/* GENERATED by build-css.sh from main.css - edit the source files, then run the script */
/* ---- tokens.css ---- */
/* Digiselvo AI design tokens. Change values here, never hard-code them in components. */
@import url("https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@400;500;600;700&family=Instrument+Serif:ital@0;1&display=swap");

:root {
  /* Theme marker: the app checks it to tell when a browser still shows old style files. Change with the theme. */
  --theme: navy-2026-11;

  /* Brand (client palette, 20 Nov): Dark Navy #0F172A, Royal Blue #2563EB, Soft Blue #EFF6FF, White #FFFFFF */
  --color-navy: #0f172a;
  --color-royal: #2563eb;
  --color-soft-blue: #eff6ff;
  --color-white: #ffffff;
  --color-accent: var(--color-navy);        /* solid emphasis: main buttons, send, avatar, logo, "Start here" */
  --color-accent-hover: #1e293b;
  --color-on-accent: var(--color-white);    /* text and icons on an accent fill */
  --color-accent-soft: var(--color-soft-blue); /* selected or current things, highlighted text boxes */
  --color-highlight: var(--color-royal);    /* subtle accents: progress, links, the edge of what is selected */
  --color-ink: #0f172a;                      /* text and icons */

  /* Text */
  --color-text: #0f172a;
  --color-text-muted: #475569;
  --color-text-faint: #64748b;

  /* Surfaces */
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-card: #f1f5f9;
  --color-line: #e2e8f0;
  --color-line-strong: #cbd5e1;

  /* Status */
  --color-green: #4f8553;
  --color-green-soft: #dcebd9;
  --color-orange: #b8651a;
  --color-orange-soft: #fbe6cc;
  --color-blue: #2563eb;
  --color-blue-soft: #dbeafe;
  --color-red: #b73a26;
  --color-red-soft: #f8ddd7;
  --color-violet: #6b4bd0;
  --color-violet-soft: #e8e1fb;

  /* Typography */
  --font-sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Instrument Serif", Georgia, "Times New Roman", serif;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;
  --text-3xl: 2.25rem;
  --text-4xl: 3rem;

  --leading-tight: 1.15;
  --leading-snug: 1.35;
  --leading-body: 1.55;

  /* Spacing (4px base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Radius */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 6px 20px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 18px 48px rgba(15, 23, 42, 0.12);

  /* Layout */
  --sidebar-width: 248px;
  --panel-width: 360px;
  --content-max: 1120px;
  --topbar-height: 64px;

  /* Motion */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --duration-fast: 120ms;
  --duration: 200ms;

  /* Glass (transparent, frosted) look. Used by glass.css. Change here to restyle the whole app. */
  --glass-bg: rgba(255, 255, 255, 0.72);        /* main frosted panels: sidebar, top bar, cards */
  --glass-bg-soft: rgba(255, 255, 255, 0.55);   /* smaller pieces on top of a panel: chips, nested boxes */
  --glass-bg-strong: rgba(255, 255, 255, 0.9);  /* inputs and menus that need to be easy to read */
  --button-glass: rgba(255, 255, 255, 0.92);
  --button-glass-hover: #ffffff;
  --button-glass-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  --button-glass-shadow-hover: 0 10px 26px rgba(15, 23, 42, 0.12);
  --color-selected: var(--color-royal);         /* the edge of what is selected */
  --selected-ring: 0 0 0 3px rgba(37, 99, 235, 0.18);
  --glass-border: rgba(255, 255, 255, 0.85);    /* light edge on the top and left of a panel */
  --glass-edge: rgba(15, 23, 42, 0.08);         /* thin outer line so panels stay visible */
  --glass-blur: 18px;
  --glass-saturate: 1.4;
  --glass-shadow: 0 8px 30px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --glass-shadow-lg: 0 18px 50px rgba(15, 23, 42, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  /* A clean white background with a faint blue light, so the glass still has something to frost. */
  --backdrop:
    radial-gradient(900px 520px at 0% -10%, rgba(37, 99, 235, 0.08), transparent 65%),
    radial-gradient(820px 620px at 100% 0%, rgba(239, 246, 255, 0.95), transparent 65%),
    radial-gradient(900px 700px at 80% 110%, rgba(37, 99, 235, 0.05), transparent 65%);

  --focus-ring: 0 0 0 3px var(--color-bg), 0 0 0 5px var(--color-royal);
}

/* ---- base.css ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Component display rules must never override the hidden attribute. */
[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1,
h2,
h3,
h4 {
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
  font-weight: 600;
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

p { max-width: 68ch; }

a {
  color: inherit;
  text-underline-offset: 3px;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

/* Serif accent for display headings, e.g. "Welcome, <em>Delphine</em>" */
.display {
  font-size: var(--text-4xl);
  letter-spacing: -0.03em;
}

.display em{
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.text-muted { color: var(--color-text-muted); }

.text-sm { font-size: var(--text-sm); }

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

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

/* ---- components/layout.css ---- */
/* The shell is built by JS; keep the page hidden until it is mounted to avoid a flash of unstyled content. */
#app-root:not(.app-shell) { visibility: hidden; }

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 200;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill);
  background: var(--button-glass-hover);
  color: var(--color-text);
  box-shadow: var(--button-glass-shadow-hover);
  font-size: var(--text-sm);
  font-weight: 600;
}

.skip-link:focus { top: var(--space-4); }

/* App shell: sidebar | main | optional detail panel */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh; /* the visible height: on phones and tablets 100vh is taller than the screen */
  background: var(--color-surface);
}
/* Until the menu and top bar are drawn the page stays hidden, so the browser keeps the previous page on screen
   instead of flashing a half-built one. If the script cannot draw them, the page shows itself after 2 seconds. */
#app-root:not(.app-shell) { visibility: hidden; animation: dg-reveal 0s linear 2s forwards; }
@keyframes dg-reveal { to { visibility: visible; } }

/* Ask Digiselvo fills exactly one screen, so the page itself never scrolls (only the conversation does). */
.app-shell:has(.chat-layout) { height: 100vh; height: 100dvh; overflow: hidden; }

.app-main {
  min-width: 0;
  background: var(--color-bg);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: var(--topbar-height);
  padding: 0 var(--space-6);
  background: color-mix(in srgb, var(--color-bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-line);
}

.topbar__title { font-size: var(--text-sm); font-weight: 600; }
.topbar__spacer { flex: 1; }
.topbar__actions { display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: var(--radius-pill); }
.topbar__action {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 36px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease);
}
.topbar__action svg { width: 18px; height: 18px; flex: none; }
.topbar__action:hover, .topbar__action[aria-current="page"] { background: rgba(255, 255, 255, 0.85); color: var(--color-ink); }
.bell__count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--color-royal); color: var(--color-on-accent); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.topbar__divider { width: 1px; height: 20px; background: var(--color-line-strong); }
.topbar__admin { margin-right: var(--space-1); }
.topbar .topbar__menu { display: none; }

.page {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-8) var(--space-6) var(--space-16);
}

.page__header { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-8); }
.page__header p { margin-top: var(--space-2); color: var(--color-text-muted); }

.section { margin-top: var(--space-10); }

/* Right detail panel (product detail, comparison notes, comments) */

/* Layout helpers */
.stack { display: grid; gap: var(--space-4); }

.row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.grid { display: grid; gap: var(--space-4); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.grid--cards { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: var(--space-5); }

@media (max-width: 900px) {
  .app-shell{ grid-template-columns: minmax(0, 1fr); }
  .topbar .topbar__menu { display: inline-flex; }
  .page { padding: var(--space-6) var(--space-4) var(--space-12); }
  .grid--2{ grid-template-columns: minmax(0, 1fr); }
  .page__header { flex-direction: column; align-items: flex-start; }
  .display { font-size: var(--text-3xl); }
}

@media (max-width: 640px) {
  .topbar__action > span:not(.bell__count) { display: none; }
  .topbar__action { width: 36px; padding: 0; justify-content: center; }
  .topbar__action .bell__count { position: absolute; top: 0; right: 0; }
  .topbar__admin span { display: inline; }
}

/* Vertical rhythm: headings, paragraphs, lists and tables never touch. Zero-specificity defaults; any component rule can override. */
:where(.card:not(.stack)) > * + * { margin-top: var(--space-3); }
:where(.card) > :is(h2, h3, h4) + * { margin-top: var(--space-2); }
:where(.card) > .grid, :where(.card) > .group-card__actions, :where(.card) > .field + .field { margin-top: var(--space-4); }
:where(.card) > :is(p, ul, div, form) + :is(h2, h3, h4) { margin-top: var(--space-6); }
.table-wrap + :is(p, h2, h3, ul) { margin-top: var(--space-3); }
.grid > div > :is(h3, h4) + ul { margin-top: var(--space-2); }

/* Two notices in a row keep a gap between them */
:where(.note) + :where(.note) { margin-top: var(--space-3); }

/* ---- components/sidebar.css ---- */
.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  height: 100vh;
  height: 100dvh; /* the visible height, so the bottom card is never hidden behind browser toolbars */
  padding: var(--space-4) var(--space-4);
  background: var(--color-surface);
  border-right: 1px solid var(--color-line);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none; /* no scroll bar; the menu still scrolls with the wheel or touch if the screen is very short */
}
.sidebar::-webkit-scrollbar { display: none; }

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-2);
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--color-accent);
  color: var(--color-on-accent);
}

.brand__mark svg { width: 18px; height: 18px; }
.brand em { font-family: var(--font-serif); font-weight: 400; font-style: italic; }

.nav { display: grid; gap: var(--space-1); }

.nav__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 40px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  width: 100%;
  border: 0;
  background: none;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease);
}

.nav__item svg { width: 20px; height: 20px; flex: none; }
.nav__item:hover { background: var(--color-card); color: var(--color-ink); }
.nav__item[aria-current="page"] { background: var(--color-card); color: var(--color-ink); font-weight: 600; }
.nav__item .badge { margin-left: auto; }
/* Steps inside My Research: shown slightly smaller and indented. */

/* Profile card: pinned to the bottom of the sidebar, like most apps.
   Picture centred on top, name below it, Log out below that, Settings as an icon in the top-right corner. */
.profile-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: var(--space-1);
  margin-top: auto;
  margin-bottom: var(--space-3); /* lifts the card a little off the bottom edge */
  padding: var(--space-4) var(--space-3) var(--space-3);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  background: var(--color-card);
  text-align: center;
}

.profile-card__name { max-width: 100%; margin-top: var(--space-2); font-size: var(--text-sm); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.profile-card__logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  min-height: 36px;
  margin-top: var(--space-3);
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  font: inherit;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-ink);
  cursor: pointer;
}
.profile-card__logout svg { width: 16px; height: 16px; flex: none; }
.profile-card__logout:hover { background: var(--color-accent-soft); border-color: var(--color-selected); }

.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-size: var(--text-xs);
  font-weight: 700;
}
.avatar--xl { width: 52px; height: 52px; font-size: var(--text-lg); }

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: min(300px, 86vw);
    transform: translateX(-100%);
    transition: transform var(--duration) var(--ease);
    box-shadow: var(--shadow-lg);
  }

  .sidebar.is-open { transform: translateX(0); }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgba(15, 23, 42, 0.35);
  }

  .sidebar-backdrop[hidden] { display: none; }
}

@media (min-width: 901px) {
  .sidebar-backdrop { display: none; }
}

/* Short screens: tighten the menu so the profile card still fits without scrolling. */
@media (min-width: 901px) and (max-height: 700px) {
  .sidebar { gap: var(--space-3); }
  .nav__item { min-height: 36px; }
  .profile-card { padding-top: var(--space-3); }
  .avatar--xl { width: 40px; height: 40px; font-size: var(--text-base); }
  .profile-card__logout { margin-top: var(--space-2); }
}

/* ---- components/button.css ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-5);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease),
    transform var(--duration-fast) var(--ease);
}

.btn:active { transform: translateY(1px); }

.btn svg { width: 18px; height: 18px; flex: none; }

.btn--primary { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-on-accent); box-shadow: 0 6px 18px rgba(15, 23, 42, 0.18); }
.btn--primary:hover { background: var(--color-accent-hover); box-shadow: 0 10px 26px rgba(15, 23, 42, 0.22); }

.btn--accent { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-on-accent); }
.btn--accent:hover { background: var(--color-accent-hover); }

.btn--secondary { background: var(--color-surface); border-color: var(--color-line-strong); color: var(--color-ink); }
.btn--secondary:hover { border-color: var(--color-selected); color: var(--color-royal); }

.btn--ghost { background: transparent; color: var(--color-text-muted); }
.btn--ghost:hover { background: var(--color-card); color: var(--color-ink); }

.btn--sm { min-height: 36px; padding: 0 var(--space-4); }
.btn--lg { min-height: 52px; padding: 0 var(--space-8); font-size: var(--text-base); }
.btn--block { width: 100%; }

.btn--icon { width: 44px; padding: 0; }
.btn--icon.btn--sm { width: 36px; }

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.btn.is-loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  color: var(--color-text);
  animation: btn-spin 0.7s linear infinite;
}

.btn--primary.is-loading::after,
.btn--accent.is-loading::after { color: var(--color-on-accent); }
.btn--secondary.is-loading::after { color: var(--color-ink); }

@keyframes btn-spin { to { transform: rotate(360deg); } }

/* ---- components/card.css ---- */
.card {
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
}

.card__title { font-size: var(--text-lg); font-weight: 600; }
.card__body { margin-top: var(--space-2); color: var(--color-text-muted); font-size: var(--text-sm); }

/* Large pathway / hero card */

/* The second hero card: white glass (the design system uses no black fills). */

/* Inline notice, e.g. "these are sample cards" */
.note {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-card);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* Empty state: tell the person what to do next */
.empty-state {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: var(--space-3);
  padding: var(--space-12) var(--space-6);
  text-align: center;
  border: 1px dashed var(--color-line-strong);
  border-radius: var(--radius-lg);
}

.empty-state p { color: var(--color-text-muted); font-size: var(--text-sm); }

/* ---- components/badge.css ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.2;
  background: var(--color-card);
  color: var(--color-text-muted);
}

.badge--green { background: var(--color-green-soft); color: var(--color-green); }
.badge--orange { background: var(--color-orange-soft); color: var(--color-orange); }

.badge--accent { background: var(--color-accent); color: var(--color-on-accent); }

.badge--count {
  min-width: 22px;
  justify-content: center;
  padding: 2px 7px;
  background: var(--color-accent);
  color: var(--color-on-accent);
}

/*
  Evidence chips: the six claim types from the client brief.
  Each one has its own icon shape AND a text label, so meaning never depends on color alone.
*/
.evidence {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 8px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.2;
}

.evidence::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: none;
  background: currentColor;
}

.evidence--observed { background: var(--color-green-soft); color: var(--color-green); }
.evidence--observed::before { border-radius: 50%; }

.evidence--bestseller { background: var(--color-accent); color: var(--color-on-accent); }
.evidence--bestseller::before { clip-path: polygon(50% 0, 100% 38%, 82% 100%, 18% 100%, 0 38%); }

.evidence--sales { background: var(--color-blue-soft); color: var(--color-blue); }
.evidence--sales::before { border-radius: 2px; }

.evidence--signal { background: var(--color-orange-soft); color: var(--color-orange); }
.evidence--signal::before { clip-path: polygon(50% 0, 100% 100%, 0 100%); }

.evidence--estimate { background: var(--color-card); color: var(--color-text-muted); border: 1px dashed var(--color-line-strong); }
.evidence--estimate::before { background: transparent; border: 2px solid currentColor; border-radius: 50%; }

.evidence--ai { background: var(--color-violet-soft); color: var(--color-violet); }
.evidence--ai::before { clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); width: 10px; height: 10px; }

/* ---- components/progress.css ---- */
.progress {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
}

/* Research progress: a vertical list of stages */
.stages { display: grid; gap: var(--space-3); }

.stage {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  font-size: var(--text-sm);
}

/* A stage that finished with part of its work skipped, e.g. a source that could not be read. */

/* A stage this student does not need, for example the profile on Pathway B. */

/* The stage the student is on now. No spinner: nothing is loading. */


/* ---- components/form.css ---- */
.field { display: grid; gap: var(--space-2); }

.label { font-size: var(--text-sm); font-weight: 600; }
.hint { font-size: var(--text-xs); color: var(--color-text-faint); }
.error-text { font-size: var(--text-xs); color: var(--color-red); font-weight: 500; }

.input,
.textarea,
.select {
  width: 100%;
  min-height: 48px;
  padding: 0 var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  transition: border-color var(--duration-fast) var(--ease);
}

.textarea {
  min-height: 120px;
  padding: var(--space-3) var(--space-4);
  resize: vertical;
  line-height: var(--leading-body);
}

.input::placeholder,
.textarea::placeholder { color: var(--color-text-faint); }

.input:hover,
.textarea:hover,
.select:hover { border-color: var(--color-selected); }

.input:focus-visible,
.textarea:focus-visible,
.select:focus-visible {
  border-color: var(--color-selected);
  box-shadow: 0 0 0 3px var(--color-accent-soft);
  border-radius: var(--radius-md);
}

.input[aria-invalid="true"],
.textarea[aria-invalid="true"] { border-color: var(--color-red); }

.search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-4);
  background: var(--color-card);
  border-radius: var(--radius-pill);
  color: var(--color-text-faint);
}

.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: var(--text-sm);
}

.search svg { width: 18px; height: 18px; flex: none; }

/* Selectable option row (checkbox / radio look) */
.choice {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  cursor: pointer;
}

.choice input { width: 18px; height: 18px; accent-color: var(--color-green); }
.choice:has(input:checked) { border-color: var(--color-selected); background: var(--color-accent-soft); }

/* Saving indicator for autosave */


/* ---- components/product-card.css ---- */
/*
  Product example card. Fields follow the client brief (section 4):
  title, preview, link, marketplace, observed price, format, evidence, customer/problem, relevance, original angle.
*/
.product-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
}

.product-card__preview {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--color-card);
  overflow: hidden;
}

.product-card__preview img { width: 100%; height: 100%; object-fit: cover; }

.product-card__placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: var(--space-4);
  text-align: center;
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  background: repeating-linear-gradient(135deg, var(--color-card), var(--color-card) 12px, #e2e8f0 12px, #e2e8f0 24px);
}

.product-card__save {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.product-card__save svg { width: 18px; height: 18px; }
.product-card__save[aria-pressed="true"] { background: var(--color-accent); color: var(--color-on-accent); }
.product-card__save[aria-pressed="true"] svg { fill: currentColor; }

.product-card__body { display: grid; gap: var(--space-3); padding: var(--space-5); flex: 1; }

.product-card__title { font-size: var(--text-base); font-weight: 600; line-height: var(--leading-snug); }

.product-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.product-card__chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }

.product-card__fact { font-size: var(--text-sm); color: var(--color-text-muted); }
.product-card__fact strong { color: var(--color-ink); font-weight: 600; }

.product-card__angle {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-accent-soft);
  font-size: var(--text-sm);
}

.product-card__footer {
  display: flex;
  gap: var(--space-2);
  padding: 0 var(--space-5) var(--space-5);
}

.product-card__footer .btn { flex: 1; }

.product-card__placeholder { align-content: center; gap: var(--space-1); }
.product-card__placeholder strong { font-size: var(--text-sm); color: var(--color-ink); }

/* A card opened from a link (Home, "View research") is highlighted. */
.product-card--target { outline: 3px solid var(--color-highlight); outline-offset: 3px; }

.product-card__stats { margin: var(--space-1) 0; padding-left: var(--space-4); }
.product-card__img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---- components/toast.css ---- */
.toast-region {
  position: fixed;
  left: 50%;
  bottom: var(--space-6);
  z-index: 100;
  display: grid;
  gap: var(--space-2);
  width: max-content;
  max-width: calc(100vw - var(--space-8));
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-pill);
  background: var(--button-glass);
  color: var(--color-text);
  border: 1px solid rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  font-size: var(--text-sm);
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toast-in var(--duration) var(--ease);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- components/chip.css ---- */
/* Tappable suggestion, e.g. an example answer. Use for choices that fill in a field. */
.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  font-size: var(--text-sm);
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease);
}

.chip:hover {
  border-color: var(--color-selected);
  background: var(--color-accent-soft);
}

/* Short filter label (category). Pill shape, filled when selected. */
.chip--pill { min-height: 36px; padding: 6px 14px; border-radius: var(--radius-pill); font-weight: 500; }
.chip[aria-pressed="true"] { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-on-accent); }

/* ---- components/next-card.css ---- */
/* Personalized next step: one clear, clickable recommendation */
.next-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--color-selected);
  border-radius: var(--radius-lg);
  background: var(--color-accent-soft);
  color: var(--color-ink);
  text-decoration: none;
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.next-card:hover { transform: translateY(-1px); box-shadow: var(--glass-shadow, 0 8px 24px rgba(15, 23, 42, 0.12)); }
.next-card__text { display: grid; gap: var(--space-1); min-width: 0; }
.next-card__eyebrow { font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-muted); }
.next-card__title { font-size: var(--text-lg); font-weight: 600; line-height: 1.3; }
.next-card__cta { flex: none; padding: var(--space-3) var(--space-5); border-radius: var(--radius-pill); background: var(--button-glass); color: var(--color-text); box-shadow: var(--button-glass-shadow); font-weight: 600; font-size: var(--text-sm); }
.next-card__cta::after { content: " \2192"; }
@media (max-width: 640px) { .next-card { flex-direction: column; align-items: stretch; } .next-card__cta { text-align: center; } }


/* Smaller version used at the top of the other pages */
.next-card--slim { margin: var(--space-4) 0 var(--space-5); padding: var(--space-3) var(--space-5); }
.next-card--slim .next-card__title { font-size: var(--text-base); }
div.next-card:hover { transform: none; box-shadow: none; }

/* ---- components/dialog.css ---- */
/* Pop-up editor (native <dialog>). Glass panel on a softly blurred backdrop. */


/* ---- components/glass.css ---- */
/* Transparent glass look for the whole app. Loaded last, so it restyles the surfaces defined in the other files.
   Three levels: panels (frosted white), small pieces on panels (lighter), dark panels.
   Falls back to solid colours where blur is not supported or when the person asks for less transparency. */

/* The coloured backdrop the glass sits on */
body { background-color: var(--color-bg); background-image: var(--backdrop); background-attachment: fixed; }
.app-shell, .app-main { background: transparent; }

/* 1. Panels */
.sidebar,
.topbar,
.card,
.stat,
.product-card,
.table-wrap,
.stage{
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border-color: var(--glass-edge);
  box-shadow: var(--glass-shadow);
}
.sidebar { border-right: 1px solid var(--glass-edge); box-shadow: 8px 0 30px rgba(15, 23, 42, 0.04); }
.topbar { border-bottom: 1px solid var(--glass-edge); box-shadow: 0 6px 24px rgba(15, 23, 42, 0.04); }
.sidebar, .topbar { background: rgba(255, 255, 255, 0.5); }

/* 2. Small pieces that sit on a panel */

.profile-card,
.topbar__actions,
.chip,
.search,
.btn--secondary,
.nav__item:hover,
.nav__item[aria-current="page"],
.badge,
.refine,
.feedback-item,
.note,
.empty-state,
.choice {
  background: var(--glass-bg-soft);
  -webkit-backdrop-filter: blur(10px) saturate(var(--glass-saturate));
  backdrop-filter: blur(10px) saturate(var(--glass-saturate));
  border-color: var(--glass-edge);
}
 .profile-card, .topbar__actions { box-shadow: var(--glass-shadow); border: 1px solid var(--glass-edge); }
.nav__item[aria-current="page"] { background: rgba(255, 255, 255, 0.85); box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06); }
.chip:hover, .btn--secondary:hover { background: var(--glass-bg-strong); }

/* Brand colours stay solid so they keep their meaning: navy emphasis and the current step.
   These come after the glass fills above, so a navy chip or badge never turns white with white text. */
.badge--accent, .badge--count, .chip[aria-pressed="true"], .evidence--bestseller { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-on-accent); }
.btn--primary, .btn--accent, .badge--accent, .avatar, .brand__mark, .msg__avatar { -webkit-backdrop-filter: none; backdrop-filter: none; }

/* 3. Dark panel */

/* Inputs stay easy to read */
.input, .textarea, .select { background: var(--glass-bg-strong); border-color: var(--glass-edge); }

/* Utility for new pages and the design-system page */

/* No blur support: use solid colours so text stays readable */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .sidebar, .topbar, .card, .stat, .product-card, .table-wrap, .stage{ background: var(--color-surface); }
   .profile-card, .topbar__actions, .chip, .search{ background: var(--color-card); }
  
}

/* The person asked their device for less transparency */
@media (prefers-reduced-transparency: reduce) {
  body { background-image: none; }
  .sidebar, .topbar, .card, .stat, .product-card, .table-wrap, .stage{ background: var(--color-surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
   .profile-card, .topbar__actions, .chip, .search, .btn--secondary, .badge{ background: var(--color-card); -webkit-backdrop-filter: none; backdrop-filter: none; }
  
}

/* ---- components/projects.css ---- */
/* Projects under "Ask Digiselvo" in the side menu (open, rename with the pen, new project). */
.nav-projects { display: grid; gap: 2px; margin: 0 0 var(--space-2) var(--space-6); padding-left: var(--space-2); border-left: 1px solid var(--color-line); }
.nav-projects__list { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.nav-project { display: flex; align-items: center; gap: 4px; min-height: 34px; padding: 0 4px 0 var(--space-2); border-radius: var(--radius-sm); }
.nav-project:hover, .nav-project:focus-within { background: var(--color-card); }
.nav-project.is-active { background: var(--color-card); }
.nav-project__link { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-sm); color: var(--color-text-muted); text-decoration: none; padding: 6px 0; }
.nav-project.is-active .nav-project__link { color: var(--color-ink); font-weight: 600; }
.nav-project__icon { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--color-text-muted); cursor: pointer; opacity: 0; transition: opacity var(--duration-fast) var(--ease); }
.nav-project:hover .nav-project__icon, .nav-project:focus-within .nav-project__icon, .nav-project__icon:focus-visible, .nav-project--new .nav-project__icon { opacity: 1; }
.nav-project__icon:hover { background: var(--color-bg); color: var(--color-ink); }
.nav-project__icon.is-danger:hover { color: var(--color-danger, #c0392b); }
.nav-project__input { flex: 1; min-width: 0; height: 30px; padding: 0 var(--space-2); font-size: var(--text-sm); }
.nav-project__add { display: flex; align-items: center; gap: var(--space-2); min-height: 34px; padding: 0 var(--space-2); border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--color-text-muted); font: inherit; font-size: var(--text-sm); cursor: pointer; text-align: left; }
.nav-project__add:hover { background: var(--color-card); color: var(--color-ink); }
@media (hover: none) { .nav-project__icon { opacity: 1; } }

