:root {
  --r-g: #2fb487; --r-t: #f0b400; --r-m: #ff7a45; --r-e: #e0245e; --r-n: #a79bb0;
  --ui: "DM Sans", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --serif: "Fraunces", "Iowan Old Style", "Palatino", Georgia, serif;
  --read: "Lora", "Iowan Old Style", Georgia, serif;
}
:root, :root[data-theme="blossom"] {
  color-scheme: only light;
  --bg: #fff6f8; --panel: #ffffff; --panel-2: #fff0f5; --ink: #2b1430; --ink-2: #6b4a6e; --ink-3: #a483a3;
  --line: #f6d9e4; --accent: #e0457b; --accent-2: #ff8a5b; --accent-ink: #ffffff; --accent-soft: #ffe3ec; --chip: #fbeef3;
  --grad: linear-gradient(135deg, #f0508a 0%, #ff8a5b 100%); --grad-2: linear-gradient(90deg, #f0508a, #c9b3ff, #ff8a5b);
  --shadow: 0 1px 2px color-mix(in srgb, #e0457b 8%, transparent), 0 8px 24px color-mix(in srgb, #e0457b 10%, transparent);
  --c-char-bg: #f0e8ff; --c-char: #6a3fb5; --c-tag-bg: #fff0e2; --c-tag: #b4561a;
  --c-rel-bg: #ffe2ed; --c-rel: #c2185b; --c-fan-bg: #e0f6ee; --c-fan: #1f7a5a; --c-warn-bg: #fff6d6; --c-warn: #8a6500;
  --blob1: rgba(255,170,200,.45); --blob2: rgba(255,200,160,.40); --blob3: rgba(205,180,255,.38);
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg opacity='0.22'%3E%3Cg transform='translate%2840 50%29 scale%281%29'%3E%3Ccircle cx='0' cy='-9' r='7' fill='%23f7a1c0'/%3E%3Ccircle cx='8.5' cy='-2.8' r='7' fill='%23f7a1c0'/%3E%3Ccircle cx='5.3' cy='7.3' r='7' fill='%23f7a1c0'/%3E%3Ccircle cx='-5.3' cy='7.3' r='7' fill='%23f7a1c0'/%3E%3Ccircle cx='-8.5' cy='-2.8' r='7' fill='%23f7a1c0'/%3E%3Ccircle r='4' fill='%23ffd166'/%3E%3C/g%3E%3Cg transform='translate%28160 150%29 scale%280.7%29'%3E%3Ccircle cx='0' cy='-9' r='7' fill='%23c9b3ff'/%3E%3Ccircle cx='8.5' cy='-2.8' r='7' fill='%23c9b3ff'/%3E%3Ccircle cx='5.3' cy='7.3' r='7' fill='%23c9b3ff'/%3E%3Ccircle cx='-5.3' cy='7.3' r='7' fill='%23c9b3ff'/%3E%3Ccircle cx='-8.5' cy='-2.8' r='7' fill='%23c9b3ff'/%3E%3Ccircle r='4' fill='%23fff'/%3E%3C/g%3E%3Cg transform='translate%28170 40%29 scale%280.5%29'%3E%3Ccircle cx='0' cy='-9' r='7' fill='%23ffb38a'/%3E%3Ccircle cx='8.5' cy='-2.8' r='7' fill='%23ffb38a'/%3E%3Ccircle cx='5.3' cy='7.3' r='7' fill='%23ffb38a'/%3E%3Ccircle cx='-5.3' cy='7.3' r='7' fill='%23ffb38a'/%3E%3Ccircle cx='-8.5' cy='-2.8' r='7' fill='%23ffb38a'/%3E%3Ccircle r='4' fill='%23fff'/%3E%3C/g%3E%3Cpath transform='translate%2870 160%29 rotate%280%29' d='M0 0 q10 -14 22 -6 q-8 12 -22 6z' fill='%239fdcbf'/%3E%3Cpath transform='translate%28110 80%29 rotate%28-20%29' d='M0 0 q10 -14 22 -6 q-8 12 -22 6z' fill='%239fdcbf'/%3E%3C/g%3E%3C/svg%3E");
  --r-paper: #fffafc; --r-paper-ink: #2b1430; --r-night: #1a0e1e; --r-night-ink: #f1dde9; --hl: #ffe27a;
}
:root[data-theme="matcha"] {
  color-scheme: only light;
  --bg: #f6f3e6; --panel: #fffdf4; --panel-2: #eef0df; --ink: #0C3B2E; --ink-2: #3d5c50; --ink-3: #7f9488;
  --line: #dde3cc; --accent: #4f7d58; --accent-2: #FFBA00; --accent-ink: #ffffff; --accent-soft: #e2ecdb; --chip: #eef1e2;
  --grad: linear-gradient(135deg, #0C3B2E 0%, #6D9773 55%, #FFBA00 100%); --grad-2: linear-gradient(90deg, #6D9773, #BB8A52, #FFBA00);
  --shadow: 0 1px 2px color-mix(in srgb, #4f7d58 8%, transparent), 0 8px 24px color-mix(in srgb, #4f7d58 10%, transparent);
  --c-char-bg: #e2ecdb; --c-char: #2f5e3a; --c-tag-bg: #fff0c4; --c-tag: #8a5a00;
  --c-rel-bg: #f3e3cf; --c-rel: #8a5528; --c-fan-bg: #d8e6df; --c-fan: #0C3B2E; --c-warn-bg: #fff3cf; --c-warn: #7a5a00;
  --blob1: rgba(109,151,115,.30); --blob2: rgba(255,186,0,.22); --blob3: rgba(187,138,82,.22);
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg opacity='0.2'%3E%3Cpath transform='translate%2830 60%29 rotate%28-30%29' d='M0 0 q10 -14 22 -6 q-8 12 -22 6z' fill='%236D9773'/%3E%3Cpath transform='translate%2846 52%29 rotate%2840%29' d='M0 0 q10 -14 22 -6 q-8 12 -22 6z' fill='%236D9773'/%3E%3Cg transform='translate%28160 150%29 scale%280.6%29'%3E%3Ccircle cx='0' cy='-9' r='7' fill='%23FFBA00'/%3E%3Ccircle cx='8.5' cy='-2.8' r='7' fill='%23FFBA00'/%3E%3Ccircle cx='5.3' cy='7.3' r='7' fill='%23FFBA00'/%3E%3Ccircle cx='-5.3' cy='7.3' r='7' fill='%23FFBA00'/%3E%3Ccircle cx='-8.5' cy='-2.8' r='7' fill='%23FFBA00'/%3E%3Ccircle r='4' fill='%23BB8A52'/%3E%3C/g%3E%3Cpath transform='translate%28150 40%29 rotate%2810%29' d='M0 0 q10 -14 22 -6 q-8 12 -22 6z' fill='%236D9773'/%3E%3Ccircle cx='100' cy='110' r='3' fill='%23FFBA00'/%3E%3Ccircle cx='60' cy='180' r='2.5' fill='%23BB8A52'/%3E%3Ccircle cx='190' cy='90' r='2' fill='%23FFBA00'/%3E%3C/g%3E%3C/svg%3E");
  --r-paper: #fbf9ef; --r-paper-ink: #0C3B2E; --r-night: #0a2a21; --r-night-ink: #e6eedd; --hl: #ffd66b;
}
:root[data-theme="lavender"] {
  color-scheme: dark;
  --bg: #2A2438; --panel: #352F44; --panel-2: #3f3852; --ink: #f4f2f9; --ink-2: #DBD8E3; --ink-3: #a39cba;
  --line: #4c4462; --accent: #c4b5f5; --accent-2: #f3b6dc; --accent-ink: #2A2438; --accent-soft: #4a4166; --chip: #3f3852;
  --grad: linear-gradient(135deg, #5C5470 0%, #9d8ec9 50%, #DBD8E3 100%); --grad-2: linear-gradient(90deg, #9d8ec9, #f3b6dc, #DBD8E3);
  --shadow: 0 1px 2px color-mix(in srgb, #c4b5f5 8%, transparent), 0 8px 24px color-mix(in srgb, #c4b5f5 10%, transparent);
  --c-char-bg: #4a4166; --c-char: #e4dcff; --c-tag-bg: #3f3852; --c-tag: #DBD8E3;
  --c-rel-bg: #5C5470; --c-rel: #ffffff; --c-fan-bg: #2f3a4a; --c-fan: #c9dcf5; --c-warn-bg: #4a4030; --c-warn: #ffe3a6;
  --blob1: rgba(157,142,201,.22); --blob2: rgba(243,182,220,.10); --blob3: rgba(92,84,112,.45);
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg opacity='0.22'%3E%3Cpath transform='translate%2850 50%29 scale%281%29' d='M0 -14 C2 -4 4 -2 14 0 C4 2 2 4 0 14 C-2 4 -4 2 -14 0 C-4 -2 -2 -4 0 -14Z' fill='%23DBD8E3'/%3E%3Cpath transform='translate%28160 140%29 scale%280.6%29' d='M0 -14 C2 -4 4 -2 14 0 C4 2 2 4 0 14 C-2 4 -4 2 -14 0 C-4 -2 -2 -4 0 -14Z' fill='%239d8ec9'/%3E%3Cpath transform='translate%28170 40%29 scale%280.35%29' d='M0 -14 C2 -4 4 -2 14 0 C4 2 2 4 0 14 C-2 4 -4 2 -14 0 C-4 -2 -2 -4 0 -14Z' fill='%23DBD8E3'/%3E%3Ccircle cx='100' cy='100' r='1.6' fill='%23DBD8E3'/%3E%3Ccircle cx='40' cy='170' r='1.2' fill='%239d8ec9'/%3E%3Ccircle cx='200' cy='190' r='1.4' fill='%23DBD8E3'/%3E%3C/g%3E%3C/svg%3E");
  --r-paper: #f4f2f8; --r-paper-ink: #2A2438; --r-night: #221d2e; --r-night-ink: #e6e2f0; --hl: #e9dcff;
}
:root[data-theme="sunset"] {
  color-scheme: only light;
  --bg: #F6FFEA; --panel: #fffffa; --panel-2: #fff6dc; --ink: #4f1718; --ink-2: #87463a; --ink-3: #b88a74;
  --line: #f2e3bd; --accent: #C93638; --accent-2: #FA855A; --accent-ink: #ffffff; --accent-soft: #ffe4d6; --chip: #fff3d6;
  --grad: linear-gradient(135deg, #FFDE96 0%, #FA855A 45%, #C93638 100%); --grad-2: linear-gradient(90deg, #62C4DA, #FFDE96, #FA855A, #C93638);
  --shadow: 0 1px 2px color-mix(in srgb, #C93638 8%, transparent), 0 8px 24px color-mix(in srgb, #C93638 10%, transparent);
  --c-char-bg: #dff4fa; --c-char: #1d7891; --c-tag-bg: #fff0c4; --c-tag: #9a5a12;
  --c-rel-bg: #ffe1d6; --c-rel: #b02d2f; --c-fan-bg: #fde4d2; --c-fan: #a8481f; --c-warn-bg: #fff3cf; --c-warn: #7a5a00;
  --blob1: rgba(250,133,90,.32); --blob2: rgba(255,222,150,.55); --blob3: rgba(98,196,218,.30);
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg opacity='0.22'%3E%3Cpath transform='translate%2850 55%29 scale%281%29' d='M0 -14 C2 -4 4 -2 14 0 C4 2 2 4 0 14 C-2 4 -4 2 -14 0 C-4 -2 -2 -4 0 -14Z' fill='%2362C4DA'/%3E%3Cpath transform='translate%28160 150%29 scale%280.7%29' d='M0 -14 C2 -4 4 -2 14 0 C4 2 2 4 0 14 C-2 4 -4 2 -14 0 C-4 -2 -2 -4 0 -14Z' fill='%23FA855A'/%3E%3Cpath transform='translate%28170 40%29 scale%280.45%29' d='M0 -14 C2 -4 4 -2 14 0 C4 2 2 4 0 14 C-2 4 -4 2 -14 0 C-4 -2 -2 -4 0 -14Z' fill='%23C93638'/%3E%3Cpath transform='translate%2860 175%29 scale%280.4%29' d='M0 -14 C2 -4 4 -2 14 0 C4 2 2 4 0 14 C-2 4 -4 2 -14 0 C-4 -2 -2 -4 0 -14Z' fill='%23FFDE96'/%3E%3Ccircle cx='110' cy='100' r='2.5' fill='%23FA855A'/%3E%3C/g%3E%3C/svg%3E");
  --r-paper: #fbfff4; --r-paper-ink: #4f1718; --r-night: #2a1415; --r-night-ink: #ffe9d6; --hl: #FFDE96;
}
:root[data-theme="peony"] {
  color-scheme: only light;
  --bg: #FFF7E6; --panel: #fffcf5; --panel-2: #fdeef0; --ink: #2D3A47; --ink-2: #55606c; --ink-3: #8f97a2;
  --line: #f0dfdc; --accent: #B46A72; --accent-2: #F7C8D3; --accent-ink: #ffffff; --accent-soft: #fbe3e9; --chip: #f6eee8;
  --grad: linear-gradient(135deg, #F7C8D3 0%, #B46A72 60%, #2D3A47 100%); --grad-2: linear-gradient(90deg, #A8B58A, #F7C8D3, #B46A72, #A9B7C6);
  --shadow: 0 1px 2px color-mix(in srgb, #B46A72 8%, transparent), 0 8px 24px color-mix(in srgb, #B46A72 10%, transparent);
  --c-char-bg: #e6ecf2; --c-char: #3d5468; --c-tag-bg: #eef1e1; --c-tag: #56653a;
  --c-rel-bg: #fbe3e9; --c-rel: #8f4a53; --c-fan-bg: #e9eef3; --c-fan: #2D3A47; --c-warn-bg: #fff1d6; --c-warn: #7a5a00;
  --blob1: rgba(247,200,211,.55); --blob2: rgba(168,181,138,.28); --blob3: rgba(169,183,198,.35);
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg opacity='0.24'%3E%3Cg transform='translate%2840 50%29 scale%281%29'%3E%3Ccircle cx='0' cy='-9' r='7' fill='%23F7C8D3'/%3E%3Ccircle cx='8.5' cy='-2.8' r='7' fill='%23F7C8D3'/%3E%3Ccircle cx='5.3' cy='7.3' r='7' fill='%23F7C8D3'/%3E%3Ccircle cx='-5.3' cy='7.3' r='7' fill='%23F7C8D3'/%3E%3Ccircle cx='-8.5' cy='-2.8' r='7' fill='%23F7C8D3'/%3E%3Ccircle r='4' fill='%23FFF7E6'/%3E%3C/g%3E%3Cg transform='translate%28160 150%29 scale%280.75%29'%3E%3Ccircle cx='0' cy='-9' r='7' fill='%23B46A72'/%3E%3Ccircle cx='8.5' cy='-2.8' r='7' fill='%23B46A72'/%3E%3Ccircle cx='5.3' cy='7.3' r='7' fill='%23B46A72'/%3E%3Ccircle cx='-5.3' cy='7.3' r='7' fill='%23B46A72'/%3E%3Ccircle cx='-8.5' cy='-2.8' r='7' fill='%23B46A72'/%3E%3Ccircle r='4' fill='%23F7C8D3'/%3E%3C/g%3E%3Cpath transform='translate%2870 160%29 rotate%280%29' d='M0 0 q10 -14 22 -6 q-8 12 -22 6z' fill='%23A8B58A'/%3E%3Cpath transform='translate%28118 78%29 rotate%28-25%29' d='M0 0 q10 -14 22 -6 q-8 12 -22 6z' fill='%23A8B58A'/%3E%3Ccircle cx='180' cy='50' r='3' fill='%23A9B7C6'/%3E%3Ccircle cx='30' cy='190' r='2' fill='%23A9B7C6'/%3E%3C/g%3E%3C/svg%3E");
  --r-paper: #fffaf0; --r-paper-ink: #2D3A47; --r-night: #1f2833; --r-night-ink: #efe6e2; --hl: #F7C8D3;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow-x: hidden; }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 var(--ui); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); }
[hidden] { display: none !important; }

/* top bar */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 10px 20px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { font: 600 21px var(--serif); color: var(--ink); text-decoration: none; letter-spacing: -.01em; white-space: nowrap; }
.brand span { color: var(--accent); }
.search { flex: 1; max-width: 640px; }
.search input { width: 100%; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); outline: none; }
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.top-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.btn { border: 1px solid var(--line); background: var(--panel); padding: 7px 14px; border-radius: 9px; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--r-e); }
.btn:disabled { opacity: .55; cursor: default; }
.icon-btn { border: 1px solid transparent; background: transparent; width: 34px; height: 34px; border-radius: 8px; cursor: pointer; font-size: 15px; }
.icon-btn:hover { background: var(--panel-2); }
.only-narrow { display: none; }

/* layout */
.layout { display: grid; grid-template-columns: 260px 1fr; min-height: calc(100vh - 57px); }
.sidebar { border-right: 1px solid var(--line); padding: 16px 14px 40px; position: sticky; top: 57px; height: calc(100vh - 57px); overflow-y: auto; }
.shelves a { display: flex; justify-content: space-between; padding: 6px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; cursor: pointer; }
.shelves a:hover { background: var(--panel-2); }
.shelves a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.shelves .n { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.facet { margin-top: 18px; }
.facet h4 { margin: 0 0 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); display: flex; justify-content: space-between; cursor: pointer; user-select: none; }
.facet input { width: 100%; padding: 5px 8px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel); font-size: 12px; margin-bottom: 4px; }
.facet label { display: flex; gap: 7px; align-items: flex-start; padding: 3px 4px; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--ink-2); }
.facet label:hover { background: var(--panel-2); }
.facet label span.t { flex: 1; overflow-wrap: anywhere; }
.facet label span.n { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.facet input[type=checkbox] { width: auto; margin: 2px 0 0; accent-color: var(--accent); }
.facet .more-btn { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 3px 4px; font-size: 12px; }
.main { padding: 16px 24px 60px; min-width: 0; }
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.count { font-weight: 600; white-space: nowrap; }
.active-filters { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.tools { display: flex; gap: 8px; margin-left: auto; }
.tools select, .reader-tools select { padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel); }
.seg button { border: 0; background: transparent; padding: 5px 10px; cursor: pointer; }
.seg button.on { background: var(--accent-soft); color: var(--accent); }
.fchip { display: inline-flex; gap: 6px; align-items: center; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 3px 6px 3px 10px; font-size: 12px; }
.fchip button { border: 0; background: none; color: inherit; cursor: pointer; padding: 0 3px; }
.scan-banner { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; display: flex; gap: 12px; align-items: center; }
.bar { flex: 1; height: 6px; border-radius: 3px; background: var(--panel-2); overflow: hidden; }
.bar > div { height: 100%; background: var(--accent); transition: width .3s; }

/* cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; cursor: pointer; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 7px; transition: transform .12s, border-color .12s; min-width: 0; }
.card:hover { border-color: var(--ink-3); transform: translateY(-1px); }
.card-head { display: flex; gap: 10px; align-items: flex-start; }
.rating { flex: none; width: 26px; height: 26px; border-radius: 6px; color: #fff; font: 700 12px var(--ui); display: grid; place-items: center; margin-top: 2px; }
.rating.G { background: var(--r-g); } .rating.T { background: var(--r-t); } .rating.M { background: var(--r-m); }
.rating.E { background: var(--r-e); } .rating.N { background: var(--r-n); }
.card h3 { margin: 0; font: 600 17px/1.25 var(--serif); overflow-wrap: anywhere; }
.byline { color: var(--ink-2); font-size: 13px; }
.fandom { color: var(--ink-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rel { font-weight: 600; font-size: 13px; color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.chip { line-height: 1.35; background: var(--chip); color: var(--ink-2); border-radius: 6px; padding: 2px 7px; font-size: 12px; border: 0; cursor: pointer; text-align: left; }
.chip:hover { background: var(--accent-soft); color: var(--accent); }
.chip.more { background: transparent; color: var(--ink-3); cursor: default; }
.summary { color: var(--ink-2); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.meta-row { display: flex; gap: 12px; flex-wrap: wrap; color: var(--ink-3); font-size: 12px; margin-top: auto; padding-top: 6px; border-top: 1px dashed var(--line); align-items: center; }
.meta-row .dl { color: var(--r-g); font-weight: 600; }
.meta-row .wip { color: var(--r-t); font-weight: 600; }
.meta-row .err { color: var(--r-e); }
.meta-row .fav { color: var(--accent); }
.pbar { height: 3px; background: var(--panel-2); border-radius: 2px; overflow: hidden; }
.pbar > div { height: 100%; background: var(--accent); }

/* rows view */
.rows { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--panel); }
.rows .card { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; display: grid;
  grid-template-columns: 26px minmax(200px, 2fr) minmax(150px, 1.4fr) minmax(150px, 1.4fr) 230px; gap: 14px; align-items: center; padding: 10px 14px; transform: none; }
.rows .card:hover { background: var(--panel-2); }
.rows .card h3 { font-size: 15px; }
.rows .summary, .rows .chips.tags, .rows .card-head .rating, .rows .pbar { display: none; }
.rows .card-head { display: contents; }
.rows .meta-row { border: 0; padding: 0; margin: 0; justify-content: flex-end; gap: 6px; }
.rows .rating-cell { display: grid; }
.rating-cell { display: none; }
.rows .col-main, .rows .col-rel, .rows .col-fan { min-width: 0; }
.rows .col-rel .chips { display: none; }
.rows .fandom { white-space: normal; }
.more { height: 40px; }
.empty { text-align: center; padding: 80px 20px; color: var(--ink-2); }
.empty h2 { font: 600 24px var(--serif); color: var(--ink); }

/* drawer */
.scrim { position: fixed; inset: 0; background: rgba(20,15,10,.35); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(600px, 100vw); background: var(--panel); z-index: 50; overflow-y: auto;
  transform: translateX(100%); visibility: hidden; transition: transform .2s ease, visibility 0s .2s; box-shadow: -8px 0 30px rgba(0,0,0,.15); }
.drawer.open { transform: none; visibility: visible; transition: transform .2s ease; }
.d-head { position: sticky; top: 0; background: var(--panel); padding: 18px 24px 14px; border-bottom: 1px solid var(--line); z-index: 1; }
.d-head h2 { margin: 6px 0 2px; font: 600 26px/1.2 var(--serif); padding-right: 30px; }
.d-close { position: absolute; top: 14px; right: 14px; }
.d-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.d-body { padding: 18px 24px 40px; }
.d-sec { margin-bottom: 18px; }
.d-sec h4 { margin: 0 0 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.d-summary { font: 15px/1.6 var(--serif); color: var(--ink); white-space: pre-line; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.stat { background: var(--panel-2); border-radius: 8px; padding: 8px 10px; }
.stat b { display: block; font-size: 15px; }
.stat span { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.muted { color: var(--ink-3); }
.file-info { font-size: 12px; color: var(--ink-3); overflow-wrap: anywhere; }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(20,15,10,.4); z-index: 60; display: grid; place-items: start center; padding: 6vh 16px; overflow-y: auto; }
.modal-card { background: var(--panel); border-radius: 14px; width: min(720px, 100%); padding: 20px 24px 24px; box-shadow: var(--shadow); }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.modal-head h2, .modal-card h3 { font-family: var(--serif); margin: 0; }
.modal-card h3 { margin-top: 22px; margin-bottom: 8px; }
.add-source { display: flex; gap: 8px; margin-top: 14px; }
.add-source input { flex: 1; padding: 9px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); min-width: 0; }
.hint { color: var(--ink-3); font-size: 12px; margin: 6px 0 12px; }
.src { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.src-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.src-name { font-weight: 600; overflow-wrap: anywhere; }
.src-msg { font-size: 12px; color: var(--ink-2); margin: 6px 0; }
.src-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.src-btns .btn { padding: 4px 10px; font-size: 12px; }
.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 18px; text-align: center; display: flex; flex-direction: column; gap: 4px; color: var(--ink-2); margin-top: 16px; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.link { color: var(--accent); cursor: pointer; text-decoration: underline; }
.settings { display: grid; gap: 12px; }
.settings label { display: grid; gap: 4px; font-weight: 600; font-size: 13px; }
.settings input, .settings select { padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); font-weight: 400; }
.cache-use { font-size: 12px; color: var(--ink-3); margin-top: -6px; }

/* reader */
.reader { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; --rbg: #fbf8f2; --rink: #2a241d; background: var(--rbg); color: var(--rink); }
.reader[data-rt="sepia"] { --rbg: #f1e7d0; --rink: #3b2f1e; }
.reader[data-rt="dark"] { --rbg: #121110; --rink: #d9d2c5; }
.reader-bar { display: flex; align-items: center; gap: 12px; padding: 8px 16px; border-bottom: 1px solid color-mix(in srgb, var(--rink) 14%, transparent); }
.reader-bar .btn, .reader-bar select, .reader-bar .seg { background: transparent; border-color: color-mix(in srgb, var(--rink) 20%, transparent); color: var(--rink); }
.reader-bar .icon-btn { color: var(--rink); }
.reader-bar .seg button.on { background: color-mix(in srgb, var(--rink) 12%, transparent); color: var(--rink); }
.reader-title { flex: 1; font: 600 15px var(--serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.reader-tools { display: flex; gap: 6px; align-items: center; }
.reader-tools select { max-width: 200px; }
.reader-progress { height: 2px; background: transparent; }
.reader-progress > div { height: 100%; width: 0; background: var(--accent); }
.reader-scroll { flex: 1; overflow-y: auto; }
.book { max-width: 680px; margin: 0 auto; padding: 40px 24px 120px; font: var(--fs, 19px)/1.7 var(--serif); }
.book h1, .book h2, .book h3 { font-family: var(--serif); line-height: 1.25; }
.book .chapter { padding-bottom: 40px; margin-bottom: 40px; border-bottom: 1px solid color-mix(in srgb, var(--rink) 12%, transparent); }
.book p { margin: 0 0 1em; }
.book blockquote { margin: 1em 0; padding-left: 1em; border-left: 3px solid color-mix(in srgb, var(--rink) 20%, transparent); }
.book img { max-width: 100%; height: auto; }
.book a { color: inherit; }
.book dl.tags, .book dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: .8em; }
.book dt { font-weight: 700; }
.book dd { margin: 0; }
.book hr { border: 0; border-top: 1px solid color-mix(in srgb, var(--rink) 20%, transparent); margin: 2em 0; }
.pdf-frame { flex: 1; border: 0; width: 100%; background: #525659; }
.loading { display: grid; place-items: center; height: 60vh; font: 16px var(--serif); opacity: .7; text-align: center; padding: 20px; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 10px; z-index: 100; box-shadow: var(--shadow); max-width: 90vw; }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; top: 57px; left: 0; bottom: 0; width: 280px; background: var(--bg); z-index: 30; transform: translateX(-100%); transition: transform .2s; height: auto; }
  .sidebar.open { transform: none; box-shadow: var(--shadow); }
  .only-narrow { display: inline-block; }
  .main { padding: 12px 16px 60px; }
  .top { padding: 10px 16px; gap: 10px; flex-wrap: wrap; }
  .search { order: 5; flex-basis: 100%; max-width: none; }
  .layout { min-height: calc(100vh - 105px); }
  .sidebar { top: 105px; }
  .cards { grid-template-columns: 1fr; }
  .rows .card { grid-template-columns: 26px 1fr; }
  .rows .col-rel, .rows .col-fan { display: none; }
  .rows .meta-row { grid-column: 2; justify-content: flex-start; }
  .reader-tools select { max-width: 110px; }
  .reader-title { display: none; }
}


/* ================= Blossom theme ================= */
body {
  background:
    radial-gradient(900px 600px at -10% -10%, var(--blob1), transparent 60%),
    radial-gradient(800px 600px at 110% 10%, var(--blob2), transparent 60%),
    radial-gradient(900px 700px at 50% 120%, var(--blob3), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .5;
  background-image: var(--pattern);
}
.top, .layout, .modal, .drawer, .scrim, .reader, .toast { position: relative; z-index: 1; }
.top { position: sticky; z-index: 20; background: color-mix(in srgb, var(--panel) 72%, transparent); border-bottom: 1px solid var(--line); }
.drawer { position: fixed; z-index: 50; } .scrim { position: fixed; z-index: 40; } .modal { position: fixed; z-index: 60; }
.reader { position: fixed; z-index: 70; } .toast { position: fixed; z-index: 100; }
.brand { display: inline-flex; align-items: center; gap: 0; font: 700 25px/1 var(--serif); font-style: italic; letter-spacing: -.02em; }
.brand span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand::before { content: ""; width: 28px; height: 28px; flex: none; margin-right: 8px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-14 -14 28 28'%3E%3Cg fill='%23f0508a'%3E%3Ccircle cx='0' cy='-6.5' r='5.5'/%3E%3Ccircle cx='6.2' cy='-2' r='5.5'/%3E%3Ccircle cx='3.8' cy='5.3' r='5.5'/%3E%3Ccircle cx='-3.8' cy='5.3' r='5.5'/%3E%3Ccircle cx='-6.2' cy='-2' r='5.5'/%3E%3C/g%3E%3Ccircle r='3.4' fill='%23ffd166'/%3E%3C/svg%3E") center/contain no-repeat; }
.search input { border-radius: 999px; padding: 10px 18px; background: var(--panel); border-color: var(--line); box-shadow: inset 0 1px 2px color-mix(in srgb, var(--accent) 6%, transparent); }
.btn { border-radius: 999px; border-color: var(--line); }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--grad); border: 0; color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn.primary:hover { color: #fff; filter: brightness(1.05) saturate(1.1); }
.icon-btn:hover { background: var(--accent-soft); color: var(--accent); }
.sidebar { background: color-mix(in srgb, var(--panel) 55%, transparent); }
.shelves a { border-radius: 999px; }
.shelves a.on { background: var(--grad); color: #fff; box-shadow: 0 3px 10px color-mix(in srgb, var(--accent) 30%, transparent); }
.shelves a.on .n { color: rgba(255,255,255,.85); }
.facet h4 { color: var(--accent); }
.seg { border-radius: 999px; }
.seg button.on { background: var(--grad); color: #fff; }
.fchip { background: var(--grad); color: #fff; }
.count { font: 600 italic 20px var(--serif); }

.card { border-radius: 18px; border: 1px solid var(--line); position: relative; overflow: hidden; padding-top: 18px; }
.card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: var(--grad); }
.card:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); transform: translateY(-3px); box-shadow: 0 14px 34px color-mix(in srgb, var(--accent) 18%, transparent); }
.card h3 { font: 600 19px/1.2 var(--serif); }
.rating { border-radius: 50%; box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.rating.G { background: var(--r-g); } .rating.T { background: var(--r-t); } .rating.M { background: var(--r-m); } .rating.E { background: var(--r-e); } .rating.N { background: var(--r-n); }
.rel { color: var(--c-rel); }
.fandom { color: var(--c-fan); font-weight: 500; }
.chip { border-radius: 999px; padding: 2px 9px; }
.chip[data-f="characters"] { background: var(--c-char-bg); color: var(--c-char); }
.chip[data-f="tags"] { background: var(--c-tag-bg); color: var(--c-tag); }
.chip[data-f="relationships"] { background: var(--c-rel-bg); color: var(--c-rel); }
.chip[data-f="fandoms"] { background: var(--c-fan-bg); color: var(--c-fan); }
.chip[data-f="warnings"] { background: var(--c-warn-bg); color: var(--c-warn); }
.chip:hover { background: var(--grad) !important; color: #fff !important; }
.chip.more:hover { background: transparent !important; color: var(--ink-3) !important; }
.meta-row { border-top: 1px dashed var(--line); }
.meta-row .dl { color: var(--r-g); } .meta-row .fav { color: var(--accent); }
.pbar > div, .bar > div, .reader-progress > div { background: var(--grad); }
.rows { border-radius: 18px; }
.rows .card { border-radius: 0; padding-top: 10px; }
.rows .card::before { top: 0; bottom: 0; left: 0; right: auto; width: 4px; height: auto; }
.rows .card:hover { transform: none; box-shadow: none; }
.drawer { border-left: 1px solid var(--line); }
.d-head { background: linear-gradient(180deg, var(--accent-soft), var(--panel)); }
.d-head h2 { font: 700 30px/1.15 var(--serif); }
.d-sec h4 { color: var(--accent); }
.d-summary { font-family: var(--read); }
.stat { background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; }
.stat b { font-family: var(--serif); font-size: 18px; color: var(--accent); }
.modal-card { border-radius: 22px; border: 1px solid var(--line); }
.modal-head h2 { font-style: italic; }
.drop { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: 18px; background: var(--panel-2); }
.empty h2 { font-style: italic; }
.toast { background: var(--grad); color: #fff; border-radius: 999px; }

/* reader: wide like AO3, width switchable */
.reader { --rbg: var(--r-paper); --rink: var(--r-paper-ink); }
.reader[data-rt="sepia"] { --rbg: #f4e8cf; --rink: #3b2f1e; }
.reader[data-rt="dark"] { --rbg: var(--r-night); --rink: var(--r-night-ink); }
.reader-bar { background: color-mix(in srgb, var(--rbg) 90%, var(--accent) 10%); }
.reader-title { font-style: italic; font-size: 17px; }
.book { max-width: none; width: 100%; padding: 32px max(24px, 5vw) 120px; font-family: var(--read); }
.reader[data-rw="wide"] .book { max-width: 1040px; }
.reader[data-rw="narrow"] .book { max-width: 720px; }
.book h1, .book h2, .book h3 { color: color-mix(in srgb, var(--rink) 70%, var(--accent)); }

/* filters on the right */
.layout { grid-template-columns: minmax(0, 1fr) 280px; }
.sidebar { order: 2; border-right: 0; border-left: 1px solid var(--line); }
.main { order: 1; }
/* header search with button */
.search { display: flex; gap: 8px; align-items: center; }
.search input { flex: 1; min-width: 0; }
.search-btn { padding: 9px 18px; }
/* find in story */
.reader-find { display: flex; align-items: center; gap: 4px; }
.reader-find input { width: 200px; padding: 6px 12px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--rink) 22%, transparent); background: color-mix(in srgb, var(--rbg) 80%, #fff 20%); color: var(--rink); outline: none; }
.reader-find input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.find-count { font-size: 12px; opacity: .75; min-width: 56px; text-align: center; font-variant-numeric: tabular-nums; }
.book mark.hl { background: var(--hl); color: #1d1420; border-radius: 3px; padding: 0 1px; }
.book mark.hl.cur { background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 2px var(--accent); }
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { left: auto; right: 0; transform: translateX(100%); border-left: 1px solid var(--line); background: var(--bg); }
  .sidebar.open { transform: none; }
  .reader-bar { flex-wrap: wrap; }
  .reader-find { order: 5; flex-basis: 100%; }
  .reader-find input { flex: 1; width: auto; }
}

/* ================= theme switcher + extra flourishes ================= */
.brand span { background: var(--grad-2); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 6s ease-in-out infinite alternate; }
@keyframes shimmer { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
.brand::before { -webkit-mask: var(--brand-mask) center/contain no-repeat; mask: var(--brand-mask) center/contain no-repeat; background: var(--grad); }
:root { --brand-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-14 -14 28 28'%3E%3Cg fill='%23000'%3E%3Ccircle cx='0' cy='-6.5' r='5.5'/%3E%3Ccircle cx='6.2' cy='-2' r='5.5'/%3E%3Ccircle cx='3.8' cy='5.3' r='5.5'/%3E%3Ccircle cx='-3.8' cy='5.3' r='5.5'/%3E%3Ccircle cx='-6.2' cy='-2' r='5.5'/%3E%3C/g%3E%3C/svg%3E"); }
:root[data-theme="lavender"], :root[data-theme="celadon"], :root[data-theme="sunset"] { --brand-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-15 -15 30 30'%3E%3Cpath d='M0 -14 C2 -4 4 -2 14 0 C4 2 2 4 0 14 C-2 4 -4 2 -14 0 C-4 -2 -2 -4 0 -14Z'/%3E%3C/svg%3E"); }
:root[data-theme="matcha"] { --brand-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'%3E%3Cpath d='M4 24 C4 10 12 4 25 3 C24 16 18 24 4 24Z'/%3E%3C/svg%3E"); }
.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--grad-2); opacity: .7; }
.btn.primary { background: var(--grad); background-size: 160% 160%; color: var(--accent-ink); transition: background-position .4s, transform .15s; }
.btn.primary:hover { background-position: 100% 100%; transform: translateY(-1px); color: var(--accent-ink); }
.shelves a.on { color: var(--accent-ink); } .shelves a.on .n { color: color-mix(in srgb, var(--accent-ink) 80%, transparent); }
.seg button.on, .fchip, .toast { color: var(--accent-ink); }
.chip:hover { color: var(--accent-ink) !important; }
.card::before { background: var(--grad); }
.d-head { background: linear-gradient(180deg, color-mix(in srgb, var(--accent-soft) 85%, transparent), var(--panel)); }
.d-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--grad-2); }
.count { background: var(--grad-2); -webkit-background-clip: text; background-clip: text; color: transparent; }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }
* { scrollbar-color: color-mix(in srgb, var(--accent) 45%, transparent) transparent; }

.theme-btn { display: inline-flex; align-items: center; gap: 8px; }
.theme-btn .sw { width: 18px; height: 18px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 0 2px var(--panel), 0 0 0 3px var(--line); }
.theme-pop { position: absolute; top: 58px; right: 16px; z-index: 30; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 16px; width: min(380px, calc(100vw - 32px));
  box-shadow: 0 20px 50px color-mix(in srgb, var(--ink) 22%, transparent); display: grid; gap: 10px; }
.theme-pop h3 { margin: 0 0 2px; font: 600 italic 20px var(--serif); }
.theme-opt { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; padding: 8px; border-radius: 16px; border: 2px solid transparent; background: none; cursor: pointer; text-align: left; color: var(--ink); }
.theme-opt:hover { background: var(--panel-2); }
.theme-opt.on { border-color: var(--accent); background: var(--accent-soft); }
.theme-opt .pv { height: 48px; border-radius: 12px; position: relative; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.theme-opt .dots { position: absolute; left: 6px; bottom: 6px; display: flex; gap: 3px; }
.theme-opt .dots i { width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 1.5px rgba(255,255,255,.8); }
.theme-opt b { display: block; font: 600 16px var(--serif); }
.theme-opt small { color: var(--ink-3); font-size: 12px; }

/* reader flourishes: soft, theme-tinted */
.reader-bar { position: relative; background: color-mix(in srgb, var(--rbg) 88%, var(--accent) 12%); }
.reader-bar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--grad-2); opacity: .8; }
.reader-progress { height: 3px; } .reader-progress > div { background: var(--grad-2); box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 60%, transparent); }
.reader-scroll { background:
  radial-gradient(700px 400px at 100% 0%, color-mix(in srgb, var(--blob1) 50%, transparent), transparent 70%),
  radial-gradient(700px 400px at 0% 100%, color-mix(in srgb, var(--blob3) 50%, transparent), transparent 70%), var(--rbg); }
.reader[data-rt="sepia"] .reader-scroll { background: var(--rbg); }
.book h1, .book h2 { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.reader[data-rt="dark"] .book h1, .reader[data-rt="dark"] .book h2 { background: var(--grad-2); -webkit-background-clip: text; background-clip: text; }
.book .chapter { border-bottom: 0; position: relative; }
.book .chapter::after { content: "✦  ✿  ✦"; display: block; text-align: center; letter-spacing: .6em; margin-top: 40px; font-size: 14px;
  background: var(--grad-2); -webkit-background-clip: text; background-clip: text; color: transparent; }
.book .chapter:last-child::after { content: none; }
.book blockquote { border-left: 3px solid; border-image: var(--grad) 1; }
.book ::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.reader-find input:focus { border-color: var(--accent); }
.reader-bar .seg button.on { background: var(--grad); color: var(--accent-ink); }

/* web build */
.pdf-page { background: #fff; margin: 0 auto 18px; box-shadow: 0 4px 18px color-mix(in srgb, var(--ink) 18%, transparent); border-radius: 6px; overflow: hidden; padding: 0 !important; }
.pdf-page canvas { display: block; width: 100%; height: auto; }
.book .pdf-page.chapter::after { content: none; }
.hint.warn { color: var(--r-e); font-weight: 600; }
.backup { display: grid; gap: 6px; margin-top: 8px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 13px; }
.backup label.btn { display: inline-block; font-weight: 400; }
.foot { position: relative; z-index: 1; text-align: center; font-size: 12px; color: var(--ink-3); padding: 18px 16px 28px; }

/* rating badges: one colour, follows the theme */
.rating, .rating.G, .rating.T, .rating.M, .rating.E, .rating.N { background: var(--grad); color: var(--accent-ink); }


/* ================= Ruby Mocha (default theme) ================= */
:root, :root[data-theme="ruby"] {
  color-scheme: only light;
  --bg: #f2ebe9; --panel: #fcf9f8; --panel-2: #efe6e4; --ink: #482C3D; --ink-2: #735453; --ink-3: #9b8189;
  --line: #e2d4d3; --accent: #8B445C; --accent-2: #A38893; --accent-ink: #ffffff; --accent-soft: #f1e1e6; --chip: #ede3e2;
  --grad: linear-gradient(135deg, #482C3D 0%, #8B445C 55%, #A38893 100%); --grad-2: linear-gradient(90deg, #8B445C, #A38893, #735453);
  --shadow: 0 1px 2px rgba(72,44,61,.06), 0 8px 24px rgba(72,44,61,.08);
  --c-char-bg: #ece3ea; --c-char: #6b4a5f; --c-tag-bg: #efe4e1; --c-tag: #735453;
  --c-rel-bg: #f2dfe5; --c-rel: #8B445C; --c-fan-bg: #e9e1e6; --c-fan: #482C3D; --c-warn-bg: #f6e9cf; --c-warn: #7a5a00;
  --blob1: rgba(139,68,92,.16); --blob2: rgba(163,136,147,.24); --blob3: rgba(115,84,83,.14);
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg opacity='.16'%3E%3Cg transform='translate%2840 50%29 scale%281%29'%3E%3Ccircle cx='0' cy='-9' r='7' fill='%23A38893'/%3E%3Ccircle cx='8.5' cy='-2.8' r='7' fill='%23A38893'/%3E%3Ccircle cx='5.3' cy='7.3' r='7' fill='%23A38893'/%3E%3Ccircle cx='-5.3' cy='7.3' r='7' fill='%23A38893'/%3E%3Ccircle cx='-8.5' cy='-2.8' r='7' fill='%23A38893'/%3E%3Ccircle r='4' fill='%23E6DCDB'/%3E%3C/g%3E%3Cg transform='translate%28160 150%29 scale%280.7%29'%3E%3Ccircle cx='0' cy='-9' r='7' fill='%238B445C'/%3E%3Ccircle cx='8.5' cy='-2.8' r='7' fill='%238B445C'/%3E%3Ccircle cx='5.3' cy='7.3' r='7' fill='%238B445C'/%3E%3Ccircle cx='-5.3' cy='7.3' r='7' fill='%238B445C'/%3E%3Ccircle cx='-8.5' cy='-2.8' r='7' fill='%238B445C'/%3E%3Ccircle r='4' fill='%23E6DCDB'/%3E%3C/g%3E%3Cg transform='translate%28170 40%29 scale%280.45%29'%3E%3Ccircle cx='0' cy='-9' r='7' fill='%23735453'/%3E%3Ccircle cx='8.5' cy='-2.8' r='7' fill='%23735453'/%3E%3Ccircle cx='5.3' cy='7.3' r='7' fill='%23735453'/%3E%3Ccircle cx='-5.3' cy='7.3' r='7' fill='%23735453'/%3E%3Ccircle cx='-8.5' cy='-2.8' r='7' fill='%23735453'/%3E%3Ccircle r='4' fill='%23E6DCDB'/%3E%3C/g%3E%3Cpath transform='translate%2870 160%29 rotate%280%29' d='M0 0 q10 -14 22 -6 q-8 12 -22 6z' fill='%23735453'/%3E%3Cpath transform='translate%28118 78%29 rotate%28-25%29' d='M0 0 q10 -14 22 -6 q-8 12 -22 6z' fill='%23A38893'/%3E%3C/g%3E%3C/svg%3E");
  --r-paper: #fbf7f5; --r-paper-ink: #482C3D; --r-night: #24161f; --r-night-ink: #eadcdc; --hl: #ecc6d2;
}
/* AO3-style header bar for Ruby Mocha */
:root:not([data-theme]) .top, :root[data-theme="ruby"] .top { background: linear-gradient(90deg, #482C3D, #8B445C); border-bottom: 0; color: #fff; }
:root:not([data-theme]) .top .brand, :root[data-theme="ruby"] .top .brand { color: #fff; }
:root:not([data-theme]) .top .brand span, :root[data-theme="ruby"] .top .brand span { background: linear-gradient(90deg, #E6DCDB, #f3c9d6, #E6DCDB); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; }
:root:not([data-theme]) .top .brand::before, :root[data-theme="ruby"] .top .brand::before { background: #E6DCDB; }
:root:not([data-theme]) .top .btn, :root[data-theme="ruby"] .top .btn { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.3); color: #fff; }
:root:not([data-theme]) .top .btn.primary, :root[data-theme="ruby"] .top .btn.primary { background: #E6DCDB; color: #482C3D; box-shadow: none; }
:root:not([data-theme]) .top .icon-btn, :root[data-theme="ruby"] .top .icon-btn { color: #fff; }
:root:not([data-theme]) .top::after, :root[data-theme="ruby"] .top::after { background: linear-gradient(90deg, #A38893, #E6DCDB, #A38893); opacity: .6; }

/* ================= AO3-style list: one box per fic ================= */
.blurbs { display: flex; flex-direction: column; gap: 14px; }
.card.blurb { display: block; padding: 16px 20px 12px; border-radius: 14px; cursor: pointer; }
.card.blurb:hover { transform: none; }
.card.blurb::before { height: 4px; }
.b-head { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: start; }
.req { list-style: none; margin: 2px 0 0; padding: 0; display: grid; grid-template-columns: 24px 24px; gap: 3px; }
.req .sq { width: 24px; height: 24px; border-radius: 5px; display: grid; place-items: center; font: 700 10.5px/1 var(--ui); color: #fff; letter-spacing: -.02em; }
.sq-r { background: var(--accent); } .sq-c { background: var(--c-char); }
.sq-w { background: var(--ink-2); } .sq-s { background: var(--accent-2); }
.b-title h3 { margin: 0; font: 600 19px/1.25 var(--serif); color: var(--accent); }
.b-title .by { font: 400 14px var(--ui); color: var(--ink-2); }
.b-title .by b { color: var(--ink); font-weight: 600; }
.b-date { font-size: 12px; color: var(--ink-3); white-space: nowrap; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.b-date .fav { color: var(--accent); } .b-date .dl { color: var(--r-g); font-weight: 600; }
.b-fandoms, .b-tags { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 2px 0; }
.b-fandoms li, .b-tags li { display: inline; font-size: 13px; }
.b-fandoms li:not(:last-child)::after, .b-tags li:not(:last-child)::after { content: ","; color: var(--ink-3); margin-right: 6px; }
.b-tags { margin-top: 10px; }
.card.blurb .chip.tagl { all: unset; cursor: pointer; border-bottom: 1px dotted currentColor; line-height: 1.5; }
.card.blurb .chip.tagl:hover { background: none !important; color: var(--accent) !important; border-bottom-style: solid; }
.b-fandoms .tagl { color: var(--ink-2); font-weight: 500; }
.b-tags .warn .tagl { color: var(--c-warn); font-weight: 700; }
.b-tags .rel .tagl { color: var(--c-rel); font-weight: 600; }
.b-tags .char .tagl { color: var(--c-char); }
.b-tags .free .tagl { color: var(--ink-2); }
.b-tags .more-tags { color: var(--ink-3); font-size: 12px; }
.b-summary { margin: 12px 0 0; padding: 2px 0 2px 14px; border-left: 3px solid; border-image: var(--grad) 1; font: 14.5px/1.6 var(--read); color: var(--ink); white-space: pre-line;
  display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.b-series { margin: 8px 0 0; font-size: 13px; color: var(--ink-2); }
.b-pending { margin: 10px 0 0; font-size: 13px; color: var(--ink-2); }
.b-stats { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px 6px; margin: 12px 0 0; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--ink-3); }
.b-stats dt { font-weight: 600; color: var(--ink-2); } .b-stats dd { margin: 0 10px 0 0; }
@media (max-width: 640px) {
  .b-head { grid-template-columns: auto 1fr; }
  .b-date { grid-column: 1 / -1; flex-direction: row; justify-content: flex-start; gap: 10px; }
  .card.blurb { padding: 14px 14px 10px; }
}

/* ================= simpler Add fics popup ================= */
.src-card { width: min(560px, 100%); }
.src-card .add-source { margin-top: 12px; }
.src { padding: 10px 12px; margin: 10px 0 0; border-radius: 12px; }
.src-row { display: flex; align-items: center; gap: 10px; }
.src-main { flex: 1; min-width: 0; }
.src-name { font-weight: 600; color: var(--ink); text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src-name:hover { color: var(--accent); }
.src-msg { margin: 2px 0 0; font-size: 12px; color: var(--ink-3); }
.src-btns { display: flex; align-items: center; gap: 4px; flex: none; }
.src-btns .btn { padding: 5px 12px; font-size: 13px; }
.src .bar { margin-top: 8px; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; }
.src-card .drop { display: block; cursor: pointer; padding: 14px; margin-top: 14px; font-size: 13px; }
.src-card .drop b { color: var(--accent); }
details.more { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
details.more summary { cursor: pointer; color: var(--ink-2); font-size: 13px; font-weight: 600; list-style: none; }
details.more summary::before { content: "▸ "; } details.more[open] summary::before { content: "▾ "; }
details.more .settings { margin-top: 12px; }
.b-fandoms, .b-tags { display: block; line-height: 1.7; }
.b-fandoms li, .b-tags li { white-space: normal; }
.card.blurb .chip.tagl { display: inline; }
@media (max-width: 860px) {
  .sidebar { top: var(--top-h, 57px) !important; bottom: 0; height: auto !important; box-shadow: -10px 0 30px rgba(0,0,0,.18); }
}

.modal { display: block; }
.modal-card { margin: 0 auto; }

.more-opts { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.more-toggle { border: 0; background: none; padding: 0; cursor: pointer; color: var(--ink-2); font-size: 13px; font-weight: 600; }
.more-opts .settings { margin-top: 12px; }


/* ================= include / exclude filters ================= */
.frow { display: grid; grid-template-columns: 20px 1fr auto 22px; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 8px; font-size: 13.5px; line-height: 1.35; color: var(--ink-2); }
.frow:hover { background: var(--panel-2); }
.frow .t { cursor: pointer; overflow-wrap: anywhere; }
.frow .n { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.fbtn { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line); background: var(--panel); display: grid; place-items: center; padding: 0; cursor: pointer; font-size: 11px; line-height: 1; color: transparent; }
.fbtn.inc-btn:hover { border-color: var(--accent); }
.fbtn.exc-btn { border-color: transparent; background: transparent; color: var(--ink-3); opacity: 0; transition: opacity .15s; }
.frow:hover .exc-btn, .exc-btn:focus-visible { opacity: 1; }
.fbtn.exc-btn:hover { color: var(--r-e); background: color-mix(in srgb, var(--r-e) 12%, transparent); }
.frow.inc { color: var(--ink); font-weight: 600; }
.frow.inc .inc-btn { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.frow.exc .t { text-decoration: line-through; color: var(--r-e); }
.frow.exc .n { color: var(--r-e); }
.frow.exc .exc-btn { opacity: 1; color: #fff; background: var(--r-e); border-color: var(--r-e); }
.fchip.exc { background: color-mix(in srgb, var(--r-e) 14%, var(--panel)); color: var(--r-e); }
@media (hover: none) { .fbtn.exc-btn { opacity: .6; } }

/* ================= reading settings panel ================= */
.reader-bar { gap: 14px; padding: 8px 18px; min-height: 56px; }
.reader-bar .btn { padding: 6px 14px; }
.reader-tools { gap: 10px; }
.reader-tools select { max-width: 230px; padding: 6px 10px; border-radius: 999px; }
.aa-btn { font: 600 15px var(--serif) !important; padding: 5px 14px !important; }
.aa-pop { position: absolute; top: 60px; right: 16px; z-index: 5; width: min(380px, calc(100vw - 24px)); background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; display: grid; gap: 14px; box-shadow: 0 18px 50px rgba(0,0,0,.18); font: 14px var(--ui); }
.aa-pop .aa-text { display: grid; gap: 14px; }
.aa-row { display: grid; gap: 6px; }
.aa-lbl { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.aa-pop .seg { display: flex; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); padding: 3px; gap: 3px; }
.aa-pop .seg button { flex: 1; border-radius: 8px; padding: 7px 6px; font-size: 13px; color: var(--ink-2); background: transparent; }
.aa-pop .seg button.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); font-weight: 600; }
.aa-pop .f-serif { font-family: "Lora", Georgia, serif !important; } .aa-pop .f-classic { font-family: Georgia, "Times New Roman", serif !important; }
.aa-pop .f-sans { font-family: "DM Sans", sans-serif !important; } .aa-pop .f-easy { font-family: "Atkinson Hyperlegible", sans-serif !important; }
.aa-size { display: flex; align-items: center; gap: 10px; }
.aa-size .btn { flex: 1; border-radius: 10px; }
.aa-size span { min-width: 34px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }
.aa-check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; padding: 10px 12px; border-radius: 12px; background: var(--panel-2); }
.aa-check input { margin-top: 3px; accent-color: var(--accent); }
.aa-check small { display: block; color: var(--ink-3); font-size: 12px; margin-top: 2px; }
@media (max-width: 860px) { .aa-pop { position: fixed; top: auto; bottom: 12px; left: 12px; right: 12px; width: auto; } }

/* the book itself */
.book { line-height: var(--lh, 1.75); }
.book p { margin: 0 0 1.05em; }
.reader[data-font="serif"] .book { font-family: "Lora", Georgia, serif; }
.reader[data-font="classic"] .book { font-family: Georgia, "Times New Roman", serif; }
.reader[data-font="sans"] .book { font-family: "DM Sans", -apple-system, sans-serif; }
.reader[data-font="easy"] .book { font-family: "Atkinson Hyperlegible", -apple-system, sans-serif; letter-spacing: .01em; }
.reader[data-align="justify"] .book p { text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.reader[data-rw="narrow"] .book { max-width: 680px; }
.reader[data-rw="wide"] .book { max-width: 920px; }
.reader[data-rw="full"] .book { max-width: none; }
.reader.plain .book *:not(h1):not(h2):not(h3) { font-family: inherit !important; font-size: inherit !important; color: inherit !important; background: none !important; letter-spacing: normal !important; }
.reader.plain .book p, .reader.plain .book div, .reader.plain .book center { text-align: left !important; }
.reader.plain[data-align="justify"] .book p { text-align: justify !important; }
.reader.plain .book center { display: block; }

/* ================= typography & spacing polish ================= */
body { font-size: 15px; line-height: 1.5; text-rendering: optimizeLegibility; font-feature-settings: "kern", "liga"; }
h1, h2, h3, h4 { text-wrap: balance; }
p, blockquote, .summary, .d-summary, .b-summary { text-wrap: pretty; }
.top { gap: 14px; padding: 10px 20px; }
.main { padding: 18px 28px 64px; }
.toolbar { margin-bottom: 16px; min-height: 36px; }
.count { font-size: 22px; line-height: 1; }
.sidebar { padding: 18px 16px 48px; }
.shelves a { padding: 7px 12px; font-size: 14px; }
.facet { margin-top: 22px; }
.facet h4 { font-size: 11.5px; margin-bottom: 8px; padding: 0 6px; }
.facet input[data-fsearch] { margin: 0 0 6px; font-size: 13px; padding: 6px 10px; border-radius: 8px; }
.facet .more-btn { padding: 4px 6px; font-size: 12.5px; }
.card.blurb { padding: 18px 22px 14px; }
.b-title h3 { font-size: 20px; line-height: 1.25; }
.b-title .by { font-size: 14.5px; }
.b-fandoms li { font-size: 13.5px; }
.b-tags li { font-size: 13.5px; }
.b-tags { line-height: 1.75; }
.b-summary { font-size: 15px; line-height: 1.65; margin-top: 14px; }
.b-stats { font-size: 12.5px; gap: 4px 6px; }
.card h3 { line-height: 1.3; }
.summary { font-size: 14px; line-height: 1.55; }
.drawer .d-head { padding: 22px 28px 16px; }
.drawer .d-body { padding: 20px 28px 48px; }
.d-sec { margin-bottom: 22px; }
.d-sec h4 { font-size: 11.5px; margin-bottom: 8px; }
.d-summary { font-size: 16px; line-height: 1.7; }
.d-actions { gap: 10px; margin-top: 14px; }
.modal-card { padding: 22px 26px 24px; }
.src-msg, .cache-use { line-height: 1.45; }
.foot { font-size: 12.5px; line-height: 1.5; max-width: 640px; margin: 0 auto; }
@media (max-width: 860px) { .main { padding: 14px 14px 56px; } .card.blurb { padding: 16px 16px 12px; } .b-title h3 { font-size: 18px; } }

.nomatch { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 70px 20px; color: var(--ink-2); }
.nomatch b { font: 600 italic 22px var(--serif); color: var(--ink); }
.nomatch .btn { margin-top: 8px; }
@media (max-width: 860px) {
  .reader-bar { flex-wrap: wrap; row-gap: 8px; padding: 8px 12px; }
  .reader-tools { margin-left: auto; gap: 6px; min-width: 0; }
  .reader-tools select { max-width: 120px; padding: 6px 8px; }
  .reader-bar .seg button { padding: 5px 8px; font-size: 12.5px; }
  .reader-bar .btn { padding: 6px 10px; }
  .reader-find { order: 5; flex-basis: 100%; }
  .aa-pop { top: auto; bottom: 12px; }
}
@media (max-width: 480px) { #readerTheme { display: none; } }
.aa-theme { display: none; }
@media (max-width: 860px) { .aa-theme { display: grid; } }
.reader-find input { min-width: 0; }
.reader-find .find-count:empty { display: none; }
@media (max-width: 860px) { .reader-find { display: flex; } .reader-find input { flex: 1 1 auto; width: auto; } .reader-find .icon-btn { flex: none; } }
.book a, .book p { overflow-wrap: anywhere; }

/* italic letters at the end of gradient text were being clipped */
.brand span, .count { padding-right: .14em; margin-right: -.04em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
:root[data-theme="sunset"] .brand span { background-image: linear-gradient(90deg, #FA855A, #C93638, #FA855A); }
:root[data-theme="peony"] .brand span { background-image: linear-gradient(90deg, #B46A72, #8f4a53, #B46A72); }

/* relationship tag stands apart from character / other tags */
.rels { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 2px 0 4px; }
.chip.rel-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, var(--panel)) !important; color: var(--c-rel) !important;
  border: 1.5px solid color-mix(in srgb, var(--accent) 55%, transparent); font-weight: 650; font-size: 13.5px; line-height: 1.3; }
.chip.rel-chip .rel-ico { font-size: 11px; color: var(--accent); }
.chip.rel-chip:hover { background: var(--accent) !important; color: var(--accent-ink) !important; border-color: var(--accent); }
.chip.rel-chip:hover .rel-ico { color: var(--accent-ink); }
.chip.more { align-self: center; line-height: 1.35; padding: 2px 4px; }
.rows .col-rel .rels { margin: 0; }
@media (max-width: 480px) { #openSources { font-size: 13px; padding: 6px 10px; } }

/* tidy dropdowns everywhere: no native arrow, consistent chevron + spacing */
select.btn, .tools select, .reader-tools select, .settings select {
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23735453' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; background-size: 11px 7px;
  padding-right: 36px !important; cursor: pointer; line-height: 1.3; font: inherit; }
:root[data-theme="lavender"] select.btn, :root[data-theme="lavender"] .tools select, :root[data-theme="lavender"] .settings select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23DBD8E3' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.reader-tools select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23999' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.tools select { padding: 7px 14px; border-radius: 999px; }
.d-actions { align-items: stretch; }
.d-actions .btn, .d-actions .shelf-sel { min-height: 40px; display: inline-flex; align-items: center; padding: 8px 18px; font-size: 15px; }
.d-actions .shelf-sel { display: inline-block; background-color: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 999px; min-width: 132px; }
.d-actions .shelf-sel:hover { border-color: var(--accent); }
.d-actions .shelf-sel:focus-visible { outline: 3px solid var(--accent-soft); border-color: var(--accent); }

/* more breathing room between the relationship pill and the other tags */
.rels { margin: 6px 0 10px; }
.rels + .chips, .col-rel .rels + .chips { margin-top: 0; }
.card .chips + .chips { margin-top: 6px; }
.chips .chip.more, .rels .chip.more { align-self: stretch; display: inline-flex; align-items: center; margin: 0; padding: 0 4px !important; line-height: 1 !important; font-size: 12.5px; }
.d-head .rating { border-radius: 999px !important; width: auto !important; height: 24px !important; padding: 0 10px !important; font-size: 11.5px !important; box-shadow: none; }

/* logo: open book with sparkles (replaces the flower) */
:root, :root[data-theme] { --brand-mask: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 489 489%22%3E%3Cpath fill-rule=%22evenodd%22 d=%22M73.3 479.1C72.3 478.0 70.2 474.1 68.6 470.3C58.0 445.6 35.6 403.1 19.6 377.7C14.7 369.8 11.0 362.9 11.0 361.4C11.0 357.3 14.8 354.4 22.2 353.0C28.7 351.7 28.9 351.6 30.3 347.6C33.0 340.4 33.9 336.7 35.4 328.1C36.3 322.7 37.5 319.1 38.7 318.0C39.7 317.0 45.0 315.2 50.5 314.0C56.0 312.8 67.4 309.5 75.8 306.8C89.9 302.3 91.1 301.7 90.7 299.8C90.4 298.6 85.3 276.4 79.4 250.4C72.6 220.0 69.0 202.2 69.4 200.6C70.3 197.0 74.2 194.7 78.0 195.5C80.3 196.0 82.1 197.7 85.2 202.2C96.9 219.6 118.5 235.1 137.5 240.0C141.7 241.1 151.9 242.4 160.3 243.0C168.6 243.6 180.2 244.7 186.0 245.5C213.2 249.3 230.3 258.2 240.8 274.0L244.8 280.0L247.6 275.2C252.3 267.1 261.0 259.5 271.3 254.6C283.0 248.9 293.4 246.4 313.5 244.5C345.2 241.5 349.2 241.0 356.8 238.4C372.6 233.2 388.4 221.8 399.8 207.5C403.3 203.1 406.8 198.7 407.6 197.8C411.3 193.1 419.2 195.6 419.8 201.7C420.0 204.0 400.9 291.9 398.4 300.1C398.0 301.5 400.5 302.6 411.7 306.3C419.3 308.8 430.7 312.0 437.0 313.5C450.8 316.8 452.5 318.1 453.5 325.7C454.4 332.7 457.6 345.4 459.5 349.0C460.6 351.2 462.1 352.0 467.0 353.0C470.4 353.7 474.2 355.2 475.6 356.2C479.8 359.6 478.9 362.8 469.2 378.4C453.3 403.7 434.2 439.9 420.3 470.7C415.0 482.7 415.0 482.6 397.2 476.6C364.7 465.7 327.6 460.0 288.4 460.0L274.3 460.0L273.6 463.8C272.9 468.8 271.1 470.2 262.1 473.4C248.3 478.4 232.6 477.4 220.6 470.7C217.1 468.8 216.4 467.8 215.6 464.1L214.7 459.7L192.6 460.3C148.3 461.6 112.8 467.7 86.8 478.6C79.9 481.5 75.7 481.6 73.3 479.1ZM97.8 459.0C125.2 450.4 165.2 445.1 202.8 445.0L215.1 445.0L214.5 420.2C214.2 406.6 213.7 393.1 213.5 390.2C212.9 384.5 214.6 379.7 217.5 378.6C220.5 377.5 223.6 378.0 225.7 379.9C228.4 382.5 228.8 387.0 229.6 426.9L230.3 458.2L233.6 459.6C238.9 461.8 245.1 462.3 251.1 461.1C254.1 460.5 257.0 459.6 257.7 459.2C258.5 458.7 259.1 447.1 259.9 420.5L261.0 382.5L263.6 380.2C266.9 377.3 270.5 377.4 273.6 380.5L276.1 383.0L275.5 405.2C275.2 417.5 274.7 431.4 274.5 436.1L274.0 444.7L296.2 445.3C337.2 446.4 367.6 450.9 394.5 459.8C400.6 461.8 405.9 463.5 406.3 463.5C406.8 463.5 411.3 454.7 416.4 444.0C427.0 421.7 436.3 404.1 449.2 382.2C454.2 373.8 458.1 366.8 457.9 366.6C457.7 366.3 448.7 364.4 438.0 362.2C382.7 350.8 337.7 348.5 292.2 354.7C278.4 356.6 279.0 356.2 276.5 365.6C275.7 368.8 274.2 372.2 273.2 373.2C271.0 375.4 255.4 378.0 244.5 378.0C240.1 378.0 232.2 377.3 227.0 376.5C216.1 374.8 213.7 373.0 212.6 366.0C211.2 357.0 210.6 356.6 196.8 354.7C151.6 348.4 106.4 350.8 51.0 362.2C40.3 364.4 31.3 366.3 31.1 366.5C30.9 366.7 34.3 372.9 38.7 380.2C52.5 403.3 69.9 436.4 79.4 457.8C81.3 462.3 82.6 464.0 83.6 463.6C84.4 463.3 90.8 461.2 97.8 459.0ZM260.8 361.1C261.8 360.6 263.2 358.2 263.9 355.8C266.4 347.4 272.4 337.6 279.1 330.9C286.7 323.2 297.8 317.2 310.5 313.9C319.8 311.5 342.1 310.3 357.5 311.5C366.6 312.2 367.6 312.4 370.3 315.1C372.6 317.5 373.1 318.6 372.5 320.8C371.0 327.0 370.8 327.0 348.1 326.3C330.8 325.8 326.1 326.0 319.0 327.4C310.7 329.1 298.4 334.1 294.5 337.5C292.6 339.1 292.7 339.1 297.1 338.6C337.8 333.9 380.0 335.9 428.3 344.6C436.0 346.0 442.3 347.0 442.5 346.8C442.7 346.6 441.9 342.7 440.8 338.0L438.8 329.4L429.7 327.1C417.0 323.8 395.4 316.4 377.5 309.2C358.9 301.7 350.2 299.8 334.5 299.8C310.5 299.8 289.5 307.4 272.5 322.1C265.0 328.6 261.9 329.4 258.2 326.0C256.7 324.6 256.0 322.7 256.0 320.4C256.0 317.4 256.8 316.0 260.8 312.4C281.4 293.1 314.7 282.2 344.2 285.0C356.1 286.2 363.8 287.9 375.3 292.0C380.1 293.8 384.2 295.1 384.4 294.9C384.6 294.7 387.7 281.0 391.4 264.5C395.1 248.0 398.4 233.7 398.6 232.7C399.0 231.6 396.9 232.7 392.6 235.9C372.6 251.1 360.5 255.2 327.5 258.1C300.1 260.5 288.3 262.7 278.6 267.3C262.1 275.1 254.5 288.4 252.4 312.8C251.6 322.6 250.0 325.3 245.0 325.3C239.8 325.3 237.0 321.4 237.0 314.0C237.0 298.6 231.4 283.5 222.6 275.2C211.4 264.6 197.3 260.7 160.5 258.0C152.2 257.3 142.1 256.2 138.0 255.3C123.4 252.4 109.0 245.5 96.9 235.8C93.7 233.1 91.0 231.4 91.0 231.9C91.0 232.4 94.2 246.7 98.0 263.9C101.9 281.0 105.0 295.1 105.0 295.3C105.0 295.5 108.7 294.2 113.3 292.4C131.6 285.1 157.9 282.8 177.5 286.9C196.7 290.9 215.5 300.1 227.6 311.5C234.9 318.3 235.7 321.4 231.5 325.5C227.7 329.4 225.1 328.7 216.4 321.4C207.5 314.0 192.8 306.3 181.0 302.9C175.6 301.4 169.6 300.6 159.4 300.3C139.0 299.5 131.0 301.2 105.5 311.8C92.0 317.3 73.0 323.8 59.6 327.3L50.6 329.7L48.9 337.6C47.9 341.9 47.1 345.9 47.1 346.4C47.0 346.9 48.5 347.0 50.3 346.6C100.2 336.5 150.4 333.7 192.9 338.6L197.5 339.1L192.0 335.5C189.0 333.6 182.9 330.7 178.5 329.2C170.7 326.6 170.0 326.5 145.9 326.5C123.0 326.5 121.1 326.4 119.1 324.6C116.5 322.3 116.4 318.0 118.8 315.0C121.3 311.9 132.6 310.7 153.5 311.3C173.2 311.9 183.1 313.9 195.0 319.8C209.2 326.8 221.5 341.5 226.1 356.7C227.2 360.5 227.7 361.0 230.9 361.6C232.9 361.9 235.2 362.3 236.0 362.5C238.9 363.3 258.9 362.1 260.8 361.1ZM447.6 271.6C432.3 265.9 429.6 245.9 442.9 236.5C446.6 233.9 448.0 233.5 453.8 233.5C464.1 233.5 470.5 238.3 473.1 248.1C477.0 262.8 461.8 276.8 447.6 271.6ZM457.5 256.0C461.0 252.1 457.2 246.9 452.0 248.5C449.2 249.4 448.3 253.6 450.5 256.0C451.5 257.1 453.1 258.0 454.0 258.0C454.9 258.0 456.5 257.1 457.5 256.0ZM267.4 246.7C264.8 244.5 264.6 243.7 264.8 238.5C265.5 222.3 273.9 211.3 297.6 195.5C311.4 186.3 318.6 179.5 322.0 172.5C324.0 168.3 324.4 166.0 324.4 158.5C324.3 148.5 323.0 144.3 317.8 138.5C307.8 127.1 293.1 128.9 287.5 142.4C284.6 149.3 288.3 157.1 296.3 161.1C302.5 164.2 304.0 165.9 304.0 169.7C304.0 179.8 292.5 179.2 281.0 168.4C264.9 153.3 270.1 128.0 291.2 118.5C296.3 116.2 298.3 115.8 304.4 116.2C332.5 117.6 348.7 152.0 334.6 180.5C330.1 189.7 323.6 195.8 305.6 208.0C286.5 220.9 281.1 227.4 279.5 239.7C278.8 245.2 277.1 247.4 272.9 248.5C270.9 249.0 269.6 248.5 267.4 246.7ZM145.0 215.3C138.7 213.0 138.3 206.8 143.9 200.7L147.8 196.5L143.9 192.1C138.5 186.1 138.7 180.9 144.4 178.5C148.4 176.8 151.6 178.0 155.7 182.7L158.8 186.4L163.4 182.2C168.7 177.3 172.5 176.7 175.8 180.3C179.2 183.9 178.6 187.4 173.8 192.6L169.7 197.1L173.5 201.0C178.3 205.9 178.9 211.1 175.1 214.1C171.5 217.0 168.4 216.4 163.6 212.0C161.2 209.8 158.9 208.0 158.4 208.0C158.0 208.0 156.0 209.5 154.0 211.4C150.3 215.0 147.5 216.2 145.0 215.3ZM244.9 214.8C242.2 213.9 241.5 212.7 238.6 203.6C235.0 192.4 225.4 182.1 212.7 175.7C208.8 173.7 196.9 168.8 186.4 164.7C162.2 155.4 153.7 150.6 143.9 141.0C135.3 132.4 130.3 123.6 126.9 110.5C124.0 99.7 123.7 76.6 126.3 67.0C130.6 50.8 141.1 37.1 154.2 30.6C186.7 14.3 221.9 38.7 222.0 77.6C222.0 85.8 220.5 88.0 214.8 88.0C209.6 88.0 208.0 85.6 207.0 75.9C205.0 55.9 195.3 43.5 179.9 41.1C169.5 39.4 159.0 43.1 151.5 51.1C142.8 60.4 139.5 70.4 139.6 87.5C139.7 107.7 144.3 120.4 155.2 131.1C162.4 138.2 171.7 143.1 194.7 151.9C221.9 162.3 230.3 167.1 240.5 178.1C249.3 187.7 256.6 204.6 254.5 210.7C253.3 214.1 248.6 216.1 244.9 214.8ZM394.6 177.8C392.4 175.9 391.7 174.2 391.0 169.0C389.2 154.9 384.1 149.2 371.2 146.9C363.1 145.4 361.0 143.8 361.0 139.1C361.0 134.2 363.1 132.3 369.9 131.0C384.1 128.3 390.4 117.6 393.6 90.5C395.0 79.1 395.5 77.2 397.7 75.2C400.8 72.4 404.5 72.4 407.4 75.3C409.5 77.4 409.7 78.8 410.3 91.0C411.2 111.2 415.0 123.4 422.0 129.3C424.9 131.8 430.6 134.0 434.2 134.0C436.0 134.0 440.0 138.5 440.0 140.6C440.0 145.3 435.6 149.0 429.9 149.0C424.6 149.0 418.3 151.1 414.8 154.1C410.5 157.6 408.2 162.1 406.9 169.9C405.7 176.2 404.1 178.4 399.9 179.5C398.0 180.0 396.6 179.5 394.6 177.8ZM405.2 142.6C409.8 138.4 409.8 138.3 408.0 136.4C406.9 135.4 404.8 132.1 403.1 129.1C400.6 124.5 400.1 124.0 399.5 125.9C399.2 127.0 397.1 130.2 394.9 133.0L391.0 137.9L395.3 142.4C397.6 144.9 399.7 146.9 400.0 146.9C400.3 146.9 402.6 145.0 405.2 142.6ZM244.3 140.0C241.2 138.7 240.0 135.9 240.0 129.6L240.0 124.0L234.0 124.0C226.8 124.0 224.0 121.9 224.0 116.6C224.0 111.6 227.7 109.0 234.6 109.0L240.0 109.0L240.0 103.5C240.0 98.9 240.4 97.5 242.5 95.5C245.6 92.3 249.4 92.3 252.5 95.5C254.6 97.5 255.0 98.9 255.0 103.5L255.0 109.0L258.9 109.0C266.9 109.0 271.0 111.9 271.0 117.4C271.0 121.9 267.8 124.0 261.0 124.0L255.0 124.0L255.0 129.4C255.0 133.7 254.5 135.4 252.8 137.4C250.1 140.3 247.3 141.2 244.3 140.0ZM79.5 123.5C75.3 121.6 73.7 120.1 70.6 115.6C65.4 107.8 67.7 95.3 75.6 89.3C78.6 87.1 80.5 86.5 86.0 86.2C94.4 85.7 99.7 88.1 103.7 94.2C106.1 97.8 106.5 99.4 106.5 105.6C106.5 112.2 106.2 113.2 103.4 116.7C97.3 124.3 87.3 127.2 79.5 123.5ZM91.3 107.9C92.7 105.7 91.4 101.3 89.2 100.8C85.8 99.9 83.0 101.7 83.0 104.8C83.0 106.3 83.6 108.2 84.2 108.8C85.9 110.5 90.0 109.9 91.3 107.9ZM287.1 87.1C285.9 85.9 284.8 82.5 284.0 78.1C281.8 65.0 274.5 57.9 261.7 56.4C254.3 55.5 251.6 53.5 251.6 48.5C251.6 43.6 254.2 41.5 261.3 40.7C275.0 39.0 281.7 32.7 283.9 19.2C284.4 15.8 285.4 12.2 286.0 11.1C288.1 7.1 295.9 7.1 298.0 11.1C298.6 12.2 299.5 15.7 300.0 18.8C302.2 31.9 308.4 38.2 321.5 40.5C330.8 42.1 333.6 44.3 332.6 49.5C331.8 53.7 329.0 55.6 322.9 56.3C309.6 57.9 301.9 65.4 300.1 78.5C299.3 83.7 298.5 86.0 296.9 87.2C294.1 89.5 289.5 89.5 287.1 87.1ZM296.3 52.2L300.0 48.4L296.0 44.5L292.0 40.6L288.0 44.5L284.0 48.4L287.7 52.2C289.7 54.3 291.7 56.0 292.0 56.0C292.3 56.0 294.3 54.3 296.3 52.2Z%22/%3E%3C/svg%3E"); }
.brand::before { width: 34px; height: 34px; margin-right: 10px; }
@media (max-width: 480px) { .brand::before { width: 28px; height: 28px; margin-right: 8px; } }


/* ===================== PHONES & TABLETS ===================== */
html { -webkit-text-size-adjust: 100%; }
* { -webkit-tap-highlight-color: transparent; }
body.locked { overflow: hidden; }
.sb-head, .sb-foot, .filt-btn, .lbl-short { display: none; }
.filt-n { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11.5px; font-weight: 700; }
.filt-n[hidden] { display: none; }
@media (hover: none) { .card:hover, .card.blurb:hover { transform: none; box-shadow: var(--shadow); } }

@media (max-width: 860px) {
  /* header: one compact row + search */
  .top { position: relative; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "brand actions" "search search"; gap: 10px 10px;
    padding: calc(10px + env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 12px max(14px, env(safe-area-inset-left)); }
  .brand { grid-area: brand; font-size: 23px; }
  .top-actions { grid-area: actions; gap: 6px; margin: 0; }
  .search { grid-area: search; order: 0 !important; max-width: none; }
  .search input { font-size: 16px; padding: 11px 16px; }
  .search-btn { padding: 10px 16px; }
  .lbl-long { display: none; } .lbl-short { display: inline; }
  #themeName { display: none; }
  .theme-btn { padding: 6px 9px !important; }
  .theme-btn .sw { width: 20px; height: 20px; }
  #openSources { padding: 7px 14px; }

  /* sticky toolbar with Filters button */
  .layout { min-height: auto; }
  .main { padding: 0 12px calc(60px + env(safe-area-inset-bottom)); }
  .toolbar { position: sticky; top: 0; z-index: 15; margin: 0 -12px 12px; padding: 10px 12px; flex-wrap: wrap; gap: 8px 10px;
    background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
  .count { font-size: 19px; order: 1; }
  .tools { order: 2; margin-left: auto; gap: 6px; }
  .active-filters { order: 3; flex-basis: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .active-filters:empty { display: none; }
  .active-filters::-webkit-scrollbar { display: none; }
  .fchip { flex: none; }
  .filt-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; font-size: 14px; }
  .tools select { max-width: 150px; font-size: 14px; padding: 7px 12px; }
  .seg button { padding: 6px 10px; }

  /* filters = bottom sheet */
  .sidebar { position: fixed !important; left: 0 !important; right: 0 !important; top: auto !important; bottom: 0 !important; width: 100% !important; height: 88vh !important; height: 88dvh !important;
    z-index: 60 !important; border: 0; border-radius: 22px 22px 0 0; background: var(--panel) !important; padding: 0 !important;
    display: flex; flex-direction: column; transform: translateY(105%) !important; transition: transform .25s ease, box-shadow .25s; box-shadow: none; overflow: hidden; }
  .sidebar.open { transform: none !important; box-shadow: 0 0 0 100vmax rgba(20,10,15,.42) !important; }
  body.sb-open .layout { z-index: 50; }
  .sb-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); position: relative; }
  .sb-head b { font: 600 italic 19px var(--serif); flex: 1; }
  .sb-grab { position: absolute; top: 6px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: var(--line); }
  .sb-head .icon-btn { width: 38px; height: 38px; }
  .sb-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 14px 20px; overscroll-behavior: contain; }
  .sb-foot { display: flex; gap: 10px; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--panel); }
  .sb-foot .btn { flex: 1; min-height: 46px; font-size: 15px; justify-content: center; }
  .sb-foot .btn.primary { flex: 2; }
  .shelves { display: flex; flex-wrap: wrap; gap: 6px; }
  .shelves a { flex: none; padding: 8px 14px; border: 1px solid var(--line); gap: 8px; }
  .shelves a .n { font-size: 12px; }
  .frow { padding: 9px 6px; font-size: 15px; grid-template-columns: 26px 1fr auto 34px; }
  .fbtn { width: 26px; height: 26px; font-size: 13px; }
  .fbtn.exc-btn { width: 34px; height: 34px; opacity: .55; }
  .facet h4 { font-size: 12px; padding: 6px; }
  .facet input[data-fsearch] { font-size: 16px; padding: 9px 12px; }

  /* fic boxes */
  .cards { gap: 12px; }
  .card.blurb { padding: 15px 15px 11px; border-radius: 16px; }
  .b-head { gap: 12px; }
  .b-summary { -webkit-line-clamp: 4; font-size: 15px; }
  .b-tags li, .b-fandoms li { font-size: 14px; }
  .b-stats { justify-content: flex-start; }

  /* details = full-screen page with actions in reach */
  .drawer { width: 100vw; border: 0; padding-bottom: env(safe-area-inset-bottom); }
  .drawer .d-head { padding: calc(16px + env(safe-area-inset-top)) 18px 14px; }
  .drawer .d-head h2 { font-size: 25px; padding-right: 44px; }
  .d-close { top: calc(10px + env(safe-area-inset-top)) !important; right: 10px !important; width: 42px !important; height: 42px !important; font-size: 18px; }
  .drawer .d-body { padding: 18px 18px 40px; }
  .d-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .d-actions .btn.primary { grid-column: 1 / -1; min-height: 48px; justify-content: center; font-size: 16px; }
  .d-actions .btn, .d-actions .shelf-sel { justify-content: center; width: 100%; min-width: 0; }
  .stats { grid-template-columns: 1fr 1fr; }

  /* popups = bottom sheets */
  .modal { display: flex !important; align-items: flex-end; padding: 0 !important; }
  .modal[hidden] { display: none !important; }
  .modal-card { width: 100% !important; max-height: 92vh; max-height: 92dvh; overflow-y: auto; border-radius: 22px 22px 0 0; margin: 0;
    padding: 18px 18px calc(22px + env(safe-area-inset-bottom)) !important; }
  .modal-head h2 { font-size: 21px; padding-right: 8px; }
  .add-source input, .settings input, .settings select, .reader-find input { font-size: 16px !important; }
  .add-source input { padding: 12px 14px; }
  .add-source .btn { padding: 10px 18px; }
  .theme-pop { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: 100%; max-height: 85vh; overflow-y: auto; z-index: 80; border-radius: 22px 22px 0 0;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); color: var(--ink); box-shadow: 0 0 0 100vmax rgba(20,10,15,.42); }
  .theme-opt { padding: 10px; }

  .aa-pop { position: fixed; left: 0; right: 0; bottom: 0; top: auto !important; width: 100%; border-radius: 22px 22px 0 0; max-height: 80vh; overflow-y: auto;
    padding: 16px 18px calc(18px + env(safe-area-inset-bottom)); box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
  .aa-pop .aa-row:has([data-set="rw"]) { display: none; }
  .pdf-page { margin-bottom: 10px; border-radius: 4px; }
  .foot { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
}
@media (max-width: 380px) {
  .brand { font-size: 21px; } .brand::before { width: 26px; height: 26px; }
  .tools select { max-width: 124px; }
  .seg[aria-label="View"] { display: none; }
}

/* let the page (not <body>) scroll, so sticky bars and scroll-to-top work everywhere */
html, body { height: auto !important; overflow-x: clip !important; }
.b-tags .more-tags { white-space: nowrap; }
body > .theme-pop { position: fixed; top: 64px; right: 16px; z-index: 80; color: var(--ink); }
@media (max-width: 860px) { body > .theme-pop { top: auto; right: 0; } }
@media (max-width: 480px) { .seg[aria-label="View"] { display: none; } .tools select { max-width: 170px; } .toolbar { flex-wrap: nowrap; } .active-filters { order: 4; } .toolbar:has(.fchip) { flex-wrap: wrap; } }

.toast { border-radius: 14px !important; max-width: min(440px, calc(100vw - 32px)); width: max-content; padding: 12px 18px; text-align: center; line-height: 1.45; font-size: 14px;
  bottom: calc(20px + env(safe-area-inset-bottom)); }


/* ===================== notifications ===================== */
.toast { display: none !important; }
.toasts { position: fixed; z-index: 120; left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100vw - 24px)); pointer-events: none; }
.toast-item { pointer-events: auto; display: grid; grid-template-columns: 26px 1fr 28px; align-items: start; gap: 10px; padding: 12px 10px 12px 14px;
  background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(20,10,15,.18); font: 14px/1.45 var(--ui); opacity: 0; transform: translateY(8px); transition: opacity .18s, transform .18s; }
.toast-item.in { opacity: 1; transform: none; } .toast-item.out { opacity: 0; transform: translateY(8px); }
.toast-item .t-ico { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 700 13px var(--ui); color: #fff; background: var(--accent); }
.toast-item.error { border-left-color: #c0392b; } .toast-item.error .t-ico { background: #c0392b; }
.toast-item.success { border-left-color: #2f9e6e; } .toast-item.success .t-ico { background: #2f9e6e; }
.toast-item .t-msg { padding-top: 2px; overflow-wrap: anywhere; }
.toast-item .t-x { border: 0; background: none; color: var(--ink-3); cursor: pointer; width: 28px; height: 28px; border-radius: 8px; font-size: 13px; }
.toast-item .t-x:hover { background: var(--panel-2); color: var(--ink); }

/* ===================== dialogs ===================== */
.dlg-wrap { position: fixed; inset: 0; z-index: 130; background: rgba(20,10,15,.45); display: grid; place-items: center; padding: 16px; animation: fadeIn .15s; }
.dlg { background: var(--panel); color: var(--ink); width: min(400px, 100%); border-radius: 18px; padding: 20px 20px 16px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.dlg h3 { margin: 0 0 6px; font: 600 20px/1.3 var(--serif); }
.dlg p { margin: 0 0 18px; color: var(--ink-2); font-size: 14.5px; line-height: 1.5; }
.dlg-btns { display: flex; gap: 8px; justify-content: flex-end; }
.dlg-btns .btn { min-height: 42px; padding: 8px 18px; }
.btn.danger-solid { background: #c0392b; border-color: #c0392b; color: #fff; font-weight: 600; }
@keyframes fadeIn { from { opacity: 0; } }
@media (max-width: 860px) { .dlg-wrap { place-items: end center; padding: 0; } .dlg { width: 100%; border-radius: 22px 22px 0 0; padding-bottom: calc(18px + env(safe-area-inset-bottom)); } .dlg-btns .btn { flex: 1; } }

/* ===================== error / offline / no-js states ===================== */
.loading.err { display: grid; justify-items: center; gap: 8px; text-align: center; font-family: var(--ui); }
.loading.err b { font: 600 20px var(--serif); } .loading.err span { max-width: 420px; opacity: .85; } .loading.err .btn { margin-top: 8px; }
.offline-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 110; padding: calc(6px + env(safe-area-inset-top)) 44px 6px; text-align: center; font: 600 13px var(--ui); background: #3b2a33; color: #fff; }
.offline-bar[hidden] { display: none; }
.offline-x { position: absolute; right: 6px; bottom: 2px; width: 32px; height: 26px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: inherit; font: 600 14px var(--ui); cursor: pointer; opacity: .8; }
.offline-x:hover, .offline-x:focus-visible { opacity: 1; background: rgba(255,255,255,.14); }
.nojs { padding: 40px 20px; text-align: center; font: 16px var(--ui); }

/* ===================== accessibility basics ===================== */
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; border-radius: 6px; }
button:focus:not(:focus-visible), a:focus:not(:focus-visible) { outline: none; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }

/* readable secondary text (WCAG AA 4.5:1) */
:root, :root[data-theme="ruby"] { --ink-3: #7d6168; }
:root[data-theme="blossom"] { --ink-3: #86617f; }
:root[data-theme="matcha"] { --ink-3: #58695f; }
:root[data-theme="sunset"] { --ink-3: #86563f; }
:root[data-theme="peony"] { --ink-3: #5f6773; }
.sq-s { background: var(--ink-2) !important; }


/* ================= Lemon Breeze (light) ================= */
:root[data-theme="lemon"] {
  color-scheme: only light;
  --bg: #eef8fb; --panel: #ffffff; --panel-2: #e3f3f8; --ink: #20373B; --ink-2: #3c5a60; --ink-3: #4f6d73;
  --line: #cde5ed; --accent: #2f7d8c; --accent-2: #FFC64F; --accent-ink: #ffffff; --accent-soft: #dcf0f5; --chip: #e8f5f9;
  --grad: linear-gradient(135deg, #20373B 0%, #2f7d8c 55%, #519CAB 100%); --grad-2: linear-gradient(90deg, #519CAB, #FFC64F, #519CAB);
  --shadow: 0 1px 2px rgba(32,55,59,.06), 0 8px 24px rgba(32,55,59,.08);
  --c-char-bg: #fff1cc; --c-char: #7a5600; --c-tag-bg: #e3f3f8; --c-tag: #2d5a62;
  --c-rel-bg: #dcf0f5; --c-rel: #22677a; --c-fan-bg: #e7eef0; --c-fan: #20373B; --c-warn-bg: #fff1cc; --c-warn: #7a5600;
  --blob1: rgba(81,156,171,.22); --blob2: rgba(255,198,79,.30); --blob3: rgba(194,231,241,.65);
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg opacity='0.22'%3E%3Cg transform='translate%2845 55%29 rotate%28-20%29 scale%281%29'%3E%3Cellipse rx='13' ry='10' fill='%23FFC64F'/%3E%3Ccircle cx='13' cy='0' r='2.4' fill='%23FFC64F'/%3E%3Cpath d='M-6 -14 q8 -6 14 2 q-8 4 -14 -2z' fill='%23519CAB'/%3E%3C/g%3E%3Cg transform='translate%28165 150%29 rotate%2825%29 scale%280.75%29'%3E%3Cellipse rx='13' ry='10' fill='%23FFC64F'/%3E%3Ccircle cx='13' cy='0' r='2.4' fill='%23FFC64F'/%3E%3Cpath d='M-6 -14 q8 -6 14 2 q-8 4 -14 -2z' fill='%23519CAB'/%3E%3C/g%3E%3Cg transform='translate%28160 45%29 scale%280.5%29'%3E%3Ccircle cx='0' cy='-9' r='7' fill='%23519CAB'/%3E%3Ccircle cx='8.5' cy='-2.8' r='7' fill='%23519CAB'/%3E%3Ccircle cx='5.3' cy='7.3' r='7' fill='%23519CAB'/%3E%3Ccircle cx='-5.3' cy='7.3' r='7' fill='%23519CAB'/%3E%3Ccircle cx='-8.5' cy='-2.8' r='7' fill='%23519CAB'/%3E%3Ccircle r='4' fill='%23FFC64F'/%3E%3C/g%3E%3Ccircle cx='95' cy='120' r='3' fill='%23519CAB'/%3E%3Ccircle cx='40' cy='180' r='2.5' fill='%23FFC64F'/%3E%3C/g%3E%3C/svg%3E");
  --r-paper: #fbfdfe; --r-paper-ink: #20373B; --r-night: #14262a; --r-night-ink: #e3f1f4; --hl: #FFC64F;
}
:root[data-theme="lemon"] .brand span { background-image: linear-gradient(90deg, #2f7d8c, #d99a10, #2f7d8c); }
:root[data-theme="lemon"] .rating { background: linear-gradient(135deg, #20373B, #519CAB) !important; }

/* ================= Midnight Steel (dark) ================= */
:root[data-theme="midnight"] {
  color-scheme: dark;
  --bg: #06141B; --panel: #11212D; --panel-2: #182b38; --ink: #e8ecec; --ink-2: #CCD0CF; --ink-3: #9BA8AB;
  --line: #253745; --accent: #aebcc0; --accent-2: #4A5C6A; --accent-ink: #06141B; --accent-soft: #223644; --chip: #1a2d3a;
  --grad: linear-gradient(135deg, #CCD0CF 0%, #9BA8AB 55%, #4A5C6A 100%); --grad-2: linear-gradient(90deg, #4A5C6A, #CCD0CF, #4A5C6A);
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.35);
  --c-char-bg: #223644; --c-char: #d3dee3; --c-tag-bg: #182b38; --c-tag: #CCD0CF;
  --c-rel-bg: #2b4252; --c-rel: #eef3f4; --c-fan-bg: #172833; --c-fan: #b9c6ca; --c-warn-bg: #3a3420; --c-warn: #f0d999;
  --blob1: rgba(74,92,106,.38); --blob2: rgba(155,168,171,.10); --blob3: rgba(37,55,69,.55);
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg opacity='0.2'%3E%3Cpath transform='translate%2850 50%29 scale%281%29' d='M0 -14 C2 -4 4 -2 14 0 C4 2 2 4 0 14 C-2 4 -4 2 -14 0 C-4 -2 -2 -4 0 -14Z' fill='%239BA8AB'/%3E%3Cpath transform='translate%28160 140%29 scale%280.6%29' d='M0 -14 C2 -4 4 -2 14 0 C4 2 2 4 0 14 C-2 4 -4 2 -14 0 C-4 -2 -2 -4 0 -14Z' fill='%23CCD0CF'/%3E%3Cpath transform='translate%28170 40%29 scale%280.35%29' d='M0 -14 C2 -4 4 -2 14 0 C4 2 2 4 0 14 C-2 4 -4 2 -14 0 C-4 -2 -2 -4 0 -14Z' fill='%239BA8AB'/%3E%3Ccircle cx='100' cy='100' r='1.6' fill='%23CCD0CF'/%3E%3Ccircle cx='40' cy='170' r='1.2' fill='%239BA8AB'/%3E%3Ccircle cx='200' cy='190' r='1.4' fill='%23CCD0CF'/%3E%3Ccircle cx='130' cy='30' r='1' fill='%23CCD0CF'/%3E%3C/g%3E%3C/svg%3E");
  --r-paper: #eef1f1; --r-paper-ink: #11212D; --r-night: #0a1820; --r-night-ink: #d6dcdc; --hl: #CCD0CF;
}
:root[data-theme="midnight"] .brand span { background-image: linear-gradient(90deg, #9BA8AB, #ffffff, #9BA8AB); }
:root[data-theme="midnight"] .card, :root[data-theme="midnight"] .card.blurb { border-color: #22364a; }
:root[data-theme="midnight"] .sq-r, :root[data-theme="midnight"] .sq-c, :root[data-theme="midnight"] .sq-w, :root[data-theme="midnight"] .sq-s { color: #06141B; }
:root[data-theme="midnight"] .sq-r { background: #CCD0CF; } :root[data-theme="midnight"] .sq-c { background: #9BA8AB; }
:root[data-theme="midnight"] .sq-w { background: #7f8f95 !important; } :root[data-theme="midnight"] .sq-s { background: #aebcc0 !important; }
:root[data-theme="midnight"] select.btn, :root[data-theme="midnight"] .tools select, :root[data-theme="midnight"] .settings select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23CCD0CF' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
:root[data-theme="midnight"] .toast-item, :root[data-theme="lavender"] .toast-item, :root[data-theme="celadon"] .toast-item { box-shadow: 0 10px 30px rgba(0,0,0,.45); }
:root[data-theme="midnight"] .b-title h3, :root[data-theme="midnight"] .card h3 { color: #f1f4f4; }
:root[data-theme="midnight"] .count { background-image: linear-gradient(90deg, #CCD0CF, #ffffff); }
:root[data-theme="lemon"] .b-title h3 { color: #20373B; }

/* ===================== first-time guide ===================== */
.empty.guide { max-width: 760px; margin: 40px auto 56px; padding: 0 8px; text-align: center; background: none; border: 0; box-shadow: none; color: var(--ink-2); }
.g-icon { width: 64px; height: 64px; margin: 0 auto 14px; background: var(--grad); -webkit-mask: var(--brand-mask) center/contain no-repeat; mask: var(--brand-mask) center/contain no-repeat; }
.guide h2 { margin: 0; font: 600 italic 30px/1.2 var(--serif); color: var(--ink); }
.guide .g-lead { margin: 10px auto 32px; max-width: 420px; font-size: 16px; line-height: 1.5; color: var(--ink-2); }
.g-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; text-align: left; }
.g-steps li { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px 18px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; }
.g-n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: var(--accent-ink); font: 700 14px var(--ui); margin-bottom: 6px; }
.g-steps b { font: 600 17px/1.3 var(--serif); color: var(--ink); }
.g-steps p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.g-cta { display: inline-flex; margin: 32px auto 0; min-height: 48px; padding: 12px 28px; font-size: 16px; }
.g-help { margin: 22px auto 0; max-width: 480px; font-size: 14px; }
.g-help summary { cursor: pointer; display: inline-block; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; list-style: none; }
.g-help summary::-webkit-details-marker { display: none; }
.g-help-body { margin-top: 12px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; text-align: left; line-height: 1.6; }
.g-help-body p { margin: 0; }
.g-note { margin-top: 8px !important; font-size: 13px; color: var(--ink-3); }
.g-foot { margin: 20px 0 0; font-size: 13px; color: var(--ink-3); }
@media (max-width: 860px) {
  .empty.guide { margin: 18px auto 36px; padding: 0 2px; }
  .g-icon { width: 52px; height: 52px; }
  .guide h2 { font-size: 25px; }
  .guide .g-lead { margin: 8px auto 22px; font-size: 15px; }
  .g-steps { grid-template-columns: 1fr; gap: 10px; }
  .g-steps li { display: grid; grid-template-columns: 30px 1fr; column-gap: 14px; row-gap: 2px; padding: 14px 16px; align-items: start; }
  .g-n { grid-row: span 2; margin: 0; }
  .g-cta { display: flex; width: 100%; justify-content: center; margin-top: 22px; }
}

/* scan progress banner */
.scan-banner { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; padding: 12px 16px; border-radius: 14px; }
.scan-banner .sb-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.scan-banner .sb-txt strong { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scan-banner .sb-txt .muted { font-size: 13px; }
.scan-banner .btn { padding: 6px 16px; font-size: 13px; }
.scan-banner .bar { grid-column: 1 / -1; }
/* loading fic boxes */
.card.blurb:has(.skel) { opacity: .85; }
.card.blurb:has(.skel) h3 { color: var(--ink-3) !important; font-weight: 500; }
.skel { display: grid; gap: 8px; margin-top: 12px; }
.skel i { display: block; height: 10px; border-radius: 6px; background: linear-gradient(90deg, var(--panel-2) 25%, color-mix(in srgb, var(--panel-2) 55%, var(--panel)) 50%, var(--panel-2) 75%); background-size: 200% 100%; animation: shimmer-sk 1.3s linear infinite; }
.skel i.s { width: 55%; }
@keyframes shimmer-sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.b-pending.err { color: var(--r-e); }

.loading-now { display: flex; align-items: center; gap: 10px; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }


/* ================= Bryn's Forest (dark) ================= */
:root[data-theme="bryn"] {
  color-scheme: dark;
  --bg: #101212; --panel: #1a2519; --panel-2: #22301f; --ink: #efe6d6; --ink-2: #cfc4ae; --ink-3: #a59b86;
  --line: #2e3d27; --accent: #a9bf7a; --accent-2: #c0895f; --accent-ink: #101212; --accent-soft: #2b3a24; --chip: #22301f;
  --grad: linear-gradient(135deg, #a9bf7a 0%, #7d9a52 45%, #b98258 100%); --grad-2: linear-gradient(90deg, #7d9a52, #c0895f, #7d9a52);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.4);
  --c-char-bg: #2b3a24; --c-char: #cfe0a8; --c-tag-bg: #35261f; --c-tag: #e3c3a6;
  --c-rel-bg: #3f2c22; --c-rel: #f0c9a3; --c-fan-bg: #233021; --c-fan: #bcd29a; --c-warn-bg: #3d3420; --c-warn: #f0d999;
  --blob1: rgba(50,68,41,.55); --blob2: rgba(103,71,54,.30); --blob3: rgba(26,37,25,.75);
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg opacity='.28'%3E%3Cpath transform='translate%2845 55%29 scale%281.1%29' d='M0 -16 L9 -4 L4 -4 L11 6 L3 6 L3 12 L-3 12 L-3 6 L-11 6 L-4 -4 L-9 -4Z' fill='%234f6b3c'/%3E%3Cpath transform='translate%28165 150%29 scale%280.8%29' d='M0 -16 L9 -4 L4 -4 L11 6 L3 6 L3 12 L-3 12 L-3 6 L-11 6 L-4 -4 L-9 -4Z' fill='%234f6b3c'/%3E%3Cpath transform='translate%28150 40%29 rotate%28-20%29 scale%281%29' d='M0 0 q10 -14 22 -6 q-8 12 -22 6z' fill='%238a5e43'/%3E%3Cpath transform='translate%2870 165%29 rotate%2815%29 scale%280.9%29' d='M0 0 q10 -14 22 -6 q-8 12 -22 6z' fill='%236f8f4a'/%3E%3Ccircle cx='110' cy='105' r='2.4' fill='%23a07454'/%3E%3Ccircle cx='30' cy='190' r='1.6' fill='%236f8f4a'/%3E%3Ccircle cx='200' cy='85' r='1.4' fill='%23a07454'/%3E%3C/g%3E%3C/svg%3E");
  --r-paper: #f3ece0; --r-paper-ink: #1a2519; --r-night: #121614; --r-night-ink: #e6dccb; --hl: #c0895f;
}
:root[data-theme="bryn"] .brand span { background-image: linear-gradient(90deg, #a9bf7a, #e2b48a, #a9bf7a); }
:root[data-theme="bryn"] .top { background: linear-gradient(90deg, #101212, #1a2519 55%, #35261f); border-bottom: 0; }
:root[data-theme="bryn"] .card, :root[data-theme="bryn"] .card.blurb { border-color: #2a3824; }
:root[data-theme="bryn"] .b-title h3, :root[data-theme="bryn"] .card h3 { color: #f3ead9; }
:root[data-theme="bryn"] .count { background-image: linear-gradient(90deg, #a9bf7a, #e2b48a); }
:root[data-theme="bryn"] .sq-r { background: #7d9a52 !important; } :root[data-theme="bryn"] .sq-c { background: #8a5e43 !important; }
:root[data-theme="bryn"] .sq-w { background: #4f5f45 !important; } :root[data-theme="bryn"] .sq-s { background: #674736 !important; }
:root[data-theme="bryn"] select.btn, :root[data-theme="bryn"] .tools select, :root[data-theme="bryn"] .settings select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23cfc4ae' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
:root[data-theme="bryn"] .toast-item { box-shadow: 0 10px 30px rgba(0,0,0,.5); }
:root[data-theme="bryn"] .reader[data-rt="light"] { --rbg: #f3ece0; --rink: #1a2519; }
:root[data-theme="bryn"] .sq-r { background: #5f7a3c !important; }


/* ================= Bryn's Forest v2: chocolate first, forest green second, cream only as a highlight ================= */
:root[data-theme="bryn"] {
  --bg: #140e0b; --panel: #24170f; --panel-2: #2f1f16; --ink: #ecdccb; --ink-2: #c9ad94; --ink-3: #a88c74;
  --line: #3d2a1e; --accent: #d9a273; --accent-2: #3f5a31; --accent-ink: #f6e9da; --accent-soft: #3a261b; --chip: #2f1f16;
  --grad: linear-gradient(135deg, #6b4430 0%, #4a2e20 100%);
  --grad-2: linear-gradient(90deg, #3f5a31, #8a5a3e 50%, #3f5a31);
  --shadow: 0 1px 2px rgba(0,0,0,.45), 0 10px 26px rgba(0,0,0,.45);
  --c-char-bg: #22301d; --c-char: #b9d29a; --c-tag-bg: #38261c; --c-tag: #dcbfa4;
  --c-rel-bg: #4a2e20; --c-rel: #f1c8a0; --c-fan-bg: #1f2a1b; --c-fan: #c7d6ae; --c-warn-bg: #3d3018; --c-warn: #f0d999;
  --blob1: rgba(107,68,48,.35); --blob2: rgba(63,90,49,.22); --blob3: rgba(36,23,15,.8);
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg opacity='.3'%3E%3Cpath transform='translate%2845 55%29 scale%281.1%29' d='M0 -16 L9 -4 L4 -4 L11 6 L3 6 L3 12 L-3 12 L-3 6 L-11 6 L-4 -4 L-9 -4Z' fill='%233f5a31'/%3E%3Cpath transform='translate%28150 40%29 rotate%28-20%29 scale%281%29' d='M0 0 q10 -14 22 -6 q-8 12 -22 6z' fill='%237a4f36'/%3E%3Cpath transform='translate%28165 150%29 rotate%2830%29 scale%281.1%29' d='M0 0 q10 -14 22 -6 q-8 12 -22 6z' fill='%236b4430'/%3E%3Cpath transform='translate%2880 170%29 scale%280.7%29' d='M0 -16 L9 -4 L4 -4 L11 6 L3 6 L3 12 L-3 12 L-3 6 L-11 6 L-4 -4 L-9 -4Z' fill='%233f5a31'/%3E%3Ccircle cx='110' cy='105' r='2.4' fill='%238a5a3e'/%3E%3Ccircle cx='200' cy='85' r='1.4' fill='%23c9a27e'/%3E%3Ccircle cx='30' cy='195' r='1.6' fill='%237a4f36'/%3E%3C/g%3E%3C/svg%3E");
  --r-paper: #efe2d0; --r-paper-ink: #2a1a12; --r-night: #160f0c; --r-night-ink: #e6d4c2; --hl: #b07a52;
}
:root[data-theme="bryn"] .top { background: linear-gradient(90deg, #1a120e 0%, #2a1a12 60%, #1f2a1b 100%); }
:root[data-theme="bryn"] .top::after { background: linear-gradient(90deg, #3f5a31, #b07a52, #3f5a31); opacity: .9; }
:root[data-theme="bryn"] .brand span { background-image: linear-gradient(90deg, #e9c7a2, #d9a273, #e9c7a2); }
:root[data-theme="bryn"] .brand::before { background: #d9a273; }
:root[data-theme="bryn"] .card, :root[data-theme="bryn"] .card.blurb { background: #24170f; border-color: #3d2a1e; }
:root[data-theme="bryn"] .card::before { background: linear-gradient(90deg, #3f5a31, #6b4430); }
:root[data-theme="bryn"] .b-title h3, :root[data-theme="bryn"] .card h3 { color: #f1dfcb; }
:root[data-theme="bryn"] .count { background-image: linear-gradient(90deg, #e9c7a2, #d9a273); }
:root[data-theme="bryn"] .btn.primary { background: linear-gradient(135deg, #7a4f36, #4a2e20); color: #f6e9da; box-shadow: 0 4px 14px rgba(0,0,0,.45); }
:root[data-theme="bryn"] .shelves a.on, :root[data-theme="bryn"] .seg button.on, :root[data-theme="bryn"] .fchip { background: linear-gradient(135deg, #6b4430, #4a2e20); color: #f6e9da; }
:root[data-theme="bryn"] .sidebar { background: rgba(26,18,14,.6); }
:root[data-theme="bryn"] .sq-r { background: #6b4430 !important; color: #f6e9da; } :root[data-theme="bryn"] .sq-c { background: #3f5a31 !important; color: #f6e9da; }
:root[data-theme="bryn"] .sq-w { background: #4a3a30 !important; } :root[data-theme="bryn"] .sq-s { background: #5a3a28 !important; }
:root[data-theme="bryn"] .rating { background: linear-gradient(135deg, #7a4f36, #4a2e20) !important; color: #f6e9da; }
:root[data-theme="bryn"] .pbar > div, :root[data-theme="bryn"] .bar > div, :root[data-theme="bryn"] .reader-progress > div { background: linear-gradient(90deg, #3f5a31, #b07a52); }
:root[data-theme="bryn"] .g-n { background: linear-gradient(135deg, #7a4f36, #4a2e20); color: #f6e9da; }
:root[data-theme="bryn"] .g-icon { background: #d9a273; }
:root[data-theme="bryn"] .d-head { background: linear-gradient(180deg, #2f1f16, #24170f); }
:root[data-theme="bryn"] .stat b { color: #d9a273; }
:root[data-theme="bryn"] ::selection { background: rgba(176,122,82,.45); }

/* ================= Bryn's Hollow v3: ~60% forest green, ~40% chocolate ================= */
:root[data-theme="bryn"] {
  --bg: #0f1410; --panel: #1a2519; --panel-2: #22301f; --ink: #ece2d0; --ink-2: #cdbfa8; --ink-3: #a69a84;
  --line: #2f3f28; --accent-soft: #2a3a24; --chip: #22301f;
  --c-char-bg: #24361f; --c-fan-bg: #1f2c1b;
  --blob1: rgba(50,68,41,.45); --blob2: rgba(107,68,48,.28); --blob3: rgba(26,37,25,.7);
}
:root[data-theme="bryn"] .top { background: linear-gradient(90deg, #1a2519 0%, #22301f 55%, #3a2619 100%); }
:root[data-theme="bryn"] .card, :root[data-theme="bryn"] .card.blurb { background: #1a2519; border-color: #2f3f28; }
:root[data-theme="bryn"] .card::before { background: linear-gradient(90deg, #6b4430, #3f5a31); }
:root[data-theme="bryn"] .sidebar { background: rgba(36,25,18,.82); border-color: #3d2a1e; }
:root[data-theme="bryn"] .d-head { background: linear-gradient(180deg, #2a1c14, #1a2519); }
:root[data-theme="bryn"] .drawer { background: #1a2519; }
:root[data-theme="bryn"] .modal-card, :root[data-theme="bryn"] .theme-pop, :root[data-theme="bryn"] .aa-pop { background: #1e2a1c; }
:root[data-theme="bryn"] .stat { background: #24170f; border-color: #3d2a1e; }
:root[data-theme="bryn"] .b-summary { border-image: linear-gradient(#6b4430, #3f5a31) 1; }
:root[data-theme="bryn"] .reader[data-rt="dark"] { --rbg: #111712; --rink: #e6dccb; }
.src.removing { opacity: .45; pointer-events: none; }

.loading-row { display: flex; align-items: center; gap: 14px; padding: 16px 20px; margin-top: 4px; border: 1px dashed var(--line); border-radius: 14px; background: color-mix(in srgb, var(--panel) 70%, transparent); color: var(--ink-2); grid-column: 1 / -1; }
.loading-row b { display: block; color: var(--ink); font-size: 14.5px; } .loading-row span:not(.spin) { font-size: 13px; color: var(--ink-3); }

/* delete-download button in the fic drawer */
.d-actions .del-dl { color: var(--ink-soft, inherit); }
.d-actions .del-dl:hover { color: #b3261e; border-color: #b3261e66; background: #b3261e12; }


/* ===== Lilac Daydream: Lavender Haze turned to daylight (light lilac, violet ink) ===== */
:root[data-theme="lilac"] {
  color-scheme: only light;
  --bg: #F6F2FC; --panel: #FFFFFF; --panel-2: #EFE8FA; --ink: #2E2440; --ink-2: #54496A; --ink-3: #6f6585;
  --line: #E4D9F5; --accent: #7B5EA7; --accent-2: #B9A6E0; --accent-ink: #ffffff; --accent-soft: #ECE3FA; --chip: #F1EBFB;
  --grad: linear-gradient(135deg, #9D82CC 0%, #7B5EA7 55%, #5C4585 100%); --grad-2: linear-gradient(90deg, #B9A6E0, #7B5EA7, #E0A6C8, #B9A6E0);
  --shadow: 0 1px 2px color-mix(in srgb, #7B5EA7 8%, transparent), 0 8px 24px color-mix(in srgb, #7B5EA7 11%, transparent);
  --c-char-bg: #ECE3FA; --c-char: #5C4585; --c-tag-bg: #F4EEFB; --c-tag: #6a4f8f;
  --c-rel-bg: #F9E3EF; --c-rel: #9b3f72; --c-fan-bg: #E6EAF7; --c-fan: #3f4c7a; --c-warn-bg: #FFF1D6; --c-warn: #7a5a00;
  --blob1: rgba(185,166,224,.45); --blob2: rgba(224,166,200,.25); --blob3: rgba(201,182,234,.40);
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg opacity='0.22'%3E%3Cg transform='translate%2840 50%29 scale%281%29'%3E%3Ccircle cx='0' cy='-9' r='7' fill='%23C9B6EA'/%3E%3Ccircle cx='8.5' cy='-2.8' r='7' fill='%23C9B6EA'/%3E%3Ccircle cx='5.3' cy='7.3' r='7' fill='%23C9B6EA'/%3E%3Ccircle cx='-5.3' cy='7.3' r='7' fill='%23C9B6EA'/%3E%3Ccircle cx='-8.5' cy='-2.8' r='7' fill='%23C9B6EA'/%3E%3Ccircle r='4' fill='%23FFF'/%3E%3C/g%3E%3Cg transform='translate%28160 150%29 scale%280.7%29'%3E%3Ccircle cx='0' cy='-9' r='7' fill='%239D82CC'/%3E%3Ccircle cx='8.5' cy='-2.8' r='7' fill='%239D82CC'/%3E%3Ccircle cx='5.3' cy='7.3' r='7' fill='%239D82CC'/%3E%3Ccircle cx='-5.3' cy='7.3' r='7' fill='%239D82CC'/%3E%3Ccircle cx='-8.5' cy='-2.8' r='7' fill='%239D82CC'/%3E%3Ccircle r='4' fill='%23E4D9F5'/%3E%3C/g%3E%3Cg transform='translate%28172 40%29 scale%280.45%29'%3E%3Ccircle cx='0' cy='-9' r='7' fill='%23E4D9F5'/%3E%3Ccircle cx='8.5' cy='-2.8' r='7' fill='%23E4D9F5'/%3E%3Ccircle cx='5.3' cy='7.3' r='7' fill='%23E4D9F5'/%3E%3Ccircle cx='-5.3' cy='7.3' r='7' fill='%23E4D9F5'/%3E%3Ccircle cx='-8.5' cy='-2.8' r='7' fill='%23E4D9F5'/%3E%3Ccircle r='4' fill='%239D82CC'/%3E%3C/g%3E%3Cpath transform='translate%2870 160%29 rotate%280%29' d='M0 0 q10 -14 22 -6 q-8 12 -22 6z' fill='%23B9A6E0'/%3E%3Cpath transform='translate%28112 82%29 rotate%28-25%29' d='M0 0 q10 -14 22 -6 q-8 12 -22 6z' fill='%23CDBDEA'/%3E%3Ccircle cx='100' cy='120' r='2.5' fill='%239D82CC'/%3E%3Ccircle cx='30' cy='190' r='2' fill='%23B9A6E0'/%3E%3C/g%3E%3C/svg%3E");
  --r-paper: #FBF9FE; --r-paper-ink: #2E2440; --r-night: #1f1a2b; --r-night-ink: #e6def3; --hl: #E4D2FF;
}
:root[data-theme="lilac"] .brand span { background-image: linear-gradient(90deg, #7B5EA7, #b07aa6, #7B5EA7); }
:root[data-theme="lilac"] .b-title h3, :root[data-theme="lilac"] .card h3 { color: #3a2c55; }
:root[data-theme="lilac"] .reader[data-rt="sepia"] { --rbg: #f6efe2; --rink: #3a2c45; }

/* ===== Violet Latte: lilac & violet on Peony Latte's vanilla cream ===== */
:root[data-theme="violatte"] {
  color-scheme: only light;
  --bg: #FFF7E6; --panel: #FFFCF5; --panel-2: #F7EFFA; --ink: #3A2D4F; --ink-2: #5d5070; --ink-3: #6f6380;
  --line: #EEE2D2; --accent: #8A63B8; --accent-2: #F3D27A; --accent-ink: #ffffff; --accent-soft: #EFE4FA; --chip: #F6EFE9;
  --grad: linear-gradient(135deg, #B596DE 0%, #8A63B8 55%, #5F4387 100%); --grad-2: linear-gradient(90deg, #C9B3E6, #8A63B8, #E6B85C, #C9B3E6);
  --shadow: 0 1px 2px color-mix(in srgb, #8A63B8 8%, transparent), 0 8px 24px color-mix(in srgb, #8A63B8 10%, transparent);
  --c-char-bg: #EFE4FA; --c-char: #5F4387; --c-tag-bg: #FBF0D3; --c-tag: #7d5a10;
  --c-rel-bg: #F7E1EC; --c-rel: #8f3f6b; --c-fan-bg: #EAEFE0; --c-fan: #4d5c32; --c-warn-bg: #FFEFD0; --c-warn: #7a5200;
  --blob1: rgba(201,179,230,.45); --blob2: rgba(243,210,122,.28); --blob3: rgba(183,196,154,.22);
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg opacity='0.26'%3E%3Cg transform='translate%2840 50%29 scale%281%29'%3E%3Ccircle cx='0' cy='-9' r='7' fill='%23C9B3E6'/%3E%3Ccircle cx='8.5' cy='-2.8' r='7' fill='%23C9B3E6'/%3E%3Ccircle cx='5.3' cy='7.3' r='7' fill='%23C9B3E6'/%3E%3Ccircle cx='-5.3' cy='7.3' r='7' fill='%23C9B3E6'/%3E%3Ccircle cx='-8.5' cy='-2.8' r='7' fill='%23C9B3E6'/%3E%3Ccircle r='4' fill='%23F3D27A'/%3E%3C/g%3E%3Cg transform='translate%28160 150%29 scale%280.75%29'%3E%3Ccircle cx='0' cy='-9' r='7' fill='%238A63B8'/%3E%3Ccircle cx='8.5' cy='-2.8' r='7' fill='%238A63B8'/%3E%3Ccircle cx='5.3' cy='7.3' r='7' fill='%238A63B8'/%3E%3Ccircle cx='-5.3' cy='7.3' r='7' fill='%238A63B8'/%3E%3Ccircle cx='-8.5' cy='-2.8' r='7' fill='%238A63B8'/%3E%3Ccircle r='4' fill='%23F3E3B8'/%3E%3C/g%3E%3Cg transform='translate%28170 40%29 scale%280.5%29'%3E%3Ccircle cx='0' cy='-9' r='7' fill='%23F3D27A'/%3E%3Ccircle cx='8.5' cy='-2.8' r='7' fill='%23F3D27A'/%3E%3Ccircle cx='5.3' cy='7.3' r='7' fill='%23F3D27A'/%3E%3Ccircle cx='-5.3' cy='7.3' r='7' fill='%23F3D27A'/%3E%3Ccircle cx='-8.5' cy='-2.8' r='7' fill='%23F3D27A'/%3E%3Ccircle r='4' fill='%238A63B8'/%3E%3C/g%3E%3Cpath transform='translate%2870 160%29 rotate%280%29' d='M0 0 q10 -14 22 -6 q-8 12 -22 6z' fill='%23B7C49A'/%3E%3Cpath transform='translate%28118 78%29 rotate%28-25%29' d='M0 0 q10 -14 22 -6 q-8 12 -22 6z' fill='%23B7C49A'/%3E%3Ccircle cx='180' cy='95' r='3' fill='%23C9B3E6'/%3E%3Ccircle cx='30' cy='190' r='2' fill='%23F3D27A'/%3E%3C/g%3E%3C/svg%3E");
  --r-paper: #FFFAF0; --r-paper-ink: #33284A; --r-night: #221c2e; --r-night-ink: #efe6dc; --hl: #E7D6FA;
}
:root[data-theme="violatte"] .brand span { background-image: linear-gradient(90deg, #8A63B8, #c9953a, #8A63B8); }
:root[data-theme="violatte"] .b-title h3, :root[data-theme="violatte"] .card h3 { color: #3A2D4F; }

/* source label (which Drive folder / upload a fic came from) */
.src-tag { display: inline-flex; align-items: center; gap: 4px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; color: var(--ink-2); }
.src-tag svg { flex: none; opacity: .75; }
.d-src { margin-top: 6px; font-size: 13px; }
.d-src:empty { display: none; }
.d-src .src-tag { max-width: 100%; padding: 3px 10px; border-radius: 999px; background: var(--chip); border: 1px solid var(--line); }
:root[data-theme="violatte"] .reader:not([data-rt="dark"]) .book h1, :root[data-theme="violatte"] .reader:not([data-rt="dark"]) .book h2,
:root[data-theme="lilac"] .reader:not([data-rt="dark"]) .book h1, :root[data-theme="lilac"] .reader:not([data-rt="dark"]) .book h2 { background-image: linear-gradient(135deg, #6E4C9E, #4E3878); }
/* theme menu: scroll when there are more themes than fit on screen */
@media (min-width: 861px) { body > .theme-pop, .theme-pop { max-height: calc(100vh - 80px); overflow-y: auto; overscroll-behavior: contain; } }

/* one-time AI note for first-time visitors */
.ai-note { display: flex; align-items: center; gap: 12px; margin: 12px 20px 0; padding: 10px 10px 10px 16px; border-radius: 14px;
  background: var(--accent-soft); border: 1px solid var(--line); color: var(--ink-2); font-size: 13.5px; line-height: 1.45; animation: aiIn .35s ease-out; }
.ai-note p { margin: 0; flex: 1; }
.ai-note b { color: var(--ink); }
.ai-note .icon-btn { flex: none; color: var(--ink-2); }
@keyframes aiIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (max-width: 860px) { .ai-note { margin: 10px 12px 0; font-size: 13px; } }

/* =====================================================================
   Calmer finish: solid colours instead of gradients, no glows,
   no gradient text, no decorative stripes, steadier hover states.
   Themes, fonts, flower patterns and colours stay as they are.
   ===================================================================== */
html { --brand-c: var(--accent); }
html:not([data-theme]), html[data-theme="ruby"] { --brand-c: #f0c6d3; }
html[data-theme="bryn"] { --brand-c: #e2b48a; }
html[data-theme="lavender"] { --brand-c: #DBD8E3; }
html[data-theme="midnight"] { --brand-c: #CCD0CF; }

/* page background: keep the theme colour and its pattern, drop the soft glows */
body { background-image: var(--pattern) !important; background-color: var(--bg) !important; }
/* Speed: the pattern used to be painted on the page itself with background-attachment: fixed, which makes phones repaint
   the whole screen on every frame of scrolling (the library and the reader both felt it). It now sits on its own fixed
   layer that the browser just keeps in place. Looks exactly the same: same pattern, same spot, same size. */
body { background-attachment: scroll !important; background-image: none !important; }
body::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; background-image: var(--pattern); background-size: inherit; background-repeat: inherit; background-position: inherit; }
html[data-plain-bg] body::after, html[data-theme="auroragreen"] body::after, html[data-theme="aurorarosa"] body::after, html[data-theme="auroraviolet"] body::after,
html[data-theme="synthwave"] body::after, html[data-theme="neoncity"] body::after, html[data-theme="blade"] body::after { display: none; }
.reader-scroll { background: var(--rbg) !important; }

/* text is never gradient-filled */
html .brand span { background: none !important; -webkit-text-fill-color: currentColor; color: var(--brand-c) !important; animation: none !important; }
html .brand::before { background: var(--brand-c) !important; }
html .count { background: none !important; -webkit-text-fill-color: currentColor; color: var(--ink-2) !important; font-style: normal; }
html .book h1, html .book h2, html .book h3 { background: none !important; -webkit-text-fill-color: currentColor;
  color: color-mix(in srgb, var(--rink) 72%, var(--accent)) !important; }
html .reader[data-rt="dark"] .book h1, html .reader[data-rt="dark"] .book h2 { color: color-mix(in srgb, var(--rink) 80%, var(--accent)) !important; }

/* no decorative gradient stripes on cards, header, drawer and reader bar */
html .card::before, html .top::after, html .reader-bar::after, html .d-head::after { display: none !important; }
html .top { border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }

/* solid accent colour for buttons and selected states, with no glow shadow */
html { --solid: var(--accent); --solid-ink: var(--accent-ink); }
html[data-theme="bryn"] { --solid: #7a4f36; --solid-ink: #f6e9da; }
html .btn.primary, html .shelves a.on, html .seg button.on, html .fchip, html .reader-bar .seg button.on,
html .g-n, html .rating, html .rating.G, html .rating.T, html .rating.M, html .rating.E, html .rating.N {
  background: var(--solid) !important; color: var(--solid-ink) !important; box-shadow: none !important; }
html .shelves a.on .n { color: color-mix(in srgb, var(--solid-ink) 80%, transparent) !important; }
html .btn.primary:hover { background: color-mix(in srgb, var(--solid) 86%, #000) !important; transform: none; }
html .chip:hover { background: var(--accent-soft) !important; color: var(--ink) !important; }
html .pbar > div, html .bar > div, html .reader-progress > div { background: var(--accent) !important; box-shadow: none !important; }
html .g-icon { background: var(--accent) !important; }
html .book blockquote, html .b-summary { border-image: none !important; border-left: 3px solid color-mix(in srgb, var(--accent) 55%, var(--line)) !important; }

/* cards: an edge or a shadow, not both; no jumping on hover; tighter corners */
html .card { border-radius: 12px; box-shadow: none !important; }
html .card:hover { transform: none !important; box-shadow: none !important; border-color: color-mix(in srgb, var(--accent) 45%, var(--line)) !important; }
html .rows, html .card.blurb { border-radius: 12px; }
html .modal-card, html .dlg, html .theme-pop { border-radius: 16px; }
html .g-steps li { border-radius: 12px; }

/* card footer: spacing instead of dot separators */
.meta-row { gap: 6px 14px; }
.meta-row .mi { display: inline-flex; align-items: center; }

/* small icons used in buttons */
.ico, .plus svg, .drop svg { vertical-align: -2px; flex: none; }
.btn .ico, #emptyAdd svg { margin-right: 4px; }
.seg [data-view] svg { fill: currentColor; display: block; }
.seg [data-view] { display: inline-grid; place-items: center; }

/* "choose what loads first" panel */
.ch-dlg { width: min(560px, 100%); max-height: 86vh; overflow-y: auto; }
.ch-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ch-head h3 { margin: 0; }
.ch-lead { color: var(--ink-2); font-size: 13.5px; line-height: 1.5; margin: 8px 0 14px; }
.ch-dlg h4 { margin: 16px 0 6px; font: 600 12px var(--ui); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.ch-list { border: 1px solid var(--line); border-radius: 10px; max-height: 240px; overflow-y: auto; }
.ch-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 14px; }
.ch-row:last-child { border-bottom: 0; }
.ch-row:hover { background: var(--panel-2); }
.ch-row input { accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.ch-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.ch-n { color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.ch-q { width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); outline: none; }
.ch-res { margin-top: 6px; }
.ch-hit { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 2px; border-bottom: 1px solid var(--line); }
.ch-hit span { min-width: 0; display: grid; } .ch-hit b { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-hit small { color: var(--ink-3); font-size: 12px; }
.ch-note { color: var(--ink-3); font-size: 12.5px; margin: 14px 0 0; }
/* own key guide */
.opt { font-weight: 400; color: var(--ink-3); }
.key-help { margin-top: 6px; font-size: 13px; color: var(--ink-2); font-weight: 400; }
.key-help summary { cursor: pointer; color: var(--accent); }
.key-help ol { padding-left: 20px; margin: 8px 0; line-height: 1.55; }
.key-help p { margin: 8px 0; line-height: 1.5; }
/* folder picker */
.fp-row { gap: 6px; padding-top: 6px; padding-bottom: 6px; cursor: default; }
.fp-exp { flex: none; width: 26px; height: 26px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-2); cursor: pointer; font-size: 13px; }
.fp-exp:hover { background: var(--panel-2); color: var(--ink); }
.fp-lab { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; cursor: pointer; }
.fp-lab input, .ch-all input { accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.ch-all { border: 0; padding: 4px 12px 8px 38px; }
.fp-none { color: var(--ink-3); font-size: 12.5px; padding-top: 4px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.fp-list { max-height: 320px; }
.ch-dlg .dlg-btns { position: sticky; bottom: -20px; background: var(--panel); padding: 12px 0 0; margin-top: 14px; }
.fb-line { margin: 12px 0 0; font-size: 13px; color: var(--ink-2); }
.foot a { color: var(--accent); white-space: nowrap; }
/* round feedback button in the top bar */
.fb-btn { width: 38px; height: 38px; padding: 0 !important; border-radius: 50% !important; display: inline-grid; place-items: center; flex: none; text-decoration: none; color: inherit; }
.fb-btn svg { display: block; }
@media (max-width: 860px) { .fb-btn { width: 36px; height: 36px; } }
/* support popup */
.sup-dlg { width: min(460px, 100%); }
.sup-opt { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-top: 12px; background: var(--panel); }
.sup-opt b { font: 600 16px var(--serif); color: var(--ink); }
.sup-opt p { margin: 6px 0 12px; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.sup-opt .btn { display: inline-flex; text-decoration: none; }
.sup-opt small { display: block; margin-top: 8px; font-size: 12px; color: var(--ink-3); }
.sup-dlg .dlg-btns { margin-top: 14px; }

/* =====================================================================
   Squarer, plainer finish (closer to AO3): solid top bars, small corners,
   flat cards. Themes, colours, patterns and fonts are unchanged.
   ===================================================================== */
html:not([data-theme]) .top, html[data-theme="ruby"] .top { background: #5a3449 !important; }
html[data-theme="bryn"] .top { background: #1c2419 !important; }

/* buttons, inputs and menus: gently rounded instead of pills */
html .btn, html select.btn, html .tools select, html .search input, html .seg, html .reader-find input,
html .reader-tools select, html .d-actions .shelf-sel, html .ch-q, html .theme-btn { border-radius: 8px; }
html .seg button { border-radius: 6px; }
html .shelves a, html .fchip { border-radius: 6px; }
/* the two round icon buttons in the top bar stay round */
html .fb-btn { border-radius: 50% !important; }

/* tags: plain small labels like AO3's */
html .chip, html .chip.rel-chip, html .src-tag, html .d-src .src-tag, html .d-head .rating { border-radius: 4px !important; }

/* cards, boxes and popups: small corners, flat */
html .card, html .card.blurb, html .rows, html .g-steps li, html .stat, html .sup-opt, html .ch-list, html .drop,
html .scan-banner, html .ai-note, html .toast-item, html .loading-row { border-radius: 6px !important; }
html .modal-card, html .dlg, html .theme-pop, html .aa-pop { border-radius: 10px !important; }
html .cards { gap: 14px; }
@media (max-width: 860px) {
  html .modal-card, html .dlg, html .theme-pop, html .aa-pop, html .sidebar { border-radius: 12px 12px 0 0 !important; }
}
.fb-tw { margin: 14px 2px 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.fb-tw b { color: var(--ink); font-weight: 600; }
.fb-tw a { color: var(--accent); font-weight: 600; white-space: nowrap; }
/* PDF text view */
.pdf-note { font: 13px/1.5 var(--ui); color: color-mix(in srgb, var(--rink) 65%, transparent); border: 1px dashed color-mix(in srgb, var(--rink) 25%, transparent); border-radius: 6px; padding: 8px 12px; margin: 0 0 24px; }
#pdfModeBtn { white-space: nowrap; }

/* How it works & privacy page */
.about-page .top { gap: 12px; }
.about-page .top-actions .btn { text-decoration: none; }
.about { max-width: 720px; margin: 0 auto; padding: 28px 20px 64px; color: var(--ink); line-height: 1.6; }
.about h1 { font: 600 30px/1.2 var(--serif); margin: 8px 0 12px; }
.about-lead { font-size: 16px; color: var(--ink-2); margin: 0 0 8px; }
.about section { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 16px 20px; margin-top: 16px; }
.about h2 { font: 600 19px/1.3 var(--serif); margin: 0 0 8px; }
.about ul { margin: 0; padding-left: 20px; } .about li { margin: 6px 0; font-size: 14.5px; }
.about p { font-size: 14.5px; }
.about a { color: var(--accent); }
.about code { font-size: 13px; background: var(--chip); padding: 1px 5px; border-radius: 4px; }
.about-foot { margin-top: 24px; } .about-foot .btn { text-decoration: none; display: inline-flex; }
@media (max-width: 860px) { .about { padding: 18px 14px 48px; } .about h1 { font-size: 25px; } }

/* accessibility fixes */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.top .search input { color: var(--ink); }
.top .search input::placeholder { color: var(--ink-3); opacity: 1; }
.d-sec h3 { margin: 0 0 8px; font: 600 11.5px var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
html:not([data-theme="lavender"]):not([data-theme="celadon"]):not([data-theme="midnight"]):not([data-theme="bryn"]):not([data-theme="crimson"]):not([data-theme="blade"]):not([data-theme="rosepine"]):not([data-theme="supernova"]):not([data-theme="vae"]):not([data-theme="sofia"]):not([data-theme="monokai"]):not([data-theme="abyssal"]):not([data-theme="duskbloom"]):not([data-theme="inkjellies"]):not([data-theme="duskydarkpurple"]):not([data-theme="starry"]):not([data-theme="auroragreen"]):not([data-theme="aurorarosa"]):not([data-theme="auroraviolet"]):not([data-theme="synthwave"]):not([data-theme="neoncity"]):not([data-theme="acidrain"]) .dl { color: #18734f !important; }
.nomatch { grid-column: 1 / -1; width: 100%; }

.cap-btns { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.cap-btns .linkbtn { font-size: 12.5px; }
@media (max-width: 860px) { .cap-btns { flex-direction: row; align-items: center; gap: 10px; } }
@media (max-width: 860px) {
  .scan-banner:has(.cap-btns) { flex-wrap: wrap; }
  .scan-banner:has(.cap-btns) .sb-txt { flex: 1 1 100%; }
  .scan-banner .cap-btns { width: 100%; justify-content: flex-start; }
}
@media (max-width: 860px) {
  .scan-banner:has(.cap-btns) { grid-template-columns: 1fr; }
  .scan-banner .cap-btns { grid-column: 1 / -1; }
}

@media (max-width: 1180px) {
  /* reader: bar floats over the text, hides while you read, tap to bring back */
  .reader { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
  .reader-bar { position: absolute; top: 0; left: 0; right: 0; z-index: 4; padding-top: calc(8px + env(safe-area-inset-top)); transition: transform .22s ease; }
  .reader.bar-hidden .reader-bar { transform: translateY(-105%); }
  .reader-progress { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; height: 3px; padding-bottom: env(safe-area-inset-bottom); }
  .reader-scroll { padding-top: var(--rbar-h, 104px); }
  .book { padding: 18px 20px calc(90px + env(safe-area-inset-bottom)); }
  .reader[data-rw="narrow"] .book, .reader[data-rw="wide"] .book, .reader[data-rw="full"] .book { max-width: none; }
}

/* PDF pages follow the page colour: Night darkens them (like Zotero), Sepia warms them */
.reader[data-rt="dark"] .pdf-page { background: #111; }
.reader[data-rt="dark"] .pdf-page canvas { filter: invert(.92) hue-rotate(180deg) brightness(1.05) contrast(.95); }
.reader[data-rt="sepia"] .pdf-page canvas { filter: sepia(.35) brightness(.97); }
/* Lavender Haze: the light rating/category squares get dark symbols so they're readable */
html[data-theme="lavender"] .req .sq { color: #1e1a2a; }

.err-detail { max-width: 520px; margin: 4px auto 6px; font: 12px/1.5 var(--ui); color: color-mix(in srgb, var(--rink, var(--ink)) 70%, transparent); text-align: left; }
.err-detail summary { cursor: pointer; text-align: center; }
.err-detail code { display: block; margin: 8px 0; padding: 8px 10px; border-radius: 6px; background: color-mix(in srgb, var(--rink, var(--ink)) 8%, transparent); word-break: break-word; white-space: pre-wrap; font-size: 11.5px; }

/* pages */
.more { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 18px 0 8px; }
.more:empty { padding: 0; }
.pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; }
.pager .pg { min-width: 38px; padding: 6px 10px; }
.pager .pg.on { background: var(--solid, var(--accent)) !important; color: var(--solid-ink, var(--accent-ink)) !important; border-color: transparent; }
.pager .pg[disabled] { opacity: .45; cursor: default; }
.pg-gap { color: var(--ink-3); padding: 0 2px; }
.per-page { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.per-page select { padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font: inherit; }
@media (max-width: 640px) { .pager .pg { min-width: 34px; padding: 6px 8px; } }

.sup-opt b { display: flex; align-items: center; gap: 8px; }
.sup-ico { flex: none; color: var(--accent); }

/* ---------- Nov batch: shelves, notes, phone fixes ---------- */
/* my shelves in the sidebar */
.my-shelves { margin: 10px 0 4px; padding-top: 10px; border-top: 1px solid var(--line); }
.my-shelves h4 { margin: 0 0 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.ms-row { display: flex; align-items: center; gap: 2px; }
.ms-row > a { flex: 1; min-width: 0; }
.ms-edit { width: 26px; height: 26px; font-size: 15px; opacity: .55; flex: none; }
.ms-edit:hover, .ms-edit:focus-visible { opacity: 1; }
.new-shelf { margin: 4px 10px 0; font-size: 13px; }
.shelves a { text-decoration: none; color: inherit; }
/* shelf chips above the list (every screen size) */
.shelf-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 0 12px; }
.sc-chip { flex: none; border: 1px solid var(--line); background: var(--panel); color: var(--ink-2); border-radius: 999px; padding: 5px 12px; font: 500 13px var(--sans, inherit); white-space: nowrap; cursor: pointer; }
.sc-chip:hover { color: var(--ink); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.sc-chip span { opacity: .7; margin-left: 2px; font-size: 12px; }
.sc-chip.on { background: var(--accent); color: var(--accent-ink, #fff); border-color: transparent; }
.sc-chip.on span { opacity: .9; }
@media (max-width: 860px) {
  .shelf-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .shelf-chips::-webkit-scrollbar { display: none; }
}
/* drawer: my shelves + notes */
.ms-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ms-chip { cursor: pointer; }
.ms-chip.on { background: var(--accent); color: var(--accent-ink, #fff); border-color: transparent; }
.ms-new { background: transparent; border-style: dashed; }
.my-notes h3 small { font: 400 11px var(--sans, inherit); text-transform: none; letter-spacing: 0; color: var(--ink-3); margin-left: 6px; }
.mn-row { display: flex; align-items: center; gap: 10px; margin: 6px 0; flex-wrap: wrap; }
.mn-lbl { font-size: 13px; color: var(--ink-2); min-width: 78px; }
.stars { display: flex; align-items: center; gap: 2px; }
.star { background: none; border: 0; padding: 2px 3px; font-size: 22px; line-height: 1; color: var(--accent); cursor: pointer; }
.star:not(.on) { color: var(--ink-3); }
.mn-clear { font-size: 12px; margin-left: 6px; }
.my-notes input[type=date] { padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font: inherit; font-size: 13px; }
.mn-notes textarea { width: 100%; box-sizing: border-box; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); font: 14px/1.5 var(--sans, inherit); resize: vertical; min-height: 90px; }
.mn-saved { display: block; min-height: 16px; font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.newtab-link { display: inline-block; margin-top: 8px; font-size: 12.5px; color: var(--ink-2); }
/* files list and copies: collapsed, and never taller than part of a phone screen */
.d-files > summary { list-style: none; cursor: pointer; }
.d-files > summary::-webkit-details-marker { display: none; }
.d-files > summary h3 { display: inline; }
.d-files > summary::after { content: " ▸"; color: var(--ink-3); font-size: 12px; }
.d-files[open] > summary::after { content: " ▾"; }
.d-files[open] > summary { margin-bottom: 8px; }
@media (max-width: 860px) {
  .d-copies[open] { max-height: 38vh; overflow-y: auto; overscroll-behavior: contain; }
  .d-files[open] { max-height: 45vh; overflow-y: auto; overscroll-behavior: contain; }
}
/* live reading percentage */
.reader-pct { position: absolute; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 5; font-size: 11.5px; font-variant-numeric: tabular-nums; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--rbg) 82%, transparent); color: color-mix(in srgb, var(--rink) 70%, transparent); pointer-events: none; }
.reader-pct:empty { display: none; }
/* reader on phones: the story can't drag the page underneath into view */
.reader-scroll { overscroll-behavior: contain; }
html.reading, html.reading body { overflow: hidden; overscroll-behavior: none; }
.reader { height: 100%; height: 100dvh; }
/* text box dialog */
.pd-lbl { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 4px; font-size: 13px; color: var(--ink-2); }
.pd-lbl input { padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); font: inherit; font-size: 15px; }
.dlg-btns .btn.danger { margin-right: auto; }
.my-stars { color: var(--accent); letter-spacing: 1px; } .has-note { color: var(--ink-2); font-style: italic; }

/* heart in the top-right corner of every fic */
.card { position: relative; }
.corner { position: absolute; top: 8px; right: 10px; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 2px; width: 32px; }
.cm { display: grid; place-items: center; font-size: 11px; font-weight: 600; line-height: 1; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.cm-rate { color: var(--accent); }
.fav-btn { position: relative; width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink-3); font-size: 19px; line-height: 1; cursor: pointer; }
.fav-btn:hover { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.fav-btn.on { color: var(--accent); }
.card:not(.blurb) .card-head, .card:not(.blurb) .col-main { padding-right: 30px; }
.card.blurb .b-head { padding-right: 34px; }
.sc-x { margin-left: 6px; font-size: 11px; font-weight: 600; opacity: .85; }
/* themes: a header with a close button that stays visible while scrolling */
.tp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: sticky; top: -16px; z-index: 2; margin: -16px -16px 6px; padding: 14px 12px 8px 16px; background: inherit; }
.tp-head h3 { margin: 0; }
.tp-close { width: 34px; height: 34px; font-size: 16px; flex: none; }

/* ---------- reader top bar on phones: two tidy rows ----------
   row 1: back · title · find · Aa      row 2: Text/Page view · chapter / page picker (full width) */
.find-toggle { display: none; }
@media (max-width: 860px) {
  .reader-bar { display: grid !important; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 6px 6px; row-gap: 6px;
    padding: 6px 10px 8px; padding-top: calc(6px + env(safe-area-inset-top)); min-height: 0; flex-wrap: nowrap; }
  #readerBack { grid-column: 1; grid-row: 1; padding: 6px 10px; font-size: 17px; line-height: 1; }
  #readerBack .rb-lbl { font-size: 14px; }
  .reader-title { display: block !important; grid-column: 2; grid-row: 1; text-align: left; font-size: 15px; min-width: 0; }
  .find-toggle { display: inline-grid; place-items: center; grid-column: 3; grid-row: 1; width: 36px; height: 36px; color: var(--rink); }
  .find-toggle[hidden] { display: none; }
  .reader-tools { display: contents; }
  #aaBtn { grid-column: 4; grid-row: 1; }
  #readerTheme { display: none !important; }
  #pdfModeBtn { grid-column: 1 / 2; grid-row: 2; white-space: nowrap; padding: 7px 12px; font-size: 14px; }
  #chapterSel { grid-column: 2 / -1; grid-row: 2; max-width: none !important; width: 100%; min-width: 0; font-size: 15px; padding: 8px 30px 8px 12px; }
  #pdfModeBtn[hidden] + #chapterSel { grid-column: 1 / -1; }
  #chapterSel[hidden] { display: none; }
  .reader-find { display: none !important; grid-column: 1 / -1; grid-row: 3; }
  .reader.find-open .reader-find:not([hidden]) { display: flex !important; }
}
/* phones: if the count and the Filters / sort buttons don't fit on one line, the buttons move to their own line
   instead of running off the screen */
@media (max-width: 480px) {
  .toolbar, .toolbar:has(.fchip) { flex-wrap: wrap !important; }
  .tools { flex: 1 1 auto; justify-content: flex-end; min-width: 0; margin-left: auto; }
  .tools select, #sort { min-width: 0; max-width: 190px; flex: 0 1 auto; }
}
/* the smallest phones (320–360 px wide): tighter header so nothing is cut off */
@media (max-width: 360px) {
  .top { padding-left: 10px !important; padding-right: 10px !important; gap: 8px !important; }
  .top-actions { gap: 5px !important; min-width: 0; }
  .top-actions .btn, .top-actions .fb-btn { padding-left: 8px !important; padding-right: 8px !important; }
  .top-actions .fb-btn, .theme-btn { width: 34px !important; height: 34px !important; min-width: 34px; }
  .brand { font-size: 20px !important; min-width: 0; }
  .search { min-width: 0; gap: 6px; }
  .search input { min-width: 0; }
  .search-btn { padding-left: 12px !important; padding-right: 12px !important; flex: none; }
  .main { padding-left: 10px !important; padding-right: 10px !important; }
}

/* =====================================================================
   New themes (fan requests, Nov 2026). Each block sets the theme colours;
   the rules under it fix headers, squares and text for that theme.
   ===================================================================== */
:root[data-theme="peachy"] {
  color-scheme: only light;
  --bg: #FDF1E6;
  --panel: #FFFAF4;
  --panel-2: #FCE6D8;
  --ink: #45192C;
  --ink-2: #6A3B4C;
  --ink-3: #80545F;
  --line: #F2D7C3;
  --accent: #C42A62;
  --accent-2: #EEB17D;
  --accent-ink: #FFFFFF;
  --accent-soft: #FCE0E6;
  --chip: #FBE8D8;
  --c-char-bg: #FFE3EC;
  --c-char: #962056;
  --c-tag-bg: #FCEBD3;
  --c-tag: #7A4612;
  --c-rel-bg: #FFD9E8;
  --c-rel: #931D50;
  --c-fan-bg: #FBF0C9;
  --c-fan: #6B5200;
  --c-warn-bg: #FFEFD0;
  --c-warn: #7A5200;
  --blob1: rgba(255,146,193,.30);
  --blob2: rgba(238,177,125,.30);
  --blob3: rgba(239,212,122,.25);
  --r-paper: #FFF8F1;
  --r-paper-ink: #3A1A27;
  --r-night: #24171C;
  --r-night-ink: #F3E3DA;
  --hl: #FFD6A8;
  --grad: linear-gradient(135deg, #D5306D 0%, #FF92C1 40%, #EEB17D 75%, #EFD47A 100%); --grad-2: linear-gradient(90deg, #FF92C1, #D5306D, #EEB17D, #EFD47A);
  --shadow: 0 1px 2px rgba(196,42,98,.08), 0 8px 24px rgba(238,177,125,.18);
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg opacity='0.24'%3E%3Cpath transform='translate%2848 52%29 rotate%280%29 scale%281%29' d='M0 -14 C2 -4 4 -2 14 0 C4 2 2 4 0 14 C-2 4 -4 2 -14 0 C-4 -2 -2 -4 0 -14Z' fill='%23FF92C1'/%3E%3Cpath transform='translate%28165 150%29 rotate%280%29 scale%280.65%29' d='M0 -14 C2 -4 4 -2 14 0 C4 2 2 4 0 14 C-2 4 -4 2 -14 0 C-4 -2 -2 -4 0 -14Z' fill='%23EEB17D'/%3E%3Cpath transform='translate%28175 42%29 rotate%280%29 scale%280.4%29' d='M0 -14 C2 -4 4 -2 14 0 C4 2 2 4 0 14 C-2 4 -4 2 -14 0 C-4 -2 -2 -4 0 -14Z' fill='%23D5306D'/%3E%3Ccircle cx='100' cy='110' r='2.5' fill='%23EFD47A'/%3E%3Ccircle cx='30' cy='185' r='2' fill='%23FF92C1'/%3E%3Ccircle cx='130' cy='30' r='1.8' fill='%23EEB17D'/%3E%3C/g%3E%3C/svg%3E");
}
html[data-theme="peachy"] { --brand-c: #C42A62; }
html[data-theme="peachy"] .b-title h3, html[data-theme="peachy"] .card h3 { color: #9C1F50 !important; }
html[data-theme="peachy"] .sq-r { background: #C42A62 !important; } html[data-theme="peachy"] .sq-c { background: #962056 !important; } html[data-theme="peachy"] .sq-w { background: #80545F !important; } html[data-theme="peachy"] .sq-s { background: #B5703A !important; }
html[data-theme="peachy"] .req .sq { color: #FFFFFF !important; }
:root[data-theme="melody"] {
  color-scheme: only light;
  --bg: #FFF6F9;
  --panel: #FDE6EF;
  --panel-2: #FAD9E6;
  --ink: #45172C;
  --ink-2: #6B324D;
  --ink-3: #7F4560;
  --line: #F2C6D6;
  --accent: #A63265;
  --accent-2: #EEBACD;
  --accent-ink: #FFFFFF;
  --accent-soft: #F9D6E4;
  --chip: #FFF0F5;
  --c-char-bg: #FFFFFF;
  --c-char: #9E2F61;
  --c-tag-bg: #FFF4F7;
  --c-tag: #7B3352;
  --c-rel-bg: #F7C2D6;
  --c-rel: #7D1F4B;
  --c-fan-bg: #F5F5DC;
  --c-fan: #6B5A2A;
  --c-warn-bg: #FFF1D6;
  --c-warn: #7A5A00;
  --blob1: rgba(238,186,205,.40);
  --blob2: rgba(245,245,220,.50);
  --blob3: rgba(238,157,187,.25);
  --r-paper: #FFF8FA;
  --r-paper-ink: #3D1428;
  --r-night: #2A1620;
  --r-night-ink: #F7E3EC;
  --hl: #F7C2D6;
  --grad: linear-gradient(135deg, #EEBACD 0%, #EE9DBB 50%, #E97CA2 100%); --grad-2: linear-gradient(90deg, #EFD4DE, #E97CA2, #EFD4DE);
  --shadow: 0 1px 2px rgba(233,124,162,.10), 0 8px 24px rgba(233,124,162,.14);
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg opacity='0.3'%3E%3Cpath transform='translate%2846 52%29 rotate%280%29 scale%281.4%29' d='M0 4 C-7 -2 -9 -8 -4.5 -9.5 C-2 -10.3 -0.5 -8.6 0 -7.2 C0.5 -8.6 2 -10.3 4.5 -9.5 C9 -8 7 -2 0 4Z' fill='%23EE9DBB'/%3E%3Cpath transform='translate%28160 150%29 rotate%280%29 scale%281%29' d='M0 4 C-7 -2 -9 -8 -4.5 -9.5 C-2 -10.3 -0.5 -8.6 0 -7.2 C0.5 -8.6 2 -10.3 4.5 -9.5 C9 -8 7 -2 0 4Z' fill='%23EEBACD'/%3E%3Cpath transform='translate%28176 42%29 rotate%280%29 scale%280.7%29' d='M0 4 C-7 -2 -9 -8 -4.5 -9.5 C-2 -10.3 -0.5 -8.6 0 -7.2 C0.5 -8.6 2 -10.3 4.5 -9.5 C9 -8 7 -2 0 4Z' fill='%23E97CA2'/%3E%3Cg transform='translate%2870 165%29 scale%280.55%29'%3E%3Ccircle cx='0' cy='-9' r='7' fill='%23FFFFFF'/%3E%3Ccircle cx='8.5' cy='-2.8' r='7' fill='%23FFFFFF'/%3E%3Ccircle cx='5.3' cy='7.3' r='7' fill='%23FFFFFF'/%3E%3Ccircle cx='-5.3' cy='7.3' r='7' fill='%23FFFFFF'/%3E%3Ccircle cx='-8.5' cy='-2.8' r='7' fill='%23FFFFFF'/%3E%3Ccircle r='4' fill='%23EE9DBB'/%3E%3C/g%3E%3Ccircle cx='110' cy='95' r='2.5' fill='%23EE9DBB'/%3E%3Ccircle cx='30' cy='120' r='2' fill='%23EEBACD'/%3E%3C/g%3E%3C/svg%3E");
}
html[data-theme="melody"] { --brand-c: #8C2453; --solid: #E890B2; --solid-ink: #3D1428; }
html[data-theme="melody"] .b-title h3, html[data-theme="melody"] .card h3 { color: #8C2453 !important; }
html[data-theme="melody"] .sq-r { background: #F3B3CB !important; } html[data-theme="melody"] .sq-c { background: #F7C9DA !important; } html[data-theme="melody"] .sq-w { background: #EFD4DE !important; } html[data-theme="melody"] .sq-s { background: #F9DCE6 !important; }
html[data-theme="melody"] .req .sq { color: #4A1F33 !important; }
html[data-theme="melody"] .card, html[data-theme="melody"] .card.blurb { background: var(--panel) !important; border-color: #F2C6D6 !important; }
html[data-theme="melody"] .rating { background: #F3B3CB !important; color: #4A1F33 !important; }
html[data-theme="melody"] .top { background: #F4BED2 !important; border-bottom: 0 !important; color: #4A1F33; }
html[data-theme="melody"] .top .brand { color: #4A1F33; } html[data-theme="melody"] .top .brand span { color: #8C2453 !important; } html[data-theme="melody"] .top .brand::before { background: #8C2453 !important; }
html[data-theme="melody"] .top .btn { background: rgba(255,255,255,.55) !important; border-color: rgba(140,36,83,.25) !important; color: #4A1F33 !important; }
html[data-theme="melody"] .top .btn.primary { background: #E97CA2 !important; color: #3D1428 !important; border-color: transparent !important; }
html[data-theme="melody"] .top .icon-btn { color: #4A1F33 !important; }
:root[data-theme="kurokiss"] {
  color-scheme: only light;
  --bg: #F1EEFB;
  --panel: #FCFBFF;
  --panel-2: #E9E4F8;
  --ink: #241A43;
  --ink-2: #463C6C;
  --ink-3: #5C5482;
  --line: #DCD5F2;
  --accent: #514283;
  --accent-2: #CAC5ED;
  --accent-ink: #FFFFFF;
  --accent-soft: #E6E1F7;
  --chip: #EEEAFA;
  --c-char-bg: #E6E1F7;
  --c-char: #40326E;
  --c-tag-bg: #F3F0FC;
  --c-tag: #4F4580;
  --c-rel-bg: #F7DCEC;
  --c-rel: #83275F;
  --c-fan-bg: #E1DDF4;
  --c-fan: #3A2E6A;
  --c-warn-bg: #FFF1D6;
  --c-warn: #7A5A00;
  --blob1: rgba(202,197,237,.50);
  --blob2: rgba(240,195,226,.30);
  --blob3: rgba(223,207,243,.45);
  --r-paper: #FBFAFF;
  --r-paper-ink: #241A43;
  --r-night: #1C1630;
  --r-night-ink: #E7E2F7;
  --hl: #F0C3E2;
  --grad: linear-gradient(135deg, #514283 0%, #7A6BB0 55%, #F0C3E2 100%); --grad-2: linear-gradient(90deg, #CAC5ED, #514283, #F0C3E2, #CAC5ED);
  --shadow: 0 1px 2px rgba(81,66,131,.10), 0 8px 24px rgba(81,66,131,.12);
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg opacity='0.26'%3E%3Cpath transform='translate%2848 50%29 rotate%280%29 scale%281%29' d='M0 -14 C2 -4 4 -2 14 0 C4 2 2 4 0 14 C-2 4 -4 2 -14 0 C-4 -2 -2 -4 0 -14Z' fill='%23CAC5ED'/%3E%3Cpath transform='translate%28160 148%29 rotate%280%29 scale%281.1%29' d='M0 4 C-7 -2 -9 -8 -4.5 -9.5 C-2 -10.3 -0.5 -8.6 0 -7.2 C0.5 -8.6 2 -10.3 4.5 -9.5 C9 -8 7 -2 0 4Z' fill='%23F0C3E2'/%3E%3Cpath transform='translate%28176 40%29 rotate%280%29 scale%280.45%29' d='M0 -14 C2 -4 4 -2 14 0 C4 2 2 4 0 14 C-2 4 -4 2 -14 0 C-4 -2 -2 -4 0 -14Z' fill='%23514283'/%3E%3Cpath transform='translate%2860 170%29 rotate%280%29 scale%280.7%29' d='M0 4 C-7 -2 -9 -8 -4.5 -9.5 C-2 -10.3 -0.5 -8.6 0 -7.2 C0.5 -8.6 2 -10.3 4.5 -9.5 C9 -8 7 -2 0 4Z' fill='%23CAC5ED'/%3E%3Ccircle cx='110' cy='100' r='2.4' fill='%237A6BB0'/%3E%3Ccircle cx='30' cy='120' r='1.8' fill='%23F0C3E2'/%3E%3C/g%3E%3C/svg%3E");
}
html[data-theme="kurokiss"] { --brand-c: #514283; }
html[data-theme="kurokiss"] .b-title h3, html[data-theme="kurokiss"] .card h3 { color: #3E3170 !important; }
html[data-theme="kurokiss"] .sq-r { background: #514283 !important; } html[data-theme="kurokiss"] .sq-c { background: #7A6BB0 !important; } html[data-theme="kurokiss"] .sq-w { background: #CAC5ED !important; } html[data-theme="kurokiss"] .sq-s { background: #F0C3E2 !important; }
html[data-theme="kurokiss"] .sq-w, html[data-theme="kurokiss"] .sq-s { color: #fff !important; }
html[data-theme="kurokiss"] .sq-w, html[data-theme="kurokiss"] .sq-s { color: #241A43 !important; }
html[data-theme="kurokiss"] .top { background: #514283 !important; border-bottom: 0 !important; color: #FFFFFF; }
html[data-theme="kurokiss"] .top .brand { color: #FFFFFF; } html[data-theme="kurokiss"] .top .brand span { color: #F0C3E2 !important; } html[data-theme="kurokiss"] .top .brand::before { background: #F0C3E2 !important; }
html[data-theme="kurokiss"] .top .btn { background: rgba(255,255,255,.12) !important; border-color: rgba(255,255,255,.3) !important; color: #FFFFFF !important; }
html[data-theme="kurokiss"] .top .btn.primary { background: #F0C3E2 !important; color: #2E2350 !important; border-color: transparent !important; }
html[data-theme="kurokiss"] .top .icon-btn { color: #FFFFFF !important; }
:root[data-theme="frosted"] {
  color-scheme: only light;
  --bg: #EDF7F8;
  --panel: #FFFFFF;
  --panel-2: #E2F3F6;
  --ink: #1F2450;
  --ink-2: #41477A;
  --ink-3: #565D8C;
  --line: #CDE7EE;
  --accent: #6159B8;
  --accent-2: #9FE2EE;
  --accent-ink: #FFFFFF;
  --accent-soft: #E5E3F7;
  --chip: #E9F6F8;
  --c-char-bg: #E5E3F7;
  --c-char: #4A43A0;
  --c-tag-bg: #E2F3F7;
  --c-tag: #2B5C68;
  --c-rel-bg: #DCE6F6;
  --c-rel: #35538F;
  --c-fan-bg: #EAF7ED;
  --c-fan: #2D5A3B;
  --c-warn-bg: #FFF1D6;
  --c-warn: #7A5A00;
  --blob1: rgba(159,226,238,.40);
  --blob2: rgba(123,117,201,.18);
  --blob3: rgba(234,247,237,.60);
  --r-paper: #F9FDFE;
  --r-paper-ink: #1F2450;
  --r-night: #151A30;
  --r-night-ink: #E2E8F4;
  --hl: #C9F0F7;
  --grad: linear-gradient(135deg, #9FE2EE 0%, #80A4D4 50%, #7B75C9 100%); --grad-2: linear-gradient(90deg, #E0FAFF, #80A4D4, #7B75C9, #E0FAFF);
  --shadow: 0 1px 2px rgba(123,117,201,.08), 0 8px 24px rgba(128,164,212,.16);
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg opacity='0.28'%3E%3Cpath transform='translate%2850 50%29 rotate%280%29 scale%281%29' d='M0 -14 C2 -4 4 -2 14 0 C4 2 2 4 0 14 C-2 4 -4 2 -14 0 C-4 -2 -2 -4 0 -14Z' fill='%239FE2EE'/%3E%3Cpath transform='translate%28160 150%29 rotate%280%29 scale%280.7%29' d='M0 -14 C2 -4 4 -2 14 0 C4 2 2 4 0 14 C-2 4 -4 2 -14 0 C-4 -2 -2 -4 0 -14Z' fill='%2380A4D4'/%3E%3Cpath transform='translate%28176 40%29 rotate%280%29 scale%280.42%29' d='M0 -14 C2 -4 4 -2 14 0 C4 2 2 4 0 14 C-2 4 -4 2 -14 0 C-4 -2 -2 -4 0 -14Z' fill='%237B75C9'/%3E%3Cpath transform='translate%2870 170%29 rotate%280%29 scale%280.35%29' d='M0 -14 C2 -4 4 -2 14 0 C4 2 2 4 0 14 C-2 4 -4 2 -14 0 C-4 -2 -2 -4 0 -14Z' fill='%239FE2EE'/%3E%3Ccircle cx='110' cy='105' r='2.2' fill='%2380A4D4'/%3E%3Ccircle cx='28' cy='120' r='1.6' fill='%239FE2EE'/%3E%3C/g%3E%3C/svg%3E");
}
html[data-theme="frosted"] { --brand-c: #6159B8; }
html[data-theme="frosted"] .b-title h3, html[data-theme="frosted"] .card h3 { color: #463F9C !important; }
html[data-theme="frosted"] .sq-r { background: #6159B8 !important; } html[data-theme="frosted"] .sq-c { background: #44699C !important; } html[data-theme="frosted"] .sq-w { background: #565D8C !important; } html[data-theme="frosted"] .sq-s { background: #2F8A9C !important; }
html[data-theme="frosted"] .sq-w, html[data-theme="frosted"] .sq-s { color: #fff !important; }
:root[data-theme="spring"] {
  color-scheme: only light;
  --bg: #F8F3EA;
  --panel: #FFFDF8;
  --panel-2: #F4EEF2;
  --ink: #3A2E39;
  --ink-2: #5B4D58;
  --ink-3: #6E626C;
  --line: #E9E0D3;
  --accent: #8C4E77;
  --accent-2: #93BAD9;
  --accent-ink: #FFFFFF;
  --accent-soft: #F4E3EC;
  --chip: #F3F0E8;
  --c-char-bg: #F8E1E9;
  --c-char: #863B5E;
  --c-tag-bg: #E8EFE0;
  --c-tag: #46602F;
  --c-rel-bg: #E2ECF6;
  --c-rel: #365C84;
  --c-fan-bg: #F4EFD6;
  --c-fan: #635617;
  --c-warn-bg: #FFEFD0;
  --c-warn: #7A5200;
  --blob1: rgba(233,198,206,.40);
  --blob2: rgba(147,186,217,.28);
  --blob3: rgba(155,178,123,.22);
  --r-paper: #FFFCF6;
  --r-paper-ink: #3A2E39;
  --r-night: #20242A;
  --r-night-ink: #ECE5DD;
  --hl: #E9C6CE;
  --grad: linear-gradient(135deg, #E9C6CE 0%, #C38FAD 35%, #93BAD9 70%, #9BB27B 100%); --grad-2: linear-gradient(90deg, #E9C6CE, #C38FAD, #93BAD9, #9BB27B);
  --shadow: 0 1px 2px rgba(195,143,173,.10), 0 8px 24px rgba(147,186,217,.16);
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg opacity='0.3'%3E%3Cg transform='translate%2842 50%29 scale%281%29'%3E%3Ccircle cx='0' cy='-9' r='7' fill='%23E9C6CE'/%3E%3Ccircle cx='8.5' cy='-2.8' r='7' fill='%23E9C6CE'/%3E%3Ccircle cx='5.3' cy='7.3' r='7' fill='%23E9C6CE'/%3E%3Ccircle cx='-5.3' cy='7.3' r='7' fill='%23E9C6CE'/%3E%3Ccircle cx='-8.5' cy='-2.8' r='7' fill='%23E9C6CE'/%3E%3Ccircle r='4' fill='%23CFC987'/%3E%3C/g%3E%3Cg transform='translate%28160 150%29 scale%280.7%29'%3E%3Ccircle cx='0' cy='-9' r='7' fill='%23C38FAD'/%3E%3Ccircle cx='8.5' cy='-2.8' r='7' fill='%23C38FAD'/%3E%3Ccircle cx='5.3' cy='7.3' r='7' fill='%23C38FAD'/%3E%3Ccircle cx='-5.3' cy='7.3' r='7' fill='%23C38FAD'/%3E%3Ccircle cx='-8.5' cy='-2.8' r='7' fill='%23C38FAD'/%3E%3Ccircle r='4' fill='%23FFFDF8'/%3E%3C/g%3E%3Cg transform='translate%28172 40%29 scale%280.45%29'%3E%3Ccircle cx='0' cy='-9' r='7' fill='%23C7D7E7'/%3E%3Ccircle cx='8.5' cy='-2.8' r='7' fill='%23C7D7E7'/%3E%3Ccircle cx='5.3' cy='7.3' r='7' fill='%23C7D7E7'/%3E%3Ccircle cx='-5.3' cy='7.3' r='7' fill='%23C7D7E7'/%3E%3Ccircle cx='-8.5' cy='-2.8' r='7' fill='%23C7D7E7'/%3E%3Ccircle r='4' fill='%23E9C6CE'/%3E%3C/g%3E%3Cpath transform='translate%2870 160%29 rotate%280%29' d='M0 0 q10 -14 22 -6 q-8 12 -22 6z' fill='%239BB27B'/%3E%3Cpath transform='translate%28118 80%29 rotate%28-25%29' d='M0 0 q10 -14 22 -6 q-8 12 -22 6z' fill='%239BB27B'/%3E%3Ccircle cx='100' cy='120' r='2.5' fill='%2393BAD9'/%3E%3Ccircle cx='30' cy='190' r='2' fill='%23CFC987'/%3E%3C/g%3E%3C/svg%3E");
}
html[data-theme="spring"] { --brand-c: #8C4E77; }
html[data-theme="spring"] .b-title h3, html[data-theme="spring"] .card h3 { color: #7E4469 !important; }
html[data-theme="spring"] .sq-r { background: #9A5A84 !important; } html[data-theme="spring"] .sq-c { background: #5E7F44 !important; } html[data-theme="spring"] .sq-w { background: #5B4D58 !important; } html[data-theme="spring"] .sq-s { background: #4F7FA8 !important; }
html[data-theme="spring"] .sq-w, html[data-theme="spring"] .sq-s { color: #fff !important; }
:root[data-theme="crimson"] {
  color-scheme: dark;
  --bg: #250202;
  --panel: #3A0C0E;
  --panel-2: #4A1416;
  --ink: #FFF9F2;
  --ink-2: #FFCAD0;
  --ink-3: #D9A3A8;
  --line: #5C1B1E;
  --accent: #FF6B7D;
  --accent-2: #892325;
  --accent-ink: #250202;
  --accent-soft: #4A1416;
  --chip: #320A0C;
  --c-char-bg: #4A1416;
  --c-char: #FFCAD0;
  --c-tag-bg: #320A0C;
  --c-tag: #F3D6D9;
  --c-rel-bg: #6B1A1F;
  --c-rel: #FFF9F2;
  --c-fan-bg: #2C0708;
  --c-fan: #FFB3BD;
  --c-warn-bg: #3A2A10;
  --c-warn: #F0D999;
  --blob1: rgba(137,35,37,.40);
  --blob2: rgba(241,2,34,.12);
  --blob3: rgba(255,202,208,.06);
  --r-paper: #FFF9F2;
  --r-paper-ink: #2A0B0D;
  --r-night: #1A0405;
  --r-night-ink: #F6E1E1;
  --hl: #FFCAD0;
  --grad: linear-gradient(135deg, #F10222 0%, #892325 55%, #250202 100%); --grad-2: linear-gradient(90deg, #892325, #F10222, #FFCAD0, #892325);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.4);
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg opacity='0.2'%3E%3Cpath transform='translate%2850 50%29 rotate%280%29 scale%281%29' d='M0 -14 C2 -4 4 -2 14 0 C4 2 2 4 0 14 C-2 4 -4 2 -14 0 C-4 -2 -2 -4 0 -14Z' fill='%23892325'/%3E%3Cpath transform='translate%28160 140%29 rotate%280%29 scale%280.6%29' d='M0 -14 C2 -4 4 -2 14 0 C4 2 2 4 0 14 C-2 4 -4 2 -14 0 C-4 -2 -2 -4 0 -14Z' fill='%23FFCAD0'/%3E%3Cpath transform='translate%28172 40%29 rotate%280%29 scale%280.35%29' d='M0 -14 C2 -4 4 -2 14 0 C4 2 2 4 0 14 C-2 4 -4 2 -14 0 C-4 -2 -2 -4 0 -14Z' fill='%23F10222'/%3E%3Ccircle cx='100' cy='100' r='1.6' fill='%23FFCAD0'/%3E%3Ccircle cx='40' cy='170' r='1.2' fill='%23F10222'/%3E%3Ccircle cx='200' cy='190' r='1.4' fill='%23FFCAD0'/%3E%3C/g%3E%3C/svg%3E");
}
html[data-theme="crimson"] { --brand-c: #FFCAD0; --solid: #C9021D; --solid-ink: #FFF9F2; }
html[data-theme="crimson"] .b-title h3, html[data-theme="crimson"] .card h3 { color: #FFE3E6 !important; }
html[data-theme="crimson"] .sq-r { background: #FF6B7D !important; } html[data-theme="crimson"] .sq-c { background: #FFCAD0 !important; } html[data-theme="crimson"] .sq-w { background: #D9A3A8 !important; } html[data-theme="crimson"] .sq-s { background: #FFF9F2 !important; }
html[data-theme="crimson"] .req .sq { color: #250202 !important; }
html[data-theme="crimson"] .top { background: #3A0C0E !important; border-bottom: 0 !important; color: #FFF9F2; }
html[data-theme="crimson"] .top .brand { color: #FFF9F2; } html[data-theme="crimson"] .top .brand span { color: #FFCAD0 !important; } html[data-theme="crimson"] .top .brand::before { background: #FFCAD0 !important; }
html[data-theme="crimson"] .top .btn { background: rgba(255,255,255,.08) !important; border-color: rgba(255,202,208,.3) !important; color: #FFF9F2 !important; }
html[data-theme="crimson"] .top .btn.primary { background: #C9021D !important; color: #FFF9F2 !important; border-color: transparent !important; }
html[data-theme="crimson"] .top .icon-btn { color: #FFF9F2 !important; }
html[data-theme="crimson"] select.btn, html[data-theme="crimson"] .tools select, html[data-theme="crimson"] .settings select, html[data-theme="crimson"] .reader-tools select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23FFCAD0' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
html[data-theme="crimson"] .toast-item { box-shadow: 0 10px 30px rgba(0,0,0,.5); }
html[data-theme="crimson"] .dl { color: #FFB3BD !important; }
html[data-theme="crimson"] .fav-btn.on, html[data-theme="crimson"] .fav { color: #FF6B7D !important; }
:root[data-theme="rosepine"] {
  color-scheme: dark;
  --bg: #232136;
  --panel: #2A273F;
  --panel-2: #393552;
  --ink: #E0DEF4;
  --ink-2: #C3C0DE;
  --ink-3: #A29EBC;
  --line: #44415A;
  --accent: #EA9A97;
  --accent-2: #C4A7E7;
  --accent-ink: #232136;
  --accent-soft: #393552;
  --chip: #2A283E;
  --c-char-bg: #393552;
  --c-char: #C4A7E7;
  --c-tag-bg: #2A283E;
  --c-tag: #9CCFD8;
  --c-rel-bg: #3E3A55;
  --c-rel: #EFA9A6;
  --c-fan-bg: #2A283E;
  --c-fan: #F6C177;
  --c-warn-bg: #3B3226;
  --c-warn: #F6C177;
  --blob1: rgba(196,167,231,.14);
  --blob2: rgba(234,154,151,.10);
  --blob3: rgba(62,143,176,.12);
  --r-paper: #FAF4ED;
  --r-paper-ink: #575279;
  --r-night: #232136;
  --r-night-ink: #E0DEF4;
  --hl: #F6C177;
  --grad: linear-gradient(135deg, #EA9A97 0%, #C4A7E7 55%, #3E8FB0 100%); --grad-2: linear-gradient(90deg, #C4A7E7, #EA9A97, #F6C177, #9CCFD8);
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.3);
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg opacity='0.18'%3E%3Cg transform='translate%2846 50%29 scale%280.8%29'%3E%3Ccircle cx='0' cy='-9' r='7' fill='%23C4A7E7'/%3E%3Ccircle cx='8.5' cy='-2.8' r='7' fill='%23C4A7E7'/%3E%3Ccircle cx='5.3' cy='7.3' r='7' fill='%23C4A7E7'/%3E%3Ccircle cx='-5.3' cy='7.3' r='7' fill='%23C4A7E7'/%3E%3Ccircle cx='-8.5' cy='-2.8' r='7' fill='%23C4A7E7'/%3E%3Ccircle r='4' fill='%23F6C177'/%3E%3C/g%3E%3Cpath transform='translate%28160 150%29 rotate%280%29 scale%280.6%29' d='M0 -14 C2 -4 4 -2 14 0 C4 2 2 4 0 14 C-2 4 -4 2 -14 0 C-4 -2 -2 -4 0 -14Z' fill='%23EA9A97'/%3E%3Cg transform='translate%28176 40%29 scale%280.4%29'%3E%3Ccircle cx='0' cy='-9' r='7' fill='%239CCFD8'/%3E%3Ccircle cx='8.5' cy='-2.8' r='7' fill='%239CCFD8'/%3E%3Ccircle cx='5.3' cy='7.3' r='7' fill='%239CCFD8'/%3E%3Ccircle cx='-5.3' cy='7.3' r='7' fill='%239CCFD8'/%3E%3Ccircle cx='-8.5' cy='-2.8' r='7' fill='%239CCFD8'/%3E%3Ccircle r='4' fill='%23232136'/%3E%3C/g%3E%3Cpath transform='translate%2870 160%29 rotate%280%29' d='M0 0 q10 -14 22 -6 q-8 12 -22 6z' fill='%233E8FB0'/%3E%3Ccircle cx='110' cy='100' r='1.8' fill='%23F6C177'/%3E%3Ccircle cx='30' cy='120' r='1.4' fill='%23EA9A97'/%3E%3C/g%3E%3C/svg%3E");
}
html[data-theme="rosepine"] { --brand-c: #EA9A97; }
html[data-theme="rosepine"] .b-title h3, html[data-theme="rosepine"] .card h3 { color: #E0DEF4 !important; }
html[data-theme="rosepine"] .sq-r { background: #EA9A97 !important; } html[data-theme="rosepine"] .sq-c { background: #C4A7E7 !important; } html[data-theme="rosepine"] .sq-w { background: #908CAA !important; } html[data-theme="rosepine"] .sq-s { background: #9CCFD8 !important; }
html[data-theme="rosepine"] .req .sq { color: #232136 !important; }
html[data-theme="rosepine"] select.btn, html[data-theme="rosepine"] .tools select, html[data-theme="rosepine"] .settings select, html[data-theme="rosepine"] .reader-tools select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23C4A7E7' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
html[data-theme="rosepine"] .toast-item { box-shadow: 0 10px 30px rgba(0,0,0,.5); }
html[data-theme="rosepine"] .dl { color: #9CCFD8 !important; }
html[data-theme="rosepine"] .fav-btn.on, html[data-theme="rosepine"] .fav { color: #EB6F92 !important; }
html[data-theme="rosepine"] .cm-rate { color: #F6C177 !important; }
:root[data-theme="supernova"] {
  color-scheme: dark;
  --bg: #000000;
  --panel: #100021;
  --panel-2: #170331;
  --ink: #ECE7F5;
  --ink-2: #B9ADC7;
  --ink-3: #9A93AD;
  --line: #25183D;
  --accent: #A3A7C9;
  --accent-2: #B9ADC7;
  --accent-ink: #000130;
  --accent-soft: #1A1240;
  --chip: #120328;
  --c-char-bg: #1C0C3A;
  --c-char: #D6CFE6;
  --c-tag-bg: #0A0A2A;
  --c-tag: #C4C7E0;
  --c-rel-bg: #241048;
  --c-rel: #ECE7F5;
  --c-fan-bg: #00013A;
  --c-fan: #B9BDE0;
  --c-warn-bg: #2A2410;
  --c-warn: #F0D999;
  --blob1: rgba(16,0,33,.8);
  --blob2: rgba(0,1,48,.7);
  --blob3: rgba(163,167,201,.06);
  --r-paper: #F4F1F8;
  --r-paper-ink: #100021;
  --r-night: #000000;
  --r-night-ink: #D9D2E6;
  --hl: #B9ADC7;
  --grad: linear-gradient(135deg, #000130 0%, #100021 45%, #B9ADC7 100%); --grad-2: linear-gradient(90deg, #000130, #A3A7C9, #B9ADC7, #000130);
  --shadow: 0 1px 2px rgba(0,0,0,.6), 0 8px 24px rgba(16,0,33,.6);
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg opacity='0.3'%3E%3Cpath transform='translate%2850 50%29 rotate%280%29 scale%280.9%29' d='M0 -14 C2 -4 4 -2 14 0 C4 2 2 4 0 14 C-2 4 -4 2 -14 0 C-4 -2 -2 -4 0 -14Z' fill='%23B9ADC7'/%3E%3Cpath transform='translate%28160 140%29 rotate%280%29 scale%280.5%29' d='M0 -14 C2 -4 4 -2 14 0 C4 2 2 4 0 14 C-2 4 -4 2 -14 0 C-4 -2 -2 -4 0 -14Z' fill='%23A3A7C9'/%3E%3Cpath transform='translate%28172 40%29 rotate%280%29 scale%280.3%29' d='M0 -14 C2 -4 4 -2 14 0 C4 2 2 4 0 14 C-2 4 -4 2 -14 0 C-4 -2 -2 -4 0 -14Z' fill='%23ECE7F5'/%3E%3Ccircle cx='100' cy='100' r='1.4' fill='%23ECE7F5'/%3E%3Ccircle cx='40' cy='170' r='1.1' fill='%23A3A7C9'/%3E%3Ccircle cx='200' cy='190' r='1.2' fill='%23B9ADC7'/%3E%3Ccircle cx='130' cy='30' r='0.9' fill='%23ECE7F5'/%3E%3Ccircle cx='15' cy='90' r='0.8' fill='%23B9ADC7'/%3E%3Ccircle cx='205' cy='95' r='1' fill='%23A3A7C9'/%3E%3C/g%3E%3C/svg%3E");
}
html[data-theme="supernova"] { --brand-c: #B9ADC7; }
html[data-theme="supernova"] .b-title h3, html[data-theme="supernova"] .card h3 { color: #ECE7F5 !important; }
html[data-theme="supernova"] .sq-r { background: #A3A7C9 !important; } html[data-theme="supernova"] .sq-c { background: #B9ADC7 !important; } html[data-theme="supernova"] .sq-w { background: #7E7896 !important; } html[data-theme="supernova"] .sq-s { background: #D6CFE6 !important; }
html[data-theme="supernova"] .req .sq { color: #000130 !important; }
html[data-theme="supernova"] .top { background: #000130 !important; border-bottom: 0 !important; color: #ECE7F5; }
html[data-theme="supernova"] .top .brand { color: #ECE7F5; } html[data-theme="supernova"] .top .brand span { color: #B9ADC7 !important; } html[data-theme="supernova"] .top .brand::before { background: #B9ADC7 !important; }
html[data-theme="supernova"] .top .btn { background: rgba(185,173,199,.10) !important; border-color: rgba(185,173,199,.3) !important; color: #ECE7F5 !important; }
html[data-theme="supernova"] .top .btn.primary { background: #A3A7C9 !important; color: #000130 !important; border-color: transparent !important; }
html[data-theme="supernova"] .top .icon-btn { color: #ECE7F5 !important; }
html[data-theme="supernova"] select.btn, html[data-theme="supernova"] .tools select, html[data-theme="supernova"] .settings select, html[data-theme="supernova"] .reader-tools select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23B9ADC7' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
html[data-theme="supernova"] .toast-item { box-shadow: 0 10px 30px rgba(0,0,0,.5); }
html[data-theme="supernova"] .dl { color: #A3A7C9 !important; }
html[data-theme="supernova"] .fav-btn.on, html[data-theme="supernova"] .fav { color: #B9ADC7 !important; }
/* theme picker: Light / Dark section titles (one scrolling list, not folded) */
.tp-sec { margin: 12px 4px 4px; font: 600 11px var(--ui, inherit); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.tp-head + .tp-sec { margin-top: 2px; }

/* ---------- readability touch-ups (all themes): small text dark/light enough to read comfortably ---------- */
.reader-bar #readerBack, .reader-bar #readerBack .rb-lbl { color: var(--rink) !important; }
.wip { color: var(--c-warn) !important; }
.theme-opt.on small { color: var(--ink-2); }
.reader-pct { color: color-mix(in srgb, var(--rink) 85%, transparent) !important; }
html:root[data-theme="blossom"] { --accent: #B53864; }
html:root[data-theme="peony"] { --accent: #975960; }
html:root[data-theme="matcha"] { --accent: #497452; }
html:root[data-theme="lemon"] { --accent: #2C7482; }
html:root[data-theme="lilac"] { --accent: #775BA2; }
html:root[data-theme="violatte"] { --accent: #805CAB; }
html:root[data-theme="sunset"] { --c-char: #1C748D; }
html:root[data-theme="lavender"] { --ink-3: #BAB2D4; }
html:root[data-theme="blossom"] { --c-tag: #9A4915; }

/* ---------- All fics | My library tabs ---------- */
.scope-tabs { display: flex; gap: 4px; margin: 0 0 12px; border-bottom: 1px solid var(--line); }
.scope-tab { position: relative; background: none; border: 0; padding: 8px 14px 10px; font: 600 15px var(--ui, inherit); color: var(--ink-3); cursor: pointer; }
.scope-tab span { font-weight: 500; font-size: 12.5px; opacity: .8; margin-left: 2px; }
.scope-tab:hover { color: var(--ink); }
.scope-tab.on { color: var(--ink); }
.scope-tab.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--solid, var(--accent)); }
/* page numbers above the list too */
.more-top { display: flex; justify-content: center; margin: 0 0 12px; }
.more-top:empty { display: none; }
/* back to top */
.to-top { position: fixed; right: 18px; bottom: calc(22px + env(safe-area-inset-bottom)); z-index: 25; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-size: 20px; line-height: 1; cursor: pointer; box-shadow: 0 4px 16px rgba(0,0,0,.14); }
.to-top:hover { background: var(--panel-2); }
.to-top[hidden] { display: none; }
/* "You finished it" card at the end of a fic */
.end-card { max-width: 560px; margin: 48px auto 24px; padding: 18px 20px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--rink) 16%, transparent); background: color-mix(in srgb, var(--rink) 5%, var(--rbg)); font: 15px/1.55 var(--ui, sans-serif); color: var(--rink); text-align: left; }
.end-card[hidden] { display: none; }
.end-card b { display: block; font: 600 18px var(--serif); margin-bottom: 6px; }
.end-card p { margin: 6px 0; font-size: 14.5px !important; line-height: 1.55 !important; color: color-mix(in srgb, var(--rink) 94%, transparent); text-indent: 0 !important; }
.end-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 12px; }
.end-btns .btn { text-decoration: none; color: var(--rink); border-color: color-mix(in srgb, var(--rink) 25%, transparent); background: transparent; }
.end-btns .linkbtn { color: color-mix(in srgb, var(--rink) 94%, transparent); font-size: 14px; }
.end-sentinel { height: 1px; }
/* quiet support line at the bottom of the Aa menu */
.aa-support { display: block; width: 100%; margin-top: 10px; padding-top: 10px; border-top: 1px solid color-mix(in srgb, var(--rink, var(--ink)) 12%, transparent); text-align: left; font-size: 13px; }
/* top page numbers: small, only from page 2 */
.pager.pager-sm { gap: 4px; }
.pager.pager-sm .pg { min-width: 28px; padding: 3px 8px; font-size: 12.5px; border-radius: 6px; }
.more-top { margin: 0 0 8px; }
/* back to top: centred with the page numbers at the bottom */
.to-top-btn { font-size: 13px; padding: 5px 14px; }
#more.more { height: auto; min-height: 40px; }
.scan-banner { position: relative; } .scan-banner .cap-x { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; font-size: 14px; color: var(--ink-3); } .scan-banner:has(.cap-x) { padding-right: 40px; }
/* "What's new" note */
.wn { position: relative; width: min(400px, 100%); text-align: center; padding: 22px 22px 18px; }
.wn h3 { margin: 0 0 6px; font: 600 22px var(--serif); }
.wn-x { position: absolute; top: 8px; right: 8px; }
.wn-heart { color: var(--solid, var(--accent)); margin: 4px auto 10px; width: 56px; animation: wnBeat 1.6s ease-in-out infinite; transform-origin: center; }
@keyframes wnBeat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.14); } 30% { transform: scale(1); } 45% { transform: scale(1.1); } 60% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .wn-heart { animation: none; } }
.wn-list { list-style: none; margin: 0 auto; padding: 0; text-align: left; display: grid; gap: 7px; font-size: 14px; line-height: 1.45; color: var(--ink-2); max-width: 330px; }
.wn-list li { position: relative; padding-left: 18px; }
.wn-list li::before { content: "✦"; position: absolute; left: 0; top: 1px; font-size: 11px; color: var(--accent); }
.wn-list b { color: var(--ink); }
.wn-note { margin: 12px 0 0; font-size: 12.5px; color: var(--ink-3); }
.wn-sign { margin: 10px 0 0; font: italic 600 16px var(--serif); color: var(--ink); }
.wn-btns { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 14px; }
.wn-btns .btn { min-width: 160px; justify-content: center; }
.wn-btns .linkbtn { font-size: 13px; }
.wn .wn-note { margin-top: 14px !important; } .wn .wn-sign { margin-top: 10px !important; }
/* "What's new" art: the book GIF on a soft circle so its white pages show on every theme */
.wn-art { width: 132px; height: 132px; margin: 6px auto 12px; border-radius: 50%; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 34%, var(--panel)) 0%, color-mix(in srgb, var(--accent) 16%, var(--panel)) 70%); }
.wn-art img { width: 150px; height: 150px; display: block; }
.wn-sign .wn-heart { display: inline-block; width: auto; margin: 0 0 0 4px; vertical-align: -1px; animation-duration: 1.8s; }
@media (prefers-reduced-motion: reduce) { .wn-art img { content: none; } .wn-art { display: none; } }
.wn-art { width: 140px; height: 140px; } .wn-art img { width: 250px; height: 250px; max-width: none; }
.wn-art { position: relative; } .wn-art img { position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%); }
/* What's new: a tinted header band (with the theme's own faint pattern) instead of a circle */
.wn { overflow: hidden; padding-top: 0 !important; }
.wn-hero { margin: 0 -22px 14px; padding: 20px 22px 4px; text-align: center;
  background-color: color-mix(in srgb, var(--accent) 13%, var(--panel)); background-image: var(--pattern); background-size: 160px;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line)); }
.wn-hero h3 { margin: 0; }
.wn-art { width: 150px !important; height: 104px !important; margin: 0 auto !important; border-radius: 0 !important; background: none !important; overflow: hidden; }
.wn-art img { width: 210px !important; height: 210px !important; top: 50% !important; }
.wn-x { z-index: 2; }

/* keeping libraries safe: protection note (Drive link panel) and backup reminder */
.protect { margin: 12px 0 4px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.protect.warn { background: var(--accent-soft); }
.protect.ok { background: transparent; }
.protect.ok span { color: var(--accent); font-weight: 700; margin-right: 4px; }
.protect p { margin: 0 0 8px; }
.protect b { color: var(--ink); }
.protect .src-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.backup-note .bn-btns { display: flex; align-items: center; gap: 10px; flex: none; }
@media (max-width: 860px) { .backup-note { flex-wrap: wrap; } .backup-note .bn-btns { width: 100%; } }
/* three-button dialogs on phones: the main choice gets its own row so nothing runs off the screen */
@media (max-width: 860px) {
  .dlg-btns { flex-wrap: wrap; }
  .dlg-btns .btn { min-width: 0; }
  .dlg-btns:has(> .btn:nth-child(3)) .btn[data-a="1"] { flex-basis: 100%; order: -1; }
}

/* ---- Fic panel: ⋯ menu next to ✕, one Files list with a ⋯ per file ---- */
.d-topbtns { position: absolute; top: 14px; right: 14px; display: flex; gap: 6px; z-index: 2; }
.d-topbtns .d-close { position: static !important; }
.d-head > .chips { padding-right: 96px; min-height: 30px; }
.d-more { font-size: 20px; line-height: 1; letter-spacing: 1px; }
@media (max-width: 860px) { .d-topbtns { top: calc(10px + env(safe-area-inset-top)); right: 10px; } .d-more { width: 42px; height: 42px; } .d-head > .chips { padding-right: 104px; } }
.d-files summary { display: flex; align-items: baseline; gap: 10px; cursor: pointer; }
.d-files summary h3 { margin: 0; }
.d-files-kinds { font-size: 12px; color: var(--ink-2); }
.d-file { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.d-file:first-of-type { margin-top: 8px; }
.d-file-info { flex: 1; min-width: 0; font-size: 13.5px; color: var(--ink); overflow-wrap: anywhere; }
.d-file-info small { display: block; color: var(--ink-2); font-size: 12px; margin-top: 2px; }
.d-file-off { color: var(--r-g); }
.d-file-btns { display: flex; align-items: center; gap: 4px; flex: none; }
.btn.btn-sm { padding: 5px 12px; min-height: 32px; font-size: 13px; }
.d-file-btns .icon-btn { font-size: 18px; width: 36px; height: 36px; }
/* the menu itself */
.pop-menu { position: fixed; z-index: 200; min-width: 200px; max-width: calc(100vw - 16px); padding: 6px; border-radius: 12px; background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.22); animation: aiIn .15s ease-out; }
.pm-item { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 8px; font-size: 14px; color: var(--ink); background: transparent; min-height: 40px; }
.pm-item:hover, .pm-item:focus-visible { background: var(--accent-soft); outline: none; }
.pm-item.danger { color: var(--r-e); }
.pm-sep { height: 1px; background: var(--line); margin: 4px 6px; }
/* Edit details form */
.edit-dlg { max-width: 560px; max-height: 88vh; overflow-y: auto; display: grid; gap: 10px; }
.edit-dlg label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--ink); }
.edit-dlg label small { font-weight: 400; color: var(--ink-2); }
.edit-dlg input, .edit-dlg select, .edit-dlg textarea { font: inherit; font-weight: 400; font-size: 14px; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2, var(--panel)); color: var(--ink); width: 100%; box-sizing: border-box; }
.edit-dlg textarea { resize: vertical; }
.ed-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ed-lead { margin: -4px 0 4px; font-size: 13px; }
.ed-err { color: var(--r-e); font-size: 13px; margin: 0; }
.edit-dlg .dlg-btns { position: sticky; bottom: -20px; background: var(--panel); padding-top: 10px; flex-wrap: wrap; }
.edit-dlg .dlg-btns [data-ed-reset] { margin-right: auto; }
@media (max-width: 860px) { .edit-dlg { max-height: 92vh; } .ed-row { grid-template-columns: 1fr; } }
.d-edited { font-size: 12px; color: var(--ink-2); margin-left: 8px; font-style: italic; }
.drawer .d-head { background-color: var(--panel); }  /* the sticky top stays solid while the panel scrolls under it */
.shuffle-btn { flex: none; width: 38px; height: 38px; color: var(--ink-2); }
/* hidden tags: one tidy section at the bottom of the filters */
.hid-chip { cursor: pointer; border: 0; font: inherit; }
.hid-sec h4 { cursor: pointer; }
.hid-note { font-size: 12px; color: var(--ink-2); margin: 4px 0 8px; }
.hid-grp h5 { margin: 10px 0 4px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.hid-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; color: var(--ink); }
.hid-row span { flex: 1; min-width: 0; overflow-wrap: anywhere; text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--r-e) 60%, transparent); }
.hid-row .linkbtn { flex: none; font-size: 12.5px; }
.hid-all { margin-top: 10px; width: 100%; }
/* ---- Select mode ---- */
.sel-btn { flex: none; }
.sel-btn[aria-pressed="true"] { background: var(--accent-soft); }
.sel-box { position: absolute; top: 12px; right: 12px; width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--ink-2); background: var(--panel);
  display: grid; place-items: center; font-weight: 700; font-size: 15px; color: var(--accent-ink); z-index: 2; }
.sel-box.on { background: var(--accent); border-color: var(--accent); }
body.selecting #list .card { cursor: pointer; user-select: none; }
body.selecting #list .card.selected { outline: 2px solid var(--accent); outline-offset: -2px; }
body.selecting #list .card a, body.selecting #list .card .tagl { pointer-events: none; }
body.selecting { padding-bottom: 96px; }
.sel-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 60; width: min(760px, calc(100vw - 20px));
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 16px;
  background: var(--panel); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 12px 34px rgba(0,0,0,.25); }
.sel-count { font-size: 14px; display: flex; align-items: center; gap: 10px; }
.sel-count .linkbtn { font-size: 13px; }
.sel-acts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sel-acts .btn:disabled, .sel-acts .icon-btn:disabled { opacity: .45; pointer-events: none; }
#selFav { min-width: 44px; font-size: 16px; }
#selMore { font-size: 20px; width: 40px; height: 40px; }
@media (max-width: 860px) {
  .sel-bar { bottom: 0; width: 100vw; border-radius: 16px 16px 0 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
  .sel-acts { width: 100%; display: grid; grid-template-columns: 1fr auto 1fr auto auto; }
  .sel-acts .btn { padding-left: 8px; padding-right: 8px; }
}
body.selecting #toasts { bottom: calc(150px + env(safe-area-inset-bottom)) !important; }
@media (min-width: 861px) { body.selecting #toasts { bottom: 96px !important; } }
/* sub-shelves in the sidebar */
.ms-row { display: flex; align-items: center; }
.ms-row > a { flex: 1; min-width: 0; }
.ms-tw, .ms-tw-sp { flex: none; width: 24px; height: 28px; font-size: 11px; color: var(--ink-2); padding: 0; }
.ms-sub { padding-left: 20px; }
.ms-sub > a span:first-child::before { content: "↳ "; color: var(--ink-2); }
.ms-chip-sub { font-size: 12px; }
/* after finishing a fic: a gentle "Rate it?" under the main buttons */
.d-rate-nudge { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding: 8px 12px;
  border-radius: 12px; background: var(--accent-soft); color: var(--ink); font-size: 14px; font-weight: 600; animation: aiIn .3s ease-out; }
.d-rate-nudge .star { font-size: 22px; padding: 2px 4px; min-width: 34px; min-height: 34px; color: var(--accent); background: transparent; }
/* PDFs: "Keep the PDF's own colours" turns off recolouring in Sepia and Night */
.reader.pdf-orig .pdf-page canvas { filter: none !important; }
.reader.pdf-orig[data-rt="dark"] .pdf-page { background: #fff; }
/* night: old-style <font color> from a file can't make text vanish into the dark page */
.reader[data-rt="dark"] .book font[color] { color: inherit; }
/* welcome note */
.wn { max-height: 92vh; overflow-y: auto; }
.wl-lead { margin: 0 auto 12px; max-width: 330px; font-size: 14.5px; line-height: 1.5; color: var(--ink); }
.wn-welcome .wn-list { gap: 8px; }
@media (max-width: 860px) { .wn { max-height: 88vh; } }
/* readable in every theme: "remove" items are red-tinted ink, not pure red; "on this device" is ink with a green dot */
.pm-item.danger { color: color-mix(in srgb, #c0392b 26%, var(--ink)); font-weight: 600; }
.d-file-off { color: var(--ink-2); }
.d-file-off::before { content: "● "; color: var(--r-g); }
.sel-box { padding: 0; cursor: pointer; }

/* ---- Stats tab ---- */
body.stats-on #list, body.stats-on #more, body.stats-on #moreTop, body.stats-on #shelfChips, body.stats-on #scanBanner, body.stats-on #empty,
body.stats-on .toolbar .tools, body.stats-on #activeFilters, body.stats-on #count, body.stats-on .loading-row { display: none !important; }
.stats-view { padding-bottom: 40px; }
.sg-head h2 { font: 600 26px var(--serif); margin: 2px 0 2px; color: var(--ink); }
.sg-head p { color: var(--ink-2); margin: 0 0 14px; font-size: 14px; }
.sg-grid { display: grid; gap: 14px; }
.sg-tiles { grid-template-columns: repeat(3, 1fr); }
.sg-row2 { grid-template-columns: 2fr 1fr; margin-top: 14px; }
.sg-row3 { grid-template-columns: repeat(3, 1fr); margin-top: 14px; }
.sg-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; box-shadow: var(--shadow); color: var(--ink); min-width: 0; }
.sg-card h3 { font: 600 18px var(--serif); margin: 0; }
.sg-tile .lbl { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); font-weight: 600; }
.sg-tile .big { font: 600 34px/1.1 var(--serif); margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.sg-tile .hint, .sg-streak .hint { font-size: 13px; color: var(--ink-2); }
.sg-hero { background: linear-gradient(135deg, var(--accent-soft), var(--panel)); }
.sg-ch-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.sg-ch-head .seg { display: flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 3px; }
.sg-ch-head .seg button { border-radius: 8px; padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--ink-2); background: transparent; }
.sg-ch-head .seg button.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.sg-chart { position: relative; }
.sg-chart svg { display: block; max-width: 100%; height: auto; overflow: visible; }
.sg-gl { stroke: var(--line); stroke-width: 1; }
.sg-ax { font-size: 11px; fill: var(--ink-2); }
.sg-ax-fut { opacity: .45; }   /* months that haven't happened yet this year */
.sg-val { font-size: 11.5px; font-weight: 700; fill: var(--ink); }
.sg-bar { fill: var(--accent); }
.sg-hit { cursor: pointer; }
.sg-tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--panel); font-size: 12.5px; padding: 6px 9px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, -115%); opacity: 0; transition: opacity .1s; }
.sg-tip.on { opacity: 1; }
.sg-st { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.sg-st .flame { font-size: 32px; }
.sg-st .big { font: 600 32px var(--serif); }
.sg-dots { display: flex; gap: 6px; margin: 10px 0 6px; flex-wrap: wrap; }
.sg-dot { width: 28px; height: 28px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 11px; color: var(--ink-2); }
.sg-dot.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.sg-kv { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.sg-kv b { font-variant-numeric: tabular-nums; text-align: right; }
.sg-hb { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; font-size: 13.5px; margin-top: 10px; }
.sg-hb .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-hb .v { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.sg-hb .bar { grid-column: 1 / -1; height: 8px; border-radius: 0 4px 4px 0; background: var(--accent); margin-bottom: 8px; }
.sg-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.sg-empty { color: var(--ink-2); font-size: 13.5px; margin: 10px 0 0; }
.sg-foot { color: var(--ink-2); font-size: 12.5px; margin: 14px 2px 0; }
.sg-start { margin-top: 8px; }
@media (max-width: 860px) {
  .sg-tiles { grid-template-columns: 1fr 1fr; } .sg-tiles .sg-hero { grid-column: 1 / -1; }
  .sg-row2, .sg-row3 { grid-template-columns: 1fr; }
  .sg-tile .big { font-size: 28px; }
}
/* filters don't apply to Stats, so the sidebar steps aside and Stats gets the full width */
body.stats-on .layout { grid-template-columns: minmax(0, 1fr) !important; }
body.stats-on #sidebar, body.stats-on .toolbar { display: none !important; }
body.stats-on .scope-tabs { margin-top: 6px; }
.nm-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
/* What's new: one short line per point */
.wn-crisp { gap: 8px; font-size: 14.5px; }
.wn-crisp li { white-space: normal; }
@media (max-width: 340px) { .wn-crisp li { white-space: normal; } }
/* fic page: Read on its own row on phones, then ♥ · Status · Shelves */
.d-status, .d-shelves { gap: 6px; }
@media (max-width: 860px) {
  .d-actions { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .d-actions > [data-read], .d-actions > [data-needfile] { grid-column: 1 / -1; }
  .d-actions .btn { padding: 8px 8px !important; font-size: 14px !important; justify-content: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
/* menus: section headings and ticks */
.pm-head { padding: 8px 12px 4px; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); }
.pm-item.pm-check { display: flex; align-items: center; gap: 8px; }
.pm-tick { width: 16px; flex: none; opacity: 0; color: var(--accent); font-weight: 700; }
.pm-item.on .pm-tick { opacity: 1; }
.pm-item.on { font-weight: 600; }
.pop-menu { max-height: min(70vh, 460px); overflow-y: auto; }
/* sidebar: Status group */
.sb-group { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.sb-group h4 { margin: 0 0 4px; padding: 0 12px; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); }
/* hidden things inside each tag group */
.hid-toggle { display: block; margin: 6px 0 0; padding: 4px 0; font-size: 12.5px; color: var(--ink-2); background: none; border: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.hid-rows { margin: 2px 0 4px; padding-left: 6px; border-left: 2px solid var(--line); }
/* Undo inside a message */
.t-undo { flex: none; font: inherit; font-weight: 700; color: var(--accent); background: none; border: 0; padding: 4px 8px; border-radius: 8px; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
/* a message with Undo: icon · text · Undo · ✕ on one line */
.toast-item:has(.t-undo) { grid-template-columns: 26px 1fr auto 28px; align-items: center; }
.toast-item .t-undo { padding: 4px 6px; }
/* small headings in menus and the sidebar: full ink so they read clearly in every theme */
.pm-head, .sb-group h4 { color: var(--ink); }
/* "+10 more" sits on the same line as the tags, shaped like them but quieter */
.chips { align-items: center; }
.chip.more { display: inline-flex; align-items: center; background: transparent; border: 1px dashed var(--line); color: var(--ink-2); font-size: 12.5px; cursor: default; }
html .chips .chip.more { display: inline-flex !important; align-self: center !important; height: auto !important; min-height: 0 !important; line-height: 1.5 !important; padding: 1px 8px !important; }
/* footer: three clear lines */
.foot .foot-l { margin: 0 0 4px; }
.foot .foot-l:last-child { margin-bottom: 0; }
/* phone filter sheet: Status and My shelves each get their own full row of buttons */
@media (max-width: 860px) {
  .shelves .sb-group, .shelves .my-shelves { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
  .shelves .sb-group h4, .shelves .my-shelves h4 { flex: 1 1 100%; margin: 4px 0 2px; padding: 0; }
  .shelves .my-shelves .ms-row { flex: none; }
}
/* fic page buttons: the main one on its own row, then ♥ · Status · Shelves together (every screen size) */
.drawer .d-actions { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.drawer .d-actions > [data-read], .drawer .d-actions > [data-needfile] { grid-column: 1 / -1; justify-content: center; }
.drawer .d-actions .btn { justify-content: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* ===== Menus: "soft with icons" style (all ⋯ / ▾ menus) ===== */
:root { --pm-danger: #c0392b; }
:root[data-theme="lavender"], :root[data-theme="celadon"], :root[data-theme="midnight"], :root[data-theme="bryn"], :root[data-theme="rosepine"], :root[data-theme="supernova"], :root[data-theme="vae"], :root[data-theme="sofia"], :root[data-theme="monokai"], :root[data-theme="abyssal"], :root[data-theme="duskbloom"], :root[data-theme="inkjellies"], :root[data-theme="duskydarkpurple"], :root[data-theme="starry"], :root[data-theme="auroragreen"], :root[data-theme="aurorarosa"], :root[data-theme="auroraviolet"], :root[data-theme="synthwave"], :root[data-theme="neoncity"], :root[data-theme="acidrain"] { --pm-danger: #ff9a9a; }
:root[data-theme="crimson"] { --pm-danger: #ffc2c2; }
html .pop-menu { padding: 8px; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); background: var(--panel); min-width: 220px;
  box-shadow: 0 2px 6px rgba(0,0,0,.08), 0 18px 40px rgba(0,0,0,.2); }
html .pop-menu .pm-item { -webkit-appearance: none; appearance: none; border: 0 !important; outline: none; box-shadow: none; background: transparent;
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 40px; padding: 9px 12px; border-radius: 11px;
  font-size: 14.5px; font-weight: 500; color: var(--ink); cursor: pointer; text-align: left; }
html .pop-menu .pm-item .pm-lbl { flex: 1 1 auto; min-width: 0; }
html .pop-menu .pm-ic { display: inline-flex; flex: none; color: var(--ink-3); }
html .pop-menu .pm-item:hover, html .pop-menu .pm-item:focus-visible { background: var(--accent-soft); }
html .pop-menu .pm-item:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
html .pop-menu .pm-item:hover .pm-ic, html .pop-menu .pm-item:focus-visible .pm-ic { color: var(--accent); }
html .pop-menu .pm-item.danger, html .pop-menu .pm-item.danger .pm-ic { color: var(--pm-danger); font-weight: 600; }
html .pop-menu .pm-item.danger:hover, html .pop-menu .pm-item.danger:focus-visible { background: color-mix(in srgb, var(--pm-danger) 14%, transparent); }
html .pop-menu .pm-item.pm-add, html .pop-menu .pm-item.pm-add .pm-ic { color: var(--accent); font-weight: 600; }
html .pop-menu .pm-sep { height: 1px; background: var(--line); margin: 6px 10px; }
html .pop-menu .pm-head { padding: 6px 12px 4px; font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink-2); }
html .pop-menu .pm-cnt { flex: none; margin-left: 8px; font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
html .pop-menu .pm-dot { flex: none; width: 12px; height: 12px; margin: 0 2px; border-radius: 50%; border: 2px solid var(--ink-3); }
html .pop-menu .pm-cb { flex: none; width: 18px; height: 18px; border-radius: 5px; border: 2px solid var(--ink-3); display: grid; place-items: center; color: transparent; }
html .pop-menu .pm-item.on { font-weight: 600; background: var(--accent-soft); }
html .pop-menu .pm-item.on .pm-dot { background: var(--accent); border-color: var(--accent); }
html .pop-menu .pm-item.on .pm-cb { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
html .pop-menu .pm-tick { display: none; }
/* About page: How do I…? */
.about .faq-hint { margin: 0 0 6px; color: var(--ink-2); font-size: 13.5px; }
.about .faq-group { font: 600 13px/1.3 var(--ui); color: var(--ink-2); margin: 18px 0 6px; }
.about details { border-top: 1px solid var(--line); }
.about details:last-of-type { border-bottom: 1px solid var(--line); }
.about details summary { cursor: pointer; padding: 11px 4px; font-weight: 600; font-size: 14.5px; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.about details summary::-webkit-details-marker { display: none; }
.about details summary::after { content: "+"; color: var(--accent); font-weight: 700; }
.about details[open] summary::after { content: "−"; }
.about details > :not(summary) { margin: 0 4px 10px; font-size: 14.5px; }
.about details ol, .about details ul { padding-left: 22px; }
.about details li { margin: 4px 0; }
.wn-more { text-align: center; margin: 6px 0 0; font-size: 14px; }
.wn-more a { color: var(--accent); font-weight: 600; }
/* text fields never touch or hide under the buttons below them */
.dlg .pd-lbl { margin-bottom: 20px; }
.dlg .pd-lbl input:focus { outline-offset: 2px; }
.edit-dlg .dlg-btns, .ch-dlg .dlg-btns { border-top: 1px solid var(--line); box-shadow: 0 -10px 16px -10px rgba(0,0,0,.18); padding-top: 12px; padding-bottom: 4px; margin-top: 16px; z-index: 2; }
/* tablets (iPad): Page width works, in both directions */
.book:focus { outline: none; }
@media (min-width: 601px) and (max-width: 1180px) {
  html .aa-pop .aa-row:has([data-set="rw"]) { display: grid; }
  html .reader[data-rw="narrow"] .book { max-width: 680px; }
  html .reader[data-rw="wide"] .book { max-width: 920px; }
  html .reader[data-rw="full"] .book { max-width: none; }
}
/* no page jumps: the footer waits until the library has drawn, and isn't laid out behind the reader */
body:not(.ready) .foot { visibility: hidden; }
html.reading .foot { display: none; }
#count:empty::before { content: "\00a0"; }
/* menu text contrast (readable on every theme, also on the highlighted row) */
html .pop-menu .pm-head { color: var(--ink); font-weight: 700; }
html .pop-menu .pm-item.danger .pm-lbl { color: color-mix(in srgb, var(--pm-danger) 36%, var(--ink)); }
html .pop-menu .pm-item.pm-add .pm-lbl { color: color-mix(in srgb, var(--accent) 30%, var(--ink)); }
/* list view shows everything, like AO3: the whole summary, never cut */
html .blurbs .b-summary { display: block; -webkit-line-clamp: unset; line-clamp: unset; overflow: visible; max-height: none; }
/* box view: title up to 2 lines · fandom 1 line · every ship · characters 1 line (+N) · tags up to 3 lines · short summary */
html .cards .card h3 { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
html .cards .card .fandom { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html .cards .chips.one-line { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; min-width: 0; margin-top: 6px; }
html .cards .chips.one-line .ol-in { display: flex; flex-wrap: nowrap; gap: 6px; min-width: 0; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
html .cards .chips.one-line .ol-in .chip { flex: none; white-space: nowrap; }
html .cards .chips.one-line > .chip.more { flex: none; cursor: help; }
html .cards .chips.three-lines { --row: 30px; display: flex; flex-wrap: wrap; gap: 6px; max-height: calc(3 * var(--row) + 2 * 6px); overflow: hidden; margin-top: 6px; }
html .cards .chips.three-lines .chip { height: var(--row); box-sizing: border-box; display: inline-flex; align-items: center; }
/* ✕ Clear all: first in the filter row, never scrolls out of sight */
.active-filters .clear-all { flex: none; cursor: pointer; padding: 3px 12px; font: inherit; font-size: 12px; font-weight: 700; background: var(--panel) !important; color: color-mix(in srgb, var(--accent) 60%, var(--ink)) !important; border: 1.5px solid currentColor !important; border-radius: 999px; }
.active-filters .clear-all:hover { filter: brightness(1.06); }
/* "42% read" bubble next to the reader's scrollbar */
.scroll-tip { position: absolute; z-index: 6; pointer-events: none; padding: 4px 10px; border-radius: 999px; font: 600 12.5px/1.4 var(--ui); font-variant-numeric: tabular-nums;
  background: var(--rink, #222); color: var(--rbg, #fff); box-shadow: 0 4px 14px rgba(0,0,0,.18); white-space: nowrap; }
.scroll-tip[hidden] { display: none; }
/* thin line between a chapter's notes and where the story starts */
.book hr.story-start { border: 0; border-top: 1px solid color-mix(in srgb, var(--rink, currentColor) 28%, transparent); margin: 1.8em 0 1.6em; height: 0; background: none; width: 100%; }
/* What's new: changes grouped under small headings */
.wn-group { max-width: 330px; margin: 16px auto 6px; padding-bottom: 4px; text-align: left; font: 700 12px/1.3 var(--ui); letter-spacing: .06em; text-transform: uppercase; color: var(--ink); border-bottom: 1px solid var(--line); }
.wn-group:first-of-type { margin-top: 6px; }
.wn-sign-note { font-size: .85em; opacity: .85; }
/* private FicShelf: CSV of Drive links */
.csv-btn { display: flex; justify-content: center; gap: 6px; margin-top: 10px; width: 100%; cursor: pointer; }
.csv-btn .muted { opacity: .7; font-weight: 400; }

/* ===== Celadoncore (fan-requested): charcoal to celadon, dark-to-light like Lavender Haze ===== */
:root[data-theme="celadon"] {
  color-scheme: dark;
  --bg: #333333; --panel: #3b3e3c; --panel-2: #434845; --ink: #DAF5EA; --ink-2: #ABDBBE; --ink-3: #9cbfab;
  --line: #4e5752; --accent: #ABDBBE; --accent-2: #7AA38B; --accent-ink: #263029; --accent-soft: #46574d; --chip: #434845;
  --grad: linear-gradient(135deg, #7AA38B 0%, #ABDBBE 50%, #DAF5EA 100%); --grad-2: linear-gradient(90deg, #7AA38B, #ABDBBE, #DAF5EA);
  --shadow: 0 1px 2px color-mix(in srgb, #ABDBBE 6%, transparent), 0 8px 24px color-mix(in srgb, #000 22%, transparent);
  --c-char-bg: #46574d; --c-char: #DAF5EA; --c-tag-bg: #434845; --c-tag: #ABDBBE;
  --c-rel-bg: #7AA38B; --c-rel: #1f2823; --c-fan-bg: #36434b; --c-fan: #cfe6f2; --c-warn-bg: #4a4430; --c-warn: #ffe3a6;
  --blob1: rgba(171,219,190,.14); --blob2: rgba(218,245,234,.06); --blob3: rgba(122,163,139,.22);
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg opacity='0.22'%3E%3Cpath transform='translate%2850 50%29 scale%281%29' d='M0 -14 C2 -4 4 -2 14 0 C4 2 2 4 0 14 C-2 4 -4 2 -14 0 C-4 -2 -2 -4 0 -14Z' fill='%23DAF5EA'/%3E%3Cpath transform='translate%28160 140%29 scale%280.6%29' d='M0 -14 C2 -4 4 -2 14 0 C4 2 2 4 0 14 C-2 4 -4 2 -14 0 C-4 -2 -2 -4 0 -14Z' fill='%237AA38B'/%3E%3Cpath transform='translate%28170 40%29 scale%280.35%29' d='M0 -14 C2 -4 4 -2 14 0 C4 2 2 4 0 14 C-2 4 -4 2 -14 0 C-4 -2 -2 -4 0 -14Z' fill='%23ABDBBE'/%3E%3Ccircle cx='100' cy='100' r='1.6' fill='%23DAF5EA'/%3E%3Ccircle cx='40' cy='170' r='1.2' fill='%237AA38B'/%3E%3Ccircle cx='200' cy='190' r='1.4' fill='%23ABDBBE'/%3E%3C/g%3E%3C/svg%3E");
  --r-paper: #f2faf6; --r-paper-ink: #2b3330; --r-night: #2b2d2c; --r-night-ink: #DAF5EA; --hl: #cdeedd;
}
:root[data-theme="celadon"] select.btn, :root[data-theme="celadon"] .tools select, :root[data-theme="celadon"] .settings select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23DAF5EA' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
html[data-theme="celadon"] { --brand-c: #DAF5EA; }
html[data-theme="celadon"] .req .sq { color: #1f2823; }
html:root[data-theme="celadon"] { --ink-3: #a3c7b2; }

/* What's new: the latest additions get their own box at the top, earlier ones follow */
/* "Just added" / "Earlier this month" in What's new: a soft candy-coloured card in the theme's own two colours, with a
   little sparkle in the corner, a pill-shaped heading and flower bullets (owner: "cuter, sweeter") */
.wn-new { position: relative; overflow: hidden; text-align: left; margin: 0 0 10px; padding: 6px 14px 14px; border-radius: 20px;
  background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--accent-2, var(--accent)) 16%, transparent), transparent 60%),
    radial-gradient(110% 90% at 0% 100%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 62%),
    color-mix(in srgb, var(--accent) 6%, var(--panel));
  border: 1.5px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 14%, transparent), inset 0 1px 0 color-mix(in srgb, #fff 45%, transparent); }
.wn-new::before, .wn-new::after { position: absolute; pointer-events: none; color: color-mix(in srgb, var(--accent) 55%, transparent); line-height: 1; }
.wn-new::before { content: "✦"; top: 10px; right: 14px; font-size: 15px; }
.wn-new::after { content: "✧"; top: 26px; right: 30px; font-size: 10px; opacity: .8; }
.wn-new .wn-new-h { display: inline-flex; align-items: center; gap: 6px; max-width: none; margin: 10px 0 10px; padding: 5px 13px 5px 11px;
  border: 0; border-radius: 999px; background: var(--grad, var(--accent)); color: #fff; font-size: 11.5px; letter-spacing: .07em;
  box-shadow: 0 3px 10px color-mix(in srgb, var(--accent) 30%, transparent); text-shadow: 0 1px 1px rgb(0 0 0 / .12); }
.wn-new .wn-new-h::before { content: "✿"; font-size: 12px; letter-spacing: 0; }
.wn-new .wn-list li::before { content: "♡"; top: 0; font-size: 12px; color: color-mix(in srgb, var(--accent) 85%, var(--ink)); }
.wn-theme { display: grid; gap: 6px; justify-items: start; margin: 0 auto 10px; max-width: 330px; font-size: 14px; color: var(--ink); }
.wn-theme small { font-size: 12.5px; color: var(--ink-2); line-height: 1.4; }
.wn-sw { display: flex; gap: 6px; }
.wn-sw i { width: 34px; height: 34px; border-radius: 9px; border: 1px solid color-mix(in srgb, var(--ink) 18%, transparent); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.wn-earlier { margin: 18px 0 2px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); display: flex; align-items: center; gap: 10px; }
.wn-earlier::before, .wn-earlier::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Theme nudge pop-up */
.wn-themes { max-width: 560px; }
.tn-lead { margin: 0 0 6px; font-size: 14px; color: var(--ink-2); text-align: center; }
.tn-sec { margin: 12px 0 6px; font: 700 11px/1.3 var(--ui); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); text-align: left; }
.tn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.tn-opt { display: grid; gap: 6px; padding: 6px; border-radius: 12px; border: 2px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; text-align: left; font: 600 12.5px/1.25 var(--ui); }
.tn-opt:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.tn-opt.on { border-color: var(--accent); background: var(--accent-soft); }
.tn-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tn-pv { display: block; height: 42px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent); }
.tn-later { margin: 12px 0 0; font-size: 12.5px; color: var(--ink-3); text-align: center; }
@media (max-width: 420px) { .tn-grid { grid-template-columns: repeat(2, 1fr); } }
.dlg.wn.wn-themes { width: min(640px, calc(100vw - 24px)); max-width: none; }
.wn-themes .tn-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
@media (max-width: 420px) { .wn-themes .tn-grid { grid-template-columns: repeat(2, 1fr); } }
.wn-themes .wn-btns { position: sticky; bottom: -22px; margin: 14px -22px -22px; padding: 12px 22px 16px; background: var(--panel); border-top: 1px solid var(--line); z-index: 1; }

/* Theme pop-up: keep the library visible behind it, so trying a theme shows the whole page changing */
.dlg-wrap.tn-wrap { background: rgba(20,10,15,.12); }
@media (max-width: 860px) {
  .dlg-wrap.tn-wrap { place-items: end center; }
  .dlg.wn.wn-themes { width: 100%; max-height: 56vh; border-radius: 22px 22px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.28); }
  .wn-themes .wn-hero { padding-top: 14px !important; }
  .wn-themes .wn-hero h3 { font-size: 20px; }
  .wn-themes .tn-lead { font-size: 13px; }
  .wn-themes .tn-pv { height: 30px; }
  .wn-themes .tn-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .wn-themes .tn-opt { padding: 5px; font-size: 11.5px; gap: 4px; }
}

/* "Hide my shelved fics": toolbar button on computers, a switch in the filters panel on phones, and the note above the list */
.hide-mine-btn { flex: none; white-space: nowrap; }
.hide-mine-btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); }
.hide-mine-btn[aria-pressed="true"]::before { content: "\2713  "; }
.hm-switch { display: none; width: 100%; align-items: center; gap: 12px; text-align: left; padding: 12px; margin: 0 0 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink); font: inherit; cursor: pointer; }
.hm-switch b { display: block; font-size: 15px; }
.hm-switch small { display: block; color: var(--ink-2); font-size: 12.5px; margin-top: 2px; }
.hm-track { flex: none; width: 40px; height: 24px; border-radius: 999px; background: var(--line); position: relative; transition: background .15s; }
.hm-track i { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--panel); box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.hm-switch[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.hm-switch[aria-pressed="true"] .hm-track { background: var(--accent); }
.hm-switch[aria-pressed="true"] .hm-track i { transform: translateX(16px); }
.hm-note { margin: 0 0 12px; padding: 9px 14px; border-radius: 10px; background: var(--accent-soft); color: var(--ink); font-size: 14px; }
.hm-note[hidden] { display: none; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }
@media (max-width: 860px) {
  .hide-mine-btn { display: none; }
  .hm-switch:not([hidden]) { display: flex; }
}

/* Fic panel details laid out like an AO3 work page's tag block (ao3Box in app.js) */
.ao3-meta { margin: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel);
  display: grid; grid-template-columns: max-content 1fr; column-gap: 14px; row-gap: 10px; font-size: 14.5px; line-height: 1.55; }
.ao3-meta dt { color: var(--ink-2); font-weight: 500; }
.ao3-meta dt.ao3-strong { color: var(--ink); font-weight: 700; }
.ao3-meta dd { margin: 0; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.ao3-tag { color: var(--ink); cursor: pointer;
  text-decoration: underline dotted; text-decoration-color: var(--ink-3); text-underline-offset: 3px; }
.ao3-tag:hover, .ao3-tag:focus-visible { color: var(--accent); text-decoration-color: var(--accent); }
.ao3-sep { color: var(--ink-3); }
.ao3-meta dd.ao3-strong .ao3-tag { font-weight: 700; }
.ao3-stats { display: inline-flex; flex-wrap: wrap; column-gap: 14px; row-gap: 2px; }
@media (max-width: 640px) {
  .ao3-meta { grid-template-columns: 1fr; row-gap: 2px; }
  .ao3-meta dd { padding-left: 14px; margin-bottom: 8px; }
}

/* "Hide my shelved fics": choose what to hide (chips on the Hiding line) */
.hm-note { display: flex; flex-direction: column; gap: 8px; }
.hm-kinds { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.hm-kinds-label { font-size: 13px; color: var(--ink-2); margin-right: 2px; }
.hm-kind { font: inherit; font-size: 13px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--ink-2); cursor: pointer; }
.hm-kind[aria-pressed="true"] { border-color: var(--accent); background: var(--panel); color: var(--ink); font-weight: 600; }
.hm-kind:hover { border-color: var(--accent); }

/* Exact word count range under Length (item 31): one compact row, [From] – [To] [Go] */
.wr-form { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; margin: 2px 0 10px; }
.wr-form input { width: 100%; min-width: 0; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font: inherit; font-size: 14px; }
.wr-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.wr-dash { color: var(--ink-3); }
.wr-hint { grid-column: 1 / -1; color: var(--ink-3); font-size: 12px; }

/* "Hide my shelved fics", compact: a chip above the list, choices in a menu (computer) or under the switch (phone) */
.hm-chip { cursor: pointer; }
.hm-side-kinds { display: none; flex-wrap: wrap; align-items: center; gap: 6px; margin: -4px 0 12px; }
@media (max-width: 860px) { .hm-side-kinds:not([hidden]) { display: flex; } }

/* My tags (item 13): the box in My bookmark notes, and the small line on cards */
.mt-row { display: grid; gap: 6px; margin: 4px 0 10px; }
.mt-lbl { font-size: 13.5px; color: var(--ink-2); }
.mt-box { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.mt-box:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.mt-tag { display: inline-flex; align-items: center; gap: 2px; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--ink); font-size: 13.5px; }
.mt-tag button { border: 0; background: none; color: var(--ink-2); cursor: pointer; font-size: 12px; padding: 2px 5px; border-radius: 999px; }
.mt-tag button:hover { color: var(--accent); }
.mt-box input { flex: 1 1 120px; min-width: 120px; border: 0; background: none; font: inherit; font-size: 14px; color: var(--ink); padding: 4px; outline: none; }
.mt-hint { font-size: 12px; color: var(--ink-3); }
.mt-sugg { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; color: var(--ink-2); align-items: center; }
.mt-sugg button { border: 1px dashed var(--line); background: none; border-radius: 999px; padding: 2px 9px; font: inherit; color: var(--ink-2); cursor: pointer; }
.mt-sugg button:hover { border-color: var(--accent); color: var(--accent); }
.b-mytags { margin: 6px 0 0; font-size: 13px; color: var(--ink-2); }
.b-mytags > span:first-child { font-weight: 600; color: var(--accent); }
.mytag-link { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); cursor: pointer; text-decoration: underline dotted; text-decoration-color: var(--ink-3); text-underline-offset: 3px; }
.mytag-link:hover { color: var(--accent); }

/* ================= Phone design (640px and narrower), part 1: header + toolbar =================
   Header: FicShelf + Add + Feedback + Support + Theme in one slim row. Toolbar: search · Filters · sort in one row,
   lined up with the fic cards. Tabs row: All fics · My library · Shelf life, with Select + the fic count on the right.
   Rounded boxes, not pills. */
.tabs-row { display: contents; }
.tabs-right:empty { display: none; }
@media (max-width: 640px) {
  html body .top { grid-template-areas: "brand actions" !important; padding: calc(8px + env(safe-area-inset-top)) 12px 8px !important; row-gap: 0 !important; }
  html body .brand { font-size: 21px !important; }
  html body .brand::before { width: 24px !important; height: 24px !important; margin-right: 6px !important; }
  html body .top-actions .btn { height: 34px !important; border-radius: 8px !important; }
  html body #openSources { padding: 0 12px !important; font-size: 13.5px !important; }
  html body .top-actions .fb-btn { width: 34px !important; padding: 0 !important; }
  html body .main { padding: 8px 12px 60px !important; }
  html body .toolbar { display: block !important; margin: 0 0 6px !important; padding: 8px 0 !important; }
  html body .toolbar .tools { display: flex !important; gap: 6px !important; width: 100% !important; flex-wrap: nowrap !important; margin: 0 !important; }
  html body .toolbar .search { flex: 1 1 auto !important; min-width: 0; max-width: none !important; margin: 0 !important; }
  html body .toolbar .search input { height: 32px !important; font-size: 16px !important; padding: 0 10px 0 32px !important; border-radius: 8px !important;
    background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 10px center !important; }
  html body .toolbar .search input::placeholder { font-size: 14px; }
  html body .toolbar .search-btn { display: none !important; }
  html body .toolbar .btn, html body .toolbar select { height: 32px !important; padding: 0 10px !important; font-size: 13px !important; border-radius: 8px !important; flex: none; }
  html body .toolbar select { padding: 0 24px 0 10px !important; max-width: 128px !important; text-overflow: ellipsis; }
  html body .toolbar .active-filters { margin-top: 6px; }
  html body .tabs-row { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); margin: 4px 0 8px; }
  html body .tabs-row .scope-tabs { border-bottom: 0 !important; margin: 0 !important; flex: 1 1 auto; min-width: 0; display: flex !important; gap: 16px !important; }
  html body .scope-tab { font-size: 14px !important; padding: 6px 0 8px !important; }
  html body .tabs-right { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; flex: none; }
  html body .tabs-right .count { font: 600 12.5px var(--ui) !important; color: var(--ink-3) !important; margin: 0 !important; }
  html body .tabs-right .sel-btn { height: 26px !important; padding: 0 10px !important; font-size: 12.5px !important; border-radius: 8px !important; }
  html body .shelf-chips { flex-wrap: nowrap !important; overflow-x: auto !important; scrollbar-width: none; gap: 6px !important; margin: 0 -12px 8px !important; padding: 0 12px 2px !important; }
  html body .shelf-chips::-webkit-scrollbar { display: none; }
  html body .sc-chip { flex: none; font-size: 12.5px !important; padding: 3px 9px !important; height: 26px; border-radius: 8px !important; }
}

/* ================= Phone design part 2: fic cards =================
   Close together (8px), a little roomier inside, clear sizes (title > author > fandom > tags > stats), smaller rating
   squares, tags up to 2 lines, the FULL summary always shown, stats on one line. */
@media (max-width: 640px) {
  html body #list { gap: 8px !important; }
  html body .card.blurb { margin: 0 !important; padding: 13px 14px 11px !important; border-radius: 10px !important; }
  html body .b-head { gap: 11px !important; }
  html body .req { grid-template-columns: 19px 19px !important; gap: 2px !important; }
  html body .req .sq { width: 19px !important; height: 19px !important; font-size: 9px !important; border-radius: 4px !important; }
  html body .b-title h3 { font-size: 16.5px !important; line-height: 1.25 !important; }
  html body .b-title h3 .by { font-size: 13px !important; }
  html body .b-fandoms { font-size: 13px !important; margin-top: 2px !important; }
  html body .b-date { font-size: 11.5px !important; }
  /* every tag is shown in full on phones, no folding */
  html body .b-tags { margin-top: 8px !important; font-size: 13px !important; line-height: 1.55 !important; display: block !important; overflow: visible; }
  html body .b-summary { font-size: 14px !important; line-height: 1.5 !important; margin: 8px 0 0 !important; padding: 0 0 0 10px !important; }
  html body .b-series, html body .b-mytags { font-size: 12.5px !important; margin-top: 5px !important; }
  html body .b-stats { font-size: 11.5px !important; margin-top: 9px !important; padding-top: 8px !important;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block !important; }
  html body .b-stats dt, html body .b-stats dd { display: inline !important; margin: 0 !important; }
  html body .b-stats dt { color: var(--ink-3) !important; font-weight: 500 !important; }
  html body .b-stats dd { margin-left: 3px !important; margin-right: 10px !important; }
}

/* ================= Phone design part 3: Filters sheet =================
   Each shelf is shown once: the chip row on the page has them all, so the sheet drops the system shelves and Status
   (My shelves stays, for New shelf / rename / delete). Option rows are tighter so more filters fit on screen. */
.sbh-phone { display: none; }
@media (max-width: 640px) {
  .sbh-wide { display: none; } .sbh-phone { display: inline; }
  html body #sidebar #shelves > a, html body #sidebar #shelves > .sb-group { display: none !important; }
  html body #sidebar #shelves .my-shelves { margin-top: 0 !important; padding-top: 2px !important; }
  html body .sb-head { padding: 6px 16px 8px !important; }
  html body .sb-head b { font-size: 18px !important; }
  html body .hm-switch { padding: 9px 10px !important; gap: 10px !important; margin-bottom: 8px !important; }
  html body .hm-switch b { font-size: 14px !important; }
  html body .hm-switch small { font-size: 12px !important; }
  html body .hm-track { width: 34px !important; height: 20px !important; }
  html body .hm-track i { width: 14px !important; height: 14px !important; }
  html body .hm-switch[aria-pressed="true"] .hm-track i { transform: translateX(14px) !important; }
  html body #sidebar .facet { padding: 8px 0 !important; margin: 0 !important; }
  html body #sidebar .facet + .facet { border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
  html body #sidebar .facet h4 { font-size: 11px !important; margin: 0 0 4px !important; padding: 4px 0 !important; }
  html body #sidebar .frow { min-height: 34px !important; padding: 3px 0 !important; margin: 0 !important; gap: 10px !important; }
  html body #sidebar .frow .fbtn { width: 22px !important; height: 22px !important; }
  html body #sidebar .frow, html body #sidebar .frow * { font-size: 14px !important; }
  html body .sb-foot { padding: 10px 14px calc(10px + env(safe-area-inset-bottom)) !important; gap: 8px !important; }
  html body .sb-foot .btn { height: 42px !important; font-size: 14px !important; border-radius: 10px !important; }
}

/* ================= Phone design part 4: text boxes =================
   A little smaller everywhere (36px tall). The text inside stays 16px: smaller makes iPhones zoom the page on tap. */
@media (max-width: 640px) {
  html body input[type=text], html body input[type=search], html body input[type=url], html body input[type=email],
  html body input[type=date], html body input[type=number], html body input:not([type]), html body select {
    height: 36px; min-height: 0; padding-top: 0; padding-bottom: 0; border-radius: 8px; font-size: 16px; }
  html body #sourceUrl, html body .settings input, html body .settings select, html body #mnDate, html body .wr-form input,
  html body .facet input[data-fsearch], html body #findQ, html body .modal input:not([type=checkbox]):not([type=radio]) { height: 36px !important; padding-top: 0 !important; padding-bottom: 0 !important; }
  html body #addSource .btn { height: 36px !important; }
  html body .mt-box input { height: 28px !important; }
  html body textarea { font-size: 16px; padding: 8px 10px; border-radius: 8px; }
}

/* ================= Reading settings (all screens) + Phone design part 5: reader =================
   New: Center / Right alignment, sliders for line spacing, paragraph spacing and page width. */
.book p { margin-bottom: var(--ps, 1.05em); }
.reader[data-align="center"] .book p { text-align: center; }
.reader[data-align="right"] .book p { text-align: right; }
.reader.plain[data-align="center"] .book p { text-align: center !important; }
.reader.plain[data-align="right"] .book p { text-align: right !important; }
.aa-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.aa-head b { font: 600 16px var(--serif); color: var(--ink); }
.aa-grab { display: none; }
.aa-done { font-weight: 600; }
.aa-inline { display: flex; align-items: center; justify-content: space-between; }
.aa-slide { display: grid !important; grid-template-columns: 120px 1fr 40px; align-items: center; gap: 10px; }
.aa-slide input[type=range] { width: 100%; accent-color: var(--accent); }
.aa-val { font: 600 12.5px var(--ui); color: var(--ink-2); text-align: right; }
.aa-icons button { display: grid; place-items: center; gap: 1px; padding: 6px 0 4px !important; }
.aa-icons small { font-size: 10.5px; }
.aa-swatches button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.aa-swatches i { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,.18); }
@media (max-width: 640px) {
  /* reader bar: one slim row: back · title · find · chapter · Aa (page colour lives in the settings sheet) */
  html body #reader .reader-bar { display: flex !important; flex-wrap: nowrap !important; align-items: center; gap: 6px !important; padding: calc(6px + env(safe-area-inset-top)) 10px 6px !important; min-height: 0 !important; }
  html body #readerBack { width: 34px; height: 34px; padding: 0 !important; justify-content: center; border-radius: 8px !important; flex: none; }
  html body #readerBack .rb-lbl { display: none !important; }
  html body #readerTitle { flex: 1 1 auto; min-width: 0; font-size: 14.5px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  html body #reader .reader-tools { display: flex !important; flex: none; gap: 6px !important; grid-template-columns: none !important; margin: 0 !important; width: auto !important; order: 3; }
  html body #chapterSel { height: 32px !important; max-width: 92px !important; font-size: 13px !important; padding: 0 22px 0 10px !important; border-radius: 8px !important; grid-column: auto !important; }
  html body #readerTheme { display: none !important; }
  html body #findToggle { order: 2; width: 34px; height: 34px; flex: none; }
  html body #aaBtn { order: 4; height: 34px !important; padding: 0 11px !important; font-size: 14px !important; border-radius: 8px !important; flex: none; }
  html body #pdfModeBtn { height: 32px !important; font-size: 12.5px !important; padding: 0 9px !important; border-radius: 8px !important; }
  /* reading settings: a compact bottom sheet */
  html body #aaPop { padding: 8px 16px calc(12px + env(safe-area-inset-bottom)) !important; border-radius: 22px 22px 0 0 !important; max-height: 82vh; overflow-y: auto; }
  html body .aa-grab { display: block; width: 36px; height: 4px; border-radius: 4px; background: var(--line); position: absolute; top: 7px; left: 50%; transform: translateX(-50%); }
  html body #aaPop .aa-head { padding-top: 8px; }
  html body #aaPop .aa-row { padding: 8px 0 !important; margin: 0 !important; border-top: 1px solid color-mix(in srgb, var(--line) 55%, transparent); gap: 6px; }
  html body #aaPop .aa-lbl { font: 600 11px var(--ui) !important; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2) !important; }
  html body #aaPop .seg { background: var(--panel-2); padding: 3px; border-radius: 10px; gap: 3px; }
  html body #aaPop .seg button { height: 32px; border-radius: 8px; font-size: 13.5px; background: none; color: var(--ink-2); border: 0; }
  html body #aaPop .seg button.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); font-weight: 600; }
  html body #aaPop .aa-icons button { height: 44px; }
  html body #aaPop .aa-size .btn { width: 40px; height: 30px !important; padding: 0 !important; border-radius: 8px !important; }
  html body #aaPop .aa-slide { grid-template-columns: 112px 1fr 38px; }
  html body #aaPop .aa-check { padding: 10px 0 6px !important; border-top: 1px solid color-mix(in srgb, var(--line) 55%, transparent); margin: 0 !important; }
  html body #aaPop .aa-check b { font-size: 13.5px; } html body #aaPop .aa-check small { font-size: 12px; }
  html body #aaPop .aa-support { font-size: 12.5px; padding-top: 6px; }
}
@media (max-width: 640px) { html body #aaPop.aa-pop { left: 0 !important; right: 0 !important; bottom: 0 !important; width: auto !important; } }

/* ================= Appearance switches (items 10 and 25) ================= */
.tp-switches { display: grid; gap: 6px; margin: 4px 0 10px; }
.tp-switch { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); font: inherit; cursor: pointer; }
.tp-switch b { display: block; font: 600 14px var(--ui); }
.tp-switch small { display: block; font-size: 12px; color: var(--ink-2); margin-top: 1px; }
.tp-switch .hm-track { flex: none; width: 34px; height: 20px; border-radius: 999px; background: var(--line); position: relative; transition: background .15s; }
.tp-switch .hm-track i { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--panel); box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.tp-switch[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.tp-switch[aria-pressed="true"] .hm-track { background: var(--accent); }
.tp-switch[aria-pressed="true"] .hm-track i { transform: translateX(14px); }
/* Easy-read font: everything that uses the app's text font, plus summaries; headings and titles keep the serif */
html[data-ui-font="easy"] { --ui: "Atkinson Hyperlegible", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif; }
html[data-ui-font="easy"] body { font-family: var(--ui); letter-spacing: .005em; }
html[data-ui-font="easy"] .b-summary, html[data-ui-font="easy"] .card .summary, html[data-ui-font="easy"] .d-summary,
html[data-ui-font="easy"] .count, html[data-ui-font="easy"] .loading { font-family: var(--ui) !important; }
/* Plain background */
html[data-plain-bg] body { background-image: none !important; }
html[data-plain-bg] body::before { display: none !important; }

/* Computers and tablets: a slimmer header. Only the heights change (search box, Search button, header buttons). */
@media (min-width: 641px) {
  html body .top { padding-top: 8px !important; padding-bottom: 8px !important; }
  html body .top .search input { height: 36px !important; padding-top: 0 !important; padding-bottom: 0 !important; }
  html body .top .search-btn { height: 36px !important; padding-top: 0 !important; padding-bottom: 0 !important; display: inline-flex; align-items: center; }
  html body .top-actions .btn, html body .top-actions .theme-btn { height: 34px !important; padding-top: 0 !important; padding-bottom: 0 !important; display: inline-flex; align-items: center; }
}

/* ================= Reading calendar (item 20) =================
   Computers: chart on its own row; calendar (left half) next to Reading streak + From what you finished (right half).
   Phones: one column. */
.sg-row2 { grid-template-columns: 1fr; }
.sg-cal-row { grid-template-columns: 1fr 1fr; margin-top: 14px; align-items: start; }
.sg-col { display: grid; gap: 14px; }
.sg-row3 { grid-template-columns: 1fr 1fr; }
.sg-cal .cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sg-cal h3 { margin: 0; }
.cal-nav { display: inline-flex; align-items: center; gap: 6px; }
.cal-nav b { font: 600 13.5px var(--ui); min-width: 108px; text-align: center; }
.cal-nav button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-size: 15px; cursor: pointer; }
.cal-nav button:hover { border-color: var(--accent); color: var(--accent); }
.cal-sub { font-size: 12.5px; color: var(--ink-2); margin: 2px 0 10px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-wd { text-align: center; font: 600 10.5px var(--ui); color: var(--ink-3); padding-bottom: 2px; }
.cal-cell { position: relative; height: 34px; border: 0; border-radius: 7px; background: color-mix(in srgb, var(--panel-2) 70%, transparent); color: var(--ink-2); font: 500 12.5px var(--ui); display: grid; place-items: center; padding: 0; }
.cal-cell.blank { background: none; }
.cal-cell.has { background: var(--accent-soft); color: var(--ink); font-weight: 700; cursor: pointer; }
.cal-cell.has:hover { box-shadow: inset 0 0 0 1px var(--accent); }
.cal-cell.today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.cal-cell.sel { background: var(--accent); color: var(--accent-ink); }
.cal-dot { position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.cal-dot.big { width: 6px; height: 6px; }
.cal-cell.sel .cal-dot { background: var(--accent-ink); }
.cal-hint { font-size: 12.5px; color: var(--ink-3); margin: 10px 0 0; }
.cal-day { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.cal-day-h { font: 600 13px var(--ui); color: var(--ink-2); }
.cal-fic { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; text-align: left; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); cursor: pointer; font: inherit; }
.cal-fic:hover { border-color: var(--accent); }
.cal-fic .cf-t { font: 600 14px var(--serif); color: var(--accent); }
.cal-fic .cf-a { grid-column: 1; font-size: 12.5px; color: var(--ink-2); }
.cal-fic .cf-r { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--accent); font-size: 13px; }
@media (max-width: 860px) {
  .sg-cal-row, .sg-row3 { grid-template-columns: 1fr; }
  .cal-cell { height: auto; aspect-ratio: 1 / .86; border-radius: 9px; font-size: 13px; }
  .cal-dot { bottom: 5px; width: 5px; height: 5px; } .cal-dot.big { width: 8px; height: 8px; }
}
/* Shelf life has no list to select from or count: hide Select + the count there (phones put them on the tabs row) */
body.stats-on .tabs-right { display: none !important; }

/* ================= Journal view (item 21) ================= */
#list.journal { display: grid; gap: 10px; max-width: 860px; }
.jr-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 8px; max-width: 860px; }
.jr-bar[hidden] { display: none; }
.jr-count { font: 600 13px var(--ui); color: var(--ink-2); }
.jr-seg button { padding: 4px 12px; font-size: 13px; }
.jr-month { font: 600 italic 18px var(--serif); color: var(--ink); margin: 10px 0 0; }
#list.journal > .jr-month:first-child { margin-top: 0; }
.jr-entry { display: grid; grid-template-columns: 54px 1fr; gap: 14px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.jr-entry:hover, .jr-entry:focus-visible { border-color: var(--accent); outline: none; }
.jr-date { display: grid; justify-items: center; align-content: start; padding-top: 2px; border-right: 1px solid var(--line); }
.jr-date b { font: 600 26px/1 var(--serif); color: var(--accent); }
.jr-date span { font: 600 11px var(--ui); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-top: 3px; }
.jr-top { display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.jr-main { min-width: 0; }
.jr-main h4 { margin: 0; font: 600 18px/1.25 var(--serif); color: var(--accent); overflow-wrap: anywhere; }
.jr-by { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.jr-stars { color: var(--accent); font-size: 15px; letter-spacing: 1px; white-space: nowrap; }
.jr-stars span { color: var(--line); }
.jr-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.jr-tags span { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--ink); }
.jr-notes { margin: 10px 0 0; padding: 8px 12px; border-left: 3px solid var(--accent); background: color-mix(in srgb, var(--accent-soft) 45%, transparent); border-radius: 0 8px 8px 0; font: italic 15px/1.55 var(--read); color: var(--ink); overflow-wrap: anywhere; }
.jr-meta { margin-top: 9px; font-size: 12px; color: var(--ink-3); }
@media (max-width: 640px) {
  .jr-entry { grid-template-columns: 40px 1fr; gap: 10px; padding: 12px; }
  .jr-date b { font-size: 21px; }
  .jr-main h4 { font-size: 16px; }
  .jr-notes { font-size: 14px; }
}

/* ================= End of a fic: rate, notes, tags ================= */
.end-box { max-width: 560px; margin: 40px auto 24px; padding: 18px 18px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); color: var(--ink); font: 14px/1.45 var(--ui); text-align: left; }
.eb-rule { text-align: center; color: var(--accent); letter-spacing: .6em; margin: -4px 0 6px; font-size: 13px; }
.eb-h { margin: 0; text-align: center; font: 600 20px/1.3 var(--serif); color: var(--ink); }
.eb-h i { color: var(--accent); }
.eb-sub { text-align: center; margin: 4px 0 12px; font-size: 13px; color: var(--ink-2); }
.eb-row { display: grid; gap: 6px; padding: 10px 0; border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.eb-lbl { font: 600 11px var(--ui); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); }
.eb-stars { display: flex; align-items: center; gap: 2px; }
.eb-stars button { border: 0; background: none; font-size: 30px; line-height: 1; color: var(--line); padding: 0 2px; cursor: pointer; }
.eb-stars button.on { color: var(--accent); }
.eb-stars .eb-clear { font: 500 12.5px var(--ui); color: var(--ink-3); margin-left: 8px; text-decoration: underline; }
/* end-of-fic Favorite: a pill that fills with the theme's accent once the fic is a favourite */
.eb-fav { border: 1px solid var(--line); background: var(--panel); color: var(--ink-2); border-radius: 99px; padding: 7px 14px; font: 600 14px var(--ui); cursor: pointer; }
.eb-fav:hover { border-color: var(--accent); color: var(--accent); }
.eb-fav.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.reader[data-rt="dark"] .end-box .eb-fav:not(.on) { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.25); color: inherit; }
.eb-notes { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font: 16px/1.45 var(--ui); background: var(--panel); color: var(--ink); resize: vertical; }
.eb-notes:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.end-box .mt-hint { display: none; }
.eb-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; padding-top: 10px; border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); font-size: 12.5px; min-height: 18px; }
.eb-saved { color: #2f7d4f; font-weight: 600; }
.eb-date { color: var(--ink-3); margin-left: auto; }
.eb-ao3 { text-align: center; margin: 12px 0 0; font-size: 12.5px; color: var(--ink-2); }
.reader[data-rt="dark"] .end-box { background: rgba(255,255,255,.04); }
.end-box .mt-lbl { font: 600 11px var(--ui); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); }
/* end-of-fic box on the Night page colour: follow the page's light text instead of the theme's dark ink */
.reader[data-rt="dark"] .end-box { color: inherit; background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.14); }
.reader[data-rt="dark"] .end-box .eb-h, .reader[data-rt="dark"] .end-box .mt-tag, .reader[data-rt="dark"] .end-box .eb-notes, .reader[data-rt="dark"] .end-box .mt-input { color: inherit; }
.reader[data-rt="dark"] .end-box .eb-sub, .reader[data-rt="dark"] .end-box .eb-lbl, .reader[data-rt="dark"] .end-box .mt-lbl,
.reader[data-rt="dark"] .end-box .mt-sugg, .reader[data-rt="dark"] .end-box .mt-sugg button, .reader[data-rt="dark"] .end-box .eb-date,
.reader[data-rt="dark"] .end-box .eb-ao3, .reader[data-rt="dark"] .end-box .eb-clear { color: inherit; opacity: .75; }
.reader[data-rt="dark"] .end-box .eb-notes, .reader[data-rt="dark"] .end-box .mt-box { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.18); }
.reader[data-rt="dark"] .end-box .mt-tag { background: rgba(255,255,255,.12); }
.reader[data-rt="dark"] .end-box .mt-sugg button { border-color: rgba(255,255,255,.25); }
.reader[data-rt="dark"] .end-box .eb-stars button { color: rgba(255,255,255,.2); }
.reader[data-rt="dark"] .end-box .eb-stars button.on, .reader[data-rt="dark"] .end-box .eb-h i { color: var(--accent); filter: brightness(1.5); }
.reader[data-rt="dark"] .end-box .eb-row, .reader[data-rt="dark"] .end-box .eb-foot { border-top-color: rgba(255,255,255,.1); }
.reader[data-rt="dark"] .end-box .eb-saved { color: #7fd09b; }

/* ================= Series linking (item 22) ================= */
.b-series > span:first-child { font-weight: 600; color: var(--accent); }
.ser-link { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); cursor: pointer; text-align: left; text-decoration: underline dotted; text-decoration-color: var(--ink-3); text-underline-offset: 3px; }
.ser-link:hover { color: var(--accent); }
.ser-n { color: var(--ink-3); }
.ser-chip { border-color: var(--accent); }
.d-series .ser-h { margin: 0 0 8px; font-size: 14px; color: var(--ink-2); }
.d-series .ser-h .ser-link { font-size: 15px; }
.ser-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ser-list li > button, .ser-list li.gap { display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font: inherit; text-align: left; }
.ser-list li > button { cursor: pointer; }
.ser-list li > button:hover { border-color: var(--accent); }
.ser-list li.cur > button { border-color: var(--accent); background: var(--accent-soft); }
.ser-list li.gap { border-style: dashed; background: none; color: var(--ink-3); }
.sp-n { font: 600 12px var(--ui); color: var(--ink-2); }
.sp-t { font: 600 14px var(--serif); color: var(--accent); overflow-wrap: anywhere; }
.ser-list li.gap .sp-t { font: italic 13px var(--ui); color: var(--ink-3); }
.sp-s { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.sp-done { color: var(--accent); }
.ser-ao3 { display: inline-block; margin-top: 8px; }
.next-part { display: grid; justify-items: center; gap: 4px; text-align: center; margin: 40px auto 0; max-width: 560px; padding: 18px 20px; border: 1px solid var(--accent); border-radius: 14px; background: color-mix(in srgb, var(--accent-soft) 55%, transparent); font-family: var(--ui); }
.next-part .np-k { font: 600 12px var(--ui); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.next-part .np-t { font: 600 19px/1.3 var(--serif); color: var(--accent); }
.next-part .np-m { font-size: 13px; color: var(--ink-2); }
.next-part .btn { margin-top: 8px; }
.next-part.np-none { border-style: dashed; background: none; }
.reader[data-rt="dark"] .next-part { background: rgba(255,255,255,.04); color: inherit; }
.reader[data-rt="dark"] .next-part .np-k, .reader[data-rt="dark"] .next-part .np-m { color: inherit; opacity: .75; }
.reader[data-rt="dark"] .next-part .np-t, .reader[data-rt="dark"] .next-part .sp-done { color: var(--accent); filter: brightness(1.5); }
@media (max-width: 640px) {
  .ser-list li > button, .ser-list li.gap { grid-template-columns: 48px 1fr; }
  .sp-s { grid-column: 2; white-space: normal; }
}

/* ================= Share a fic ================= */
.share-dlg { width: min(480px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 16px 18px 14px; }
.sh-head { display: flex; align-items: center; justify-content: space-between; }
.sh-head h3 { margin: 0; font: 600 20px var(--serif); }
.sh-sub { margin: 2px 0 10px; font-size: 13px; color: var(--ink-2); }
.sh-prev { display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.sh-prev canvas { display: block; height: min(42dvh, 380px); width: auto; max-width: 100%; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.15); }
.sh-prev[data-shape="square"] canvas { height: min(36dvh, 320px); }
.sh-opts { display: grid; gap: 10px; margin-top: 12px; }
.sh-lbl { display: block; font: 600 11px var(--ui); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 6px; }
.sh-cks { display: flex; flex-wrap: wrap; gap: 6px; }
.sh-ck { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font: 13px var(--ui); cursor: pointer; }
.sh-ck i { width: 15px; height: 15px; border-radius: 4px; border: 1.5px solid var(--ink-3); display: grid; place-items: center; font-style: normal; font-size: 10px; color: transparent; }
.sh-ck[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.sh-ck[aria-pressed="true"] i { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.sh-two { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.sh-seg button { padding: 5px 11px; font-size: 13px; }
.sh-text { width: 100%; resize: vertical; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font: 13.5px/1.45 var(--ui); }
.sh-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.sh-btns .btn { justify-content: center; }
.sh-note { margin: 8px 0 0; font-size: 12px; color: var(--ink-3); }
.eb-share { display: flex; justify-content: center; margin-top: 12px; }
@media (max-width: 860px) { .share-dlg { max-height: 94dvh; border-radius: 22px 22px 0 0; } }

/* ================= Main navigation (item 15) ================= */
.navbar { position: fixed; z-index: 28; display: flex; background: color-mix(in srgb, var(--panel) 94%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.nav-item { flex: 1; display: grid; justify-items: center; gap: 3px; padding: 6px 2px; border: 0; background: none; color: var(--ink-3); font: 600 11px var(--ui); cursor: pointer; border-radius: 10px; }
.nav-item svg { display: block; }
.nav-item:hover { color: var(--ink); }
.nav-item.on { color: var(--accent); background: var(--accent-soft); }
.nav-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* phones: bottom bar */
@media (max-width: 640px) {
  .navbar { left: 0; right: 0; bottom: 0; gap: 4px; padding: 5px 8px calc(5px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); box-shadow: 0 -4px 18px rgba(0,0,0,.06); }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  body.selecting .navbar { display: none; }
  .toasts { bottom: calc(76px + env(safe-area-inset-bottom)) !important; }
  .to-top { bottom: calc(76px + env(safe-area-inset-bottom)) !important; }
  .shelf-chips { display: none !important; }
}
/* computers: icon strip on the left */
@media (min-width: 641px) {
  .navbar { top: 0; left: 0; bottom: 0; width: 76px; flex-direction: column; gap: 6px; padding: 14px 8px 16px; border-right: 1px solid var(--line); z-index: 35; }
  .nav-item { flex: none; padding: 9px 2px 7px; }
  body { padding-left: 76px; }
}
@media (min-width: 641px) and (max-width: 860px) { .sidebar { left: 76px !important; width: auto !important; } }
/* the title above the list (replaces the All fics / My library / Shelf life tabs) */
.view-title { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; padding: 2px 0 10px; font: 600 18px var(--serif); color: var(--ink); }
.view-title .vt-sep { color: var(--ink-3); font-weight: 400; }
.vt-shelf { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--accent); border-radius: 8px; background: var(--accent-soft); color: var(--ink); font: 600 14px var(--ui); cursor: pointer; }
.vt-shelf span { font-size: 11px; color: var(--ink-2); }
.vt-q { font: 500 13px var(--ui); color: var(--ink-2); }
.scope-tabs:has(.view-title) { border-bottom: 0; margin: 0; }
/* the Shelves list */
.shelves-dlg { width: min(440px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 16px 18px; }
.shv-sub { margin: 2px 0 10px; font-size: 12.5px; color: var(--ink-2); }
.shv-h { margin: 14px 0 6px; font: 600 11px var(--ui); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); }
.shv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.shv-list { display: grid; gap: 6px; }
.sh-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); font: 600 14px var(--ui); text-align: left; cursor: pointer; }
.sh-row.sub { margin-left: 18px; width: calc(100% - 18px); }
.sh-row .n { font-weight: 500; font-size: 12.5px; color: var(--ink-3); }
.sh-row:hover { border-color: var(--accent); }
.sh-row.on { border-color: var(--accent); background: var(--accent-soft); }
.shv-empty { margin: 0; font-size: 13px; color: var(--ink-3); }
.shv-all { width: 100%; justify-content: center; margin-top: 14px; }
@media (max-width: 860px) { .shelves-dlg { max-height: 88dvh; } }

/* ================= Empty library, footer ornament, Shelves list, empty Shelf life ================= */
.g-cta { align-items: center; gap: 8px; }
.g-cta svg { display: block; vertical-align: 0; }
.g-help summary { font-size: 13px; }
.g-foot { font-size: 12.5px; margin-top: 14px; }
html .main:has(> #empty:not([hidden])) { padding-bottom: 8px !important; }
html .main:has(> #empty:not([hidden])) #more { display: none !important; }
.empty.guide:not([hidden]) { margin-bottom: 8px; }
@media (max-width: 640px) {
  .empty.guide { margin: 10px auto 8px; }
  .g-icon { width: 44px; height: 44px; margin-bottom: 8px; }
  .guide h2 { font-size: 22px; }
  .guide .g-lead { margin: 6px auto 16px; font-size: 14px; }
  .g-steps { gap: 8px; }
  .g-steps li { grid-template-columns: 26px 1fr; column-gap: 12px; padding: 10px 14px; border-radius: 10px; }
  .g-n { width: 26px; height: 26px; font-size: 12.5px; }
  .g-steps b { font-size: 15px; }
  .g-steps p { font-size: 13px; line-height: 1.45; }
  .g-cta { display: inline-flex; width: auto; margin: 18px auto 0; min-height: 42px; padding: 9px 20px; font-size: 14.5px; }
  .g-help { margin-top: 14px; }
}
/* a little flourish between the page and the footer */
.foot-orn { display: flex; align-items: center; gap: 12px; max-width: 300px; margin: 4px auto 14px; color: var(--accent); }
.foot-orn i { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 55%, transparent)); }
.foot-orn i:last-child { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 55%, transparent), transparent); }
.foot-orn span { font-size: 11px; letter-spacing: 6px; padding-left: 6px; opacity: .85; }
.foot { padding-top: 10px; }
/* Shelves list: New shelf button next to the heading */
.shv-hrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 0 6px; }
.shv-hrow .shv-h { margin: 0; }
/* Shelf life before there's anything to show */
.sg-welcome { max-width: 520px; margin: 6px auto 0; padding: 22px 20px 18px; text-align: center; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.sgw-orn { color: var(--accent); font-size: 12px; letter-spacing: 6px; padding-left: 6px; }
.sg-welcome h3 { margin: 6px 0 4px; font: 600 italic 22px/1.25 var(--serif); color: var(--ink); }
.sgw-lead { margin: 0 auto 16px; max-width: 380px; font-size: 14px; color: var(--ink-2); }
.sgw-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sgw-tiles div { display: grid; gap: 2px; padding: 10px 6px; border: 1px dashed color-mix(in srgb, var(--accent) 40%, var(--line)); border-radius: 10px; background: color-mix(in srgb, var(--accent-soft) 35%, transparent); }
.sgw-tiles b { font: 600 22px var(--serif); color: var(--accent); }
.sgw-tiles span { font-size: 11.5px; color: var(--ink-2); }
.sgw-chart { display: flex; align-items: flex-end; justify-content: center; gap: 8px; height: 70px; margin: 14px auto 4px; padding: 0 10px 0; border-bottom: 1px solid var(--line); max-width: 300px; }
.sgw-chart i { flex: 1; max-width: 26px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 35%, transparent), color-mix(in srgb, var(--accent) 12%, transparent)); }
.sgw-list { list-style: none; margin: 14px auto 0; padding: 0; display: grid; gap: 5px; max-width: 320px; text-align: left; font-size: 13.5px; color: var(--ink-2); }
.sgw-list span { color: var(--accent); margin-right: 4px; }
.sgw-cta { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; }
.sgw-cta svg { display: block; }
.sgw-foot { margin: 12px 0 0; font-size: 12px; color: var(--ink-3); }

/* ================= Pop-ups that behave like an app =================
   Every pop-up (dialogs, What's new, the theme picker, Share, Shelves, Feedback, Add fics, Filters on phones):
   - the page behind is locked while it's open, so scrolling never moves the library underneath
   - no rubber-band bounce: the title can't slide down and leave a gap
   - the title row (and ✕) stays fixed at the top, the buttons stay fixed at the bottom, only the middle scrolls
   - phones: a sheet that slides up from the bottom; computers: a card that fades in */
/* the page behind is locked by a class app.js sets while a pop-up sheet is open (not for Add fics, where you type and paste) */
html.pop-lock body { overflow: hidden; }
.dlg-wrap { background: rgba(20,10,15,.42); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); overscroll-behavior: none; }
.dlg-wrap.tn-wrap { -webkit-backdrop-filter: none; backdrop-filter: none; }
html .dlg { --dp: 20px; max-height: min(88vh, 760px); max-height: min(88dvh, 760px); overflow-y: auto; overscroll-behavior: none; -webkit-overflow-scrolling: touch; }
html .wn { --dp: 22px; } html .share-dlg, html .shelves-dlg { --dp: 18px; }
html .theme-pop, html .sb-body, html .drawer { overscroll-behavior: none; }
html .modal { overscroll-behavior: contain; }
/* fixed title rows */
html .dlg:has(> .wn-hero, > .sh-head, > .ch-head) { padding-top: 0 !important; }
html .dlg > .sh-head, html .dlg > .ch-head { position: sticky; top: 0; z-index: 3; background: var(--panel); margin: 0 calc(-1 * var(--dp)) 4px; padding: 16px var(--dp) 10px; }
html .dlg > .wn-hero { position: sticky; top: 0; z-index: 3; }
html .wn-hero .wn-x { position: absolute; top: 8px; right: 8px; }
html .wn-hero { position: sticky; }
/* fixed button rows */
html .dlg:has(> .dlg-btns, > .wn-btns, > .sh-btns) { padding-bottom: 0 !important; }
html .dlg > .dlg-btns, html .dlg > .wn-btns, html .dlg > .sh-btns { position: sticky !important; bottom: 0 !important; z-index: 3; background: var(--panel); margin: 14px calc(-1 * var(--dp)) 0 !important;
  padding: 12px var(--dp) calc(14px + env(safe-area-inset-bottom)) !important; border-top: 1px solid var(--line); box-shadow: 0 -10px 18px -14px rgba(0,0,0,.25); }
/* the theme list (header button) and Add fics */
html .theme-pop { padding-top: 0 !important; }
html .theme-pop > .tp-head { position: sticky; top: 0; z-index: 3; background: var(--panel); margin: 0 -16px 6px; padding: 14px 16px 8px; }
html .modal-card { padding-top: 0 !important; }
html .modal-head { position: sticky; top: 0; z-index: 3; background: var(--panel); margin: 0; padding: 18px 0 10px; }
/* opening */
@keyframes popSheetUp { from { transform: translateY(28px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes popFadeIn { from { transform: scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 860px) { html .dlg-wrap > .dlg { animation: popSheetUp .24s cubic-bezier(.2,.8,.2,1); box-shadow: 0 -12px 40px rgba(0,0,0,.22); } }
@media (min-width: 861px) { html .dlg-wrap > .dlg { animation: popFadeIn .18s ease-out; } }
@media (prefers-reduced-motion: reduce) { html .dlg-wrap > .dlg { animation: none; } }
/* Shelves sheet: one list, every shelf alike */
.shelves-dlg .sh-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.shv-acts { display: flex; align-items: center; gap: 8px; }
.shelves-dlg .shv-sub { margin: 0 0 12px; }
.shelves-dlg .shv-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
.shelves-dlg .sh-row { min-height: 46px; padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.shelves-dlg .sh-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shelves-dlg .sh-name small { font-weight: 500; color: var(--ink-3); }
.shelves-dlg .shv-empty { margin: 12px 2px 4px; font-size: 13px; color: var(--ink-3); }
.shelves-dlg .dlg-btns .btn { flex: 1; justify-content: center; }
@media (max-width: 360px) { .shelves-dlg .shv-grid { grid-template-columns: 1fr; } }
/* your own shelves follow the ready-made ones with no divider: they're all just shelves */
html .my-shelves { border-top: 0; padding-top: 0; margin-top: 0; }
/* author names you can tap */
.author-link { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: inherit; cursor: pointer; text-decoration: underline dotted; text-decoration-color: var(--ink-3); text-underline-offset: 3px; }
.author-link:hover { color: var(--accent); }
.byline .author-link { font-weight: 600; }
/* "all of these / any of these" for tag filters */
.f-mode { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin: 2px 0 8px; font-size: 12.5px; color: var(--ink-2); }
.f-mode .seg button { padding: 3px 10px; font-size: 12.5px; }

/* ================= The Shelves screen ================= */
body.shv-on #list, body.shv-on #more, body.shv-on #moreTop, body.shv-on #shelfChips, body.shv-on #scanBanner, body.shv-on #empty, body.shv-on #journalBar, body.shv-on #dlBar,
body.shv-on .toolbar, body.shv-on #activeFilters, body.shv-on #count, body.shv-on .loading-row, body.shv-on .tabs-row, body.shv-on #sidebar { display: none !important; }
body.shv-on .layout { grid-template-columns: minmax(0, 1fr) !important; }
.shelves-view { max-width: 920px; padding-bottom: 30px; }
.shp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 0 12px; }
.shp-head h2 { margin: 0; font: 600 italic 26px var(--serif); color: var(--ink); }
/* the three folders: one row that stays put while the shelves scroll */
.shp-folders { position: sticky; z-index: 5; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 8px 0 12px; background: linear-gradient(var(--bg) 82%, transparent); }
.shp-folder { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink); font: 600 14px var(--ui); cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.shp-folder svg { flex: none; color: var(--accent); }
.shp-fl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.shp-fn { font: 500 12.5px var(--ui); color: var(--ink-3); }
.shp-folder:hover { border-color: var(--accent); }
/* the shelves: boxes in shades of your theme */
.shp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.shp-cell { position: relative; }
.shp-box { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 2px; width: 100%; min-height: 118px; padding: 14px 14px 12px; border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line)); border-radius: 16px; background: var(--panel); color: var(--ink); text-align: left; cursor: pointer; font: inherit; box-shadow: 0 4px 14px rgba(0,0,0,.05); transition: transform .15s, box-shadow .15s; }
.shp-box::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 34%, var(--panel)) 0%, color-mix(in srgb, var(--accent) 10%, var(--panel)) 60%, var(--panel) 100%); filter: hue-rotate(var(--h, 0deg)); }
.shp-box:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0,0,0,.09); }
.shp-par { font-size: 11.5px; color: var(--ink-2); }
.shp-name { font: 600 18px/1.2 var(--serif); color: var(--ink); overflow-wrap: anywhere; padding-right: 26px; }
.shp-n { font-size: 12.5px; color: var(--ink-2); }
.shp-spines { position: absolute; right: 12px; bottom: 10px; display: flex; align-items: flex-end; gap: 3px; filter: hue-rotate(var(--h, 0deg)); }
.shp-spines i { width: 8px; border-radius: 2px 2px 1px 1px; background: color-mix(in srgb, var(--accent) 70%, var(--panel)); }
.shp-spines i:nth-child(1) { height: 30px; } .shp-spines i:nth-child(2) { height: 38px; opacity: .75; } .shp-spines i:nth-child(3) { height: 26px; opacity: .55; transform: rotate(8deg); transform-origin: bottom left; }
.shp-more { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; z-index: 2; background: color-mix(in srgb, var(--panel) 70%, transparent); border-radius: 8px; }
.shp-add { border-style: dashed; background: none; box-shadow: none; }
.shp-add::before { display: none; }
.shp-add .shp-name { color: var(--accent); }
/* "‹ Shelves" in the title inside a shelf */
.vt-back { border: 1px solid var(--line); background: var(--panel); color: var(--ink-2); border-radius: 8px; padding: 3px 10px; font: 600 13px var(--ui); cursor: pointer; }
.vt-back:hover { border-color: var(--accent); color: var(--accent); }
/* inside Downloaded */
.dl-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin: 0 0 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.dl-bar[hidden] { display: none; }
.dl-info { display: grid; gap: 1px; }
.dl-info b { font: 600 14px var(--ui); }
.dl-info span { font-size: 12.5px; color: var(--ink-2); }
.dl-tip { flex: 1 1 100%; margin: 0; font-size: 12px; color: var(--ink-3); }
@media (max-width: 640px) {
  .shp-head h2 { font-size: 23px; }
  .shp-folders { gap: 6px; }
  .shp-folder { flex-direction: column; align-items: flex-start; gap: 4px; padding: 9px 10px; font-size: 13px; }
  .shp-folder .shp-fl { width: 100%; }
  .shp-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .shp-box { min-height: 104px; padding: 12px; }
  .shp-name { font-size: 16px; }
}
/* Downloaded: a Delete download button on each fic */
.dl-one { margin-top: 10px; }
.card .dl-one { justify-self: start; }
/* Shelves screen: title + folders are one solid bar that stays on top; the boxes scroll underneath it */
.shp-top { position: sticky; z-index: 8; margin: 0 -16px 12px; padding: 4px 16px 0; background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: 0 8px 14px -12px rgba(0,0,0,.25); }
.shp-top .shp-head { margin: 6px 0 10px; }
.shp-top .shp-folders { position: static; background: none; padding: 0 0 12px; }
@media (min-width: 861px) { .shp-top { margin: 0 -24px 14px; padding: 4px 24px 0; } }
.shp-grid { position: relative; z-index: 1; }
/* Shelf boxes as little bookshelves (style 6): spines on a wooden ledge, one per fic */
.shp-box { min-height: 128px; }
.shp-box::before { background: linear-gradient(180deg, var(--panel) 0%, color-mix(in srgb, var(--accent) 12%, var(--panel)) 100%); }
.shp-spines { display: none; }
.shp-ledge { position: absolute; left: 12px; right: 12px; bottom: 10px; height: 44px; display: flex; align-items: flex-end; gap: 2px; padding: 0 2px; border-bottom: 4px solid color-mix(in srgb, #8a5a3c 70%, var(--panel)); border-radius: 0 0 2px 2px; filter: hue-rotate(var(--h, 0deg)); }
.shp-ledge i { flex: none; border-radius: 2px 2px 0 0; background: color-mix(in srgb, var(--accent) var(--m, 70%), #fff); box-shadow: inset -2px 0 0 rgba(0,0,0,.08); }
.shp-ledge:empty { border-bottom-style: solid; opacity: .7; }
.shp-n { margin-bottom: 48px; }
/* lighter on phones: no blur behind the bottom bar or pop-ups (blur is costly to draw on phones) */
html .navbar { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--panel); }
html .dlg-wrap { -webkit-backdrop-filter: none; backdrop-filter: none; }

/* ================= Reader page colour "Theme" ================= */
html .reader.rt-theme { --rbg: var(--bg) !important; --rink: var(--ink) !important; }
html .reader.rt-theme .reader-scroll { background: var(--bg); }
html .reader.rt-theme .book h1, html .reader.rt-theme .book h2, html .reader.rt-theme .book h3 { color: var(--accent); -webkit-text-fill-color: var(--accent); background: none; }
html .reader.rt-theme .book a { color: var(--accent); }
.rt-theme-dot { background: var(--grad, var(--accent)) !important; }

/* ================= Computers: alignment clean-up =================
   Feedback and Support were 38×34 ovals with the icon pushed to the left; now square rounded boxes, icon centred.
   The search box and Search button match the 34px header buttons. Shelf chips and filter chips are rounded boxes
   like on phones, not pills. */
@media (min-width: 641px) {
  html body .top-actions .fb-btn { width: 34px !important; min-width: 34px !important; height: 34px !important; padding: 0 !important; border-radius: 8px !important; display: inline-flex !important; align-items: center; justify-content: center; }
  html body .top-actions .fb-btn svg { display: block; margin: 0 !important; }
  html body .top .search input, html body .top .search-btn { height: 34px !important; }
  html body .sc-chip, html body .fchip { border-radius: 8px !important; }
}
/* no pills anywhere: your tags, tag suggestions and journal tags are rounded boxes like everything else */
html .mt-tag, html .mt-sugg button, html .jr-tags span, html .sh-ck { border-radius: 8px !important; }

/* touch screens: text boxes use 16px text, so phones (iPhone especially) don't zoom the page in when you tap one,
   which pushed pop-ups like Share off the side of the screen */
@media (pointer: coarse) {
  html body input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), html body textarea, html body select { font-size: 16px !important; }
}

/* Chosen filters on computers: one row that scrolls sideways (trackpad, mouse wheel or drag), fading out at the right
   edge, instead of piling up in rows; "Clear all" stays pinned at the start. */
@media (min-width: 641px) {
  html body .toolbar { flex-wrap: nowrap !important; }
  html body .toolbar .active-filters { flex: 1 1 0; min-width: 0; flex-wrap: nowrap !important; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; padding: 2px 0; margin-top: 0 !important;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); }
  html body .toolbar .active-filters::-webkit-scrollbar { display: none; }
  html body .toolbar .active-filters > * { flex: none; white-space: nowrap; }
  html body .toolbar .active-filters .clear-all { position: sticky; left: 0; z-index: 1; box-shadow: 6px 0 8px -4px var(--bg); }
  html body .toolbar .tools { flex: none; }
}
/* narrower computer screens: the chips get their own full-width line under the buttons (still one scrolling row) */
@media (min-width: 641px) and (max-width: 1500px) {
  html body .toolbar:has(.fchip) { flex-wrap: wrap !important; }
  html body .toolbar .active-filters:not(:empty) { order: 5; flex: 1 1 100%; }
}

/* What's new: the big ones read a touch larger */
.wn-big li { font-size: 14.5px; }
.wn-big li + li { margin-top: 2px; }
/* What's new floats in the middle of the screen on phones too: a card with space on every side, not a sheet from the bottom */
@media (max-width: 860px) {
  html .dlg-wrap:has(> .wn-whatsnew) { place-items: center; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
  html .dlg-wrap > .dlg.wn-whatsnew { width: 100%; max-width: 440px; max-height: min(82vh, 720px); max-height: min(82dvh, 720px); border-radius: 18px !important; box-shadow: 0 24px 60px rgba(0,0,0,.35); animation: popFadeIn .2s ease-out; }
  html .dlg.wn-whatsnew > .wn-btns { padding-bottom: 14px !important; }
}
/* What's new: no ✕; the buttons show once you've scrolled to the end, with a scroll hint until then */
.wn-whatsnew .wn-scroll { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 8px 4px; font: 600 14px var(--ui); color: var(--accent); cursor: pointer; }
.wn-whatsnew .wn-scroll span { display: inline-block; font-size: 16px; animation: wnNudge 1.4s ease-in-out infinite; }
@keyframes wnNudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .wn-whatsnew .wn-scroll span { animation: none; } }
.wn-whatsnew:not(.wn-read) .wn-btns > .btn, .wn-whatsnew:not(.wn-read) .wn-btns > .linkbtn:not(.wn-scroll) { display: none; }
.wn-whatsnew.wn-read .wn-scroll { display: none; }
.wn-whatsnew.wn-read .wn-btns > .btn { animation: popFadeIn .25s ease-out; }
/* Filters sheet on phones: the list runs right down to the Clear all / Apply buttons, with a solid
   base, so nothing scrolls through a gap between them; the space at the end of the list moves inside the list */
@media (max-width: 860px) {
  html body #sidebar .sb-body { padding-bottom: 0 !important; }
  html body #sidebar #facets { padding-bottom: 20px; }
}

/* ================= Calm & cosy themes (new group): Oat Milk, Latte, Nordic, Sunlit Page, Ink Wash ================= */
:root[data-theme="oatmilk"] {
  color-scheme: only light;
  --bg: #f4f0e8; --panel: #fdfbf6; --panel-2: #efe8dc;
  --ink: #2f2a24; --ink-2: #5f564c; --ink-3: #857b70; --line: #e4dccd;
  --accent: #8a6a4f; --accent-2: #c9a98a; --accent-ink: #FFFFFF; --accent-soft: #eee3d4; --chip: #efe8dc;
  --c-char-bg: #efe6da; --c-char: #6b4f37; --c-tag-bg: #ece6db; --c-tag: #4f4a40; --c-rel-bg: #f1e1d6; --c-rel: #7a4a35;
  --c-fan-bg: #e6eadc; --c-fan: #4b5a3a; --c-warn-bg: #FFF1D6; --c-warn: #7A5A00;
  --blob1: transparent; --blob2: transparent; --blob3: transparent;
  --r-paper: #faf6ee; --r-paper-ink: #2f2a24; --r-night: #1d1a16; --r-night-ink: #e9e1d4; --hl: #f3dfb4;
  --grad: linear-gradient(135deg,#d9c2a5,#8a6a4f); --grad-2: linear-gradient(90deg, #8a6a4f, #c9a98a, #8a6a4f);
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.07);
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cg fill='%238a6a4f' opacity='0.16'%3E%3Ccircle cx='30' cy='40' r='2.2'/%3E%3Ccircle cx='118' cy='22' r='1.6'/%3E%3Ccircle cx='86' cy='104' r='2.6'/%3E%3Ccircle cx='150' cy='140' r='1.8'/%3E%3Ccircle cx='22' cy='142' r='1.4'/%3E%3Ccircle cx='160' cy='70' r='1.2'/%3E%3C/g%3E%3C/svg%3E");
}
html[data-theme="oatmilk"] { --brand-c: #8a6a4f; }
html[data-theme="oatmilk"] .b-title h3, html[data-theme="oatmilk"] .card h3 { color: #8a6a4f !important; }
html[data-theme="oatmilk"] .sq-r { background: #8a6a4f !important; } html[data-theme="oatmilk"] .sq-c { background: #a9876a !important; } html[data-theme="oatmilk"] .sq-w { background: #857b70 !important; } html[data-theme="oatmilk"] .sq-s { background: #5f564c !important; }
html[data-theme="oatmilk"] .sq-w, html[data-theme="oatmilk"] .sq-s, html[data-theme="oatmilk"] .sq-r, html[data-theme="oatmilk"] .sq-c { color: #fff !important; }
html[data-theme="oatmilk"] .top { background: #3a322a !important; border-bottom: 0 !important; color: #f3e9dc; }
html[data-theme="oatmilk"] .top .brand { color: #f3e9dc; } html[data-theme="oatmilk"] .top .brand span { color: #e6c9a6 !important; } html[data-theme="oatmilk"] .top .brand::before { background: #e6c9a6 !important; }
html[data-theme="oatmilk"] .top .btn { background: rgba(255,255,255,.1) !important; border-color: rgba(255,255,255,.28) !important; color: #f3e9dc !important; }
html[data-theme="oatmilk"] .top .btn.primary { background: #e6c9a6 !important; color: #3a322a !important; border-color: transparent !important; }
html[data-theme="oatmilk"] .top .icon-btn { color: #f3e9dc !important; }
:root[data-theme="latte"] {
  color-scheme: only light;
  --bg: #eff1f5; --panel: #ffffff; --panel-2: #e6e9ef;
  --ink: #4c4f69; --ink-2: #5c5f77; --ink-3: #7c7f93; --line: #dce0e8;
  --accent: #1e8a8f; --accent-2: #dd7878; --accent-ink: #FFFFFF; --accent-soft: #d6eeee; --chip: #e6e9ef;
  --c-char-bg: #ece6f8; --c-char: #7340c9; --c-tag-bg: #e6e9ef; --c-tag: #4c4f69; --c-rel-bg: #f6e1e4; --c-rel: #b84d5b;
  --c-fan-bg: #dff1ec; --c-fan: #2c7a5a; --c-warn-bg: #FFF1D6; --c-warn: #7A5A00;
  --blob1: transparent; --blob2: transparent; --blob3: transparent;
  --r-paper: #f7f8fb; --r-paper-ink: #4c4f69; --r-night: #1e1e2e; --r-night-ink: #cdd6f4; --hl: #f9e2af;
  --grad: linear-gradient(135deg,#7ad1cf,#1e8a8f 55%,#dd7878); --grad-2: linear-gradient(90deg, #1e8a8f, #dd7878, #1e8a8f);
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.07);
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cg fill='%231e8a8f' opacity='0.16'%3E%3Ccircle cx='30' cy='40' r='2.2'/%3E%3Ccircle cx='118' cy='22' r='1.6'/%3E%3Ccircle cx='86' cy='104' r='2.6'/%3E%3Ccircle cx='150' cy='140' r='1.8'/%3E%3Ccircle cx='22' cy='142' r='1.4'/%3E%3Ccircle cx='160' cy='70' r='1.2'/%3E%3C/g%3E%3C/svg%3E");
}
html[data-theme="latte"] { --brand-c: #1e8a8f; }
html[data-theme="latte"] .b-title h3, html[data-theme="latte"] .card h3 { color: #1e8a8f !important; }
html[data-theme="latte"] .sq-r { background: #1e8a8f !important; } html[data-theme="latte"] .sq-c { background: #dd7878 !important; } html[data-theme="latte"] .sq-w { background: #7c7f93 !important; } html[data-theme="latte"] .sq-s { background: #5c5f77 !important; }
html[data-theme="latte"] .sq-w, html[data-theme="latte"] .sq-s, html[data-theme="latte"] .sq-r, html[data-theme="latte"] .sq-c { color: #fff !important; }
html[data-theme="latte"] .top { background: #4c4f69 !important; border-bottom: 0 !important; color: #eff1f5; }
html[data-theme="latte"] .top .brand { color: #eff1f5; } html[data-theme="latte"] .top .brand span { color: #f5c2e7 !important; } html[data-theme="latte"] .top .brand::before { background: #f5c2e7 !important; }
html[data-theme="latte"] .top .btn { background: rgba(255,255,255,.1) !important; border-color: rgba(255,255,255,.28) !important; color: #eff1f5 !important; }
html[data-theme="latte"] .top .btn.primary { background: #f5c2e7 !important; color: #4c4f69 !important; border-color: transparent !important; }
html[data-theme="latte"] .top .icon-btn { color: #eff1f5 !important; }
:root[data-theme="nordic"] {
  color-scheme: only light;
  --bg: #eceff4; --panel: #f8f9fb; --panel-2: #e5e9f0;
  --ink: #2e3440; --ink-2: #434c5e; --ink-3: #6b7488; --line: #d8dee9;
  --accent: #5e81ac; --accent-2: #88c0d0; --accent-ink: #FFFFFF; --accent-soft: #dde5f0; --chip: #e5e9f0;
  --c-char-bg: #e4e9f2; --c-char: #4c6a92; --c-tag-bg: #e5e9f0; --c-tag: #3b4252; --c-rel-bg: #ece3ea; --c-rel: #8a5c80;
  --c-fan-bg: #e3ede0; --c-fan: #4e6b45; --c-warn-bg: #FFF1D6; --c-warn: #7A5A00;
  --blob1: transparent; --blob2: transparent; --blob3: transparent;
  --r-paper: #f6f7fa; --r-paper-ink: #2e3440; --r-night: #2e3440; --r-night-ink: #e5e9f0; --hl: #ebcb8b;
  --grad: linear-gradient(135deg,#88c0d0,#5e81ac); --grad-2: linear-gradient(90deg, #5e81ac, #88c0d0, #5e81ac);
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.07);
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cg fill='%235e81ac' opacity='0.16'%3E%3Ccircle cx='30' cy='40' r='2.2'/%3E%3Ccircle cx='118' cy='22' r='1.6'/%3E%3Ccircle cx='86' cy='104' r='2.6'/%3E%3Ccircle cx='150' cy='140' r='1.8'/%3E%3Ccircle cx='22' cy='142' r='1.4'/%3E%3Ccircle cx='160' cy='70' r='1.2'/%3E%3C/g%3E%3C/svg%3E");
}
html[data-theme="nordic"] { --brand-c: #5e81ac; }
html[data-theme="nordic"] .b-title h3, html[data-theme="nordic"] .card h3 { color: #5e81ac !important; }
html[data-theme="nordic"] .sq-r { background: #5e81ac !important; } html[data-theme="nordic"] .sq-c { background: #81a1c1 !important; } html[data-theme="nordic"] .sq-w { background: #6b7488 !important; } html[data-theme="nordic"] .sq-s { background: #434c5e !important; }
html[data-theme="nordic"] .sq-w, html[data-theme="nordic"] .sq-s, html[data-theme="nordic"] .sq-r, html[data-theme="nordic"] .sq-c { color: #fff !important; }
html[data-theme="nordic"] .top { background: #2e3440 !important; border-bottom: 0 !important; color: #eceff4; }
html[data-theme="nordic"] .top .brand { color: #eceff4; } html[data-theme="nordic"] .top .brand span { color: #88c0d0 !important; } html[data-theme="nordic"] .top .brand::before { background: #88c0d0 !important; }
html[data-theme="nordic"] .top .btn { background: rgba(255,255,255,.1) !important; border-color: rgba(255,255,255,.28) !important; color: #eceff4 !important; }
html[data-theme="nordic"] .top .btn.primary { background: #88c0d0 !important; color: #2e3440 !important; border-color: transparent !important; }
html[data-theme="nordic"] .top .icon-btn { color: #eceff4 !important; }
:root[data-theme="sunlit"] {
  color-scheme: only light;
  --bg: #fbf4df; --panel: #fffbee; --panel-2: #f3ecd6;
  --ink: #073642; --ink-2: #3d5a62; --ink-3: #667b7e; --line: #e9e0c6;
  --accent: #2a8c84; --accent-2: #b58900; --accent-ink: #FFFFFF; --accent-soft: #e2eedb; --chip: #f3ecd6;
  --c-char-bg: #e3eef0; --c-char: #1f6f8b; --c-tag-bg: #f0e9d4; --c-tag: #3d5a62; --c-rel-bg: #f6e3dc; --c-rel: #b0451a;
  --c-fan-bg: #e6eed6; --c-fan: #5f7400; --c-warn-bg: #FFF1D6; --c-warn: #7A5A00;
  --blob1: transparent; --blob2: transparent; --blob3: transparent;
  --r-paper: #fdf6e3; --r-paper-ink: #073642; --r-night: #002b36; --r-night-ink: #eee8d5; --hl: #f5e3a3;
  --grad: linear-gradient(135deg,#7cc4b7,#2a8c84); --grad-2: linear-gradient(90deg, #2a8c84, #b58900, #2a8c84);
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.07);
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cg fill='%232a8c84' opacity='0.16'%3E%3Ccircle cx='30' cy='40' r='2.2'/%3E%3Ccircle cx='118' cy='22' r='1.6'/%3E%3Ccircle cx='86' cy='104' r='2.6'/%3E%3Ccircle cx='150' cy='140' r='1.8'/%3E%3Ccircle cx='22' cy='142' r='1.4'/%3E%3Ccircle cx='160' cy='70' r='1.2'/%3E%3C/g%3E%3C/svg%3E");
}
html[data-theme="sunlit"] { --brand-c: #2a8c84; }
html[data-theme="sunlit"] .b-title h3, html[data-theme="sunlit"] .card h3 { color: #2a8c84 !important; }
html[data-theme="sunlit"] .sq-r { background: #2a8c84 !important; } html[data-theme="sunlit"] .sq-c { background: #b58900 !important; } html[data-theme="sunlit"] .sq-w { background: #667b7e !important; } html[data-theme="sunlit"] .sq-s { background: #3d5a62 !important; }
html[data-theme="sunlit"] .sq-w, html[data-theme="sunlit"] .sq-s, html[data-theme="sunlit"] .sq-r, html[data-theme="sunlit"] .sq-c { color: #fff !important; }
html[data-theme="sunlit"] .top { background: #073642 !important; border-bottom: 0 !important; color: #fdf6e3; }
html[data-theme="sunlit"] .top .brand { color: #fdf6e3; } html[data-theme="sunlit"] .top .brand span { color: #b5e0d8 !important; } html[data-theme="sunlit"] .top .brand::before { background: #b5e0d8 !important; }
html[data-theme="sunlit"] .top .btn { background: rgba(255,255,255,.1) !important; border-color: rgba(255,255,255,.28) !important; color: #fdf6e3 !important; }
html[data-theme="sunlit"] .top .btn.primary { background: #b5e0d8 !important; color: #073642 !important; border-color: transparent !important; }
html[data-theme="sunlit"] .top .icon-btn { color: #fdf6e3 !important; }
:root[data-theme="inkwash"] {
  color-scheme: only light;
  --bg: #f3eee0; --panel: #fbf8ef; --panel-2: #ede6d3;
  --ink: #3a3a5c; --ink-2: #545470; --ink-3: #7e7a8c; --line: #e2d9c2;
  --accent: #4d699b; --accent-2: #c84053; --accent-ink: #FFFFFF; --accent-soft: #dde3ee; --chip: #ede6d3;
  --c-char-bg: #e6e2ef; --c-char: #624c83; --c-tag-bg: #ece6d6; --c-tag: #545464; --c-rel-bg: #f2dfe0; --c-rel: #a6303f;
  --c-fan-bg: #e4ead8; --c-fan: #5a6e3f; --c-warn-bg: #FFF1D6; --c-warn: #7A5A00;
  --blob1: transparent; --blob2: transparent; --blob3: transparent;
  --r-paper: #f8f4e8; --r-paper-ink: #3a3a5c; --r-night: #1f1f28; --r-night-ink: #dcd7ba; --hl: #e6c384;
  --grad: linear-gradient(135deg,#7fa0c9,#4d699b 60%,#c84053); --grad-2: linear-gradient(90deg, #4d699b, #c84053, #4d699b);
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.07);
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cg fill='%234d699b' opacity='0.16'%3E%3Ccircle cx='30' cy='40' r='2.2'/%3E%3Ccircle cx='118' cy='22' r='1.6'/%3E%3Ccircle cx='86' cy='104' r='2.6'/%3E%3Ccircle cx='150' cy='140' r='1.8'/%3E%3Ccircle cx='22' cy='142' r='1.4'/%3E%3Ccircle cx='160' cy='70' r='1.2'/%3E%3C/g%3E%3C/svg%3E");
}
html[data-theme="inkwash"] { --brand-c: #4d699b; }
html[data-theme="inkwash"] .b-title h3, html[data-theme="inkwash"] .card h3 { color: #4d699b !important; }
html[data-theme="inkwash"] .sq-r { background: #4d699b !important; } html[data-theme="inkwash"] .sq-c { background: #c84053 !important; } html[data-theme="inkwash"] .sq-w { background: #7e7a8c !important; } html[data-theme="inkwash"] .sq-s { background: #545470 !important; }
html[data-theme="inkwash"] .sq-w, html[data-theme="inkwash"] .sq-s, html[data-theme="inkwash"] .sq-r, html[data-theme="inkwash"] .sq-c { color: #fff !important; }
html[data-theme="inkwash"] .top { background: #2b2e48 !important; border-bottom: 0 !important; color: #f1ece0; }
html[data-theme="inkwash"] .top .brand { color: #f1ece0; } html[data-theme="inkwash"] .top .brand span { color: #e6c384 !important; } html[data-theme="inkwash"] .top .brand::before { background: #e6c384 !important; }
html[data-theme="inkwash"] .top .btn { background: rgba(255,255,255,.1) !important; border-color: rgba(255,255,255,.28) !important; color: #f1ece0 !important; }
html[data-theme="inkwash"] .top .btn.primary { background: #e6c384 !important; color: #2b2e48 !important; border-color: transparent !important; }
html[data-theme="inkwash"] .top .icon-btn { color: #f1ece0 !important; }
:root[data-theme="silverlining"] {
  color-scheme: only light;
  --bg: #ebebeb; --panel: #f7f7f7; --panel-2: #dedede;
  --ink: #0d0d0d; --ink-2: #545454; --ink-3: #9a9a9a; --line: #c0c0c0;
  --accent: #545454; --accent-2: #9a9a9a; --accent-ink: #ffffff; --accent-soft: #e0e0e0; --chip: #dedede;
  --c-char-bg: #e2e2e2; --c-char: #3a3a3a; --c-tag-bg: #dedede; --c-tag: #444444; --c-rel-bg: #e8e8e8; --c-rel: #3a3a3a;
  --c-fan-bg: #e4e4e4; --c-fan: #404040; --c-warn-bg: #FFF1D6; --c-warn: #7A5A00;
  --blob1: transparent; --blob2: transparent; --blob3: transparent;
  --r-paper: #f7f7f7; --r-paper-ink: #0d0d0d; --r-night: #1a1a1a; --r-night-ink: #e8e8e8; --hl: #d8d8d8;
  --grad: linear-gradient(135deg,#c0c0c0,#9a9a9a 55%,#545454); --grad-2: linear-gradient(90deg, #545454, #9a9a9a, #545454);
  --shadow: 0 1px 2px rgba(0,0,0,.07), 0 8px 24px rgba(0,0,0,.10);
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cg fill='%239a9a9a' opacity='0.18'%3E%3Ccircle cx='30' cy='40' r='2.2'/%3E%3Ccircle cx='118' cy='22' r='1.6'/%3E%3Ccircle cx='86' cy='104' r='2.6'/%3E%3Ccircle cx='150' cy='140' r='1.8'/%3E%3Ccircle cx='22' cy='142' r='1.4'/%3E%3Ccircle cx='160' cy='70' r='1.2'/%3E%3C/g%3E%3C/svg%3E");
}
html[data-theme="silverlining"] { --brand-c: #545454; }
html[data-theme="silverlining"] .b-title h3, html[data-theme="silverlining"] .card h3 { color: #545454 !important; }
html[data-theme="silverlining"] .sq-r { background: #545454 !important; } html[data-theme="silverlining"] .sq-c { background: #9a9a9a !important; } html[data-theme="silverlining"] .sq-w { background: #7a7a7a !important; } html[data-theme="silverlining"] .sq-s { background: #3a3a3a !important; }
html[data-theme="silverlining"] .sq-w, html[data-theme="silverlining"] .sq-s, html[data-theme="silverlining"] .sq-r, html[data-theme="silverlining"] .sq-c { color: #fff !important; }
html[data-theme="silverlining"] .top { background: #0d0d0d !important; border-bottom: 0 !important; color: #ebebeb; }
html[data-theme="silverlining"] .top .brand { color: #ebebeb; } html[data-theme="silverlining"] .top .brand span { color: #c0c0c0 !important; } html[data-theme="silverlining"] .top .brand::before { background: #c0c0c0 !important; }
html[data-theme="silverlining"] .top .btn { background: rgba(255,255,255,.1) !important; border-color: rgba(255,255,255,.28) !important; color: #ebebeb !important; }
html[data-theme="silverlining"] .top .btn.primary { background: #c0c0c0 !important; color: #0d0d0d !important; border-color: transparent !important; }
html[data-theme="silverlining"] .top .icon-btn { color: #ebebeb !important; }
.tp-new { margin-left: 6px; padding: 1px 7px; border-radius: 6px; background: var(--accent); color: var(--accent-ink); font: 700 10px var(--ui); letter-spacing: .04em; vertical-align: 2px; }

/* ================= Raspberry Cream: the starting theme (calm pinks, raspberry red and a touch of magenta) ================= */
:root[data-theme="raspberry"] {
  color-scheme: only light;
  --bg: #fbf4f1; --panel: #fffdfb; --panel-2: #f6ebe7;
  --ink: #3a2026; --ink-2: #6a4f55; --ink-3: #8f777c; --line: #efdcd8;
  --accent: #c03a5b; --accent-2: #f2a7b8; --accent-ink: #FFFFFF; --accent-soft: #f8dde2; --chip: #f6ebe7;
  --c-char-bg: #f6e4ec; --c-char: #9a2f5c; --c-tag-bg: #f3e9e6; --c-tag: #5d4448; --c-rel-bg: #fbe0e4; --c-rel: #b02a4e;
  --c-fan-bg: #f1e6ea; --c-fan: #7a3d55; --c-warn-bg: #FFF1D6; --c-warn: #7A5A00;
  --blob1: transparent; --blob2: transparent; --blob3: transparent;
  --r-paper: #fffaf7; --r-paper-ink: #3a2026; --r-night: #24161b; --r-night-ink: #f2e1e4; --hl: #ffd6df;
  --grad: linear-gradient(135deg,#f2a7b8,#c03a5b 60%,#8e2a48); --grad-2: linear-gradient(90deg, #c03a5b, #f2a7b8, #c03a5b);
  --shadow: 0 1px 2px rgba(58,32,38,.05), 0 8px 24px rgba(192,58,91,.08);
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cg fill='%23c03a5b' opacity='0.14'%3E%3Ccircle cx='30' cy='40' r='2.2'/%3E%3Ccircle cx='118' cy='22' r='1.6'/%3E%3Ccircle cx='86' cy='104' r='2.6'/%3E%3Ccircle cx='150' cy='140' r='1.8'/%3E%3Ccircle cx='22' cy='142' r='1.4'/%3E%3Ccircle cx='160' cy='70' r='1.2'/%3E%3C/g%3E%3C/svg%3E");
}
html[data-theme="raspberry"] { --brand-c: #c03a5b; }
html[data-theme="raspberry"] .b-title h3, html[data-theme="raspberry"] .card h3 { color: #c03a5b !important; }
html[data-theme="raspberry"] .sq-r { background: #c03a5b !important; } html[data-theme="raspberry"] .sq-c { background: #e0708a !important; } html[data-theme="raspberry"] .sq-w { background: #8f777c !important; } html[data-theme="raspberry"] .sq-s { background: #6a4f55 !important; }
html[data-theme="raspberry"] .sq-w, html[data-theme="raspberry"] .sq-s, html[data-theme="raspberry"] .sq-r, html[data-theme="raspberry"] .sq-c { color: #fff !important; }
html[data-theme="raspberry"] .top { background: #3a2026 !important; border-bottom: 0 !important; color: #fbe6ea; }
html[data-theme="raspberry"] .top .brand { color: #fbe6ea; } html[data-theme="raspberry"] .top .brand span { color: #f2a7b8 !important; } html[data-theme="raspberry"] .top .brand::before { background: #f2a7b8 !important; }
html[data-theme="raspberry"] .top .btn { background: rgba(255,255,255,.1) !important; border-color: rgba(255,255,255,.28) !important; color: #fbe6ea !important; }
html[data-theme="raspberry"] .top .btn.primary { background: #f2a7b8 !important; color: #3a2026 !important; border-color: transparent !important; }
html[data-theme="raspberry"] .top .icon-btn { color: #fbe6ea !important; }

/* ================= Theme picker: preview cards ================= */
html .theme-pop { width: min(680px, calc(100vw - 32px)); }
.tp-head { display: flex; align-items: center; justify-content: space-between; }
.tp-tabs { display: none; gap: 6px; margin: 4px 0 8px; }
.tp-tab { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink-2); font: 600 13px var(--ui); cursor: pointer; }
.tp-tab.on { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.tp-tab .tp-new { vertical-align: 1px; }
.tp-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; }
.tp-card { display: grid; gap: 5px; padding: 0; border: 0; background: none; cursor: pointer; text-align: left; font: inherit; color: var(--ink); }
.tpc-pv { position: relative; display: block; height: 138px; border-radius: 12px; border: 2px solid rgba(0,0,0,.08); overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.06); transition: transform .15s; }
.tp-card:hover .tpc-pv { transform: translateY(-2px); }
.tp-card.on .tpc-pv { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.tpc-top { display: block; height: 18px; padding: 2px 7px; font: 600 italic 9.5px var(--serif); line-height: 14px; }
.tpc-card { display: block; margin: 6px; padding: 5px 6px 6px; border: 1px solid; border-radius: 7px; }
.tpc-card b { display: block; font: 600 10px/1.15 var(--serif); }
.tpc-card i { display: block; font: 500 7.5px var(--ui); font-style: normal; margin: 1px 0 3px; }
.tpc-card u { display: inline-block; text-decoration: none; font: 600 7px var(--ui); padding: 1px 4px; border-radius: 3px; margin-bottom: 3px; white-space: nowrap; }
.tpc-card em { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font: italic 7.5px/1.35 var(--read); border-left: 1.5px solid; padding-left: 4px; }
.tpc-tick { position: absolute; right: 6px; bottom: 6px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font: 700 11px var(--ui); }
.tpc-name { font: 600 12px var(--ui); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-card.on .tpc-name { color: var(--accent); }
.tp-switches { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0 4px; }
@media (max-width: 860px) {
  html .theme-pop { width: 100%; max-height: none !important; padding-bottom: calc(14px + env(safe-area-inset-bottom)) !important; }
  .tp-tabs { display: flex; }
  .tp-group { display: none; } .tp-group.on { display: block; }
  .tp-group .tp-sec { display: none; }
  .tp-row { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; margin: 0 -16px; padding: 4px 16px 6px; scrollbar-width: none; }
  .tp-row::-webkit-scrollbar { display: none; }
  .tp-card { flex: none; width: 112px; scroll-snap-align: start; }
  .tp-switches { grid-template-columns: 1fr 1fr; margin-top: 10px; }
  .tp-switches .tp-switch small { display: none; }
}
html .theme-pop { overflow-x: hidden; }
.tp-row { position: relative; }
/* the picker's parts never grow wider than the sheet (the swipeable row of cards was stretching it) */
html .theme-pop { grid-template-columns: minmax(0, 1fr); }
html .theme-pop > * { min-width: 0; }

/* Celadoncore: the relationship text colour is dark (it's meant for the light-green pill), so plain relationship text needs a light one */
html[data-theme="celadon"] .b-tags .rel .tagl, html[data-theme="celadon"] .rel:not(.chip) { color: #c2f0d5; }

/* ================= Computers: the left nav sits under the header, and the filters panel can be hidden ================= */
@media (min-width: 641px) {
  .top { margin-left: -76px; padding-left: 20px; }
  .navbar { top: var(--top-h, 57px); padding-top: 12px; }
}
.sb-hide { display: none; }
@media (min-width: 861px) {
  .sb-hide { display: inline-flex; align-items: center; gap: 6px; margin: -4px 0 12px auto; padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink-2); font: 600 12.5px var(--ui); cursor: pointer; }
  .sb-hide:hover { color: var(--accent); border-color: var(--accent); }
  .sb-body { display: flex; flex-direction: column; } .sb-body > * { align-self: stretch; } .sb-body > .sb-hide { align-self: flex-end; }
  html.filters-off .layout { grid-template-columns: minmax(0, 1fr); }
  html.filters-off .sidebar { display: none; }
  html.filters-off .filt-btn { display: inline-flex; align-items: center; gap: 6px; }
  /* with the panel hidden, keep things from stretching across very wide screens */
  html.filters-off .main { width: 100%; max-width: 1480px; margin: 0 auto; }
}
/* New shelf: "Put it inside" choices */
.pd-pick { margin: -8px 0 18px; } .pd-pick-l { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.pd-chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 132px; overflow-y: auto; overscroll-behavior: contain; }
.pd-chip { padding: 6px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font: 500 13px var(--ui); cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-chip.on { background: var(--ink); border-color: var(--ink); color: var(--panel); font-weight: 600; }
.pd-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ================= Reading settings on phones: a short sheet with tabs, and a peek mode ================= */
.aa-tabs { display: none; }
@media (max-width: 640px) {
  html body #aaPop:not([hidden]) { display: flex; flex-direction: column; gap: 0; max-height: 70vh; transition: transform .18s ease; }
  html body #aaPop .aa-text { display: contents; }
  #aaPop .aa-head { order: 0; touch-action: none; cursor: grab; }
  #aaPop .aa-inline { order: 1; } #aaPop .aa-theme { order: 2; } #aaPop #pdfOrigRow { order: 3; }
  #aaPop .aa-tabs { order: 4; display: flex; gap: 3px; margin: 8px 0 2px; padding: 3px; border-radius: 10px; background: var(--panel-2); }
  #aaPop .aa-tabs button { flex: 1; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--ink-2); font: 600 13.5px var(--ui); cursor: pointer; }
  #aaPop .aa-tabs button.on { background: var(--panel); color: var(--accent); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
  #aaPop [data-aatab] { order: 5; } #aaPop .aa-support { order: 6; }
  html body #aaPop[data-tab="text"] [data-aatab="spacing"], html body #aaPop[data-tab="spacing"] [data-aatab="text"] { display: none !important; }
  /* peek: only Size and Page colour, no dimming, so the whole page shows while you adjust */
  html body #aaPop.aa-peek { box-shadow: 0 -8px 26px rgba(0,0,0,.18) !important; padding-bottom: calc(8px + env(safe-area-inset-bottom)) !important; }
  html body #aaPop.aa-peek > :not(.aa-head):not(.aa-text):not(.aa-theme), html body #aaPop.aa-peek .aa-text > :not(.aa-inline) { display: none !important; }
  html body #aaPop.aa-peek .aa-head b, html body #aaPop.aa-peek .aa-done { display: none; }
  html body #aaPop.aa-peek .aa-head { min-height: 16px; margin: 0; }
  html body #aaPop.aa-peek .aa-inline { border-top: 0 !important; }
}
@media (max-width: 640px) {
  /* labels beside their controls, so each setting is one short line */
  html body #aaPop .aa-row:not(.aa-slide) { display: grid; grid-template-columns: 90px minmax(0, 1fr); align-items: center; gap: 6px; padding: 6px 0 !important; }
  html body #aaPop .aa-inline .aa-size { justify-self: end; }
  html body #aaPop .seg button { height: 30px; font-size: 12.5px; padding: 0 4px; }
  html body #aaPop .aa-icons button { height: 30px; }
  html body #aaPop .aa-swatches button { gap: 5px; }
  html body #aaPop .aa-head { margin-bottom: 0; }
  html body #aaPop .aa-slide { padding: 6px 0 !important; }
}
/* inside a shelf: the path back, and the shelves inside it */
.vt-crumb { border: 0; background: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 3px; }
.vt-subs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.vt-sub { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); font: 600 14px var(--ui); cursor: pointer; box-shadow: var(--shadow); max-width: 100%; }
.vt-sub svg { color: var(--accent); flex: none; } .vt-sub-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vt-sub-c { font: 600 12px var(--ui); color: var(--ink-2); background: var(--panel-2); border-radius: 6px; padding: 1px 7px; }
.vt-sub:hover { border-color: var(--accent); }
.vt-sub-add { border-style: dashed; border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); color: var(--accent); background: transparent; box-shadow: none; }
@media (max-width: 640px) { .vt-subs { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 12px; padding: 2px 16px 4px; scrollbar-width: none; } .vt-subs::-webkit-scrollbar { display: none; } .vt-sub { flex: none; } }

/* shelves inside shelves, any depth: each level steps in a little (up to 5 steps) */
.my-shelves .ms-row.ms-sub { margin-left: 0 !important; padding-left: calc(var(--d, 1) * 14px) !important; }

/* filter panel: your own shelves line up with the ready-made ones above (same name column, same count column); the arrow that
   opens a shelf sits in the margin to the left, deeper shelves step in, and the ⋯ appears in place of the count on hover */
#sidebar .my-shelves .ms-row { position: relative; display: flex; align-items: center; margin-left: -16px; padding-left: calc(var(--d, 0) * 14px) !important; gap: 0; }
#sidebar .my-shelves .ms-row.ms-sub > a span:first-child::before { content: none; }
#sidebar .my-shelves .ms-tw, #sidebar .my-shelves .ms-tw-sp { width: 16px; height: 28px; flex: none; display: grid; place-items: center; padding: 0; border: 0; background: none; color: var(--ink-2); border-radius: 6px; }
#sidebar .my-shelves .ms-tw svg { transition: transform .15s; } #sidebar .my-shelves .ms-tw[aria-expanded="true"] svg { transform: rotate(90deg); }
#sidebar .my-shelves .ms-tw:hover { color: var(--accent); }
#sidebar .my-shelves .ms-row > a { flex: 1; min-width: 0; }
#sidebar .my-shelves .ms-row > a span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#sidebar .my-shelves .ms-edit { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 28px; height: 26px; opacity: 0; border-radius: 6px; }
#sidebar .my-shelves .ms-row:hover .ms-edit, #sidebar .my-shelves .ms-edit:focus-visible, #sidebar .my-shelves .ms-edit[aria-expanded="true"] { opacity: 1; }
#sidebar .my-shelves .ms-row:hover > a .n, #sidebar .my-shelves .ms-row:focus-within > a .n { visibility: hidden; }
@media (hover: none) { #sidebar .my-shelves .ms-edit { opacity: .7; } #sidebar .my-shelves .ms-row > a { padding-right: 34px; } }
/* menus where you tick several things: the ticked box says it, no pink block behind every row (one-choice menus keep their highlight) */
html .pop-menu .pm-item.pm-box.on { background: none; font-weight: 500; }
html .pop-menu .pm-item.pm-box.on:hover, html .pop-menu .pm-item.pm-box.on:focus-visible { background: var(--panel-2); }

/* ================= Reading on phones and tablets: the page itself scrolls, so the browser's address bar can hide ================= */
html.reader-page, html.reader-page body { overflow-y: visible !important; overflow-x: clip !important; overscroll-behavior: auto !important; height: auto !important; }
html.reader-page body { padding-left: 0 !important; }
html.reader-page body > .top, html.reader-page body > .navbar, html.reader-page body > .layout, html.reader-page body > .foot,
html.reader-page body > .sel-bar, html.reader-page body > .offline-bar:not([hidden]) ~ .foot { display: none !important; }
html.reader-page .reader:not([hidden]) { position: relative !important; inset: auto !important; display: block; min-height: 100vh; min-height: 100svh; }
html.reader-page .reader-scroll { overflow: visible !important; height: auto !important; }
html.reader-page .reader-bar { position: fixed !important; top: 0; left: 0; right: 0; }
html.reader-page .reader-progress { position: fixed !important; }
html.reader-page .reader-pct { position: fixed !important; }

/* ================= Themes made for the beta testers: Vae's Jellyfish Bloom, Sofia Solstice, Monokai ================= */
:root[data-theme="vae"] {
  color-scheme: dark;
  --bg: #071423; --panel: #0d1f33; --panel-2: #13294a; --ink: #e4f3ff; --ink-2: #a9cbe8; --ink-3: #8fb0cf; --line: #1f3a5a;
  --accent: #6fe3f2; --accent-2: #b994ff; --accent-ink: #04121f; --accent-soft: #12324a; --chip: #13294a;
  --c-char-bg: #0f3a46; --c-char: #9ff1ff; --c-tag-bg: #13294a; --c-tag: #a9cbe8; --c-rel-bg: #2a2150; --c-rel: #e2d2ff;
  --c-fan-bg: #1d1f4a; --c-fan: #c8b6ff; --c-warn-bg: #3b2a14; --c-warn: #ffd49a;
  --blob1: transparent; --blob2: transparent; --blob3: transparent;
  --r-paper: #f2f8fc; --r-paper-ink: #0d1f33; --r-night: #071423; --r-night-ink: #dcecfb; --hl: #6fe3f2;
  --grad: linear-gradient(135deg, #1f6f8a 0%, #2b7d99 50%, #5b4bb0 100%); --grad-2: linear-gradient(90deg, #6fe3f2, #b994ff, #ff9ad5, #6fe3f2);
  --shadow: 0 1px 2px rgba(0,0,0,.6), 0 8px 24px rgba(0,0,0,.35);
  --pattern: url("img/jellyfish.svg");
}
html[data-theme="vae"] { --brand-c: #8fecf7; }
html[data-theme="vae"] .b-title h3, html[data-theme="vae"] .card h3 { color: #8fecf7 !important; }
html[data-theme="vae"] .top { background: #050f1c !important; border-bottom: 1px solid #1f3a5a !important; color: #bfefff; }
html[data-theme="vae"] .top .brand { color: #bfefff; } html[data-theme="vae"] .top .brand span { color: #8fecf7 !important; } html[data-theme="vae"] .top .brand::before { background: #8fecf7 !important; }
html[data-theme="vae"] .top .btn { background: color-mix(in srgb, #bfefff 10%, transparent) !important; border-color: color-mix(in srgb, #bfefff 30%, transparent) !important; color: #bfefff !important; }
html[data-theme="vae"] .top .btn.primary { background: #6fe3f2 !important; color: #04121f !important; border-color: transparent !important; }
html[data-theme="vae"] .top .icon-btn { color: #bfefff !important; }
html[data-theme="vae"] select.btn, html[data-theme="vae"] .tools select, html[data-theme="vae"] .settings select, html[data-theme="vae"] .reader-tools select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23a9cbe8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
html[data-theme="vae"] .toast-item { box-shadow: 0 10px 30px rgba(0,0,0,.5); }
html[data-theme="vae"] .dl { color: #6fe3f2 !important; }
html[data-theme="vae"] .req .sq { color: #071423 !important; }
html[data-theme="vae"] .b-tags .rel .tagl { color: #e2d2ff; }
:root[data-theme="sofia"] {
  color-scheme: dark;
  --bg: #000000; --panel: #0e0e0e; --panel-2: #1c1c1c; --ink: #faf0e6; --ink-2: #ffe8b4; --ink-3: #c4b79c; --line: #3a1a20;
  --accent: #ffe8b4; --accent-2: #7a1424; --accent-ink: #1a0a0d; --accent-soft: #3d0710; --chip: #1c1c1c;
  --c-char-bg: #1c1c1c; --c-char: #ffffff; --c-tag-bg: #1c1c1c; --c-tag: #e6dccb; --c-rel-bg: #5a0c18; --c-rel: #ffe8b4;
  --c-fan-bg: #2a0610; --c-fan: #ffe8b4; --c-warn-bg: #3d0710; --c-warn: #ffb3b3;
  --blob1: transparent; --blob2: transparent; --blob3: transparent;
  --r-paper: #faf0e6; --r-paper-ink: #1a0a0d; --r-night: #000000; --r-night-ink: #faf0e6; --hl: #7a1424;
  --grad: linear-gradient(135deg, #3d0710 0%, #7a1424 60%, #9a2638 100%); --grad-2: linear-gradient(90deg, #7a1424, #ffe8b4, #7a1424);
  --shadow: 0 1px 2px rgba(0,0,0,.6), 0 8px 24px rgba(0,0,0,.35);
  --pattern: url("img/stars.svg");
}
html[data-theme="sofia"] { --brand-c: #ffe8b4; }
html[data-theme="sofia"] .b-title h3, html[data-theme="sofia"] .card h3 { color: #ffe8b4 !important; }
html[data-theme="sofia"] .top { background: #6b0f1d !important; border-bottom: 1px solid #3a1a20 !important; color: #ffe8b4; }
html[data-theme="sofia"] .top .brand { color: #ffe8b4; } html[data-theme="sofia"] .top .brand span { color: #ffe8b4 !important; } html[data-theme="sofia"] .top .brand::before { background: #ffe8b4 !important; }
html[data-theme="sofia"] .top .btn { background: color-mix(in srgb, #ffe8b4 10%, transparent) !important; border-color: color-mix(in srgb, #ffe8b4 30%, transparent) !important; color: #ffe8b4 !important; }
html[data-theme="sofia"] .top .btn.primary { background: #ffe8b4 !important; color: #1a0a0d !important; border-color: transparent !important; }
html[data-theme="sofia"] .top .icon-btn { color: #ffe8b4 !important; }
html[data-theme="sofia"] select.btn, html[data-theme="sofia"] .tools select, html[data-theme="sofia"] .settings select, html[data-theme="sofia"] .reader-tools select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23ffe8b4' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
html[data-theme="sofia"] .toast-item { box-shadow: 0 10px 30px rgba(0,0,0,.5); }
html[data-theme="sofia"] .dl { color: #ffe8b4 !important; }
html[data-theme="sofia"] .req .sq { color: #000000 !important; }
html[data-theme="sofia"] .b-tags .rel .tagl { color: #ffe8b4; }
:root[data-theme="monokai"] {
  color-scheme: dark;
  --bg: #1e1f1c; --panel: #272822; --panel-2: #3e3d32; --ink: #f8f8f2; --ink-2: #cfcfc2; --ink-3: #a8a28a; --line: #3e3d32;
  --accent: #a6e22e; --accent-2: #f92672; --accent-ink: #1e1f1c; --accent-soft: #33402a; --chip: #3e3d32;
  --c-char-bg: #1b3a40; --c-char: #66d9ef; --c-tag-bg: #3a3820; --c-tag: #e6db74; --c-rel-bg: #4a1a2c; --c-rel: #ff5c94;
  --c-fan-bg: #2e2448; --c-fan: #ae81ff; --c-warn-bg: #3e2c14; --c-warn: #fd971f;
  --blob1: transparent; --blob2: transparent; --blob3: transparent;
  --r-paper: #f8f8f2; --r-paper-ink: #272822; --r-night: #272822; --r-night-ink: #f8f8f2; --hl: #e6db74;
  --grad: linear-gradient(135deg, #4a8a12 0%, #6a9a1e 50%, #a8326a 100%); --grad-2: linear-gradient(90deg, #f92672, #fd971f, #e6db74, #a6e22e, #66d9ef, #ae81ff);
  --shadow: 0 1px 2px rgba(0,0,0,.6), 0 8px 24px rgba(0,0,0,.35);
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='200' viewBox='0 0 240 200'%3E%3Cg opacity='.09'%3E%3Ctext x='14' y='30' font-family='Menlo,Consolas,monospace' font-size='18' fill='%23a6e22e'%3E%7B %7D%3C/text%3E%3Ctext x='150' y='52' font-family='Menlo,Consolas,monospace' font-size='16' fill='%23f92672'%3E=%26gt%3B%3C/text%3E%3Ctext x='70' y='110' font-family='Menlo,Consolas,monospace' font-size='18' fill='%2375715e'%3E//%3C/text%3E%3Ctext x='180' y='140' font-family='Menlo,Consolas,monospace' font-size='15' fill='%2366d9ef'%3E%26lt%3B/%26gt%3B%3C/text%3E%3Ctext x='26' y='176' font-family='Menlo,Consolas,monospace' font-size='20' fill='%23fd971f'%3E%3B%3C/text%3E%3Ctext x='110' y='186' font-family='Menlo,Consolas,monospace' font-size='15' fill='%23ae81ff'%3E()%3C/text%3E%3C/g%3E%3C/svg%3E");
}
html[data-theme="monokai"] { --brand-c: #a6e22e; }
html[data-theme="monokai"] .b-title h3, html[data-theme="monokai"] .card h3 { color: #a6e22e !important; }
html[data-theme="monokai"] .top { background: #1e1f1c !important; border-bottom: 1px solid #3e3d32 !important; color: #f8f8f2; }
html[data-theme="monokai"] .top .brand { color: #f8f8f2; } html[data-theme="monokai"] .top .brand span { color: #a6e22e !important; } html[data-theme="monokai"] .top .brand::before { background: #a6e22e !important; }
html[data-theme="monokai"] .top .btn { background: color-mix(in srgb, #f8f8f2 10%, transparent) !important; border-color: color-mix(in srgb, #f8f8f2 30%, transparent) !important; color: #f8f8f2 !important; }
html[data-theme="monokai"] .top .btn.primary { background: #a6e22e !important; color: #1e1f1c !important; border-color: transparent !important; }
html[data-theme="monokai"] .top .icon-btn { color: #f8f8f2 !important; }
html[data-theme="monokai"] select.btn, html[data-theme="monokai"] .tools select, html[data-theme="monokai"] .settings select, html[data-theme="monokai"] .reader-tools select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23cfcfc2' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
html[data-theme="monokai"] .toast-item { box-shadow: 0 10px 30px rgba(0,0,0,.5); }
html[data-theme="monokai"] .dl { color: #a6e22e !important; }
html[data-theme="monokai"] .req .sq { color: #1e1f1c !important; }
html[data-theme="monokai"] .b-tags .rel .tagl { color: #ff5c94; }

/* Vae: the jellyfish drift a little larger on computers, smaller on phones so more of them show */
html[data-theme="vae"] body, html[data-theme="vae"] body::before { background-size: 440px auto !important; }
@media (max-width: 640px) { html[data-theme="vae"] body, html[data-theme="vae"] body::before { background-size: 300px auto !important; } }
html[data-theme="vae"] .card, html[data-theme="vae"] .blurb { box-shadow: 0 0 0 1px #1f3a5a, 0 8px 28px rgba(111,227,242,.08); }
html[data-theme="vae"] .fav-btn.on, html[data-theme="vae"] .fav { color: #ff9ad5 !important; }

/* Sofia: a loving copy of her AO3 skin: black and starlit, maroon bars, old gold, Times New Roman, AO3's glossy grey buttons */
html[data-theme="sofia"] { --serif: "Times New Roman", Times, serif; }
html[data-theme="sofia"]:not([data-ui-font="easy"]) { --ui: "Times New Roman", Times, serif; }
html[data-theme="sofia"] body, html[data-theme="sofia"] body::before { background-size: 160px !important; }
html[data-theme="sofia"] .top { border-bottom: 4px solid #3d0710 !important; box-shadow: 0 3px 0 #8a1a2c; }
html[data-theme="sofia"] .btn:not(.primary):not(.icon-btn) { background: #555; color: #eee; border-color: #2a2a2a; box-shadow: inset 0 -8px 4px #232323, inset 0 8px 7px #555; }
html[data-theme="sofia"] .btn.primary { background: #7a1424; color: #ffe8b4; border-color: #3d0710; box-shadow: inset 0 -6px 4px #3d0710, inset 0 6px 6px #9a2638; }
html[data-theme="sofia"] .card, html[data-theme="sofia"] .blurb { border-color: #5a0c18; background: rgba(12,0,3,.9); border-radius: 6px; }
html[data-theme="sofia"] .b-stats { background: #2a0610; border-radius: 4px; padding: 3px 8px; }
html[data-theme="sofia"] .navbar { background: #1c0307; border-color: #5a0c18; }
html[data-theme="sofia"] .nav-item.on, html[data-theme="sofia"] .nav-item[aria-current] { color: #ffe8b4; background: #5a0c18; }
@media (max-width: 640px) { html[data-theme="sofia"] .navbar { background: #6b0f1d; border-top: 3px solid #3d0710; } html[data-theme="sofia"] .nav-item { color: #e6cfa8; } }
html[data-theme="sofia"] .fav-btn.on, html[data-theme="sofia"] .fav { color: #ffb3b3 !important; }

/* Monokai: every kind of tag its own colour, like syntax highlighting, with details in a code font */
html[data-theme="monokai"] .b-title .by, html[data-theme="monokai"] .b-title .by a, html[data-theme="monokai"] .card .by a { color: #fd971f !important; }
html[data-theme="monokai"] .b-fandoms .tagl { color: #ae81ff; }
html[data-theme="monokai"] .b-tags .warn .tagl { color: #fd971f; }
html[data-theme="monokai"] .b-tags .char .tagl { color: #66d9ef; }
html[data-theme="monokai"] .b-tags .free .tagl { color: #e6db74; }
html[data-theme="monokai"] .b-tags, html[data-theme="monokai"] .b-fandoms, html[data-theme="monokai"] .b-stats, html[data-theme="monokai"] .b-date { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .92em; }
html[data-theme="monokai"] .b-stats dt { color: #ae81ff; } html[data-theme="monokai"] .b-stats dd { color: #e6db74; }
html[data-theme="monokai"] .b-summary { border-left-color: #75715e !important; color: #cfcfc2; }
html[data-theme="monokai"] .card, html[data-theme="monokai"] .blurb { border-left: 3px solid #a6e22e; border-radius: 6px; }
html[data-theme="monokai"] .top .brand span { color: #f92672 !important; }
html[data-theme="monokai"] .fav-btn.on, html[data-theme="monokai"] .fav { color: #f92672 !important; }

.tpc-credit { font: 600 10.5px var(--ui); color: var(--accent); margin-top: -3px; white-space: nowrap; }
#vtSubs:empty { display: none; } #vtSubs .vt-subs { margin-top: 2px; }

/* Ko-fi note */
.wn-kofi .kp-lead { margin: 10px 4px 0; text-align: center; color: var(--ink-2); line-height: 1.55; }
.wn-kofi .wn-btns a.btn { text-decoration: none; }

/* ================= Computers: the filters panel's hide/show arrow sits on the panel's left edge, level with the first row ================= */
@media (min-width: 861px) {
  html .sb-hide { display: grid; place-items: center; position: fixed; z-index: 25; top: calc(var(--top-h, 57px) + 21px); right: calc(280px - 13px);
    width: 26px; height: 30px; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink-2);
    box-shadow: 0 2px 8px rgba(0,0,0,.10); cursor: pointer; transition: right .2s ease, color .15s, border-color .15s; }
  html .sb-hide:hover, html .sb-hide:focus-visible { color: var(--accent); border-color: var(--accent); }
  html .sb-hide svg { transition: transform .2s ease; }
  html.filters-off .sb-hide { right: 0; width: 20px; border-right: 0; border-radius: 8px 0 0 8px; } html.filters-off .sb-hide svg { transform: rotate(180deg); }
  html.reading .sb-hide, html.reader-page .sb-hide { display: none; }
}
/* Sofia: the reader's "← Library" button wears the glossy grey AO3 button, so its text stays light on every page colour */
html[data-theme="sofia"] .reader-bar #readerBack, html[data-theme="sofia"] .reader-bar #readerBack .rb-lbl { color: #eee !important; }

/* ================= Aqua: jellyfish themes (Vae's Jellyfish Bloom, Abyssal Neon, Dusk Bloom, Ink Jellies) ================= */
:root[data-theme="abyssal"] {
  color-scheme: dark;
  --bg: #02060d; --panel: #07111f; --panel-2: #0d1c30; --ink: #e9f6ff; --ink-2: #9fb8cc; --ink-3: #86a2b8; --line: #173049;
  --accent: #6ff7ff; --accent-2: #ff5fd8; --accent-ink: #02060d; --accent-soft: #0e2a36; --chip: #0d1c30;
  --c-char-bg: #0b2f36; --c-char: #6ff7ff; --c-tag-bg: #0d1c30; --c-tag: #a9c3d6; --c-rel-bg: #3a0f35; --c-rel: #ff9be8;
  --c-fan-bg: #1f1640; --c-fan: #c3b5ff; --c-warn-bg: #3b2a14; --c-warn: #ffd49a;
  --blob1: transparent; --blob2: transparent; --blob3: transparent;
  --r-paper: #f2f8fc; --r-paper-ink: #07111f; --r-night: #02060d; --r-night-ink: #dbeaf5; --hl: #ff5fd8;
  --grad: linear-gradient(135deg, #0b6f7a 0%, #7a2a8a 100%); --grad-2: linear-gradient(90deg, #6ff7ff, #ff5fd8, #8f7bff, #6ff7ff);
  --shadow: 0 1px 2px rgba(0,0,0,.6), 0 8px 24px rgba(0,0,0,.35);
  --pattern: url("img/jelly-neon.svg");
}
html[data-theme="abyssal"] { --brand-c: #6ff7ff; }
html[data-theme="abyssal"] .b-title h3, html[data-theme="abyssal"] .card h3 { color: #6ff7ff !important; }
html[data-theme="abyssal"] .top { background: #02060d !important; border-bottom: 1px solid #173049 !important; color: #e9f6ff; }
html[data-theme="abyssal"] .top .brand { color: #e9f6ff; } html[data-theme="abyssal"] .top .brand span { color: #6ff7ff !important; } html[data-theme="abyssal"] .top .brand::before { background: #6ff7ff !important; }
html[data-theme="abyssal"] .top .btn { background: color-mix(in srgb, #e9f6ff 10%, transparent) !important; border-color: color-mix(in srgb, #e9f6ff 30%, transparent) !important; color: #e9f6ff !important; }
html[data-theme="abyssal"] .top .btn.primary { background: #6ff7ff !important; color: #02060d !important; border-color: transparent !important; }
html[data-theme="abyssal"] .top .icon-btn { color: #e9f6ff !important; }
html[data-theme="abyssal"] select.btn, html[data-theme="abyssal"] .tools select, html[data-theme="abyssal"] .settings select, html[data-theme="abyssal"] .reader-tools select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%239fb8cc' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
html[data-theme="abyssal"] .toast-item { box-shadow: 0 10px 30px rgba(0,0,0,.5); }
html[data-theme="abyssal"] .dl { color: #6ff7ff !important; }
html[data-theme="abyssal"] .req .sq { color: #02060d !important; }
html[data-theme="abyssal"] .b-tags .rel .tagl { color: #ff9be8; }
html[data-theme="abyssal"] body, html[data-theme="abyssal"] body::before { background-size: 420px auto !important; }
@media (max-width: 640px) { html[data-theme="abyssal"] body, html[data-theme="abyssal"] body::before { background-size: 300px auto !important; } }
html[data-theme="abyssal"] .card, html[data-theme="abyssal"] .blurb { box-shadow: 0 0 0 1px #173049, 0 8px 28px color-mix(in srgb, #6ff7ff 8%, transparent); }
:root[data-theme="duskbloom"] {
  color-scheme: dark;
  --bg: #23224a; --panel: #2b2a58; --panel-2: #36346a; --ink: #f3eeff; --ink-2: #c3bce6; --ink-3: #aaa2d4; --line: #3d3a72;
  --accent: #ff8fc7; --accent-2: #ffc59a; --accent-ink: #23224a; --accent-soft: #43305e; --chip: #36346a;
  --c-char-bg: #4a3434; --c-char: #ffc59a; --c-tag-bg: #36346a; --c-tag: #cfc8ee; --c-rel-bg: #4a2450; --c-rel: #ffb3d9;
  --c-fan-bg: #2f2c66; --c-fan: #c9bcff; --c-warn-bg: #4a3a1e; --c-warn: #ffd9a0;
  --blob1: transparent; --blob2: transparent; --blob3: transparent;
  --r-paper: #fbf6fb; --r-paper-ink: #2b2a58; --r-night: #1f1e42; --r-night-ink: #ece6ff; --hl: #ff8fc7;
  --grad: linear-gradient(135deg, #8a3d78 0%, #c45a8e 55%, #d9845a 100%); --grad-2: linear-gradient(90deg, #ff8fc7, #ffc59a, #b9a8ff, #ff8fc7);
  --shadow: 0 1px 2px rgba(0,0,0,.6), 0 8px 24px rgba(0,0,0,.35);
  --pattern: url("img/jelly-dusk.svg");
}
html[data-theme="duskbloom"] { --brand-c: #ffb3d9; }
html[data-theme="duskbloom"] .b-title h3, html[data-theme="duskbloom"] .card h3 { color: #ffb3d9 !important; }
html[data-theme="duskbloom"] .top { background: #1c1b3d !important; border-bottom: 1px solid #3d3a72 !important; color: #f3eeff; }
html[data-theme="duskbloom"] .top .brand { color: #f3eeff; } html[data-theme="duskbloom"] .top .brand span { color: #ffb3d9 !important; } html[data-theme="duskbloom"] .top .brand::before { background: #ffb3d9 !important; }
html[data-theme="duskbloom"] .top .btn { background: color-mix(in srgb, #f3eeff 10%, transparent) !important; border-color: color-mix(in srgb, #f3eeff 30%, transparent) !important; color: #f3eeff !important; }
html[data-theme="duskbloom"] .top .btn.primary { background: #ff8fc7 !important; color: #23224a !important; border-color: transparent !important; }
html[data-theme="duskbloom"] .top .icon-btn { color: #f3eeff !important; }
html[data-theme="duskbloom"] select.btn, html[data-theme="duskbloom"] .tools select, html[data-theme="duskbloom"] .settings select, html[data-theme="duskbloom"] .reader-tools select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23c3bce6' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
html[data-theme="duskbloom"] .toast-item { box-shadow: 0 10px 30px rgba(0,0,0,.5); }
html[data-theme="duskbloom"] .dl { color: #ff8fc7 !important; }
html[data-theme="duskbloom"] .req .sq { color: #23224a !important; }
html[data-theme="duskbloom"] .b-tags .rel .tagl { color: #ffb3d9; }
html[data-theme="duskbloom"] body, html[data-theme="duskbloom"] body::before { background-size: 440px auto !important; }
@media (max-width: 640px) { html[data-theme="duskbloom"] body, html[data-theme="duskbloom"] body::before { background-size: 300px auto !important; } }
html[data-theme="duskbloom"] .card, html[data-theme="duskbloom"] .blurb { box-shadow: 0 0 0 1px #3d3a72, 0 8px 28px color-mix(in srgb, #ff8fc7 8%, transparent); }
:root[data-theme="inkjellies"] {
  color-scheme: dark;
  --bg: #0c1424; --panel: #111c30; --panel-2: #18263f; --ink: #e8eef8; --ink-2: #a7b6cc; --ink-3: #8e9fb8; --line: #22324d;
  --accent: #8fd6e8; --accent-2: #c9b8ff; --accent-ink: #0c1424; --accent-soft: #16304a; --chip: #18263f;
  --c-char-bg: #132b3a; --c-char: #8fd6e8; --c-tag-bg: #18263f; --c-tag: #b3c1d6; --c-rel-bg: #252447; --c-rel: #c9b8ff;
  --c-fan-bg: #1d2747; --c-fan: #b9c8ff; --c-warn-bg: #3b2f1a; --c-warn: #f0d39a;
  --blob1: transparent; --blob2: transparent; --blob3: transparent;
  --r-paper: #f4f7fb; --r-paper-ink: #111c30; --r-night: #0e1626; --r-night-ink: #e3eaf4; --hl: #8fd6e8;
  --grad: linear-gradient(135deg, #2a5f75 0%, #4a4f8a 100%); --grad-2: linear-gradient(90deg, #8fd6e8, #c9b8ff, #8fd6e8);
  --shadow: 0 1px 2px rgba(0,0,0,.6), 0 8px 24px rgba(0,0,0,.35);
  --pattern: url("img/jelly-ink.svg");
}
html[data-theme="inkjellies"] { --brand-c: #e8eef8; }
html[data-theme="inkjellies"] .b-title h3, html[data-theme="inkjellies"] .card h3 { color: #e8eef8 !important; }
html[data-theme="inkjellies"] .top { background: #0c1424 !important; border-bottom: 1px solid #22324d !important; color: #e8eef8; }
html[data-theme="inkjellies"] .top .brand { color: #e8eef8; } html[data-theme="inkjellies"] .top .brand span { color: #e8eef8 !important; } html[data-theme="inkjellies"] .top .brand::before { background: #e8eef8 !important; }
html[data-theme="inkjellies"] .top .btn { background: color-mix(in srgb, #e8eef8 10%, transparent) !important; border-color: color-mix(in srgb, #e8eef8 30%, transparent) !important; color: #e8eef8 !important; }
html[data-theme="inkjellies"] .top .btn.primary { background: #8fd6e8 !important; color: #0c1424 !important; border-color: transparent !important; }
html[data-theme="inkjellies"] .top .icon-btn { color: #e8eef8 !important; }
html[data-theme="inkjellies"] select.btn, html[data-theme="inkjellies"] .tools select, html[data-theme="inkjellies"] .settings select, html[data-theme="inkjellies"] .reader-tools select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23a7b6cc' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
html[data-theme="inkjellies"] .toast-item { box-shadow: 0 10px 30px rgba(0,0,0,.5); }
html[data-theme="inkjellies"] .dl { color: #8fd6e8 !important; }
html[data-theme="inkjellies"] .req .sq { color: #0c1424 !important; }
html[data-theme="inkjellies"] .b-tags .rel .tagl { color: #c9b8ff; }
html[data-theme="inkjellies"] body, html[data-theme="inkjellies"] body::before { background-size: 420px auto !important; }
@media (max-width: 640px) { html[data-theme="inkjellies"] body, html[data-theme="inkjellies"] body::before { background-size: 320px auto !important; } }
html[data-theme="inkjellies"] .card, html[data-theme="inkjellies"] .blurb { box-shadow: 0 0 0 1px #22324d, 0 8px 28px color-mix(in srgb, #8fd6e8 8%, transparent); }
/* Shelves screen and Shelf life have no filters panel: use the full width (no empty strip where the panel would be), and no panel arrow */
@media (min-width: 861px) { body.shv-on .shelves-view { max-width: 1480px; margin: 0 auto; } }
body.shv-on .sb-hide, body.stats-on .sb-hide { display: none !important; }

/* ================= New themes: Teddy Bear, Archive Classic, Grace, Dusky Dark Purple, Starry Night; Aurora; Cyberpunk ================= */
:root[data-theme="teddy"] {
  color-scheme: light;
  --bg: #f4e8d8; --panel: #fffaf3; --panel-2: #f1e2cf; --ink: #3b2a1e; --ink-2: #6b5240; --ink-3: #866c58; --line: #e6d2bb;
  --accent: #83593a; --accent-2: #a77551; --accent-ink: #fffaf3; --accent-soft: #efdcc4; --chip: #f1e2cf;
  --c-char-bg: #f1dfc9; --c-char: #6b4a2f; --c-tag-bg: #f6eadb; --c-tag: #6b5240; --c-rel-bg: #ead0b3; --c-rel: #59422e;
  --c-fan-bg: #efe0cc; --c-fan: #7a5a3f; --c-warn-bg: #f6dccc; --c-warn: #8a3b1e;
  --blob1: transparent; --blob2: transparent; --blob3: transparent;
  --r-paper: #fbf5ec; --r-paper-ink: #3b2a1e; --r-night: #2b2925; --r-night-ink: #e8d8c4; --hl: #dcb697;
  --grad: linear-gradient(135deg, #a77551 0%, #83593a 60%, #59422e 100%); --grad-2: linear-gradient(90deg, #dcb697, #c8956e, #a77551, #83593a);
  --shadow: 0 1px 2px rgba(60,40,20,.08), 0 8px 24px rgba(60,40,20,.08);
  --pattern: url("img/teddy.svg");
}
html[data-theme="teddy"] { --brand-c: #83593a; }
html[data-theme="teddy"] .b-title h3, html[data-theme="teddy"] .card h3 { color: #83593a !important; }
html[data-theme="teddy"] .top { background: #59422e !important; border-bottom: 1px solid #59422e !important; color: #f4e8d8; }
html[data-theme="teddy"] .top .brand { color: #f4e8d8; } html[data-theme="teddy"] .top .brand span { color: #f4e8d8 !important; } html[data-theme="teddy"] .top .brand::before { background: #f4e8d8 !important; }
html[data-theme="teddy"] .top .btn { background: color-mix(in srgb, #f4e8d8 12%, transparent) !important; border-color: color-mix(in srgb, #f4e8d8 32%, transparent) !important; color: #f4e8d8 !important; }
html[data-theme="teddy"] .top .btn.primary { background: #f4e8d8 !important; color: #59422e !important; border-color: transparent !important; }
html[data-theme="teddy"] .top .icon-btn { color: #f4e8d8 !important; }
html[data-theme="teddy"] select.btn, html[data-theme="teddy"] .tools select, html[data-theme="teddy"] .settings select, html[data-theme="teddy"] .reader-tools select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236b5240' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
html[data-theme="teddy"] .req .sq { color: #fff !important; }
html[data-theme="teddy"] .b-tags .rel .tagl { color: #59422e; }
html[data-theme="teddy"] body, html[data-theme="teddy"] body::before { background-size: 240px auto !important; }
:root[data-theme="archive"] {
  color-scheme: light;
  --bg: #ffffff; --panel: #ffffff; --panel-2: #f3f3f3; --ink: #2a2a2a; --ink-2: #555555; --ink-3: #6f6f6f; --line: #dddddd;
  --accent: #990000; --accent-2: #cc3333; --accent-ink: #ffffff; --accent-soft: #f6e6e6; --chip: #f3f3f3;
  --c-char-bg: #f3f3f3; --c-char: #2a2a2a; --c-tag-bg: #f3f3f3; --c-tag: #555555; --c-rel-bg: #f6e6e6; --c-rel: #990000;
  --c-fan-bg: #eeeeee; --c-fan: #2a2a2a; --c-warn-bg: #fdeaea; --c-warn: #990000;
  --blob1: transparent; --blob2: transparent; --blob3: transparent;
  --r-paper: #ffffff; --r-paper-ink: #2a2a2a; --r-night: #1e1e1e; --r-night-ink: #dddddd; --hl: #ffef9e;
  --grad: linear-gradient(135deg, #990000 0%, #b31f1f 100%); --grad-2: linear-gradient(90deg, #990000, #cc3333, #990000);
  --shadow: 0 1px 2px rgba(60,40,20,.08), 0 8px 24px rgba(60,40,20,.08);
  --pattern: none;
}
html[data-theme="archive"] { --brand-c: #990000; }
html[data-theme="archive"] .b-title h3, html[data-theme="archive"] .card h3 { color: #990000 !important; }
html[data-theme="archive"] .top { background: #990000 !important; border-bottom: 1px solid #990000 !important; color: #ffffff; }
html[data-theme="archive"] .top .brand { color: #ffffff; } html[data-theme="archive"] .top .brand span { color: #ffffff !important; } html[data-theme="archive"] .top .brand::before { background: #ffffff !important; }
html[data-theme="archive"] .top .btn { background: color-mix(in srgb, #ffffff 12%, transparent) !important; border-color: color-mix(in srgb, #ffffff 32%, transparent) !important; color: #ffffff !important; }
html[data-theme="archive"] .top .btn.primary { background: #ffffff !important; color: #990000 !important; border-color: transparent !important; }
html[data-theme="archive"] .top .icon-btn { color: #ffffff !important; }
html[data-theme="archive"] select.btn, html[data-theme="archive"] .tools select, html[data-theme="archive"] .settings select, html[data-theme="archive"] .reader-tools select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23555555' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
html[data-theme="archive"] .req .sq { color: #fff !important; }
html[data-theme="archive"] .b-tags .rel .tagl { color: #990000; }
:root[data-theme="grace"] {
  color-scheme: light;
  --bg: #f7ead9; --panel: #fff6ea; --panel-2: #f3e1c9; --ink: #1e404f; --ink-2: #34685c; --ink-3: #4f6f74; --line: #ecd3b4;
  --accent: #cc2132; --accent-2: #e6692a; --accent-ink: #fff6ea; --accent-soft: #f6d9c4; --chip: #f3e1c9;
  --c-char-bg: #e3eee9; --c-char: #2c5a50; --c-tag-bg: #f6e7d2; --c-tag: #5e5617; --c-rel-bg: #f9d5d0; --c-rel: #a81b29;
  --c-fan-bg: #fde6cc; --c-fan: #a3480d; --c-warn-bg: #fde0d6; --c-warn: #b01c2b;
  --blob1: transparent; --blob2: transparent; --blob3: transparent;
  --r-paper: #fbf3e7; --r-paper-ink: #1e404f; --r-night: #16303b; --r-night-ink: #f2e2cc; --hl: #ed9530;
  --grad: linear-gradient(135deg, #cc2132 0%, #e6692a 55%, #b8530f 100%); --grad-2: linear-gradient(90deg, #cc2132, #e6692a, #ed9530, #988a20, #34685c, #1e404f);
  --shadow: 0 1px 2px rgba(60,40,20,.08), 0 8px 24px rgba(60,40,20,.08);
  --pattern: url("img/grace.svg");
}
html[data-theme="grace"] { --brand-c: #cc2132; }
html[data-theme="grace"] .b-title h3, html[data-theme="grace"] .card h3 { color: #cc2132 !important; }
html[data-theme="grace"] .top { background: #1e404f !important; border-bottom: 1px solid #1e404f !important; color: #f7ead9; }
html[data-theme="grace"] .top .brand { color: #f7ead9; } html[data-theme="grace"] .top .brand span { color: #f7ead9 !important; } html[data-theme="grace"] .top .brand::before { background: #f7ead9 !important; }
html[data-theme="grace"] .top .btn { background: color-mix(in srgb, #f7ead9 12%, transparent) !important; border-color: color-mix(in srgb, #f7ead9 32%, transparent) !important; color: #f7ead9 !important; }
html[data-theme="grace"] .top .btn.primary { background: #f7ead9 !important; color: #1e404f !important; border-color: transparent !important; }
html[data-theme="grace"] .top .icon-btn { color: #f7ead9 !important; }
html[data-theme="grace"] select.btn, html[data-theme="grace"] .tools select, html[data-theme="grace"] .settings select, html[data-theme="grace"] .reader-tools select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2334685c' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
html[data-theme="grace"] .req .sq { color: #fff !important; }
html[data-theme="grace"] .b-tags .rel .tagl { color: #a81b29; }
html[data-theme="grace"] body, html[data-theme="grace"] body::before { background-size: 220px auto !important; }
:root[data-theme="duskydarkpurple"] {
  color-scheme: dark;
  --bg: #262029; --panel: #302433; --panel-2: #3C293C; --ink: #DAADB4; --ink-2: #DAADB4; --ink-3: #BD8A96; --line: #472E44;
  --accent: #AD396F; --accent-2: #D44E8D; --accent-ink: #1F1B21; --accent-soft: #3C293C; --chip: #3C293C;
  --c-char-bg: #7F416E; --c-char: #F7CFD2; --c-tag-bg: #A94C8D35; --c-tag: #BD8A96; --c-rel-bg: #694CB8; --c-rel: #F7CFD2;
  --c-fan-bg: #9B37A4; --c-fan: #F7CFD2; --c-warn-bg: #AD396F; --c-warn: #F7CFD2;
  --blob1: transparent; --blob2: transparent; --blob3: transparent;
  --r-paper: #F7F6F5; --r-paper-ink: #6C2D52; --r-night: #262029; --r-night-ink: #BD8A96; --hl: #7F416E;
  --grad: linear-gradient(135deg, #302433 0%, #AD396F 55%, #DAADB4 100%); --grad-2: linear-gradient(90deg, #AD396F, #D44E8D, #694CB8, #AD396F);
  --shadow: 0 1px 2px rgba(0,0,0,.6), 0 8px 24px rgba(0,0,0,.35);
  --pattern: url("img/dusky.svg");
}
html[data-theme="duskydarkpurple"] { --brand-c: #E98BB7; }
html[data-theme="duskydarkpurple"] .b-title h3, html[data-theme="duskydarkpurple"] .card h3 { color: #E98BB7 !important; }
html[data-theme="duskydarkpurple"] .top { background: #1F1B21 !important; border-bottom: 1px solid #472E44 !important; color: #DAADB4; }
html[data-theme="duskydarkpurple"] .top .brand { color: #DAADB4; } html[data-theme="duskydarkpurple"] .top .brand span { color: #E98BB7 !important; } html[data-theme="duskydarkpurple"] .top .brand::before { background: #E98BB7 !important; }
html[data-theme="duskydarkpurple"] .top .btn { background: color-mix(in srgb, #DAADB4 12%, transparent) !important; border-color: color-mix(in srgb, #DAADB4 32%, transparent) !important; color: #DAADB4 !important; }
html[data-theme="duskydarkpurple"] .top .btn.primary { background: #AD396F !important; color: #1F1B21 !important; border-color: transparent !important; }
html[data-theme="duskydarkpurple"] .top .icon-btn { color: #DAADB4 !important; }
html[data-theme="duskydarkpurple"] select.btn, html[data-theme="duskydarkpurple"] .tools select, html[data-theme="duskydarkpurple"] .settings select, html[data-theme="duskydarkpurple"] .reader-tools select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23DAADB4' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
html[data-theme="duskydarkpurple"] .req .sq { color: #262029 !important; }
html[data-theme="duskydarkpurple"] .b-tags .rel .tagl { color: #F7CFD2; }
html[data-theme="duskydarkpurple"] .dl { color: #AD396F !important; } html[data-theme="duskydarkpurple"] .toast-item { box-shadow: 0 10px 30px rgba(0,0,0,.5); }
html[data-theme="duskydarkpurple"] body, html[data-theme="duskydarkpurple"] body::before { background-size: 220px auto !important; }
html[data-theme="duskydarkpurple"] .reader[data-rt="sepia"] { --rbg: #F7E7DA; --rink: #48192F; }
html[data-theme="duskydarkpurple"] { --brand-c: #D44E8D; }
html[data-theme="duskydarkpurple"] .req .sq { color: #1F1B21 !important; }
:root[data-theme="starry"] {
  color-scheme: dark;
  --bg: #07070c; --panel: #0f0f17; --panel-2: #171722; --ink: #ecebf5; --ink-2: #b9b8cc; --ink-3: #9897ad; --line: #24243a;
  --accent: #f5d76e; --accent-2: #9fb3ff; --accent-ink: #0b0b12; --accent-soft: #2a2716; --chip: #171722;
  --c-char-bg: #1b1b2b; --c-char: #c9d3ff; --c-tag-bg: #171722; --c-tag: #b9b8cc; --c-rel-bg: #3a3214; --c-rel: #ffe08a;
  --c-fan-bg: #1d1d33; --c-fan: #c9c4ff; --c-warn-bg: #3a2a14; --c-warn: #ffcf8a;
  --blob1: transparent; --blob2: transparent; --blob3: transparent;
  --r-paper: #f6f5ee; --r-paper-ink: #121218; --r-night: #07070c; --r-night-ink: #e6e5f0; --hl: #f5d76e;
  --grad: linear-gradient(135deg, #2a2a48 0%, #4a4a7a 60%, #8a7a3a 100%); --grad-2: linear-gradient(90deg, #9fb3ff, #f5d76e, #9fb3ff);
  --shadow: 0 1px 2px rgba(0,0,0,.6), 0 8px 24px rgba(0,0,0,.35);
  --pattern: url("img/starry.svg");
}
html[data-theme="starry"] { --brand-c: #ffe08a; }
html[data-theme="starry"] .b-title h3, html[data-theme="starry"] .card h3 { color: #ffe08a !important; }
html[data-theme="starry"] .top { background: #050509 !important; border-bottom: 1px solid #24243a !important; color: #ecebf5; }
html[data-theme="starry"] .top .brand { color: #ecebf5; } html[data-theme="starry"] .top .brand span { color: #ffe08a !important; } html[data-theme="starry"] .top .brand::before { background: #ffe08a !important; }
html[data-theme="starry"] .top .btn { background: color-mix(in srgb, #ecebf5 12%, transparent) !important; border-color: color-mix(in srgb, #ecebf5 32%, transparent) !important; color: #ecebf5 !important; }
html[data-theme="starry"] .top .btn.primary { background: #f5d76e !important; color: #0b0b12 !important; border-color: transparent !important; }
html[data-theme="starry"] .top .icon-btn { color: #ecebf5 !important; }
html[data-theme="starry"] select.btn, html[data-theme="starry"] .tools select, html[data-theme="starry"] .settings select, html[data-theme="starry"] .reader-tools select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23b9b8cc' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
html[data-theme="starry"] .req .sq { color: #07070c !important; }
html[data-theme="starry"] .b-tags .rel .tagl { color: #ffe08a; }
html[data-theme="starry"] .dl { color: #f5d76e !important; } html[data-theme="starry"] .toast-item { box-shadow: 0 10px 30px rgba(0,0,0,.5); }
html[data-theme="starry"] body, html[data-theme="starry"] body::before { background-size: 320px auto !important; }
:root[data-theme="auroragreen"] {
  color-scheme: dark;
  --bg: #04121a; --panel: #081d28; --panel-2: #0d2733; --ink: #e6fbf6; --ink-2: #9fd6cc; --ink-3: #7fb5ad; --line: #15384a;
  --accent: #3ff2b4; --accent-2: #8b7bff; --accent-ink: #04121a; --accent-soft: #0f3a3a; --chip: #0d2733;
  --c-char-bg: #0f3a3a; --c-char: #7ff5d0; --c-tag-bg: #0d2733; --c-tag: #a9d8d0; --c-rel-bg: #26204a; --c-rel: #c3b6ff;
  --c-fan-bg: #0e2e3e; --c-fan: #8fe6ff; --c-warn-bg: #3b2f14; --c-warn: #ffd58a;
  --blob1: transparent; --blob2: transparent; --blob3: transparent;
  --r-paper: #f3fbf9; --r-paper-ink: #0a2530; --r-night: #04121a; --r-night-ink: #dff5f0; --hl: #3ff2b4;
  --grad: linear-gradient(135deg, #0f6b5a 0%, #2a8a8a 55%, #5a4fb8 100%); --grad-2: linear-gradient(90deg, #3ff2b4, #8fe6ff, #8b7bff, #3ff2b4);
  --shadow: 0 1px 2px rgba(0,0,0,.6), 0 8px 24px rgba(0,0,0,.35);
  --pattern: linear-gradient(rgba(3,6,14,.30), rgba(3,6,14,.50)), url("img/photo-aurora-green-wide.webp");
}
html[data-theme="auroragreen"] { --brand-c: #7ff5d0; }
html[data-theme="auroragreen"] .b-title h3, html[data-theme="auroragreen"] .card h3 { color: #7ff5d0 !important; }
html[data-theme="auroragreen"] .top { background: #031018 !important; border-bottom: 1px solid #15384a !important; color: #e6fbf6; }
html[data-theme="auroragreen"] .top .brand { color: #e6fbf6; } html[data-theme="auroragreen"] .top .brand span { color: #7ff5d0 !important; } html[data-theme="auroragreen"] .top .brand::before { background: #7ff5d0 !important; }
html[data-theme="auroragreen"] .top .btn { background: color-mix(in srgb, #e6fbf6 12%, transparent) !important; border-color: color-mix(in srgb, #e6fbf6 32%, transparent) !important; color: #e6fbf6 !important; }
html[data-theme="auroragreen"] .top .btn.primary { background: #3ff2b4 !important; color: #04121a !important; border-color: transparent !important; }
html[data-theme="auroragreen"] .top .icon-btn { color: #e6fbf6 !important; }
html[data-theme="auroragreen"] select.btn, html[data-theme="auroragreen"] .tools select, html[data-theme="auroragreen"] .settings select, html[data-theme="auroragreen"] .reader-tools select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%239fd6cc' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
html[data-theme="auroragreen"] .req .sq { color: #04121a !important; }
html[data-theme="auroragreen"] .b-tags .rel .tagl { color: #c3b6ff; }
html[data-theme="auroragreen"] .dl { color: #3ff2b4 !important; } html[data-theme="auroragreen"] .toast-item { box-shadow: 0 10px 30px rgba(0,0,0,.5); }
html[data-theme="auroragreen"] body { background-image: none !important; }
html[data-theme="auroragreen"] body::before { opacity: 1 !important; background-size: cover !important; background-position: center bottom !important; background-repeat: no-repeat !important; }
:root[data-theme="aurorarosa"] {
  color-scheme: dark;
  --bg: #14040d; --panel: #1f0915; --panel-2: #2a0f1e; --ink: #ffeaf2; --ink-2: #f2a9c4; --ink-3: #d48aa6; --line: #3d1428;
  --accent: #ff4f8b; --accent-2: #ffb86b; --accent-ink: #14040d; --accent-soft: #3d1428; --chip: #2a0f1e;
  --c-char-bg: #3a1024; --c-char: #ffb3cf; --c-tag-bg: #2a0f1e; --c-tag: #f0bfd2; --c-rel-bg: #4a1030; --c-rel: #ff8fb7;
  --c-fan-bg: #3a1a10; --c-fan: #ffc48a; --c-warn-bg: #3a2a10; --c-warn: #ffd58a;
  --blob1: transparent; --blob2: transparent; --blob3: transparent;
  --r-paper: #fff6f9; --r-paper-ink: #2a0f1e; --r-night: #14040d; --r-night-ink: #fde6ee; --hl: #ff4f8b;
  --grad: linear-gradient(135deg, #8a1040 0%, #b8154f 55%, #c2185b 100%); --grad-2: linear-gradient(90deg, #ff4f8b, #ffb86b, #ff4f8b);
  --shadow: 0 1px 2px rgba(0,0,0,.6), 0 8px 24px rgba(0,0,0,.35);
  --pattern: linear-gradient(rgba(3,6,14,.30), rgba(3,6,14,.50)), url("img/photo-aurora-rosa-wide.webp");
}
html[data-theme="aurorarosa"] { --brand-c: #ff8fb7; }
html[data-theme="aurorarosa"] .b-title h3, html[data-theme="aurorarosa"] .card h3 { color: #ff8fb7 !important; }
html[data-theme="aurorarosa"] .top { background: #0f030a !important; border-bottom: 1px solid #3d1428 !important; color: #ffeaf2; }
html[data-theme="aurorarosa"] .top .brand { color: #ffeaf2; } html[data-theme="aurorarosa"] .top .brand span { color: #ff8fb7 !important; } html[data-theme="aurorarosa"] .top .brand::before { background: #ff8fb7 !important; }
html[data-theme="aurorarosa"] .top .btn { background: color-mix(in srgb, #ffeaf2 12%, transparent) !important; border-color: color-mix(in srgb, #ffeaf2 32%, transparent) !important; color: #ffeaf2 !important; }
html[data-theme="aurorarosa"] .top .btn.primary { background: #ff4f8b !important; color: #14040d !important; border-color: transparent !important; }
html[data-theme="aurorarosa"] .top .icon-btn { color: #ffeaf2 !important; }
html[data-theme="aurorarosa"] select.btn, html[data-theme="aurorarosa"] .tools select, html[data-theme="aurorarosa"] .settings select, html[data-theme="aurorarosa"] .reader-tools select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23f2a9c4' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
html[data-theme="aurorarosa"] .req .sq { color: #14040d !important; }
html[data-theme="aurorarosa"] .b-tags .rel .tagl { color: #ff8fb7; }
html[data-theme="aurorarosa"] .dl { color: #ff4f8b !important; } html[data-theme="aurorarosa"] .toast-item { box-shadow: 0 10px 30px rgba(0,0,0,.5); }
html[data-theme="aurorarosa"] body { background-image: none !important; }
html[data-theme="aurorarosa"] body::before { opacity: 1 !important; background-size: cover !important; background-position: center bottom !important; background-repeat: no-repeat !important; }
:root[data-theme="auroraviolet"] {
  color-scheme: dark;
  --bg: #0b0c26; --panel: #12143a; --panel-2: #1a1d4a; --ink: #eeeeff; --ink-2: #b8bcf0; --ink-3: #9aa0d8; --line: #262a5e;
  --accent: #8fa2ff; --accent-2: #c9a8ff; --accent-ink: #0b0c26; --accent-soft: #23275a; --chip: #1a1d4a;
  --c-char-bg: #1f2560; --c-char: #b8c6ff; --c-tag-bg: #1a1d4a; --c-tag: #c3c6f2; --c-rel-bg: #33235e; --c-rel: #d9c2ff;
  --c-fan-bg: #1d2a5a; --c-fan: #a9d4ff; --c-warn-bg: #3a3014; --c-warn: #ffd58a;
  --blob1: transparent; --blob2: transparent; --blob3: transparent;
  --r-paper: #f6f6ff; --r-paper-ink: #12143a; --r-night: #0b0c26; --r-night-ink: #e6e8ff; --hl: #8fa2ff;
  --grad: linear-gradient(135deg, #2a3a9a 0%, #4a4fc0 55%, #6a4ab8 100%); --grad-2: linear-gradient(90deg, #8fa2ff, #c9a8ff, #8fa2ff);
  --shadow: 0 1px 2px rgba(0,0,0,.6), 0 8px 24px rgba(0,0,0,.35);
  --pattern: linear-gradient(rgba(3,6,14,.30), rgba(3,6,14,.50)), url("img/photo-aurora-violet-wide.webp");
}
html[data-theme="auroraviolet"] { --brand-c: #c9d2ff; }
html[data-theme="auroraviolet"] .b-title h3, html[data-theme="auroraviolet"] .card h3 { color: #c9d2ff !important; }
html[data-theme="auroraviolet"] .top { background: #08091d !important; border-bottom: 1px solid #262a5e !important; color: #eeeeff; }
html[data-theme="auroraviolet"] .top .brand { color: #eeeeff; } html[data-theme="auroraviolet"] .top .brand span { color: #c9d2ff !important; } html[data-theme="auroraviolet"] .top .brand::before { background: #c9d2ff !important; }
html[data-theme="auroraviolet"] .top .btn { background: color-mix(in srgb, #eeeeff 12%, transparent) !important; border-color: color-mix(in srgb, #eeeeff 32%, transparent) !important; color: #eeeeff !important; }
html[data-theme="auroraviolet"] .top .btn.primary { background: #8fa2ff !important; color: #0b0c26 !important; border-color: transparent !important; }
html[data-theme="auroraviolet"] .top .icon-btn { color: #eeeeff !important; }
html[data-theme="auroraviolet"] select.btn, html[data-theme="auroraviolet"] .tools select, html[data-theme="auroraviolet"] .settings select, html[data-theme="auroraviolet"] .reader-tools select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23b8bcf0' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
html[data-theme="auroraviolet"] .req .sq { color: #0b0c26 !important; }
html[data-theme="auroraviolet"] .b-tags .rel .tagl { color: #d9c2ff; }
html[data-theme="auroraviolet"] .dl { color: #8fa2ff !important; } html[data-theme="auroraviolet"] .toast-item { box-shadow: 0 10px 30px rgba(0,0,0,.5); }
html[data-theme="auroraviolet"] body { background-image: none !important; }
html[data-theme="auroraviolet"] body::before { opacity: 1 !important; background-size: cover !important; background-position: center bottom !important; background-repeat: no-repeat !important; }
:root[data-theme="synthwave"] {
  color-scheme: dark;
  --bg: #0b0f2b; --panel: #14123a; --panel-2: #1d1a4a; --ink: #fff0fb; --ink-2: #d6b8ff; --ink-3: #b49ad8; --line: #2e2763;
  --accent: #ff5ca8; --accent-2: #00f0ff; --accent-ink: #0b0f2b; --accent-soft: #3a1640; --chip: #1d1a4a;
  --c-char-bg: #0a2e44; --c-char: #7ff6ff; --c-tag-bg: #1d1a4a; --c-tag: #d6c8ff; --c-rel-bg: #4a1440; --c-rel: #ff8cc4;
  --c-fan-bg: #3a2a14; --c-fan: #ffb86b; --c-warn-bg: #3a2a14; --c-warn: #ffb86b;
  --blob1: transparent; --blob2: transparent; --blob3: transparent;
  --r-paper: #fff7fc; --r-paper-ink: #1d1a4a; --r-night: #0b0f2b; --r-night-ink: #f3e6ff; --hl: #bc6cff;
  --grad: linear-gradient(135deg, #7a1f9a 0%, #b0186e 55%, #c2185b 100%); --grad-2: linear-gradient(90deg, #ff5ca8, #bc6cff, #00f0ff, #ffb86b);
  --shadow: 0 1px 2px rgba(0,0,0,.6), 0 8px 24px rgba(0,0,0,.35);
  --pattern: linear-gradient(rgba(5,4,18,.28), rgba(5,4,18,.48)), url("img/photo-synthwave-wide.webp");
}
html[data-theme="synthwave"] { --brand-c: #ff8cc4; }
html[data-theme="synthwave"] .b-title h3, html[data-theme="synthwave"] .card h3 { color: #ff8cc4 !important; }
html[data-theme="synthwave"] .top { background: #070a20 !important; border-bottom: 1px solid #2e2763 !important; color: #fff0fb; }
html[data-theme="synthwave"] .top .brand { color: #fff0fb; } html[data-theme="synthwave"] .top .brand span { color: #ff8cc4 !important; } html[data-theme="synthwave"] .top .brand::before { background: #ff8cc4 !important; }
html[data-theme="synthwave"] .top .btn { background: color-mix(in srgb, #fff0fb 12%, transparent) !important; border-color: color-mix(in srgb, #fff0fb 32%, transparent) !important; color: #fff0fb !important; }
html[data-theme="synthwave"] .top .btn.primary { background: #ff5ca8 !important; color: #0b0f2b !important; border-color: transparent !important; }
html[data-theme="synthwave"] .top .icon-btn { color: #fff0fb !important; }
html[data-theme="synthwave"] select.btn, html[data-theme="synthwave"] .tools select, html[data-theme="synthwave"] .settings select, html[data-theme="synthwave"] .reader-tools select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23d6b8ff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
html[data-theme="synthwave"] .req .sq { color: #0b0f2b !important; }
html[data-theme="synthwave"] .b-tags .rel .tagl { color: #ff8cc4; }
html[data-theme="synthwave"] .dl { color: #ff5ca8 !important; } html[data-theme="synthwave"] .toast-item { box-shadow: 0 10px 30px rgba(0,0,0,.5); }
html[data-theme="synthwave"] body { background-image: none !important; }
html[data-theme="synthwave"] body::before { opacity: 1 !important; background-size: cover !important; background-position: center bottom !important; background-repeat: no-repeat !important; }
:root[data-theme="neoncity"] {
  color-scheme: dark;
  --bg: #120a2e; --panel: #1a1140; --panel-2: #23185a; --ink: #f5eeff; --ink-2: #c6b8f0; --ink-3: #a596d6; --line: #33247a;
  --accent: #3bb8f8; --accent-2: #f787f8; --accent-ink: #0b0720; --accent-soft: #2a1d66; --chip: #23185a;
  --c-char-bg: #13306a; --c-char: #8fd8ff; --c-tag-bg: #23185a; --c-tag: #cfc2f5; --c-rel-bg: #4a1a6a; --c-rel: #f7a6f8;
  --c-fan-bg: #2a1a66; --c-fan: #b9a8ff; --c-warn-bg: #3a2a14; --c-warn: #ffcf8a;
  --blob1: transparent; --blob2: transparent; --blob3: transparent;
  --r-paper: #faf7ff; --r-paper-ink: #23185a; --r-night: #120a2e; --r-night-ink: #eee6ff; --hl: #b42eca;
  --grad: linear-gradient(135deg, #3c54b8 0%, #6f1594 55%, #8a1fa0 100%); --grad-2: linear-gradient(90deg, #3bb8f8, #b42eca, #f787f8);
  --shadow: 0 1px 2px rgba(0,0,0,.6), 0 8px 24px rgba(0,0,0,.35);
  --pattern: linear-gradient(rgba(5,4,18,.28), rgba(5,4,18,.48)), url("img/photo-neoncity-wide.webp");
}
html[data-theme="neoncity"] { --brand-c: #f7a6f8; }
html[data-theme="neoncity"] .b-title h3, html[data-theme="neoncity"] .card h3 { color: #f7a6f8 !important; }
html[data-theme="neoncity"] .top { background: #0b0720 !important; border-bottom: 1px solid #33247a !important; color: #f5eeff; }
html[data-theme="neoncity"] .top .brand { color: #f5eeff; } html[data-theme="neoncity"] .top .brand span { color: #f7a6f8 !important; } html[data-theme="neoncity"] .top .brand::before { background: #f7a6f8 !important; }
html[data-theme="neoncity"] .top .btn { background: color-mix(in srgb, #f5eeff 12%, transparent) !important; border-color: color-mix(in srgb, #f5eeff 32%, transparent) !important; color: #f5eeff !important; }
html[data-theme="neoncity"] .top .btn.primary { background: #3bb8f8 !important; color: #0b0720 !important; border-color: transparent !important; }
html[data-theme="neoncity"] .top .icon-btn { color: #f5eeff !important; }
html[data-theme="neoncity"] select.btn, html[data-theme="neoncity"] .tools select, html[data-theme="neoncity"] .settings select, html[data-theme="neoncity"] .reader-tools select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23c6b8f0' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
html[data-theme="neoncity"] .req .sq { color: #120a2e !important; }
html[data-theme="neoncity"] .b-tags .rel .tagl { color: #f7a6f8; }
html[data-theme="neoncity"] .dl { color: #3bb8f8 !important; } html[data-theme="neoncity"] .toast-item { box-shadow: 0 10px 30px rgba(0,0,0,.5); }
html[data-theme="neoncity"] body { background-image: none !important; }
html[data-theme="neoncity"] body::before { opacity: 1 !important; background-size: cover !important; background-position: center bottom !important; background-repeat: no-repeat !important; }
:root[data-theme="acidrain"] {
  color-scheme: dark;
  --bg: #021826; --panel: #062433; --panel-2: #0a3040; --ink: #eafff2; --ink-2: #9fe8c0; --ink-3: #7fc9a3; --line: #0f4050;
  --accent: #06f284; --accent-2: #eaf405; --accent-ink: #021826; --accent-soft: #0a3a33; --chip: #0a3040;
  --c-char-bg: #0a3a3a; --c-char: #9bff6c; --c-tag-bg: #0a3040; --c-tag: #b8f0d0; --c-rel-bg: #3a1a40; --c-rel: #e8a6f2;
  --c-fan-bg: #1a3a10; --c-fan: #eaf405; --c-warn-bg: #3a3a10; --c-warn: #eaf405;
  --blob1: transparent; --blob2: transparent; --blob3: transparent;
  --r-paper: #f4fff8; --r-paper-ink: #062433; --r-night: #021826; --r-night-ink: #e2fff0; --hl: #06f284;
  --grad: linear-gradient(135deg, #01595a 0%, #0a6b4a 55%, #5c1966 100%); --grad-2: linear-gradient(90deg, #06f284, #9bff6c, #eaf405, #62c0f6);
  --shadow: 0 1px 2px rgba(0,0,0,.6), 0 8px 24px rgba(0,0,0,.35);
  --pattern: url("img/acidrain.svg");
}
html[data-theme="acidrain"] { --brand-c: #9bff6c; }
html[data-theme="acidrain"] .b-title h3, html[data-theme="acidrain"] .card h3 { color: #9bff6c !important; }
html[data-theme="acidrain"] .top { background: #01121c !important; border-bottom: 1px solid #0f4050 !important; color: #eafff2; }
html[data-theme="acidrain"] .top .brand { color: #eafff2; } html[data-theme="acidrain"] .top .brand span { color: #9bff6c !important; } html[data-theme="acidrain"] .top .brand::before { background: #9bff6c !important; }
html[data-theme="acidrain"] .top .btn { background: color-mix(in srgb, #eafff2 12%, transparent) !important; border-color: color-mix(in srgb, #eafff2 32%, transparent) !important; color: #eafff2 !important; }
html[data-theme="acidrain"] .top .btn.primary { background: #06f284 !important; color: #021826 !important; border-color: transparent !important; }
html[data-theme="acidrain"] .top .icon-btn { color: #eafff2 !important; }
html[data-theme="acidrain"] select.btn, html[data-theme="acidrain"] .tools select, html[data-theme="acidrain"] .settings select, html[data-theme="acidrain"] .reader-tools select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%239fe8c0' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
html[data-theme="acidrain"] .req .sq { color: #021826 !important; }
html[data-theme="acidrain"] .b-tags .rel .tagl { color: #e8a6f2; }
html[data-theme="acidrain"] .dl { color: #06f284 !important; } html[data-theme="acidrain"] .toast-item { box-shadow: 0 10px 30px rgba(0,0,0,.5); }
html[data-theme="acidrain"] body, html[data-theme="acidrain"] body::before { background-size: 240px auto !important; }
html[data-theme="archive"] { --ui: "Lucida Grande", "Lucida Sans Unicode", Verdana, Helvetica, sans-serif; --serif: Georgia, "Times New Roman", serif; }
html[data-theme="archive"][data-ui-font="easy"] { --ui: "Atkinson Hyperlegible", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif; }
html[data-theme="archive"] .card, html[data-theme="archive"] .blurb { border-radius: 4px; box-shadow: 1px 1px 3px rgba(0,0,0,.12); }
html[data-theme="archive"] .top { border-bottom: 3px solid #5e0000 !important; }
/* Cyberpunk and Aurora cards: a soft glow on the edge */
html[data-theme="auroragreen"] .card, html[data-theme="auroragreen"] .blurb { box-shadow: 0 0 0 1px #15384a, 0 8px 30px color-mix(in srgb, #3ff2b4 12%, transparent); }
html[data-theme="aurorarosa"] .card, html[data-theme="aurorarosa"] .blurb { box-shadow: 0 0 0 1px #3d1428, 0 8px 30px color-mix(in srgb, #ff4f8b 12%, transparent); }
html[data-theme="auroraviolet"] .card, html[data-theme="auroraviolet"] .blurb { box-shadow: 0 0 0 1px #262a5e, 0 8px 30px color-mix(in srgb, #8fa2ff 12%, transparent); }
html[data-theme="synthwave"] .card, html[data-theme="synthwave"] .blurb { box-shadow: 0 0 0 1px #2e2763, 0 8px 30px color-mix(in srgb, #ff5ca8 12%, transparent); }
html[data-theme="neoncity"] .card, html[data-theme="neoncity"] .blurb { box-shadow: 0 0 0 1px #33247a, 0 8px 30px color-mix(in srgb, #3bb8f8 12%, transparent); }
html[data-theme="acidrain"] .card, html[data-theme="acidrain"] .blurb { box-shadow: 0 0 0 1px #0f4050, 0 8px 30px color-mix(in srgb, #06f284 12%, transparent); }
/* the picker's tabs scroll sideways when there are more than fit */
.tp-tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; } .tp-tabs::-webkit-scrollbar { display: none; } .tp-tab { flex: none; white-space: nowrap; }


/* the big Aurora and Cyberpunk pictures: one whole picture behind pop-up headers too, never a small repeating tile */
html[data-theme="auroragreen"] .wn-hero, html[data-theme="aurorarosa"] .wn-hero, html[data-theme="auroraviolet"] .wn-hero, html[data-theme="synthwave"] .wn-hero, html[data-theme="neoncity"] .wn-hero { background-size: cover !important; background-position: center 30% !important; background-repeat: no-repeat !important; }

/* Phones and tablets: the closed Filters sheet is truly hidden, not just pushed below the screen. If a phone ever lays the
   page out shorter than the screen (zoomed out, toolbar quirks), the closed sheet can't peek out and cover the fics. */
@media (max-width: 860px) {
  .sidebar:not(.open) { visibility: hidden; transition: transform .25s ease, box-shadow .25s, visibility 0s linear .25s !important; }
  .sidebar.open { visibility: visible; transition: transform .25s ease, box-shadow .25s, visibility 0s !important; }
}
/* the reader keeps wide things (long links, tables, pictures) inside the screen, so the page never needs zooming out */
html.reader-page .book, html.reader-page .book * { max-width: 100%; overflow-wrap: anywhere; }
html.reader-page .book table { display: block; overflow-x: auto; }
/* bottom pop-ups on phones: scrolling inside them never scrolls the page behind */
@media (max-width: 860px) { .sb-body, .theme-pop, .modal-card, .dlg-wrap > .dlg { overscroll-behavior: contain; } }

/* ================= Q&A page ================= */
.qa .qa-meta { margin: -4px 0 4px; font-size: 13.5px; color: var(--ink-2); }
.qa section { padding: 12px 16px; }
.qa section h2 { margin-bottom: 4px; }
.qa-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.qa-item:first-of-type { border-top: 0; }
.qa-item > div { flex: 1; min-width: 0; }
.qa-item h3 { margin: 0 0 2px; font: 600 15.5px/1.3 var(--ui); color: var(--ink); }
.qa-item p { margin: 0; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.qa-plus { flex: none; display: grid; justify-items: center; gap: 0; min-width: 52px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink-2); cursor: pointer; font: 600 12px var(--ui); }
.qa-plus b { font-size: 13px; color: var(--accent); }
.qa-plus .qa-n { font-size: 15px; color: var(--ink); }
.qa-plus:hover { border-color: var(--accent); }
.qa-plus.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.qa-plus.on b, .qa-plus.on .qa-n { color: var(--accent-ink); }
.qa-asked { flex: none; font: 600 12px var(--ui); color: var(--ink-3); white-space: nowrap; padding-top: 2px; }
.qa-done h3::before { content: "✓ "; color: var(--accent); }
/* done (and answered) items: the same pill as +1, with a ✓ and how many asked; not a button, so no hover or tap */
.qa-plus.qa-got { cursor: default; border-style: dashed; background: transparent; }
.qa-plus.qa-got:hover { border-color: var(--line); }
.qa-plus.qa-got small { font: 600 10px var(--ui); color: var(--ink-3); line-height: 1.1; }

/* Aurora themes: real photos (Unsplash License; credits on the about page). Upright photo on upright screens, wide one on wide screens,
   a light dark wash on top so the page stays calm behind the cards */
@media (orientation: portrait) { html:root[data-theme="auroragreen"] { --pattern: linear-gradient(rgba(3,6,14,.30), rgba(3,6,14,.50)), url("img/photo-aurora-green-phone.webp"); } }
html[data-theme="auroragreen"] body::before { background-position: center center !important; }
@media (orientation: portrait) { html:root[data-theme="aurorarosa"] { --pattern: linear-gradient(rgba(3,6,14,.30), rgba(3,6,14,.50)), url("img/photo-aurora-rosa-phone.webp"); } }
html[data-theme="aurorarosa"] body::before { background-position: center center !important; }
@media (orientation: portrait) { html:root[data-theme="auroraviolet"] { --pattern: linear-gradient(rgba(3,6,14,.30), rgba(3,6,14,.50)), url("img/photo-aurora-violet-phone.webp"); } }
html[data-theme="auroraviolet"] body::before { background-position: center center !important; }

/* Synthwave and Neon City: real photos (Unsplash License; credits on the about page) */
@media (orientation: portrait) { html:root[data-theme="synthwave"] { --pattern: linear-gradient(rgba(5,4,18,.28), rgba(5,4,18,.48)), url("img/photo-synthwave-phone.webp"); } }
html[data-theme="synthwave"] body::before { background-position: center center !important; }
@media (orientation: portrait) { html:root[data-theme="neoncity"] { --pattern: linear-gradient(rgba(5,4,18,.28), rgba(5,4,18,.48)), url("img/photo-neoncity-phone.webp"); } }
html[data-theme="neoncity"] body::before { background-position: center center !important; }

/* Feedback window: the two small extras as tidy tiles */
.fb-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.fb-tile { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); color: var(--ink); text-decoration: none; transition: border-color .15s, transform .15s; }
.fb-tile:hover, .fb-tile:focus-visible { border-color: var(--accent); transform: translateY(-1px); }
.fb-tile > span:last-child { min-width: 0; }
.fb-ic { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent); }
.fb-tile b { display: block; font: 600 13.5px/1.25 var(--ui); color: var(--ink); }
.fb-tile small { display: block; margin-top: 1px; font: 500 12px/1.3 var(--ui); color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 480px) { .fb-mini { grid-template-columns: 1fr; } }
/* the Q&A and privacy pages sit above the theme's background picture (the photo themes cover the whole screen) */
.about { position: relative; z-index: 1; }
/* the Q&A page is a list to scan, not text to read: wider on computers (still with space on both sides) */
.about.qa { max-width: 1100px; padding-left: 32px; padding-right: 32px; }
@media (max-width: 640px) { .about.qa { padding-left: 16px; padding-right: 16px; } }

/* Q&A search */
.qa-search { display: flex; align-items: center; gap: 8px; margin: 14px 0 4px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink-3); }
.qa-search:focus-within { border-color: var(--accent); color: var(--accent); }
.qa-search input { flex: 1; min-width: 0; padding: 11px 0; border: 0; outline: 0; background: none; color: var(--ink); font: 500 15px var(--ui); }
.qa-none { margin: 16px 2px; color: var(--ink-2); font-size: 14.5px; }
.qa-item[hidden], .qa section[hidden] { display: none; }
.wn-qa .kp-lead { margin: 10px 4px 0; text-align: center; color: var(--ink-2); line-height: 1.55; } .wn-qa .wn-btns a.btn { text-decoration: none; }

/* phones: every tag on a fic card is shown in full in Card view too, no three-line cut */
@media (max-width: 640px) {
  html .cards .chips.three-lines { max-height: none; overflow: visible; }
}

.f-rows { display: contents; }
/* reload: contents wait for the saved theme and fonts (boot.js), the themed background shows meanwhile */
html.booting body > * { visibility: hidden !important; }
/* reader progress bar: moved with transform (no layout on each scroll frame) */
.reader-progress > div { width: 100% !important; transform: scaleX(0); transform-origin: left center; will-change: transform; }
/* while a sheet or pop-up is open the page behind never bounces or pulls to refresh */
html:has(body.locked), html:has(body > .dlg-wrap), html:has(#sidebar.open) { overscroll-behavior: none; }
/* ← Back: returns to your previous filters and spot in the list */
.fchip.back-chip { background: var(--accent) !important; color: var(--accent-ink) !important; border: 0; padding: 3px 10px; font: 600 12px var(--ui); cursor: pointer; }
/* ---- Shelves screen views: Bookshelf / Small / List ---- */
.shp-head .shp-views { margin-left: auto; }
.shp-views { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.shp-views button { border: 0; background: none; border-radius: 7px; padding: 0 10px; min-height: 34px; font: 500 13px var(--ui); color: var(--ink-2); cursor: pointer; }
.shp-views button.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
@media (max-width: 640px) {
  .shp-head { flex-wrap: wrap; }
  .shp-head .shp-views { order: 3; margin-left: 0; width: 100%; }
  .shp-views button { flex: 1; min-height: 38px; }
}
/* Small: a third of the height, three to a row on phones */
.shp-grid.shp-small { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
@media (max-width: 640px) { .shp-grid.shp-small { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; } }
.shp-small .shp-box { min-height: 88px; padding: 10px 10px 8px; border-radius: 12px; }
.shp-small .shp-name { font-size: 14px; padding-right: 22px; }
.shp-small .shp-n { font-size: 11.5px; margin-bottom: 22px; }
.shp-small .shp-ledge { left: 8px; right: 8px; bottom: 7px; height: 18px; border-bottom-width: 2px; gap: 1px; overflow: hidden; }
.shp-small .shp-ledge i { height: 10px !important; width: 4px !important; }
.shp-small .shp-ledge i:nth-child(3n+1) { height: 14px !important; } .shp-small .shp-ledge i:nth-child(3n+2) { height: 16px !important; }
.shp-small .shp-more { top: 4px; right: 4px; width: 26px; height: 26px; }
.shp-small .shp-add .shp-n { margin-bottom: 0; }
/* List: one row per shelf; nested shelves open under their shelf at the same indent, path shown above the name */
.shl-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); overflow: hidden; position: relative; z-index: 1; }
.shl-row { display: flex; align-items: stretch; min-height: 56px; border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.shl-row:first-child { border-top: 0; }
.shl-row.shl-in { background: color-mix(in srgb, var(--accent) 6%, var(--panel)); box-shadow: inset 3px 0 0 color-mix(in srgb, var(--accent) 45%, transparent); }
.shl-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 14px; border: 0; background: none; color: var(--ink); text-align: left; cursor: pointer; font: inherit; }
.shl-main:hover .shl-txt b { color: var(--accent); }
.shl-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.shl-txt b { font: 600 16px/1.25 var(--serif); overflow-wrap: anywhere; }
.shl-path { font: 500 11.5px/1.3 var(--ui); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shl-n { font: 500 13px var(--ui); color: var(--ink-2); }
.shl-ic { flex: none; display: flex; align-items: flex-end; gap: 2px; width: 22px; height: 22px; border-bottom: 2px solid color-mix(in srgb, #8a5a3c 70%, var(--panel)); filter: hue-rotate(var(--h, 0deg)); }
.shl-ic i { width: 5px; border-radius: 1px 1px 0 0; background: color-mix(in srgb, var(--accent) 75%, #fff); }
.shl-ic i:nth-child(1) { height: 14px; } .shl-ic i:nth-child(2) { height: 20px; opacity: .8; } .shl-ic i:nth-child(3) { height: 11px; opacity: .6; }
.shl-tw, .shl-tw-sp { flex: none; width: 56px; }
.shl-tw { display: flex; align-items: center; justify-content: center; gap: 3px; border: 0; border-left: 1px solid color-mix(in srgb, var(--line) 70%, transparent); background: none; color: var(--accent); font: 600 12.5px var(--ui); cursor: pointer; }
.shl-tw svg { transition: transform .15s; }
.shl-tw[aria-expanded="true"] { background: var(--accent-soft); }
.shl-tw[aria-expanded="true"] svg { transform: rotate(180deg); }
.shl-more, .shl-more-sp { flex: none; width: 44px; }
.shl-more { align-self: center; height: 44px; color: var(--ink-2); }
.shl-new { display: inline-block; margin: 12px 4px 0; position: relative; z-index: 1; }
/* List: what's inside a shelf is one group with one fixed indent and one line down its left, not a box per level */
.shl-row.shl-in { background: none; box-shadow: none; min-height: 50px; border-top: 0; }
.shl-group { position: relative; border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); padding: 2px 0 6px; }
.shl-group::before { content: ""; position: absolute; left: 24px; top: 0; bottom: 10px; width: 2px; border-radius: 2px; background: color-mix(in srgb, var(--accent) 35%, transparent); }
.shl-group .shl-main { padding-left: 44px; }
.shl-group .shl-row + .shl-row .shl-main { box-shadow: inset 0 1px 0 color-mix(in srgb, var(--line) 55%, transparent); }
.shl-group .shl-txt b { font-size: 15px; }
.shl-group .shl-ic { transform: scale(.85); transform-origin: left bottom; }
.shl-tw[aria-expanded="true"] { background: none; }
.shl-in .shl-tw { border-left-color: transparent; }
/* shelf pickers: the shelves a shelf sits inside, shown small above its name (every level, no indents) */
html .pop-menu .pm-item .pm-path { display: block; font: 500 11px/1.3 var(--ui); color: var(--ink-3); margin-bottom: 1px; white-space: normal; }
/* ---- Aa › Scroll: tap to scroll and auto-scroll ---- */
#aaPop .aa-scroll { display: flex; flex-direction: column; gap: 8px; }
#aaPop .aa-sub { margin: 6px 0 0; font: 600 11.5px var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
#aaPop .ts-zones button { flex: 1; }
#aaPop .ts-off { opacity: .45; pointer-events: none; }
#aaPop .as-row { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
#aaPop .as-hint { color: var(--ink-3); font-size: 12px; line-height: 1.4; }
@media (max-width: 640px) {
  html body #aaPop[data-tab="text"] [data-aatab="scroll"], html body #aaPop[data-tab="spacing"] [data-aatab="scroll"],
  html body #aaPop[data-tab="scroll"] [data-aatab="text"], html body #aaPop[data-tab="scroll"] [data-aatab="spacing"] { display: none !important; }
  html body #aaPop[data-tab="scroll"] { overflow-y: auto; }
}
/* no double-tap-to-zoom delay while tap to scroll is on (pinch zoom still works) */
.reader.tap-scroll .reader-scroll, .reader.tap-scroll .book { touch-action: manipulation; }
/* the play / pause button: bottom corner, on your tapping side, above the % read */
.as-ctl { position: fixed; z-index: 6; right: 14px; bottom: calc(40px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 6px; padding: 4px; border-radius: 999px;
  background: color-mix(in srgb, var(--rbg, var(--panel)) 88%, transparent); border: 1px solid color-mix(in srgb, var(--rink, var(--ink)) 18%, transparent); box-shadow: 0 4px 14px rgba(0,0,0,.14); }
.as-ctl[hidden] { display: none; }
.as-ctl.left { right: auto; left: 14px; }
.as-b { width: 44px; height: 44px; border: 0; border-radius: 999px; background: none; color: var(--rink, var(--ink)); font: 600 20px var(--ui); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.as-b[hidden] { display: none; }
.as-play { background: var(--accent); color: var(--accent-ink); }
.as-play .as-i-pause { display: none; } .as-ctl.on .as-play .as-i-pause { display: block; } .as-ctl.on .as-play .as-i-play { display: none; }
.reader.bar-hidden .as-ctl:not(.on) { opacity: .55; }
/* where to tap: shown for a moment when you change it */
.ts-hint { position: fixed; inset: 0; z-index: 7; pointer-events: none; transition: opacity .4s; }
.ts-hint.fade { opacity: 0; }
.ts-hint i { position: absolute; display: flex; align-items: center; justify-content: center; box-sizing: border-box; border: 2px dashed var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.ts-hint i.upz { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.ts-hint b { font: 600 14px var(--ui); color: var(--accent-ink); background: var(--accent); padding: 4px 10px; border-radius: 999px; }
/* the play button steps aside while Reading settings are open; the Start button gets the full width */
.reader:has(#aaPop:not([hidden])) .as-ctl { display: none; }
html body #aaPop .aa-row.as-row { display: flex !important; flex-direction: column !important; align-items: stretch !important; gap: 6px; }
html body #aaPop .aa-row.as-row .btn { width: 100%; min-height: 44px; justify-content: center; }
/* a small dot before the title of fics you've opened */
.seen-dot { display: inline-block; width: 7px; height: 7px; margin: 0 7px 0 1px; border-radius: 50%; background: var(--accent); vertical-align: .22em; opacity: .85; }
/* phones: the fic count sits right after the "All fics" title; Select stays on the right */
@media (max-width: 640px) {
  html body .tabs-row .scope-tabs:has(.view-title) { flex: 0 1 auto !important; }
  html body .tabs-row > .count { order: 0 !important; flex: none; align-self: flex-start; margin: 0 auto 0 10px !important; padding-top: 7px; font: 500 13px var(--ui) !important; color: var(--ink-3) !important; white-space: nowrap; }
}
/* the Filters panel no longer lists shelves: shelves are reached from the Shelves tab */
#sidebar #shelves { display: none !important; }
/* phones: the toolbar never cuts off the sort name; Filters is its icon (with the count badge) */
@media (max-width: 640px) {
  html body .toolbar .filt-btn .filt-lbl { display: none; }
  html body .toolbar .filt-btn { width: 36px; padding: 0 !important; justify-content: center; position: relative; }
  html body .toolbar .filt-btn .filt-n { position: absolute; top: -6px; right: -6px; margin: 0; }
  html body .toolbar select, html body .tools select, html body #sort { max-width: none !important; flex: none !important; text-overflow: clip; }
  html body .toolbar .tools > form, html body .toolbar .tools .search { flex: 1 1 auto; min-width: 0; }
  /* title, count and Select sit on one centre line */
  html body .tabs-row { align-items: center !important; min-height: 40px; }
  html body .tabs-row .view-title { padding: 4px 0 !important; }
  html body .tabs-row > .count { align-self: center !important; padding-top: 0 !important; line-height: 1.2; }
  html body .tabs-right { align-self: center; }
}
/* the smallest phones (iPhone SE and similar): a touch smaller so nothing touches or overlaps */
@media (max-width: 360px) {
  html body .toolbar select, html body #sort { font-size: 12.5px !important; padding-right: 26px !important; }
  html body .top .brand { font-size: 21px !important; }
  html body .top .brand::before { width: 23px !important; height: 23px !important; margin-right: 6px !important; }
}
@media (max-width: 360px) {
  /* the logo never gets squeezed under the buttons; the Add button keeps just its + so everything fits */
  html body .top .brand { flex: none !important; padding-right: 2px; }
  html body #openSources .lbl-short { display: none !important; }
  html body #openSources { padding: 0 10px !important; min-width: 36px; }
}
/* ---- Reading settings on phones: tidy rows, ticks with room, and the sheet keeps its own scrolling ---- */
@media (max-width: 640px) {
  html body #aaPop:not([hidden]) { overflow-y: auto; overscroll-behavior: contain; }
  /* Left / Justify / Center / Right: icon above its word, all inside the button */
  html body #aaPop .aa-icons button { height: auto !important; min-height: 46px; padding: 6px 2px 5px !important; display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 4px; line-height: 1; }
  html body #aaPop .aa-icons small { font-size: 10.5px; line-height: 1; white-space: nowrap; }
  html body #aaPop .aa-icons svg { flex: none; }
  /* tick boxes: padding on every side, a bigger box, lined up with the first line */
  html body #aaPop .aa-check { padding: 12px 14px !important; gap: 12px; align-items: flex-start; border-top: 0 !important; background: var(--panel-2); border-radius: 12px; margin: 4px 0 !important; }
  html body #aaPop .aa-check input { flex: none; width: 20px; height: 20px; margin: 1px 0 0 !important; }
  html body #aaPop .aa-check b { display: block; line-height: 22px; }
}
/* the Story / chapter menu: room for its arrow, so the words never run into it */
html body #chapterSel { padding-right: 28px !important; background-position: right 10px center !important; text-overflow: ellipsis; }
/* tapping fast (A+, A−, the auto-scroll + and −, anything in Reading settings) never zooms the page */
.as-ctl, .as-ctl button, #aaPop, #aaPop button, #aaPop input, .reader-bar button, .reader-bar select { touch-action: manipulation; }
@media (max-width: 640px) {
  /* Page colour: label on top, the four colours across the full width, none cut off */
  html body #aaPop .aa-row.aa-theme { grid-template-columns: 1fr !important; gap: 6px !important; }
  html body #aaPop .aa-theme .aa-swatches { display: flex; width: 100%; overflow: visible; }
  html body #aaPop .aa-theme .aa-swatches button { flex: 1 1 0; min-width: 0; justify-content: center; white-space: nowrap; }
  /* Font: every name on one line */
  html body #aaPop .aa-row[data-aatab="text"] .seg button { white-space: nowrap; font-size: 12px; padding: 0 2px; min-width: 0; }
}
@media (max-width: 640px) {
  /* chosen filters (✕ Clear all and your tags): the same space above and below, between the header and the search bar */
  html body .toolbar .active-filters { margin: -3px 0 13px !important; }
  /* filter rows: the highlight reaches past the tick box on the left and the ✕ on the right; nothing else moves */
  html body #sidebar .frow { padding: 3px 8px !important; margin: 0 -8px !important; border-radius: 10px; }
}
/* the space between the end of a page and the footer's ✦ line: about half what it was, so the page flows into the footer */
html body .main { padding-bottom: 16px !important; }
html body #shelvesView, html body #statsView { padding-bottom: 8px !important; }
/* phones: in-story search gets its own full-width row under the reading bar (it used to squeeze onto the bar's one line
   and run off the screen); closed, the bar stays one slim row */
@media (max-width: 640px) {
  html body #reader.find-open .reader-bar { flex-wrap: wrap !important; row-gap: 6px !important; }
  html body #reader.find-open #findForm { order: 10; flex: 1 1 100%; width: 100%; min-width: 0; display: flex !important; align-items: center; gap: 4px; }
  html body #reader.find-open #findQ { flex: 1 1 auto; min-width: 0; width: auto !important; height: 36px; }
  html body #reader #findForm .find-count { flex: none; font-size: 12px; white-space: nowrap; }
  html body #reader #findForm .icon-btn { flex: none; width: 36px; height: 36px; }
}
/* ---- UI check fixes ---- */
@media (max-width: 640px) {
  /* the details line under each fic (Language · Words · Chapters · Format · Source) wraps instead of ending in "…" */
  html body .b-stats { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; display: flex !important; flex-wrap: wrap; gap: 2px 0; }
  html body .b-stats dt, html body .b-stats dd { white-space: nowrap; }
  /* easier to tap: the ✕ on chosen-filter chips and the Select button */
  html body .fchip button { min-width: 28px; min-height: 28px; margin: -5px -6px -5px -2px; padding: 0 6px; }
  html body .tabs-right .sel-btn { height: 30px !important; }
}
@media (max-width: 360px) {
  /* Shelves screen: Bookmarks / Completed / Downloaded fit in full on the smallest phones */
  html body .shp-folder { font-size: 12.5px !important; padding: 9px 8px !important; }
  html body .shp-folder .shp-fl { text-overflow: clip; overflow: visible; }
}
/* Add (Drive link / Upload): the button's label sits in the middle when the button stretches to the box beside it */
#sourcesModal .btn { display: inline-flex; align-items: center; justify-content: center; }
@media (max-width: 640px) {
  /* Card view on phones: the full title, and every character on wrapping lines (nothing cut off mid-word) */
  html .cards .card h3 { display: block !important; -webkit-line-clamp: unset !important; line-clamp: unset !important; overflow: visible !important; }
  html .cards .chips.one-line, html .cards .chips.one-line .ol-in { flex-wrap: wrap !important; overflow: visible !important; -webkit-mask-image: none !important; mask-image: none !important; }
}

/* ---- Aa › Text colour: gentler story text, mostly for reading at night. Only the story text changes; a fic's own
   coloured text keeps its colour. On light pages the colours stay dark enough to read easily. ---- */
.reader[data-tc="soft"] .book { color: color-mix(in srgb, var(--rink) 78%, var(--rbg)) !important; }
.reader[data-tc="warm"] .book { color: color-mix(in srgb, var(--rink) 70%, #7a4f24) !important; }
.reader[data-tc="amber"] .book { color: color-mix(in srgb, var(--rink) 50%, #8a5414) !important; }
.reader[data-rt="dark"][data-tc="soft"] .book { color: color-mix(in srgb, var(--rink) 68%, var(--rbg)) !important; }
.reader[data-rt="dark"][data-tc="warm"] .book { color: color-mix(in srgb, color-mix(in srgb, var(--rink) 55%, #c8964f) 85%, var(--rbg)) !important; }
.reader[data-rt="dark"][data-tc="amber"] .book { color: color-mix(in srgb, color-mix(in srgb, var(--rink) 30%, #e9a43c) 85%, var(--rbg)) !important; }
/* the little dot on each choice shows its colour on the current page */
.tc-swatches i { background: var(--rink); border-color: transparent !important; }
.reader .tc-swatches [data-val="soft"] i { background: color-mix(in srgb, var(--rink) 78%, var(--rbg)); }
.reader .tc-swatches [data-val="warm"] i { background: color-mix(in srgb, var(--rink) 70%, #7a4f24); }
.reader .tc-swatches [data-val="amber"] i { background: color-mix(in srgb, var(--rink) 50%, #8a5414); }
.reader[data-rt="dark"] .tc-swatches [data-val="soft"] i { background: color-mix(in srgb, var(--rink) 68%, var(--rbg)); }
.reader[data-rt="dark"] .tc-swatches [data-val="warm"] i { background: color-mix(in srgb, color-mix(in srgb, var(--rink) 55%, #c8964f) 85%, var(--rbg)); }
.reader[data-rt="dark"] .tc-swatches [data-val="amber"] i { background: color-mix(in srgb, color-mix(in srgb, var(--rink) 30%, #e9a43c) 85%, var(--rbg)); }
/* Reading settings on computers and tablets: never taller than the window; anything below scrolls inside the panel
   (and scrolling it never moves the story behind) */
@media (min-width: 641px) {
  #aaPop:not([hidden]) { max-height: calc(100vh - 80px); max-height: calc(100dvh - 80px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--ink) 25%, transparent) transparent; }
}

/* the "check my folders by themselves" switch under the Drive folders */
#autoCheckRow { margin: 10px 0 4px; }
#autoCheckRow[hidden] { display: none; }

/* ---- Reading calendar: each day is shaded by how much you read (never one mark per fic, so it stays calm),
   a dot (or a small number) for fics finished, and an outline on the days of a fic you tap ---- */
.sg-cal .cal-cell.has { background: color-mix(in srgb, var(--panel-2) 70%, transparent); color: var(--ink); font-weight: 600; }
.sg-cal .cal-cell.h1 { background: color-mix(in srgb, var(--accent) 14%, var(--panel)); }
.sg-cal .cal-cell.h2 { background: color-mix(in srgb, var(--accent) 28%, var(--panel)); }
.sg-cal .cal-cell.h3 { background: color-mix(in srgb, var(--accent) 46%, var(--panel)); }
.sg-cal .cal-cell.h4 { background: color-mix(in srgb, var(--accent) 66%, var(--panel)); color: var(--accent-ink); }
.sg-cal .cal-cell.h4 .cal-dot { background: var(--accent-ink); }
.sg-cal .cal-cell.band { box-shadow: inset 0 0 0 2px var(--ink); }
.sg-cal .cal-cell.sel { background: var(--accent); color: var(--accent-ink); }
.sg-cal .cal-cell.sel .cal-num { background: var(--accent-ink); color: var(--accent); }
.cal-num { position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%); min-width: 14px; padding: 0 3px; border-radius: 7px; background: var(--accent); color: var(--accent-ink); font: 700 9.5px/13px var(--ui); text-align: center; }
.sg-cal .cal-cell.h4 .cal-num { background: var(--accent-ink); color: var(--accent); }
.cal-legend { display: flex; align-items: center; gap: 4px; margin-top: 8px; font: 500 11px var(--ui); color: var(--ink-3); flex-wrap: wrap; }
.cal-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.cal-legend i.h1 { background: color-mix(in srgb, var(--accent) 14%, var(--panel)); } .cal-legend i.h2 { background: color-mix(in srgb, var(--accent) 28%, var(--panel)); }
.cal-legend i.h3 { background: color-mix(in srgb, var(--accent) 46%, var(--panel)); } .cal-legend i.h4 { background: color-mix(in srgb, var(--accent) 66%, var(--panel)); }
.cal-legend .cl-sep { width: 10px; } .cal-legend .cal-dot { position: static; transform: none; width: 6px; height: 6px; }
.cal-sec { font: 700 11px var(--ui); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-top: 4px; }
.sg-cal .cal-fic { display: flex; align-items: stretch; padding: 0; gap: 0; overflow: hidden; cursor: default; }
.sg-cal .cal-fic.on { border-color: var(--ink); }
.cal-fic .cf-main { flex: 1; min-width: 0; display: grid; text-align: left; padding: 7px 10px; border: 0; background: none; color: inherit; cursor: pointer; font: inherit; }
.cal-fic .cf-main .cf-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-fic .cf-open { flex: none; width: 40px; border: 0; border-left: 1px solid var(--line); background: none; color: var(--accent); font-size: 20px; cursor: pointer; }
.cal-fic .cf-open:hover, .cal-fic .cf-main:hover { background: var(--accent-soft); }
.cal-more { justify-self: start; font-size: 12.5px; }
.sg-kv .sg-kv-t { max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
/* Notes: Started and Finished side by side */
.mn-dates { gap: 8px; align-items: flex-end; }
.mn-dates .mn-d { display: grid; gap: 2px; flex: 1; min-width: 0; }
.mn-dates .mn-d small { font-size: 11.5px; color: var(--ink-3); }
.mn-dates .mn-d input { width: 100%; min-width: 0; }
/* a day with a count: its date sits a little higher so the small number never covers it */
.sg-cal .cal-cell:has(.cal-num) > span:first-child { transform: translateY(-5px); }

/* ---- Pages reading style: the story never scrolls by itself; pages turn by swipe, tap or key ---- */
html.pages, html.pages body { overscroll-behavior: none; }
html.pages #readerScroll, html.pages .reader .book { touch-action: none; }
html.pages #readerScroll { scrollbar-width: none; }
html.pages #readerScroll::-webkit-scrollbar { display: none; }
#pgMask, #pgMaskTop { position: fixed; z-index: 3; background: var(--rbg); pointer-events: none; }
.pg-sheet { position: fixed; z-index: 4; background: var(--rbg); overflow: hidden; pointer-events: none; transform-origin: 0 50%; will-change: transform;
  box-shadow: 6px 0 18px rgba(0,0,0,.18); --pg-shade: 0; backface-visibility: hidden; }
.pg-sheet::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(0,0,0,0) 55%, rgba(0,0,0,.22)); opacity: calc(var(--pg-shade) * 2.2); }
.reader[data-rt="dark"] .pg-sheet { box-shadow: 6px 0 18px rgba(0,0,0,.5); }
/* Aa: the two new rows, and the scroll-only settings step aside in Pages */
.pg-note { margin: 2px 0 8px; font-size: 12.5px; color: color-mix(in srgb, var(--rink, var(--ink)) 70%, transparent); line-height: 1.45; }
#aaPop:not(.pg-pages) .pg-opt { display: none; }
#aaPop.pg-pages .scroll-only { display: none; }
/* ---- Aa › Scroll, in sections: a title, its settings, and a line between sections ---- */
html body #aaPop .aa-scroll { display: flex; flex-direction: column; gap: 0; }
html body #aaPop .aa-sec { display: flex; flex-direction: column; gap: 10px; padding: 14px 0 16px; border-top: 1px solid var(--line); }
html body #aaPop .aa-sec:first-child { border-top: 0; padding-top: 6px; }
html body #aaPop .aa-sec .aa-sub { margin: 0; font: 700 12px var(--ui); letter-spacing: .09em; text-transform: uppercase; color: var(--accent); }
html body #aaPop .aa-sec-more { display: flex; flex-direction: column; gap: 10px; }
html body #aaPop .aa-mini { font: 600 12.5px var(--ui); color: var(--ink-2); margin-top: 2px; }
html body #aaPop .aa-mini-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; }
html body #aaPop .aa-mini-row .aa-mini { margin: 0; }
html body #aaPop .aa-mini-row input[type=range] { width: 100%; }
html body #aaPop .aa-sec .seg { width: 100%; box-sizing: border-box; }
html body #aaPop .aa-sec .aa-check { margin: 0 !important; }
html body #aaPop .aa-sec .as-row { display: flex; flex-direction: column; gap: 6px; }
html body #aaPop .aa-sec .as-row .btn { width: 100%; min-height: 44px; justify-content: center; }
html body #aaPop .pg-note { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--ink-2); }
/* Pages or Scroll: only the settings that apply show, and they ease in instead of popping up */
html body #aaPop:not(.pg-pages) .pg-opt { display: none !important; }
html body #aaPop.pg-pages .scroll-only { display: none !important; }
html body #aaPop .ts-opt.ts-off { display: none !important; }
@keyframes aaIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) { html body #aaPop .pg-opt, html body #aaPop .scroll-only, html body #aaPop .ts-opt { animation: aaIn .22s ease-out; } }
html body #aaPop input[type=range] { accent-color: var(--accent); }
html body #aaPop .aa-sec .aa-sub { color: var(--ink-2); font: 700 11.5px var(--ui); letter-spacing: .08em; }

/* Pages: on phones and tablets the header slides away when you turn a page (tap the middle or pull down lightly to bring it
   back); turning pages pass underneath it */
html.pages .reader .reader-bar { z-index: 6 !important; }
html.pages .pg-sheet { z-index: 4; }
html.pages #pgMask, html.pages #pgMaskTop { z-index: 3; }

/* follow FicShelf on X: the X logo sits in line with the words */
.x-follow { display: inline-flex; align-items: center; gap: 6px; }
.x-follow .x-ico { flex: none; }
.x-btn .x-ico { display: block; }
.end-btns .x-follow { justify-content: center; }
/* the smallest phones: the header X button steps aside so the FicShelf name never touches + Add (the footer and menus still link to X) */
@media (max-width: 360px) { html body #xBtn { display: none !important; } }

/* ---- Menu icons: each one sits on the same soft tile in the theme's own colours; the page you're on gets a filled tile.
   The drawing is the text colour with one small detail in the accent colour. ---- */
html body .navbar .nav-item { gap: 4px; }
html body .navbar .nav-item, html body .navbar .nav-item.on, html body .navbar .nav-item:hover { background: none; }
html body .navbar .nav-item .nt { width: 36px; height: 34px; border-radius: 11px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 11%, var(--panel)); color: var(--ink-2); --nt-acc: var(--accent); transition: background .15s, color .15s; }
html body .navbar .nav-item .nt svg { display: block; }
html body .navbar .nav-item .ga { fill: var(--nt-acc); }
html body .navbar .nav-item .gs { stroke: var(--nt-acc); }
html body .navbar .nav-item:hover .nt { background: color-mix(in srgb, var(--accent) 18%, var(--panel)); color: var(--ink); }
html body .navbar .nav-item.on .nt, html body .navbar .nav-item[aria-current] .nt { background: var(--accent); color: var(--accent-ink); --nt-acc: color-mix(in srgb, var(--accent-ink) 55%, var(--accent)); }
html body .navbar .nav-item.on, html body .navbar .nav-item[aria-current] { color: var(--accent); }
@media (min-width: 641px) { html body .navbar .nav-item .nt { width: 40px; height: 38px; border-radius: 12px; } }

/* the little bands on the book spines in the Shelf life icon are cut in the tile's own colour */
html body .navbar .nav-item .nt { --nt-tile: color-mix(in srgb, var(--accent) 11%, var(--panel)); }
html body .navbar .nav-item:hover .nt { --nt-tile: color-mix(in srgb, var(--accent) 18%, var(--panel)); }
html body .navbar .nav-item.on .nt, html body .navbar .nav-item[aria-current] .nt { --nt-tile: var(--accent); }
html body .navbar .nav-item .gb { fill: var(--nt-tile); }
/* the selected menu tile: two themes whose own "text on accent" colour is too faint on it */
html[data-theme="bryn"] body .navbar .nav-item.on .nt { color: #0f1410; --nt-acc: #5a3d22; }
html[data-theme="duskydarkpurple"] body .navbar .nav-item.on .nt { color: #ffffff; --nt-acc: #f3c6d6; }
/* Shelves: the "+ New shelf" box is just its words, centred, and the same size as the shelves beside it */
html body .shp-grid .shp-add-cell { display: flex; }
html body .shp-grid .shp-add { flex: 1; height: 100%; align-items: center; justify-content: center; text-align: center; }
html body .shp-grid .shp-add .shp-name { margin: 0; }
html body .shp-grid.shp-small .shp-add .shp-name { white-space: nowrap; font-size: 14px; }

/* ================= Inside a shelf: the same calm look as the Shelves page =================
   ‹ Shelves, then the shelf's name as a big title with its count and the shelves inside it, then one row of equal
   controls, a line, and the fics. The long row of every shelf isn't shown here (Shelves is one tap away). */
html body .main.in-shelf { display: flex; flex-direction: column; }
html body .main.in-shelf > * { order: 5; }
html body .main.in-shelf > .tabs-row { order: 1; margin: 0; }
html body .main.in-shelf > .toolbar { order: 2; }
html body .main.in-shelf #shelfChips, html body .main.in-shelf #vtSubs, html body .main.in-shelf #count { display: none !important; }
html body .main.in-shelf .view-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 4px 0 2px; }
html body .main.in-shelf .view-title .vt-back { flex-basis: 100%; justify-content: flex-start; width: auto; margin: 0 0 4px; padding: 0; border: 0; background: none; font: 500 13px var(--ui); color: var(--ink-2); text-align: left; }
html body .main.in-shelf .view-title .vt-back:hover { color: var(--accent); }
html body .main.in-shelf .view-title > b { font: italic 700 32px/1.05 var(--serif); color: var(--ink); }
html body .main.in-shelf .view-title .vt-crumb { font: 500 15px var(--ui); color: var(--ink-2); }
html body .main.in-shelf .view-title .vt-count { font: 500 14px var(--ui); color: var(--ink-2); }
html body .main.in-shelf .view-title .vt-subs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 0 6px; padding: 0; }
html body .main.in-shelf .view-title .vt-sub { height: 34px; padding: 0 12px; border-radius: 10px; }
/* the controls: equal boxes in one row, then a line */
html body .main.in-shelf .toolbar { display: block; margin: 14px 0 16px; padding: 0 0 16px; border-bottom: 1px solid var(--line); }
html body .main.in-shelf .toolbar .active-filters:empty { display: none; }
html body .main.in-shelf .toolbar .tools { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 10px; width: 100%; }
html body .main.in-shelf .toolbar .tools > [hidden], html body .main.in-shelf .toolbar .tools > .shuffle-btn[hidden] { display: none !important; }
html body .main.in-shelf .toolbar .tools > select, html body .main.in-shelf .toolbar .tools > .btn, html body .main.in-shelf .toolbar .tools > .seg {
  height: 44px; min-height: 44px; width: 100%; box-sizing: border-box; border-radius: 12px; border: 1px solid var(--line); background-color: var(--panel); font-size: 14px; margin: 0; }
html body .main.in-shelf .toolbar .tools > .seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); padding: 4px; gap: 4px; }
html body .main.in-shelf .toolbar .tools > .seg > button { height: 100%; border-radius: 9px; }
html body .main.in-shelf.jr-on .toolbar .tools > .seg[aria-label="View"] { display: none; }
html body .main .jr-switch[hidden] { display: none !important; }
html body .main .jr-switch > button { white-space: nowrap; }
/* ================= The journal: tiles across the whole width, grouped by month ================= */
html body #list.journal { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; max-width: none; align-items: start; }
html body #list.journal > .jr-month { grid-column: 1 / -1; margin: 10px 0 0; }
html body #list.journal > .jr-month:first-child { margin-top: 0; }
html body #list.journal .jr-tile { display: flex; flex-direction: column; gap: 7px; padding: 16px; border-radius: 16px; min-width: 0; }
html body #list.journal .jr-tile .jt-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
html body #list.journal .jr-tile .jt-when { font: 700 12px var(--ui); color: var(--accent); }
html body #list.journal .jr-tile .jr-stars { color: var(--accent); font-size: 14px; letter-spacing: 1px; white-space: nowrap; }
html body #list.journal .jr-tile .jr-stars span { opacity: .25; }
html body #list.journal .jr-tile h4 { margin: 0; font: 700 18px/1.25 var(--serif); color: var(--accent); overflow-wrap: anywhere; }
html body #list.journal .jr-tile .jr-by { font-size: 12.5px; color: var(--ink-2); }
html body #list.journal .jr-tile .jr-notes { margin: 0; }
html body #list.journal .jr-tile .jr-meta { font-size: 12px; color: var(--ink-3); }
html body #list.journal .jt-bar { height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--accent) 14%, var(--panel)); overflow: hidden; }
html body #list.journal .jt-bar i { display: block; height: 100%; border-radius: 2px; background: var(--accent); }
@media (max-width: 640px) {
  html body .main.in-shelf .view-title > b { font-size: 27px; }
  html body .main.in-shelf .view-title .vt-subs { margin: 2px 0 0; flex-basis: 100%; }
  html body .main.in-shelf .toolbar { margin: 10px 0 12px; padding-bottom: 12px; }
  html body .main.in-shelf .toolbar .tools { gap: 8px; }
  html body .main.in-shelf .toolbar .tools > select, html body .main.in-shelf .toolbar .tools > .btn, html body .main.in-shelf .toolbar .tools > .seg { height: 42px; min-height: 42px; font-size: 13px; }
  html body #list.journal { grid-template-columns: 1fr; gap: 12px; }
}
html body .main.in-shelf #hideMineBtn { display: none !important; }

/* ---- Shelves come in two kinds you can tell apart at a glance:
   Built in (Favorites and the reading statuses): plain boxes with a small badge, the same for everyone.
   Your shelves: your own, in soft colours, with ⋯ to rename, nest or delete. ---- */
html body .shp-grid .shp-sec { grid-column: 1 / -1; margin: 6px 0 -2px; font: 700 11.5px var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
html body .shp-grid .shp-sec:first-child { margin-top: 0; }
html body .shl-list .shl-sec { margin: 14px 4px 6px; font: 700 11.5px var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
html body .shl-list .shl-sec:first-child { margin-top: 2px; }
html body .shp-cell.k-status .shp-box::before, html body .shp-cell.k-builtin .shp-box::before { filter: none; background: var(--panel); }
html body .shp-cell.k-status .shp-box, html body .shp-cell.k-builtin .shp-box { border: 1px solid var(--line); }
html body .shp-badge { position: absolute; top: 10px; right: 10px; display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, var(--panel)); color: var(--accent); font: 700 10.5px var(--ui); letter-spacing: .04em; text-transform: uppercase; }
html body .shp-small .shp-badge { top: 7px; right: 7px; padding: 2px 6px; font-size: 9.5px; }
html body .shp-small .shp-badge svg { display: none; }
html body .shp-cell.k-status .shp-name, html body .shp-cell.k-builtin .shp-name { padding-right: 64px; }
html body .shp-small .shp-cell.k-status .shp-name, html body .shp-small .shp-cell.k-builtin .shp-name { padding-right: 0; margin-top: 14px; }
/* inside a shelf: its kind, small, above the title */
html body .main.in-shelf .view-title .vt-kind { flex-basis: 100%; margin: 2px 0 -4px; font: 700 11px var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }

/* built-in shelves: a bold outline and badge in their own colour, the same in every theme (your shelves keep the soft theme colours) */
html body .shp-cell.k-status .shp-box, html body .shp-cell.k-builtin .shp-box { border: 2px solid var(--kc, var(--line)); }
html body .shp-cell.k-status .shp-badge, html body .shp-cell.k-builtin .shp-badge { background: var(--kc, var(--accent)); color: #ffffff; }
html body .shp-cell.k-status .shp-box:hover, html body .shp-cell.k-builtin .shp-box:hover { box-shadow: 0 10px 22px color-mix(in srgb, var(--kc, #000) 22%, transparent); }
html body .shl-row.k-status .shl-main, html body .shl-row.k-builtin .shl-main { box-shadow: inset 3px 0 0 var(--kc, transparent); }
html body .shl-row.k-status .shl-ic, html body .shl-row.k-builtin .shl-ic { filter: none; }
html body .shl-row.k-status .shl-ic i, html body .shl-row.k-builtin .shl-ic i { background: var(--kc); }
/* the badge sits above the shelf's name (beside it, it squeezed long names) */
html body .shp-cell .shp-badge { position: static; align-self: flex-start; margin: 0 0 6px; }
html body .shp-cell.k-status .shp-name, html body .shp-cell.k-builtin .shp-name, html body .shp-small .shp-cell.k-status .shp-name, html body .shp-small .shp-cell.k-builtin .shp-name { padding-right: 0; margin-top: 0; }
html body .shp-small .shp-cell .shp-badge { margin-bottom: 4px; }
/* phones, inside a shelf: Filters, sort and Journal / Full view as equal boxes (Select stays beside the title; Search has its own tab) */
@media (max-width: 640px) {
  html body .main.in-shelf .toolbar .tools { display: grid !important; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
  html body .main.in-shelf .toolbar #searchForm { display: none !important; }
  html body .main.in-shelf .toolbar .tools > * { min-width: 0 !important; width: 100% !important; flex: none !important; }
  html body .main.in-shelf .toolbar #sort { padding-right: 26px; text-overflow: ellipsis; }
  html body .main.in-shelf .tabs-row { align-items: flex-start; }
}
@media (max-width: 640px) {
  html body .main.in-shelf .toolbar .tools { grid-auto-flow: row; grid-template-columns: 50px minmax(0, 1fr); }
  html body .main.in-shelf .toolbar .tools:has(#jrSwitch:not([hidden])) { grid-template-columns: 50px minmax(0, 1fr) minmax(0, 1.25fr); }
  html body .main.in-shelf .jr-switch > button { font-size: 12.5px; padding: 0 4px; }
}

/* ---- Quick shelves (Favorites, Bookmarks and the reading statuses): small one-line tiles, all in one colour that stays
   the same in every theme, so they read as their own kind. Your shelves below keep their bigger, colourful boxes. ---- */
html body .shelves-view > .shp-sec { margin: 18px 0 8px; font: 700 11.5px var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
html body .shelves-view > .shp-sec:first-of-type { margin-top: 6px; }
html body .shq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; }
html body .shq-tile { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 14px; box-sizing: border-box; border-radius: 12px; border: 2px solid var(--kc);
  background: var(--panel); color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: transform .12s, box-shadow .12s; }
html body .shq-tile:hover { transform: translateY(-1px); box-shadow: 0 6px 16px color-mix(in srgb, var(--kc) 22%, transparent); }
html body .shq-tile:focus-visible { outline: 2px solid var(--kc); outline-offset: 2px; }
html body .shq-ic { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--kc); color: #ffffff; }
html body .shq-name { flex: 1; min-width: 0; font: 700 15px var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html body .shq-n { flex: none; font: 600 12.5px var(--ui); color: var(--ink-2); font-variant-numeric: tabular-nums; }
html body .shelves-view .shp-grid { align-items: stretch; }
html body .shelves-view .shp-grid .shp-cell { display: flex; }
html body .shelves-view .shp-grid .shp-cell > .shp-box { flex: 1; }
@media (max-width: 640px) {
  html body .shq-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  html body .shq-tile { height: 48px; padding: 0 10px; gap: 8px; }
  html body .shq-ic { width: 26px; height: 26px; border-radius: 8px; }
  html body .shq-name { font-size: 14px; }
}
/* the reading-status tiles carry a small "Status" tag on their top-right edge */
html body .shq-tile { position: relative; }
html body .shq-tag { position: absolute; top: -9px; right: 10px; padding: 1px 7px; border-radius: 999px; background: var(--kc); color: #ffffff; font: 700 9.5px/14px var(--ui); letter-spacing: .06em; text-transform: uppercase; }
html body .shq-grid { padding-top: 6px; row-gap: 16px; }
html body .shq-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
@media (max-width: 640px) { html body .shq-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* quick shelves follow the theme: its main colour, with its "text on main colour" for the icon and Status tag */
html body .shq-grid, html body .shl-list { --qk-ink: var(--accent-ink); }
html[data-theme="bryn"] body .shq-grid, html[data-theme="bryn"] body .shl-list { --qk-ink: #0f1410; }
html[data-theme="duskydarkpurple"] body .shq-grid, html[data-theme="duskydarkpurple"] body .shl-list { --qk-ink: #ffffff; }
html body .shq-ic, html body .shq-tag { color: var(--qk-ink); }

/* phones: the header buttons sit a little closer so the theme button never slips past the edge (wider logo fonts, e.g. Archive) */
@media (max-width: 400px) { html body .top-actions { gap: 4px; min-width: 0; } html body .brand { min-width: 0; flex-shrink: 1; } }

/* small one-line pop-ups (Follow on X, Home Screen app): same look as the Ko-fi note, just narrower; a normal centred box on phones too */
.dlg.wn.wn-small { max-width: 400px; }
.wn-small .kp-lead { margin: 10px 4px 0; text-align: center; color: var(--ink-2); line-height: 1.55; }
.wn-small .wn-btns a.btn { text-decoration: none; }
@media (max-width: 860px) {
  html .dlg-wrap:has(> .wn-small) { place-items: center; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
  html .dlg-wrap > .dlg.wn-small { width: 100%; max-width: 400px; border-radius: 18px !important; box-shadow: 0 24px 60px rgba(0,0,0,.35); animation: popFadeIn .2s ease-out; }
  html .dlg.wn-small > .wn-btns { padding-bottom: 14px !important; }
}
.hn-body { display: contents; }   /* the Home Screen pop-up swaps its text and button in place; this keeps the usual pop-up layout */
/* empty library: a short note in the filters panel instead of a blank space */
.facets-empty { margin: 6px 2px; padding: 16px 14px; border: 1px dashed var(--line); border-radius: 12px; text-align: center; display: grid; gap: 8px; justify-items: center; color: var(--ink-2); font-size: 13px; line-height: 1.5; }
.facets-empty b { color: var(--ink); font-size: 14px; }
/* phones, inside a shelf: the card / list toggle counts as a box too. Filters, sort and that toggle share one row; in Full view
   the Journal / Full view switch gets the whole row below (in Journal the toggle is hidden, so all three fit on one row) */
@media (max-width: 640px) {
  html body .main.in-shelf:not(.jr-on) .toolbar .tools { grid-template-columns: 50px minmax(0, 1fr) 96px !important; }
  html body .main.in-shelf:not(.jr-on) .toolbar .tools > #jrSwitch { grid-column: 1 / -1; }
  /* Random sort: the shuffle button gets its own small box beside the sort, so the card / list toggle stays on the same row */
  html body .main.in-shelf:not(.jr-on) .toolbar .tools:has(#shuffleBtn:not([hidden])) { grid-template-columns: 50px minmax(0, 1fr) 44px 96px !important; }
  html body .main.in-shelf.jr-on .toolbar .tools:has(#shuffleBtn:not([hidden])):has(#jrSwitch:not([hidden])) { grid-template-columns: 50px minmax(0, 1fr) 44px minmax(0, 1.25fr) !important; }
  html body .main.in-shelf .toolbar .tools > #shuffleBtn { height: 44px; border-radius: 12px; border: 1px solid var(--line); background-color: var(--panel); }
}
/* very long fics on iPad (and phones): in page-scroll mode the story must not sit in its own layer. A positioned reader with
   a z-index became one giant layer above the page, and iPad's browser stops drawing a layer that tall partway down: a
   ~400k-word fic went blank after chapter 21 while the scrollbar kept moving. Without the z-index the story is drawn as part
   of the page itself, which has no such limit. The theme's pattern is hidden while reading (the story covers it anyway), so it
   can't paint over the text. */
html.reader-page .reader:not([hidden]) { z-index: auto !important; }
html.reader-page body::before, html.reader-page body::after { display: none !important; }
/* behind the story: the reader's own page colour (Paper, Sepia, Night or the theme), so Android's bottom bar matches it */
html.reader-page, html.reader-page body { background: var(--reader-bg, var(--bg)) !important; }
/* the in-app browser note has a Copy link button beside its text */
.inapp-note { align-items: center; gap: 8px; }
.inapp-note .btn { flex: none; white-space: nowrap; }
.ios-home-note { margin: 10px auto 0; max-width: 34em; }

/* "Remove empty lines" (Aa > More): hides the blank paragraphs some fics put between paragraphs */
.reader.no-blank .book p.blank-line { display: none; }

/* "One chapter at a time" (Aa > Scroll): only the current chapter shows; the end of the fic only after the last one */
.chap-nav { display: none; }
.reader.one-chap .book > .chapter:not(.cur) { display: none; }
.reader.one-chap:not(.last-chap) .book > .chapter ~ :not(.chapter) { display: none; }
.reader.one-chap .chap-nav { display: flex; justify-content: space-between; gap: 10px; margin: 2.2em 0 1em; padding-top: 1.2em; border-top: 1px solid color-mix(in srgb, var(--rink) 15%, transparent); }
.reader.one-chap .chap-nav .btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; max-width: 48%; padding: 10px 14px; text-align: left; font-family: var(--ui, inherit); }
.reader.one-chap .chap-nav .btn.primary { align-items: flex-end; text-align: right; margin-left: auto; }
.reader.one-chap .chap-nav .btn small { font-size: 12px; opacity: .8; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

/* Ko-fi at happy moments: the small line about who makes FicShelf */
.wn-kt .kt-small { font-size: 12.5px; opacity: .8; margin-top: 6px; }

/* Follow on X pop-up: our profile picture with a sparkly glow, and a big black X-style button */
.wn-xfollow .wn-hero { display: flex; flex-direction: column; align-items: center; gap: 2px; padding-top: 22px !important; }
.wn-xfollow .xf-pfp { position: relative; width: 92px; height: 92px; display: grid; place-items: center; margin-bottom: 6px; }
.wn-xfollow .xf-pfp img { position: relative; z-index: 1; width: 84px; height: 84px; border-radius: 50%; box-shadow: 0 0 0 4px var(--panel), 0 8px 22px rgba(72, 44, 61, .35); }
.wn-xfollow .xf-glow { position: absolute; inset: -10px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, #f5c542 45%, transparent) 0%, transparent 70%); animation: xfGlow 2.4s ease-in-out infinite; }
.wn-xfollow .xf-sp { position: absolute; z-index: 2; font-style: normal; color: #f5c542; text-shadow: 0 0 6px rgba(245, 197, 66, .8); animation: xfTwinkle 1.8s ease-in-out infinite; }
.wn-xfollow .xf-sp.s1 { top: -4px; right: -6px; font-size: 18px; }
.wn-xfollow .xf-sp.s2 { top: 18px; left: -14px; font-size: 13px; animation-delay: .5s; }
.wn-xfollow .xf-sp.s3 { bottom: -2px; left: 2px; font-size: 14px; animation-delay: 1s; }
.wn-xfollow .xf-sp.s4 { bottom: 10px; right: -14px; font-size: 12px; animation-delay: 1.4s; }
.wn-xfollow .xf-handle { margin: 0; font-weight: 700; color: var(--accent); font-size: 15px; }
.wn-xfollow .xf-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: min(100%, 320px); padding: 14px 22px; font-size: 16.5px; font-weight: 700; border-radius: 999px;
  background: #0f0f0f !important; color: #fff !important; border: 0 !important; text-decoration: none; position: relative; overflow: hidden; box-shadow: 0 6px 18px rgba(0, 0, 0, .28); }
.wn-xfollow .xf-btn svg path { fill: #fff; }
.wn-xfollow .xf-btn::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .28) 50%, transparent 65%); transform: translateX(-100%); animation: xfShine 2.8s ease-in-out infinite 1s; }
.wn-xfollow .xf-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(0, 0, 0, .32); }
@keyframes xfGlow { 0%, 100% { opacity: .55; transform: scale(.95); } 50% { opacity: 1; transform: scale(1.06); } }
@keyframes xfTwinkle { 0%, 100% { opacity: .25; transform: scale(.7) rotate(0); } 50% { opacity: 1; transform: scale(1.15) rotate(20deg); } }
@keyframes xfShine { 0% { transform: translateX(-100%); } 60%, 100% { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .wn-xfollow .xf-glow, .wn-xfollow .xf-sp, .wn-xfollow .xf-btn::after { animation: none; } }

/* Tablets and computers. iPad's Home Screen app draws the page under its status bar (clock, battery), so the header keeps
   room for it; the slimmer-header rule above had set the top to a flat 8px and the clock sat on the logo */
@media (min-width: 641px) {
  html body .top { padding-top: calc(8px + env(safe-area-inset-top)) !important; }
  /* the Mac's rubber-band bounce at the top moved the header but not the pinned side menu, so they overlapped: no bounce here */
  html, body { overscroll-behavior-y: none; }
  /* the side menu and the theme's background reach the very bottom edge, under the iPad's home bar too */
  .navbar { bottom: calc(-1 * env(safe-area-inset-bottom, 0px)); padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
}
body::before, body::after { bottom: calc(-1 * env(safe-area-inset-bottom, 0px)); }

/* Laptops and tablets: the header sits above the side navbar, so if the page ever shifts, the navbar can't cover the header */
@media (min-width: 641px) { .top { z-index: 36; } }

/* the lines between the notes and the story (before the story starts, and after it ends): clear in every theme, page colour and layout */
.reader .book hr.story-start { display: block !important; border: 0 !important; border-top: 1.5px solid color-mix(in srgb, var(--rink, currentColor) 45%, transparent) !important; margin: 1.8em 0 1.6em !important; height: 0 !important; background: none !important; width: 100% !important; opacity: 1 !important; break-inside: avoid; }

/* Add a Drive link / upload: the title scrolls away with the rest of the panel instead of staying pinned while you scroll a long list of drives */
html #sourcesModal .modal-head { position: static; }
/* a simple line between the drives that are fully loaded and the ones still loading */
.src-split { border: 0; border-top: 1.5px solid var(--line); margin: 12px 0; height: 0; }

/* Shelf life: the page reads top to bottom in sections (when, what, who, your library), each with its own heading and a thin line above */
.sg-sec { font: 600 21px var(--serif); color: var(--ink); margin: 30px 0 12px; padding-top: 18px; border-top: 1px solid var(--line); }
/* two cards side by side, always the same height, so there's no empty gap under the shorter one */
.sg-two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; }
.sg-two > .sg-col { display: flex; flex-direction: column; gap: 14px; }
.sg-two > .sg-col > .sg-card:last-child { flex: 1; }
/* the streak card: its numbers sit at the bottom, so a taller card shares its space evenly */
.sg-two > .sg-streak { display: flex; flex-direction: column; }
.sg-two > .sg-streak .sg-dots { margin-bottom: auto; }
.sg-sub { margin: 2px 0 0; font-size: 13px; color: var(--ink-2); }
/* one bar split into parts, and its legend */
.sg-split { display: flex; height: 16px; border-radius: 999px; overflow: hidden; margin: 14px 0 10px; gap: 2px; background: var(--line); }
.sg-split span { min-width: 3px; }
.sg-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--ink-2); }
.sg-legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.sg-legend i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.sg-legend b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .sg-two { grid-template-columns: minmax(0, 1fr); } .sg-sec { font-size: 19px; margin-top: 24px; } }

/* iPad and phone Home Screen app (iOS 27): when the header has scrolled away, the side menu moves up with it (--nav-top, set as
   you scroll), bars pinned to the top stop just under the clock and battery, and a strip in the header's colour sits behind them */
.sa-top { position: fixed; top: 0; left: 0; right: 0; height: env(safe-area-inset-top, 0px); z-index: 60; pointer-events: none; background-size: 100% var(--top-h, 57px); }
@media (min-width: 641px) { html body .navbar { top: var(--nav-top, var(--top-h, 57px)); } }
@media (max-width: 860px) { html body .toolbar { top: env(safe-area-inset-top, 0px); } }
/* rating / warning squares: the letters sat a little high (the font keeps room below for letters like g and y), so the text
   box is trimmed to the capital letters and they sit in the true middle */
.req .sq { text-box: trim-both cap alphabetic; }
/* ...and a hair lower still (about 3% of the square), so letters and the ✓ look centred to the eye, not just measured */
html body .req .sq { padding-top: 6%; }

/* Edit details: AO3's categories and archive warnings as tick boxes */
.edit-dlg .ed-set { border: 0; margin: 2px 0 0; padding: 0; min-width: 0; }
.edit-dlg .ed-set legend { font-size: 13px; font-weight: 600; color: var(--ink); padding: 0; margin-bottom: 6px; }
.ed-ticks { display: flex; flex-wrap: wrap; gap: 6px; }
.edit-dlg .ed-tick { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); font-weight: 400; font-size: 13.5px; cursor: pointer; }
.edit-dlg .ed-tick input { width: 16px; height: 16px; margin: 0; padding: 0; accent-color: var(--accent); flex: none; }
.edit-dlg .ed-tick:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--panel)); }
/* phones: "Reset to the file's details" was cut off beside Cancel and Save, so it gets its own row above them */
@media (max-width: 640px) { .edit-dlg .dlg-btns [data-ed-reset] { flex: 1 1 100%; margin-right: 0; } .edit-dlg .dlg-btns .btn:not([data-ed-reset]) { flex: 1 1 0; } }

/* ================= Blade: Crimson Romance's red, metallic gold, and a painted gold sun =================
   Starts as a copy of Crimson Romance, then: a deeper red glow from the top, gold text, and the sun.
   The sun is from Charles Monblond, "Designs for Ceilings with Central Sunburst" (19th century),
   The Metropolitan Museum of Art, Open Access (public domain): only its gold rays are kept, on a see-through background. */
:root[data-theme="blade"] {
  color-scheme: dark;
  --bg: #250202;
  --panel: #3A0C0E;
  --panel-2: #4A1416;
  --ink: #FFF9F2;
  --ink-2: #FFCAD0;
  --ink-3: #D9A3A8;
  --line: #5C1B1E;
  --accent: #FF6B7D;
  --accent-2: #892325;
  --accent-ink: #250202;
  --accent-soft: #4A1416;
  --chip: #320A0C;
  --c-char-bg: #4A1416;
  --c-char: #FFCAD0;
  --c-tag-bg: #320A0C;
  --c-tag: #F3D6D9;
  --c-rel-bg: #6B1A1F;
  --c-rel: #FFF9F2;
  --c-fan-bg: #2C0708;
  --c-fan: #FFB3BD;
  --c-warn-bg: #3A2A10;
  --c-warn: #F0D999;
  --blob1: rgba(137,35,37,.40);
  --blob2: rgba(241,2,34,.12);
  --blob3: rgba(255,202,208,.06);
  --r-paper: #FFF9F2;
  --r-paper-ink: #2A0B0D;
  --r-night: #1A0405;
  --r-night-ink: #F6E1E1;
  --hl: #FFCAD0;
  --grad: linear-gradient(135deg, #F10222 0%, #892325 55%, #250202 100%); --grad-2: linear-gradient(90deg, #892325, #F10222, #FFCAD0, #892325);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.4);
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg opacity='0.2'%3E%3Cpath transform='translate%2850 50%29 rotate%280%29 scale%281%29' d='M0 -14 C2 -4 4 -2 14 0 C4 2 2 4 0 14 C-2 4 -4 2 -14 0 C-4 -2 -2 -4 0 -14Z' fill='%23892325'/%3E%3Cpath transform='translate%28160 140%29 rotate%280%29 scale%280.6%29' d='M0 -14 C2 -4 4 -2 14 0 C4 2 2 4 0 14 C-2 4 -4 2 -14 0 C-4 -2 -2 -4 0 -14Z' fill='%23FFCAD0'/%3E%3Cpath transform='translate%28172 40%29 rotate%280%29 scale%280.35%29' d='M0 -14 C2 -4 4 -2 14 0 C4 2 2 4 0 14 C-2 4 -4 2 -14 0 C-4 -2 -2 -4 0 -14Z' fill='%23F10222'/%3E%3Ccircle cx='100' cy='100' r='1.6' fill='%23FFCAD0'/%3E%3Ccircle cx='40' cy='170' r='1.2' fill='%23F10222'/%3E%3Ccircle cx='200' cy='190' r='1.4' fill='%23FFCAD0'/%3E%3C/g%3E%3C/svg%3E");
}
html[data-theme="blade"] { --brand-c: #FFCAD0; --solid: #C9021D; --solid-ink: #FFF9F2; }
html[data-theme="blade"] .b-title h3, html[data-theme="blade"] .card h3 { color: #FFE3E6 !important; }
html[data-theme="blade"] .sq-r { background: #FF6B7D !important; } html[data-theme="blade"] .sq-c { background: #FFCAD0 !important; } html[data-theme="blade"] .sq-w { background: #D9A3A8 !important; } html[data-theme="blade"] .sq-s { background: #FFF9F2 !important; }
html[data-theme="blade"] .req .sq { color: #250202 !important; }
html[data-theme="blade"] .top { background: #3A0C0E !important; border-bottom: 0 !important; color: #FFF9F2; }
html[data-theme="blade"] .top .brand { color: #FFF9F2; } html[data-theme="blade"] .top .brand span { color: #FFCAD0 !important; } html[data-theme="blade"] .top .brand::before { background: #FFCAD0 !important; }
html[data-theme="blade"] .top .btn { background: rgba(255,255,255,.08) !important; border-color: rgba(255,202,208,.3) !important; color: #FFF9F2 !important; }
html[data-theme="blade"] .top .btn.primary { background: #C9021D !important; color: #FFF9F2 !important; border-color: transparent !important; }
html[data-theme="blade"] .top .icon-btn { color: #FFF9F2 !important; }
html[data-theme="blade"] select.btn, html[data-theme="blade"] .tools select, html[data-theme="blade"] .settings select, html[data-theme="blade"] .reader-tools select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23FFCAD0' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
html[data-theme="blade"] .toast-item { box-shadow: 0 10px 30px rgba(0,0,0,.5); }
html[data-theme="blade"] .dl { color: #FFB3BD !important; }
html[data-theme="blade"] .fav-btn.on, html[data-theme="blade"] .fav { color: #FF6B7D !important; }
:root[data-theme="blade"] {
  --gold: linear-gradient(100deg, #a8742a 0%, #e9c979 28%, #fff1c4 46%, #d4a853 62%, #9c6a24 100%);
  --pattern: url("img/blade-sun.webp");
}
html[data-theme="blade"] body { background: radial-gradient(90% 60% at 50% 0%, #7a0614 0%, #4a0309 40%, #250202 75%, #1a0101 100%) fixed #250202 !important; }
/* the sun: low on the right on computers and tablets, peeking into the top-right corner on phones */
html[data-theme="blade"] body::before { opacity: .45 !important; background-repeat: no-repeat !important; background-size: 620px auto !important; background-position: right -120px bottom -200px !important; }
@media (max-width: 640px) { html[data-theme="blade"] body::before { opacity: .6 !important; background-size: 340px auto !important; background-position: right -150px top -40px !important; } }
/* metallic gold: the FicShelf name, page titles, fic authors */
html[data-theme="blade"] .top .brand, html[data-theme="blade"] .top .brand span, html[data-theme="blade"] .view-title > b, html[data-theme="blade"] .shp-head h2, html[data-theme="blade"] .sg-title, html[data-theme="blade"] .b-title .by a {
  background: var(--gold) !important; -webkit-background-clip: text !important; background-clip: text !important; color: transparent !important; }
html[data-theme="blade"] .top { background: rgba(37,2,2,.82) !important; border-bottom: 1px solid rgba(201,161,90,.28) !important; }
html[data-theme="blade"] .top .btn { border-color: rgba(201,161,90,.32) !important; color: #f0cf8c !important; }
html[data-theme="blade"] .top .btn.primary { color: #FFF9F2 !important; }
html[data-theme="blade"] .card { border-color: rgba(201,161,90,.22) !important; }
html[data-theme="blade"] .view-title .vt-kind { color: #d4a853 !important; }
:root[data-theme="blade"] { --pm-danger: #ffc2c2; }

/* ---- Shelves inside shelves: no indents, a deeper shade per level ----
   List view and the "All N shelves" panel share one tree. Every row starts at the same left edge; each level opened is a
   deeper shade of the theme colour (--sh, set per row), and shadeInk() picks light or dark text for each shade. */
.shl-row.shl-in { background: color-mix(in srgb, var(--accent) var(--sh, 10%), var(--panel)) !important; box-shadow: none !important; border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent) !important; }
.shl-row.shl-in .shl-main { padding-left: 14px !important; }
.shl-row.shl-in .shl-ic { transform: none !important; }
.shl-row.shl-ink-light .shl-txt b, .shl-row.shl-ink-light .shl-n, .shl-row.shl-ink-light .shl-more, .shl-row.shl-ink-light .shl-tw { color: #fff !important; }
.shl-row.shl-ink-light .shl-path { color: rgba(255,255,255,.88) !important; }
.shl-row.shl-ink-dark .shl-txt b { color: #0b0608 !important; } .shl-row.shl-ink-dark .shl-n, .shl-row.shl-ink-dark .shl-more, .shl-row.shl-ink-dark .shl-tw { color: #3b2a2e !important; }
.shl-row.shl-ink-dark .shl-path { color: rgba(29,18,21,.82) !important; }
.vt-all.shl-ink-light { color: #fff !important; } .vt-all.shl-ink-dark { color: #0b0608 !important; }
.shl-row.shl-in .shl-tw { border-left-color: transparent; }
/* ---- inside a shelf: one short row (All N shelves · ··· · the shelf one step up · + Shelf inside), then the fics ---- */
.vt-path { display: flex !important; flex-wrap: nowrap !important; overflow-x: auto; gap: 8px; scrollbar-width: none; align-items: center; }
.vt-path::-webkit-scrollbar { display: none; }
.vt-path > * { flex: none; }
.vt-all { position: sticky; left: 0; z-index: 1; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 13px; border: 0; border-radius: 10px; background: var(--solid, var(--accent)); color: var(--solid-ink, #fff); font: 700 13.5px var(--ui); cursor: pointer; box-shadow: 8px 0 10px -6px var(--bg); }
.vt-mid { height: 36px; padding: 0 12px; border-radius: 10px; border: 1.5px dashed color-mix(in srgb, var(--ink) 28%, transparent); background: transparent; color: var(--ink-2); font: 700 15px var(--ui); letter-spacing: 2px; cursor: pointer; }
.vt-mid:hover { border-color: var(--accent); color: var(--accent); }
.vt-more { width: 32px; height: 32px; margin-left: 4px; color: var(--ink-2); align-self: center; }
html body .main.in-shelf .view-title .vt-path { margin: 8px 0 0; flex-basis: 100%; }
html body .main.in-shelf .view-title .vt-path .vt-sub { height: 36px; }
/* the All N shelves panel */
.shv-all { width: min(560px, 100%); max-height: 82vh; display: flex; flex-direction: column; gap: 10px; }
.shv-all-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.shv-all-head h3 { margin: 0; } .shv-all-head h3 span { font: 500 14px var(--ui); color: var(--ink-3); margin-left: 4px; }
.shv-all-q { flex: none; min-height: 44px; box-sizing: border-box; font: inherit; font-size: 15px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); }
.shv-all-list { overflow-y: auto; flex: 1; min-height: 0; }
.shv-all-new { border-style: dashed !important; color: var(--accent) !important; }
.shv-all-none { margin: 0; padding: 18px 14px; color: var(--ink-2); text-align: center; }

/* PDF Text view: the PDF's own pictures, between the paragraphs where they sit on the page */
.reader .book p.pdf-img { text-align: center; margin: 1.2em 0; text-indent: 0; }
.reader .book p.pdf-img img { max-width: 100%; height: auto; border-radius: 4px; }
/* inside a shelf, the row scrolls within the screen's width instead of pushing the title area past the right edge */
html body .main.in-shelf .view-title { min-width: 0; }
html body .main.in-shelf .view-title .vt-path { min-width: 0; max-width: 100%; }
/* the "+ New shelf" / "+ Shelf inside" buttons: the theme colour blended with the text colour, so it reads in every theme
   (on its own it was too pale in a few light themes) */
.shp-add .shp-name, .vt-sub-add, .shv-all-new { color: color-mix(in srgb, var(--accent) 40%, var(--ink)) !important; }
/* Tags in the AO3-style rows: the dotted line is drawn as an underline, not a bottom border. A bottom-only dotted border
   with rounded corners made some browsers (Safari on iPhone/iPad) draw faint dashed lines above and beside every tag. */
html body .card.blurb .chip.tagl { border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
  text-decoration: underline dotted currentColor; text-decoration-thickness: 1px; text-underline-offset: 3px; }
html body .card.blurb .chip.tagl:hover { text-decoration-style: solid; }
/* the Previous / Next chapter buttons at the end of a chapter (one chapter at a time) are drawn in the reader's own colours
   (Paper, Sepia or Night), not the app theme's: in dark themes the theme's pale button box held the reader's light text,
   so "← Previous" could hardly be seen */
html body .reader.one-chap .chap-nav .btn { background: transparent !important; background-image: none !important; color: var(--rink) !important;
  border: 1px solid color-mix(in srgb, var(--rink) 35%, transparent) !important; box-shadow: none !important; }
html body .reader.one-chap .chap-nav .btn.primary { background: var(--rink) !important; color: var(--rbg) !important; border-color: var(--rink) !important; }
html body .reader.one-chap .chap-nav .btn span, html body .reader.one-chap .chap-nav .btn small { color: inherit !important; }
html body .reader.one-chap .chap-nav .btn small { opacity: .85; }

/* Apply filters: floats at the bottom of the filters panel (computers) while picked filters are waiting, about 14px
   above the bottom of the screen (the negative bottom offsets the panel's own bottom padding, which sticky counts),
   wherever the panel is scrolled to. On phones and tablets the filters open as a sheet whose own bottom bar does this
   ("Apply filters"), so it is hidden there. */
html body .sb-apply { position: sticky; bottom: -26px; z-index: 5; display: flex; justify-content: center; margin: 16px 0 0; pointer-events: none; }
html body .sb-apply[hidden] { display: none; }
html body .sb-apply-btn { position: relative; pointer-events: auto; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 44px; padding: 10px 18px; border: 0; border-radius: 10px; cursor: pointer; font: inherit; font-size: 14.5px; font-weight: 600;
  color: #fff !important; background: var(--apply-bg, var(--accent)) !important; box-shadow: 0 6px 18px color-mix(in srgb, var(--apply-bg, var(--accent)) 35%, transparent), 0 1px 2px rgba(0,0,0,.12);
  animation: sbApplyIn .18s ease-out; transition: transform .12s, box-shadow .12s; }
html body .sb-apply-btn:hover { transform: translateY(-1px); box-shadow: 0 9px 22px color-mix(in srgb, var(--accent) 42%, transparent), 0 1px 2px rgba(0,0,0,.12); }
html body .sb-apply-btn:active { transform: translateY(0); }
html body .sb-apply-btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
html body .sb-apply-n { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 6px; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700;
  background: rgba(255,255,255,.22); color: #fff; }
@keyframes sbApplyIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { html body .sb-apply-btn { animation: none; transition: none; } }
@media (max-width: 860px) { html body .sb-apply { display: none !important; } }

/* the phone and tablet sheet's "Apply N changes" button: the same white text on a readable colour as the floating one */
html body #sidebar.apply-on #sbDone { color: #fff !important; background: var(--apply-bg, var(--accent)) !important; border-color: transparent !important; }
/* the filters panel's scrollbar is always there and easy to see, so it's clear there are more filters further down */
/* (the standard scrollbar-color is switched off here: Chrome and Safari ignore the styled scrollbar below while it is set) */
html body #sidebar, html body #sidebar .sb-body { scrollbar-width: auto; scrollbar-color: auto; }
html body #sidebar::-webkit-scrollbar, html body #sidebar .sb-body::-webkit-scrollbar { width: 10px; }
html body #sidebar::-webkit-scrollbar-track, html body #sidebar .sb-body::-webkit-scrollbar-track { background: color-mix(in srgb, var(--ink) 7%, transparent); border-radius: 10px; }
html body #sidebar::-webkit-scrollbar-thumb, html body #sidebar .sb-body::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--accent) 55%, transparent); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; min-height: 40px; }
html body #sidebar::-webkit-scrollbar-thumb:hover, html body #sidebar .sb-body::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--accent) 75%, transparent); background-clip: padding-box; }

/* a word box with something that isn't a number yet */
html body .wr-form input.bad { border-color: #d64545 !important; box-shadow: 0 0 0 2px rgba(214,69,69,.18); }

/* The chosen-filters row: ← Back and "Clear all" stay fixed at the start, and the chips scroll sideways in their own
   lane right after them (fading out at the right edge), so a chip never slides underneath Clear all. Every screen size. */
html body .toolbar .active-filters, html body .active-filters { flex-wrap: nowrap !important; overflow: hidden !important; align-items: center; -webkit-mask-image: none !important; mask-image: none !important; }
html body .active-filters > .back-chip, html body .active-filters > .clear-all { flex: none; position: static !important; box-shadow: none !important; white-space: nowrap; }
html body .active-filters .af-scroll { flex: 1 1 0; min-width: 0; display: flex; gap: 6px; align-items: center; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; padding: 2px 0;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); }
html body .active-filters .af-scroll::-webkit-scrollbar { display: none; }
html body .active-filters .af-scroll > * { flex: none; white-space: nowrap; }

/* Reading progress on phones and tablets: a thin line across the very top of the screen that fills up as you read
   (owner's ask, like the one on computers). It floats over the page, so the header and the text don't move, it stays
   when the header slides away while you scroll, and taps go straight through it. It sits below the notch / status
   bar in the Home Screen app. It used to sit at the bottom edge, where the browser's toolbar and the home bar hid it. */
@media (max-width: 1180px) {
  html body .reader-progress, html.reader-page body .reader-progress { position: fixed !important; top: env(safe-area-inset-top, 0px) !important; bottom: auto !important; left: 0; right: 0;
    height: 3px !important; padding: 0 !important; z-index: 60 !important; pointer-events: none;
    background: color-mix(in srgb, var(--rink, var(--ink)) 10%, transparent) !important; }
  html body .reader-progress > div { border-radius: 0 2px 2px 0; }
}

/* Smooth scrolling on phones and tablets (a reader said a photo theme "runs terribly"):
   1. No frosted-glass blur on touch screens. The top bar and the sticky toolbar blurred whatever scrolled under them,
      so the phone re-blurred the page (and in photo themes, a large photo) on every frame. The top bar is already
      solid on phones; the toolbar becomes nearly solid instead (it looks the same, a touch more opaque).
   2. The background layer (pattern or photo) gets its own GPU layer, so scrolling just moves the page over it
      instead of repainting it.
   3. Phones that report little memory (Android's deviceMemory ≤ 4 GB) skip the big photo in photo themes and keep the
      theme's colours and gradient (data-lite, set in app.js). */
@media (pointer: coarse) {
  html body .top, html body .toolbar { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  html body .toolbar { background: color-mix(in srgb, var(--bg) 97%, transparent) !important; }
  html body::before, html body::after { will-change: transform; transform: translateZ(0); backface-visibility: hidden; }
}
html[data-lite][data-theme="neoncity"] body::before, html[data-lite][data-theme="synthwave"] body::before,
html[data-lite][data-theme="auroraviolet"] body::before, html[data-lite][data-theme="auroragreen"] body::before,
html[data-lite][data-theme="aurorarosa"] body::before, html[data-lite][data-theme="blade"] body::before { background-image: none !important; }

/* Phones: the search / filter / sort bar ran from 12px in from each side, so its background stopped right at the edges
   of the search box and the sort button and looked cut off (owner's report). It now runs edge to edge across the phone,
   with the same 12px space inside, so the controls stay exactly where they were. */
@media (max-width: 640px) {
  html body .main > .toolbar { margin-left: -12px !important; margin-right: -12px !important; padding-left: 12px !important; padding-right: 12px !important; }
}

/* The pop-up flow (AO3 is back → Coming soon → Ko-fi → X). Built on the small note style, so it follows every theme.
   It scrolls inside itself when the list is long, so the page behind never moves (375px phones included). */
html .dlg-wrap > .dlg.wn-flow { max-height: min(86vh, 680px); max-height: min(86dvh, 680px); overflow-y: auto; overscroll-behavior: contain; }
.wn-flow .fl-dots { display: flex; justify-content: center; gap: 6px; margin: 10px 0 2px; }
.wn-flow .fl-dots i { width: 7px; height: 7px; border-radius: 50%; background: color-mix(in srgb, var(--ink) 22%, transparent); }
.wn-flow .fl-dots i.on { background: var(--accent); width: 18px; border-radius: 4px; }
.wn-flow .fl-sub { margin: 16px 4px 0; text-align: center; font-size: 1.02em; color: var(--ink); }
.wn-flow .fl-list { margin: 10px 4px 0; }
.wn-flow .fl-list li { margin: 6px 0; line-height: 1.45; }
.wn-flow .wn-btns { flex-wrap: wrap; }
/* Coming soon: a shimmer across the title and the items fading in one by one. Only transforms and opacity (cheap on
   phones), no blur or images, and none of it with reduced motion. */
.wn-flow .fl-shine { background: linear-gradient(100deg, var(--ink) 30%, var(--accent) 45%, color-mix(in srgb, var(--accent) 40%, #fff) 50%, var(--accent) 55%, var(--ink) 70%);
  background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: flShine 3.2s ease-in-out infinite; }
@keyframes flShine { 0% { background-position: 100% 0; } 100% { background-position: -50% 0; } }
/* the big one (accounts) as its own card, then the rest as a light list with accent dots (no emoji icons) */
.wn-flow .fl-top { display: grid; gap: 2px; margin: 2px 0 12px; padding: 14px 16px; border-radius: 14px; text-align: left;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, transparent), color-mix(in srgb, var(--accent) 6%, transparent));
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); color: var(--ink);
  opacity: 0; transform: translateY(6px); animation: flIn .35s ease-out forwards; animation-delay: 150ms; }
.wn-flow .fl-top b { font-size: 1.08em; }
.wn-flow .fl-top span:last-child { color: var(--ink-2); }
.wn-flow .fl-tag { justify-self: start; margin-bottom: 4px; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; background: var(--accent); color: var(--accent-ink, #fff); }
.wn-flow .fl-soon { list-style: none; margin: 0; padding: 0 2px; text-align: left; }
.wn-flow .fl-soon li { position: relative; padding: 7px 0 7px 18px; line-height: 1.4; color: var(--ink);
  border-top: 1px solid color-mix(in srgb, var(--ink) 8%, transparent);
  opacity: 0; transform: translateY(6px); animation: flIn .35s ease-out forwards; animation-delay: calc(var(--i) * 70ms + 150ms); }
.wn-flow .fl-soon li:first-child { border-top: 0; }
.wn-flow .fl-soon li::before { content: ""; position: absolute; left: 3px; top: calc(7px + .55em); width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
@keyframes flIn { to { opacity: 1; transform: none; } }
/* step 1: the six "still yours" points a bit tighter, so more of them fit before scrolling */
.wn-flow .fl-list { font-size: .95em; margin-bottom: 18px; }
.wn-flow .fl-list li { margin: 4px 0; }
/* a soft fade above the buttons, so a long list reads as "there's more, scroll" */
.wn-flow > .wn-btns { position: sticky; bottom: 0; z-index: 2; background: var(--panel); box-shadow: 0 -18px 16px -4px var(--panel); }
/* bigger, easier-to-see step dots */
.wn-flow .fl-dots { gap: 7px; margin: 12px 0 4px; }
.wn-flow .fl-dots i { width: 8px; height: 8px; transition: width .2s; }
.wn-flow .fl-dots i.on { width: 22px; }
/* Ko-fi: a coffee in a soft accent circle */
.wn-flow .fl-badge { width: 64px; height: 64px; margin: 2px auto 10px; display: grid; place-items: center; font-size: 30px; border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 18%, transparent); box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 8%, transparent); }
.wn-flow.wn-xfollow .xf-pfp { margin: 2px auto 8px; }
/* Next: the next step slides in over the same backdrop (no blink between steps) */
html .dlg-wrap.wn-wrap > .dlg.wn.wn-flow.fl-cont:not(.wn-themes) { animation: flStep .24s ease-out; }
html .dlg-wrap:has(> .fl-cont) { animation: none !important; }
@keyframes flStep { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
/* the quick poll: it should read clearly as a question (owner: bigger, a list of answers, a bit jazzy).
   A badge, a big question, then one answer per row with a circle to tick, like a real poll. */
.wn-flow .fl-poll { position: relative; margin: 18px 0 6px; padding: 18px 14px 14px; border-radius: 16px; text-align: center;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 16%, var(--panel)), color-mix(in srgb, var(--accent) 5%, var(--panel)));
  border: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 18%, transparent); }
.wn-flow .fl-poll-tag { display: inline-block; margin-bottom: 8px; padding: 4px 12px; border-radius: 99px; font-size: 12px; font-weight: 800;
  letter-spacing: .05em; text-transform: uppercase; background: var(--accent); color: var(--accent-ink, #fff); animation: flPop 2.4s ease-in-out infinite; }
@keyframes flPop { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.wn-flow .fl-poll-q { margin: 0 0 4px; font-size: 1.15em; font-weight: 700; line-height: 1.35; color: var(--ink); }
.wn-flow .fl-poll-hint { margin: 0 0 12px; font-size: 13px; color: var(--ink-2); }
.wn-flow .fl-poll-opts { display: grid; gap: 8px; }
.wn-flow .fl-poll-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 12px; text-align: left;
  border: 1.5px solid color-mix(in srgb, var(--accent) 35%, transparent); background: var(--panel); color: var(--ink);
  font: inherit; font-size: 1em; font-weight: 600; line-height: 1.3; cursor: pointer; transition: transform .12s, background .15s, border-color .15s; }
.wn-flow .fl-poll-dot { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--accent) 60%, transparent);
  transition: background .15s, box-shadow .15s; }
.wn-flow .fl-poll-btn:hover { background: color-mix(in srgb, var(--accent) 12%, var(--panel)); border-color: var(--accent); }
.wn-flow .fl-poll-btn:hover .fl-poll-dot { box-shadow: inset 0 0 0 4px var(--panel); background: color-mix(in srgb, var(--accent) 50%, transparent); }
.wn-flow .fl-poll-btn:active { transform: scale(.98); }
.wn-flow .fl-poll-btn:active .fl-poll-dot { background: var(--accent); box-shadow: inset 0 0 0 4px var(--panel); }
.wn-flow .fl-poll-done { margin: 8px 0 2px; font-size: 1.05em; font-weight: 700; color: var(--accent); animation: flIn .3s ease-out both; }
/* the main page's section headings (Coming soon, Already here) */
.wn-flow .fl-sec { margin: 6px 0 10px; text-align: center; font-size: 1.15em; color: var(--ink); }
.wn-flow .fl-poll + .fl-sec { margin-top: 18px; }
/* like What's new: until they've scrolled to the end, only the "Scroll down" hint shows; then Next and Back appear */
.wn-flow:not(.fl-read) .wn-btns > .btn, .wn-flow:not(.fl-read) .wn-btns > .linkbtn { display: none; }
.wn-flow .fl-scroll { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 8px 4px; font: 600 14px var(--ui); color: var(--accent); cursor: pointer; }
.wn-flow.fl-read .fl-scroll { display: none; }
.wn-flow.fl-read .wn-btns > .btn { animation: popFadeIn .25s ease-out; }
@media (prefers-reduced-motion: reduce) {
  .wn-flow .fl-shine { animation: none; background: none; color: var(--accent); }
  .wn-flow .fl-poll-tag, .wn-flow .fl-poll-done, .wn-flow .fl-soon li, .wn-flow .fl-top, html .dlg-wrap.wn-wrap > .dlg.wn.wn-flow.fl-cont:not(.wn-themes) { animation: none; opacity: 1; transform: none; }
}

/* Every info pop-up (welcome, What's new, the pop-up flow, Ko-fi, X, Home Screen and the like: anything opened through
   noteDialog) sits in the middle of the screen at every size, as a card with space on every side, never a sheet from
   the bottom (owner, 15 Nov 2026). The theme picker nudge stays a sheet: it's a picker, not information. */
@media (max-width: 860px) {
  html .dlg-wrap.wn-wrap:not(:has(> .wn-themes)) { place-items: center; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
  html .dlg-wrap.wn-wrap > .dlg.wn:not(.wn-themes) { width: 100%; max-width: 440px; max-height: min(86vh, 720px); max-height: min(86dvh, 720px);
    border-radius: 18px !important; box-shadow: 0 24px 60px rgba(0,0,0,.35); animation: popFadeIn .2s ease-out; }
  html .dlg-wrap.wn-wrap > .dlg.wn.wn-small { max-width: 400px; }
  html .dlg-wrap.wn-wrap > .dlg.wn:not(.wn-themes) > .wn-btns { padding-bottom: 14px !important; }
}

/* The pop-up flow's main page in two parts (owner, 15 Nov 2026): on tablets and laptops it's a big card with the
   reading on the left (it scrolls on its own) and the question on the right (always in view). Below 760px wide it's
   the usual single column that scrolls as a whole, with the question at the end just above Next. */
.wn-flow .fl-right .fl-poll { margin-top: 18px; }
@media (min-width: 760px) {
  html .dlg-wrap.wn-wrap > .dlg.wn.wn-flow.fl-wide:not(.wn-themes), html .dlg-wrap > .dlg.wn.wn-flow.fl-wide {
    width: min(900px, calc(100vw - 40px)); max-width: none; height: min(86vh, 660px); height: min(86dvh, 660px); max-height: none;
    overflow: hidden; display: flex; flex-direction: column; border-radius: 20px !important; }
  .wn-flow.fl-wide > .wn-hero { flex: none; }
  .wn-flow.fl-wide .fl-split { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 22px; }
  .wn-flow.fl-wide .fl-left { overflow-y: auto; overscroll-behavior: contain; padding: 4px 10px 8px 2px; }
  .wn-flow.fl-wide .fl-right { display: flex; flex-direction: column; justify-content: center; padding: 4px 2px 12px; }
  .wn-flow.fl-wide .fl-right .fl-poll { margin: 0; }
  .wn-flow.fl-wide > .wn-btns { flex: none; position: static; box-shadow: 0 -10px 14px -8px color-mix(in srgb, var(--ink) 25%, transparent); }
}
/* phones: the question comes first, so a quick scroll down to Next can't skip past it */
@media (max-width: 759.98px) {
  .wn-flow.fl-wide .fl-split { display: flex; flex-direction: column; }
  .wn-flow.fl-wide .fl-right { order: -1; }
  .wn-flow.fl-wide .fl-right .fl-poll { margin: 2px 0 14px; }
}
/* tapping Next before answering: the question shakes once and its hint turns to the theme colour */
.wn-flow .fl-poll.fl-nudge { animation: flNudge .5s ease-in-out; }
.wn-flow .fl-poll.fl-nudge .fl-poll-hint { color: var(--accent); font-weight: 700; }
@keyframes flNudge { 0%, 100% { transform: none; } 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
@media (prefers-reduced-motion: reduce) { .wn-flow .fl-poll.fl-nudge { animation: none; } }

/* ---------------- moving to ficshelf.org (move.js): a notification-style banner that slides down from the top on the old
   address (over the library and the reader), the "FicShelf has moved" page, and the receiving page on ficshelf.org.
   Uses each theme's own colours, so it fits all of them. */
html body .mv-banner { position: fixed; left: 0; right: 0; top: 0; z-index: 2147483000; display: flex; flex-direction: column; align-items: center;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 12px 0; pointer-events: none;
  transform: translateY(-130%); transition: transform .45s cubic-bezier(.2, .9, .25, 1.1); }
html body .mv-banner.in { transform: none; }
html body .mv-card { pointer-events: auto; display: flex; align-items: center; gap: 12px; width: 100%; max-width: 640px;
  background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 18px; padding: 12px 12px 12px 14px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, .22), 0 2px 6px rgba(0, 0, 0, .10); font-family: var(--ui); position: relative; }
html body .mv-ico { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--grad); color: var(--accent-ink); }
html body .mv-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
html body .mv-txt b { font-size: 14.5px; line-height: 1.25; }
html body .mv-sub { font-size: 12.5px; line-height: 1.35; color: var(--ink-2); }
html body .mv-bar { display: block; height: 6px; border-radius: 99px; background: var(--chip); overflow: hidden; margin-top: 6px; }
html body .mv-bar[hidden] { display: none; }
html body .mv-bar i { display: block; height: 100%; width: 3%; background: var(--grad); border-radius: inherit; transition: width .3s; }
html body .mv-go, html body .mv-open { flex: none; border: 0; border-radius: 999px; background: var(--grad); color: var(--accent-ink); font: 700 14px/1 var(--ui);
  padding: 11px 16px; min-height: 42px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; }
html body .mv-go:disabled { opacity: .7; cursor: default; }
html body .mv-banner[data-state="fail"] .mv-sub { color: var(--r-e); }
/* only after a move went wrong: keep using the old address for this visit (there's no close button, everyone has to move) */
html body .mv-stay { pointer-events: auto; margin-top: 6px; border: 0; border-radius: 999px; padding: 6px 12px; background: var(--panel);
  color: var(--ink-2); font: 600 12.5px/1.2 var(--ui); text-decoration: underline; cursor: pointer; box-shadow: 0 4px 14px rgba(0, 0, 0, .15); }
html body .mv-stay[hidden] { display: none; }
@media (max-width: 640px) {
  html body .mv-card { flex-wrap: wrap; gap: 10px 12px; padding: 12px; }
  html body .mv-txt { flex-basis: calc(100% - 56px); }
  html body .mv-go { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { html body .mv-banner { transition: none; } }

/* "FicShelf has moved" (old address after the move) and the receiving page (ficshelf.org/move.html) */
html body .mv-page { position: fixed; inset: 0; z-index: 2147483001; background: var(--bg); color: var(--ink); display: grid; place-items: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px)); overflow: auto; font-family: var(--ui); }
html body .mv-pcard { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 28px 24px;
  box-shadow: var(--shadow); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
html body .mv-brand { font: 700 26px/1 var(--serif); color: var(--ink); }
html body .mv-brand span { color: var(--accent); }
html body .mv-pcard h1 { font: 700 21px/1.25 var(--serif); margin: 4px 0 0; }
html body .mv-pcard p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--ink-2); max-width: 34ch; }
/* the new address on its own line: soft pill, wraps anywhere so a long test address can't push the card wide */
html body .mv-addr { display: inline-block; max-width: 100%; padding: 6px 14px; border-radius: 999px; background: var(--chip); color: var(--ink);
  font: 600 13.5px/1.35 var(--ui); overflow-wrap: anywhere; margin-bottom: 4px; }
html body .mv-pcard .mv-open { margin-top: 8px; padding: 13px 22px; font-size: 15px; }
html body .mv-pcard .mv-bar { width: 100%; height: 8px; }
html body .mv-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
html body .mv-open.ghost { background: var(--chip); color: var(--ink); }
html body .mv-small { font-size: 12.5px !important; }
html body .mv-again { border: 0; background: none; color: var(--accent); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; padding: 0; }
html.mv-moved, html.mv-moved body { overflow: hidden; }

/* ---------------- the footer always sits at the bottom of the screen (owner, 15 Nov): with few or no fics it rests at the
   bottom instead of floating mid-page; with a long list you scroll down to it as before. The library column is a
   top-to-bottom stack that fills the screen height, and the footer takes up whatever room is left above it. */
html body .main { display: flex; flex-direction: column; min-height: calc(100vh - var(--top-h, 57px)); min-height: calc(100dvh - var(--top-h, 57px)); }
html body .main > .foot { margin-top: auto; }
/* "Nothing here yet" sits in the middle of the free space, not hugging the top (tablets especially) */
html body .main > #empty:not([hidden]) { margin-top: auto !important; margin-bottom: auto !important; padding-top: 24px; padding-bottom: 24px; }
/* Add fics: a neat button on tablets too (it stretched into a full-width bar up to 860px) */
@media (max-width: 860px) { html body .g-cta { display: inline-flex; width: auto; align-self: center; min-height: 44px; padding: 10px 24px; } }
/* iPhone/iPad Safari: "Added FicShelf to your Home Screen?" on its own line, the explanation under it, in a soft box */
html body .ios-home-note { display: flex; flex-direction: column; gap: 4px; max-width: 420px; margin: 18px auto 0 !important; padding: 12px 16px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--ink-2); font-size: 13.5px; line-height: 1.5; text-align: center; }
html body .ios-home-note b { color: var(--ink); font-size: 14px; }
/* phones: the bottom navigation bar has its own room under the page, so the column is that much shorter (else the footer
   slid under the bar) */
@media (max-width: 640px) {
  html body .main { min-height: calc(100vh - var(--top-h, 57px) - 64px - env(safe-area-inset-bottom, 0px));
    min-height: calc(100dvh - var(--top-h, 57px) - 64px - env(safe-area-inset-bottom, 0px)); }
}

/* ---------------- Filters on tablets (641-860px, iPad portrait): a panel that slides in from the right, with the library
   still visible (dimmed) beside it, like iPad apps do, instead of the phone's full-width bottom sheet (owner, 15 Nov).
   Wider tablets in landscape (861px+) keep the filters always open on the right, like laptops. Phones keep the sheet.
   How filters work doesn't change: the draft, "Apply N changes", ✕ and tapping outside all behave the same. */
@media (min-width: 641px) and (max-width: 860px) {
  html body .sidebar { left: auto !important; right: 0 !important; top: 0 !important; bottom: 0 !important;
    width: min(400px, 86vw) !important; height: 100vh !important; height: 100dvh !important;
    border-radius: 22px 0 0 22px !important; transform: translateX(105%) !important;
    padding-top: env(safe-area-inset-top, 0px) !important; padding-right: env(safe-area-inset-right, 0px) !important; }
  html body .sidebar.open { transform: none !important; }
  html body .sb-grab { display: none !important; }
  html body .sb-head { padding: 18px 18px 12px !important; }
}

/* ---------------- tablets (641-860px, iPad portrait): search sits in the filters row like on phones, not cramped beside
   the logo (owner, 15 Nov). The fic count and Select move up beside All fics / My library (placeForPhone in app.js),
   so the row is just: search, Filters, sort, grid/list. The top bar is logo + buttons. */
@media (min-width: 641px) and (max-width: 860px) {
  html body .top { grid-template-areas: "brand actions" !important; row-gap: 0 !important; }
  html body .toolbar { display: block !important; padding: 8px 0 !important; }
  html body .toolbar .tools { display: flex !important; align-items: center; gap: 8px !important; width: 100% !important; flex-wrap: nowrap !important; margin: 0 !important; }
  html body .toolbar .search { flex: 1 1 auto !important; min-width: 0; max-width: none !important; margin: 0 !important; }
  html body .toolbar .search input { height: 38px !important; font-size: 16px !important; padding: 0 12px 0 34px !important; border-radius: 10px !important;
    background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 11px center !important; }
  html body .toolbar .search-btn { display: none !important; }
  html body .toolbar .btn, html body .toolbar select { height: 38px !important; flex: none; }
  html body .toolbar select { max-width: 160px !important; text-overflow: ellipsis; }
  html body .tabs-right { margin-left: auto; display: inline-flex; align-items: center; gap: 10px; flex: none; }
  html body .tabs-right .count { font: 600 13px var(--ui) !important; color: var(--ink-3) !important; margin: 0 !important; }
  html body .tabs-right .sel-btn { height: 30px !important; padding: 0 12px !important; font-size: 13px !important; border-radius: 8px !important; }
  /* "All fics", the count and Select on one line, as on phones */
  html body .tabs-row { display: flex !important; align-items: center !important; gap: 8px; min-height: 42px; margin: 4px 0 8px; }
  html body .tabs-row .scope-tabs { border-bottom: 0 !important; margin: 0 !important; min-width: 0; display: flex !important; }
  html body .tabs-row .scope-tabs:has(.view-title) { flex: 0 1 auto !important; }
  html body .tabs-row .view-title { padding: 4px 0 !important; }
  html body .tabs-row > .count { order: 0 !important; flex: none; align-self: center; margin: 0 auto 0 10px !important; line-height: 1.2; white-space: nowrap;
    font: 500 13.5px var(--ui) !important; color: var(--ink-3) !important; }
}
/* tablets: the filters row stretches edge to edge (so its background fills the width when it sticks to the top), but its
   contents keep a margin, so the search box doesn't touch the side menu and the grid/list buttons don't touch the edge */
@media (min-width: 641px) and (max-width: 860px) {
  html body .toolbar { padding-left: 16px !important; padding-right: 16px !important; }
  html body .main { padding-left: 16px !important; padding-right: 16px !important; }
}
/* phones and tablets: Select is an action, not a shelf, so it looks different from the Favorites / To read buttons under
   it: an outlined pill in the theme colour with a tick */
@media (max-width: 860px) {
  html body .tabs-right .sel-btn { background: transparent !important; border: 1.5px solid var(--accent) !important; color: var(--accent) !important;
    font-weight: 700 !important; border-radius: 999px !important; padding: 0 12px !important; box-shadow: none !important; display: inline-flex; align-items: center; gap: 5px; }
  html body .tabs-right .sel-btn::before { content: "✓"; font-size: 12px; line-height: 1; }
}

/* ---------------- "When you read it": the two date boxes side by side under their own small heading, the same size and
   lined up, instead of squeezed next to a lone "Read" label (owner, 15 Nov). All screen sizes. */
html body .mn-dates { display: grid !important; grid-template-columns: 1fr 1fr; gap: 6px 12px; align-items: start; margin: 12px 0 !important; }
html body .mn-dates .mn-lbl { grid-column: 1 / -1; min-width: 0; font-weight: 600; color: var(--ink-2); }
html body .mn-dates .mn-d { display: grid; gap: 4px; min-width: 0; }
html body .mn-dates .mn-d small { font-size: 12px; color: var(--ink-3); }
html body .mn-dates .mn-d input, html body .mn-dates #mnDate, html body .mn-dates #mnFrom { width: 100% !important; min-width: 0; height: 40px !important; margin: 0 !important; box-sizing: border-box; padding: 0 10px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--panel); color: var(--ink); font: 14px var(--ui); }

/* ---------------- iPad portrait (641-860px): things that were stretched phone layouts (owner, 15 Nov) */
@media (min-width: 641px) and (max-width: 860px) {
  /* reader: one row: ← Library · the fic's name (bigger) · search · small chapter menu · Aa */
  html body #reader .reader-bar { display: flex !important; flex-wrap: nowrap !important; align-items: center; gap: 10px !important;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 16px 8px !important; min-height: 56px !important; }
  html body #readerBack { flex: none; }
  html body #readerTitle { flex: 1 1 auto; min-width: 0; font-size: 18px !important; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  html body #findToggle { order: 2; flex: none; }
  html body #reader .reader-tools { display: flex !important; flex: none; align-items: center; gap: 8px !important; order: 3; margin: 0 !important; width: auto !important; }
  html body #chapterSel { width: auto !important; max-width: 170px !important; height: 36px !important; font-size: 14px !important;
    padding: 0 28px 0 12px !important; border-radius: 10px !important; grid-column: auto !important; grid-row: auto !important; }
  html body #pdfModeBtn { height: 36px !important; padding: 0 12px !important; font-size: 13.5px !important; grid-column: auto !important; grid-row: auto !important; }
  html body #aaBtn { order: 4; flex: none; }
  /* a fic's details: a panel from the right with the library dimmed beside it, not the whole screen */
  html body .drawer { width: min(500px, 88vw) !important; border-left: 1px solid var(--line) !important; border-radius: 22px 0 0 22px; }
  /* Add fics: a small centred card, not a full-width sheet from the bottom */
  html body .modal { align-items: center !important; justify-content: center; padding: 24px !important; }
  html body .modal-card { width: min(560px, 100%) !important; max-height: 85vh; max-height: 85dvh; border-radius: 20px !important; margin: auto !important; }
}
@media (min-width: 641px) and (max-width: 860px) {
  /* reading settings (Aa): a panel on the right under the reader bar, so the story stays visible and you see each change,
     instead of a sheet covering the whole screen */
  html body #aaPop.aa-pop { position: fixed !important; top: calc(64px + env(safe-area-inset-top, 0px)) !important; bottom: auto !important;
    left: auto !important; right: 12px !important; width: min(400px, calc(100vw - 24px)) !important;
    max-height: calc(100vh - 80px); max-height: calc(100dvh - 80px - env(safe-area-inset-top, 0px)); overflow-y: auto;
    border-radius: 18px !important; border: 1px solid var(--line); box-shadow: 0 16px 40px rgba(0, 0, 0, .22); }
}
/* the move banner's small extra choices under the card (move with a file instead / keep using it here) */
html body .mv-more { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; pointer-events: none; }
html body .mv-more .mv-stay { pointer-events: auto; }
html body .mv-filelink { margin-top: 14px !important; font-size: 13.5px; }
html body .mv-filelink a { color: var(--accent); font-weight: 700; }
/* move banner and move page: short pointers instead of a paragraph, with room to breathe (owner, 15 Nov) */
html body .mv-list { margin: 2px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; text-align: left; }
html body .mv-list li { position: relative; padding-left: 16px; line-height: 1.45; }
html body .mv-list li::before { content: ""; position: absolute; left: 2px; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
html body .mv-card { padding: 16px 16px 16px 18px; gap: 14px; }
html body .mv-txt { gap: 6px; }
html body .mv-txt b { font-size: 15.5px; }
html body .mv-sub { font-size: 13.5px; }
@media (max-width: 640px) { html body .mv-card { gap: 12px 14px; padding: 16px; } }
/* the move page: the list sits in a soft box, left-aligned and easy to scan */
html body .mv-pcard .mv-sub:has(.mv-list) { align-self: stretch; padding: 12px 14px; border-radius: 14px; background: var(--panel-2, var(--chip)); }
html body .mv-pcard .mv-list { gap: 8px; font-size: 14.5px; color: var(--ink-2); }
/* the move banner's × (hide for this visit; it's back next time until they move) */
html body .mv-x { position: absolute; top: -9px; right: -7px; width: 28px; height: 28px; padding: 0; border-radius: 50%; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink-2); font: 17px/1 var(--ui); cursor: pointer; display: grid; place-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
html body .mv-x[hidden] { display: none; }
/* "Welcome to the new FicShelf!": the new address in a soft glowing bubble with little twinkling sparkles */
html body .mw-addr { display: flex; justify-content: center; margin: 4px 0 14px; }
html body .mw-bubble { position: relative; display: inline-flex; align-items: center; padding: 9px 20px; border-radius: 999px;
  font: 700 17px/1.2 var(--ui); letter-spacing: .01em; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--panel)); border: 1.5px solid color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 8%, transparent), 0 6px 20px color-mix(in srgb, var(--accent) 22%, transparent); }
html body .mw-sp { position: absolute; font-style: normal; color: var(--accent); pointer-events: none; animation: mwTwinkle 2.2s ease-in-out infinite; }
html body .mw-sp.s1 { top: -10px; left: -6px; font-size: 14px; }
html body .mw-sp.s2 { top: -12px; right: -4px; font-size: 12px; animation-delay: .7s; }
html body .mw-sp.s3 { bottom: -10px; right: 18px; font-size: 10px; animation-delay: 1.4s; }
@keyframes mwTwinkle { 0%, 100% { opacity: .25; transform: scale(.7) rotate(0deg); } 50% { opacity: 1; transform: scale(1.15) rotate(20deg); } }
@media (prefers-reduced-motion: reduce) { html body .mw-sp { animation: none; opacity: .8; } }
html body .wn-moved .kp-lead { text-align: center; margin: 4px 0; }
/* "Continue here for now" under Open the new FicShelf: a quiet second choice, clearly a button */
html body .mv-here { border: 1.5px solid var(--line); background: transparent; color: var(--ink-2); font: 600 14px/1 var(--ui);
  padding: 11px 20px; border-radius: 999px; cursor: pointer; }
html body .mv-here:hover { border-color: var(--accent); color: var(--accent); }
/* Sofia Solstice: the top-bar buttons get a maroon-and-gold version of the theme's raised look, instead of the grey
   bevel meant for the page (it clashed with the maroon bar, owner 16 Nov) */
html[data-theme="sofia"] .top .btn:not(.primary), html[data-theme="sofia"] .top .theme-btn {
  background: linear-gradient(180deg, #86202f 0%, #5c0c18 100%) !important; color: #ffe8b4 !important;
  border: 1px solid color-mix(in srgb, #ffe8b4 38%, transparent) !important;
  box-shadow: inset 0 1px 0 rgba(255, 232, 180, .22), inset 0 -2px 0 rgba(0, 0, 0, .25), 0 1px 3px rgba(0, 0, 0, .45) !important; }
html[data-theme="sofia"] .top .btn:not(.primary):hover, html[data-theme="sofia"] .top .theme-btn:hover { background: linear-gradient(180deg, #962536 0%, #6b0f1d 100%) !important; }
html[data-theme="sofia"] .top .btn svg, html[data-theme="sofia"] .top .btn .ico { color: #ffe8b4 !important; }
html[data-theme="sofia"] .top .theme-btn .sw { box-shadow: 0 0 0 2px #ffe8b4 !important; border-color: transparent !important; }
