/* Mondsichtung Admin Panel. Tokens and components from variant A of mocks/hub-variants.html.
   Phone first (360 to 430 px), three columns from 1000 px. Dark by default, light follows the system. */

:root {
  color-scheme: dark;
  --bg: #0b0f14; --panel: #121923; --panel2: #1a2330; --line: #263244;
  --text: #ece6d6; --muted: #909cab; --faint: #5d6878;
  --accent: #62ba65; --ink: #07140a; --asoft: rgba(98, 186, 101, .15);
  --warn: #e3b65c; --wsoft: rgba(227, 182, 92, .14);
  --bad: #f08b7d; --bsoft: rgba(240, 139, 125, .13);
  --serif: ui-serif, "New York", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --pad: 18px;
  --padl: max(var(--pad), env(safe-area-inset-left));
  --padr: max(var(--pad), env(safe-area-inset-right));
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f2eee2; --panel: #fffdf6; --panel2: #e9e4d4; --line: #d5cdb8;
    --text: #1b2019; --muted: #586253; --faint: #9ba293;
    --accent: #2e7b32; --ink: #fff; --asoft: rgba(46, 123, 50, .13);
    --warn: #8a6100; --wsoft: rgba(138, 97, 0, .13);
    --bad: #b3261e; --bsoft: rgba(179, 38, 30, .1);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text); font: 15px/1.45 var(--sans); -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
p, h1, h2, h3, ul { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { font-size: 16px; } /* below 16px iOS zooms into the field */
code { font: 13px ui-monospace, "SF Mono", Menlo, monospace; overflow-wrap: anywhere; }
small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

[hidden] { display: none !important; }
.serif { font-family: var(--serif); }
.mut { color: var(--muted); }
.acc { color: var(--accent); }
.grow { flex: 1; min-width: 0; }
.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i.s { width: 14px; height: 14px; }

/* wordmark */
.wm { display: inline-flex; align-items: center; min-height: 44px; font: 400 16px/1 "Avenir Next Condensed", "Arial Narrow", "Helvetica Neue", sans-serif; letter-spacing: .05em; white-space: nowrap; text-decoration: none; }
.wm b { font-weight: 800; display: inline-flex; align-items: center; }
.wm i { width: .78em; height: .78em; border-radius: 50%; background: url(moon.webp) center / 116%; filter: sepia(1) saturate(4) hue-rotate(60deg) brightness(.85); margin: 0 .05em; }
.wm em { font: italic 500 15px var(--serif); color: var(--accent); margin-left: 7px; letter-spacing: 0; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--accent); color: var(--ink); font-weight: 600; font-size: 14.5px; line-height: 1.15; text-align: center; text-decoration: none; cursor: pointer; }
.btn.gh { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.btn.sm { padding: 0 12px; font-size: 13.5px; border-radius: 9px; gap: 6px; }
.btn.lg { min-height: 50px; font-size: 15.5px; border-radius: 13px; width: 100%; }
.btn.sq { width: 50px; min-height: 50px; padding: 0; border-radius: 13px; flex: none; }
.btn.off { background: var(--panel2); color: var(--muted); cursor: default; }
.btn.link { min-height: 44px; padding: 0 2px; background: none; color: var(--accent); font-size: 13px; }
.btn.htmx-request, .btn[data-busy-on] { opacity: .6; }
.btn .busy, .btn.htmx-request .idle { display: none; }
.btn.htmx-request .busy { display: inline; }
.btn.did { background: var(--asoft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.btn.link.bad { color: var(--bad); }
@media (pointer: fine) {
  .btn.sm { min-height: 32px; }
  .btn.link { min-height: 28px; }
}

/* chips and channel tiles */
.chip { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; letter-spacing: 0; text-transform: none; background: var(--panel2); color: var(--muted); white-space: nowrap; vertical-align: middle; }
.chip.ok, .chip.st-reviewed { background: var(--asoft); color: var(--accent); }
.chip.wn { background: var(--wsoft); color: var(--warn); }
.chip.st-sent { background: var(--accent); color: var(--ink); }
.chip.st-off { background: none; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }
.ch { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--panel2); color: var(--muted); flex: none; }
.ch.ok { background: var(--asoft); color: var(--accent); }
.ch.wn { background: var(--wsoft); color: var(--warn); }

/* labels, groups, fields */
.lbl { display: block; margin: 0 0 7px; font-size: 11.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.lbl .opt { letter-spacing: .07em; }
.fld { margin-bottom: 16px; }
.help { margin-top: 4px; }
.help b { font-weight: 600; color: var(--text); }
.err { margin-top: 4px; color: var(--bad); font-size: 13px; font-weight: 600; }
.grp { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); overflow: hidden; }
.frow { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-height: 50px; padding: 6px 12px; }
.frow + .frow, .item-head + .frow { border-top: 1px solid var(--line); }
.frow .k { width: 108px; flex: none; color: var(--muted); font-size: 13px; line-height: 1.25; hyphens: auto; overflow-wrap: break-word; }
.frow .v { flex: 1 1 160px; min-width: 0; }
.frow .v:has(input[type=datetime-local]) { flex-basis: 200px; }
.frow:not(:has(input, select, textarea)) { align-items: center; }
.frow.stack { display: block; padding: 10px 12px; }
.frow.stack .k { display: block; width: auto; margin-bottom: 4px; }
.frow:focus-within { box-shadow: inset 3px 0 0 var(--accent); }
.frow.bad { box-shadow: inset 3px 0 0 var(--bad); }
.frow input, .frow select { display: block; width: 100%; min-height: 38px; padding: 4px 0; border: 0; border-radius: 0; background-color: transparent; outline: none; }
.frow.stack input { min-height: 34px; }
.frow input[type=date], .frow input[type=datetime-local] { -webkit-appearance: none; appearance: none; text-align: left; }
.frow input::-webkit-date-and-time-value { text-align: left; }
select { -webkit-appearance: none; appearance: none; padding-right: 22px !important; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23909cab' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E") no-repeat right center / 16px; text-overflow: ellipsis; }
.frow .hint { font-size: 12.5px; }
.frow .hint:empty { display: none; }
.in { display: block; width: 100%; min-height: 48px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); line-height: 1.45; }
textarea.in { resize: vertical; field-sizing: content; min-height: 120px; }
textarea.in.line { resize: none; min-height: 48px; }
.frow textarea.in { min-height: 34px; padding: 4px 0; border: 0; border-radius: 0; background: transparent; outline: none; }
.in:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.fld.bad .in { border-color: var(--bad); }

.pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pick label { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 54px; padding: 0 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); font-weight: 600; cursor: pointer; }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick .i { display: none; }
.pick label:has(input:checked) { border-color: var(--accent); background: var(--asoft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.pick label:has(input:checked) .i { display: block; }
.pick label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.fld.bad .pick label { border-color: var(--bad); }

.calc { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--panel2); }
.calc > .i { margin-top: 3px; }
.calc .ck { display: block; font-size: 13px; color: var(--muted); }
.calc input, .calc select { display: block; width: 100%; min-height: 36px; padding: 2px 0; border: 0; background-color: transparent; font-weight: 600; outline: none; }
.calc:focus-within { box-shadow: inset 0 0 0 1.5px var(--accent); }
.fld.bad .calc { box-shadow: inset 0 0 0 1.5px var(--bad); }

.add { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 54px; padding: 8px 12px; border: 1.5px dashed var(--line); border-radius: 12px; background: none; color: var(--muted); font-size: 14px; text-align: center; cursor: pointer; }
.add:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.add[data-busy-on] { opacity: .7; cursor: progress; }
.add input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.media .add { position: relative; margin-top: 8px; }
.media .help + .add, .media .lbl + .add { margin-top: 0; }
.add .busy, .busy-note { display: none; }
.fld.htmx-request .add .idle, .fld.preparing .add .idle { display: none; }
.fld.htmx-request .add .busy, .fld.preparing .add .busy { display: inline; }
.fld.htmx-request .add, .fld.preparing .add { cursor: progress; }
.sform[data-busy=maps] .busy-note { display: block; color: var(--warn); font-weight: 600; }
.sform[data-busy=maps] #fld-maps .help:not(.busy-note) { display: none; }
.add .spin, .add[data-busy-on] > .i { display: none; }
.add[data-busy-on] .spin { display: block; }
.sform[data-busy] .pf .btn { opacity: .6; }

/* images fields */
.thumbs { display: grid; gap: 8px; }
.thumbs:empty { display: none; }
.thumb { display: flex; gap: 12px; align-items: flex-start; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.thumb img { display: block; width: 76px; height: 76px; border-radius: 8px; object-fit: cover; background: var(--panel2); }
.thumb .tv { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.thumb textarea.in { min-height: 44px; padding: 10px; font-size: 16px; }
.maps { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.maps figure { margin: 0; min-width: 0; }
.maps img { display: block; width: 100%; aspect-ratio: 2 / 1; object-fit: cover; border-radius: 8px; background: #fff; }
.maps figcaption { margin-top: 4px; color: var(--muted); font-size: 12.5px; }

/* images of a channel */
.strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x proximity; }
.shot { flex: none; scroll-snap-align: start; text-decoration: none; }
.shot img { display: block; height: 170px; width: auto; max-width: 260px; border-radius: 8px; background: var(--panel2); box-shadow: 0 0 0 1px var(--line); }
.shot small { margin-top: 3px; font-size: 11.5px; }
.wait { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 13.5px; }
.spin { width: 16px; height: 16px; flex: none; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.editor.has-media { display: flex; flex-direction: column; }
.editor .shots { order: -1; margin-bottom: 14px; }
.list .help { margin: -2px 0 8px; }
.item { margin-bottom: 8px; }
.item-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 6px 2px 12px; background: var(--panel2); }
.item-head b { font-size: 13px; color: var(--muted); }

.alert { margin-bottom: 14px; padding: 10px 12px; border-radius: 12px; background: var(--panel2); font-size: 14px; overflow-wrap: anywhere; }
.alert p + p { margin-top: 6px; }
.alert.ok { background: var(--asoft); }
.alert.wn { background: var(--wsoft); }
.alert.bad { background: var(--bsoft); color: var(--bad); font-weight: 600; }
.alert a { color: var(--accent); font-weight: 600; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: var(--panel2); }
.seg label { position: relative; display: flex; align-items: center; justify-content: center; min-height: 40px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--panel); color: var(--text); box-shadow: 0 0 0 1px var(--line); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

.txt { display: block; width: 100%; min-height: 260px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); font-size: 16px; line-height: 1.5; resize: vertical; field-sizing: content; overflow-wrap: anywhere; }
.txt:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.txt.ro { min-height: 0; margin-bottom: 10px; background: var(--bg); font-size: 14px; white-space: pre-wrap; }
.editor.has-media .txt { min-height: 120px; }
.ed:has(.count.over) .txt { border-color: var(--bad); }
.lbl-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.count { margin-bottom: 7px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.count.over { color: var(--bad); font-weight: 700; }
.meta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0 12px; margin-top: 4px; font-size: 13px; color: var(--muted); }
.meta .state { display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px; }
.meta .edited { display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px; width: 100%; }
.meta .dirty, .meta .failed { display: none; }
[data-state=dirty] + .meta .saved, [data-state=error] + .meta .saved { display: none; }
[data-state=dirty] + .meta .dirty { display: inline; }
[data-state=error] + .meta .failed { display: inline; color: var(--bad); font-weight: 600; }

.preview { padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.preview h1, .preview h2, .preview h3 { font: 500 21px/1.25 var(--serif); margin: 4px 0 10px; }
.preview h2, .preview h3 { font-size: 17px; margin-top: 14px; }
.preview p, .preview ul, .preview ol { margin: 0 0 10px; }
.preview img { max-width: 100%; height: auto; }
.preview figure { margin: 0 0 12px; }
.preview figure p { margin: 0; }
.preview figcaption { margin-top: 4px; color: var(--muted); font-size: 13px; }
.preview a { color: var(--accent); }
/* The preview is a document of its own (preview.html) in an iframe as tall as that document (admin.js). Its body is the
   box; wide content scrolls inside the box, the frame never scrolls. */
.preview-doc { overflow: hidden; background: none; }
.preview-doc body { min-height: 0; overflow-x: auto; }
.pv { position: relative; }
.preview-frame { display: block; width: 100%; height: 0; border: 0; }
.preview-frame.next { position: absolute; top: 0; left: 0; visibility: hidden; }

/* toast */
.toasts { position: fixed; left: 0; right: 0; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 20; display: grid; justify-items: center; padding: 0 16px; pointer-events: none; }
.toast { max-width: 440px; padding: 11px 14px; border-radius: 12px; background: var(--text); color: var(--bg); font-size: 14px; font-weight: 600; box-shadow: 0 8px 28px rgba(0, 0, 0, .35); animation: toast 5s forwards; }
@keyframes toast { 0% { opacity: 0; transform: translateY(8px); } 5% { opacity: 1; transform: none; } 85% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }

/* headers */
.top { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: env(safe-area-inset-top) var(--padr) 0 var(--padl); border-bottom: 1px solid var(--line); }
.top .crumb { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: none; margin-left: 10px; }
.top .crumb:hover { color: var(--text); }
.top .ttl { font-size: 18px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.top .who { margin-left: auto; }
.nav { display: flex; align-items: center; gap: 4px; min-height: 56px; padding: env(safe-area-inset-top) max(6px, env(safe-area-inset-right)) 0 max(6px, env(safe-area-inset-left)); }
.nav .t { flex: 1; min-width: 0; text-align: center; font-size: inherit; font-weight: 400; line-height: 1.25; }
.nav .t b { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-weight: 600; overflow-wrap: anywhere; }
.nav .t small { font-size: 12px; }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 10px; color: var(--text); }
.h1 { margin: 4px 0 16px; font-size: 24px; line-height: 1.2; font-weight: 500; }

/* start page */
.home-main { max-width: 760px; margin: 0 auto; padding: 18px var(--padr) calc(32px + env(safe-area-inset-bottom)) var(--padl); }
.new { margin-bottom: 26px; }
.types { display: grid; gap: 8px; }
.type { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 0 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); font-weight: 600; text-decoration: none; }
.type .i { color: var(--accent); }
.type small { margin-top: 1px; }
@media (min-width: 600px) { .types { grid-template-columns: repeat(3, 1fr); } }
.posts { list-style: none; padding: 0; display: grid; gap: 10px; }
.post { display: block; padding: 12px 14px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); text-decoration: none; }
.post:hover { border-color: var(--faint); }
.post-head { display: flex; align-items: center; gap: 8px; }
.post-head b { flex: 1; min-width: 0; font-size: 18px; font-weight: 500; line-height: 1.25; overflow-wrap: anywhere; }
.chips-status { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.empty { padding: 18px 0; }

/* login, passkey setup, account */
.authoff { margin: 0; padding: max(8px, env(safe-area-inset-top)) var(--padr) 8px var(--padl); border-radius: 0; font-size: 13.5px; }
.home-main.narrow { max-width: 480px; }
.lead { margin-bottom: 18px; }
.narrow > .btn.lg + .help { margin-top: 14px; }
.narrow .help + .lbl, .narrow .grp + .lbl { margin-top: 22px; }
.narrow .lbl + .help { margin: -3px 0 10px; }
.logout { margin-top: 30px; padding-top: 16px; border-top: 1px solid var(--line); }
.narrow .btn:disabled { opacity: .5; cursor: default; }

/* wizard, phone: one step per screen, the action bar sticks to the bottom */
.wiz { display: flex; flex-direction: column; }
.steps { display: flex; align-items: center; gap: 6px; padding: 0 var(--padr) 8px var(--padl); font-size: 13px; font-weight: 600; color: var(--muted); }
.steps a, .steps span { display: flex; align-items: center; min-height: 44px; text-decoration: none; white-space: nowrap; }
.steps b { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 6px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px currentColor; font-size: 12px; }
.steps .on { color: var(--text); }
.steps .on b { background: var(--accent); color: var(--ink); box-shadow: none; }
.steps .done { color: var(--accent); }
.steps i { flex: 1; min-width: 6px; height: 1px; background: var(--line); }
.wiz > .top { display: none; }
.a3 { flex: 1; display: flex; flex-direction: column; }
.step { display: none; }
.step.on { flex: 1; display: flex; flex-direction: column; }
.sh { display: none; }
.sform { flex: 1; display: flex; flex-direction: column; }
.pb { flex: 1; padding: 6px var(--padr) 22px var(--padl); }
.pf { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 12px var(--padr) max(14px, env(safe-area-inset-bottom)) var(--padl); border-top: 1px solid var(--line); background: var(--panel); }
.pf.col { flex-direction: column; align-items: stretch; gap: 6px; }
.foot-note { text-align: center; }

/* step 2 */
.chan-nav { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; }
.chan-nav .ch { position: relative; width: 44px; height: 44px; border-radius: 11px; text-decoration: none; }
.chan-nav .ch .cl { display: none; }
.chan-nav .ch .mark { position: absolute; right: -3px; top: -3px; width: 16px; height: 16px; padding: 2px; border-radius: 50%; background: var(--accent); color: var(--ink); stroke-width: 3; }
.chan-nav .st-reviewed, .chan-nav .st-sent { background: var(--asoft); color: var(--accent); }
.chan-nav .st-off { background: none; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }
.chan-nav .st-off .mark { background: var(--muted); color: var(--bg); }
.chan-nav .cur { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--text); color: var(--text); }
.chan-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.chan-head h2 { font-size: 22px; font-weight: 500; line-height: 1.2; }
/* A channel left out: its note with the way back (_chan_off.html) takes the place of the text, which is kept. */
.pb:has(#chan-off .off) :is(.pv-toggle, .editor, .skip, #chan-over, #web-images) { display: none; }
.alert.off { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.alert.off .btn { margin: 0; }
.skip { margin-top: 6px; }
.pv-toggle { margin-bottom: 12px; }
/* Hidden, the preview keeps its width, so its frame has the right height before it is shown (admin.js). */
.editor .pv { height: 0; overflow: hidden; visibility: hidden; }
.step:has(.pv-toggle input[value=preview]:checked) .editor .ed { display: none; }
.step:has(.pv-toggle input[value=preview]:checked) .editor .pv { height: auto; overflow: visible; visibility: visible; }

/* step 3 */
.send-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.send-head .serif { flex: 1; font-size: 22px; font-weight: 500; line-height: 1.2; }
.prog { height: 5px; margin-bottom: 18px; border-radius: 9px; background: var(--panel2); overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--accent); }
.srow { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 8px 12px; text-decoration: none; }
.srow + .srow { border-top: 1px solid var(--line); }
.srow b { font-weight: 600; }
.srow.st-off { color: var(--muted); }
a.srow:hover { background: var(--panel2); }
.srow + .link-warn { margin: 0 12px 12px; }
.card { padding: 0 12px; }
.card[open] { padding-bottom: 8px; }
.card-head { display: flex; align-items: center; gap: 10px; min-height: 54px; list-style: none; cursor: pointer; }
.card-head::-webkit-details-marker { display: none; }
.card-head .chev { transition: transform .15s; }
.card[open] .card-head { margin-bottom: 2px; }
.card[open] .card-head .chev { transform: rotate(90deg); }
.card .txt.ro { max-height: 280px; overflow-y: auto; resize: none; }
.link-warn { margin-bottom: 10px; font-size: 13.5px; }
.send-media { margin-bottom: 10px; }
.send-media .shot img { height: 120px; }
/* Step 3: each image with its description under it, as wide as the image but at least as wide as the copy button. */
.tile { flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; width: min-content; min-width: 200px; scroll-snap-align: start; }
.alt { font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.alt summary { list-style: none; cursor: pointer; }
.alt summary::-webkit-details-marker { display: none; }
.alt:not([open]) p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.alt.none { color: var(--warn); }
.acts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.posted { border-top: 1px solid var(--line); padding-top: 10px; }
.posted .in { min-height: 44px; padding: 8px 12px; }
.tickrow { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0; border: 0; background: none; font-size: 14.5px; text-align: left; cursor: pointer; }
.tick { width: 22px; height: 22px; flex: none; border-radius: 6px; box-shadow: inset 0 0 0 1.5px var(--faint); }
.alert.mode b { display: block; margin-bottom: 2px; }
.alert .btn { margin-top: 8px; }
.danger-zone { margin-top: 22px; padding-top: 6px; border-top: 1px solid var(--line); text-align: center; }

/* touch: form controls inside rows reach 44 px */
@media (pointer: coarse) {
  .frow input, .frow select, .frow textarea.in, .calc input, .calc select, .seg label { min-height: 44px; }
}

/* The action bar stays at the end of the step and stops sticking where it would cover the work: on a touch device while
   a field that brings up the keyboard has the focus (iOS Safari floats a sticky bar over the text being typed), and in a
   low window (a phone held sideways). */
@media (pointer: coarse) {
  body:has(:is(textarea, input:not([type=date], [type=datetime-local], [type=radio], [type=checkbox], [type=file])):focus) .pf { position: static; }
}
@media (max-height: 500px) {
  .pf { position: static; }
}

/* desktop: the three steps side by side */
@media (min-width: 1000px) {
  .wiz { height: 100dvh; min-height: 0; overflow: hidden; }
  .wiz > .top { display: flex; flex: none; }
  .nav, .steps { display: none; }
  .a3 { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(330px, 26%) minmax(0, 1fr) minmax(300px, 25%); }
  .at-fields .a3 { grid-template-columns: minmax(420px, 36%) minmax(0, 1fr) minmax(300px, 25%); }
  .step, .step.on { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow-y: auto; border-left: 1px solid var(--line); }
  .step:first-child { border-left: 0; }
  .sh { position: sticky; top: 0; z-index: 4; display: flex; align-items: center; gap: 10px; padding: 16px 18px 12px; background: var(--bg); }
  .sh b { display: grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--faint); color: var(--muted); font-size: 13px; }
  .sh span { font: 500 19px/1 var(--serif); }
  .sh small { margin-left: auto; text-align: right; }
  .sh.on b { background: var(--accent); color: var(--ink); box-shadow: none; }
  .sh.done b { color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
  .step:not(.on) .sh span { color: var(--muted); }
  .step.todo > :not(.sh) { opacity: .6; }
  .pb { padding: 0 18px 18px; }
  .pf { padding: 12px 18px 16px; background: var(--bg); }
  .step:not(.on) .pf .btn:not(.off) { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
  .wiz .h1 { display: none; }
  .chan-nav { gap: 2px; margin: 0 -18px 16px; padding: 0 12px; border-bottom: 1px solid var(--line); }
  .chan-nav .ch { width: auto; height: 42px; gap: 7px; padding: 0 12px; display: flex; align-items: center; margin-bottom: -1px; border-radius: 0; background: none !important; box-shadow: none !important; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; font-size: 13.5px; }
  .chan-nav .ch .cl { display: inline; }
  .chan-nav .ch .mark { position: static; width: 14px; height: 14px; padding: 0; background: none; color: var(--accent); stroke-width: 2; }
  .chan-nav .st-off .mark { color: var(--muted); }
  .chan-nav .cur { color: var(--text); border-color: var(--accent); }
  .chan-nav .st-off .cl { text-decoration: line-through; }
  .step { container-type: inline-size; }
  @container (max-width: 620px) { .chan-nav .ch .cl { display: none; } }
  .pv-toggle { display: none; }
  .editor.has-preview { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
  .editor .pv, .step:has(.pv-toggle input[value=preview]:checked) .editor .pv { height: auto; overflow: visible; visibility: visible; }
  .editor.has-media { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 16px; align-items: start; }
  .editor .shots { order: 0; margin: 0; }
  .shots .strip { flex-direction: column; overflow: visible; }
  .shots .shot img { width: 100%; height: auto; max-width: none; }
  @container (max-width: 560px) { .editor.has-media { grid-template-columns: minmax(0, 1fr); } .editor .shots { order: -1; } .shots .strip { flex-direction: row; overflow-x: auto; } .shots .shot img { width: auto; height: 150px; } }
  .step:has(.pv-toggle input[value=preview]:checked) .editor .ed { display: block; }
  .txt, .editor.has-media .txt { min-height: 52vh; }
  .toasts { bottom: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  .spin { animation-duration: 2.4s; }
  .card-head .chev { transition: none; }
  /* No fade or slide: the toast stays still and disappears after the same five seconds. */
  .toast { animation: toast-still 5s step-end forwards; }
  @keyframes toast-still { to { visibility: hidden; } }
}
