/* Azwah Admin. One stylesheet, no build step.
   A fixed light theme in the brand's colours (website/app/globals.css): forest velvet sidebar, lime accent,
   white cards on a soft green-grey page. */

@font-face { font-family: "Inter Tight"; font-weight: 400; font-display: swap; src: url("inter-tight-400.woff2") format("woff2"); }
@font-face { font-family: "Inter Tight"; font-weight: 500; font-display: swap; src: url("inter-tight-500.woff2") format("woff2"); }
@font-face { font-family: "Inter Tight"; font-weight: 600; font-display: swap; src: url("inter-tight-600.woff2") format("woff2"); }
@font-face { font-family: "Newsreader"; font-weight: 400 600; font-display: swap; src: url("newsreader.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --page: #f5f7f5;
  --card: #ffffff;
  --brand: #237855;
  --forest: #11241c;
  --lime: #dbff78;
  --ink: #0f1a14;
  --muted: #66736b;
  --faint: #9aa59e;
  --line: #e4e8e5;
  --soft: #f1f4f2;
  --chart: #1f8a5b;
  --chart-soft: #d9efe4;
  --amber: #92400e;
  --amber-bg: #fef3c7;
  --red: #b42318;
  --display: "Newsreader", ui-serif, Georgia, serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, Menlo, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 14px/1.45 "Inter Tight", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum";
}
h1, h2, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
b, strong { font-weight: 500; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 8px; }
.side :focus-visible, .drawer-head :focus-visible { outline-color: var(--lime); }

.icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; top: 12px; left: 12px; z-index: 10; padding: 8px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; }

/* ---- Frame ---- */
.app { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; }

/* The website's velvet: the tile under a black shade, on forest. */
.side, .drawer-head {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.32), rgba(0, 0, 0, 0.45)),
    url("velvet.webp") left top / 1566.75px 564.75px repeat,
    var(--forest);
  color: #fff;
}
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column;
  padding: 24px 12px 16px;
}
.brand { display: flex; align-items: flex-end; gap: 8px; padding: 0 12px 24px; }
.brand-word { display: flex; align-items: flex-end; gap: 2px; color: var(--lime); font: 500 22px/0.9 var(--display); letter-spacing: 1px; }
.brand-word img { display: block; height: 28px; width: auto; }
.brand-tag { color: rgba(255, 255, 255, 0.6); font-size: 12px; line-height: 16px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-head { padding: 0 12px 6px; color: rgba(255, 255, 255, 0.5); font-size: 12px; line-height: 16px; }
.nav-head:not(:first-child) { margin-top: 22px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  height: 36px; padding: 0 12px; border-radius: 10px;
  color: rgba(255, 255, 255, 0.8); font-weight: 500;
}
a.nav-item:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.nav-item[aria-current="page"], a.nav-item[aria-current="page"]:hover { background: var(--lime); color: var(--forest); }
.nav-item.is-off { color: rgba(255, 255, 255, 0.38); font-weight: 400; }
.soon { margin-left: auto; color: rgba(255, 255, 255, 0.34); font-size: 12px; }

.side-note { margin-top: auto; padding: 16px 12px 0; border-top: 1px solid rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.6); font-size: 12px; line-height: 16px; }
.nav + .side-note { margin-top: 24px; }
.side-note-title { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; color: #fff; font-size: 13px; font-weight: 500; line-height: 20px; text-transform: capitalize; }
.side-note-title::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--lime); }
.side > .nav { flex: 1; }

.body { min-width: 0; }
.top {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 56px; padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
.top-title { color: var(--muted); font-weight: 500; }
.me { display: flex; align-items: center; gap: 8px; color: var(--muted); }

.main { display: flex; flex-direction: column; gap: 24px; max-width: 1440px; padding: 32px 32px 64px; }

/* ---- Type ---- */
h1 { font: 500 32px/1.15 var(--display); }
h2 { font-size: 15px; font-weight: 500; line-height: 20px; }
.hello.is-split { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.sub { margin-top: 4px; color: var(--muted); }
.sub b { color: var(--ink); }
.card-head .sub { margin-top: 2px; font-size: 12px; }
.count { color: var(--muted); }
.count b { color: var(--ink); }
.meta { color: var(--muted); font-size: 12px; }
.hint { color: var(--muted); line-height: 1.55; max-width: 64ch; }
.dash { color: var(--faint); }
.lower { text-transform: lowercase; }
.lime { color: var(--lime); }
.mono { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
dd.mono { color: var(--ink); }
.is-missing { color: var(--muted); font-weight: 400; }
.more { color: var(--brand); font-size: 13px; font-weight: 500; white-space: nowrap; }
.more:hover { text-decoration: underline; text-underline-offset: 3px; }
code { padding: 1px 5px; border-radius: 5px; background: var(--soft); font: 12.5px var(--mono); overflow-wrap: anywhere; }

/* ---- Cards ---- */
.card { min-width: 0; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: 0 1px 2px rgba(15, 26, 20, 0.04); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.card.is-flush { padding: 0; overflow: hidden; }
.card.is-flush > .card-head { margin: 0; padding: 20px 24px; align-items: center; border-bottom: 1px solid var(--line); }
.grid { display: grid; gap: 16px; }
.grid.is-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid.is-1-1 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.is-top { align-items: start; }
.stack { display: grid; gap: 16px; min-width: 0; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat { display: flex; flex-direction: column; gap: 12px; padding: 20px 24px; }
.stat-label { color: var(--muted); font-size: 14px; font-weight: 400; }
.chip-icon { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 8px; background: var(--soft); color: var(--brand); }
.chip-icon .icon { width: 16px; height: 16px; }
.chip-icon.is-big { width: 44px; height: 44px; border-radius: 12px; }
.chip-icon.is-big .icon { width: 22px; height: 22px; }
.stat-value { font-size: 32px; font-weight: 500; line-height: 1; }
.stat-note { min-height: 16px; color: var(--muted); font-size: 12px; line-height: 16px; }
.stat-note .is-up { color: var(--brand); }
.stat-note .is-down { color: var(--red); }

/* ---- Avatars, pills and tags ---- */
.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--soft); color: var(--muted);
  font-size: 12px; font-weight: 500;
}
.avatar.is-me { width: 28px; height: 28px; background: var(--forest); color: var(--lime); font-size: 11px; }
.avatar.is-big { width: 48px; height: 48px; background: var(--lime); color: var(--forest); font-size: 16px; }

.pill, .tag { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 6px; background: var(--soft); color: #47544c; font-size: 12px; font-weight: 400; line-height: 16px; white-space: nowrap; }
.pill.is-good, .tag.is-business { background: var(--chart-soft); color: #1b6245; font-weight: 500; }
.pill.is-wait { background: var(--amber-bg); color: var(--amber); }
.pill.is-lime { background: var(--lime); color: var(--forest); }
.pill.is-glass { background: rgba(255, 255, 255, 0.12); color: rgba(255, 255, 255, 0.85); }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }

.country { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.flag { display: block; flex: none; width: 20px; height: 15px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1); }

/* ---- Ranked bars ---- */
.bars { display: flex; flex-direction: column; gap: 4px; }
.bar-row { display: block; margin: 0 -8px; padding: 8px; border-radius: 8px; }
a.bar-row:hover { background: var(--soft); }
.bar-text { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bar-label { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.bar-label > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-value { flex: none; color: var(--muted); }
.bar-value b { color: var(--ink); }
.bar { display: block; width: 100%; height: 4px; margin-top: 8px; border: 0; border-radius: 99px; background: var(--soft); overflow: hidden; -webkit-appearance: none; appearance: none; }
.bar::-webkit-progress-bar { background: var(--soft); border-radius: 99px; }
.bar::-webkit-progress-value { background: var(--chart); border-radius: 99px; }
.bar::-moz-progress-bar { background: var(--chart); border-radius: 99px; }

/* ---- Line chart ---- */
.plot { display: flex; gap: 12px; }
.plot-y { display: flex; flex-direction: column; justify-content: space-between; height: 236px; margin-top: -8px; min-width: 24px; color: var(--muted); font: 12px var(--mono); text-align: right; }
.plot-area { flex: 1; min-width: 0; }
.plot-area svg { display: block; width: 100%; height: 220px; overflow: hidden; }
.grid-line { fill: none; stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.base { fill: none; stroke: var(--line); stroke-width: 1; }
.line { fill: none; stroke: var(--chart); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.area { fill: var(--chart); opacity: 0.08; stroke: none; }
/* One accent: today leads, the days before it stay quiet. */
.col { fill: #bfe0cf; stroke: none; }
.col:last-of-type { fill: var(--chart); }
.col:hover { fill: var(--brand); }
.hit { fill: transparent; stroke: none; }
.hit:hover { fill: var(--ink); opacity: 0.05; }
.plot-x { display: flex; justify-content: space-between; margin-top: 8px; color: var(--muted); font: 12px var(--mono); }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { height: 36px; padding: 0 12px; border-bottom: 1px solid var(--line); background: #fafbfa; color: var(--muted); font-size: 12px; font-weight: 400; text-align: left; white-space: nowrap; }
td { height: 56px; padding: 8px 12px; border-bottom: 1px solid var(--soft); white-space: nowrap; vertical-align: middle; }
th:first-child, td:first-child { padding-left: 24px; }
th:last-child, td:last-child { padding-right: 24px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { position: relative; scroll-margin-top: 35vh; }
tbody tr:hover td { background: #f7f9f7; }
tbody tr.is-open td { background: #edf6f1; }
tbody tr.is-open td:first-child { box-shadow: inset 2px 0 0 var(--brand); }
.num { text-align: right; }
td.num { color: var(--muted); font-size: 12px; }
td.mono { font-size: 12px; }
.clip { max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
td .tags { flex-wrap: nowrap; }
.who { display: inline-flex; align-items: center; gap: 12px; max-width: 260px; vertical-align: middle; }
.who-text, .two { display: flex; flex-direction: column; min-width: 0; }
.who-name { overflow: hidden; text-overflow: ellipsis; font-weight: 500; line-height: 20px; }
.who-sub { overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 12px; line-height: 16px; }
/* The whole row opens the side panel, not only the name. */
.who::after { content: ""; position: absolute; inset: 0; cursor: pointer; }
.updated { color: var(--brand); }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 24px; border-top: 1px solid var(--line); }
.pager-nav { display: flex; align-items: center; gap: 8px; }
.pager .meta { font-family: var(--mono); }
.empty { padding: 48px 20px; color: var(--muted); text-align: center; }
.blank { padding: 96px 24px; text-align: center; }
.blank .sub { margin: 8px auto 24px; }

/* ---- Controls ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--ink);
  font: inherit; font-weight: 500; white-space: nowrap; cursor: pointer;
}
.btn:hover { background: var(--soft); }
.btn .icon { width: 16px; height: 16px; }
.btn.is-primary { border-color: var(--forest); background: var(--forest); color: #fff; }
.btn.is-primary:hover { background: #1a3529; }
.btn.is-lime { border-color: var(--lime); background: var(--lime); color: var(--forest); }
.btn.is-lime:hover { border-color: #fff; background: #fff; }
.btn.is-glass { border-color: transparent; background: rgba(255, 255, 255, 0.1); color: #fff; }
.btn.is-glass:hover { background: rgba(255, 255, 255, 0.2); }
.btn.is-icon { width: 32px; height: 32px; padding: 0; border-radius: 8px; }
.btn:active { transform: scale(0.98); }
.btn.is-off:active { transform: none; }
.btn.is-off { opacity: 0.4; cursor: default; }
.btn.is-off:hover { background: var(--card); }

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 16px 24px 12px; }
.filters.is-second { gap: 8px; padding: 0 24px 16px; border-bottom: 1px solid var(--line); }
.filters .more { margin-left: auto; }
.filters > .meta { margin-right: 4px; }
.search { position: relative; display: flex; flex: 1; align-items: center; min-width: 240px; }
.search .icon { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--faint); pointer-events: none; }
.search input, select {
  height: 36px; border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink); font: inherit;
}
.search input { width: 100%; padding: 0 12px 0 36px; background: var(--card); }
.search input::placeholder { color: var(--faint); }
select { max-width: 240px; padding: 0 8px; background: var(--card); }
.search input:hover, select:hover { border-color: #cfd6d1; }
.search input:focus-visible, select:focus-visible { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(35, 120, 85, 0.14); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 5px 12px; border: 1px solid var(--line); border-radius: 99px; color: #47544c; font-size: 12px; line-height: 16px; white-space: nowrap; }
.chip:hover { background: var(--soft); }
.chip[aria-current="true"], .chip[aria-current="true"]:hover { border-color: var(--forest); background: var(--forest); color: var(--lime); font-weight: 500; }

/* Two views of one thing: a segmented switch beside the page title. */
.seg { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: #e9edea; }
.seg a { display: flex; align-items: center; height: 30px; padding: 0 16px; border-radius: 7px; color: var(--muted); font-weight: 500; }
.seg a:hover { color: var(--ink); }
.seg a[aria-current="page"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(15, 26, 20, 0.08); }

/* ---- One person ---- */
.crumbs { display: flex; gap: 8px; color: var(--muted); font-size: 13px; }
.crumbs a { color: var(--brand); font-weight: 500; }
.crumbs a:hover { text-decoration: underline; text-underline-offset: 3px; }
.crumbs span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs + .banner { margin-top: -8px; }

.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; padding: 28px; border-radius: 16px; }
.banner-text { flex: 1; min-width: 220px; }
.banner h1 { font-size: 26px; overflow-wrap: anywhere; }
.banner-text p { margin-top: 4px; color: rgba(255, 255, 255, 0.64); }
.banner-pills, .banner-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.facts > div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--soft); }
.stack + .stack .facts > div { grid-template-columns: 104px minmax(0, 1fr); }
.facts > div:first-child { padding-top: 0; }
.facts > div:last-child { padding-bottom: 0; border-bottom: 0; }
dt { color: var(--muted); }
dd { min-width: 0; overflow-wrap: anywhere; }
.words { line-height: 1.6; white-space: pre-line; }

.timeline li { position: relative; padding: 0 0 16px 20px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: 0; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--chart); }
.timeline li.is-joined::before { background: var(--brand); }
.timeline li.is-edited::before { background: #d97706; }
.timeline li:not(:last-child)::after { content: ""; position: absolute; left: 3.5px; top: 16px; bottom: 0; width: 1px; background: var(--line); }
.event-title { font-weight: 500; overflow-wrap: anywhere; }
.changes { display: grid; gap: 4px; margin-top: 8px; padding: 8px 12px; border-radius: 8px; background: rgba(241, 244, 242, 0.8); font-size: 12px; }
.changes > div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px; }
.changes s { color: var(--muted); }

.notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.notes li { padding: 12px 16px; border: 1px solid var(--soft); border-radius: 12px; background: rgba(241, 244, 242, 0.4); }
.note-who { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; color: var(--muted); font-size: 12px; }
.note-who a { color: var(--ink); font-weight: 500; }
.note-who a:hover { text-decoration: underline; text-underline-offset: 3px; }
.note-who time { margin-left: auto; }
.quote { margin-top: 8px; line-height: 1.6; white-space: pre-line; }
.quote span { color: var(--muted); }

.setup { display: flex; flex-direction: column; gap: 12px; max-width: 720px; padding: 32px; }
.setup h2 { font: 500 22px/1.3 var(--display); }
.setup p, .setup ol { color: var(--muted); line-height: 1.6; }
.setup ol { display: grid; gap: 8px; padding-left: 20px; list-style: decimal; color: var(--ink); }

/* ---- Side panel for one person ---- */
.scrim { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, 0.3); cursor: default; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 21; display: flex; flex-direction: column; width: 448px; max-width: 100vw; background: var(--card); box-shadow: -16px 0 48px rgba(0, 0, 0, 0.18); }
.drawer-head { flex: none; padding: 24px 24px 28px; }
.drawer-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.drawer-close { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: rgba(255, 255, 255, 0.7); }
.drawer-close:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.drawer-close .icon { width: 20px; height: 20px; }
.drawer-name { margin-top: 16px; font: 500 24px/1.25 var(--display); overflow-wrap: anywhere; }
.drawer-sub { margin-top: 4px; color: rgba(255, 255, 255, 0.62); }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.drawer-body { flex: 1; padding: 0 24px; overflow-y: auto; overscroll-behavior: contain; }
.drawer-body section { padding: 20px 0; border-bottom: 1px solid var(--line); }
.drawer-body section:last-child { border-bottom: 0; }
.drawer-body h3 { margin: 0 0 8px; font-size: 14px; font-weight: 500; line-height: 20px; }
.drawer-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.drawer-row h3 { margin: 0; }
.drawer-body .facts > div { grid-template-columns: 120px minmax(0, 1fr); }
.drawer-body .facts + .hint { margin-top: 12px; }

/* ---- Forms ---- */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field > span, .field > legend { padding: 0; color: var(--muted); font-size: 12px; line-height: 16px; }
.field > legend { margin-bottom: 6px; }
.field-row { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; }
.input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); font: inherit; }
textarea.input { height: auto; padding: 8px 12px; line-height: 1.5; resize: vertical; }
.input::placeholder { color: var(--faint); }
.input:hover { border-color: #cfd6d1; }
.input:focus-visible { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(35, 120, 85, 0.14); }
.input.is-code { height: 48px; font: 500 20px var(--mono); letter-spacing: 6px; text-align: center; }
.checks { display: grid; gap: 8px; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); }
.btn.is-wide { width: 100%; height: 40px; }
.btn.is-small { height: 28px; padding: 0 12px; font-size: 12px; }
.btn.is-danger { border-color: var(--red); background: var(--red); color: #fff; }
.btn.is-danger:hover { background: #8f1c13; }
.form > .btn { justify-self: start; }
.form > .btn.is-wide { justify-self: stretch; }
.link { padding: 0; border: 0; background: none; color: var(--brand); font: inherit; font-weight: 500; cursor: pointer; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

.note { padding: 12px 16px; border-radius: 8px; background: var(--chart-soft); color: #1b6245; line-height: 20px; }
.note.is-error { background: #fdecea; color: var(--red); }
.drawer-body > .note { margin-top: 20px; }

.fold { border: 1px solid var(--line); border-radius: 8px; }
.fold + .fold { margin-top: 8px; }
.fold summary { display: flex; align-items: center; justify-content: space-between; height: 40px; padding: 0 12px; border-radius: 8px; font-weight: 500; cursor: pointer; list-style: none; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary::after { content: ""; width: 7px; height: 7px; margin-right: 4px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg) translate(-2px, -2px); }
.fold[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.fold summary:hover { background: var(--soft); }
.fold .form { padding: 8px 12px 16px; }
.fold ~ .hint { margin-top: 12px; }
td.wrap { white-space: normal; min-width: 240px; }
.me form { display: flex; }

/* ---- Sign-in ---- */
.gate {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.32), rgba(0, 0, 0, 0.45)),
    url("velvet.webp") left top / 1566.75px 564.75px repeat,
    var(--forest);
}
.gate-main { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; min-height: 100vh; padding: 32px 16px; }
.gate .brand { padding: 0; }
.gate-card { width: 100%; max-width: 400px; padding: 32px; border-radius: 16px; background: var(--card); box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28); }
.gate-card h1 { font-size: 28px; }
.gate-card .sub { margin: 8px 0 24px; line-height: 1.55; }
.gate-card .sub b { overflow-wrap: anywhere; }
.gate-card .note { margin-bottom: 16px; }
.gate-more { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; margin-top: 20px; font-size: 13px; }
.gate-foot { color: rgba(255, 255, 255, 0.6); font-size: 12px; text-align: center; }

/* ---- Smaller screens ---- */
@media (max-width: 1240px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.is-2-1 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; padding: 14px 16px 12px; }
  .brand { padding: 0 4px 12px; }
  .nav { flex-direction: row; overflow-x: auto; }
  .nav-item { flex: none; }
  .nav-head, .nav-item.is-off, .side-note { display: none; }
  .top { position: static; height: 56px; padding: 0 16px; }
  .main { gap: 20px; padding: 20px 16px 56px; }
  .grid.is-1-1, .notes { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 20px; }
  .banner { padding: 20px; }
  .search { flex-basis: 100%; }
  select { flex: 1; max-width: none; }
  .facts > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: minmax(0, 1fr); }
  .me-text { display: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .drawer { animation: drawer-in 220ms var(--ease); }
  .scrim { animation: scrim-in 220ms var(--ease); }
  .nav-item, .btn, .chip, .seg a, td, .bar-row, .col, .search input, select { transition: background-color 140ms var(--ease), color 140ms var(--ease), border-color 140ms var(--ease), fill 140ms var(--ease), transform 140ms var(--ease); }
  .drawer.is-still, .scrim.is-still { animation: none; }
  .drawer.is-leaving { animation: drawer-out 160ms var(--ease) forwards; }
  .scrim.is-leaving { animation: scrim-out 160ms var(--ease) forwards; }
}
/* Moving between pages fades instead of flashing white. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-group(root) { animation-duration: 140ms; }
}
@keyframes drawer-out { to { transform: translateX(12px); opacity: 0; } }
@keyframes scrim-out { to { opacity: 0; } }
@keyframes drawer-in { from { transform: translateX(12px); opacity: 0; } }
@keyframes scrim-in { from { opacity: 0; } }

/* ---- PIN locks ---- */
.pin-head { display: flex; align-items: center; gap: 16px; }
.pin-who { flex: 1; min-width: 0; }
.pin-who h2 { overflow-wrap: anywhere; }
.pin-facts { margin-top: 20px; padding: 16px; border-radius: 12px; background: rgba(241, 244, 242, 0.6); }
.pin-form { margin-top: 24px; }
.pin-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pill.is-bad { background: #fdecea; color: var(--red); }
.timeline li.is-bad::before { background: var(--red); }
.timeline li.is-plain::before { background: var(--faint); }
.nav-count { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--red); color: #fff; font-size: 12px; line-height: 20px; text-align: center; }
main > .note { margin: 0; }
.pin-devices { margin-top: 20px; }
.pin-devices h3 { margin: 0 0 8px; font-size: 14px; font-weight: 500; }
.pin-devices ul { display: grid; gap: 8px; }
.pin-devices li { display: grid; gap: 2px; padding: 12px 16px; border: 1px solid var(--soft); border-radius: 12px; }
.pin-device-name { display: flex; align-items: center; gap: 8px; font-weight: 500; }
