:root {
  color-scheme: light;
  --bg: #fbf8f6;
  --surface: #ffffff;
  --surface-2: #f5f0ee;
  --surface-3: #ede5e2;
  --text: #211b1e;
  --muted: #81767b;
  --line: #e9e1de;
  --primary: #b83468;
  --primary-dark: #8e244d;
  --primary-soft: #f7dce7;
  --ink-soft: #3b3135;
  --success: #2d7b5b;
  --shadow-lg: 0 24px 70px rgba(56, 36, 45, .10);
  --shadow-md: 0 12px 34px rgba(56, 36, 45, .075);
  --shadow-sm: 0 5px 16px rgba(56, 36, 45, .06);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 17px;
  --radius-sm: 12px;
}

body.dark {
  color-scheme: dark;
  --bg: #161214;
  --surface: #211b1e;
  --surface-2: #2b2427;
  --surface-3: #362d31;
  --text: #fbf7f5;
  --muted: #b4a9ae;
  --line: #3b3236;
  --primary: #ee8db3;
  --primary-dark: #ffb4d0;
  --primary-soft: #4a2836;
  --ink-soft: #ede4e7;
  --shadow-lg: 0 26px 70px rgba(0, 0, 0, .30);
  --shadow-md: 0 12px 34px rgba(0, 0, 0, .22);
  --shadow-sm: 0 5px 16px rgba(0, 0, 0, .16);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 100% -10%, rgba(236, 172, 198, .18), transparent 25rem),
    var(--bg);
  color: var(--text);
  font-family: "Avenir Next", Avenir, "Segoe UI", Helvetica, Arial, sans-serif;
  letter-spacing: -.012em;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { color: inherit; -webkit-tap-highlight-color: transparent; }
button, select { cursor: pointer; }
svg { display: block; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 24%, transparent);
  outline-offset: 2px;
}

.app-shell { width: min(1240px, 100%); margin: 0 auto; padding: 0 28px 120px; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 12px 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 62%, transparent);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}
.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 13px 13px 17px 17px;
  background: var(--text);
  color: var(--surface);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-style: italic;
  box-shadow: var(--shadow-sm);
}
.brand-copy strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  line-height: 1;
  letter-spacing: -.035em;
}
.brand-copy small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .055em; text-transform: uppercase; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-button, .avatar-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
}
.icon-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.avatar-button { border: 0; background: var(--primary); color: white; font-size: 13px; font-weight: 900; }

.view { display: none; animation: viewIn .24s ease both; }
.view.active { display: block; }
@keyframes viewIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.studio-intro, .section-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 42px 2px 28px;
}
.eyebrow, .micro-label {
  display: inline-block;
  color: var(--primary);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .16em;
}
.studio-intro h1, .section-intro h1 {
  margin: 7px 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 5vw, 65px);
  line-height: .96;
  letter-spacing: -.055em;
}
.studio-intro p, .section-intro p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.55; }
.quiet-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 12px;
  font-weight: 850;
  box-shadow: var(--shadow-sm);
}
.quiet-action svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(290px, .72fr); gap: 18px; align-items: start; }
.panel { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-md); }
.canvas-panel { overflow: hidden; padding: 23px; }
.canvas-topline { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.set-name-block h2 { margin: 4px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(25px, 3vw, 34px); line-height: 1; letter-spacing: -.045em; }
.micro-label { color: var(--muted); letter-spacing: .12em; }
.hand-tabs { display: inline-grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 4px; border-radius: 999px; background: var(--surface-2); }
.hand-tab { min-width: 64px; min-height: 34px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 850; }
.hand-tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.nail-stage {
  position: relative;
  isolation: isolate;
  min-height: 500px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  margin: 18px 0;
  padding: 18px 18px 14px;
  overflow: hidden;
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 35%, rgba(255,255,255,.96), rgba(255,255,255,.32) 48%, transparent 70%),
    linear-gradient(145deg, #f1e0e4 0%, #e9e2ec 55%, #f2e7e1 100%);
}
body.dark .nail-stage {
  background: radial-gradient(circle at 50% 34%, rgba(255,255,255,.09), transparent 52%), linear-gradient(145deg, #372930, #2e2933 57%, #332724);
}
.nail-stage::before {
  content: "";
  position: absolute;
  inset: 7%;
  z-index: -1;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 50%;
  opacity: .75;
}
.photo-badge {
  position: absolute;
  z-index: 4;
  left: 16px;
  top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 29px;
  padding: 0 10px;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 999px;
  background: rgba(255,255,255,.66);
  color: #6d5a63;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
  box-shadow: 0 5px 18px rgba(62,36,49,.08);
}
.photo-badge span { width: 6px; height: 6px; border-radius: 50%; background: #45a879; box-shadow: 0 0 0 3px rgba(69,168,121,.14); }
.nail-row {
  position: relative;
  width: min(480px, 100%);
  aspect-ratio: 1;
  flex: 0 0 auto;
}
.hand-photo {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
  filter: drop-shadow(0 28px 28px rgba(76,46,55,.16));
}
.nail-button {
  position: absolute;
  z-index: 3;
  width: 10%;
  height: 15%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  transform-origin: center center;
  -webkit-tap-highlight-color: transparent;
}
.nail-button::after {
  content: "";
  position: absolute;
  inset: -12%;
  border: 2px solid transparent;
  border-radius: 999px;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.nail-button:hover::after,
.nail-button:focus-visible::after {
  border-color: rgba(255,255,255,.88);
  background: rgba(255,255,255,.08);
  transform: scale(1.03);
}
.nail-button:focus-visible { outline: none; }
.hand-model .nail-button .nail {
  width: 68%;
  height: 88%;
  flex: 0 0 auto;
  opacity: .88;
  border-color: rgba(118, 58, 78, .2);
  box-shadow:
    0 3px 8px rgba(83,43,61,.12),
    inset 4px 7px 10px rgba(255,255,255,.16),
    inset -4px -6px 9px rgba(76,30,50,.09);
}
.hand-model .nail-button.short .nail { width: 62%; height: 73%; margin-top: 12%; }
.hand-model .nail-button.medium .nail { width: 68%; height: 88%; }
.hand-model .nail-button.long .nail { width: 73%; height: 106%; transform: translateY(-10%); }
.nail-button.left-thumb { left: 78.8%; top: 39.3%; transform: rotate(16deg); width: 10.5%; height: 15.5%; }
.nail-button.left-index { left: 55.3%; top: 7.3%; transform: rotate(2deg); }
.nail-button.left-middle { left: 43.1%; top: 1.2%; }
.nail-button.left-ring { left: 30.7%; top: 5.9%; transform: rotate(-2deg); }
.nail-button.left-pinky { left: 18.0%; top: 20.0%; transform: rotate(-4deg); width: 9%; height: 14%; }
.nail-button.right-thumb { left: 11.6%; top: 38.7%; transform: rotate(-16deg); width: 10.5%; height: 15.5%; }
.nail-button.right-index { left: 33.7%; top: 8.2%; transform: rotate(-2deg); }
.nail-button.right-middle { left: 46.8%; top: 3.5%; }
.nail-button.right-ring { left: 59.8%; top: 8.5%; transform: rotate(2deg); }
.nail-button.right-pinky { left: 74.5%; top: 24.3%; transform: rotate(4deg); width: 9%; height: 14%; }
.nail {
  position: relative;
  overflow: hidden;
  width: 61px;
  height: 128px;
  border: 1.5px solid rgba(255,255,255,.72);
  background: #c65a86;
  box-shadow:
    0 7px 13px rgba(83,43,61,.18),
    inset 6px 8px 12px rgba(255,255,255,.24),
    inset -5px -7px 12px rgba(76,30,50,.13);
  transition: width .18s ease, height .18s ease, border-radius .18s ease, clip-path .18s ease;
}
.editor-preview.nail { width: 61px; height: 128px; }
.nail.short { width: 56px; height: 98px; }
.nail.medium { width: 61px; height: 128px; }
.nail.long { width: 65px; height: 154px; }
.nail.almond { border-radius: 52% 52% 28% 28% / 19% 19% 8% 8%; clip-path: polygon(50% 0, 75% 7%, 92% 23%, 100% 100%, 0 100%, 8% 23%, 25% 7%); }
.nail.coffin { border-radius: 11px 11px 13px 13px; clip-path: polygon(23% 0, 77% 0, 94% 22%, 100% 100%, 0 100%, 6% 22%); }
.nail.square { border-radius: 11px 11px 8px 8px; }
.nail.round { border-radius: 50% 50% 28% 28% / 24% 24% 8% 8%; }
.nail-art, .nail::before, .nail::after { pointer-events: none; }
.nail.finish-glitter::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(circle, rgba(255,255,255,.94) 0 1px, transparent 1.5px), radial-gradient(circle, rgba(255,225,242,.92) 0 1px, transparent 1.5px); background-size: 9px 11px, 13px 15px; background-position: 2px 1px, 5px 7px; mix-blend-mode: screen; opacity: .8; }
.nail.finish-chrome::after { content: ""; position: absolute; inset: -35% -45%; background: linear-gradient(105deg, transparent 33%, rgba(255,255,255,.82) 44%, rgba(255,221,241,.38) 51%, transparent 63%); transform: rotate(6deg); }
.nail.finish-matte { filter: saturate(.82); box-shadow: 0 6px 12px rgba(62,36,49,.13), inset 5px 5px 10px rgba(255,255,255,.10); }
.nail.finish-cat-eye::after { content: ""; position: absolute; inset: -12%; background: radial-gradient(ellipse at 42% 50%, rgba(255,255,255,.72), transparent 14%, transparent 30%); transform: rotate(-16deg); mix-blend-mode: screen; }
.nail.finish-jelly { opacity: .86; }
.nail.art-french::before { content: ""; position: absolute; top: 0; left: 3%; width: 94%; height: 24%; border-radius: 50% 50% 38% 38%; background: rgba(255,255,255,.92); box-shadow: 0 3px 7px rgba(85,56,73,.08); }
.nail.art-swirl::before { content: ""; position: absolute; inset: 20% -20% auto -12%; height: 20%; border-radius: 50%; border: 4px solid rgba(255,255,255,.88); transform: rotate(-22deg); }
.nail.art-flower::before { content: "✿"; position: absolute; left: 50%; top: 44%; transform: translate(-50%,-50%); color: rgba(255,255,255,.96); font-size: 20px; text-shadow: 0 2px 4px rgba(84,48,68,.18); }
.nail.art-stars::before { content: "✦ · ✧"; position: absolute; left: 50%; top: 42%; width: 100%; transform: translate(-50%,-50%) rotate(-14deg); color: rgba(255,255,255,.96); font-size: 12px; letter-spacing: 1px; }
.nail.art-gems::before { content: "◆"; position: absolute; left: 50%; top: 44%; transform: translate(-50%,-50%); color: #fff8f5; font-size: 15px; filter: drop-shadow(0 1px 3px rgba(56,32,49,.3)); }
.nail.art-ombre::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(255,255,255,.78), transparent 58%); }
.nail-number { display: none; }
.stage-hint {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  margin: 0;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.6);
  border-radius: 999px;
  background: rgba(255,255,255,.7);
  color: #68555e;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  backdrop-filter: blur(10px);
}
body.dark .photo-badge,
body.dark .stage-hint { background: rgba(35,27,31,.72); color: #e3d8dc; border-color: rgba(255,255,255,.12); }

.quick-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tool-button { display: flex; align-items: center; gap: 11px; min-height: 64px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); text-align: left; }
.tool-icon { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 11px; background: var(--primary-soft); color: var(--primary); font-size: 17px; }
.tool-button strong, .tool-button small { display: block; }
.tool-button strong { font-size: 12px; }
.tool-button small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.canvas-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.set-summary { display: flex; flex-wrap: wrap; gap: 6px; }
.summary-tag { padding: 6px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 10px; font-weight: 850; }
.primary-actions { display: flex; gap: 8px; }
.primary-button, .secondary-button { min-height: 44px; padding: 0 16px; border-radius: 13px; font-size: 12px; font-weight: 900; }
.primary-button { border: 1px solid var(--primary); background: var(--primary); color: white; box-shadow: 0 8px 18px color-mix(in srgb, var(--primary) 25%, transparent); }
.primary-button:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.secondary-button { border: 1px solid var(--line); background: var(--surface); color: var(--text); }

.project-panel { padding: 23px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 21px; }
.panel-heading h2 { margin: 5px 0 0; font-size: 22px; line-height: 1.05; letter-spacing: -.035em; }
.field { display: grid; gap: 7px; margin-bottom: 15px; }
.field > span, .segmented-field > span { color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .055em; text-transform: uppercase; }
input, select { width: 100%; height: 46px; padding: 0 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--text); font-size: 13px; }
input::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.name-field input { height: 52px; background: var(--surface); font-family: Georgia, "Times New Roman", serif; font-size: 18px; letter-spacing: -.025em; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.segmented-field { margin-top: 17px; }
.segmented { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 8px; }
.segmented.three { grid-template-columns: repeat(3, 1fr); }
.segment { min-height: 42px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--muted); font-size: 11px; font-weight: 850; }
.shape-segments .segment { min-height: 58px; display: flex; align-items: center; justify-content: center; gap: 7px; }
.segment.active { border-color: var(--text); background: var(--text); color: var(--surface); box-shadow: var(--shadow-sm); }
.shape-icon { display: block; width: 13px; height: 24px; border: 1.5px solid currentColor; opacity: .9; }
.almond-icon { border-radius: 50% 50% 32% 32% / 23% 23% 10% 10%; clip-path: polygon(50% 0, 82% 17%, 100% 100%, 0 100%, 18% 17%); }
.coffin-icon { border-radius: 2px; clip-path: polygon(25% 0, 75% 0, 100% 25%, 100% 100%, 0 100%, 0 25%); }
.square-icon { border-radius: 3px; }
.round-icon { border-radius: 50% 50% 28% 28% / 22% 22% 8% 8%; }
.project-note { display: flex; align-items: center; gap: 11px; margin-top: 20px; padding: 13px; border-radius: 15px; background: var(--surface-2); }
.project-note > span { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; background: var(--surface); color: var(--primary); font-family: Georgia, serif; font-size: 20px; font-weight: 700; }
.project-note p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.project-note strong { color: var(--text); font-size: 11px; }

.recipe-panel { margin-top: 18px; padding: 24px; }
.recipe-heading { align-items: center; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 999px; background: color-mix(in srgb, var(--success) 10%, var(--surface)); color: var(--success); font-size: 10px; font-weight: 900; }
.status-pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 12%, transparent); }
.recipe-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 20px; }
.recipe-stat { display: grid; gap: 5px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.recipe-stat span { color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.recipe-stat strong { font-size: 17px; }
.recipe-list { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; counter-reset: recipe; }
.recipe-list li { counter-increment: recipe; display: grid; grid-template-columns: 29px 1fr; gap: 10px; align-items: start; color: var(--muted); font-size: 12px; line-height: 1.55; }
.recipe-list li::before { content: counter(recipe); width: 27px; height: 27px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--primary); font-size: 10px; font-weight: 900; }

.section-intro { padding-top: 42px; }
.closet-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.search-field { width: min(350px, 100%); height: 46px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.search-field svg { width: 17px; flex: 0 0 auto; fill: none; stroke: var(--muted); stroke-width: 1.7; stroke-linecap: round; }
.search-field input { height: 42px; padding: 0; border: 0; background: transparent; }
.filter-chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.filter-chip { min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 10px; font-weight: 900; }
.filter-chip.active { border-color: var(--text); background: var(--text); color: var(--surface); }
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.product-card { position: relative; overflow: hidden; min-height: 205px; padding: 14px; border: 1px solid var(--line); border-radius: 19px; background: var(--surface); box-shadow: var(--shadow-sm); }
.product-swatch { width: 100%; height: 92px; margin-bottom: 14px; border-radius: 14px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.52); }
.product-card h3 { margin: 0 0 4px; font-size: 14px; }
.product-card p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.product-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.product-type { padding: 5px 8px; border-radius: 999px; background: var(--surface-2); color: var(--primary); font-size: 9px; font-weight: 900; }
.delete-product { border: 0; background: transparent; color: var(--muted); font-size: 16px; }
.empty-state { grid-column: 1 / -1; padding: 54px 24px; text-align: center; border: 1px dashed var(--line); border-radius: 20px; background: var(--surface); color: var(--muted); }
.empty-state strong { color: var(--text); }
.empty-state p { margin: 7px 0 0; font-size: 12px; }

.lookbook-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.look-card { overflow: hidden; border: 1px solid var(--line); border-radius: 21px; background: var(--surface); box-shadow: var(--shadow-sm); }
.look-preview { min-height: 225px; display: flex; justify-content: center; align-items: flex-end; gap: 8px; padding: 35px 15px 29px; background: linear-gradient(145deg, #f1dce3, #e9e1ee 57%, #f0e5df); }
body.dark .look-preview { background: linear-gradient(145deg, #3a2931, #302937 57%, #392d2b); }
.look-preview .nail { width: 31px; height: 72px; border-width: 1.5px; }
.look-preview .nail.short { width: 28px; height: 55px; }
.look-preview .nail.long { width: 34px; height: 88px; }
.look-content { padding: 17px; }
.look-content h3 { margin: 0 0 6px; font-family: Georgia, serif; font-size: 20px; letter-spacing: -.03em; }
.look-content p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.look-actions { display: flex; gap: 8px; margin-top: 14px; }
.look-actions button { flex: 1; min-height: 38px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); font-size: 10px; font-weight: 900; }

.bottom-nav {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  padding: 6px;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface) 93%, transparent);
  box-shadow: 0 18px 50px rgba(50, 30, 39, .18);
  backdrop-filter: blur(20px);
}
.nav-item { width: 92px; min-height: 55px; display: grid; place-items: center; align-content: center; gap: 3px; padding: 5px; border: 0; border-radius: 15px; background: transparent; color: var(--muted); }
.nav-item svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-item small { font-size: 9px; font-weight: 900; }
.nav-item.active { background: var(--text); color: var(--surface); }

.sheet-backdrop { position: fixed; z-index: 70; inset: 0; background: rgba(28,19,23,.45); opacity: 0; pointer-events: none; transition: opacity .22s ease; backdrop-filter: blur(4px); }
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.editor-sheet { position: fixed; z-index: 80; top: 0; right: 0; width: min(470px, 100%); height: 100%; overflow-y: auto; padding: 22px 24px 28px; border-left: 1px solid var(--line); background: var(--surface); box-shadow: -24px 0 70px rgba(38,24,31,.22); transform: translateX(105%); transition: transform .26s cubic-bezier(.2,.8,.2,1); }
.editor-sheet.open { transform: translateX(0); }
.sheet-handle { display: none; width: 44px; height: 4px; margin: 0 auto 15px; border-radius: 99px; background: var(--surface-3); }
.sheet-heading { display: flex; align-items: flex-start; justify-content: space-between; }
.sheet-heading h2 { margin: 5px 0 0; font-family: Georgia, serif; font-size: 30px; letter-spacing: -.04em; }
.editor-preview-wrap { position: relative; isolation: isolate; min-height: 190px; display: grid; place-items: center; overflow: hidden; margin: 18px 0 12px; border-radius: 20px; background: linear-gradient(145deg, #f2e4e8, #ece5ef); }
body.dark .editor-preview-wrap { background: linear-gradient(145deg, #392b31, #302a36); }
.preview-orbit { position: absolute; z-index: -1; width: 150px; height: 150px; border: 1px solid rgba(255,255,255,.65); border-radius: 50%; }
.editor-preview { transform: scale(1.24); }
.editor-section { padding: 19px 0; border-top: 1px solid var(--line); }
.editor-section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.editor-section-heading h3 { margin: 0; font-size: 13px; }
.editor-section-heading span { color: var(--muted); font-size: 10px; font-weight: 800; }
.text-button { padding: 0; border: 0; background: transparent; color: var(--primary); font-size: 10px; font-weight: 900; }
.color-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 9px; }
.color-swatch { aspect-ratio: 1; border: 3px solid transparent; border-radius: 50%; background: var(--swatch); box-shadow: inset 0 0 0 1px rgba(53,31,42,.12); }
.color-swatch.active { border-color: var(--surface); outline: 2px solid var(--text); transform: scale(1.08); }
.option-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.option-button { min-height: 43px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--muted); font-size: 10px; font-weight: 900; }
.option-button.active { border-color: var(--text); background: var(--text); color: var(--surface); }
.sheet-actions { position: sticky; bottom: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 15px 0 max(2px, env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--surface) 78%, transparent); }

.modal { width: min(520px, calc(100% - 28px)); padding: 0; border: 1px solid var(--line); border-radius: 23px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.modal::backdrop { background: rgba(28,19,23,.48); backdrop-filter: blur(4px); }
.modal form { padding: 24px; }
.modal-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
.modal-heading h2 { margin: 5px 0 0; font-family: Georgia, serif; font-size: 27px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 21px; }
.color-field input[type="color"] { padding: 5px; }
.toast { position: fixed; z-index: 110; left: 50%; bottom: 98px; transform: translate(-50%, 18px); padding: 11px 15px; border-radius: 12px; background: var(--text); color: var(--surface); font-size: 11px; font-weight: 850; box-shadow: var(--shadow-md); opacity: 0; pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 980px) {
  .workspace-grid { grid-template-columns: 1fr; }
  .project-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
  .project-panel .panel-heading, .project-panel .name-field, .project-panel .segmented-field, .project-note { grid-column: 1 / -1; }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 720px) {
  .app-shell { padding: 0 13px 106px; }
  .topbar { min-height: 64px; }
  .brand-copy small { display: none; }
  .brand-mark { width: 36px; height: 36px; font-size: 20px; }
  .brand-copy strong { font-size: 19px; }
  .top-actions .icon-button { display: none; }
  .avatar-button { width: 36px; height: 36px; }
  .studio-intro, .section-intro { align-items: center; padding: 28px 2px 20px; }
  .studio-intro h1, .section-intro h1 { font-size: 42px; }
  .studio-intro p, .section-intro p { max-width: 280px; font-size: 12px; }
  .quiet-action { min-width: 42px; min-height: 42px; justify-content: center; padding: 0; font-size: 0; }
  .quiet-action svg { width: 18px; }
  .panel { border-radius: 21px; }
  .canvas-panel { padding: 15px; }
  .canvas-topline { padding: 3px 2px 0; }
  .set-name-block h2 { font-size: 25px; }
  .nail-stage { min-height: 365px; margin: 14px 0; padding: 24px 8px 22px; border-radius: 18px; }
  .nail-row { width: min(360px, 100%); height: 280px; }
  .quick-tools { gap: 8px; }
  .tool-button { min-height: 57px; padding: 8px 9px; }
  .tool-icon { width: 31px; height: 31px; }
  .tool-button strong { font-size: 10px; }
  .tool-button small { font-size: 9px; }
  .canvas-footer { align-items: stretch; flex-direction: column; margin-top: 14px; padding-top: 14px; }
  .set-summary { min-height: 24px; }
  .primary-actions { width: 100%; }
  .primary-actions button { flex: 1; }
  .project-panel { display: block; padding: 19px; }
  .recipe-panel { padding: 19px; }
  .recipe-grid { grid-template-columns: repeat(3, 1fr); }
  .recipe-stat { padding: 11px 9px; }
  .recipe-stat strong { font-size: 14px; }
  .recipe-list li { font-size: 11px; }
  .section-intro { align-items: flex-end; }
  .closet-toolbar { align-items: stretch; flex-direction: column; }
  .search-field { width: 100%; }
  .filter-chips { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; padding-bottom: 3px; scrollbar-width: none; }
  .filter-chips::-webkit-scrollbar { display: none; }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .lookbook-grid { grid-template-columns: 1fr; }
  .bottom-nav { width: calc(100% - 26px); justify-content: stretch; bottom: max(10px, env(safe-area-inset-bottom)); }
  .nav-item { flex: 1; width: auto; }
  .editor-sheet { top: auto; bottom: 0; width: 100%; height: min(91vh, 790px); padding: 12px 18px 22px; border: 0; border-radius: 25px 25px 0 0; transform: translateY(105%); }
  .editor-sheet.open { transform: translateY(0); }
  .sheet-handle { display: block; }
  .editor-preview-wrap { min-height: 158px; margin-top: 12px; }
  .editor-preview { transform: scale(1.05); }
  .color-grid { grid-template-columns: repeat(8, 1fr); gap: 8px; }
}

@media (max-width: 410px) {
  .studio-intro h1, .section-intro h1 { font-size: 38px; }
  .studio-intro p { max-width: 245px; }
  .canvas-topline { align-items: flex-start; }
  .hand-tabs { margin-top: 1px; }
  .hand-tab { min-width: 53px; padding-inline: 9px; }
  .nail-stage { min-height: 338px; }
  .nail-row { width: min(318px, 100%); height: 255px; }
  .tool-button small { display: none; }
  .recipe-grid { gap: 6px; }
  .recipe-stat span { font-size: 8px; }
  .recipe-stat strong { font-size: 13px; }
  .two-col { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: 1fr; }
  .color-grid { grid-template-columns: repeat(7, 1fr); }
}


/* Photo-model responsive overrides */
@media (max-width: 720px) {
  .nail-stage { min-height: 410px; padding: 10px 4px 12px; }
  .nail-row { width: min(390px, 112%); height: auto; }
  .photo-badge { left: 10px; top: 10px; }
  .stage-hint { bottom: 10px; }
  .hand-model .nail-button .nail { width: 68%; height: 88%; }
  .hand-model .nail-button.short .nail { width: 62%; height: 73%; }
  .hand-model .nail-button.long .nail { width: 73%; height: 106%; }
}
@media (max-width: 410px) {
  .nail-stage { min-height: 365px; }
  .nail-row { width: min(350px, 116%); height: auto; }
  .photo-badge { font-size: 8px; }
  .stage-hint { font-size: 8px; }
}
