/* Stella's Gold look for the account and admin pages: the same tokens as the
   control page (src/phone/phone.css), fonts served from here, nothing loaded
   from anywhere else. */
@font-face {
  font-family: 'Saira Variable';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/saira-latin-wght-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Saira Variable';
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/saira-latin-wght-italic.woff2') format('woff2');
}

@font-face {
  font-family: 'Hanken Grotesk Variable';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/hanken-grotesk-latin-wght-normal.woff2') format('woff2');
}

:root {
  color-scheme: dark;
  --panel: #0b0b0d;
  --raised: #141418;
  --button: #1b1b21;
  --edge: #3a3a42;
  --line: #27272e;
  --text: #f5f3ee;
  --text-soft: #a3a1aa;
  --text-faint: #75737c;
  --accent: #ffc21a;
  --accent-rgb: 255 194 26;
  --on-accent: #171103;
  --red: #ff6b78;
  --green: #3ddc84;
  --font: 'Hanken Grotesk Variable', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  --font-display: 'Saira Variable', 'Segoe UI', system-ui, sans-serif;
  --slant: polygon(9px 0, 100% 0, calc(100% - 9px) 100%, 0 100%);
  --slant-small: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%);
  --radius: 3px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--panel);
  color: var(--text);
  font: 400 15px/1.5 var(--font);
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

a {
  color: var(--accent);
}

/* ---- Header ---- */

.top {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 14px max(16px, calc(50% - 560px));
  border-bottom: 1px solid var(--line);
}

.wide .top {
  padding-inline: max(16px, calc(50% - 720px));
}

.brand {
  display: inline-flex;
  align-items: baseline;
  font: italic 800 26px/1 var(--font-display);
  text-decoration: none;
  color: var(--text);
}

/* Logo 1a: the S trails two grey copies of itself. */
.brand .trail {
  display: inline-grid;
  margin-left: 0.36em;
}

.brand .trail > * {
  grid-area: 1 / 1;
}

.brand .s1 {
  color: #4a4850;
  font-weight: 200;
  transform: translateX(-0.36em);
}

.brand .s2 {
  color: #9c9aa3;
  font-weight: 500;
  transform: translateX(-0.19em);
}

.brand .s3 {
  color: var(--accent);
}

.brand .rest {
  margin-left: 0.02em;
  letter-spacing: 0.03em;
}

.top .where {
  color: var(--text-soft);
  font-size: 14px;
}

.top .who {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-soft);
  font-size: 14px;
}

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 16px 64px;
}

.wide main {
  max-width: 1440px;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  line-height: 1.15;
}

h1 {
  font-size: 30px;
}

h2 {
  font-size: 20px;
}

h3 {
  font-size: 16px;
}

p {
  margin: 0;
}

.soft {
  color: var(--text-soft);
}

.faint {
  color: var(--text-faint);
}

.small {
  font-size: 13px;
}

/* ---- Cards, forms and buttons ---- */

.card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--raised);
}

.narrow {
  max-width: 440px;
  margin: 0 auto;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

label.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--text-soft);
}

input[type='email'],
input[type='password'],
input[type='text'],
input[type='search'],
select {
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  font-size: 16px;
}

input:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

input.code {
  font-family: var(--font-display);
  font-size: 26px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2em;
  text-align: center;
}

button {
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: var(--button);
  cursor: pointer;
}

button:hover:not(:disabled, .gold) {
  border-color: #55555f;
}

button:disabled {
  cursor: default;
  opacity: 0.5;
}

/* The one thing to press: gold, slanted like the tabs. */
button.gold {
  padding: 0 24px;
  border: 0;
  border-radius: 0;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  clip-path: var(--slant);
}

button.plain {
  height: auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  text-decoration: underline;
}

button.danger {
  border-color: rgb(255 107 120 / 0.5);
  color: var(--red);
}

.message {
  padding: 10px 12px;
  border-radius: var(--radius);
  background: rgb(255 107 120 / 0.1);
  color: #ffb3ba;
  font-size: 14px;
}

.message.ok {
  background: rgb(61 220 132 / 0.1);
  color: #a6f0c7;
}

/* Slanted tabs, as on the control page. */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tabs button {
  height: 36px;
  padding: 0 18px;
  border: 0;
  border-radius: 0;
  background: var(--button);
  color: var(--text-soft);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  clip-path: var(--slant);
}

.tabs button[aria-selected='true'] {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
}

/* ---- Tables ---- */

.table-box {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  background: var(--raised);
  color: var(--text-soft);
  font-weight: 500;
}

td.number,
th.number {
  text-align: right;
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
}

tr:last-child td {
  border-bottom: 0;
}

/* A small slanted tag, the box hanging outside the text so it lines up. */
.tag {
  display: inline-block;
  margin: 0 4px;
  padding: 0 6px;
  background: var(--button);
  color: var(--text-soft);
  font-size: 12px;
  clip-path: var(--slant-small);
}

.tag.gold {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
}

.tag.red {
  background: rgb(255 107 120 / 0.2);
  color: #ffb3ba;
}

/* ---- Admin: tiles, charts, bar lists ---- */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--raised);
}

.tile .value {
  font: 700 30px/1.1 var(--font-display);
  font-variant-numeric: tabular-nums;
}

.tile .label {
  color: var(--text-soft);
  font-size: 13px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
  gap: 16px;
}

.chart {
  position: relative;
}

.chart svg {
  display: block;
  width: 100%;
  height: 180px;
  overflow: visible;
}

.chart .bar {
  fill: var(--accent);
}

.chart .bar:hover,
.chart .bar.active {
  fill: #ffd45c;
}

.chart .hit {
  fill: transparent;
  cursor: crosshair;
}

.chart .grid {
  stroke: var(--line);
  stroke-width: 1;
}

.chart .axis {
  fill: var(--text-faint);
  font: 11px var(--font-display);
}

.tooltip {
  position: absolute;
  z-index: 5;
  padding: 6px 10px;
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: #1b1b21;
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 8px));
}

.tooltip b {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
}

.bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bars li {
  display: grid;
  grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) 4.5rem;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.bars .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bars .track {
  height: 10px;
  border-radius: 2px;
  background: var(--line);
}

.bars .fill {
  height: 100%;
  border-radius: 0 4px 4px 0;
  background: var(--accent);
}

.bars .count {
  text-align: right;
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
}

.empty {
  padding: 18px;
  color: var(--text-faint);
  text-align: center;
}

.hidden {
  display: none !important;
}

@media (max-width: 600px) {
  .top {
    flex-wrap: wrap;
    gap: 10px;
  }

  .bars li {
    grid-template-columns: minmax(0, 7rem) minmax(0, 1fr) 3.5rem;
  }
}
