/* Sift - "inbox zero" redesign. Phone first, dark only; tokens from
   _assets/design_handoff_sift_inbox_zero/README.md. */

:root {
    /* surfaces (warm near-black) */
    --bg-page: oklch(0.12 0.004 60);
    --bg: oklch(0.17 0.005 60);
    --surface: oklch(0.215 0.006 60);
    --surface-2: oklch(0.26 0.007 60);
    --surface-3: oklch(0.30 0.007 60);
    --border-soft: oklch(0.32 0.007 60);

    /* text */
    --text: oklch(0.97 0.004 80);
    --text-2: oklch(0.72 0.01 70);
    --text-3: oklch(0.58 0.01 70);
    --text-4: oklch(0.45 0.01 70);

    /* accent */
    --accent: oklch(0.78 0.15 45);
    --on-accent: oklch(0.20 0.03 45);
    --accent-tint: oklch(0.78 0.15 45 / .13);
    --accent-line: oklch(0.78 0.15 45 / .38);

    /* formats */
    --f-watch: oklch(0.80 0.12 10);
    --f-listen: oklch(0.80 0.12 165);
    --f-brief: oklch(0.80 0.12 245);
    --f-read: oklch(0.80 0.12 300);
    --f-download: oklch(0.80 0.12 95);

    /* status */
    --danger: oklch(0.72 0.15 25);
    --danger-bg: oklch(0.52 0.16 25);
    --positive-bg: oklch(0.42 0.10 245);
    --share-bg: oklch(0.40 0.08 165);
    --warn: oklch(0.82 0.13 80);
    --ok-dot: oklch(0.80 0.12 165);

    --mono: 'Geist Mono', ui-monospace, monospace;
    --gutter: 20px;
    color-scheme: dark;
}

.f-watch { --f: var(--f-watch); }
.f-listen { --f: var(--f-listen); }
.f-brief { --f: var(--f-brief); }
.f-read { --f: var(--f-read); }
.f-download { --f: var(--f-download); }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg-page); }
body {
    margin: 0;
    background: var(--bg-page);
    color: var(--text);
    font-family: 'Schibsted Grotesk', system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); font-feature-settings: "tnum"; }
.nowrap { white-space: nowrap; }
.muted { color: var(--text-2); }
.hint { color: var(--text-3); font-size: 12px; }

.app {
    max-width: 480px;
    min-height: 100dvh;
    margin: 0 auto;
    background: var(--bg);
    padding-bottom: 34px;
    display: flex;
    flex-direction: column;
    overflow-x: clip;   /* a flung Sort card must not widen the page */
}

.label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-3);
}
.pad { padding: 0 var(--gutter); }
.empty { color: var(--text-2); padding: 24px var(--gutter); }
.empty a { color: var(--accent); }

/* ---------- header bits ---------- */
.topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px var(--gutter) 12px;
}
.topbar .spacer { flex: 1; }
.wordmark { font-size: 28px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.wordmark::after {
    content: "";
    display: inline-block;
    width: 8px; height: 8px;
    margin-left: 2px;
    border-radius: 50%;
    background: var(--accent);
}
.screen-title { font-size: 24px; font-weight: 800; letter-spacing: -0.025em; }

.icon-btn {
    flex: none;
    width: 44px; height: 44px;
    border-radius: 50%;
    border: 0;
    background: var(--surface);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}
.icon-btn.plain { background: transparent; }
.icon-btn.danger { color: var(--danger); }

.worker-pill {
    height: 32px;
    padding: 0 12px;
    border-radius: 16px;
    background: var(--surface);
    color: var(--text-2);
    font-size: 12.5px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    min-width: 0;
    overflow: hidden;
}
.worker-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok-dot); flex: none; }
.worker-pill.is-warning .dot { background: var(--warn); }
.worker-pill.is-danger .dot { background: var(--danger); }
.worker-pill.is-danger { color: var(--danger); }

.notice {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: 12.5px;
    color: var(--text-2);
    padding: 0 var(--gutter);
}
.notice i { color: var(--text-3); margin-top: 2px; }
.notice.is-warning i { color: var(--warn); }
.notice.is-danger, .notice.is-danger i { color: var(--danger); }

/* ---------- buttons ---------- */
.btn {
    border: 0;
    border-radius: 18px;
    height: 60px;
    padding: 0 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font-size: 17px;
    font-weight: 700;
    background: var(--surface-2);
    color: var(--text);
    white-space: nowrap;
}
.btn-accent { background: var(--accent); color: var(--on-accent); }
.btn-pill { border-radius: 30px; }
.btn-sm { height: 44px; font-size: 15px; border-radius: 22px; padding: 0 16px; }
.btn-danger {
    width: 60px;
    padding: 0;
    background: transparent;
    border: 1.5px solid var(--surface-3);
    color: var(--danger);
    flex: none;
}
.btn-danger.round { border-radius: 50%; }
.btn:disabled { opacity: .5; }
.btn.is-armed { box-shadow: 0 0 0 4px var(--accent-line); }
.btn-2.is-armed { box-shadow: 0 0 0 3px oklch(1 0 0 / .25); }
.link-accent { color: var(--accent); font-weight: 600; background: none; border: 0; padding: 0; }

/* ---------- sort banner ---------- */
.sort-banner {
    margin: 4px var(--gutter) 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 18px;
    background: var(--accent-tint);
    border: 1px solid var(--accent-line);
}
.sort-banner .sq {
    width: 40px; height: 40px;
    border-radius: 11px;
    background: var(--accent);
    color: var(--on-accent);
    display: grid;
    place-items: center;
    flex: none;
}
.sort-banner b { display: block; font-size: 16px; font-weight: 700; }
.sort-banner small { font-size: 13px; color: var(--text-2); }
.sort-banner .fa-chevron-right { margin-left: auto; color: var(--accent); }

/* ---------- format tiles ---------- */
.h-section { font-size: 20px; font-weight: 700; padding: 22px var(--gutter) 12px; }
.tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 0 var(--gutter); }
.tile {
    height: 86px;
    border-radius: 14px;
    background: var(--surface);
    border: 1.5px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 13px;
    color: var(--text-2);
    position: relative;
    cursor: pointer;
    user-select: none;
}
.tile i { font-size: 20px; color: var(--f); margin-bottom: 3px; }
.tile .mono { font-size: 11.5px; color: var(--text-3); }
.tile.is-on, input:checked + .tile {
    background: color-mix(in oklch, var(--f) 14%, transparent);
    border-color: var(--f);
    color: var(--text);
    font-weight: 600;
}
.tile .check { display: none; position: absolute; top: 6px; right: 6px; font-size: 12px; margin: 0; color: var(--f); }
input:checked + .tile .check { display: block; }
input:focus-visible + .tile, input:focus-visible + .chip { outline: 2px solid var(--accent); outline-offset: 2px; }
.tiles.sm .tile { height: 74px; font-size: 12px; border-radius: 16px; }

/* ---------- chips ---------- */
.chips { display: flex; gap: 8px; padding: 14px var(--gutter) 0; }
.chips.scroll { overflow-x: auto; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; gap: 7px; padding: 0; }
.chip {
    flex: none;
    height: 36px;
    padding: 0 14px;
    border-radius: 18px;
    border: 1px solid var(--surface-3);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--text-2);
    white-space: nowrap;
    background: transparent;
    cursor: pointer;
    user-select: none;
}
.chip.is-on { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }
.chips.wrap .chip { height: 40px; border-radius: 20px; font-size: 15px; }
.chip .fa-check { display: none; }
input:checked + .chip { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
input:checked + .chip .fa-check { display: inline; }
.chip i.fmt { color: var(--f); }

/* ---------- queue ---------- */
.queue-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px var(--gutter) 10px;
    font-size: 14px;
    color: var(--text-2);
}
.queue-head b { color: var(--text); font-weight: 600; }
.list { list-style: none; margin: 0; padding: 0; }

.thumb {
    position: relative;
    flex: none;
    border-radius: 9px;
    overflow: hidden;
    background: repeating-linear-gradient(135deg, var(--surface) 0 8px, var(--surface-2) 8px 16px);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .dur {
    position: absolute;
    right: 5px; bottom: 5px;
    font-family: var(--mono);
    font-size: 11px;
    line-height: 1;
    padding: 3px 5px;
    border-radius: 5px;
    background: oklch(0 0 0 / .72);
    color: var(--text);
}

.row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 8px 10px var(--gutter);
    min-height: 83px;
}
.row .thumb { width: 112px; height: 63px; }
.row-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; }
.row-body { flex: 1; min-width: 0; }
.row-title {
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-wrap: pretty;
}
.row-meta { display: block; margin-top: 4px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.state-pending, .state-ok { color: var(--text-3); }
.state-warn { color: var(--warn); }
.state-danger { color: var(--danger); }
.grip {
    width: 36px; height: 44px;
    flex: none;
    display: grid;
    place-items: center;
    color: var(--text-4);
    cursor: grab;
    touch-action: manipulation;
}
.row.is-preparing .thumb, .row.is-preparing .row-title { opacity: .6; }
.sortable-ghost { opacity: .35; }
.sortable-chosen .swipe-face { box-shadow: 0 24px 48px oklch(0 0 0 / .45); }

/* ---------- swipe (swipe.js) ---------- */
.swipe { position: relative; overflow: hidden; }
.swipe-face { position: relative; background: var(--bg); touch-action: pan-y; transition: transform .2s ease-out; z-index: 1; }
.swipe.is-dragging .swipe-face { transition: none; }
.swipe.is-open .swipe-face, .swipe.is-dragging[data-dir] .swipe-face { box-shadow: -10px 0 20px oklch(0 0 0 / .3); }
.swipe-bg {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 var(--gutter);
    font-weight: 700;
    font-size: 14px;
    background: var(--positive-bg);
    visibility: hidden;
}
.swipe[data-dir="right"] .swipe-bg { visibility: visible; }
.swipe-acts { position: absolute; top: 0; right: 0; bottom: 0; display: flex; visibility: hidden; }
.swipe[data-dir="left"] .swipe-acts, .swipe.is-open .swipe-acts { visibility: visible; }
.swipe-acts form { display: flex; }
.act {
    width: 88px;
    border: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    background: var(--surface-2);
}
.act i { font-size: 17px; }
.act-done { background: var(--accent); color: var(--on-accent); }
.act-delete { background: var(--danger-bg); }
.act-share { background: var(--share-bg); }
.lib .act { width: 76px; }

/* ---------- sort ---------- */
.progress-block { flex: 1; min-width: 0; }
.progress-block .top { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); margin-bottom: 7px; }
.track { height: 5px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.track > span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

.sort-stack { position: relative; margin: 4px 14px 0; }
.sort-stack.has-more::before {
    content: "";
    position: absolute;
    inset: 10px 10px -10px;
    border-radius: 26px;
    background: var(--surface);
    opacity: .5;
}
.sort-card {
    position: relative;
    background: var(--surface);
    border-radius: 26px;
    padding: 12px 12px 16px;
    touch-action: pan-y;
    transform-origin: 50% 100%;
    transition: transform .2s ease-out;
}
.swipe.is-dragging .sort-card, .sort-card.is-dragging { transition: none; }
.sort-card .hero { aspect-ratio: 16 / 9; width: 100%; border-radius: 16px; }
.sort-card h1 {
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.2;
    text-wrap: pretty;
    margin: 14px 4px 6px;
    overflow-wrap: anywhere;
}
.meta-line { font-size: 13px; color: var(--text-2); padding: 0 4px; display: flex; flex-wrap: wrap; gap: 0 10px; }
.stale { color: var(--warn); }
.sort-section { padding: 18px 4px 0; }
.sort-section .label-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.ai-note { font-size: 12px; color: var(--accent); }
.stamp {
    position: absolute;
    top: 30px;
    z-index: 2;
    padding: 4px 12px;
    border: 3px solid var(--accent);
    border-radius: 10px;
    color: var(--accent);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: .06em;
    background: oklch(0.17 0.005 60 / .6);
    opacity: 0;
    pointer-events: none;
}
.stamp-keep { left: 26px; transform: rotate(-12deg); }
.stamp-delete { right: 26px; transform: rotate(12deg); border-color: var(--danger); color: var(--danger); }
.sort-card[data-dir="right"].is-armed .stamp-keep,
.sort-card[data-dir="left"].is-armed .stamp-delete { opacity: 1; }
.form-error { color: var(--danger); font-size: 13px; padding: 10px 4px 0; }
.sort-foot { padding: 16px var(--gutter) 0; }
.sort-foot .hint { text-align: center; margin-bottom: 12px; }
.sort-foot .btns { display: flex; gap: 12px; }
.sort-foot .btn-accent { flex: 1; font-size: 18px; }

/* ---------- player ---------- */
.player-head {
    display: grid;
    grid-template-columns: 1fr minmax(0, auto) 1fr;
    align-items: center;
    gap: 6px;
    padding: 6px 12px 10px;
}
.grab { width: 40px; height: 5px; border-radius: 3px; background: var(--surface-3); margin: 10px auto 0; }
.player-head .center { text-align: center; min-width: 0; }
.player-head .center b { display: block; font-size: 15px; font-weight: 700; }
.player-head .center b i { color: var(--f); margin-right: 4px; }
.player-head .center small { font-size: 12px; color: var(--text-2); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-head .right { display: flex; justify-self: end; }
.wordmark { white-space: nowrap; }

.art-wrap { position: relative; margin: 6px var(--gutter) 0; }
.art {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: 22px;
    overflow: hidden;
    background: var(--surface);
    box-shadow: 0 20px 40px oklch(0 0 0 / .35);
    touch-action: pan-y;
    transition: transform .2s ease-out;
    z-index: 1;
}
.art img { width: 100%; height: 100%; object-fit: cover; }
.art-wrap.is-dragging .art { transition: none; }
.art-peek {
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 40%;
    border-radius: 22px 0 0 22px;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: var(--surface) center / cover no-repeat;
    visibility: hidden;
}
.art-peek span { background: oklch(0 0 0 / .6); padding: 6px 12px; border-radius: 14px; font-weight: 700; font-size: 14px; }
.art-wrap[data-dir="left"] .art-peek { visibility: visible; }
.art-wrap[data-dir="left"] ~ .player-title { opacity: .55; }
.embed { aspect-ratio: 16 / 9; border-radius: 22px; overflow: hidden; background: #000; }
.embed iframe, .embed > div { width: 100%; height: 100%; border: 0; }

.player-title { font-size: 21px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.2; padding: 20px var(--gutter) 6px; text-wrap: pretty; overflow-wrap: anywhere; }
.player-meta { font-size: 13px; color: var(--text-2); padding: 0 var(--gutter); }

.scrub { padding: 18px var(--gutter) 0; }
.scrub input[type=range] {
    width: 100%;
    height: 16px;
    margin: 0;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    --pct: 0%;
}
.scrub input[type=range]::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(var(--text), var(--text)) 0 / var(--pct) 100% no-repeat, var(--surface-2);
}
.scrub input[type=range]::-moz-range-track { height: 6px; border-radius: 3px; background: var(--surface-2); }
.scrub input[type=range]::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--text); }
.scrub input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -5px; border-radius: 50%; background: var(--text); border: 0; }
.scrub input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--text); border: 0; }
.scrub .times { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 12px; color: var(--text-2); margin-top: 6px; }
.transport { display: flex; align-items: center; justify-content: space-between; padding: 14px var(--gutter) 0; }
.transport .round { width: 48px; height: 48px; font-family: var(--mono); font-size: 13px; }
.transport .skip { background: none; border: 0; color: var(--text); font-size: 22px; width: 48px; height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
.transport .skip small { font-family: var(--mono); font-size: 11px; line-height: 1; }
.play-btn { width: 80px; height: 80px; border-radius: 50%; border: 0; background: var(--text); color: var(--bg); font-size: 28px; display: grid; place-items: center; }
.play-btn .fa-play { margin-left: 4px; }
.yt { color: var(--f-watch); font-size: 18px; }
.native-audio { width: calc(100% - 2 * var(--gutter)); margin: 16px var(--gutter) 0; }

.also { display: flex; align-items: center; gap: 8px; padding: 18px var(--gutter) 0; font-size: 12.5px; color: var(--text-2); flex-wrap: wrap; }
.also .chip { height: 34px; font-size: 13.5px; color: var(--text); font-weight: 600; }

.read { padding: 16px var(--gutter) 8px; font-size: 17px; line-height: 1.6; max-width: 64ch; }
.read > * + * { margin-top: 1em; }
.read p + :is(ol, ul) { margin-top: .35em; }
.read ol, .read ul { padding-left: 1.4em; }
.read ol { list-style: decimal; }
.read ul { list-style: disc; }
.read li + li { margin-top: .35em; }
.read li::marker { color: var(--text-2); }
.state-box { margin: 16px var(--gutter) 0; padding: 14px 16px; border-radius: 16px; background: var(--surface); color: var(--text-2); font-size: 14px; }
.state-box .btn { margin-top: 12px; }
.copy-url { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.copy-url .btn { margin-top: 0; }
.copy-url a { flex: 1; min-width: 0; overflow-wrap: anywhere; color: var(--text); }

.up-next { list-style: none; margin: 22px var(--gutter) 0; padding: 0; }
.up-next li:not(:first-child) { display: none; }
.up-next a { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 16px; background: var(--surface); }
.up-next .thumb { width: 64px; height: 36px; border-radius: 7px; }
.up-next .body { flex: 1; min-width: 0; }
.up-next .body small { display: block; font-size: 11px; letter-spacing: .08em; color: var(--text-3); text-transform: uppercase; }
.up-next .body span { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-next .mono { font-size: 12px; color: var(--text-2); }

.actionbar {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin-top: auto;
    display: flex;
    gap: 10px;
    padding: 14px var(--gutter) 24px;
    border-top: 1px solid var(--surface-2);
    background: var(--bg);
}
.actionbar form { display: flex; }
.actionbar .grow { flex: 1; }
.actionbar .grow-2 { flex: 1.4; }
.actionbar .grow .btn, .actionbar .grow-2 .btn { width: 100%; }
.player-spacer { height: 24px; }

/* ---------- library ---------- */
.search {
    margin: 4px var(--gutter) 0;
    height: 48px;
    border-radius: 14px;
    background: var(--surface);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    color: var(--text-3);
}
.search input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none; font-size: 15px; }
.search input::placeholder { color: var(--text-3); }
.segmented { margin: 14px var(--gutter) 0; padding: 4px; border-radius: 14px; background: var(--surface); display: flex; }
.segmented a { flex: 1; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 14px; color: var(--text-2); }
.segmented a.is-on { background: var(--surface-3); color: var(--text); font-weight: 600; }
.segmented .mono { font-size: 11.5px; color: var(--text-3); }
.lib .notice { padding-top: 12px; }
.group-label { padding: 20px var(--gutter) 6px; }
.lib-row { display: flex; align-items: center; gap: 12px; padding: 9px 8px 9px var(--gutter); min-height: 68px; }
.lib-row .thumb { width: 88px; height: 50px; border-radius: 8px; }
.lib-row.is-dropped .thumb { opacity: .55; }
.lib-row.is-dropped .row-title { color: var(--text-2); }
.lib-meta { display: flex; align-items: center; gap: 8px; margin-top: 5px; font-size: 12px; color: var(--text-2); min-width: 0; }
.lib-meta .fmt { color: var(--f); }
.lib-meta .topic { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { font-size: 11.5px; padding: 2px 7px; border-radius: 6px; font-weight: 600; white-space: nowrap; }
.badge-done { background: oklch(0.80 0.12 165 / .16); color: var(--ok-dot); }
.badge-dropped { background: var(--surface-2); color: var(--text-2); }
.row-btn { flex: none; height: 38px; padding: 0 12px; border-radius: 19px; border: 1px solid var(--surface-3); background: transparent; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.row-btn.icon { width: 44px; height: 44px; padding: 0; justify-content: center; border: 0; color: var(--text-2); }
.lib-row form { display: contents; }

/* ---------- forms (settings, capture) ---------- */
.field {
    width: 100%;
    height: 48px;
    border-radius: 14px;
    border: 1px solid transparent;
    background: var(--surface);
    padding: 0 14px;
    font-size: 15px;
}
.field:focus { outline: none; border-color: var(--accent-line); }
.stack { display: flex; flex-direction: column; gap: 12px; padding: 0 var(--gutter); }
.card { background: var(--surface); border-radius: 16px; padding: 12px; }
.topic-card { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.topic-card .field { flex: 1 1 100%; background: var(--surface-2); height: 44px; }
.toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--text-2); cursor: pointer; }
.toggle input { accent-color: var(--accent); width: 18px; height: 18px; }
.topic-card .btn-sm { margin-left: auto; }
.run { display: flex; flex-direction: column; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--surface-2); font-size: 13px; color: var(--text-2); }
.run b { color: var(--text); font-weight: 600; }
.run .err { color: var(--danger); }
.section-head { font-size: 17px; font-weight: 700; padding: 26px var(--gutter) 12px; }
code { font-family: var(--mono); font-size: 12.5px; background: var(--surface); padding: 2px 6px; border-radius: 6px; }

/* ---------- toasts ---------- */
.toasts {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    width: min(448px, calc(100% - 32px));
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 50;
}
body.has-actionbar .toasts { bottom: 116px; }
.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 16px;
    background: var(--surface-2);
    box-shadow: 0 12px 30px oklch(0 0 0 / .4);
    font-size: 14px;
}
.toast .msg { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast .fa-trash { color: var(--danger); }
.toast .ok { color: var(--ok-dot); }
.toast .bad { color: var(--danger); }
.toast form { display: contents; }

@media (prefers-reduced-motion: reduce) {
    .swipe-face, .sort-card, .art { transition: none; }
}

.sort-section .tiles { padding: 0; }
@media (hover: none) { .d-desk { display: none; } }
/* Mouse: hovering an idle swipe row shows its actions as a compact strip - same buttons a swipe
   reveals. Idle = not dragged/open: swipe.js sizes the open row from the full-size strip. Queue rows
   keep the grip (36px) clear. */
@media (hover: hover) {
    .swipe:not([data-dir], .is-open):hover .swipe-acts { visibility: visible; z-index: 2; top: 50%; bottom: auto; height: 52px; transform: translateY(-50%); gap: 4px; padding-right: 6px; }
    .swipe:not([data-dir], .is-open):hover .swipe-acts:has(~ .row) { right: 36px; }
    .swipe:not([data-dir], .is-open):hover .act { width: 64px; border-radius: 10px; font-size: 11px; gap: 3px; box-shadow: 0 4px 12px oklch(0 0 0 / .35); }
    .swipe:not([data-dir], .is-open):hover .act i { font-size: 14px; }
    .act-reopen { background: var(--positive-bg); }
}
.wordmark.sm { font-size: 22px; padding-left: 8px; }
.run-hint { padding-top: 14px; }
.self-start { align-self: flex-start; }

/* Desktop: a wider column, not a new layout - phone is the design target. Media and the Sort card
   stay capped so a 16:9 hero doesn't eat the screen. */
@media (min-width: 800px) {
    .app { max-width: 760px; }
    .sort-stack, .sort-foot, .art-wrap, .scrub, .transport { width: auto; max-width: 600px; margin-inline: auto; }
}

/* ---------- item page state (inbox / finished / archived / shared) ---------- */
.item-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 2px var(--gutter) 8px; padding: 10px 12px; border-radius: 14px; background: var(--surface); font-size: 13px; line-height: 1.45; }
.badge-inbox { background: var(--accent-tint); color: var(--accent); }
.badge-shared { background: oklch(0.40 0.08 165 / .35); color: var(--ok-dot); }
.actionbar.compact { flex-wrap: wrap; }
.actionbar.compact .btn { height: 52px; font-size: 15px; padding: 0 12px; gap: 7px; }
.actionbar .purge { order: 2; flex-basis: 100%; }   /* its own row: never squeezed beside the safe actions */
.actionbar a.grow { flex: 1; }
.btn-danger.wide { width: 100%; }
.act-delete { text-align: center; line-height: 1.15; }
.pad-bottom { padding-bottom: 10px; }
body:has(.actionbar.compact) .toasts { bottom: 172px; }
