/* Qoohosh web client. Logical properties only, so RTL (fa) and LTR (en) share one stylesheet. */

/* Vazirmatn (OFL, github.com/rastikerdar/vazirmatn) — bundled locally, one variable file covers weights 100–900. */
@font-face {
  font-family: "Vazirmatn";
  src: url("fonts/Vazirmatn-Variable.woff2") format("woff2-variations"), url("fonts/Vazirmatn-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f3f5f4;
  --surface: #ffffff;
  --surface-2: #eef1f0;
  --line: #dde3e0;
  --text: #17201c;
  --muted: #64706b;
  --accent: #0e8f6e;
  --accent-ink: #ffffff;
  --accent-soft: #dcf2ea;
  --danger: #c2413a;
  --danger-soft: #fbe7e5;
  --warn: #a86a00;
  --radius: 10px;
  --radius-sm: 7px;
  --nav-w: 232px;
  --panel-w: 320px;
  --shadow: 0 1px 2px rgb(0 0 0 / .05), 0 4px 16px rgb(0 0 0 / .04);
  --font: "Vazirmatn", "Segoe UI", Tahoma, system-ui, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #111614;
  --surface: #181f1c;
  --surface-2: #202825;
  --line: #2c3632;
  --text: #e6ece9;
  --muted: #95a29c;
  --accent: #2fc196;
  --accent-ink: #062018;
  --accent-soft: #163a2f;
  --danger: #ef7d75;
  --danger-soft: #3a1d1b;
  --warn: #e0a640;
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }
.ltr { direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.hidden { display: none !important; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--nav-w) 1fr; height: 100vh; }
.nav { background: var(--surface); border-inline-end: 1px solid var(--line); display: flex; flex-direction: column; padding: 14px 10px; gap: 2px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; font-weight: 700; font-size: 17px; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; color: var(--accent-ink); }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; }
.nav a:hover { background: var(--surface-2); }
.nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav-sep { height: 1px; background: var(--line); margin: 10px 6px; }
.nav-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 8px 6px 0; }
.balance-chip { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; background: var(--surface-2); border-radius: var(--radius-sm); }
.balance-chip b { color: var(--accent); }
.nav-tools { display: flex; gap: 6px; }
.nav-tools select, .nav-tools button { flex: 1; }

.main { overflow: auto; min-width: 0; }
.page { padding: 24px 28px; max-width: 1180px; }
.page h1 { font-size: 20px; margin: 0 0 4px; }
.page-sub { color: var(--muted); margin: 0 0 20px; }

/* ---------- studio ---------- */
.studio { display: grid; grid-template-columns: var(--panel-w) 1fr; height: 100vh; }
.panel { background: var(--surface); border-inline-end: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.panel-body { padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.panel-foot { padding: 12px 16px 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.canvas-wrap { display: grid; grid-template-rows: 1fr auto; min-width: 0; min-height: 0; }
.canvas { display: grid; place-items: center; padding: 24px; min-height: 0; overflow: auto; position: relative; }
.canvas-empty { text-align: center; color: var(--muted); max-width: 360px; }
.canvas-empty svg { width: 48px; height: 48px; opacity: .5; margin-bottom: 8px; }
.result { display: flex; flex-direction: column; gap: 12px; align-items: center; max-width: 100%; max-height: 100%; }
.result img { max-width: 100%; max-height: calc(100vh - 260px); border-radius: var(--radius); box-shadow: var(--shadow); background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0 / 16px 16px; }
.result audio { width: min(480px, 90vw); }
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.progress { display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--muted); text-align: center; max-width: 340px; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.recent { border-top: 1px solid var(--line); background: var(--surface); padding: 10px 16px; }
.recent summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.recent-strip { display: flex; gap: 10px; overflow-x: auto; padding-top: 10px; }
.thumb { flex: none; width: 92px; height: 92px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2); display: grid; place-items: center; overflow: hidden; cursor: pointer; padding: 0; position: relative; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .badge { position: absolute; inset-block-end: 4px; inset-inline-start: 4px; }

/* ---------- form controls ---------- */
label.field { display: flex; flex-direction: column; gap: 5px; }
.field-label { font-weight: 600; font-size: 13px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
input[type=text], input[type=email], input[type=number], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; outline: none;
}
textarea { resize: vertical; min-height: 110px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); padding: 7px 12px; border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap; text-decoration: none; color: var(--text); }
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-primary:hover { background: var(--accent); filter: brightness(1.06); }
.btn-lg { padding: 10px 14px; font-size: 15px; width: 100%; }
.btn-danger { color: var(--danger); }
.btn-sm { padding: 3px 9px; font-size: 12.5px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 3px 11px; cursor: pointer; }
.seg button.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.model-desc { font-size: 12.5px; color: var(--muted); margin: 0; }
.cost-line { display: flex; justify-content: space-between; color: var(--muted); font-size: 12.5px; }
.cost-line.bad { color: var(--danger); }

.dropzone { border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 12px; text-align: center; color: var(--muted); cursor: pointer; font-size: 12.5px; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.refs { display: flex; gap: 8px; flex-wrap: wrap; }
.ref { width: 62px; height: 62px; border-radius: var(--radius-sm); overflow: hidden; position: relative; border: 1px solid var(--line); background: var(--surface-2); display: grid; place-items: center; font-size: 11px; }
.ref img { width: 100%; height: 100%; object-fit: cover; }
.ref button { position: absolute; inset-block-start: 2px; inset-inline-end: 2px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgb(0 0 0 / .6); color: #fff; cursor: pointer; line-height: 1; padding: 0; }

/* ---------- cards, tables ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 18px; }
.card h2 { font-size: 15px; margin: 0 0 4px; }
.card .hint { color: var(--muted); margin: 0 0 14px; font-size: 13px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .k { color: var(--muted); font-size: 12.5px; }
.stat .v { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: start; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 12.5px; }
td.num, th.num { text-align: end; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.ok, .badge.succeeded { background: var(--accent-soft); color: var(--accent); }
.badge.bad, .badge.failed, .badge.canceled { background: var(--danger-soft); color: var(--danger); }
.badge.running, .badge.queued { background: #fff4dc; color: var(--warn); }
:root[data-theme="dark"] .badge.running, :root[data-theme="dark"] .badge.queued { background: #3a2c10; }
.form-row { display: grid; grid-template-columns: 2fr 1fr 1.3fr auto auto; gap: 10px; align-items: end; }
.check { display: flex; align-items: center; gap: 6px; padding-bottom: 8px; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.toolbar input { max-width: 280px; }
.job-row-prompt { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; background: var(--surface-2); display: block; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.login-card .brand { padding: 0; }
.login-top { display: flex; justify-content: space-between; align-items: center; }
.code-input { letter-spacing: 10px; text-align: center; font-size: 22px; direction: ltr; }
.dev-code { background: var(--surface-2); padding: 8px 10px; border-radius: var(--radius-sm); font-size: 12.5px; }

.banner { padding: 8px 14px; background: var(--danger-soft); color: var(--danger); text-align: center; font-size: 13px; }

#toast { position: fixed; inset-block-end: 20px; inset-inline-start: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 9px 16px; border-radius: 999px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; max-width: 90vw; }
[dir="rtl"] #toast { transform: translateX(50%); }
#toast.show { opacity: 1; }
#toast.err { background: var(--danger); color: #fff; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: auto; min-height: 100vh; }
  .nav { flex-direction: row; flex-wrap: wrap; border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .nav-foot { margin-top: 0; flex-direction: row; }
  .nav-sep { display: none; }
  .studio { grid-template-columns: 1fr; height: auto; }
  .form-row { grid-template-columns: 1fr; }
}

/* ---------- admin ---------- */
.page-wide { max-width: 1320px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 12px 0 18px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs a { padding: 8px 14px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.filters input[type=search] { max-width: 260px; }
.filters select, .filters input[type=date] { width: auto; }
.filters label.inline { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
.stat.sm { padding: 10px 14px; }
.stat.sm .v { font-size: 19px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid2 > .card { margin-bottom: 18px; }
.bar { block-size: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar span { display: block; block-size: 100%; background: var(--accent); border-radius: 999px; }
.list-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 12px; }
.nowrap { white-space: nowrap; }
.prompt-cell { min-width: 260px; max-width: 460px; }
.prompt-text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; }
.prompt-text.open { -webkit-line-clamp: unset; display: block; }
button.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; }
.user-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.user-head h2 { font-size: 17px; }
.user-balance { display: flex; align-items: center; gap: 14px; }
.user-balance .v { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
dialog.dlg { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); padding: 22px; width: min(420px, 92vw); box-shadow: 0 20px 60px rgb(0 0 0 / .25); }
dialog.dlg::backdrop { background: rgb(0 0 0 / .45); }
dialog.dlg form { display: flex; flex-direction: column; gap: 12px; }
dialog.dlg h2 { margin: 0; font-size: 17px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; }
@media (max-width: 1100px) { .grid2 { grid-template-columns: 1fr; } }

/* ---------- presets, providers, announcements ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 3px 11px; cursor: pointer; font-size: 12.5px; }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.chip.open { box-shadow: 0 0 0 2px var(--accent-soft); }
.preset-axes { margin-top: 8px; padding: 10px; border-radius: var(--radius-sm); background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
.axis { display: flex; flex-direction: column; gap: 4px; }
.announce { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 16px; background: var(--accent-soft); color: var(--accent); font-size: 13.5px; }
.announce.warning { background: #fff4dc; color: var(--warn); }
.announce.critical { background: var(--danger-soft); color: var(--danger); }
:root[data-theme="dark"] .announce.warning { background: #3a2c10; }
.announce button { background: none; border: 0; color: inherit; font-size: 18px; cursor: pointer; line-height: 1; }
.provider h2 { display: flex; align-items: center; gap: 8px; }
.provider h3 { font-size: 13.5px; margin: 18px 0 6px; }
.provider-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.switch { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.budget-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 12px; }
.budget { display: flex; flex-direction: column; gap: 4px; min-width: 140px; }
.bar.warn span { background: var(--warn); }
.bar.over span { background: var(--danger); }
.warn-text { color: var(--warn); }
.limits { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.limits .field { width: 160px; }
.key-form { display: grid; grid-template-columns: 1fr 1.6fr 0.8fr 0.8fr auto; gap: 8px; margin-top: 12px; }
.key-form input { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 7px 10px; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.small-input { margin-top: 4px; padding: 3px 7px !important; font-size: 12px; width: 190px !important; }
.num-input { width: 78px !important; }
.add-model { margin-top: 14px; }
.add-model summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.grid-form { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
.grid-form .span2 { grid-column: span 2; }
.preset-admin { display: flex; flex-direction: column; gap: 6px; }
.preset-toggle { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.preset-toggle:last-child { border-bottom: 0; }
@media (max-width: 1100px) { .key-form, .grid-form { grid-template-columns: 1fr; } .grid-form .span2 { grid-column: auto; } .budget-grid { grid-template-columns: 1fr; } }

/* ---------- workbench (v0.5) ---------- */
.nav-group summary { cursor: pointer; font-weight: 700; padding: 8px 10px; border-radius: var(--radius-sm); list-style: none; display: flex; justify-content: space-between; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary::after { content: "▾"; color: var(--muted); }
.nav-group:not([open]) summary::after { content: "▸"; }
[dir="rtl"] .nav-group:not([open]) summary::after { content: "◂"; }
.nav-group summary:hover { background: var(--surface-2); }
.nav a.sub { padding-inline-start: 26px; font-size: 13.5px; }
.acc-row { display: flex; align-items: center; gap: 6px; }
.acc-row a { flex: 1; }
.bal { border: 0; background: none; color: var(--accent); font-weight: 700; cursor: pointer; padding: 4px 6px; }
.side-btn { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-sm); padding: 7px; cursor: pointer; margin-top: 4px; }
.side-btn:hover { background: var(--surface-2); }
.nav-label { padding: 8px 10px 2px; }
.links-row { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.link-btn { border: 0; background: none; color: var(--muted); font-size: 11.5px; cursor: pointer; }
.link-btn:hover { color: var(--accent); }
.studio { grid-template-columns: 350px 1fr; }
.panel-title { padding: 12px 16px 0; font-weight: 700; }
.panel-foot { align-items: stretch; }
.cost-pill { align-self: center; background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 2px 12px; font-weight: 700; font-size: 13px; }
.cost-pill.bad { background: var(--danger); color: #fff; }
.btn-link { border: 0; background: none; color: var(--muted); }
.canvas-wrap { grid-template-rows: auto 1fr auto auto auto; }
.top-actions { display: flex; gap: 8px; padding: 12px 16px 0; flex-wrap: wrap; }
.result-actions { display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; padding: 6px 16px; }
#below { padding: 0 16px; }
.canvas { padding: 16px; }
.canvas .result img, .canvas .result video { max-width: 100%; max-height: calc(100vh - 330px); border-radius: var(--radius); }
.canvas-drop { inline-size: 100%; block-size: 100%; min-height: 320px; border: 2px dashed var(--accent-soft); border-radius: 12px; background: var(--surface);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--accent); cursor: pointer; padding: 20px; text-align: center; }
.canvas-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.canvas-drop b { font-size: 15px; }
.drop-plus { font-size: 34px; line-height: 1; }
.picker { position: relative; }
.picker-btn, .picker-item { inline-size: 100%; text-align: start; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 8px 10px; cursor: pointer; color: var(--text); }
.picker-list { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; max-height: 420px; overflow-y: auto; }
.picker-item.on { border-color: var(--accent); background: var(--accent-soft); }
.picker-item:disabled { opacity: .55; cursor: not-allowed; }
.mcard-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mcard-chips { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.tabs-seg { display: flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.tabs-seg .chip { flex: 1; border: 0; border-radius: 0; padding: 7px; }
.info-box { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.toggle-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.role-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.role-media { display: flex; align-items: center; justify-content: space-between; }
.role-media img { inline-size: 56px; block-size: 56px; object-fit: cover; border-radius: 6px; }
.slider { display: grid; grid-template-columns: 60px 1fr 52px; align-items: center; gap: 6px; font-size: 12.5px; }
.tiles { display: flex; flex-wrap: wrap; gap: 6px; }
.tile { inline-size: 64px; min-block-size: 54px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px; cursor: pointer; font-size: 11.5px; color: var(--muted); }
.tile b { color: var(--text); font-size: 12px; }
.tile.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.tile:disabled { opacity: .5; cursor: not-allowed; }
.counter { font-size: 12px; color: var(--muted); text-align: end; }
.counter.bad, .bad-text { color: var(--danger); }
.beat { display: grid; grid-template-columns: 64px 1fr auto; gap: 6px; align-items: center; }
.beat input { inline-size: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px; background: var(--surface); }
.beat-foot { display: flex; justify-content: space-between; align-items: center; }
.icon-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; inline-size: 28px; block-size: 26px; cursor: pointer; line-height: 1; }
.slots { display: flex; flex-wrap: wrap; gap: 6px; }
.slot { inline-size: 70px; block-size: 70px; border: 1.5px dashed var(--line); border-radius: 8px; background: var(--surface); font-size: 22px; color: var(--accent); cursor: pointer; position: relative; padding: 0; }
.slot.filled { border-style: solid; overflow: hidden; }
.slot.filled img { inline-size: 100%; block-size: 100%; object-fit: cover; }
.slot.filled .icon-btn { position: absolute; inset-block-start: 2px; inset-inline-end: 2px; }
.frames { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; }
.frame { inline-size: 150px; block-size: 112px; border: 1.5px dashed var(--accent-soft); border-radius: 10px; background: var(--surface); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px; color: var(--accent); cursor: pointer; padding: 6px; }
.frame:disabled { opacity: .5; cursor: not-allowed; }
.frame.filled { border-style: solid; cursor: default; }
.frame.filled img { max-inline-size: 100%; max-block-size: 72px; object-fit: contain; }
.frame-foot { display: flex; justify-content: space-between; align-items: center; inline-size: 100%; }
.checker { inline-size: 100%; block-size: 100%; min-height: 320px; border-radius: 12px; display: grid; place-items: center; padding: 16px;
  background: repeating-conic-gradient(#e3e8e6 0 25%, #ffffff 0 50%) 0 0 / 20px 20px; }
.checker img { max-inline-size: 100%; max-block-size: calc(100vh - 340px); }
.viewer3d { inline-size: 100%; block-size: 100%; min-height: 360px; background: #2b2f2e; border-radius: 12px; display: grid; place-items: center; color: #cfd8d4; text-align: center; }
.viewer3d canvas { inline-size: 100%; block-size: 100%; min-height: 360px; cursor: grab; }
.viewer3d svg { inline-size: 48px; block-size: 48px; opacity: .6; }
.textout { inline-size: 100%; max-height: 60vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; white-space: pre-wrap; direction: ltr; }
.sep { border-top: 1px solid var(--line); padding-top: 8px; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row-btns label.inline { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.compare { position: relative; margin-top: 14px; border-radius: 12px; overflow: hidden; background: var(--surface-2); min-height: 360px; touch-action: none; cursor: ew-resize; }
.compare img { display: block; inline-size: 100%; max-block-size: 70vh; object-fit: contain; }
.cmp-b-wrap { position: absolute; inset: 0; }
.cmp-handle { position: absolute; inset-block: 0; inline-size: 2px; background: #fff; box-shadow: 0 0 0 1px rgb(0 0 0 / .2); }
.compare, .cmp-b-wrap, .cmp-handle { direction: ltr; }
.annot { margin-top: 14px; display: grid; place-items: center; background: var(--surface-2); border-radius: 12px; padding: 12px; }
.annot canvas { max-inline-size: 100%; max-block-size: 70vh; touch-action: none; cursor: crosshair; }
.capture-overlay { position: fixed; inset: 0; z-index: 100; background-size: 100% 100%; cursor: crosshair; }
.capture-overlay::before { content: ""; position: absolute; inset: 0; background: rgb(0 0 0 / .35); pointer-events: none; }
.capture-sel { position: absolute; display: none; border: 2px solid #2fc196; box-shadow: 0 0 0 9999px rgb(0 0 0 / .2); }
.capture-hint { position: absolute; inset-block-start: 16px; inset-inline: 0; text-align: center; color: #fff; z-index: 1; }
.lib-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.page h2 { font-size: 15px; margin: 18px 0 8px; }
.sent { margin-top: 6px; } .sent summary { cursor: pointer; color: var(--muted); } .sent pre { white-space: pre-wrap; word-break: break-word; font-size: 11.5px; background: var(--surface-2); padding: 8px; border-radius: 6px; max-height: 260px; overflow: auto; text-align: left; }
