:root {
  color-scheme: dark;
  --bg: #12140f;
  --ink: #f3f1e6;
  --muted: #a39e8b;
  --line: #2c3124;
  --panel: #1a1e16;
  --hit: #d6ff4a;
  --bad: #ffb4a2;
  --font: "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  --sans: "Segoe UI", "Helvetica Neue", sans-serif;
  --mono: "IBM Plex Mono", "Source Code Pro", ui-monospace, monospace;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgb(214 255 74 / 8%), transparent 180px),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.gate {
  position: fixed;
  inset: 0;
  overflow: auto;
  display: grid;
  place-items: safe center;
  padding: 24px;
}

.gate form,
#desk {
  width: min(960px, 100%);
}

.gate form {
  display: grid;
  gap: 10px;
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
}

h1,
h2,
.mark {
  font-family: var(--font);
  font-weight: 500;
}

h1 { margin: 0; font-size: 40px; letter-spacing: -0.03em; }
h2 { margin: 0; font-size: 22px; }
.mark { margin: 0 0 8px; color: var(--hit); letter-spacing: 0.14em; text-transform: uppercase; font-size: 13px; }
.lede,
.empty,
.section-head p,
#last-alert,
#phones { color: var(--muted); }

label { font-size: 13px; color: var(--muted); }

input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: #10130d;
  color: var(--ink);
}

.token-field { position: relative; }
.token-field input { padding-right: 76px; }

#toggle-token {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 6px 8px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#toggle-token:hover,
#toggle-token:focus-visible {
  color: var(--ink);
}

.gate button[type="submit"] {
  border: 0;
  background: var(--hit);
  color: #16190f;
  padding: 12px 16px;
}

.account { position: relative; }

.account-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 168px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: #171b13;
  color: var(--ink);
  text-align: left;
}

.account-trigger[aria-expanded="true"] {
  border-color: #4c5538;
  background: #1d2318;
}

.account-trigger[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.account-copy { display: grid; min-width: 0; }
.account-name { font-size: 13px; line-height: 1.2; }
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex: none;
}
.dot.ok { background: var(--hit); box-shadow: 0 0 0 3px rgb(214 255 74 / 16%); }
.dot.down { background: var(--bad); }

.chevron { width: 16px; height: 16px; margin-left: auto; color: var(--muted); }

.menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 5;
  width: 240px;
  padding: 6px;
  background: #1c2118;
  border: 1px solid #3a4230;
  box-shadow: 0 16px 40px rgb(0 0 0 / 35%);
}

.menu-head {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 8px 10px;
  border-bottom: 1px solid var(--line);
}

.menu-copy strong,
.menu-copy span { display: block; }
.menu-copy strong { font-size: 14px; font-weight: 600; }
#menu-status { color: var(--muted); font-size: 12px; margin-top: 2px; }

.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  background: #2a331c;
  color: var(--hit);
  font-family: var(--font);
}

.menu-item {
  width: 100%;
  margin-top: 6px;
  padding: 9px 10px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.menu-item:hover,
.menu-item:focus-visible {
  background: #2a241f;
  color: var(--bad);
}

.error,
.banner { color: var(--bad); }

#desk {
  position: fixed;
  inset: 0;
  width: min(960px, 100%);
  margin: 0 auto;
  padding: 28px 20px 64px;
  overflow: auto;
  display: grid;
  gap: 28px;
  align-content: start;
}

.top,
.section-head,
.split {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

.pulse { color: var(--muted); font-size: 12px; line-height: 1.2; }
.pulse.ok { color: var(--hit); }
.pulse.down { color: var(--bad); }

#test-call {
  padding: 7px 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
}

.rule {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.rule label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.rule input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  padding: 10px 12px;
}

.rule button {
  border: 0;
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg);
  padding: 10px 16px;
}

.rule button:disabled {
  opacity: 0.55;
  cursor: progress;
}

.rule-status {
  margin: 0;
  min-height: 1.3em;
  font-size: 14px;
}

.rule-status.ok { color: var(--hit); }
.rule-status.bad { color: var(--bad); }

#call-price { margin: 0; font-family: var(--mono); color: var(--hit); }

.figures {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.figures div { padding: 16px 12px 16px 0; }
.figures span { display: block; color: var(--muted); font-size: 13px; }
.figures strong { display: block; margin-top: 6px; font-family: var(--mono); font-size: 28px; font-weight: 500; }
.figures strong.hit { color: var(--hit); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th,
td {
  white-space: nowrap;
  text-align: left;
  padding: 12px 10px 12px 0;
  border-bottom: 1px solid var(--line);
}
th { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
td.price { font-family: var(--mono); font-size: 18px; }
tr.hit td.price { color: var(--hit); }

.split { align-items: start; }
.split article { flex: 1; padding-top: 8px; border-top: 1px solid var(--line); }
#phones { margin: 12px 0 0; padding: 0; list-style: none; }
#phones li + li { margin-top: 6px; }

@media (max-width: 720px) {
  h1 { font-size: 32px; }
  .figures { grid-template-columns: 1fr 1fr; }
  .rule { grid-template-columns: 1fr; }
  .top,
  .split { display: grid; }
}
