/* Strays: one stylesheet, light and dark (follows the device setting). Fonts: Bricolage Grotesque
   (headings), IBM Plex Sans (text) and IBM Plex Mono (resource names), SIL Open Font License,
   served from /static/fonts. */
@font-face { font-family: "Bricolage Grotesque"; src: url("/static/fonts/bricolage-grotesque-latin.woff2") format("woff2"); font-weight: 500 700; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/static/fonts/ibm-plex-sans-latin.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/static/fonts/ibm-plex-mono-400-latin.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/static/fonts/ibm-plex-mono-500-latin.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  color-scheme: light dark;
  --bg: #F6F5F1; --surface: #FFFFFF; --ink: #17201C; --body: #2E3833; --muted: #4A5550; --line: #DEDBD2;
  --strong-line: #C9C5BA; --field-line: #7A7F78; --accent: #0B6B53; --accent-soft: #E4F1EB; --accent-ink: #0B4F3D;
  --high: #B4470F; --high-soft: #FBE7DC; --high-ink: #8A320A; --medium: #8A4B08; --medium-soft: #FEF3E2;
  --low: #0B4F3D; --low-soft: #E4F1EB; --nav: #F6F5F1; --nav-ink: #2E3833; --nav-current: #FFFFFF;
  --button: #17201C; --button-ink: #FFFFFF; --cta: #0B6B53; --cta-ink: #FFFFFF; --focus: #2563EB;
  --chart: #C9E7DC; --chart-now: #0B6B53; --track: #EEECE6; --shadow: 0 24px 60px -24px rgba(17, 24, 39, .25);
  --panel: #17201C; --panel-ink: #F6F5F1; --panel-muted: #C8D0CB; --panel-link: #7FD8B6;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1412; --surface: #171E1B; --ink: #ECEFED; --body: #D3D9D6; --muted: #A3AEA8; --line: #2B3531;
    --strong-line: #3A4742; --field-line: #7C8984; --accent: #6EE7B7; --accent-soft: #0E2A22; --accent-ink: #A7F3D0;
    --high: #F4A57A; --high-soft: #3A1D0E; --high-ink: #F9C3A4; --medium: #FCD34D; --medium-soft: #3A2A0E;
    --low: #A7F3D0; --low-soft: #0E2A22; --nav: #0B100E; --nav-ink: #C5CEC9; --nav-current: #171E1B;
    --button: #ECEFED; --button-ink: #0F1412; --cta: #34D399; --cta-ink: #052E22; --focus: #93C5FD;
    --chart: #1E4D3F; --chart-now: #34D399; --track: #26302C; --shadow: 0 24px 60px -24px rgba(0, 0, 0, .6);
    --panel: #0B100E; --panel-ink: #ECEFED; --panel-muted: #A3AEA8; --panel-link: #7FD8B6;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--body); background: var(--bg); }
a { color: var(--accent); }
h1, h2, h3, .display { font-family: "Bricolage Grotesque", "IBM Plex Sans", system-ui, sans-serif; letter-spacing: -0.01em; color: var(--ink); }
h1 { font-size: 34px; font-weight: 700; line-height: 1.15; margin: 0; }
h2 { font-size: 19px; font-weight: 700; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 8px; }
p { margin: 0 0 12px; }
code, .mono { font-family: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace; font-size: .9em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; z-index: 10; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* Buttons */
.button, button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600; min-height: 44px; padding: 10px 16px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; text-decoration: none; background: var(--button); color: var(--button-ink); }
.button.cta, button.cta { background: var(--cta); color: var(--cta-ink); }
.button.quiet, button.quiet { background: var(--surface); color: var(--ink); border-color: var(--strong-line); }
button.link { background: none; border: 0; color: var(--accent); padding: 0; min-height: 0; text-decoration: underline; font-weight: 500; }
button:disabled { opacity: 0.6; cursor: not-allowed; } /* e.g. "Scanning now": shown, not hidden */
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; } /* labels level with their boxes */
.pack-actions { display: flex; flex-wrap: wrap; gap: 10px; } /* Download and Save as PDF side by side */
.legend { margin: 4px 0 8px; padding-left: 20px; }
.legend li { margin: 2px 0; }
form.inline { display: inline; }

/* Public pages */
.top { max-width: 1200px; margin: 0 auto; padding: 18px 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: "Bricolage Grotesque", sans-serif; font-weight: 700; font-size: 21px; }
.brand .dot { fill: var(--ink); }
.brand .lead-dot { fill: var(--accent); }
.top nav ul { display: flex; flex-wrap: wrap; gap: 20px; list-style: none; margin: 0; padding: 0; }
.top nav a { color: var(--muted); text-decoration: none; font-weight: 500; }
.top .end { margin-left: auto; display: flex; gap: 12px; align-items: center; }
.page { max-width: 960px; margin: 0 auto; padding: 32px 24px 56px; }
.hero h1 { font-size: 52px; line-height: 1.05; margin-bottom: 16px; }
.lead { font-size: 19px; color: var(--muted); max-width: 46ch; }
.ticks { padding-left: 20px; line-height: 1.9; }

/* Signed-in shell */
.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side { flex: 1 1 220px; max-width: 260px; background: var(--nav); border-right: 1px solid var(--line); padding: 24px 16px; display: flex; flex-direction: column; gap: 4px; }
.side .brand { padding: 0 10px 20px; }
.side .grow { flex: 1; }
.side a.nav { color: var(--nav-ink); text-decoration: none; padding: 10px 12px; border-radius: 10px; }
.side a.nav { border: 1px solid transparent; border-radius: 8px; }
.side a.nav[aria-current="page"] { background: var(--nav-current); border-color: var(--line); color: var(--ink); font-weight: 600; }
.side .who { margin-top: auto; padding: 12px; color: var(--nav-ink); font-size: 14px; border-top: 1px solid var(--line); }
.side .who button { color: var(--accent); }
.content { flex: 999 1 560px; min-width: 0; padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 22px; }
.heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.heading p { margin: 4px 0 0; color: var(--muted); }

/* Cards and tiles */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid.wide { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 24px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.tile .label { color: var(--muted); font-weight: 500; margin: 0; }
.tile .value { font-family: "Bricolage Grotesque", sans-serif; font-weight: 700; font-size: 34px; margin: 6px 0 0; line-height: 1.1; }
.tile .note { color: var(--muted); font-size: 14px; margin: 4px 0 0; }
.tile.good { background: var(--accent-soft); border-color: transparent; }
.tile.good .label, .tile.good .note { color: var(--accent-ink); }
.tile.good .value { color: var(--accent); }
.empty { border: 1px dashed var(--strong-line); background: var(--surface); border-radius: 16px; padding: 22px; }

/* Severity and status */
.pill { display: inline-block; font-weight: 700; font-size: 12px; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pill.High { color: var(--high-ink); background: var(--high-soft); }
.pill.Medium { color: var(--medium); background: var(--medium-soft); }
.pill.Low, .pill.connected { color: var(--low); background: var(--low-soft); }
.pill.pending { color: var(--medium); background: var(--medium-soft); }
.pill.error { color: var(--high); background: var(--high-soft); }
.risk-high { color: var(--high); font-weight: 600; }

/* Lists and tables */
.items { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.items li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
/* A support conversation: the customer's messages and Strays' replies, oldest first */
.thread { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.thread li { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.thread li.from-strays { background: var(--accent-soft); border-color: var(--accent); }
.thread p { margin: 0 0 6px; }
.message-text { white-space: pre-wrap; overflow-wrap: anywhere; }
/* Label and value pairs, two columns on wide screens and stacked on phones */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.facts dt { font-weight: 600; color: var(--ink); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) { .facts { grid-template-columns: 1fr; } .facts dd { margin-bottom: 8px; } }
.scroll { overflow-x: auto; position: relative; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; padding: 10px 10px; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
td { padding: 12px 10px; border-top: 1px solid var(--line); vertical-align: top; }
/* A row whose cell is just a form: its text lines up with the controls, not above them (a cell
   with text above its form stays top-aligned, so the text lines up with that) */
tr:has(> td > form:only-child) > td { vertical-align: middle; }
td.num, th.num { text-align: right; }
caption { text-align: left; color: var(--muted); font-size: 14px; padding-bottom: 6px; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--strong-line); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; }
.chip[aria-current="true"] { background: var(--button); color: var(--button-ink); border-color: var(--button); }
select, input { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--field-line); border-radius: 10px; padding: 10px 12px; min-height: 44px; }

/* Forms */
.stack { display: grid; gap: 8px; max-width: 440px; }
/* Grid items don't shrink below their content by default: a file input's wide built-in size would
   push the form past the edge of a 320px screen */
.stack > * { min-width: 0; }
input[type="file"] { max-width: 100%; }
label { font-weight: 600; }
.hint { margin: 0; color: var(--muted); font-size: 15px; }
.error { color: var(--high); font-weight: 600; }
input[aria-invalid="true"] { border-color: var(--high); }
.banner { background: var(--medium-soft); color: var(--medium); padding: 10px 14px; border-radius: 10px; }
details.hint-box summary { cursor: pointer; font-weight: 600; }
.steps { padding-left: 20px; line-height: 1.8; }

/* Ready-to-run fixes */
details.fix { margin-top: 10px; }
details.fix summary { cursor: pointer; font-weight: 600; min-height: 24px; line-height: 24px; }
details.fix h4, .fix h4, details.more h4 { margin: 14px 0 4px; font-size: 15px; }
.fix-steps { padding-left: 20px; margin: 6px 0; }
.fix-steps li { margin: 10px 0; }
.cmd { display: flex; gap: 8px; align-items: flex-start; margin-top: 6px; }
.cmd pre { flex: 1; min-width: 0; margin: 0; padding: 10px 12px; overflow-x: auto; background: var(--bg); border: 1px solid var(--strong-line); border-radius: 8px; font-size: 13px; }
/* Commands wrap rather than run off the side, so they can be read before copying (Copy takes
   the text as it is, not as it wraps) */
.cmd pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.cmd.request pre { font-family: inherit; font-size: 14px; max-height: 20em; overflow-y: auto; }
.cmd button { flex: none; }
/* A message to send someone (the account page's "Ask someone else"): wraps, nothing to scroll */
.cmd pre.letter { white-space: pre-wrap; overflow-wrap: anywhere; font-family: inherit; font-size: 15px; }

/* Chart */
.chart { width: 100%; height: 160px; margin-top: 8px; }
.chart .bar { fill: var(--chart); }
.chart .bar.now { fill: var(--chart-now); }

/* Help */
.cards { list-style: none; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.cards a { display: block; padding: 16px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; text-decoration: none; font-weight: 600; }
.crumbs { font-size: 15px; margin-bottom: 8px; }
.bottom { max-width: 1200px; margin: 0 auto; padding: 20px 24px 32px; color: var(--muted); font-size: 14px; }

@media (max-width: 720px) {
  .side { max-width: none; flex-basis: 100%; border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px; }
  .side .brand { padding: 4px 8px; }
  .side .who { margin: 0; border: 0; padding: 4px 8px; }
  .side .grow { display: none; }
  .hello { font-size: 32px; }
  .content { padding: 20px 16px 40px; }
  .hero h1 { font-size: 36px; }
  .top { padding: 14px 16px; }
  .top .end { margin-left: 0; }
  /* 44px tap targets: the open/close line of a "details" box */
  details summary, details.fix summary { padding: 10px 0; min-height: 44px; line-height: 24px; box-sizing: border-box; }
}

/* Budget spent this month */
progress.budget { display: block; width: 100%; height: 12px; margin: 4px 0 16px; border: 0; border-radius: 6px; background: var(--track); overflow: hidden; appearance: none; }
progress.budget::-webkit-progress-bar { background: var(--track); border-radius: 6px; }
progress.budget::-webkit-progress-value { background: var(--accent); border-radius: 6px; }
progress.budget::-moz-progress-bar { background: var(--accent); border-radius: 6px; }

.spaced { margin-top: 20px; line-height: 2; }

/* Tagging: fix snippets (copy buttons are in app.js) and the tag policy form */
.snippet { margin: 6px 0 8px; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; white-space: pre; font-family: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; max-width: 520px; }
details summary { cursor: pointer; font-weight: 600; }
textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--field-line); border-radius: 10px; padding: 10px 12px; width: 100%; max-width: 560px; }
.side .side-label { color: var(--nav-ink); font-size: 13px; font-weight: 600; margin: 0 12px 8px; text-transform: uppercase; letter-spacing: 0.04em; }
a.ticket { display: inline-block; min-height: 24px; line-height: 24px; }

/* Templates shown word for word: scrollable, focusable regions */
pre.source { max-height: 28em; overflow: auto; margin: 8px 0 20px; padding: 12px 14px; background: var(--bg); border: 1px solid var(--strong-line); border-radius: 8px; font-size: 13px; line-height: 1.5; }
pre.source code { font-family: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace; }
.service { text-align: left; background: var(--surface); }
.hash { overflow-wrap: anywhere; }
.help-page code, .help-page .mono { overflow-wrap: anywhere; }

/* Home: "This week" */
.topline { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; }
.topline p { margin: 0; }
.hello { font-size: 40px; line-height: 1.1; overflow-wrap: anywhere; }
.headline { font-size: 19px; margin: 8px 0 0; }
.home { display: flex; flex-wrap: wrap; gap: 32px; }
.main-col { flex: 3 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.side-col { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 16px; align-self: flex-start; }
.eyebrow { font-family: "IBM Plex Sans", sans-serif; font-size: 15px; font-weight: 600; color: var(--muted); letter-spacing: 0; margin: 0 0 12px; }
.ask { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin-bottom: 12px; }
.ask-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.ask-head code { font-size: 14px; color: var(--ink); overflow-wrap: anywhere; }
.ask .sentence { font-size: 17px; margin: 8px 0 0; color: var(--ink); }
.ask .why { font-size: 14px; color: var(--muted); margin: 4px 0 0; }
.ask-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.ask-actions .button { order: -1; }
.pill.cost { color: var(--accent-ink); background: var(--accent-soft); }
.pill { font-size: 13px; padding: 2px 8px; border-radius: 6px; }
.calm { padding: 14px 20px; border: 1px dashed var(--strong-line); border-radius: 14px; margin: 0; }
.people { list-style: none; margin: 0 0 12px; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.people li { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-top: 1px solid var(--line); }
.people li:first-child { border-top: 0; }
.people p { margin: 0; }
.who-line { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.avatar { flex: 0 0 36px; height: 36px; border-radius: 18px; background: var(--accent-soft); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }
.side-col .card { padding: 20px; }
.side-col .big { font-family: "Bricolage Grotesque", sans-serif; font-size: 32px; line-height: 1.1; margin: 0; color: var(--ink); }
.side-col .mid { font-size: 17px; margin: 0 0 6px; color: var(--ink); }
.side-col p.small { margin: 6px 0 0; }
.side-col progress.budget { margin-top: 12px; }
.card.dark { background: var(--panel); border-color: var(--panel); color: var(--panel-ink); }
.card.dark .eyebrow, .card.dark .small { color: var(--panel-muted); }
.card.dark .mid { color: var(--panel-ink); }
.card.dark a { color: var(--panel-link); display: inline-block; margin-top: 12px; }
@media (max-width: 720px) { .hello { font-size: 30px; } }

/* Website visitors: charts are inline SVG that scale to the width of the page */
svg.chart { display: block; width: 100%; height: auto; max-height: 200px; margin: 8px 0 12px; }
svg.chart.funnel { max-height: 120px; }
svg.chart rect { fill: var(--chart-now); }
details.fix > summary { min-height: 44px; line-height: 44px; }
.heading > a { display: inline-flex; align-items: center; min-height: 44px; }
/* Admin console: trend charts (inline SVG, no script), alert switches, small screens */
.trends { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.trend { margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.trend figcaption { margin-bottom: 6px; }
.trend p { margin: 6px 0 0; }
svg.spark { display: block; width: 100%; height: 56px; }
svg.spark polyline { stroke: var(--accent); }
.alert-switches fieldset { border: 0; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.alert-switches legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.switch { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; }
.switch input { flex: none; width: 24px; height: 24px; min-height: 0; margin: 2px 0 0; padding: 0; }
.switch label { flex: 1; min-width: 0; }
@media (max-width: 720px) {
  /* Tables scroll inside their card; a shadow at the edge shows there is more */
  .scroll { background: linear-gradient(to right, var(--surface), var(--surface)) left center / 24px 100% no-repeat local, linear-gradient(to left, var(--surface), var(--surface)) right center / 24px 100% no-repeat local, linear-gradient(to right, var(--strong-line), transparent) left center / 12px 100% no-repeat scroll, linear-gradient(to left, var(--strong-line), transparent) right center / 12px 100% no-repeat scroll; }
  .scroll td a, .scroll th a, .tile .label a { display: inline-flex; align-items: center; min-height: 44px; }
  .side a.nav { min-height: 44px; display: inline-flex; align-items: center; box-sizing: border-box; }
  .heading > a { display: inline-flex; align-items: center; min-height: 44px; }
}

/* Billing: the Monthly/Yearly choice, aligned and with a visible group border */
fieldset.interval { border: 1px solid var(--strong-line); border-radius: 10px; padding: 6px 14px 10px; margin: 12px 0; display: flex; flex-wrap: wrap; gap: 4px 24px; min-width: 0; }
fieldset.interval legend { padding: 0 6px; font-weight: 600; color: var(--ink); }
fieldset.interval label { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; }
fieldset.interval input[type="radio"] { min-height: 0; width: 20px; height: 20px; margin: 0; padding: 0; accent-color: var(--accent); }
/* Billing: the running total for extra accounts (shown by app.js), on its own line */
.total { margin: 8px 0; font-weight: 600; }
.actions .total { flex: 1 1 100%; }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 8px; }
.warn { background: var(--medium-soft); color: var(--medium); padding: 10px 14px; border-radius: 10px; }
.gate { color: var(--muted); margin: 8px 0; }
/* Phones and small tablets (reflow at 320px, WCAG 1.4.10): hidden attribute wins over display rules */
[hidden] { display: none !important; }
select, input, textarea { font-size: 16px; }
.skip, .standalone, .heading > a, .topline > a, .side .who button.link { display: inline-flex; align-items: center; min-height: 44px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; }
.side .who button.link { padding: 0; }
.bottom { text-align: left; }
.shell + .bottom { border-top: 1px solid var(--line); margin-top: 0; max-width: none; padding-left: 32px; padding-right: 32px; }
.card, .tile, fieldset { min-width: 0; }
fieldset { border: 0; margin: 0 0 12px; padding: 0; }
legend { font-weight: 600; padding: 0; }
fieldset label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-right: 16px; }
.grid.wide { grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); }
.grid { grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); }
.invite-link { overflow-wrap: anywhere; }
.menu { display: flex; flex-direction: column; flex: 1; }
.menu > summary { display: none; }
.menu .links { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.shell > .side { flex-direction: column; }
@media (max-width: 900px) {
  .side { max-width: none; flex-basis: 100%; border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row !important; flex-wrap: wrap; align-items: center; padding: 10px 12px; }
  .side .brand { padding: 4px 8px; }
  .menu { flex: 1 1 auto; align-items: flex-end; }
  .menu > summary { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border: 1px solid var(--strong-line); border-radius: 10px; background: var(--surface); color: var(--ink); font-weight: 600; list-style: none; cursor: pointer; }
  .menu > summary::-webkit-details-marker { display: none; }
  .menu > summary::after { content: ""; width: 8px; height: 8px; margin-left: 10px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); }
  .menu[open] > summary::after { transform: rotate(-135deg); }
  .menu .links { align-self: stretch; flex: none; padding-top: 8px; }
  .side .who { margin: 8px 0 0; padding: 8px 12px; }
  .side .grow { display: none; }
  .side a.nav { min-height: 44px; display: inline-flex; align-items: center; }
  .content { padding: 20px 16px 40px; }
  .shell + .bottom { padding-left: 16px; padding-right: 16px; }
  .scroll td a, .scroll th a, .tile .label a { display: inline-flex; align-items: center; min-height: 44px; }
}
@media (max-width: 720px) {
  .page { padding-left: 16px; padding-right: 16px; }
  .bottom { padding-left: 16px; padding-right: 16px; }
  /* Tables that hold forms become one block per row */
  table.team, table.team tbody, table.team tr, table.team td { display: block; width: 100%; }
  table.team thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.team tr { padding: 10px 0; border-top: 1px solid var(--line); }
  table.team td { border: 0; padding: 4px 0; overflow-wrap: anywhere; }
  table.team td::before { content: attr(data-label); display: block; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
  table.team td form { margin: 4px 0; }
  .invite-form { flex-direction: column; align-items: stretch; }
  .invite-form input, .invite-form select, .invite-form button { width: 100%; }
  .stack { max-width: none; }
  .cards { grid-template-columns: 1fr; }
  .actions > * { max-width: 100%; }
  .cmd { flex-wrap: wrap; }
  .cmd pre { flex-basis: 100%; }
}
.scroll:focus-visible { outline: 3px solid var(--focus); }
.top nav a, .top .end a:not(.button) { display: inline-flex; align-items: center; min-height: 44px; }
@media (max-width: 900px) { .shell { align-content: flex-start; } }
.items li { flex-wrap: wrap; }
.items li > * { min-width: 0; max-width: 100%; }
button { max-width: 100%; text-align: center; }
@media (max-width: 900px) {
  details summary, details.fix summary, details.fix > summary { padding: 10px 0; min-height: 44px; line-height: 24px; box-sizing: border-box; }
}
select { max-width: 100%; }

/* Admin console only: menu, Needs-you strip, tiles, the Change forms, the help page */
.admin-nav { position: relative; display: flex; flex-direction: column; gap: 4px; }
.admin-nav .count { display: inline-block; min-width: 22px; padding: 0 7px; margin-left: 4px; border-radius: 11px; background: var(--high-soft); color: var(--high-ink); font-size: 13px; font-weight: 700; line-height: 22px; text-align: center; }
.tile.warn { background: var(--high-soft); border-color: var(--high); }
.tile.warn .label, .tile.warn .note { color: var(--high-ink); }
.tile.warn .value { color: var(--high); }
.needs { border-color: var(--high); }
.needs.clear { border-color: var(--line); }
.needs-list { display: flex; flex-wrap: wrap; gap: 8px 20px; list-style: none; margin: 0 0 8px; padding: 0; }
.needs-list a { display: inline-flex; align-items: center; min-height: 44px; }
.subcard { border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-top: 16px; }
.subcard h3 { margin-bottom: 12px; }
.change-form { display: flex; flex-direction: column; align-items: stretch; gap: 8px; max-width: 560px; margin-bottom: 16px; }
.change-form button, .change-form .button { justify-content: flex-start; text-align: left; height: auto; }
.preview { margin: 0; padding: 10px 14px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); }
.admin-help code, .admin-help p, .admin-help li { overflow-wrap: anywhere; }
.admin-help { min-width: 0; }
#connections li, #summary .note, #change p, .change-form button, .change-form .button, .preview, .needs-list li { overflow-wrap: anywhere; }
@media (max-width: 720px) {
  .grid.tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grid.tiles .tile { padding: 12px; }
  .grid.tiles .tile .value { font-size: 26px; }
  .grid.tiles .tile .note { overflow-wrap: anywhere; }
  .grid.tiles .tile .note a, .admin-help p.small a { display: inline-flex; align-items: center; min-height: 44px; }
  form[role=search] select, form[role=search] input { max-width: 100%; min-width: 0; }
}

/* A one-shot message after an action (Keep, Snooze...): stays in view while the page is scrolled */
.flash { position: sticky; top: 8px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; background: var(--accent-soft); color: var(--accent-ink); border: 1px solid var(--accent); border-radius: 10px; padding: 8px 14px; font-weight: 600; }
.flash form { margin: 0; }
.flash:focus { outline: 3px solid var(--focus); outline-offset: 2px; }
/* Where app.js puts focus after a form (an error, a status message, the row that changed) */
[data-settled]:focus { outline: 3px solid var(--focus); outline-offset: 2px; }
.note { margin: 0 0 12px; }

/* Findings: one card each (title, how bad, the decision), the long text folded away */
.findings { display: flex; flex-direction: column; gap: 12px; }
.finding { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; scroll-margin-top: 72px; }
.finding:target { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.finding h3 { margin: 0; font-size: 17px; overflow-wrap: anywhere; }
.finding h3 .mono { font-weight: 500; }
.finding-where { margin: 2px 0 0; overflow-wrap: anywhere; }
.finding-rank { margin: 0; text-align: right; }
.finding-body { grid-column: 1 / -1; }
.finding-body p { margin-bottom: 8px; }
.finding .decision { color: var(--ink); }
.finding-decide, .finding-ticket { grid-column: 1 / -1; margin: 0; }
.finding-decide .decide-what, .ask-what { flex-basis: 100%; margin: 0; }
details.more > summary { cursor: pointer; font-weight: 600; min-height: 44px; line-height: 44px; }
/* Everything found's filters: open on wide screens, folded behind "Filter" on phones (app.js) */
details.filter-box { margin: 12px 0; }
details.filter-box > summary { cursor: pointer; font-weight: 600; min-height: 44px; line-height: 44px; }
@media (min-width: 721px) { details.filter-box[open] > summary { display: none; } }
@media (max-width: 720px) {
  .finding { grid-template-columns: minmax(0, 1fr); padding: 14px; }
  .finding-rank { text-align: left; }
  .finding-decide button { flex: 1 1 140px; }
}

/* Phones: tables too wide for the screen become one block per row, each cell labelled with its
   column heading (app.js adds .stacked and data-label; without it they scroll in their card) */
tbody th { text-transform: none; letter-spacing: 0; font-size: 15px; color: var(--ink); font-weight: 600; padding: 12px 10px; border-top: 1px solid var(--line); vertical-align: top; }
@media (max-width: 900px) {
  table.stacked, table.stacked tbody, table.stacked tr, table.stacked td, table.stacked tbody th { display: block; width: 100%; }
  table.stacked thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.stacked tr { padding: 10px 0; border-top: 1px solid var(--line); }
  table.stacked tbody tr:first-child { border-top: 0; }
  table.stacked td, table.stacked tbody th { border: 0; padding: 2px 0; text-align: left; overflow-wrap: anywhere; }
  table.stacked td[data-label]:not(:first-child)::before { content: attr(data-label); display: inline-block; margin-right: 8px; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
  table.stacked td:first-child { font-weight: 600; color: var(--ink); }
  /* After the first cell, short values share a line: "Open items 1   Waste a month $0" */
  table.stacked td:not(:first-child) { display: inline-block; width: auto; max-width: 100%; margin-right: 18px; vertical-align: middle; }
  /* A cell with a form or a fold-out gets its own full-width line (as specific as the rule above,
     or a short neighbour pulls it up beside it: "Suggested Owner alex   Fix") */
  table.stacked td:not(:first-child):has(form, input, select, details, pre) { display: block; width: 100%; margin-right: 0; }
  table.stacked caption { display: block; text-align: left; }
  table.stacked td.blank { display: none; }
  table.stacked td form { margin: 4px 0; }
  table.stacked input:not([type=hidden]) { width: 100%; }
  .scroll:has(table.stacked) { background: none; }
}
@media (max-width: 720px) {
  /* Filter forms: each label above its field */
  form.filters, form[role=search] { display: grid; grid-template-columns: minmax(0, 1fr); align-items: stretch; gap: 8px; }
  form.filters > button, form[role=search] > button { justify-self: start; }
  form.filters input, form.filters select, form[role=search] input, form[role=search] select { width: 100%; }
  /* Home cards: the fix on one line, Keep and Snooze side by side under it */
  .ask-actions .button { flex: 1 1 100%; }
  .ask-actions form.actions { flex: 1 1 100%; flex-wrap: nowrap; }
  .ask-actions form.actions button { flex: 1 1 0; padding-left: 8px; padding-right: 8px; }
}
/* A count and its words in one link: inline-flex would drop the space between them */
.needs-list a { gap: .3em; }
.card form.actions input[type=url] { flex: 1 1 100%; min-width: 0; }
.card form.stack + h3 { margin-top: 24px; }
/* Summary tiles that are links (the evidence pack's counts filter its answers) */
a.link-tile { display: block; color: inherit; text-decoration: none; }
a.link-tile:hover { border-color: var(--accent); }
a.link-tile[aria-current="true"] { border: 2px solid var(--accent); }
a.link-tile .note { text-decoration: underline; color: var(--accent); }
a.link-tile.good .note { color: var(--accent-ink); }
.grid.counts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 720px) { .grid.counts { gap: 8px; } .grid.counts .tile { padding: 12px; } .grid.counts .tile .value { font-size: 26px; } }
/* Settings: the contents list at the top */
.contents ul { margin: 0; padding-left: 20px; columns: 2 16em; column-gap: 32px; }
.contents li { break-inside: avoid; }
.contents a { display: inline-flex; align-items: center; min-height: 44px; }
/* Narrow screens: the open menu is a full-width sheet under the header, so the logo and the Menu
   button stay on one row (app.js adds .sheet; without it the list opens in the header) */
@media (max-width: 900px) {
  .shell > .side { position: relative; }
  .side .brand { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
  .menu { align-self: flex-start; }
  .menu.sheet[open] .links { position: absolute; top: 100%; left: 0; right: 0; z-index: 20; padding: 8px 16px 16px; background: var(--nav); border-bottom: 1px solid var(--line); box-shadow: 0 12px 24px rgba(0, 0, 0, .14); }
}

/* Settings: the co-branding logo, as reports show it */
.brand-preview { display: block; max-width: 240px; max-height: 64px; object-fit: contain; background: #fff; padding: 8px; border-radius: 6px; }

/* AWS accounts: Scan all now at the top, Scan now (or "Scanning…") under each account's last scan */
.row-action { margin-top: 6px; }
.scan-all { margin: 8px 0 20px; }

/* Claude's suggestions (Business): always marked as AI, kept visually apart from Strays' checks */
.ai-priorities { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 14px; padding: 18px 22px; margin: 0 0 24px; }
.ai-priorities h2 { margin-top: 0; }
.ai-priorities ol { padding-left: 22px; }
.ai-priorities li { margin: 0 0 10px; }
.ai-note { border-left: 3px solid var(--accent); padding: 2px 0 2px 12px; margin: 8px 0; }
.ai-note p { margin: 4px 0; }
.ai-label { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent-soft); padding: 1px 7px; border-radius: 999px; margin-right: 4px; }
.ai-guess { font-family: inherit; }
.ai-priorities details { border-top: 1px solid var(--line); padding: 8px 0; }
.ai-priorities details summary { cursor: pointer; }
.ai-priorities .cmd pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.talk { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; }
.talk > div { flex: 1 1 28em; }
.talk h2 { margin-top: 0; }
