:root {
  color-scheme: dark;
  --void: #05090c;
  --hull: #081318;
  --panel: #101d22;
  --panel-2: #16262b;
  --line: #2d4b50;
  --line-bright: #4f7d80;
  --paper: #e9e0c8;
  --muted: #9cadab;
  --cyan: #62e5df;
  --cyan-dim: #2c8f91;
  --amber: #ffb44f;
  --amber-dim: #a26325;
  --red: #f26b55;
  --green: #8cdf95;
  --shadow: rgba(0, 0, 0, 0.52);
  --display: "Arial Narrow", "Roboto Condensed", "Segoe UI", sans-serif;
  --mono: "Cascadia Mono", "Lucida Console", Consolas, monospace;
  --body: Inter, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--paper);
  background:
    radial-gradient(circle at 18% 12%, rgba(42, 122, 126, 0.16), transparent 30rem),
    radial-gradient(circle at 88% 38%, rgba(177, 99, 37, 0.12), transparent 32rem),
    linear-gradient(140deg, #071015 0%, #03070a 65%, #091318 100%);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  opacity: 0.12;
  background: repeating-linear-gradient(to bottom, transparent 0 3px, rgba(0, 0, 0, 0.28) 4px);
  mix-blend-mode: multiply;
}

button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

a { color: inherit; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  transform: translateY(-180%);
  padding: 0.65rem 0.9rem;
  background: var(--amber);
  color: #171007;
  font-weight: 800;
  text-decoration: none;
}

.skip-link:focus { transform: translateY(0); }

.site-shell { min-height: 100vh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto minmax(180px, 1fr);
  align-items: center;
  gap: 1rem;
  min-height: 82px;
  padding: 0.7rem clamp(1rem, 3vw, 3rem);
  border-bottom: 1px solid var(--line-bright);
  background: rgba(7, 16, 20, 0.95);
  box-shadow: 0 10px 32px var(--shadow);
  backdrop-filter: blur(12px);
}

.topbar::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -4px;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--amber), transparent);
  opacity: 0.45;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  width: fit-content;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  width: 44px;
  height: 44px;
  border: 1px solid var(--amber);
  background: repeating-linear-gradient(135deg, rgba(255, 180, 79, 0.1) 0 3px, transparent 3px 7px);
  transform: rotate(45deg);
  box-shadow: inset 0 0 18px rgba(255, 180, 79, 0.15), 0 0 12px rgba(255, 180, 79, 0.12);
}

.brand-mark::before,
.brand-mark::after,
.brand-mark i {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 22px;
  height: 2px;
  background: var(--cyan);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 8px var(--cyan);
}

.brand-mark::after { transform: translate(-50%, -50%) rotate(90deg); }
.brand-mark i { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }

.brand strong {
  display: block;
  color: var(--paper);
  font-family: var(--display);
  font-size: 1.35rem;
  letter-spacing: 0.16em;
  line-height: 1;
}

.brand small {
  display: block;
  margin-top: 0.35rem;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.primary-nav { display: flex; gap: 0.35rem; }

.primary-nav a {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.6rem 0.9rem;
  border: 1px solid transparent;
  color: var(--muted);
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.primary-nav a span { color: var(--amber); font-family: var(--mono); font-size: 0.72rem; }

.primary-nav a:hover,
.primary-nav a.active {
  border-color: var(--line-bright);
  color: var(--paper);
  background: linear-gradient(180deg, rgba(55, 105, 108, 0.25), rgba(16, 29, 34, 0.5));
}

.curator-button,
.control-button,
.small-button,
.submit-button {
  min-height: 42px;
  border: 1px solid var(--line-bright);
  color: var(--paper);
  background: linear-gradient(180deg, #1c3035, #0e191d);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.05), 0 5px 14px var(--shadow);
  cursor: pointer;
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.curator-button {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 0.85rem;
  color: var(--muted);
}

.curator-button[aria-pressed="true"] { border-color: var(--amber); color: var(--amber); }

.status-lamp,
.footer-signal i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 9px var(--green);
}

.status-lamp.unlocked { background: var(--amber); box-shadow: 0 0 9px var(--amber); }

#main-content { min-height: calc(100vh - 140px); }

.view { animation: view-in 240ms ease-out; }

@keyframes view-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 3.5rem clamp(1rem, 4vw, 4rem) 1.5rem;
}

.eyebrow {
  margin: 0 0 0.45rem;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }

h1, h2, h3 {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.055em;
}

.section-heading h1 {
  margin-bottom: 0.3rem;
  font-size: clamp(2rem, 5vw, 4.8rem);
  line-height: 0.95;
}

.section-heading > p,
.section-heading .lede { max-width: 56ch; color: var(--muted); }

.reader-layout {
  display: grid;
  grid-template-columns: 104px minmax(0, 1040px) 290px;
  gap: clamp(1rem, 2vw, 1.6rem);
  align-items: start;
  max-width: 1550px;
  margin: 0 auto;
  padding: 1.25rem clamp(1rem, 3vw, 3rem) 4rem;
}

.archive-rail,
.signal-panel,
.notes-panel,
.comments-panel,
.moderation-panel,
.world-card,
.character-card {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(20, 37, 43, 0.98), rgba(9, 18, 22, 0.98));
  box-shadow: 0 18px 45px var(--shadow), inset 0 0 24px rgba(74, 170, 171, 0.035);
}

.archive-rail { position: sticky; top: 105px; padding: 0.55rem; }

.panel-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 0.8rem;
  color: var(--amber);
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.panel-label::after { content: ""; flex: 1; height: 1px; background: var(--amber-dim); }

.comic-index { display: grid; gap: 0.5rem; }

.comic-index .index-divider { height: 1px; margin: 0.05rem 0; background: linear-gradient(90deg, transparent, rgba(229, 211, 175, 0.55), transparent); }
.comic-index .index-spacer {
  min-height: 54px; display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem 0.75rem;
  border: 1px dashed rgba(229, 211, 175, 0.18); color: rgba(229, 211, 175, 0.35);
  font-family: var(--mono); font-size: 0.7rem;
}
.comic-index button.index-endpoint { border-color: #2f281f; background: linear-gradient(#cbb78e, #9d8765); }
.comic-index button.index-endpoint .index-no { min-width: 3.8rem; color: #3b2a16; }

.comic-index button {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.18rem;
  width: 100%;
  padding: 0.55rem 0.45rem;
  border: 1px solid transparent;
  color: var(--muted);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.comic-index button:hover,
.comic-index button.active {
  border-color: var(--cyan-dim);
  color: var(--paper);
  background: rgba(98, 229, 223, 0.07);
}

.comic-index .index-no { color: var(--amber); font-family: var(--mono); font-size: 0.78rem; }
.comic-index strong { display: block; font-family: var(--display); font-size: 0.72rem; line-height: 1.15; text-transform: uppercase; overflow-wrap: anywhere; }
.comic-index small { display: none; }

.signal-panel { margin-top: 1rem; padding: 0.85rem; color: var(--muted); font-family: var(--mono); font-size: 0.76rem; }
.signal-bars { display: flex; align-items: end; gap: 4px; height: 28px; margin-top: 0.6rem; }
.signal-bars i { width: 9px; background: var(--cyan); box-shadow: 0 0 8px rgba(98, 229, 223, 0.5); }
.signal-bars i:nth-child(1) { height: 30%; }
.signal-bars i:nth-child(2) { height: 55%; }
.signal-bars i:nth-child(3) { height: 75%; }
.signal-bars i:nth-child(4) { height: 100%; }

.reader-main { min-width: 0; }

.reader-toolbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.reader-title { text-align: center; }
.reader-title h1 { margin: 0; font-size: clamp(1.25rem, 2.2vw, 2rem); }
.reader-title p { margin: 0.2rem 0 0; color: var(--cyan); font-family: var(--mono); font-size: 0.75rem; }

.control-button { padding: 0.65rem 0.9rem; }
.control-button:hover:not(:disabled), .small-button:hover, .submit-button:hover { border-color: var(--amber); color: var(--amber); }
.control-button:disabled { opacity: 0.35; cursor: not-allowed; }

.comic-frame {
  position: relative;
  min-height: 480px;
  padding: clamp(0.45rem, 1.2vw, 0.85rem);
  border: 1px solid var(--line-bright);
  background: #020405;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.66), 0 0 0 4px rgba(8, 19, 24, 0.9), 0 0 0 5px var(--line);
}

.comic-frame::before,
.comic-frame::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: var(--amber);
  opacity: 0.7;
}

.comic-frame::before { top: -1px; left: -1px; border-top: 2px solid; border-left: 2px solid; }
.comic-frame::after { right: -1px; bottom: -1px; border-right: 2px solid; border-bottom: 2px solid; }

.comic-frame img {
  display: block;
  width: 100%;
  height: auto;
  background: #111;
  cursor: zoom-in;
}

.page-dock {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.7rem 1rem;
  padding: 0.9rem 0.2rem 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.76rem;
}

.page-dock span:first-child { color: var(--amber); }

.reader-side { display: grid; gap: 1rem; position: sticky; top: 105px; }
.notes-panel, .comments-panel, .moderation-panel { padding: 1.1rem; }
.notes-panel p, .comments-panel p { color: var(--muted); }

.character-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.9rem; }
.character-chips a {
  padding: 0.28rem 0.5rem;
  border: 1px solid var(--line);
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 0.72rem;
  text-decoration: none;
}

.comment-list { display: grid; gap: 0.7rem; margin: 0 0 1rem; }
.comment {
  padding: 0.75rem;
  border-left: 2px solid var(--cyan-dim);
  background: rgba(0, 0, 0, 0.2);
}
.comment-head { display: flex; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.3rem; color: var(--amber); font-family: var(--mono); font-size: 0.72rem; }
.comment p { margin: 0; color: var(--paper); font-size: 0.9rem; }
.comment-empty { color: var(--muted); font-style: italic; }

.comment-form { display: grid; gap: 0.55rem; }
.comment-form label { color: var(--cyan); font-family: var(--mono); font-size: 0.76rem; }
.comment-form input,
.comment-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 0.7rem;
  color: var(--paper);
  background: #081115;
}
.comment-form textarea { min-height: 92px; resize: vertical; }
.comment-form small { color: var(--muted); font-size: 0.72rem; }
.submit-button { padding: 0.65rem 0.8rem; }

.moderation-panel { border-color: var(--amber-dim); }
.moderation-panel[hidden] { display: none; }
.moderation-item { display: grid; gap: 0.55rem; padding: 0.75rem 0; border-top: 1px solid var(--line); }
.moderation-item:first-of-type { border-top: 0; }
.moderation-item p { margin: 0; font-size: 0.88rem; }
.moderation-item small { color: var(--red); font-family: var(--mono); }
.moderation-actions { display: flex; gap: 0.4rem; }
.small-button { min-height: 34px; padding: 0.35rem 0.55rem; font-size: 0.72rem; }
.small-button.danger:hover { border-color: var(--red); color: var(--red); }

.curator-panel {
  border-color: var(--amber-dim);
  background: linear-gradient(145deg, rgba(162, 99, 37, 0.12), rgba(16, 29, 34, 0.9));
}
.curator-panel > p { margin: 0.7rem 0; color: var(--muted); font-size: 0.88rem; }
.curator-panel > small { display: block; margin-top: 0.75rem; color: var(--amber); font-family: var(--mono); font-size: 0.7rem; }
.curator-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem; }
.curator-actions .small-button { width: 100%; }
.upload-button { display: grid; place-items: center; text-align: center; }
.small-button:disabled { opacity: 0.35; cursor: not-allowed; }

.archive-dialog {
  width: min(620px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 0;
  border: 1px solid var(--cyan-dim);
  color: var(--paper);
  background: var(--panel);
  box-shadow: 0 28px 90px #000;
}
.archive-dialog::backdrop { background: rgba(1, 5, 7, 0.82); backdrop-filter: blur(4px); }
.dialog-card { display: grid; gap: 0.55rem; padding: 1.35rem; }
.dialog-card h2 { margin: 0.25rem 0; color: var(--paper); font-family: var(--display); text-transform: uppercase; }
.dialog-card > p { margin: 0 0 0.5rem; color: var(--muted); }
.dialog-card label { color: var(--cyan); font-family: var(--mono); font-size: 0.74rem; text-transform: uppercase; }
.dialog-card label small { color: var(--muted); text-transform: none; }
.dialog-card input,
.dialog-card textarea {
  width: 100%;
  padding: 0.7rem;
  border: 1px solid var(--line-bright);
  color: var(--paper);
  background: #071115;
}
.dialog-card textarea { min-height: 88px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.form-grid > div { display: grid; gap: 0.4rem; }
.form-error { min-height: 1.4em; color: var(--red) !important; font-family: var(--mono); font-size: 0.75rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 0.4rem; }
.dialog-actions button { padding-inline: 0.85rem; }

.character-grid,
.world-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 4rem) 5rem;
}

.character-card { overflow: hidden; transition: transform 160ms ease, border-color 160ms ease; }
.character-card:hover { transform: translateY(-4px); border-color: var(--cyan-dim); }
.character-image {
  position: relative;
  height: 245px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: #d9d4c8;
}
.character-image img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 7%; cursor: zoom-in; transition: transform 300ms ease; }
.character-card:hover img { transform: scale(1.035); }
.character-code { position: absolute; right: 0.7rem; bottom: 0.6rem; padding: 0.25rem 0.4rem; color: #081318; background: var(--amber); font-family: var(--mono); font-size: 0.7rem; font-weight: 800; }
.character-copy { padding: 1rem; }
.character-copy h2 { margin-bottom: 0.15rem; font-size: 1.35rem; }
.character-meta { color: var(--cyan); font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; }
.character-copy p { margin: 0.8rem 0 0; color: var(--muted); font-size: 0.9rem; }
.character-stats { display: flex; justify-content: space-between; gap: 0.75rem; margin-top: 0.9rem; padding-top: 0.7rem; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 0.72rem; }
.character-stats span:last-child { color: var(--amber); }

.world-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.world-card { position: relative; min-height: 280px; padding: 1.5rem; overflow: hidden; }
.world-card::after {
  content: attr(data-code);
  position: absolute;
  right: 1rem;
  bottom: -0.35rem;
  color: rgba(98, 229, 223, 0.06);
  font-family: var(--mono);
  font-size: 4.5rem;
  font-weight: 900;
  line-height: 1;
}
.world-card h2 { margin-bottom: 0.3rem; font-size: clamp(1.5rem, 3vw, 2.4rem); }
.world-kicker { color: var(--amber); font-family: var(--mono); font-size: 0.75rem; text-transform: uppercase; }
.world-card > p { max-width: 58ch; margin-top: 1.2rem; color: var(--muted); }
.fact-list { position: relative; z-index: 1; display: grid; gap: 0.4rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.fact-list li { display: flex; gap: 0.55rem; font-family: var(--mono); font-size: 0.78rem; }
.fact-list li::before { content: "▸"; color: var(--cyan); }

.world-intro {
  max-width: 1400px;
  margin: 0 auto 1rem;
  padding: 0 clamp(1rem, 4vw, 4rem);
}
.world-transmission {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--line);
  background: rgba(4, 10, 13, 0.7);
  color: var(--muted);
}
.world-transmission strong { color: var(--cyan); font-family: var(--mono); }

.footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem clamp(1rem, 3vw, 3rem);
  border-top: 1px solid var(--line);
  color: #748786;
  background: #050b0e;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
}
.footer-signal { color: var(--green); }
.footer-signal i { margin-right: 0.4rem; width: 6px; height: 6px; }
.footer a {
  color: #d5bd7d;
  text-decoration: none;
}
.footer a:hover,
.footer a:focus-visible { color: #fff1c4; text-decoration: underline; }

.privacy-return {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  text-decoration: none;
}

.privacy-main {
  width: min(900px, calc(100% - 2rem));
  margin: clamp(1rem, 4vw, 3rem) auto;
}

.privacy-record {
  padding: clamp(1.2rem, 4vw, 3rem);
  border: 4px solid #211c17;
  border-radius: 5px;
  color: #d8cab0;
  background:
    repeating-linear-gradient(90deg, transparent 0 29px, rgba(255,255,255,.012) 30px),
    linear-gradient(#4f4333, #382f25);
  box-shadow: inset 0 0 0 1px #756349, 0 18px 35px rgba(0,0,0,.35);
}

.privacy-record h1,
.privacy-record h2,
.privacy-record h3 { color: #f1e2bf; font-family: var(--display); text-transform: uppercase; }
.privacy-record h1 { margin: .35rem 0 0; font-size: clamp(2rem, 7vw, 4.5rem); letter-spacing: .04em; }
.privacy-record h2 { margin: 2.2rem 0 .65rem; font-size: clamp(1.15rem, 3vw, 1.65rem); }
.privacy-record h3 { margin: 1.35rem 0 .35rem; color: #d5bd7d; font-size: .95rem; }
.privacy-record p,
.privacy-record li { line-height: 1.72; }
.privacy-record p { margin: .55rem 0; }
.privacy-record ul { padding-left: 1.25rem; }
.privacy-record code { color: #fff1c4; font-family: var(--mono); }
.privacy-effective { margin-top: 0 !important; color: #b4a486; font-family: var(--mono); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
.privacy-lead { max-width: 68ch; padding: 1rem 1.15rem; border-left: 4px solid #d5bd7d; background: rgba(20,17,13,.24); font-size: 1.05rem; }
.privacy-note { margin-top: 2rem; padding: 1rem 1.15rem; border: 2px dashed #8d7856; background: rgba(20,17,13,.32); line-height: 1.6; }
.privacy-note strong { color: #d5bd7d; }

.toast {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  z-index: 50;
  max-width: min(360px, calc(100vw - 2.4rem));
  padding: 0.85rem 1rem;
  border: 1px solid var(--cyan-dim);
  color: var(--paper);
  background: #0d1c20;
  box-shadow: 0 12px 30px var(--shadow);
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: 180ms ease;
}
.toast.show { opacity: 1; transform: translateY(0); }

body.viewer-open { overflow: hidden; }

.image-viewer {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: clamp(2.75rem, 6vw, 4.5rem) clamp(0.5rem, 3vw, 2rem) 2rem;
  border: 0;
  overflow: auto;
  color: var(--paper);
  background: rgba(3, 6, 7, 0.96);
  overscroll-behavior: contain;
}

.image-viewer::backdrop { background: rgba(0, 0, 0, 0.92); }

.image-viewer img {
  display: block;
  height: auto;
  margin: 0 auto;
  cursor: zoom-out;
  touch-action: pan-x pan-y pinch-zoom;
  box-shadow: 0 18px 70px #000;
}

.image-viewer img.viewer-comic { width: min(1400px, 100%); }
.image-viewer img.viewer-character { width: min(1000px, 100%); }

.image-viewer-hint {
  position: fixed;
  z-index: 2;
  top: max(0.75rem, env(safe-area-inset-top));
  left: 50%;
  margin: 0;
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(222, 203, 164, 0.45);
  border-radius: 4px;
  color: #decba4;
  background: rgba(3, 6, 7, 0.82);
  font-family: var(--hand);
  font-size: 0.78rem;
  text-align: center;
  transform: translateX(-50%);
  pointer-events: none;
}

.image-viewer-close {
  position: fixed;
  z-index: 2;
  top: max(0.65rem, env(safe-area-inset-top));
  right: max(0.65rem, env(safe-area-inset-right));
  min-width: 48px;
  min-height: 44px;
  padding: 0.55rem 0.8rem;
  border: 1px solid #decba4;
  border-radius: 4px;
  color: #302a22;
  background: linear-gradient(#d6c39b, #ad9871);
  box-shadow: 0 5px 18px #000;
  font-family: var(--hand);
  font-weight: 800;
  cursor: pointer;
}

.error-panel {
  max-width: 700px;
  margin: 5rem auto;
  padding: 2rem;
  border: 1px solid var(--red);
  background: var(--panel);
}
.error-panel h1 { color: var(--red); }

@media (max-width: 1180px) {
  .topbar { grid-template-columns: 1fr auto; }
  .primary-nav { grid-column: 1 / -1; grid-row: 2; justify-content: center; }
  .reader-layout { grid-template-columns: 104px minmax(0, 1fr); }
  .reader-side { grid-column: 2; position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .moderation-panel { grid-column: 1 / -1; }
  .character-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 780px) {
  .topbar { position: static; grid-template-columns: 1fr; gap: 0.7rem; }
  .brand, .curator-button { justify-self: center; }
  .primary-nav { grid-column: 1; grid-row: auto; width: 100%; overflow-x: auto; justify-content: start; }
  .primary-nav a { flex: 1 0 auto; justify-content: center; }
  .section-heading { display: block; padding-top: 2.2rem; }
  .reader-layout { grid-template-columns: 1fr; }
  .archive-rail { position: static; overflow: hidden; }
  .comic-index { display: flex; overflow-x: auto; padding-bottom: 0.4rem; }
  .comic-index button { flex: 0 0 190px; }
  .comic-index .index-spacer { flex: 0 0 150px; }
  .comic-index .index-divider { flex: 0 0 1px; height: auto; }
  .signal-panel { display: none; }
  .reader-side { grid-column: 1; grid-template-columns: 1fr; }
  .moderation-panel { grid-column: auto; }
  .character-grid, .world-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer { flex-direction: column; align-items: center; text-align: center; }
}

@media (max-width: 780px) {
  .image-viewer { padding-inline: 0.35rem; }
  .image-viewer img.viewer-comic,
  .image-viewer img.viewer-character { width: 100%; }
}

@media (max-width: 520px) {
  .brand strong { font-size: 1.05rem; }
  .brand small { font-size: 0.62rem; }
  .reader-toolbar { grid-template-columns: 1fr 1fr; }
  .reader-title { grid-column: 1 / -1; grid-row: 1; }
  .reader-toolbar .control-button:first-child { grid-column: 1; }
  .reader-toolbar .control-button:last-child { grid-column: 2; }
  .character-grid, .world-grid { grid-template-columns: 1fr; }
  .character-image { height: 290px; }
  .world-transmission { grid-template-columns: 1fr; }
  .form-grid, .curator-actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* AR-07 in-world housing and archive modules */
.site-shell {
  position: relative;
  margin: 10px;
  min-height: calc(100vh - 20px);
  border: 5px solid #241f19;
  border-radius: 9px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.025), transparent 16%, rgba(0,0,0,.025) 63%, transparent),
    #29251e;
  box-shadow: inset 0 0 0 2px #756248, inset 0 0 55px rgba(0,0,0,.35), 0 20px 60px rgba(0,0,0,.7);
}

.site-shell::before,
.site-shell::after {
  content: "+";
  position: absolute;
  z-index: 18;
  width: 19px;
  height: 19px;
  border: 1px solid #191610;
  border-radius: 50%;
  color: #241f18;
  background: radial-gradient(circle, #8f7959, #4e4233 72%);
  box-shadow: inset 1px 1px rgba(255,255,255,.2), 0 1px 2px #000;
  font: 700 16px/17px Arial, sans-serif;
  text-align: center;
}
.site-shell::before { top: 8px; left: 8px; transform: rotate(18deg); }
.site-shell::after { top: 8px; right: 8px; transform: rotate(-31deg); }

.topbar { top: 0; border-radius: 3px 3px 0 0; }

.equipment-strip {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  min-height: 35px;
  padding: .32rem clamp(1rem, 3vw, 3rem);
  border-top: 1px solid #8a7557;
  border-bottom: 3px solid #201c16;
  color: #d8c8a9;
  background: linear-gradient(#3c3429, #2a251e);
  box-shadow: inset 0 1px rgba(255,255,255,.1), inset 0 -2px 4px rgba(0,0,0,.5);
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .05em;
}
.equipment-strip > span { padding-right: 1.1rem; border-right: 1px solid #695943; }
.equipment-strip b { margin-right: .35rem; color: #a99878; font-weight: 500; }
.equipment-meter { display: inline-flex; align-items: center; gap: 3px; }
.equipment-meter i { width: 6px; height: 12px; border: 1px solid #152016; background: #62ba63; box-shadow: 0 0 4px rgba(112,238,111,.45); }
.equipment-meter i:nth-of-type(5) { background: #2d422e; box-shadow: none; }
.equipment-strip .warning-label {
  margin-left: auto;
  padding: .18rem .48rem;
  border: 0;
  color: #2d281f;
  background: #d5bd7d;
  box-shadow: 0 1px 2px #000;
  font-family: var(--hand);
  font-size: .67rem;
  font-weight: 800;
  letter-spacing: 0;
  transform: rotate(-.45deg);
}

.reader-layout { padding-top: 1.45rem; }
.reader-toolbar {
  min-height: 83px;
  margin-bottom: 1rem;
  padding: .72rem;
  border: 4px solid #1e1a15;
  border-radius: 6px;
  background: linear-gradient(135deg, #67563f, #41372b);
  box-shadow: inset 0 0 0 2px #816d50, inset 0 8px 16px rgba(0,0,0,.18), 0 7px 13px rgba(0,0,0,.4);
}
.reader-title {
  align-self: stretch;
  display: grid;
  align-content: center;
  padding: .35rem 1rem;
  border: 2px solid #161b18;
  border-radius: 12px / 7px;
  background:
    linear-gradient(105deg, rgba(255,255,255,.08), transparent 23%),
    radial-gradient(ellipse at center, #23392f, #101a17 78%);
  box-shadow: inset 0 3px 12px rgba(0,0,0,.85), 0 1px rgba(255,255,255,.12);
  text-shadow: 0 0 7px rgba(140,223,149,.35);
}
.reader-title h1 { color: #c9e0b8; font-family: var(--mono); letter-spacing: .08em; }
.reader-title p { color: #8cdf95; }
.reader-toolbar .control-button {
  min-width: 84px;
  border: 1px solid #d9c59d;
  border-bottom: 4px solid #6d5c43;
  border-radius: 4px;
  color: var(--marker);
  background: linear-gradient(#c8b38b, #a38c68);
  box-shadow: inset 1px 1px rgba(255,255,255,.55), inset -1px -1px rgba(58,44,30,.25), 0 4px 0 #211c17;
  font-family: var(--hand);
  letter-spacing: 0;
  text-transform: none;
}
.reader-toolbar .control-button:hover:not(:disabled) { color: #1d1914; filter: brightness(1.07); }
.reader-toolbar .control-button:active:not(:disabled) { border-bottom-width: 1px; box-shadow: inset 2px 3px 5px rgba(0,0,0,.4), 0 1px #211c17; transform: translateY(3px); }

.reader-toolbar .transport-button {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  place-items: center;
  min-width: 92px;
  min-height: 59px;
  padding: .42rem .7rem .28rem;
  border-radius: 3px 3px 7px 7px;
}
.transport-symbol {
  color: #29231c;
  font-family: Arial, sans-serif;
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: -.18em;
  line-height: 1;
  text-shadow: 0 1px rgba(255,255,255,.28);
}
.play-button .transport-symbol {
  padding-left: .16em;
  font-size: 1.45rem;
  letter-spacing: 0;
}
.transport-label {
  color: #44382a;
  font-family: var(--hand);
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .04em;
  line-height: 1;
}
.transport-button::after {
  content: "";
  position: absolute;
  right: 7px;
  bottom: 6px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #3a3125;
  box-shadow: inset 0 1px 1px #111;
}
.transport-button:active:not(:disabled) .transport-symbol { transform: translateY(1px); }
.transport-button:disabled .transport-symbol,
.transport-button:disabled .transport-label { opacity: .42; }

.comic-frame {
  isolation: isolate;
  padding: clamp(.85rem, 1.5vw, 1.15rem);
  border: 7px solid #201c17;
  border-radius: 12px;
  background: #0b0d0c;
  box-shadow: inset 0 0 0 3px #6f6049, inset 0 0 25px #000, 0 18px 48px rgba(0,0,0,.72), 0 0 0 2px #8d7858;
}
.comic-frame::before {
  z-index: 2;
  inset: clamp(.85rem, 1.5vw, 1.15rem);
  width: auto;
  height: auto;
  border: 0;
  border-radius: 4px;
  background: linear-gradient(112deg, rgba(255,255,255,.10), transparent 16%, transparent 77%, rgba(151,210,181,.035));
  opacity: .45;
  pointer-events: none;
}
.comic-frame::after {
  right: 5px;
  bottom: 5px;
  width: 8px;
  height: 8px;
  border: 1px solid #17130f;
  border-radius: 50%;
  background: #76644a;
  box-shadow: inset 1px 1px rgba(255,255,255,.15);
  opacity: 1;
}
.comic-frame img { position: relative; z-index: 1; border: 1px solid #151814; border-radius: 3px; }
.page-dock {
  margin-top: .72rem;
  padding: .58rem .8rem;
  border: 2px solid #171b18;
  border-radius: 4px;
  color: #9fc49c;
  background: #17211d;
  box-shadow: inset 0 3px 7px rgba(0,0,0,.7), 0 1px rgba(255,255,255,.1);
  text-shadow: 0 0 5px rgba(127,224,131,.25);
}
.page-dock span:first-child { color: #d6c07f; }

.section-heading {
  margin-top: 1.4rem;
  border: 4px solid #1f1b16;
  border-radius: 6px;
  background: linear-gradient(120deg, #62513c, #41362a);
  box-shadow: inset 0 0 0 2px #826d4e, 0 12px 28px rgba(0,0,0,.4);
}
.section-heading h1 { color: #e5d4b2; text-shadow: 0 2px #201a14; }
.section-heading .eyebrow { color: #c8af77; }
.section-heading > p, .section-heading .lede { color: #ddd0b6; }

.character-card,
.world-card {
  border: 4px solid #201c17;
  border-radius: 7px;
  background: linear-gradient(145deg, #655640, #40372b);
  box-shadow: inset 0 0 0 2px #806c50, inset 0 8px 15px rgba(0,0,0,.16), 0 14px 30px rgba(0,0,0,.48);
}
.character-image { margin: .62rem .62rem 0; border: 3px solid #1f1b16; border-radius: 4px; background: #171916; box-shadow: inset 0 4px 9px #000; }
.character-code { right: .35rem; bottom: .35rem; color: #282219; background: #d1b976; font-family: var(--hand); transform: rotate(-1deg); }
.character-copy h2, .world-card h2 { color: #efdfbd; text-shadow: 0 2px #211b14; }
.character-meta, .world-kicker { color: #d1b976; }
.character-copy p, .world-card > p { color: #d7cab0; }
.character-stats { color: #bea986; border-top-color: #837052; }
.world-card::after { color: rgba(221,195,139,.07); }
.fact-list li { color: #dbceb4; }
.fact-list li::before { color: #cbb271; }

.world-transmission {
  border: 3px solid #211c17;
  border-radius: 5px;
  color: #d8cab0;
  background: linear-gradient(#4f4333, #382f25);
  box-shadow: inset 0 0 0 1px #756349, 0 8px 18px rgba(0,0,0,.35);
}
.world-transmission strong { color: #d5bd7d; }

.footer {
  margin-top: 1rem;
  border-top: 4px solid #201b16;
  border-radius: 0 0 3px 3px;
  color: #b4a486;
  background:
    repeating-linear-gradient(90deg, transparent 0 15px, rgba(255,255,255,.018) 16px),
    linear-gradient(#41372b, #302921);
  box-shadow: inset 0 2px #746148, inset 0 8px 20px rgba(0,0,0,.24);
}

.archive-dialog { border: 5px solid #211c17; border-radius: 7px; background: linear-gradient(145deg, #5d4f3d, #3d3429); box-shadow: inset 0 0 0 2px #816d51, 0 28px 90px #000; }
.dialog-card input, .dialog-card textarea, .comment-form input, .comment-form textarea {
  border: 2px solid #171b18;
  border-radius: 5px;
  color: #d4e4bd;
  background: #15201b;
  box-shadow: inset 0 3px 8px rgba(0,0,0,.72), 0 1px rgba(255,255,255,.1);
}

@media (max-width: 900px) {
  .equipment-strip { flex-wrap: wrap; }
  .equipment-strip .warning-label { display: none; }
}

@media (max-width: 520px) {
  .site-shell { margin: 4px; min-height: calc(100vh - 8px); border-width: 3px; }
  .equipment-strip { justify-content: center; }
  .equipment-strip > span { border-right: 0; }
  .reader-toolbar { padding: .5rem; }
}

/* Portable electronics control surface — late 1970s / early 1980s */
:root {
  --case-brown: #493b2d;
  --case-dark: #28241e;
  --case-edge: #77654e;
  --plastic: #b8a27c;
  --plastic-light: #d1bb91;
  --plastic-dark: #806d50;
  --marker: #302a22;
  --lamp-off: #263a28;
  --lamp-on: #91f78d;
  --hand: "Segoe Print", "Bradley Hand ITC", "Comic Sans MS", cursive;
}

body {
  background:
    radial-gradient(circle at 20% 0%, rgba(177, 139, 78, 0.13), transparent 32rem),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.012) 0 1px, transparent 1px 5px),
    #171712;
}

.topbar {
  min-height: 104px;
  padding-block: 0.9rem 1rem;
  border: 0;
  border-bottom: 5px solid #241f18;
  border-radius: 0 0 7px 7px;
  background:
    linear-gradient(90deg, transparent 18px, rgba(38,31,23,.35) 19px 20px, transparent 21px),
    linear-gradient(180deg, #665641 0%, var(--case-brown) 72%, #352d23 100%);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.16), inset 0 -2px 0 rgba(0,0,0,.45), 0 10px 24px rgba(0,0,0,.55);
}

.topbar::before {
  content: "";
  position: absolute;
  inset: 12px;
  pointer-events: none;
  background:
    radial-gradient(circle at 4px 4px, #1c1915 0 2px, #8a7658 2.5px 4px, transparent 4.5px) left top / 100% 100% no-repeat,
    radial-gradient(circle at calc(100% - 4px) 4px, #1c1915 0 2px, #8a7658 2.5px 4px, transparent 4.5px) right top / 100% 100% no-repeat;
}

.topbar::after {
  bottom: 3px;
  height: 2px;
  background: repeating-linear-gradient(90deg, #1f1b16 0 9px, #8c7757 9px 11px);
  opacity: .7;
}

.brand-mark {
  border: 2px solid #201c17;
  border-radius: 4px;
  background: #ad9974;
  box-shadow: inset 2px 2px 2px rgba(255,255,255,.22), inset -2px -2px 2px rgba(0,0,0,.35);
}

.brand strong { color: #efe1c2; text-shadow: 0 2px 0 #1f1a14; }
.brand small { color: #d4ba85; }

.primary-nav {
  align-items: start;
  gap: .7rem;
  padding: .5rem .75rem .65rem;
  border: 2px solid #2d271f;
  border-radius: 5px;
  background: #322b22;
  box-shadow: inset 0 3px 8px rgba(0,0,0,.75), 0 1px 0 rgba(255,255,255,.12);
}

.primary-nav a {
  position: relative;
  min-width: 112px;
  min-height: 57px;
  justify-content: center;
  padding: .62rem .9rem 1rem;
  border: 1px solid #dcc9a0;
  border-bottom: 4px solid #6c5c43;
  border-radius: 4px 4px 6px 6px;
  color: var(--marker);
  background:
    linear-gradient(100deg, transparent 0 47%, rgba(255,255,255,.11) 50%, transparent 53%),
    linear-gradient(180deg, var(--plastic-light), var(--plastic) 62%, #99835f);
  box-shadow: inset 1px 1px 0 rgba(255,255,255,.7), inset -2px -2px 1px rgba(65,49,32,.25), 0 6px 0 #241f19, 0 8px 8px rgba(0,0,0,.45);
  font-family: var(--hand);
  font-size: .93rem;
  font-weight: 800;
  letter-spacing: .015em;
  text-shadow: 0 1px rgba(255,255,255,.22);
  transform: translateY(-2px);
  transition: transform 90ms ease, box-shadow 90ms ease, filter 90ms ease;
}

.primary-nav a span {
  color: #594937;
  font-family: var(--hand);
  font-size: .72rem;
}

.primary-nav a::after {
  content: "";
  position: absolute;
  bottom: 5px;
  left: 50%;
  width: 17px;
  height: 4px;
  border: 1px solid #332b22;
  border-radius: 4px;
  background: var(--lamp-off);
  box-shadow: inset 0 1px 2px #000;
  transform: translateX(-50%);
}

.primary-nav a:hover {
  border-color: #ead8b2;
  color: #1e1a15;
  background: linear-gradient(180deg, #dac7a1, #b59f78);
  filter: brightness(1.04);
}

.primary-nav a.active {
  border-color: #806e52;
  color: #211c16;
  background: linear-gradient(180deg, #9d8968, #b39e78);
  box-shadow: inset 2px 4px 6px rgba(39,28,18,.48), inset -1px -1px rgba(255,255,255,.25), 0 1px 0 #211c17;
  transform: translateY(5px);
}

.primary-nav a.active::after {
  background: var(--lamp-on);
  box-shadow: 0 0 4px #61df62, 0 0 10px rgba(113,255,113,.8), inset 0 1px rgba(255,255,255,.8);
}

.curator-button {
  border: 2px solid #241f19;
  border-radius: 3px;
  color: #2c261f;
  background: linear-gradient(#c7b38e, #9b8563);
  box-shadow: inset 1px 1px rgba(255,255,255,.55), inset -2px -2px rgba(55,42,29,.25), 0 4px 0 #211c17;
  font-family: var(--hand);
  letter-spacing: 0;
  text-transform: none;
}

.curator-button[aria-pressed="true"] { border-color: #211c17; color: #211c17; box-shadow: inset 2px 3px 5px rgba(0,0,0,.42), 0 1px #211c17; transform: translateY(3px); }

.archive-rail {
  padding: .85rem;
  border: 4px solid #211d17;
  border-radius: 7px;
  background: linear-gradient(110deg, #5f503d, #44392c);
  box-shadow: inset 0 0 0 2px #79674e, inset 0 8px 18px rgba(0,0,0,.22), 0 15px 35px rgba(0,0,0,.5);
}

.archive-rail .panel-label { margin: .15rem .25rem 1rem; color: #e0cda7; font-family: var(--hand); letter-spacing: .02em; text-transform: none; }
.archive-rail .panel-label::after { background: #988262; }
.comic-index { gap: .72rem; }

.comic-index button {
  position: relative;
  padding: .72rem .75rem;
  border: 1px solid #dbc69d;
  border-bottom: 4px solid #6c5a40;
  border-radius: 4px;
  color: var(--marker);
  background:
    repeating-linear-gradient(92deg, transparent 0 28px, rgba(93,74,48,.025) 29px 30px),
    linear-gradient(180deg, #cbb68e, #ae9871);
  box-shadow: inset 1px 1px rgba(255,255,255,.62), inset -2px -2px rgba(60,46,30,.22), 0 5px 0 #221d17, 0 8px 8px rgba(0,0,0,.36);
  transform: translateY(-2px);
  transition: transform 90ms ease, box-shadow 90ms ease, filter 90ms ease;
}

.comic-index button::after {
  content: "";
  position: absolute;
  right: 7px;
  bottom: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3b3327;
  box-shadow: inset 0 1px 2px #000;
}

.comic-index button:hover { border-color: #e5d3af; color: #201b15; background: linear-gradient(#d6c39b, #b9a27a); filter: brightness(1.03); }
.comic-index button.active {
  border-color: #7f6b4e;
  color: #211c16;
  background: linear-gradient(#9c8867, #b09a73);
  box-shadow: inset 2px 4px 6px rgba(39,28,18,.47), inset -1px -1px rgba(255,255,255,.24), 0 1px #211c17;
  transform: translateY(4px);
}
.comic-index button.active::after { background: var(--lamp-on); box-shadow: 0 0 7px #78ee75; }
.comic-index .index-no { color: #624d33; font-family: var(--hand); font-weight: 800; }
.comic-index strong { font-family: var(--hand); font-size: .91rem; line-height: 1.25; text-transform: none; }
.comic-index small { color: #564a3a; font-family: var(--hand); font-size: .69rem; line-height: 1.2; }

.signal-panel {
  border: 2px solid #211d17;
  border-radius: 4px;
  color: #d1be96;
  background: #2d2921;
  box-shadow: inset 0 3px 7px rgba(0,0,0,.7), 0 1px rgba(255,255,255,.12);
}

.notes-panel, .comments-panel, .moderation-panel, .curator-panel {
  border: 3px solid #2b251d;
  border-radius: 6px;
  background:
    linear-gradient(90deg, transparent 12px, rgba(0,0,0,.04) 13px, transparent 14px),
    linear-gradient(145deg, #665640, #473c2f);
  box-shadow: inset 0 0 0 1px #847155, inset 0 8px 18px rgba(0,0,0,.14), 0 12px 28px rgba(0,0,0,.45);
}

.reader-side .panel-label { color: #ead8b2; font-family: var(--hand); letter-spacing: .02em; text-transform: none; }
.reader-side .panel-label::after { background: #9f8762; }
.reader-side .notes-panel p, .reader-side .comments-panel p, .reader-side .curator-panel > p { color: #e2d6bd; }

.reader-side .character-chips a,
.reader-side .small-button,
.reader-side .submit-button,
.reader-side .upload-button {
  display: inline-grid;
  place-items: center;
  min-height: 31px;
  padding: .34rem .55rem;
  border: 1px solid #decba4;
  border-bottom: 3px solid #6c5b43;
  border-radius: 3px;
  color: var(--marker);
  background: linear-gradient(180deg, #cbb68e, #a9916b);
  box-shadow: inset 1px 1px rgba(255,255,255,.55), inset -1px -1px rgba(60,44,29,.25), 0 3px 0 #211c17, 0 5px 6px rgba(0,0,0,.35);
  font-family: var(--hand);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  text-transform: none;
  transform: translateY(-1px);
}

.reader-side .character-chips a:hover,
.reader-side .small-button:hover,
.reader-side .submit-button:hover,
.reader-side .upload-button:hover {
  border-color: #f0dfb9;
  color: #1e1914;
  filter: brightness(1.05);
}

.reader-side .character-chips a:active,
.reader-side .small-button:active,
.reader-side .submit-button:active,
.reader-side .upload-button:active {
  border-bottom-width: 1px;
  box-shadow: inset 2px 3px 5px rgba(0,0,0,.4), 0 1px #211c17;
  transform: translateY(2px);
}

.reader-side .small-button.danger { color: #57291f; background: linear-gradient(#c7a17d, #a78263); }
.comment-form input, .comment-form textarea { border-color: #2b251d; background: #201f1a; box-shadow: inset 0 3px 7px rgba(0,0,0,.65); }
.comment-form label { color: #d4bd92; font-family: var(--hand); text-transform: none; }

.reader-toolbar {
  padding: .55rem .65rem .75rem;
  border: 3px solid #28221b;
  border-radius: 6px;
  background: linear-gradient(180deg, #5e503d, #40372b);
  box-shadow: inset 0 1px #867257, 0 8px 20px rgba(0,0,0,.45);
}

.reader-toolbar .control-button {
  border-color: #dac59e;
  border-bottom: 4px solid #69583f;
  border-radius: 4px;
  color: var(--marker);
  background: linear-gradient(#cbb58c, #a58e68);
  box-shadow: inset 1px 1px rgba(255,255,255,.58), 0 4px 0 #211c17;
  font-family: var(--hand);
  letter-spacing: 0;
  text-transform: none;
}
.reader-toolbar .control-button:hover:not(:disabled) { color: #1e1914; border-color: #ecd9b1; }
.reader-toolbar .control-button:active:not(:disabled) { box-shadow: inset 2px 3px 5px rgba(0,0,0,.42), 0 1px #211c17; transform: translateY(3px); }

@media (max-width: 780px) {
  .primary-nav { padding-inline: .45rem; }
  .primary-nav a { min-width: 104px; }
}

/* Compact desktop transmission rail — approximately 60% narrower than the original. */
@media (min-width: 781px) {
  .archive-rail { padding: .5rem; }
  .archive-rail .panel-label {
    display: block;
    margin: .1rem .15rem .65rem;
    font-size: .62rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }
  .archive-rail .panel-label::after { display: none; }
  .comic-index { gap: .5rem; }
  .comic-index button {
    grid-template-columns: 1fr;
    gap: .12rem;
    min-height: 0;
    padding: .5rem .4rem .62rem;
  }
  .comic-index button.index-endpoint .index-no { min-width: 0; }
  .comic-index .index-no { font-size: .67rem; }
  .comic-index strong {
    font-size: .71rem;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }
  .comic-index small { display: none; }
  .comic-index .index-spacer {
    min-height: 40px;
    padding: .4rem;
    font-size: .62rem;
    overflow-wrap: anywhere;
  }
  .signal-panel {
    padding: .5rem;
    font-size: .6rem;
    overflow-wrap: anywhere;
  }
}

/* Native-feeling phone and tablet controls. */
button,
a,
[role="button"] { touch-action: manipulation; }

.comic-frame img { touch-action: auto; }

.visitor-counter b {
  color: var(--amber);
  font-family: var(--display);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
}

.visitor-counter.loaded b { text-shadow: 0 0 10px rgba(242, 188, 83, 0.35); }

@media (pointer: coarse) {
  .primary-nav a,
  .curator-button,
  .control-button,
  .small-button,
  .submit-button,
  .image-viewer-close { min-height: 44px; }

  .comic-index {
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .comic-index button,
  .comic-index .index-spacer { scroll-snap-align: start; }
}

@media (max-width: 520px) {
  .image-viewer-hint {
    right: calc(max(0.65rem, env(safe-area-inset-right)) + 4.5rem);
    left: max(0.65rem, env(safe-area-inset-left));
    padding-inline: 0.5rem;
    font-size: 0.7rem;
    transform: none;
  }

  .footer { padding-bottom: calc(1.25rem + env(safe-area-inset-bottom)); }
}
.primary-nav a[href="https://muck.vulpecula.world/wsclient/"] {
  min-width: 176px;
  white-space: nowrap;
}
