:root {
  color-scheme: dark;
  --bg: #080b0d;
  --panel: #111715;
  --panel-2: #151918;
  --line: #2b3934;
  --text: #f2f5ee;
  --muted: #aeb8ad;
  --soft: #d7ddcf;
  --amber: #f2ad3f;
  --green: #9be675;
  --blue: #80c7ff;
  --red: #ff7b6e;
  --shadow: 0 22px 80px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

body {
  min-width: 0;
  margin: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 85% 8%, rgba(128, 199, 255, 0.11), transparent 32rem),
    var(--bg);
  background-size: 22px 22px, 22px 22px, auto, auto;
  overflow-x: hidden;
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: 0;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
  text-wrap: balance;
}

p {
  color: var(--soft);
  line-height: 1.65;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 11, 13, 0.88);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.brand img {
  flex: 0 0 auto;
}

nav {
  display: flex;
  align-items: center;
  gap: clamp(0.7rem, 2vw, 1.5rem);
  color: var(--muted);
  font-size: 0.94rem;
}

nav a {
  text-decoration: none;
}

.band,
.admin-shell,
.result-shell {
  width: min(1160px, calc(100vw - 2rem));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: clamp(1.2rem, 4vw, 4rem);
  align-items: center;
  min-height: calc(100vh - 62px);
  padding: clamp(3rem, 8vw, 7rem) 0;
}

.hero h1 {
  max-width: 13ch;
  font-size: clamp(3rem, 8vw, 6.7rem);
}

.lede {
  max-width: 650px;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--amber);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
}

.metrics,
.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 1.5rem;
}

.metrics span,
.plan-grid div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 23, 21, 0.76);
  padding: 0.75rem;
  color: var(--muted);
}

.case-visual,
.access-form,
.access-state,
.notice,
.admin-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 23, 21, 0.9);
  box-shadow: var(--shadow);
}

.case-visual {
  display: grid;
  gap: 0.9rem;
  padding: clamp(1.2rem, 3vw, 2rem);
}

.case-visual strong {
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  line-height: 1.05;
}

.case-visual span {
  border-left: 3px solid var(--amber);
  padding-left: 0.75rem;
  color: var(--soft);
}

.section-head {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 1.3rem;
}

.section-head h2,
.admin-head h1 {
  font-size: clamp(2rem, 5vw, 4rem);
}

.issue-band,
.access-band {
  padding: clamp(2.5rem, 6vw, 5rem) 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.issue-preview {
  border-left: 4px solid var(--amber);
  padding: 0.2rem 0 0.2rem 1rem;
}

.issue-preview p {
  max-width: 78ch;
}

.issue-date {
  color: var(--green);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.notice {
  margin: 1rem 0;
  padding: 1rem;
}

.notice h1,
.notice h3 {
  margin-bottom: 0.6rem;
}

.notice-success {
  border-color: rgba(155, 230, 117, 0.45);
}

.notice-warning {
  border-color: rgba(242, 173, 63, 0.55);
}

.notice-danger {
  border-color: rgba(255, 123, 110, 0.55);
}

.state-grid,
.admin-grid,
.preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

.preview-grid {
  grid-template-columns: minmax(0, 1fr);
  margin-top: 1rem;
}

.access-state,
.access-form,
.admin-panel {
  padding: clamp(1rem, 3vw, 1.4rem);
}

.access-state h3,
.access-form h3,
.admin-panel h2 {
  font-size: clamp(1.25rem, 3vw, 1.8rem);
}

.access-state.warning {
  border-color: rgba(242, 173, 63, 0.55);
}

.access-form {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.hp-field {
  position: absolute;
  left: -9999px;
}

.sign-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
}

.sign-option {
  min-width: 0;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1211;
  color: var(--text);
  cursor: pointer;
}

.sign-option span,
.sign-option strong {
  display: block;
}

.sign-option strong {
  font-size: 0.9rem;
}

.sign-option.is-active {
  border-color: var(--green);
  background: #142019;
}

.field {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
}

.field input,
.field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090d0d;
  color: var(--text);
  padding: 0.75rem 0.85rem;
}

.field textarea {
  resize: vertical;
}

.primary-button,
.ghost-button,
.danger-button,
.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  padding: 0.7rem 1rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.primary-button,
.primary-link {
  border: 1px solid var(--amber);
  background: var(--amber);
  color: #17110a;
}

.ghost-button {
  border: 1px solid #3e5650;
  background: transparent;
  color: var(--text);
}

.danger-button {
  border: 1px solid var(--red);
  background: #2a1110;
  color: var(--text);
}

.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  width: min(1160px, calc(100vw - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
  color: var(--muted);
}

.admin-shell {
  padding: clamp(2rem, 5vw, 4rem) 0;
}

.admin-head {
  margin-bottom: 1.5rem;
}

.issue-list,
.action-stack {
  display: grid;
  gap: 0.75rem;
}

.issue-row {
  display: grid;
  gap: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.85rem;
  text-decoration: none;
}

.issue-row span,
.issue-row em,
dt {
  color: var(--muted);
  font-size: 0.84rem;
  font-style: normal;
}

dd {
  margin: 0.2rem 0 0;
  font-size: 1.6rem;
  font-weight: 800;
}

.danger-zone {
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
}

.email-frame {
  width: 100%;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.plain-preview {
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090d0d;
  color: var(--soft);
  padding: 1rem;
  white-space: pre-wrap;
}

.result-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
}

.result-shell .notice {
  width: min(720px, 100%);
}

[hidden] {
  display: none !important;
}

@media (max-width: 860px) {
  .hero,
  .state-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero h1 {
    max-width: 11ch;
    font-size: clamp(2.7rem, 16vw, 4.8rem);
  }

  .metrics,
  .plan-grid {
    grid-template-columns: 1fr;
  }

  .sign-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    width: 100%;
    justify-content: space-between;
  }

  .band,
  .admin-shell,
  .result-shell,
  .footer {
    width: min(100vw - 1rem, 1160px);
  }

  .sign-grid {
    gap: 0.45rem;
  }

  .sign-option {
    min-height: 54px;
  }

  .primary-button,
  .ghost-button,
  .danger-button {
    width: 100%;
    white-space: normal;
  }
}
