:root{
  /* Hugofolio Motion Tokens: 5 timings + 3 curves */
  --m-press:90ms;
  --m-fast:160ms;
  --m-base:240ms;
  --m-move:320ms;
  --m-grow:420ms;
  --e-grow:cubic-bezier(.2,.8,.2,1);
  --e-sheet:cubic-bezier(.32,.72,0,1);
  --e-sweep:cubic-bezier(.4,0,.2,1);

  /* Nail Atelier Editorial Porcelain Palette (Preserving Signature Rose-Plum #7a5469) */
  --ink:#27202b;
  --muted:#726877;
  --accent:#7a5469;
  --accent-soft:#f5edf2;
  --surface:#ffffff;
  --sheet-bg:#fcfbf9;
  --paper:#f6f3ee;
  --stage:#f3efe8;
  --line:rgba(47,39,50,.09);
  --line-strong:rgba(47,39,50,.15);
  --ghost-hover:rgba(122,84,105,.08);
  --track-bg:rgba(47,39,50,.055);
  --chrome-glass:rgba(252,250,247,.78);
  --surface-glass:rgba(255,255,255,.88);
  --fav-btn-bg:rgba(255,255,255,.84);
  --shadow:0 20px 56px rgba(40,26,38,.12);
  --shadow-soft:0 8px 26px rgba(40,26,38,.07);
  --shadow-xs:0 1px 2px rgba(40,26,38,.04);

  /* Material #1: Hugofolio 4-Layer Liquid Glass (Strictly Reserved for Hero CTAs) */
  --g-bg:linear-gradient(148deg,rgba(148,103,129,.90) 0%,rgba(122,84,105,.96) 54%,rgba(98,64,84,.98) 100%);
  --g-bg-hover:linear-gradient(148deg,rgba(162,115,142,.95) 0%,rgba(134,92,116,.98) 54%,rgba(108,71,93,1) 100%);
  --g-hl:linear-gradient(140deg,rgba(255,255,255,.34),rgba(255,255,255,.04) 46%,rgba(255,255,255,.14));
  --g-edge:rgba(255,255,255,.26);
  --g-shadow:
    0 1px 3px rgba(48,26,40,.14),
    0 8px 20px rgba(92,56,78,.22),
    inset 0 0 0 1px var(--g-edge),
    inset 0 1.5px 1px rgba(255,255,255,.52),
    inset 0 -6px 12px rgba(42,20,34,.18),
    inset 3px 3px .5px -3.5px rgba(255,255,255,.75),
    inset -3px -3px .5px -3.5px rgba(255,255,255,.45);
  --g-shadow-hover:
    0 2px 5px rgba(48,26,40,.18),
    0 12px 26px rgba(92,56,78,.28),
    inset 0 0 0 1px rgba(255,255,255,.36),
    inset 0 1.5px 1px rgba(255,255,255,.64),
    inset 0 -6px 12px rgba(42,20,34,.2);

  font-family:Inter,-apple-system,BlinkMacSystemFont,"Noto Sans TC","PingFang TC","Microsoft JhengHei",sans-serif;
  font-size:16px;
  color:var(--ink);
  background:var(--sheet-bg);
}

/* Boot Guard: suppress first-load transitions for 2 painted frames */
html.boot.boot *,html.boot.boot *::before,html.boot.boot *::after{
  transition:none !important;
  animation:none !important;
}

/* View Transition Discipline: instant element swap under VT + pause ambient animations */
html[data-vt-kind] *,html[data-vt-kind] *::before,html[data-vt-kind] *::after{
  transition-duration:0s !important;
  transition-delay:0s !important;
}
html[data-vt-pause] *,html[data-vt-pause] *::before,html[data-vt-pause] *::after{
  animation-play-state:paused !important;
}

@keyframes vtOut{to{opacity:0}}
@keyframes vtIn{from{opacity:0}}
@keyframes modalEnter{from{opacity:0;transform:translate3d(0,12px,0)}}
@keyframes modalBackdropIn{from{opacity:0}}

html[data-vt="theme-fade"]::view-transition-group(root){animation-duration:280ms;animation-timing-function:var(--e-sweep)}
html[data-vt="theme-fade"]::view-transition-old(root){animation:vtOut 280ms var(--e-sweep) both}
html[data-vt="theme-fade"]::view-transition-new(root){animation:vtIn 280ms var(--e-sweep) both}
html[data-vt="xfade"]::view-transition-group(root){animation-duration:var(--m-base);animation-timing-function:var(--e-sweep)}
html[data-vt="xfade"]::view-transition-old(root){animation:vtOut var(--m-base) var(--e-sweep) both}
html[data-vt="xfade"]::view-transition-new(root){animation:vtIn var(--m-base) var(--e-sweep) both}
html[data-vt="fade"]::view-transition-group(root){animation-duration:150ms;animation-timing-function:ease-out}
html[data-vt="fade"]::view-transition-old(root){animation:vtOut 150ms ease-out both}
html[data-vt="fade"]::view-transition-new(root){animation:vtIn 150ms ease-out both}
html[data-vt="theme-circle"]::view-transition-group(root){animation-duration:400ms;animation-timing-function:var(--e-sheet)}

/* Fixed Frosted Chrome stays steady during canvas background crossfades */
html[data-vt="xfade"] .topbar{view-transition-name:studio-topbar}
html[data-vt="xfade"] #studio-dock{view-transition-name:studio-dock}
html[data-vt="xfade"]::view-transition-group(studio-topbar),
html[data-vt="xfade"]::view-transition-group(studio-dock){
  animation:none;z-index:10;
  backdrop-filter:blur(20px) saturate(1.7);
  -webkit-backdrop-filter:blur(20px) saturate(1.7);
}
html[data-vt="xfade"]::view-transition-old(studio-topbar),
html[data-vt="xfade"]::view-transition-new(studio-topbar),
html[data-vt="xfade"]::view-transition-old(studio-dock),
html[data-vt="xfade"]::view-transition-new(studio-dock){animation:none}

*{box-sizing:border-box}
body{margin:0;overflow:hidden;background:var(--stage);-webkit-font-smoothing:antialiased}
button,input,select{font:inherit;color:inherit}

/* Base Button + Hugofolio Standalone `scale` Press Feedback (Never Clobbers `transform`) */
button{
  cursor:pointer;border:1px solid transparent;background:none;
  display:inline-flex;justify-content:center;align-items:center;gap:6px;
  min-height:44px;border-radius:12px;padding:8px 13px;line-height:1.25;
  touch-action:manipulation;
  transition:background-color var(--m-fast) ease,color var(--m-fast) ease,border-color var(--m-fast) ease,box-shadow var(--m-fast) ease,scale var(--m-base) var(--e-sheet);
}
button:hover{background:var(--ghost-hover)}
button:not(.nail-hit):not(.swatch):not(.mini-swatch):not(.shape-card):not(.lib-card-btn):not(.layer-select-btn):not(.dock-item):not(.overview-nail):not(.moodboard-drop):not(.sample-load-card):active:not(:disabled){
  scale:.96;
  transition:background-color var(--m-fast) ease,color var(--m-fast) ease,border-color var(--m-fast) ease,scale var(--m-press) ease-out 40ms;
}
.shape-card:active:not(:disabled),.lib-card-btn:active:not(:disabled),.charm-card:active:not(:disabled),.overview-nail:active:not(:disabled),.sample-load-card:active:not(:disabled){
  scale:.98;
  transition:border-color var(--m-fast) ease,background-color var(--m-fast) ease,scale 100ms ease-out;
}
button:disabled{cursor:default;opacity:.34}
button:disabled:hover{background:none}
button svg{width:18px;height:18px;flex-shrink:0}
input,select{min-height:44px;min-width:44px}
select{
  border:1px solid var(--line-strong);background:var(--surface);border-radius:10px;
  padding:8px 34px 8px 12px;-webkit-appearance:none;appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='m3 5 4 4 4-4' fill='none' stroke='%237a5469' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position:right 12px center;background-repeat:no-repeat;
}
html[data-theme="dark"] select{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='m3 5 4 4 4-4' fill='none' stroke='%23d8b4ca' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
/* Refined Global Range Sliders (3px Hairline Track + 16px Tactile Thumb) */
input[type="range"]{
  -webkit-appearance:none;appearance:none;background:transparent;cursor:pointer;
}
input[type="range"]::-webkit-slider-runnable-track{
  height:4px;border-radius:999px;background:var(--line-strong);
}
input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance:none;appearance:none;width:16px;height:16px;border-radius:50%;
  margin-top:-6px;background:var(--accent);border:2px solid var(--surface);
  box-shadow:0 1px 4px rgba(38,24,38,.28);
  transition:transform var(--m-fast) var(--e-grow),box-shadow var(--m-fast) ease;
}
input[type="range"]:hover::-webkit-slider-thumb{transform:scale(1.12);box-shadow:0 2px 8px rgba(122,84,105,.35)}
input[type="range"]::-moz-range-track{height:4px;border-radius:999px;background:var(--line-strong);border:0}
input[type="range"]::-moz-range-thumb{
  width:16px;height:16px;border-radius:50%;background:var(--accent);
  border:2px solid var(--surface);box-shadow:0 1px 4px rgba(38,24,38,.28);
}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,[tabindex="0"]:focus-visible{
  outline:2.5px solid var(--accent);outline-offset:2px;
}
h1,h2,h3,p{margin:0}
h1,h2{font-size:18px;font-weight:600;line-height:1.35}
h3{font-size:16px;font-weight:600}
p{line-height:1.65}
strong{font-weight:600}
.mini,small{font-size:12px;color:var(--muted);line-height:1.45}
.eyebrow{font-size:11px;letter-spacing:1.8px;color:var(--muted);line-height:1.4}

/* Calm Flat Hairline Porcelain Button (Zero Glass Clutter, Zero Heavy Bevel) */
.outline{
  position:relative;
  border:1px solid var(--line-strong);
  background:var(--surface);
  color:var(--ink);
  box-shadow:var(--shadow-xs);
}
.outline:hover:not(:disabled){
  background:var(--accent-soft);
  border-color:rgba(122,84,105,.32);
}

/* Refined Satin Rose-Plum Hero CTA (Clean Porcelain Sheen, Zero Muddy Halo) */
.primary{
  position:relative;isolation:isolate;
  border:1px solid rgba(255,255,255,.22);border-radius:999px;
  background:var(--g-bg);
  color:#fff;
  box-shadow:0 2px 8px rgba(92,56,78,.22),inset 0 1px 0 rgba(255,255,255,.32);
  text-shadow:0 1px 1px rgba(42,20,34,.18);
  transition:transform var(--m-base) var(--e-grow),scale var(--m-base) var(--e-sheet),box-shadow var(--m-fast) ease,background var(--m-fast) ease;
}
.primary>*{position:relative;z-index:1}
.primary:hover:not(:disabled){
  background:var(--g-bg-hover);
  box-shadow:0 4px 14px rgba(92,56,78,.28),inset 0 1px 0 rgba(255,255,255,.42);
}
@media(hover:hover){
  .primary:hover:not(:disabled){transform:translateY(-1px)}
}
/* Crisp Dark Ink Secondary Completion Pill for Floating Action Rails */
.chip-done{
  background:var(--ink);color:var(--surface);border:1px solid transparent;
  font-weight:600;border-radius:999px;box-shadow:var(--shadow-xs);
}
.chip-done:hover:not(:disabled){background:var(--accent);color:#fff}

.full{width:100%;margin-top:12px}
.icon-btn{width:44px;height:44px;padding:10px;flex-shrink:0;border-radius:12px}
.icon-btn span{display:none}

/* Crisp Editorial Pressed State (Explicit Specificity so .outline & .stack-buttons Clearly Light Up) */
:where(button[aria-pressed=true]:not(.nail-hit):not(.swatch):not(.mini-swatch):not(.shape-card):not(.dock-item):not(.layer-select-btn):not(.lib-card-btn):not(.lib-fav-btn):not(.mini-pill):not(.primary):not(.ambience-card)),
button.outline[aria-pressed="true"]:not(.primary):not(.stage-layers-btn):not(.ambience-card),
.stack-buttons button[aria-pressed="true"],
.pill-btn[aria-pressed="true"],
.brush-card[aria-pressed="true"]{
  background:var(--accent-soft);color:var(--accent);border-color:rgba(122,84,105,.46);
  box-shadow:inset 0 0 0 1px rgba(122,84,105,.18);font-weight:600;
}
html[data-theme="dark"] button.outline[aria-pressed="true"]:not(.primary):not(.stage-layers-btn):not(.ambience-card),
html[data-theme="dark"] .pill-btn[aria-pressed="true"],
html[data-theme="dark"] .brush-card[aria-pressed="true"]{
  background:rgba(204,160,185,.22);color:#f3dce9;border-color:rgba(204,160,185,.56);
}

/* App Shell */
#app{height:100dvh;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:68px minmax(0,1fr);overflow:hidden}
.boot{display:grid;place-content:center;height:100dvh;color:var(--accent);letter-spacing:2px}

/* Material #3 (Surface 1/3): Minimal Frosted Topbar — Zero Bubble Overload */
.topbar{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:6px 18px;
  background:var(--chrome-glass);
  backdrop-filter:blur(20px) saturate(1.7);
  -webkit-backdrop-filter:blur(20px) saturate(1.7);
  border-bottom:1px solid var(--line);
  z-index:5;
}
.top-left{display:flex;align-items:center;gap:4px;min-width:0;flex:1}
.brand-monogram{font:italic 32px Georgia,serif;color:var(--accent);line-height:1;padding-right:6px;flex-shrink:0;letter-spacing:-.5px}
.brand-monogram span{color:#b994a9}
.project-name{
  font-size:14.5px;font-weight:600;min-width:44px;min-height:44px;padding:6px 8px;
  justify-content:flex-start;max-width:196px;border-radius:10px;
}
.project-name>span{display:block;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}

/* Clean Architectural Segmented Controls (No Double-Bevel Noise) */
.top-center{display:flex;align-items:center;gap:8px;flex-shrink:0}
.hand-switch,.mode-switch{
  display:inline-flex;align-items:center;gap:2px;padding:3px;
  background:var(--track-bg);
  border:1px solid var(--line);border-radius:999px;
}
.hand-switch button,.mode-switch button{
  min-height:44px;padding:6px 12px;border-radius:999px;font-size:13px;font-weight:500;
  color:var(--muted);border-color:transparent;background:transparent;
}
.hand-switch button:hover,.mode-switch button:hover{color:var(--ink);background:transparent}
.hand-switch button[aria-pressed=true],.mode-switch button[aria-pressed=true]{
  background:var(--surface);color:var(--ink);border-color:transparent;
  box-shadow:0 1px 3px rgba(38,24,38,.09),0 0 0 1px var(--line);font-weight:600;
}
.hand-dots{display:inline-flex;align-items:center;gap:3px;margin-left:5px}
.hand-dots i{width:6.5px;height:6.5px;border-radius:50%;border:1px solid rgba(0,0,0,.14);display:inline-block}

/* Frameless Ghost Utility Icons + Quiet Save + Hero Liquid Glass Export */
.top-actions{display:flex;align-items:center;gap:4px;flex-shrink:0}
.top-actions>.icon-btn,.top-left>.icon-btn{
  border:0;background:transparent;box-shadow:none;color:var(--muted);border-radius:10px;
}
.top-actions>.icon-btn:hover:not(:disabled),.top-left>.icon-btn:hover:not(:disabled){
  background:var(--ghost-hover);color:var(--ink);
}
.top-actions>.icon-btn[aria-pressed=true]{
  background:var(--accent-soft);color:var(--accent);
}
.top-actions>.primary{border-radius:999px;padding:8px 18px;font-size:14px;font-weight:600;margin-left:4px}
.save-area{display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:80px}
.save-btn{
  min-height:44px;padding:6px 10px;color:var(--accent);font-size:13px;font-weight:600;
  border-radius:10px;border:0;background:transparent;box-shadow:none;
}
.save-btn:hover:not(:disabled){background:var(--ghost-hover)}
#save-status{font-size:10.5px;line-height:1.1;white-space:nowrap;color:var(--muted);margin-top:1px;letter-spacing:.2px}
#save-status[data-state=error]{color:#a6334f}
.top-preview,.top-tpl-btn{
  font-size:13px;font-weight:500;padding:8px 12px;border-radius:999px;
  border:1px solid var(--line-strong);background:var(--surface);box-shadow:var(--shadow-xs);
  white-space:nowrap;flex-shrink:0;
}
.top-tpl-btn[aria-pressed=true]{background:var(--accent-soft);border-color:rgba(122,84,105,.38);color:var(--accent)}
.batch-quick-bar{margin-bottom:2px}
.ten-set-card.is-previewing{border-color:var(--accent);box-shadow:0 0 0 2px var(--accent-soft)}

/* Workspace Layout (Resizable Split Between Stage & Control Sheet, Viewport-Clamped) */
.workspace{display:grid;grid-template-columns:minmax(0,1fr) min(var(--sheet-w,320px),48vw);min-height:0;position:relative;overflow:hidden}
.workspace.panel-closed{grid-template-columns:minmax(0,1fr)}
.workspace.panel-left{grid-template-columns:min(var(--sheet-w,320px),48vw) minmax(0,1fr)}
.workspace.panel-left .studio-sheet{grid-column:1;grid-row:1;border-left:0;border-right:1px solid var(--line)}
.workspace.panel-left .stage{grid-column:2;grid-row:1}
.workspace.panel-left.panel-closed{grid-template-columns:minmax(0,1fr)}
.workspace.panel-left.panel-closed .stage{grid-column:1}
.workspace.is-resizing{user-select:none;-webkit-user-select:none}
.workspace.is-resizing .stage,.workspace.is-resizing .studio-sheet{pointer-events:none}

/* Material #2: Fine Static Cotton-Linen / Neutral Stone / Obsidian Velvet Stage Canvas */
.stage{
  min-width:0;min-height:0;position:relative;display:flex;flex-direction:column;
  padding:14px 24px 92px;overflow:hidden;background:var(--stage);
}
.bg-light{
  background:radial-gradient(ellipse 84% 68% at 50% 42%,#faf8f4 0%,#f0ebe3 100%);
}
.bg-light::before,.bg-stone::before{
  content:"";position:absolute;inset:0;pointer-events:none;z-index:0;opacity:.036;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-repeat:repeat;background-size:160px 160px;
}
.bg-stone{
  background:radial-gradient(ellipse 84% 68% at 50% 42%,#e8e5e0 0%,#dad6cf 100%);
  color:#27202b;
}
.bg-dark{
  background:radial-gradient(ellipse 80% 65% at 50% 42%,#2d2834 0%,#1f1c25 100%);
  color:#f4eef5;
}
.bg-dark::before{
  content:"";position:absolute;inset:0;pointer-events:none;z-index:0;opacity:.045;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-repeat:repeat;background-size:160px 160px;
}
.bg-dark .board-dir,.bg-dark .direction,.bg-dark .drag-tip,.bg-dark .slot-meta,.bg-dark .slot-index{color:#bfb5c7}
.bg-dark .stage-bar .outline,.bg-dark .zoom-controls{
  background:rgba(42,36,50,.82);border-color:rgba(255,255,255,.15);color:#f3edf5;
}
.bg-dark .stage-bar .outline:hover:not(:disabled){
  background:rgba(204,160,185,.2);border-color:rgba(204,160,185,.46);color:#fff;
}
.bg-dark .stage-bar .outline[aria-pressed="true"]:not(.stage-layers-btn){
  background:rgba(204,160,185,.26);border-color:rgba(204,160,185,.56);color:#f7e2ef;
}
.bg-dark .zoom-controls button{color:#f3edf5}
.bg-dark .zoom-controls button:hover{background:rgba(255,255,255,.1)}
.bg-dark .stage-layers-btn.has-layers{background:rgba(204,160,185,.2);border-color:rgba(204,160,185,.45);color:#f5dfed}
.bg-dark .stage-layers-btn.has-layers .layers-count-pill{background:rgba(204,160,185,.28);color:#fff}
.bg-dark .stage-layers-btn[aria-pressed="true"]{background:#cca0b9;color:#1c1722;border-color:#cca0b9}
.bg-dark .stage-layers-btn[aria-pressed="true"] .layers-count-pill{background:rgba(28,23,34,.22);color:#1c1722}
.bg-dark .drag-handle span{
  background:rgba(38,33,46,.92);color:#e9cfe0;border-color:rgba(204,160,185,.52);
  box-shadow:0 3px 10px rgba(0,0,0,.38);
}
.bg-checker{
  background-color:#fcfbf9;
  background-image:conic-gradient(#ebe6df 25%,transparent 0 50%,#ebe6df 0 75%,transparent 0);
  background-size:24px 24px;
}
html[data-theme="dark"] .bg-checker{
  background-color:#1c1822;
  background-image:conic-gradient(#292332 25%,transparent 0 50%,#292332 0 75%,transparent 0);
  background-size:24px 24px;
}

/* Stage Top Bar: Calm Flat Hairline Badges & Controls */
.stage-bar{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:8px 12px;flex-shrink:0;position:relative;z-index:2}
.stage-status{display:flex;align-items:center;flex-wrap:wrap;gap:8px 10px;min-width:0}
.finger-stepper{display:inline-flex;align-items:center;gap:6px}
.finger-stepper .icon-btn{border-radius:999px}
.stage-status h1{font-size:17px;font-weight:600;letter-spacing:.2px}
.stage-top-info{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.spec-chip{
  display:inline-flex;align-items:center;gap:6px;padding:4px 11px;border-radius:999px;
  background:rgba(255,255,255,.72);border:1px solid var(--line-strong);color:var(--ink);
  font-size:12px;font-weight:500;box-shadow:none;
}
.finish-chip{background:var(--accent-soft);border-color:rgba(122,84,105,.25);color:var(--accent)}
.bg-dark .spec-chip{background:rgba(255,255,255,.08);border-color:rgba(255,255,255,.14);color:#f3edf5}
.bg-dark .finish-chip{background:#4b3746;border-color:#74546c;color:#f3dce9}
.color-dot{display:inline-block;width:10px;height:10px;border-radius:50%;border:1px solid rgba(0,0,0,.14);flex-shrink:0}
.stage-bar-right{display:flex;align-items:center;gap:6px;flex-shrink:0}
.select-tools,.draw-mode-badge{display:inline-flex;align-items:center;gap:6px}
.chip-btn{min-height:44px;padding:6px 13px;border-radius:999px;font-size:13px;font-weight:500;white-space:nowrap}
.expand-panel{white-space:nowrap;border-radius:999px;padding:8px 15px;font-size:13.5px}
.zoom-controls{
  display:inline-flex;align-items:center;background:var(--surface);border:1px solid var(--line-strong);
  box-shadow:var(--shadow-xs);padding:1px;border-radius:999px;color:var(--ink);
}
.zoom-controls .icon-btn{border-radius:999px}
#zoom-label{
  font-size:12px;font-weight:600;min-width:50px;min-height:44px;padding:6px 8px;
  border-radius:999px;text-align:center;font-variant-numeric:tabular-nums;color:inherit;
}

/* Material #3 (Surface 2/3): Floating Procreate Quick Brush / Preview Rail */
.procreate-rail{
  position:relative;display:inline-flex;align-items:center;justify-content:center;gap:14px;align-self:center;
  margin-top:6px;margin-bottom:4px;padding:3px 14px;flex-shrink:0;z-index:2;max-width:100%;
  background:var(--chrome-glass);
  backdrop-filter:blur(20px) saturate(1.7);-webkit-backdrop-filter:blur(20px) saturate(1.7);
  border:1px solid var(--line-strong);border-radius:999px;
  box-shadow:0 8px 24px rgba(40,26,38,.08),inset 0 1px 0 rgba(255,255,255,.68);
}
.rail-slider{
  display:inline-flex;align-items:center;gap:8px;min-height:44px;
  font-size:12px;color:var(--muted);white-space:nowrap;
}
.rail-slider input{width:104px;min-width:44px;min-height:44px;accent-color:var(--accent);cursor:pointer;margin:0}
.rail-slider output{min-width:34px;text-align:right;font-size:12px;font-weight:600;color:var(--ink);font-variant-numeric:tabular-nums}
.bg-dark .procreate-rail{background:rgba(36,31,42,.82);border-color:rgba(255,255,255,.14);color:#f4eef5;box-shadow:0 10px 28px rgba(0,0,0,.35)}
.bg-dark .rail-slider{color:#c9bfd0}
.bg-dark .rail-slider output{color:#f4eef5}
.eyedropper-rail{gap:10px;padding:4px 10px 4px 14px;flex-wrap:wrap}
.ey-label{display:inline-flex;align-items:center;gap:6px;font-size:12.5px;font-weight:600;color:var(--accent)}
.ey-label svg{width:17px;height:17px;flex-shrink:0}
.ey-target{display:inline-flex;align-items:center;gap:4px}
.eyedropper-loupe{
  position:fixed;left:0;top:0;z-index:250;pointer-events:none;
  display:inline-flex;align-items:center;gap:8px;padding:6px 12px 6px 7px;border-radius:999px;
  background:#27202bef;color:#fff;font-size:12px;font-weight:600;
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  box-shadow:0 8px 24px rgba(0,0,0,.28);will-change:transform;
}
.eyedropper-loupe i{width:22px;height:22px;border-radius:50%;border:2px solid #fff;display:inline-block}
.eyedropper-loupe small{font-size:11px;font-weight:500;color:#dfd4e5;font-family:inherit;white-space:nowrap}
.sample-pin{
  position:absolute;transform:translate(-50%,-50%);z-index:5;pointer-events:none;
  display:inline-flex;align-items:center;gap:4px;
}
.sample-pin i{
  width:20px;height:20px;border-radius:50%;border:2.5px solid #fff;
  box-shadow:0 0 0 2px var(--accent),0 4px 12px rgba(0,0,0,.35);display:block;flex-shrink:0;
}
.sample-pin span{
  padding:2px 7px;border-radius:999px;background:#27202bef;color:#fff;
  font-size:11px;font-weight:600;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  white-space:nowrap;box-shadow:0 3px 10px rgba(0,0,0,.22);
}

/* Main Viewport */
.canvas-viewport{
  flex:1;min-height:0;position:relative;display:grid;place-items:center;overflow:hidden;z-index:1;
}
.mode-board .canvas-viewport{display:block;overflow:hidden;padding:6px 0 4px}
.board-scroll-canvas{width:100%;height:100%;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;padding:2px 2px 12px;scrollbar-width:thin}
.studio-board-sheet{
  position:relative;max-width:960px;margin:0 auto;padding:14px 18px 18px;
  background:rgba(255,255,255,.86);border:1px solid var(--line-strong);border-radius:20px;
  box-shadow:var(--shadow-soft);display:flex;flex-direction:column;gap:12px;color:var(--ink);
}
.bg-dark .studio-board-sheet{background:rgba(38,33,45,.90);border-color:rgba(255,255,255,.12);color:#f4eef5}
.board-hands-zone,.board-mood-zone{position:relative;display:flex;flex-direction:column;gap:8px;min-width:0}
.board-zone-head{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:6px}
.board-zone-title{display:inline-flex;align-items:center;flex-wrap:wrap;gap:6px;font-size:13.5px;font-weight:600;color:var(--ink)}
.bg-dark .board-zone-title{color:#f4eef5}
.board-zone-title svg{width:16px;height:16px;color:var(--accent);flex-shrink:0}
.board-zone-title small{font-weight:400;font-size:12px;color:var(--muted)}
.board-zone-actions{display:inline-flex;align-items:center;gap:5px;flex-wrap:wrap}
.board-hand-row{display:grid;grid-template-columns:30px minmax(0,1fr);gap:6px;align-items:center}
.board-hand-tag{display:flex;flex-direction:column;align-items:center;gap:1px;color:var(--muted)}
.board-hand-tag strong{font:italic 20px Georgia,serif;color:var(--accent);line-height:1}
.board-hand-tag span{font-size:11px}
.board-five-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;align-items:start}
.board-nail-slot{padding:5px 3px 6px;border-radius:15px;gap:4px}
.board-nail-slot.is-transfer-target{border:1.5px dashed #c7a9bc;background:rgba(122,84,105,.04)}
.board-nail-slot.is-transfer-target:hover{border-color:var(--accent);background:var(--accent-soft);transform:scale(1.02)}
.board-nail-box{min-height:112px}
.finger-outline-guide{
  position:absolute;inset:2px;width:calc(100% - 4px);height:calc(100% - 4px);
  max-height:108px;max-width:82px;margin:auto;
  color:#c5bccb;pointer-events:none;z-index:0;
}
.bg-dark .finger-outline-guide{color:#625872}
.board-nail-slot .nail-hit{z-index:1;padding:2px}
.board-nail-slot .nail-svg{max-height:108px;max-width:82px}
.board-callout{
  width:100%;min-height:44px;min-width:44px;padding:5px 7px;border-radius:10px;
  border:1px solid var(--line);background:var(--paper);text-align:left;
  align-items:flex-start;justify-content:flex-start;
}
.board-callout:hover{border-color:rgba(122,84,105,.35);background:var(--surface)}
.board-callout.is-active{border-color:var(--accent);background:var(--accent-soft)}
.callout-text{
  font-size:11px;line-height:1.35;color:var(--ink);word-break:break-word;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
}
.finger-drag-btn{
  position:absolute;left:-4px;top:-4px;width:44px;height:44px;min-width:44px;min-height:44px;
  padding:0;border:0;border-radius:50%;background:transparent;z-index:4;
  touch-action:none;cursor:grab;
}
.finger-drag-btn:hover{background:transparent}
.finger-drag-btn svg{
  width:22px;height:22px;padding:4px;border-radius:50%;background:var(--surface);color:var(--accent);
  border:1px solid rgba(122,84,105,.45);box-shadow:0 2px 8px rgba(45,32,48,.14);
}
.finger-drag-btn:hover svg,.finger-drag-btn:active svg{background:var(--accent);color:#fff}
.drag-nail-ghost{
  position:fixed;left:0;top:0;z-index:210;pointer-events:none;
  display:flex;flex-direction:column;align-items:center;gap:2px;padding:6px 9px;
  border-radius:14px;background:rgba(255,255,255,.95);border:1px solid var(--accent);
  box-shadow:var(--shadow);will-change:transform;
}
.drag-nail-ghost svg{width:42px;height:62px}
.drag-nail-ghost span{font-size:11px;font-weight:600;color:var(--accent)}
.moodboard-drop{
  width:100%;min-height:96px;border:1.5px dashed var(--line-strong);border-radius:15px;
  background:var(--paper);flex-direction:column;gap:4px;padding:12px 16px;color:var(--muted);
}
.moodboard-drop svg{width:24px;height:24px;color:var(--accent)}
.moodboard-drop strong{font-size:13.5px;color:var(--ink)}
.moodboard-drop small{font-size:12px;color:var(--muted);max-width:480px;text-align:center}
.moodboard-canvas{
  position:relative;width:100%;min-height:250px;border:1px dashed var(--line-strong);
  border-radius:15px;background:var(--paper);overflow:hidden;touch-action:none;
}
.mood-card{
  position:absolute;border-radius:12px;background:#fff;padding:4px;
  box-shadow:0 6px 20px rgba(40,26,38,.12);border:1.5px solid transparent;
  cursor:grab;user-select:none;touch-action:none;
}
.mood-card.is-active,.mood-card.is-dragging{border-color:var(--accent);box-shadow:0 10px 28px rgba(122,84,105,.2)}
.mood-card.is-locked{cursor:crosshair;border-color:#cbb0c2}
.mood-img-frame{position:relative;width:100%;height:100%;overflow:hidden;border-radius:8px}
.mood-card img{display:block;width:100%;height:100%;object-fit:fill;pointer-events:none;transform-origin:top left}
.board-annotations-lane{
  position:relative;width:100%;min-height:112px;margin-bottom:4px;
  border:1px dashed var(--line-strong);border-radius:14px;background:rgba(250,248,245,.65);
}
.board-ann-card{
  position:absolute;width:210px;max-width:44%;min-height:58px;padding:7px 34px 8px 10px;
  border-radius:12px;background:var(--surface);border:1px solid var(--line-strong);
  box-shadow:0 4px 14px rgba(45,32,48,.08);cursor:grab;user-select:none;touch-action:none;z-index:4;
}
.board-ann-card.is-active{border-color:var(--accent);box-shadow:0 8px 20px rgba(122,84,105,.18)}
.board-ann-card.is-locked{cursor:default;border-style:dashed}
.ann-head{display:flex;align-items:center;justify-content:space-between;gap:4px;margin-bottom:2px}
.ann-target{font-size:11px;font-weight:600;color:var(--accent)}
.ann-body{font-size:12px;line-height:1.35;color:var(--ink);word-break:break-word;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.ann-del{
  position:absolute;top:-6px;right:-6px;width:44px;height:44px;min-width:44px;min-height:44px;
  padding:0;border:0;background:transparent;
}
.ann-del:hover{background:transparent}
.ann-del svg{width:22px;height:22px;padding:4px;border-radius:50%;background:#27202bd8;color:#fff}
.board-arrows-svg{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:3;overflow:visible}
.board-inspector-card{
  border:1px solid rgba(122,84,105,.28);border-radius:14px;padding:10px;background:var(--surface);
  display:flex;flex-direction:column;gap:8px;margin-bottom:6px;
}
.ann-select-row{display:flex;align-items:center;gap:8px;min-height:44px}
.ann-select-row select{flex:1;min-width:0;font-size:13px}
.is-tappable img{cursor:crosshair}
.is-eyedropper .mood-card{cursor:crosshair}
.is-eyedropper .mood-card img,.is-eyedropper .ref-thumb-card img{pointer-events:auto;cursor:crosshair;touch-action:none}
.mood-del,.mood-resize,.mood-lock{
  position:absolute;width:44px;height:44px;min-width:44px;min-height:44px;
  padding:0;border:0;border-radius:50%;background:transparent;
}
.mood-del:hover,.mood-resize:hover,.mood-lock:hover{background:transparent}
.mood-lock{top:-12px;left:-12px;z-index:3}
.mood-lock svg{width:24px;height:24px;padding:5px;border-radius:50%;background:var(--surface);color:var(--muted);border:1px solid var(--line-strong);box-shadow:0 3px 10px rgba(45,32,48,.14)}
.mood-lock.is-on svg{background:var(--accent);color:#fff;border-color:var(--accent)}
.mood-del{top:-12px;right:-12px;z-index:3}
.mood-del svg{width:24px;height:24px;padding:5px;border-radius:50%;background:#27202be0;color:#fff;box-shadow:0 3px 10px rgba(0,0,0,.2)}
.mood-resize{bottom:-12px;right:-12px;z-index:3;cursor:nwse-resize;touch-action:none}
.mood-resize span{
  width:24px;height:24px;border-radius:50%;background:var(--surface);color:var(--accent);
  border:1px solid rgba(122,84,105,.45);display:grid;place-items:center;font-size:12px;font-weight:700;
  box-shadow:0 3px 10px rgba(45,32,48,.14);
}
@media(min-width:1320px){
  .studio-board-sheet{
    max-width:1180px;display:grid;grid-template-columns:minmax(0,1.35fr) minmax(260px,.75fr);
    gap:18px;align-items:start;
  }
  .board-mood-zone .moodboard-canvas,.board-mood-zone .moodboard-drop{min-height:360px}
}
.mood-resize:hover span,.mood-resize:active span{background:var(--accent);color:#fff}
.mode-single .canvas-viewport,.mode-hand .canvas-viewport{touch-action:none}
.mode-single .canvas-viewport{display:block;cursor:grab}
.mode-hand .canvas-viewport.is-zoomed{cursor:grab}
.mode-single .canvas-viewport:active,.mode-hand .canvas-viewport.is-zoomed:active,.canvas-viewport.is-panning{cursor:grabbing}
.canvas-viewport.is-panning .nail-stage-box,.canvas-viewport.is-panning .nail-hit{cursor:grabbing}
.tool-brush .canvas-viewport,.tool-eraser .canvas-viewport{touch-action:none}
.tool-brush .nail-stage-box,.tool-brush .nail-hit{cursor:crosshair}
.tool-eraser .nail-stage-box,.tool-eraser .nail-hit{cursor:cell}
.tool-brush .nail-hit:hover,.tool-eraser .nail-hit:hover{background:transparent}

/* Five-Nail Studio Display: Poised Luminous Tray + Free Zoom/Pan Ready */
.five-hand-board{
  width:100%;max-width:780px;height:100%;max-height:386px;
  display:flex;flex-direction:column;justify-content:center;align-items:center;
  gap:8px;position:relative;padding:6px 4px;
  will-change:transform;transform-origin:center;
}
.board-dir{font-size:11px;letter-spacing:2.5px;color:var(--muted);pointer-events:none;opacity:.85}
.five-nails-row{
  width:100%;flex:1;min-height:0;
  display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;align-items:stretch;
  position:relative;
}
.five-nails-row::after{
  content:'';position:absolute;left:12px;right:12px;bottom:48px;height:1px;
  border-bottom:1px dashed rgba(130,118,108,.38);pointer-events:none;z-index:0;
}
.bg-dark .five-nails-row::after{border-bottom-color:rgba(255,255,255,.14)}

.nail-slot{
  display:flex;flex-direction:column;align-items:center;justify-content:flex-end;
  gap:6px;min-width:0;min-height:0;position:relative;z-index:1;
  border-radius:18px;padding:10px 6px 10px;
  border:1px solid transparent;
  transition:background-color var(--m-fast) ease,border-color var(--m-fast) ease,box-shadow var(--m-base) var(--e-grow),transform var(--m-fast) var(--e-grow);
}
.nail-slot.is-selected{
  background:radial-gradient(ellipse 85% 75% at 50% 54%,rgba(255,255,255,.46) 0%,rgba(255,255,255,.04) 100%);
  border-color:rgba(122,84,105,.12);
  box-shadow:none;
}
.nail-slot.is-selected::after{
  content:"";position:absolute;left:24%;right:24%;bottom:2px;height:2px;border-radius:999px;
  background:var(--accent);opacity:.85;pointer-events:none;
}
.bg-dark .nail-slot.is-selected{
  background:radial-gradient(ellipse 85% 75% at 50% 54%,rgba(204,160,185,.12) 0%,rgba(255,255,255,0) 100%);
  border-color:rgba(204,160,185,.28);
  box-shadow:none;
}
.bg-dark .nail-slot.is-selected::after{background:#d9b0c7}
.nail-slot.is-hero::after{display:none}
.nail-slot.drop-target{
  background:var(--accent-soft);border:1.5px dashed var(--accent);transform:scale(1.03);
}
.nail-stage-box{
  position:relative;width:100%;flex:1;min-height:0;display:grid;place-items:center;
}
.nail-hit{
  width:100%;height:100%;min-height:44px;min-width:44px;padding:4px;
  border-radius:16px;position:relative;display:grid;place-items:center;background:none;border:0;
}
.nail-hit:hover{background:rgba(122,84,105,.04)}
.nail-hit .nail-svg{
  width:100%;height:100%;max-height:270px;max-width:136px;
  filter:drop-shadow(0 12px 18px rgba(45,32,48,.11));
}
.slot-dot{
  position:absolute;top:6px;right:6px;width:6px;height:6px;border-radius:50%;
  background:var(--accent);opacity:.72;pointer-events:none;
}
.slot-check{
  position:absolute;top:4px;right:4px;width:18px;height:18px;border-radius:50%;
  background:var(--accent);color:#fff;display:grid;place-items:center;padding:3px;
}
.slot-check svg{width:11px;height:11px}
.slot-meta{
  display:flex;align-items:baseline;gap:5px;font-size:13px;color:var(--ink);
  pointer-events:none;white-space:nowrap;
}
.slot-index{font-size:11px;color:var(--muted);font-variant-numeric:tabular-nums}
.nail-slot.is-selected .slot-meta{color:var(--accent)}

/* Single-Nail Hero Mode */
.canvas-art{
  position:absolute;left:0;right:0;top:14px;bottom:28px;
  width:min(88%,480px);margin:0 auto;display:grid;place-items:center;
  will-change:transform;transform-origin:center;
}
.nail-slot.is-hero{width:100%;height:100%;padding:0;background:none;border:0;box-shadow:none}
.nail-slot.is-hero .nail-stage-box{width:100%;height:100%}
.nail-slot.is-hero .nail-hit{pointer-events:none}
.charm-node,.obj-node{cursor:grab;touch-action:none}
.mode-single .charm-node,.mode-single .obj-node,.gizmo-handle,.mode-single .gizmo-handle{pointer-events:auto;touch-action:none}
.charm-node.is-locked,.obj-node.is-locked{cursor:not-allowed}
.nail-slot.is-hero .nail-svg{max-height:100%;max-width:100%;width:100%;height:100%}
.nail-slot.is-hero .slot-meta{display:none}
.direction{
  position:absolute;left:50%;transform:translateX(-50%);font-size:11.5px;color:var(--muted);
  pointer-events:none;letter-spacing:3px;padding:2px 10px;border-radius:999px;
  background:rgba(248,245,240,.78);
}
.bg-dark .direction{background:rgba(36,31,42,.78)}
.direction.tip{top:4px}
.direction.root{bottom:4px}

/* Direct Finger-Drag Resize Handles (44x44 Touch Zone + Refined Hairline Disc) */
.drag-handle{
  position:absolute;width:44px;height:44px;min-width:44px;min-height:44px;
  padding:0;border:0;background:transparent;border-radius:50%;z-index:4;
  touch-action:none;display:grid;place-items:center;
}
.drag-handle:hover{background:transparent}
.drag-handle span{
  width:22px;height:22px;border-radius:50%;background:rgba(255,255,255,.94);color:var(--accent);
  border:1px solid rgba(122,84,105,.42);box-shadow:0 2px 8px rgba(45,32,48,.12);
  display:grid;place-items:center;font-size:11.5px;font-weight:600;line-height:1;
  transform:scale(var(--inv-zoom,1));
  transition:transform var(--m-fast) var(--e-grow),background-color var(--m-fast) ease,color var(--m-fast) ease;
}
.drag-handle:hover span,.drag-handle:active span{background:var(--accent);color:#fff;border-color:var(--accent);transform:scale(calc(var(--inv-zoom,1) * 1.12))}
.handle-length{left:50%;transform:translate(-50%,-50%);cursor:ns-resize}
.handle-width{top:68%;transform:translate(-50%,-50%);cursor:ew-resize}
.drag-readout{
  position:absolute;top:6px;left:50%;transform:translateX(-50%);z-index:6;
  background:#27202be8;color:#fff;font-size:12px;font-weight:600;padding:4px 10px;
  border-radius:999px;white-space:nowrap;pointer-events:none;
}
.drag-color-ghost{
  position:fixed;left:0;top:0;width:36px;height:36px;border-radius:50%;
  border:3px solid #fff;box-shadow:0 8px 24px rgba(45,32,48,.28);
  pointer-events:none;z-index:200;will-change:transform;
}

/* Zero-Jump Viewport-Pinned Studio Dock (Outside #app — Strict 0px Drift on Panel Toggle/Resize) */
:root{--dock-w:376px}
.dock-host{
  position:fixed;bottom:12px;z-index:20;
  left:clamp(calc(var(--dock-w) / 2 + 12px),50vw,calc(100vw - var(--active-sheet-w,0px) - var(--dock-w) / 2 - 16px));
  transform:translateX(-50%);
  display:flex;flex-direction:column;align-items:center;gap:6px;
  pointer-events:none;max-width:calc(100vw - 24px);
}
html[data-dock-anchor="left"] .dock-host{
  left:clamp(calc(var(--active-sheet-w,0px) + var(--dock-w) / 2 + 16px),50vw,calc(100vw - var(--dock-w) / 2 - 12px));
}
.dock-host>.floating-dock{pointer-events:auto}
.drag-tip{
  font-size:11.5px;font-weight:500;color:var(--ink);text-align:center;
  padding:3px 11px;border-radius:999px;pointer-events:none;
  background:var(--chrome-glass);border:1px solid var(--line);
  backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);
  transition:opacity var(--m-fast) ease;
}
html[data-stage-bg="dark"] .drag-tip{background:rgba(30,26,38,.86);border-color:rgba(255,255,255,.14);color:#efe8f3}
.dock-host:has(.dock-item:hover,.dock-item:focus-visible) .drag-tip{opacity:.08}
.floating-dock.mac-studio-dock{
  display:inline-flex;align-items:flex-end;gap:4px;padding:6px 10px 5px;max-width:100%;
  background:var(--chrome-glass);
  backdrop-filter:blur(20px) saturate(1.7);
  -webkit-backdrop-filter:blur(20px) saturate(1.7);
  border:1px solid var(--line-strong);
  border-radius:22px;
  box-shadow:
    0 12px 32px rgba(40,26,38,.1),
    0 1px 3px rgba(40,26,38,.05),
    inset 0 1px 0 rgba(255,255,255,.72);
  position:relative;
  overflow:visible;
}
html[data-theme="dark"] .floating-dock.mac-studio-dock,
html[data-stage-bg="dark"] .floating-dock.mac-studio-dock{
  background:rgba(30,26,38,.82);
  border-color:rgba(255,255,255,.14);
  box-shadow:
    0 14px 36px rgba(0,0,0,.44),
    0 1px 3px rgba(0,0,0,.28),
    inset 0 1px 0 rgba(255,255,255,.12);
}
.dock-sep{
  width:1px;height:34px;margin:0 4px 12px;flex-shrink:0;align-self:flex-end;
  background:var(--line-strong);
}
.dock-item.dock-pill{
  position:relative;min-width:54px;min-height:58px;padding:2px 3px 3px;border:0;border-radius:14px;
  background:transparent;color:var(--ink);
  display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:3px;
  cursor:pointer;flex-shrink:0;will-change:transform;
  transition:color var(--m-fast) ease;
}
.dock-item.dock-pill:hover{background:transparent}
.dock-item.dock-pill:active .dock-tile{scale:.94;transition:scale var(--m-press) ease-out 40ms}
.dock-item.dock-pill:focus-visible{outline:2px solid var(--accent);outline-offset:2px}

/* Open Monochrome Icons Breathing in One Frosted Bar (Zero Double-Boxed Squares on Idle) */
.dock-tile{
  position:relative;width:42px;height:42px;border-radius:13px;
  display:grid;place-items:center;flex-shrink:0;
  transform-origin:bottom center;will-change:transform;
  background:transparent;
  color:#564552;
  border:1px solid transparent;
  box-shadow:none;
  transition:box-shadow var(--m-fast) ease,border-color var(--m-fast) ease,background var(--m-fast) ease,color var(--m-fast) ease,scale var(--m-base) var(--e-sheet);
}
.dock-tile svg{width:25px;height:25px;display:block;pointer-events:none}
.dock-item:hover .dock-tile{
  background:rgba(122,84,105,.09);
  color:var(--accent);
}
.dock-item.active .dock-tile{
  background:linear-gradient(162deg,#fdf8fa 0%,#f0e0ea 100%);
  color:var(--accent);
  border-color:rgba(122,84,105,.4);
  box-shadow:0 3px 10px rgba(122,84,105,.14),inset 0 1px 0 rgba(255,255,255,.92);
}
html[data-theme="dark"] .dock-tile,
html[data-stage-bg="dark"] .dock-tile{
  background:transparent;
  color:#d9cde0;
  border-color:transparent;
}
html[data-theme="dark"] .dock-item:hover .dock-tile,
html[data-stage-bg="dark"] .dock-item:hover .dock-tile{
  background:rgba(204,160,185,.14);
  color:#f5e4ee;
}
html[data-theme="dark"] .dock-item.active .dock-tile,
html[data-stage-bg="dark"] .dock-item.active .dock-tile{
  background:linear-gradient(162deg,#4c384a 0%,#3a2a38 100%);
  color:#f7e2ef;
  border-color:rgba(204,160,185,.54);
  box-shadow:0 4px 14px rgba(0,0,0,.38),inset 0 1px 0 rgba(255,255,255,.16);
}
html[data-stage-bg="dark"] .dock-label{color:#bdb2c6}
html[data-stage-bg="dark"] .dock-item.active .dock-label,
html[data-stage-bg="dark"] .dock-item:hover .dock-label{color:#f0d6e6}

/* Live Nail Color Gel Orb inside Color Tile */
.dock-color-dot{
  position:absolute;inset:8px;width:auto;height:auto;border-radius:50%;
  border:1.5px solid rgba(45,32,48,.18);
  box-shadow:inset 0 -3px 6px rgba(0,0,0,.14),inset 0 1px 2px rgba(255,255,255,.68),0 2px 5px rgba(40,26,38,.12);
  pointer-events:none;
}
.dock-color-shine{position:relative;z-index:1}

.dock-badge{
  position:absolute;top:-3px;right:-3px;min-width:17px;height:17px;padding:0 4px;
  border-radius:999px;background:var(--accent);color:#fff;font-style:normal;
  font-size:10px;font-weight:700;display:grid;place-items:center;
  border:1.5px solid var(--surface);box-shadow:0 2px 6px rgba(45,32,48,.2);
  pointer-events:none;
}
.dock-label{
  font-size:11px;font-weight:500;line-height:1.1;color:var(--muted);white-space:nowrap;
  transition:color var(--m-fast) ease;pointer-events:none;
}
.dock-item.active .dock-label,.dock-item:hover .dock-label{color:var(--accent);font-weight:600}
html[data-theme="dark"] .dock-item.active .dock-label,html[data-theme="dark"] .dock-item:hover .dock-label{color:#ecd3e2}

/* Floating Tooltip */
.dock-tooltip{
  position:absolute;bottom:calc(100% + 16px);left:50%;transform:translate(-50%,4px);
  padding:5px 11px;border-radius:999px;white-space:nowrap;pointer-events:none;
  background:rgba(39,32,43,.94);color:#fff;font-size:11.5px;font-weight:500;letter-spacing:.01em;
  box-shadow:0 6px 18px rgba(30,20,34,.24);border:1px solid rgba(255,255,255,.12);
  opacity:0;transition:opacity var(--m-fast) ease,transform var(--m-fast) var(--e-grow);z-index:30;
}
.dock-item:hover .dock-tooltip,.dock-item:focus-visible .dock-tooltip{
  opacity:1;transform:translate(-50%,0);
}
@media(hover:none){
  .dock-tooltip{display:none}
}

/* Studio Sheet (Warm Editorial Alabaster Sidebar + Draggable Seam Resizer) */
.studio-sheet{
  position:relative;min-width:0;min-height:0;background:var(--sheet-bg);border-left:1px solid var(--line);
  display:flex;flex-direction:column;z-index:4;
}
.studio-sheet.collapsed{display:none}
.panel-resizer{
  position:absolute;top:0;bottom:0;left:-8px;width:16px;z-index:8;
  cursor:col-resize;touch-action:none;
  display:flex;align-items:center;justify-content:center;
}
.panel-resizer::after{
  content:"";position:absolute;top:0;bottom:0;left:-14px;width:44px;
}
.panel-resizer::before{
  content:"";position:absolute;top:0;bottom:0;left:50%;width:2px;transform:translateX(-50%);
  background:transparent;transition:background-color var(--m-fast) ease;
}
.resizer-pill{
  width:4px;height:40px;border-radius:999px;
  background:rgba(47,39,50,.18);
  transition:background-color var(--m-fast) ease,transform var(--m-fast) var(--e-grow),height var(--m-fast) ease;
}
.panel-resizer:hover::before,.panel-resizer.is-active::before{background:rgba(122,84,105,.38)}
.panel-resizer:hover .resizer-pill,.panel-resizer:focus-visible .resizer-pill,.panel-resizer.is-active .resizer-pill{
  background:var(--accent);height:54px;transform:scaleX(1.15);
}
.workspace.panel-left .panel-resizer{left:auto;right:-8px}
.studio-sheet.is-wide .lib-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.studio-sheet.is-wide .recipe-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.studio-sheet.is-wide .brush-kind-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.studio-sheet.is-wide .brush-card:last-child:nth-child(odd){grid-column:auto}
.sheet-header{
  display:flex;justify-content:space-between;align-items:center;gap:8px;
  padding:10px 12px;border-bottom:1px solid var(--line);flex-shrink:0;
}
.sheet-header h2{font-size:14.5px;font-weight:600;padding-left:4px;letter-spacing:.2px}
.sheet-header>.icon-btn{color:var(--muted)}
.sheet-header>.icon-btn:hover{color:var(--ink)}
.sheet-tabs{
  display:inline-flex;background:var(--track-bg);border:1px solid var(--line);
  padding:2px;border-radius:999px;gap:2px;
}
.sheet-tabs button{
  min-height:44px;padding:6px 13px;border-radius:999px;font-size:13px;font-weight:500;
  color:var(--muted);border-color:transparent;background:transparent;white-space:nowrap;
}
.sheet-tabs button[aria-pressed=true]{
  background:var(--surface);color:var(--accent);border-color:transparent;
  box-shadow:0 1px 3px rgba(38,24,38,.08),0 0 0 1px var(--line);font-weight:600;
}
.panel-scroll{overflow-y:auto;overscroll-behavior:contain;padding:14px 12px 20px;min-height:0;scrollbar-width:thin}

/* 2D Interactive Color Spectrum Pad + Rainbow Hue Bar */
.picker-layout{display:flex;flex-direction:column;gap:12px}
.picker-spectrum-col{display:flex;flex-direction:column;gap:8px}
.sv-pad{
  position:relative;width:100%;height:164px;border-radius:14px;cursor:crosshair;touch-action:none;
  border:1px solid rgba(0,0,0,.1);box-shadow:inset 0 0 0 1px rgba(255,255,255,.22);
  background:
    linear-gradient(to top,#000,transparent),
    linear-gradient(to right,#fff,hsl(var(--hue,344),100%,50%));
}
.sv-thumb{
  position:absolute;width:22px;height:22px;border-radius:50%;
  border:3px solid #fff;box-shadow:0 2px 8px rgba(0,0,0,.32);
  transform:translate(-50%,-50%);pointer-events:none;
}
.hue-bar{
  position:relative;width:100%;height:44px;display:flex;align-items:center;
  cursor:ew-resize;touch-action:none;
}
.hue-bar::before{
  content:'';width:100%;height:14px;border-radius:999px;border:1px solid rgba(0,0,0,.1);
  background:linear-gradient(to right,#ff0000 0%,#ffff00 17%,#00ff00 33%,#00ffff 50%,#0000ff 67%,#ff00ff 83%,#ff0000 100%);
}
.hue-thumb{
  position:absolute;top:50%;width:22px;height:22px;border-radius:50%;
  border:3px solid #fff;box-shadow:0 2px 8px rgba(0,0,0,.3);
  transform:translate(-50%,-50%);pointer-events:none;
}

.picker-controls-col{display:flex;flex-direction:column;gap:10px}
.current-color-bar{display:flex;align-items:center;gap:6px}
.drag-swatch-pill{
  min-height:44px;padding:6px 10px;border-radius:10px;
  border:1px dashed rgba(122,84,105,.38);background:var(--accent-soft);color:var(--accent);
  font-size:12px;font-weight:600;white-space:nowrap;cursor:grab;touch-action:none;
}
.drag-swatch-pill:active{cursor:grabbing}
.live-dot{width:16px;height:16px;border-radius:50%;border:1px solid rgba(0,0,0,.15);flex-shrink:0}
#color-input{
  width:44px;height:44px;min-width:44px;padding:3px;border:1px solid var(--line-strong);
  border-radius:10px;background:var(--surface);flex-shrink:0;
}
#color-input::-webkit-color-swatch-wrapper{padding:0}
#color-input::-webkit-color-swatch{border:0;border-radius:6px}
#color-hex{
  min-width:0;flex:1;width:100%;border:1px solid var(--line-strong);border-radius:10px;
  padding:0 10px;font-size:14px;background:var(--surface);text-transform:uppercase;
}
.swatch-head{display:flex;justify-content:space-between;align-items:baseline;flex-wrap:wrap;gap:2px 8px}
.swatches{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;justify-items:center}
.swatches-salon{grid-template-columns:repeat(6,minmax(0,1fr));gap:4px}
.swatch{
  width:44px;height:44px;min-width:44px;border:3px solid var(--sheet-bg);
  background:var(--swatch);border-radius:50%;padding:8px;color:#fff;
  box-shadow:0 0 0 1px rgba(0,0,0,.12);touch-action:none;cursor:grab;
}
.swatch:hover{background:var(--swatch);box-shadow:0 0 0 2px var(--accent)}
.swatch.chosen{box-shadow:0 0 0 2.5px var(--accent)}
.swatch svg,.mini-swatch svg{width:17px;height:17px;filter:drop-shadow(0 1px 1px #2226)}
.swatch.is-light-swatch,.mini-swatch.is-light-swatch{color:#27202b}
.swatch.is-light-swatch svg,.mini-swatch.is-light-swatch svg{filter:none}
.recent-colors-block,.custom-swatches-block{display:flex;flex-direction:column;gap:5px;padding-top:8px;border-top:1px solid var(--line)}
.active-slot-banner{
  padding:5px 10px;border-radius:10px;background:var(--accent-soft);border:1px solid rgba(122,84,105,.28);
  color:var(--accent);font-size:12px;font-weight:600;line-height:1.35;
}
.swatch.is-editing-slot{box-shadow:0 0 0 2.5px var(--accent),0 0 0 5px var(--accent-soft)}
.recent-swatches{display:flex;flex-wrap:wrap;gap:4px}
.inline-slant{display:flex;flex-direction:column;gap:6px;padding-top:4px}

/* Size & Palette Tab */
.size-panel-layout{display:flex;flex-direction:column;gap:14px}
.shape-picker{
  width:100%;justify-content:flex-start;padding:8px 10px;border:1px solid var(--line-strong);
  background:var(--surface);border-radius:14px;text-align:left;gap:10px;margin-bottom:10px;
}
.shape-picker>svg{width:30px;height:46px}
.shape-picker strong{font-size:14px}
.shape-picker small{display:block;font-size:12px;margin-top:2px}
.picker-cta{
  margin-left:auto;font-size:12px;font-weight:600;color:var(--accent);
  background:var(--accent-soft);padding:4px 9px;border-radius:999px;flex-shrink:0;
}
.size-controls{display:flex;flex-direction:column;gap:4px;margin-bottom:8px}
.size-controls label{display:flex;align-items:center;gap:8px;font-size:13.5px;min-height:44px;white-space:nowrap}
.size-controls input{flex:1;width:auto;min-width:44px;accent-color:var(--accent);cursor:pointer;margin:0}
.size-controls output{font-size:12px;min-width:38px;text-align:right;font-variant-numeric:tabular-nums;flex-shrink:0}
.section-label{display:block;font-size:13.5px;font-weight:600;margin:0 0 6px}
.inspiration{border-top:1px solid var(--line);margin-top:4px}
.palette{
  display:flex;align-items:center;justify-content:space-between;
  border-bottom:1px solid var(--line);gap:6px;font-size:13px;padding:5px 0;
}
.palette>div{display:flex;gap:2px}
.palette button{
  background:var(--swatch);border:6px solid var(--sheet-bg);border-radius:50%;
  width:44px;height:44px;min-width:44px;padding:0;touch-action:none;cursor:grab;
}
.palette button:hover{outline:1.5px solid var(--accent)}
.panel-note{color:var(--muted);font-size:12px;line-height:1.65;margin-top:8px}

/* Brush & Eraser Studio Panel */
.brush-layout{display:flex;flex-direction:column;gap:12px}
.brush-col{display:flex;flex-direction:column;gap:10px;min-width:0}
.brush-kind-grid{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.brush-card{
  display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:2px;
  min-height:54px;padding:8px 10px;border:1px solid var(--line-strong);border-radius:12px;
  background:var(--surface);text-align:left;
}
.brush-card:last-child:nth-child(odd){grid-column:1 / -1}
.brush-card strong{font-size:13px;line-height:1.25}
.brush-card small{font-size:11.5px;line-height:1.3}
.brush-palette-block{display:flex;flex-direction:column;gap:8px;padding-top:2px}
.brush-color-actions{display:flex;align-items:center;gap:6px}
.brush-edit-btn{min-height:44px;padding:6px 10px;font-size:12.5px;font-weight:600;white-space:nowrap;flex-shrink:0;border-radius:10px}
#brush-hex{
  min-width:78px;flex:1;width:0;border:1px solid var(--line-strong);border-radius:10px;
  padding:0 10px;font-size:13.5px;background:var(--surface);text-transform:uppercase;
}
.inline-brush-picker{
  display:flex;flex-direction:column;gap:6px;padding:8px;border:1px solid rgba(122,84,105,.28);
  border-radius:14px;background:var(--surface);overflow-y:clip;
}
.sv-pad-compact{height:124px}
#charm-color-input,.mat-color-row input[type="color"]{
  width:44px;height:44px;min-width:44px;min-height:44px;padding:3px;
  border:1px solid var(--line-strong);border-radius:10px;background:var(--surface);flex-shrink:0;
}
#charm-color-input::-webkit-color-swatch-wrapper,.mat-color-row input[type="color"]::-webkit-color-swatch-wrapper{padding:0}
#charm-color-input::-webkit-color-swatch,.mat-color-row input[type="color"]::-webkit-color-swatch{border:0;border-radius:6px}
.brush-swatches{display:grid;grid-template-columns:repeat(4,minmax(44px,1fr));gap:4px;justify-items:center}
.mini-swatch{
  width:44px;height:44px;min-width:44px;min-height:44px;padding:0;border-radius:50%;
  background:var(--swatch);border:7px solid var(--sheet-bg);color:#fff;
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.15);
}
.mini-swatch:hover{background:var(--swatch);outline:2px solid var(--accent);outline-offset:-3px}
.mini-swatch.chosen{outline:2.5px solid var(--accent);outline-offset:-3px}
.brush-preview-box{
  border:1px solid var(--line);border-radius:12px;padding:8px 10px;background:var(--surface);
  display:flex;flex-direction:column;gap:4px;
}
.brush-preview-meta{display:flex;align-items:baseline;justify-content:space-between;gap:6px;flex-wrap:wrap}
.brush-preview-meta strong{font-size:12.5px;color:var(--ink)}
.brush-preview-svg{width:100%;height:42px;display:block;border-radius:8px;background:var(--paper);border:1px solid var(--line)}
.eraser-preview-line{
  height:42px;border-radius:8px;background:var(--paper);border:1px dashed rgba(122,84,105,.38);
  display:grid;place-items:center;font-size:12px;color:var(--accent);
}
.brush-footer-actions{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.brush-footer-actions button{font-size:12.5px;padding:8px 6px}
.stroke-layer-section{display:flex;flex-direction:column;gap:6px;padding-top:8px;border-top:1px solid var(--line)}
.refit-btn{width:100%;font-size:12.5px;font-weight:600;color:var(--accent);border-color:rgba(122,84,105,.32);background:var(--accent-soft);padding:8px 10px}
.out-badge{
  display:inline-block;padding:1px 6px;border-radius:999px;font-style:normal;
  background:#fce8ed;color:#9c2c4a;font-size:11px;font-weight:600;
}
.stroke-layer-list{display:flex;flex-direction:column;gap:6px}
.stroke-layer-item{flex-shrink:0;border:1px solid var(--line-strong);border-radius:11px;background:var(--surface);overflow:hidden}
.stroke-layer-item.is-selected{border-color:var(--accent)}
.stroke-layer-item.is-hidden .layer-name{opacity:.5;text-decoration:line-through}
.layer-select-btn{width:100%;justify-content:flex-start;padding:6px 10px;min-height:44px;border:0;border-radius:0;font-size:13px}
.layer-name{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.layer-badges{margin-left:auto;font-size:11px;color:var(--accent);font-weight:600;flex-shrink:0}
.layer-actions{display:flex;flex-wrap:wrap;gap:4px;padding:6px 8px 8px;border-top:1px solid var(--line)}
.layer-actions button{min-width:44px;min-height:44px;padding:6px 8px;font-size:12px}
.layer-actions .layer-restyle{flex:1;white-space:nowrap}
.stroke-local-edit{padding:6px 8px 10px;border-top:1px dashed var(--line);display:flex;flex-direction:column;gap:6px}
.stroke-local-edit .size-controls{margin-bottom:0}
.stroke-local-edit .size-controls label{font-size:12.5px}

/* Phase C: Stage Persistent Layers Button + Dedicated Layers Drawer & Fixed Unified Inspector */
.stage-layers-btn{gap:5px}
.stage-layers-btn.has-layers{border-color:rgba(122,84,105,.35);color:var(--accent);background:var(--accent-soft)}
.stage-layers-btn[aria-pressed=true],
.stage-layers-btn[aria-pressed=true]:hover:not(:disabled){background:var(--accent);color:#fff;border-color:var(--accent)}
.layers-count-pill{
  display:inline-grid;place-items:center;min-width:19px;height:19px;padding:0 5px;
  border-radius:999px;font-size:11px;font-weight:700;font-style:normal;
  background:rgba(122,84,105,.16);color:var(--accent);
}
.stage-layers-btn[aria-pressed=true] .layers-count-pill{background:rgba(255,255,255,.24);color:#fff}
.layers-jump-btn{
  width:100%;justify-content:space-between;padding:8px 12px;border-radius:12px;
  font-size:12.5px;font-weight:600;color:var(--accent);
  background:var(--accent-soft);border-color:rgba(122,84,105,.28);
}
.layers-jump-btn:hover{background:rgba(122,84,105,.14);border-color:rgba(122,84,105,.45)}
.layers-drawer-layout{display:flex;flex-direction:column;gap:12px}
.layers-col{display:flex;flex-direction:column;gap:10px;min-width:0}
.unified-inspector-card{
  border:1.5px solid rgba(122,84,105,.32);border-radius:14px;background:var(--surface);
  overflow:hidden;box-shadow:var(--shadow-xs);
}
.unified-inspector-head{
  display:flex;align-items:center;gap:8px;padding:10px 12px 8px;
  background:var(--accent-soft);border-bottom:1px solid rgba(122,84,105,.14);
}
.unified-inspector-head strong{font-size:13.5px;color:var(--ink);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.unified-inspector-head .layer-badges{margin-left:auto}
.unified-inspector-empty{
  padding:12px;border-radius:12px;border:1px dashed var(--line-strong);
  background:var(--paper);font-size:12.5px;color:var(--muted);line-height:1.55;
}
.unified-inspector-card .layer-actions{
  border-top:0;padding:6px 3px;
  display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:2px;
}
.unified-inspector-card .layer-actions button{min-width:44px;min-height:44px;padding:6px 2px;font-size:12px}
.unified-inspector-card .layer-actions .layer-restyle{grid-column:1 / -1;padding:6px 10px}
.unified-inspector-card .stroke-local-edit{padding:8px 10px 12px}
.layer-row-card{
  flex-shrink:0;display:flex;align-items:center;gap:2px;
  border:1px solid var(--line-strong);border-radius:11px;background:var(--surface);
  transition:border-color var(--m-fast) ease,background-color var(--m-fast) ease;
}
.layer-row-card.is-selected{border-color:var(--accent);background:var(--accent-soft)}
.layer-row-card.is-hidden .layer-name{opacity:.5;text-decoration:line-through}
.layer-row-card .layer-select-btn{flex:1;min-width:0;border-radius:10px}
.layer-row-mini-btn{width:44px;height:44px;min-width:44px;min-height:44px;padding:8px;border:0;color:var(--muted);flex-shrink:0}
.layer-row-mini-btn:hover{color:var(--ink)}
.layer-row-mini-btn.is-active{color:var(--accent)}
.base-layer-summary{
  border:1px solid var(--line);border-radius:12px;padding:10px 12px;
  background:var(--paper);display:flex;flex-direction:column;gap:8px;
}
.base-summary-meta{display:flex;align-items:center;gap:8px;font-size:12.5px;color:var(--ink);flex-wrap:wrap}
.base-summary-jumps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.base-summary-jumps button{min-height:44px;padding:6px 6px;font-size:12px;border-radius:10px}
.settings-size-block{display:flex;flex-direction:column;gap:6px;padding:8px 10px;border:1px solid var(--line);border-radius:12px;background:var(--surface)}
.settings-size-block .size-controls{margin-bottom:0}

/* Salon Charms & Ornaments Panel */
.charm-layout{display:flex;flex-direction:column;gap:12px}
.charm-col{display:flex;flex-direction:column;gap:10px;min-width:0}
.charm-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
.charm-card{
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;
  min-height:66px;min-width:44px;padding:6px 4px;border:1px solid var(--line-strong);
  border-radius:12px;background:var(--surface);font-size:12px;font-weight:500;
}
.charm-card:hover{background:var(--accent-soft);border-color:rgba(122,84,105,.32)}
.charm-thumb-svg{width:34px;height:32px;display:block;flex-shrink:0}
.charm-inspector{
  border:1px solid rgba(122,84,105,.28);border-radius:14px;padding:10px 10px 12px;
  background:var(--surface);display:flex;flex-direction:column;gap:8px;min-width:0;
}
.charm-color-row{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
#charm-hex{
  min-width:86px;flex:1;width:0;border:1px solid var(--line-strong);border-radius:10px;
  padding:0 10px;font-size:13.5px;background:var(--surface);text-transform:uppercase;
}
.charm-swatches{display:flex;flex-wrap:wrap;gap:2px;width:100%}
.charm-nudge-row{display:flex;flex-direction:column;gap:4px}
.charm-nudge-btns{display:grid;grid-template-columns:repeat(5,minmax(44px,1fr));gap:4px}
.charm-nudge-btns button{min-width:44px;min-height:44px;padding:6px 2px;font-size:12.5px}

/* Salon Material & Finishes Panel (Interruptible WAAPI Collapsibles) */
.material-layout{display:flex;flex-direction:column;gap:10px}
.material-col{display:flex;flex-direction:column;gap:10px;min-width:0}
.recipe-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
.recipe-pill{
  min-width:0;font-size:12.5px;padding:8px 8px;border-radius:10px;
  justify-content:flex-start;gap:6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.recipe-dot{
  width:10px;height:10px;border-radius:50%;flex-shrink:0;
  border:1px solid rgba(40,26,38,.2);
  background:var(--rdot,linear-gradient(135deg,#fff,#dfd8d0));
}
.mat-card{
  min-width:0;border:1px solid var(--line-strong);border-radius:14px;padding:4px 10px 6px;
  background:var(--surface);overflow-y:clip;
  transition:border-color var(--m-fast) ease,background-color var(--m-fast) ease;
}
.mat-card.is-on{border-color:rgba(122,84,105,.38);padding-bottom:10px}
.mat-toggle{font-size:13.5px;min-height:44px}
.mat-controls{
  display:flex;flex-direction:column;gap:6px;padding-top:6px;
  border-top:1px solid var(--line);margin-top:2px;
}
.mat-controls label{display:flex;align-items:center;gap:6px;font-size:13px;min-height:44px;white-space:nowrap}
.mat-controls input[type="range"]{flex:1;width:auto;min-width:44px;min-height:44px;accent-color:var(--accent);cursor:pointer;margin:0}
.mat-controls output{font-size:12px;min-width:34px;text-align:right;font-variant-numeric:tabular-nums;color:var(--muted);flex-shrink:0}
.mini-pills{display:grid;grid-template-columns:repeat(auto-fit,minmax(50px,1fr));gap:4px}
.mini-pills-3{grid-template-columns:repeat(3,minmax(0,1fr))}

/* Sleek Editorial Hairline Chips (44px Touch Hitbox + Whisper-Slim 30px Visual Pill) */
.mini-pill{
  position:relative;isolation:isolate;
  min-height:44px;min-width:44px;padding:0 11px;font-size:12px;font-weight:500;
  color:var(--muted);border:0;background:transparent;box-shadow:none;
  border-radius:999px;white-space:nowrap;
}
.mini-pill::before{
  content:"";position:absolute;inset:7px 0;z-index:-1;border-radius:999px;pointer-events:none;
  border:1px solid var(--line-strong);background:var(--surface);
  transition:background-color var(--m-fast) ease,border-color var(--m-fast) ease;
}
.mini-pill:hover:not(:disabled){background:transparent;color:var(--ink)}
.mini-pill:hover:not(:disabled)::before{background:var(--accent-soft);border-color:rgba(122,84,105,.3)}
.mini-pill[aria-pressed="true"]{color:var(--accent);font-weight:600;background:transparent}
.mini-pill[aria-pressed="true"]::before{background:var(--accent-soft);border-color:rgba(122,84,105,.44)}

.mat-color-row{display:flex;align-items:center;flex-wrap:wrap;gap:8px;font-size:13px;color:var(--muted)}
.mat-color-row>span{margin-right:auto}

/* Reference & Recipe Note Side Panel */
.board-panel-layout{display:flex;flex-direction:column;gap:14px}
.board-panel-col{display:flex;flex-direction:column;gap:8px;min-width:0}
.note-textarea{
  width:100%;min-height:84px;border:1px solid var(--line-strong);border-radius:12px;
  padding:10px 12px;background:var(--surface);font:inherit;font-size:13.5px;
  line-height:1.55;resize:vertical;color:var(--ink);
}
.note-actions-row,.ref-actions-row{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.note-actions-row button,.ref-actions-row button{font-size:12.5px;padding:8px 6px;min-width:0}
.quick-note-chips{display:flex;flex-wrap:wrap;gap:0 6px}
.quick-note-chips .mini-pill{flex:0 1 auto;padding:0 10px}
.ref-thumb-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.ref-thumb-card{
  position:relative;border-radius:12px;overflow:hidden;border:1px solid var(--line-strong);
  background:var(--surface);min-height:86px;display:flex;align-items:center;justify-content:center;padding:4px;
}
.ref-thumb-card img{width:auto;height:auto;max-width:100%;max-height:112px;border-radius:8px;display:block}
.ref-thumb-del{
  position:absolute;top:0;right:0;width:44px;height:44px;min-width:44px;min-height:44px;
  padding:0;border:0;background:transparent;
}
.ref-thumb-del:hover{background:transparent}
.ref-thumb-del svg{width:22px;height:22px;padding:4px;border-radius:50%;background:#27202bd8;color:#fff}
.board-switch-cta .full{margin-top:4px;font-size:13px}

/* Settings Tab: 4 Luxury Studio Ambience Cards + Sleek iOS Pill Switches */
.settings-layout{display:flex;flex-direction:column;gap:14px}
.settings-group{display:flex;flex-direction:column;gap:10px;min-width:0}
.ambience-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.ambience-card{
  display:flex;flex-direction:column;align-items:stretch;gap:7px;
  padding:7px 7px 9px;border-radius:14px;border:1.5px solid var(--line-strong);
  background:var(--surface);text-align:left;min-height:112px;
  transition:border-color var(--m-fast) ease,box-shadow var(--m-fast) ease,transform var(--m-fast) var(--e-grow);
}
.ambience-card:hover{border-color:rgba(122,84,105,.42);background:var(--surface);box-shadow:var(--shadow-soft)}
.ambience-card[aria-pressed="true"]{
  border-color:var(--accent);background:var(--accent-soft);
  box-shadow:0 0 0 1px var(--accent),0 6px 16px rgba(122,84,105,.14);
}
.ambience-preview{
  position:relative;width:100%;aspect-ratio:16 / 10;border-radius:9px;overflow:hidden;
  border:1px solid rgba(40,26,38,.12);display:grid;grid-template-columns:1fr 28%;
}
.ambience-stage{display:flex;align-items:center;justify-content:center;gap:4px;padding:6px}
.ambience-nail{
  width:10px;height:20px;border-radius:5px 5px 4px 4px;
  box-shadow:0 2px 4px rgba(0,0,0,.18),inset 1px 1px 1px rgba(255,255,255,.45);
}
.ambience-side{border-left:1px solid rgba(120,105,120,.18);display:flex;flex-direction:column;gap:4px;padding:6px 5px}
.ambience-side i{height:4px;border-radius:999px;background:currentColor;opacity:.22;display:block}
.ambience-side i:first-child{width:75%;opacity:.45}
.ambience-check{
  position:absolute;top:5px;right:5px;width:18px;height:18px;border-radius:50%;
  background:var(--accent);color:#fff;display:none;place-items:center;padding:3px;
  box-shadow:0 2px 6px rgba(0,0,0,.22);
}
.ambience-check svg{width:11px;height:11px}
.ambience-card[aria-pressed="true"] .ambience-check{display:grid}
.ambience-meta{display:flex;flex-direction:column;gap:1px;padding:0 2px}
.ambience-meta strong{font-size:12.5px;color:var(--ink);line-height:1.25}
.ambience-meta small{font-size:11px;color:var(--muted);line-height:1.3}
.ambience-card[aria-pressed="true"] .ambience-meta strong{color:var(--accent)}

/* Sleek iOS Pill Switch (Keeps Native <input type="checkbox"> Accessible & Playwright-Compatible) */
.ios-switch{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  min-height:44px;font-size:13.5px;cursor:pointer;padding:2px 0;
}
.ios-switch>span{flex:1;min-width:0;line-height:1.35}
.ios-switch input[type="checkbox"]{
  -webkit-appearance:none;appearance:none;position:relative;flex-shrink:0;
  width:40px;height:22px;min-width:40px;min-height:22px;margin:0;
  border-radius:999px;background:var(--line-strong);border:1px solid var(--line);
  cursor:pointer;transition:background-color var(--m-fast) ease,border-color var(--m-fast) ease;
}
.ios-switch input[type="checkbox"]::after{
  content:"";position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:50%;
  background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.25);
  transition:transform var(--m-fast) var(--e-grow);
}
.ios-switch input[type="checkbox"]:checked{background:var(--accent);border-color:var(--accent)}
.ios-switch input[type="checkbox"]:checked::after{transform:translateX(18px)}
.ios-switch-card{
  padding:4px 12px;border-radius:12px;border:1px solid var(--line-strong);background:var(--surface);
}
.inline-reset-link{
  min-height:44px;min-width:44px;padding:4px 8px;font-size:12px;font-weight:600;
  color:var(--accent);border-radius:8px;margin-left:auto;
}
.hide-landscape{display:none !important}
.hide-portrait{display:flex}

.stack-buttons{display:flex;gap:6px;margin-bottom:12px}
.stack-buttons button{
  flex:1;font-size:13px;border:1px solid var(--line-strong);background:var(--surface);
  box-shadow:var(--shadow-xs);padding:8px 6px;border-radius:11px;
}
.segmented{
  display:flex;border:1px solid var(--line);background:var(--track-bg);
  padding:3px;border-radius:13px;gap:3px;margin-bottom:8px;min-width:0;
}
.segmented button{flex:1;min-width:44px;font-size:12.5px;padding:8px 6px;gap:4px;white-space:nowrap;border-radius:10px;color:var(--muted)}
.segmented button[aria-pressed=true]{
  background:var(--surface);color:var(--accent);border-color:transparent;
  box-shadow:0 1px 3px rgba(38,24,38,.08),0 0 0 1px var(--line);font-weight:600;
}
.settings-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:2px}
.settings-actions button{font-size:13px;padding:8px 10px}

/* Phase F: Bottom-to-Top Nail Build Recipe Spec Breakdown Card */
.recipe-spec-layout{display:flex;flex-direction:column;gap:10px;min-width:0}
.recipe-scope-bar{display:flex;align-items:center;justify-content:space-between;gap:6px;flex-wrap:wrap}
.recipe-scope-bar .segmented{margin-bottom:0;flex:1}
.recipe-copy-btn{min-height:44px;padding:6px 11px;border-radius:10px;font-size:12px;font-weight:600;white-space:nowrap}
.recipe-timeline{display:flex;flex-direction:column;gap:6px}
.recipe-step-card{
  display:flex;align-items:flex-start;gap:9px;width:100%;text-align:left;
  padding:9px 10px;border-radius:12px;border:1px solid var(--line-strong);
  background:var(--surface);min-height:48px;justify-content:flex-start;
  transition:border-color var(--m-fast) ease,background-color var(--m-fast) ease;
}
.recipe-step-card:hover{border-color:rgba(122,84,105,.42);background:var(--accent-soft)}
.recipe-step-card.is-hidden{opacity:.55;border-style:dashed}
.recipe-step-num{
  width:22px;height:22px;border-radius:50%;flex-shrink:0;margin-top:1px;
  display:grid;place-items:center;font-size:11px;font-weight:700;font-variant-numeric:tabular-nums;
  background:var(--accent-soft);color:var(--accent);border:1px solid rgba(122,84,105,.24);
}
.recipe-step-body{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1}
.recipe-step-title{display:flex;align-items:center;gap:6px;font-size:13px;font-weight:600;color:var(--ink);flex-wrap:wrap}
.recipe-step-tag{
  font-size:10px;font-weight:600;padding:1px 6px;border-radius:999px;
  background:var(--paper);color:var(--muted);border:1px solid var(--line);
}
.recipe-step-params{font-size:11.5px;color:var(--muted);line-height:1.4;word-break:break-word}
.recipe-note-box{
  padding:9px 11px;border-radius:12px;background:var(--paper);border:1px solid var(--line);
  display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--ink);line-height:1.5;
}
.recipe-ten-list{display:flex;flex-direction:column;gap:6px}
.recipe-ten-row{
  width:100%;display:flex;align-items:center;gap:8px;padding:8px 10px;border-radius:12px;
  border:1px solid var(--line-strong);background:var(--surface);text-align:left;justify-content:flex-start;
}
.recipe-ten-row.is-current{border-color:var(--accent);background:var(--accent-soft)}
.recipe-ten-code{font-size:11.5px;font-weight:700;color:var(--accent);min-width:26px;font-variant-numeric:tabular-nums}
.recipe-ten-meta{display:flex;flex-direction:column;gap:1px;min-width:0;flex:1}
.recipe-ten-meta strong{font-size:12.5px;color:var(--ink);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.recipe-ten-meta small{font-size:11px;color:var(--muted);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}

/* Modals (Smooth Compositor Entrance + Reduced Motion Support) */
dialog{
  padding:0;color:var(--ink);background:var(--sheet-bg);border:1px solid var(--line-strong);
  border-radius:22px;box-shadow:var(--shadow);width:min(600px,calc(100vw - 32px));
  max-width:none;max-height:calc(100dvh - 36px);margin:auto;overflow:hidden;
}
dialog[open]{display:flex;flex-direction:column;animation:modalEnter var(--m-base) var(--e-sheet) both}
dialog::backdrop{background:rgba(32,24,36,.32);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px)}
dialog[open]::backdrop{animation:modalBackdropIn var(--m-fast) var(--e-sweep) both}
dialog.wide{width:min(920px,calc(100vw - 32px))}
.modal-header{
  display:flex;justify-content:space-between;align-items:flex-start;gap:16px;
  padding:20px 24px 14px;border-bottom:1px solid var(--line);flex-shrink:0;background:var(--surface);
}
.modal-header h2{font-size:20px;margin-top:2px}
.modal-header p{font-size:13px;color:var(--muted);margin-top:4px}
.modal-body{padding:18px 24px;overflow:auto;overscroll-behavior:contain;min-height:0}
.modal-footer{
  border-top:1px solid var(--line);padding:12px 24px;display:flex;justify-content:space-between;
  align-items:center;gap:14px;flex-shrink:0;font-size:14px;background:var(--surface);
}
.modal-actions{display:flex;justify-content:flex-end;gap:10px;flex-shrink:0}
.check-row{display:flex;align-items:center;gap:10px;min-height:44px;font-size:14px;cursor:pointer}
.check-row input{width:20px;height:20px;min-width:20px;min-height:20px;accent-color:var(--accent);margin:0;flex-shrink:0}
.check-row:has(input:disabled){opacity:.45;cursor:default}

/* Shape Gallery Modal */
.gallery-toolbar{
  display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:10px;
  padding:10px 24px;border-bottom:1px solid var(--line);background:var(--sheet-bg);flex-shrink:0;
}
.length-pills{display:flex;gap:6px;flex-wrap:wrap}
.pill-btn{
  min-height:44px;min-width:44px;padding:6px 13px;font-size:13px;font-weight:500;
  border:1px solid var(--line-strong);background:var(--surface);border-radius:999px;color:var(--ink);
}
.gallery-filter-right{display:flex;align-items:center;gap:10px;margin-left:auto}
.gallery-toolbar select{font-size:14px}
.gallery-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;padding:14px 24px 16px}
.shape-card{
  min-width:0;position:relative;display:flex;flex-direction:column;align-items:center;
  justify-content:flex-start;border:1px solid var(--line-strong);border-radius:14px;
  padding:10px 8px;gap:0;min-height:176px;background:var(--surface);
}
.shape-card:hover{border-color:rgba(122,84,105,.38)}
.card-meta{width:100%;display:flex;justify-content:space-between;align-items:center;gap:4px;padding-right:22px}
.family-tag{font-size:12px;color:var(--muted)}
.length-tag{
  font-size:11px;padding:2px 7px;border-radius:999px;background:var(--accent-soft);
  color:var(--accent);font-weight:600;line-height:1.4;white-space:nowrap;
}
.shape-card svg:not(i svg){height:98px;width:74px;margin:2px 0;flex-shrink:0}
.shape-card strong{font-size:14px;margin:3px 0 1px}
.shape-card small{font-size:12px}
.shape-card i{
  display:none;position:absolute;right:8px;top:10px;width:20px;height:20px;
  background:var(--accent);border-radius:50%;padding:3px;color:#fff;
}
.shape-card i svg{width:14px;height:14px}
.shape-card[aria-pressed=true]{border:2px solid var(--accent);padding:9px 7px;background:var(--surface);box-shadow:0 4px 14px rgba(122,84,105,.12)}
.shape-card[aria-pressed=true] i{display:block}
.current-badge{position:absolute;right:8px;top:34px;font-size:12px;color:var(--accent);font-weight:600}
.shape-footer{flex-direction:row;align-items:center;justify-content:space-between;gap:16px}
.shape-preview{display:flex;align-items:center;gap:12px;min-height:54px;flex:1;min-width:0}
.shape-preview svg{width:38px;height:56px;flex-shrink:0}
.shape-preview strong{font-size:16px}
.shape-preview small{display:block}
.preview-title-row{display:flex;align-items:center;gap:8px}
.compare-pair{display:flex;align-items:center;gap:6px}
.compare-pair svg{width:34px;height:52px}
.compare-cur{opacity:.65}
.compare-arrow{font-size:14px;color:var(--accent);font-weight:600}

/* Batch Modal */
fieldset{border:0;padding:0;margin:0 0 12px}
legend{font-size:14px;font-weight:600;padding:0 0 6px}
.batch-body{display:grid;grid-template-columns:minmax(0,1.06fr) minmax(0,.94fr);gap:18px;align-items:start;padding:14px 24px}
.field-options{display:grid;grid-template-columns:1fr 1fr;gap:6px 8px}
.field-pill{border:1px solid var(--line-strong);border-radius:10px;padding:0 10px;background:var(--surface)}
.field-pill:has(input:checked){border-color:rgba(122,84,105,.45);background:var(--accent-soft)}
.target-shortcuts{display:flex;gap:6px;margin-bottom:8px;flex-wrap:wrap}
.target-shortcuts button{font-size:13px;padding:6px 10px}
.target-hands{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.target-hand-col{border:1px solid var(--line-strong);border-radius:12px;padding:6px 10px 2px;background:var(--surface)}
.target-hand-title{font-size:12px;font-weight:600;color:var(--muted);letter-spacing:.6px;padding-bottom:4px;border-bottom:1px solid var(--line)}
.target-hand-col .target{border-bottom:1px solid var(--line);gap:8px;font-size:14px}
.target-hand-col .target:last-child{border-bottom:0}
.direction-options{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.direction-options .check-row{border:1px solid var(--line-strong);border-radius:10px;padding:4px 10px;background:var(--surface);font-size:13px}
.direction-options .check-row:has(input:checked){border-color:rgba(122,84,105,.45);background:var(--accent-soft)}
.batch-preview{
  position:sticky;top:0;border:1px solid var(--line-strong);border-radius:14px;padding:14px 16px;
  background:var(--surface);display:flex;flex-direction:column;gap:10px;
  max-height:calc(100dvh - 240px);overflow-y:auto;
}
.preview-head{display:flex;justify-content:space-between;align-items:center;gap:8px;padding-bottom:8px;border-bottom:1px solid var(--line)}
.preview-rows{display:flex;flex-direction:column}
.preview-empty{font-size:14px;color:var(--muted);padding:16px 0}
.change-row{display:grid;grid-template-columns:86px 86px minmax(0,1fr);gap:8px;align-items:center;border-bottom:1px solid var(--line);font-size:12px;padding:7px 0}
.change-row>div{display:flex;align-items:center;gap:4px}
.change-row svg{width:28px;height:46px;flex-shrink:0}

/* Overview Consultation Board */
.overview-modal .overview-body{padding:12px 22px 14px;display:flex;flex-direction:column;gap:12px}
.overview-tray{background:var(--stage);border:1px solid var(--line);border-radius:16px;padding:10px 14px 8px}
.overview-tray h3{font-size:15px;border-bottom:1px solid var(--line);padding-bottom:6px;display:flex;align-items:baseline;gap:8px}
.overview-hand{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;padding-top:6px}
.overview-nail{display:flex;flex-direction:column;min-width:0;gap:3px;padding:6px 4px;border-radius:12px;background:var(--surface);border:1px solid var(--line)}
.overview-nail:hover{border-color:var(--accent);background:var(--surface)}
.overview-nail>svg{width:100%;height:clamp(68px,calc((100dvh - 610px)/2),176px)}
.overview-nail strong{font-size:14px}
.overview-nail small{font-size:12px}
.hex-chip{display:inline-flex;align-items:center;gap:5px;justify-content:center}
.overview-dark .overview-tray{background:#24202b;border-color:rgba(255,255,255,.1);color:#f3edf5}
.overview-dark .overview-tray h3{border-bottom-color:rgba(255,255,255,.1);color:#f3edf5}
.overview-dark .overview-tray h3 small{color:#bfb5c7}
.overview-dark .overview-nail{background:#2e2937;border-color:rgba(255,255,255,.09);color:#f3edf5}
.overview-dark .overview-nail small{color:#ccc3d4}
.overview-dark .overview-nail:hover{background:#383243;border-color:#c696b3}
.overview-bg-toggle{display:flex;gap:6px;align-items:center}
.overview-bg-toggle button{font-size:13px;padding:6px 12px}

/* Export & Projects Modals */
.export-body{display:flex;flex-direction:column;gap:14px}
.export-card{border:1px solid var(--line-strong);border-radius:14px;padding:16px 18px;background:var(--surface)}
.export-card h3{font-size:16px;margin-bottom:6px}
.export-card p{font-size:13px;color:var(--muted)}
.export-pair{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:12px}
.export-res-row{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:8px;font-size:14px;min-height:44px}
.export-res-row select{flex:1;max-width:260px;font-size:13.5px}
.project-tools{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:16px}
.project-tools button{font-size:14px}
.project-list{display:grid;gap:10px}
.project-list>button{
  display:flex;flex-direction:column;align-items:flex-start;border:1px solid var(--line-strong);
  padding:14px 16px;gap:6px;width:100%;background:var(--surface);text-align:left;border-radius:14px;
}
.project-list>button.is-current{border-color:var(--accent);background:var(--accent-soft)}
.project-list>button>span{font-size:12px;color:var(--muted)}
.project-ten-thumbs{display:flex;align-items:center;gap:10px;width:100%;overflow:hidden}
.project-ten-thumbs>span{display:flex;gap:4px;align-items:center}
.project-ten-thumbs svg{width:26px;height:42px}
.thumbs-sep{width:1px;height:30px;background:var(--line);flex-shrink:0}
.text-input{width:100%;border:1px solid var(--line-strong);border-radius:10px;padding:10px 12px;background:var(--surface);margin-bottom:20px}

/* Phase D: Client Profile & Zero-Keyboard Preference Memory */
.modal-seg-tabs{
  display:inline-flex;gap:4px;padding:3px;border-radius:999px;
  background:var(--track-bg);border:1px solid var(--line);margin-bottom:14px;
}
.modal-seg-tabs button{
  min-height:44px;min-width:110px;padding:6px 16px;border-radius:999px;
  font-size:13.5px;font-weight:500;color:var(--muted);background:transparent;border:0;
}
.modal-seg-tabs button[aria-pressed=true]{
  background:var(--surface);color:var(--accent);font-weight:600;
  box-shadow:0 1px 3px rgba(38,24,38,.09),0 0 0 1px var(--line);
}
.client-filter-row{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:12px}
.project-client-tag{
  display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:999px;
  background:var(--accent-soft);color:var(--accent);font-size:11.5px;font-weight:600;margin-left:6px;
}
.client-ban-strip{
  display:flex;align-items:center;gap:8px;flex-wrap:wrap;
  margin-top:8px;padding:4px 8px 4px 12px;border-radius:14px;
  background:rgba(255,252,250,.88);border:1px solid rgba(186,68,94,.28);
  box-shadow:var(--shadow-xs);position:relative;z-index:2;flex-shrink:0;
}
.client-ban-strip.is-collapsed{width:fit-content;padding:2px 4px;border-radius:999px;background:var(--surface)}
.client-ban-strip.is-calm{border-color:rgba(122,84,105,.24)}
.client-strip-name{
  display:inline-flex;align-items:center;gap:5px;font-size:12.5px;font-weight:600;color:var(--ink);white-space:nowrap;
}
.client-strip-name svg{width:15px;height:15px;color:var(--accent)}
.client-strip-flags{display:flex;align-items:center;gap:5px;flex-wrap:wrap;flex:1;min-width:0}
.client-strip-actions{display:inline-flex;align-items:center;gap:4px;margin-left:auto;flex-shrink:0}
.client-strip-actions button{min-height:44px;min-width:44px;padding:6px 10px;font-size:12px;border-radius:10px}
.client-pill-ban,.client-pill-like,.client-pill-habit{
  display:inline-flex;align-items:center;gap:3px;padding:2px 8px;border-radius:999px;
  font-size:11.5px;font-weight:600;line-height:1.4;white-space:nowrap;
}
.client-pill-ban{background:#fdecef;color:#a12c49;border:1px solid rgba(186,68,94,.26)}
.client-pill-like{background:var(--accent-soft);color:var(--accent);border:1px solid rgba(122,84,105,.24)}
.client-pill-habit{background:var(--paper);color:var(--ink);border:1px solid var(--line-strong)}
.bg-dark .client-ban-strip{background:rgba(39,32,45,.88);border-color:rgba(229,122,148,.36);color:#f5eff5}
.bg-dark .client-strip-name{color:#f5eff5}

.client-board-card{
  border:1px solid rgba(122,84,105,.26);border-radius:14px;padding:10px 12px;
  background:var(--surface);display:flex;flex-direction:column;gap:8px;margin-bottom:4px;
}
.client-board-head{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}
.client-board-head strong{display:inline-flex;align-items:center;gap:6px;font-size:13.5px;color:var(--ink)}
.client-board-head strong svg{width:15px;height:15px;color:var(--accent)}
.client-board-head button{min-height:44px;padding:6px 10px;font-size:12px;border-radius:10px}
.client-board-pills{display:flex;flex-wrap:wrap;gap:5px}
.client-board-note{font-size:12px;color:var(--ink);background:var(--paper);padding:6px 8px;border-radius:8px;line-height:1.5}
.client-privacy-hint{font-size:11px;color:var(--muted);line-height:1.4}
.client-bind-cta{
  width:100%;justify-content:space-between;padding:8px 12px;border-radius:12px;
  font-size:12.5px;font-weight:600;color:var(--accent);background:var(--accent-soft);
  border-color:rgba(122,84,105,.28);margin-bottom:4px;
}
.client-bind-cta>span:first-child{display:inline-flex;align-items:center;gap:6px}

.clients-pane{display:flex;flex-direction:column;gap:14px}
.clients-top-bar{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.clients-list{display:grid;gap:10px}
.client-card{
  border:1px solid var(--line-strong);border-radius:14px;padding:12px 14px;
  background:var(--surface);display:flex;flex-direction:column;gap:8px;
}
.client-card.is-linked{border-color:var(--accent);background:var(--accent-soft)}
.client-card-head{display:flex;align-items:baseline;justify-content:space-between;gap:8px;flex-wrap:wrap}
.client-card-head strong{font-size:15px;color:var(--ink)}
.client-card-actions{display:flex;flex-wrap:wrap;gap:6px;padding-top:4px}
.client-card-actions button{min-height:44px;padding:6px 12px;font-size:13px;border-radius:10px}

.client-editor{display:flex;flex-direction:column;gap:14px}
.client-editor-top{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}
.client-name-row{display:flex;flex-direction:column;gap:4px}
.client-name-row input{
  width:100%;border:1px solid var(--line-strong);border-radius:10px;padding:8px 12px;
  font-size:15px;background:var(--surface);
}
.client-pen-mode{
  display:grid;grid-template-columns:1fr 1fr;gap:8px;
}
.client-pen-mode button{min-height:44px;border-radius:12px;font-size:13.5px;font-weight:600}
.client-pen-mode button.mode-ban[aria-pressed=true]{background:#fdecef;color:#a12c49;border-color:rgba(186,68,94,.48)}
.client-pen-mode button.mode-like[aria-pressed=true]{background:var(--accent-soft);color:var(--accent);border-color:rgba(122,84,105,.48)}
.client-color-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.client-color-orb{
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;
  min-height:70px;min-width:44px;padding:8px 6px;border-radius:12px;
  border:1px solid var(--line-strong);background:var(--surface);font-size:12px;font-weight:500;
}
.client-color-orb .orb-disc{
  position:relative;width:30px;height:30px;border-radius:50%;background:var(--orb);
  border:1.5px solid rgba(0,0,0,.14);display:grid;place-items:center;
  font-size:14px;font-weight:800;color:#fff;text-shadow:0 1px 2px rgba(0,0,0,.45);
}
.client-color-orb.is-ban{border-color:#c63b5c;background:#fdecef;color:#a12c49;font-weight:600}
.client-color-orb.is-ban .orb-disc::after{
  content:"";position:absolute;left:-3px;right:-3px;top:50%;height:2.5px;
  background:#c63b5c;transform:rotate(-35deg);border-radius:2px;box-shadow:0 0 0 1px #fff;
}
.client-color-orb.is-like{border-color:var(--accent);background:var(--accent-soft);color:var(--accent);font-weight:600}
.client-pref-group{display:flex;flex-direction:column;gap:8px}
.client-chip-grid{display:flex;flex-wrap:wrap;gap:6px}
.client-chip{
  min-height:44px;min-width:44px;padding:6px 12px;border-radius:999px;
  font-size:13px;font-weight:500;border:1px solid var(--line-strong);background:var(--surface);
}
.client-chip.is-ban{background:#fdecef;color:#a12c49;border-color:rgba(186,68,94,.48);font-weight:600}
.client-chip.is-like{background:var(--accent-soft);color:var(--accent);border-color:rgba(122,84,105,.48);font-weight:600}
.client-chip.is-habit{background:#efe9f2;color:var(--ink);border-color:rgba(122,84,105,.45);font-weight:600}
.client-chip.is-habit.is-hard{background:#fdecef;color:#a12c49;border-color:rgba(186,68,94,.48)}
.client-shape-row{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.client-shape-row select{flex:1;min-width:160px;font-size:13.5px}
.client-editor-footer{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end;padding-top:6px;border-top:1px solid var(--line)}
.client-editor-footer button{min-height:44px}
html[data-theme=dark] .client-pill-ban,html[data-theme=dark] .client-chip.is-ban,html[data-theme=dark] .client-chip.is-habit.is-hard,html[data-theme=dark] .client-color-orb.is-ban{
  background:rgba(198,59,92,.22);color:#ff9db2;border-color:rgba(255,140,166,.45);
}
html[data-theme=dark] .client-chip.is-habit{background:rgba(180,148,178,.18);color:#f3eaf4}
/* Phase E: Soft Non-Blocking Guardrails + Repeat-Visit History Wall (Editorial Rose-Clay Palette) */
.client-guardrail-slot:empty{display:none}
.client-guardrail-bar{
  display:flex;align-items:center;gap:8px;flex-wrap:wrap;
  margin-top:6px;padding:4px 8px 4px 12px;border-radius:12px;
  background:#fbf1f3;border:1px solid rgba(168,78,100,.3);color:#6e2c3e;
  font-size:12px;line-height:1.4;position:relative;z-index:2;flex-shrink:0;
}
.client-guardrail-bar strong{font-weight:600;white-space:nowrap}
.client-guardrail-reasons{flex:1;min-width:140px}
.client-guardrail-bar button{
  min-height:44px;padding:6px 11px;font-size:12px;border-radius:10px;
  border-color:rgba(168,78,100,.36);color:#6e2c3e;background:rgba(255,255,255,.84);
}
html[data-theme=dark] .client-guardrail-bar{
  background:rgba(156,64,88,.24);border-color:rgba(232,148,170,.42);color:#ffdbe4;
}
html[data-theme=dark] .client-guardrail-bar button{
  background:rgba(36,26,34,.76);border-color:rgba(232,148,170,.44);color:#ffdbe4;
}
.swatch.has-client-warn,.mood-orb-btn.has-client-warn,.segmented button.has-client-warn{position:relative}
.swatch.has-client-warn::after,.mood-orb-btn.has-client-warn::after,.segmented button.has-client-warn::after{
  content:"";position:absolute;top:5px;right:5px;width:9px;height:9px;border-radius:50%;
  background:#c93858;border:1.5px solid #fff;box-shadow:0 1px 3px rgba(0,0,0,.22);pointer-events:none;
}
.lib-card{position:relative}
.lib-warn-badge{
  position:absolute;top:6px;left:6px;z-index:2;pointer-events:none;
  padding:2px 6px;border-radius:999px;font-size:10px;font-weight:700;
  background:rgba(253,236,239,.94);color:#a12c49;border:1px solid rgba(186,68,94,.36);
  box-shadow:0 1px 3px rgba(0,0,0,.1);
}
html[data-theme=dark] .lib-warn-badge,html[data-theme=dark] .out-badge{
  background:rgba(186,58,88,.88);color:#fff;border-color:rgba(255,170,190,.42);
}
.client-inherit-check{
  font-size:13px;padding:6px 10px;border-radius:12px;background:var(--paper);border:1px solid var(--line);
}
.client-history-wall{
  display:flex;flex-direction:column;gap:8px;padding-top:8px;border-top:1px dashed var(--line-strong);
}
.client-history-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:8px}
.client-visit-tile{
  border:1px solid var(--line);border-radius:12px;padding:8px 10px;background:var(--sheet-bg);
  display:flex;flex-direction:column;gap:6px;min-width:0;
}
.client-visit-strip{display:flex;align-items:center;justify-content:center;gap:4px;padding:4px;border-radius:8px;background:var(--paper)}
.client-visit-strip svg{width:24px;height:38px}
.client-visit-meta{display:flex;align-items:baseline;justify-content:space-between;gap:6px}
.client-visit-meta strong{font-size:12.5px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.client-visit-actions{display:grid;grid-template-columns:1fr 1.35fr;gap:6px}
.client-visit-actions button{min-height:44px;padding:6px 8px;font-size:12px;border-radius:10px}
@media(max-width:600px){
  .client-color-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
.shortcuts-body{display:flex;flex-direction:column;gap:16px}
.shortcut-group h3{font-size:14px;color:var(--accent);margin-bottom:6px;padding-bottom:6px;border-bottom:1px solid var(--line)}
.guide-step{padding:10px 12px;border-radius:12px;background:var(--surface);border:1px solid var(--line-strong);margin-bottom:8px}
.guide-step:last-child{margin-bottom:0}
.guide-step strong{display:block;font-size:14px;color:var(--ink);margin-bottom:3px}
.guide-step p{font-size:13px;color:var(--muted);line-height:1.55}
.shortcut-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:6px 0;font-size:13px;border-bottom:1px solid var(--line)}
.shortcut-row:last-child{border-bottom:0}
.shortcut-row kbd{
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;font-weight:600;
  padding:4px 9px;border-radius:8px;background:var(--surface);border:1px solid var(--line-strong);
  color:var(--ink);white-space:nowrap;flex-shrink:0;
}
.shortcut-row span{color:var(--muted);text-align:right}

/* Stage-Centered Frosted Toast (Positioned Cleanly Above Dock — Never Covers Stage-Bar, Nails or Dock) */
#toast{
  position:fixed;bottom:124px;top:auto;
  left:calc((100vw - var(--active-sheet-w,0px)) / 2);
  transform:translate3d(-50%,8px,0);
  background:rgba(39,32,43,.92);color:#fff;
  max-width:min(440px,calc(100vw - var(--active-sheet-w,0px) - 32px));
  padding:8px 16px;border-radius:999px;font-size:12.5px;font-weight:500;line-height:1.4;
  border:1px solid rgba(255,255,255,.12);
  box-shadow:0 8px 26px rgba(30,20,38,.22);
  backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);
  opacity:0;transition:opacity var(--m-fast) ease,transform var(--m-base) var(--e-sheet);z-index:100;pointer-events:none;
  text-align:center;
}
#toast.show{opacity:1;transform:translate3d(-50%,0,0)}
html[data-panel-side=left] #toast{left:calc((100vw + var(--active-sheet-w,0px)) / 2)}
html[data-panel-side=none] #toast{left:50%;max-width:min(520px,90vw)}
.failure-banner{
  position:fixed;top:76px;left:16px;right:16px;z-index:90;
  background:#fff2f1;color:#912a40;border:1px solid #dda9b2;box-shadow:var(--shadow);
  padding:10px 14px;display:flex;align-items:center;gap:8px;border-radius:14px;font-size:14px;
}
.failure-banner[hidden]{display:none}
.failure-banner span{flex:1}
.failure-banner button{border:1px solid #dda9b2;background:#fff;flex-shrink:0}
.failure-banner button[hidden]{display:none}

/* Phase 1 Curated Nail Material Library (Calm Hairline Editorial Layout) */
.library-layout{display:flex;flex-direction:column;gap:8px;min-width:0;max-width:100%}
.library-col{display:flex;flex-direction:column;gap:6px;min-width:0;max-width:100%;overflow-x:clip}
[hidden]{display:none !important}
.lib-search-row{display:flex;align-items:center;gap:6px;position:relative}
.lib-search-ico{
  position:absolute;left:12px;top:50%;transform:translateY(-50%);
  color:var(--muted);pointer-events:none;display:grid;place-items:center;
}
.lib-search-ico svg{width:16px;height:16px}
#library-search{
  flex:1;min-width:0;min-height:44px;padding:8px 12px 8px 36px;border-radius:12px;
  border:1px solid var(--line-strong);background:var(--surface);color:var(--ink);font-size:13.5px;
  transition:border-color var(--m-fast) ease,box-shadow var(--m-fast) ease;
}
#library-search:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
.lib-scroll-row{
  display:flex;flex-wrap:nowrap;align-items:center;gap:5px;
  overflow-x:auto;overflow-y:hidden;max-width:100%;min-width:0;
  scrollbar-width:none;-webkit-overflow-scrolling:touch;padding:1px 14px 3px 0;
  mask-image:linear-gradient(to right,#000 0%,#000 90%,transparent 100%);
  -webkit-mask-image:linear-gradient(to right,#000 0%,#000 90%,transparent 100%);
}
.lib-scroll-row::-webkit-scrollbar{display:none}
.lib-scroll-row .mini-pill{flex:0 0 auto;min-width:44px;min-height:44px;padding:0 11px;font-size:12px;white-space:nowrap}
.lib-quick-chips{padding-bottom:0}
.lib-family-pills{padding-top:3px;border-top:1px solid var(--line)}
.lib-preview-drawer{
  display:flex;flex-direction:column;gap:9px;padding:11px;border-radius:14px;
  background:var(--accent-soft);border:1px solid rgba(122,84,105,.38);overflow-y:clip;
}
.lib-preview-use{margin:0;font-size:12px;color:var(--ink);line-height:1.4}
.lib-limit-note{margin:0;color:var(--muted);line-height:1.4}
.preview-mat-rail{background:var(--accent-soft);border-color:rgba(122,84,105,.35)}
.obj-quick-rail{gap:6px;padding:3px 8px 3px 12px;flex-wrap:wrap}
.obj-quick-rail .ey-label{font-size:12px;max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lib-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:2px}
.lib-card{
  position:relative;border-radius:14px;border:1px solid var(--line-strong);background:var(--surface);
  overflow:hidden;transition:border-color var(--m-fast) ease,box-shadow var(--m-fast) ease;min-width:0;
}
.lib-card:hover{border-color:rgba(122,84,105,.36);box-shadow:0 6px 16px rgba(45,32,48,.07)}
.lib-card.is-previewing{border-color:var(--accent);box-shadow:0 0 0 2px var(--accent-soft)}
.lib-card-btn{
  width:100%;min-height:132px;padding:7px;border:0;background:transparent;
  display:flex;flex-direction:column;align-items:stretch;gap:6px;text-align:left;cursor:pointer;
}
.lib-card-btn:hover{background:transparent}
.lib-thumb{
  height:92px;border-radius:10px;background:var(--paper);border:1px solid var(--line);
  display:grid;place-items:center;overflow:hidden;padding:3px;
}
.mat-lib-thumb-svg{width:64px;height:86px;display:block;filter:drop-shadow(0 2px 6px rgba(38,28,44,.16))}
.lib-meta{display:flex;flex-direction:column;gap:2px;min-width:0;padding:0 2px}
.lib-meta strong{font-size:12.5px;color:var(--ink);line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lib-fam-tag,.lib-match-tag{
  display:inline-flex;align-self:flex-start;font-size:10px;padding:1.5px 6px;border-radius:999px;
  background:var(--paper);color:var(--muted);border:1px solid var(--line);max-width:100%;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.lib-match-tag{background:var(--accent-soft);color:var(--accent);border-color:rgba(122,84,105,.3);font-weight:600}
.quick-finger-strip{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin-top:2px}
.mini-action-btn{min-height:44px;padding:6px 10px;border-radius:12px;font-size:12.5px;font-weight:500;gap:5px}
.mini-action-btn svg{width:15px;height:15px}
.sheet-tabs-3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));flex:1;min-width:0}
.sheet-tabs-3 button{min-width:44px;padding:6px 6px;font-size:12.5px;white-space:nowrap}
.styles-pane,.sets-pane{display:flex;flex-direction:column;gap:8px;min-width:0}
.sets-keep-shape{padding:2px 4px;font-size:12.5px}
.sets-list{display:flex;flex-direction:column;gap:10px;min-width:0}
.ten-set-card{
  display:flex;flex-direction:column;gap:8px;padding:10px;border-radius:14px;
  border:1px solid var(--line-strong);background:var(--surface);min-width:0;
  transition:border-color var(--m-fast) ease,box-shadow var(--m-fast) ease;
}
.ten-set-card:hover{border-color:rgba(122,84,105,.36);box-shadow:0 6px 18px rgba(45,32,48,.07)}
.ten-set-strip{
  height:76px;border-radius:10px;background:var(--paper);border:1px solid var(--line);
  display:grid;place-items:center;padding:4px 8px;overflow:hidden;
}
.set-strip-svg{width:100%;height:68px;display:block;filter:drop-shadow(0 2px 5px rgba(38,28,44,.14))}
.ten-set-body{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0}
.ten-set-info{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1}
.ten-set-info strong{font-size:13px;color:var(--ink);line-height:1.25}
.ten-set-info small{font-size:11px;color:var(--muted);line-height:1.35}
.ten-set-apply{min-height:44px;padding:6px 12px;border-radius:999px;font-size:12.5px;flex-shrink:0}
.gizmo-handle circle,.gizmo-handle rect{transition:transform var(--m-fast) ease}
.gizmo-handle:hover circle:nth-child(2),.gizmo-handle:hover rect{stroke-width:2.4}

/* Phase A: JP/KR 3D Mood & Texture Palettes + Shape Modal Proportions + Scope Clarity */
.base-op-inline{padding:6px 10px;border-radius:12px;background:var(--surface);border:1px solid var(--line)}
.scope-hint{
  margin:0;padding:7px 10px;border-radius:10px;background:var(--paper);border:1px solid var(--line);
  font-size:11.5px;color:var(--muted);line-height:1.45;
}
.scope-hint strong{color:var(--ink)}
.scope-banner{
  margin:0;padding:8px 10px;border-radius:10px;background:var(--accent-soft);
  border:1px solid rgba(122,84,105,.32);font-size:12px;font-weight:500;color:var(--accent);line-height:1.4;
}
.mood-panel-layout{display:flex;flex-direction:column;gap:8px;min-width:0}
.mood-palette-list{display:flex;flex-direction:column;gap:10px;min-width:0}
.palette-mood-card{
  display:flex;flex-direction:column;gap:9px;padding:11px;border-radius:14px;
  border:1px solid var(--line-strong);background:var(--surface);min-width:0;
  transition:border-color var(--m-fast) ease,box-shadow var(--m-fast) ease;
}
.palette-mood-card:hover{border-color:rgba(122,84,105,.38);box-shadow:0 6px 18px rgba(45,32,48,.07)}
.mood-card-head{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0}
.mood-title-col{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1}
.mood-title-col strong{font-size:13.5px;color:var(--ink);line-height:1.25}
.mood-vibe{font-size:11px;color:var(--accent);font-weight:500;line-height:1.25}
.mood-hand-btn{min-height:44px;min-width:74px;padding:6px 11px;border-radius:999px;font-size:12px;font-weight:600;flex-shrink:0}
.mood-orbs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
.mood-orb-btn{
  min-width:44px;min-height:58px;padding:5px 2px;border-radius:12px;border:1px solid var(--line);
  background:var(--paper);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;
  cursor:pointer;transition:border-color var(--m-fast) ease,transform var(--m-fast) ease;
}
.mood-orb-btn:hover{border-color:var(--accent);transform:translateY(-1px)}
.mood-orb-btn small{font-size:10.5px;color:var(--muted);line-height:1}
.mood-orb-dot{
  position:relative;width:30px;height:30px;border-radius:50%;display:grid;place-items:center;
  border:1px solid rgba(35,28,42,.18);overflow:hidden;background:var(--swatch);
  box-shadow:inset 0 2px 4px rgba(255,255,255,.45),0 2px 6px rgba(32,24,38,.12);
}
.mood-orb-btn.is-sheer .mood-orb-dot{
  background-image:
    linear-gradient(0deg,color-mix(in srgb,var(--swatch) calc(var(--sw-op,1) * 100%),transparent),color-mix(in srgb,var(--swatch) calc(var(--sw-op,1) * 100%),transparent)),
    conic-gradient(#e7e1da 90deg,#ffffff 90deg 180deg,#e7e1da 180deg 270deg,#ffffff 270deg);
  background-size:100% 100%,8px 8px;
}
.mood-orb-btn.is-3d .mood-orb-dot{
  box-shadow:inset 2px 3px 5px rgba(255,255,255,.82),inset -2px -3px 5px rgba(24,18,34,.28),0 2px 8px rgba(32,24,38,.2);
}
.orb-op-tag{
  font-style:normal;font-size:8.5px;font-weight:700;line-height:1;padding:1px 3px;border-radius:4px;
  background:rgba(255,255,255,.84);color:#2b2330;letter-spacing:-.2px;
}
.mood-texture-foot{display:flex;flex-direction:column;gap:5px;padding-top:6px;border-top:1px dashed var(--line)}
.mood-contrast{font-size:11px;color:var(--muted);line-height:1.35}
.mood-mat-row{
  display:flex;flex-wrap:wrap;align-items:center;gap:2px 5px;
  max-width:100%;min-width:0;
}
.mood-mat-chip{flex:0 1 auto;min-height:44px;min-width:44px;padding:0 10px;font-size:11.5px;white-space:nowrap}
.shape-prop-bar{
  display:flex;flex-wrap:wrap;align-items:center;gap:8px 18px;padding:8px 20px;
  border-top:1px solid var(--line);background:var(--paper);flex-shrink:0;
}
.shape-prop-slider{
  display:inline-flex;align-items:center;gap:8px;min-height:44px;flex:1 1 200px;
  font-size:12.5px;color:var(--muted);white-space:nowrap;
}
.shape-prop-slider input{flex:1;min-width:96px;min-height:44px;accent-color:var(--accent);cursor:pointer;margin:0}
.shape-prop-slider output{min-width:38px;text-align:right;font-size:12px;font-weight:600;color:var(--ink);font-variant-numeric:tabular-nums}
.shape-modal-slant{display:inline-flex;align-items:center;gap:6px}
.shape-modal-slant button{min-height:44px;min-width:52px;padding:6px 10px;border-radius:10px;font-size:12px}
/* Touch-safe 44x44 Star Favorite Button with Subtle 28px Visual Circle (Fixed in Dark Mode too!) */
.lib-fav-btn{
  position:absolute;top:2px;right:2px;width:44px;height:44px;min-width:44px;min-height:44px;
  padding:0;border:0;border-radius:999px;background:transparent;color:var(--muted);
  display:grid;place-items:center;cursor:pointer;z-index:2;isolation:isolate;
}
.lib-fav-btn::before{
  content:"";position:absolute;inset:8px;z-index:-1;border-radius:50%;pointer-events:none;
  background:var(--fav-btn-bg);border:1px solid var(--line);
  transition:background-color var(--m-fast) ease,border-color var(--m-fast) ease;
}
.lib-fav-btn:hover{color:var(--accent);background:transparent}
.lib-fav-btn:hover::before{border-color:rgba(122,84,105,.32)}
.lib-fav-btn.is-fav{color:#c98a1e}
.lib-fav-btn.is-fav svg{fill:currentColor}
.lib-fav-btn svg{width:16px;height:16px}
.lib-empty{padding:16px 12px;border-radius:12px;background:var(--surface);border:1px dashed var(--line-strong);font-size:13px;color:var(--muted);line-height:1.5}
.samples-section{margin-top:16px;padding-top:14px;border-top:1px solid var(--line);display:flex;flex-direction:column;gap:8px}
.samples-list{display:flex;flex-direction:column;gap:8px}
.sample-load-card{
  width:100%;min-height:54px;padding:10px 12px;border-radius:14px;border:1px solid var(--line-strong);
  background:var(--surface);box-shadow:var(--shadow-xs);color:var(--ink);display:flex;align-items:center;justify-content:space-between;
  gap:10px;text-align:left;cursor:pointer;
}
.sample-load-card:hover{border-color:rgba(122,84,105,.38);background:var(--accent-soft)}
.sample-load-card>div{display:flex;flex-direction:column;gap:3px;min-width:0}
.sample-load-card strong{font-size:13.5px;color:var(--ink)}
.sample-load-card small{font-size:12px;color:var(--muted);line-height:1.35}
.sample-cta{
  flex-shrink:0;font-size:12px;font-weight:600;color:var(--accent);
  padding:5px 10px;border-radius:999px;background:var(--accent-soft);border:1px solid rgba(122,84,105,.32);
}

/* Obsidian Dark Theme (Crisp Architectural Hairlines + Harmonious Light-Canvas Adaptation) */
html[data-theme=dark]{
  --ink:#f1eaf3;
  --muted:#a699ad;
  --accent:#cca0b9;
  --accent-soft:rgba(204,160,185,.15);
  --surface:#26212c;
  --sheet-bg:#1d1922;
  --paper:#2c2633;
  --stage:#19161d;
  --line:rgba(255,255,255,.09);
  --line-strong:rgba(255,255,255,.15);
  --ghost-hover:rgba(255,255,255,.07);
  --track-bg:rgba(0,0,0,.28);
  --chrome-glass:rgba(27,23,32,.78);
  --surface-glass:rgba(38,33,44,.86);
  --fav-btn-bg:rgba(30,25,36,.82);
  --shadow:0 22px 60px rgba(0,0,0,.48);
  --shadow-soft:0 10px 30px rgba(0,0,0,.32);
  --shadow-xs:0 1px 2px rgba(0,0,0,.24);
  --g-bg:linear-gradient(148deg,rgba(182,134,162,.92) 0%,rgba(148,104,130,.96) 54%,rgba(118,78,102,.98) 100%);
  --g-bg-hover:linear-gradient(148deg,rgba(196,148,176,.96) 0%,rgba(162,116,143,.98) 54%,rgba(130,88,113,1) 100%);
  --g-edge:rgba(255,255,255,.22);
  --g-shadow:
    0 2px 6px rgba(0,0,0,.38),
    0 8px 22px rgba(130,82,112,.32),
    inset 0 0 0 1px var(--g-edge),
    inset 0 1.5px 1px rgba(255,255,255,.42),
    inset 0 -6px 12px rgba(20,10,18,.3);
  --g-shadow-hover:
    0 3px 10px rgba(0,0,0,.45),
    0 12px 28px rgba(154,104,134,.4),
    inset 0 0 0 1px rgba(255,255,255,.32),
    inset 0 1.5px 1px rgba(255,255,255,.54),
    inset 0 -6px 12px rgba(20,10,18,.34);
}
html[data-theme=dark] .primary{color:#fff}
html[data-theme=dark] .resizer-pill{background:rgba(255,255,255,.22)}
html[data-theme=dark] .stage-layers-btn[aria-pressed=true],
html[data-theme=dark] .stage-layers-btn[aria-pressed=true]:hover:not(:disabled){color:#1c1722}
html[data-theme=dark] .stage-layers-btn[aria-pressed=true] .layers-count-pill{background:rgba(28,23,34,.22);color:#1c1722}
html[data-theme=dark] .client-ban-strip{background:rgba(42,31,42,.92);border-color:rgba(229,122,148,.4);color:#f5eff5}
html[data-theme=dark] .client-ban-strip.is-collapsed{background:rgba(38,33,44,.94)}
html[data-theme=dark] .client-strip-name{color:#f5eff5}
html[data-theme=dark] .drag-handle span{background:rgba(38,33,46,.92);color:#e9cfe0;border-color:rgba(204,160,185,.5)}

/* Context-Aware Light-Linen Stage Adaptation when Dark UI is paired with Light Linen Canvas */
html[data-theme=dark] .stage.bg-light{color:#27202b}
html[data-theme=dark] .stage.bg-light .stage-bar .outline,
html[data-theme=dark] .stage.bg-light .stage-bar .chip-btn.outline,
html[data-theme=dark] .stage.bg-light .stage-bar .icon-btn.outline,
html[data-theme=dark] .stage.bg-light .zoom-controls{
  background:rgba(255,255,255,.78);color:#27202b;border-color:rgba(47,39,50,.14);box-shadow:0 1px 2px rgba(40,26,38,.05);
}
html[data-theme=dark] .stage.bg-light .stage-bar .outline:hover:not(:disabled){
  background:#f5edf2;border-color:rgba(122,84,105,.32);color:#7a5469;
}
html[data-theme=dark] .stage.bg-light .spec-chip{
  background:rgba(255,255,255,.76);color:#27202b;border-color:rgba(47,39,50,.14);
}
html[data-theme=dark] .stage.bg-light .procreate-rail{
  background:rgba(252,250,247,.84);color:#27202b;border-color:rgba(47,39,50,.14);
}
html[data-theme=dark] .stage.bg-light .rail-slider{color:#675e6c}
html[data-theme=dark] .stage.bg-light .rail-slider output{color:#27202b}
html[data-theme=dark] .stage.bg-light .board-dir,
html[data-theme=dark] .stage.bg-light .direction,
html[data-theme=dark] .stage.bg-light .drag-tip,
html[data-theme=dark] .stage.bg-light .slot-meta{color:#5e5466}
html[data-theme=dark] .stage.bg-light .slot-index{color:#7a7080}
html[data-theme=dark] .stage.bg-light .nail-slot.is-selected{
  background:rgba(255,255,255,.5);border-color:rgba(122,84,105,.36);
}
html[data-theme=dark] .stage.bg-light .nail-slot.is-selected .slot-meta{color:#7a5469}
html[data-theme=dark] .stage.bg-light .slot-dot{background:#7a5469}
html[data-theme=dark] .stage.bg-light .drag-handle span{
  background:rgba(255,255,255,.94);color:#7a5469;border-color:rgba(122,84,105,.44);
}
html[data-theme=dark] .stage.bg-light .board-zone-title{color:#27202b}
html[data-theme=dark] .stage.bg-light .studio-board-sheet{background:rgba(255,255,255,.88);color:#27202b;border-color:rgba(47,39,50,.12)}
html[data-theme=dark] .stage.bg-light .studio-board-sheet .outline{background:#fff;color:#27202b;border-color:rgba(47,39,50,.14)}
html[data-theme=dark] .stage.bg-light .studio-board-sheet .board-callout{background:#f6f3ee;color:#27202b;border-color:rgba(47,39,50,.12)}
html[data-theme=dark] .stage.bg-light .studio-board-sheet .callout-text{color:#27202b}
html[data-theme=dark] .stage.bg-light .moodboard-drop,
html[data-theme=dark] .stage.bg-light .moodboard-canvas{background:#f6f3ee;border-color:rgba(47,39,50,.16)}
html[data-theme=dark] .stage.bg-light .moodboard-drop strong{color:#27202b}
html[data-theme=dark] .bg-dark{color:#f5eff5}
html[data-theme=dark] .bg-dark .spec-chip{background:rgba(255,255,255,.09);color:#f5eff5;border-color:rgba(255,255,255,.16)}
html[data-theme=dark] .overview-light .overview-tray{background:#302b36}
html[data-theme=dark] .overview-light .overview-nail{background:#26222b;border-color:rgba(255,255,255,.1)}

/* 20-Shape Catalog Sheet (?catalog) */
.catalog-page{overflow:auto;background:#f5f3ef}
.catalog-page #app{height:auto;display:block;overflow:visible}
.catalog-page #dock-host{display:none !important}
.catalog-sheet{padding:32px 42px;max-width:1700px;margin:auto}
.catalog-sheet header{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:24px}
.catalog-sheet h1{font-size:30px;margin:6px 0}
.catalog-sheet header p{font-size:14px;color:var(--muted)}
a.outline{text-decoration:none;padding:12px 18px;border-radius:10px;color:var(--ink);white-space:nowrap;font-size:14px}
.catalog-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px}
.catalog-grid article{background:#fff;border:1px solid #e3dce6;border-radius:14px;padding:14px 16px 16px;min-width:0}
.catalog-index{display:block;font-size:12px;color:var(--muted)}
.catalog-grid svg{display:block;width:140px;height:190px;margin:0 auto 6px}
.catalog-grid h2{font-size:17px}
.catalog-grid .english{display:block;font-size:12px;color:var(--muted);margin-top:3px}
.catalog-grid code{display:block;font-size:12px;color:#79536a;margin:5px 0}
.catalog-grid p{font-size:12px;line-height:1.5;color:#655d6c;min-height:36px}
.catalog-sheet footer{font-size:12px;color:var(--muted);margin-top:22px}

/* Full prefers-reduced-motion Degradation (<=150ms Fade, Zero Displacement/Scale) */
@media(prefers-reduced-motion:reduce){
  button:active{scale:none !important}
  .primary:hover:not(:disabled){transform:none !important}
  .dock-item.is-bouncing .dock-tile{animation:none}
  .dock-tile{transition:none}
  dialog[open]{animation:vtIn 140ms ease-out both}
  dialog[open]::backdrop{animation:modalBackdropIn 120ms ease-out both}
  #toast{transform:none;transition:opacity 140ms ease-out}
  #toast.show{transform:none}
}

/* Responsive: Compact Landscape (<=1100px, e.g. 1024x768) */
@media(max-width:1100px){
  :root{--dock-w:328px}
  .topbar{padding:6px 10px;gap:6px}
  .brand-monogram{display:none}
  .project-name{max-width:116px}
  .hand-dots{display:none}
  .hand-switch button,.mode-switch button{padding:6px 9px}
  .top-tpl-btn{padding:6px 10px;font-size:12.5px}
  .top-preview span{display:none}
  .top-preview{width:44px;min-width:44px;padding:8px;justify-content:center}
  .top-actions{gap:2px}
  .top-actions>.primary{padding:8px 13px;font-size:13px;margin-left:2px}
  .save-area{min-width:66px}
  .floating-dock.mac-studio-dock{padding:5px 7px 4px;gap:2px}
  .dock-item.dock-pill{min-width:48px;min-height:54px;padding:2px 2px 3px}
  .dock-tile{width:38px;height:38px;border-radius:11px}
  .dock-tile svg{width:23px;height:23px}
  .dock-color-dot{inset:7px}
  .dock-label{font-size:10.5px}
}

/* Responsive: Portrait Tablet (768x1024, 820x1180) — Fixed Bottom Dock Bar (Strict 0px Drift) */
@media(orientation:portrait),(max-width:900px){
  #app{height:calc(100dvh - 78px)}
  .dock-host,html[data-dock-anchor="left"] .dock-host{
    left:0;right:0;bottom:0;top:auto;height:78px;max-width:none;transform:none;
    background:var(--chrome-glass);border-top:1px solid var(--line);
    backdrop-filter:blur(20px) saturate(1.7);-webkit-backdrop-filter:blur(20px) saturate(1.7);
    justify-content:center;padding:4px 8px calc(4px + env(safe-area-inset-bottom,0px));
    pointer-events:auto;
  }
  .dock-host .drag-tip,.dock-host .dock-tooltip{display:none}
  .dock-host .floating-dock.mac-studio-dock{
    background:transparent;border:0;box-shadow:none;backdrop-filter:none;-webkit-backdrop-filter:none;
    padding:2px 4px;border-radius:0;
  }
  html[data-theme="dark"] .dock-host,html[data-stage-bg="dark"] .dock-host{
    background:rgba(28,24,35,.88);border-top-color:rgba(255,255,255,.12);
  }
  .hide-landscape{display:flex !important}
  .hide-portrait{display:none !important}
  .topbar{gap:4px;padding:6px 10px}
  .top-left{gap:2px}
  .top-center{gap:4px}
  .project-name{display:none}
  .hand-dots{display:none}
  .hand-switch button,.mode-switch button{min-width:44px;padding:6px 7px;font-size:12px}
  .top-actions{gap:2px}
  .save-area{min-width:52px}
  .save-btn{padding:6px 4px;font-size:12px}
  .top-tpl-btn span,.top-preview span{display:none}
  .top-tpl-btn,.top-preview{width:44px;min-width:44px;padding:8px;justify-content:center}
  .top-actions>.primary{padding:8px 10px;font-size:12.5px;gap:4px;margin-left:1px}
  .workspace,.workspace.panel-left,.workspace.panel-closed,.workspace.panel-left.panel-closed{
    grid-template-columns:minmax(0,1fr);
    grid-template-rows:minmax(0,1fr) min(var(--sheet-h,316px),52vh);
  }
  .workspace.panel-closed,.workspace.panel-left.panel-closed{grid-template-rows:minmax(0,1fr)}
  .workspace .stage,.workspace.panel-left .stage{grid-column:1;grid-row:1;padding:12px 16px 10px}
  .workspace .studio-sheet,.workspace.panel-left .studio-sheet{
    grid-column:1;grid-row:2;border-left:0;border-right:0;border-top:1px solid var(--line);
    border-radius:20px 20px 0 0;box-shadow:0 -8px 28px rgba(45,32,48,.07);
  }
  .panel-resizer,.workspace.panel-left .panel-resizer{
    top:-8px;bottom:auto;left:0;right:0;width:auto;height:16px;cursor:row-resize;
  }
  .panel-resizer::after{top:-14px;bottom:auto;left:0;right:0;width:auto;height:44px}
  .panel-resizer::before{
    top:50%;bottom:auto;left:0;right:0;width:auto;height:2px;transform:translateY(-50%);
  }
  .resizer-pill{width:44px;height:4px}
  .panel-resizer:hover .resizer-pill,.panel-resizer:focus-visible .resizer-pill,.panel-resizer.is-active .resizer-pill{
    width:58px;height:4px;transform:scaleY(1.15);
  }
  .five-hand-board{max-height:348px}
  .panel-scroll{padding:12px 16px 16px}
  .picker-layout{display:grid;grid-template-columns:minmax(0,1.08fr) minmax(0,.92fr);gap:14px 20px;align-items:start}
  .sv-pad{height:158px}
  .brush-layout,.charm-layout,.material-layout,.board-panel-layout,.library-layout,.layers-drawer-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px 18px;align-items:start}
  .size-panel-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px 20px;align-items:start}
  .settings-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px 20px;align-items:start}
  .batch-body{grid-template-columns:1fr;gap:14px}
  .batch-preview{position:static;max-height:none;overflow:visible}
  .shape-footer{flex-direction:column;align-items:stretch;gap:10px}
  .shape-footer .modal-actions{align-self:flex-end}
  .catalog-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
  #toast,html[data-panel-side=left] #toast{
    left:50%;right:auto;top:auto;bottom:calc(min(var(--sheet-h,316px),52vh) + 90px);
    max-width:min(420px,calc(100vw - 32px));
    transform:translate3d(-50%,8px,0);border-radius:999px;
  }
  html[data-panel-side=none] #toast{
    left:50%;right:auto;top:auto;bottom:92px;
    max-width:min(420px,calc(100vw - 32px));
    transform:translate3d(-50%,8px,0);border-radius:999px;
  }
  #toast.show,html[data-panel-side=left] #toast.show,html[data-panel-side=none] #toast.show{transform:translate3d(-50%,0,0)}
}

/* Responsive: Narrow Screens (<=790px, including 768x1024 portrait, 680x960 & 390px mobile) */
@media(max-width:790px){
  .top-actions>.primary span{display:none}
  .top-actions>.primary{width:44px;min-width:44px;padding:8px;justify-content:center}
  .project-name{max-width:58px}
}
@media(max-width:720px){
  .top-center{gap:4px}
  .top-preview span,.top-actions>.primary span{display:none}
  .top-preview,.top-actions>.primary{width:44px;padding:8px}
  .drag-tip{display:none}
  .floating-dock.mac-studio-dock{padding:5px 6px 4px;gap:1px;border-radius:18px}
  .dock-item.dock-pill{min-width:45px;min-height:54px;padding:2px 1px 3px;gap:3px}
  .dock-tile{width:38px;height:38px;border-radius:10px}
  .dock-tile svg{width:22px;height:22px}
  .dock-sep{margin:0 2px 10px;height:30px}
  .dock-label{font-size:10px}
  .procreate-rail{gap:8px;padding:2px 10px}
  .rail-slider input{width:76px}
  .picker-layout,.brush-layout,.charm-layout,.material-layout,.board-panel-layout,.library-layout,.layers-drawer-layout,.size-panel-layout,.settings-layout{grid-template-columns:1fr}
  .gallery-grid{grid-template-columns:repeat(2,minmax(0,1fr));padding:12px 16px}
  .target-hands,.direction-options,.export-pair{grid-template-columns:1fr}
  .catalog-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* Mobile Phone Viewport (<=520px, e.g. 390px iPhone): Zero Horizontal Page Overflow */
@media(max-width:520px){
  #app{max-width:100vw}
  .topbar{padding:4px 8px;gap:4px;overflow-x:auto;scrollbar-width:none;justify-content:flex-start}
  .topbar::-webkit-scrollbar{display:none}
  .top-left{flex:0 0 auto}
  .project-name{display:none}
  .workspace .stage,.workspace.panel-left .stage{padding:10px 10px 8px}
  .stage-status h1{font-size:15px}
  .five-hand-board{max-height:280px}
  .five-nails-row{gap:2px}
  .nail-slot{padding:6px 2px 6px;border-radius:14px}
  .slot-meta{font-size:11px;gap:2px}
  .slot-index{display:none}
  .floating-dock.mac-studio-dock{
    max-width:calc(100vw - 16px);overflow-x:auto;overflow-y:visible;
    scrollbar-width:none;justify-content:flex-start;
  }
  .floating-dock.mac-studio-dock::-webkit-scrollbar{display:none}
}
