/* Scratch Box — 白い罫線ノートに筆記体で書き込んだような手書きメモ帳のテーマ */
:root {
  --bg: #fbfaf6;
  --rule: #dfe7ef;           /* ノートの罫線 */
  --margin-line: #f0a4a4;    /* 左の赤い余白線 */
  --panel: #ffffff;
  --panel-solid: #ffffff;
  --panel-2: #f6f4ee;
  --line: #e7e3d8;
  --line-strong: #3a3f4b;    /* ペンで引いた線 */
  --text: #2a2e38;           /* 黒インク */
  --muted: #858a96;
  --accent: #2f5ea8;         /* 青インク */
  --accent-ink: #ffffff;
  --cyan: #2f5ea8;
  --marker: #fff09a;         /* 蛍光ペン */
  --danger: #d2423f;         /* 赤ペン */
  --paper: #f7f6f1;
  --radius: 14px;
  --wobble: 255px 14px 225px 14px / 14px 225px 14px 255px;  /* 手で描いたような少し歪んだ角 */
  --wobble-2: 14px 225px 14px 255px / 255px 14px 225px 14px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --script: 'Homemade Apple', 'Segoe Script', cursive;
  --hand: 'Caveat', 'Segoe Print', cursive;
  --mono: var(--hand);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background:
    repeating-linear-gradient(180deg, transparent 0 31px, var(--rule) 31px 32px),
    var(--bg);
  color: var(--text);
  font: 14px/1.6 'Klee One', 'Zen Kaku Gothic New', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

body { overflow-x: hidden; }

/* ---------- hero（ノートの1ページ目。左に赤い余白線、タイトルは筆記体） ---------- */
.hero {
  position: relative;
  aspect-ratio: 1128 / 208;
  min-height: 140px;
  overflow: hidden;
  border-bottom: 1.5px dashed #c9c4b6;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 0 30px, var(--margin-line) 30px 31.5px, transparent 31.5px 35px, var(--margin-line) 35px 36px, transparent 36px),
    repeating-linear-gradient(180deg, transparent 0 31px, var(--rule) 31px 32px),
    #fffefb;
}
.hero-inner {
  position: relative;
  z-index: 1;
  height: 100%;
  padding: 20px 40px 18px 64px;
  display: flex;
  align-items: flex-end;
}
.dot-live { display: none; }
.title {
  position: relative;
  margin: 0;
  line-height: 1.5;
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(26px, 3vw, 42px);
  letter-spacing: .01em;
  color: var(--text);
  transform: rotate(-2deg);
  transform-origin: left bottom;
}
.title em { font-style: normal; color: var(--accent); }
/* タイトルの下にペンでさっと引いた波線 */
.title::after {
  content: '';
  position: absolute;
  left: 2%; right: -4%; bottom: -2px;
  height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 12' preserveAspectRatio='none'%3E%3Cpath d='M2 8 C 40 2, 70 11, 110 6 S 190 2, 230 7 S 280 9, 298 4' fill='none' stroke='%23f0a4a4' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
.top-actions { position: absolute; z-index: 2; top: 20px; right: 24px; display: flex; gap: 8px; }
/* 右側に雑誌から破り取った写真を貼ったコラージュ。上はマスキングテープで留める */
.collage {
  position: absolute;
  z-index: 1;
  right: clamp(215px, 19vw, 320px);
  top: 50%;
  height: 86%;
  aspect-ratio: 760 / 557;
  transform: translateY(-50%) rotate(3.5deg);
  pointer-events: none;
}
.collage img { width: 100%; height: 100%; display: block; filter: drop-shadow(0 3px 4px rgba(60, 50, 30, .22)) drop-shadow(0 10px 18px rgba(60, 50, 30, .10)); }
.collage::before, .collage::after {
  content: '';
  position: absolute;
  width: 26%;
  height: 13%;
  background: rgba(240, 214, 140, .62);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}
.collage::before { left: 34%; top: -2%; transform: rotate(-6deg); }
.collage::after { right: -6%; bottom: 10%; transform: rotate(-58deg); background: rgba(168, 205, 226, .62); }
.boot .collage { animation: paste .9s var(--ease) both .3s; }
@keyframes paste {
  from { opacity: 0; transform: translateY(-46%) rotate(9deg) scale(1.06); }
  to { opacity: 1; transform: translateY(-50%) rotate(3.5deg); }
}
/* 読み込み時の登場 */
.boot .title { animation: write 1.1s var(--ease) both; }
.boot .top-actions { animation: rise .9s var(--ease) both .25s; }
@keyframes write {
  from { opacity: 0; clip-path: inset(0 100% 0 0); }
  to { opacity: 1; clip-path: inset(0 -10% -20% 0); }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ---------- buttons（ペンで囲んだような枠） ---------- */
.btn {
  border: 1.5px solid var(--line-strong);
  background: #fff;
  border-radius: var(--wobble);
  padding: 7px 16px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease), opacity .25s;
}
.btn:hover:not(:disabled) { background: var(--marker); transform: translateY(-1px) rotate(-.6deg); }
.btn:active:not(:disabled) { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.sm { padding: 6px 10px; border-radius: var(--wobble-2); }
.btn.wide { width: 100%; }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn.danger:hover:not(:disabled) { background: #fde3e2; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.btn.primary:hover:not(:disabled) { background: #244c8b; }
.btn:focus-visible, .tile:focus-visible, .sec-h:focus-visible, .chip:focus-visible, .seg:focus-visible, .sw:focus-visible, .tool:focus-visible {
  outline: 2px dashed var(--accent);
  outline-offset: 2px;
}

/* ---------- layout（ステージ｜書き込み・調整｜アイテム一覧） ---------- */
.app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(300px, 25vw, 400px);
  min-height: 100vh;
}
.stage-area {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 16px;
  padding: 20px 20px 32px;
  min-width: 0;
}
.stage-col {
  flex: 0 1 auto;
  width: min(calc(100vh - 110px), 820px);
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
/* ステージの隣に「書き込み」と「調整」を縦に並べる */
.tools-col {
  flex: none;
  width: 280px;
  display: grid;
  gap: 12px;
  align-content: start;
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  scrollbar-width: thin;
}

/* マネキンのステージは正方形。ノートに貼った写真のように */
.stage-card {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 0 #e9e5da, 0 14px 30px rgba(60, 50, 30, .12), 0 0 0 1px #e4e0d4;
}
.boot .stage-card { animation: materialize .9s var(--ease) both .1s; }
@keyframes materialize {
  0% { opacity: 0; transform: translateY(8px) rotate(-.4deg); }
  100% { opacity: 1; transform: none; }
}
#stage { display: block; width: 100%; height: 100%; touch-action: none; user-select: none; }
#stage.tool-arrow, #stage.tool-text { cursor: crosshair; }
.sel-box { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-dasharray: 6 5; vector-effect: non-scaling-stroke; animation: march 1s linear infinite; }
@keyframes march { to { stroke-dashoffset: -11; } }
.handle { fill: #fff; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; cursor: grab; }

/* 着せたときにふわっと現れる */
#layers image.develop { animation: appear .6s var(--ease) both; }
@keyframes appear {
  0% { opacity: 0; }
  100% { opacity: 1; }
}
#notes .note { cursor: move; }
#notes .note.new { animation: appear .4s var(--ease) both; }

/* 上の2隅はマスキングテープで留めた感じ */
.hud { position: absolute; inset: 0; pointer-events: none; }
.hud .c { position: absolute; width: 92px; height: 24px; background: rgba(240, 214, 140, .55); box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.hud .tl { top: 8px; left: -18px; transform: rotate(-35deg); }
.hud .tr { top: 8px; right: -18px; transform: rotate(35deg); background: rgba(168, 205, 226, .55); }
.hud .bl, .hud .br, .scan { display: none; }
.hud-label {
  position: absolute; top: 12px; left: 64px;
  display: flex; align-items: center;
  font-family: var(--hand); font-size: 20px; line-height: 1;
  color: var(--muted);
  transform: rotate(-2deg);
}
.note-input {
  position: absolute; z-index: 5;
  min-width: 160px;
  padding: 6px 10px;
  border-radius: var(--wobble-2);
  border: 1.5px solid var(--line-strong);
  background: #fffef6;
  color: var(--text);
  font: 14px 'Klee One', sans-serif;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .1);
  outline: none;
  transform: translate(-4px, -50%);
}

.stage-tools { position: absolute; right: 14px; top: 40px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.chip {
  border: 1.5px solid var(--line-strong);
  border-radius: var(--wobble);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, .92);
  transition: transform .25s var(--ease), background .25s var(--ease);
}
.chip:hover { background: var(--marker); transform: translateX(-2px) rotate(-1deg); }
.chip.off { opacity: .55; text-decoration: line-through; text-decoration-color: var(--danger); }
.boot .chip { animation: slide-in .7s var(--ease) both; }
.boot .chip:nth-child(1) { animation-delay: .45s; }
.boot .chip:nth-child(2) { animation-delay: .52s; }
.boot .chip:nth-child(3) { animation-delay: .59s; }
.boot .chip:nth-child(4) { animation-delay: .66s; }
@keyframes slide-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

/* 着用中アイテムの一覧 */
.strip {
  width: 100%;
  display: flex;
  gap: 8px;
  padding: 10px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1.5px dashed #cfc9ba;
  overflow-x: auto;
  min-height: 70px;
  align-items: center;
}
.strip-empty { margin: 0 8px; color: var(--muted); font-size: 12px; }
.pill {
  position: relative;
  flex: none;
  width: 48px; height: 48px;
  border-radius: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.boot .pill { animation: pop .45s var(--ease) both .6s; }
@keyframes pop { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: none; } }
.pill img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.pill:hover { transform: translateY(-2px) rotate(-2deg); }
.pill.on { box-shadow: 0 0 0 2px var(--accent); background: var(--marker); }
.pill.dim { opacity: .35; }
.pill-x {
  position: absolute; top: -6px; right: -6px;
  width: 18px; height: 18px; border-radius: 50%;
  border: 0; padding: 0; font-size: 12px; line-height: 18px;
  background: var(--danger); color: #fff;
  opacity: 0; transition: opacity .2s;
}
.pill:hover .pill-x, .pill.on .pill-x { opacity: 1; }

/* 右側のツール列（白い付箋のようなカード） */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 2px 0 #ece8dd, 0 8px 20px rgba(60, 50, 30, .06);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.boot .panel { animation: rise .7s var(--ease) both .4s; }
.panel-title { display: flex; align-items: baseline; justify-content: space-between; font-weight: 700; }
.panel-title span { font-size: 15px; box-shadow: inset 0 -.45em 0 var(--marker); }
.panel-title small { color: var(--muted); font-weight: 400; font-size: 11px; }
.tool-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tool {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 8px;
  border-radius: var(--wobble);
  border: 1.5px solid var(--line-strong);
  background: #fff;
  font-size: 13px; font-weight: 700;
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.tool:hover { background: var(--marker); transform: translateY(-1px); }
.tool.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tool-ico { font-family: var(--hand); font-size: 20px; line-height: 1; }
.note-colors { display: flex; gap: 8px; }
.adjust-empty { margin: 0; color: var(--muted); font-size: 12px; text-align: center; padding: 18px 14px; border: 1.5px dashed #cfc9ba; box-shadow: none; background: rgba(255, 255, 255, .7); }
.adjust { animation: panel-in .4s var(--ease) both; }
@keyframes panel-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.adj-head { display: flex; gap: 10px; align-items: center; }
.adj-head img { width: 52px; height: 52px; border-radius: 6px; background: var(--paper); border: 1px solid var(--line); object-fit: contain; padding: 4px; }
.adj-cat { font-family: var(--hand); color: var(--accent); font-size: 17px; line-height: 1.1; }
.adj-name { font-weight: 700; }
.adj-sec { display: flex; flex-direction: column; gap: 8px; padding-bottom: 12px; border-bottom: 1.5px dashed var(--line); }
.adj-label { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .04em; }
.segs { display: flex; flex-wrap: wrap; gap: 4px; }
.seg {
  border: 1.5px solid var(--line-strong); background: #fff;
  border-radius: var(--wobble-2); padding: 4px 9px; font-size: 12px;
  transition: background .2s var(--ease);
}
.seg:hover { background: var(--marker); }
.seg.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.swatches { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.sw {
  aspect-ratio: 1; border-radius: 50%; padding: 0;
  border: 1.5px solid rgba(42, 46, 56, .35);
  transition: transform .2s var(--ease);
}
.note-colors .sw { width: 24px; }
.sw:hover { transform: scale(1.15); }
.sw.orig { background: linear-gradient(135deg, #fff 45%, var(--danger) 45% 55%, #fff 55%); }
.sw.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent); }
.adj-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.adj-hint { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.slider { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; font-size: 12px; color: var(--muted); }
.slider output { color: var(--accent); font-family: var(--hand); font-size: 17px; line-height: 1; }
.slider input { grid-column: 1 / -1; width: 100%; accent-color: var(--accent); }

/* ---------- 一覧（右半分） ---------- */
.side {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 16px 14px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-left: 1.5px dashed #cfc9ba;
  background: rgba(255, 254, 250, .82);
}
.sec {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 2px 0 #ece8dd;
  transition: border-color .3s var(--ease);
}
.sec:hover { border-color: #cfc9ba; }
.boot .sec { animation: rise .7s var(--ease) both; animation-delay: calc(.2s + var(--si, 0) * 60ms); }
.sec-h {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 0;
  background: none;
  font-weight: 700;
  text-align: left;
}
.sec-h .idx { font-family: var(--hand); font-size: 17px; line-height: 1; color: var(--danger); }
.ico { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; opacity: .8; }
.chev { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .35s var(--ease); }
.sec-h .chev { margin-left: 4px; }
.sec.closed .sec-h .chev { transform: rotate(180deg); }
.sec.closed .sec-b { display: none; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.multi { color: var(--muted); font-weight: 400; font-size: 11px; }
.count { margin-left: auto; color: var(--muted); font-family: var(--hand); font-size: 16px; line-height: 1; font-weight: 400; }
.sec-b { padding: 0 10px 10px; }
.empty, .note-inline { color: var(--muted); font-size: 12px; margin: 0 2px 4px; }
.note-inline { color: var(--danger); margin-bottom: 8px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
.tile {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 6px;
  background: var(--paper);
  border: 0;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.boot .tile { animation: rise .6s var(--ease) both; animation-delay: calc(.35s + var(--i, 0) * 25ms); }
.tile:hover { transform: translateY(-3px) rotate(-1.5deg); box-shadow: 0 10px 18px rgba(60, 50, 30, .16), 0 0 0 1.5px var(--line-strong); }
.tile img { width: 100%; height: 100%; object-fit: contain; padding: 10%; display: block; transition: transform .5s var(--ease); }
.tile:hover img { transform: scale(1.06); }
.tile.on { background: var(--marker); box-shadow: 0 0 0 2px var(--accent); }
.tile .check {
  position: absolute; left: 5px; bottom: 5px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 10px; font-style: normal; font-weight: 700;
  background: var(--accent); color: #fff;
  transform: rotate(-4deg);
  display: none;
}
.tile .check::after { content: '着用中'; }
.tile.on .check { display: block; animation: pop .35s var(--ease) both; }
.tile.on .vbadge { display: none; }
.tile.add {
  background: #fff;
  border: 1.5px dashed #b9b3a3;
  color: var(--muted);
  display: grid; place-items: center;
}
.tile.add span {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1.5px solid currentColor; display: grid; place-items: center; font-size: 16px;
  transition: transform .35s var(--ease), color .35s var(--ease);
}
.tile.add:hover { color: var(--accent); }
.tile.add:hover span { transform: rotate(90deg); }
.mine {
  position: absolute; left: 6px; top: 6px;
  font-family: var(--hand); font-size: 14px; line-height: 1.1;
  padding: 0 5px; border-radius: 4px;
  background: #fff; color: var(--danger);
}
.vbadge {
  position: absolute; left: 6px; bottom: 6px;
  font-size: 9px; font-weight: 700;
  padding: 1px 5px; border-radius: 4px;
  background: rgba(42, 46, 56, .78); color: #fff;
}
.tile-x {
  position: absolute; right: 5px; top: 5px; z-index: 1;
  width: 20px; height: 20px; border-radius: 50%;
  border: 0; padding: 0; line-height: 20px; font-size: 13px;
  background: var(--danger); color: #fff;
  opacity: 0; transition: opacity .2s;
}
.tile:hover .tile-x, .tile:focus-within .tile-x { opacity: 1; }
.grid.looks .tile { background: #fff; border: 1px solid var(--line); }
.grid.looks .tile img { padding: 0; object-fit: cover; }
.look-name {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  font-size: 10px; padding: 3px 6px;
  background: rgba(255, 255, 255, .88); color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.more {
  width: 100%;
  margin-top: 8px;
  display: flex; align-items: center; justify-content: space-between;
  border: 0; background: none; color: var(--muted);
  padding: 6px 4px; font-size: 12px;
}
.more .chev { transform: rotate(180deg); }
.more:hover { color: var(--accent); }

/* ---------- modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(42, 46, 56, .35);
  backdrop-filter: blur(4px);
  display: grid; place-items: center;
  padding: 16px;
  animation: fade .3s var(--ease) both;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  width: min(780px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  background:
    repeating-linear-gradient(180deg, transparent 0 31px, var(--rule) 31px 32px),
    #fffefb;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 30px 70px rgba(42, 46, 56, .25);
  animation: rise .5s var(--ease) both;
}
.sheet-h { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1.5px dashed var(--line); background: #fffefb; }
.sheet-h h2 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: .04em; box-shadow: inset 0 -.45em 0 var(--marker); }
.x { margin-left: auto; border: 0; background: none; font-size: 22px; line-height: 1; color: var(--muted); }
.x:hover { color: var(--danger); }
.sheet-b { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 20px; }
.sheet-f { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1.5px dashed var(--line); background: #fffefb; }
.drop {
  min-height: 340px;
  border-radius: 10px;
  border: 1.5px dashed #b9b3a3;
  display: grid; place-items: center;
  cursor: pointer;
  background-color: #f1f1f1;
  background-image:
    linear-gradient(45deg, #e2e2e2 25%, transparent 25%, transparent 75%, #e2e2e2 75%),
    linear-gradient(45deg, #e2e2e2 25%, transparent 25%, transparent 75%, #e2e2e2 75%);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
  overflow: hidden;
  transition: border-color .25s var(--ease);
}
.drop.over { border-color: var(--accent); }
.drop canvas { max-width: 100%; max-height: 420px; display: block; }
.drop-msg { text-align: center; color: #444; font-size: 13px; background: rgba(255, 255, 255, .92); padding: 16px 20px; border-radius: 12px; }
.drop-plus { font-size: 26px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form label:not(.slider) { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.form label.chk { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 13px; }
.form input:not([type]), .form select {
  background: #fff;
  border: 0;
  border-bottom: 1.5px solid var(--line-strong);
  color: var(--text);
  border-radius: 0;
  padding: 8px 4px;
  font: inherit;
}
.form input:not([type]):focus, .form select:focus { outline: none; border-color: var(--accent); background: #fffdf0; }
.form select option { background: #fff; }
.form input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }
.note { margin: 0; color: var(--muted); font-size: 12px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 60;
  background: #fffef6;
  border: 1.5px solid var(--line-strong);
  color: var(--text);
  padding: 10px 18px; border-radius: var(--wobble); font-size: 13px;
  box-shadow: 0 10px 24px rgba(42, 46, 56, .18);
  animation: toast-in .4s var(--ease) both;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  /* 幅が足りないときは書き込み・調整をステージの下へ */
  .stage-area { flex-direction: column; align-items: center; }
  .stage-col { width: min(100%, calc(100vh - 110px)); }
  .tools-col { position: static; max-height: none; width: min(100%, calc(100vh - 110px)); grid-template-columns: 1fr 1fr; align-items: start; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .hero-inner { padding: 12px 16px 14px 52px; }
  .title { font-size: 26px; }
  .top-actions { top: 14px; right: 16px; }
  .collage { right: 14px; height: 52%; top: 68%; }
  .stage-area { padding: 16px 16px 16px; }
  .stage-col, .tools-col { width: 100%; grid-template-columns: 1fr; }
  .side { position: static; height: auto; overflow: visible; padding: 16px; border-left: 0; border-top: 1.5px dashed #cfc9ba; }
  .sheet-b { grid-template-columns: 1fr; }
  .drop { min-height: 240px; }
  .grid { grid-template-columns: repeat(4, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
