/* Layout: a contact sheet. One capture bar, a row of shelf tabs, then frames numbered in the order you saved them. */
:root {
  --bg: #eff1ec; --surface: #ffffff; --sunk: #e4e7e0; --ink: #17191a; --muted: #586059; --faint: #858c86;
  --line: #d6dad2; --line-strong: #b8beb5;
  --accent: #c9392b; --accent-hover: #b02f22; --accent-ink: #ffffff; --accent-soft: #f6dedb;
  --warn: #8a5a00; --warn-soft: #fbefd5; --danger: #b42318; --ok: #2c6e47;
  --shadow: 0 1px 2px rgb(20 24 22 / .06), 0 6px 18px rgb(20 24 22 / .07);
  --scrim: rgb(14 16 15 / .55);
  --h0-bg: #dcebdd; --h0-fg: #24553a; --h1-bg: #dce6f5; --h1-fg: #1f4478;
  --h2-bg: #f5e6c8; --h2-fg: #6b4708; --h3-bg: #f4dce0; --h3-fg: #7a2637;
  --h4-bg: #e6dff4; --h4-fg: #47307a; --h5-bg: #d5ecea; --h5-fg: #12534f;
  --h6-bg: #f1e0d4; --h6-fg: #73391a; --h7-bg: #e1e4e8; --h7-fg: #374151;
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Instrument Sans", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111413; --surface: #1a1e1c; --sunk: #0b0d0c; --ink: #ecefea; --muted: #a3aaa4; --faint: #737a74;
    --line: #2a302c; --line-strong: #3d4440;
    --accent: #f26a57; --accent-hover: #ff8070; --accent-ink: #1c0906; --accent-soft: #3a1c17;
    --warn: #e9b44c; --warn-soft: #33280f; --danger: #ff8a7a; --ok: #7fd3a0;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px rgb(0 0 0 / .35);
    --scrim: rgb(0 0 0 / .65);
    --h0-bg: #1f3326; --h0-fg: #a9d9b6; --h1-bg: #1c2a40; --h1-fg: #a9c4ee;
    --h2-bg: #3a2d12; --h2-fg: #ebc77c; --h3-bg: #3d1f26; --h3-fg: #f0a9b6;
    --h4-bg: #2b2340; --h4-fg: #c9b8f0; --h5-bg: #133331; --h5-fg: #97dcd5;
    --h6-bg: #3b2618; --h6-fg: #edb58f; --h7-bg: #262b31; --h7-fg: #c3cad3;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111413; --surface: #1a1e1c; --sunk: #0b0d0c; --ink: #ecefea; --muted: #a3aaa4; --faint: #737a74;
  --line: #2a302c; --line-strong: #3d4440;
  --accent: #f26a57; --accent-hover: #ff8070; --accent-ink: #1c0906; --accent-soft: #3a1c17;
  --warn: #e9b44c; --warn-soft: #33280f; --danger: #ff8a7a; --ok: #7fd3a0;
  --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px rgb(0 0 0 / .35);
  --scrim: rgb(0 0 0 / .65);
  --h0-bg: #1f3326; --h0-fg: #a9d9b6; --h1-bg: #1c2a40; --h1-fg: #a9c4ee;
  --h2-bg: #3a2d12; --h2-fg: #ebc77c; --h3-bg: #3d1f26; --h3-fg: #f0a9b6;
  --h4-bg: #2b2340; --h4-fg: #c9b8f0; --h5-bg: #133331; --h5-fg: #97dcd5;
  --h6-bg: #3b2618; --h6-fg: #edb58f; --h7-bg: #262b31; --h7-fg: #c3cad3;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.5;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); font-size: 11.5px; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap {
  max-width: 1280px; margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px));
}

/* Top bar */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 18px 6px; flex-wrap: wrap; }
.brand { display: flex; align-items: baseline; gap: 12px; }
.brand h1 { font-family: var(--display); font-weight: 750; font-size: 26px; letter-spacing: -.02em; margin: 0; line-height: 1; }
.brand h1 span { color: var(--accent); }
.brand .count { color: var(--muted); }
.top-actions { display: flex; align-items: center; gap: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font-weight: 550; font-size: 14px; white-space: nowrap; text-decoration: none;
}
.btn:hover { border-color: var(--ink); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--sunk); }
.btn.danger { color: var(--danger); }
.btn.danger.armed { background: var(--danger); border-color: var(--danger); color: var(--surface); }
.btn[disabled] { opacity: .55; cursor: progress; }

.ai-pill { height: 32px; font-size: 13px; padding: 0 12px; font-weight: 500; }
.ai-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.ai-pill.on .dot { background: var(--ok); }
.ai-pill.err .dot { background: var(--danger); }

/* Capture */
.capture { padding-block: 18px 8px; }
.capture form {
  display: flex; gap: 8px; align-items: center; background: var(--surface); border: 1.5px solid var(--line-strong);
  border-radius: 16px; padding: 7px 7px 7px 16px; box-shadow: var(--shadow);
}
.capture form:focus-within { border-color: var(--ink); }
.capture svg.lead { width: 20px; height: 20px; color: var(--faint); flex: none; }
.capture input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 17px; height: 44px;
}
.capture input::placeholder { color: var(--faint); }
.capture .btn.primary { height: 44px; padding: 0 22px; border-radius: 11px; font-size: 15px; }
.capture .hint { margin: 10px 2px 0; color: var(--muted); font-size: 13.5px; }
.capture .hint strong { color: var(--ink); font-weight: 620; }
.capture .hint kbd { font-family: var(--mono); font-size: 11.5px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; background: var(--surface); }
.save-to {
  display: flex; align-items: center; gap: 4px; height: 44px; padding: 0 4px 0 12px; border-left: 1px solid var(--line); flex: 0 1 auto; min-width: 0;
}
.save-to span { font-size: 12.5px; color: var(--faint); white-space: nowrap; }
.save-to select {
  border: 0; background: transparent; font-weight: 620; font-size: 14.5px; height: 36px; max-width: 210px; min-width: 0;
  cursor: pointer; text-overflow: ellipsis; border-radius: 8px; padding: 0 4px;
}
.save-to select:hover { background: var(--sunk); }
.save-to.chosen select { color: var(--accent); }

/* Two columns: categories on the left, saves on the right */
.layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 34px; align-items: start; padding-top: 20px; }
.side { position: sticky; top: 14px; max-height: calc(100dvh - 28px); overflow: auto; padding: 2px 2px 24px; }
.side-head { margin: 4px 0 8px 30px; font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.cat-line { display: flex; align-items: center; gap: 2px; border-radius: 9px; }
.cat-line.drop-ok { outline: 2px dashed var(--accent); outline-offset: 1px; background: var(--accent-soft); }
body.dragging-card .cat-node .cat-line { outline: 1px dashed var(--line-strong); outline-offset: 1px; }
body.dragging-card .cat-node .cat-line.drop-ok { outline: 2px dashed var(--accent); }
.tree .row {
  all: unset; box-sizing: border-box; flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; padding: 6px 9px; border-radius: 8px;
  cursor: pointer; font-size: 14.5px; font-weight: 560; color: var(--ink); line-height: 1.3;
}
.tree .row:hover { background: var(--sunk); }
.tree .row:focus-visible, .caret:focus-visible, .subject button:focus-visible, .group-head button:focus-visible, .crumb:focus-visible, .link-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tree .row.active { background: var(--ink); color: var(--bg); }
.tree .row .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree .row .n { color: var(--faint); font-size: 11px; }
.tree .row.active .n { color: var(--bg); opacity: .7; }
.caret { width: 24px; height: 30px; border: 0; background: transparent; color: var(--faint); display: grid; place-items: center; padding: 0; flex: none; border-radius: 6px; }
.caret:hover { color: var(--ink); background: var(--sunk); }
.caret svg { width: 14px; height: 14px; transition: transform .15s ease; }
.caret[aria-expanded="false"] svg { transform: rotate(-90deg); }
.caret-sp { width: 24px; flex: none; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--cat-fg, var(--faint)); flex: none; }
.dot.ring { background: transparent; border: 2px solid var(--faint); }
.tree .row.active .dot.ring { border-color: var(--bg); }
.tree li + li { margin-top: 1px; }
.subs { margin: 1px 0 6px 34px !important; padding-left: 8px !important; border-left: 1px solid var(--line); }
.subs .row { font-size: 13.5px; font-weight: 500; color: var(--muted); padding: 4px 9px; }
.subs .cat-node.child > .cat-line .row { font-size: 14px; font-weight: 560; color: var(--ink); padding: 5px 9px; }
.subs .cat-node.child > .cat-line .row.active { color: var(--bg); }
.subs .cat-node.child > .cat-line .caret, .subs .cat-node.child > .cat-line .caret-sp { width: 20px; margin-left: -6px; }
.subs .subs { margin: 1px 0 5px 26px !important; }
.subs .row.sub.active, .tree .row.sub.active { color: var(--bg); }
.new-cat { margin: 12px 0 0 26px; height: 34px; font-size: 13.5px; color: var(--muted); }
.new-cat:hover { color: var(--ink); }

/* Heading above the saves */
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; padding-bottom: 14px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.view-id { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.view-title { margin: 0; font-family: var(--display); font-size: 26px; font-weight: 720; letter-spacing: -.02em; line-height: 1.1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; overflow-wrap: anywhere; }
.view-title .dot { width: 12px; height: 12px; }
.view-title .sep { color: var(--faint); font-weight: 500; }
.crumb { all: unset; cursor: pointer; color: var(--muted); }
.crumb:hover { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.view-meta { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; color: var(--muted); }
.link-btn { all: unset; cursor: pointer; font-size: 13px; font-weight: 550; color: var(--muted); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.link-btn:hover { color: var(--ink); text-decoration-color: currentColor; }
.link-btn.danger { color: var(--danger); }
.link-btn.danger.armed { background: var(--danger); color: var(--surface); text-decoration: none; padding: 2px 8px; border-radius: 6px; }

/* Chips replace the sidebar on small screens */
.mchips { display: none; flex-direction: column; gap: 8px; padding-block: 4px 14px; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; min-width: 0; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chips.sub { align-items: center; }
.chips.sub .chip { height: 28px; font-size: 12.5px; }
.chips.deeper { padding-left: 18px; }
.chip .dot { width: 8px; height: 8px; }
.sub-lead { color: var(--faint); padding: 0 2px 0 6px; flex: none; }
.chip {
  flex: none; border: 1px solid var(--line-strong); background: transparent; border-radius: 999px; height: 32px; padding: 0 12px;
  font-size: 13.5px; font-weight: 550; color: var(--muted); display: inline-flex; align-items: center; gap: 7px;
}
.chip svg { width: 14px; height: 14px; }
.chip .n { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.chip:hover { color: var(--ink); border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip[aria-pressed="true"] .n { color: var(--bg); opacity: .7; }
.chip.add { border-style: dashed; }
.tools { display: flex; align-items: center; gap: 10px; flex: 0 1 auto; flex-wrap: wrap; }
.search { position: relative; }
.search svg { position: absolute; left: 11px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search input {
  height: 34px; width: 220px; max-width: 100%; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface);
  padding: 0 12px 0 33px; font-size: 14px;
}
.toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--muted); cursor: pointer; user-select: none; white-space: nowrap; }
.toggle input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }

/* Grid of frames, in groups by source inside a category */
.results { display: flex; flex-direction: column; gap: 30px; padding-block: 22px 60px; }
.results:empty { padding: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(224px, 1fr)); gap: 22px 18px; }
.group-head { margin: 0 0 12px; display: flex; align-items: baseline; gap: 9px; font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.group-head::after { content: ""; flex: 1; height: 1px; background: var(--line); align-self: center; }
.group-head button { all: unset; cursor: pointer; color: var(--ink); }
.group-head button:hover { text-decoration: underline; text-underline-offset: 3px; }
.group-head .n { color: var(--faint); }
.subcat { display: flex; flex-direction: column; gap: 18px; padding: 16px 0 6px 16px; border-left: 3px solid var(--cat-fg); }
.subcat-head { margin: 0; display: flex; align-items: center; gap: 9px; font-family: var(--display); font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.subcat-head .dot { width: 10px; height: 10px; }
.subcat-head button { all: unset; cursor: pointer; }
.subcat-head button:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.subcat-head button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.subcat-head .n { color: var(--faint); font-weight: 400; }
.subcat .group-head { margin-bottom: 10px; }
.card { display: flex; flex-direction: column; min-width: 0; position: relative; }
.card[draggable="true"] { cursor: grab; }
.card[draggable="true"]:active { cursor: grabbing; }
.thumb {
  position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; border: 0; padding: 0; border-radius: var(--radius);
  overflow: hidden; background: var(--sunk); text-align: left;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card:hover .thumb img { transform: scale(1.03); }
.thumb .ph {
  position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 14px; background: var(--cat-bg, var(--sunk)); color: var(--cat-fg, var(--muted));
  font-family: var(--display); font-weight: 700; font-size: 21px; line-height: 1.1; letter-spacing: -.01em;
}
.badge {
  position: absolute; top: 9px; left: 9px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 7px; border-radius: 6px; background: rgb(12 14 13 / .72); color: #f4f5f2; backdrop-filter: blur(4px);
}
.play {
  position: absolute; right: 10px; bottom: 10px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: rgb(12 14 13 / .72); color: #fff;
}
.play svg { width: 15px; height: 15px; margin-left: 2px; }
.seen {
  position: absolute; top: 9px; right: 9px; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 6px;
  background: var(--surface); color: var(--ok); display: inline-flex; gap: 4px; align-items: center;
}
.seen svg { width: 12px; height: 12px; }
.card .body { padding: 10px 2px 0; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.frame { color: var(--faint); display: flex; justify-content: space-between; gap: 8px; }
.frame .src { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subject { margin: 0; font-family: var(--body); font-size: 16px; font-weight: 620; line-height: 1.3; letter-spacing: -.005em; text-wrap: balance; overflow-wrap: anywhere; }
.subject button { all: unset; cursor: pointer; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.subject button:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.summary { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.cat { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--cat-bg); color: var(--cat-fg); }
.tag { font-size: 12px; color: var(--faint); }
.needs {
  margin-top: 8px; border: 1px dashed var(--warn); background: var(--warn-soft); color: var(--warn); border-radius: 8px;
  padding: 8px 10px; font-size: 12.5px; line-height: 1.4; display: flex; gap: 8px; align-items: center; justify-content: space-between;
}
.needs button { border: 0; background: transparent; color: inherit; font-weight: 650; text-decoration: underline; text-underline-offset: 2px; padding: 0; flex: none; }
.card.drop-target .thumb { outline: 3px dashed var(--accent); outline-offset: 3px; }

/* Pending frame */
.card.pending .thumb { border: 1.5px dashed var(--line-strong); background: transparent; display: grid; place-items: center; }
.loader { display: flex; gap: 5px; }
.loader i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: blink 1.1s infinite ease-in-out; }
.loader i:nth-child(2) { animation-delay: .15s; } .loader i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .2; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }
.card.pending .subject { color: var(--muted); font-weight: 550; }
.card.pending .summary { overflow-wrap: anywhere; }
.card.fresh { animation: settle .5s ease-out; }
@keyframes settle { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Empty */
.empty { padding-block: 70px 90px; display: grid; justify-items: center; text-align: center; gap: 12px; }
.empty .frames { display: flex; gap: 10px; margin-bottom: 10px; }
.empty .frames span { width: 70px; height: 54px; border-radius: 8px; border: 1.5px dashed var(--line-strong); }
.empty .frames span:nth-child(2) { border-color: var(--accent); background: var(--accent-soft); }
.empty h2 { font-family: var(--display); font-size: 28px; font-weight: 720; letter-spacing: -.02em; margin: 0; text-wrap: balance; }
.empty p { margin: 0; color: var(--muted); max-width: 46ch; }
.empty .platforms { margin-top: 6px; color: var(--faint); }

/* Dialogs */
dialog {
  border: 0; padding: 0; border-radius: 18px; background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgb(0 0 0 / .3);
  width: min(980px, calc(100vw - 24px)); max-height: calc(100dvh - 24px);
}
dialog::backdrop { background: var(--scrim); }
dialog.small { width: min(560px, calc(100vw - 24px)); }
dialog.cat-dlg { width: min(440px, calc(100vw - 24px)); }
.dlg { display: flex; flex-direction: column; max-height: calc(100dvh - 24px); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 10px 22px; border-bottom: 1px solid var(--line); }
.dlg-head h2 { margin: 0; font-family: var(--display); font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.dlg-body { overflow: auto; padding: 20px 22px 22px; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; color: var(--muted); }
.icon-btn:hover { background: var(--sunk); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }

.detail { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; }
.media { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.stage { position: relative; border-radius: 12px; overflow: hidden; background: var(--sunk); aspect-ratio: 16 / 9; }
.stage.tall { aspect-ratio: 9 / 14; width: min(100%, 380px); margin: 0 auto; }
.stage img { width: 100%; height: 100%; object-fit: contain; background: #0c0d0d; }
.stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #0c0d0d; }
.stage .ph { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; text-align: center; background: var(--cat-bg); color: var(--cat-fg); font-family: var(--display); font-weight: 700; font-size: 24px; }
.stage .play-here { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); height: 46px; padding: 0 20px; font-size: 15px; }
.media-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.media-note { color: var(--muted); font-size: 12.5px; margin: 0; }

.fields { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label, .label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.field input[type="text"], .field input[type="password"], .field textarea, .field select {
  width: 100%; border: 1px solid var(--line-strong); background: var(--bg); border-radius: 9px; padding: 9px 11px; font-size: 15px;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.field textarea { resize: vertical; min-height: 64px; line-height: 1.45; }
.field input.big { font-family: var(--body); font-weight: 620; font-size: 18px; }
.field .help { font-size: 12.5px; color: var(--faint); margin: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 13px; margin: 0; }
.facts dt { color: var(--faint); }
.facts dd { margin: 0; overflow-wrap: anywhere; color: var(--muted); }
.facts a { color: var(--ink); }
.dlg-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding-top: 6px; }
.dlg-foot .grp { display: flex; flex-wrap: wrap; gap: 8px; }
.named-by { font-size: 12px; color: var(--faint); }

.section { padding-block: 4px 18px; border-bottom: 1px solid var(--line); margin-bottom: 18px; display: flex; flex-direction: column; gap: 12px; }
.section:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.section h3 { margin: 0; font-size: 15px; font-weight: 650; }
.section p { margin: 0; color: var(--muted); font-size: 14px; }
.section code, .section .code { font-family: var(--mono); font-size: 12.5px; background: var(--sunk); padding: 2px 6px; border-radius: 5px; overflow-wrap: anywhere; }
.status-line { font-size: 13.5px; padding: 9px 12px; border-radius: 9px; background: var(--sunk); color: var(--muted); }
.status-line.ok { color: var(--ok); }
.status-line.err { color: var(--danger); }
.bookmarklet { align-self: flex-start; cursor: grab; }
.section ul.ways { margin: 0; padding-left: 20px; color: var(--muted); font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
.section strong { color: var(--ink); font-weight: 620; }
.help.err { color: var(--danger); font-size: 13.5px; margin: 0; }

/* Toasts */
.toasts { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 50; width: min(520px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; background: var(--ink); color: var(--bg); border-radius: 12px; padding: 11px 14px; font-size: 14px; box-shadow: var(--shadow); display: flex; gap: 10px; align-items: flex-start; animation: settle .25s ease-out; }
.toast.warn { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn); }
.toast.error { background: var(--danger); color: #fff; }

.drop-overlay { position: fixed; inset: 0; z-index: 40; background: var(--scrim); display: grid; place-items: center; pointer-events: none; }
.drop-overlay div { background: var(--surface); border: 2px dashed var(--accent); border-radius: 18px; padding: 28px 36px; font-family: var(--display); font-size: 22px; font-weight: 700; }

@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 10px; }
  .side { display: none; }
  .mchips { display: flex; }
}
@media (max-width: 760px) {
  .detail { grid-template-columns: minmax(0, 1fr); }
  .row2 { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 18px 12px; }
  .capture form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 8px; padding: 6px 6px 6px 14px; }
  .capture svg.lead { display: none; }
  .capture input { grid-column: 1 / -1; }
  .save-to { min-width: 0; border-left: 0; padding: 0; height: 44px; }
  .save-to select { font-size: 16px; max-width: none; width: 100%; min-width: 0; flex: 1 1 0; }
  .view-title { font-size: 22px; }
  .subject { font-size: 14.5px; }
  .summary { font-size: 12.5px; }
  .search input { width: 100%; }
  .tools { width: 100%; }
  .search { flex: 1; }
  .capture input { font-size: 16px; }
  .capture .btn.primary { padding: 0 16px; }
  .ai-pill .label-long { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Link Dots: the "Save this link?" confirm. */
.add-url { margin: 0 0 6px; font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; background: var(--sunk); padding: 8px 10px; border-radius: 8px; }
