/* Wakil Books — a terminal window for your reading life.
   Tokyo Night after dark, Tokyo Day in the light. */

@font-face { font-family: "Newsreader"; font-weight: 400; font-style: normal; font-display: swap; src: url(fonts/newsreader-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Newsreader"; font-weight: 600; font-style: normal; font-display: swap; src: url(fonts/newsreader-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Newsreader"; font-weight: 400; font-style: italic; font-display: swap; src: url(fonts/newsreader-latin-400-italic.woff2) format("woff2"); }
@font-face { font-family: "Newsreader"; font-weight: 600; font-style: italic; font-display: swap; src: url(fonts/newsreader-latin-600-italic.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url(fonts/jetbrains-mono-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-display: swap; src: url(fonts/jetbrains-mono-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Amiri"; font-weight: 400; font-display: swap; src: url(fonts/amiri-arabic-400-normal.woff2) format("woff2"); }

:root {
  /* Tokyo Day */
  --bg: #d5d6db; --win: #e1e2e7; --bar: #d0d1d7; --field: #e9e9ed;
  --text: #3760bf; --strong: #343b58; --muted: #6172b0; --faint: #8990b3; --line: #c4c8da;
  --blue: #2e7de9; --purple: #9854f1; --green: #587539; --yellow: #8c6c3e;
  --red: #f52a65; --cyan: #007197; --orange: #b15c00;
  --shadow: 0 30px 70px -34px #3760bf55;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --serif: "Newsreader", Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16161e; --win: #1a1b26; --bar: #13131a; --field: #1f2335;
    --text: #c0caf5; --strong: #c0caf5; --muted: #7982a9; --faint: #4f5679; --line: #262a3d;
    --blue: #7aa2f7; --purple: #bb9af7; --green: #9ece6a; --yellow: #e0af68;
    --red: #f7768e; --cyan: #7dcfff; --orange: #ff9e64;
    --shadow: 0 30px 70px -30px #000c; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #16161e; --win: #1a1b26; --bar: #13131a; --field: #1f2335;
  --text: #c0caf5; --strong: #c0caf5; --muted: #7982a9; --faint: #4f5679; --line: #262a3d;
  --blue: #7aa2f7; --purple: #bb9af7; --green: #9ece6a; --yellow: #e0af68;
  --red: #f7768e; --cyan: #7dcfff; --orange: #ff9e64;
  --shadow: 0 30px 70px -30px #000c; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 14.5px/1.65 var(--mono); padding: 36px 20px; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
img { max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.inline { display: inline; margin: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.serif { font-family: var(--serif); }

/* ---------------------------------------------------------------- window */
.win { max-width: 1060px; margin: 0 auto; background: var(--win); border: 1px solid var(--line);
  border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); }
.titlebar { display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  background: var(--bar); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
.dots { display: flex; gap: 8px; width: 70px; }
.dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--red); }
.dots i:nth-child(2) { background: var(--yellow); }
.dots i:nth-child(3) { background: var(--green); }
.titlebar .title { flex: 1; text-align: center; color: var(--muted); }
.titlebar .title:hover { text-decoration: none; color: var(--text); }
.titlebar .tools { width: 70px; display: flex; justify-content: flex-end; }
.theme-btn { background: none; border: 0; padding: 2px; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.theme-btn:hover { color: var(--text); }
.theme-btn .moon { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .sun { display: none; }
  :root:not([data-theme="light"]) .theme-btn .moon { display: block; }
}

.tabs { display: flex; gap: 2px; padding: 0 14px; background: var(--bar);
  border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 8px 14px; color: var(--muted); font-size: 12.5px; border-bottom: 2px solid transparent;
  white-space: nowrap; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--strong); border-color: var(--purple); background: var(--win); }
.tabs .add { margin-left: auto; color: var(--green); }

.body { padding: 26px 30px 34px; }

.foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; padding: 14px 30px;
  border-top: 1px solid var(--line); background: var(--bar); color: var(--muted); font-size: 12.5px; }
.foot a { color: var(--strong); }
.foot-credit { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.foot-sep { opacity: .5; }
.foot [lang="ar"] { font: 1.15rem "Amiri", serif; color: var(--yellow); }
.foot .right { margin-left: auto; }

/* ---------------------------------------------------------------- headers */
.h { display: flex; align-items: center; gap: 12px; margin: 38px 0 16px; font-size: 12.5px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; color: var(--strong); }
.h:first-child { margin-top: 0; }
.h::before { content: ""; flex: 0 0 8px; height: 8px; border-radius: 2px; background: var(--c, var(--green));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c, var(--green)) 22%, transparent); }
.h::after { content: ""; flex: 1; height: 1px; background: var(--line); order: 2; min-width: 16px; }
.h em, .h .meta { order: 3; font-style: normal; text-transform: none; letter-spacing: 0; color: var(--muted); font-weight: 400; }
.h a, .h .act { order: 4; text-transform: none; letter-spacing: 0; font-weight: 400; }
.c-green { --c: var(--green); } .c-blue { --c: var(--blue); } .c-purple { --c: var(--purple); }
.c-yellow { --c: var(--yellow); } .c-orange { --c: var(--orange); } .c-cyan { --c: var(--cyan); } .c-red { --c: var(--red); }

.page-title { font: 600 2rem/1.1 var(--serif); color: var(--strong); margin-bottom: 6px; letter-spacing: -.01em; }
.page-sub { color: var(--muted); margin-bottom: 26px; }
.empty { color: var(--faint); }
.empty a { color: var(--blue); }

/* ---------------------------------------------------------------- controls */
.btn { display: inline-flex; align-items: center; gap: 6px; font: 500 12.5px/1 var(--mono);
  padding: 9px 14px; border-radius: 4px; border: 1px solid var(--line); background: var(--field);
  color: var(--text); cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--muted); text-decoration: none; }
.btn-go { background: var(--green); border-color: var(--green); color: var(--win); }
.btn-go:hover { border-color: var(--green); filter: brightness(1.08); }
.btn-small { padding: 6px 10px; font-size: 12px; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--blue); cursor: pointer; }
.linkish:hover { text-decoration: underline; }
.danger { color: var(--red); }
.icon-btn { width: 30px; height: 30px; display: inline-grid; place-items: center; background: var(--field);
  border: 1px solid var(--line); border-radius: 4px; color: var(--muted); cursor: pointer; font: 13px var(--mono); }
.icon-btn:hover:not(:disabled) { color: var(--text); border-color: var(--muted); }
.icon-btn:disabled { opacity: .3; cursor: default; }

input, select, textarea { font: 13.5px/1.5 var(--mono); color: var(--strong); background: var(--field);
  border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px; width: 100%; min-width: 0; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--purple);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--purple) 20%, transparent); }
.btn:focus-visible, .icon-btn:focus-visible, a:focus-visible, .linkish:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }
textarea { resize: vertical; }
label, .label { display: block; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.hint { text-transform: none; letter-spacing: 0; color: var(--faint); }
.row { display: flex; gap: 8px; align-items: center; }
.check { display: flex; gap: 8px; align-items: center; text-transform: none; letter-spacing: 0; font-size: 13px; margin: 0; }
.check input { width: auto; }

.flash { margin: 0 0 18px; padding: 9px 14px; border-left: 2px solid var(--yellow);
  background: color-mix(in srgb, var(--yellow) 10%, transparent); color: var(--strong); }
.flash::before { content: "› "; color: var(--yellow); }

/* ---------------------------------------------------------------- covers */
.cv { --h: 20; position: relative; aspect-ratio: 2 / 3; border-radius: 2px 5px 5px 2px; overflow: hidden;
  container-type: inline-size; flex-shrink: 0; display: block; width: 100%;
  color: hsl(var(--h) 45% 92%);
  background:
    radial-gradient(120% 70% at 85% 0%, hsl(var(--h) 55% 60% / .35), transparent 60%),
    radial-gradient(90% 60% at 0% 100%, hsl(var(--h) 60% 12% / .55), transparent 70%),
    linear-gradient(160deg, hsl(var(--h) 38% 38%), hsl(var(--h) 42% 24%));
  box-shadow: inset 3px 0 0 hsl(var(--h) 40% 14% / .55), inset 5px 0 0 hsl(0 0% 100% / .10),
    0 1px 1px #0002, 0 6px 12px -2px #0003, 0 18px 30px -12px #0005; }
.cv::before { content: ""; position: absolute; inset: 0; opacity: .07; mix-blend-mode: overlay; z-index: 2; pointer-events: none;
  background-image: repeating-linear-gradient(0deg, #fff 0 1px, transparent 1px 3px),
                    repeating-linear-gradient(90deg, #000 0 1px, transparent 1px 4px); }
.cv::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(90deg, #0000 0 4%, #ffffff26 5.5%, #0000 8%, #0000 85%, #ffffff12); }
.cv img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.cv .cvt { font-family: var(--serif); font-weight: 600; line-height: 1.08; font-size: clamp(.6rem, 13cqi, 2.2rem);
  overflow-wrap: anywhere; hyphens: auto; }
.cv .cva { font-family: var(--serif); font-style: italic; font-size: clamp(.5rem, 7.5cqi, 1.1rem); opacity: .85; }
.cv .in { position: absolute; inset: 0; display: flex; flex-direction: column; }
.cv.frame .in { margin: 9cqi 8cqi 9cqi 11cqi; border: 1px solid hsl(var(--h) 50% 85% / .55);
  outline: 1px solid hsl(var(--h) 50% 85% / .3); outline-offset: 3px;
  align-items: center; justify-content: center; text-align: center; gap: 8cqi; padding: 8cqi; overflow: hidden; }
.cv.frame .orn { width: 22cqi; height: 1px; background: currentColor; opacity: .55; flex-shrink: 0; }
.cv.band .in { justify-content: center; }
.cv.band .bd { background: hsl(var(--h) 50% 88%); color: hsl(var(--h) 45% 20%);
  padding: 9cqi 10cqi 9cqi 14cqi; display: flex; flex-direction: column; gap: 3cqi; }
.cv.band .top, .cv.band .bot { position: absolute; left: 14cqi; right: 8cqi; font: 500 clamp(.4rem, 5.5cqi, .7rem) var(--mono);
  letter-spacing: .12em; text-transform: uppercase; opacity: .7; white-space: nowrap; overflow: hidden; }
.cv.band .top { top: 9cqi; } .cv.band .bot { bottom: 9cqi; }
.cv.min .in { padding: 13cqi 11cqi 11cqi 15cqi; justify-content: space-between; }
.cv.min .cvt { font-size: clamp(.7rem, 16cqi, 2.6rem); letter-spacing: -.01em; position: relative; }
.cv.min .cva { position: relative; }
.cv.min .disc { position: absolute; right: -12cqi; bottom: 18cqi; width: 62cqi; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, hsl(calc(var(--h) + 30) 75% 70%), hsl(calc(var(--h) + 10) 70% 45%)); opacity: .55; }
@container (max-width: 90px) { .cv .cva, .cv .top, .cv .bot, .cv .orn { display: none; } }
@container (max-width: 50px) { .cv .cvt { display: none; } }

/* ---------------------------------------------------------------- now reading */
.now { display: grid; grid-template-columns: 120px 1fr; gap: 26px; align-items: center;
  padding: 4px 0 6px 14px; border-left: 2px solid var(--line); }
.now + .now { margin-top: 22px; }
.now .cv { width: 120px; }
.now-title { font: 600 2.3rem/1.05 var(--serif); color: var(--strong); letter-spacing: -.01em; }
.now-title a { color: inherit; }
.by { font: italic 1.1rem var(--serif); color: var(--muted); margin: 2px 0 14px; }
.seg { display: flex; align-items: center; gap: 12px; max-width: 520px; color: var(--purple); margin-bottom: 4px; }
.seg-track { flex: 1; height: 14px; background: repeating-linear-gradient(90deg, var(--line) 0 7px, transparent 7px 9px); }
.seg-track i { display: block; height: 100%; background: repeating-linear-gradient(90deg, var(--purple) 0 7px, transparent 7px 9px); }
.kv { color: var(--muted); }
.kv b { color: var(--cyan); font-weight: 400; }
.log-line { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.cmdline { display: inline-flex; align-items: center; gap: 10px; border-bottom: 1px dashed var(--line); padding: 2px 0; }
.cmdline label { margin: 0; color: var(--green); text-transform: none; letter-spacing: 0; font-size: 14px; }
.cmdline input { width: 92px; border: 0; background: transparent; padding: 2px 0; color: var(--strong); box-shadow: none !important;
  caret-color: var(--strong); font-size: 14px; -moz-appearance: textfield; }
.cmdline input::-webkit-inner-spin-button, .cmdline input::-webkit-outer-spin-button { -webkit-appearance: none; }
.cmdline:focus-within { border-bottom-color: var(--green); }
.cmdline button { background: none; border: 0; padding: 0; color: var(--faint); font: 12px var(--mono); cursor: pointer; }
.cmdline button:hover { color: var(--green); }

/* ---------------------------------------------------------------- lists */
.ls { display: flex; flex-wrap: wrap; gap: 4px 34px; }
.ls .n { color: var(--faint); margin-right: 8px; }
.ls .f { color: var(--strong); }
.ls .w { color: var(--muted); }

.rows { border-top: 1px solid var(--line); }
.r { display: grid; grid-template-columns: 30px 100px minmax(0, 1fr) minmax(0, 220px) 96px 90px; gap: 16px;
  align-items: center; padding: 7px 0; border-bottom: 1px dashed var(--line); color: var(--text); }
.r:hover { text-decoration: none; background: color-mix(in srgb, var(--purple) 5%, transparent); }
.r .cv { width: 30px; }
.r .d { color: var(--faint); }
.r .t { color: var(--strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r .a { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r .p { color: var(--faint); text-align: right; }
.rows-head { display: grid; grid-template-columns: 30px 100px minmax(0, 1fr) minmax(0, 220px) 96px 90px; gap: 16px;
  padding: 0 0 6px; color: var(--faint); font-size: 12px; }
.rows-head span:last-child { text-align: right; }

.stars { letter-spacing: 1px; white-space: nowrap; }
.stars i { font-style: normal; color: var(--faint); }
.stars i.on { color: var(--yellow); }

.pill { font-size: 11px; padding: 2px 7px; border-radius: 3px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; justify-self: start; }
.pill-reading { color: var(--green); border-color: color-mix(in srgb, var(--green) 45%, transparent); }
.pill-next { color: var(--blue); border-color: color-mix(in srgb, var(--blue) 45%, transparent); }
.pill-read { color: var(--purple); border-color: color-mix(in srgb, var(--purple) 45%, transparent); }
.pill-dnf { color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, transparent); }

/* queue */
.queue { border-top: 1px solid var(--line); }
.qrow { display: grid; grid-template-columns: 26px 34px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 8px 0; border-bottom: 1px dashed var(--line); }
.qrow .n { color: var(--faint); }
.qrow .cv { width: 34px; }
.qrow .t { color: var(--strong); }
.qrow .a { color: var(--muted); }
.qctl { display: flex; gap: 6px; align-items: center; }

/* covers grid */
.cover-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 26px 20px; }
.gb { display: flex; flex-direction: column; gap: 3px; color: var(--text); }
.gb:hover { text-decoration: none; }
.gb .cv { margin-bottom: 8px; transition: transform .15s ease; }
.gb:hover .cv { transform: translateY(-3px); }
.gb .t { font: 600 1rem/1.25 var(--serif); color: var(--strong); }
.gb .a { color: var(--muted); font-size: 12px; }

/* shelf filters */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.chip { font-size: 12.5px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); }
.chip:hover { color: var(--text); text-decoration: none; border-color: var(--muted); }
.chip.on { color: var(--strong); border-color: var(--purple); background: color-mix(in srgb, var(--purple) 10%, transparent); }
.chip b { font-weight: 400; color: var(--faint); margin-left: 4px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 26px; }
.filters input[type=search] { flex: 1 1 240px; width: auto; }
.filters select { width: auto; }
.viewtoggle { margin-left: auto; display: flex; gap: 2px; font-size: 12.5px; }
.viewtoggle a { padding: 5px 9px; color: var(--muted); border-radius: 3px; }
.viewtoggle a.on { color: var(--strong); background: var(--field); }

/* ---------------------------------------------------------------- quotes */
.q { margin: 0; padding: 4px 0 4px 16px; border-left: 2px solid var(--yellow); }
.q blockquote { margin: 0; font: italic 1.35rem/1.45 var(--serif); color: var(--strong); white-space: pre-line; }
.q figcaption { color: var(--muted); font-size: 12.5px; margin-top: 6px; display: flex; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.q figcaption a { color: var(--muted); }
.q figcaption a:hover { color: var(--text); }
.q-list .q { margin-bottom: 22px; }
.q-list .q blockquote { font-size: 1.15rem; }
.quote-wall { columns: 2 340px; column-gap: 40px; }
.quote-wall .q { break-inside: avoid; margin-bottom: 26px; }

/* ---------------------------------------------------------------- year strip */
.yr { display: flex; flex-wrap: wrap; gap: 18px 26px; align-items: end; }
.months { display: grid; grid-template-columns: repeat(12, 14px); gap: 5px; height: 56px; align-items: end; }
.months .m { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; gap: 4px; }
.months i { display: block; min-height: 2px; background: var(--blue); border-radius: 1px; }
.months b { font-weight: 400; color: var(--faint); font-size: 11px; text-align: center; }
.stat-line { color: var(--muted); }
.stat-line b { color: var(--orange); font-weight: 400; }

/* ---------------------------------------------------------------- book page */
.book { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 36px; align-items: start; }
.book .cv { width: 220px; }
.book-title { font: 600 2.6rem/1.05 var(--serif); color: var(--strong); letter-spacing: -.015em; margin-top: 10px; }
.book .by { font-size: 1.25rem; margin-bottom: 12px; }
.book .by a { color: inherit; }
.rate { display: flex; gap: 2px; margin-bottom: 16px; }
.star-btn { background: none; border: 0; padding: 0 2px; font-size: 1.3rem; line-height: 1; color: var(--faint); cursor: pointer; }
.star-btn.on { color: var(--yellow); }
.rate:hover .star-btn { color: var(--yellow); }
.rate .star-btn:hover ~ .star-btn { color: var(--faint); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 3px 22px; margin: 16px 0; }
.facts dt { color: var(--faint); }
.facts dd { margin: 0; color: var(--strong); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 3px; border: 1px solid var(--line); color: var(--cyan); }
.tag::before { content: "#"; color: var(--faint); }
.tag:hover { text-decoration: none; border-color: var(--cyan); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.notes { font: 1.12rem/1.65 var(--serif); color: var(--strong); white-space: pre-line; max-width: 70ch; }
.two { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 34px; align-items: start; }
.two > div > .h:first-child { margin-top: 38px; }
.quote-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 22px; }
.quote-form .page { width: 110px; }
.log { width: 100%; border-collapse: collapse; }
.log td { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.log td:first-child { color: var(--muted); }
.log td.p { color: var(--strong); }
.log td.x { text-align: right; width: 30px; }
.log-form { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.log-form input[type=number] { width: 100px; flex: 0 0 auto; }
.log-form input[type=date] { width: auto; flex: 1 1 140px; }
.danger-zone { margin-top: 36px; text-align: right; font-size: 12.5px; }

/* ---------------------------------------------------------------- forms */
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; max-width: 760px; }
.span-2 { grid-column: span 2; }
.form-actions { display: flex; gap: 10px; }
.lookup { max-width: 760px; margin-bottom: 8px; }
.lookup-results { display: grid; gap: 4px; margin-top: 10px; }
.lookup-hit { display: flex; gap: 12px; align-items: center; text-align: left; width: 100%;
  background: transparent; border: 0; border-bottom: 1px dashed var(--line); padding: 6px 4px;
  color: var(--text); font: inherit; cursor: pointer; }
.lookup-hit:hover { background: color-mix(in srgb, var(--green) 8%, transparent); }
.lookup-hit img, .lookup-noimg { width: 26px; height: 39px; object-fit: cover; border-radius: 2px; flex-shrink: 0; background: var(--line); }
.lookup-txt { display: flex; flex-direction: column; min-width: 0; }
.lookup-txt strong { font-weight: 400; color: var(--strong); }
.lookup-txt span { color: var(--muted); font-size: 12px; }
.cover-field .row { flex-wrap: wrap; }
.cover-field .cv { width: 40px; }
.cover-field input[type=file] { flex: 1 1 220px; width: auto; }
.login { max-width: 340px; margin: 30px auto 10px; display: flex; flex-direction: column; gap: 12px; }
.err { text-align: center; padding: 50px 0 40px; }
.err .code { font-size: 3rem; color: var(--purple); }

/* ---------------------------------------------------------------- stats */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 4px; }
.tile { padding: 14px 18px; border-left: 1px solid var(--line); }
.tile:first-child { border-left: 0; }
.tile b { display: block; font: 600 2rem/1.1 var(--serif); color: var(--strong); }
.tile b small { font-size: 1rem; color: var(--faint); font-weight: 400; }
.tile span { color: var(--muted); font-size: 12px; }
.heatmap { display: grid; grid-template-columns: repeat(26, minmax(0, 16px)); gap: 3px; }
.hm-col { display: grid; grid-template-rows: repeat(7, auto); gap: 3px; }
.hm-cell { display: block; aspect-ratio: 1; border-radius: 2px; background: var(--line); }
.hm-cell.on { background: var(--green); }
.hm-cell.future { background: transparent; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 150px; }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.bar { width: 100%; max-width: 26px; min-height: 2px; background: var(--blue); border-radius: 1px; }
.bar-col span { font-size: 11px; color: var(--faint); min-height: 1em; }
.hbar-row { display: grid; grid-template-columns: 80px 1fr 30px; gap: 12px; align-items: center; margin-bottom: 8px; }
.hbar-row .stars { font-size: 12px; }
.hbar-track { height: 10px; background: repeating-linear-gradient(90deg, var(--line) 0 6px, transparent 6px 8px); }
.hbar { height: 100%; background: repeating-linear-gradient(90deg, var(--yellow) 0 6px, transparent 6px 8px); }
.hbar-row b { font-weight: 400; color: var(--muted); text-align: right; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 400; color: var(--faint); font-size: 12px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.table td { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.table .num { text-align: right; }
.ranked { list-style: none; margin: 0 0 14px; padding: 0; }
.ranked li { display: flex; gap: 12px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.ranked li .n { color: var(--faint); }
.ranked li .c { margin-left: auto; color: var(--muted); }

/* ---------------------------------------------------------------- phones */
@media (max-width: 760px) {
  body { padding: 0; font-size: 13px; }
  .win { border-radius: 0; border: 0; min-height: 100vh; display: flex; flex-direction: column; }
  .body { padding: 18px 16px 26px; flex: 1; }
  .dots { width: auto; }
  .titlebar .tools { width: auto; }
  .tabs { padding: 0 6px; }
  .tabs a { padding: 8px 10px; }
  .foot { padding: 12px 16px; }
  .h { margin-top: 32px; }
  .now { grid-template-columns: 84px 1fr; gap: 16px; padding-left: 10px; }
  .now .cv { width: 84px; }
  .now-title { font-size: 1.55rem; }
  .ls { flex-direction: column; }
  .r { grid-template-columns: 30px minmax(0, 1fr) auto; gap: 2px 12px; }
  .r .cv { grid-row: 1 / 3; }
  .r .d, .r .p { display: none; }
  .r .a { grid-column: 2; font-size: 12px; }
  .r .stars, .r .pill { grid-row: 1; grid-column: 3; justify-self: end; }
  .rows-head { display: none; }
  .qrow { grid-template-columns: 22px 30px minmax(0, 1fr) auto; gap: 10px; }
  .qrow .cv { width: 30px; }
  .qrow .a { display: block; font-size: 12px; }
  .cover-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 20px 14px; }
  .q blockquote { font-size: 1.2rem; }
  .book { grid-template-columns: 1fr; gap: 20px; }
  .book .cv { width: 150px; }
  .book-title { font-size: 1.9rem; }
  .two, .grid2 { grid-template-columns: 1fr; }
  .form { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .tile:nth-child(3) { border-left: 0; }
  .tile:nth-child(n+3) { border-top: 1px solid var(--line); }
  .viewtoggle { margin-left: 0; }
}
@media (max-width: 760px) {
  .r .pill ~ .stars { grid-row: 2; }
}
.cmdline label { white-space: nowrap; }
@media (max-width: 760px) {
  .now { align-items: start; }
  .cmdline input { width: 56px; }
  .cmdline button { font-size: 0; }
  .cmdline button::after { content: "↵"; font-size: 14px; }
  .r .stars.faint { display: none; }
}
.more { margin-top: 10px; font-size: 12.5px; }
.more a { color: var(--muted); }
.more a:hover { color: var(--text); }
@media (max-width: 760px) { .qrow .dot { display: none; } }
