/* snaplist: mobile-first (iPhone), then iPad (768px+) and desktop / iPad landscape (1024px+). */
:root {
  --bg: #F4F4F1; --card: #FFFFFF; --soft: #FAFAF8;
  --ink: #17181C; --text2: #45474D; --muted: #5E6168; --faint: #6B6E75;
  --line: #E6E6E1; --field: #DCDCD6; --dash: #D6D6CF;
  --accent: #C2410C; --accent-dark: #9A3412; --accent-soft: #FFF1E8; --accent-ring: #FBD9C4;
  --ok: #166534; --ok-dot: #16A34A; --ok-soft: #EAF6EE;
  --warn: #92400E; --warn-icon: #B45309; --warn-soft: #FEF5E7; --warn-line: #F5C77E;
  --bad: #A12A1C; --bad-soft: #FDECEA;
  --info: #1E4E8C; --info-soft: #E8F0FB;
  --radius: 20px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 Manrope, system-ui, -apple-system, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
h1 { margin: 0; font-size: 26px; line-height: 1.15; font-weight: 800; letter-spacing: -0.025em; }
h2 { margin: 0; font-size: 18px; font-weight: 800; }
p { margin: 0; }
svg { flex: none; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lead { margin-top: 8px; color: var(--muted); font-size: 15px; max-width: 680px; }
.hint { color: var(--muted); font-size: 13px; margin-top: 8px; }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; font-weight: 500; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: var(--card); border-bottom: 1px solid var(--line); }
.logo { display: flex; align-items: center; gap: 8px; min-height: 44px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 18px; letter-spacing: -0.02em; }
.logo:hover { color: var(--ink); }
.mark { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); display: flex; align-items: center; justify-content: center; }
.top-right { display: flex; align-items: center; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 999px; white-space: nowrap; }
.pill-ai { display: none; color: var(--muted); border: 1px solid var(--line); font-weight: 500; }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-ok::before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: var(--ok-dot); }
.pill-connect { background: var(--accent-soft); color: var(--accent-dark); text-decoration: none; min-height: 36px; }

/* ---------- layout ---------- */
main { max-width: 1200px; margin: 0 auto; padding: 20px 16px 32px; }
.page-head { margin-bottom: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.split { display: flex; flex-direction: column; gap: 20px; }
.split > * { min-width: 0; }

/* ---------- messages ---------- */
.error { display: flex; gap: 10px; align-items: flex-start; background: var(--bad-soft); color: var(--bad); padding: 12px 14px; border-radius: 14px; margin-bottom: 20px; font-weight: 600; overflow-wrap: anywhere; }
.banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; background: var(--ink); color: #FFFFFF; border-radius: var(--radius); padding: 18px 20px; margin-bottom: 20px; }
.banner p { color: #D9D9D5; font-size: 14px; margin-top: 4px; }
.banner strong { font-size: 16px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 22px; border-radius: 14px; border: 1px solid transparent;
  font: inherit; font-weight: 700; font-size: 16px; cursor: pointer; text-decoration: none; background: var(--accent); color: #FFFFFF; -webkit-tap-highlight-color: transparent; }
.btn:hover { background: var(--accent-dark); color: #FFFFFF; }
.btn.secondary { background: var(--card); color: var(--ink); border-color: var(--field); }
.btn.secondary:hover { background: var(--soft); }
.btn.ghost { background: none; color: var(--text2); border: 0; padding: 0 8px; min-height: 44px; font-weight: 600; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn:focus-visible, .big:focus-within, a:focus-visible, button:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 2px; }

/* bottom action bar: pinned on phones, inline on bigger screens */
.actions { position: sticky; bottom: 0; z-index: 5; display: flex; gap: 8px; align-items: center;
  margin: 8px -20px -20px; padding: 12px 16px calc(12px + var(--safe-bottom)); background: var(--card); border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius); }
.actions { flex-wrap: wrap; }  /* four buttons (Etsy connected) don't fit one phone row */
.actions .btn { flex: 1 1 auto; padding: 0 14px; min-width: 0; }
.actions .btn.ghost { flex: 0 0 auto; }
.actions .spacer { display: none; }

/* ---------- form fields ---------- */
.field { display: block; }
.lbl { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-weight: 700; font-size: 15px; }
.lbl .opt { font-weight: 500; color: var(--faint); }
.count { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 13px; font-weight: 500; color: var(--muted); }
.count.good { color: var(--ok); }
.count.over { color: var(--bad); font-weight: 700; }
/* 16px text stops iOS Safari from zooming in on focus */
.input { display: block; width: 100%; margin-top: 8px; padding: 12px 14px; font: inherit; font-size: 16px; line-height: 1.5; color: var(--ink);
  background: var(--card); border: 1px solid var(--field); border-radius: 12px; -webkit-appearance: none; appearance: none; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
textarea.input { resize: vertical; }
.input.price { font-size: 20px; font-weight: 800; }
.meter { height: 4px; border-radius: 999px; background: #F0F0EC; margin-top: 8px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--ok-dot); border-radius: 999px; transition: width .2s; }
.meter i.over { background: var(--bad); }
.row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }

/* tag / material chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 6px 6px 12px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); font-size: 14px; font-weight: 600; max-width: 100%; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip small { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 11px; color: var(--faint); font-weight: 500; }
.chip.warn { background: var(--warn-soft); border-color: var(--warn-line); }
.chip.over { background: var(--bad-soft); border-color: #F2B8B0; }
.chip.over small { color: var(--bad); font-weight: 700; }
.chip button { width: 28px; height: 28px; border: 0; border-radius: 999px; background: transparent; color: var(--faint); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.chip button:hover { background: #E8E8E3; color: var(--ink); }

/* ---------- steps ---------- */
.steps { display: flex; gap: 6px; list-style: none; margin: 0 0 20px; padding: 0; font-size: 13px; font-weight: 700; overflow-x: auto; scrollbar-width: none; }
.steps li { flex: none; display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; color: var(--muted); }
.steps .n { width: 24px; height: 24px; border-radius: 999px; border: 2px solid var(--dash); display: flex; align-items: center; justify-content: center; font-size: 12px; }
.steps .done { background: var(--card); border: 1px solid var(--line); color: var(--ink); }
.steps .done .n { background: var(--ink); border-color: var(--ink); }
.steps .now { background: var(--ink); color: #FFFFFF; }
.steps .now .n { background: var(--accent); border-color: var(--accent); }
.label-long { display: none; }

/* ---------- upload ---------- */
.pickers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.big { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 104px; padding: 12px;
  border-radius: 16px; font-weight: 700; font-size: 15px; text-align: center; cursor: pointer; background: var(--card); border: 1px solid var(--line); }
.big.primary { background: var(--accent); color: #FFFFFF; border-color: var(--accent); }
.big.drag { border: 2px dashed var(--accent); background: var(--accent-soft); }
.big .sub { display: none; font-size: 13px; font-weight: 500; color: var(--faint); }
.thumbs-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #E4E0D6; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #17181C55; }
.thumb .badge { position: absolute; left: 6px; bottom: 6px; font-size: 10px; font-weight: 700; color: #FFFFFF; background: #17181CCC; padding: 2px 7px; border-radius: 999px; }
.thumb .x { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; border: 0; border-radius: 999px; background: #FFFFFFE6; color: var(--ink);
  display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.thumb.add { display: flex; align-items: center; justify-content: center; background: none; border: 1.5px dashed var(--dash); color: var(--muted); cursor: pointer; }
.empty-thumbs { padding: 14px; border: 1.5px dashed var(--dash); border-radius: 12px; color: var(--muted); font-size: 14px; text-align: center; }

/* recent drafts */
.recent { display: flex; flex-direction: column; }
.recent a { display: flex; gap: 12px; align-items: center; padding: 10px 0; min-height: 64px; border-bottom: 1px solid #F0F0EC; text-decoration: none; color: var(--ink); }
.recent a:last-child { border-bottom: 0; }
.recent .pic { flex: none; width: 52px; height: 52px; border-radius: 10px; background: #E4E0D6; object-fit: cover; }
.recent .meta { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.recent .name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status { align-self: flex-start; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.status.ru { background: var(--accent-soft); color: var(--accent-dark); }
.status.en { background: var(--info-soft); color: var(--info); }
.status.active { background: var(--ok-soft); color: var(--ok); }
.status.draft { background: #EFEFEC; color: var(--text2); }
.status.copy { background: var(--warn-soft); color: var(--warn); }
.status.posted { background: var(--ok-soft); color: var(--ok); }
.tip { background: var(--ink); color: #E7E7E4; border-radius: var(--radius); padding: 20px; font-size: 15px; }
.tip b { display: block; margin-bottom: 6px; font-size: 12px; color: #FDBA8C; letter-spacing: .04em; text-transform: uppercase; }

/* ---------- on/off switch ---------- */
.switch { position: relative; display: flex; align-items: flex-start; gap: 12px; min-height: 44px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--soft); cursor: pointer; font-size: 15px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .knob { flex: none; position: relative; width: 44px; height: 26px; margin-top: 1px; border-radius: 999px; background: var(--field); transition: background .15s; }
.switch .knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 999px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + .knob { background: var(--accent); }
.switch input:checked + .knob::after { transform: translateX(18px); }
.switch input:focus-visible + .knob { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + .knob { opacity: .6; }
.switch .sub { display: block; color: var(--muted); font-size: 13px; }
.gallery .switch { margin-top: 12px; }

/* ---------- gallery ---------- */
.gallery .main { position: relative; aspect-ratio: 3 / 2; border-radius: var(--radius); overflow: hidden; background: #E4E0D6; }
.gallery .main img, .gallery .main video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.gallery .strip { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.gallery .strip button { flex: none; position: relative; width: 60px; height: 60px; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: #E4E0D6; cursor: pointer; }
.gallery .strip button[aria-current="true"] { outline: 2px solid var(--accent); outline-offset: 2px; }
.gallery .strip img, .gallery .strip video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.side-note { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.side-note .k { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.ai-note { display: flex; gap: 12px; padding: 14px 16px; background: #FFF7F1; border: 1px solid #FBE0CE; border-radius: 14px; font-size: 14px; color: var(--text2); }
.ai-note strong { color: var(--ink); }

/* ---------- SEO ---------- */
.seo summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; cursor: pointer; list-style: none; min-height: 32px; }
.seo summary::-webkit-details-marker { display: none; }
.score { white-space: nowrap; font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); }
.score.all { background: var(--ok-soft); color: var(--ok); }
.bars { display: grid; gap: 4px; margin: 14px 0 4px; }
.bars span { height: 6px; border-radius: 999px; background: var(--ok-dot); }
.bars span.no { background: #F59E0B; }
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; font-size: 14px; border-bottom: 1px solid #F0F0EC; }
.checks li:last-child { border-bottom: 0; }
.checks li b { margin-left: auto; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12px; font-weight: 500; color: var(--muted); }
.checks li.no { background: var(--warn-soft); margin: 4px -12px; padding: 12px; border-radius: 10px; border-bottom: 0; }
.checks li.no .t { font-weight: 700; color: var(--warn); }
.checks li .h { display: block; color: var(--text2); margin-top: 2px; }
.preview { display: none; }
.preview .pic { width: 220px; max-width: 100%; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: #E4E0D6; }
.preview .pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview .t { margin-top: 10px; width: 220px; max-width: 100%; font-size: 14px; line-height: 1.4; color: var(--text2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.preview .p { font-size: 16px; font-weight: 800; }
.category { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-top: 8px; padding: 12px 14px; border: 1px solid var(--field); border-radius: 12px; font-size: 15px; }
.category span:first-child { flex: 1 1 220px; }
.tag-ai { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); }

/* ---------- busy overlay ---------- */
.working { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 24px; background: #F4F4F1F2; }
.working[hidden] { display: none; }
.working .box { width: 100%; max-width: 520px; }
.working h2 { font-size: 26px; letter-spacing: -0.02em; }
.working p { margin: 8px 0 22px; color: var(--muted); }
.progress { height: 8px; border-radius: 999px; background: #E6E6E1; overflow: hidden; }
.progress i { display: block; width: 40%; height: 100%; border-radius: 999px; background: var(--accent); animation: slide 1.4s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
.working ol { list-style: none; margin: 22px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; color: var(--text2); }
.working li { display: flex; gap: 12px; align-items: center; }
.working li::before { content: ""; width: 8px; height: 8px; border-radius: 999px; background: var(--accent); }
.spin { width: 22px; height: 22px; border-radius: 999px; border: 3px solid var(--accent-ring); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .progress i, .spin { animation: none; } .progress i { width: 100%; } }

/* ---------- done ---------- */
.done-page { max-width: 640px; margin: 0 auto; text-align: center; padding-top: 24px; }
.done-page .ok-icon { display: inline-flex; width: 72px; height: 72px; border-radius: 999px; background: var(--ok-soft); align-items: center; justify-content: center; }
.done-page h1 { margin: 18px 0 8px; }
.done-page .lead { margin: 0 auto 24px; }
.listing-card { display: flex; gap: 14px; align-items: center; text-align: left; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; text-decoration: none; color: var(--ink); }
.listing-card .pic { flex: none; width: 72px; height: 72px; border-radius: 12px; background: #E4E0D6; object-fit: cover; }
.listing-card .meta { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.listing-card .name { font-weight: 700; line-height: 1.35; }
.listing-card .go { font-weight: 700; color: var(--accent); font-size: 14px; }
.done-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 28px; }

/* ---------- listing chat ---------- */
.ask { position: fixed; right: 16px; bottom: calc(var(--bar, calc(76px + var(--safe-bottom))) + 16px);  /* --bar: measured height of the sticky button bar */
  z-index: 20; display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 18px 0 14px;
  border-radius: 999px; border: 0; background: var(--ink); color: #FFFFFF; font: inherit; font-weight: 700; font-size: 15px; box-shadow: 0 10px 24px #17181C40; cursor: pointer; }
.chat-scrim { position: fixed; inset: 0; z-index: 30; background: #17181C66; }
.chat { position: fixed; left: 0; right: 0; bottom: 0; top: calc(env(safe-area-inset-top, 0px) + 48px); z-index: 31; display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg); border-radius: 22px 22px 0 0; box-shadow: 0 -8px 30px #17181C26; }
.chat .grab { flex: none; width: 40px; height: 5px; border-radius: 999px; background: #CFCFC8; margin: 8px auto 0; }
.c-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 10px 12px 12px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.c-head .pic { flex: none; width: 40px; height: 40px; border-radius: 10px; object-fit: cover; background: #E4E0D6; }
.c-head .meta { min-width: 0; flex: 1; }
.c-head h2 { font-size: 16px; }
.c-head p { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { flex: none; width: 44px; height: 44px; border-radius: 999px; border: 0; background: var(--bg); color: var(--ink); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.msgs { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 12px; display: flex; flex-direction: column; gap: 10px; }
.chat-item { display: contents; }
.msg { max-width: 86%; padding: 10px 13px; border-radius: 18px; font-size: 15px; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; }
.msg.me { align-self: flex-end; background: var(--ink); color: #FFFFFF; border-bottom-right-radius: 6px; }
.msg.ai { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.who { font-size: 11px; font-weight: 700; color: var(--accent-dark); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; white-space: normal; }
.quick button { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--accent-ring); background: var(--accent-soft); color: var(--accent-dark); font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; }
.prop { align-self: stretch; flex: none; background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.prop-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px; background: var(--soft); font-size: 14px; font-weight: 800; }
.prop.new .prop-h { border-bottom: 1px solid var(--line); }
.prop.applied .prop-h { background: var(--ok-soft); color: var(--ok); }
.prop.rejected .prop-h { color: var(--muted); font-weight: 600; }
.prop-b { padding: 12px 14px; display: flex; flex-direction: column; gap: 12px; font-size: 14px; }
.prop .k { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.diff { display: flex; flex-direction: column; gap: 6px; }
.diff .chips { margin-top: 0; }
.del, .ins { padding: 7px 10px; border-radius: 10px; line-height: 1.4; overflow-wrap: anywhere; }
.del { background: var(--bad-soft); color: #7A2217; text-decoration: line-through; text-decoration-color: #A12A1C88; }
.ins { background: var(--ok-soft); color: #14532D; }
.chip.old { text-decoration: line-through; color: var(--faint); background: var(--card); padding-right: 12px; }
.chip.new { background: var(--ok-soft); border-color: #BFE3C9; color: var(--ok); padding-right: 12px; }
.ru, .why { color: var(--muted); font-size: 13px; }
.seo-ok, .seo-no p { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; }
.seo-ok { padding: 8px 10px; border-radius: 10px; background: var(--ok-soft); color: var(--ok); }
.seo-no { padding: 8px 10px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); }
.seo-no ul, .decl ul { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.prop-a { display: flex; gap: 8px; padding: 0 14px 14px; }
.btn.sm { flex: 1; min-height: 44px; font-size: 15px; border-radius: 12px; padding: 0 12px; }
.undo { background: none; border: 0; color: var(--ok); font: inherit; font-weight: 700; font-size: 14px; text-decoration: underline; min-height: 44px; cursor: pointer; }
.decl { align-self: stretch; flex: none; border: 1px solid var(--warn-line); background: var(--warn-soft); border-radius: 18px; padding: 12px 14px; font-size: 14px; color: #5C2C07; }
.decl .h { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--warn); }
.offtopic { align-self: stretch; flex: none; display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 14px; background: #EFEFEC; color: var(--text2); font-size: 14px; }
.offtopic svg { margin-top: 2px; }
.offtopic.bad { background: var(--bad-soft); color: var(--bad); font-weight: 600; }
.typing { align-self: flex-start; display: flex; gap: 4px; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; }
.typing i { width: 6px; height: 6px; border-radius: 999px; background: #B9BAB4; animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 50% { opacity: .3; } }
.composer { flex: none; display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px calc(10px + var(--safe-bottom)); background: var(--card); border-top: 1px solid var(--line); }
.composer .field { flex: 1; min-width: 0; min-height: 44px; max-height: 140px; padding: 10px 14px; border: 1px solid var(--field); border-radius: 22px; font: inherit; font-size: 16px; line-height: 1.4; resize: none; color: var(--ink); background: var(--card); }
.composer .field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.send { flex: none; width: 44px; height: 44px; border-radius: 999px; border: 0; background: var(--accent); color: #FFFFFF; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.flash { animation: flash 1.6s ease-out; }
@keyframes flash { from { box-shadow: 0 0 0 4px #86EFAC; background-color: var(--ok-soft); } }
@media (max-width: 767px) { body.chat-open { overflow: hidden; } }
@media (prefers-reduced-motion: reduce) { .typing i, .flash { animation: none; } }

/* ================= iPad portrait and up ================= */
@media (min-width: 768px) {
  h1 { font-size: 32px; }
  .lead { font-size: 16px; }
  .top { padding: 12px 24px; }
  .logo { font-size: 20px; }
  .mark { width: 32px; height: 32px; border-radius: 9px; }
  .pill-ai { display: inline-flex; }
  main { padding: 32px 24px 48px; }
  .card { padding: 28px; }
  .actions { margin: 8px -28px -28px; padding: 14px 28px calc(14px + var(--safe-bottom)); }
  .actions .btn { flex: 0 0 auto; padding: 0 22px; }
  .actions .spacer { display: block; flex: 1; }
  .row.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row.price { grid-template-columns: 200px minmax(0, 1fr); align-items: end; }
  .steps { font-size: 14px; margin-bottom: 24px; }
  .label-long { display: inline; }
  .label-short { display: none; }
  .gallery .main { aspect-ratio: 4 / 5; }
  .preview { display: block; }
  .big { min-height: 96px; flex-direction: row; font-size: 17px; }
  .big .sub { display: block; }
  .thumbs { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
  .recent.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px; }
  .recent.grid a:nth-last-child(2):nth-child(odd) { border-bottom: 0; }
  .split.media { display: grid; grid-template-columns: 260px minmax(0, 1fr); align-items: start; }
  .done-actions { flex-direction: row; justify-content: center; }
  /* chat becomes a side panel; the page makes room for it */
  .ask { bottom: calc(var(--bar, calc(76px + var(--safe-bottom))) + 24px); right: 24px; }
  .chat { top: 0; left: auto; width: 360px; border-radius: 0; border-left: 1px solid var(--line); box-shadow: none; }
  .chat .grab { display: none; }
  .chat .c-head { padding-top: max(12px, env(safe-area-inset-top)); }
  body.chat-open .top { padding-right: 384px; }
  body.chat-open main { margin-right: 360px; margin-left: max(0px, calc((100vw - 360px - 1200px) / 2)); }
}
@media (min-width: 768px) and (max-width: 1279px) {
  body.chat-open .split.media { display: flex; }
  body.chat-open .split.media > .side { display: none; }
}

/* ================= desktop and iPad landscape ================= */
@media (min-width: 1024px) {
  h1 { font-size: 34px; }
  main { padding: 36px 32px 64px; }
  .card { padding: 32px; }
  .actions { position: static; margin: 4px 0 0; padding: 24px 0 0; background: none; border-radius: 0; border-top-color: #EEEEEA; }
  .split { flex-direction: row; align-items: flex-start; gap: 28px; }
  .split > .wide { flex: 999 1 560px; }
  .split > .side { flex: 1 1 320px; max-width: 420px; }
  .split.media { display: flex; }
  .split.media > .side { position: sticky; top: 88px; }
  .recent.grid { display: flex; }
  .recent.grid a:nth-last-child(2):nth-child(odd) { border-bottom: 1px solid #F0F0EC; }
  .ask { bottom: 28px; right: 28px; }
}

/* ---------- log out (header) ---------- */
.top-right form { margin: 0; display: flex; }
.logout { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; min-height: 44px; padding: 0 6px; border: 0; border-radius: 12px;
  background: none; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.logout:hover { color: var(--ink); background: var(--soft); }
.logout span { display: none; }
@media (min-width: 768px) { .logout span { display: inline; } .logout { padding: 0 10px; } }

/* ---------- sign-in page: phone first, card on iPad, split with a dark panel from 1024px ---------- */
.auth-page { min-height: 100vh; min-height: 100dvh; }
.auth { min-height: 100vh; min-height: 100dvh; display: flex; }
.auth-side { display: none; }
.auth-main { flex: 1; display: flex; flex-direction: column; min-width: 0;
  padding: max(16px, env(safe-area-inset-top)) 22px calc(20px + var(--safe-bottom)); }
.auth-top { display: flex; }
.auth h1 { font-size: 28px; line-height: 1.12; letter-spacing: -0.03em; text-wrap: balance; }
.auth h1 em { font-style: normal; color: var(--accent); }
.auth .lead { margin-top: 8px; }
.auth-form { margin-top: 22px; display: flex; flex-direction: column; gap: 14px; }
.auth-form .error { margin: 0; font-size: 14px; }
.auth-form .btn { width: 100%; min-height: 54px; }
.pw { position: relative; display: block; margin-top: 8px; }
.pw .input { margin: 0; min-height: 54px; padding-right: 54px; }
.input.bad { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 12px; background: none; color: var(--muted); cursor: pointer; }
.eye:hover { color: var(--ink); }
.eye .slash { display: none; }
.eye[aria-pressed="true"] .slash { display: inline; }
.check { position: relative; display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; color: var(--text2); cursor: pointer; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check .box { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--field); background: var(--card); display: flex; align-items: center; justify-content: center; flex: none; }
.check .box svg { visibility: hidden; }
.check input:checked + .box { background: var(--accent); border-color: var(--accent); }
.check input:checked + .box svg { visibility: visible; }
.check input:focus-visible + .box { outline: 3px solid var(--accent-ring); outline-offset: 2px; }
.auth-foot { margin-top: auto; padding-top: 20px; display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 13px; }

/* fanned listing cards: what snaplist makes */
.fan { position: relative; height: 210px; margin: 14px 0 4px; flex: none; }
.snap { position: absolute; left: 50%; top: 10px; width: 136px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 8px 8px 10px;
  box-shadow: 0 14px 30px -14px rgba(23, 24, 28, .28); }
.snap .ph { height: 102px; border-radius: 10px; position: relative; overflow: hidden; }
.snap i { display: block; margin-top: 8px; height: 7px; border-radius: 4px; background: #ECECE7; }
.snap i + i { width: 64%; margin-top: 5px; }
.snap.a { transform: translateX(-118%) rotate(-9deg); top: 30px; }
.snap.b { transform: translateX(-50%) rotate(1deg); z-index: 2; }
.snap.c { transform: translateX(18%) rotate(8deg); top: 34px; }
.ph.mug { background: radial-gradient(circle at 50% 120%, #E7D3C2 0 45%, transparent 46%), linear-gradient(#F1E6DB, #E8D9CA); }
.ph.mug::before { content: ""; position: absolute; left: 30%; top: 28%; width: 34%; height: 46%; border-radius: 6px 6px 14px 14px; background: var(--accent); }
.ph.mug::after { content: ""; position: absolute; left: 64%; top: 38%; width: 14%; height: 22%; border: 5px solid var(--accent); border-left: 0; border-radius: 0 12px 12px 0; }
.ph.ring { background: linear-gradient(160deg, #2A2B30, #17181C); }
.ph.ring::before { content: ""; position: absolute; left: 32%; top: 26%; width: 36%; height: 48%; border-radius: 999px; border: 7px solid #E9C46A; }
.ph.ring::after { content: ""; position: absolute; left: 44%; top: 18%; width: 12%; height: 14%; background: #F4F4F1; transform: rotate(45deg); border-radius: 3px; }
.ph.candle { background: linear-gradient(#DDE7DE, #C9D8CB); }
.ph.candle::before { content: ""; position: absolute; left: 36%; top: 40%; width: 28%; height: 44%; background: var(--soft); border-radius: 6px; }
.ph.candle::after { content: ""; position: absolute; left: 47%; top: 22%; width: 6%; height: 16%; background: #F59E0B; border-radius: 50% 50% 40% 40%; }
.badge { position: absolute; z-index: 3; display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 999px; white-space: nowrap;
  font: 500 12px/1 "JetBrains Mono", ui-monospace, monospace; color: var(--ink); background: var(--card); border: 1px solid var(--line);
  box-shadow: 0 6px 16px -8px rgba(23, 24, 28, .3); }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: var(--ok-dot); }
.badge.b1 { left: 2%; bottom: 6px; }
.badge.b2 { right: 0; top: 0; }

/* short phones (iPhone SE) and the open keyboard: drop the picture, keep the form */
@media (max-height: 620px) { .auth-main > .fan { display: none; } .auth-card { margin-top: 20px; } }

@media (min-width: 768px) {
  .auth-main { align-items: center; justify-content: center; padding: 32px 40px; }
  .auth-top { position: absolute; top: max(28px, env(safe-area-inset-top)); left: 32px; }
  .auth-main > .fan { width: 100%; max-width: 440px; }
  .auth-card { width: 100%; max-width: 440px; background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 32px;
    box-shadow: 0 24px 50px -28px rgba(23, 24, 28, .25); }
  .auth-foot { margin-top: 24px; }
}

@media (min-width: 1024px) {
  .auth-side { display: flex; flex-direction: column; width: 46%; max-width: 620px; background: var(--ink); color: #FFFFFF; padding: 40px 48px; overflow: hidden; }
  .auth-side .logo { color: #FFFFFF; }
  .auth-side h2 { margin-top: 48px; font-size: 30px; line-height: 1.15; letter-spacing: -0.025em; max-width: 380px; text-wrap: balance; }
  .auth-side ol { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 12px; color: #D9D9D5; font-size: 15px; }
  .auth-side li { display: flex; gap: 12px; align-items: center; }
  .auth-side li b { width: 26px; height: 26px; border-radius: 999px; background: #2C2D33; color: #FFFFFF; display: flex; align-items: center; justify-content: center; font-size: 13px; flex: none; }
  .auth-side .fan { margin-top: auto; height: 240px; }
  .auth-side .snap { border-color: #2C2D33; }
  .auth-top, .auth-main > .fan { display: none; }
  .auth-main { align-items: flex-start; padding: 48px 64px; }
  .auth-card { background: none; border: 0; box-shadow: none; padding: 0; }
  .auth-foot { justify-content: flex-start; }
  .auth h1 { font-size: 34px; }
}

/* ---------- accounts: admin back office, account page ---------- */
.pill-admin { background: var(--ink); color: #FFFFFF; text-decoration: none; min-height: 36px; }
.pill-admin:hover { color: #FFFFFF; }
.pill-bad { background: var(--bad-soft); color: var(--bad); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-new { background: var(--info-soft); color: var(--info); }
.note-box { margin-top: 16px; padding: 12px 14px; border-radius: 14px; background: var(--warn-soft); color: var(--warn); font-size: 14px; font-weight: 600; }
.tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.tabs a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; color: var(--muted); font-weight: 700; text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current] { color: var(--ink); border-color: var(--accent); }
.tabs a span { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12px; font-weight: 500; color: var(--faint); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.stat b { display: block; font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--muted); }
.invite-form { display: flex; flex-direction: column; gap: 12px; }
.link-box { border-color: var(--accent-ring); background: var(--accent-soft); }
.link-field { width: 100%; font-size: 13px; }
.people { list-style: none; margin: 8px 0 0; padding: 0; }
.person { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.person:first-child { border-top: 0; }
.person.is-blocked .person-info { opacity: .6; }
.av { width: 40px; height: 40px; flex: none; border-radius: 999px; background: var(--accent); color: #FFFFFF; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.av-wait { background: var(--line); color: var(--muted); }
.person-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.person-info b { font-size: 15px; }
.person-info > span { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.you { font-size: 12px; font-weight: 600; color: var(--faint); }
.person form { margin: 0; }
.menu { position: relative; }
.menu > summary { list-style: none; min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 12px; cursor: pointer; font-weight: 800; color: var(--muted); }
.menu > summary::-webkit-details-marker, .confirm > summary::-webkit-details-marker { display: none; }
.menu > summary:hover, .menu[open] > summary { background: var(--soft); color: var(--ink); }
.menu-body { position: absolute; right: 0; top: 48px; z-index: 6; width: 260px; background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 12px 32px rgba(23, 24, 28, .14); padding: 6px; display: flex; flex-direction: column; }
.menu-body button, .confirm > summary { width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: none; font: inherit; font-size: 15px; font-weight: 600; color: var(--ink); text-align: left; cursor: pointer; display: flex; align-items: center; list-style: none; }
.menu-body button:hover, .confirm > summary:hover { background: var(--soft); }
.confirm > summary { color: var(--bad); }
.confirm form { padding: 4px 12px 10px; font-size: 14px; color: var(--text2); display: flex; flex-direction: column; gap: 10px; }
.menu-body .danger { background: var(--bad); color: #FFFFFF; justify-content: center; }
.menu-body .danger:hover { background: var(--bad); opacity: .9; }
.person { align-items: flex-start; }
.person > .av, .person > .menu, .person > form { margin-top: 2px; }
.person-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.person-pills:empty { display: none; }
.account-logout { display: none; }
@media (max-width: 420px) {
  .top-right form:has(.logout) { display: none; }
  .account-logout { display: flex; }
}
.top-right .pill-ok { max-width: 150px; overflow: hidden; text-overflow: ellipsis; display: inline-block; }
.top-right { min-width: 0; }
.top-right .pill-connect { min-width: 0; overflow: hidden; text-overflow: ellipsis; display: inline-block; line-height: 24px; }  /* 320px phones: shorten, don't push the account icon off-screen */

/* ---------- copy to Etsy by hand ---------- */
.copy-field { padding-bottom: 18px; border-bottom: 1px solid #F0F0EC; }
.copy-field:last-of-type { border-bottom: 0; padding-bottom: 0; }
.copy-field .lbl { align-items: center; }
.copy-field .lbl .n { display: inline-flex; width: 22px; height: 22px; border-radius: 999px; border: 2px solid var(--dash); align-items: center; justify-content: center;
  font-size: 12px; margin-right: 8px; color: var(--muted); }
.copy-field.copied .lbl .n { background: var(--ok-dot); border-color: var(--ok-dot); color: #FFFFFF; }
.copy-value { margin-top: 8px; padding: 12px 14px; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; overflow-wrap: anywhere; }
.copy-value.pre { white-space: pre-wrap; max-height: 320px; overflow-y: auto; }
.copy-btn { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--field);
  background: var(--card); color: var(--ink); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.copy-btn:hover { background: var(--soft); }
.copy-btn.done { background: var(--ok-soft); border-color: #BFE3CB; color: var(--ok); }
.chip.copy { padding: 6px 12px; cursor: pointer; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink); }
.chip.copy:hover { background: #E8E8E3; }
.chip.copy.done { background: var(--ok-soft); border-color: #BFE3CB; color: var(--ok); }
.attrs { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; margin-top: 8px; }
.files { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.files a { display: flex; justify-content: space-between; gap: 12px; min-height: 40px; align-items: center; font-size: 14px; font-weight: 600; }
.warn-box { display: flex; gap: 10px; align-items: flex-start; background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-line);
  padding: 12px 14px; border-radius: 14px; font-weight: 600; font-size: 14px; }
.posted-form { display: flex; flex-direction: column; gap: 10px; }
