/* hent.ai — restrained dark UI. Fraunces (display) + Satoshi (text). */

:root {
  --bg: #0a0a0c;
  --bg-elev: #111116;
  --bg-elev-2: #16161d;
  --border: #1d1d27;
  --border-strong: #2a2a36;
  --text: #ececf2;
  --text-dim: #9897a4;
  --text-faint: #5a5a6a;
  --accent: #e9b872;
  --accent-soft: #e9b8721a;
  --like: #7fbf7f;
  --danger: #d97a7a;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 0 #ffffff04 inset, 0 18px 50px -20px #00000060;
  --t: 160ms cubic-bezier(.4,.0,.2,1);
  --font-display: "Fraunces", serif;
  --font-text: "Satoshi", -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }
body {
  font-family: var(--font-text);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
::selection { background: var(--accent); color: #1a1a1a; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.02em; }

.container { max-width: 1440px; margin: 0 auto; padding: 0 28px; }

/* ── header ─────────────────────────────────────────── */
header.site {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  border-bottom: 1px solid var(--border);
}
.topbar {
  display: flex; align-items: center; gap: 22px;
  padding: 13px 28px;
  max-width: 1440px; margin: 0 auto;
}
.brand {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 36, "SOFT" 50, "WONK" 1;
  font-size: 22px;
  display: flex; align-items: baseline; gap: 8px;
  white-space: nowrap;
}
.brand .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); transform: translateY(-2px); }
.brand small {
  font-family: var(--font-text);
  font-size: 10px; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: 0.18em;
}

.search-wrap { flex: 1; position: relative; max-width: 640px; }
.search {
  width: 100%;
  padding: 11px 42px 11px 16px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color var(--t), background var(--t);
}
.search::placeholder { color: var(--text-faint); }
.search:focus { border-color: var(--border-strong); background: var(--bg-elev-2); }
.kbd {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-size: 11px; color: var(--text-faint);
  padding: 2px 7px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--bg);
  pointer-events: none;
}

nav.main { display: flex; gap: 4px; align-items: center; margin-left: auto; }
nav.main a, nav.main button {
  background: transparent; border: 0;
  color: var(--text-dim);
  font-size: 13px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: all var(--t);
  white-space: nowrap;
}
nav.main a:hover, nav.main button:hover { color: var(--text); background: var(--bg-elev-2); }
nav.main a.active { color: var(--accent); }
nav.main .user-chip {
  border: 1px solid var(--border);
  color: var(--text);
  display: inline-flex; align-items: center; gap: 7px;
}
nav.main .user-chip .avatar {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
}

/* ── layout bits ─────────────────────────────────────── */
main { padding: 26px 0 80px; }
.section { margin: 0 0 38px; }
.section-head {
  display: flex; align-items: baseline; gap: 14px;
  margin-bottom: 14px;
}
.section-head h2 { font-size: 22px; margin: 0; font-variation-settings: "opsz" 60, "SOFT" 60, "WONK" 1; }
.section-head .sub { color: var(--text-faint); font-size: 12px; }
.section-head a.more { margin-left: auto; color: var(--text-dim); font-size: 12px; }
.section-head a.more:hover { color: var(--accent); }

.row-scroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 172px;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  gap: 14px;
}

/* ── gallery card ────────────────────────────────────── */
.card {
  position: relative;
  display: block;
  transition: transform var(--t);
}
.card:hover { transform: translateY(-2px); }
.card .covr {
  display: block;
  position: relative;
  aspect-ratio: 3 / 4.2;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  transition: border-color var(--t), box-shadow var(--t);
}
.card:hover .covr { border-color: var(--border-strong); box-shadow: var(--shadow); }
.card .covr img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.card .pgs {
  position: absolute; bottom: 8px; right: 8px;
  font-size: 10px; font-variant-numeric: tabular-nums;
  color: var(--text);
  background: #000000b0;
  border: 1px solid #ffffff14;
  padding: 2px 7px; border-radius: 5px;
  backdrop-filter: blur(6px);
}
.card .sem {
  position: absolute; top: 8px; left: 8px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}
.card .prog {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 3px; background: #00000080;
}
.card .prog i { display: block; height: 100%; background: var(--accent); }
.card .match {
  position: absolute; bottom: 8px; left: 8px;
  width: 34%;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  overflow: hidden;
  background: var(--bg);
  box-shadow: 0 6px 16px -6px #000000c0;
}
.card .match img { width: 100%; display: block; }
.card .match span {
  display: block; text-align: center;
  font-size: 9px; color: var(--accent);
  padding: 1px 0 2px;
  background: #000000d8;
}
.card .t {
  display: -webkit-box;
  margin-top: 8px;
  font-size: 12.5px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text);
  min-height: 2.6em;
}
.card .a {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card .a b { color: var(--text-dim); font-weight: 500; }

/* page hit card (search results, similar pages) */
.pcard { display: block; position: relative; }
.pcard .covr {
  display: block;
  aspect-ratio: 3 / 4.2;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-elev-2);
  position: relative;
  transition: all var(--t);
}
.pcard:hover .covr { border-color: var(--border-strong); transform: translateY(-2px); }
.pcard .covr img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pcard .score {
  position: absolute; top: 8px; left: 8px;
  font-size: 10px; font-variant-numeric: tabular-nums;
  color: var(--accent);
  background: #000000c0;
  border: 1px solid #ffffff14;
  padding: 2px 7px; border-radius: 5px;
}
.pcard .pg {
  position: absolute; bottom: 8px; right: 8px;
  font-size: 10px;
  color: var(--text);
  background: #000000b0;
  padding: 2px 7px; border-radius: 5px;
}
.pcard .t {
  margin-top: 7px; font-size: 11.5px; color: var(--text-dim);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pcard.no-t .t { display: none; }

/* ── chips / pills / buttons ─────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  transition: all var(--t);
  user-select: none;
}
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip.on, .chip[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  color: var(--accent);
}
.chip .cnt { color: var(--text-faint); font-size: 10px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  transition: all var(--t);
}
.btn:hover { border-color: var(--border-strong); background: var(--bg-elev-2); }
.btn.primary {
  background: var(--accent); color: #16130c; border-color: var(--accent);
  font-weight: 600;
}
.btn.primary:hover { filter: brightness(1.06); }
.btn.on { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: var(--accent-soft); }
.btn.like.on { color: var(--like); border-color: color-mix(in srgb, var(--like) 45%, var(--border)); background: #7fbf7f14; }
.btn.dislike.on { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); background: #d97a7a14; }
.btn:disabled { opacity: .45; cursor: default; }
.btn .n { font-size: 11px; color: var(--text-faint); font-variant-numeric: tabular-nums; }

/* ── forms ───────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; color: var(--text-dim); }
.input, select.input {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  transition: border-color var(--t);
}
.input:focus { border-color: var(--border-strong); }
select.input { appearance: none; }

/* ── auth card ───────────────────────────────────────── */
.auth-wrap { display: flex; justify-content: center; padding: 60px 0; }
/* opaque on purpose: nothing may show through until the visitor confirms 18+ */
.age-gate {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.auth-card {
  width: 360px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 30px;
  box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 26px; margin: 0 0 4px; }
.auth-card .sub { color: var(--text-faint); font-size: 12px; margin-bottom: 22px; }
.auth-switch { margin-top: 16px; font-size: 12px; color: var(--text-faint); text-align: center; }
.auth-switch a { color: var(--accent); cursor: pointer; }
.form-error { color: var(--danger); font-size: 12px; min-height: 16px; margin-bottom: 8px; }

/* ── gallery page ────────────────────────────────────── */
.g-hero { display: grid; grid-template-columns: 300px 1fr; gap: 32px; margin-bottom: 36px; }
.g-cover {
  border-radius: 14px; overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  align-self: start;
}
.g-cover img { width: 100%; display: block; }
.g-info h1 {
  font-size: clamp(24px, 3.2vw, 38px);
  margin: 0 0 4px;
  line-height: 1.12;
  font-variation-settings: "opsz" 90, "SOFT" 70, "WONK" 1;
}
.g-info .full-title { color: var(--text-faint); font-size: 12px; margin-bottom: 14px; }
.g-meta-line { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--text-dim); font-size: 13px; margin-bottom: 16px; }
.g-meta-line b { color: var(--text); font-weight: 500; }
.g-meta-line .sem-note { color: var(--accent); }
.g-actions { display: flex; gap: 10px; margin: 18px 0 22px; flex-wrap: wrap; }
.g-recap {
  color: var(--text-dim); font-size: 14px; line-height: 1.65;
  border-left: 2px solid var(--border-strong);
  padding-left: 16px;
  margin: 0 0 18px;
  max-width: 720px;
}
.g-overview { max-width: 720px; margin: 0 0 18px; }
.g-overview .tagline {
  font-family: var(--font-display); font-size: 17px; color: var(--text);
  margin: 0 0 10px; line-height: 1.4; font-variation-settings: "opsz" 40, "SOFT" 60, "WONK" 1;
}
.g-overview .body {
  color: var(--text-dim); font-size: 14px; line-height: 1.7;
  border-left: 2px solid var(--accent); padding-left: 16px; margin: 0 0 6px;
}
.g-overview .src { font-size: 10px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .12em; padding-left: 18px; }

.g-plot { max-width: 720px; margin-bottom: 18px; }
.g-plot summary { cursor: pointer; color: var(--text-dim); font-size: 13px; user-select: none; }
.g-plot summary:hover { color: var(--text); }
.g-plot .plot-body { color: var(--text-dim); font-size: 13.5px; line-height: 1.7; padding-top: 12px; white-space: pre-wrap; }
.tag-groups { display: flex; flex-direction: column; gap: 10px; }
.tag-group { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.tag-group .lbl { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .1em; min-width: 74px; }

.pages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}
.pages-grid a { position: relative; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); transition: all var(--t); background: var(--bg-elev-2); aspect-ratio: 3/4.3; }
.pages-grid a:hover { border-color: var(--accent); }
.pages-grid a.no-sem { border-color: color-mix(in srgb, var(--warn, #f5a524) 35%, var(--border)); }
.pages-grid a.no-sem img { filter: saturate(.55) brightness(.72); }
.pages-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pages-grid .n {
  position: absolute; bottom: 6px; right: 6px;
  font-size: 10px; color: var(--text);
  background: #000000b0; padding: 1px 6px; border-radius: 4px;
}
.pages-grid .miss {
  position: absolute; left: 6px; bottom: 6px;
  font-size: 9px; color: #ffd79a; background: #000000c0;
  padding: 1px 6px; border-radius: 4px; text-transform: uppercase; letter-spacing: .04em;
}

/* ── reader ──────────────────────────────────────────── */
.reader { position: fixed; inset: 0; z-index: 90; background: #060608; display: flex; flex-direction: column; }
.reader .bar {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  z-index: 2;
  overflow-x: auto;
  scrollbar-width: thin;
}
.reader .bar .btn { white-space: nowrap; }
.reader .bar .ttl { font-size: 13px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.reader .bar .pos { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--text); white-space: nowrap; }
.reader .stage-outer { flex: 1; position: relative; min-height: 0; }
.reader .stage {
  position: absolute; inset: 0; overflow: auto;
  scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
}
.reader .page-wrap {
  min-width: 100%; min-height: 100%;
  display: flex; align-items: center; justify-content: center;
}
.reader .page-wrap img { display: block; user-select: none; -webkit-user-drag: none; }
.reader .zone { position: absolute; top: 0; bottom: 0; width: 28%; cursor: pointer; z-index: 3; }
.reader .zone.prev { left: 0; }
.reader .zone.next { right: 0; }
.reader .zone:hover { background: linear-gradient(to right, #ffffff05, transparent); }
.reader .zone.next:hover { background: linear-gradient(to left, #ffffff05, transparent); }

/* reader view-settings menu */
.rd-settings-wrap { position: relative; }
.rd-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 6;
  width: 250px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
  display: flex; flex-direction: column; gap: 12px;
}
.rd-menu[hidden] { display: none; }
.rd-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rd-lbl { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .1em; }
.rd-seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.rd-opt {
  background: transparent; border: 0; color: var(--text-dim);
  padding: 6px 9px; font-size: 12px; min-width: 30px;
  border-left: 1px solid var(--border);
  transition: all var(--t);
}
.rd-opt:first-child { border-left: 0; }
.rd-opt:hover { color: var(--text); background: var(--bg-elev); }
.rd-opt.on { color: var(--accent); background: var(--accent-soft); }
#zoom-val { font-variant-numeric: tabular-nums; min-width: 34px; display: inline-block; }

input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 160px; height: 4px;
  background: var(--border-strong);
  border-radius: 2px;
  outline: none;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 13px; height: 13px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer; border: 0;
}
input[type=range]::-moz-range-thumb {
  width: 13px; height: 13px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer; border: 0;
}

.sim-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 95;
  width: min(560px, 92vw);
  background: var(--bg-elev);
  border-left: 1px solid var(--border);
  box-shadow: -30px 0 60px -30px #000000c0;
  transform: translateX(102%);
  transition: transform 220ms cubic-bezier(.3,.7,.3,1);
  display: flex; flex-direction: column;
}
.sim-panel.open { transform: translateX(0); }
.sim-panel .head { padding: 18px 20px 0; }
.sim-panel .head h3 { margin: 0 0 4px; font-size: 19px; }
.sim-panel .head .sub { color: var(--text-faint); font-size: 12px; margin-bottom: 12px; }
.sim-panel .refine { display: flex; gap: 8px; padding: 0 20px 12px; }
.sim-panel .refine .input { flex: 1; }
.sim-panel .opts { display: flex; gap: 8px; padding: 0 20px 14px; }
.sim-panel .results {
  flex: 1; overflow-y: auto;
  padding: 4px 20px 20px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  align-content: start;
}
.sim-panel .empty-note { grid-column: 1/-1; color: var(--text-faint); font-size: 13px; padding: 20px 0; text-align: center; }

.desc-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 96;
  width: min(520px, 92vw);
  background: var(--bg-elev);
  border-left: 1px solid var(--border);
  box-shadow: -30px 0 60px -30px #000000c0;
  transform: translateX(102%);
  transition: transform 220ms cubic-bezier(.3,.7,.3,1);
  display: flex; flex-direction: column;
}
.desc-panel.open { transform: translateX(0); }
.desc-panel .head { padding: 18px 20px 10px; border-bottom: 1px solid var(--border); }
.desc-panel .head h3 { margin: 0 0 4px; font-size: 19px; }
.desc-panel .head .sub { color: var(--text-faint); font-size: 12px; }
.desc-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 24px;
}
.desc-panel .empty-note { color: var(--text-faint); font-size: 13px; padding: 20px 0; text-align: center; }
.desc-body section { margin-bottom: 20px; }
.desc-body h4 {
  margin: 0 0 8px;
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .12em;
}
.desc-body p {
  margin: 0;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.65;
}
.cap-list {
  margin: 0;
  padding-left: 20px;
  color: var(--text-dim);
}
.cap-list li { margin-bottom: 12px; padding-left: 4px; }
.cap-meta, .cap-extra {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.cap-meta span, .cap-extra span {
  font-size: 11px;
  color: var(--text-faint);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
}
.cap-dialogue, .cap-chars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cap-dialogue p, .cap-chars > div {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.cap-dialogue b, .cap-chars b { color: var(--text); font-weight: 600; }
.cap-chars p { margin-top: 5px; }
.cap-src {
  color: var(--text-faint);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .12em;
}

/* ── search page ─────────────────────────────────────── */
.search-head { margin-bottom: 22px; }
.search-head h1 { font-size: 26px; margin: 0 0 12px; }
.search-head .modes { display: flex; gap: 8px; }
.sr-group {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elev);
  padding: 14px;
  margin-bottom: 14px;
}
.sr-group .g-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.sr-group .g-head img { width: 40px; height: 54px; object-fit: cover; border-radius: 5px; border: 1px solid var(--border); }
.sr-group .g-head .t { font-size: 14px; }
.sr-group .g-head .m { font-size: 11px; color: var(--text-faint); }
.sr-group .hits { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }

/* ── catalog ─────────────────────────────────────────── */
.cat-controls {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin-bottom: 20px;
}
.cat-controls .spacer { flex: 1; }
.filter-active { display: inline-flex; align-items: center; gap: 8px; }
.pager { display: flex; gap: 8px; justify-content: center; margin-top: 30px; align-items: center; }
.pager .info { color: var(--text-faint); font-size: 12px; font-variant-numeric: tabular-nums; padding: 0 8px; }

.tag-browser { margin-bottom: 22px; border: 1px solid var(--border); border-radius: 12px; padding: 16px; background: var(--bg-elev); }
.tag-browser .kinds { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.tag-browser .list { display: flex; flex-wrap: wrap; gap: 8px; max-height: 180px; overflow-y: auto; }

/* ── profile ─────────────────────────────────────────── */
.profile-head { display: flex; align-items: center; gap: 20px; margin-bottom: 28px; }
.profile-head .avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-family: var(--font-display);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  text-transform: uppercase;
}
.profile-head h1 { margin: 0; font-size: 28px; }
.profile-head .sub { color: var(--text-faint); font-size: 12px; }
.taste { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; }
.taste .chip { cursor: default; }
.taste .chip i { font-style: normal; opacity: .55; font-size: 10px; }
.tabs { display: flex; gap: 8px; margin-bottom: 18px; border-bottom: 1px solid var(--border); padding-bottom: 0; }
.tabs button {
  background: none; border: 0; color: var(--text-dim);
  padding: 10px 14px; font-size: 13px;
  border-bottom: 2px solid transparent;
  transition: all var(--t);
}
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }

/* ── collections ─────────────────────────────────────── */
.collect-wrap { position: relative; }
.collect-menu {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 20;
  width: 260px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 8px;
  display: flex; flex-direction: column; gap: 2px;
}
.collect-menu[hidden] { display: none; }
.cm-item {
  display: flex; align-items: center; gap: 10px;
  background: transparent; border: 0; color: var(--text);
  padding: 8px 10px; border-radius: var(--radius-sm); font-size: 13px;
  text-align: left; width: 100%; transition: background var(--t);
}
.cm-item:hover { background: var(--bg-elev); }
.cm-item .cm-check { width: 14px; color: var(--accent); font-size: 12px; }
.cm-item.on .cm-name { color: var(--accent); }
.cm-item .cm-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-item .cm-cnt { color: var(--text-faint); font-size: 11px; }
.cm-empty { color: var(--text-faint); font-size: 12px; padding: 8px 10px; }
.cm-new { display: flex; gap: 6px; padding: 8px 6px 4px; border-top: 1px solid var(--border); margin-top: 4px; }
.cm-new .input { flex: 1; padding: 7px 10px; font-size: 13px; }
.cm-new .btn { padding: 7px 12px; }

.coll-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.coll-card { display: block; }
.coll-card .coll-cover {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 3 / 4.2; border-radius: var(--radius); overflow: hidden;
  background: var(--bg-elev-2); border: 1px solid var(--border);
  transition: border-color var(--t);
}
.coll-card:hover .coll-cover { border-color: var(--border-strong); }
.coll-card .coll-cover img { width: 100%; height: 100%; object-fit: cover; }
.coll-card .coll-ph { font-size: 34px; color: var(--text-faint); }
.coll-card .coll-name { display: block; margin-top: 8px; font-size: 13px; color: var(--text); }
.coll-card .coll-cnt { display: block; font-size: 11px; color: var(--text-faint); }

/* ── misc ────────────────────────────────────────────── */
.hero-empty {
  padding: 70px 0 50px;
  text-align: center;
  color: var(--text-faint);
}
.hero-empty h2 {
  font-size: clamp(34px, 5vw, 52px);
  color: var(--text);
  margin: 0 0 12px;
  font-weight: 300;
  font-variation-settings: "opsz" 120, "SOFT" 100, "WONK" 1;
}
.hero-empty p { max-width: 480px; margin: 0 auto; font-size: 14px; }
.examples { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 22px; }

.status-line { color: var(--text-faint); font-size: 13px; padding: 6px 0 16px; display: flex; align-items: center; gap: 10px; }
.status-line .glyph { width: 5px; height: 5px; border-radius: 50%; background: var(--text-faint); }
.status-line.busy .glyph { background: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity:.35; } 50% { opacity:1; } }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--bg-elev-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 11px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  z-index: 200;
  opacity: 0;
  transition: all 200ms ease;
  box-shadow: var(--shadow);
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-color: color-mix(in srgb, var(--danger) 50%, var(--border)); color: var(--danger); }

.skel { background: linear-gradient(100deg, var(--bg-elev) 40%, var(--bg-elev-2) 50%, var(--bg-elev) 60%); background-size: 200% 100%; animation: sk 1.2s infinite linear; border-radius: var(--radius); }
@keyframes sk { to { background-position: -200% 0; } }

footer.site {
  padding: 40px 28px 60px;
  text-align: center;
  color: var(--text-faint);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border-top: 1px solid var(--border);
}

@media (max-width: 640px) {
  .reader .bar .ttl { display: none; }
  .reader .bar { gap: 10px; }
  .reader .bar input[type=range] { width: 90px; }
}

@media (max-width: 860px) {
  .container { padding: 0 16px; }
  .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .search-wrap { order: 3; max-width: none; flex-basis: 100%; }
  .g-hero { grid-template-columns: 1fr; }
  .g-cover { max-width: 260px; }
  .sim-panel .results { grid-template-columns: repeat(2, 1fr); }
  .row-scroll { grid-auto-columns: 140px; }
}

/* ── search suggestions dropdown ─────────────────────── */
.q-sugg {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 14px;
  padding: 6px; z-index: 80; max-height: 340px; overflow: auto;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
}
.q-lbl {
  font-size: 10px; text-transform: uppercase; letter-spacing: .1em;
  color: var(--text-faint); padding: 6px 10px 2px;
}
.q-item {
  display: flex; width: 100%; align-items: center; gap: 8px;
  padding: 7px 10px; background: none; border: 0; border-radius: 8px;
  color: var(--text-dim); font-size: 13px; text-align: left; cursor: pointer;
}
.q-item:hover { background: var(--accent-soft); color: var(--text); }
.q-item .ic { opacity: .6; font-size: 12px; }
.q-item i { margin-left: auto; font-style: normal; font-size: 10px; color: var(--text-faint); }

/* ── chips that hold a link + a control (tag “less”, saved-search ✕) ── */
.chip a { color: inherit; }
.chip .less, .pill-x button {
  background: none; border: 0; padding: 0 0 0 2px; cursor: pointer;
  color: var(--text-faint); font-size: 13px; line-height: 1;
}
.chip .less:hover, .pill-x button:hover { color: var(--accent); }
.chip.neg { opacity: .6; }
.chip.neg > a { text-decoration: line-through; }
.taste a.chip, .taste .pill-x { cursor: pointer; }
