:root {
  --ink: #1c1915;
  --muted: #6f675e;
  --line: #e4d9cc;
  --paper: #f3efe6;
  --card: #fffaf3;
  --nav: #1e2a32;
  --nav-text: #f4efe6;
  --teal: #0f6e62;
  --teal-soft: #e5f3f0;
  --amber: #8a5a12;
  --amber-soft: #f8edd9;
  --red: #8d2e2e;
  --red-soft: #f8e6e2;
  --shadow: 0 16px 40px rgba(60, 42, 20, 0.06);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Avenir Next", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
}

button, input { font: inherit; }
button { cursor: pointer; }

[hidden] { display: none !important; }

.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  background:
    radial-gradient(circle at top left, rgba(15, 110, 98, 0.12), transparent 36%),
    var(--paper);
}
.gate-card {
  width: min(440px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 36px 32px 28px;
  box-shadow: var(--shadow);
}
.gate-card h1, .top h1, .card h2, .block h3 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.03em;
}
.gate-card h1 { margin: 0 0 8px; font-size: 42px; }
.lede { color: var(--muted); margin: 0 0 22px; }
label { display: block; font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
input {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
button[type="submit"], .nav nav button.is-on {
  background: var(--teal);
  color: white;
  border: 0;
}
button[type="submit"] {
  width: 100%;
  border-radius: 14px;
  padding: 14px 16px;
}
.error { color: var(--red); margin: 12px 0 0; }
.hint { color: var(--muted); font-size: 14px; margin: 14px 0 0; }
.hint code { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 13px; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.eyebrow { margin: 0 0 6px; color: var(--teal); letter-spacing: 0.14em; text-transform: uppercase; font-size: 12px; }

.shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
  max-width: 100%;
  overflow-x: hidden;
}
.nav {
  background: var(--nav);
  color: var(--nav-text);
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.brand { display: flex; gap: 12px; align-items: center; }
.brand strong { display: block; font-family: var(--serif); font-size: 28px; font-weight: 500; }
.brand p { margin: 0; color: #c8beb2; font-size: 13px; }
.mark { width: 14px; height: 42px; border-radius: 99px; background: #efc27a; display: block; }
.nav nav { display: flex; flex-direction: column; gap: 6px; }
.nav nav button, .quiet {
  text-align: left;
  border: 0;
  background: transparent;
  color: #efe7dc;
  border-radius: 12px;
  padding: 10px 12px;
  white-space: nowrap;
}
.nav-short { display: none; }
.nav nav button.is-on { background: rgba(255, 250, 243, 0.12); color: white; }
.quiet { margin-top: auto; color: #c8beb2; }

main {
  padding: 32px 36px 64px;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}
main > section { min-width: 0; max-width: 100%; }
.top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.top h1 {
  margin: 0;
  font-size: clamp(28px, 5vw, 44px);
  overflow-wrap: anywhere;
}
.pill {
  margin: 0;
  border-radius: 999px;
  padding: 8px 14px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 14px;
}
.pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.top .pills { justify-content: flex-end; }
.pill.watch { background: var(--amber-soft); color: var(--amber); }
.pill.incident { background: var(--red-soft); color: var(--red); }
.pill.handled { background: #e7eee4; color: #3d5a44; }
.pill.ok { background: #e7eee4; color: #3d5a44; }
.pill.pause { background: var(--amber-soft); color: var(--amber); }
.card .pill { display: inline-block; margin: 6px 0; font-size: 13px; }
.people { margin-top: 12px; overflow-x: auto; max-width: 100%; }
.people summary { cursor: pointer; color: var(--teal); }
.people table { margin-top: 10px; }

.bento { padding: 0; overflow: hidden; }
.bento > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 18px 20px;
  cursor: pointer;
  min-width: 0;
}
.bento > summary::-webkit-details-marker,
.bento > summary::marker { display: none; content: ""; }
.bento-title {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
}
.bento-hint {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
  min-width: 0;
  max-width: 100%;
  flex: 1 1 10rem;
  text-align: right;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}
.bento-go {
  border: 0;
  background: transparent;
  color: var(--teal);
  cursor: pointer;
  font: inherit;
  padding: 0;
}
.bento-go.pill {
  padding: 8px 14px;
  font-size: 13px;
}
.bento-go:hover { text-decoration: underline; }
.bento-body { padding: 4px 20px 18px; border-top: 1px solid var(--line); }
.bento-body .calm { margin: 12px 0 4px; }
.bento > summary::before {
  content: "▸";
  color: var(--muted);
  font-size: 14px;
}
.bento[open] > summary::before { content: "▾"; }
.counts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
  gap: 14px;
}
.account-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}
.account-list li {
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: 14px;
}
.card, .block, .log, .repo, .site, .bento {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  min-width: 0;
  max-width: 100%;
}
.card { padding: 18px 18px 16px; }
.card span, .muted { color: var(--muted); font-size: 13px; }
.card strong, .figure {
  display: block;
  margin-top: 8px;
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 500;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.secure { margin-bottom: 18px; }
.secure-global { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; flex-wrap: wrap; }
.secure-row { padding: 12px 0; border-top: 1px solid var(--line); }
.secure-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.secure-head strong { font-family: var(--serif); font-size: 22px; font-weight: 500; }
.stack { display: grid; gap: 14px; margin-top: 14px; }
.stack:first-child { margin-top: 0; }
.two { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr); gap: 14px; }
.block { padding: 20px; }
.block h2, .block h3 { margin: 0 0 8px; }
.calm { color: var(--muted); margin: 0; }
.calm, .anomaly, .muted, .paths, .repo, .log, .note {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.anomaly { padding: 12px 0; border-top: 1px solid var(--line); }
.anomaly:first-of-type { border-top: 0; }
.anomaly b { display: block; }
.anomaly.incident b { color: var(--red); }
.anomaly.watch b { color: var(--amber); }
.meter { height: 8px; background: #efe6da; border-radius: 99px; overflow: hidden; margin: 8px 0 14px; }
.meter span { display: block; height: 100%; background: var(--teal); }
.meter.warn span { background: #c4842a; }
.meter.bad span { background: var(--red); }
.row { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.spark { width: 100%; max-width: 100%; height: 56px; }
.site-list, .log-list, .repo-list { display: grid; gap: 12px; min-width: 0; }
.site, .log, .repo { padding: 16px 18px; }
.site header, .repo header { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.site header a { color: var(--teal); font-size: 14px; }
.site h3, .repo h3 { margin: 0; font-family: var(--serif); font-size: 26px; font-weight: 500; }
.bars { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: #efe6da; margin: 10px 0; }
.bars i { display: block; height: 100%; }
.s2 { background: var(--teal); }
.s3 { background: #8fb9b2; }
.s4 { background: #e0b15a; }
.s5 { background: var(--red); }
.paths { margin: 8px 0 0; padding: 0; list-style: none; color: var(--muted); }
.paths li { display: flex; justify-content: space-between; gap: 12px; min-width: 0; }
.paths li span:first-child { min-width: 0; overflow-wrap: anywhere; }
.log { display: grid; grid-template-columns: minmax(0, 92px) minmax(0, 1fr); gap: 12px; }
.tag { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.tag.error { color: var(--red); }
.tag.warn { color: var(--amber); }
.quiet-action {
  margin-top: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--teal);
  border-radius: 10px;
  padding: 6px 10px;
}
.fold { min-width: 0; }
.fold-more {
  margin-top: 12px;
  width: 100%;
  text-align: center;
}
.fold-more-row td {
  border-bottom: 0;
  padding-top: 12px;
}
.fold-more-row .fold-more {
  margin-top: 0;
}
.brief { padding: 14px 0; border-top: 1px solid var(--line); display: grid; gap: 4px; }
.brief b { display: block; }
.brief.incident b { color: var(--red); }
.brief.watch b { color: var(--amber); }
.main-action {
  margin-top: 16px;
  border: 0;
  background: var(--nav);
  color: #fffaf3;
  border-radius: 12px;
  padding: 12px 18px;
}
.punish-stats { margin: 14px 0 0; }
.punish-filter { display: block; margin: 14px 0 0; }
.punish-filter input { margin: 0; }
.ban {
  display: grid;
  gap: 6px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.ban:first-of-type { border-top: 0; margin-top: 8px; }
.ban-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.ban-hits {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
}
.ban-ip {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}
.ban-top .quiet-action {
  margin-top: 0;
  margin-left: auto;
}
.ban-form {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  max-width: 28rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}
.ban-form label {
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 0;
}
.ban-form input { margin-bottom: 0; }
.ban-form .error { margin: 0; }
.ban-form .main-action { margin-top: 0; }
.ban-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
table { width: 100%; max-width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
th { color: var(--muted); font-weight: 500; font-size: 13px; }

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    min-height: 100dvh;
  }
  .nav {
    position: sticky;
    top: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand quit"
      "tabs tabs";
    align-items: center;
    column-gap: 8px;
    row-gap: 8px;
    padding: 10px 12px calc(10px + env(safe-area-inset-top, 0px));
    background: var(--nav);
  }
  .nav .brand { grid-area: brand; min-width: 0; }
  .nav .brand strong { font-size: 22px; }
  .nav .brand p {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
  }
  .nav nav {
    grid-area: tabs;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 4px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    mask-image: linear-gradient(to right, #000 78%, transparent);
    -webkit-mask-image: linear-gradient(to right, #000 78%, transparent);
  }
  .nav nav::-webkit-scrollbar { display: none; }
  .nav nav button {
    flex: 0 0 auto;
    padding: 8px 10px;
    font-size: 14px;
  }
  .quiet {
    grid-area: quit;
    margin-top: 0;
    justify-self: end;
    padding: 8px 10px;
    font-size: 14px;
  }
  .two { grid-template-columns: minmax(0, 1fr); }
  main { padding: 20px 16px 48px; }
}
@media (max-width: 640px) {
  .nav-full { display: none; }
  .nav-short { display: inline; }
  .nav .brand p { display: none; }
  .grid, .two, .log, .site .grid { grid-template-columns: 1fr; }
  .top { flex-direction: column; align-items: flex-start; gap: 10px; }
  .top .pills { justify-content: flex-start; }
  .top h1 { font-size: clamp(22px, 7vw, 32px); }
  .card strong, .figure { font-size: 28px; }
  .gate { padding: 20px 12px; }
  .gate-card { padding: 28px 20px 22px; border-radius: 20px; }
  .gate-card h1 { font-size: 32px; }
  main { padding: 14px 12px 40px; }
  .bento > summary { padding: 14px; gap: 8px; align-items: flex-start; }
  .bento-title {
    font-size: 20px;
    flex: 1 1 auto;
    min-width: 0;
  }
  .bento-hint {
    margin-left: 0;
    flex: 1 1 100%;
    text-align: left;
    font-size: 12px;
    line-height: 1.35;
  }
  .bento-body { padding: 4px 14px 14px; }
  .block { padding: 16px; }
  .site h3, .repo h3 { font-size: 20px; }
  .secure-head strong { font-size: 18px; }
  .counts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .paths li { flex-direction: column; gap: 2px; }
}
@media (max-width: 430px) {
  .gate { padding: 14px 10px; }
  .gate-card { padding: 20px 14px 16px; border-radius: 16px; }
  .gate-card h1 { font-size: 26px; }
  .lede { font-size: 14px; margin-bottom: 16px; }
  .nav {
    padding: 8px 8px calc(8px + env(safe-area-inset-top, 0px));
    row-gap: 6px;
  }
  .brand { gap: 8px; }
  .mark { width: 10px; height: 28px; }
  .nav .brand strong { font-size: 18px; }
  .nav nav button {
    padding: 7px 9px;
    font-size: 13px;
    border-radius: 10px;
  }
  .quiet { padding: 7px 9px; font-size: 13px; }
  main { padding: 12px 10px 32px; }
  .top { margin-bottom: 16px; }
  .eyebrow { font-size: 11px; }
  .pill { padding: 6px 10px; font-size: 12px; }
  .card { padding: 14px; border-radius: 16px; }
  .card strong, .figure { font-size: 24px; margin-top: 4px; }
  .bento, .block, .site, .log, .repo { border-radius: 16px; }
  .bento > summary { padding: 12px; }
  .bento-title { font-size: 17px; }
  .bento-go.pill { padding: 6px 10px; font-size: 12px; }
  .counts { gap: 8px; }
  .grid { gap: 10px; }
  .site, .log, .repo { padding: 12px; }
  .site h3, .repo h3 { font-size: 18px; }
  .log { grid-template-columns: minmax(0, 72px) minmax(0, 1fr); gap: 8px; }
  .ban-ip { font-size: 14px; }
  .ban-top .quiet-action { margin-left: 0; width: 100%; }
  .ban-form { padding: 12px; max-width: none; }
  .main-action { width: 100%; padding: 12px 14px; }
  th, td { padding: 6px 0; font-size: 13px; }
}
