:root {
  --bg: #f4f3f0;
  --surface: #ffffff;
  --sunk: #f0eee9;
  --line: rgba(14, 14, 13, .08);
  --line-strong: rgba(14, 14, 13, .16);
  --ink: #111110;
  --ink-2: #3a3936;
  --muted: #76736d;
  --faint: #a29f98;
  --accent: #111110;
  --on-accent: #ffffff;
  --ok: #1f7a4d;
  --ok-bg: #e7f4ec;
  --warn: #9a5b00;
  --warn-bg: #fdf1dc;
  --bad: #b3261e;
  --bad-bg: #fbe9e7;
  --info-bg: #eef1f7;
  --info: #2d4a7a;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(14,14,13,.04), 0 8px 24px rgba(14,14,13,.05);
  --shadow-lg: 0 24px 64px rgba(14,14,13,.18);
  --side: 264px;
  --top: 68px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Inter Tight", "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14.5px/1.55 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -.02em; margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 600; font-size: 13.5px; text-decoration: none; white-space: nowrap; transition: background .15s ease, border-color .15s ease, transform .15s ease, opacity .15s ease; }
.btn:hover { background: var(--sunk); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn-primary:hover { background: #2a2926; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: rgba(14,14,13,.05); }
.btn-danger { color: var(--bad); }
.btn-danger-fill { background: var(--bad); border-color: var(--bad); }
.btn-danger-fill:hover { background: #8f1e18; }
.btn.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 12.5px; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); }
.icon-btn:hover { background: rgba(14,14,13,.06); color: var(--ink); }
.icon-btn.danger:hover { background: var(--bad-bg); color: var(--bad); }
.kbd { font: 11px/1 var(--font); padding: 3px 6px; border-radius: 6px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.2); }

/* Login */
.login { min-height: 100%; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.login-art { position: relative; overflow: hidden; background: #0e0e0d; color: #f4f3f0; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.login-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 42%; transform: scale(1.85); transform-origin: center 42%; opacity: .62; }
.login-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(14,14,13,.42), rgba(14,14,13,.2) 40%, rgba(14,14,13,.9)); }
.login-art > * { position: relative; z-index: 1; }
.login-art h2 { font-size: clamp(30px, 3.4vw, 46px); line-height: 1.05; max-width: 14ch; font-weight: 600; letter-spacing: -.035em; }
.login-art p { color: rgba(244,243,240,.72); max-width: 44ch; margin: 14px 0 0; }
.login-side { display: grid; place-items: center; padding: 40px 24px; min-width: 0; }
.login-card { width: min(400px, 100%); min-width: 0; }
.login-card .muted, .login-foot { overflow-wrap: anywhere; }
.login-card h1 { font-size: 30px; margin: 28px 0 6px; }
.login-card .muted { margin: 0 0 22px; }
.login-card .field + .field { margin-top: 14px; }
.login-card .btn-primary { width: 100%; min-height: 48px; margin-top: 18px; }
.login-foot { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.login-foot a { color: var(--ink); font-weight: 600; }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--ink); color: #fff; display: grid; place-items: center; }
.brand-mark svg { width: 18px; height: 18px; }
.brand-type { display: grid; line-height: 1.1; }
.brand-type strong { font-family: var(--display); letter-spacing: .14em; font-size: 13px; }
.brand-type span { font-size: 11.5px; color: var(--muted); }
.login-art .brand-mark { background: #f4f3f0; color: #0e0e0d; }
.login-art .brand-type span { color: rgba(244,243,240,.6); }

/* App shell */
.app { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100%; }
.app.with-preview { grid-template-columns: var(--side) minmax(0, 1fr) minmax(380px, 42%); }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; padding: 18px 14px; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; }
.side .brand { padding: 4px 8px 18px; }
.nav-group { margin-top: 10px; }
.nav-group > p { margin: 0 0 6px; padding: 0 10px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.nav-link { width: 100%; display: flex; align-items: center; gap: 11px; padding: 9px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); font-weight: 500; text-align: left; text-decoration: none; transition: background .15s ease, color .15s ease; }
.nav-link:hover { background: var(--sunk); color: var(--ink); }
.nav-link.is-on { background: var(--ink); color: #fff; }
.nav-link .badge { margin-left: auto; }
.nav-link.is-on .badge { background: rgba(255,255,255,.18); color: #fff; }
.side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 2px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 30; height: var(--top); display: flex; align-items: center; gap: 14px; padding: 0 28px; background: rgba(244,243,240,.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.top-title { min-width: 0; }
.top-title small { display: block; font-size: 12px; color: var(--muted); }
.top-title strong { font-family: var(--display); font-size: 17px; letter-spacing: -.01em; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.burger { display: none; }

.status { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--ok-bg); color: var(--ok); }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.is-dirty { background: var(--warn-bg); color: var(--warn); }
.status.is-busy { background: var(--info-bg); color: var(--info); }
.status.is-busy::before { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }

.view { padding: 30px 28px 100px; max-width: 1180px; width: 100%; }
.dock {
  position: sticky; bottom: 16px; z-index: 25; margin: 0 auto; width: min(720px, calc(100% - 24px));
  display: none; align-items: center; gap: 12px; padding: 12px 14px 12px 18px; border-radius: 999px;
  background: rgba(14,14,13,.92); color: #f4f3f0; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-lg);
}
.dock.is-on { display: flex; }
.dock p { margin: 0; flex: 1; min-width: 0; font-size: 13.5px; font-weight: 500; }
.dock .btn { background: #f4f3f0; color: #0e0e0d; border-color: #f4f3f0; }
.dock .btn-ghost { background: transparent; color: #f4f3f0; border-color: rgba(255,255,255,.2); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-head h1 { font-size: 28px; font-weight: 600; letter-spacing: -.03em; }
.page-head p { margin: 6px 0 0; color: var(--muted); max-width: 70ch; }

/* Cards, sections */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line), var(--shadow); padding: 24px; }
.card + .card, .card + .callout, .callout + .card, .grid-2 + .card, .card + .grid-2 { margin-top: 18px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.card-head h2 { font-size: 17px; font-weight: 600; }
.card-head p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; max-width: 66ch; }
.step-no { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-right: 8px; border-radius: 8px; background: var(--sunk); font-size: 12px; font-weight: 700; vertical-align: 2px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stack { display: grid; gap: 16px; }
.muted { color: var(--muted); }
.divider { height: 1px; background: var(--line); margin: 22px 0; border: 0; }

.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--info-bg); color: var(--info); font-size: 13.5px; }
.callout svg.i { margin-top: 1px; }
.callout b { color: inherit; }
.callout p { margin: 0; }
.callout p + p { margin-top: 6px; }
.callout.warn { background: var(--warn-bg); color: var(--warn); }
.callout.ok { background: var(--ok-bg); color: var(--ok); }
.callout.plain { background: var(--sunk); color: var(--ink-2); }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--sunk); color: var(--ink-2); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.dark { background: var(--ink); color: #fff; }

/* Fields */
.field { display: grid; gap: 7px; min-width: 0; }
.field-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--ink-2); display: inline-flex; align-items: center; gap: 7px; }
.lang { display: inline-grid; place-items: center; min-width: 24px; height: 18px; padding: 0 5px; border-radius: 5px; background: var(--sunk); color: var(--muted); font-size: 10.5px; font-weight: 700; letter-spacing: .04em; }
.count { font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.count.warn { color: var(--warn); }
.count.bad { color: var(--bad); }
.input, .field input:not([type=checkbox]):not([type=radio]), .field textarea, .field select, .select {
  width: 100%; min-height: 42px; padding: 10px 13px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); outline: none; transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
.field input:hover, .field textarea:hover, .field select:hover, .select:hover { border-color: rgba(14,14,13,.28); }
.field input:focus, .field textarea:focus, .field select:focus, .select:focus, .input:focus { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(14,14,13,.07); }
.field select, .select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2376736d' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; }
.hint { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.field.is-changed input, .field.is-changed textarea { border-color: #c9a96a; background: #fffcf5; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.input-wrap { position: relative; }
.input-wrap .icon-btn { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); }

.search { position: relative; }
.search svg.i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search input { width: 100%; min-height: 42px; padding: 0 14px 0 40px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); outline: none; }
.search input:focus { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(14,14,13,.07); }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-ui { position: relative; width: 38px; height: 22px; border-radius: 999px; background: #d6d3cc; transition: background .2s ease; flex: none; }
.switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s ease; }
.switch input:checked + .switch-ui { background: var(--ink); }
.switch input:checked + .switch-ui::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--ink); outline-offset: 2px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.chip small { color: var(--faint); font-weight: 600; }
.chip:hover { background: var(--sunk); }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.is-on small { color: rgba(255,255,255,.6); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.toolbar .search { flex: 1 1 260px; }

/* Dashboard */
.hello { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; margin-bottom: 18px; }
.hello-card { position: relative; overflow: hidden; border-radius: var(--radius); background: #0e0e0d; color: #f4f3f0; padding: 30px; min-height: 230px; display: flex; flex-direction: column; justify-content: flex-end; }
.hello-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .45; }
.hello-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(14,14,13,.92), rgba(14,14,13,.35)); }
.hello-card > * { position: relative; z-index: 1; }
.hello-card h1 { font-size: 30px; font-weight: 600; letter-spacing: -.03em; }
.hello-card p { margin: 8px 0 18px; color: rgba(244,243,240,.75); max-width: 50ch; }
.hello-card .btn { background: #f4f3f0; color: #0e0e0d; border-color: #f4f3f0; }
.stat { background: var(--surface); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line), var(--shadow); padding: 18px 20px; }
.stat b { display: block; font-family: var(--display); font-size: 28px; font-weight: 600; letter-spacing: -.03em; }
.stat span { color: var(--muted); font-size: 13px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; counter-reset: how; }
.how div { padding: 18px; border-radius: 12px; background: var(--sunk); }
.how div::before { counter-increment: how; content: counter(how); display: grid; place-items: center; width: 28px; height: 28px; margin-bottom: 12px; border-radius: 9px; background: var(--ink); color: #fff; font-weight: 700; font-size: 13px; }
.how b { display: block; margin-bottom: 4px; }
.how p { margin: 0; color: var(--muted); font-size: 13.5px; }
.shortcuts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.shortcut { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); text-align: left; transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.shortcut:hover { border-color: var(--line-strong); transform: translateY(-1px); box-shadow: var(--shadow); }
.shortcut .ico { width: 38px; height: 38px; border-radius: 11px; background: var(--sunk); display: grid; place-items: center; flex: none; }
.shortcut b { display: block; font-size: 14px; }
.shortcut span { color: var(--muted); font-size: 12.5px; }

/* Home sections */
.sections { display: grid; gap: 8px; }
.section-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); }
.section-row .no { width: 30px; height: 30px; border-radius: 9px; background: var(--sunk); display: grid; place-items: center; font-weight: 700; font-size: 12px; color: var(--muted); flex: none; }
.section-row div { flex: 1; min-width: 0; }
.section-row b { display: block; font-size: 14px; }
.section-row span { color: var(--muted); font-size: 12.5px; }
.section-row.is-off { background: var(--sunk); }
.section-row.is-off b { color: var(--muted); }

/* Door list editor */
.doorlist { display: flex; flex-wrap: wrap; gap: 10px; }
.dl-item { position: relative; width: 108px; border-radius: 12px; background: var(--sunk); overflow: hidden; box-shadow: 0 0 0 1px var(--line); cursor: grab; }
.dl-item.is-drag { opacity: .4; }
.dl-item.is-over { box-shadow: 0 0 0 2px var(--ink); }
.dl-item img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.dl-item figcaption { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 6px 6px 6px 9px; background: var(--surface); font-size: 11.5px; font-weight: 600; }
.dl-item .ord { position: absolute; left: 6px; top: 6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 6px; background: rgba(14,14,13,.78); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.dl-item .tools { position: absolute; right: 6px; top: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s ease; }
.dl-item:hover .tools, .dl-item:focus-within .tools { opacity: 1; }
.dl-item .tools button { width: 24px; height: 24px; border: 0; border-radius: 7px; background: rgba(255,255,255,.94); display: grid; place-items: center; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.dl-item .tools svg.i { width: 13px; height: 13px; }
.dl-add { width: 108px; min-height: 160px; border-radius: 12px; border: 1.5px dashed var(--line-strong); background: transparent; color: var(--muted); display: grid; place-items: center; align-content: center; gap: 6px; font-size: 12.5px; font-weight: 600; }
.dl-add:hover { border-color: var(--ink); color: var(--ink); background: var(--surface); }
.single-pick { display: flex; gap: 16px; align-items: center; }
.single-pick img { width: 96px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 12px; box-shadow: 0 0 0 1px var(--line); }
.single-pick b { display: block; }

/* Texts */
.text-row { display: grid; gap: 12px; padding: 18px 0; border-top: 1px solid var(--line); }
.text-row:first-child { border-top: 0; padding-top: 0; }
.text-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.text-meta .orig { font-size: 12.5px; color: var(--muted); margin-right: 6px; max-width: 80ch; }
.text-row textarea { min-height: 46px !important; }
.more { display: flex; justify-content: center; margin-top: 18px; }

/* Series */
.split-view { display: grid; grid-template-columns: 280px 1fr; gap: 18px; align-items: start; }
.list { background: var(--surface); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line), var(--shadow); padding: 8px; position: sticky; top: calc(var(--top) + 18px); }
.list button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border: 0; border-radius: 10px; background: transparent; text-align: left; }
.list button:hover { background: var(--sunk); }
.list button.is-on { background: var(--ink); color: #fff; }
.list img { width: 36px; height: 44px; border-radius: 7px; object-fit: cover; flex: none; }
.list b { display: block; font-size: 13.5px; font-weight: 600; line-height: 1.2; }
.list small { font-size: 11.5px; opacity: .65; }

/* Catalog models */
.models { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.model { background: var(--surface); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line), var(--shadow); overflow: hidden; display: grid; grid-template-columns: 116px 1fr; }
.model.is-off { opacity: .62; }
.model-media { position: relative; background: var(--sunk); }
.model-media img { width: 100%; height: 100%; object-fit: cover; }
.model-media .badge { position: absolute; left: 8px; top: 8px; }
.model-body { padding: 14px; display: grid; gap: 10px; align-content: start; }
.model-body .field input, .model-body .field select { min-height: 36px; padding: 6px 10px; font-size: 13px; }
.model-body .field select { padding-right: 30px; }
.model-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.model-head b { font-size: 13.5px; }
.crops { display: flex; gap: 5px; flex-wrap: wrap; }
.crops span { position: relative; }
.crops img { width: 34px; height: 42px; object-fit: cover; border-radius: 6px; box-shadow: 0 0 0 1px var(--line); }
.crops em { position: absolute; left: 0; right: 0; bottom: 0; font-style: normal; text-align: center; font-size: 9.5px; font-weight: 700; color: #fff; background: rgba(14,14,13,.7); border-radius: 0 0 6px 6px; }

/* Media */
.drop { display: grid; place-items: center; gap: 10px; padding: 34px; border-radius: var(--radius); border: 1.5px dashed var(--line-strong); background: var(--surface); text-align: center; transition: border-color .15s ease, background .15s ease; }
.drop.is-over { border-color: var(--ink); background: var(--sunk); }
.drop .ico { width: 52px; height: 52px; border-radius: 15px; background: var(--sunk); display: grid; place-items: center; }
.drop b { font-size: 15px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-top: 18px; }
.media-item { background: var(--surface); border-radius: 14px; overflow: hidden; box-shadow: 0 0 0 1px var(--line), var(--shadow); }
.media-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--sunk); }
.media-item div { display: flex; align-items: center; gap: 4px; padding: 8px 8px 8px 12px; }
.media-item p { flex: 1; min-width: 0; margin: 0; font-size: 12.5px; }
.media-item p b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.media-item p span { color: var(--muted); font-size: 11.5px; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

/* SEO preview */
.serp { padding: 18px 20px; border-radius: 12px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); font-family: Arial, sans-serif; }
.serp small { display: block; color: #4d5156; font-size: 12.5px; margin-bottom: 4px; }
.serp strong { display: block; color: #1a0dab; font-size: 19px; font-weight: 400; line-height: 1.3; }
.serp p { margin: 4px 0 0; color: #4d5156; font-size: 13.5px; line-height: 1.5; }
.seo-meters { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.seo-meters > div { display: grid; gap: 6px; }
.seo-meters span { font-size: 12px; color: var(--muted); font-weight: 600; }
.meter { height: 6px; border-radius: 999px; background: var(--sunk); overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--ok); transition: width .2s ease, background .2s ease; }

/* Preview pane */
.preview { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--line); }
.preview-bar { height: var(--top); display: flex; align-items: center; gap: 8px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.preview-bar .url { flex: 1; min-width: 0; height: 34px; padding: 0 12px; border-radius: 999px; background: var(--sunk); display: flex; align-items: center; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview iframe { flex: 1; width: 100%; border: 0; background: var(--bg); }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--sunk); }
.seg button { height: 28px; padding: 0 10px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); display: grid; place-items: center; }
.seg button.is-on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.preview.is-mobile iframe { width: 390px; max-width: 100%; margin: 0 auto; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }

/* Overlays */
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px; }
.modal-scrim { position: absolute; inset: 0; border: 0; background: rgba(14,14,13,.45); backdrop-filter: blur(3px); animation: fade .2s ease; }
.modal-card { position: relative; width: min(460px, 100%); max-height: calc(100vh - 48px); display: flex; flex-direction: column; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg); animation: rise .25s cubic-bezier(.2,.8,.2,1); }
.modal-card.wide { width: min(1040px, 100%); }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 22px 24px 0; }
.modal-head h2 { font-size: 19px; font-weight: 600; }
.modal-head p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.modal-head .icon-btn { margin-left: auto; }
.modal-body { padding: 18px 24px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 16px 24px; border-top: 1px solid var(--line); }
.modal-foot .muted { margin-right: auto; font-size: 13px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(.98); } }

.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.pick { position: relative; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: var(--sunk); box-shadow: 0 0 0 1px var(--line); text-align: left; transition: box-shadow .15s ease, transform .15s ease; }
.pick:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px var(--line-strong), var(--shadow); }
.pick img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.pick span { display: block; padding: 6px 8px; background: var(--surface); font-size: 11.5px; font-weight: 600; }
.pick span small { display: block; color: var(--muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick.is-on { box-shadow: 0 0 0 2.5px var(--ink); }
.pick .tick { position: absolute; right: 7px; top: 7px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; display: none; place-items: center; }
.pick.is-on .tick { display: grid; }
.pick .tick svg.i { width: 13px; height: 13px; stroke-width: 2.4; }

.toast { position: fixed; left: 50%; bottom: 26px; z-index: 100; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 14px; background: #161615; color: #fff; font-weight: 500; box-shadow: var(--shadow-lg); transition: opacity .2s ease, transform .2s ease; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: var(--bad); }

.drawer { position: fixed; inset: 0; z-index: 85; }
.drawer-card { position: absolute; right: 0; top: 0; bottom: 0; width: min(460px, 100%); background: var(--surface); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .25s cubic-bezier(.2,.8,.2,1); }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.faq details { border-top: 1px solid var(--line); padding: 14px 0; }
.faq details:first-child { border-top: 0; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 18px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq p { margin: 10px 0 0; color: var(--muted); font-size: 13.5px; }

.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.strength span { height: 5px; border-radius: 999px; background: var(--sunk); }
.strength[data-level="1"] span:nth-child(-n+1) { background: var(--bad); }
.strength[data-level="2"] span:nth-child(-n+2) { background: var(--warn); }
.strength[data-level="3"] span:nth-child(-n+3) { background: #6f8f3a; }
.strength[data-level="4"] span { background: var(--ok); }

.scrim-mobile { display: none; }

@media (max-width: 1280px) {
  .app.with-preview { grid-template-columns: var(--side) minmax(0, 1fr); }
  .app.with-preview .preview { position: fixed; right: 0; top: 0; width: min(480px, 92vw); z-index: 60; box-shadow: var(--shadow-lg); }
}
@media (max-width: 1080px) {
  .hello, .grid-3, .shortcuts, .how { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .split-view { grid-template-columns: 1fr; }
  .list { position: static; display: flex; overflow-x: auto; gap: 4px; }
  .list button { width: auto; flex: none; }
}
@media (max-width: 860px) {
  .app, .app.with-preview { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; z-index: 70; width: var(--side); transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--shadow-lg); }
  .app.nav-open .side { transform: none; }
  .app.nav-open .scrim-mobile { display: block; position: fixed; inset: 0; z-index: 65; background: rgba(14,14,13,.4); border: 0; }
  .burger { display: inline-grid; }
  .top { padding: 0 14px; }
  .view { padding: 22px 16px 80px; }
  .login { grid-template-columns: minmax(0, 1fr); }
  .login-art { display: none; }
  .hello, .grid-2, .grid-3, .grid-4, .pair, .shortcuts, .how, .stats, .seo-meters { grid-template-columns: 1fr; }
  .top-actions .hide-sm { display: none; }
  .models { grid-template-columns: 1fr; }
  .dock { border-radius: 18px; flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
