:root {
    --bg: #f5f3ef;
    --card: #fff;
    --text: #2b2a28;
    --muted: #76716a;
    --line: #e2ddd5;
    --accent: #7a2e2e;
    --accent-2: #9b3c3c;
    --ok: #2f7a3f;
    --ok-bg: #e6f3e8;
    --warn-bg: #fff4dc;
    --err: #a42424;
    --err-bg: #fbe7e7;
    --radius: 8px;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    color: var(--text);
    background: var(--bg);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); }
a { color: var(--accent); }
code { font-family: ui-monospace, Consolas, monospace; font-size: .9em; }
h1 { font-size: 1.5rem; margin: 0 0 .6em; }
h2 { font-size: 1.2rem; margin: 0 0 .6em; }
h3 { font-size: 1rem; margin: 1.4em 0 .4em; }
h1 small, h2 small { font-weight: normal; font-size: .75em; }
.muted { color: var(--muted); }
.small { font-size: .85em; }
.nowrap { white-space: nowrap; }
.spacer { flex: 1; }
.grow { flex: 1; min-width: 0; }
.hint { color: var(--muted); font-weight: normal; font-size: .85em; }
.inline { display: inline; margin: 0; }

/* ---------- top bar ---------- */
.topbar {
    display: flex; align-items: center; gap: 1.5rem;
    background: var(--accent); color: #fff; padding: 0 1rem; height: 48px;
}
.topbar .brand { display: flex; align-items: center; gap: .5rem; color: #fff; text-decoration: none; font-weight: 600; white-space: nowrap; }
.topbar .brand img { height: 30px; width: auto; filter: drop-shadow(0 0 1px #fff); }
.topbar .brand small { font-weight: normal; opacity: .8; }
.topbar nav { display: flex; align-items: center; gap: .3rem; flex: 1; min-width: 0; }
.topbar nav a, .topbar nav button.link {
    color: #fff; text-decoration: none; padding: .35rem .7rem; border-radius: 6px; opacity: .9; font-size: .95rem;
}
.topbar nav a:hover, .topbar nav a.active, .topbar nav button.link:hover { background: rgba(255,255,255,.15); opacity: 1; }
.badge { display: inline-block; background: #fff; color: var(--accent); border-radius: 10px; padding: 0 .45em; font-size: .8em; font-weight: 700; margin-left: .2em; }

/* ---------- layout ---------- */
.page { max-width: 1100px; margin: 1.2rem auto; padding: 0 1rem; }
.page.narrow { max-width: 640px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.4rem; margin-bottom: 1.2rem; }
.toolbar { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; flex-wrap: wrap; }
.toolbar h1 { margin: 0; }
.row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: .9rem; }
.empty { padding: 1rem 0; color: var(--muted); }

/* ---------- forms ---------- */
label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .92rem; }
label.checkbox { flex-direction: row; align-items: center; gap: .5rem; font-weight: normal; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
    font: inherit; padding: .5rem .6rem; border: 1px solid #cfc8bd; border-radius: 6px; background: #fff; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(122,46,46,.25); border-color: var(--accent); }
input:invalid:not(:placeholder-shown) { border-color: var(--err); }
textarea { font-family: ui-monospace, Consolas, monospace; font-size: .88rem; }
#filter { max-width: 340px; }

button, .button {
    font: inherit; display: inline-block; padding: .5rem 1rem; border-radius: 6px; border: 1px solid #cfc8bd;
    background: #fff; color: var(--text); cursor: pointer; text-decoration: none; line-height: 1.2;
}
button:hover, .button:hover { background: #f3efe9; }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover, .button.primary:hover { background: var(--accent-2); }
button.danger { color: var(--err); border-color: #e3b5b5; }
button.danger:hover { background: var(--err-bg); }
button.link { background: none; border: none; padding: 0; color: var(--accent); text-decoration: underline; }
button.link.danger { color: var(--err); }
.small-button { padding: .3rem .65rem; font-size: .88rem; }

/* ---------- messages ---------- */
.flash { padding: .7rem 1rem; border-radius: 6px; margin-bottom: 1rem; white-space: pre-line; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.error { background: var(--err-bg); color: var(--err); }
.flash.warn { background: var(--warn-bg); color: #6d5100; }

/* ---------- tables ---------- */
table { border-collapse: collapse; width: 100%; }
th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); padding: .4rem .6rem; }
td { border-bottom: 1px solid #f0ece6; padding: .5rem .6rem; vertical-align: top; }
tr:hover td { background: #faf8f5; }
tr.disabled td { opacity: .55; }
td.actions { text-align: right; white-space: nowrap; }
td.actions a { margin-left: .8rem; }
.content-list td a { font-weight: 500; }
.tree { color: #bbb; margin-right: .3em; }
.tag { display: inline-block; font-size: .75rem; padding: .1em .5em; border-radius: 4px; font-weight: 600; white-space: nowrap; }
.tag.hidden { background: #ece9e4; color: #6c665e; }
.tag.changed { background: #fff0cc; color: #7a5600; }
.tag.page-post { background: #e8eef7; color: #2d4a73; }
.commits td { font-size: .9rem; padding: .35rem .6rem; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.2rem; margin: 0 0 1.2rem; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }
pre.log { background: #1f1e1c; color: #e8e4dc; padding: 1rem; border-radius: 6px; max-height: 60vh; overflow: auto; font-size: .8rem; white-space: pre-wrap; word-break: break-word; }

/* ---------- publish ---------- */
.changes { display: flex; flex-direction: column; gap: .5rem; }
.change { border: 1px solid var(--line); border-radius: 6px; padding: .6rem .8rem; }
.change-head { display: flex; align-items: center; gap: 1rem; }
.change-head label { flex-wrap: wrap; }
.change details summary { cursor: pointer; color: var(--muted); font-size: .88rem; margin-top: .3rem; }
pre.diff { background: #fbfaf8; border: 1px solid var(--line); border-radius: 6px; padding: .6rem; overflow: auto; max-height: 50vh; font-size: .8rem; white-space: pre-wrap; word-break: break-word; }
pre.diff .add { background: #e6f6e9; color: #1d5e2a; display: block; }
pre.diff .del { background: #fbe9e9; color: #8b1f1f; display: block; }
pre.diff .hunk { color: #6b5ca5; display: block; }
pre.diff .meta { color: var(--muted); display: block; }
.danger-zone { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px dashed var(--line); display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }

/* ---------- login ---------- */
.login-page { display: grid; place-items: center; min-height: 100vh; }
.login-box { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 2rem 2.2rem; width: min(380px, 92vw); text-align: center; }
.login-box img { height: 70px; width: auto; }
.login-box h1 { margin: .4rem 0 0; }
.login-box form { text-align: left; margin-top: 1.2rem; }

/* ---------- editor ---------- */
.editor-page { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.editor-layout { flex: 1; display: grid; grid-template-columns: minmax(380px, 1fr) minmax(380px, 1fr); min-height: 0; }
.editor-pane { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; padding: .8rem 1rem; background: var(--bg); border-right: 1px solid var(--line); }
.editor-head { display: flex; align-items: center; gap: .8rem; margin-bottom: .6rem; }
.editor-head .back { font-size: 1.4rem; text-decoration: none; line-height: 1; }
.save-status { font-size: .9rem; font-weight: 600; margin-top: .1rem; }
.save-status.ok { color: var(--ok); }
.save-status.pending { color: var(--muted); }
.save-status.error { color: var(--err); white-space: pre-line; }
.props { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .9rem .5rem; margin-bottom: .8rem; }
.props .title-field input { font-size: 1.05rem; font-weight: 600; }
details.props-more { margin-top: .5rem; }
details.props-more > summary { cursor: pointer; font-weight: 600; padding: .2rem 0; }
.props-summary { font-weight: normal; color: var(--muted); font-size: .85rem; margin-left: .4rem; }
details.props-more[open] .props-summary { display: none; }
.props-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem 1rem; padding: .6rem 0 .3rem; }
.props-grid .span2 { grid-column: span 2; }
details.advanced summary { cursor: pointer; font-size: .88rem; color: var(--muted); }
details.advanced textarea { margin-top: .4rem; }
.markdown-wrap { flex: 1; display: flex; flex-direction: column; min-height: 320px; }
.markdown-wrap .EasyMDEContainer { flex: 1; display: flex; flex-direction: column; }
.markdown-wrap .EasyMDEContainer .CodeMirror { flex: 1; min-height: 300px; font-size: 15px; line-height: 1.55; border-radius: 0 0 var(--radius) var(--radius); }
.EasyMDEContainer .editor-toolbar { background: #fff; border-radius: var(--radius) var(--radius) 0 0; }
.fa-small { font-size: .75em; }
.editor-foot { display: flex; align-items: center; gap: 1rem; padding-top: .6rem; }

.preview-pane { display: flex; flex-direction: column; min-height: 0; background: #e9e6e0; }
.preview-head { display: flex; align-items: center; gap: .5rem; padding: .45rem .8rem; background: #fff; border-bottom: 1px solid var(--line); }
.build-status { font-size: .85rem; font-weight: 600; padding: .15rem .55rem; border-radius: 4px; cursor: default; }
.build-status.ready { color: var(--ok); background: var(--ok-bg); }
.build-status.building, .build-status.starting, .build-status.installing { color: #6d5100; background: var(--warn-bg); }
.build-status.error { color: var(--err); background: var(--err-bg); cursor: pointer; }
.build-log { margin: 0; max-height: 35vh; overflow: auto; background: #2a1414; color: #ffd9d9; font-size: .75rem; padding: .6rem .8rem; white-space: pre-wrap; }
.preview-frame-wrap { flex: 1; display: flex; justify-content: center; min-height: 0; }
.preview-frame-wrap iframe { width: 100%; height: 100%; border: 0; background: #fff; transition: width .2s; box-shadow: 0 0 0 1px var(--line); }
.seg { display: inline-flex; border: 1px solid #cfc8bd; border-radius: 6px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; padding: .25rem .6rem; }
.seg button.active { background: #ece6dd; }

@media (max-width: 900px) {
    .topbar { gap: .6rem; height: auto; min-height: 48px; flex-wrap: wrap; padding: .3rem .8rem; }
    .topbar .brand small { display: none; }
    .topbar nav { flex-wrap: wrap; }
    .editor-page { height: auto; overflow: visible; }
    .editor-layout { grid-template-columns: 1fr; }
    .preview-pane { height: 80vh; }
    .props-grid { grid-template-columns: 1fr; }
    .props-grid .span2 { grid-column: auto; }
    td.actions a { margin-left: .4rem; }
    table.commits { display: block; overflow-x: auto; }
    .change-head { flex-wrap: wrap; }
    .change-head code { word-break: break-all; }
}

/* ---------- files (assets) ---------- */
.upload-zone { display: flex; align-items: center; gap: 1rem; border: 2px dashed #cfc8bd; border-radius: var(--radius); padding: 1rem 1.2rem; background: #fbfaf8; flex-wrap: wrap; }
.upload-zone.drag { border-color: var(--accent); background: #f7eeee; }
.upload-zone input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-zone .drop-label { flex: 1; display: flex; flex-direction: column; gap: .2rem; font-weight: normal; cursor: pointer; }
.upload-zone .drop-label strong { color: var(--accent); }
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .8rem; }
.asset-tile { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.asset-tile .thumb { display: flex; align-items: center; justify-content: center; height: 120px; background: #f1eee9; }
.asset-tile .thumb img { max-width: 100%; max-height: 120px; object-fit: contain; }
.asset-meta { padding: .45rem .6rem; display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.asset-name { font-size: .85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-meta button.copy { align-self: flex-start; font-size: .8rem; }
.file-icon { font-weight: 700; font-size: 1.1rem; color: #fff; background: var(--accent); padding: .5rem .7rem; border-radius: 4px; }
.asset-change { display: flex; align-items: center; gap: .8rem; margin-top: .4rem; }
.asset-change img { height: 48px; width: auto; border-radius: 4px; border: 1px solid var(--line); }

/* ---------- image/link dialogs ---------- */
dialog.picker { width: min(900px, 96vw); max-height: 92vh; padding: 0; border: 0; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog.picker::backdrop { background: rgba(30, 25, 20, .45); }
.picker-form { display: flex; flex-direction: column; max-height: 92vh; }
.picker-head { display: flex; align-items: center; justify-content: space-between; padding: .9rem 1.2rem .4rem; }
.picker-head h2 { margin: 0; }
.picker-head .close { font-size: 1.2rem; text-decoration: none; color: var(--muted); }
.tabs { display: flex; gap: .2rem; padding: 0 1.2rem; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: none; padding: .5rem .9rem; color: var(--muted); }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tab-panel { padding: .8rem 1.2rem; display: flex; flex-direction: column; gap: .7rem; overflow: auto; min-height: 0; flex: 1; }
.picker-status:empty { display: none; }
.upload-button { position: relative; white-space: nowrap; font-weight: normal; flex-direction: row; }
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .6rem; max-height: 38vh; overflow: auto; padding: 2px; }
.image-tile { display: flex; flex-direction: column; gap: .2rem; padding: .35rem; text-align: left; border: 2px solid var(--line); border-radius: 6px; background: #fff; }
.image-tile img { width: 100%; height: 90px; object-fit: contain; background: #f1eee9; border-radius: 3px; }
.image-tile.selected { border-color: var(--accent); background: #f7eeee; }
.image-name { font-size: .78rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-list { display: flex; flex-direction: column; max-height: 40vh; overflow: auto; border: 1px solid var(--line); border-radius: 6px; }
.link-group { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: .5rem .7rem .2rem; background: #faf8f5; position: sticky; top: 0; }
.link-row { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; text-align: left; border: 0; border-radius: 0; border-bottom: 1px solid #f0ece6; padding: .45rem .7rem; background: #fff; }
.link-row:hover { background: #faf6f1; }
.link-row.selected { background: #f7eeee; box-shadow: inset 3px 0 0 var(--accent); }
.link-title { font-weight: 500; }
.picker-common { padding: .6rem 1.2rem; border-top: 1px solid var(--line); background: #fbfaf8; display: flex; flex-direction: column; gap: .6rem; }
.picker-selected { font-size: .88rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-preview { display: block; font-size: .8rem; color: #555; background: #f1eee9; padding: .35rem .5rem; border-radius: 4px; word-break: break-all; }
.picker-preview:empty { display: none; }
.picker-foot { display: flex; justify-content: flex-end; gap: .6rem; padding: .7rem 1.2rem; border-top: 1px solid var(--line); }

/* ---------- work in progress overlay ---------- */
.busy-overlay { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; background: rgba(30, 25, 20, .45); backdrop-filter: blur(2px); animation: busy-in .15s ease-out; }
.busy-box { background: #fff; border-radius: 12px; padding: 1.8rem 2.2rem; width: min(420px, 90vw); text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.busy-title { font-size: 1.15rem; font-weight: 600; margin-top: 1rem; }
.busy-detail { color: var(--muted); margin-top: .4rem; font-size: .92rem; }
.busy-detail:empty, .busy-elapsed:empty { display: none; }
.busy-elapsed { color: var(--muted); margin-top: .8rem; font-size: .85rem; font-variant-numeric: tabular-nums; }
.spinner { width: 44px; height: 44px; margin: 0 auto; border-radius: 50%; border: 4px solid #eadfdf; border-top-color: var(--accent); animation: spin .8s linear infinite; }
body.busy { cursor: progress; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes busy-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } .busy-overlay { animation: none; } }

/* ---------- confirm / alert dialogs (dialogs.js) ---------- */
dialog.small-dialog { width: min(460px, 94vw); }
.small-dialog .dialog-body { padding: .4rem 1.2rem 1rem; }
.small-dialog .dialog-message { margin: 0; line-height: 1.5; white-space: pre-line; }
.small-dialog .dialog-text { font-family: ui-monospace, Consolas, monospace; font-size: .88rem; }
button.danger-fill, button.primary.danger-fill { background: var(--err); border-color: var(--err); color: #fff; }
button.danger-fill:hover { background: #8c1d1d; }

/* ---------- move dialog / editor actions ---------- */
.foot-actions { display: flex; gap: .4rem; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.delete-button:disabled { opacity: .45; cursor: not-allowed; }
dialog.move-dialog { width: min(560px, 94vw); }
.move-urls code { word-break: break-all; }
.move-info:empty { display: none; }
.move-info { font-size: .9rem; color: var(--ok); }
.move-info.error { color: var(--err); }
.move-links-list { margin: -.3rem 0 0 1.6rem; padding: 0; font-size: .88rem; color: var(--muted); max-height: 9rem; overflow: auto; }

/* ---------- error page ---------- */
.error-box .error-code { font-size: 2.6rem; font-weight: 700; color: var(--accent); margin: .4rem 0 0; line-height: 1; }
.error-box h1 { margin: .4rem 0 .6rem; }
.error-box code { word-break: break-all; }
.error-actions { justify-content: center; margin-top: 1.2rem; }

/* ---------- site deploy status (publish page) ---------- */
.deploy-head { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.deploy-head h2 { margin: 0; }
.deploy-head .deploy-site { margin-left: auto; }
.deploy-state { font-size: .85rem; font-weight: 600; padding: .15rem .6rem; border-radius: 4px; background: #ece9e4; color: #6c665e; white-space: nowrap; }
.deploy-state[data-state="success"] { color: var(--ok); background: var(--ok-bg); }
.deploy-state[data-state="running"], .deploy-state[data-state="queued"], .deploy-state[data-state="waiting"] { color: #6d5100; background: var(--warn-bg); }
.deploy-state[data-state="failure"], .deploy-state[data-state="error"] { color: var(--err); background: var(--err-bg); }
.deploy-state[data-state="running"]::before, .deploy-state[data-state="queued"]::before, .deploy-state[data-state="waiting"]::before {
    content: ""; display: inline-block; width: .7em; height: .7em; margin-right: .4em; vertical-align: -.05em;
    border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; animation: spin .9s linear infinite; }
.deploy-summary { margin: .6rem 0; }
.deploy-run h3 { margin: 1rem 0 .5rem; font-size: 1rem; }
.deploy-steps { list-style: none; padding: 0; margin: 0 0 .8rem; border: 1px solid var(--line); border-radius: 6px; }
.deploy-steps li { display: flex; align-items: center; gap: .6rem; padding: .35rem .7rem; font-size: .9rem; }
.deploy-steps li + li { border-top: 1px solid var(--line); }
.deploy-steps li::before { content: "○"; width: 1.1em; text-align: center; color: var(--muted); flex: none; }
.deploy-steps li[data-state="success"]::before { content: "✓"; color: var(--ok); font-weight: 700; }
.deploy-steps li[data-state="failure"]::before { content: "✕"; color: var(--err); font-weight: 700; }
.deploy-steps li[data-state="failure"] { background: var(--err-bg); }
.deploy-steps li[data-state="running"]::before { content: ""; width: .75em; height: .75em; margin: 0 .175em; border-radius: 50%;
    border: 2px solid #6d5100; border-top-color: transparent; animation: spin .9s linear infinite; }
.deploy-steps li[data-state="running"] { background: var(--warn-bg); font-weight: 600; }
.deploy-steps li[data-state="skipped"], .deploy-steps li[data-state="cancelled"] { color: var(--muted); }
.deploy-steps .step-label { margin-left: auto; color: var(--muted); font-size: .8rem; }
.deploy-foot { margin: .8rem 0 0; }
@media (prefers-reduced-motion: reduce) { .deploy-state::before, .deploy-steps li::before { animation-duration: 2.4s !important; } }

/* ---------- overview with preview ---------- */
.overview-page { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.overview-layout { flex: 1; display: grid; grid-template-columns: minmax(420px, 1.1fr) minmax(380px, 1fr); min-height: 0; }
.overview-list { min-height: 0; overflow-y: auto; padding: 1.2rem 1rem; border-right: 1px solid var(--line); }
.overview-list .card:last-child { margin-bottom: 0; }
.content-list tr.current td { background: #f7eeee; }
.overview-list .content-list td { overflow-wrap: anywhere; }
.overview-list td.actions { white-space: normal; text-align: right; }
.overview-list td.actions a { display: block; margin: 0 0 .25rem; white-space: nowrap; }
@media (max-width: 900px) {
    .overview-page { height: auto; overflow: visible; }
    .overview-layout { grid-template-columns: 1fr; }
    .overview-layout .preview-pane { display: none; }
    .overview-list { border-right: 0; }
}

/* ---------- help dialog (editor) ---------- */
dialog.help-dialog { width: min(1080px, 96vw); height: 92vh; }
.help-dialog .picker-form { height: 100%; }
.help-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 230px 1fr; border-top: 1px solid var(--line); }
.help-toc { overflow-y: auto; padding: .8rem .5rem; background: #faf8f5; border-right: 1px solid var(--line); font-size: .86rem; }
.help-toc a { display: block; padding: .25rem .55rem; border-radius: 4px; color: var(--text); text-decoration: none; }
.help-toc a.top { font-weight: 600; }
.help-toc a.sub { padding-left: 1.4rem; font-size: .8rem; color: var(--muted); }
.help-toc a:hover, .help-toc a.active { background: #f1e7e4; color: var(--accent); }
.help-body { overflow-y: auto; padding: 1rem 1.7rem 2.5rem; line-height: 1.55; }
.help-intro { background: #f7f3ee; border: 1px solid var(--line); border-radius: 8px; padding: .3rem 1.2rem .6rem; margin-bottom: 1.6rem; }
.help-intro h2 { margin-top: .7rem; }
.help-intro li { margin: .35rem 0; }
.help-body h1 { font-size: 1.45rem; margin: .4rem 0 .6rem; }
.help-guide h2 { margin-top: 1.8rem; padding-top: .3rem; border-top: 1px solid var(--line); }
.help-guide h3 { margin: 1.3rem 0 .4rem; font-size: 1.05rem; }
.help-body table { border-collapse: collapse; width: 100%; font-size: .87rem; margin: .6rem 0 1rem; display: block; overflow-x: auto; }
.help-body th, .help-body td { border: 1px solid var(--line); padding: .35rem .55rem; vertical-align: top; text-align: left; }
.help-body th { text-transform: none; letter-spacing: 0; font-size: inherit; color: var(--text); background: #faf8f5; }
.help-body code { background: #f1eee9; padding: .05em .3em; border-radius: 3px; font-size: .87em; }
.help-body pre { background: #f6f3ef; border: 1px solid var(--line); padding: .7rem .9rem; border-radius: 6px; overflow-x: auto; line-height: 1.45; }
.help-body pre code { background: none; padding: 0; }
.help-body blockquote { border-left: 3px solid var(--accent); margin: .8rem 0; padding: .2rem .9rem; background: #fbf7f4; }
.help-body kbd { font: .8em ui-monospace, Consolas, monospace; border: 1px solid #cfc8bd; border-bottom-width: 2px; border-radius: 3px; padding: 0 .3em; background: #fff; }
@media (max-width: 720px) {
    .help-layout { grid-template-columns: 1fr; }
    .help-toc { display: none; }
    .help-body { padding: .8rem 1rem 2rem; }
}

/* ---------- second factor (login, account) ---------- */
.passkey-login { display: flex; flex-direction: column; gap: .6rem; margin-top: .8rem; }
.passkey-login button { width: 100%; }
.or { display: flex; align-items: center; gap: .6rem; color: var(--muted); font-size: .85rem; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.cancel-login { margin-top: 1rem; text-align: center; }
.otp-input { font-size: 1.4rem; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; max-width: 12rem; }
.login-box .otp-input { max-width: none; }
.totp-qr { width: 200px; margin: .6rem 0; }
.totp-qr svg { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 6px; }
.totp-secret { font-size: 1rem; letter-spacing: .05em; word-break: break-all; }
ol.steps li { margin-bottom: 1rem; }
.totp-confirm { margin-top: .5rem; }
.tag.ok-tag { background: var(--ok-bg); color: var(--ok); }
.tag.second-factor { background: #e8eef7; color: #2d4a73; }
.passkey-add { margin-top: .6rem; }
.passkey-add input { flex: 1; min-width: 12rem; }
