/*
 * Hamstra's dashboard. tokens.css (from the Webready design kit) comes first;
 * this file adds Hamstra's accent, the font and the layout. No inline styles
 * anywhere: the CSP is style-src 'self'.
 */

@font-face {
  font-family: "Figtree";
  src: url("fonts/figtree-latin.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Hamstra's accent (the design kit's docs/colour.md) */
:root { --accent: #9a520f; --accent-tile: #c46c1d; --accent-soft: #fff7ec; }
:root[data-theme="dark"] { --accent: #f2b866; --accent-soft: rgb(242 184 102 / 0.12); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --accent: #f2b866; --accent-soft: rgb(242 184 102 / 0.12); } }

/* Base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
p { margin: 0; }
code { font-family: var(--mono); font-size: 0.86em; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); }
.icon { width: 18px; height: 18px; flex: none; }
.muted { color: var(--text-3); }

.skip { position: absolute; left: -9999px; top: 8px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
.skip:focus { left: 8px; z-index: 10; }

/* Top bar */
.top {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand span { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; }
.mark { width: 34px; height: 34px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.top-actions form { margin: 0; }
.user { display: inline-flex; align-items: center; gap: 8px; padding: 0 4px; color: var(--text-2); font-weight: 600; }
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

/* The search box: properties and pages, Cmd+K or Ctrl+K from anywhere */
.finder { position: relative; flex: 1 1 280px; max-width: 440px; }
.finder-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 10px 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-3);
}
.finder-box:focus-within { border-color: var(--line-strong); background: var(--surface); }
.finder-box .icon { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.finder-box input { flex: 1; min-width: 0; min-height: 40px; border: 0; background: transparent; color: var(--text); font: inherit; outline: none; }
.finder-box input::placeholder { color: var(--text-3); }
.finder-box input::-webkit-search-cancel-button { display: none; }
.key { padding: 0 7px; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--text-3); font: 600 12px/20px var(--font); white-space: nowrap; }
.finder-list {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 360px;
  overflow-y: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.finder-group { padding: 8px 10px 4px; color: var(--text-3); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.finder-option { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.finder-option[aria-selected="true"], .finder-option:hover { background: var(--surface-2); }
.finder-label { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.finder-detail { color: var(--text-3); font-size: 13px; overflow-wrap: anywhere; }
.finder-none { padding: 10px; color: var(--text-3); }

button { font: inherit; cursor: pointer; }
.ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-2);
}
.ghost:hover { color: var(--text); border-color: var(--line-strong); }
.ghost.icon-only { justify-content: center; width: 44px; padding: 0; }

/* Main */
main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 32px 24px 48px; }
main > section > h1, .home-title { font-size: 34px; font-weight: 800; letter-spacing: -0.035em; }
.home-title { margin-bottom: 20px; }
.lede { margin-top: 6px; color: var(--text-2); font-size: 17px; }
.error { color: var(--down); }

/* Chips: a meaning with its icon and its word (the design kit's docs/colour.md) */
.chip { display: inline-flex; align-items: flex-start; gap: 6px; padding: 6px 10px; border-radius: var(--radius-sm); font-size: 14px; }
.chip .icon { width: 16px; height: 16px; margin-top: 2px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.chip.warn { background: var(--warn-soft); color: var(--warn); }

/* Empty state: nothing stored yet */
.empty {
  grid-column: 1 / -1;
  display: flex;
  gap: 28px;
  align-items: flex-start;
  padding: 28px;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.empty-character { width: 120px; height: 120px; flex: none; }
.empty h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.empty p, .empty ol { margin-top: 8px; color: var(--text-2); }
.empty ol { padding-left: 20px; }
.empty li { margin-top: 10px; }
.empty li.done::marker { color: var(--up); }
.step-done { display: inline-flex; align-items: center; gap: 4px; color: var(--up); }
.step-done .icon { fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.empty .chip { display: flex; margin-top: 8px; }

/* Something to copy: a command or an address, and its button */
.copyable { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; max-width: 100%; vertical-align: middle; }
.copyable code { overflow-wrap: anywhere; color: var(--text); }
.copy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
}
.copy:hover { color: var(--text); }
.copy .icon { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* What needs the site owner, above every view of a property */
.notices { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.notices:empty { display: none; }
.notice { display: flex; align-items: flex-start; gap: 8px; padding: 12px 16px; border-radius: var(--radius-sm); }
.notice .icon { margin-top: 3px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.runs-notice { margin-bottom: 20px; }
.notice code, .chip code { background: var(--surface); color: var(--text); }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* One property's head: back to all, its name, its views and the period */
.property-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.property-head .back { align-self: flex-start; min-height: 32px; }
.view > .group-head { margin-bottom: 0; } /* the view's gap spaces it */
.property-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; }
.property-title { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; overflow-wrap: anywhere; }
.property-meta { color: var(--text-3); font-size: 14px; overflow-wrap: anywhere; }
.property-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 4px; }
.tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  margin-bottom: -1px;
  border-bottom: 3px solid transparent;
  color: var(--text-2);
  font-weight: 600;
  text-decoration: none;
}
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { border-bottom-color: var(--accent-tile); color: var(--text); font-weight: 700; }
.period-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-bottom: 8px; }
.segmented { display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--surface-2); }
.segmented button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-2);
}
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 700; box-shadow: var(--shadow); }
.segmented .count { padding: 0 7px; border-radius: 999px; background: var(--line); color: var(--text-2); font-size: 12px; font-weight: 700; line-height: 20px; }

/* Every view of a property */
.view { display: flex; flex-direction: column; gap: 20px; }
.view-period { color: var(--text-3); font-size: 13px; }
.view[aria-busy="true"] { opacity: 0.55; transition: opacity 0.2s 0.1s; }
.view-head h1 { margin-top: 6px; font-size: 34px; font-weight: 800; letter-spacing: -0.035em; }
.view-head .lede { max-width: 720px; }

/* Overview */
:root { --archive-bar: #efc58f; --hatch-bg: #fbe3c4; --hatch-line: #c8701e; }
:root[data-theme="dark"] { --archive-bar: #8a5a26; --hatch-bg: #3a2a18; --hatch-line: #d98a3a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --archive-bar: #8a5a26; --hatch-bg: #3a2a18; --hatch-line: #d98a3a; } }

.answer-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 20px 28px;
  padding: 26px 28px 20px;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: 20px;
}
.answer h1 { margin-top: 8px; font-size: 38px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.1; }
.answer-why { margin-top: 10px; max-width: 640px; color: var(--text-2); font-size: 16px; }
.answer-why:empty { display: none; }
.explain { margin-top: 10px; color: var(--text-3); font-size: 13px; }
.change { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; }
.change .icon { fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.answer h1 .change { display: inline; }
.answer h1 .change .icon { width: 0.8em; height: 0.8em; vertical-align: -0.05em; margin-right: 4px; }
.change.up { color: var(--up); }
.change.down { color: var(--down); }
.page-path { font-weight: 600; color: var(--text); overflow-wrap: anywhere; }

.stash {
  display: flex;
  align-items: center;
  gap: 14px;
  align-self: start;
  padding: 16px;
  background: var(--surface);
  border-radius: var(--radius);
}
.stash-character { width: 64px; height: 64px; flex: none; }
.stash-label { color: var(--accent); font-size: 13px; font-weight: 700; }
.stash-big { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.stash-only { color: var(--text-2); font-size: 13px; }

.archive { grid-column: 1 / -1; }
.archive svg, .chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.archive .bar { fill: var(--archive-bar); }
.archive .bar.only { fill: url(#hatch); }
.hatch-bg { fill: var(--hatch-bg); }
.hatch-line { stroke: var(--hatch-line); stroke-width: 2.4; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.archive .marker { stroke: var(--text-2); stroke-width: 1.5; }
.archive .marker-label { fill: var(--text-2); font-size: 13px; font-weight: 600; }
.axis { fill: var(--text-3); font-size: 13px; }

.panel { padding: 20px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel h2 { font-size: 17px; font-weight: 700; }
.panel > h2 + div { margin-top: 12px; }
.panel-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.chart { margin-top: 12px; }
.chart .baseline { stroke: var(--line); }
.chart .line-now { fill: none; stroke: var(--accent-tile); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.chart .line-before { fill: none; stroke: var(--text-3); stroke-width: 2; stroke-dasharray: 6 5; stroke-linecap: round; }
.chart .label-now { fill: var(--text); font-size: 13px; font-weight: 700; }
.chart .label-before { fill: var(--text-2); font-size: 13px; font-weight: 700; }

.change-list { margin: 8px 0 0; padding: 0; list-style: none; }
.change-list li { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; align-items: baseline; gap: 4px 14px; padding: 10px 0; border-top: 1px solid var(--line); }
.change-list li:first-child { border-top: 0; }
.change-list li.muted { display: block; }
.change-list .page-path { font-weight: 600; }
.change-list .change-why { color: var(--text-2); text-align: right; }
.more-links { display: flex; gap: 16px; font-weight: 600; }
a.page-path { color: var(--text); text-decoration-color: var(--line-strong); }
a.page-path:hover { color: var(--accent); text-decoration-color: currentColor; }
.change-list .change { font-variant-numeric: tabular-nums; }
.change-list .muted { font-size: 13px; }

/* All properties: what needs you, and a row each */
.label { color: var(--text-3); font-size: 12px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; }
.needs { display: flex; flex-direction: column; gap: 10px; }
.needs-list { margin: 0; padding: 0; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.needs-list li + li { border-top: 1px solid var(--line); }
.needs-list a { display: flex; align-items: flex-start; gap: 14px; padding: 14px 20px; color: var(--text); text-decoration: none; }
.needs-list a:hover { background: var(--surface-2); }
.needs-icon { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex: none; border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--warn); }
.needs-icon .icon { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.needs-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.needs-why { color: var(--text-2); font-size: 14px; }
.all { display: flex; flex-direction: column; gap: 12px; }
.all h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.list-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; color: var(--text-3); font-size: 13px; }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 10px; height: 10px; border-radius: 2px; background: var(--archive-bar); }
.swatch.only { background: repeating-linear-gradient(45deg, var(--hatch-line) 0 2px, var(--hatch-bg) 2px 5px); }
.property-link { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.property-link .avatar { width: 32px; height: 32px; border-radius: 9px; background: var(--surface-2); color: var(--text-2); font-size: 14px; }
.property-text { display: flex; flex-direction: column; min-width: 0; }
.property-text .property-name { font-weight: 700; overflow-wrap: anywhere; }
.property-site { color: var(--text-3); font-size: 13px; overflow-wrap: anywhere; }
.property-note { color: var(--warn); font-size: 13px; font-weight: 600; }
.strip { display: block; width: 168px; height: 28px; }
.strip .kept { fill: var(--archive-bar); }
.strip .only { fill: url(#hatch-small); }
.strip .none { fill: var(--line); }
.kept-col .kept { display: block; font-weight: 600; }
.kept-col .only { display: block; color: var(--accent); font-size: 13px; }
/* A group's head in the table: its name, how many it holds, their visits together */
.home-rows .group-row { background: var(--bg); }
.group-text { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.group-name { color: var(--text); font-weight: 800; text-decoration: none; overflow-wrap: anywhere; }
a.group-name:hover { text-decoration: underline; }
.group-count { color: var(--text-3); font-size: 13px; font-weight: 500; }
/* A section of a site, under the property it is part of */
.section-row .property-link { padding-left: 20px; }
.section-mark { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex: none; color: var(--text-3); }
.section-mark .icon { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Lists of searches and pages */
.list, .list-section { display: flex; flex-direction: column; gap: 12px; }
.list-section h2 { font-size: 17px; font-weight: 700; }
.list-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.find { position: relative; display: flex; align-items: center; flex: 0 1 280px; }
.find .icon { position: absolute; left: 12px; color: var(--text-3); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.find input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px 0 38px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.find input::placeholder { color: var(--text-3); }
.list-explain { color: var(--text-2); font-size: 14px; }
.list-rows { display: flex; flex-direction: column; gap: 12px; }
.list-empty { padding: 16px 20px; }
.list-status:empty { display: none; }
.list-status { font-size: 13px; }
.footnote { max-width: 720px; color: var(--text-3); font-size: 13px; }
.more { align-self: flex-start; }
.more .muted { font-size: 13px; }

.table-box { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.rows { width: 100%; border-collapse: collapse; }
.rows th, .rows td { padding: 10px 12px; border-top: 1px solid var(--line); text-align: left; vertical-align: middle; }
.rows th:first-child, .rows td:first-child { padding-left: 20px; }
.rows th:last-child, .rows td:last-child { padding-right: 20px; }
.rows thead th { border-top: 0; padding-top: 11px; padding-bottom: 11px; background: var(--bg); color: var(--text-3); font-size: 13px; font-weight: 600; white-space: nowrap; }
.rows .num { text-align: right; white-space: nowrap; }
.rows tbody th { font-weight: 500; overflow-wrap: anywhere; }
.rows tbody tr[data-href] { cursor: pointer; }
.rows tbody tr[data-href]:hover { background: var(--surface-2); }
.rows .query { color: var(--text); }
.rows .visits { font-weight: 700; }
.rows .was { color: var(--text-3); font-size: 13px; }
.rows .change, .rows .chip, .rows .was { vertical-align: middle; }
.rows .chip { padding: 1px 8px; font-weight: 700; font-size: 13px; }
.rows .unit { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rows .place { font-weight: 600; }
.visits-col { width: 220px; white-space: nowrap; }
.visits-col .visits { display: inline-block; min-width: 48px; text-align: right; }
.change-col { white-space: nowrap; }
.place-col { width: 150px; }
.open-col { width: 44px; color: var(--text-3); }
.open-col .icon { display: block; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.share { display: inline-block; width: 120px; height: 6px; margin-left: 10px; vertical-align: middle; }
.share-bg { fill: var(--surface-2); }
.share-fill { fill: var(--archive-bar); }
.change.same { color: var(--text-3); font-weight: 600; }
.chip.new { background: var(--new-soft); color: var(--new); }
.chip.gone { background: var(--neutral-soft); color: var(--neutral); }
.chip.new .icon, .chip.gone .icon { width: 14px; height: 14px; margin-top: 3px; }

/* One page */
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 600; text-decoration: none; }
.back .icon { width: 16px; height: 16px; }
.back:hover { text-decoration: underline; }
.page-title { overflow-wrap: anywhere; }
.page-open { margin-top: 6px; }
.page-open:empty { display: none; }
.page-open a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.page-open .icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.page-answer { overflow: hidden; background: var(--accent-soft); border: 1px solid var(--line); border-radius: 20px; }
.page-why { padding: 20px 26px; font-size: 20px; font-weight: 700; line-height: 1.35; }
.page-why:empty { display: none; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.stat { padding: 18px 26px 22px; background: var(--surface); }
.stat + .stat { border-left: 1px solid var(--line); }
.stat-label { color: var(--text-3); font-size: 13px; font-weight: 700; }
.stat-value { margin-top: 4px; font-size: 32px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.stat-change { margin-top: 8px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.stat-change .was { color: var(--text-3); font-size: 14px; }
.stat-explain { margin-top: 10px; color: var(--text-3); font-size: 13px; }

/* Footer: the tool's own half always, the family credit unless FOOTER_CREDIT=false */
.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  color: var(--text-3);
  font-size: 13px;
}
.credit { display: inline-flex; align-items: center; gap: 6px; }
.credit a { color: var(--text-2); }
.credit-marks { display: inline-flex; gap: 4px; }
.credit-mark { width: 16px; height: 16px; }
.credit-marks a { display: inline-flex; }

/* Sign-in page */
body.login { align-items: center; justify-content: center; padding: 24px 16px; }
.login-card {
  flex: none;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
}
.login-character { width: 96px; height: 96px; }
.login-card h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; }
.login-tagline { color: var(--text-2); }
.login-form { width: 100%; margin-top: 16px; display: flex; flex-direction: column; gap: 6px; text-align: left; }
.login-form label { margin-top: 8px; font-weight: 600; font-size: 14px; }
.login-form input {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.login-form button {
  margin-top: 16px;
  min-height: 44px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
}
.login-error { padding: 8px 12px; border-radius: var(--radius-sm); background: var(--down-soft); color: var(--down); }
.login-steps { margin-top: 16px; text-align: left; }
.login-steps h2 { font-size: 18px; }
.login-steps p, .login-steps code { display: block; margin-top: 8px; }
.login-steps code { padding: 8px 10px; overflow-x: auto; }
.login-foot { position: static; justify-content: center; }

/* Phones */
@media (max-width: 860px) {
  .top { flex-wrap: wrap; gap: 10px 12px; }
  .brand { order: 0; }
  .top-actions { order: 1; }
  .finder { order: 2; flex: 1 1 100%; max-width: none; }
  .strip-col { display: none; }
}

@media (max-width: 640px) {
  .top { padding: 10px 16px 12px; }
  .user-name, .key { display: none; }
  main { padding: 20px 16px 40px; }
  main > section > h1, .home-title { font-size: 28px; }
  .empty { flex-direction: column; }
  .foot { padding: 16px; }
  .property-title { font-size: 26px; }
  .tabs { width: 100%; }
  .tabs a { flex: 1; justify-content: center; }
  .period-bar { width: 100%; }
  .answer-panel { grid-template-columns: minmax(0, 1fr); padding: 20px 18px; }
  .answer h1 { font-size: 28px; }
  .change-list li { grid-template-columns: 72px minmax(0, 1fr); }
  .change-list .change-why { grid-column: 2; text-align: left; font-size: 14px; }
  .segmented { width: 100%; }
  .segmented button { flex: 1; justify-content: center; padding: 0 6px; }
  .view-head h1 { font-size: 28px; }
  .find, .list-tools { flex: 1 1 100%; }
  .needs-list a { padding: 14px 16px; }
  .stats { grid-template-columns: minmax(0, 1fr); }
  .stat + .stat { border-left: 0; border-top: 1px solid var(--line); }
  .stat { padding: 14px 18px; }
  .stat-value { font-size: 26px; }
  .stat-change { margin-top: 4px; }
  .stat-explain { margin-top: 6px; }
  .page-why { font-size: 17px; padding: 16px 18px; }

  /* A row of a table becomes two lines: the name and its visits, then the change (and the place) */
  .rows thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .rows tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 2px 12px; padding: 10px 16px; border-top: 1px solid var(--line); }
  .rows tbody tr:first-child { border-top: 0; }
  .rows tbody + tbody tr:first-child { border-top: 1px solid var(--line); }
  .rows th, .rows td, .rows th:first-child, .rows td:first-child, .rows th:last-child, .rows td:last-child { padding: 0; border: 0; width: auto; }
  .rows td.num { text-align: left; }
  .rows .visits-col { text-align: right; }
  .rows .share, .rows .open-col, .rows .kept-col, .rows .strip-col { display: none; }
  .rows td.place-col { text-align: right; }
  .rows .unit { position: static; width: auto; height: auto; clip: auto; color: var(--text-3); font-weight: 400; }
  .home-rows .change-col { grid-column: 1 / -1; }
}

/* Touch screens: every target at least 44 px high (the kit's rule), however compact it looks with a mouse */
@media (pointer: coarse) {
  .segmented button, .copy { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
