﻿/* ── Design tokens ────────────────────────────────────────────────────────── */
:root {
    /* Surfaces */
    --bg:          #F7F8FB;
    --surface:     #FFFFFF;
    --surface-2:   #F0F2F7;

    /* Ink — Perceptence navy hsl(222 47% 11%) */
    --ink:         #0F1729;
    --ink-700:     #1E3050;
    --ink-500:     #4A5875;
    --ink-400:     #6B7A96;
    --ink-300:     #A0ABBC;
    --ink-100:     #DDE3ED;

    /* Terracotta — the signature accent */
    --tc:          #C2522E;
    --tc-dark:     #A3431F;
    --tc-light:    #FEF2EE;
    --tc-mid:      #F9D5CA;

    /* Utility */
    --border:      #DDE3ED;
    --green:       #15803D;
    --green-lt:    #DCFCE7;
    --amber:       #B45309;
    --amber-lt:    #FEF3C7;
    --red-lt:      #FEE2E2;
    --red:         #991B1B;

    /* Shape */
    --r-sm:  6px;
    --r-md:  10px;
    --r-lg:  18px;
    --r-xl:  28px;
    --r-pill: 999px;

    /* Shadow */
    --sh-xs: 0 1px 2px rgb(0 0 0 / .05);
    --sh-sm: 0 1px 4px rgb(0 0 0 / .07), 0 1px 2px rgb(0 0 0 / .04);
    --sh-md: 0 4px 12px rgb(0 0 0 / .07), 0 1px 3px rgb(0 0 0 / .04);
    --sh-lg: 0 12px 32px rgb(0 0 0 / .08), 0 2px 8px rgb(0 0 0 / .04);
}

/* ── Base ─────────────────────────────────────────────────────────────────── */
html { font-size: 16px; }

body {
    font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--ink);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* Display serif — used for hero and large headlines only */
.serif {
    font-family: 'DM Serif Display', Georgia, serif;
    font-weight: 400;
}

h1, h2 { font-family: 'DM Serif Display', Georgia, serif; font-weight: 400; color: var(--ink); }
h3, h4, h5, h6 { font-family: 'DM Sans', sans-serif; font-weight: 600; color: var(--ink); }

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--ink-700); }

/* ── Navbar ───────────────────────────────────────────────────────────────── */
.site-nav {
    background: var(--surface) !important;
    border-bottom: 1px solid var(--border) !important;
    padding: 0;
    min-height: 64px;
}

.site-nav .navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 0;
    text-decoration: none;
}

.site-nav .brand-mark {
    width: 54px;
    height: 54px;
    background: var(--ink);
    border-radius: 0 12px 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.site-nav .brand-mark svg {
    width: 25px;
    height: 25px;
}

.site-nav .brand-word {
    display: flex;
    flex-direction: column;
    line-height: 1;
    gap: 6px;
}

.site-nav .brand-word-top {
    font-family: 'DM Serif Display', serif;
    font-style: italic;
    font-size: 2.5rem;
    color: var(--ink);
    letter-spacing: -0.025em;
    line-height: 1;
}

.site-nav .brand-word-bot {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--tc);
    letter-spacing: 0.32em;
    text-transform: uppercase;
    line-height: 1;
}

.site-nav .nav-link {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--ink-500) !important;
    padding: 1rem 0.8rem !important;
    transition: color 0.12s;
}

.site-nav .nav-link:hover { color: var(--ink) !important; }

.site-nav .dropdown-menu {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--sh-lg);
    padding: 0.35rem;
    min-width: 210px;
}

.site-nav .dropdown-item {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.875rem;
    color: var(--ink-700);
    border-radius: var(--r-sm);
    padding: 0.5rem 0.8rem;
}

.site-nav .dropdown-item:hover { background: var(--bg); color: var(--ink); }
.site-nav .dropdown-divider { border-color: var(--border); margin: 0.25rem 0; }

.site-nav .user-chip {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--ink-500) !important;
    font-size: 0.875rem;
}

.site-nav .avatar {
    width: 30px;
    height: 30px;
    background: var(--tc-light);
    border: 1.5px solid var(--tc-mid);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--tc-dark);
    flex-shrink: 0;
}

/* ── Current-organisation chip (navbar) ───────────────────────────────────────
   Always-visible answer to "which org am I signed into?". Client orgs get the
   quiet outlined pill; the platform org gets the unmissable inverted chip with
   the brand mark + PLATFORM tag, so a superadmin can't mistake a client tenant
   for Perceptence itself. */
.org-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    max-width: 260px;
    padding: 0.3rem 0.75rem;
    margin-right: 0.6rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ink-700);
    white-space: nowrap;
}

.org-chip-icon { width: 13px; height: 13px; color: var(--ink-300); flex-shrink: 0; }

.org-chip-name {
    overflow: hidden;
    text-overflow: ellipsis;
}

.org-chip-platform {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
}

.org-chip-mark {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.org-chip-mark svg { width: 14px; height: 14px; }

.org-chip-tag {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.59375rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #fff;
    background: var(--tc);
    border-radius: 999px;
    padding: 0.14rem 0.5rem;
    flex-shrink: 0;
}

@media (max-width: 575.98px) {
    .org-chip { margin: 0.35rem 0; }
}

.navbar-toggler { border-color: var(--border) !important; }
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%230F1729' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    border-radius: 0 var(--r-xl) 0 var(--r-xl);
    font-size: 0.9375rem;
    padding: 0.45rem 1.4rem;
    transition: all 0.14s ease;
    letter-spacing: -0.01em;
}
.btn-sm { padding: 0.3rem 1rem; }
.btn-lg { padding: 0.65rem 2rem; }

/* Primary — ink-black pill */
.btn-primary,
.btn-warning {
    background: var(--ink) !important;
    color: #fff !important;
    border: none !important;
}

.btn-primary:hover,
.btn-warning:hover {
    background: var(--ink-700) !important;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgb(15 23 41 / .2);
}

.btn-primary:focus,
.btn-warning:focus { color: #fff !important; box-shadow: 0 0 0 3px rgb(15 23 41 / .15) !important; }

/* Terracotta — for highlighted CTAs */
.btn-tc {
    background: var(--tc);
    color: #fff;
    border: none;
}

.btn-tc:hover {
    background: var(--tc-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgb(194 82 46 / .3);
}

/* Ghost */
.btn-ghost {
    background: transparent;
    color: var(--ink-500);
    border: 1.5px solid var(--border);
}

.btn-ghost:hover {
    background: var(--surface-2);
    color: var(--ink);
    border-color: var(--ink-100);
}

/* Outline secondary */
.btn-outline-secondary {
    color: var(--ink-700);
    border: 1.5px solid var(--border);
    background: transparent;
}

.btn-outline-secondary:hover {
    background: var(--surface-2) !important;
    color: var(--ink) !important;
    border-color: var(--ink-100) !important;
}

/* Outline action buttons — quiet by default, soft tinted fill on hover.
   Stops the raw Bootstrap solid-colour hover from clashing with the palette. */
.btn-outline-success {
    color: var(--green); border: 1.5px solid #BBF7D0; background: transparent;
}
.btn-outline-success:hover {
    background: var(--green-lt) !important; color: var(--green) !important; border-color: #86EFAC !important;
}
.btn-outline-warning {
    color: var(--amber); border: 1.5px solid #FDE68A; background: transparent;
}
.btn-outline-warning:hover {
    background: var(--amber-lt) !important; color: var(--amber) !important; border-color: #FCD34D !important;
}
.btn-outline-danger {
    color: var(--red); border: 1.5px solid #FECACA; background: transparent;
}
.btn-outline-danger:hover {
    background: var(--red-lt) !important; color: var(--red) !important; border-color: #FCA5A5 !important;
}

.btn-link { color: var(--ink-500); }
.btn-link:hover { color: var(--ink); }

.btn:focus, .btn:active:focus,
.form-control:focus, .form-check-input:focus, .form-select:focus {
    box-shadow: 0 0 0 3px rgb(194 82 46 / .18) !important;
    outline: none;
}

/* ── Forms ────────────────────────────────────────────────────────────────── */
.form-control, .form-select {
    font-family: 'DM Sans', sans-serif;
    border-color: var(--border);
    border-radius: var(--r-md);
    font-size: 0.9375rem;
    color: var(--ink);
    background-color: var(--surface);
    transition: border-color 0.14s, box-shadow 0.14s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--tc);
    color: var(--ink);
    background-color: var(--surface);
}

.form-label {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--ink-700);
    margin-bottom: 0.4rem;
}

.form-text { font-size: 0.8125rem; color: var(--ink-300); }

/* ── Invalid field state ──────────────────────────────────────────────────
   Uses the danger crimson #B42318 (NOT brand terracotta) so an error field is
   visibly distinct from a normal focused/branded control. ASP.NET stamps
   .input-validation-error on the bound control automatically. */
.form-control.input-validation-error,
.form-control.input-validation-error:hover {
    border-color: #B42318 !important;
    background-color: #FEF3F2;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M10 2.5 18.5 17H1.5L10 2.5Z' stroke='%23B42318' stroke-width='1.5' stroke-linejoin='round'/%3E%3Cpath d='M10 8v3.4' stroke='%23B42318' stroke-width='1.6' stroke-linecap='round'/%3E%3Ccircle cx='10' cy='14.2' r='0.9' fill='%23B42318'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem top 0.7rem;
    padding-right: 2.4rem;
}
.form-control.input-validation-error:focus {
    border-color: #B42318 !important;
    box-shadow: 0 0 0 3px rgb(180 35 24 / .18) !important;
}
textarea.form-control.input-validation-error { animation: field-attn .4s ease; }

@keyframes field-attn {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-4px); }
    60%      { transform: translateX(3px); }
    80%      { transform: translateX(-2px); }
}
@media (prefers-reduced-motion: reduce) {
    textarea.form-control.input-validation-error { animation: none; }
}

/* Label of the offending group turns danger to anchor the eye */
.field-invalid .section-label { color: #B42318; }

.field-validation-error { color: #B42318; font-weight: 500; }

.form-check-input:checked { background-color: var(--tc); border-color: var(--tc); }

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border-color: var(--border) !important;
    border-radius: var(--r-lg) !important;
}

.card-header {
    border-radius: var(--r-lg) var(--r-lg) 0 0 !important;
    font-size: 0.875rem;
    font-family: 'DM Sans', sans-serif;
}

/* ── Selection cards ──────────────────────────────────────────────────────── */
.mode-card, .framework-card, .voice-card {
    cursor: pointer;
    border-color: var(--border) !important;
    border-radius: var(--r-lg) !important;
    background: var(--surface);
    transition: border-color 0.14s, box-shadow 0.14s;
}

.mode-card:hover, .framework-card:hover, .voice-card:hover {
    border-color: var(--ink-300) !important;
    box-shadow: var(--sh-sm);
}

/* Selected uses green, NOT terracotta — keeps the warm red family reserved for
   error/danger so selection never reads as a fault. */
.mode-card.selected, .framework-card.selected, .voice-card.selected {
    border-color: var(--green) !important;
    background: #ECFAF1 !important;
    box-shadow: 0 0 0 3px rgb(21 128 61 / .15);
}

.mode-card.selected .form-check-input:checked,
.framework-card.selected .form-check-input:checked,
.voice-card.selected .form-check-input:checked {
    background-color: var(--green) !important;
    border-color: var(--green) !important;
}

/* ── Badges & pills ───────────────────────────────────────────────────────── */
.badge {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 0.72rem;
    border-radius: var(--r-sm);
    letter-spacing: 0.01em;
}

.badge.bg-success { background: var(--green-lt) !important; color: var(--green) !important; }
.badge.bg-warning, .badge.bg-warning.text-dark { background: var(--amber-lt) !important; color: var(--amber) !important; }
.badge.bg-secondary { background: var(--surface-2) !important; color: var(--ink-500) !important; }
.badge.bg-info, .badge.bg-info.text-dark { background: var(--tc-light) !important; color: var(--tc-dark) !important; }
.badge.bg-light, .badge.bg-light.text-dark { background: var(--surface-2) !important; color: var(--ink-500) !important; border-color: var(--border) !important; }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.65rem;
    border-radius: var(--r-pill);
    font-size: 0.72rem;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    letter-spacing: 0.01em;
}

.pill.tc    { background: var(--tc-light); color: var(--tc-dark); }
.pill.green { background: var(--green-lt); color: var(--green); }
.pill.amber { background: var(--amber-lt); color: var(--amber); }
.pill.slate { background: var(--surface-2); color: var(--ink-500); }
.pill.violet { background: #EDE9FE; color: #5B21B6; }
.pill.coral { background: var(--tc-light); color: var(--tc-dark); }

/* ── Tables ───────────────────────────────────────────────────────────────── */
.table { font-family: 'DM Sans', sans-serif; color: var(--ink-700); font-size: 0.9375rem; }
.table th { font-weight: 600; font-size: 0.78125rem; text-transform: none; letter-spacing: 0; color: var(--ink-500); border-bottom-color: var(--border); }
.table td { border-color: var(--surface-2); vertical-align: middle; }

/* Soft branded hover instead of Bootstrap's flat grey. Override Bootstrap's
   per-cell accent variables so the tint actually lands on every column. */
.table { --bs-table-hover-bg: var(--tc-light); --bs-table-hover-color: var(--ink); }
.table-hover > tbody > tr { transition: background-color 0.12s ease; }
.table-hover > tbody > tr:hover > * {
    background-color: var(--tc-light);
    color: var(--ink);
    box-shadow: none;
}

/* Disabled / inactive rows: a quiet neutral wash, not the harsh default grey. */
.table > tbody > tr.table-secondary > *,
.table > tbody > tr.table-secondary {
    --bs-table-bg: var(--bg);
    background-color: var(--bg) !important;
    color: var(--ink-400) !important;
}
.table-hover > tbody > tr.table-secondary:hover > * {
    background-color: var(--tc-light) !important;
    color: var(--ink) !important;
}

/* Consistent header across all admin tables — no grey band, regardless of .table-light. */
.table-light,
.table > thead.table-light th,
.table > thead > tr > th {
    --bs-table-bg: var(--surface);
    background-color: var(--surface);
    border-bottom-color: var(--border);
}

/* ── Admin tables ──────────────────────────────────────────────── */
[data-admin-table] thead th[data-sort]:hover { background: rgba(0,0,0,.04); }
[data-admin-table] thead th.admin-sort-active { color: var(--primary); }
.admin-sort-chevron { font-size: 0.75em; opacity: 0.5; }
[data-admin-table] thead th.admin-sort-active .admin-sort-chevron { opacity: 1; }
.admin-table-filter { max-width: 320px; }

/* ── Alerts ───────────────────────────────────────────────────────────────── */
.alert { border-radius: var(--r-md); font-family: 'DM Sans', sans-serif; font-size: 0.9375rem; border: 1px solid; }
.alert-danger { background: var(--red-lt); color: var(--red); border-color: #FECACA; }
.alert-success { background: var(--green-lt); color: var(--green); border-color: #BBF7D0; }
.alert-info { background: var(--tc-light); color: var(--tc-dark); border-color: var(--tc-mid); }

/* ── List group ───────────────────────────────────────────────────────────── */
.list-group-item { border-color: var(--surface-2); color: var(--ink-700); font-family: 'DM Sans', sans-serif; }
.list-group-item:first-child { border-top: none; }

/* ── Start-path chooser (New simulation / Browse / Custom) ─────────────────── */
.start-paths { margin-bottom: 2.5rem; }
.start-path-card {
    display: flex; flex-direction: column; height: 100%;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-lg); padding: 1.35rem 1.5rem 1.3rem;
    text-decoration: none; transition: box-shadow .15s, border-color .15s, transform .15s;
}
.start-path-card:hover { box-shadow: var(--sh-md); border-color: var(--ink-100); transform: translateY(-2px); }
.start-path-num {
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--ink-300); margin-bottom: 0.75rem;
}
.start-path-title {
    font-family: 'DM Serif Display', serif; font-size: 1.15rem; color: var(--ink);
    line-height: 1.2; margin-bottom: 0.35rem;
}
.start-path-desc { font-size: 0.85rem; color: var(--ink-500); line-height: 1.5; margin-bottom: 1.1rem; }
.start-path-cta { margin-top: auto; font-weight: 600; font-size: 0.875rem; color: var(--tc); }
.start-path-card:hover .start-path-cta { color: var(--tc-dark); }
/* Current page = dark, highlighted, non-interactive */
.start-path-card.is-current { background: var(--ink); border-color: var(--ink); cursor: default; }
.start-path-card.is-current:hover { transform: none; box-shadow: none; }
.start-path-card.is-current .start-path-num { color: rgba(255,255,255,0.4); }
.start-path-card.is-current .start-path-title { color: #fff; }
.start-path-card.is-current .start-path-desc { color: rgba(255,255,255,0.62); }
.start-path-card.is-current .start-path-cta { color: var(--tc); }

/* ── Typography helpers ───────────────────────────────────────────────────── */
.page-headline {
    font-family: 'DM Serif Display', Georgia, serif;
    font-weight: 400;
    font-size: 1.875rem;
    color: var(--ink);
    letter-spacing: -0.025em;
    line-height: 1.15;
    margin-bottom: 0;
}

.page-sub {
    font-family: 'DM Sans', sans-serif;
    color: var(--ink-500);
    font-size: 1rem;
    font-weight: 400;
    margin-bottom: 0;
}

.section-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-300);
    margin-bottom: 0.85rem;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.site-footer {
    flex-shrink: 0;
    background: var(--ink);
    color: rgba(255,255,255,0.75);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.875rem;
    padding: 4rem 0 0;
    margin-top: 5rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr;
    gap: 3rem;
    padding-bottom: 3rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.footer-brand-mark {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.09);
    border-radius: 0 10px 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.08);
}

.footer-brand-mark svg { width: 20px; height: 20px; }

.footer-brand-word {
    display: flex;
    flex-direction: column;
    line-height: 1;
    gap: 4px;
}

.footer-brand-top {
    font-family: 'DM Serif Display', serif;
    font-style: italic;
    font-size: 1.75rem;
    color: #fff;
    letter-spacing: -0.025em;
    line-height: 1;
}

.footer-brand-bot {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.0rem;
    color: var(--tc);
    letter-spacing: 0.32em;
    text-transform: uppercase;
    line-height: 1;
}

.footer-tagline {
    font-size: 0.9rem;
    line-height: 1.65;
    color: rgba(255,255,255,0.42);
    margin: 0;
    max-width: 290px;
}

.footer-col-head {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.28);
    margin-bottom: 1.1rem;
}

.footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.footer-links a {
    color: rgba(255,255,255,0.56);
    font-size: 0.875rem;
    transition: color 0.12s;
}

.footer-links a:hover { color: #fff; }

.footer-trust {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-trust li {
    color: rgba(255,255,255,0.48);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.footer-trust-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--tc);
    flex-shrink: 0;
    opacity: 0.75;
}

.footer-divider {
    height: 1px;
    background: rgba(255,255,255,0.07);
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1.5rem 0;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.28);
}

.footer-bottom-tagline {
    font-family: 'DM Serif Display', serif;
    font-style: italic;
    font-size: 0.875rem;
    color: rgba(255,255,255,0.32);
}

@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
    .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* ── LANDING PAGE ─────────────────────────────────────────────────────────── */

/* Hero — asymmetric 2-col layout */
.hero-wrap {
    padding: 4rem 0 5rem;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--tc);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 1.25rem;
}

.hero-eyebrow-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--tc);
    flex-shrink: 0;
}

.hero-h1 {
    font-family: 'DM Serif Display', Georgia, serif;
    font-weight: 400;
    font-size: clamp(2.5rem, 5.5vw, 3.75rem);
    line-height: 1.08;
    letter-spacing: -0.035em;
    color: var(--ink);
    margin-bottom: 1.5rem;
}

.hero-h1 em {
    font-style: italic;
    color: var(--tc);
}

.hero-body {
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--ink-500);
    max-width: 420px;
    margin-bottom: 2rem;
}

.hero-body strong { color: var(--ink); font-weight: 500; }

/* Dictionary-entry treatment for the hero definition */
.hero-def {
    max-width: 420px;
    margin-bottom: 2rem;
    padding-left: 1.125rem;
    border-left: 2px solid var(--tc);
}

.hero-def-head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.625rem;
    margin-bottom: 0.5rem;
}

.hero-def-word {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 1.5rem;
    line-height: 1.1;
    color: var(--ink);
    letter-spacing: -0.02em;
}

.hero-def-pron {
    font-family: Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-size: 1rem;
    color: var(--ink-500);
}

.hero-def-pos {
    font-style: italic;
    font-size: 0.875rem;
    color: var(--tc);
}

.hero-def-gloss {
    font-size: 0.9375rem;
    line-height: 1.65;
    color: var(--ink-500);
    margin: 0;
}

/* Hero entrance — staggered fade-rise on load */
.reveal {
    opacity: 0;
    transform: translateY(14px);
    animation: hero-reveal 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.hero-copy .reveal:nth-child(1) { animation-delay: 0.05s; }
.hero-copy .reveal:nth-child(2) { animation-delay: 0.14s; }
.hero-copy .reveal:nth-child(3) { animation-delay: 0.23s; }
.hero-copy .reveal:nth-child(4) { animation-delay: 0.32s; }
.hero-copy .reveal:nth-child(5) { animation-delay: 0.46s; }

@keyframes hero-reveal {
    to { opacity: 1; transform: translateY(0); }
}

/* Live-AI typing demo under the hero CTAs */
.hero-demo {
    margin-top: 2rem;
    padding: 0.9rem 1.1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 2px solid var(--tc);
    border-radius: var(--r-md);
    max-width: 460px;
}

.hero-demo-label {
    display: block;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--tc);
    margin-bottom: 0.4rem;
}

.hero-demo-line {
    display: flex;
    align-items: baseline;
    gap: 0.15rem;
    min-height: 2.7em;
}

.hero-demo-text {
    font-family: Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-size: 0.95rem;
    line-height: 1.45;
    color: var(--ink-700);
}

.hero-demo-caret {
    display: inline-block;
    width: 2px;
    height: 1.05em;
    background: var(--tc);
    transform: translateY(2px);
    animation: hero-caret 1s steps(1) infinite;
}

.hero-demo.is-static .hero-demo-caret { display: none; }

@keyframes hero-caret {
    0%, 50% { opacity: 1; }
    50.01%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; animation: none; }
    .hero-demo-caret { animation: none; }
}

.hero-photo-wrap {
    position: relative;
}

.hero-photo {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    object-position: center 25%;
    border-radius: var(--r-xl);
    box-shadow: var(--sh-lg);
    display: block;
}

.hero-photo-badge {
    position: absolute;
    bottom: -1rem;
    left: -1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-md);
    padding: 0.85rem 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 200px;
}

.hero-photo-badge-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--tc-light);
    color: var(--tc);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.hero-photo-badge-text {
    font-size: 0.8125rem;
    line-height: 1.35;
}

.hero-photo-badge-text strong {
    display: block;
    font-weight: 600;
    color: var(--ink);
    font-size: 0.875rem;
}

.hero-photo-badge-text span { color: var(--ink-500); }

/* Caption under the rotating hero photo — connects the image to a discipline. */
.hero-photo-caption {
    margin-top: 2.25rem;
    padding-left: 0.1rem;
}

.hero-photo-discipline {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--tc);
    margin-bottom: 0.3rem;
}

.hero-photo-statement {
    display: block;
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--ink-500);
    max-width: 460px;
}

/* Stats cards */
.stat-band {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin: 2rem 0 0;
}

@media (max-width: 900px) {
    .stat-band {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .stat-band {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--tc);
    border-radius: 0 var(--r-md) var(--r-md) 0;
    padding: 1.5rem 1.75rem;
    box-shadow: var(--sh-sm);
}

.stat-card-num {
    font-family: 'DM Serif Display', serif;
    font-size: 3rem;
    font-weight: 400;
    color: var(--ink);
    line-height: 1;
    letter-spacing: -0.03em;
}

.stat-plus {
    color: var(--tc);
    font-style: italic;
}

.stat-card-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-400);
    margin-top: 0.5rem;
}

/* Trust strip — below stat cards */
.trust-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem 1.75rem;
    margin-top: 1.25rem;
    padding: 0.9rem 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
}

.trust-item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.875rem;
    font-weight: 450;
    color: var(--ink-500);
}

.trust-item svg { color: var(--green); flex-shrink: 0; }

.trust-sep {
    color: var(--border);
    font-size: 1.1rem;
    line-height: 1;
    user-select: none;
}

/* Feature columns */
.feature-section {
    padding: 5rem 0;
}

.feature-section-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--tc);
    margin-bottom: 0.75rem;
}

.feature-section-headline {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: 400;
    letter-spacing: -0.025em;
    color: var(--ink);
    margin-bottom: 0;
    line-height: 1.15;
}

.feature-item {
    padding-top: 2rem;
    border-top: 2px solid var(--border);
    transition: border-color 0.2s;
}

.feature-item:hover { border-color: var(--tc); }

.feature-item-num {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 1rem;
    color: var(--tc);
    margin-bottom: 0.75rem;
}

.feature-item h3 {
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 0.6rem;
}

.feature-item p {
    font-size: 0.9375rem;
    color: var(--ink-500);
    line-height: 1.65;
    margin: 0;
}

.feature-item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--r-md);
    background: var(--tc-50, rgb(194 82 46 / .08));
    color: var(--tc);
    margin-bottom: 1rem;
}

.feature-lead {
    color: var(--ink-500);
    font-size: 1rem;
    line-height: 1.7;
    margin: 0;
}

/* Scenario preview */
.scenario-preview {
    padding: 5rem 0;
    border-top: 1px solid var(--border);
}

.feature-section-headline--sm { font-size: 1.75rem; }

.scenario-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 1.25rem;
    height: 100%;
    transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
}

.scenario-card:hover {
    box-shadow: var(--sh-md);
    border-color: var(--ink-100);
    transform: translateY(-2px);
}

.scenario-card-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.scenario-card-cat {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--ink-300);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.scenario-card-name {
    font-weight: 500;
    font-size: 0.9375rem;
    color: var(--ink);
    line-height: 1.4;
}

/* Big image row */
.img-row {
    border-radius: var(--r-xl);
    overflow: hidden;
    position: relative;
    aspect-ratio: 16/7;
}

.img-row img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 28%;
    display: block;
}

.img-row-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, rgb(15 23 41 / .72) 0%, rgb(15 23 41 / .3) 60%, transparent 100%);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 2.5rem 3rem;
}

.img-row-discipline {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: rgb(255 255 255 / .72);
    margin: 0 0 0.5rem;
}

.img-row-text {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: clamp(1.35rem, 2.4vw, 1.95rem);
    color: #fff;
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.25;
    max-width: 600px;
    margin: 0;
}

.img-row-text em { font-style: italic; color: rgb(255 255 255 / .75); }

/* CTA banner */
.cta-banner-wrap {
    position: relative;
    margin: 3rem 0 1rem;
}

.cta-banner {
    position: relative;
    border-radius: var(--r-xl);
    overflow: hidden;
    min-height: 480px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    text-align: center;
}

.cta-banner-img {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center 35%;
    filter: saturate(0.6) brightness(0.85);
}

.cta-banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(15,23,41,.93) 0%, rgba(15,23,41,.72) 60%, rgba(15,23,41,.55) 100%);
}

.cta-banner-glow {
    position: absolute;
    bottom: -80px;
    right: -80px;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(194,82,46,.4) 0%, transparent 62%);
    pointer-events: none;
}

.cta-banner-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,.045) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
}

.cta-banner-content {
    position: relative;
    z-index: 2;
    padding: 4rem 2rem 2rem;
    max-width: 680px;
    margin: 0 auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

.cta-btn-band {
    position: relative;
    z-index: 2;
    width: 100%;
    background: rgba(0,0,0, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1.4rem 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.cta-banner-eyebrow {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--tc);
    margin-bottom: 1.25rem;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 5px 10px;
}

.cta-banner-headline {
    font-family: 'DM Serif Display', serif;
    font-size: clamp(2.25rem, 5vw, 3.75rem);
    font-weight: 400;
    color: #fff;
    line-height: 1.12;
    letter-spacing: -0.025em;
    margin-bottom: 1.25rem;
}

.cta-banner-headline em { color: var(--tc); font-style: italic; }

.cta-banner-sub {
    color: rgba(255,255,255,.88);
    font-size: 1.0625rem;
    margin-bottom: 2.25rem;
}

.cta-ghost-btn {
    background: rgba(255,255,255,.08) !important;
    color: #fff !important;
    border: 1px solid rgba(255,255,255,.22) !important;
}

.cta-ghost-btn:hover {
    background: rgba(255,255,255,.15) !important;
    border-color: rgba(255,255,255,.35) !important;
}

.cta-banner-proof {
    position: relative;
    z-index: 2;
    font-size: 0.72rem;
    color: rgba(255,255,255,.62);
    letter-spacing: 0.04em;
    padding: 1.25rem 2rem 2rem;
    margin: 0;
}

/* ── Voice mode ───────────────────────────────────────────────────────────── */
.voice-panel {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 0.75rem 1.1rem;
    margin-bottom: 0.85rem;
    box-shadow: var(--sh-sm);
}

.voice-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background 0.2s;
}

.voice-dot.idle       { background: var(--ink-100); }
.voice-dot.connecting { background: var(--amber); animation: voice-pulse 1s ease-in-out infinite; }
.voice-dot.listening  { background: var(--green); animation: voice-pulse 2s ease-in-out infinite; }
.voice-dot.speaking   { background: var(--tc); animation: voice-pulse 0.7s ease-in-out infinite; }
.voice-dot.error      { background: var(--red); }

@keyframes voice-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.45; transform: scale(0.8); }
}

.voice-status {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ink-500);
    flex: 1;
}

/* ── APP PAGES ────────────────────────────────────────────────────────────── */

/* Session rows (dashboard) */
.session-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--surface-2);
    transition: background 0.1s;
}

.session-item:last-child { border-bottom: none; }
.session-item:hover { background: var(--bg); }

.session-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--r-md);
    background: var(--surface-2);
    color: var(--ink-500);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.session-icon.completed { background: var(--green-lt); color: var(--green); border-color: #BBF7D0; }
.session-icon.abandoned { background: var(--surface-2); color: var(--ink-300); }

.session-name { font-weight: 500; font-size: 0.9375rem; color: var(--ink); }
.session-meta { font-size: 0.8125rem; color: var(--ink-300); margin-top: 1px; }

/* Chat */
.chat-window {
    height: 60vh;
    min-height: 320px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.5rem;
    background: var(--bg);
    border-radius: var(--r-lg);
    border: 1px solid var(--border);
}

.chat-bubble {
    max-width: 80%;
    padding: 0.85rem 1.1rem;
    border-radius: 1.25rem;
    line-height: 1.65;
    font-size: 0.9375rem;
}

.chat-bubble.manager {
    align-self: flex-end;
    background: var(--ink);
    color: #fff;
    border-bottom-right-radius: 0.25rem;
}

.chat-bubble.direct-report {
    align-self: flex-start;
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--border);
    border-bottom-left-radius: 0.25rem;
    box-shadow: var(--sh-xs);
}

.bubble-label {
    font-size: 0.67rem;
    font-weight: 700;
    opacity: 0.5;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.chat-bubble.manager .bubble-label { opacity: 0.6; }
.bubble-text { white-space: pre-wrap; }

/* ── Misc ─────────────────────────────────────────────────────────────────── */
hr { border-color: var(--border); opacity: 1; }

/* ── Teams-style call UI ──────────────────────────────────────────────────── */

/* Full-bleed wrapper that sits below the nav */
.call-layout {
    display: flex;
    height: 100vh;          /* immersive: nav is hidden on the active call */
    overflow: hidden;
    background: #1a1a2e;
}

/* ── Left rail: live HUD / scoring / tips ── */
.call-hud-rail {
    width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: #1e1e35;
    border-right: 1px solid rgba(255,255,255,.07);
    overflow-y: auto;
}
.call-hud-rail .stabilisers-hud { border-bottom: none; }

/* ── Centre: call stage ── */
.call-stage {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    background: #1a1a2e;
}

/* Top bar — session title + end button */
.call-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    background: rgba(0,0,0,.35);
    backdrop-filter: blur(6px);
    flex-shrink: 0;
    z-index: 10;
}

.call-topbar-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255,255,255,.8);
    letter-spacing: 0.01em;
}

.call-topbar-meta {
    font-size: 0.75rem;
    color: rgba(255,255,255,.45);
    margin-left: 0.6rem;
}

/* Main tile area */
.call-tiles {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    gap: 1rem;
}

/* Single participant tile — camera off */
.call-tile {
    background: #252540;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    width: 100%;
    max-width: 640px;
    aspect-ratio: 16 / 9;
    position: relative;
    box-shadow: 0 8px 32px rgba(0,0,0,.45);
    border: 1px solid rgba(255,255,255,.06);
}

/* Avatar circle */
.call-tile-avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: #464668;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
    user-select: none;
    flex-shrink: 0;
}

/* "Camera off" badge sitting top-right of the tile */
.call-tile-cam-off {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,.5);
    border-radius: 8px;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    color: rgba(255,255,255,.55);
}

/* Name label bottom of tile */
.call-tile-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: rgba(255,255,255,.9);
}

.call-tile-role {
    font-size: 0.75rem;
    color: rgba(255,255,255,.4);
    margin-top: -0.5rem;
}

/* ── Control bar ── */
.call-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem 1.25rem 1.5rem;
    flex-shrink: 0;
}

.call-ctrl-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    flex-shrink: 0;
}

.call-ctrl-btn:active { transform: scale(0.92); }

/* Mic button — active = listening (green-ish), muted = dark */
.call-ctrl-btn.mic-on  { background: #3a3a5c; color: #fff; }
.call-ctrl-btn.mic-on:hover { background: #4a4a6c; }
.call-ctrl-btn.mic-muted { background: #c0392b; color: #fff; }
.call-ctrl-btn.mic-muted:hover { background: #e74c3c; }

/* Camera — always disabled style */
.call-ctrl-btn.cam-disabled { background: #2c2c3e; color: rgba(255,255,255,.3); cursor: not-allowed; }

/* End call */
.call-ctrl-btn.end-call { background: #c0392b; color: #fff; width: 56px; height: 56px; }
.call-ctrl-btn.end-call:hover { background: #e74c3c; }

/* Speaking ring — pulses on the tile when AI is speaking */
.call-tile.speaking .call-tile-avatar {
    box-shadow: 0 0 0 4px rgba(99,102,241,.7), 0 0 0 8px rgba(99,102,241,.25);
    animation: tile-ring 1.2s ease-in-out infinite;
}

@keyframes tile-ring {
    0%, 100% { box-shadow: 0 0 0 3px rgba(99,102,241,.7), 0 0 0 7px rgba(99,102,241,.2); }
    50%       { box-shadow: 0 0 0 5px rgba(99,102,241,.9), 0 0 0 11px rgba(99,102,241,.1); }
}

/* Connecting overlay */
.call-connecting-overlay {
    position: absolute;
    inset: 0;
    border-radius: 16px;
    background: rgba(26,26,46,.75);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: rgba(255,255,255,.65);
    z-index: 5;
    backdrop-filter: blur(2px);
}

.call-connecting-overlay.hidden { display: none; }

/* Teams-style reconnect overlay — darker scrim, amber while retrying, red on give-up */
.call-reconnect-overlay {
    position: absolute;
    inset: 0;
    border-radius: 16px;
    background: rgba(18,18,34,.86);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 1.25rem;
    text-align: center;
    z-index: 7;
    backdrop-filter: blur(3px);
    animation: reconnect-in .2s ease;
}
.call-reconnect-overlay.hidden { display: none; }

@keyframes reconnect-in { from { opacity: 0; } to { opacity: 1; } }

.reconnect-spinner {
    border-top-color: #F0A23B;          /* amber — "working on it" */
}
.reconnect-icon { color: #F26D5B; }     /* soft red — used on give-up */

.reconnect-title {
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: #fff;
    letter-spacing: 0.01em;
}
.reconnect-sub {
    font-size: 0.8125rem;
    line-height: 1.5;
    color: rgba(255,255,255,.62);
    max-width: 280px;
}
.reconnect-retry {
    margin-top: 0.5rem;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: 0.8125rem;
    color: #fff;
    background: var(--tc);
    border: 0;
    border-radius: var(--r-sm);
    padding: 0.5rem 1.1rem;
    cursor: pointer;
    transition: background .15s;
}
.reconnect-retry:hover { background: var(--tc-dark); }
.reconnect-retry.hidden,
.reconnect-spinner.hidden,
.reconnect-icon.hidden { display: none; }

/* Pulsing border on the tile while reconnecting, like a live call in trouble */
.call-reconnect-overlay:not(.failed) { box-shadow: inset 0 0 0 2px rgba(240,162,59,.55); }
.call-reconnect-overlay.failed       { box-shadow: inset 0 0 0 2px rgba(242,109,91,.55); }

.call-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(255,255,255,.15);
    border-top-color: rgba(255,255,255,.7);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Status chip below controls */
.call-status-chip {
    position: absolute;
    bottom: calc(1rem + 52px + 1.25rem);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,.5);
    color: rgba(255,255,255,.7);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 14px;
    border-radius: 999px;
    white-space: nowrap;
    pointer-events: none;
    transition: opacity 0.2s;
}

/* ── Right: transcript panel ── */
.call-transcript-panel {
    width: 360px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: #1e1e35;
    border-left: 1px solid rgba(255,255,255,.07);
}

.call-transcript-header {
    padding: 1rem 1.25rem 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.call-transcript-header-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: rgba(255,255,255,.85);
}

.call-transcript-icon {
    color: rgba(255,255,255,.45);
    flex-shrink: 0;
}

/* Scrollable transcript list */
.call-transcript-list {
    flex: 1 1 0;
    overflow-y: auto;
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

/* Thin, themed scrollbar for the dark call view — replaces the stock chunky OS scrollbar.
   Firefox */
.call-transcript-list,
.call-stage,
.call-hud-rail {
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.22) transparent;
}
/* WebKit / Chromium / Edge */
.call-transcript-list::-webkit-scrollbar,
.call-stage::-webkit-scrollbar,
.call-hud-rail::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.call-transcript-list::-webkit-scrollbar-track,
.call-stage::-webkit-scrollbar-track,
.call-hud-rail::-webkit-scrollbar-track {
    background: transparent;
}
.call-transcript-list::-webkit-scrollbar-thumb,
.call-stage::-webkit-scrollbar-thumb,
.call-hud-rail::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.18);
    border-radius: 8px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
.call-transcript-list::-webkit-scrollbar-thumb:hover,
.call-stage::-webkit-scrollbar-thumb:hover,
.call-hud-rail::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,.32);
    background-clip: padding-box;
}
/* Kill the up/down arrow buttons */
.call-transcript-list::-webkit-scrollbar-button,
.call-stage::-webkit-scrollbar-button,
.call-hud-rail::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
}

/* Transcript bubbles — Teams-style: modest rounding, cleaner labels */
.call-transcript-list .chat-bubble {
    max-width: 88%;
    font-size: 0.875rem;
    padding: 0.6rem 0.85rem;
    border-radius: 0.5rem;   /* Teams uses ~8px, not pill-shaped */
    line-height: 1.5;
}

/* AI bubble: dark card, light text — sits on the dark panel */
.call-transcript-list .chat-bubble.direct-report {
    background: #2a2a48;
    color: rgba(255,255,255,.88);
    border: none;
    box-shadow: none;
    border-bottom-left-radius: 0.125rem;
}

/* User bubble: Teams blue, not near-black */
.call-transcript-list .chat-bubble.manager {
    background: #5b5fc7;   /* Teams indigo-blue */
    border-bottom-right-radius: 0.125rem;
}

/* ── What-If version tree (review screen) ─────────────────────────────── */
.version-tree-panel {
    margin: 0 0 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--surface);
    overflow: hidden;
}
.version-tree-panel.d-none { display: none; }
.version-tree-summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--ink-700);
    list-style: none;
}
.version-tree-summary::-webkit-details-marker { display: none; }
.version-tree-summary svg { color: var(--tc); }
.version-tree-count {
    margin-left: auto;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--ink-300);
}
/* Expand/contract affordance on the header */
.version-tree-caret {
    margin-left: 0.6rem;
    color: var(--ink-300);
    transition: transform .15s ease;
}
.version-tree-panel[open] .version-tree-caret { transform: rotate(180deg); }
/* In fullscreen the header can't collapse the panel — remove the affordance. */
.version-tree-panel.vtree-fullscreen .version-tree-summary { cursor: default; }
.version-tree-panel.vtree-fullscreen .version-tree-caret { display: none; }
/* ── What-If version tree — horizontal org-chart (trunk forks left/right) ──── */
.version-tree-panel { position: relative; }
.version-tree {
    padding: 1.2rem 0.6rem 3rem;   /* bottom room so the expand button never overlaps a node */
    border-top: 1px solid var(--border);
    overflow-x: auto;            /* deep trees scroll sideways */
    text-align: center;          /* centre the trunk */
}

/* Expand / contract control, bottom-right of the panel */
.vtree-expand {
    position: absolute;
    bottom: 0.7rem;
    right: 0.7rem;
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: var(--surface);
    color: var(--ink-400);
    cursor: pointer;
    z-index: 6;
    transition: background .12s, color .12s, border-color .12s;
}
.vtree-expand:hover { background: var(--surface-2); color: var(--ink); border-color: var(--ink-100); }

/* Fullscreen mode — fill the viewport */
body.vtree-fullscreen-open { overflow: hidden; }
.version-tree-panel.vtree-fullscreen {
    position: fixed;
    inset: 1.5rem;
    z-index: 1080;
    margin: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: 0 24px 70px rgba(15, 23, 41, .28);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
/* Fullscreen: keep the branching org-chart, but use the extra room for full,
   unclipped speech bubbles in the review-screen skin. Scrolls in both directions. */
.version-tree-panel.vtree-fullscreen .version-tree {
    /* Absolute within the fixed panel → a definite height, so it scrolls reliably
       (a flex child inside <details> doesn't constrain height in all browsers). */
    position: absolute;
    top: 3.1rem;                 /* below the summary header */
    left: 0;
    right: 0;
    bottom: 0;
    overflow: auto;              /* scroll vertically and horizontally */
    border-top: 1px solid var(--border);
    padding: 2.5rem 2rem 3.5rem;
}
/* Each tree node becomes a proper speech bubble (review skin: coach indigo, AI light). */
.version-tree-panel.vtree-fullscreen .vtree-node {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    max-width: 340px;              /* constrained — not grotesquely wide */
    white-space: normal;
    text-align: left;
    padding: 0.7rem 0.95rem;
    border-radius: 0.7rem;
    line-height: 1.55;
    font-size: 0.9rem;
    box-shadow: 0 1px 3px rgba(15,23,41,.06);
}
.version-tree-panel.vtree-fullscreen .vtree-node:has(.vtree-dot.coach) {
    background: #5b5fc7;
    border-color: #5b5fc7;
    color: #fff;
}
.version-tree-panel.vtree-fullscreen .vtree-node:has(.vtree-dot.ai) {
    background: var(--surface-2);
    border-color: var(--border);
    color: var(--ink-700);
}
.version-tree-panel.vtree-fullscreen .vtree-node .vtree-dot { display: none; }
.version-tree-panel.vtree-fullscreen .vtree-node .vtree-who {
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.7rem;
}
.version-tree-panel.vtree-fullscreen .vtree-node:has(.vtree-dot.coach) .vtree-who { color: rgba(255,255,255,.78); }
.version-tree-panel.vtree-fullscreen .vtree-node .vtree-text {
    white-space: normal;
    overflow: visible;
    max-width: none;
    font-size: 0.9rem;
}
/* A touch more breathing room between forked branches in the wide view */
.version-tree-panel.vtree-fullscreen .vtree-branches { gap: 40px; }

/* Compact (non-fullscreen) tree clips long text to keep cards tidy */
.vtree-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

/* Flash a node when jumped to */
@keyframes vtreeFlash {
    0% { box-shadow: 0 0 0 3px rgba(194,82,46,.5); }
    100% { box-shadow: 0 0 0 3px rgba(194,82,46,0); }
}
.vtree-node.vtree-flash { animation: vtreeFlash 1.1s ease-out; }

/* A vertical run of message cards (a single branch), centred */
.vtree-path {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;                   /* gap holds the vertical connector */
    vertical-align: top;
}

/* Message card */
.vtree-node {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    max-width: 250px;
    padding: 0.4rem 0.65rem;
    border-radius: var(--r-md);
    background: var(--surface);
    border: 1px solid var(--border);
    cursor: pointer;
    font-size: 0.78rem;
    color: var(--ink-400);
    position: relative;
    opacity: 0.6;
    transition: background .12s, border-color .12s, box-shadow .12s;
}
.vtree-node:hover { background: var(--surface-2); opacity: 1; }
.vtree-node.active { opacity: 1; color: var(--ink-700); border-color: var(--tc-mid); box-shadow: 0 1px 4px rgba(194,82,46,.12); }

/* Vertical connector linking a card to whatever sits above it in the same run */
.vtree-path > .vtree-node:not(:first-child)::before,
.vtree-path > .vtree-branches::before {
    content: '';
    position: absolute;
    left: 50%; transform: translateX(-50%);
    bottom: 100%;
    width: 2px; height: 20px;
    background: var(--border);
}
.vtree-path > .vtree-node.active:not(:first-child)::before,
.vtree-path > .vtree-branches.active-trunk::before { background: var(--tc); }

/* Node marker — hollow off the active path, filled on it */
.vtree-dot {
    width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
    background: var(--surface); border: 2px solid var(--ink-300);
}
.vtree-node.active .vtree-dot.coach { background: #5b5fc7; border-color: #5b5fc7; }
.vtree-node.active .vtree-dot.ai    { background: var(--tc);  border-color: var(--tc); }

.vtree-who { font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; flex-shrink: 0; }
.vtree-who.coach { color: #5b5fc7; }
.vtree-who.ai    { color: var(--tc); }
.vtree-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The split — child branches laid out side by side */
.vtree-branches {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 1.8rem;
    position: relative;
}
.vtree-col { position: relative; padding-top: 20px; }     /* room for bus + drop */
/* horizontal bus across the tops of the sibling columns */
.vtree-col::after {
    content: ''; position: absolute; top: 0; height: 2px; background: var(--border);
}
.vtree-col:first-child::after { left: 50%; right: -0.9rem; }   /* -0.9rem = half the 1.8rem gap */
.vtree-col:last-child::after  { right: 50%; left: -0.9rem; }
.vtree-col:not(:first-child):not(:last-child)::after { left: -0.9rem; right: -0.9rem; }
.vtree-col:only-child::after  { display: none; }
/* vertical drop from the bus into each column */
.vtree-col::before {
    content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 2px; height: 20px; background: var(--border);
}
.vtree-col.active::before,
.vtree-col.active::after { background: var(--tc); }

/* Endpoint badge — each distinct path gets one global version number */
.vtree-node.leaf { font-weight: 600; }
.vtree-version {
    flex-shrink: 0; margin-left: 0.35rem;
    font-size: 0.58rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
    padding: 0.1rem 0.45rem; border-radius: 999px;
    background: var(--surface-2); color: var(--ink-400); border: 1px solid var(--border);
    white-space: nowrap;
}
.vtree-version.current {
    background: var(--tc);
    color: #fff;
    border-color: var(--tc);
}

/* ── What-If branching (in-session) ───────────────────────────────────── */
.call-transcript-list.whatif-on .chat-bubble { position: relative; }

.whatif-rewind {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.4rem;
    padding: 0.15rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255,255,255,.85);
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 999px;
    cursor: pointer;
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity .15s, transform .15s, background .15s;
}
.chat-bubble:hover .whatif-rewind { opacity: 1; transform: translateY(0); }
.whatif-rewind:hover { background: var(--tc); border-color: var(--tc); }

.chat-bubble.whatif-dimmed {
    opacity: 0.32;
    filter: saturate(.6);
    transition: opacity .25s, filter .25s;
}

.whatif-banner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
    padding: 0.4rem 0.6rem;
    border-radius: var(--r-sm);
    background: rgba(194,82,46,.16);
    border: 1px solid rgba(194,82,46,.4);
    color: rgba(255,255,255,.9);
    font-size: 0.78rem;
}
.whatif-banner svg { color: var(--tc); flex-shrink: 0; }
.whatif-banner-text { flex: 1; }
.whatif-banner-text strong { color: #fff; }
.whatif-cancel {
    background: none;
    border: 0;
    color: rgba(255,255,255,.65);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}
.whatif-cancel:hover { color: #fff; }

/* Branch switcher chip-row, shown under a coach turn that has alternatives */
.whatif-branchbar {
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0.1rem 0 0.4rem;
    padding: 0.15rem 0.3rem;
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.16);
    font-size: 0.7rem;
    color: rgba(255,255,255,.7);
}
.whatif-brk {
    background: none;
    border: 0;
    color: rgba(255,255,255,.85);
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.2rem;
}
.whatif-brk:hover { color: var(--tc); }
.whatif-brlabel { font-weight: 600; letter-spacing: 0.01em; }

/* Labels: readable on dark panel */
.call-transcript-list .bubble-label {
    font-size: 0.7rem;
    font-weight: 600;
    opacity: 0.6;
    margin-bottom: 0.2rem;
    text-transform: none;
    letter-spacing: 0;
}

/* Text input at bottom of transcript panel */
.call-chat-input {
    flex-shrink: 0;
    border-top: 1px solid rgba(255,255,255,.08);
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.call-chat-input textarea {
    resize: none;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: var(--r-md);
    padding: 0.6rem 0.8rem;
    font-size: 0.875rem;
    color: rgba(255,255,255,.85);
    background: #2a2a48;
    width: 100%;
    box-shadow: none;
    outline: none;
    font-family: inherit;
}

.call-chat-input textarea::placeholder {
    color: rgba(255,255,255,.3);
}

.call-chat-input textarea:focus {
    border-color: rgba(255,255,255,.25);
    background: #32324e;
}

.call-chat-input-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Send button: Teams-style accent (matches the "You" bubble), not the app's dark
   ink button which disappears against the dark call panel. The base .btn-warning
   uses !important, so this override must too. */
.call-chat-input #send-btn {
    background: #5b5fc7 !important;   /* Teams indigo — same as the user bubble */
    border-color: #5b5fc7 !important;
    color: #fff !important;
}
.call-chat-input #send-btn:hover,
.call-chat-input #send-btn:focus {
    background: #4f52b3 !important;
    border-color: #4f52b3 !important;
    color: #fff !important;
    box-shadow: none !important;
    transform: none;
}
.call-chat-input #send-btn:disabled {
    background: #3a3d78 !important;
    border-color: #3a3d78 !important;
    color: rgba(255,255,255,.55) !important;
    opacity: 1;
}

.call-chat-error {
    font-size: 0.75rem;
    color: var(--red);
}

/* Responsive: collapse transcript + HUD rail below 900px */
@media (max-width: 900px) {
    .call-transcript-panel,
    .call-hud-rail {
        display: none;
    }
}

/* ── Stabilisers HUD ─────────────────────────────────────────────────── */
.stabilisers-hud {
    border-bottom: 1px solid rgba(255,255,255,.06);
    flex-shrink: 0;
    background: rgba(255,255,255,.025);
}

.stabilisers-hud-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 1.25rem;
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,.7);
    font-size: 0.8rem;
    font-weight: 600;
    gap: 0.5rem;
    letter-spacing: 0.02em;
}

.stabilisers-hud-toggle:hover { color: rgba(255,255,255,.9); }

/* Static HUD header (no collapse control — the HUD lives in its own left rail now). */
.stabilisers-hud-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem 0.6rem;
    color: rgba(255,255,255,.82);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.hud-toggle-icon { color: rgba(99,102,241,.8); flex-shrink: 0; }

.hud-chevron {
    color: rgba(255,255,255,.3);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.stabilisers-hud-body { padding: 0 1.25rem 0.85rem; }

.stage-stepper {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.6rem;
}

.stage-chip {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.18rem 0.5rem;
    border-radius: 100px;
    background: rgba(255,255,255,.06);
    color: rgba(255,255,255,.3);
    border: 1px solid transparent;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.stage-chip.completed {
    background: rgba(99,102,241,.12);
    color: rgba(255,255,255,.55);
}

.stage-chip.active {
    background: rgba(99,102,241,.28);
    color: rgba(255,255,255,.95);
    border-color: rgba(99,102,241,.5);
}

/* ── Live Read (frameworkless HUD) ──────────────────────────────────────────── */
.live-read { margin-bottom: 0.7rem; }

.live-read-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.live-read-title {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255,255,255,.45);
}

.lr-delta {
    font-size: 0.72rem;
    font-weight: 700;
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity 0.3s, transform 0.3s;
}
.lr-delta.show { opacity: 1; transform: none; }
.lr-delta.up   { color: #34d399; }
.lr-delta.down { color: #f87171; }

.lr-track {
    position: relative;
    height: 8px;
    border-radius: 100px;
    background: linear-gradient(90deg, #ef4444 0%, #f59e0b 50%, #22c55e 100%);
    box-shadow: inset 0 1px 2px rgba(0,0,0,.35);
    margin: 0.9rem 0 0.55rem;
}

.lr-trail {
    position: absolute;
    top: 0;
    height: 100%;
    left: 0;
    width: 0;
    border-radius: 100px;
    background: rgba(255,255,255,.28);
    opacity: 0;
    transition: opacity 0.4s;
}
.lr-trail.show { opacity: 1; }

/* Marker is a value pill sitting ON the track — the score lives inside it, so nothing floats
   above the track to collide with the title. */
.lr-marker {
    position: absolute;
    top: 50%;
    left: 0;
    min-width: 24px;
    height: 20px;
    padding: 0 0.4rem;
    border-radius: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: hsl(var(--lr-hue, 0), 85%, 50%);
    border: 2px solid rgba(255,255,255,.92);
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 4px hsla(var(--lr-hue, 0), 85%, 50%, 0.22), 0 1px 4px rgba(0,0,0,.4);
    transition: left 0.7s cubic-bezier(.22,1,.36,1), background 0.7s, box-shadow 0.7s;
    z-index: 2;
}
.lr-score {
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

/* Before the first exchange: no score yet — neutral, centred dot, no number. */
.live-read.lr-empty .lr-marker {
    left: 50%;
    min-width: 0;
    width: 16px;
    height: 16px;
    padding: 0;
    background: rgba(255,255,255,.35);
    border-color: rgba(255,255,255,.5);
    box-shadow: none;
}
.live-read.lr-empty .lr-score { display: none; }

.lr-scale {
    display: flex;
    justify-content: space-between;
    font-size: 0.62rem;
    letter-spacing: 0.03em;
    color: rgba(255,255,255,.32);
    margin-bottom: 0.7rem;
}

.lr-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.lr-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.22rem 0.55rem;
    border-radius: 100px;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.08);
    transition: background 0.3s, border-color 0.3s;
}

.lr-pill-name {
    font-size: 0.68rem;
    font-weight: 600;
    color: rgba(255,255,255,.55);
}

.lr-pill-dots { display: inline-flex; gap: 2px; }

.lr-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255,255,255,.18);
    transition: background 0.3s;
}
.lr-pill.lvl-1 .lr-dot.on { background: #ef4444; }
.lr-pill.lvl-2 .lr-dot.on { background: #f59e0b; }
.lr-pill.lvl-3 .lr-dot.on { background: #84cc16; }
.lr-pill.lvl-4 .lr-dot.on { background: #22c55e; }
.lr-pill.lvl-3, .lr-pill.lvl-4 { border-color: rgba(34,197,94,.3); background: rgba(34,197,94,.08); }
.lr-pill.lvl-3 .lr-pill-name, .lr-pill.lvl-4 .lr-pill-name { color: rgba(255,255,255,.82); }

.hud-observation {
    font-size: 0.8rem;
    line-height: 1.5;
    color: rgba(255,255,255,.65);
    margin-bottom: 0.6rem;
    min-height: 1.4em;
}

.hud-obs-placeholder {
    color: rgba(255,255,255,.28);
    font-style: italic;
}

.hud-hint-area { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

.hud-hint-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.28rem 0.7rem;
    border-radius: var(--r-sm);
    background: rgba(251,191,36,.1);
    color: rgba(251,191,36,.88);
    border: 1px solid rgba(251,191,36,.22);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.hud-hint-btn:hover:not(:disabled) {
    background: rgba(251,191,36,.18);
    border-color: rgba(251,191,36,.38);
}

.hud-hint-btn:disabled { opacity: 0.5; cursor: default; }

.hud-auto-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    user-select: none;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255,255,255,.5);
    transition: color 0.15s;
}
.hud-auto-toggle.on { color: rgba(251,191,36,.88); }
.hud-auto-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.hud-auto-track {
    position: relative;
    width: 26px;
    height: 15px;
    border-radius: 999px;
    background: rgba(255,255,255,.16);
    transition: background 0.15s;
    flex-shrink: 0;
}
.hud-auto-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: rgba(255,255,255,.85);
    transition: transform 0.15s;
}
.hud-auto-toggle.on .hud-auto-track { background: rgba(251,191,36,.55); }
.hud-auto-toggle.on .hud-auto-thumb { transform: translateX(11px); }
.hud-auto-label { letter-spacing: 0.02em; }

.hint-card {
    margin-top: 0.6rem;
    padding: 0.6rem 0.8rem;
    border-radius: var(--r-sm);
    background: rgba(251,191,36,.07);
    border: 1px solid rgba(251,191,36,.18);
    font-size: 0.8rem;
    line-height: 1.55;
    color: rgba(255,255,255,.78);
}

.hint-card p { margin: 0 0 0.3rem; }
.hint-card p:last-child { margin-bottom: 0; }
.hint-card strong { color: rgba(251,191,36,.88); font-weight: 600; }

/* ── Scenario brief panel ─────────────────────────────────────────────── */
.scenario-brief {
    margin: 0 1rem 0;
    border-radius: var(--r-md);
    background: linear-gradient(135deg, rgba(99,102,241,.18) 0%, rgba(139,92,246,.12) 100%);
    border: 1px solid rgba(139,92,246,.35);
    overflow: hidden;
}

.scenario-brief-summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.65rem 1rem;
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 600;
    color: rgba(255,255,255,.9);
    user-select: none;
}

.scenario-brief-summary::-webkit-details-marker { display: none; }

.scenario-brief-summary svg:first-child {
    color: rgba(139,92,246,.9);
    flex-shrink: 0;
}

.scenario-brief-summary span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.scenario-brief-chevron {
    color: rgba(255,255,255,.45);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

details.scenario-brief[open] .scenario-brief-chevron {
    transform: rotate(180deg);
}

.scenario-brief-body {
    padding: 0 1rem 0.85rem 2.35rem;
    font-size: 0.8125rem;
    line-height: 1.6;
    color: rgba(255,255,255,.72);
    border-top: 1px solid rgba(139,92,246,.2);
    padding-top: 0.65rem;
}

/* ═══════════════════════════════════════════════════════════════════
   SESSION REVIEW LAYOUT
   ═══════════════════════════════════════════════════════════════════ */

.review-layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 2rem;
    align-items: start;
    padding: 2rem 0 4rem;
}

/* ── Sidebar ─────────────────────────────────────────────────────── */

.review-sidebar {
    position: sticky;
    top: 1.5rem;
    align-self: start;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    box-shadow: var(--sh-sm);
}

.review-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8125rem;
    color: var(--ink-400);
    text-decoration: none;
    transition: color 0.12s;
}

.review-back-link:hover { color: var(--ink); }

.review-sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.review-mode-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--tc);
    background: var(--tc-light);
    border: 1px solid var(--tc-mid);
    border-radius: var(--r-pill);
    padding: 0.2rem 0.6rem;
    align-self: flex-start;
}

.review-sidebar-title {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 1.1rem;
    color: var(--ink);
    line-height: 1.3;
}

.review-sidebar-scenario {
    font-size: 0.8rem;
    color: var(--ink-400);
    font-style: italic;
}

.review-sidebar-meta {
    font-size: 0.78rem;
    color: var(--ink-300);
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

/* Score cards */
.review-scores {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

/* Frameworkless / single-score: the one card fills the full width. */
.review-scores.single {
    grid-template-columns: 1fr;
}

.review-score-card {
    text-align: center;
    padding: 0.75rem 0.5rem;
    border-radius: var(--r-md);
    border: 1px solid var(--border);
}

.review-score-card.score-green {
    background: var(--green-lt);
    border-color: #bbf7d0;
}

.review-score-card.score-amber {
    background: var(--amber-lt);
    border-color: #fde68a;
}

.review-score-card.score-red {
    background: var(--red-lt);
    border-color: #fecaca;
}

.review-score-num {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--ink);
}

.review-score-card.score-green .review-score-num { color: var(--green); }
.review-score-card.score-amber .review-score-num { color: var(--amber); }
.review-score-card.score-red   .review-score-num { color: var(--red);   }

.review-score-lbl {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ink-400);
    margin-top: 0.25rem;
}

.review-summary-text {
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--ink-500);
    border-left: 3px solid var(--border);
    padding-left: 0.75rem;
}

.review-section-heading {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-300);
    margin-bottom: 0.25rem;
}

.review-strength-item,
.review-improve-item {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--ink-500);
    margin-bottom: 0.35rem;
}

.review-strength-item svg { color: var(--green); flex-shrink: 0; margin-top: 0.2rem; }
.review-improve-item  svg { color: var(--amber); flex-shrink: 0; margin-top: 0.2rem; }

/* Recommendations (unified report sidebar) */
.review-reco-item {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--ink-500);
    margin-bottom: 0.4rem;
}
.review-reco-bullet { color: var(--tc); flex-shrink: 0; }

/* "In your own words" repositioning examples */
.review-reposition {
    border-left: 3px solid var(--tc-mid, #F9D5CA);
    padding-left: 0.7rem;
    margin-bottom: 0.85rem;
}
.review-reposition-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}
.review-reposition-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-300);
}
.review-reposition-turn {
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
}
.review-reposition-said {
    display: block;
    font-size: 0.8rem;
    font-style: italic;
    color: var(--ink-500);
    line-height: 1.5;
}
/* When the quote itself is the link, keep its muted look; reveal intent on hover */
a.review-reposition-said.turn-link {
    color: var(--ink-500);
    text-decoration: none;
    cursor: pointer;
    white-space: normal;       /* override .turn-link's nowrap so long quotes wrap */
    overflow-wrap: anywhere;
}
a.review-reposition-said.turn-link:hover {
    color: var(--tc);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.review-reposition-issue {
    font-size: 0.75rem;
    color: var(--ink-400);
    margin-top: 0.3rem;
    line-height: 1.45;
}
.review-reposition-better {
    font-size: 0.8rem;
    color: var(--ink-700);
    line-height: 1.5;
    margin-top: 0.4rem;
    padding: 0.4rem 0.55rem;
    background: var(--green-lt);
    border: 1px solid #dcfce7;
    border-radius: var(--r-sm);
}

/* Bubble row holds the bubble + the (absolutely-positioned) current-turn marker */
.review-bubble-row {
    position: relative;
    max-width: 76%;
}
.review-bubble-row .review-bubble { max-width: 100%; }

.review-turn-marker {
    position: absolute;
    left: -2rem;
    top: 50%;
    transform: translateY(-50%) scale(0.3);
    color: var(--tc);
    line-height: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(.34,1.56,.64,1);
    filter: drop-shadow(0 2px 5px rgba(194,82,46,.45));
}

/* Persistent "current turn" marker (stays until another turn is selected) */
.review-turn-current .review-turn-marker {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}
.review-turn-current .review-bubble {
    box-shadow: 0 0 0 2px var(--tc), 0 6px 18px -5px rgba(194,82,46,.45);
}
.review-turn-current .review-turn-num { color: var(--tc); font-weight: 800; }

.review-annotation-stat {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: var(--ink-400);
    padding: 0.5rem 0.65rem;
    background: var(--amber-lt);
    border-radius: var(--r-sm);
    border: 1px solid #fde68a;
}

.review-annotation-stat svg { color: var(--amber); flex-shrink: 0; }

.review-no-report {
    font-size: 0.8125rem;
    color: var(--ink-400);
    text-align: center;
}

.review-no-report p { margin-bottom: 0.75rem; }

.review-sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

/* ── Main transcript area ─────────────────────────────────────── */

.review-main {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.review-transcript-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.review-transcript-title {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 1.5rem;
    color: var(--ink);
    line-height: 1.2;
}

.review-transcript-scenario {
    font-size: 0.875rem;
    color: var(--ink-400);
    margin-top: 0.25rem;
    max-width: 900px;
    line-height: 1.5;
}

.review-annotated-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--amber);
    background: var(--amber-lt);
    border: 1px solid #fde68a;
    border-radius: var(--r-pill);
    padding: 0.3rem 0.7rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.review-empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--ink-300);
    font-size: 0.9375rem;
}

.version-mismatch-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    background: var(--amber-lt, #fef3c7);
    border: 1px solid #fde68a;
    color: var(--ink-700);
    border-radius: var(--r-md);
    padding: 0.55rem 0.85rem;
    font-size: 0.8125rem;
    margin-bottom: 0.85rem;
}
.version-mismatch-banner.d-none { display: none; }

/* "Assessed on the version you ended on" note + What-If reflection section */
.review-assessed-note {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    background: #FAF7FE;
    border: 1px solid #E4D8F7;
    color: var(--ink-600);
    border-radius: var(--r-md);
    padding: 0.55rem 0.75rem;
    font-size: 0.8rem;
    line-height: 1.45;
    margin-bottom: 1rem;
}
.review-assessed-note svg { color: #7c5cd6; flex-shrink: 0; margin-top: 0.15rem; }

.review-whatif-badge {
    display: inline-block;
    background: #ede9fb;
    color: #5b5fc7;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border-radius: 999px;
    padding: 0.05rem 0.5rem;
    margin-right: 0.4rem;
    vertical-align: middle;
}
.review-whatif-intro {
    font-size: 0.8rem;
    color: var(--ink-500);
    margin: 0.15rem 0 0.6rem;
    line-height: 1.45;
}
.review-whatif-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--ink-700);
    line-height: 1.5;
    margin-bottom: 0.5rem;
}
.review-whatif-bullet { color: #7c5cd6; flex-shrink: 0; font-size: 0.95rem; line-height: 1.35; }

/* Voice timbre filter + tags (pick a voice by how it sounds) */
.voice-timbre-filter { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.voice-timbre-chip {
    border: 1px solid var(--border, #e2e0dc);
    background: #fff;
    color: var(--ink-600, #555);
    border-radius: 999px;
    padding: 0.25rem 0.8rem;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.12s ease;
}
.voice-timbre-chip:hover { border-color: var(--terracotta, #C2522E); color: var(--terracotta, #C2522E); }
.voice-timbre-chip.active {
    background: var(--terracotta, #C2522E);
    border-color: var(--terracotta, #C2522E);
    color: #fff;
}
.voice-timbre-tag {
    display: inline-block;
    margin-top: 0.4rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    border-radius: 999px;
    padding: 0.05rem 0.5rem;
}
.timbre-warm    { background: #fbe7e0; color: #b4521f; }
.timbre-bright  { background: #fdf3d4; color: #a9810a; }
.timbre-deep    { background: #e0e7f5; color: #3a5599; }
.timbre-neutral { background: #ececec; color: #5a5a5a; }

.review-turns {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Individual turns */
.review-turn {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.75rem;
    scroll-margin-top: 84px;   /* don't tuck the target under the sticky header */
}

.review-turn-num {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--ink-300);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Flash when arriving from a "Turn N" link on the feedback report */
@keyframes reviewTurnFlash {
    0%   { box-shadow: 0 0 0 0 rgba(194,82,46,0); }
    12%  { box-shadow: 0 0 0 4px rgba(194,82,46,0.55); }
    100% { box-shadow: 0 0 0 0 rgba(194,82,46,0); }
}
.review-turn-flash .review-bubble {
    animation: reviewTurnFlash 1.9s ease-out;
}

/* "Turn N" links on the feedback report */
.turn-link {
    color: var(--tc, #C2522E);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    white-space: nowrap;
    cursor: pointer;
}
.turn-link:hover { text-decoration: none; }

.review-turn-coach {
    align-items: flex-end;
}

.review-turn-ai {
    align-items: flex-start;
}

.review-turn-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}

.review-speaker-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ink-300);
}

.review-turn-time {
    font-size: 0.7rem;
    color: var(--ink-100);
}

.review-bubble {
    max-width: 88%;
    padding: 0.7rem 1rem;
    border-radius: 0.625rem;
    font-size: 0.9375rem;
    line-height: 1.55;
    word-break: break-word;
}

.review-turn-coach .review-bubble {
    background: #5b5fc7;
    color: #fff;
    border-bottom-right-radius: 0.125rem;
}

.review-turn-ai .review-bubble {
    background: var(--surface-2);
    color: var(--ink-700);
    border: 1px solid var(--border);
    border-bottom-left-radius: 0.125rem;
}

/* Coaching annotation card */
.review-coaching-note {
    align-self: flex-end;
    max-width: 76%;
    margin-top: 0.35rem;
    margin-bottom: 1.25rem;
    padding: 0.7rem 0.9rem;
    background: var(--amber-lt);
    border: 1px solid #fde68a;
    border-left: 3px solid var(--amber);
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

.review-coaching-note-header {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--amber);
    margin-bottom: 0.5rem;
}

.review-coaching-note-list {
    margin: 0;
    padding: 0 0 0 1rem;
    list-style: disc;
}

.review-coaching-note-list li {
    font-size: 0.8125rem;
    line-height: 1.55;
    color: var(--ink-700);
    margin-bottom: 0.25rem;
}

.review-coaching-note-list li:last-child { margin-bottom: 0; }

/* ── Inline annotation gutter (Word-comments style, pinned to a coach turn) ── */
.review-annotations {
    align-self: flex-end;
    max-width: 88%;
    margin-top: 0.4rem;
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
/* Notes card already styled; neutralise its standalone spacing inside the gutter */
.review-annotations .review-coaching-note {
    align-self: stretch;
    max-width: 100%;
    margin: 0;
}

/* "Stronger phrasing" reframe card — the actionable per-turn feedback, terracotta-accented */
.review-reframe {
    padding: 0.7rem 0.9rem;
    background: var(--tc-light, #FCEEE9);
    border: 1px solid var(--tc-mid, #F9D5CA);
    border-left: 3px solid var(--tc, #C2522E);
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.review-reframe-head {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.4rem;
}
.review-reframe-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--tc, #C2522E);
}
.review-reframe-issue {
    font-size: 0.8125rem;
    color: var(--ink-500);
    line-height: 1.5;
    margin-bottom: 0.45rem;
}
.review-reframe-better {
    font-size: 0.875rem;
    color: var(--ink-700);
    line-height: 1.55;
    font-style: italic;
    padding: 0.45rem 0.6rem;
    background: #fff;
    border-radius: var(--r-sm);
    border: 1px solid var(--tc-mid, #F9D5CA);
}

/* Coachee Experience: pinned notes celebrate the coach's great technique (green), not critique it. */
.review-reframe.review-highlight {
    background: #ECFDF5;
    border-color: #A7F3D0;
    border-left-color: #059669;
}
.review-reframe.review-highlight .review-reframe-issue {
    color: var(--ink-700);
    margin-bottom: 0;
}

/* Sidebar hint pointing at the inline reframes */
.review-inline-hint {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--ink-500);
    padding: 0.5rem 0.65rem;
    background: var(--tc-light, #FCEEE9);
    border: 1px solid var(--tc-mid, #F9D5CA);
    border-radius: var(--r-sm);
}
.review-inline-hint svg { color: var(--tc, #C2522E); flex-shrink: 0; margin-top: 0.15rem; }

/* Responsive */
@media (max-width: 800px) {
    .review-layout {
        grid-template-columns: 1fr;
    }
    .review-sidebar {
        position: static;
    }
    .review-bubble,
    .review-coaching-note,
    .review-annotations {
        max-width: 92%;
    }
}

/* ── Toasts ───────────────────────────────────────────────────────────── */
.toast-stack {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 1080;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-width: min(360px, calc(100vw - 2rem));
    pointer-events: none;
}

.app-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.85rem 0.95rem;
    border-radius: var(--r-md);
    background: #fff;
    border: 1px solid var(--border);
    border-left: 3px solid var(--ink-300);
    box-shadow: 0 12px 30px -8px rgba(15, 23, 42, .22);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--ink-700);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity .22s ease, transform .22s ease;
}
.app-toast.show { opacity: 1; transform: translateY(0); }

/* Success / info stay quiet: white card + coloured left accent */
.app-toast.toast-success { border-left-color: #2E7D5B; }
.app-toast.toast-info    { border-left-color: #3B6FB0; }
.app-toast.toast-success .app-toast-icon { color: #2E7D5B; }
.app-toast.toast-info    .app-toast-icon { color: #3B6FB0; }

/* Error is loud and unmistakable: solid danger fill (a true crimson, NOT brand
   terracotta #C2522E) so it never reads as ordinary branded chrome. */
.app-toast.toast-error {
    background: #B42318;
    border-color: #B42318;
    border-left-color: #7A140C;
    color: #fff;
    box-shadow: 0 14px 34px -8px rgba(180, 35, 24, .5);
}
.app-toast.toast-error .app-toast-icon  { color: #fff; }
.app-toast.toast-error .app-toast-title { font-weight: 700; }
.app-toast.toast-error .app-toast-close { color: rgba(255,255,255,.7); }
.app-toast.toast-error .app-toast-close:hover { color: #fff; }
.app-toast.toast-error.show { animation: toast-attn .4s ease; }

@keyframes toast-attn {
    0%, 100% { transform: translateY(0); }
    25%      { transform: translateY(0) translateX(-4px); }
    60%      { transform: translateY(0) translateX(3px); }
    80%      { transform: translateY(0) translateX(-2px); }
}
@media (prefers-reduced-motion: reduce) {
    .app-toast.toast-error.show { animation: none; }
}

.app-toast-icon { flex-shrink: 0; margin-top: 1px; }

.app-toast-body { flex: 1; }
.app-toast-title {
    display: block;
    font-weight: 600;
    font-size: 0.8125rem;
    letter-spacing: 0.01em;
    margin-bottom: 0.1rem;
}
.app-toast-close {
    flex-shrink: 0;
    background: none;
    border: 0;
    padding: 0;
    margin: 1px 0 0;
    line-height: 1;
    color: var(--ink-300);
    cursor: pointer;
    font-size: 1rem;
    transition: color .15s;
}
.app-toast-close:hover { color: var(--ink-700); }

/* ── My account ─────────────────────────────────────────────────────────── */

.user-menu { min-width: 220px; }
.user-menu-head {
    padding: 0.55rem 1rem 0.45rem;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.user-menu-name  { font-weight: 600; font-size: 0.875rem; color: var(--ink); line-height: 1.3; }
.user-menu-email { font-size: 0.78125rem; color: var(--ink-300); word-break: break-all; }
.user-menu-org   { font-size: 0.78125rem; color: var(--tc-dark); font-weight: 600; margin-top: 0.15rem; }

.account-card {
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 1.5rem 1.75rem;
    background: var(--surface);
}
.account-card-head  { margin-bottom: 1rem; }
.account-card-title { font-weight: 600; font-size: 1rem; color: var(--ink); }
.account-card-sub   { font-size: 0.84375rem; color: var(--ink-500); margin-bottom: 0; line-height: 1.55; }

.account-live-preview {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--ink-300);
}
.account-avatar-preview {
    width: 30px; height: 30px;
    background: var(--tc-light);
    border: 1.5px solid var(--tc-mid);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--tc-dark);
}

.mfa-steps { padding-left: 1.25rem; margin: 0; display: flex; flex-direction: column; gap: 1.25rem; }
.mfa-steps > li::marker { font-weight: 700; color: var(--tc); }
.mfa-step-title { font-weight: 600; font-size: 0.9375rem; color: var(--ink); margin-bottom: 0.15rem; }

.qr-frame {
    padding: 0.75rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    display: inline-block;
}
.mfa-shared-key {
    display: inline-block;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.35rem 0.6rem;
    font-size: 0.8125rem;
    letter-spacing: 0.06em;
    color: var(--ink);
    word-break: break-all;
}
.mfa-code-input {
    width: 150px;
    font-size: 1.25rem;
    letter-spacing: 0.35em;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.recovery-panel {
    border: 1px solid var(--amber);
    background: var(--amber-lt);
    border-radius: var(--r-md);
    padding: 1.1rem 1.25rem;
}
.recovery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.4rem 1rem;
}
.recovery-grid code {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.3rem 0.5rem;
    font-size: 0.8125rem;
    color: var(--ink);
    text-align: center;
    letter-spacing: 0.04em;
}

/* ── Developer: application logs ────────────────────────────────────────── */

.logchip {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    font-size: 0.78125rem;
    font-weight: 600;
    color: var(--ink-500);
    text-decoration: none;
    background: var(--surface);
}
.logchip:hover { border-color: var(--ink-300); color: var(--ink); }
.logchip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.logchip.debug.active       { background: #64748B; border-color: #64748B; }
.logchip.information.active { background: #15803D; border-color: #15803D; }
.logchip.warning.active     { background: #B45309; border-color: #B45309; }
.logchip.error.active       { background: #DC2626; border-color: #DC2626; }
.logchip.fatal.active       { background: #7F1D1D; border-color: #7F1D1D; }

.logpill {
    display: inline-block;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    font-size: 0.71875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.logpill.debug       { background: var(--surface-2); color: #64748B; }
.logpill.information { background: var(--green-lt); color: var(--green); }
.logpill.warning     { background: var(--amber-lt); color: var(--amber); }
.logpill.error       { background: #FEE2E2; color: #DC2626; }
.logpill.fatal       { background: #FECACA; color: #7F1D1D; }

.log-chevron {
    display: inline-block;
    color: var(--ink-300);
    font-size: 1.1rem;
    transition: transform 0.15s ease;
}
.log-row-expandable.open .log-chevron { transform: rotate(90deg); }

.log-pre {
    margin: 0 0 0.75rem 0;
    padding: 0.6rem 0.8rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.75rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 320px;
    overflow: auto;
    color: var(--ink-500);
}
.log-pre.exception { color: #9F1239; background: #FFF1F2; border-color: #FECDD3; }

.logpage {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 0.4rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ink-500);
    text-decoration: none;
    background: var(--surface);
}
.logpage:hover { border-color: var(--ink-300); color: var(--ink); }
.logpage.active { background: var(--tc); border-color: var(--tc); color: #fff; }
.logpage.disabled { opacity: 0.4; pointer-events: none; }

/* ── Organisational context admin ───────────────────────────────────────── */

.orgctx-hero {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--tc);
    border-radius: var(--r-lg);
    padding: 1.5rem 1.75rem;
    box-shadow: var(--sh-md);
}

.orgctx-statement {
    font-family: 'Lora', Georgia, serif;
    font-size: 1.0125rem;
    line-height: 1.75;
    color: var(--ink);
    white-space: pre-wrap;
}

.orgctx-edit-area {
    font-family: 'Lora', Georgia, serif;
    font-size: 0.9375rem;
    line-height: 1.7;
}

.orgctx-version {
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 0.85rem 1rem;
    margin-bottom: 0.75rem;
    background: var(--surface);
}
.orgctx-version.current {
    border-color: var(--tc-mid);
    background: var(--tc-light);
}
.orgctx-version-snippet {
    font-size: 0.8125rem;
    line-height: 1.55;
    color: var(--ink-500);
    margin: 0 0 0.5rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.orgctx-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(31, 39, 51, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}
.orgctx-overlay-card {
    background: var(--surface);
    border-radius: var(--r-lg);
    padding: 2rem 2.5rem;
    text-align: center;
    box-shadow: var(--sh-md);
    max-width: 380px;
}

.orgctx-eg {
    display: inline-block;
    margin: 0.15rem 0.15rem 0 0;
    padding: 0.1rem 0.5rem;
    font-size: 0.71875rem;
    color: var(--ink-500);
    background: var(--surface-alt, rgba(31, 39, 51, 0.04));
    border: 1px solid var(--border);
    border-radius: 999px;
}

/* ── Coachee experience differentiation ─────────────────────────────────── */

.pill.demo-score {
    background: transparent;
    color: #5B21B6;
    border: 1.5px dashed #B197E0;
}

.session-item.session-coachee { background: transparent; }
.session-item.session-coachee:hover { background: rgba(124, 58, 237, 0.04); }

/* Analytics canvas charts (Chart.js) */
.analytics-chart {
    position: relative;
    height: 260px;
}

.analytics-chart--wide {
    height: 300px;
}

/* Org-context: sticky "apply staged changes" bar */
.orgctx-apply-bar {
    position: sticky;
    bottom: 1rem;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
    padding: 0.9rem 1.25rem;
    background: var(--surface);            /* opaque — page content must not bleed through */
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: 0 6px 24px rgb(15 23 41 / .16), 0 0 0 1px rgb(15 23 41 / .03);
}

.orgctx-apply-bar.has-pending {
    border-color: var(--amber, #C2872E);
    background: #FBF2E1;                   /* opaque pale amber, not a translucent tint */
}

.orgctx-apply-text {
    flex: 1 1 320px;
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--ink-500);
}

.orgctx-apply-text strong { color: var(--ink); }

.orgctx-apply-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.4rem;
    margin-right: 0.5rem;
    border-radius: 999px;
    background: var(--tc);
    color: #fff;
    font-weight: 700;
    font-size: 0.8125rem;
    vertical-align: middle;
}
