/* ================================================================
   GRADIS EXPERIENCE CENTRE — SHARED STYLES
   Palette: deep navy chrome, paper content, teal for live things.
   Type: Space Grotesk (display) / IBM Plex Sans (body) / Plex Mono
   (codes, confidence values, anything machine-made).
   ================================================================ */

:root {
  --navy-900: #121D33;
  --navy-800: #1B2A4A;
  --navy-700: #24365C;
  --teal-600: #0E7C7B;
  --teal-500: #14A09E;
  --teal-100: #DDF2F1;
  --paper:    #F5F7FA;
  --card:     #FFFFFF;
  --ink:      #1E2A3A;
  --ink-soft: #5A6B7F;
  --line:     #E2E8F0;
  --green:    #2E8B57;
  --green-bg: #E8F5EC;
  --amber:    #B87400;
  --amber-bg: #FFF4DE;
  --red:      #C6404A;
  --red-bg:   #FBEAEC;
  --radius:   10px;
  --shadow:   0 1px 3px rgba(18, 29, 51, .08), 0 8px 24px rgba(18, 29, 51, .07);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

h1, h2, h3, .display {
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  letter-spacing: -0.01em;
  margin: 0;
}

.mono { font-family: "IBM Plex Mono", ui-monospace, monospace; }

a { color: var(--teal-600); }

/* ── Top bar ──────────────────────────────────────────────────── */
.topbar {
  background: var(--navy-800);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 90;
}
.topbar .topbar-main {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  height: 60px;
}
.topbar .brand { display: flex; align-items: center; gap: 12px; }
.topbar .brand img { height: 28px; display: block; }
.topbar .brand span { margin-top: 9px; }
.topbar .topbar-sub {
  background: #14213C;
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  border-bottom: 4px solid #5CBA62;
}
.topbar .topbar-sub .crumb { font-size: .82rem; }
.topbar.mini .topbar-main { display: none; }
.topbar .topbar-sub .sub-actions {
  margin-left: auto; display: flex; gap: 8px; align-items: center;
}
.topbar .topbar-sub .sub-actions .btn {
  padding: 4px 11px; font-size: .74rem;
}
.topbar.mini .topbar-sub { min-height: 40px; }
.topbar .brand span {
  color: #5CBA62;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.08rem;
  font-weight: 600;
  white-space: nowrap;
}
.topbar .crumb { color: #B9C4D8; font-size: .9rem; }
.topbar .spacer { flex: 1; }
.topbar .who { color: #B9C4D8; font-size: .85rem; text-align: right; line-height: 1.3; }
.topbar .who strong { color: #fff; font-weight: 600; }

.btn {
  font: inherit;
  border: 0;
  border-radius: 8px;
  padding: 9px 16px;
  cursor: pointer;
  transition: filter .12s ease, transform .05s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: #5CBA62; color: #fff; font-weight: 600; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:disabled { background: #9DB3B2; cursor: default; }
.btn-ghost { background: transparent; color: #C7D2E4; border: 1px solid #3D4E73; }
.btn-ghost:hover { color: #fff; border-color: #6A7CA3; }
.btn-quiet { background: #EDF1F6; color: var(--ink); }
.btn-quiet:hover { filter: brightness(.97); }
.btn-danger-quiet { background: transparent; color: var(--red); border: 1px solid #EBC3C7; }

/* ── Page scaffolding ─────────────────────────────────────────── */
.wrap { max-width: 1280px; margin: 0 auto; padding: 26px 22px 60px; }
.page-title { font-size: 1.9rem; margin-bottom: 6px; }
.page-sub { color: var(--ink-soft); margin: 0 0 26px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ── Live dot — the "this is really happening" signature ─────── */
.live {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: "IBM Plex Mono", monospace;
  font-size: .72rem; letter-spacing: .08em; color: var(--teal-600);
}
.live::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--teal-500);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(20, 160, 158, .45); }
  55%      { box-shadow: 0 0 0 7px rgba(20, 160, 158, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .live::before { animation: none; }
  * { transition: none !important; }
}

/* ── Login ────────────────────────────────────────────────────── */
.login-shell {
  min-height: 100vh;
  display: grid; place-items: center;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(20,160,158,.16), transparent 60%),
    var(--navy-900);
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 430px;
  background: var(--card); border-radius: 14px;
  padding: 38px 36px 34px; box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.login-card .brandline {
  font-family: "Space Grotesk", sans-serif; font-weight: 700;
  font-size: 1.15rem; margin-bottom: 2px;
}
.login-card .brandline span { color: #5CBA62; }
.login-card p { color: var(--ink-soft); margin: 6px 0 24px; }
.code-input {
  width: 100%;
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.45rem; letter-spacing: .12em; text-align: center;
  text-transform: uppercase;
  padding: 14px 10px;
  border: 2px solid var(--line); border-radius: var(--radius);
  outline: none; transition: border-color .15s;
}
.code-input:focus { border-color: var(--teal-500); }
.login-error {
  background: var(--red-bg); color: var(--red);
  border-radius: 8px; padding: 10px 14px; font-size: .9rem;
  margin-top: 14px; display: none;
}
.login-hint { color: var(--ink-soft); font-size: .82rem; margin-top: 18px; }

/* ── Landing tiles ────────────────────────────────────────────── */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.tile {
  padding: 22px 22px 18px;
  display: flex; flex-direction: column; gap: 8px;
  text-decoration: none; color: inherit;
  position: relative;
  transition: transform .12s ease, box-shadow .12s ease;
}
.tile.enabled:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(18,29,51,.1), 0 14px 34px rgba(18,29,51,.12); }
.tile .t-num {
  font-family: "IBM Plex Mono", monospace;
  color: var(--teal-600); font-size: .78rem; letter-spacing: .06em;
}
.tile h3 { font-size: 1.08rem; }
.tile p { margin: 0; color: var(--ink-soft); font-size: .9rem; flex: 1; }
.tile .badge {
  position: absolute; top: 18px; right: 18px;
  font-size: .68rem; font-family: "IBM Plex Mono", monospace;
  letter-spacing: .07em; padding: 3px 9px; border-radius: 99px;
}
.badge-live { background: var(--teal-100); color: var(--teal-600); }
.badge-soon { background: #EDF1F6; color: var(--ink-soft); }
.tile.disabled { opacity: .62; }

/* ── Demo page: three panels ─────────────────────────────────── */
.demo-grid {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}
@media (max-width: 1020px) { .demo-grid { grid-template-columns: 1fr; } }

.panel { padding: 20px; }
.panel-label {
  font-family: "IBM Plex Mono", monospace;
  font-size: .95rem; font-weight: 600; letter-spacing: .09em;
  color: var(--navy-800);
  margin-bottom: 14px;
}

/* narrative steps */
.steps { display: flex; flex-direction: column; gap: 2px; }
.step {
  display: flex; gap: 10px; align-items: baseline;
  padding: 7px 8px; border-radius: 8px;
  color: #9AA8BC; font-size: .92rem;
  transition: background .2s, color .2s;
}
.step .dot {
  width: 10px; height: 10px; border-radius: 50%; flex: none;
  border: 2px solid #C2CCDA; transform: translateY(1px);
  transition: all .2s;
}
.step.active { color: var(--ink); background: var(--teal-100); }
.step.active .dot { border-color: var(--teal-500); background: #fff; }
.step.done { color: var(--ink); }
.step.done .dot { border-color: var(--teal-600); background: var(--teal-600); }
.steps-note { color: var(--ink-soft); font-size: .8rem; font-style: italic; margin-top: 16px; }

/* centre demo */
textarea.review-box {
  width: 100%; min-height: 96px; resize: vertical;
  font: inherit; padding: 13px 14px;
  border: 2px solid var(--line); border-radius: var(--radius);
  outline: none;
}
textarea.review-box:focus { border-color: var(--teal-500); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 16px; }
.chip {
  font-size: .8rem; padding: 6px 12px; border-radius: 99px;
  background: #EDF1F6; border: 0; cursor: pointer; color: var(--ink-soft);
}
.chip:hover { background: var(--teal-100); color: var(--teal-600); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

.result {
  margin-top: 18px; border-radius: var(--radius);
  border: 1px solid var(--line); padding: 16px 18px;
  display: none; animation: rise .25s ease;
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.result .pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.pill {
  font-size: .78rem; font-weight: 600; padding: 4px 12px; border-radius: 99px;
}
.pill-positive { background: var(--green-bg); color: var(--green); }
.pill-negative { background: var(--red-bg); color: var(--red); }
.pill-mixed    { background: var(--amber-bg); color: var(--amber); }
.pill-neutral  { background: #EDF1F6; color: var(--ink-soft); }
.pill-topic    { background: var(--teal-100); color: var(--teal-600); }
.pill-urgency-high   { background: var(--red-bg); color: var(--red); }
.pill-urgency-medium { background: var(--amber-bg); color: var(--amber); }
.pill-urgency-low    { background: #EDF1F6; color: var(--ink-soft); }

.conf-row { display: flex; align-items: center; gap: 10px; font-size: .85rem; color: var(--ink-soft); }
.conf-track { flex: 1; height: 6px; background: #EDF1F6; border-radius: 99px; overflow: hidden; }
.conf-fill { height: 100%; width: 0; background: var(--teal-500); border-radius: 99px; transition: width .6s ease; }
.conf-val { font-family: "IBM Plex Mono", monospace; color: var(--ink); }

.suggested {
  margin-top: 14px; padding: 12px 14px; border-radius: 8px;
  background: var(--paper); border-left: 3px solid var(--teal-500);
  font-size: .9rem; display: none;
}
.suggested .s-label {
  font-family: "IBM Plex Mono", monospace; font-size: .68rem;
  letter-spacing: .08em; color: var(--teal-600); display: block; margin-bottom: 5px;
}

/* dashboard */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpi { background: var(--paper); border-radius: 8px; padding: 12px 12px 10px; }
.kpi .k-label { font-size: .72rem; color: var(--ink-soft); }
.kpi .k-value {
  font-family: "Space Grotesk", sans-serif; font-weight: 700;
  font-size: 1.45rem; line-height: 1.2;
}
.kpi.bumped { animation: bump .5s ease; }
@keyframes bump { 30% { background: var(--teal-100); } }

.topics { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.topic-row { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: .8rem; }
.topic-row .t-name { color: var(--ink-soft); text-transform: capitalize; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topic-row .t-track { height: 7px; background: #EDF1F6; border-radius: 99px; overflow: hidden; }
.topic-row .t-fill { height: 100%; background: var(--navy-700); border-radius: 99px; transition: width .5s ease; }
.topic-row .t-count { font-family: "IBM Plex Mono", monospace; text-align: right; color: var(--ink); white-space: nowrap; }

/* pipeline page: region rows carry longer names and £ amounts */
#regions .topic-row { grid-template-columns: 96px minmax(0, 1fr) auto; }
#regions .t-count { font-size: .78rem; }

.feed { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.feed-item {
  display: flex; gap: 9px; font-size: .8rem; color: var(--ink-soft);
  padding: 7px 9px; background: var(--paper); border-radius: 8px;
}
.feed-item .f-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; margin-top: 5px; }
.f-positive { background: var(--green); }
.f-negative { background: var(--red); }
.f-mixed    { background: var(--amber); }
.f-neutral  { background: #A9B6C6; }
.feed-item .f-text { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* under the hood */
.hood { margin-top: 18px; }
.hood summary {
  cursor: pointer; list-style: none;
  font-family: "IBM Plex Mono", monospace; font-size: .95rem;
  font-weight: 600; letter-spacing: .09em; color: var(--navy-800);
  padding: 13px 18px;
}
.hood summary::before { content: "▸ "; color: var(--teal-600); }
.hood[open] summary::before { content: "▾ "; }
.hood-body { padding: 0 18px 16px; color: var(--ink-soft); font-size: .9rem; }
.hood-body .stack { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.hood-body .stack span {
  font-family: "IBM Plex Mono", monospace; font-size: .74rem;
  background: var(--paper); border: 1px solid var(--line);
  padding: 5px 10px; border-radius: 6px; color: var(--ink);
}

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: var(--navy-800); color: #fff; font-size: .9rem;
  padding: 11px 20px; border-radius: 99px; opacity: 0;
  transition: opacity .25s, transform .25s; pointer-events: none;
  box-shadow: 0 10px 30px rgba(0,0,0,.3);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* admin */
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 860px) { .admin-grid { grid-template-columns: 1fr; } }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: .82rem; color: var(--ink-soft); margin-bottom: 5px; }
.form-row input {
  width: 100%; font: inherit; padding: 10px 12px;
  border: 2px solid var(--line); border-radius: 8px; outline: none;
}
.form-row input:focus { border-color: var(--teal-500); }
table.codes { width: 100%; border-collapse: collapse; font-size: .85rem; }
table.codes th {
  text-align: left; color: var(--ink-soft); font-weight: 500; font-size: .75rem;
  padding: 8px 10px; border-bottom: 1px solid var(--line);
}
table.codes td { padding: 9px 10px; border-bottom: 1px solid var(--line); }
table.codes .copy { cursor: pointer; }


/* ── Site footer — contact GRADIS ────────────────────────────── */
.site-footer {
  margin-top: 48px;
  background: var(--navy-800);
  border-top: 4px solid #5CBA62;
  color: #B9C4D8;
  font-size: .84rem;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  text-align: center;
}
.site-footer a { color: #fff; text-decoration: none; font-weight: 600; }
.site-footer a:hover { color: #5CBA62; }
.site-footer .f-sep { color: #3D4E73; }


/* ── Floating "next experience" button ───────────────────────── */
.next-xp {
  position: fixed; right: 64px; z-index: 80;
  overflow: hidden;
  font: inherit; font-size: .95rem; font-weight: 600;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px; cursor: pointer;
  background: #5CBA62; color: #fff;
  border: 1px solid var(--navy-800);
  box-shadow: 0 3px 12px rgba(15, 40, 80, .18);
  transition: top .25s ease, opacity .2s ease, filter .12s ease;
}
.next-xp:hover { filter: brightness(1.08); }
/* A single faint light-reflection sweep on hover */
.next-xp::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -60%;
  width: 40%; pointer-events: none;
  background: linear-gradient(105deg,
    transparent 0%, rgba(255,255,255,.16) 45%,
    rgba(255,255,255,.26) 50%, rgba(255,255,255,.16) 55%, transparent 100%);
  transform: skewX(-18deg); opacity: 0;
}
.next-xp:hover::after { animation: pillsheen .7s ease-out 1; }
@keyframes pillsheen {
  from { left: -60%; opacity: 1; }
  to   { left: 130%; opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .next-xp:hover::after { animation: none; } }
.next-xp.locked { opacity: .45; }
.next-xp.locked:hover { filter: none; }
.prev-xp { right: auto; left: 64px; }
@media (max-width: 700px) { .next-xp { right: 10px; font-size: .82rem; padding: 8px 14px; }
  .prev-xp { right: auto; left: 10px; } }


/* ── Benefit / inefficiency lists (numbered coloured circles) ── */
.wins ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 15px; }
.wins li { display: flex; gap: 14px; align-items: flex-start;
           font-size: 1.06rem; font-weight: 600; color: var(--ink);
           line-height: 1.55; max-width: 1000px; }
.wins .bn { flex: none; width: 30px; height: 30px; border-radius: 50%;
            background: #5CBA62; color: #fff; display: flex; align-items: center;
            justify-content: center; font-size: .92rem; font-weight: 700; margin-top: 1px; }

/* ── THE BUSINESS VALUE — bold title + supporting value line ── */
.wins .w-body { display: block; }
.wins .w-t { display: block; font-weight: 700; }
.wins .w-p { display: block; font-weight: 500; font-size: .97rem;
             color: var(--ink-soft); line-height: 1.5; margin-top: 3px; }

/* ── THE BUSINESS VALUE — collapsible (matches Under the hood) + navy-outlined circles ── */
details.panel > summary.panel-label { cursor: pointer; list-style: none; margin-bottom: 0; }
details.panel > summary.panel-label::-webkit-details-marker { display: none; }
details.panel > summary.panel-label::before { content: "▸ "; color: var(--teal-600); }
details.panel[open] > summary.panel-label::before { content: "▾ "; }
details.panel[open] > summary.panel-label { margin-bottom: 14px; }
.wins .bn { border: 2px solid var(--navy-800); }

/* ── THE BUSINESS VALUE — navy circles with green ticks ── */
details.wins .bn { background: #fff; color: #5CBA62; font-size: 1.02rem; }
