/* Brand: gray + olive green. Fonts follow the Product Foundry guide (product-context/brand/brand.md);
   colours are the earlier olive palette, kept by choice rather than the guide's Foundry Olive palette. */

/* Fonts are self-hosted (the website's /fonts/), so the strict CSP holds and every German glyph (ä ö ü ß „ “ –)
   renders in Inter and Manrope. */
@font-face { font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900; src: url(/fonts/inter-latin-wght-normal.woff2) format("woff2-variations"); 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; }
@font-face { font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900; src: url(/fonts/inter-latin-ext-wght-normal.woff2) format("woff2-variations"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Manrope"; font-style: normal; font-display: swap; font-weight: 200 800; src: url(/fonts/manrope-latin-wght-normal.woff2) format("woff2-variations"); 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; }
@font-face { font-family: "Manrope"; font-style: normal; font-display: swap; font-weight: 200 800; src: url(/fonts/manrope-latin-ext-wght-normal.woff2) format("woff2-variations"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
:root {
  --brand-50: #f7f8ef;
  --brand-100: #eef1dc;
  --brand-200: #dce3b9;
  --brand-300: #c3ce8b;
  --brand-400: #a3b25f;
  --brand-500: #82923f;
  --brand-600: #6b7a2f;
  --brand-700: #566227;
  --brand-800: #454f21;

  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  --bg: var(--gray-50);
  --surface: #fff;
  --border: var(--gray-200);
  --text: var(--gray-900);
  --muted: var(--gray-500);
  --primary: var(--brand-600);
  --primary-hover: var(--brand-700);
  --primary-soft: var(--brand-100);
  --danger: #b42318;
  --warn: #b45309;

  --font-body: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: "Manrope", var(--font-body);

  --radius: 10px;
  --shadow: 0 1px 2px rgba(17, 24, 39, 0.05), 0 1px 3px rgba(17, 24, 39, 0.07);
  --ring: 0 0 0 3px rgba(107, 122, 47, 0.28);

  color-scheme: light;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
/* German runs about 30% longer, with long compounds: hyphenate (by the page's lang) rather than overflow. */
:lang(de) { hyphens: auto; overflow-wrap: break-word; hyphenate-limit-chars: 10 4 4; }
:lang(de) :is(h1, h2, h3) { hyphens: manual; }
/* What people wrote (names, titles, notes, file contents) keeps its own words: no German hyphenation rules on it. */
.table td, .prewrap, .notes, .doc-text, .file-name, .list-title,
.insight-card h3, .kcard h3, .guide li { hyphens: manual; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 10; background: #fff; color: var(--gray-900); padding: 8px 14px; border-radius: 8px; font-weight: 600; }
.skip-link:focus { top: 12px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-family: var(--font-heading); }
h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1rem; font-weight: 650; }
h3 { font-size: 0.95rem; font-weight: 600; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; }
:focus-visible { outline: none; box-shadow: var(--ring); }

.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.prewrap { white-space: pre-wrap; }
.warn { color: var(--warn); }
.hint { margin-bottom: 12px; }

/* Layout */
.layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.icon { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* The sidebar (`app-navigation`): the team picker, the menu, then feedback and the account at the foot. */
.sidebar {
  background: var(--gray-900);
  color: var(--gray-300);
  padding: 18px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
/* The app's focus ring is too faint on the dark sidebar: a light ring with a dark gap instead. */
.sidebar :focus-visible { box-shadow: 0 0 0 2px var(--gray-900), 0 0 0 4px var(--brand-300); }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; padding: 0 8px; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--brand-600); color: #fff; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--font-heading); font-weight: 800; font-size: 1.1rem; letter-spacing: -0.01em; }
.brand-endorsement { font-size: 0.72rem; color: var(--gray-400); }
.drawer-close { display: none; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; color: var(--gray-300); cursor: pointer; }
.drawer-close:hover { background: var(--gray-800); color: #fff; }

/* Menu items: an icon before each word; the current page has a tint, a bar at its edge and bold text, never colour alone. */
.nav { display: flex; flex-direction: column; gap: 2px; }
/* The menu's sections (`menu-sections`): Plan, Learn and Decide, each a label over its pages, in one level. The label is
   text, in the sidebar's quiet grey (AA on --gray-900). */
.nav-section { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; }
.nav-section-label { margin: 0 0 2px; padding: 0 12px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gray-400); }
/* A page that's coming soon (Competitors): a row like a menu item, but text in quiet grey with a "Soon" badge, never a link. */
.nav-soon { display: flex; align-items: center; gap: 12px; min-height: 40px; margin: 0; padding: 8px 12px; color: var(--gray-400); font-weight: 500; cursor: default; }
.nav-soon-badge { margin-left: auto; background: var(--gray-800); color: var(--gray-300); }
.nav a, .nav-item {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 40px; padding: 8px 12px;
  border: 0; border-radius: 8px; background: none; color: var(--gray-300); font: inherit; font-weight: 500;
  text-align: left; text-decoration: none; cursor: pointer;
}
.nav a:hover, .nav-item:hover { background: var(--gray-800); color: #fff; }
.nav a.active, .nav-item.active { background: rgba(163, 178, 95, 0.18); color: var(--brand-200); font-weight: 650; }
.nav a.active::before, .nav-item.active::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--brand-400); }
.sidebar-foot { margin-top: auto; display: grid; gap: 4px; padding-top: 12px; border-top: 1px solid var(--gray-800); }

/* The team picker and the account: a button that shows its value, opening a short list (lib/disclosure.js). */
.disclosure { position: relative; }
.picker-toggle, .account-toggle {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 7px 8px; border-radius: 8px;
  border: 1px solid var(--gray-700); background: var(--gray-800); color: #fff; font: inherit; text-align: left; cursor: pointer;
}
.picker-toggle:hover { border-color: var(--gray-500); }
.picker-toggle[hidden] { display: none; }
.account-toggle { border-color: transparent; background: none; }
.account-toggle:hover { background: var(--gray-800); }
.team-mark { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 7px; background: var(--brand-600); color: #fff; font-weight: 700; font-size: 0.85rem; }
.team-mark .icon { width: 17px; height: 17px; }
.team-mark:not(.is-all) .team-all-icon, .team-mark.is-all .team-initial { display: none; }
.picker-text, .account-text { display: grid; flex: 1; min-width: 0; line-height: 1.3; }
.picker-label { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gray-400); }
.picker-value { font-weight: 600; font-size: 0.92rem; overflow-wrap: anywhere; }
.account-name { font-weight: 600; font-size: 0.9rem; overflow-wrap: anywhere; }
.account-name[hidden] { display: none; }
.account-email { font-size: 0.78rem; color: var(--gray-400); overflow-wrap: anywhere; }
.chevron { width: 16px; height: 16px; color: var(--gray-400); }
.avatar { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--brand-200); color: var(--gray-900); font-weight: 700; font-size: 0.8rem; }
.add-first-team {
  display: flex; align-items: center; gap: 6px; width: 100%; min-height: 44px; padding: 8px 12px; border-radius: 8px; border: 1px dashed var(--brand-400); background: none;
  color: var(--brand-200); font: inherit; font-weight: 600; text-align: left; cursor: pointer;
}
.add-first-team:hover { background: var(--gray-800); color: #fff; }
.add-first-team[hidden] { display: none; }

.popup {
  position: absolute; left: 0; right: 0; z-index: 20; display: grid; gap: 2px; padding: 6px;
  border: 1px solid var(--gray-200); border-radius: 10px; background: #fff; color: var(--gray-800); box-shadow: 0 10px 30px rgba(17, 24, 39, 0.2);
}
.popup[hidden] { display: none; }
.popup-below { top: calc(100% + 6px); }
.popup-above { bottom: calc(100% + 6px); }
.sidebar .popup :focus-visible { box-shadow: var(--ring); }
.popup-title { padding: 6px 10px 2px; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.popup-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.popup-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 8px 10px; border: 0; border-radius: 6px;
  background: none; color: var(--gray-800); font: inherit; font-size: 0.9rem; text-align: left; text-decoration: none; cursor: pointer;
}
.popup-item .icon { width: 18px; height: 18px; color: var(--gray-500); }
.popup-item[hidden] { display: none; }
.popup-item:hover { background: var(--gray-100); }
.popup-item[aria-current] { font-weight: 650; color: var(--brand-800); }
.popup-item .tick { visibility: hidden; color: var(--brand-700); }
.popup-item[aria-current] .tick { visibility: visible; }
.popup-item.danger, .popup-item.danger .icon { color: var(--danger); }
.popup-item.danger:hover { background: #fef3f2; }
.popup-sep { width: 100%; margin: 4px 0; border: 0; border-top: 1px solid var(--gray-100); }
.popup-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.popup-head > span:last-child { display: grid; min-width: 0; line-height: 1.35; }
.popup-email { font-size: 0.82rem; color: var(--muted); overflow-wrap: anywhere; }

/* Phones: the top bar, and the sidebar as a drawer over a dimmed page (app/drawer.js). Hidden above 860 px. */
.topbar { display: none; }
.menu-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border: 1px solid var(--gray-300); border-radius: 8px;
  background: var(--surface); color: var(--gray-800); font: inherit; font-weight: 600; cursor: pointer;
}
.menu-btn:hover { background: var(--gray-100); }
.topbar-title { display: grid; flex: 1; min-width: 0; line-height: 1.25; }
.topbar-title strong { font-family: var(--font-heading); font-size: 1.02rem; overflow-wrap: anywhere; }
.topbar-title span { font-size: 0.8rem; color: var(--muted); overflow-wrap: anywhere; }
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(17, 24, 39, 0.5); }
.scrim[hidden] { display: none; }

/* A button that reads as a link (the roadmap cards' titles). */
.link-btn { background: none; border: 0; color: var(--brand-300); padding: 4px 0; text-align: left; cursor: pointer; font-size: 0.85rem; }
.link-btn:hover { color: var(--brand-200); }

.form-intro { grid-column: 1 / -1; margin: 0 0 14px; }
.form-intro-danger { padding: 10px 12px; border-radius: 8px; background: #fef3f2; color: #912018; }
.confirm-text { grid-column: 1 / -1; margin: 0; }

/* Language switch (languageSwitch() in /ui/ui.js): the active language is bold and underlined, not just coloured. */
.lang-switch { display: flex; gap: 2px; margin-top: 6px; }
.lang-option { color: var(--gray-400); text-decoration: none; font-size: 0.85rem; font-weight: 500; padding: 6px 8px; border-radius: 6px; }
.lang-option:hover { color: #fff; background: var(--gray-800); }
.lang-option-on { color: var(--brand-200); font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }

.main { padding: 32px 40px 56px; max-width: 1280px; width: 100%; min-width: 0; outline: none; }

/* Page header */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-subtitle { margin-top: 6px; color: var(--muted); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px; color: var(--primary); text-decoration: none; font-weight: 500; }
.back-link:hover { text-decoration: underline; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 8px; padding: 8px 14px;
  font-weight: 600; font-size: 0.9rem; border: 1px solid transparent; cursor: pointer; text-align: center; text-decoration: none;
  transition: background 0.12s, border-color 0.12s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--surface); color: var(--gray-700); border-color: var(--gray-300); }
.btn-secondary:hover { background: var(--gray-100); }
.btn-danger { background: transparent; color: var(--danger); border-color: transparent; }
.btn-danger:hover { background: #fef3f2; }
.icon-btn { background: none; border: 0; font-size: 1.5rem; line-height: 1; color: var(--muted); cursor: pointer; border-radius: 6px; padding: 2px 8px; }
.icon-btn:hover { background: var(--gray-100); color: var(--text); }
.link { color: var(--primary); text-decoration: none; font-size: 0.85rem; font-weight: 600; }
.link:hover { text-decoration: underline; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card > h2 { margin-bottom: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section { margin-bottom: 24px; }
.count {
  display: inline-block; min-width: 22px; padding: 0 7px; border-radius: 999px; text-align: center;
  font-size: 0.75rem; font-weight: 600; background: var(--gray-100); color: var(--gray-600); vertical-align: middle;
}
.empty { color: var(--muted); padding: 10px 0; }
.error { color: var(--danger); }
.error-state { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }

/* Badges & chips */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.badge-solid { background: var(--brand-600); color: #fff; }
.badge-brand { background: var(--brand-100); color: var(--brand-800); }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }
.badge-outline { background: var(--surface); color: var(--gray-700); box-shadow: inset 0 0 0 1px var(--gray-300); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
/* Filter chips, as the admin site's chipGroup() (shared/ui/ui.css). */
.chip {
  min-height: 44px; padding: 6px 16px; border-radius: 999px; border: 1px solid var(--gray-300);
  background: var(--surface); color: var(--gray-700); font: inherit; font-size: 0.8125rem; font-weight: 500; cursor: pointer;
}
.chip:hover { border-color: var(--brand-600); }
.chip-on, .chip-on:hover { background: var(--gray-900); border-color: var(--gray-900); color: #fff; font-weight: 600; }

/* Dashboard */

.list { list-style: none; margin: 0; padding: 0; }
.list-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 8px; margin: 0 -8px; border-radius: 8px; text-decoration: none;
}
a.list-item:hover { background: var(--brand-50); }
.list li + li { border-top: 1px solid var(--gray-100); }
.list-title { font-weight: 600; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 -20px; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th {
  text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted); font-weight: 600; padding: 8px 20px; border-bottom: 1px solid var(--border);
}
.table td { padding: 12px 20px; border-bottom: 1px solid var(--gray-100); vertical-align: top; }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover { background: var(--brand-50); }
.table tbody tr:last-child td { border-bottom: 0; }

/* Interview detail */
.meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 0 0 16px; }
.meta dt { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 4px; }
.meta dd { margin: 0; font-weight: 500; }
.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.guide { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.notes { min-height: 200px; }
/* Your takeaways, on a completed interview (`takeaways-first`). */
.takeaways-lead { margin: -4px 0 12px; color: var(--gray-700); }
.takeaways-form { display: grid; gap: 12px; }
.takeaways-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.takeaways-actions .btn[hidden] { display: none; }
.takeaways-list { margin: 0; padding-left: 22px; display: grid; gap: 10px; }
.takeaways-list li { padding-left: 4px; }
.takeaways-list li::marker { font-weight: 700; color: var(--brand-700); }
.takeaway-text { margin: 0 0 6px; font-weight: 550; overflow-wrap: anywhere; }
.takeaway-insight { text-decoration: none; }
.takeaway-insight:hover { text-decoration: underline; }
.takeaways-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.takeaways-foot p { margin: 0; }
/* The goal on an interview (`interview-goal`): the goal banner (as in Ask the agent), or a dashed card when there is none,
   and the goal's beliefs under What you want to learn. */
.interview-goal-banner { margin-bottom: 16px; }
.goal-banner-label .badge { margin-left: 8px; text-transform: none; letter-spacing: 0; }
.interview-no-goal { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin-bottom: 16px; border-style: dashed; }
.interview-no-goal-text { flex: 1 1 280px; min-width: 0; }
.interview-no-goal h2 { margin-bottom: 4px; }
.interview-no-goal p { margin: 0; }
.interview-beliefs-title { margin: 16px 0 6px; font-size: 0.95rem; }
.interview-beliefs-title .icon { width: 18px; height: 18px; margin-top: 1px; color: var(--brand-700); }
.interview-beliefs { margin: 0; padding-left: 22px; display: grid; gap: 6px; overflow-wrap: anywhere; }
.interview-beliefs li::marker { color: var(--brand-700); }
.interview-learned { margin: 10px 0 0; overflow-wrap: anywhere; }
.interview-beliefs-hint { margin: 12px 0 0; padding: 8px 12px; border-radius: 8px; background: var(--brand-50); color: var(--gray-800); font-size: 0.88rem; }
@media (max-width: 860px) {
  .interview-no-goal .btn, .interview-aim .btn { width: 100%; min-height: 44px; }
  .takeaways-actions { width: 100%; }
  .takeaways-actions .btn, .takeaways-list .btn { flex: 1 1 auto; min-height: 44px; }
  .takeaway-insight { min-height: 44px; }
}

/* Insights */
.group-title { margin-bottom: 12px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.insight-card {
  text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 10px; font: inherit; color: inherit;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.insight-card:hover, .kcard:hover { border-color: var(--brand-300); box-shadow: 0 4px 14px rgba(86, 98, 39, 0.12); }
.insight-top, .kcard-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.insight-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--gray-100); color: var(--gray-600); }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 0.88rem; }

/* Roadmap timeline (`roadmap-timeline`, `goals-and-roadmap`, `roadmap-trash`): this month, next month, Later and Trash. The columns
   scroll inside their region on narrow screens, never the page. */
.timeline { contain: inline-size; display: grid; grid-template-columns: repeat(4, minmax(180px, 1fr)); gap: 14px; align-items: start; overflow-x: auto; padding-bottom: 6px; }
.timeline:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius); }
.tl-column {
  background: var(--gray-100); border: 1px solid var(--gray-200); border-radius: var(--radius);
  padding: 12px; display: flex; flex-direction: column; gap: 8px; min-height: 360px; min-width: 0;
}
.tl-now { background: var(--brand-50); border-color: var(--brand-300); }
/* A long month ("November", "September") with Now and the count doesn't fit a 180 px column: Now and the count wrap
   together under the month rather than squeezing it. */
.column-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-weight: 650; padding: 2px 4px; }
.column-title { font-size: 0.95rem; font-weight: 650; flex: 1 0 auto; }
.column-meta { display: flex; align-items: center; gap: 8px; }
.column-body { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.column-empty { font-size: 0.82rem; color: var(--gray-500); text-align: center; padding: 24px 0; border: 1px dashed var(--gray-300); border-radius: 8px; }
.kcard { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); }
.kcard-title { color: var(--text); font-size: 0.95rem; font-weight: 650; padding: 0; text-align: left; }
.kcard-title:hover { color: var(--brand-700); text-decoration: underline; }
.kcard-top { align-items: flex-start; }
.kcard-top h3 { flex: 1; min-width: 0; overflow-wrap: anywhere; }
/* Dragging (`goals-and-roadmap`): a mouse picks a card up anywhere but its title; touch and pen only by the grip, so the
   rest of the card still scrolls the page. The lifted card sits in the month under the pointer, which is outlined. */
.kcard { cursor: grab; }
.kcard-grip { display: grid; place-items: center; flex: none; width: 32px; height: 32px; margin: -6px -6px 0 0; border-radius: 6px; color: var(--gray-500); touch-action: none; }
.kcard-grip:hover { background: var(--gray-100); color: var(--gray-800); }
.kcard-grip .icon { width: 18px; height: 18px; }
.is-dragging, .is-dragging * { cursor: grabbing !important; user-select: none; }
.kcard-lifted { border: 2px dashed var(--brand-600); background: var(--brand-50); box-shadow: 0 10px 24px rgba(86, 98, 39, 0.25); }
.tl-target { border-color: var(--brand-600); box-shadow: inset 0 0 0 2px var(--brand-600); }
.tl-target .column-empty { display: none; }
.drop-hint { display: none; margin: 0; font-size: 0.78rem; font-weight: 650; color: var(--brand-800); }
.kcard-lifted .drop-hint { display: block; }
.kcard-moved { box-shadow: 0 0 0 3px var(--brand-300); }

/* Trash (`roadmap-trash`): the danger red on its tint, as the Teams page's delete row, so it never reads as another month;
   the bin and the word say it too. #b42318 on #fef3f2 is 6.0:1, #912018 on it 7.9:1 (AA). */
.tl-trash { background: #fef3f2; border-color: #fecdca; }
.tl-trash-title { display: flex; align-items: center; gap: 6px; color: var(--danger); }
.tl-trash-title .icon { width: 18px; height: 18px; }
.tl-trash .count { background: #fee4e2; color: var(--danger); }
.tl-trash-note { margin: -2px 4px 0; font-size: 0.78rem; color: #912018; }
.tl-trash-empty { display: grid; justify-items: center; gap: 6px; padding: 24px 10px; border-color: #fda29b; color: #912018; }
.tl-trash-empty .icon { width: 22px; height: 22px; }
.tl-trash-button { align-self: flex-start; }
.tl-trash.tl-target { border-color: var(--danger); box-shadow: inset 0 0 0 2px var(--danger); }
/* A card in the Trash: a dashed edge and its title struck through; the day it goes, in words. */
.kcard-trashed { border-style: dashed; border-color: #fda29b; box-shadow: none; }
.kcard-trashed .kcard-title { color: var(--gray-700); text-decoration: line-through; text-decoration-color: #f97066; }
.kcard-trashed .kcard-title:hover { color: var(--gray-900); text-decoration-line: line-through underline; }
.trash-when { display: flex; align-items: flex-start; gap: 6px; margin: 0; color: #912018; font-weight: 600; }
.trash-when .icon { margin-top: 2px; }
/* Dragging over Trash: the card turns red too, and says what letting go does. */
.kcard-lifted.kcard-over-trash { border-color: var(--danger); background: var(--surface); box-shadow: 0 10px 24px rgba(180, 35, 24, 0.22); }
.kcard-over-trash .drop-hint { color: var(--danger); }

/* Similar work in other teams (`similar-opportunities`): a charcoal section above the timeline, so it stands apart from the
   olive page (owner, 2026-10-25); its pairs are white cards. A matched card's line is a pill of the same charcoal. */
.similar { margin-bottom: 18px; background: var(--gray-900); border-color: var(--gray-900); color: #fff; box-shadow: 0 6px 20px rgba(17, 24, 39, 0.18); }
.similar-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.similar-head h2 { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 1.05rem; color: #fff; }
.similar-head .count { background: var(--brand-200); color: var(--gray-900); }
.similar-lead { margin: 2px 0 0; font-size: 0.85rem; color: var(--gray-300); }
.similar-pairs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 12px; }
.similar-pair { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border-radius: 8px; background: var(--surface); color: var(--text); }
.similar-pair:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--gray-900), 0 0 0 4px var(--brand-300); }
.similar-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.similar-item { display: grid; gap: 4px; padding-left: 10px; border-left: 3px solid var(--brand-200); }
.similar-item .kcard-title { overflow-wrap: anywhere; }
.similar-why { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px 16px; padding-top: 8px; border-top: 1px solid var(--border); font-size: 0.82rem; color: var(--gray-700); }
.similar-why strong { color: var(--gray-800); }
.similar-why > span { display: inline-flex; align-items: flex-start; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.similar-why .icon { flex: none; width: 14px; height: 14px; margin-top: 2px; stroke-width: 2; }
.similar-actions { justify-content: flex-end; margin-top: auto; }
.kcard-similar { margin: 2px 0 0; }
.similar-link {
  display: inline-flex; align-items: flex-start; gap: 6px; min-height: 32px; padding: 6px 10px; border: 0; border-radius: 999px;
  background: var(--gray-900); color: #fff; font-size: 0.78rem; font-weight: 650; text-align: left; cursor: pointer; overflow-wrap: anywhere;
}
.similar-link:hover { background: var(--gray-700); }
.similar-link:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--brand-600); }
.similar-link .icon { flex: none; width: 14px; height: 14px; margin-top: 1px; }
.undo-btn { margin-left: 8px; padding: 0; color: var(--brand-800); font-size: inherit; font-weight: 650; text-decoration: underline; }
.undo-btn:hover { color: var(--brand-600); }
.stage { display: inline-flex; align-items: center; gap: 4px; font-size: 0.75rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--brand-100); color: var(--brand-800); white-space: nowrap; }
.stage-validating { background: #e0ecff; color: #1e3a8a; }
.stage-ready { background: var(--brand-600); color: #fff; }
.sr-status { min-height: 1.4em; margin: -8px 0 10px; font-size: 0.85rem; font-weight: 600; color: var(--brand-800); }

/* Forms */
input, textarea, select {
  width: 100%; font: inherit; font-size: 0.92rem; color: var(--text); background: var(--surface);
  border: 1px solid var(--gray-300); border-radius: 8px; padding: 8px 10px;
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand-500); box-shadow: var(--ring); }

.modal { border: 0; border-radius: 14px; padding: 0; width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); box-shadow: 0 24px 60px rgba(17, 24, 39, 0.3); }
.modal::backdrop { background: rgba(17, 24, 39, 0.55); }
.modal-form { display: flex; flex-direction: column; max-height: calc(100vh - 48px); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-header h2 { font-size: 1.1rem; }
.modal-body { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 20px 22px; overflow-y: auto; }
.modal-footer { display: flex; align-items: center; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--gray-50); }
.spacer { flex: 1; }

.field { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; }
.field-half { grid-column: span 1; }
.field-label { font-size: 0.82rem; font-weight: 600; color: var(--gray-700); }
.req { color: var(--brand-600); }
.fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.fieldset legend { padding: 0; margin-bottom: 6px; }
.field-error { color: var(--danger); font-size: 0.82rem; font-weight: 500; }
.field-error::before { content: "! "; font-weight: 700; }
[aria-invalid="true"] { border-color: var(--danger); }
.form-error { margin: 0 22px 12px; color: var(--danger); font-weight: 500; }
.checklist { border: 1px solid var(--gray-300); border-radius: 8px; max-height: 190px; overflow-y: auto; padding: 4px; }
.check { display: flex; align-items: flex-start; gap: 10px; padding: 7px 8px; border-radius: 6px; cursor: pointer; font-size: 0.88rem; }
.check:hover { background: var(--brand-50); }
.check input { width: auto; margin-top: 3px; accent-color: var(--brand-600); }

/* Guided discovery (`guided-discovery`): goals, the interview filter, product data */
.lead-text { color: var(--gray-700); max-width: 70ch; margin: -6px 0 18px; }
.next-step { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-bottom: 16px; background: var(--brand-50); border-color: var(--brand-200); color: var(--brand-800); font-weight: 600; }
.next-step a:not(.btn) { color: var(--brand-800); }
.empty-start { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.field-hint { margin: -2px 0 6px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.goal-list { display: flex; flex-direction: column; gap: 16px; }
.goal-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 12px; margin-bottom: 12px; }
.goal-question { font-size: 1.1rem; flex: 1 1 320px; min-width: 0; }
.goal-meta { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 12px 24px; margin: 0; }
.goal-meta dt { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--brand-700); margin-bottom: 2px; font-weight: 700; }
.goal-meta dd { margin: 0; }
.goal-beliefs { grid-column: 1 / -1; }
.goal-beliefs ul { margin: 0; padding-left: 1.2em; }
.goal-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--gray-100); }
.filter-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 20px; margin-bottom: 20px; padding: 14px 20px; }
.filter-field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 320px; min-width: 0; }
.tag { display: inline-flex; align-items: center; gap: 4px; max-width: 260px; overflow-wrap: anywhere; font-size: 0.75rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--gray-100); color: var(--gray-700); vertical-align: middle; }
.table tbody th.row-name { text-transform: none; letter-spacing: 0; font-size: inherit; font-weight: 600; color: var(--text); background: none; }
.tag-goal { background: var(--brand-100); color: var(--brand-800); }
.option-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-bottom: 12px; }
.option-card { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); }
.option-card h3 { font-size: 1rem; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 16px 0; }
.notice-line { margin: 8px 0; padding: 10px 12px; border-radius: 8px; background: #fff7ed; color: #7c2d12; font-size: 0.88rem; }
.notice-line::before { content: "⚠ "; }
.dataset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.dataset-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); }
.dataset-card h3 { font-size: 1rem; }
/* The card's foot: its insights, then its actions (`insights-from-data`). */
.dataset-foot { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; width: 100%; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--gray-100); }
.dataset-foot p { margin: 0; }
.dataset-insights { display: inline-flex; align-items: center; gap: 6px; }
.dataset-insights .icon { width: 14px; height: 14px; }
/* The line under an Insights tab saying which insights it shows. */
.tab-note { margin: -8px 0 16px; }
/* Editing a data set (`edit-product-data`): newest first, scrolling inside its card with the header row in view. */
.edit-table-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin: 4px 0 10px; }
.edit-table-head p { margin: 0; }
.edit-table-wrap { max-height: 60vh; overflow: auto; margin-bottom: 12px; border-top: 1px solid var(--gray-100); }
.edit-table th { position: sticky; top: 0; z-index: 1; background: var(--gray-50); }
.edit-table tbody tr { cursor: default; }
.edit-table tbody tr:hover { background: none; }
.edit-table td { padding: 6px 8px; vertical-align: middle; }
.edit-table td:first-child, .edit-table th:first-child { padding-left: 20px; }
.edit-table input { min-width: 110px; font-variant-numeric: tabular-nums; }
.edit-table input[type="date"], .edit-table input[type="month"] { min-width: 160px; }
.edit-table [aria-invalid="true"] { border-color: var(--danger); }
.edit-remove-cell { width: 1%; white-space: nowrap; }
.edit-more { margin-bottom: 12px; }
#edit-title:focus, #edit-error:focus { outline: none; }
.trends { list-style: none; margin: 4px 0; padding: 0; display: grid; gap: 8px; width: 100%; }
.trends li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.trends li > .muted { flex-basis: 100%; }
.trend-value { font-family: var(--font-heading); font-weight: 800; font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.trend { display: inline-flex; align-items: center; gap: 4px; font-size: 0.8rem; font-weight: 600; color: var(--gray-700); }

/* Home: the discovery cycle (`guided-discovery`) */
.step-state { display: inline-flex; align-items: center; gap: 4px; font-size: 0.75rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--gray-100); color: var(--gray-700); white-space: nowrap; }
.step-state-done { background: var(--brand-100); color: var(--brand-800); }
.step-state-next { background: var(--brand-600); color: #fff; }

/* Home (`empty-workspace`): the sample data an older account can remove, and the tips, set apart from the tasks: an
   aside with a light bulb and the word "Tips", a dashed edge on a warm surface, no shadow, smaller text. */
.sample-card { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 20px; background: var(--brand-50); border-color: var(--brand-200); }
.sample-text { flex: 1 1 260px; display: grid; gap: 2px; }
.sample-text h2 { color: var(--brand-800); }
.tips-card { margin-bottom: 28px; padding: 18px 20px; border: 1.5px dashed var(--brand-300); border-radius: var(--radius); background: #fbfaf3; }
.tips-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.tips-icon { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 50%; background: var(--brand-100); color: var(--brand-800); }
.tips-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--brand-700); }
.tips-head h2 { font-size: 0.98rem; }

/* Home once the first steps are done (`home-loop`): the next step in the charcoal card for what must stand out, the loop
   with its list in words, and a tip for today in the tips card. */
.home-next { margin-bottom: 20px; background: var(--gray-900); border-color: var(--gray-900); color: #fff; box-shadow: 0 6px 20px rgba(17, 24, 39, 0.18); }
.home-next-label { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--brand-200); }
.home-next-label .icon { width: 14px; height: 14px; stroke-width: 2.25; }
.home-next-body { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; }
.home-next-body > div:first-child { flex: 1 1 320px; min-width: 0; }
.home-next h2 { color: #fff; font-size: 1.25rem; overflow-wrap: anywhere; }
.home-next p { margin: 4px 0 0; color: var(--gray-300); overflow-wrap: anywhere; }
.home-next .btn:focus-visible, .home-next a:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--gray-900), 0 0 0 4px var(--brand-300); }
.home-next-also { margin-top: 14px !important; padding-top: 12px; border-top: 1px solid var(--gray-700); font-size: 0.85rem; }
.home-next-also a { color: #fff; font-weight: 600; }
.home-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.home-loop { margin-bottom: 24px; }
.home-loop > h2 { font-size: 1.15rem; margin-bottom: 4px; }
.home-loop-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); align-items: center; gap: 8px 32px; }
.home-loop-svg { display: block; width: 100%; max-width: 380px; height: auto; margin: 0 auto; }
.home-loop-track { fill: none; stroke: var(--brand-200); stroke-width: 3; }
.home-loop-arrow { fill: none; stroke: var(--brand-600); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.home-loop-node { fill: var(--brand-100); stroke: var(--surface); stroke-width: 4; }
.home-loop-icon { fill: none; stroke: var(--brand-800); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.home-loop-station { fill: var(--gray-800); font-family: var(--font-heading); font-size: 14px; font-weight: 700; }
.home-loop-marker circle { fill: var(--gray-900); stroke: var(--surface); stroke-width: 3; }
.home-loop-marker text { fill: #fff; font-size: 14px; font-weight: 800; }
.home-loop-count { fill: var(--text); font-family: var(--font-heading); font-size: 40px; font-weight: 800; }
.home-loop-count-label { fill: var(--gray-600); font-size: 13px; font-weight: 600; }
.home-where { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.home-where li { display: flex; align-items: flex-start; gap: 12px; }
.home-where-n { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--gray-900); color: #fff; font-size: 0.85rem; font-weight: 800; }
.home-where-text { display: grid; gap: 2px; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.home-where-text a { color: var(--text); font-weight: 650; }
.home-where-text a:hover { color: var(--brand-700); }
.home-where-text .small { color: var(--gray-700); }
.home-where-team { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--brand-700); }
.home-loop-more { margin: 12px 0 0 40px; font-size: 0.88rem; }
.home-answered { display: flex; align-items: flex-start; gap: 8px; margin: 14px 0 0; font-size: 0.88rem; color: var(--gray-700); overflow-wrap: anywhere; }
.home-answered .icon { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--brand-700); stroke-width: 2; }
.home-answered a { color: var(--gray-800); }
.home-tip { display: grid; justify-items: start; gap: 4px; }
.home-tip .tips-head { margin-bottom: 4px; }
.home-tip h2 { font-size: 1.1rem; }
.home-tip-text { margin: 0 0 10px; max-width: 62ch; color: var(--gray-800); }
.home-tip-foot { justify-self: stretch; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding-top: 12px; border-top: 1px solid var(--brand-200); }
.home-tip-foot p { flex: 1 1 260px; margin: 0; color: var(--gray-700); overflow-wrap: anywhere; }
/* Home for someone new (`home-welcome`): the help line, and How Discovery works, also in a dialog from the returning
   Home's loop card: the loop's stations as buttons placed by class around the ring, and the panel for the one chosen. */
.home-help { display: flex; align-items: flex-start; gap: 8px; margin: 8px 0 0; font-size: 0.88rem; color: var(--gray-700); }
.home-help .icon { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--brand-700); }
.home-loop-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 4px; }
.home-loop-head h2 { font-size: 1.15rem; }
.home-how { margin-bottom: 16px; }
.home-how > h2 { font-size: 1.15rem; margin-bottom: 6px; }
.home-how-lead { margin: 0 0 12px; max-width: 75ch; color: var(--gray-800); }
.home-how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); align-items: center; gap: 12px 32px; }
.home-how-loop { position: relative; width: min(340px, 100%); aspect-ratio: 1; margin: 0 auto; }
.home-how-ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.home-how-centre { position: absolute; top: 50%; left: 50%; width: 46%; transform: translate(-50%, -50%); margin: 0; display: grid; gap: 2px; text-align: center; font-size: 0.78rem; color: var(--gray-600); }
.home-how-centre strong { font-family: var(--font-heading); font-size: 1.15rem; color: var(--text); }
.home-how-stop { position: absolute; display: grid; justify-items: center; gap: 4px; padding: 0; border: 0; background: none; cursor: pointer; transform: translate(-50%, -22px); font: inherit; color: var(--gray-800); }
.home-how-stop-goal { left: 50%; top: 15%; }
.home-how-stop-interviews { left: 85%; top: 50%; }
.home-how-stop-insights { left: 50%; top: 85%; }
.home-how-stop-roadmap { left: 15%; top: 50%; }
.home-how-stop-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--brand-100); color: var(--brand-800); box-shadow: 0 0 0 4px var(--surface); }
.home-how-stop-word { font-size: 0.82rem; font-weight: 600; padding: 0 4px; border-radius: 4px; background: var(--surface); }
.home-how-stop:hover .home-how-stop-icon { background: var(--brand-200); }
.home-how-stop[aria-pressed="true"] .home-how-stop-icon { background: var(--gray-900); color: #fff; }
.home-how-stop[aria-pressed="true"] .home-how-stop-word { font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.home-how-stop:focus-visible { outline: none; }
.home-how-stop:focus-visible .home-how-stop-icon { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--brand-600); }
.home-how-panel { display: grid; gap: 8px; align-content: start; padding: 18px 20px; border-radius: var(--radius); background: var(--brand-50); }
.home-how-panel h3 { font-size: 1.1rem; }
.home-how-panel p { margin: 0; color: var(--gray-800); }
.home-how-count { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--brand-700) !important; }
.home-how-menu { display: flex; align-items: flex-start; gap: 8px; font-size: 0.85rem; }
.home-how-menu .icon { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--brand-700); }
.home-how-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.home-how-later { display: flex; align-items: flex-start; gap: 8px; margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--border); font-size: 0.88rem; color: var(--gray-700); }
.home-how-later .icon { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--brand-700); }
.home-how-dialog { width: min(860px, calc(100vw - 32px)); }
@media (max-width: 860px) {
  .home-actions { width: 100%; }
  .home-how-foot .btn, .home-loop-head .btn { flex: 1 1 auto; min-height: 44px; }
  .home-next .btn, .home-tip-foot .btn { flex: 1 1 auto; min-height: 44px; }
  .home-loop-svg { max-width: 340px; }
}

/* Ask the discovery agent (`discovery-agent`, `ask-page-layout`): your questions beside the answer, which reads conclusion
   first. The page is a size container, so the two columns follow the room left beside the sidebar. */
.ask-page { container: ask / inline-size; }
.ask-split { display: grid; grid-template-columns: clamp(220px, 30%, 300px) minmax(0, 1fr); gap: 20px; align-items: start; }
.ask-split.is-first { grid-template-columns: minmax(0, 1fr); }
.ask-pane { display: grid; gap: 16px; min-width: 0; }
.ask-page .page-actions .btn { text-decoration: none; }
.ask-back { display: none; }

/* Your questions: the open one has a tint, a bar at its edge and bold text, like the menu's current page. */
.ask-list { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; padding: 16px; }
.ask-list h2 { margin-bottom: 8px; }
.ask-items { list-style: none; margin: 0 -6px; padding: 0; display: grid; gap: 2px; }
.ask-item {
  position: relative; display: grid; gap: 4px; min-height: 44px; padding: 10px 12px; border-radius: 8px;
  color: var(--gray-800); font-size: 0.92rem; text-decoration: none;
}
.ask-item:hover { background: var(--gray-50); }
.ask-item[aria-current="true"] { background: var(--brand-50); font-weight: 650; }
.ask-item[aria-current="true"]::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 2px; background: var(--brand-600); }
.ask-item-title { overflow-wrap: anywhere; }
.ask-item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size: 0.78rem; font-weight: 500; color: var(--gray-600); }
.ask-status { display: inline-flex; align-items: center; gap: 4px; font-weight: 650; color: var(--gray-800); }
.ask-status .icon { width: 15px; height: 15px; }
.ask-status-failed { color: var(--danger); }
.ask-review { padding: 1px 8px; border-radius: 999px; background: var(--brand-100); color: var(--brand-800); font-weight: 650; }

/* The form */
.ask-form { display: grid; gap: 14px; }
.ask-question-label { font-size: 0.95rem; color: var(--gray-800); }
.ask-suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ask-options { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 20px; padding-top: 12px; border-top: 1px solid var(--gray-100); }
.ask-options .field { flex: 1 1 260px; min-width: 0; }
.ask-options .check { flex: 1 1 260px; padding-inline: 0; }
.ask-options .check:hover { background: none; }
.ask-submit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.btn .icon { width: 18px; height: 18px; }
.chip-btn { min-height: 36px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--brand-300); background: var(--brand-50); color: var(--brand-800); font: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer; text-align: left; }
.chip-btn:hover { background: var(--brand-100); }
.chip-btn:disabled, .btn:disabled { opacity: 0.55; cursor: not-allowed; }
.ask-notice { display: grid; gap: 10px; background: var(--brand-50); border-color: var(--brand-200); }
.ask-notice p { margin: 0; }
.ask-can { margin-bottom: 0; }
.plain-list { margin: 0 0 8px; padding-left: 1.2em; display: flex; flex-direction: column; gap: 6px; }

/* The answer */
.answer { display: grid; gap: 16px; min-width: 0; }
.answer-head { display: grid; gap: 6px; }
.answer-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 0.85rem; color: var(--gray-600); }
.answer-meta .tag { max-width: none; }
.answer-title { font-size: 1.3rem; overflow-wrap: anywhere; }
.answer-title:focus, .answer-part:focus { outline: none; }
.answer-part:focus-visible { box-shadow: var(--ring); }
.answer-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 1.02rem; }
.answer-h .icon { width: 24px; height: 24px; color: var(--brand-700); }
.answer-main { border-color: var(--brand-300); }
.answer-summary { font-size: 1.08rem; line-height: 1.6; }
.answer-jumps { list-style: none; margin: 16px 0 0; padding: 14px 0 0; display: flex; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--gray-100); }
.answer-jump {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--gray-300); background: var(--surface);
  color: var(--gray-800); font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.answer-jump:hover { background: var(--gray-100); }
.answer-jump.is-todo { border-color: var(--brand-400); background: var(--brand-50); color: var(--brand-800); }
.answer-sub { margin: 18px 0 10px; font-size: 0.9rem; }
.answer-sub:first-of-type { margin-top: 0; }
.answer-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.belief, .evidence, .outside, .gap { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.belief { background: var(--gray-50); }
.belief-text { flex: 1 1 300px; font-style: italic; }
.belief .small { flex-basis: 100%; }
.verdict { display: inline-flex; align-items: center; gap: 4px; font-size: 0.78rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: #fff7ed; color: #7c2d12; }
.verdict-supported { background: var(--brand-100); color: var(--brand-800); }
.verdict-not_supported { background: var(--gray-100); color: var(--gray-700); }
.evidence-body { flex: 1 1 320px; min-width: 0; }
/* Evidence: its kind in a column of its own, so every item's text starts at the same place. */
.evidence { display: grid; grid-template-columns: 104px minmax(0, 1fr) auto; gap: 4px 14px; }
.evidence-kind { justify-self: start; margin-top: 2px; }
.evidence > a { justify-self: end; }
.evidence-open { display: inline-flex; align-items: center; gap: 4px; }
.outside { border-style: dashed; background: var(--gray-50); }
.tag-outside { background: #f3e8ff; color: #581c87; }
.opp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 12px; }
.opp { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--brand-300); border-radius: 12px; background: var(--brand-50); }
.opp h5 { margin: 0; font-family: var(--font-heading); font-size: 0.98rem; overflow-wrap: anywhere; }
.opp [role="status"]:focus { outline: none; }
.opp-meta { margin: 0; display: grid; gap: 4px; font-size: 0.82rem; }
.opp-meta div { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.opp-meta dt { font-weight: 700; }
.opp-meta dd { margin: 0; }
.gap { align-items: center; }
.gap p { flex: 1 1 260px; margin: 0; }
.useful { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 4px; }

/* Being answered: the wait in words, and a bar that moves only without reduced motion (the global rule stops it). */
.ask-working { display: grid; gap: 10px; border-color: var(--brand-300); }
.ask-working p { margin: 0; }
.ask-progress { height: 6px; border-radius: 999px; background: var(--gray-100); overflow: hidden; }
.ask-progress span { display: block; width: 35%; height: 100%; border-radius: 999px; background: var(--brand-500); animation: ask-progress 1.6s ease-in-out infinite; }
@keyframes ask-progress { from { transform: translateX(-100%); } to { transform: translateX(290%); } }

/* A narrow page: the list alone, or one view with a way back to it. */
@container ask (max-width: 639px) {
  .ask-split { grid-template-columns: minmax(0, 1fr); }
  .ask-split[data-view="home"]:not(.is-first) .ask-pane, .ask-split:not([data-view="home"]) .ask-list { display: none; }
  .ask-list { position: static; max-height: none; }
  .ask-item { min-height: 48px; }
  .ask-split:not(.is-first) .ask-back {
    display: inline-flex; align-items: center; gap: 6px; justify-self: start; min-height: 44px; padding: 0 4px;
    color: var(--primary); font-weight: 600; text-decoration: none;
  }
  .answer-jump, .chip-btn, .ask-pane .btn { min-height: 44px; }
}

/* Tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
/* A page's tabs are links (`interviews-and-insights`). */
a.tab { text-decoration: none; }
.tab {
  background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
  padding: 10px 14px; font-weight: 600; color: var(--gray-500); cursor: pointer;
}
.tab:hover { color: var(--gray-800); }
.tab.active { color: var(--brand-700); border-bottom-color: var(--brand-600); }
.tab.active .count { background: var(--brand-100); color: var(--brand-800); }

/* Research files uploads */
.upload-panel { display: grid; grid-template-columns: 1fr 220px; gap: 16px 20px; margin-bottom: 24px; align-items: start; }
.dropzone {
  border: 2px dashed var(--brand-300); border-radius: var(--radius); background: var(--brand-50);
  padding: 28px 20px; text-align: center; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px;
  transition: background 0.12s, border-color 0.12s;
}
.dropzone:hover, .dropzone.drag-over { background: var(--brand-100); border-color: var(--brand-500); }
.dropzone-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--surface); color: var(--brand-600); margin-bottom: 6px; box-shadow: var(--shadow); }
.link-inline { color: var(--brand-700); font-weight: 600; text-decoration: underline; }
.upload-team { display: flex; flex-direction: column; gap: 6px; }
.upload-status { grid-column: 1 / -1; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.upload-status li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.upload-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gray-400); flex: none; }
.upload-working .upload-dot { background: var(--brand-400); animation: pulse 1s ease-in-out infinite; }
.upload-done .upload-dot { background: var(--brand-600); }
.upload-error .upload-dot { background: var(--danger); }
.upload-error .muted { color: var(--danger); }
@keyframes pulse { 50% { opacity: 0.3; } }
.file-name { word-break: break-word; }

/* File viewer */
.modal-wide { width: min(960px, calc(100vw - 32px)); }
.viewer-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.viewer-title h2 { overflow-wrap: anywhere; }
.viewer-body { padding: 16px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.doc-text {
  margin: 0; white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: 0.9rem; line-height: 1.6;
  background: var(--gray-50); border: 1px solid var(--border); border-radius: 8px; padding: 16px; max-height: 60vh; overflow-y: auto;
}
.csv-preview { overflow: auto; max-height: 60vh; border: 1px solid var(--border); border-radius: 8px; }
.csv-preview .table th { position: sticky; top: 0; background: var(--gray-50); }
.csv-preview .table tbody tr { cursor: default; }
.csv-preview .table td, .csv-preview .table th { padding: 8px 12px; }

/* Outcomes (OKRs) */
.badge-danger { background: #fef3f2; color: var(--danger); box-shadow: inset 0 0 0 1px #fecdca; }

/* Dashboard */
.dash-section { margin-bottom: 32px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 12px; flex-wrap: wrap; }
.section-head h2 { font-size: 1.15rem; }
.section-head p { margin-top: 2px; }

/* Teams (`team-management`, `teams-page`): "+ New team…" in a team field, and the Teams page */
.new-team { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; padding: 12px; border: 1px dashed var(--brand-300); border-radius: 8px; background: var(--brand-50); }
.new-team .field-hint { margin: 0; }
.new-team[hidden] { display: none; }
.check-new span { font-weight: 600; color: var(--brand-700); }
.check-hint { display: block; margin-top: 2px; font-size: 0.8rem; color: var(--gray-600); }
.check-disabled { cursor: not-allowed; color: var(--gray-500); }
.check-disabled:hover { background: none; }
.use-team { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.btn[aria-busy="true"] { cursor: progress; opacity: 0.7; }
.teams-page { display: flex; flex-direction: column; align-items: stretch; gap: 14px; }
.teams-page .team-rows { background: var(--surface); }
/* Account and teams (`account-and-teams`): rows of words and an action, the action dropping below on a phone. */
.profile-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 0; }
.profile-row + .profile-row { border-top: 1px solid var(--border); }
.profile-row:first-of-type { padding-top: 0; }
.profile-text { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
.profile-text p { margin: 0; }
.profile-text p + p { margin-top: 2px; }
.profile-danger { border-color: #fecdca; }
.profile-foot { display: flex; flex-wrap: wrap; gap: 8px; }
.team-rows { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 10px; }
.team-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 14px; }
.team-row + .team-row { border-top: 1px solid var(--border); }
.team-row-text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
.team-row-text p { margin: 0; }
.team-row-edit { background: var(--brand-50); }
.team-name-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; }
.team-name-form input { flex: 1 1 220px; min-width: 0; }
.team-name-form .field-error, .team-name-form .field-label { flex-basis: 100%; }
.team-add { padding: 12px 14px; border: 1px dashed var(--brand-300); border-radius: 10px; background: var(--brand-50); }
.team-row-delete { background: #fef3f2; box-shadow: inset 4px 0 0 var(--danger); }
.delete-title { display: flex; align-items: center; gap: 6px; font-weight: 700; color: var(--danger); }
.delete-title .icon { width: 18px; height: 18px; stroke-width: 2; }
.team-row-delete .btn-danger { background: var(--danger); color: #fff; }
.team-row-delete .btn-danger:hover { background: #912018; }
/* The people of the organisation (`invite-people`): under the teams on the Teams tab, then the invitations waiting and
   what each role can do. A team's row also says who's in it. */
.section-title { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 1.05rem; }
.section-title .icon { width: 20px; height: 20px; color: var(--brand-700); }
.seats { margin: 0 0 10px; font-size: 0.9rem; color: var(--gray-700); }
.team-rows { background: var(--surface); }
.person-row { justify-content: flex-start; }
.person-row > .avatar { width: 40px; height: 40px; }
.avatar-invited { background: var(--gray-100); color: var(--gray-600); box-shadow: inset 0 0 0 1px var(--gray-300); }
.avatar-invited .icon { width: 18px; height: 18px; }
.person-name, .person-email { overflow-wrap: anywhere; }
.person-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.person-facts .icon { color: var(--gray-500); }
.person-actions { margin-left: auto; align-items: center; }
.person-role select { min-width: 130px; min-height: 40px; }
.people-alone { display: flex; align-items: flex-start; gap: 10px; margin: 12px 0 0; padding: 12px 14px; border-radius: 10px; background: var(--brand-50); box-shadow: inset 0 0 0 1px var(--brand-200); font-size: 0.9rem; }
.people-alone .icon, .read-only-notice .icon { flex: none; width: 20px; height: 20px; color: var(--gray-600); }
.team-members-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.avatar-face { width: 26px; height: 26px; font-size: 0.6rem; box-shadow: 0 0 0 2px var(--surface); }
.avatar-face + .avatar-face { margin-left: -8px; }
.team-members-form { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.team-members-list { max-height: none; background: var(--surface); }
.roles h2 { font-size: 1rem; margin-bottom: 10px; }
.roles ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 12px; }
.roles li { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 8px; background: var(--gray-50); }
/* Reading only: one line under a work page's title, and View only where a row's change would be. */
.read-only-notice { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 20px; padding: 12px 14px; border-radius: 10px; background: var(--gray-100); color: var(--gray-800); font-size: 0.9rem; }
.tag-view-only { color: var(--gray-700); }
/* Bring your team in, on the dashboard: the charcoal card (`.similar`) while the Admin is alone. */
.invite-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; }
.invite-card-text { display: grid; gap: 6px; max-width: 62ch; }
.invite-card-text h2 { display: flex; align-items: center; gap: 8px; font-size: 1.05rem; color: #fff; }
.invite-card-text h2 .icon { width: 24px; height: 24px; color: var(--brand-200); }
.invite-card-text p { margin: 0; font-size: 0.9rem; color: var(--gray-300); }
.invite-card-waiting { display: flex; align-items: center; gap: 6px; }
.invite-card-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.invite-card .btn:focus-visible { box-shadow: 0 0 0 2px var(--gray-900), 0 0 0 4px var(--brand-300); }
.btn-on-dark { background: transparent; color: #fff; border-color: var(--gray-400); }
.btn-on-dark:hover { background: rgba(255, 255, 255, 0.08); }
@media (max-width: 640px) {
  .page-actions .btn { min-height: 44px; }
  .person-actions { margin-left: 0; width: 100%; }
  .person-role select { min-height: 44px; }
}

/* Toast */
/* Icons (`topic-icons`): one set (src/lib/icons.js), a topic's icon wherever it's named, always beside its word.
   Sizes: a page title's circle 44 px (icon 24), a section heading's 36 px (20), Tips' 48 px (26), a card heading's icon
   24 px; 16 px beside text, 18 px in a button, 14 px beside small text, tags and pills, there with lines 2 px wide so
   they aren't fainter than their words. 6 px from icon to word, 12 px from a circle to its heading. One colour: olive. */
.icon-fill { fill: currentColor; stroke: none; }
.topic-badge { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--brand-100); color: var(--brand-800); }
.topic-badge .icon { width: 20px; height: 20px; }
.topic-badge-lg { width: 44px; height: 44px; }
.topic-badge-lg .icon { width: 24px; height: 24px; }
.topic-badge-sm { width: 30px; height: 30px; }
.topic-badge-sm .icon { width: 17px; height: 17px; }
.with-badge { display: flex; align-items: center; gap: 12px; }
.with-icon { display: flex; align-items: flex-start; gap: 8px; }
h2.with-icon .icon { width: 24px; height: 24px; color: var(--brand-700); }
h5.with-icon .icon { width: 16px; height: 16px; margin-top: 2px; }
.icon-topic { color: var(--brand-700); }
.small .icon, .tag .icon, .badge .icon, .stage .icon, .step-state .icon, .verdict .icon, .trend .icon { width: 14px; height: 14px; stroke-width: 2; }
.tips-icon .icon { width: 26px; height: 26px; }
.dropzone-icon .icon { width: 22px; height: 22px; stroke-width: 2; }
.back-link .icon { width: 16px; height: 16px; }
.btn .icon { width: 18px; height: 18px; stroke-width: 1.75; }
/* Facts with their icons ("4 of 6 interviews done", "2 data sets"), the icons standing in for the dots between them. */
.icon-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin: 0; }
.icon-facts > span { display: inline-flex; align-items: flex-start; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.icon-facts .icon { margin-top: 2px; }

/* Cards: a head (title, status on its first line), the body, then a foot behind a hairline, facts left and actions right.
   Cards side by side keep their actions on the bottom line. */
.goal-head .badge { margin-top: 3px; }
.opp > .row-actions, .opp > [role="status"] { margin-top: auto; }

/* Ask the agent: the goal behind an answer, first, on the menu's dark gray. The whole banner opens it. */
.goal-banner {
  display: flex; align-items: center; gap: 14px; margin-bottom: 8px; padding: 14px 16px; border-radius: var(--radius);
  background: var(--gray-900); color: #fff; text-decoration: none; box-shadow: var(--shadow);
}
.goal-banner:hover { background: var(--gray-800); }
.goal-banner:hover .goal-banner-question { text-decoration: underline; }
.goal-banner:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--brand-600); }
.goal-banner .topic-badge { width: 40px; height: 40px; }
.goal-banner .topic-badge .icon { width: 22px; height: 22px; }
.goal-banner-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.goal-banner-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gray-400); }
.goal-banner-question { font-family: var(--font-heading); font-size: 1.05rem; font-weight: 700; overflow-wrap: anywhere; }
.goal-banner-open { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; font-weight: 650; color: var(--brand-200); white-space: nowrap; }
.goal-banner-open .icon { width: 16px; height: 16px; }

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

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--gray-900); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 0.9rem;
  border-left: 4px solid var(--brand-500); transition: opacity 0.2s, transform 0.2s;
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

/* Responsive */
@media (max-width: 1100px) {

  .meta { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .upload-panel { grid-template-columns: 1fr; }
  .layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .topbar {
    position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 16px;
    background: var(--surface); border-bottom: 1px solid var(--border);
  }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 50; width: min(300px, 86vw); height: 100%;
    transform: translateX(-100%); visibility: hidden; transition: transform 0.2s ease, visibility 0s linear 0.2s;
  }
  .sidebar.is-open { transform: none; visibility: visible; transition: transform 0.2s ease; }
  .drawer-close { display: inline-grid; }
  .nav a, .nav-item, .nav-soon { min-height: 48px; }
  .popup-item { min-height: 44px; }
  .main { padding: 20px 16px 40px; }
  .detail-grid { grid-template-columns: 1fr; }
  .similar-actions .btn { flex: 1 1 auto; min-height: 44px; }
  .similar-link { min-height: 44px; align-items: center; }
}
@media (max-width: 560px) {
  /* The remove button keeps its ✕ and its aria-label, and drops the word to save room. */
  .edit-remove-word { display: none; }
  .edit-remove { min-width: 44px; min-height: 44px; justify-content: center; }
  .goal-meta, .evidence { grid-template-columns: minmax(0, 1fr); }
  .evidence > a { justify-self: start; }
  .goal-banner { flex-wrap: wrap; align-items: flex-start; }
  .goal-banner-open { flex-basis: 100%; padding-left: 54px; }
  .team-row .btn, .team-name-form .btn, .check { min-height: 44px; }
  .team-row .row-actions { width: 100%; }
  .team-row .row-actions .btn { flex: 1 1 0; }
  .meta { grid-template-columns: 1fr; }
  .modal-body { grid-template-columns: 1fr; }
  .field-half { grid-column: 1 / -1; }
}

/* The assistant (`ai-assistant`): a button at the bottom right of every page and a chat in a popup above it; at 860 px
   and below a full-screen sheet. Records it just made or changed are outlined for a few seconds. */
.assistant-on .main { padding-bottom: 96px; }
.recent { box-shadow: 0 0 0 3px var(--brand-400) !important; border-color: var(--brand-600) !important; }
tr.recent td { background: var(--brand-50); }
.recent-badge { margin-left: 6px; vertical-align: middle; }
/* Below the phone drawer's dimmed page (40); the toast shows over the chat. */
.assistant-on .toast { z-index: 70; }

.assistant-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 35; display: inline-flex; align-items: center; gap: 8px;
  min-height: 48px; padding: 0 20px 0 16px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--brand-700); color: #fff; font: inherit; font-weight: 650; font-size: 0.95rem;
  box-shadow: 0 8px 24px rgba(69, 79, 33, 0.35), 0 2px 6px rgba(17, 24, 39, 0.15); transition: background 0.15s, transform 0.2s;
}
.assistant-fab:hover { background: var(--brand-800); transform: translateY(-1px); }
.assistant-fab:focus-visible { outline: none; box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--brand-700); }
.assistant-fab .icon { width: 22px; height: 22px; }
.assistant-fab[aria-expanded="true"] { background: var(--gray-900); }
.assistant-fab[hidden], .assistant[hidden], .assistant-context[hidden], .assistant-composer[hidden], .assistant-send[hidden] { display: none; }

.assistant {
  position: fixed; right: 24px; bottom: 88px; z-index: 45; display: flex; flex-direction: column;
  width: min(420px, calc(100vw - 48px)); height: min(680px, calc(100vh - 112px));
  background: var(--surface); border: 1px solid var(--gray-200); border-radius: 18px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(17, 24, 39, 0.22), 0 4px 14px rgba(17, 24, 39, 0.08);
  transform-origin: bottom right;
}
/* Only while opening, so a resize past 860 px never replays it. */
.assistant.is-opening { animation: assistant-in 0.2s ease-out; }
@keyframes assistant-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }

.assistant-head { display: flex; align-items: center; gap: 8px; padding: 12px 10px 12px 14px; border-bottom: 1px solid var(--gray-200); background: linear-gradient(180deg, var(--brand-50), var(--surface)); }
.assistant-mark { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--brand-700); color: #fff; }
.assistant-mark .icon { width: 20px; height: 20px; }
.assistant-head-text { flex: 1; min-width: 0; }
.assistant-head h2 { font-size: 1rem; }
.assistant-sees { display: inline-flex; align-items: flex-start; gap: 2px; max-width: 100%; padding: 2px 0; border: 0; background: none; color: var(--gray-600); font: inherit; font-size: 0.78rem; cursor: pointer; text-align: left; }
.assistant-sees span { overflow-wrap: anywhere; }
.assistant-sees .icon { width: 14px; height: 14px; transition: transform 0.2s; }
.assistant-sees[aria-expanded="true"] .icon { transform: rotate(180deg); }
.assistant-sees:hover { color: var(--gray-900); }
.assistant-head-btn { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 10px; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--gray-700); font: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer; }
.assistant-head-btn .icon { width: 17px; height: 17px; }
.assistant-head-btn:hover, .assistant-head-btn[aria-pressed="true"] { background: var(--gray-100); color: var(--gray-900); }
.assistant-close { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 8px; background: none; color: var(--gray-600); cursor: pointer; }
.assistant-close:hover { background: var(--gray-100); color: var(--gray-900); }
.assistant :is(button, a, textarea, input, summary):focus-visible { outline: none; box-shadow: var(--ring); }

.assistant-context { padding: 12px 16px; background: var(--brand-50); border-bottom: 1px solid var(--brand-200); font-size: 0.82rem; color: var(--gray-800); }
.assistant-context dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; margin: 0; }
.assistant-context dt { color: var(--gray-600); }
.assistant-context dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.assistant-context p { margin: 8px 0 0; color: var(--gray-600); }

.assistant-body { position: relative; flex: 1; min-height: 0; overflow-y: auto; padding: 16px; overscroll-behavior: contain; }
.assistant-log { display: flex; flex-direction: column; gap: 14px; }
.assistant-hello h3 { font-size: 1.15rem; }
.assistant-hello p { margin: 4px 0 0; color: var(--gray-600); font-size: 0.9rem; }
.assistant-quiet { margin: 0; color: var(--gray-600); font-size: 0.88rem; }
.assistant-paused, .assistant-error, .ask-error { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 10px 12px; border-radius: 10px; font-size: 0.88rem; }
.assistant-paused { background: var(--gray-100); color: var(--gray-800); }
.assistant-error, .ask-error { flex-wrap: wrap; background: #fef3f2; color: var(--danger); }
.assistant-paused .icon, .assistant-error .icon, .ask-error .icon { width: 18px; height: 18px; margin-top: 1px; }
/* Errors at the top of the form, where they're seen first (`agent-scope`). */
.ask-error { flex-wrap: nowrap; background: var(--danger); color: #fff; font-size: 0.95rem; font-weight: 500; }
.ask-paused { display: grid; gap: 10px; background: var(--danger); border-color: var(--danger); color: #fff; }
.ask-paused p, .ask-paused .answer-h, .ask-paused .answer-h .icon { margin: 0; color: inherit; }

.assistant-starters { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.assistant-starter {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%;
  padding: 12px; border: 1px solid var(--gray-200); border-radius: 12px; background: var(--surface); cursor: pointer; text-align: left; font: inherit; color: var(--text);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.assistant-starter:hover { border-color: var(--brand-300); background: var(--brand-50); box-shadow: 0 4px 14px rgba(86, 98, 39, 0.1); }
.assistant-starter-title { display: block; font-weight: 650; font-size: 0.92rem; overflow-wrap: anywhere; }
.assistant-starter-why { display: block; margin-top: 2px; font-size: 0.8rem; color: var(--gray-600); overflow-wrap: anywhere; }
.assistant-starter > .icon { width: 18px; height: 18px; color: var(--gray-500); }
.assistant-starter:hover > .icon { color: var(--brand-700); }
.assistant-skeleton { display: block; height: 64px; border-radius: 12px; background: linear-gradient(90deg, var(--gray-100), var(--gray-50), var(--gray-100)); background-size: 200% 100%; animation: assistant-shimmer 1.2s linear infinite; }
@keyframes assistant-shimmer { to { background-position: -200% 0; } }

.assistant-msg { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: start; }
.assistant-msg-body { min-width: 0; }
.assistant-msg-mark { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--brand-100); color: var(--brand-800); }
.assistant-msg-mark .icon { width: 15px; height: 15px; }
.assistant-text { font-size: 0.92rem; overflow-wrap: anywhere; }
.assistant-text p { margin: 0 0 8px; }
.assistant-text p:last-child { margin-bottom: 0; }
/* A comparison of the person's takeaways with the notes (`takeaways-first`). */
.comparison { margin: 8px 0; }
.comparison-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; }
.comparison-item { display: grid; gap: 4px; justify-items: start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-size: 0.9rem; }
.comparison-item p { margin: 0; }
.comparison-label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--gray-600); }
.comparison-text { font-weight: 600; overflow-wrap: anywhere; }
.comparison-quote { margin: 2px 0 0; padding-left: 10px; border-left: 3px solid var(--brand-300); color: var(--gray-700); overflow-wrap: anywhere; }
.comparison-hint { color: var(--gray-700); }
.comparison-also-title { margin: 4px 0 6px; font-size: 0.9rem; }
.comparison-also .comparison-item { background: var(--brand-50); }
.assistant-text ol, .assistant-text ul { margin: 0 0 8px; padding-left: 20px; }
.assistant-text li + li { margin-top: 4px; }
.assistant-ref { display: inline-flex; align-items: baseline; gap: 3px; color: var(--brand-700); font-weight: 600; text-decoration: underline; text-decoration-color: var(--brand-300); text-underline-offset: 2px; }
.assistant-ref .icon { width: 14px; height: 14px; align-self: center; }
.assistant-ref:hover { text-decoration-color: currentColor; }
.assistant-user { align-self: flex-end; max-width: 85%; margin: 0; padding: 8px 12px; border-radius: 14px 14px 4px 14px; background: var(--brand-700); color: #fff; font-size: 0.92rem; overflow-wrap: anywhere; white-space: pre-wrap; }
.assistant-divider { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--gray-600); font-size: 0.75rem; }
.assistant-divider::before, .assistant-divider::after { content: ""; flex: 1; height: 1px; background: var(--gray-200); }
.assistant-divider .icon { width: 14px; height: 14px; }
.assistant-chat-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding-bottom: 10px; border-bottom: 1px solid var(--gray-100); }
.assistant-chat-bar p { margin: 0; font-size: 0.85rem; }
.assistant-chat-name { flex: 1; min-width: 0; font-weight: 650; overflow-wrap: anywhere; }
.assistant-chat-bar.is-confirm p { flex: 1 1 100%; }
.assistant-ask { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 10px 0 0; }
.assistant-ask-question { font-size: 0.84rem; color: var(--gray-600); overflow-wrap: anywhere; }

.assistant-working { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 0.82rem; color: var(--gray-600); }
.assistant-working li { display: flex; align-items: center; gap: 6px; overflow-wrap: anywhere; }
.assistant-working .icon { width: 14px; height: 14px; color: var(--brand-700); }
.assistant-spin { flex: none; width: 14px; height: 14px; border: 2px solid var(--brand-200); border-top-color: var(--brand-700); border-radius: 50%; animation: assistant-spin 0.8s linear infinite; }
@keyframes assistant-spin { to { transform: rotate(360deg); } }
.assistant-did { margin-top: 6px; font-size: 0.78rem; color: var(--gray-600); }
.assistant-did summary { cursor: pointer; min-height: 24px; }
.assistant-did ul { margin: 4px 0 0; padding-left: 18px; }

.assistant-card { margin-top: 10px; border: 1px solid var(--brand-300); border-radius: 12px; background: var(--surface); overflow: hidden; }
.assistant-card-head { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; background: var(--brand-50); border-bottom: 1px solid var(--brand-200); }
.assistant-card-head .topic-badge { width: 30px; height: 30px; }
.assistant-card-head .topic-badge .icon { width: 17px; height: 17px; }
.assistant-card-label { display: block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brand-800); }
.assistant-card-title { font-size: 0.95rem; font-weight: 650; overflow-wrap: anywhere; }
.assistant-items { list-style: none; margin: 0; padding: 0; }
.assistant-items li + li { border-top: 1px solid var(--gray-100); }
.assistant-item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding: 10px 12px; cursor: pointer; }
.assistant-item input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--brand-700); }
.assistant-item-solo { display: block; padding: 10px 12px; }
.assistant-item-title { display: block; font-weight: 600; font-size: 0.9rem; overflow-wrap: anywhere; }
.assistant-change { margin-top: 6px; }
.assistant-change-label { display: inline-flex; align-items: center; gap: 4px; font-size: 0.8rem; font-weight: 600; color: var(--gray-700); }
.assistant-change-label .icon { width: 14px; height: 14px; }
.assistant-diff { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; margin: 4px 0 0; font-size: 0.84rem; }
.assistant-diff dt { color: var(--gray-600); }
.assistant-diff dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.assistant-diff del { color: var(--gray-600); }
.assistant-diff ins { text-decoration: none; font-weight: 600; background: var(--brand-100); padding: 0 3px; border-radius: 3px; }
.assistant-diff-list { margin: 0; padding-left: 1.1em; white-space: normal; }
.assistant-diff-list li + li { margin-top: 2px; }
.assistant-card-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--gray-200); }
.assistant-card-note { flex: 1 1 100%; margin: 0; font-size: 0.78rem; color: var(--gray-600); }
.assistant-card-error { flex: 1 1 100%; display: flex; align-items: flex-start; gap: 6px; margin: 0; font-size: 0.84rem; color: var(--danger); }
.assistant-card-error .icon { width: 16px; height: 16px; }
.assistant-result { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 12px; border-top: 1px solid var(--gray-200); font-size: 0.85rem; outline: none; }
.assistant-result-text { display: inline-flex; align-items: center; gap: 6px; flex: 1; font-weight: 600; }
.assistant-result-text .icon { width: 16px; height: 16px; color: var(--brand-700); }
.assistant-result.is-quiet .assistant-result-text { color: var(--gray-600); font-weight: 500; }
.assistant-link { min-height: 36px; border: 0; background: none; padding: 0 4px; color: var(--brand-700); font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; border-radius: 4px; }

.assistant-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.assistant-quick-label { flex: 1 1 100%; margin: 0; font-size: 0.75rem; color: var(--gray-600); }
.assistant-qr {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 14px; border: 1px solid var(--brand-400); border-radius: 999px;
  background: var(--surface); color: var(--brand-800); font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; text-align: left; overflow-wrap: anywhere;
  transition: background 0.15s, border-color 0.15s;
}
.assistant-qr:hover { background: var(--brand-50); border-color: var(--brand-600); }
.assistant-qr-box { flex: none; width: 16px; height: 16px; border: 1.5px solid var(--brand-600); border-radius: 4px; display: inline-grid; place-items: center; }
.assistant-qr-box .icon { width: 12px; height: 12px; stroke-width: 3; visibility: hidden; }
.assistant-qr[aria-pressed="true"] { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.assistant-qr[aria-pressed="true"] .assistant-qr-box { border-color: #fff; }
.assistant-qr[aria-pressed="true"] .assistant-qr-box .icon { visibility: visible; }
.assistant .btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.assistant-history h3 { font-size: 1.05rem; }
.assistant-search { width: 100%; margin: 10px 0 4px; }
.assistant-group { margin: 14px 0 6px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gray-600); }
.assistant-chats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.assistant-chat { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; width: 100%; min-height: 48px; padding: 10px; border: 0; border-radius: 10px; background: none; text-align: left; font: inherit; color: var(--text); cursor: pointer; }
.assistant-chat:hover { background: var(--gray-100); }
.assistant-chat[aria-current="true"] { background: var(--brand-50); }
.assistant-chat .topic-badge { width: 30px; height: 30px; }
.assistant-chat .topic-badge .icon { width: 16px; height: 16px; }
.assistant-chat-title { display: block; font-weight: 600; font-size: 0.9rem; overflow-wrap: anywhere; }
.assistant-chat-meta { display: block; font-size: 0.78rem; color: var(--gray-600); }

.assistant-composer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; padding: 10px 12px; border-top: 1px solid var(--gray-200); background: var(--surface); }
.assistant-composer textarea { field-sizing: content; min-height: 44px; max-height: 140px; resize: none; border-radius: 12px; padding: 10px 12px; font: inherit; font-size: 0.92rem; line-height: 1.4; }
.assistant-send { min-height: 44px; }
.assistant-promise { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; margin: 0; font-size: 0.75rem; color: var(--gray-600); }
.assistant-promise .icon { width: 14px; height: 14px; color: var(--brand-700); }

@media (max-width: 860px) {
  .assistant-fab { right: 16px; bottom: 16px; }
  .assistant { inset: 0; width: auto; height: auto; border: 0; border-radius: 0; z-index: 60; }
  .assistant.is-opening { animation-name: assistant-up; }
  .assistant-is-open .assistant-fab { display: none; }
  .assistant-head-btn, .assistant-close { min-height: 48px; min-width: 48px; }
  .assistant-link { min-height: 44px; min-width: 44px; }
  .assistant-on .toast { bottom: 84px; }
  @keyframes assistant-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
}
/* The narrowest phones: the header keeps room for its title. */
@media (max-width: 420px) {
  .assistant-mark { display: none; }
  .assistant-head { gap: 4px; padding-left: 12px; }
  .assistant-head-btn { padding: 0 8px; }
}

/* The Product Foundry pages (`apps-dashboard`, `browse-apps`):
   Two shells in one page: body[data-shell="pf"] shows the header, the dashboard or Browse apps, and none of Discovery's
   sidebar, top bar or assistant; Discovery's shell hides the header. */
body:not([data-shell="pf"]) .pf-header { display: none; }
body[data-shell="pf"] .layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
body[data-shell="pf"] :is(.sidebar, .topbar, .scrim, .assistant-fab, .assistant) { display: none !important; }
body[data-shell="pf"] .main { margin: 0 auto; max-width: 1180px; }

.pf-header {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 20px; min-height: 64px; padding: 8px 32px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.pf-header :focus-visible { outline: none; box-shadow: var(--ring); }
.pf-brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--gray-900); text-decoration: none; border-radius: 8px; }
.pf-brand-name { font-family: var(--font-heading); font-weight: 800; font-size: 1.1rem; letter-spacing: -0.01em; white-space: nowrap; }
.pf-nav { display: flex; gap: 4px; align-self: stretch; }
.pf-nav a { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 8px; color: var(--gray-700); font-weight: 500; text-decoration: none; }
.pf-nav a:hover { background: var(--gray-100); color: var(--gray-900); }
/* The current page: bold text and a bar under it, never colour alone. */
.pf-nav a[aria-current="page"] { color: var(--brand-800); font-weight: 650; }
.pf-nav a[aria-current="page"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -8px; height: 3px; border-radius: 2px; background: var(--brand-600); }
.pf-account-slot { margin-left: auto; }
/* The account menu, in the light header. */
.pf-header .account-toggle { width: auto; min-height: 44px; padding: 4px 10px 4px 6px; border: 0; border-radius: 999px; background: none; color: var(--gray-800); }
.pf-header .account-toggle:hover { background: var(--gray-100); }
.pf-header .account-text { flex: none; }
.pf-header .account-email { display: none; }
.pf-header .account-toggle .chevron { transform: rotate(180deg); color: var(--gray-500); }
.pf-header .popup { left: auto; right: 0; width: 280px; }

/* The way back, at the top of Discovery's menu. */
.pf-back {
  display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 8px 12px; margin-bottom: -6px; border-radius: 8px 8px 0 0;
  border-bottom: 1px solid var(--gray-800); color: var(--gray-300); font-weight: 500; text-decoration: none;
}
.pf-back:hover { background: var(--gray-800); color: #fff; }
.pf-from { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 18px; padding: 10px 14px; border: 1px solid var(--brand-200); border-radius: 8px; background: var(--brand-50); font-size: 0.9rem; }
.pf-from .icon { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--brand-700); }

/* Apps: a mark per app, cards, and the Browse apps tile. */
.pf-app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 16px; }
.pf-app { display: flex; flex-direction: column; gap: 12px; }
.pf-app-head { display: flex; align-items: flex-start; gap: 12px; }
.pf-app-mark { display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--brand-600); color: #fff; }
.pf-app-mark .icon { width: 24px; height: 24px; }
.pf-app-title { flex: 1; min-width: 0; }
.pf-app-title h3 { font-size: 1.05rem; }
.pf-app-title p { margin: 0; }
.pf-app-text { margin: 0; color: var(--gray-700); font-size: 0.92rem; }
.pf-app-foot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid var(--gray-100); }
.pf-app-loading { min-height: 160px; }
.pf-browse-tile {
  display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 120px; padding: 20px; border: 1.5px dashed var(--gray-300);
  border-radius: var(--radius); color: var(--gray-800); text-decoration: none;
}
.pf-browse-tile:hover { border-color: var(--brand-500); background: var(--brand-50); }
.pf-browse-tile:focus-visible { outline: none; box-shadow: var(--ring); }
.pf-browse-tile > span { display: grid; }
.pf-browse-tile > .icon { width: 24px; height: 24px; color: var(--brand-700); }
.pf-apps-error { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 12px; color: var(--gray-800); }
.pf-apps-error > .icon { color: var(--warn); }
.pf-on-the-way { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 20px; padding: 16px 20px; border: 1.5px dashed var(--gray-300); border-radius: var(--radius); }
.pf-on-the-way p { margin: 0; flex: 1 1 260px; }
.pf-skeleton { display: block; height: 2.2rem; width: 60%; border-radius: 6px; background: var(--gray-100); }

/* Get started: steps with their state as a word and an icon. */
.pf-guide { border: 2px solid var(--brand-300); }
.pf-guide .card-head { flex-wrap: wrap; }
.pf-progress { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: var(--gray-700); font-size: 0.85rem; font-weight: 600; }
.pf-progress-bar { display: inline-flex; gap: 3px; }
.pf-progress-bar span { width: 22px; height: 6px; border-radius: 3px; background: var(--gray-200); }
.pf-progress-bar span.is-done { background: var(--brand-600); }
.pf-steps { list-style: none; margin: 0; padding: 0; display: grid; }
.pf-step { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 6px 14px; padding: 14px 0; }
.pf-step + .pf-step { border-top: 1px solid var(--gray-100); }
.pf-step-n { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--gray-100); color: var(--gray-700); font-weight: 700; }
.pf-step-done .pf-step-n { background: var(--brand-100); color: var(--brand-800); }
.pf-step-next .pf-step-n { background: var(--brand-600); color: #fff; }
.pf-step-n .icon { width: 18px; height: 18px; }
.pf-step-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 0 2px; }
.pf-step-body p { margin: 0; }
.pf-guide-foot { padding-top: 6px; border-top: 1px solid var(--gray-100); }
.pf-link-btn { min-height: 44px; padding: 0; border: 0; background: none; color: var(--brand-700); font: inherit; font-weight: 600; font-size: 0.88rem; cursor: pointer; }
.pf-link-btn:hover { text-decoration: underline; }
.pf-link-btn:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 4px; }

/* The last 30 days: tiles, then the weeks as one series of bars. */
.pf-tiles { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 16px; }
.pf-tile { display: grid; align-content: start; gap: 4px; padding: 16px 18px; }
.pf-tile p { margin: 0; }
.pf-tile-label { display: flex; align-items: center; gap: 8px; color: var(--gray-600); font-size: 0.85rem; font-weight: 500; }
.pf-tile-label .icon { width: 16px; height: 16px; color: var(--brand-700); }
.pf-tile-value { font-family: var(--font-heading); font-weight: 800; font-size: 2rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pf-tile-of { font-size: 1rem; font-weight: 700; color: var(--gray-600); }
.pf-warn { color: var(--warn); }
.pf-weeks h3 { font-size: 0.95rem; }
.pf-bars { list-style: none; margin: 8px 0 0; padding: 26px 0 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 2px 8px; height: 190px; border-bottom: 1px solid var(--gray-300); }
.pf-week { position: relative; display: flex; align-items: flex-end; justify-content: center; border-radius: 6px; }
.pf-week:focus-visible { outline: none; box-shadow: var(--ring); }
.pf-bar { position: relative; display: block; width: min(36px, 100%); border-radius: 4px 4px 0 0; background: var(--brand-500); }
.pf-bar.is-latest, .pf-week:hover .pf-bar, .pf-week:focus-visible .pf-bar { background: var(--brand-700); }
.pf-bar-tip {
  position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); padding: 2px 8px; border-radius: 6px;
  background: var(--gray-900); color: #fff; font-size: 0.75rem; font-weight: 600; white-space: nowrap; visibility: hidden;
}
.pf-week:hover .pf-bar-tip, .pf-week:focus-visible .pf-bar-tip { visibility: visible; }
.pf-bar.is-latest .pf-bar-tip { visibility: visible; background: none; color: var(--gray-800); }
.pf-week:hover .pf-bar.is-latest .pf-bar-tip, .pf-week:focus-visible .pf-bar.is-latest .pf-bar-tip { background: var(--gray-900); color: #fff; }
.pf-week-label { position: absolute; top: calc(100% + 6px); left: 0; right: 0; text-align: center; font-size: 0.72rem; color: var(--gray-600); white-space: nowrap; }
.pf-weeks-table { margin-top: 34px; }
.pf-weeks-table summary { display: inline-flex; align-items: center; min-height: 44px; color: var(--brand-700); font-weight: 600; font-size: 0.88rem; cursor: pointer; }
.pf-weeks-table summary:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
/* Bar heights in 5% steps: classes, because nothing may set a style attribute (strict CSP). */
.pf-h-0 { height: 2px; } .pf-h-1 { height: 5%; } .pf-h-2 { height: 10%; } .pf-h-3 { height: 15%; } .pf-h-4 { height: 20%; }
.pf-h-5 { height: 25%; } .pf-h-6 { height: 30%; } .pf-h-7 { height: 35%; } .pf-h-8 { height: 40%; } .pf-h-9 { height: 45%; }
.pf-h-10 { height: 50%; } .pf-h-11 { height: 55%; } .pf-h-12 { height: 60%; } .pf-h-13 { height: 65%; } .pf-h-14 { height: 70%; }
.pf-h-15 { height: 75%; } .pf-h-16 { height: 80%; } .pf-h-17 { height: 85%; } .pf-h-18 { height: 90%; } .pf-h-19 { height: 95%; } .pf-h-20 { height: 100%; }

/* Where you can improve. */
.pf-improve-head { margin-bottom: 8px; }
.pf-improve-head h2 { font-size: 1.15rem; }
.pf-improve-head p { margin: 2px 0 0; }
.pf-suggestions { list-style: none; margin: 0; padding: 0; display: grid; }
.pf-suggestion { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 6px 14px; padding: 14px 0; }
.pf-suggestion + .pf-suggestion { border-top: 1px solid var(--gray-100); }
.pf-suggestion-text p { margin: 0; overflow-wrap: anywhere; }
.pf-suggestion-why { color: var(--gray-600); font-size: 0.9rem; }
.pf-improve-none { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.pf-improve-none p { margin: 0; flex: 1 1 260px; }

@media (max-width: 860px) {
  .pf-header { gap: 10px; min-height: 56px; padding: 6px 16px; }
  .pf-nav, .pf-header .account-name { display: none; }
  .pf-back { min-height: 48px; }
  .pf-browse-tile { min-height: 72px; justify-content: flex-start; }
  .pf-step { grid-template-columns: 32px minmax(0, 1fr); }
  .pf-step-action { grid-column: 2; }
  .pf-suggestion { grid-template-columns: auto minmax(0, 1fr); }
  .pf-suggestion .btn { grid-column: 2; justify-self: start; }
  :is(.pf-app-foot, .pf-step-action, .pf-suggestion, .pf-improve-none, .pf-on-the-way, .pf-apps-error) .btn { min-height: 44px; }
  .pf-bars { gap: 2px 4px; }
}
/* On phones, every other week is labelled, each label as wide as two columns. */
@media (max-width: 560px) {
  .pf-week-label { left: -50%; right: -50%; font-size: 0.68rem; }
  .pf-week:nth-child(even) .pf-week-label { display: none; }
}
