/* ComicDogs — Oddly Enough Studio suite aesthetic (baseline §2), tuned for a
   content-dense browsing app: teal→slate→purple gradient, single coral accent,
   flat translucent hairline panels, system font stack. */
:root {
  --bg-grad: linear-gradient(150deg, #1e5a4d 0%, #294a55 42%, #3b2f60 100%);
  --accent: #ff9a5a;
  --accent-dim: #e07d3f;
  --panel: rgba(255, 255, 255, 0.043);
  --panel-2: rgba(255, 255, 255, 0.07);
  --hairline: rgba(255, 255, 255, 0.12);
  --hairline-strong: rgba(255, 255, 255, 0.22);
  --text: #f3f5f7;
  --muted: rgba(255, 255, 255, 0.55);
  --muted-2: rgba(255, 255, 255, 0.38);
  --go: #57c97a;
  --err: #ff6b6b;
  --warn: #ffcf5c;
  --break: #b18cff;
  --radius: 12px;
  --font: -apple-system, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-grad) fixed;
  background-attachment: fixed;
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3 { color: #fff; font-weight: 650; line-height: 1.2; margin: 0 0 .5rem; }

/* ── Layout shell ─────────────────────────────────────────────────────────── */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 1rem; }
header.site {
  position: sticky; top: 0; z-index: 20;
  background: rgba(20, 30, 34, 0.72);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.site-inner { display: flex; align-items: center; gap: 1rem; padding: .6rem 1rem; max-width: 1080px; margin: 0 auto; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 750; font-size: 1.15rem; color: #fff; letter-spacing: .2px; }
.brand:hover { text-decoration: none; }
.brand .dot { color: var(--accent); }
.site-search { flex: 1 1 260px; display: flex; }
.site-search input {
  flex: 1; min-width: 0; padding: .5rem .8rem; border-radius: 999px 0 0 999px;
  border: 1px solid var(--hairline); border-right: none; background: rgba(0,0,0,0.22);
  color: var(--text); font-size: .95rem;
}
.site-search button {
  border-radius: 0 999px 999px 0; border: 1px solid var(--accent);
  background: var(--accent); color: #241206; font-weight: 650; padding: 0 1rem; cursor: pointer;
}
.site-nav { display: flex; align-items: center; gap: .9rem; font-size: .9rem; }
.site-nav a { color: var(--muted); }
.site-nav a:hover { color: #fff; text-decoration: none; }
.site-nav a.active { color: #fff; }

main { padding: 1.4rem 0 3rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ── Panels ───────────────────────────────────────────────────────────────── */
.panel {
  background: var(--panel); border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: 1.1rem 1.2rem; margin-bottom: 1.2rem;
}
.panel h2 { font-size: 1.05rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 1rem; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: #fff; }

/* ── Cover grid ───────────────────────────────────────────────────────────── */
.grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.cover-card {
  background: var(--panel); border: 1px solid var(--hairline); border-radius: var(--radius);
  overflow: hidden; transition: border-color .15s, transform .15s;
}
.cover-card:hover { border-color: var(--hairline-strong); transform: translateY(-2px); text-decoration: none; }
.cover-thumb {
  aspect-ratio: 2 / 3; background: rgba(0,0,0,0.28); display: flex; align-items: center; justify-content: center;
  position: relative;
}
.cover-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cover-thumb .noart { color: var(--muted-2); font-size: .8rem; text-align: center; padding: .5rem; }
.cover-meta { padding: .5rem .6rem .7rem; }
.cover-meta .t { font-size: .9rem; color: #fff; font-weight: 600; }
.cover-meta .s { font-size: .78rem; color: var(--muted); }

/* ── Badges ───────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .04em;
  padding: .12rem .45rem; border-radius: 999px; text-transform: uppercase; vertical-align: middle;
}
.badge.key { background: rgba(255,207,92,.15); color: var(--warn); border: 1px solid rgba(255,207,92,.35); }
.badge.variant { background: rgba(177,140,255,.14); color: var(--break); border: 1px solid rgba(177,140,255,.32); }
.badge.slab { background: rgba(87,201,122,.14); color: var(--go); border: 1px solid rgba(87,201,122,.32); }
.badge.cover-key { position: absolute; top: .4rem; left: .4rem; }

/* ── Issue / series detail ────────────────────────────────────────────────── */
.detail { display: grid; grid-template-columns: 260px 1fr; gap: 1.6rem; align-items: start; }
.detail .cover-big { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--hairline); background: rgba(0,0,0,.28); aspect-ratio: 2/3; }
.detail .cover-big img { width: 100%; height: 100%; object-fit: cover; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: .3rem 1rem; font-size: .92rem; margin: .8rem 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.roles { color: var(--muted); }
@media (max-width: 640px) { .detail { grid-template-columns: 1fr; } .detail .cover-big { max-width: 240px; } }

/* ── Variant list ─────────────────────────────────────────────────────────── */
.variant-row {
  display: flex; align-items: center; gap: .9rem; padding: .6rem 0; border-top: 1px solid var(--hairline);
}
.variant-row:first-child { border-top: none; }
.variant-row .vt { width: 46px; aspect-ratio: 2/3; border-radius: 6px; overflow: hidden; background: rgba(0,0,0,.3); flex: none; }
.variant-row .vt img { width: 100%; height: 100%; object-fit: cover; }
.variant-row .vname { flex: 1; }
.variant-row form { margin: 0; }

/* ── Tables (collection) ──────────────────────────────────────────────────── */
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th, table.data td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--hairline); }
table.data th { color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.table-scroll { overflow-x: auto; }

/* ── Forms + buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-block; border: 1px solid var(--accent); background: var(--accent); color: #241206;
  font-weight: 650; font-size: .9rem; padding: .5rem .95rem; border-radius: 8px; cursor: pointer; text-align: center;
}
.btn:hover { background: var(--accent-dim); border-color: var(--accent-dim); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--hairline-strong); }
.btn.ghost:hover { background: var(--panel-2); }
.btn.sm { padding: .3rem .6rem; font-size: .8rem; }
.btn.danger { background: transparent; color: var(--err); border-color: rgba(255,107,107,.4); }
.btn.danger:hover { background: rgba(255,107,107,.12); }

form.stack { display: flex; flex-direction: column; gap: .8rem; max-width: 400px; }
label { font-size: .85rem; color: var(--muted); display: block; margin-bottom: .25rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%; padding: .5rem .7rem; border-radius: 8px; border: 1px solid var(--hairline);
  background: rgba(0,0,0,.22); color: var(--text); font-size: .95rem; font-family: var(--font);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
.form-row { display: flex; gap: .8rem; flex-wrap: wrap; }
.form-row > div { flex: 1 1 140px; }
fieldset { border: 1px solid var(--hairline); border-radius: var(--radius); padding: 1rem; margin: 0 0 1rem; }
legend { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; padding: 0 .4rem; }

/* ── Flash / notices ──────────────────────────────────────────────────────── */
.flash { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid; font-size: .9rem; }
.flash.ok { background: rgba(87,201,122,.1); border-color: rgba(87,201,122,.4); color: #b7f0c6; }
.flash.err { background: rgba(255,107,107,.1); border-color: rgba(255,107,107,.4); color: #ffc7c7; }
.flash.info { background: rgba(177,140,255,.1); border-color: rgba(177,140,255,.4); color: #dcceff; }

/* ── Hero (home) ──────────────────────────────────────────────────────────── */
.hero { text-align: center; padding: 2rem 0 1.4rem; }
.hero h1 { font-size: 2.1rem; }
.hero p { color: var(--muted); font-size: 1.05rem; max-width: 560px; margin: .3rem auto 1.4rem; }
.hero .big-search { max-width: 560px; margin: 0 auto; display: flex; }
.hero .big-search input { flex: 1; padding: .8rem 1rem; border-radius: 999px 0 0 999px; border: 1px solid var(--hairline); border-right: none; background: rgba(0,0,0,.25); color: var(--text); font-size: 1rem; }
.hero .big-search button { border-radius: 0 999px 999px 0; border: 1px solid var(--accent); background: var(--accent); color: #241206; font-weight: 700; padding: 0 1.4rem; cursor: pointer; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { background: var(--panel-2); border: 1px solid var(--hairline); border-radius: 999px; padding: .3rem .8rem; font-size: .85rem; color: var(--text); }
.chip:hover { border-color: var(--hairline-strong); text-decoration: none; }
.chip .n { color: var(--muted); }

/* ── Footer ───────────────────────────────────────────────────────────────── */
footer.site { border-top: 1px solid var(--hairline); padding: 1.4rem 0 2rem; color: var(--muted); font-size: .82rem; }
footer.site .wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
footer.site a { color: var(--muted); }
footer.site a:hover { color: #fff; }

.empty { text-align: center; color: var(--muted); padding: 2.4rem 1rem; }
