/* Team Kyte panel. Colours and type follow Kyte's site (kiteside.app) and Brand.swift. */

@font-face {
  font-family: "Outfit";
  src: url("fonts/Outfit-Black.ttf") format("truetype");
  font-weight: 900;
  font-display: swap;
}
@font-face {
  font-family: "Outfit";
  src: url("fonts/Outfit-Bold.ttf") format("truetype");
  font-weight: 700 800;
  font-display: swap;
}

:root {
  --canvas: #f1f0f4;
  --card: #ffffff;
  --raised: #f7f6fa;
  --ink: #1f1f21;
  --quiet: #6b6b73;
  --faint: #9a9aa3;
  --line: rgba(31, 31, 33, 0.09);
  --line-strong: rgba(31, 31, 33, 0.16);
  --accent: #3373f2;
  --accent-ink: #ffffff;
  --accent-soft: rgba(51, 115, 242, 0.11);
  --you: #6b5cff;
  --danger: #d93a3f;
  --danger-soft: rgba(217, 58, 63, 0.1);
  --ok: #1f9d63;
  --ok-soft: rgba(31, 157, 99, 0.12);
  --warn: #b86e00;
  --warn-soft: rgba(230, 150, 20, 0.14);
  --glass: rgba(255, 255, 255, 0.72);
  --shadow: 0 1px 2px rgba(20, 20, 40, 0.04), 0 6px 20px rgba(20, 20, 40, 0.05);
  --shadow-lg: 0 2px 6px rgba(20, 20, 40, 0.08), 0 20px 50px rgba(20, 20, 40, 0.16);
  --skeleton: rgba(31, 31, 33, 0.07);
  --skeleton-hi: rgba(31, 31, 33, 0.03);
  --radius: 18px;
  --radius-s: 12px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --bar-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #0b0c12;
    --card: #171a22;
    --raised: #1f232d;
    --ink: #f3f3f6;
    --quiet: #a3a3ad;
    --faint: #767680;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.16);
    --accent: #5b8ff7;
    --accent-ink: #ffffff;
    --accent-soft: rgba(91, 143, 247, 0.16);
    --you: #8b7fff;
    --danger: #ff6b6f;
    --danger-soft: rgba(255, 107, 111, 0.13);
    --ok: #3fcf8e;
    --ok-soft: rgba(63, 207, 142, 0.13);
    --warn: #f0a83a;
    --warn-soft: rgba(240, 168, 58, 0.14);
    --glass: rgba(18, 20, 28, 0.74);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.4), 0 20px 50px rgba(0, 0, 0, 0.55);
    --skeleton: rgba(255, 255, 255, 0.07);
    --skeleton-hi: rgba(255, 255, 255, 0.025);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  background: var(--canvas);
  scroll-padding-top: calc(var(--bar-h) + 16px);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--canvas);
  color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

h1, h2, h3 { margin: 0; font-family: "Outfit", -apple-system, sans-serif; font-weight: 800; letter-spacing: -0.01em; }
h1 { font-size: 30px; line-height: 1.1; font-weight: 900; letter-spacing: -0.02em; }
h2 { font-size: 18px; line-height: 1.25; }
h3 { font-size: 13px; line-height: 1.3; text-transform: uppercase; letter-spacing: 0.06em; color: var(--quiet); font-weight: 700; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(107, 92, 255, 0.24); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
main:focus { outline: none; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip {
  position: fixed; left: 12px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font-weight: 600;
  transition: top 0.2s var(--ease-out);
}
.skip:focus { top: 12px; text-decoration: none; }

/* The Kyte mark (the app icon) */
.mark {
  display: inline-block; flex: none;
  width: 26px; height: 26px;
  border-radius: 8px;
  background: url("favicon.svg") center / cover no-repeat;
  box-shadow: 0 2px 8px rgba(80, 90, 255, 0.28);
}
.mark-l { width: 52px; height: 52px; border-radius: 15px; }

/* Top bar */

.topbar {
  position: sticky; top: 0; z-index: 20;
  height: var(--bar-h);
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  backdrop-filter: blur(18px) saturate(1.6);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  height: 100%;
  max-width: 1280px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 20px;
}
.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  font: 900 21px/1 "Outfit", sans-serif; letter-spacing: -0.03em;
  color: var(--ink); white-space: nowrap;
}
.wordmark:hover { text-decoration: none; opacity: 0.8; }

.tabs { display: flex; gap: 2px; margin-right: auto; }
.tabs a {
  position: relative;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; border-radius: 999px;
  color: var(--quiet); font-weight: 600; font-size: 14.5px;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.tabs a:hover { color: var(--ink); background: var(--line); text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--ink); background: var(--card); box-shadow: var(--shadow); }
.tabs .tab-icon { width: 17px; height: 17px; }
.count {
  min-width: 20px; height: 20px; padding: 0 6px;
  display: inline-grid; place-items: center;
  border-radius: 999px; background: var(--danger); color: #fff;
  font-size: 11.5px; font-weight: 700; line-height: 1;
}

.account { position: relative; }
.account-button {
  display: grid; place-items: center;
  width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; cursor: pointer;
  transition: transform 0.2s var(--ease-spring);
}
.account-button:hover { transform: scale(1.06); }
.account-button:active { transform: scale(0.96); }
.account-button .avatar { box-shadow: 0 0 0 2px var(--card), 0 0 0 3px var(--line-strong); }

.menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30;
  width: 270px; padding: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-lg);
  animation: pop 0.22s var(--ease-out);
  transform-origin: top right;
}
.menu-head { display: flex; align-items: center; gap: 12px; padding: 8px 8px 10px; }
.menu-name { font-weight: 700; overflow-wrap: anywhere; }
.menu-sub { color: var(--quiet); font-size: 13px; }
.menu-note { padding: 8px 10px; margin: 0 0 6px; border-radius: 10px; background: var(--raised); color: var(--quiet); font-size: 13px; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; border: 0; border-radius: 10px;
  background: transparent; color: var(--ink); text-align: left; cursor: pointer; font-size: 14.5px;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--line); text-decoration: none; outline: none; }
.menu-item .icon { color: var(--quiet); }
.menu-danger, .menu-danger .icon { color: var(--danger); }

@keyframes pop { from { opacity: 0; transform: scale(0.96) translateY(-4px); } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes fade { from { opacity: 0; } }

/* Pages */

.view { min-height: calc(100vh - var(--bar-h)); }
.page {
  max-width: 980px; margin: 0 auto; padding: 28px 20px 64px;
  animation: rise 0.35s var(--ease-out);
}
.page-wide { max-width: 1280px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.section { margin-top: 28px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section-title { margin-bottom: 10px; font-size: 17px; }
.section-head .section-title { margin-bottom: 0; }
.link { font-weight: 600; font-size: 14px; }
.muted { color: var(--quiet); }
.pad { padding: 16px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-title { font-size: 15px; margin-bottom: 12px; }

.boot { display: grid; place-items: center; min-height: 60vh; }
.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--line-strong); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Buttons and fields */

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; padding: 8px 15px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--card); color: var(--ink);
  font-weight: 600; font-size: 14.5px; line-height: 1.2; white-space: nowrap;
  cursor: pointer; user-select: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s var(--ease-spring), opacity 0.15s ease;
}
.button:hover { background: var(--raised); text-decoration: none; }
.button:active { transform: scale(0.97); }
.button:disabled { opacity: 0.5; cursor: default; transform: none; }
.button-primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.button-primary:hover { background: var(--accent); filter: brightness(1.08); }
.button-danger { background: var(--danger); border-color: transparent; color: #fff; }
.button-danger:hover { background: var(--danger); filter: brightness(1.08); }
.button-danger-quiet { color: var(--danger); }
.button-danger-quiet:hover { background: var(--danger-soft); }
.button-s { min-height: 32px; padding: 5px 12px; font-size: 13.5px; }
.button.busy { position: relative; color: transparent !important; }
.button.busy::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-color: rgba(255, 255, 255, 0.5); border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}
.button:not(.button-primary):not(.button-danger).busy::after { border-color: var(--line-strong); border-top-color: var(--ink); }

.icon-button {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; padding: 0;
  border: 0; border-radius: 10px; background: transparent; color: var(--quiet); cursor: pointer;
}
.icon-button:hover { background: var(--line); color: var(--ink); }

.back {
  display: none; align-items: center; gap: 4px;
  margin: 0 0 14px -4px; padding: 4px 8px 4px 4px; border-radius: 999px;
  color: var(--accent); font-weight: 600;
}
.back:hover { background: var(--accent-soft); text-decoration: none; }
.back-always { display: inline-flex; }

.input {
  width: 100%; min-height: 40px; padding: 8px 12px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-s);
  background: var(--card); color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.input { resize: vertical; min-height: 64px; line-height: 1.45; }
select.input {
  appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--quiet) 50%), linear-gradient(135deg, var(--quiet) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.input-s { width: auto; min-height: 32px; padding: 4px 30px 4px 10px; font-size: 13.5px; }
.input-code { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.12em; text-transform: uppercase; }
.input-code::placeholder { letter-spacing: normal; text-transform: none; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }

.field { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field > label, .field > legend { font-size: 13px; font-weight: 600; color: var(--quiet); padding: 0; }
.field > legend { margin-bottom: 6px; }
.hint { font-size: 12.5px; color: var(--faint); }

.choices { display: flex; flex-wrap: wrap; gap: 6px; }
.choice { position: relative; cursor: pointer; }
.choice span {
  display: inline-flex; align-items: center; min-height: 34px; padding: 6px 13px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  font-size: 13.5px; font-weight: 600; color: var(--quiet);
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.choice:hover span { color: var(--ink); }
.choice input:checked + span { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

kbd {
  display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px;
  border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 7px;
  background: var(--raised); font: 600 12.5px/1 ui-monospace, "SF Mono", Menlo, monospace; color: var(--quiet);
}

/* Avatars, pills and badges */

.avatar {
  --size: 40px;
  position: relative; display: inline-grid; place-items: center; flex: none;
  width: var(--size); height: var(--size); border-radius: 50%;
  background: var(--c, var(--you)); overflow: hidden;
  font-size: calc(var(--size) * 0.52); line-height: 1;
  color: #fff; user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar .initial { font: 800 calc(var(--size) * 0.44) / 1 "Outfit", sans-serif; }
.avatar-xs { --size: 20px; }
.avatar-s { --size: 28px; }
.avatar-m { --size: 40px; }
.avatar-l { --size: 48px; }
.avatar-xl { --size: 72px; }
.avatar-xxl { --size: 96px; box-shadow: 0 0 0 4px var(--card); }

.who { display: inline-flex; align-items: center; gap: 8px; min-width: 0; color: var(--ink); vertical-align: middle; }
a.who:hover { text-decoration: none; }
a.who:hover .who-name { text-decoration: underline; text-underline-offset: 3px; }
.who-text { display: flex; flex-direction: column; min-width: 0; }
.who-name { font-weight: 600; overflow-wrap: anywhere; display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.who-sub { font-size: 13px; color: var(--quiet); }
.who-l .who-name { font-size: 16px; }
.you-tag { padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11.5px; font-weight: 700; }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px;
  background: var(--line); color: var(--quiet);
  font-size: 12px; font-weight: 700; line-height: 1.5; white-space: nowrap;
}
.pill-reason-name_or_photo { background: rgba(107, 92, 255, 0.13); color: var(--you); }
.pill-reason-harassment { background: var(--warn-soft); color: var(--warn); }
.pill-reason-hate { background: var(--danger-soft); color: var(--danger); }
.pill-reason-spam { background: rgba(46, 204, 158, 0.15); color: #138a68; }
.pill-reason-other { background: var(--line); color: var(--quiet); }
.pill-open { background: var(--accent-soft); color: var(--accent); }
.pill-closed { background: var(--ok-soft); color: var(--ok); }
.pill-team { background: rgba(77, 158, 255, 0.15); color: var(--accent); }
.pill-role { background: rgba(107, 92, 255, 0.13); color: var(--you); }
.pill-danger { background: var(--danger-soft); color: var(--danger); }
.pill-muted { background: var(--line); color: var(--quiet); }
.pill-info { background: var(--warn-soft); color: var(--warn); }
@media (prefers-color-scheme: dark) {
  .pill-reason-spam { color: #4fe0b5; }
}

.badges { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px; }
.badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 12px 4px 4px; border-radius: 999px;
  background: var(--raised); border: 1px solid var(--line);
  font-size: 13.5px; font-weight: 600;
}
.badge-medal {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--c); color: #fff;
}
.glyph { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.badge-team .badge-medal { box-shadow: 0 0 0 2px var(--card), 0 0 0 3px var(--c); }
.badge-showcased { border-color: var(--c); }

.code {
  font: 600 13.5px/1.4 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.08em;
  padding: 1px 7px; border-radius: 6px; background: var(--line); color: var(--ink);
}
.code-l { font-size: 17px; padding: 3px 10px; letter-spacing: 0.14em; }
.code-s { font-size: 12px; letter-spacing: 0; overflow-wrap: anywhere; background: transparent; padding: 0; color: var(--quiet); }

/* Lists and rows */

.list { overflow: hidden; }
.list > [role="listitem"] + [role="listitem"] > .row,
.list > .row + .row,
.list > .skeletons + .row { border-top: 1px solid var(--line); }
.row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 12px 16px; color: var(--ink);
  transition: background-color 0.12s ease;
  position: relative;
}
a.row:hover { background: var(--raised); text-decoration: none; }
.row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 0; background: var(--raised); }
.row.selected { background: var(--accent-soft); }
.row.selected::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.row-main { display: grid; gap: 3px; min-width: 0; }
.row-title { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.row-name { font-weight: 650; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-was { color: var(--faint); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; color: var(--quiet); }
.row-kind { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.row-snippet { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.row-side { display: grid; justify-items: end; gap: 3px; font-size: 12.5px; color: var(--quiet); white-space: nowrap; }
.row-count { color: var(--danger); font-weight: 600; }
.row-outcome { color: var(--ok); font-weight: 600; }
.row.is-closed .avatar { opacity: 0.75; }
.list-compact .row { padding: 10px 14px; }

.entry-text { overflow-wrap: anywhere; color: var(--quiet); }
.entry-name { color: var(--ink); font-weight: 600; }
.entry-gone { color: var(--quiet); font-style: italic; font-weight: 500; }
.entry-detail { font-size: 12.5px; color: var(--faint); }
.entry-row { cursor: default; }

/* Loading */

.skeletons { display: grid; }
.skeleton { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.skeleton + .skeleton { border-top: 1px solid var(--line); }
.sk-circle, .sk-line, .sk-block {
  display: block; border-radius: 999px;
  background: linear-gradient(90deg, var(--skeleton) 25%, var(--skeleton-hi) 50%, var(--skeleton) 75%);
  background-size: 300% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
}
.sk-circle { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.sk-lines { display: grid; gap: 8px; flex: 1; }
.sk-line { height: 11px; width: 62%; }
.sk-line.short { width: 34%; }
.skeleton-head .sk-circle { width: 72px; height: 72px; }
.sk-block { height: 120px; border-radius: 14px; margin: 16px; }
.sk-block.short { height: 64px; width: 60%; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* Empty states */

.empty { display: grid; justify-items: center; gap: 8px; padding: 48px 20px; text-align: center; color: var(--quiet); }
.empty > .icon { width: 34px; height: 34px; color: var(--faint); margin-bottom: 4px; }
.empty-title { font: 700 17px/1.3 "Outfit", sans-serif; color: var(--ink); overflow-wrap: anywhere; }
.empty-text { max-width: 36ch; font-size: 14px; }
.empty .button { margin-top: 8px; }
.empty-error > .icon { color: var(--danger); }

/* Overview */

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat {
  position: relative; display: grid; gap: 2px; padding: 18px 18px 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  color: var(--ink); transition: transform 0.2s var(--ease-spring), box-shadow 0.2s ease;
}
a.stat:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat > .icon { position: absolute; right: 14px; top: 18px; color: var(--faint); }
.stat-value { font: 900 34px/1 "Outfit", sans-serif; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 13.5px; color: var(--quiet); font-weight: 600; }
.stat-alert .stat-value { color: var(--danger); }
.stat-loading .stat-value { color: var(--faint); }

/* Reports */

.segmented { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--line); }
.segment {
  min-height: 34px; padding: 6px 18px; border: 0; border-radius: 999px;
  background: transparent; color: var(--quiet); font-weight: 600; cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}
.segment[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }

.chips { display: flex; gap: 6px; margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin-left: -2px; margin-right: -2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 32px; padding: 5px 13px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: transparent;
  color: var(--quiet); font-size: 13.5px; font-weight: 600; cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.chip:hover { color: var(--ink); background: var(--line); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--canvas); border-color: transparent; }

.split { display: grid; grid-template-columns: minmax(320px, 410px) minmax(0, 1fr); gap: 16px; align-items: start; }
.pane { position: sticky; top: calc(var(--bar-h) + 16px); max-height: calc(100vh - var(--bar-h) - 32px); overflow: auto; overscroll-behavior: contain; }
.sentinel { height: 1px; }
.detail-pane { padding: 22px 24px 26px; outline: none; }
.detail-empty { display: grid; place-items: center; gap: 8px; min-height: 320px; color: var(--faint); }
.detail-empty .icon { width: 36px; height: 36px; }
.detail-loading .skeleton { padding: 0; }
.detail-loading .sk-block { margin: 18px 0 0; }

.detail-head { display: grid; gap: 8px; margin-bottom: 20px; animation: fade 0.25s ease; }
.detail-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.detail-title { font-size: 22px; overflow-wrap: anywhere; }
.detail-sub { color: var(--quiet); font-size: 14px; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }

.compare {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px;
  padding: 18px; border-radius: 16px; background: var(--raised); border: 1px solid var(--line);
}
.compare-side { display: grid; gap: 10px; justify-items: center; text-align: center; min-width: 0; }
.compare-label { font-size: 12px; font-weight: 700; color: var(--quiet); text-transform: uppercase; letter-spacing: 0.06em; }
.compare-face { display: grid; justify-items: center; gap: 8px; color: var(--ink); min-width: 0; }
a.compare-face:hover { text-decoration: none; }
a.compare-face:hover .compare-name { text-decoration: underline; text-underline-offset: 3px; }
.compare-name { font: 700 16px/1.3 "Outfit", sans-serif; overflow-wrap: anywhere; }
.compare-arrow { color: var(--faint); }

.block { margin-top: 22px; display: grid; gap: 10px; }
.quote {
  margin: 0; padding: 12px 14px; border-left: 3px solid var(--line-strong); border-radius: 4px 12px 12px 4px;
  background: var(--raised); white-space: pre-wrap; overflow-wrap: anywhere;
}
.quote-team { border-left-color: var(--accent); }
.item-text {
  padding: 14px 16px; border-radius: 12px; border: 1px dashed var(--line-strong);
  white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px;
}
.action-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.close-form { display: grid; gap: 12px; padding: 16px; border-radius: 16px; background: var(--raised); border: 1px solid var(--line); }
.closed-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-weight: 600; color: var(--ok); }
.closed-line .who { color: var(--ink); }

/* People */

.search {
  position: relative; display: flex; align-items: center;
  margin-bottom: 16px;
}
.search > .icon { position: absolute; left: 16px; color: var(--quiet); pointer-events: none; }
.input-search { min-height: 52px; padding: 12px 52px 12px 46px; border-radius: 16px; font-size: 17px; box-shadow: var(--shadow); }
.input-search::-webkit-search-cancel-button { cursor: pointer; }
.search-key { position: absolute; right: 14px; pointer-events: none; }
.input-search:focus ~ .search-key { opacity: 0; }

.person-row .row-meta { flex-wrap: wrap; }

.person-card { position: relative; overflow: hidden; padding: 0 22px 20px; }
.person-banner {
  height: 92px; margin: 0 -22px;
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--c) 55%, transparent), transparent 60%),
    linear-gradient(120deg, color-mix(in srgb, var(--c) 35%, var(--card)), color-mix(in srgb, var(--you) 25%, var(--card)));
}
.person-top { display: flex; align-items: flex-start; gap: 18px; flex-wrap: wrap; }
.person-top > .avatar { margin-top: -44px; }
.person-id { display: grid; gap: 8px; min-width: 0; flex: 1 1 220px; padding-top: 14px; }
.person-name { font-size: 26px; overflow-wrap: anywhere; }
.person-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.code-row { display: flex; align-items: center; gap: 4px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px 20px; margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--line); }
.fact { min-width: 0; }
.fact dt { font-size: 12px; font-weight: 700; color: var(--quiet); text-transform: uppercase; letter-spacing: 0.05em; }
.fact dd { margin: 3px 0 0; overflow-wrap: anywhere; }

.notice { margin-top: 16px; padding: 16px 18px; display: grid; gap: 10px; }
.notice-head { display: flex; align-items: center; gap: 10px; }
.notice-head .icon { width: 22px; height: 22px; color: var(--quiet); }
.notice-danger { border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: color-mix(in srgb, var(--danger) 6%, var(--card)); }
.notice-danger .notice-head .icon, .notice-danger h2 { color: var(--danger); }
.notice-line { color: var(--quiet); display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.action-card { padding: 14px; }

.team-badges { padding: 16px; display: grid; gap: 16px; }
.checks { display: flex; flex-wrap: wrap; gap: 10px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 6px 4px 10px; border-radius: 999px; border: 1px solid var(--line); }
.check:hover { background: var(--raised); }
.check input { width: 17px; height: 17px; accent-color: var(--accent); margin: 0; cursor: pointer; }
.check .badge { background: transparent; border: 0; padding-left: 0; }
.team-badges-foot { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.team-badges-foot .field { width: 220px; max-width: 100%; }

.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }

/* Team */

.add-staff { padding: 18px; margin-bottom: 16px; }
.add-staff-row { display: flex; gap: 8px; flex-wrap: wrap; }
.add-staff-row .input-code { flex: 1 1 180px; width: auto; }
.add-staff-row select { flex: 0 0 150px; }
.team-list { display: grid; gap: 12px; }
.member { padding: 16px 18px; animation: rise 0.3s var(--ease-out); }
.member-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.member-controls { display: flex; align-items: center; gap: 8px; }
.sessions { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.sessions-title { margin-bottom: 8px; }
.session-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.session { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; }
.session > .icon { width: 20px; height: 20px; color: var(--quiet); }
.session-current { background: var(--accent-soft); }
.session-name { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.session-sub { font-size: 13px; color: var(--quiet); overflow-wrap: anywhere; }

/* Activity */

.log { display: grid; gap: 22px; }
.log-day-title { font-size: 14px; color: var(--quiet); font-weight: 700; margin: 0 0 8px 4px; font-family: inherit; letter-spacing: 0; }
.log-end { text-align: center; color: var(--faint); font-size: 13px; padding: 24px 0 0; }

/* Sign-in */

.signin { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.signin-card {
  width: min(760px, 100%); padding: 32px;
  background: var(--card); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow-lg);
  animation: rise 0.5s var(--ease-out);
}
.signin-head { display: flex; align-items: center; gap: 14px; }
.signin-head h1 { font-size: 28px; }
.signin-note { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; padding: 4px 12px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-weight: 600; font-size: 13.5px; }
.signin-body { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 32px; align-items: center; margin-top: 26px; }
.qr-wrap { display: grid; gap: 10px; }
.qr {
  width: 260px; height: 260px; padding: 10px;
  border-radius: 22px; background: #fff; border: 1px solid var(--line);
  display: grid; place-items: center;
  transition: opacity 0.3s ease, filter 0.3s ease, transform 0.4s var(--ease-spring);
}
.qr-code { width: 100%; height: 100%; display: block; }
.qr-bg { fill: #fff; }
.qr-fg { fill: #111216; }
.signin-card[data-ready="false"] .qr { opacity: 0.35; filter: blur(3px); }
.signin-card[data-ready="done"] .qr { transform: scale(0.96); opacity: 0.4; }
.signin-progress { height: 4px; border-radius: 999px; background: var(--line); overflow: hidden; }
.signin-progress span { display: block; height: 100%; background: var(--accent); transform-origin: left; animation: deplete 120s linear forwards; }
.signin-card:not([data-state="waiting"]) .signin-progress span { animation-play-state: paused; opacity: 0.4; }
@keyframes deplete { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.signin-side { display: grid; gap: 10px; justify-items: start; }
.match-label { font-size: 13px; font-weight: 700; color: var(--quiet); text-transform: uppercase; letter-spacing: 0.06em; }
.match {
  font: 900 112px/0.9 "Outfit", sans-serif; letter-spacing: -0.04em; font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, var(--you), var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  min-height: 100px;
}
.signin-card[data-ready="false"] .match { opacity: 0.3; }
.signin-how { color: var(--quiet); max-width: 36ch; }
.signin-status { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; font-weight: 600; min-height: 24px; }
.signin-status .i-dot { color: var(--accent); animation: breathe 1.4s ease-in-out infinite; }
.signin-card[data-state="loading"] .signin-status { color: var(--quiet); }
.signin-card[data-state="approved"] .signin-status { color: var(--ok); }
.signin-card[data-state="refused"] .signin-status,
.signin-card[data-state="error"] .signin-status,
.signin-card[data-state="expired"] .signin-status { color: var(--danger); }
@keyframes breathe { 50% { opacity: 0.3; transform: scale(0.7); } }

/* Toasts */

.toasts {
  position: fixed; left: 50%; bottom: 24px; z-index: 60;
  display: grid; gap: 8px; justify-items: center;
  transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px);
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 18px 11px 14px; border-radius: 999px;
  background: var(--ink); color: var(--canvas); box-shadow: var(--shadow-lg);
  font-weight: 600; font-size: 14.5px;
  opacity: 0; transform: translateY(12px) scale(0.96);
  transition: opacity 0.25s ease, transform 0.35s var(--ease-spring);
  max-width: 100%;
}
.toast span { overflow-wrap: anywhere; }
.toast.in { opacity: 1; transform: none; }
.toast.out { opacity: 0; transform: translateY(6px); }
.toast-ok .icon { color: var(--ok); }
.toast-error .icon { color: var(--danger); }
@media (prefers-color-scheme: dark) {
  .toast { background: #f3f3f6; color: #111216; }
  .toast-ok .icon { color: #1f9d63; }
  .toast-error .icon { color: #d93a3f; }
}

/* Dialogs */

.dialog {
  width: min(460px, calc(100vw - 32px)); max-height: calc(100dvh - 48px);
  padding: 0; border: 1px solid var(--line); border-radius: 22px;
  background: var(--card); color: var(--ink); box-shadow: var(--shadow-lg);
  overflow: auto;
}
.dialog[open] { animation: pop 0.25s var(--ease-out); }
.dialog::backdrop { background: rgba(10, 10, 20, 0.42); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fade 0.2s ease; }
.dialog-body { display: grid; gap: 14px; padding: 22px; }
.dialog-title { font-size: 20px; overflow-wrap: anywhere; }
.dialog-text { color: var(--quiet); }
.dialog-error { padding: 9px 12px; border-radius: 10px; background: var(--danger-soft); color: var(--danger); font-weight: 600; font-size: 14px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.dialog-who { padding: 12px; border-radius: 14px; background: var(--raised); }
.dialog-fields { display: grid; gap: 14px; }
.dialog-fields > .who { padding: 10px 12px; border-radius: 14px; background: var(--raised); }
.keylist { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 0; align-items: center; }
.keylist dt { display: flex; gap: 4px; }
.keylist dd { margin: 0; color: var(--quiet); }

/* Narrower screens: the reports list and the open report stack */

@media (max-width: 899px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .pane { position: static; max-height: none; overflow: visible; }
  .split .detail-pane { display: none; }
  .split.has-detail .list-pane { display: none; }
  .split.has-detail .detail-pane { display: block; }
  .split.has-detail ~ * { display: none; }
  .view-reports .page:has(.has-detail) .chips,
  .view-reports .page:has(.has-detail) .page-head { display: none; }
  .back { display: inline-flex; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col { grid-template-columns: minmax(0, 1fr); }
}

/* Phones: tabs move to a bar at the bottom */

@media (max-width: 719px) {
  :root { --bar-h: 56px; }
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  h1 { font-size: 26px; }
  /* A backdrop filter would make the topbar the containing block of the fixed tab bar inside it. */
  .topbar { -webkit-backdrop-filter: none; backdrop-filter: none; background: color-mix(in srgb, var(--canvas) 94%, transparent); }
  .topbar-inner { padding: 0 16px; justify-content: space-between; }
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    justify-content: space-around; gap: 0; margin: 0;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: var(--glass); border-top: 1px solid var(--line);
    -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6);
  }
  .account-button { width: 36px; height: 36px; }
  .tabs a { flex: 1; flex-direction: column; gap: 2px; padding: 6px 2px; border-radius: 12px; font-size: 11px; }
  .tabs a[aria-current="page"] { background: transparent; box-shadow: none; color: var(--accent); }
  .tabs .tab-icon { width: 22px; height: 22px; }
  .tabs .count { position: absolute; top: 0; left: calc(50% + 6px); min-width: 18px; height: 18px; font-size: 10.5px; }
  .page { padding: 20px 16px 40px; }
  .page-head { margin-bottom: 14px; }
  .stat { padding: 14px; }
  .stat-value { font-size: 28px; }
  .detail-pane { padding: 18px 16px 22px; }
  .compare { padding: 14px 10px; gap: 6px; }
  .compare .avatar-xl { --size: 56px; }
  .row { padding: 12px 14px; gap: 10px; }
  .report-row .row-snippet { display: none; }
  .person-card { padding: 0 16px 18px; }
  .person-banner { margin: 0 -16px; height: 76px; }
  .person-top { gap: 4px 14px; }
  .person-top > .avatar { margin-top: -36px; }
  .person-id { padding-top: 8px; }
  .avatar-xxl { --size: 80px; }
  .person-name { font-size: 22px; }
  .signin-card { padding: 22px 18px; border-radius: 24px; }
  .signin-head h1 { font-size: 23px; }
  .signin-body { grid-template-columns: minmax(0, 1fr); gap: 20px; justify-items: center; text-align: center; }
  .signin-side { justify-items: center; }
  .qr { width: min(240px, 72vw); height: min(240px, 72vw); }
  .match { font-size: 88px; min-height: 80px; }
  .toasts { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .member-head { align-items: flex-start; }
  .session { grid-template-columns: auto minmax(0, 1fr); }
  .session > .button { grid-column: 2; justify-self: start; }
  .dialog-actions { flex-direction: column-reverse; }
  .dialog-actions .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .signin-progress span { animation: none; }
}
