/* Design page: big mockup on the left (sticky), steps + quote on the right. Phones stack, with a price bar pinned. */
.studio { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(380px, 1fr); gap: 32px; padding: 28px 0 80px; align-items: start; }
@media (max-width: 900px) { .studio { grid-template-columns: 1fr; padding-top: 14px; padding-bottom: 120px; gap: 20px; } }

/* ---------- Mockup ---------- */
.stage-col { position: sticky; top: 88px; }
@media (max-width: 900px) { .stage-col { position: static; } }
/* As big as the column allows, but never taller than the window. */
.stage { position: relative; width: min(100%, calc((100vh - 150px) * 600 / 700)); margin: 0 auto; aspect-ratio: 600 / 700;
  border-radius: var(--r-lg); user-select: none; -webkit-user-select: none; touch-action: none; overflow: hidden; }
@media (max-width: 900px) { .stage { width: 100%; } }
.garment, .garment svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.print-area { position: absolute; outline: 1.5px dashed transparent; transition: outline-color .2s; }
/* No outline at rest; a faint one shows only while a layer is dragged, so a print that stops at the edge makes sense. */
.print-area.dragging { outline-color: rgba(107, 112, 92, .4); }
.stage.dark-shirt .print-area.dragging { outline-color: rgba(255, 255, 255, .3); }
.stage-top { position: absolute; top: 14px; left: 14px; right: 14px; display: flex; justify-content: flex-start; pointer-events: none; }
/* Shirt switcher: the pill names the shirt on screen; tap for the others in the order */
.item-switch { position: relative; pointer-events: auto; min-width: 0; }
.stage-item { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; border: 1px solid var(--line); cursor: pointer; font-size: 13px; font-weight: 600;
  background: rgba(255, 255, 255, .96); color: var(--text-strong); border-radius: var(--r-pill); padding: 7px 10px 7px 8px; box-shadow: var(--shadow-soft); }
.stage-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-item svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--ease); }
.stage-item[aria-expanded="true"] svg { transform: rotate(180deg); }
.item-switch .dot { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .2); flex: none; }
.item-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 6; min-width: 240px; max-width: calc(100vw - 40px); display: grid; gap: 2px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lift); }
.item-menu button { display: grid; grid-template-columns: 16px 1fr auto; align-items: center; gap: 10px; border: 0; background: none; border-radius: 11px; padding: 11px 12px;
  text-align: left; font-size: 14.5px; color: var(--text-strong); cursor: pointer; }
.item-menu button:hover { background: var(--bg); }
.item-menu button[aria-checked="true"] { background: var(--bg-2); font-weight: 600; }
.item-menu small { font-size: 12.5px; color: var(--muted); font-weight: 500; }
/* Front/back switch: dark pill on the mockup, so it reads on any shirt color. */
.side-switch { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; gap: 4px; padding: 5px;
  background: var(--dark); border-radius: var(--r-pill); box-shadow: 0 0 0 1.5px rgba(255,255,255,.22), 0 10px 30px -10px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.08); }
.side-switch button { border: 0; background: none; color: var(--on-dark-muted); font-family: var(--font-display); font-weight: 700; font-size: 13px;
  letter-spacing: .08em; text-transform: uppercase; padding: 10px 22px; border-radius: var(--r-pill); cursor: pointer;
  transition: background .35s var(--ease), color .35s var(--ease); display: inline-flex; align-items: center; gap: 8px; }
.side-switch button:hover { color: var(--on-dark); }
.side-switch button[aria-selected="true"] { background: var(--on-dark); color: var(--dark); }
.side-switch button.has-art::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #8FC79F; }
.stage-hint { color: var(--muted); font-size: 13.5px; margin: 12px 4px 0; text-align: center; }

/* ---------- Steps ---------- */
.panel { display: grid; gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow-soft); }
.card-title { display: flex; align-items: center; gap: 10px; font-size: 18px; margin-bottom: 14px; }
.card-title em { font-style: normal; }
.card-title span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-wash); color: var(--accent-deep); font-size: 13px; }
.card-sub { color: var(--muted); font-size: 14px; margin: -6px 0 14px; }

.drop { display: grid; gap: 4px; place-items: center; text-align: center; border: 1.5px dashed var(--line-strong); border-radius: var(--r-sm);
  padding: 26px 16px; cursor: pointer; background: var(--bg); transition: border-color .2s, background .2s; position: relative; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-wash); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop b { color: var(--text-strong); }
.drop span { font-size: 13px; color: var(--muted); }
.lib-picks { margin-bottom: 12px; }
.lib-picks p { font-size: 13.5px; font-weight: 600; color: var(--text-strong); margin: 0 0 8px; }
.lib-picks div { display: flex; flex-wrap: wrap; gap: 8px; }
.lib-pick { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--line); background: var(--surface); border-radius: var(--r-sm); padding: 6px 12px 6px 6px; cursor: pointer; font-size: 13.5px; }
.lib-pick:hover { border-color: var(--accent); }
.lib-pick img { width: 40px; height: 40px; }

.icon-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--r-pill);
  padding: 7px 13px 7px 10px; font-size: 13px; font-weight: 600; color: var(--text-strong); cursor: pointer; transition: border-color .2s var(--ease), background .2s var(--ease); }
.icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { border-color: var(--accent); }
.icon-btn.danger:hover { border-color: var(--bad); color: var(--bad); background: var(--bad-wash); }
.quality { font-size: 12.5px; font-weight: 600; border-radius: var(--r-pill); padding: 4px 10px; }
.quality.good { background: var(--good-wash); color: var(--good); }
.quality.warn { background: var(--warn-wash); color: var(--warn); }
.quality.bad { background: var(--bad-wash); color: var(--bad); }
.fix-offer { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; background: var(--warn-wash); border-radius: var(--r-sm); padding: 12px 14px; cursor: pointer; }
.fix-offer input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--text-strong); }
.fix-offer b { color: var(--text-strong); font-size: 14.5px; }
.fix-offer em { font-style: normal; font-weight: 600; color: var(--warn); font-size: 14px; }
.fix-offer small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.presets { display: flex; flex-wrap: wrap; gap: 8px; }
.presets button { border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--r-pill); padding: 6px 13px; font-size: 13px; cursor: pointer; }
.presets button:hover { border-color: var(--accent); }
.check { display: flex; align-items: center; gap: 9px; font-size: 14.5px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--text-strong); }
.side-note { font-size: 13.5px; color: var(--muted); margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.side-note button { border: 0; background: none; padding: 0; color: var(--accent-deep); font-weight: 600; text-decoration: underline; cursor: pointer; font-size: inherit; }

/* Line items */
.items { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.item-chip { display: inline-flex; align-items: center; gap: 8px; border: 1.5px solid var(--line); background: var(--surface);
  border-radius: var(--r-pill); padding: 6px 8px 6px 10px; font-size: 13.5px; cursor: pointer; color: var(--text); }
.item-chip[aria-current="true"] { border-color: var(--text-strong); color: var(--text-strong); font-weight: 600; }
.item-chip .dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,.18); flex: none; }
.item-chip .n { background: var(--bg-2); border-radius: var(--r-pill); padding: 1px 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.item-chip .n.zero { background: var(--warn-wash); color: var(--warn); }
.item-chip .rm { border: 0; background: none; width: 20px; height: 20px; border-radius: 50%; color: var(--faint); cursor: pointer; font-size: 16px; line-height: 1; padding: 0; }
.item-chip .rm:hover { background: var(--bad-wash); color: var(--bad); }
.items:has(.item-chip:only-child) { display: none; }
.item-editor { display: grid; }
.ed-label { font-size: 14px; font-weight: 600; color: var(--text-strong); margin: 4px 0 10px; }
.ed-label span { font-weight: 400; color: var(--muted); }
.styles { display: grid; gap: 8px; margin-bottom: 18px; }
.style-opt { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; text-align: left; width: 100%;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 8px 12px 8px 8px; cursor: pointer; }
.style-opt:hover { border-color: var(--line-strong); }
.style-opt[aria-pressed="true"] { border-color: var(--text-strong); }
.style-opt .thumb { width: 44px; height: 50px; }
.style-opt b { display: block; font-size: 14.5px; color: var(--text-strong); }
.style-opt small { color: var(--muted); font-size: 12.5px; }
.style-opt .from { font-size: 12.5px; color: var(--muted); text-align: right; white-space: nowrap; }
.style-opt .from b { font-size: 15px; }
.colors { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 18px; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); cursor: pointer; padding: 0; position: relative; }
.swatch[aria-checked="true"]::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--text-strong); }
/* Which design this shirt uses, per side */
.sizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 8px; }
.sizes label { display: grid; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); text-align: center; }
.sizes input { width: 100%; text-align: center; border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 9px 4px; background: var(--field); font-size: 16px; color: var(--text-strong); }
.sizes input:focus { border-color: var(--accent); outline: none; }
.sizes .up { font-weight: 500; font-size: 11px; color: var(--faint); }
.sizes .stk { font-size: 10.5px; font-weight: 600; line-height: 1.2; }
.sizes .stk.low { color: #9A6B12; }
.sizes .stk.out { color: var(--bad); }
.sizes input:disabled { background: transparent; border-style: dashed; color: var(--faint); }
.sizes input[aria-invalid="true"] { border-color: var(--bad); }
.add-item { margin-top: 16px; width: 100%; border: 1.5px dashed var(--line-strong); background: var(--bg); border-radius: var(--r-sm);
  padding: 13px; font-weight: 600; font-size: 14.5px; color: var(--text-strong); cursor: pointer; }
.add-item:hover { border-color: var(--accent); background: var(--accent-wash); }

/* Timing: three option cards */
.timing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.t-opt { position: relative; display: grid; gap: 2px; text-align: left; border: 1.5px solid var(--line); background: var(--surface); border-radius: var(--r-sm); padding: 12px; cursor: pointer;
  transition: border-color .25s var(--ease); }
.t-opt:hover { border-color: var(--line-strong); }
.t-opt[aria-checked="true"] { border-color: var(--text-strong); box-shadow: inset 0 0 0 1px var(--text-strong); }
.t-opt b { font-size: 14px; color: var(--text-strong); }
.t-opt span { font-size: 12.5px; color: var(--muted); }
.t-opt em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--good); }
.t-opt em.up { color: var(--muted); font-weight: 600; }
.t-opt em:empty { display: none; }
.t-opt:disabled { opacity: .5; cursor: not-allowed; }
.q-rows li.total { font-weight: 700; color: var(--on-dark); font-size: 16px; border-top: 1.5px solid rgba(255,255,255,.35) !important; padding-top: 11px; }
.q-rows li.total span:last-child { font-size: 18px; }
.q-state.custom { color: #E9B44C; }
.q-state.custom::before { background: #E9B44C !important; box-shadow: 0 0 0 3px rgba(233, 180, 76, .2) !important; }
@media (max-width: 420px) { .timing { grid-template-columns: 1fr; } }

/* ---------- Quote: two-layer card (shell + core), after the high-end visual design skill ---------- */
.quote-shell { padding: 6px; border-radius: 30px; background: rgba(31, 31, 31, .06); box-shadow: 0 0 0 1px rgba(31, 31, 31, .05); scroll-margin-top: 90px; }
.quote-core { border-radius: 24px; background: linear-gradient(180deg, #262624 0%, #1C1C1B 100%); color: var(--on-dark); padding: 26px 24px 22px;
  box-shadow: inset 0 1px 1px rgba(255,255,255,.12), 0 30px 60px -30px rgba(23,23,23,.55); display: grid; gap: 18px; }
.q-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.q-eyebrow { font-size: 10.5px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--accent-on-dark);
  border: 1px solid rgba(215, 201, 184, .25); border-radius: var(--r-pill); padding: 5px 11px; }
.q-state { font-size: 12px; font-weight: 600; color: var(--on-dark-muted); display: inline-flex; align-items: center; gap: 6px; }
.q-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.q-state.ready::before { background: #8FC79F; box-shadow: 0 0 0 3px rgba(143, 199, 159, .2); }
.q-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.q-big { font-family: var(--font-display); font-size: 46px; font-weight: 800; line-height: .95; letter-spacing: -.02em; font-stretch: 108%; font-variation-settings: "wdth" 108; }
.q-sub { color: var(--on-dark-muted); font-size: 13.5px; margin-top: 8px; }
.q-total { text-align: right; }
.q-total span { display: block; font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--on-dark-muted); margin-bottom: 4px; }
.q-total b { font-family: var(--font-display); font-size: 24px; font-weight: 800; }
.q-items, .q-rows { list-style: none; margin: 0; padding: 0; }
.q-items { display: grid; gap: 6px; }
.q-items li { display: grid; grid-template-columns: 26px 1fr auto; gap: 12px; align-items: center; background: rgba(255,255,255,.045); border-radius: 14px; padding: 10px 12px; }
.q-items .sw { width: 26px; height: 26px; border-radius: 8px; border: 1px solid rgba(255,255,255,.18); }
.q-items b { display: block; font-size: 14px; font-weight: 600; color: var(--on-dark); }
.q-items small { font-size: 12.5px; color: var(--on-dark-muted); }
.q-items .amt { font-weight: 600; font-variant-numeric: tabular-nums; }
.q-rows { display: grid; }
.q-rows li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 2px; font-size: 14px; color: var(--on-dark-muted); }
.q-rows li + li { border-top: 1px solid rgba(255,255,255,.07); }
.q-rows li span:last-child { color: var(--on-dark); font-variant-numeric: tabular-nums; white-space: nowrap; }
.q-rows li.save span:last-child { color: #8FC79F; }
.q-msg { margin: 0; font-size: 14px; color: var(--accent-on-dark); }
.q-msg:empty { display: none; }
.q-cta { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; border: 0; cursor: pointer;
  background: var(--on-dark); color: var(--dark); border-radius: var(--r-pill); padding: 7px 7px 7px 26px; font-family: var(--font-display);
  font-size: 14px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; transition: transform .3s var(--ease), opacity .3s var(--ease); }
.q-cta i { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--dark); color: var(--on-dark); transition: transform .45s var(--ease); }
.q-cta i svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.q-cta:hover:not(:disabled) i { transform: translate(2px, -2px) scale(1.05); }
.q-cta:active:not(:disabled) { transform: scale(.98); }
.q-cta:disabled { opacity: .4; cursor: not-allowed; }
.q-fine { margin: -6px 0 0; font-size: 12.5px; color: var(--on-dark-muted); text-align: center; }

/* Compact price bar: sticks to the bottom of the steps column on desktop, full width on phones. Hidden while the
   full quote is on screen. */
.price-bar { grid-column: 2; position: sticky; bottom: 16px; z-index: 40; display: grid; grid-template-columns: 1fr auto auto; gap: 16px; align-items: center;
  background: var(--dark); color: var(--on-dark); border-radius: 22px; padding: 12px 12px 12px 20px; box-shadow: 0 18px 40px -16px rgba(0,0,0,.55);
  transition: opacity .35s var(--ease), transform .35s var(--ease); margin-top: -8px; }
.price-bar.away { opacity: 0; transform: translateY(12px); pointer-events: none; }
.pb-price b { display: block; font-family: var(--font-display); font-size: 22px; font-weight: 800; line-height: 1.05; }
.pb-price span, .pb-total span { font-size: 12px; color: var(--on-dark-muted); }
.pb-total { text-align: right; }
.pb-total b { display: block; font-family: var(--font-display); font-size: 17px; }
.pb-cta { border: 0; background: var(--on-dark); color: var(--dark); border-radius: var(--r-pill); padding: 12px 18px; font-family: var(--font-display); font-weight: 700;
  font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
@media (max-width: 900px) {
  .price-bar { position: fixed; left: 0; right: 0; bottom: 0; border-radius: 20px 20px 0 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); margin: 0; grid-column: auto; }
  .pb-total { display: none; }
  .price-bar { grid-template-columns: 1fr auto; }
}

/* Contact sheet */
.sheet { border: 0; border-radius: var(--r-lg); padding: 0; width: min(560px, 100% - 24px); max-height: calc(100dvh - 24px); box-shadow: var(--shadow-lift); background: var(--surface); color: var(--text); }
.sheet::backdrop { background: rgba(23, 23, 23, .55); }
.sheet form { padding: 26px; display: grid; gap: 14px; }
.sheet-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.sheet h2 { font-size: 24px; }
.sheet .x { border: 0; background: var(--bg-2); width: 34px; height: 34px; border-radius: 50%; font-size: 22px; line-height: 1; cursor: pointer; flex: none; }
.sheet .muted { margin: 0; font-size: 14.5px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fields label { display: grid; gap: 5px; font-size: 13.5px; font-weight: 600; color: var(--text-strong); }
.fields label i { font-style: normal; font-weight: 400; color: var(--faint); }
.fields .wide { grid-column: 1 / -1; }
.fields input, .fields textarea { border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 11px 12px; background: var(--field); font-size: 16px; font-weight: 400; color: var(--text-strong); width: 100%; }
.fields input:focus, .fields textarea:focus { border-color: var(--accent); outline: none; }
.sheet .price-fine { margin: 0; font-size: 12.5px; color: var(--muted); text-align: center; }
.agree { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.45; color: var(--text); cursor: pointer; }
.agree input { width: 18px; height: 18px; margin: 1px 0 0; flex: none; accent-color: var(--accent); }
.agree a { color: var(--text-strong); }
.form-error { margin: 0; color: var(--bad); font-size: 14px; }
.form-error:empty { display: none; }
@media (max-width: 520px) { .fields { grid-template-columns: 1fr; } .sheet { width: 100%; max-width: none; margin: auto 0 0; border-radius: 22px 22px 0 0; } }

/* ---------- Layers on the mockup ---------- */
.layer { position: absolute; cursor: grab; touch-action: none; }
.layer:active { cursor: grabbing; }
.layer img { width: 100%; height: 100%; display: block; pointer-events: none; }
.layer:hover::after, .layer.sel::after { content: ""; position: absolute; inset: -2px; border: 1px dashed rgba(107, 112, 92, .9); pointer-events: none; }
.layer.sel::after { border-style: solid; border-color: var(--accent); }
.stage.dark-shirt .layer:hover::after { border-color: rgba(255,255,255,.6); }
.layer.sketch img { opacity: .78; }
.layer.sketch::before { content: "Sketch"; position: absolute; left: 0; top: -20px; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  background: var(--accent); color: #fff; border-radius: 6px; padding: 2px 6px; pointer-events: none; }
.handle { position: absolute; right: -11px; bottom: -11px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff;
  background: var(--accent); box-shadow: 0 1px 4px rgba(0,0,0,.35); cursor: nwse-resize; padding: 0; touch-action: none; }
.stage-top { justify-content: space-between; align-items: flex-start; gap: 10px; }
.swap-btn { flex: none; white-space: nowrap; }
.swap-btn { pointer-events: auto; display: inline-flex; align-items: center; gap: 7px; border: 0; cursor: pointer; font-size: 12.5px; font-weight: 600;
  background: rgba(251, 247, 244, .94); color: var(--text-strong); border-radius: var(--r-pill); padding: 7px 13px 7px 10px; box-shadow: var(--shadow-soft);
  transition: background .3s var(--ease), color .3s var(--ease); }
.swap-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.swap-btn[aria-pressed="true"] { background: var(--dark); color: var(--on-dark); }
.swap-btn.clash { background: var(--warn); color: #fff; animation: nudge-glow 2.4s ease-in-out infinite; }

/* ---------- Design pane ---------- */
.card-title small { font-family: var(--font-body); font-size: 13px; font-weight: 600; color: var(--accent-deep); background: var(--accent-wash); border-radius: var(--r-pill); padding: 3px 10px; }
.layers { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.layers:empty { display: none; }
.layer-row { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 8px 8px 8px 8px; cursor: pointer; background: var(--surface);
  transition: border-color .2s var(--ease); }
.layer-row:hover { border-color: var(--line-strong); }
.layer-row.sel { border-color: var(--text-strong); }
.layer-row .lt { width: 52px; height: 52px; border-radius: 8px; border: 1px solid var(--line); padding: 4px; object-fit: contain; background: repeating-conic-gradient(#ECE6DD 0 25%, #fff 0 50%) 0 0 / 12px 12px; }
.layer-row .ln { min-width: 0; display: grid; gap: 3px; }
.layer-row .ln b { font-size: 14px; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer-row .ln span { font-size: 12.5px; color: var(--muted); }
.layer-row .ln .quality { justify-self: start; font-size: 11.5px; padding: 2px 8px; }
.layer-row .rm { border: 1px solid var(--line-strong); background: var(--surface); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; color: var(--muted); }
.layer-row .rm:hover { border-color: var(--bad); color: var(--bad); background: var(--bad-wash); }
.layer-row .rm svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.add-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.add-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1.5px solid rgba(107, 112, 92, .35); background: var(--accent-wash); border-radius: var(--r-sm);
  padding: 11px 12px; font-size: 14px; font-weight: 600; color: var(--accent-deep); cursor: pointer; transition: border-color .2s var(--ease), background .2s var(--ease); }
.add-btn:hover { border-color: var(--accent); background: #E1E3D7; }
.add-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lib-picks { margin-top: 12px; }
.lib-picks p { font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 8px; }
.lib-picks div { display: flex; flex-wrap: wrap; gap: 8px; }
.lib-pick { display: flex; align-items: center; gap: 8px; border: 1px dashed var(--line-strong); background: var(--bg); border-radius: var(--r-sm); padding: 5px 10px 5px 5px; cursor: pointer; font-size: 13px; max-width: 100%; }
.lib-pick:hover { border-color: var(--accent); }
.lib-pick img { width: 34px; height: 34px; border-radius: 6px; object-fit: contain; background: repeating-conic-gradient(#ECE6DD 0 25%, #fff 0 50%) 0 0 / 10px 10px; }
.lib-pick span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.layer-edit { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 16px; display: grid; gap: 14px; }
.le-head { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; font-weight: 700; color: var(--text-strong); }
.le-head span { font-weight: 500; color: var(--muted); }
.le-quality { display: grid; gap: 6px; justify-items: start; }
.le-quality small { font-size: 13px; color: var(--muted); }
.fix-offer { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; background: var(--warn-wash); border-radius: var(--r-sm); padding: 12px 14px; cursor: pointer; }
.fix-offer input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--text-strong); }
.fix-offer b { color: var(--text-strong); font-size: 14.5px; }
.fix-offer em { font-style: normal; font-weight: 600; color: var(--warn); font-size: 14px; }
.fix-offer small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.text-input { width: 100%; border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 11px 12px; font-size: 16px; background: var(--field); color: var(--text-strong); resize: vertical; min-height: 48px; }
.text-input:focus { border-color: var(--accent); outline: none; }
.fonts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.font-opt { border: 1.5px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 4px; cursor: pointer; font-size: 17px; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.font-opt[aria-checked="true"] { border-color: var(--text-strong); }
.ink { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ink button, .ink label { width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(0,0,0,.18); cursor: pointer; padding: 0; position: relative; }
.ink [aria-checked="true"]::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--text-strong); }
.ink label { background: conic-gradient(#e74c3c, #f1c40f, #2ecc71, #3498db, #9b59b6, #e74c3c); overflow: hidden; }
.ink label input { opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.drop[hidden] + .layers { margin-top: 0; }

/* ---------- Quote: locked until there's a design + the minimum ---------- */
.q-locked { display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: center; background: rgba(255,255,255,.05); border-radius: 18px; padding: 16px; }
.q-locked > svg { width: 44px; height: 44px; padding: 10px; border-radius: 14px; background: rgba(215, 201, 184, .14); fill: none; stroke: var(--accent-on-dark); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.q-locked b { display: block; font-family: var(--font-display); font-size: 18px; line-height: 1.25; color: var(--on-dark); }
.q-locked small { display: block; margin-top: 6px; font-size: 12.5px; color: var(--on-dark-muted); }
.q-meter { height: 6px; border-radius: 6px; background: rgba(255,255,255,.12); overflow: hidden; margin-top: 10px; }
.q-meter i { display: block; height: 100%; width: 0; background: var(--accent-on-dark); border-radius: 6px; transition: width .7s var(--ease); }
/* The next-price-break nudge: light panel on the dark card, with a breathing bar. */
.q-nudge { background: var(--accent-on-dark); color: var(--dark); border-radius: 18px; padding: 14px 16px; }
.q-nudge p { margin: 0; font-size: 14.5px; font-weight: 600; line-height: 1.4; }
.q-nudge .q-meter { background: rgba(31, 31, 31, .14); }
.q-nudge .q-meter i { background: var(--dark); animation: breathe 2.2s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(31,31,31,0); } 50% { opacity: .55; box-shadow: 0 0 10px 2px rgba(31,31,31,.25); } }
@keyframes nudge-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(154, 106, 18, .45); } 50% { box-shadow: 0 0 0 6px rgba(154, 106, 18, 0); } }
@media (prefers-reduced-motion: reduce) { .q-nudge .q-meter i, .swap-btn.clash { animation: none; } }
.pb-price .lock { font-size: 14px; font-family: var(--font-body); font-weight: 600; }
.sketch-btn { width: 100%; margin-top: 8px; }
.drop { margin-bottom: 8px; }

/* ---------- Start sheet: Upload or Add text, shown when the page opens ---------- */
.start-sheet { width: min(500px, 100% - 24px); }
@media (max-width: 520px) { .start-sheet { width: 100%; } .start-body { padding: 22px 18px calc(18px + env(safe-area-inset-bottom)); } }
.start-body { padding: 26px; display: grid; gap: 14px; }
.start-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.start-opt { display: grid; justify-items: center; gap: 4px; text-align: center; padding: 22px 12px 18px; border: 1.5px solid rgba(107, 112, 92, .35); background: var(--accent-wash);
  border-radius: var(--r); cursor: pointer; color: var(--accent-deep); transition: border-color .2s var(--ease), background .2s var(--ease); }
.start-opt:hover { border-color: var(--accent); background: #E1E3D7; }
.start-opt svg { width: 30px; height: 30px; margin-bottom: 4px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.start-opt b { font-family: var(--font-display); font-size: 17px; color: var(--text-strong); }
.start-opt span { font-size: 13px; color: var(--muted); }
.start-sketch { border: 0; background: none; padding: 4px; color: var(--accent-deep); font-size: 14px; font-weight: 600; text-decoration: underline; cursor: pointer; }

/* ---------- Phones: app mode. The mockup fills the screen and the page never scrolls; panes open as bottom sheets
   from the tool bar, and Next opens the quote as its own full-screen view. ---------- */
.app-bar, .m-quote-head, .sheet-close, .layer-bar, .scrim, .tool-sheet, .sheet-cta { display: none; }
@media (max-width: 900px) {
  .design-page { --hdr: 56px; --bar: calc(64px + env(safe-area-inset-bottom)); }
  html:has(.design-page) { overflow: hidden; overscroll-behavior: none; }
  .design-page .site-head .wrap { min-height: var(--hdr); }
  .design-page .lockup img { height: 38px; }
  .studio { display: block; width: 100%; padding: 0; height: calc(100dvh - var(--hdr) - var(--bar)); }
  .stage-col { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px 8px 4px; }
  .stage { width: min(100%, calc((100dvh - var(--hdr) - var(--bar) - 44px) * 600 / 700)); border-radius: 22px; flex: none; }
  .stage-hint { margin: 6px 12px 0; font-size: 12.5px; line-height: 1.35; }
  .side-switch { bottom: 10px; }
  .side-switch button { padding: 8px 16px; font-size: 12px; }
  .price-bar { display: none; }

  /* Any sheet open: both bars hide (so Next can't be hit mid-edit) and the sheet sits on the bottom edge. The board
     never resizes; a short tool sheet lifts it to the top so the art stays in view above the sheet. */
  .design-page[data-sheet="tool"] .stage-col { justify-content: flex-start; }
  .design-page[data-sheet] .stage-hint { visibility: hidden; }
  .design-page[data-sheet] .app-bar, .design-page[data-sheet] .layer-bar { display: none; }

  .panel { display: none; }
  .design-page:is([data-sheet="design"], [data-sheet="shirts"]) .panel { display: block; position: fixed; left: 0; right: 0; bottom: 0; height: min(82dvh, 680px); z-index: 56;
    padding-bottom: env(safe-area-inset-bottom);
    overflow-y: auto; overscroll-behavior: contain; background: var(--surface); border-radius: 22px 22px 0 0; border-top: 1px solid var(--line);
    box-shadow: 0 -14px 32px -16px rgba(0, 0, 0, .3); animation: sheet-up .3s var(--ease); }
  .design-page[data-sheet] .panel > * { display: none; }
  .design-page[data-sheet="design"] #design-card, .design-page[data-sheet="shirts"] #shirts-card { display: block; border: 0; box-shadow: none; border-radius: 0; padding: 0 16px 24px; }
  .panel .card-title { position: sticky; top: 0; z-index: 2; background: var(--surface); margin: 0 -16px 12px; padding: 14px 16px 10px; }
  .panel .card-title > span { display: none; }
  /* Done: a filled pill, so "back to my shirt" reads as the next step */
  .sheet-close, .ts-done { display: inline-flex; align-items: center; margin-left: auto; flex: none; height: 40px; padding: 0 20px; border: 0; border-radius: var(--r-pill); background: var(--btn-bg); color: var(--btn-fg);
    font-family: var(--font-display); font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; cursor: pointer; }
  .ts-done.cancel { background: var(--bg-2); color: var(--text-strong); }
  .scrim { position: fixed; inset: 0; z-index: 55; background: rgba(23, 23, 23, .45); animation: fade-in .25s ease; }
  .design-page:is([data-sheet="design"], [data-sheet="shirts"], [data-tool="addtext"]) .scrim { display: block; }

  /* Shirts sheet footer: progress to the minimum, then on to the quote */
  .sheet-cta { display: grid; gap: 8px; position: sticky; bottom: 0; z-index: 2; margin: 18px -16px -24px; padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -10px 20px -14px rgba(0, 0, 0, .25); }
  .sheet-cta p { margin: 0; font-size: 14.5px; font-weight: 600; color: var(--good); }
  .sheet-cta.short p { color: var(--warn); }
  .sheet-cta .q-meter { margin: 0; background: var(--bg-2); }
  .sheet-cta .q-meter i { background: var(--good); }
  .sheet-cta.short .q-meter i { background: var(--warn); }
  .sheet-cta .btn { width: 100%; }
  .sheet-cta.short .btn { opacity: .45; }
  .sheet-cta.flash { animation: cta-flash .9s var(--ease); }

  /* Short tool sheet for the selected layer */
  .design-page[data-sheet="tool"] .tool-sheet { display: block; }
  .tool-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 56; max-height: 48dvh; overflow-y: auto; overscroll-behavior: contain; background: var(--surface);
    border-radius: 22px 22px 0 0; box-shadow: 0 -14px 32px -16px rgba(0, 0, 0, .3); padding: 0 16px calc(18px + env(safe-area-inset-bottom)); animation: sheet-up .3s var(--ease); }
  .ts-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; background: var(--surface); padding: 14px 0 12px; }
  .ts-head b { font-family: var(--font-display); font-size: 18px; color: var(--text-strong); }
  .ts-body { display: grid; gap: 14px; }
  .ts-body .text-input { font-size: 22px; min-height: 56px; }
  .ts-go { width: 100%; }
  .fonts-sample { grid-template-columns: 1fr 1fr; gap: 8px; }
  .fonts-sample .font-opt { font-size: 21px; padding: 14px 8px; border-radius: var(--r-sm); }
  .ts-body .ink { gap: 12px; }
  .ts-body .ink button, .ts-body .ink label { width: 40px; height: 40px; }
  .resize { display: grid; grid-template-columns: 52px 1fr 52px; align-items: center; gap: 10px; text-align: center; }
  .resize button { height: 52px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--r-sm); font-size: 24px; color: var(--text-strong); cursor: pointer; }
  .resize b { display: block; font-size: 16px; color: var(--text-strong); }
  .resize small { font-size: 12.5px; color: var(--muted); }
  .center-btn { border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--r-pill); padding: 10px; font-size: 14px; font-weight: 600; color: var(--text-strong); cursor: pointer; }

  /* Layer tool bar: replaces the main bar while a layer is selected */
  .design-page.has-sel .app-bar { display: none; }
  .design-page.has-sel:not([data-sheet]) .layer-bar { display: flex; }
  .layer-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; height: var(--bar); align-items: center; gap: 2px; overflow-x: auto;
    padding: 0 10px env(safe-area-inset-bottom) 6px; background: var(--surface); border-top: 1px solid var(--line); scrollbar-width: none; }
  .lb-btn { flex: 1 1 0; min-width: 50px; font-size: 11px; }
  .lb-btn.warn::after { content: ""; position: absolute; top: 5px; left: calc(50% + 8px); width: 9px; height: 9px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 2px var(--surface); }
  .lb-del { color: var(--bad); }
  .lb-swatch { width: 23px; height: 23px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .2); box-shadow: inset 0 0 0 2px var(--surface); }
  .lb-done { flex: none; margin-left: 4px; height: 44px; padding: 0 16px; border: 0; border-radius: var(--r-pill); background: var(--accent); color: #fff;
    font-family: var(--font-display); font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; cursor: pointer; }

  /* quote view: its own screen, with the phone's back gesture returning to the editor */
  .design-page.quote .panel { display: grid; gap: 14px; align-content: start; position: fixed; inset: 0; z-index: 60; background: var(--bg);
    overflow-y: auto; overscroll-behavior: contain; padding: 0 12px calc(28px + env(safe-area-inset-bottom)); animation: view-in .3s var(--ease); }
  .design-page.quote #design-card, .design-page.quote #shirts-card { display: none; }
  .design-page.quote .m-quote-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: 0; z-index: 3;
    margin: 0 -12px; padding: 8px 12px; min-height: var(--hdr); background: rgba(251, 247, 244, .94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
  .m-quote-head b { font-family: var(--font-display); font-size: 16px; color: var(--text-strong); padding-right: 6px; }
  .m-back { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--r-pill);
    padding: 8px 14px 8px 8px; font-size: 14px; font-weight: 600; color: var(--text-strong); cursor: pointer; }
  .m-back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

  .app-bar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; align-items: center; gap: 2px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    height: var(--bar); padding: 0 10px env(safe-area-inset-bottom) 6px; background: var(--surface); border-top: 1px solid var(--line); }
  .ab-btn { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; border: 0; background: none; padding: 7px 2px 5px; border-radius: 14px;
    font-size: 11.5px; font-weight: 600; color: var(--muted); cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .ab-btn svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .ab-btn:active { background: var(--bg-2); }
  .ab-btn[aria-expanded="true"] { color: var(--text-strong); background: var(--accent-wash); }
  .ab-n { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pill); background: var(--accent);
    color: #fff; font-style: normal; font-size: 10.5px; font-weight: 700; line-height: 18px; text-align: center; }
  .ab-next { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; height: 46px; padding: 0 16px 0 20px; border: 0; border-radius: var(--r-pill);
    background: var(--btn-bg); color: var(--btn-fg); font-family: var(--font-display); font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; cursor: pointer; }
  .ab-next svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
}
@keyframes sheet-up { from { transform: translateY(40px); } }
@keyframes cta-flash { 0%, 100% { background: var(--surface); } 30% { background: var(--warn-wash); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes view-in { from { transform: translateX(32px); } }
@media (prefers-reduced-motion: reduce) { .panel, .tool-sheet, .scrim { animation: none !important; } }
.upload-note { text-wrap: balance; margin: 2px 0 0; font-size: 12px; line-height: 1.4; color: var(--muted); text-align: center; }
.drop .upload-note { margin-top: 4px; }

/* Shirt list: shop styles and the way into the shop */
.ed-sub { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); margin: 10px 0 2px; }
.more-styles { display: grid; gap: 3px; width: 100%; text-align: left; padding: 14px 16px; border: 1.5px dashed var(--line-strong); border-radius: var(--r-md, 14px);
  background: transparent; cursor: pointer; color: var(--text-strong); }
.more-styles span { font-weight: 600; font-size: 14.5px; }
.more-styles span::after { content: " →"; }
.more-styles small { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.more-styles:hover { border-color: var(--text-strong); }

/* Colors: the short row + "more" chip, and the all-colors dialog */
.more-colors { height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 13px; font-weight: 600;
  color: var(--text-strong); cursor: pointer; }
.more-colors:hover { border-color: var(--text-strong); }
.sheet-pad { padding: 24px; display: grid; gap: 16px; }
.sheet-head h2 + .muted { margin-top: 4px; }
.colors-sheet { width: min(720px, 100% - 24px); }
.colors-all { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; max-height: min(62dvh, 560px); overflow-y: auto; padding: 2px; }
.color-opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid transparent; border-radius: 10px; background: none; cursor: pointer;
  text-align: left; font-size: 13.5px; color: var(--text-strong); }
.color-opt:hover { background: var(--bg-2); }
.color-opt[aria-checked="true"] { border-color: var(--text-strong); }
.color-opt i { width: 26px; height: 26px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); flex: none; }
.shop-sheet { width: min(1180px, 100% - 24px); height: calc(100dvh - 24px); }
.shop-sheet .sheet-pad { height: 100%; grid-template-rows: auto 1fr; overflow: hidden; }
.shop-sheet .shop { overflow-y: auto; margin: 0 -24px -24px; padding: 0 24px 24px; }
@media (max-width: 900px) {
  .shop-sheet, .colors-sheet { width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0; margin: 0; }
  .colors-sheet .colors-all { max-height: none; }
  .colors-sheet .sheet-pad { height: 100%; grid-template-rows: auto 1fr; overflow-y: auto; }
  .sheet-pad { padding: 18px 16px; }
  .shop-sheet .shop { margin: 0 -16px -18px; padding: 0 16px 18px; }
}

/* The stage while a shirt photo is being made (the drawing shows meanwhile) */
.stage.loading-photo .garment { opacity: .8; transition: opacity .3s; }
