@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("inter-4.1-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("inter-4.1-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("inter-4.1-600.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("inter-4.1-700.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-weight: 500; font-display: swap; src: url("space-grotesk-2.0.0-500.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-weight: 700; font-display: swap; src: url("space-grotesk-2.0.0-700.woff2") format("woff2"); }

:root {
  --ground: #F6F5F1;
  --ink: #1C1B18;
  --accent: #F2B705;
  --muted: #5C5A52;
  --line: #E8E6DF;
  --card: #FFFFFF;
  --link: #7A4E00;
  --link-hover: #4A2F00;
  --google: #C98A00;
  --sandbox: #FFF8E1;
  --field: #CFCCC2;
  --nav-text: #E8E6DF;
  --nav-muted: #B9B6AC;
  --danger: #B42318;
  --danger-soft: #FEF3F2;
  --shade: rgba(28, 27, 24, 0.18);
  --text: "Inter", system-ui, sans-serif;
  --display: "Space Grotesk", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--link); }
a:hover { color: var(--link-hover); }

h1, h2, h3, .big {
  font-family: var(--display);
  font-weight: 700;
  margin: 0;
}
h1 { font-size: 32px; line-height: 1.2; }
h2 { font-size: 20px; }
.big { font-size: 40px; line-height: 1.1; }

.muted { color: var(--muted); }
header p { margin: 6px 0 0; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  color: inherit;
  text-decoration: none;
}
.mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent);
}

.app {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  flex: 0 0 auto;
  width: clamp(220px, 18vw, 260px);
  background: var(--ink);
  color: var(--ground);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar .brand { padding: 4px 8px 20px; color: var(--ground); }
.sidebar .brand:hover { color: var(--ground); }
.nav-link {
  color: var(--nav-text);
  border-radius: 8px;
  padding: 10px 12px;
  min-height: 44px;
  display: flex;
  align-items: center;
  text-decoration: none;
}
.nav-link:hover { color: var(--card); background: rgba(255, 255, 255, 0.08); }
.nav-link.current {
  color: var(--ink);
  background: var(--accent);
  font-weight: 600;
}
.who {
  margin-top: auto;
  padding: 12px;
  font-size: 13px;
  color: var(--nav-muted);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}
.who form { margin: 0; }

main {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 1200px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.card {
  background: var(--card);
  border-radius: 14px;
  padding: 20px;
}
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stack button { margin-top: 10px; }

label { font-size: 13px; font-weight: 600; }
label:not(:first-child) { margin-top: 10px; }

input, select, textarea {
  font: inherit;
  font-size: 16px;
  color: inherit;
  padding: 12px 14px;
  border: 1px solid var(--field);
  border-radius: 10px;
  background: var(--card);
  width: 100%;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
input.code { letter-spacing: 4px; }
input.code::placeholder { letter-spacing: normal; }
input[readonly] { background: var(--ground); color: var(--muted); }
[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.field-error { margin: 0; color: var(--danger); font-size: 13px; font-weight: 600; }
.unit { font-weight: 400; color: var(--muted); }

button {
  font: inherit;
  font-weight: 600;
  padding: 12px 20px;
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: var(--ink);
  color: var(--card);
  cursor: pointer;
}
button.quiet {
  background: transparent;
  color: var(--nav-text);
  padding: 0 12px;
  margin: 0 -12px;
  min-height: 44px;
  font-weight: 500;
  text-decoration: underline;
}
button.danger, a.button.danger { background: var(--danger); color: #FFFFFF; }

.warning, .error, .flash {
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
}
.warning { background: var(--sandbox); border: 1px solid var(--accent); }
.error { background: var(--danger-soft); border: 1px solid var(--danger); }
.flash { background: var(--card); box-shadow: inset 4px 0 0 var(--ink); font-weight: 600; }
.tap { display: inline-flex; align-items: center; min-height: 44px; }
.anchor { scroll-margin-top: 72px; }

.lone {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 48px 16px;
}
.lone-card {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.lone-card h1 { font-size: 26px; }
.lone-card .mark { width: 32px; height: 32px; border-radius: 9px; }

.qr {
  background: var(--card);
  border-radius: 14px;
  padding: 16px;
  align-self: flex-start;
}
.qr svg { display: block; width: 200px; height: 200px; }
.key {
  margin: 0 0 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  letter-spacing: 1px;
  word-break: break-all;
  background: var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}

/* Positioned so an .sr-only child cannot widen the page. */
.scroll, .chart {
  position: relative;
  overflow-x: auto;
  background:
    linear-gradient(to right, var(--card) 30%, transparent) left center / 32px 100% no-repeat local,
    linear-gradient(to left, var(--card) 30%, transparent) right center / 32px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, var(--shade), transparent) left center / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, var(--shade), transparent) right center / 12px 100% no-repeat scroll,
    var(--card);
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
caption { text-align: left; font-weight: 600; font-size: 16px; padding-bottom: 12px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
thead th { font-size: 13px; font-weight: 600; color: var(--muted); }
thead th a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
tbody th { font-weight: 500; }
.list th, .list td { white-space: nowrap; }
.list thead th:has(a) { padding-top: 0; padding-bottom: 0; }
.cut { display: block; max-width: 16em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.cut { line-height: 44px; min-height: 44px; }
.lead { display: flex; align-items: center; gap: 2px; }
.lead .row-key { max-width: 9em; min-width: 44px; margin-right: 4px; }
.lead .act { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 0 6px; font-size: 13px; }
.values td a { display: inline-flex; align-items: center; min-height: 44px; }
.ident-inline { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 500; overflow-wrap: anywhere; }
.sticky-first tr > :first-child, .grid tr > :first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--card);
  box-shadow: inset -1px 0 0 var(--line);
}
/* Padding moves into the cells, so the sticky first column reaches the box edge and nothing shows beside it. */
.card.scroll { padding-left: 0; padding-right: 0; }
.card.scroll > table > caption, .card.scroll > p { padding-left: 20px; padding-right: 20px; }
.card.scroll > table tr > :first-child { padding-left: 20px; }
.card.scroll > table tr > :last-child { padding-right: 20px; }
.values th, .values td { overflow-wrap: anywhere; }
.values th { width: 35%; }
.grid th[scope="row"] { min-width: 9em; }
.grid .raw { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.grid td { padding: 0; text-align: center; }
.tick { display: flex; align-items: center; justify-content: center; min-width: 48px; min-height: 48px; margin: 0; cursor: pointer; }
.tick-name { display: none; }
input[type="checkbox"] { width: 22px; height: 22px; padding: 0; accent-color: var(--ink); }
.row-cell { padding-top: 0; padding-bottom: 0; }
.row-actions { display: flex; flex-wrap: nowrap; gap: 4px; align-items: center; justify-content: flex-end; }
.row-actions form { margin: 0; }
.row-actions a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; padding: 0 8px; white-space: nowrap; }
button.small { padding: 6px 12px; min-height: 44px; font-size: 13px; white-space: nowrap; }
.actions { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.actions > a:not(.button) { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--card);
  text-decoration: none;
}
a.button:hover { color: var(--card); }
a.button.secondary { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--field); }
a.button.secondary:hover { color: var(--ink); background: var(--line); }
.ident {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 15px;
  overflow-wrap: anywhere;
  user-select: all;
  background: var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.person { font-size: 16px; overflow-wrap: anywhere; }
.search { display: flex; gap: 8px; align-items: center; }
.search input { flex: 1 1 auto; min-width: 0; }
textarea { font-family: ui-monospace, monospace; font-size: 16px; }
.activity li > a { display: inline-flex; align-items: center; min-height: 44px; }
.activity { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.page-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}
.toggle {
  display: flex;
  gap: 4px;
  background: var(--line);
  padding: 4px;
  border-radius: 10px;
}
.toggle a {
  border-radius: 8px;
  padding: 8px 14px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  text-decoration: none;
}
.toggle a.current {
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
}
.tiles .card { display: flex; flex-direction: column; gap: 8px; }
.tiles .card .muted { font-size: 13px; }
.sandbox {
  background: var(--sandbox);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
}
.sandbox .muted { font-size: 13px; }
.numbers { display: flex; flex-direction: column; gap: 24px; }
.chart-card { display: flex; flex-direction: column; gap: 16px; }
.chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 6px; }
.swatch { width: 12px; height: 12px; border-radius: 3px; }
.swatch.apple { background: var(--ink); }
.swatch.google { background: var(--google); }
.chart-figure { margin: 0; display: flex; flex-direction: column; gap: 12px; }
/* Right to left so a narrow screen opens on the newest bar. */
.chart-plot { --axis: 64px; position: relative; display: grid; grid-template-columns: var(--axis) minmax(0, 1fr); }
/* Chrome misplaces local and scroll-driven shades in a right-to-left box, so phones get a fixed shade on the older side. */
.chart-plot::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--axis);
  width: 12px;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(farthest-side at 0 50%, var(--shade), transparent);
  display: none;
}
.chart-axis { position: relative; }
.chart-axis svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.chart { direction: rtl; background: var(--card); }
.chart svg { direction: ltr; display: block; width: 100%; min-width: 510px; height: auto; }
.figures summary { display: inline-flex; align-items: center; min-height: 44px; cursor: pointer; color: var(--link); font-weight: 600; }
.chart .gridline { stroke: var(--line); stroke-width: 1; }
.chart text, .chart-axis text { fill: var(--muted); font-family: var(--text); font-size: 12px; }
.chart-axis .tick-label { text-anchor: end; }
.chart .bar-label { text-anchor: middle; }
.bar-apple { fill: var(--ink); }
.bar-google { fill: var(--google); }
.bar-empty { fill: var(--line); }
.note { margin: 0; font-size: 13px; color: var(--muted); }
.badge {
  align-self: flex-start;
  margin: 0;
  padding: 4px 12px;
  border-radius: 8px;
  background: var(--line);
  font-size: 13px;
  font-weight: 600;
}
.badge.warn { background: var(--accent); }
.badge.bad { background: var(--danger); color: #FFFFFF; }
.card.warn { box-shadow: inset 0 0 0 2px var(--accent); }
.card.bad { box-shadow: inset 0 0 0 2px var(--danger); }
.firing { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 10px; background: var(--danger-soft); border: 1px solid var(--danger); }
.stat { font-family: var(--display); font-size: 22px; line-height: 1.2; }
.translation, .alerts { display: flex; flex-direction: column; gap: 16px; }
.alerts h3 { font-size: 16px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.topbar { display: none; }

@media (max-width: 720px) {
  .app { flex-direction: column; }
  .sidebar { display: none; }
  .topbar {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 10;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 16px;
    background: var(--ink);
    color: var(--ground);
  }
  .topbar .brand, .topbar .brand:hover { color: var(--ground); min-height: 44px; }
  .menu:not([open]) .menu-panel { display: none; }
  .menu summary {
    list-style: none;
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 10px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
    color: var(--nav-text);
    font-weight: 600;
    cursor: pointer;
  }
  .menu summary::-webkit-details-marker { display: none; }
  .menu[open] summary { background: rgba(255, 255, 255, 0.08); }
  .menu-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 16px 16px;
    background: var(--ink);
    box-shadow: 0 12px 24px var(--shade);
  }
  .menu-panel .who {
    margin: 12px 0 0;
    padding: 12px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  .menu-panel .who button.quiet { margin: 0; padding: 0 16px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24); border-radius: 10px; text-decoration: none; }
  main { padding: 20px 16px; }
  .tiles { grid-template-columns: 1fr; }
  .chart-plot { --axis: 40px; }
  .chart-plot::before { display: block; }
}

@media (max-width: 480px) {
  .grid thead, .people thead { display: none; }
  .grid, .grid tbody, .people, .people tbody, .people tr, .people td { display: block; }
  .grid tr { display: grid; grid-template-columns: repeat(4, 1fr); padding: 8px 0; border-bottom: 1px solid var(--line); }
  .grid tr > th[scope="row"] { grid-column: 1 / -1; position: static; box-shadow: none; border: 0; padding: 4px 0; min-width: 0; }
  .grid td { display: block; border: 0; }
  .tick { flex-direction: column; gap: 2px; min-height: 60px; font-size: 12px; font-weight: 500; }
  .tick-name { display: block; }
  .people tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .card.scroll > table.people td { padding: 2px 20px; border: 0; white-space: normal; overflow-wrap: anywhere; }
  .people td:first-child { font-weight: 600; }
  .people td:nth-child(2)::before { content: "Role: "; color: var(--muted); }
  .people td:nth-child(3)::before { content: "Authenticator: "; color: var(--muted); }
  .people td:nth-child(4)::before { content: "Last sign-in: "; color: var(--muted); }
  .people .row-actions { justify-content: flex-start; flex-wrap: wrap; }
}
