/* Haiku Proxy admin — a small, warm, editorial design system (ADM-5).
   Light palette on :root, dark palette under prefers-color-scheme. */

:root {
  --bg: #faf9f5;
  --surface: #ffffff;
  --surface-2: #f4f2ec;
  --surface-3: #ece9e0;
  --border: #e5e1d7;
  --border-strong: #d4cfc2;
  --text: #1f1e1c;
  --text-2: #4a4741;
  --muted: #77736a;
  --accent: #c15f3c;
  --accent-hover: #a94f30;
  --accent-ink: #ffffff;
  --accent-soft: #f7e6de;
  --accent-soft-ink: #8a3d22;
  --ok: #2f7a55;      --ok-soft: #e2f0e8;
  --warn: #9a6512;    --warn-soft: #f6ecd8;
  --bad: #b23b33;     --bad-soft: #f7e0dd;
  --info: #3a6a9c;    --info-soft: #e2ebf5;
  --idle: #a8a397;
  --shadow: 0 1px 2px rgba(31, 30, 28, .05), 0 2px 8px rgba(31, 30, 28, .04);
  --shadow-lg: 0 8px 30px rgba(31, 30, 28, .10);
  --radius: 10px;
  --radius-sm: 6px;
  --font-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sidebar-w: 236px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1a18;
    --surface: #242320;
    --surface-2: #2c2a27;
    --surface-3: #35332f;
    --border: #3a3834;
    --border-strong: #4a4742;
    --text: #edeae3;
    --text-2: #cfcac0;
    --muted: #a19c92;
    --accent: #e0805e;
    --accent-hover: #ea9273;
    --accent-ink: #1b1a18;
    --accent-soft: #3b2a23;
    --accent-soft-ink: #f0b39b;
    --ok: #6cc399;      --ok-soft: #1f3329;
    --warn: #e0b060;    --warn-soft: #3a2f1c;
    --bad: #ef8a80;     --bad-soft: #3d2422;
    --info: #8db6e3;    --info-soft: #1f2c3a;
    --idle: #6f6b63;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14.5px/1.55 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 2px; }
img { max-width: 100%; display: block; }
code, pre, .mono { font-family: var(--font-mono); font-size: .86em; }
h1, h2, h3 { font-family: var(--font-serif); font-weight: 600; letter-spacing: -.01em; margin: 0; color: var(--text); }
h1 { font-size: 1.85rem; line-height: 1.2; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 .75rem; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.25rem 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--surface-2); border-right: 1px solid var(--border);
  padding: 1.25rem .85rem 1rem; display: flex; flex-direction: column;
}
.brand { display: flex; align-items: center; gap: .6rem; padding: .25rem .55rem 1.25rem; color: var(--text); }
.brand:hover { text-decoration: none; color: var(--text); }
.brand-mark { width: 26px; height: 26px; flex: none; }
.brand-name { font-family: var(--font-serif); font-size: 1.12rem; font-weight: 600; letter-spacing: -.01em; }
.brand-sub { display: block; font-family: var(--font-sans); font-size: .72rem; font-weight: 500; color: var(--muted); letter-spacing: .02em; }
.nav-group { margin-bottom: 1rem; }
.nav-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 0 .6rem .35rem; font-weight: 600; }
.nav a {
  display: flex; align-items: center; gap: .6rem; padding: .42rem .6rem; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 500;
}
.nav a:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.nav a.active .nav-icon { color: var(--accent); }
.nav-icon { width: 17px; height: 17px; flex: none; color: var(--muted); }
.sidebar-foot { margin-top: auto; padding: .75rem .6rem 0; border-top: 1px solid var(--border); font-size: .82rem; color: var(--muted); }
.sidebar-foot a { color: var(--text-2); }

.main { padding: 2rem clamp(1rem, 3vw, 2.75rem) 3rem; max-width: 1320px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head .eyebrow { font-size: .78rem; color: var(--muted); margin-bottom: .25rem; }
.page-head .eyebrow a { color: var(--muted); }
.page-head .lede { color: var(--muted); margin: .35rem 0 0; max-width: 62ch; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-side { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.stack > * + * { margin-top: 1.25rem; }

@media (max-width: 1100px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-side { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; padding: .75rem 1rem; border-right: 0; border-bottom: 1px solid var(--border); }
  .brand { padding: 0 .5rem 0 0; }
  .brand-sub, .nav-label, .sidebar-foot { display: none; }
  .nav-group { margin: 0; display: contents; }
  .nav { display: contents; }
  .nav a { padding: .35rem .55rem; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .main { padding-top: 1.25rem; }
}

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .95rem 1.15rem; border-bottom: 1px solid var(--border); }
.card-head h2 { font-size: 1.05rem; }
.card-head .meta { color: var(--muted); font-size: .82rem; }
.card-body { padding: 1.1rem 1.15rem; }
.card-body.flush { padding: 0; }
.card-foot { padding: .75rem 1.15rem; border-top: 1px solid var(--border); font-size: .85rem; }
.card-note { background: var(--surface-2); }

/* Stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat { padding: 1rem 1.15rem; }
.stat-label { font-size: .78rem; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: .4rem; }
.stat-value { font-family: var(--font-serif); font-size: 1.9rem; font-weight: 600; line-height: 1.15; margin-top: .25rem; font-variant-numeric: tabular-nums; }
.stat-value small { font-family: var(--font-sans); font-size: .9rem; font-weight: 500; color: var(--muted); }
.stat-sub { font-size: .8rem; color: var(--muted); margin-top: .15rem; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th {
  text-align: left; font-weight: 600; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); padding: .7rem 1.15rem; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface);
}
.table td { padding: .8rem 1.15rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .nowrap { white-space: nowrap; }
.table .shrink { width: 1%; white-space: nowrap; }
.row-title { font-weight: 600; color: var(--text); }
.row-title:hover { color: var(--accent); }
.subtle { color: var(--muted); font-size: .84rem; }
.dim { color: var(--muted); }

/* ---------- Badges, dots ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .5rem; border-radius: 999px;
  font-family: var(--font-sans); font-size: .74rem; font-weight: 600; line-height: 1.5; white-space: nowrap; vertical-align: middle; letter-spacing: 0;
  background: var(--surface-3); color: var(--text-2);
}
.badge-accent { background: var(--accent-soft); color: var(--accent-soft-ink); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-test { background: var(--warn-soft); color: var(--warn); letter-spacing: .06em; font-size: .68rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: var(--idle); }
.dot-ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot-bad { background: var(--bad); }
.dot-warn { background: var(--warn); }
.status { display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font: 600 .88rem/1 var(--font-sans); padding: .6rem .95rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer;
  white-space: nowrap; transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.btn-danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--border)); }
.btn-danger:hover { background: var(--bad-soft); color: var(--bad); }
.btn-quiet { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-quiet:hover { background: var(--surface-3); }
.btn-sm { padding: .4rem .65rem; font-size: .8rem; }
.btn[disabled], .btn.is-busy { opacity: .6; cursor: progress; }
.btn svg { width: 15px; height: 15px; }
.inline-form { display: inline; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 1.1rem; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; }
.field { display: grid; gap: .35rem; align-content: start; }
.field label, .field .label { font-weight: 600; font-size: .86rem; color: var(--text); }
.field .hint { font-size: .8rem; color: var(--muted); }
.field .error { font-size: .8rem; color: var(--bad); font-weight: 500; }
.input, select.input, textarea.input {
  width: 100%; font: 400 .93rem/1.4 var(--font-sans); color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: .55rem .7rem; transition: border-color .12s, box-shadow .12s;
}
textarea.input { min-height: 7rem; resize: vertical; line-height: 1.5; }
textarea.input.code { font-family: var(--font-mono); font-size: .85rem; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.has-error { border-color: var(--bad); }
.form-actions { display: flex; gap: .6rem; align-items: center; padding-top: .25rem; }
fieldset { border: 0; padding: 0; margin: 0; }
.section-title { font-family: var(--font-serif); font-size: 1.05rem; margin-bottom: .2rem; }
.section-lede { color: var(--muted); font-size: .86rem; margin-bottom: .9rem; }

/* Choice cards (radio) */
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .75rem; }
.choice { position: relative; display: block; border: 1px solid var(--border-strong); border-radius: var(--radius); padding: .85rem 1rem .9rem 2.6rem; cursor: pointer; background: var(--surface); }
.choice input { position: absolute; left: 1rem; top: 1.02rem; accent-color: var(--accent); }
.choice strong { display: block; font-size: .92rem; }
.choice span { font-size: .82rem; color: var(--muted); }
.choice:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* Filters / tabs */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tabs { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px; gap: 2px; }
.tabs a { padding: .32rem .8rem; border-radius: 999px; color: var(--text-2); font-weight: 600; font-size: .82rem; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.tabs .count { color: var(--muted); font-weight: 500; margin-left: .2rem; }
.search { display: flex; gap: .4rem; }
.search .input { min-width: 15rem; }

/* Flash messages */
.flashes { display: grid; gap: .5rem; margin-bottom: 1.25rem; }
.flash { display: flex; gap: .6rem; align-items: flex-start; padding: .75rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); font-size: .9rem; }
.flash::before { content: ""; width: 4px; align-self: stretch; border-radius: 4px; background: var(--info); flex: none; }
.flash-success::before { background: var(--ok); }
.flash-error::before { background: var(--bad); }
.flash-warning::before { background: var(--warn); }

/* Callouts */
.callout { display: flex; gap: .75rem; align-items: flex-start; padding: .85rem 1rem; border-radius: var(--radius); background: var(--warn-soft); color: var(--text); font-size: .9rem; margin-bottom: 1.25rem; }
.callout.info { background: var(--info-soft); }
.callout.bad { background: var(--bad-soft); }
.callout strong { font-weight: 600; }
.callout svg { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--warn); }

/* Definition lists */
.dl { display: grid; grid-template-columns: minmax(8rem, max-content) minmax(0, 1fr); gap: .55rem 1.25rem; margin: 0; font-size: .92rem; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- Haiku typography ---------- */
.poem { font-family: var(--font-serif); font-size: 1.06rem; line-height: 1.5; color: var(--text); margin: 0; }
.poem span { display: block; }
.poem-lg { font-size: 1.45rem; line-height: 1.55; }
.poem-sm { font-size: .97rem; line-height: 1.45; }
.byline { color: var(--muted); font-size: .84rem; margin-top: .35rem; }
.byline::before { content: "— "; }

/* ---------- Image gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; }
.art { overflow: hidden; display: flex; flex-direction: column; }
.art-img { position: relative; aspect-ratio: 3 / 2; background: var(--surface-3); overflow: hidden; border-bottom: 1px solid var(--border); }
.art-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.art:hover .art-img img { transform: scale(1.025); }
.art-img .badge { position: absolute; top: .65rem; left: .65rem; box-shadow: var(--shadow); }
.art-body { padding: 1rem 1.1rem 1.05rem; display: flex; flex-direction: column; gap: .7rem; flex: 1; }
.art-meta { display: flex; justify-content: space-between; align-items: center; gap: .5rem; font-size: .8rem; color: var(--muted); margin-top: auto; padding-top: .7rem; border-top: 1px dashed var(--border); }
.art-meta .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thumb { width: 72px; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 4px; border: 1px solid var(--border); background: var(--surface-3); }
.thumb-lg { width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.hero-img { border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow-lg); width: 100%; }

details.disclose summary { cursor: pointer; color: var(--muted); font-size: .84rem; width: max-content; }
details.disclose summary:hover { color: var(--text); }
pre.block { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .7rem .85rem; margin: .5rem 0 0; font-size: .82rem; line-height: 1.5; overflow-wrap: anywhere; }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: .85rem; padding: .75rem 1.15rem; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .grow .ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }

/* Empty states */
.empty { text-align: center; padding: 2.5rem 1.5rem; color: var(--muted); }
.empty h3 { color: var(--text); margin-bottom: .35rem; }
.empty .poem { color: var(--muted); margin: 0 auto .9rem; width: max-content; text-align: left; }

/* Pagination */
.pager { display: flex; justify-content: space-between; align-items: center; padding: .8rem 1.15rem; font-size: .85rem; color: var(--muted); border-top: 1px solid var(--border); }
.pager .actions .btn { min-width: 5.5rem; }

/* Auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 400px; padding: 2rem 2rem 1.75rem; }
.auth-card .brand { justify-content: center; padding: 0 0 1.5rem; }
.auth-card h1 { font-size: 1.45rem; text-align: center; margin-bottom: .35rem; }
.auth-card .lede { text-align: center; color: var(--muted); margin-bottom: 1.4rem; font-size: .9rem; }
.otp { text-align: center; font: 600 1.6rem/1 var(--font-mono); letter-spacing: .45em; padding: .7rem .5rem .7rem 1rem; }
.qr { background: #fff; padding: .75rem; border-radius: var(--radius-sm); border: 1px solid var(--border); width: max-content; margin: 0 auto 1rem; }
.btn-block { width: 100%; padding: .75rem; }

/* Spinner */
.spinner { width: 15px; height: 15px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; display: none; }
.is-busy .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .art:hover .art-img img { transform: none; } .spinner { animation-duration: 2s; } }

/* Frames list: thumbnail + first line of the haiku now showing */
a.showing { display: flex; gap: .7rem; align-items: center; color: inherit; }
a.showing:hover { text-decoration: none; }
a.showing:hover .poem { color: var(--accent); }
a.showing > span { display: grid; gap: .1rem; }

/* Narrower laptop windows: slimmer sidebar, drop secondary table columns */
@media (max-width: 1280px) {
  :root { --sidebar-w: 212px; }
  .hide-narrow { display: none; }
  .table th, .table td { padding-left: .85rem; padding-right: .85rem; }
}

.table-frames { table-layout: fixed; min-width: 760px; }
.table-frames .c-frame { width: 17%; } .table-frames .c-status { width: 12%; } .table-frames .c-owner { width: 13%; }
.table-frames .c-showing { width: 30%; } .table-frames .c-schedule { width: 15%; } .table-frames .c-gen { width: 13%; }
.table-frames td { overflow-wrap: break-word; }
.table-frames td .badge { margin-top: .2rem; }
@media (max-width: 1280px) { .table-frames .c-showing { width: 34%; } .table-frames .c-schedule { width: 18%; } }

/* Live updates (ADM-8) */
.live-indicator { display: flex; align-items: center; gap: .4rem; font-size: .78rem; color: var(--muted); margin-bottom: .6rem; }
.live-indicator[data-state="on"] .dot { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
@keyframes live-flash { from { box-shadow: 0 0 0 3px var(--accent); } to { box-shadow: 0 0 0 3px transparent; } }
.live-flash { animation: live-flash 1.6s ease-out; }
@keyframes live-flash-bg { from { background: var(--accent-soft); } to { background: transparent; } }
li.live-flash, td.live-flash, p.live-flash { animation: live-flash-bg 1.6s ease-out; }

/* Haiku import (HKU-2): drop zone, review table, tags */
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; min-height: 13rem; padding: 2rem 1.5rem; text-align: center; border: 2px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone strong { font-size: 1.02rem; }
.dropzone span { color: var(--muted); font-size: .86rem; }
.dropzone .dropzone-file { color: var(--text); font-weight: 600; font-family: var(--font-mono); font-size: .85rem; }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone:focus-within { box-shadow: 0 0 0 3px var(--accent-soft); }
.import-summary { display: flex; flex-wrap: wrap; gap: .4rem; }
.table-import { min-width: 720px; }
.table-import tr.is-muted td { color: var(--muted); }
.table-import tr.is-muted .poem { color: var(--muted); }
.import-errors { margin: 0; padding-left: 1.1rem; color: var(--bad); font-size: .86rem; }
.tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .35rem; }
.tag { display: inline-block; padding: .05rem .45rem; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: .74rem; line-height: 1.5; }
.form-more { border-top: 1px solid var(--border); padding-top: .9rem; }
.form-more > summary { cursor: pointer; font-weight: 600; font-size: .92rem; color: var(--text-2); }
.form-more[open] > summary { margin-bottom: 1rem; }
.toolbar-group { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.search { flex-wrap: nowrap; }
@media (max-width: 760px) { .search { flex-wrap: wrap; } .search .input { min-width: 0; flex: 1 1 12rem; } }
.search select.input { flex: none; width: auto; min-width: 0; max-width: 16rem; }
.check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .4rem .9rem; }
.check-list label { display: flex; align-items: center; gap: .45rem; font-size: .9rem; font-weight: 400; cursor: pointer; }
.check-list input { accent-color: var(--accent); }
.haiku-source .check-list { margin-top: .25rem; padding: .7rem .9rem; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.haiku-source:has(input[name=haiku_scope][value=all]:checked) .check-list { opacity: .5; }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; font-size: .92rem; }

/* Haiku list bulk selection (HKU-5) */
.bulk-bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; padding: .65rem 1rem; margin-bottom: 1rem; }
.bulk-bar.has-selection { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.bulk-select, .bulk-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.bulk-select strong { font-size: .9rem; margin-right: .25rem; }
.bulk-bar:not(.has-selection) .bulk-select strong { font-weight: 500; color: var(--muted); }
.bulk-actions .input { width: auto; min-width: 0; max-width: 14rem; padding-top: .45rem; padding-bottom: .45rem; }
.haiku-card { position: relative; display: flex; flex-direction: column; padding: 0; }
.haiku-card-link { flex: 1; display: flex; flex-direction: column; gap: .6rem; padding: 1.25rem 2.6rem 1.25rem 1.3rem; color: inherit; text-decoration: none; }
.haiku-card-link:hover { text-decoration: none; }
.haiku-card-link:hover .poem { color: var(--accent); }
.haiku-card-collections { font-size: .78rem; }
.card-check { position: absolute; top: .55rem; right: .55rem; z-index: 1; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: var(--radius-sm); cursor: pointer; }
.card-check:hover { background: var(--surface-2); }
.card-check input { width: 1.05rem; height: 1.05rem; accent-color: var(--accent); cursor: pointer; }
.haiku-card:has(.card-check input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
