/* ThaiQR — dashboard, admin, auth and landing styles. Plain CSS with design tokens; no build step. */

:root {
	--bg: #faf8f4;
	--surface: #ffffff;
	--surface-2: #f4f1ea;
	--line: #e6e1d6;
	--line-strong: #d3ccbc;
	--ink: #23201b;
	--ink-2: #4a453c;
	--muted: #7a7467;
	--brand: #0f5c55;
	--brand-strong: #0a443f;
	--brand-soft: #e3f0ee;
	--brand-ink: #ffffff;
	--accent: #d9482b;
	--accent-soft: #fdeae5;
	--gold: #e8a317;
	--gold-soft: #fdf3da;
	--ok: #1c7c4d;
	--ok-soft: #e2f4ea;
	--warn: #9a5a00;
	--warn-soft: #fdf0d8;
	--err: #b3261e;
	--err-soft: #fde8e6;
	--info: #245a9e;
	--info-soft: #e4eefb;
	--radius: 14px;
	--radius-sm: 9px;
	--shadow: 0 1px 2px rgba(35, 32, 27, .06), 0 6px 20px rgba(35, 32, 27, .06);
	--shadow-lg: 0 10px 40px rgba(35, 32, 27, .18);
	--font: "Inter", system-ui, -apple-system, "Segoe UI", "Leelawadee UI", "Noto Sans Thai", "Sarabun", Roboto, "Helvetica Neue", Arial, sans-serif;
	--gutter: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 1.65rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
code, kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; background: var(--surface-2); padding: .1em .35em; border-radius: 5px; }
.i { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; flex: none; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt0 { margin-top: 0; } .mt1 { margin-top: 8px; } .mt2 { margin-top: 16px; } .mt3 { margin-top: 28px; }
.mb0 { margin-bottom: 0; } .mb1 { margin-bottom: 8px; } .mb2 { margin-bottom: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.row.top { align-items: flex-start; }
.stack > * + * { margin-top: 12px; }
.grow { flex: 1 1 0; min-width: 0; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- shell ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(250, 248, 244, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1180px; margin: 0 auto; padding: 10px var(--gutter); display: flex; align-items: center; gap: 14px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 750; font-size: 1.12rem; color: var(--ink); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center; }
.brand-mark .i { width: 18px; height: 18px; stroke-width: 2; }
.brand em { font-style: normal; color: var(--accent); }
.spacer { flex: 1; }
.langsw { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; gap: 2px; }
.langsw a { padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; color: var(--ink-2); }
.langsw a.on { background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); color: var(--ink); }
.langsw a:hover { text-decoration: none; }
.userbox { position: relative; }
.userbox summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 6px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.userbox summary::-webkit-details-marker { display: none; }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: .8rem; }
.userbox .pop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 6px; }
.userbox .pop a, .userbox .pop button { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 8px 10px; border-radius: 7px; color: var(--ink); background: none; border: 0; font: inherit; cursor: pointer; }
.userbox .pop a:hover, .userbox .pop button:hover { background: var(--surface-2); text-decoration: none; }
.tabs { max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 10px 14px; color: var(--ink-2); font-weight: 560; white-space: nowrap; border-bottom: 2.5px solid transparent; display: inline-flex; gap: 7px; align-items: center; }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tabs a.on { color: var(--brand); border-color: var(--brand); }
.tabs .pill { background: var(--accent); color: #fff; border-radius: 999px; font-size: .7rem; padding: 1px 7px; font-weight: 700; }
.page { max-width: 1180px; margin: 0 auto; padding: 22px var(--gutter) 80px; }
.page.narrow { max-width: 760px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 4px; }

/* ---------- elements ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card + .card { margin-top: 16px; }
.grid > .card + .card, .split > .card + .card, .split > section + section { margin-top: 0; }
.card-title { display: flex; align-items: center; gap: 9px; margin: 0 0 12px; font-size: 1.02rem; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); align-items: start; }
@media (max-width: 860px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .split { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2; transition: background .12s, border-color .12s, box-shadow .12s; min-height: 40px; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:focus-visible, .input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent); outline-offset: 1px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: var(--brand-strong); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.accent:hover { filter: brightness(.94); }
.btn.danger { color: var(--err); border-color: color-mix(in srgb, var(--err) 35%, var(--line)); }
.btn.danger:hover { background: var(--err-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 5px 11px; min-height: 32px; font-size: .86rem; border-radius: 8px; }
.btn.block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.htmx-request .btn.primary, .btn.htmx-request { opacity: .75; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 650; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.err { background: var(--err-soft); color: var(--err); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }
.badge.gold { background: var(--gold-soft); color: #7a5400; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

.alert { display: flex; gap: 11px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--info-soft); color: #173f70; border: 1px solid color-mix(in srgb, var(--info) 22%, transparent); margin-bottom: 16px; align-items: flex-start; }
.alert.ok { background: var(--ok-soft); color: #0f4d2e; border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.alert.warn { background: var(--warn-soft); color: #5e3700; border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.alert.err { background: var(--err-soft); color: #7a1914; border-color: color-mix(in srgb, var(--err) 25%, transparent); }
.alert .i { margin-top: 2px; }
.alert > div { flex: 1; min-width: 0; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }

/* forms */
.field { margin-bottom: 14px; }
.field > label, .label { display: block; font-weight: 600; margin-bottom: 5px; font-size: .9rem; }
.hint { color: var(--muted); font-size: .83rem; margin-top: 4px; }
.input, select, textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; font: inherit; color: var(--ink); min-height: 40px; }
textarea { min-height: 84px; resize: vertical; }
.input:focus, select:focus, textarea:focus { border-color: var(--brand); }
.input.err { border-color: var(--err); }
.input-group { display: flex; }
.input-group .pre { display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--line-strong); border-right: 0; border-radius: 10px 0 0 10px; background: var(--surface-2); color: var(--muted); font-size: .9rem; white-space: nowrap; }
.input-group .input { border-radius: 0 10px 10px 0; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; cursor: pointer; }
.check input { margin-top: 4px; width: 17px; height: 17px; accent-color: var(--brand); flex: none; }
.check-card { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; background: var(--surface); }
.check-card:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.check-card:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.check-card input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--brand); }
.check-card b { display: block; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); cursor: pointer; font-size: .9rem; user-select: none; }
.chip:has(input:checked) { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent); }

/* tables */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #fcfbf8; }
.table-wrap { overflow-x: auto; }

/* stats */
.stat { padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.stat b { display: block; font-size: 1.9rem; letter-spacing: -.03em; line-height: 1.1; }
.stat span { color: var(--muted); font-size: .86rem; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 120px; }
.bars i { flex: 1; background: var(--brand); border-radius: 4px 4px 0 0; min-height: 2px; opacity: .85; position: relative; }
.bars i:hover { opacity: 1; }
.progress { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist .ico { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--muted); }
.checklist li.done .ico { background: var(--ok-soft); color: var(--ok); }
.checklist li.warn .ico { background: var(--warn-soft); color: var(--warn); }
.checklist li.err .ico { background: var(--err-soft); color: var(--err); }
.checklist .ico .i { width: 13px; height: 13px; stroke-width: 2.6; }

/* ---------- menu editor ---------- */
.cat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; box-shadow: var(--shadow); }
.cat-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.cat-head h3 { margin: 0; font-size: 1.05rem; }
.cat-head .count { color: var(--muted); font-size: .85rem; }
.handle { cursor: grab; color: var(--muted); padding: 4px; border-radius: 6px; display: inline-flex; touch-action: none; }
.handle:hover { background: var(--surface-2); }
.sortable-ghost { opacity: .35; }
.dish { display: grid; grid-template-columns: auto 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface); }
.dish:last-child { border-bottom: 0; border-radius: 0 0 var(--radius) var(--radius); }
.dish.sold { background: repeating-linear-gradient(135deg, #fff, #fff 10px, #faf6ef 10px, #faf6ef 20px); }
.dish-photo { width: 64px; height: 64px; border-radius: 12px; background: var(--surface-2); object-fit: cover; display: grid; place-items: center; color: var(--muted); overflow: hidden; }
.dish-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.num { display: inline-grid; place-items: center; min-width: 34px; height: 24px; padding: 0 8px; border-radius: 7px; background: var(--ink); color: #fff; font-weight: 750; font-size: .85rem; letter-spacing: .01em; }
.dish-name { font-weight: 620; }
.dish-sub { color: var(--muted); font-size: .85rem; }
.dish-ops { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.price-input { width: 92px; text-align: right; padding: 6px 9px; min-height: 34px; font-variant-numeric: tabular-nums; }
.switch { position: relative; display: inline-block; width: 40px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--line-strong); border-radius: 999px; transition: background .15s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::before { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent); }
.live-tag { font-size: .72rem; color: var(--ok); font-weight: 650; display: inline-flex; gap: 4px; align-items: center; }
@media (max-width: 640px) {
	.dish { grid-template-columns: 64px minmax(0, 1fr); }
	.dish .handle { display: none; }
	.dish-ops { grid-column: 1 / -1; justify-content: space-between; }
}

dialog { border: 0; border-radius: 18px; padding: 0; width: min(760px, calc(100vw - 20px)); max-height: calc(100vh - 20px); box-shadow: var(--shadow-lg); color: var(--ink); background: var(--surface); }
dialog::backdrop { background: rgba(35, 32, 27, .5); backdrop-filter: blur(2px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 2; border-radius: 18px 18px 0 0; }
.modal-head h2 { margin: 0; font-size: 1.1rem; }
.modal-body { padding: 18px; overflow-y: auto; max-height: calc(100vh - 150px); }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; position: sticky; bottom: 0; background: var(--surface); border-radius: 0 0 18px 18px; }
.langtabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.langtabs button { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 5px 13px; font: inherit; font-size: .86rem; font-weight: 600; cursor: pointer; }
.langtabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.langtabs .dotmark { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-left: 6px; background: var(--ok); }
.langtabs .dotmark.empty { background: var(--line-strong); }
.photo-drop { border: 2px dashed var(--line-strong); border-radius: var(--radius-sm); padding: 14px; display: flex; gap: 14px; align-items: center; background: var(--surface-2); }
.photo-drop img { width: 84px; height: 84px; border-radius: 12px; object-fit: cover; background: #fff; }
.ai-tag { font-size: .7rem; background: var(--gold-soft); color: #7a5400; border-radius: 6px; padding: 1px 7px; font-weight: 700; margin-left: 6px; }

/* ---------- moderation ---------- */
.diff-block { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; background: var(--surface); overflow: hidden; }
.diff-head { padding: 10px 14px; background: var(--surface-2); display: flex; gap: 10px; align-items: center; font-weight: 650; }
.diff-row { display: grid; grid-template-columns: 160px minmax(0, 1fr) minmax(0, 1fr); gap: 12px; padding: 9px 14px; border-top: 1px solid var(--line); align-items: start; }
.diff-row .f { color: var(--muted); font-size: .85rem; }
.diff-row .old { background: var(--err-soft); border-radius: 7px; padding: 4px 8px; text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--err) 50%, transparent); }
.diff-row .new { background: var(--ok-soft); border-radius: 7px; padding: 4px 8px; }
.diff-row .none { color: var(--muted); font-style: italic; }
.diff-row img { max-height: 72px; border-radius: 8px; display: block; }
.diff-item { padding: 12px 14px; border-top: 1px solid var(--line); }
.diff-item .row { align-items: flex-start; }
.remark { margin-top: 8px; }
@media (max-width: 760px) { .diff-row { grid-template-columns: 1fr; gap: 4px; } }
.sev-ERROR { color: var(--err); } .sev-WARN { color: var(--warn); } .sev-INFO { color: var(--info); }

/* ---------- auth / landing ---------- */
.auth { min-height: calc(100vh - 62px); display: grid; place-items: center; padding: 24px var(--gutter); }
.auth-card { width: min(440px, 100%); }
.hero { max-width: 1180px; margin: 0 auto; padding: 56px var(--gutter) 28px; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(2rem, 4.6vw, 3.3rem); letter-spacing: -.035em; line-height: 1.08; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 36em; }
.phone { width: min(300px, 100%); margin: 0 auto; border-radius: 34px; background: #111; padding: 10px; box-shadow: var(--shadow-lg); transform: rotate(2deg); }
.phone-in { background: #fff; border-radius: 26px; overflow: hidden; }
.phone-in .ph-cover { height: 96px; background: linear-gradient(135deg, #d9482b, #e8a317); }
.phone-in .ph-body { padding: 12px; }
.ph-item { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid #eee; }
.ph-item .ph-img { width: 46px; height: 46px; border-radius: 10px; background: #f3e7d8; display: grid; place-items: center; font-size: 1.4rem; }
.ph-item b { font-size: .86rem; display: block; }
.ph-item small { color: #888; font-size: .74rem; }
.ph-item .ph-price { margin-left: auto; font-weight: 700; font-size: .86rem; }
.ph-num { background: #1b1b1f; color: #fff; font-size: .68rem; font-weight: 750; border-radius: 5px; padding: 1px 6px; margin-right: 6px; }
.features { max-width: 1180px; margin: 0 auto; padding: 24px var(--gutter) 64px; }
.feature { padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.feature .ico { width: 42px; height: 42px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin-bottom: 12px; }
.feature h3 { margin-bottom: 6px; }
.feature p { color: var(--ink-2); margin: 0; }
.langstrip { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.langstrip span { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: .9rem; }
.footer { border-top: 1px solid var(--line); padding: 22px var(--gutter); color: var(--muted); font-size: .86rem; text-align: center; }
.footer a { color: var(--muted); margin: 0 8px; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; padding-top: 30px; } .phone { transform: none; } }

/* ---------- QR studio & print ---------- */
.qr-preview { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; place-items: center; }
.qr-preview svg { width: 100%; max-width: 260px; height: auto; }
.qr-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.qr-tile { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; background: var(--surface); text-align: center; }
.qr-tile .qr-img svg { width: 100%; height: auto; display: block; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches label { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line-strong); cursor: pointer; display: block; position: relative; }
.swatches input { position: absolute; opacity: 0; }
.swatches label:has(input:checked) { box-shadow: 0 0 0 2.5px var(--ink); }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; background: var(--surface); }
.seg label { padding: 7px 14px; cursor: pointer; font-weight: 600; font-size: .9rem; border-right: 1px solid var(--line); }
.seg label:last-child { border-right: 0; }
.seg input { position: absolute; opacity: 0; }
.seg label:has(input:checked) { background: var(--ink); color: #fff; }

.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; box-shadow: var(--shadow-lg); z-index: 100; font-weight: 600; }
.htmx-indicator { opacity: 0; transition: opacity .15s; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
.spinner { width: 16px; height: 16px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty .i { width: 40px; height: 40px; stroke-width: 1.4; margin-bottom: 8px; }
.preview-banner { background: var(--ink); color: #fff; padding: 8px var(--gutter); font-size: .86rem; display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; position: sticky; top: 0; z-index: 60; }
.preview-banner a { color: #ffd88a; }

/* one-time code input */
.code-input { font: 700 1.7rem/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .45em; text-align: center; padding-left: .45em; }
.verify-banner { background: var(--warn-soft); color: #5e3700; border-top: 1px solid color-mix(in srgb, var(--warn) 25%, transparent); padding: 8px var(--gutter); font-size: .88rem; display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; }
.verify-banner a { font-weight: 700; color: inherit; text-decoration: underline; }
.mail-preview { width: 100%; height: 420px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #faf8f4; }fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
code.copy { user-select: all; word-break: break-all; font-size: .82rem; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }
