:root{
  --bg:#fff7fb; --panel:#fff; --line:#f2bfd5; --text:#5b4963; --muted:#927e9b;
  --pink:#ff8fbe; --pink2:#ff6ea9; --sky:#76cfff; --yellow:#ffe17a; --mint:#aeeccb;
}
*{box-sizing:border-box}
body{
  margin:0;
  font-family:system-ui,-apple-system,"Segoe UI","Hiragino Kaku Gothic ProN","Yu Gothic",sans-serif;
  color:var(--text);
  background:
    radial-gradient(circle,#ffe2ef 0 4px,transparent 5px) 0 0/44px 44px,
    linear-gradient(#fffafd,#fff4fa);
}
button,select,input{font:inherit}
button{user-select:none}
.app{
  min-height:100vh;
  display:grid;
  grid-template-columns:300px minmax(420px,1fr) 310px;
  gap:18px;
  padding:18px;
}
.panel{
  background:var(--panel);
  border:2px solid var(--line);
  border-radius:26px;
  padding:18px;
  box-shadow:0 14px 34px rgba(255,110,169,.11);
}
.hero{display:flex;gap:12px;align-items:center;margin-bottom:14px}
.logo{
  width:58px;height:58px;border-radius:19px;display:grid;place-items:center;font-size:31px;
  background:linear-gradient(135deg,#ff9bc5,#d8c7ff);
  box-shadow:0 8px 18px rgba(255,110,169,.18)
}
h1{font-size:24px;margin:0}
.sub{font-size:13px;color:var(--muted);line-height:1.55;margin-top:3px}
.tip{
  background:#fff8d9;border:2px dashed #ffd468;border-radius:18px;
  padding:11px 13px;font-size:13px;line-height:1.65;color:#766345
}
.section{margin:18px 0}
.section h2{
  margin:0 0 10px;font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:#9c7ca9
}
.row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.grow{flex:1}
button,select,input[type="color"]{
  min-height:46px;border:2px solid var(--line);border-radius:17px;
  background:#fff;color:var(--text);padding:9px 13px
}
button{
  cursor:pointer;font-weight:750;box-shadow:0 4px 0 rgba(242,191,213,.75);
  transition:.12s transform,.12s box-shadow,.12s background
}
button:hover{transform:translateY(-1px)}
button:active{transform:translateY(2px);box-shadow:0 2px 0 rgba(242,191,213,.75)}
button.active{
  color:#fff;background:linear-gradient(#ff91bd,#ff6ea9);border-color:#ff78ae;
  box-shadow:0 4px 0 rgba(255,110,169,.26)
}
button.secondary{background:#fff8fc}
button.danger-soft{background:#fff5f5;color:#a75a69}
button:disabled{opacity:.45;cursor:default;transform:none}
.tools,.samples{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.tools button{min-height:54px}
.samples button{
  min-height:54px;background:#fff9fd;font-size:15px
}
.palette{display:grid;grid-template-columns:repeat(6,1fr);gap:8px}
.swatch{
  aspect-ratio:1;border-radius:13px;border:3px solid transparent;cursor:pointer;
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.07)
}
.swatch.active{border-color:#5b4963;outline:2px solid #fff}
.mode-switch{
  display:grid;grid-template-columns:1fr 1fr;gap:7px;padding:5px;
  background:#fff4fa;border:2px solid #f5d2e1;border-radius:20px
}
.mode-switch button{box-shadow:none;border:0;min-height:50px}
.mode-switch button:not(.active){background:transparent}
.stage-wrap{display:flex;align-items:flex-start;justify-content:center;min-width:0}
.stage{
  width:min(calc(100vh - 36px),100%);max-width:800px;aspect-ratio:1;
  background:#fff;border:2px solid var(--line);border-radius:32px;padding:18px;
  box-shadow:0 18px 42px rgba(255,110,169,.12);position:relative
}
.bubble{
  position:absolute;z-index:2;left:18px;top:-12px;background:#fff;
  border:2px solid var(--line);border-radius:999px;padding:8px 14px;
  font-size:13px;font-weight:750;box-shadow:0 5px 12px rgba(255,110,169,.08)
}
canvas{
  width:100%;height:100%;display:block;background:#fff;border-radius:18px;
  image-rendering:auto;touch-action:none;cursor:crosshair
}
.toggle{
  display:flex;justify-content:space-between;gap:10px;align-items:center;
  padding:9px 0;border-bottom:1px dashed #f0d8e3;font-size:14px
}
.toggle:last-child{border-bottom:0}
.range-line{display:grid;grid-template-columns:1fr 48px;gap:8px;align-items:center}
input[type="range"]{width:100%;accent-color:var(--pink2)}
.value,.mini{font-size:12px;color:var(--muted)}
.mini{line-height:1.65}
.primary{
  width:100%;color:#fff;background:linear-gradient(#84d8ff,#5dc4ff);
  border-color:#69caff;box-shadow:0 4px 0 rgba(93,196,255,.28)
}
.autosave{
  display:inline-flex;align-items:center;gap:6px;margin-top:9px;padding:6px 9px;
  background:#effbf5;border-radius:999px;color:#628273;font-size:11px
}
.autosave::before{content:"●";font-size:8px;color:#55c58a}
.stipple-note{
  padding:13px;background:#f4fbff;border:2px dashed #a9dcf5;border-radius:17px;
  color:#6b8290;font-size:13px;line-height:1.6
}
.hidden{display:none!important}
.toast{
  position:fixed;left:50%;bottom:24px;transform:translateX(-50%) translateY(20px);
  background:#5b4963;color:#fff;padding:11px 18px;border-radius:999px;
  font-weight:750;font-size:14px;opacity:0;pointer-events:none;transition:.2s;z-index:20
}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
/* 画面固定：ページ全体はスクロールせず、左右パネルの中だけスクロール */
@media(min-width:1061px){
  body{overflow:hidden}
  .app{height:100vh;min-height:0}
  .panel{overflow-y:auto;overscroll-behavior:contain;min-height:0}
  .stage-wrap{align-items:center;min-height:0}
  .stage{width:min(calc(100vh - 40px),100%)}
}
@media(max-width:1060px){
  .app{grid-template-columns:1fr}
  .stage-wrap{order:-1;padding-top:10px}
  .stage{width:min(92vw,760px);position:relative;top:auto}
}


/* v0.7: 3つの描画モード */
.mode-switch.mode-switch-3{
  grid-template-columns:repeat(3,1fr);
}
.mode-switch.mode-switch-3 button{
  min-width:0;
  padding:8px 6px;
  font-size:12px;
  line-height:1.25;
}
@media(max-width:420px){
  .mode-switch.mode-switch-3{
    grid-template-columns:1fr;
  }
}


/* v0.8: 今日の技法 */
.today-card{
  background:#fff8fd;
  border:2px solid #f4d7e5;
  border-radius:20px;
  padding:12px;
}
.today-top{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:flex-start;
}
.today-name{
  font-size:18px;
  font-weight:800;
  line-height:1.3;
  color:#5b4963;
}
.today-badge{
  display:inline-block;
  margin-top:5px;
  padding:4px 9px;
  border-radius:999px;
  font-size:11px;
  font-weight:700;
  background:#fff1f7;
  border:1px solid #f4c8da;
  color:#a46685;
}
.today-desc{
  margin-top:10px;
  font-size:13px;
  line-height:1.65;
  color:#7a667f;
}
.today-mission-box{
  margin-top:10px;
  padding:10px;
  background:#fffef5;
  border:2px dashed #ffe08a;
  border-radius:16px;
}
.today-label{
  font-size:11px;
  letter-spacing:.06em;
  color:#b38d3f;
  font-weight:800;
  margin-bottom:4px;
}
.today-mission{
  font-size:13px;
  line-height:1.6;
  color:#766345;
}
.mini-btn{
  min-height:36px;
  padding:6px 10px;
  border-radius:14px;
  font-size:12px;
  background:#fff;
}
