/* Frank Management – Frank identity (green, Merriweather) with e-vate style navigation. */

:root {
    --green: #467e53;
    --green-dark: #3a6a45;
    --green-soft: #e8f0ea;
    --blue: #065fa0;
    --blue-soft: #eaf2f9;
    --ink: #1d1d1f;
    --muted: #5f6368;
    --line: #e2e6e3;
    --bg: #fbfbfb;
    --card: #ffffff;
    --tint: #fafbfa;        /* faint panel shading */
    --tint-2: #f3f6f4;      /* a little stronger (board menu, preview frames) */
    --hover: #e6ebe7;
    --line-strong: #cad6cd; /* borders that need to show more than --line */
    --blue-tint: #f7fafd;
    --amber: #8a5a00;
    --amber-soft: #fff6d9;
    --red: #b3261e;
    --red-soft: #fdecea;
    --grey-soft: #f0f1f2;
    --radius: 8px;
    --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 2px 8px rgba(0, 0, 0, .04);
    --serif: 'Merriweather', Georgia, serif;
    --sans: 'Open Sans', 'Segoe UI', system-ui, sans-serif;
}

/* ---------- Dark mode ----------
   Chosen in the account menu (Appearance), or following the computer when nothing is chosen. The colours above are
   variables; these are their dark values. Rules below them fix the few places that use a fixed colour. */
:root[data-theme="dark"] {
    --green: #5a9a69;
    --green-dark: #8cc49a;
    --green-soft: #1f2e24;
    --blue: #7cb8e8;
    --blue-soft: #15283a;
    --ink: #e6ebe7;
    --muted: #a3ada6;
    --line: #2d3631;
    --line-strong: #3d4842;
    --bg: #121614;
    --card: #1a201c;
    --tint: #1e2521;
    --tint-2: #222a25;
    --hover: #2a332d;
    --blue-tint: #172330;
    --amber: #e3b45a;
    --amber-soft: #2c2412;
    --red: #f08a80;
    --red-soft: #3a1d1b;
    --grey-soft: #232a26;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 2px 10px rgba(0, 0, 0, .3);
    color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --green: #5a9a69;
        --green-dark: #8cc49a;
        --green-soft: #1f2e24;
        --blue: #7cb8e8;
        --blue-soft: #15283a;
        --ink: #e6ebe7;
        --muted: #a3ada6;
        --line: #2d3631;
        --line-strong: #3d4842;
        --bg: #121614;
        --card: #1a201c;
        --tint: #1e2521;
        --tint-2: #222a25;
        --hover: #2a332d;
        --blue-tint: #172330;
        --amber: #e3b45a;
        --amber-soft: #2c2412;
        --red: #f08a80;
        --red-soft: #3a1d1b;
        --grey-soft: #232a26;
        --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 2px 10px rgba(0, 0, 0, .3);
        color-scheme: dark;
    }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.55;
}

h1, h2, h3 { font-family: var(--serif); color: var(--blue); font-weight: 400; line-height: 1.3; }
h1 { font-size: 1.75rem; margin: 0 0 .25rem; }
h2 { font-size: 1.25rem; margin: 2rem 0 .75rem; }
h3 { font-size: 1.05rem; margin: 1.5rem 0 .5rem; }

a { color: var(--blue); }
a:hover { color: var(--green-dark); }

:focus-visible { outline: 3px solid rgba(70, 126, 83, .45); outline-offset: 2px; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Top bar ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--green);
    color: #fff;
    box-shadow: 0 1px 0 rgba(0, 0, 0, .08);
}

.topbar-inner { display: flex; align-items: center; gap: 20px; height: 60px; }
:root { --topbar-h: 60px; }   /* the top bar's height: taller when its menu wraps (Small screens, below) */
.topbar .container { max-width: none; }   /* the top bar uses the full width, so the menu has room (the pages keep their column) */

/* Logo lock-up: the Frank logo, a thin divider, then the product name. Takes you home; on hover the whole
   lock-up lifts slightly rather than behaving like a text link. */
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: #fff; flex-shrink: 0; margin-right: 14px;
         border-radius: var(--radius); transition: opacity .15s; }
.brand:hover, .brand:focus-visible { color: #fff; opacity: .88; text-decoration: none; }
.brand:focus-visible { outline: 2px solid rgba(255, 255, 255, .7); outline-offset: 4px; }
.brand img { height: 40px; width: auto; display: block; }
.brand-label { font-family: 'Open Sans', sans-serif; font-size: .74rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
               color: rgba(255, 255, 255, .92); padding-left: 14px; border-left: 1px solid rgba(255, 255, 255, .42); line-height: 26px; }

.nav { display: flex; gap: 4px; flex: 1; min-width: 0; }
.nav a {
    color: rgba(255, 255, 255, .92);
    text-decoration: none;
    font-weight: 500;
    font-size: .95rem;
    padding: 7px 14px;
    border-radius: var(--radius);
    white-space: nowrap;
    transition: background .15s;
}
.nav a:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.nav a.is-active { background: rgba(255, 255, 255, .2); color: #fff; }
.help-academy { display: inline-flex; align-items: center; gap: 6px; margin: 12px 0 4px; font-weight: 600; text-decoration: none; }
.help-academy:hover { text-decoration: underline; }
.nav a.nav-academy { margin-left: auto; margin-right: 10px; }   /* the Academy, for everyone: at the right, beside Help */
.nav .nav-sep { width: 1px; background: rgba(255, 255, 255, .25); margin: 8px 6px; }

.topbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    font-size: .85rem;
    font-weight: 600;
    white-space: nowrap;
}
.pill.is-over { background: #f6c343; color: #3d2c00; }

.usermenu { position: relative; }
.usermenu > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px 5px 5px;
    border-radius: 999px;
    color: #fff;
}
.usermenu > summary::-webkit-details-marker { display: none; }
.usermenu > summary:hover { background: rgba(255, 255, 255, .12); }
.avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: #fff; color: var(--green);
    display: grid; place-items: center;
    font-weight: 700; font-size: .8rem;
}
.usermenu-panel {
    position: absolute; right: 0; top: calc(100% + 8px);
    min-width: 240px;
    background: var(--card); color: var(--ink);
    border: 1px solid var(--line); border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .14);
    padding: 8px;
}
.usermenu-panel .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.usermenu-panel .who strong { display: block; }
.usermenu-panel .who span { color: var(--muted); font-size: .85rem; }
.usermenu-panel a, .usermenu-panel button {
    display: block; width: 100%; text-align: left;
    padding: 8px 10px; border-radius: 6px;
    color: var(--ink); text-decoration: none;
    background: none; border: 0; font: inherit; cursor: pointer;
}
.usermenu-panel a:hover, .usermenu-panel button:hover { background: var(--grey-soft); }
/* Appearance: a small three-way switch (Auto · Light · Dark) */
.theme-choice { margin: 2px 0 4px; padding: 6px 10px 8px; }
.theme-label { display: flex; align-items: center; margin-bottom: 6px; color: var(--ink); }
.theme-options { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--grey-soft); }
.usermenu-panel .theme-options button { flex: 1; width: auto; justify-content: center; padding: 5px 8px; border-radius: 999px; text-align: center; font-size: .82rem; color: var(--muted); }
.usermenu-panel .theme-options button:hover { background: var(--card); color: var(--ink); }
.usermenu-panel .theme-options button[aria-pressed="true"] { background: var(--card); color: var(--green-dark); font-weight: 600; box-shadow: var(--shadow); }

/* ---------- Page ---------- */

.page { padding: 28px 0 64px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { margin: .25rem 0 0; color: var(--muted); }

.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--blue); text-decoration: underline; }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 20px 22px;
}
.card + .card { margin-top: 16px; }
.grid-2 > .card { margin-top: 0; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.stat .label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-family: var(--serif); font-size: 1.6rem; color: var(--blue); }

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font: 600 .92rem var(--sans);
    text-decoration: none;
    cursor: pointer;
    background: var(--green); color: #fff;
    transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--green-dark); color: #fff; }
.btn-secondary { background: var(--card); color: var(--green-dark); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--green-soft); color: var(--green-dark); }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: #8f1e18; }
.btn-link { background: none; color: var(--blue); padding: 4px 6px; }
.btn-link:hover { background: var(--blue-soft); color: var(--blue); }
.btn-sm { padding: 5px 12px; font-size: .85rem; }
.btn[disabled], .btn.is-disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: var(--tint); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--tint); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.board-name { font-family: var(--serif); color: var(--blue); font-size: 1rem; }
.sub { display: block; color: var(--muted); font-size: .85rem; }
.empty { padding: 36px; text-align: center; color: var(--muted); }

/* ---------- Badges ---------- */

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.badge-draft { background: var(--grey-soft); color: #444; }
.badge-live { background: var(--green-soft); color: var(--green-dark); }
.badge-frozen { background: var(--blue-soft); color: var(--blue); }
.badge-closed { background: var(--grey-soft); color: #6b5a3d; }
.badge-archived { background: #eee; color: #777; }
.badge-role { background: var(--blue-soft); color: var(--blue); }
.badge-inactive { background: var(--red-soft); color: var(--red); }

/* ---------- Filters ---------- */

.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.chip { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; font-size: .88rem; }
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip.is-active { background: var(--green); border-color: var(--green); color: #fff; }
.chip .count { opacity: .7; margin-left: 4px; }

/* ---------- Forms ---------- */

.form { max-width: 560px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 5px; font-size: .9rem; }
.field .hint { color: var(--muted); font-size: .83rem; margin-top: 4px; }
input[type=text], input[type=email], input[type=number], input[type=date], select, textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    font: 400 .95rem var(--sans);
    background: var(--card);
    color: var(--ink);
}
input:focus, select:focus, textarea:focus { border-color: var(--green); outline: 3px solid rgba(70, 126, 83, .18); }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 4px; }
.field > legend { font-weight: 600; font-size: .9rem; margin-bottom: 5px; padding: 0; }
.field label.check { display: flex; font-weight: 400; margin-bottom: 4px; }
.indent { margin-left: 26px; }
.actions { display: flex; gap: 10px; align-items: center; margin-top: 20px; }
.inline-form { display: flex; gap: 8px; align-items: flex-start; }
.inline-form input { max-width: 320px; }
.field-validation-error, .error-text { color: var(--red); font-size: .85rem; display: block; margin-top: 4px; }
.input-validation-error { border-color: var(--red) !important; }
.validation-summary-errors ul { margin: 0; padding-left: 18px; }

/* ---------- Messages ---------- */

.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 18px; border: 1px solid; }
.alert-success { background: var(--green-soft); border-color: var(--line-strong); color: #234a2d; }
.alert-warning { background: var(--amber-soft); border-color: #f0dc9c; color: var(--amber); }
.alert-danger { background: var(--red-soft); border-color: #f3c3bf; color: var(--red); }
.alert-info { background: var(--blue-soft); border-color: #c6dbee; color: #0b4a7a; }

/* ---------- Audit log ---------- */

.audit-action { font-family: ui-monospace, Consolas, monospace; font-size: .8rem; color: var(--muted); }
.audit-when { white-space: nowrap; color: var(--muted); font-size: .85rem; }
details.changes summary { cursor: pointer; color: var(--blue); font-size: .85rem; }
details.changes pre { white-space: pre-wrap; word-break: break-word; font-size: .78rem; background: var(--tint); padding: 8px; border-radius: 6px; margin: 6px 0 0; }

/* ---------- Footer ---------- */

.footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; padding: 18px 0 28px; }

/* ---------- Sign-in pages (echo frankadvisoryboards.com) ---------- */

.auth {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px 16px;
    background: linear-gradient(rgba(20, 24, 22, .45), rgba(10, 12, 11, .78)),
        url('../images/still1.png') center / cover no-repeat fixed;
    font-family: var(--serif);
}
.auth-logo { position: fixed; top: 0; right: 0; }
.auth-logo img { height: 64px; display: block; }
.auth-card {
    width: 100%;
    max-width: 400px;
    background: rgba(12, 14, 13, .78);
    color: #fff;
    border-radius: 10px;
    padding: 30px 30px 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}
/* The video (wider screens only, sign-in.js): it sits behind the page, so the page keeps only the shading over it,
   and the card lets a little of it show through, blurred, while the inputs stay solid */
.auth-video { display: none; }
@media (min-width: 641px) {
    .auth-video { display: block; position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; }
    .auth.has-video { background: linear-gradient(rgba(20, 24, 22, .45), rgba(10, 12, 11, .78)); }
    .auth.has-video .auth-card {
        background: rgba(12, 14, 13, .60);
        -webkit-backdrop-filter: blur(10px) saturate(1.1);
        backdrop-filter: blur(10px) saturate(1.1);
    }
}
.auth-pause {
    position: fixed; left: 16px; bottom: 16px;
    background: rgba(12, 14, 13, .6); color: rgba(255, 255, 255, .85); border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 999px; padding: 6px 14px; font: 600 .8rem var(--sans); cursor: pointer;
}
.auth-pause:hover, .auth-pause:focus-visible { background: rgba(12, 14, 13, .85); color: #fff; }
.auth-card h1 { color: #fff; font-size: 1.6rem; margin-bottom: 4px; }
.auth-card .lead { color: rgba(255, 255, 255, .78); font-weight: 300; font-size: .92rem; margin: 0 0 20px; }
.auth-card label { color: rgba(255, 255, 255, .85); font-family: var(--sans); font-weight: 600; font-size: .85rem; }
.auth-card input[type=email], .auth-card input[type=text] { border-color: transparent; font-size: 1rem; padding: 11px 12px; }
.auth-card .code-input { font-size: 1.6rem; letter-spacing: .4em; text-align: center; font-family: var(--sans); }
.auth-card .btn { width: 100%; padding: 12px; font-size: 1rem; margin-top: 6px; }
.auth-card .small { color: rgba(255, 255, 255, .7); font-size: .82rem; font-family: var(--sans); margin-top: 16px; text-align: center; }
.auth-card .small a { color: #fff; }
.auth-card .error-text { color: #ffb4ab; }
.auth-card .alert { font-family: var(--sans); font-size: .88rem; }
.auth-foot { margin-top: 18px; text-align: center; color: rgba(255, 255, 255, .6); font-size: .75rem; font-family: var(--sans); }

/* ---------- Small screens ---------- */

@media (max-width: 1240px) {
    .brand-label { display: none; }   /* room for the menu */
}

@media (max-width: 1050px) {
    /* the menu gets its own row under the logo, Help and the account menu */
    .topbar-inner { height: auto; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; gap: 8px; }
    .nav { order: 3; flex-basis: 100%; overflow-x: auto; }
    .topbar-right { margin-left: auto; }
    :root { --topbar-h: 104px; }
}

@media (max-width: 900px) {
    .brand-label { display: none; }
    .nav a { padding: 7px 10px; }
    .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
    .container { padding: 0 16px; }
    .topbar-right .pill { display: none; }
    :root { --topbar-h: 88px; }
}

/* ---------- Small utilities (inline styles are blocked by the security policy) ---------- */

.mt-0 { margin-top: 0; }
.mt-12 { margin-top: 12px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.ml-auto { margin-left: auto; }
.self-center { align-self: center; }
.inline-rename { display: flex; gap: 6px; align-items: center; margin: 0; }
.inline-rename input { max-width: 280px; }
.inline { display: inline; }
.nowrap { white-space: nowrap; }
.w-140 { max-width: 140px; }
.sub.tight { margin-top: -4px; }

/* ---------- Board pages ---------- */

.board-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.board-meta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; color: var(--muted); margin: .35rem 0 0; font-size: .9rem; }

/* ---------- Board menu (down the left of every board page; _BoardNav) ---------- */

:root { --nav-w: 256px; }
.nav-closed { --nav-w: 64px; }

.board-nav {
    position: fixed; top: var(--topbar-h); bottom: 0; left: 0; z-index: 9;
    width: var(--nav-w); padding: 10px 10px 16px;
    display: flex; flex-direction: column; gap: 4px;
    background: var(--tint-2); border-right: 1px solid var(--line);
    overflow-y: auto; overflow-x: hidden; scrollbar-width: thin;
    transition: width .18s ease;
}
.has-board-nav .page, .has-board-nav .footer { margin-left: var(--nav-w); transition: margin-left .18s ease; }
/* Board pages use all the width beside the board menu, and beside the help panel when it's open. */
.has-board-nav .page > .container { max-width: none; margin-left: 0; margin-right: 0; }   /* explicit (not auto) so the help panel's space can animate */
@media (min-width: 1100px) { .has-board-nav.help-open .page > .container { margin-right: 372px; } }
/* ...but a single form field stays a comfortable reading width (tables, card grids and the email editor use it all). */
.has-board-nav .page .field { max-width: 920px; }
.board-nav-backdrop { display: none; }

.board-nav-top { display: flex; align-items: center; justify-content: space-between; gap: 4px; min-height: 36px; }
.board-nav-back, .board-nav-toggle {
    display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border-radius: 8px;
    color: var(--muted); font: 600 .84rem var(--sans); text-decoration: none; background: none; border: 0; cursor: pointer; white-space: nowrap;
}
.board-nav-back:hover, .board-nav-toggle:hover { background: var(--hover); color: var(--ink); }
.board-nav-toggle { padding: 0 8px; }
.board-nav .icon.material-symbols-outlined { font-size: 20px; margin: 0; flex-shrink: 0; }

.board-nav-board { padding: 10px 10px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.board-nav-board strong {
    font-family: var(--serif); font-weight: 400; font-size: .92rem; line-height: 1.35; color: var(--blue);
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

.board-nav-list { display: flex; flex-direction: column; gap: 1px; }
.board-nav-group { margin: 14px 10px 4px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); white-space: nowrap; }
.board-nav-item {
    display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 10px; border-radius: 8px;
    color: #3b433d; text-decoration: none; font-size: .9rem; white-space: nowrap;
}
.board-nav-item .icon.material-symbols-outlined { color: #6b756d; }
.board-nav-item:hover { background: var(--hover); color: var(--ink); }
.board-nav-item.is-active { background: #dde8df; color: var(--green-dark); font-weight: 600; }
.board-nav-item.is-active .icon.material-symbols-outlined { color: var(--green-dark); }
.board-nav-item .nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav-mark { display: grid; place-items: center; }
.nav-mark .icon.material-symbols-outlined { font-size: 17px; }
.nav-mark.is-done .icon.material-symbols-outlined { color: var(--green); }
.nav-mark.is-todo .icon.material-symbols-outlined { color: #b8bfb9; }
.board-nav-golive { margin-top: 6px; border: 1px solid var(--line-strong); background: var(--card); }
.board-nav-golive .icon.material-symbols-outlined { color: var(--green-dark); }

/* Collapsed: icons only, centred; the labels, board name and group names are hidden. */
.board-nav .nav-label, .nav-mark { transition: opacity .15s ease; }
.nav-closed .board-nav .nav-label, .nav-closed .nav-mark { opacity: 0; pointer-events: none; }
.nav-closed .board-nav-board { display: none; }
.nav-closed .board-nav-top { flex-direction: column; align-items: flex-start; }
.nav-closed .board-nav-item, .nav-closed .board-nav-back, .nav-closed .board-nav-toggle { padding: 0 10px; }   /* icons land in the middle of the rail */
.nav-closed .board-nav-group { height: 1px; margin: 10px 8px; background: var(--line); font-size: 0; }
.board-nav-toggle .when-closed, .nav-closed .board-nav-toggle .when-open { display: none; }
.nav-closed .board-nav-toggle .when-closed { display: inline-flex; }
.board-menu-button { display: none; margin-bottom: 12px; }

/* Floating tooltip beside the menu (site.js). */
.nav-tip {
    position: fixed; z-index: 40; transform: translateY(-50%); max-width: 260px; pointer-events: none;
    padding: 7px 10px; border-radius: 8px; background: #1f2a23; color: #fff; font: 400 .8rem/1.4 var(--sans);
    box-shadow: 0 6px 20px rgba(0, 0, 0, .18); opacity: 0; transition: opacity .1s;
}
.nav-tip.is-shown { opacity: 1; }

/* Phones and small tablets: the menu slides in over the page from a "Board menu" button. */
@media (max-width: 900px) {
    .has-board-nav .page, .has-board-nav .footer { margin-left: 0; }
    .board-nav { width: 280px; transform: translateX(-100%); transition: transform .2s ease; z-index: 30; box-shadow: none; }
    .nav-closed .board-nav .nav-label, .nav-closed .nav-mark { opacity: 1; pointer-events: auto; }
    .nav-closed .board-nav-board { display: flex; }
    .nav-closed .board-nav-item, .nav-closed .board-nav-back { padding: 0 10px; }
    .nav-closed .board-nav-top { flex-direction: row; }
    .nav-closed .board-nav-group { height: auto; margin: 14px 10px 4px; background: none; font-size: .7rem; }
    .nav-drawer-open .board-nav { transform: none; box-shadow: 0 10px 40px rgba(0, 0, 0, .25); }
    .nav-drawer-open .board-nav-backdrop { display: block; position: fixed; inset: var(--topbar-h) 0 0 0; z-index: 29; background: rgba(20, 30, 24, .35); }
    .board-menu-button { display: inline-flex; }
}

.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: 10px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist .mark { font-weight: 700; width: 1.2em; text-align: center; }
.checklist .ok .mark { color: var(--green); }
.checklist .todo .mark { color: var(--red); }
.checklist .detail { color: var(--muted); font-size: .85rem; margin-left: auto; }

.action-list { display: flex; flex-direction: column; gap: 10px; }
.action-list form { margin: 0; }
.action-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.action-row:last-child { border-bottom: 0; }
.action-row p { margin: 2px 0 0; color: var(--muted); font-size: .85rem; }

.frank-preview {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px 16px;
    background: var(--card);
    font-family: var(--serif);
    font-weight: 300;
    font-size: .92rem;
}
.frank-preview .modalTitle { font-size: 1.2rem; color: var(--blue); margin-bottom: 8px; font-weight: 400; }
.frank-preview p { margin: 0 0 8px; }

.text-block { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
.text-block:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.placeholders code { background: var(--grey-soft); padding: 1px 5px; border-radius: 4px; font-size: .82rem; }

.row-grid { display: grid; gap: 8px; align-items: start; }
.row-grid.agenda { grid-template-columns: 2fr 1.2fr 1.2fr auto; }
.row-grid.compliance { grid-template-columns: 70px 1fr auto; }
.row-grid .head { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.row-grid textarea { min-height: 64px; }
.remove-check { display: flex; align-items: center; gap: 4px; font-size: .82rem; color: var(--muted); padding-top: 9px; white-space: nowrap; }

.confirm-box { border: 1px solid #f0dc9c; background: var(--amber-soft); border-radius: 8px; padding: 12px 14px; margin: 14px 0; }
.danger-zone { border-color: #f3c3bf; }
.danger-zone h3 { color: var(--red); }

@media (max-width: 800px) {
    .row-grid.agenda { grid-template-columns: 1fr; }
    .row-grid .head { display: none; }
}
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.plain .card + .card, fieldset.plain > .card { margin-bottom: 16px; }
details > summary { cursor: pointer; color: var(--blue); font-weight: 600; }

/* ---------- Topics & questions ---------- */

.topic-card { margin-bottom: 16px; }
.topic-card + .topic-card { margin-top: 0; }
.topic-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.row-actions { display: flex; gap: 2px; align-items: center; flex-shrink: 0; }
.row-actions .btn[disabled] { opacity: .3; }
.question-list { list-style: none; margin: 12px 0; padding: 0; border-top: 1px solid var(--line); }
.question-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.q-number {
    flex-shrink: 0;
    width: 34px; height: 34px; border-radius: 50%;
    border: 1px solid #c6dbee; color: var(--blue);
    display: grid; place-items: center;
    font-weight: 600; font-size: .9rem;
}
.q-body { flex: 1; min-width: 0; font-family: var(--serif); font-weight: 300; }
.q-body .board-meta { font-family: var(--sans); margin-top: 4px; font-size: .82rem; }

/* ---------- People ---------- */

.grid-3 { display: grid; grid-template-columns: 120px 1fr 1fr; gap: 12px; }
.people-list { list-style: none; margin: 8px 0 0; padding: 0; }
.person-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.person-row.found { border-top: 0; padding-top: 0; }
.person-photo { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--grey-soft); }
.person-photo.placeholder { display: grid; place-items: center; color: var(--green-dark); background: var(--green-soft); font-weight: 700; }
.person-body { flex: 1; min-width: 0; }
.person-name { font-family: var(--serif); color: var(--blue); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.person-actions { display: flex; gap: 4px; align-items: center; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.role-select { width: auto; padding: 5px 8px; font-size: .85rem; }

@media (max-width: 800px) {
    .grid-3 { grid-template-columns: 1fr; }
    .person-row { flex-wrap: wrap; }
}

/* ---------- Help panel: a floating card over the right-hand side (the page keeps its full width) ---------- */

.help-panel {
    position: fixed;
    top: calc(var(--topbar-h) + 12px);
    right: 16px;
    z-index: 20;
    width: 340px;
    max-height: calc(100vh - var(--topbar-h) - 28px);
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 12px 36px rgba(20, 30, 24, .16), 0 2px 6px rgba(20, 30, 24, .06);
    font-size: .88rem;
    /* Slides in from the right when opened, out when closed (hidden, not just moved, so it leaves the tab order). */
    transition: transform .22s cubic-bezier(.2, .8, .2, 1), opacity .18s ease, visibility 0s linear 0s;
}

.help-closed .help-panel {
    transform: translateX(calc(100% + 24px)); opacity: 0; visibility: hidden; pointer-events: none;
    transition: transform .2s cubic-bezier(.4, 0, 1, 1), opacity .18s ease, visibility 0s linear .2s;
}
/* The page makes room for (or takes back the space of) the panel at the same pace. */
.has-help .page > .container { transition: margin .22s cubic-bezier(.2, .8, .2, 1); }
.help-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 12px 10px 18px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.help-head strong { font-family: var(--serif); color: var(--green-dark); font-weight: 400; font-size: 1.05rem; }
.help-close {
    width: 30px; height: 30px; border-radius: 8px; border: 0; background: none; cursor: pointer;
    color: var(--muted); font: 400 1.35rem/1 var(--sans);
}
.help-close:hover { background: var(--grey-soft); color: var(--ink); }
.help-body { padding: 14px 18px 18px; overflow-y: auto; color: #3c4043; line-height: 1.55; }
.help-body h4 { font-family: var(--serif); color: var(--blue); font-weight: 400; font-size: .98rem; margin: 16px 0 4px; }
.help-body h4:first-child { margin-top: 0; }
.help-body p { margin: 0 0 8px; }
.help-body ul, .help-body ol { margin: 0 0 8px; padding-left: 18px; }
.help-body li { margin-bottom: 3px; }
.help-body .help-note { background: var(--amber-soft); border-radius: 6px; padding: 8px 10px; color: var(--amber); }

/* Top-bar button that shows/hides the card (like a panel icon). */
.help-toggle {
    display: inline-flex; align-items: center; gap: 6px;
    height: 34px; padding: 0 12px; border-radius: 999px; border: 0; cursor: pointer;
    background: rgba(255, 255, 255, .14); color: #fff; font: 600 .85rem var(--sans);
}
.help-toggle:hover { background: rgba(255, 255, 255, .24); }
.help-open .help-toggle { background: var(--card); color: var(--green-dark); }

/* Wide screens: slide the page left so the card sits beside it rather than over the buttons.
   1200px page + 340px card + gaps. Narrower screens keep the full-width page with the card floating over it. */
@media (min-width: 1590px) {
    .has-help.help-open .page > .container { margin-left: max(16px, calc((100vw - 1200px - 372px) / 2)); margin-right: 372px; }
    .has-board-nav.has-help.help-open .page > .container { margin-left: 0; }   /* board pages already use the full width */
}

@media (max-width: 700px) {
    .help-panel { left: 12px; right: 12px; width: auto; top: auto; bottom: 12px; max-height: 70vh; }
    .help-closed .help-panel { transform: translateY(calc(100% + 24px)); }   /* phones: slides up from the bottom */
    .help-toggle span { display: none; }
}

/* ---------- Tooltips (<tip>…</tip>, or any element with data-tip) ---------- */

.tip {
    display: inline-grid; place-items: center;
    width: 17px; height: 17px; margin-left: 5px;
    border-radius: 50%; background: var(--blue-soft); color: var(--blue);
    font: 700 .7rem var(--sans); cursor: help; vertical-align: 1px;
}
.tip:hover, .tip:focus { background: var(--blue); color: #fff; outline: none; }
[data-tip] { position: relative; }
[data-tip]::after {
    content: attr(data-tip);
    position: absolute; left: 50%; bottom: calc(100% + 10px);
    transform: translateX(-50%) translateY(4px);
    width: max-content; max-width: 280px;
    padding: 8px 11px; border-radius: 8px;
    background: #1f2a23; color: #fff;
    font: 400 .8rem/1.45 var(--sans); text-align: left; white-space: normal; letter-spacing: 0; text-transform: none;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity .12s, transform .12s;
    z-index: 30;
    display: none; /* hidden tooltips take no space, so they can't widen the page on phones */
}
[data-tip]::before {
    content: ""; position: absolute; left: 50%; bottom: calc(100% + 4px); transform: translateX(-50%);
    border: 6px solid transparent; border-top-color: #1f2a23;
    opacity: 0; visibility: hidden; transition: opacity .12s; z-index: 30;
    display: none;
}
[data-tip]:hover::after, [data-tip]:focus-visible::after, [data-tip]:focus::after { display: block; opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
[data-tip]:hover::before, [data-tip]:focus-visible::before, [data-tip]:focus::before { display: block; opacity: 1; visibility: visible; }
.tip-left::after, [data-tip-side="left"]::after { left: auto; right: -6px; transform: translateY(4px); }
.tip-left:hover::after, .tip-left:focus::after, [data-tip-side="left"]:hover::after { transform: translateY(0); }
.tip-right::after, [data-tip-side="right"]::after { left: -6px; transform: translateY(4px); }
.tip-right:hover::after, .tip-right:focus::after, [data-tip-side="right"]:hover::after { transform: translateY(0); }
/* Disabled buttons still need to show why they're disabled. */
.btn.is-disabled[data-tip] { pointer-events: auto; cursor: not-allowed; }
/* Greyed with colours rather than opacity when it has a tooltip, so the tooltip itself isn't see-through. */
.btn.is-disabled[data-tip-float] { opacity: 1; background: var(--grey-soft); color: #8a8f94; border-color: var(--line); }
.btn.is-disabled[data-tip-float]:hover { background: var(--grey-soft); color: #8a8f94; }
[data-tip-float]::after, [data-tip-float]::before { content: none; display: none !important; }

/* ---------- Rich text editor ---------- */

.rte { border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--card); }
.rte:focus-within { border-color: var(--green); outline: 3px solid rgba(70, 126, 83, .18); }
.rte-toolbar { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; padding: 6px; border-bottom: 1px solid var(--line); background: var(--tint); border-radius: var(--radius) var(--radius) 0 0; }
.rte-toolbar button {
    min-width: 30px; height: 30px; padding: 0 8px; border: 1px solid transparent; border-radius: 6px;
    background: none; color: var(--ink); cursor: pointer; font: 600 .85rem var(--sans);
}
.rte-toolbar button:hover { background: var(--grey-soft); border-color: var(--line); }
.rte-toolbar button.is-on { background: var(--green-soft); border-color: var(--line-strong); color: var(--green-dark); }
.rte-toolbar .sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.rte-toolbar select { width: auto; max-width: 100%; min-width: 0; padding: 4px 6px; font-size: .82rem; height: 30px; }
.rte-toolbar .rte-mode { margin-left: auto; }
.rte-surface { min-height: 120px; max-height: 420px; overflow-y: auto; padding: 12px 14px; outline: none; border: 0; border-radius: 0 0 var(--radius) var(--radius); }
.rte-surface:empty::before { content: attr(data-placeholder); color: #9aa0a6; }
.rte-source { width: 100%; min-height: 160px; border: 0; border-radius: 0 0 var(--radius) var(--radius); font: .82rem/1.5 ui-monospace, Consolas, monospace; padding: 12px 14px; resize: vertical; }
.rte-source:focus { outline: none; }
.rte.is-code .rte-surface { display: none; }
.rte:not(.is-code) .rte-source.js-hidden { display: none; }
.rte.is-code .rte-toolbar button:not(.rte-mode), .rte.is-code .rte-toolbar select { opacity: .35; pointer-events: none; }
/* Smaller editors for topic titles (one line) and questions / descriptions. */
.rte-inline .rte-surface { min-height: 0; max-height: none; padding: 8px 12px; }
.rte-inline .rte-source { min-height: 60px; }
.rte-basic .rte-surface { min-height: 72px; }
.rte-basic .rte-source { min-height: 110px; }
/* Plain start (topics and questions): an ordinary text box until "Formatting options" is clicked. */
.rte.is-plain .rte-source { font: inherit; font-size: .95rem; padding: 9px 12px; border-radius: var(--radius); }
.rte.is-plain.rte-inline .rte-source { min-height: 0; resize: none; }
.rte.is-plain.rte-basic .rte-source { min-height: 80px; }
.rte-advanced { display: block; margin: 4px 0 0 auto; background: none; border: 0; padding: 2px 0; color: var(--blue, #065fa0); font-size: .8rem; cursor: pointer; }
.rte-advanced:hover { text-decoration: underline; }
/* Tooltips on things near the top of the page open downwards. */
[data-tip-pos="below"]::after { bottom: auto; top: calc(100% + 10px); transform: translateX(-50%) translateY(-4px); color: #fff; }
[data-tip-pos="below"]::before { bottom: auto; top: calc(100% + 4px); border-top-color: transparent; border-bottom-color: #1f2a23; }
[data-tip-pos="below"][data-tip-side="left"]::after { left: auto; right: 0; transform: translateY(-4px); }
[data-tip-pos="below"][data-tip-side="left"]:hover::after, [data-tip-pos="below"][data-tip-side="left"]:focus::after { transform: translateY(0); }

/* ---------- Support contacts (bottom of the help panel) ---------- */

.support-box { margin-top: 16px; padding: 12px; border-radius: 8px; background: var(--green-soft); }
.support-box h4 { margin-top: 0 !important; color: var(--green-dark); }
.support-box p { font-size: .84rem; }
.support-link { display: flex; align-items: center; gap: 8px; padding: 7px 10px; margin-top: 6px; border-radius: 6px; background: var(--card); color: var(--green-dark); text-decoration: none; font-weight: 600; font-size: .85rem; word-break: break-all; }
.support-link:hover { background: var(--green); color: #fff; }
.support-link svg { flex-shrink: 0; }

/* ---------- Editing topics and questions in place ---------- */

.topic-card, .question-row { scroll-margin-top: 90px; }
.edit-link { color: inherit; text-decoration: none; border-radius: 4px; }
.edit-link:hover { color: var(--blue); text-decoration: underline; text-decoration-color: #9cc0e0; text-underline-offset: 3px; }
h3 .edit-link { color: var(--blue); }
.q-text { display: block; }
.topic-card.is-editing, .question-row.is-editing { background: var(--tint); }
.topic-card.is-editing { border-color: var(--line-strong); box-shadow: 0 0 0 3px rgba(70, 126, 83, .12); }
.question-row.is-editing { display: block; padding: 14px; margin: 8px 0; border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: 0 0 0 3px rgba(70, 126, 83, .12); }
.inline-editor .field { margin-bottom: 12px; }
.inline-editor .actions { margin-top: 8px; }
.editor-label { margin: 0 0 10px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--green-dark); display: flex; gap: 8px; align-items: center; }
.question-editor-main { display: flex; gap: 12px; align-items: flex-start; }
.q-number-field { width: 76px; flex-shrink: 0; }
.q-number-field input { text-align: center; }
.grow { flex: 1; min-width: 0; }
.question-editor textarea#q-text { font-family: var(--serif); font-weight: 300; font-size: 1rem; }
.move-field { padding-top: 10px; border-top: 1px dashed var(--line); }
.w-auto { width: auto; }
details.field > summary { font-weight: 600; font-size: .9rem; }

/* Briefly highlight the item you've just saved or moved (the page returns to it via #q-123 / #t-45). */
@keyframes saved-flash { from { background: var(--amber-soft); } to { background: transparent; } }
.question-row:target, .topic-card:target .topic-head { animation: saved-flash 2s ease-out; }

/* ---------- Topics & questions: outline on the left, selected item on the right ---------- */

.editor-shell { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
.editor-main { min-width: 0; }

.outline {
    position: sticky; top: calc(var(--topbar-h) + 16px);
    max-height: calc(100vh - 92px);
    display: flex; flex-direction: column;
    background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
}
.outline-head { padding: 12px 14px 10px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.outline-head strong { font-family: var(--serif); font-weight: 400; color: var(--green-dark); }
.outline-list { overflow-y: auto; padding: 6px; flex: 1; }
.outline-foot { display: flex; gap: 6px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--line); }
.outline-empty { padding: 8px 10px; margin: 0; }

.outline-topic { margin-bottom: 2px; }
.outline-topic > summary { list-style: none; display: flex; align-items: flex-start; gap: 2px; cursor: pointer; }
.outline-topic > summary::-webkit-details-marker { display: none; }
.outline-topic .chev { width: 18px; height: 30px; flex-shrink: 0; display: grid; place-items: center; color: var(--muted); }
.outline-topic .chev::before { content: ""; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; }
.outline-topic[open] .chev::before { transform: rotate(45deg); }
.outline-topic ul { list-style: none; margin: 0 0 6px 18px; padding: 0; border-left: 1px solid var(--line); }

.outline-link {
    display: flex; gap: 8px; align-items: flex-start; flex: 1; min-width: 0;
    padding: 6px 8px; border-radius: 7px; text-decoration: none; color: var(--ink); font-size: .86rem; line-height: 1.35;
}
.outline-link:hover { background: var(--grey-soft); color: var(--ink); }
.outline-link.is-active { background: var(--green-soft); color: var(--green-dark); font-weight: 600; }
.outline-link.topic { font-family: var(--serif); font-size: .9rem; }
.outline-link.topic .o-num { font-family: var(--sans); font-weight: 700; color: var(--green); min-width: 14px; }
.outline-link.question { margin-left: 6px; }
.outline-link .o-text { flex: 1; min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.outline-link .o-qnum { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; border: 1px solid #c6dbee; color: var(--blue); display: grid; place-items: center; font-size: .72rem; font-weight: 700; }
.outline-link .o-count { flex-shrink: 0; font-size: .72rem; font-weight: 700; color: var(--muted); background: var(--grey-soft); border-radius: 999px; padding: 1px 7px; }
.outline-link .o-flag { font-size: .8rem; }
.outline-link.add { color: var(--green-dark); font-weight: 600; margin-left: 6px; }

.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 12px; }
.panel-head h2 { margin-bottom: 4px; }
.eyebrow { margin: 0 0 4px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.eyebrow a { color: var(--green-dark); text-decoration: none; }
.eyebrow a:hover { text-decoration: underline; }
.topic-form { margin-bottom: 8px; }
.question-list.flush { margin: 0; border-top: 0; }
.question-list.flush .question-row:first-child { border-top: 0; }

.q-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.q-nav-link { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); text-decoration: none; color: var(--ink); min-width: 0; }
.q-nav-link span { font-size: .78rem; font-weight: 700; color: var(--green-dark); text-transform: uppercase; letter-spacing: .04em; }
.q-nav-link strong { font-family: var(--serif); font-weight: 300; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-nav-link:hover { border-color: var(--line-strong); background: var(--tint); color: var(--ink); }
.q-nav-link.next { text-align: right; }

@media (max-width: 900px) {
    .editor-shell { grid-template-columns: 1fr; }
    .outline { position: static; max-height: 320px; }
}

/* ---------- Photo cropper (Edit person) ---------- */
.photo-editor { border-top: 1px solid var(--line); padding-top: 14px; }
.photo-pick { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.photo-pick[hidden] { display: none; }
.file-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.photo-pick label.btn { position: relative; cursor: pointer; }
.photo-pick label.btn:focus-within { outline: 3px solid rgba(70, 126, 83, .35); }
.cropper { display: grid; grid-template-columns: auto 1fr; gap: 18px 24px; align-items: start; margin-top: 4px; }
.cropper[hidden] { display: none; }
.cropper .actions { grid-column: 1 / -1; margin-top: 0; }
/* The stage is the circle: the photo outside it is dimmed, and the circle shows Frank's inner shadow. */
.crop-stage { position: relative; width: 280px; height: 280px; overflow: hidden; border-radius: var(--radius); background: #1d1d1f;
              touch-action: none; cursor: grab; user-select: none; }
.crop-stage.is-dragging { cursor: grabbing; }
.crop-stage:focus-visible { outline: 3px solid rgba(70, 126, 83, .5); outline-offset: 2px; }
.crop-stage::after { content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
                     box-shadow: 0 0 0 400px rgba(0, 0, 0, .55), inset 0 4px 4px rgba(0, 0, 0, .7), inset 0 0 0 1px rgba(0, 0, 0, .2); }
.crop-img { position: absolute; top: 0; left: 0; max-width: none; transform-origin: 0 0; pointer-events: none; }
.crop-zoom-label { display: flex; gap: 10px; align-items: center; font-weight: 600; font-size: .9rem; }
.crop-zoom { flex: 1; min-width: 140px; }
.crop-preview-box { display: flex; gap: 12px; align-items: center; margin-top: 14px; }
/* Actual Frank size (75px), with an approximation of the baked-in shadow. */
.preview-circle { position: relative; display: block; width: 75px; height: 75px; border-radius: 50%; overflow: hidden; }
.preview-circle canvas { display: block; width: 75px; height: 75px; }
.preview-circle::after { content: ""; position: absolute; inset: 0; border-radius: 50%;
                         box-shadow: inset 0 1px 1.5px rgba(0, 0, 0, .85), inset 0 0 0 1px rgba(0, 0, 0, .18); }
@media (max-width: 600px) {
    .cropper { grid-template-columns: 1fr; }
    .crop-stage { width: 260px; height: 260px; }
}

/* ---------- Documents ---------- */
.doc-list { list-style: none; padding: 0; margin: 0; }
.doc-row { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.doc-row:last-child { border-bottom: 0; }
.doc-icon { flex-shrink: 0; width: 42px; height: 52px; border-radius: 4px; display: grid; place-items: center; font-size: .72rem; font-weight: 700; color: #fff; background: #b3261e; }
.doc-icon.is-slides { background: #c55a11; }
.doc-icon.is-other { background: var(--muted); }
.doc-body { flex: 1; min-width: 0; }
.doc-title { font-weight: 600; }
.placement .check { margin-bottom: 6px; }
.placement [hidden] { display: none; }
.question-picker { margin-top: 8px; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; background: var(--card); }
.question-picker summary { cursor: pointer; }
.picker-topic { margin-top: 10px; }
.picker-topic-title { font-weight: 600; color: var(--blue); margin: 0 0 4px; font-size: .9rem; }
.plain-list { list-style: none; padding: 0; margin: 0 0 10px; }
.plain-list li { padding: 4px 0; }
.question-docs { margin-top: 14px; }
.crop-status { display: inline-flex; gap: 8px; align-items: center; color: var(--muted); font-size: .9rem; }
.crop-status[hidden] { display: none; }
.crop-stage.is-saving { pointer-events: none; opacity: .85; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--green); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.5s; } }

/* ---------- Inactivity warning ---------- */
.idle-dialog { max-width: 420px; border: 0; border-radius: var(--radius); padding: 22px 24px; box-shadow: 0 12px 40px rgba(0, 0, 0, .25); }
.idle-dialog::backdrop { background: rgba(0, 0, 0, .45); }
.idle-dialog h2 { margin-top: 0; }
.idle-dialog .actions { margin-top: 14px; }
.idle-seconds { font-variant-numeric: tabular-nums; }

/* ---------- Progress ---------- */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.kpi-label { color: var(--muted); font-size: .82rem; }
.kpi-value { font-family: 'Open Sans', sans-serif; font-weight: 600; font-size: 1.6rem; color: var(--blue); margin: 2px 0 6px; }
.kpi-of { font-size: .9rem; color: var(--muted); font-weight: 400; }
.meter { display: block; width: 100%; height: 8px; }
.meter-cell { display: inline-flex; gap: 8px; align-items: center; min-width: 150px; }
.meter-cell .meter { width: 100px; flex-shrink: 0; }
.meter-text { font-size: .85rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart-scroll { overflow-x: auto; }
.chart { display: block; width: 100%; min-width: 560px; height: auto; }   /* stays readable on phones; scrolls sideways */
.chart-tick { font: 11px 'Open Sans', sans-serif; font-variant-numeric: tabular-nums; }
.chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; align-items: baseline; }
.legend { display: flex; gap: 16px; font-size: .85rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.swatch-answer { background: #065fa0; }
.swatch-comment { background: #3a8a4f; }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; margin: 18px 0 12px; background: var(--card); }
.segmented a { padding: 6px 16px; border-radius: 999px; text-decoration: none; color: var(--muted); font-size: .9rem; }
.segmented a.is-active { background: var(--green); color: #fff; }
.progress-table td { vertical-align: middle; }
.progress-table td.num { white-space: nowrap; }
/* Give names room (two lines at most) and keep the small columns small. */
.progress-table th, .progress-table td { padding-left: 10px; padding-right: 10px; }
.progress-table th { letter-spacing: .02em; }
.progress-table th:first-child { min-width: 190px; }
.progress-table .nowrap { white-space: nowrap; }
.progress-table th.center { width: 1%; }

/* Lists where each row opens more detail: a hint above, a hover highlight and a chevron. */
.list-hint { display: flex; align-items: center; gap: 6px; margin: 14px 0 8px; font-size: .88rem; color: var(--muted); }
.list-hint .icon.material-symbols-outlined { font-size: 18px; color: var(--blue); opacity: .8; }
.is-clickable tbody tr[data-row-href] { cursor: pointer; transition: background .12s; }
.is-clickable tbody tr[data-row-href]:hover { background: var(--tint-2); }
.is-clickable tbody tr[data-row-href]:hover .person-cell span:last-child { text-decoration: underline; }
.row-go { width: 28px; padding-left: 0 !important; color: #9aa59d; }
.row-go .icon.material-symbols-outlined { font-size: 22px; vertical-align: middle; transition: transform .12s, color .12s; }
.is-clickable tbody tr[data-row-href]:hover .row-go .icon.material-symbols-outlined { color: var(--green-dark); transform: translateX(3px); }
.qp-chev { flex-shrink: 0; color: #9aa59d; display: grid; place-items: center; }
.qp-chev .icon.material-symbols-outlined { font-size: 22px; transition: transform .15s; }
.question-progress details[open] > summary .qp-chev .icon.material-symbols-outlined { transform: rotate(180deg); }
.question-progress summary:hover .qp-chev { color: var(--green-dark); }
.progress-table .center { text-align: center; }
.tick { color: #3a8a4f; font-weight: 700; }
.person-cell { display: inline-flex; gap: 10px; align-items: center; text-decoration: none; }
.person-photo.sm { width: 32px; height: 32px; font-size: .75rem; }
.others { margin-top: 14px; }
.others summary { cursor: pointer; }
.topic-progress { margin-bottom: 14px; }
.question-progress { list-style: none; padding: 0; margin: 0; }
.question-progress > li { border-top: 1px solid var(--line); }
.question-progress summary { display: flex; gap: 12px; align-items: center; padding: 10px 0; cursor: pointer; list-style: none; }
.question-progress summary::-webkit-details-marker { display: none; }
.qp-text { flex: 1; min-width: 0; }
.qp-stats { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.post { border-left: 3px solid #d7e4ef; padding: 6px 0 6px 12px; margin: 8px 0 12px; }
.post-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.post-head .sub { display: inline; }
.post-body { margin-top: 4px; line-height: 1.55; overflow-wrap: anywhere; }
.comments { list-style: none; padding: 0 0 0 14px; margin: 8px 0 0; border-left: 2px solid #dcebdf; }
.comments li { padding: 4px 0 8px; }
.comments .sub { display: inline; margin-left: 6px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px 20px; margin: 14px 0 0; }
.facts dt { color: var(--muted); font-size: .8rem; }
.facts dd { margin: 2px 0 0; }
.person-question { padding: 10px 0; border-top: 1px solid var(--line); }
.person-question:first-of-type { border-top: 0; }
.pq-title { font-weight: 600; margin: 0 0 4px; display: flex; gap: 10px; }
.person-question.is-gap .pq-title { color: var(--muted); font-weight: 400; }
.gap-note { font-style: italic; }
.post.elsewhere { border-left-color: #dcebdf; }
.quoted { margin: 4px 0; padding: 6px 10px; background: var(--tint); border-radius: 4px; color: var(--muted); font-size: .9rem; max-height: 6.5em; overflow: hidden; }
@media (max-width: 700px) {
    .question-progress summary { flex-wrap: wrap; }
    .qp-stats { align-items: flex-start; width: 100%; padding-left: 38px; }
}

/* ---------- Icons (Material Symbols Outlined, light weight) ----------
   Small, thin and a little muted, always beside a text label. A fixed box so nothing moves while the font loads. */
.icon.material-symbols-outlined {
    display: inline-block; width: 1.2em; height: 1em; overflow: hidden;
    font-size: 1.2em; line-height: 1; vertical-align: -0.24em; margin-right: .4em;
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 20;
    opacity: .8; user-select: none; flex-shrink: 0;
}
.btn .icon.material-symbols-outlined { margin-right: 0; vertical-align: 0; opacity: .9; }   /* .btn already spaces with gap */
.nav a, .segmented a { display: inline-flex; align-items: center; }
.usermenu-panel a, .usermenu-panel button { display: flex; align-items: center; }
.kpi-label .icon.material-symbols-outlined { color: var(--blue); opacity: .7; }
.help-toggle .icon.material-symbols-outlined { margin-right: .3em; opacity: .9; }

/* ---------- Emails ---------- */
.setup-card h3 { display: flex; align-items: center; }
.setup-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.setup-form select { width: auto; min-width: 260px; max-width: 100%; }
.email-stage { margin: 26px 0 10px; font-size: 1.15rem; }
/* Every card is the same size: long text is cut to a set number of lines (the full text is in the tooltip). */
.email-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); grid-auto-rows: 1fr; gap: 14px; }
.email-cards > .email-card { display: flex; flex-direction: column; gap: 8px; margin: 0; min-height: 236px; }
.email-card-head { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.email-card-head h3 { margin: 0; font-size: 1.05rem; line-height: 1.3; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.email-when, .email-subject { margin: 0; font-size: .88rem; line-height: 1.45; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.email-when { color: var(--muted); -webkit-line-clamp: 3; min-height: calc(3 * 1.45em); }
.email-subject { -webkit-line-clamp: 2; min-height: calc(2 * 1.45em); overflow-wrap: anywhere; }
.email-subject .sub { display: inline; margin-right: 6px; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.email-notes { margin: 0; min-height: 1.4em; font-size: .8rem; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; }
.email-notes .is-check { color: var(--amber); }
.email-card-actions { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); display: flex; gap: 4px 10px; align-items: center; flex-wrap: wrap; }
.email-ready-count { display: inline-flex; align-items: center; gap: 4px; margin-right: 12px; font-weight: 600; color: var(--green-dark); }

/* Where an email is in being checked (see _EmailStatus). */
.email-status { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; white-space: nowrap;
    font-size: .74rem; font-weight: 700; padding: 3px 9px 3px 7px; border-radius: 999px; }
.email-status .icon { font-size: 16px; }
.email-status.is-ready { background: var(--green-soft); color: var(--green-dark); }
.email-status.is-tested { background: var(--blue-soft); color: var(--blue); }
.email-status.is-unchecked { background: var(--amber-soft); color: var(--amber); }
.email-status.is-problem { background: var(--red-soft); color: var(--red); }
.email-status.is-missing { background: var(--grey-soft); color: #555; }
.email-issues { list-style: none; padding: 0; margin: 6px 0 0; font-size: .85rem; }
.email-issues li { padding: 3px 0 3px 18px; position: relative; }
.email-issues li::before { content: "●"; position: absolute; left: 2px; font-size: .7rem; top: 5px; }
.email-issues li.is-problem { color: var(--red); }
.email-issues li.is-check { color: var(--amber); }
.badge-danger-soft { background: var(--red-soft); color: var(--red); }
.system-emails, .recopy, .email-original, .email-codes { margin-top: 18px; }
.system-emails summary, .recopy summary, .email-original summary, .email-codes summary { cursor: pointer; }
.system-emails summary .sub, .email-codes summary .sub { display: inline; margin-left: 6px; }
/* Editor: emails outline | the form | the preview at up to its real 600px width. */
.email-shell { grid-template-columns: 250px minmax(0, 1fr); }
.email-editor { display: grid; grid-template-columns: minmax(340px, 1fr) minmax(0, 642px); gap: 18px; align-items: start; }
.email-review { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.outline-group { margin: 12px 8px 4px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.outline-group:first-child { margin-top: 4px; }
.outline-link .o-status { flex-shrink: 0; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; }
.outline-link .o-status .icon { font-size: 16px; margin: 0; }
.o-status.is-ready { background: var(--green-soft); color: var(--green-dark); }
.o-status.is-tested { background: var(--blue-soft); color: var(--blue); }
.o-status.is-unchecked { background: var(--amber-soft); color: var(--amber); }
.o-status.is-problem { background: var(--red-soft); color: var(--red); }
.email-form { margin: 0; max-width: none; }   /* fills its column up to the preview (other forms stop at 560px) */
.email-editor > .card { margin: 0; }          /* form and preview tops line up (no stacked-card gap) */
.input-with-insert { display: flex; gap: 8px; }
.input-with-insert select { width: auto; flex-shrink: 0; }
.email-checks { border: 1px solid var(--line-strong); background: var(--amber-soft); border-radius: var(--radius); padding: 12px 14px; margin-top: 12px; }
.email-checks h3 { font-size: 1rem; }
.email-actions { flex-wrap: wrap; }
.email-preview { position: sticky; top: calc(var(--topbar-h) + 16px); margin: 0; padding: 0; overflow: hidden; }
.email-preview-head { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.email-preview-head .sub { display: block; }
.email-frame { height: 72vh; min-height: 480px; overflow: hidden; background: #f1f1f1; }
.email-frame iframe { display: block; width: 640px; height: 100%; border: 0; background: #fff; transform-origin: 0 0; }
@media (max-width: 1180px) {
    .email-editor { grid-template-columns: 1fr; }
    .email-preview { position: static; max-width: 642px; }
    .email-frame { height: 70vh; }
}

/* ---------- Compliance: fixed security measures (ticked and greyed out, not editable) ---------- */
.security-measures { margin-top: 22px; }
.security-measures h2 { display: flex; align-items: center; gap: 8px; }
.security-groups { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 28px; margin-top: 14px; }
.security-group h3 { margin: 0 0 2px; font-size: 1.05rem; }
.security-list { list-style: none; margin: 10px 0 0; padding: 0; }
.security-list li { border-top: 1px solid var(--line); }
.security-list label { display: flex; gap: 12px; align-items: flex-start; padding: 9px 2px; margin: 0; cursor: default; font-weight: 400; }
.security-list input[type="checkbox"] { margin: 3px 0 0; flex-shrink: 0; width: 16px; height: 16px; accent-color: #8fa596; opacity: .85; cursor: default; }
.security-list strong { display: block; font-weight: 600; font-size: .9rem; color: #5d6660; }
.security-list .sub { display: block; font-size: .82rem; line-height: 1.45; margin-top: 1px; }
.security-foot { margin: 16px 0 0; font-size: .82rem; }
.security-foot .icon.material-symbols-outlined { font-size: 14px; margin-left: 2px; vertical-align: -2px; }
@media (max-width: 900px) { .security-groups { grid-template-columns: 1fr; } }

/* People who've asked their computer for less motion get panels that simply appear and disappear. */
@media (prefers-reduced-motion: reduce) {
    .help-panel, .help-closed .help-panel, .has-help .page > .container, .board-nav, .has-board-nav .page, .has-board-nav .footer,
    .board-nav .nav-label, .nav-mark { transition: none !important; }
}

/* ---------- Videos (Documents & videos page, Add/Edit video) ---------- */
.videos-section { margin-top: 34px; }
.videos-section .page-head h2 { margin-bottom: 4px; }
.video-thumb { flex-shrink: 0; width: 112px; height: 63px; border-radius: 8px; object-fit: cover; background: #1f2a23; }
.video-thumb.is-empty { display: grid; place-items: center; color: #c9d1cb; }
.video-thumb.is-empty .icon.material-symbols-outlined { font-size: 26px; margin: 0; }

.video-note { margin-bottom: 16px; }
.video-editor { display: grid; grid-template-columns: minmax(340px, 1fr) minmax(0, 560px); gap: 18px; align-items: start; }
.video-editor > .card { margin: 0; }
.video-form { max-width: none; }
.video-preview video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 8px; }
.video-picked { display: flex; gap: 12px; align-items: center; margin-top: 10px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--tint); }
.video-picked img { width: 128px; height: 72px; object-fit: cover; border-radius: 6px; background: #000; }
.video-picked .sub { margin-top: 2px; }

.upload-progress { margin: 14px 0 4px; }
.upload-bar { height: 10px; border-radius: 999px; background: var(--grey-soft); overflow: hidden; }
.upload-bar span { display: block; height: 100%; width: 0; background: var(--green); border-radius: 999px; transition: width .3s ease; }
.upload-progress p { margin-top: 6px; }
@media (max-width: 1100px) { .video-editor { grid-template-columns: 1fr; } }

/* Web links in the documents list */
.doc-icon.is-link { background: var(--blue); }
.doc-icon.is-link .icon.material-symbols-outlined { font-size: 22px; margin: 0; opacity: 1; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Compliance statements: one row each (order, statement with optional formatting, remove) */
.compliance-list { display: flex; flex-direction: column; gap: 12px; }
.compliance-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.compliance-row.is-new { animation: saved-flash 1.6s ease-out; border-radius: var(--radius); }
.compliance-order input { width: 100%; }
.compliance-empty { margin: 4px 0 8px; }
.compliance-form .actions { margin-top: 16px; }
/* Tight space (a phone, or the menu and help both open): Remove goes under the statement so the text keeps the width. */
.compliance-list { container-type: inline-size; }
@container (max-width: 520px) { .compliance-row { grid-template-columns: 56px minmax(0, 1fr); } .compliance-row .remove-check { grid-column: 2; padding-top: 0; } }
.compliance-text { min-width: 0; }
.compliance-text .rte-advanced { margin-top: 4px; }

/* ---------- Codes such as <%LINK%>: shown as tags (editor, email pages) or highlighted (one-line boxes) ---------- */
.rte-code, .code-chip {
    display: inline-block; padding: 0 5px; margin: 0 1px; border-radius: 5px; line-height: 1.5;
    font: 500 .82em ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace; letter-spacing: 0;
    color: #9a3412; background: #f6f3f1; border: 1px solid var(--line-strong); white-space: nowrap; vertical-align: baseline;
}
.rte-code { cursor: default; user-select: all; }
.rte-code::selection { background: #fde2c8; }
.code-highlight { position: relative; display: block; flex: 1; min-width: 0; }
.code-highlight > input { position: relative; background: transparent; width: 100%; }
.code-highlight-back {
    position: absolute; inset: 0; overflow: hidden; white-space: pre; color: transparent; pointer-events: none;
    border-style: solid; border-color: transparent; background: var(--card); border-radius: var(--radius);
}
.code-highlight-back mark { color: transparent; background: #f3e9e3; border-radius: 4px; box-shadow: 0 0 0 1px #e6ddd8; }

.video-state { margin-top: 12px; }
.video-state p { margin: 0 0 8px; }
.video-state .icon.material-symbols-outlined { color: var(--green); vertical-align: -3px; margin-right: 4px; }
.processing-bar { display: block; width: 100%; height: 10px; border: 0; border-radius: 999px; background: var(--grey-soft); overflow: hidden; accent-color: var(--green); }
.processing-bar::-webkit-progress-bar { background: var(--grey-soft); border-radius: 999px; }
.processing-bar::-webkit-progress-value { background: var(--green); border-radius: 999px; transition: width .3s ease; }
.processing-bar::-moz-progress-bar { background: var(--green); border-radius: 999px; }

/* ---------- Board Overview: at a glance (BoardGlanceService) ---------- */
/* Rows are always full: five across when there's room, else three then two, two per row on phones, one on very narrow. */
.glance-wrap { container-type: inline-size; margin: 4px 0 18px; }
.glance { display: grid; gap: 12px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.glance > .glance-tile { grid-column: span 2; }
.glance.n5 > .glance-tile:nth-child(n+4), .glance.n4 > .glance-tile { grid-column: span 3; }
@container (min-width: 1160px) {
    .glance.n5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .glance.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .glance > .glance-tile, .glance.n5 > .glance-tile:nth-child(n+4), .glance.n4 > .glance-tile { grid-column: auto; }
}
@container (max-width: 640px) {
    .glance { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .glance > .glance-tile, .glance.n5 > .glance-tile:nth-child(n+4), .glance.n4 > .glance-tile { grid-column: auto; }
    .glance.n5 > .glance-tile:last-child { grid-column: span 2; }
}
@container (max-width: 420px) {
    .glance { grid-template-columns: 1fr; }
    .glance > .glance-tile, .glance.n5 > .glance-tile:last-child { grid-column: auto; }
}
.glance-tile { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); min-width: 0; }
.glance-chart { flex-shrink: 0; }
.glance-chart .donut { width: 56px; height: 56px; display: block; }
.glance-chart .spark { width: 72px; height: 36px; display: block; margin-top: 10px; }
.donut-centre { font: 700 15px var(--sans); fill: #2f3a33; }
.glance-text { min-width: 0; }
.glance-title { margin: 0; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.glance-value { margin: 2px 0 0; font: 400 1.18rem/1.25 var(--serif); color: var(--blue); white-space: nowrap; }
.glance-sub { margin: 3px 0 0; font-size: .8rem; line-height: 1.4; color: var(--muted); }
.glance-key { list-style: none; margin: 6px 0 0; padding: 0; font-size: .76rem; color: var(--muted); }
.glance-key li { display: flex; align-items: center; gap: 6px; line-height: 1.5; }
.glance-key svg { width: 9px; height: 9px; flex-shrink: 0; }
.glance-link { display: inline-flex; align-items: center; margin-top: 6px; font-size: .8rem; font-weight: 600; color: var(--green-dark); text-decoration: none; }
.glance-link:hover { text-decoration: underline; }
.glance-link .icon.material-symbols-outlined { font-size: 16px; margin: 0; }

/* Board Overview: status and dates in one slim card; the go-live checklist in two columns */
.dates-card { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: flex-end; justify-content: space-between; }
.dates-status { flex: 1 1 220px; min-width: 0; }
.dates-status .sub { display: block; }
.dates-form input[type="datetime-local"] { width: 200px; }
.dates-status p:last-child { margin-bottom: 0; }
.dates-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin: 0; }
.dates-form .field { margin: 0; }
.dates-form label { font-size: .82rem; }
.golive-card { margin-top: 14px; }
.golive-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.checklist.two-col { columns: 2 320px; column-gap: 28px; }
.checklist.two-col li { break-inside: avoid; }

/* A live board's status badge: a small red "on air" light with a slow, soft glow. */
.badge.on-air { display: inline-flex; align-items: center; gap: 6px; background: var(--red-soft); color: var(--red); }
.badge.on-air::before {
    content: ""; width: 7px; height: 7px; border-radius: 50%; background: #d93025; flex-shrink: 0;
    box-shadow: 0 0 0 0 rgba(217, 48, 37, .45); animation: on-air 2.4s ease-in-out infinite;
}
@keyframes on-air {
    0%, 100% { box-shadow: 0 0 0 0 rgba(217, 48, 37, .45); opacity: 1; }
    50% { box-shadow: 0 0 0 5px rgba(217, 48, 37, 0); opacity: .75; }
}
@media (prefers-reduced-motion: reduce) { .badge.on-air::before { animation: none; } }

/* ---------- Progress: who has answered what (advisors × questions) ---------- */
/* Shape and colour together: filled green dot = answered, red ring = open but not answered, grey dash = not open yet. */
.ag { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle; }
.ag-yes { background: #3a8a4f; }
.ag-no { border: 2px solid #c5372c; background: var(--red-soft); }
.ag-later { width: 10px; height: 3px; border-radius: 2px; background: #c4cbc6; }
.answer-key .ag { flex: none; }
.answer-grid-summary { margin-bottom: 10px; }
.answer-grid-summary .material-symbols-outlined, .answer-grid-summary .icon { vertical-align: -4px; margin-right: 4px; }
.answer-grid-summary strong { color: var(--red); }
.answer-grid-scroll { overflow-x: auto; overflow-y: hidden; }
.answer-grid { border-collapse: separate; border-spacing: 0; font-size: .85rem; }
.answer-grid th, .answer-grid td { padding: 0; text-align: center; font-weight: 400; text-transform: none; letter-spacing: 0; background: none; border-bottom: 0; vertical-align: middle; }
.answer-grid tbody th { font-size: .85rem; color: inherit; }
.answer-grid td { width: 28px; min-width: 28px; height: 30px; border-top: 1px solid var(--line); }
.answer-grid td.alt, .answer-grid thead th.alt { background: var(--tint-2); }
.answer-grid tbody th { text-align: left; padding: 3px 14px 3px 0; border-top: 1px solid var(--line); white-space: nowrap; }
.answer-grid tbody th .person-cell { gap: 8px; }
.answer-grid tbody tr.has-gaps th a { font-weight: 600; }
.answer-grid .ag-topic { max-width: 0; padding: 0 6px 4px; font-size: .75rem; color: var(--muted); text-align: left;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-left: 2px solid #fff; }
.answer-grid .ag-topic { white-space: normal; vertical-align: bottom; line-height: 1.3; }
.answer-grid .ag-topic span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.answer-grid.roomy td:not(.ag-count) { width: 44px; min-width: 44px; }
.answer-grid .ag-questions th[data-tip] { height: 24px; font-size: .75rem; color: var(--blue); cursor: help; }
.answer-grid .ag-questions th[data-tip]:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.answer-grid .ag-count-col { font-size: .75rem; color: var(--muted); padding: 0 0 4px 12px; white-space: nowrap; }
.answer-grid td.ag-count { width: auto; padding: 0 0 0 12px; text-align: left; white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.answer-grid td.ag-count.is-done { color: #2f6e40; }
.answer-grid .ag-no[data-tip] { cursor: help; }
.person-photo.xs { width: 24px; height: 24px; font-size: .65rem; }
.answer-grid .ag-yes[data-tip] { cursor: help; }
.answer-grid tbody [data-tip]::after { max-width: 320px; }
/* Tooltips in the grid float above the page (site.js), because the scrolling box would clip the CSS ones and grow
   a scrollbar that made them flicker. */
.answer-grid [data-tip]::after, .answer-grid [data-tip]::before { content: none; display: none !important; }
.float-tip {
    position: fixed; z-index: 1000; max-width: 320px; pointer-events: none;
    padding: 8px 11px; border-radius: 8px; background: #1f2a23; color: #fff;
    font: 400 .8rem/1.45 var(--sans); box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
}
.float-tip[hidden] { display: none; }

/* ---------- Client page: branding in Frank ---------- */
.swatch-select { display: flex; align-items: center; gap: 10px; }
.swatch-select select { flex: 1; min-width: 0; }
.style-swatch { width: 28px; height: 28px; flex: none; }
.branding-boards { margin: 4px 0 12px; font-size: .9rem; }
.branding-boards summary { cursor: pointer; color: var(--blue); }
.branding-boards ul { margin: 8px 0 0; }
.brand-preview { display: block; width: 100%; max-width: 420px; margin: 4px 0 16px; }
.brand-preview-title { font: 400 17px Merriweather, serif; fill: #fff; }
.brand-preview-note { font: 400 12px var(--sans, sans-serif); fill: rgba(255, 255, 255, .75); }
.narrow-card { max-width: 560px; }

/* ---------- People: invitations ---------- */
.invite-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.invite-card .alert { margin-top: 8px; }
.nudge-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; }
.nudge-bar .sub .material-symbols-outlined, .nudge-bar .sub .icon { vertical-align: -4px; margin-right: 4px; }
.answer-grid td.ag-nudge { width: auto; padding: 0 0 0 12px; text-align: left; white-space: nowrap; }

/* Archived topics and questions (Topics & questions, when "Show archived" is on): hidden from advisors, so greyed. */
.outline .is-archived .o-text, .question-row.is-archived .q-text, .question-row.is-archived .q-number { opacity: .6; }
.outline .is-archived .o-flag .icon { font-size: 1rem; }

/* ---------- "Latest" on a live board's Overview (_Latest): a slim panel that types out the newest posts and nudges ---------- */
.latest { padding: 10px 16px 12px; margin-bottom: 16px; }
.latest-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.latest-head .glance-link { margin-top: 0; }
.latest-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-right: 6px; vertical-align: 1px; }
.latest-list { margin: 6px 0 0; padding: 0; list-style: none; }
.latest-list li + li { margin-top: 6px; }
.latest-list .latest-line { display: block; font-size: .85rem; color: var(--muted); }
.latest-line.latest-headline { color: var(--ink); font-size: .92rem; }
.latest-list .latest-when { font-size: .85rem; }

/* With JavaScript the list is kept for screen readers and the typed copy shows instead, always the same height. */
.latest.is-enhanced .latest-list { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.latest-screen { display: flex; flex-direction: column; margin-top: 6px; min-height: 5.4em; }
.latest-screen .latest-line { font-size: .85rem; color: var(--muted); line-height: 1.45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.latest-screen .latest-line.latest-headline { color: var(--ink); font-size: .92rem; }
.latest-screen .latest-meta { order: 9; margin-top: 2px; font-size: .75rem; color: var(--muted); }
.latest-cursor { display: inline-block; width: .5em; height: 1em; margin-left: 2px; vertical-align: -2px; background: var(--green); animation: latest-blink 1s steps(1) infinite; }
@keyframes latest-blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .latest-cursor { animation: none; } }
.latest-screen[hidden] { display: none; }
.latest-ago, .latest-list .latest-when { font-weight: 600; color: var(--green-dark); }
.latest-empty { margin-top: 6px; }
/* The advisor an item is about: small and round, bottom right, with room kept so the text stays on its lines. */
/* The person it's about, larger and first, so each item reads as someone saying something (staff posts have no photo) */
.latest-screen { position: relative; }
.latest-screen:has(.latest-person) { padding-left: 72px; min-height: 60px; }
.latest-screen .latest-person { position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 56px; height: 56px; font-size: 1rem;
    box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--green-soft), 0 4px 10px rgba(20, 30, 24, .12); animation: latest-face .35s ease; }
@keyframes latest-face { from { opacity: 0; transform: translateY(-50%) scale(.85); } }
@media (prefers-reduced-motion: reduce) { .latest-screen .latest-person { animation: none; } }
.latest-list .latest-person { width: 24px; height: 24px; font-size: .65rem; display: inline-grid; vertical-align: middle; }

/* ---------- Question type (Boards/QuestionType): authoring a structured question type, with its preview ---------- */
.field-row { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: flex-end; }
.field-row > .field { margin-bottom: 12px; }
.question-type-form fieldset.field { border: 0; padding: 0; margin: 0 0 12px; }
.question-type-form legend { font-weight: 600; margin-bottom: 4px; }
.option-list { margin: 0 0 8px; padding-left: 1.4em; }
.option-list li { display: flex; align-items: center; gap: 4px; margin-bottom: 6px; }
.option-list li input[type="text"] { flex: 1; min-width: 0; }
.ix-preview-question { display: flex; gap: 10px; margin: 8px 0; }
.ix-preview-prompt { display: block; margin-top: 12px; font-weight: 600; }
.ix-preview textarea { width: 100%; }

/* ---------- Polling: the kinds of poll, the editor (a page or a pop-up) and its preview ---------- */
/* "Add polling to this question": a tile per kind, with its icon */
.poll-picker { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.poll-tile { display: grid; justify-items: start; gap: 4px; height: 100%; padding: 14px; border: 1px solid var(--line); border-radius: 12px;
             background: var(--card); color: var(--ink); text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
.poll-tile:hover, .poll-tile:focus-visible { border-color: var(--green); box-shadow: 0 6px 18px rgba(70, 126, 83, .16); transform: translateY(-2px); }
.poll-tile:focus-visible { outline: 3px solid rgba(70, 126, 83, .35); outline-offset: 2px; }
.poll-tile-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--green-soft); color: var(--green-dark); flex-shrink: 0; }
.poll-tile-icon .icon { font-size: 24px; margin: 0; }
.poll-tile-name { font-weight: 700; font-size: .92rem; margin-top: 4px; }
.poll-tile-blurb { color: var(--muted); font-size: .82rem; line-height: 1.35; }
@media (prefers-reduced-motion: reduce) { .poll-tile { transition: none; } .poll-tile:hover { transform: none; } }

/* The poll on the question page: what it is, then its results so far */
.poll-summary { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.poll-summary p { flex: 1; min-width: 12em; }

/* The editor: the settings on the left, the preview beside them (below on narrow screens) */
.poll-head { display: flex; align-items: center; gap: 12px; }
.poll-head-text { flex: 1; min-width: 0; }
.poll-head h2 { margin: 0; font-size: 1.2rem; }
.poll-head-question { margin: 2px 0 0; color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.poll-box.card .poll-head { padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.poll-editor { display: grid; gap: 20px; align-items: start; }
@media (min-width: 980px) { .poll-editor { grid-template-columns: minmax(0, 1fr) minmax(0, 440px); } }
.poll-form .field { margin-bottom: 14px; }
.poll-kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.poll-kind { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card);
             color: var(--ink); font: 600 .84rem var(--sans); cursor: pointer; }
.poll-kind .icon { font-size: 18px; margin: 0; color: var(--green-dark); }
.poll-kind:hover { border-color: var(--green); }
.poll-kind[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }
.poll-kind[aria-pressed="true"] .icon { color: #fff; }
/* Two or three choices side by side, e.g. before / after the question, computer / phone */
.poll-segment { display: inline-flex; flex-wrap: wrap; padding: 3px; border-radius: 999px; background: var(--grey-soft); gap: 2px; }
.poll-segment label, .poll-segment button { position: relative; display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 6px 14px; border: 0; border-radius: 999px;
                                            background: none; color: var(--ink); font: 600 .84rem var(--sans); cursor: pointer; }
.poll-segment input { position: absolute; opacity: 0; pointer-events: none; }
.poll-segment label:has(input:checked), .poll-segment button[aria-pressed="true"] { background: var(--card); color: var(--green-dark); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.poll-segment label:has(input:focus-visible) { outline: 3px solid rgba(70, 126, 83, .35); }
.poll-segment[hidden] { display: none; }
.poll-preview { padding: 16px; border-radius: 12px; background: var(--tint-2); border: 1px solid var(--line); }
.poll-preview-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.poll-preview-head h3 { margin: 0; font-size: 1rem; }
.poll-preview-frames { display: grid; gap: 16px; }
.poll-preview .pv-computer > .ix-preview { padding: 14px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); }
.poll-preview-waiting { padding: 14px; border-radius: 10px; background: var(--card); border: 1px dashed var(--line-strong); color: var(--muted); font-size: .9rem; }
.poll-preview-waiting ul { padding-left: 1.2em; margin-top: 6px; }
/* With the switch, one at a time and no captions */
.pv-switch .glance-title { display: none; }
.pv-switch:not(.is-phone) .pv-phone, .pv-switch.is-phone .pv-computer { display: none; }
.poll-actions .btn .icon { margin-right: 4px; }

/* ---------- Pop-ups (site.js: links marked data-modal) ---------- */
html.modal-open { overflow: hidden; }
dialog.modal { width: min(1160px, calc(100vw - 32px)); max-width: none; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px);
               margin: auto; padding: 0; border: 0; border-radius: 16px; background: var(--bg); color: var(--ink);
               box-shadow: 0 24px 70px rgba(0, 0, 0, .3); overflow: hidden; }
dialog.modal[open] { display: flex; flex-direction: column; animation: modal-in .22s ease-out; }
dialog.modal::backdrop { background: rgba(18, 28, 21, .55); animation: modal-fade .25s ease-out; }
dialog.modal.is-busy { cursor: progress; }
dialog.modal.is-busy .poll-body { opacity: .7; transition: opacity .2s .15s; }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.985); } }
@keyframes modal-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { dialog.modal[open], dialog.modal::backdrop { animation: none; } }
.poll-box.in-modal { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.in-modal .poll-head { padding: 16px 20px; background: var(--card); border-bottom: 1px solid var(--line); }
.in-modal .poll-body { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 20px 0; }
.in-modal .poll-body > :last-child:not(.poll-actions) { margin-bottom: 20px; }
.in-modal .poll-preview { position: sticky; top: 0; }
.in-modal [data-preview-submit] { display: none; }   /* the preview keeps itself up to date */
/* Save and Cancel always in view at the bottom of the box */
.in-modal .poll-actions { position: sticky; bottom: 0; z-index: 1; margin: 0 -20px; padding: 12px 20px; background: var(--card); border-top: 1px solid var(--line); }
.in-modal .poll-editor { grid-template-rows: auto; }
.modal-x { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.modal-x:hover { background: var(--grey-soft); color: var(--ink); }
.modal-x .icon { margin: 0; font-size: 24px; }
@media (max-width: 640px) {
    dialog.modal { width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; }
    .in-modal .poll-head, .in-modal .poll-body { padding-left: 16px; padding-right: 16px; }
    .in-modal .poll-actions { margin: 0 -16px; padding: 12px 16px; }
}
.option-list .btn .icon { margin: 0; font-size: 18px; }

/* ---------- AI insights (Topics & questions): the AI summariser's summary and probing tips ---------- */
.ai-insights h3 .icon { color: var(--blue); margin-right: 6px; }
.ai-headline { padding: 10px 14px; border-left: 3px solid var(--blue); border-radius: 0 8px 8px 0; background: var(--blue-soft); line-height: 1.5; }
.ai-more { margin-top: 10px; }
.ai-more > summary { cursor: pointer; font-weight: 600; color: var(--blue); }
.ai-more > div { margin-top: 6px; line-height: 1.55; font-size: .92rem; }
.ai-insights .sub { margin-top: 10px; }
.ai-label { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 0 6px; font-weight: 600; font-size: .88rem; color: var(--blue); }
.ai-label .icon { margin: 0; font-size: 18px; }
.ai-topic { margin: 4px 0 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.ai-question { margin: 10px 0 14px; padding: 12px 14px; border-radius: 10px; background: var(--blue-tint); border: 1px solid var(--line-strong); }
.ai-insights-body .ai-note { margin-top: 8px; }
/* An option that can't be used here: greyed text, the tip (which says why) still readable */
.check.is-disabled > span { color: #8a8f94; }
.check.is-disabled input { cursor: not-allowed; }
.avatar-photo { object-fit: cover; border: 2px solid #fff; padding: 0; }
/* The poll choice in the question editor (radios drawn like the kind-of-poll buttons), and the poll on a question */
.poll-field legend { font-weight: 600; margin-bottom: 6px; }
label.poll-kind { position: relative; }
label.poll-kind input { position: absolute; opacity: 0; pointer-events: none; }
label.poll-kind:has(input:checked) { background: var(--green); border-color: var(--green); color: #fff; }
label.poll-kind:has(input:checked) .icon { color: #fff; }
label.poll-kind:has(input:focus-visible) { outline: 3px solid rgba(70, 126, 83, .35); outline-offset: 2px; }
.poll-inline { display: inline-flex; align-items: center; gap: 4px; color: var(--green-dark); }
.poll-inline .icon { margin: 0; font-size: 16px; }
.poll-field .poll-inline { margin-right: 10px; }

/* ---------- Set-up progress (Overview): the stages of setting up a board, joined like a build pipeline ---------- */
.setup { margin: 0 0 18px; }
.setup-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.setup-head .glance-title { margin: 0; }
.setup-stages { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }
.setup-stage { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); min-width: 0; }
/* the line joining one stage to the next, at the height of the stage's heading */
.setup-stage:not(:last-child)::after { content: ''; position: absolute; top: 31px; right: -29px; width: 28px; height: 2px; background: #b9c7d6; }
.setup-stage:not(:last-child)::before { content: ''; position: absolute; top: 28px; right: -32px; width: 8px; height: 8px; border-radius: 50%; background: #6b8db3; z-index: 1; }
.setup-stage.is-done:not(:last-child)::after { background: #9cc0a4; }
.setup-stage-head { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; background: var(--tint); border-bottom: 1px solid var(--line); border-radius: 8px 8px 0 0; }
.setup-stage-head h3 { margin: 0; font-size: .98rem; font-family: var(--sans); font-weight: 700; color: var(--ink); }
.setup-stage-head .sub { margin: 2px 0 0; }
.setup-steps { list-style: none; margin: 0; padding: 6px 0; }
.setup-steps a { display: flex; align-items: flex-start; gap: 8px; padding: 6px 14px; color: var(--ink); text-decoration: none; font-size: .88rem; line-height: 1.35; }
.setup-steps a:hover { background: var(--tint-2); }
.setup-steps a:focus-visible { outline: 3px solid rgba(70, 126, 83, .35); outline-offset: -3px; }
.setup-steps .mk { margin-top: 1px; flex-shrink: 0; }
.setup-step-text { min-width: 0; }
.setup-step-text .sub { font-size: .78rem; }
.setup-steps .is-optional.is-todo a { color: var(--muted); }
/* the marks */
.mk { display: block; flex-shrink: 0; }
.mk-done { fill: var(--green); }
.mk-tick { fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mk-ring { fill: none; stroke: #9aa0a6; stroke-width: 1.6; }
.mk-ring-started { stroke: var(--blue); }
.mk-part { fill: var(--blue); }
.mk-dashed { stroke-dasharray: 2.2 2; stroke: #b8bfb9; }
@media (max-width: 1100px) { .setup-stages { grid-template-columns: repeat(2, minmax(0, 1fr)); } .setup-stage:nth-child(2n)::after, .setup-stage:nth-child(2n)::before { display: none; } }
@media (max-width: 640px) { .setup-stages { grid-template-columns: 1fr; gap: 14px; } .setup-stage::after, .setup-stage::before { display: none; } }
.setup-tips { margin-top: 12px; padding: 10px 14px; border-radius: 8px; background: var(--amber-soft); border: 1px solid #f0dfa8; }
.setup-tips-title { display: flex; align-items: center; gap: 6px; margin: 0 0 4px; font-weight: 700; font-size: .85rem; color: var(--amber); }
.setup-tips-title .icon { margin: 0; font-size: 18px; }
.setup-tips ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.setup-tips li { display: flex; align-items: flex-start; gap: 8px; font-size: .88rem; line-height: 1.4; }
.setup-tips li .icon { margin: 1px 0 0; font-size: 17px; color: var(--amber); flex-shrink: 0; }
.setup-tips li a { white-space: nowrap; font-weight: 600; }

/* ---------- AI help (Pages/Boards/_AIHelpSlot, _AIHelpBox) ----------
   Deliberately quiet: a small muted button that only says what it found, and a soft blue speech bubble that opens
   when asked. Blue (not Frank green) so it reads as AI advice rather than Frank's own rules. */
.ai-help { margin-top: 6px; }
.ai-help-button {
    display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 4px; border: 0; border-radius: 999px;
    background: transparent; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer;
}
.ai-help-button .icon { color: var(--blue); font-size: 17px; }
.ai-help-button:hover, .ai-help-button[aria-expanded="true"] { background: var(--blue-soft); color: var(--blue); }
.ai-help-button.has-points { color: var(--blue); }
.ai-help-button.has-points::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); margin-left: 2px; }
.ai-help-button.is-clear { color: var(--green-dark); }
.ai-help-button.is-busy .icon { animation: ai-pulse 1.2s ease-in-out infinite; }
@keyframes ai-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .ai-help-button.is-busy .icon { animation: none; } }

.ai-help-box { margin-top: 8px; }
.ai-bubble {
    position: relative; max-width: 680px; padding: 10px 14px 10px; border-radius: 16px; border-top-left-radius: 4px;
    background: var(--blue-soft); color: #1d2b36; font-size: 14px; line-height: 1.5;
}
.ai-bubble::before {   /* the tail, pointing up at the button */
    content: ""; position: absolute; top: -7px; left: 14px; border: 7px solid transparent; border-top: 0; border-bottom-color: var(--blue-soft);
}
.ai-bubble-head { display: flex; align-items: center; justify-content: space-between; }
.ai-bubble-title { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--blue); }
.ai-bubble-title .icon { font-size: 16px; }
.ai-bubble-close { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 2px; border-radius: 6px; }
.ai-bubble-close:hover { background: rgba(6, 95, 160, .1); color: var(--blue); }
.ai-bubble-summary { margin: 2px 0 6px; }
.ai-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ai-point { display: grid; grid-template-columns: 20px 1fr; gap: 6px; align-items: start; }
.ai-point > .icon { font-size: 18px; margin-top: 1px; }
.ai-point.is-fine > .icon { color: var(--green); }
.ai-point.is-look > .icon { color: var(--blue); }
.ai-point strong { font-weight: 600; }
.ai-relates { color: var(--muted); }
.ai-note-text { display: block; }
.ai-suggestion {
    margin: 6px 0 2px; padding: 6px 10px; border-left: 3px solid var(--blue); border-radius: 0 8px 8px 0; background: var(--card);
    white-space: pre-line;
}
.ai-use { padding-left: 0; }
.ai-bubble-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 12px; margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(6, 95, 160, .15); }
.ai-bubble-foot > .sub { font-size: 12px; }
.ai-bubble-actions { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.ai-ask > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; color: var(--blue); font-size: 13px; }
.ai-ask > summary::-webkit-details-marker { display: none; }
.ai-ask-form { display: grid; gap: 6px; margin-top: 6px; min-width: min(360px, 80vw); }
.ai-ask-form textarea { background: var(--card); }
.ai-ask-form .btn { justify-self: start; }
.ai-help-sent { display: inline-flex; align-items: center; gap: 4px; margin: 0; color: var(--green-dark); font-size: 13px; }
.ai-hide { color: var(--muted); font-size: 12px; }
.ai-hide .icon { font-size: 15px; }
.ai-hidden-now { margin: 6px 0 0; font-size: 12px; }
.ai-outline { display: flex; justify-content: flex-end; margin: -6px 0 10px; }
.ai-outline .ai-help { margin: 0; width: 100%; display: flex; flex-direction: column; align-items: flex-end; }
.ai-outline .ai-help-box { width: 100%; display: flex; justify-content: flex-end; }
.ai-outline .ai-bubble { border-top-left-radius: 16px; border-top-right-radius: 4px; }
.ai-outline .ai-bubble::before { left: auto; right: 14px; }
.ai-hidden-note { align-items: center; gap: 6px; }
.ai-hidden-note .icon { font-size: 15px; vertical-align: -3px; margin-right: 3px; }
.ai-for-me { display: block; margin: 2px 0 0 26px; }
/* AI help and "Formatting options" share one row, right under the box (site.js moves them into .rte-foot). */
.rte-foot { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; column-gap: 12px; margin-top: 3px; }
.rte-foot > .ai-help { grid-column: 1; margin-top: 0; }
.rte-foot > .rte-advanced { grid-column: 2; grid-row: 1; margin: 0; padding-top: 4px; }
/* Settings: the board's languages, shown only while "Advisors can use Frank in their own language" is ticked */
.lang-pick { border: 0; margin: 6px 0 0 26px; padding: 0; display: none; }
.field:has(#Input_Translation:checked) .lang-pick { display: block; }
.lang-pick legend { padding: 0; margin-bottom: 4px; }
.lang-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 12px; }
.lang-options .check { margin: 0; }
.lang-requests h3 .icon { color: var(--blue); margin-right: 6px; }
.lang-request-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.lang-request-list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.lang-request-actions { display: inline-flex; gap: 6px; align-items: center; }
.person-language { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 2px; }
.person-language .icon { font-size: 16px; color: var(--blue); }
.person-language form { display: inline-flex; align-items: center; gap: 6px; }
.lang-select { width: auto; padding: 2px 6px; font-size: 13px; }

/* ---------- "Ask Frank", the AI helper (bottom right) ----------
   Docked: a card in the right-hand column, the same width as the help panel; when help is open the help panel gets
   shorter so the two stack. Larger: a big window over the page with a soft backdrop. The panel grows between the two. */
body { --helper-docked-h: min(540px, 62vh); }
.helper-launch {
    position: fixed; right: 20px; bottom: 20px; z-index: 30;
    display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px 11px 14px; border: 0; border-radius: 999px;
    background: linear-gradient(135deg, var(--green) 0%, #3f7f78 55%, var(--blue) 100%); color: #fff;
    font: 600 14px/1 var(--sans); letter-spacing: .01em; cursor: pointer;
    box-shadow: 0 10px 28px rgba(6, 95, 160, .28), 0 2px 6px rgba(20, 30, 24, .15);
    transition: transform .18s ease, box-shadow .18s ease;
}
.helper-launch .icon { font-size: 20px; color: #fff; animation: helper-twinkle 3.2s ease-in-out infinite; }
.helper-launch::after {   /* a soft glow that breathes now and then */
    content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    animation: helper-breathe 4s ease-out infinite;
}
.helper-launch:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(6, 95, 160, .34), 0 3px 8px rgba(20, 30, 24, .18); }
.helper-launch:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
@keyframes helper-twinkle { 0%, 100% { transform: rotate(0) scale(1); } 50% { transform: rotate(14deg) scale(1.12); } }
@keyframes helper-breathe { 0% { box-shadow: 0 0 0 0 rgba(70, 126, 83, .45); } 60%, 100% { box-shadow: 0 0 0 14px rgba(70, 126, 83, 0); } }

.helper-panel {
    position: fixed; z-index: 31; right: 16px; bottom: 16px; width: 340px; height: var(--helper-docked-h);
    display: flex; flex-direction: column; overflow: hidden;
    background: var(--card); border: 1px solid var(--line); border-radius: 18px;
    box-shadow: 0 18px 48px rgba(20, 30, 24, .2), 0 3px 10px rgba(20, 30, 24, .08);
    transition: width .28s cubic-bezier(.2, .8, .2, 1), height .28s cubic-bezier(.2, .8, .2, 1),
                right .28s cubic-bezier(.2, .8, .2, 1), bottom .28s cubic-bezier(.2, .8, .2, 1), border-radius .28s ease;
    animation: helper-in .24s cubic-bezier(.2, .8, .2, 1);
}
.helper-panel[hidden], .helper-launch[hidden], .helper-backdrop[hidden] { display: none; }
@keyframes helper-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

/* Sharing the right-hand column with the help panel: help leaves room for the launcher, and gets shorter still so
   the docked chat fits underneath it. */
.has-help.help-open .help-panel { max-height: calc(100vh - 88px - 64px); }
.has-help.help-open.helper-open:not(.helper-large) .help-panel { max-height: calc(100vh - 88px - var(--helper-docked-h) - 12px); }

/* Larger: a big window over the page. */
.helper-large .helper-panel {
    width: min(860px, calc(100vw - 32px)); height: min(86vh, 900px);
    right: max(16px, calc((100vw - 860px) / 2)); bottom: max(16px, 7vh); border-radius: 20px;
}
.helper-backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(20, 30, 24, .28); backdrop-filter: blur(2px); animation: helper-fade .2s ease; }
@keyframes helper-fade { from { opacity: 0; } }

.helper-head {
    display: flex; align-items: center; gap: 10px; padding: 12px 10px 12px 14px; flex-shrink: 0; color: #fff;
    background: linear-gradient(135deg, var(--green) 0%, #3f7f78 55%, var(--blue) 100%);
}
.helper-avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, .18); }
.helper-avatar .icon { font-size: 20px; color: #fff; }
.helper-title { flex: 1; display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.helper-title strong { font-family: var(--serif); font-weight: 400; font-size: 1.02rem; }
.helper-title span { font-size: 12px; opacity: .85; }
.helper-icon { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: #fff; cursor: pointer; }
.helper-icon:hover, .helper-icon:focus-visible { background: rgba(255, 255, 255, .18); }
.helper-icon .icon { font-size: 19px; color: #fff; }
.helper-shrink-icon, .helper-large .helper-grow { display: none; }
.helper-large .helper-shrink-icon { display: inline; }

.helper-log { position: relative; flex: 1; overflow-y: auto; padding: 14px 14px 6px; display: flex; flex-direction: column; gap: 10px; background: #f7f9f8; }
.helper-msg { display: flex; flex-direction: column; max-width: 88%; animation: helper-pop .2s ease; }
.helper-large .helper-msg { max-width: 72%; }
.helper-msg.is-user { align-self: flex-end; align-items: flex-end; }
.helper-msg.is-bot { align-self: flex-start; }
@keyframes helper-pop { from { opacity: 0; transform: translateY(6px); } }
.helper-bubble { padding: 9px 13px; border-radius: 16px; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.is-user .helper-bubble { background: var(--blue); color: #fff; border-bottom-right-radius: 5px; white-space: pre-wrap; }
.is-bot .helper-bubble { background: var(--card); color: var(--ink); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.helper-text p { margin: 0 0 6px; }
.helper-text p:last-child, .helper-text ol:last-child, .helper-text ul:last-child { margin-bottom: 0; }
.helper-text ol, .helper-text ul { margin: 2px 0 6px; padding-left: 20px; }
.helper-text li { margin: 2px 0; }
.helper-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.helper-link { display: inline-flex; align-items: center; padding: 5px 11px; border-radius: 999px; background: var(--green-soft); color: var(--green-dark); font-size: 13px; text-decoration: none; }
.helper-link::after { content: "\2192"; margin-left: 6px; }
.helper-link:hover { background: var(--green); color: #fff; }
.helper-typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.helper-typing span { width: 7px; height: 7px; border-radius: 50%; background: #9fb3c4; animation: helper-dot 1.1s ease-in-out infinite; }
.helper-typing span:nth-child(2) { animation-delay: .15s; }
.helper-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes helper-dot { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-4px); opacity: 1; } }

.helper-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 10px 4px 12px; border-top: 1px solid var(--line); background: var(--card); flex-shrink: 0; }
.helper-form textarea { flex: 1; resize: none; border: 1px solid var(--line); border-radius: 14px; padding: 9px 12px; font: 14px/1.4 var(--sans); max-height: 140px; background: var(--tint); }
.helper-form textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(6, 95, 160, .12); background: var(--card); }
.helper-send { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; border: 0; border-radius: 50%; background: var(--blue); color: #fff; cursor: pointer; transition: transform .15s ease; }
.helper-send:hover { transform: scale(1.06); }
.helper-send .icon { font-size: 19px; color: #fff; }
.helper-foot { margin: 0; padding: 2px 14px 9px; font-size: 11px; color: var(--muted); background: var(--card); flex-shrink: 0; }

@media (prefers-reduced-motion: reduce) {
    .helper-launch .icon, .helper-launch::after, .helper-typing span, .helper-panel, .helper-msg, .helper-backdrop { animation: none; }
    .helper-panel { transition: none; }
}
/* Phones: the chat is a sheet from the bottom, and larger fills the screen. */
@media (max-width: 700px) {
    .helper-launch { right: 14px; bottom: 14px; }
    .helper-panel { right: 8px; left: 8px; bottom: 8px; width: auto; height: min(80vh, 640px); }
    .helper-large .helper-panel { right: 0; left: 0; bottom: 0; width: auto; height: 100vh; border-radius: 0; }
    .has-help.help-open.helper-open .help-panel { visibility: hidden; }
}

/* Admin › Ask Frank guide: a roomy plain editor for the Markdown */
.guide-editor textarea.mono { font: 13px/1.5 Consolas, "Cascadia Mono", Menlo, monospace; min-height: 60vh; }
.helper-checked { margin-top: 4px; font-size: 11.5px; color: var(--muted); }
.helper-checked::before { content: "\2713\00a0"; color: var(--green); }

/* Ask Frank: suggested questions in light grey above the question box (this page's, or follow-ups after an answer) */
.helper-suggest { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 0; background: var(--card); border-top: 1px solid var(--line); flex-shrink: 0; }
.helper-suggest[hidden] { display: none; }
.helper-suggest + .helper-form { border-top: 0; }
.helper-chip { padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--grey-soft); color: var(--muted); font: 12.5px/1.3 var(--sans); text-align: left; cursor: pointer; transition: background .15s ease, color .15s ease, border-color .15s ease; }
.helper-chip:hover, .helper-chip:focus-visible { background: var(--blue-soft); border-color: #c9d9e8; color: var(--blue); }
.helper-large .helper-suggest { padding: 10px 16px 0; }

/* The hint beside the launcher: one question for this page, once per visit, fading in and away */
.helper-hint {
    position: fixed; right: 172px; bottom: 24px; z-index: 30; max-width: 300px;
    display: flex; flex-direction: column; gap: 1px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 14px 14px 4px 14px;
    background: var(--card); color: var(--muted); font: 13px/1.35 var(--sans); text-align: left; cursor: pointer;
    box-shadow: 0 8px 22px rgba(20, 30, 24, .12);
    opacity: 0; transform: translateX(8px); transition: opacity .35s ease, transform .35s ease;
}
.helper-hint.is-shown { opacity: 1; transform: none; }
.helper-hint[hidden] { display: none; }
.helper-hint-try { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: #9aa3a0; }
.helper-hint-q { color: var(--muted); }
.helper-hint:hover .helper-hint-q { color: var(--blue); }
.helper-open .helper-hint { display: none; }
@media (prefers-reduced-motion: reduce) { .helper-hint { transition: none; } }

/* ---------- Unsaved changes bar (forms marked data-save-bar) ---------- */
.save-bar {
    position: fixed; left: 50%; bottom: 18px; z-index: 40; transform: translate(-50%, 140%);
    display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 18px; max-width: calc(100vw - 32px);
    background: #1f2d26; color: #fff; border-radius: 14px; box-shadow: 0 14px 36px rgba(20, 30, 24, .3);
    transition: transform .28s cubic-bezier(.2, .8, .2, 1);
}
.save-bar.is-shown { transform: translate(-50%, 0); }
.save-bar[hidden] { display: none; }
.save-bar-text { font-size: 14px; margin-right: 6px; white-space: nowrap; }
.save-bar-text::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: #f2b84b; vertical-align: 1px; }
.save-bar .btn-secondary { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); }
.save-bar .btn-secondary:hover { background: rgba(255, 255, 255, .1); }
.has-save-bar .helper-launch, .has-save-bar .helper-hint { bottom: 84px; }
@media (prefers-reduced-motion: reduce) { .save-bar { transition: none; } }
@media (max-width: 700px) { .save-bar { left: 8px; right: 8px; transform: translateY(140%); } .save-bar.is-shown { transform: none; } }

/* A changed option or field gets a small amber mark until it's saved */
.is-changed { position: relative; }
.opt.is-changed { border-color: #f2b84b; box-shadow: 0 0 0 3px rgba(242, 184, 75, .18); }
.field.is-changed > label::after, .check.is-changed > span::after { content: "changed"; margin-left: 8px; padding: 0 6px; border-radius: 999px; background: #fff3d6; color: #8a5a00; font-size: 11px; font-weight: 400; vertical-align: 1px; }

/* ---------- Option tiles (Settings): grouped, two columns, a switch and a visible one-line description ---------- */
.opt-card h3 .icon { color: var(--blue); margin-right: 6px; }
.opt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
@media (max-width: 760px) { .opt-grid { grid-template-columns: 1fr; } }
.opt-cell { display: flex; flex-direction: column; gap: 6px; }
.opt {
    display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
    background: var(--card); cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.opt:hover { border-color: var(--line-strong); background: var(--tint); }
.opt:has(.switch:checked) { background: var(--tint-2); border-color: var(--line-strong); }
.opt-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.opt-title { font-weight: 600; color: var(--ink); }
.opt-desc { font-size: 13px; color: var(--muted); line-height: 1.4; }
.opt-note { margin-left: 4px; }
.opt-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 0 14px 2px 64px; font-size: 13px; }
.opt-sub .check { margin: 0; }
.opt-off { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0 0; padding: 10px 14px; border-radius: 10px; background: var(--grey-soft); color: var(--muted); font-size: 14px; }
.opt-card .lang-pick { margin: 4px 0 0 64px; }

/* The switch: a checkbox drawn as a sliding toggle (still a real checkbox, so it works with keyboard and forms) */
.switch {
    appearance: none; -webkit-appearance: none; flex-shrink: 0; position: relative; width: 38px; height: 22px; margin: 1px 0 0;
    border-radius: 999px; background: #c9d0cc; cursor: pointer; transition: background .18s ease;
}
.switch::after {
    content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .18s cubic-bezier(.2, .8, .2, 1);
}
.switch:checked { background: var(--green); }
.switch:checked::after { transform: translateX(16px); }
.switch:focus-visible { outline: 3px solid rgba(6, 95, 160, .35); outline-offset: 2px; }
.switch:disabled { opacity: .5; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) { .switch, .switch::after { transition: none; } }
.opt-cell:has(input[name="Input.Translation"]:checked) .lang-pick { display: block; }
.card[id] { scroll-margin-top: 84px; }   /* links to a Settings group (e.g. #ai) land below the header */

/* ---------- Section links at the top of a long page (Settings): stay below the top bar, show where you are ---------- */
.section-nav {
    position: sticky; top: 60px; z-index: 9; display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 14px; padding: 8px 6px;
    background: rgba(251, 251, 251, .94); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line);
}
.section-nav a { padding: 5px 12px; border-radius: 999px; color: var(--muted); font-size: 13.5px; text-decoration: none; white-space: nowrap; }
.section-nav a:hover { background: var(--grey-soft); color: var(--ink); }
.section-nav a.is-current { background: var(--green-soft); color: var(--green-dark); font-weight: 600; }
.section-nav a.is-staff { margin-left: auto; border: 1px dashed var(--line-strong); }
.card[id], #frank-heading { scroll-margin-top: 124px; }

/* Messages advisors see: each folded until opened, with whether it's written and how it starts */
details.text-block { border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; margin-top: 10px; background: var(--card); }
details.text-block > summary { list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 12px 0; cursor: pointer; }
details.text-block > summary::-webkit-details-marker { display: none; }
details.text-block > summary::before { content: "\25B8"; color: var(--muted); transition: transform .15s ease; }
details.text-block[open] > summary::before { transform: rotate(90deg); }
details.text-block[open] { padding-bottom: 14px; }
.text-block-title { font-weight: 600; color: var(--ink); }
.text-block-state { flex: 1; min-width: 0; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-block-state.is-empty { color: var(--amber); }
details.text-block.is-changed { border-color: #f2b84b; }

/* Overview: Board actions, grouped and labelled, with Delete set apart in red */
.actions-card { padding-top: 6px; }
.actions-group { margin: 12px 0 0; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.actions-card .action-row { gap: 14px; }
.action-icon { display: grid; place-items: center; flex-shrink: 0; width: 36px; height: 36px; border-radius: 10px; background: var(--grey-soft); color: var(--green-dark); }
.action-text { flex: 1; min-width: 0; }
.action-row.is-danger { margin-top: 14px; padding: 12px 14px; border: 1px solid #f1c9c5; border-radius: 12px; background: var(--red-soft); }
.action-row.is-danger .action-icon { background: var(--card); color: var(--red); }
.action-row.is-danger strong { color: var(--red); }

/* Toggle pills: a real checkbox (kept for keyboards and forms) drawn as a pill that goes green when on.
   Used for the board's languages and who sees AI summaries. */
.toggle-chip { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--muted); font-size: 13.5px; cursor: pointer; user-select: none; transition: background .15s ease, border-color .15s ease, color .15s ease; }
.toggle-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-chip span::before { content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 6px; border: 1.5px solid #b7c0bb; border-radius: 50%; vertical-align: -2px; transition: background .15s ease, border-color .15s ease; }
.toggle-chip:hover { border-color: var(--line-strong); color: var(--ink); }
.toggle-chip:has(input:checked) { background: var(--green-soft); border-color: #bcd5c3; color: var(--green-dark); }
.toggle-chip:has(input:checked) span::before { background: var(--green); border-color: var(--green); box-shadow: inset 0 0 0 2.5px #fff; }
.toggle-chip:has(input:focus-visible) { outline: 3px solid rgba(6, 95, 160, .3); outline-offset: 2px; }
.toggle-chip.is-changed { border-color: #f2b84b; }
.toggle-chip .sub { margin-left: 2px; }
.opt-card .lang-options { display: flex; flex-wrap: wrap; gap: 8px; }
.opt-sub { gap: 6px 8px; }
/* System › Tools: links to Frank-only tools (kept off the top bar) */
.tool-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; color: inherit; text-decoration: none; max-width: 560px; }
.tool-link:hover { border-color: var(--line-strong); background: var(--tint); }
.tool-link strong { display: block; color: var(--ink); }
.tool-link .sub { display: block; margin: 0; }

/* Settings › About the board: wide column (name, subtitle, objectives) and a narrow one beside it (area, brand, team) */
.about-grid {
    display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); column-gap: 20px; row-gap: 4px;
    grid-template-areas: "name area" "subtitle brand" "objectives team";
}
.about-name { grid-area: name; } .about-area { grid-area: area; } .about-subtitle { grid-area: subtitle; }
.about-brand { grid-area: brand; } .about-objectives { grid-area: objectives; } .about-team { grid-area: team; align-self: start; }
.about-grid .field { margin-bottom: 8px; }
.about-grid input, .about-grid select, .about-grid textarea { width: 100%; max-width: none; }
.field-note { display: block; margin-top: 4px; font-size: 12.5px; color: var(--muted); }
@media (max-width: 760px) {
    .about-grid { grid-template-columns: 1fr; grid-template-areas: "name" "subtitle" "objectives" "area" "brand" "team"; }
}

/* The nudge window (Pages/Boards/Nudge): the choices on the left, the email as it will arrive on the right */
.nudge-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .nudge-grid { grid-template-columns: 1fr; } }
.nudge-label { display: block; font-weight: 600; margin-bottom: 6px; }
.nudge-to { display: flex; align-items: center; gap: 10px; }
.nudge-to .person-photo { width: 40px; height: 40px; }
.nudge-email { display: block; }
.nudge-form textarea { width: 100%; }
.nudge-todo { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 6px; background: var(--card); }
.nudge-todo legend { padding: 0 4px; font-weight: 600; }
.nudge-todo .check { display: flex; align-items: flex-start; gap: 8px; margin: 6px 0; }
.nudge-todo .check .icon { font-size: 16px; color: var(--blue); vertical-align: -3px; margin-right: 4px; }
.nudge-preview { position: sticky; top: 0; }
.nudge-preview .email-frame { height: min(62vh, 640px); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.nudge-box:not(.in-modal) .nudge-preview .email-frame { height: 70vh; }

/* A spoken answer: play what was said (Pages/Boards/_Post) */
.post-recording { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 6px 0 2px; }
.post-recording .icon { color: var(--blue); font-size: 18px; }
.post-recording audio { height: 32px; max-width: 320px; }

/* Compliance › Translations: the English beside each translation, with its approval */
.lang-tabs { position: static; }
.ct-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 8px; }
.ct-head h3 { margin: 0; }
.ct-head .btn { margin-left: auto; }
.ct-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
@media (max-width: 860px) { .ct-row { grid-template-columns: 1fr; } }
.ct-english { display: flex; gap: 10px; align-items: flex-start; color: var(--ink); }
.ct-num { display: grid; place-items: center; flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--grey-soft); color: var(--muted); font-size: 13px; }
.ct-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 6px; }
.compliance-translations-link { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }

/* System › Tools › Site translations */
.st-stats { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; margin: 4px 0 10px; }
.st-actions { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-bottom: 8px; }
.toggle-link { padding: 4px 10px; border-radius: 999px; color: var(--muted); text-decoration: none; font-size: 13.5px; }
.toggle-link:hover { background: var(--grey-soft); }
.toggle-link.is-current { background: var(--green-soft); color: var(--green-dark); font-weight: 600; }
.st-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.st-row.is-flagged { background: linear-gradient(90deg, var(--amber-soft), transparent 60%); margin: 0 -12px; padding: 12px; border-radius: 8px; }
@media (max-width: 860px) { .st-row { grid-template-columns: 1fr; } }
.st-english > div { white-space: pre-wrap; overflow-wrap: anywhere; }
.st-translation textarea { width: 100%; }
.st-check { display: flex; flex-direction: column; gap: 2px; margin: 4px 0 6px; font-size: 13px; }
.st-ok { color: var(--green-dark); } .st-ok .icon, .st-warn .icon { font-size: 16px; vertical-align: -3px; margin-right: 4px; }
.st-warn { color: var(--amber); }
.st-back { font-style: italic; }
.system-tools { display: grid; gap: 8px; }

/* A box heading's "?" sits in the box's top-right corner (as on the Frank site), its tooltip opening leftwards */
.card { position: relative; }
.card > h2:has(> .tip), .card > h3:has(> .tip) { padding-right: 28px; }
.card > h2 > .tip, .card > h3 > .tip { position: absolute; top: 16px; right: 16px; margin: 0; }
/* About the board: contracted hours and days side by side under the team */
.about-grid { grid-template-areas: "name area" "subtitle brand" "objectives team" "objectives commit"; }
.about-commit { grid-area: commit; display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; align-self: start; }
.about-commit .field-note { grid-column: 1 / -1; margin-top: -4px; }
@media (max-width: 760px) { .about-grid { grid-template-areas: "name" "subtitle" "objectives" "area" "brand" "team" "commit"; } }
.idle-input { width: 5.5em; display: inline-block; margin: 0 6px; }


/* ---------- Dark mode: places with a fixed colour (the variables at the top do the rest) ---------- */
:root[data-theme="dark"] .topbar { background: #2f5a3a; box-shadow: 0 1px 0 rgba(0, 0, 0, .5); }
:root[data-theme="dark"] .avatar { background: #e6ebe7; color: #2f5a3a; }
:root[data-theme="dark"] .board-nav-item { color: #c9d1cb; }
:root[data-theme="dark"] .board-nav-item .icon.material-symbols-outlined { color: #9aa59d; }
:root[data-theme="dark"] .board-nav-item.is-active { background: #263a2c; color: #a9d6b4; }
:root[data-theme="dark"] .board-nav-item.is-active .icon.material-symbols-outlined { color: #a9d6b4; }
:root[data-theme="dark"] .nav-mark.is-todo .icon.material-symbols-outlined { color: #5d6862; }
:root[data-theme="dark"] .badge-draft { color: #c9d1cb; }
:root[data-theme="dark"] .badge-closed { color: #d8c7a6; }
:root[data-theme="dark"] .badge-archived { background: #2a302c; color: #a3ada6; }
:root[data-theme="dark"] .alert-success { color: #a9d6b4; }
:root[data-theme="dark"] .alert-warning { border-color: #5a4a22; }
:root[data-theme="dark"] .alert-danger, :root[data-theme="dark"] .danger-zone { border-color: #5c2a26; }
:root[data-theme="dark"] .alert-info { border-color: #24415e; color: #a9cdee; }
:root[data-theme="dark"] .btn-danger { background: #b3261e; color: #fff; }
:root[data-theme="dark"] .btn-danger:hover { background: #c9352c; }
:root[data-theme="dark"] .help-body { color: #c9d1cb; }
:root[data-theme="dark"] .section-nav { background: rgba(18, 22, 20, .94); }
:root[data-theme="dark"] .btn.is-disabled[data-tip-float], :root[data-theme="dark"] .btn.is-disabled[data-tip-float]:hover, :root[data-theme="dark"] .check.is-disabled > span { color: #7d8781; }
:root[data-theme="dark"] .rte-surface:empty::before { color: #7d8781; }
:root[data-theme="dark"] .row-go, :root[data-theme="dark"] .qp-chev { color: #7d8781; }
:root[data-theme="dark"] .tick { color: #7cc48e; }
:root[data-theme="dark"] .post.elsewhere { border-left-color: #2f4a36; }
:root[data-theme="dark"] .email-status.is-missing { color: #b7c0ba; }
:root[data-theme="dark"] .security-list strong { color: #b7c0ba; }
:root[data-theme="dark"] .video-thumb.is-empty { color: #4a544e; }
:root[data-theme="dark"] .rte-code, :root[data-theme="dark"] code { color: #f3a77a; background: #2b2420; }
:root[data-theme="dark"] .code-highlight-back mark { background: #3a2c22; box-shadow: 0 0 0 1px #4a3a2e; }
:root[data-theme="dark"] .answer-grid td.ag-count.is-done { color: #7cc48e; }
:root[data-theme="dark"] .ai-bubble, :root[data-theme="dark"] .ai-question, :root[data-theme="dark"] .ai-topic { color: var(--ink); }
:root[data-theme="dark"] .helper-chip:hover, :root[data-theme="dark"] .helper-chip:focus-visible { border-color: #2c4560; }
:root[data-theme="dark"] .toggle-chip:has(input:checked) { border-color: #3f5e47; }
:root[data-theme="dark"] .pill.is-over { background: #6b5410; color: #fff3cf; }
:root[data-theme="dark"] input[type=datetime-local], :root[data-theme="dark"] input[type=search], :root[data-theme="dark"] input[type=url], :root[data-theme="dark"] input[type=password] { background-color: var(--card); color: var(--ink); border-color: var(--line-strong); }
:root[data-theme="dark"] .switch:not(:checked) { background: #3d4842; }
:root[data-theme="dark"] input::placeholder, :root[data-theme="dark"] textarea::placeholder { color: #7d8781; }
:root[data-theme="dark"] .help-open .help-toggle { background: var(--card); color: var(--green-dark); }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .topbar { background: #2f5a3a; box-shadow: 0 1px 0 rgba(0, 0, 0, .5); }
    :root:not([data-theme="light"]) .avatar { background: #e6ebe7; color: #2f5a3a; }
    :root:not([data-theme="light"]) .board-nav-item { color: #c9d1cb; }
    :root:not([data-theme="light"]) .board-nav-item .icon.material-symbols-outlined { color: #9aa59d; }
    :root:not([data-theme="light"]) .board-nav-item.is-active { background: #263a2c; color: #a9d6b4; }
    :root:not([data-theme="light"]) .board-nav-item.is-active .icon.material-symbols-outlined { color: #a9d6b4; }
    :root:not([data-theme="light"]) .nav-mark.is-todo .icon.material-symbols-outlined { color: #5d6862; }
    :root:not([data-theme="light"]) .badge-draft { color: #c9d1cb; }
    :root:not([data-theme="light"]) .badge-closed { color: #d8c7a6; }
    :root:not([data-theme="light"]) .badge-archived { background: #2a302c; color: #a3ada6; }
    :root:not([data-theme="light"]) .alert-success { color: #a9d6b4; }
    :root:not([data-theme="light"]) .alert-warning { border-color: #5a4a22; }
    :root:not([data-theme="light"]) .alert-danger, :root:not([data-theme="light"]) .danger-zone { border-color: #5c2a26; }
    :root:not([data-theme="light"]) .alert-info { border-color: #24415e; color: #a9cdee; }
    :root:not([data-theme="light"]) .btn-danger { background: #b3261e; color: #fff; }
    :root:not([data-theme="light"]) .btn-danger:hover { background: #c9352c; }
    :root:not([data-theme="light"]) .help-body { color: #c9d1cb; }
    :root:not([data-theme="light"]) .section-nav { background: rgba(18, 22, 20, .94); }
    :root:not([data-theme="light"]) .btn.is-disabled[data-tip-float], :root:not([data-theme="light"]) .btn.is-disabled[data-tip-float]:hover, :root:not([data-theme="light"]) .check.is-disabled > span { color: #7d8781; }
    :root:not([data-theme="light"]) .rte-surface:empty::before { color: #7d8781; }
    :root:not([data-theme="light"]) .row-go, :root:not([data-theme="light"]) .qp-chev { color: #7d8781; }
    :root:not([data-theme="light"]) .tick { color: #7cc48e; }
    :root:not([data-theme="light"]) .post.elsewhere { border-left-color: #2f4a36; }
    :root:not([data-theme="light"]) .email-status.is-missing { color: #b7c0ba; }
    :root:not([data-theme="light"]) .security-list strong { color: #b7c0ba; }
    :root:not([data-theme="light"]) .video-thumb.is-empty { color: #4a544e; }
    :root:not([data-theme="light"]) .rte-code, :root:not([data-theme="light"]) code { color: #f3a77a; background: #2b2420; }
    :root:not([data-theme="light"]) .code-highlight-back mark { background: #3a2c22; box-shadow: 0 0 0 1px #4a3a2e; }
    :root:not([data-theme="light"]) .answer-grid td.ag-count.is-done { color: #7cc48e; }
    :root:not([data-theme="light"]) .ai-bubble, :root:not([data-theme="light"]) .ai-question, :root:not([data-theme="light"]) .ai-topic { color: var(--ink); }
    :root:not([data-theme="light"]) .helper-chip:hover, :root:not([data-theme="light"]) .helper-chip:focus-visible { border-color: #2c4560; }
    :root:not([data-theme="light"]) .toggle-chip:has(input:checked) { border-color: #3f5e47; }
    :root:not([data-theme="light"]) .pill.is-over { background: #6b5410; color: #fff3cf; }
    :root:not([data-theme="light"]) input[type=datetime-local], :root:not([data-theme="light"]) input[type=search], :root:not([data-theme="light"]) input[type=url], :root:not([data-theme="light"]) input[type=password] { background-color: var(--card); color: var(--ink); border-color: var(--line-strong); }
    :root:not([data-theme="light"]) .switch:not(:checked) { background: #3d4842; }
    :root:not([data-theme="light"]) input::placeholder, :root:not([data-theme="light"]) textarea::placeholder { color: #7d8781; }
    :root:not([data-theme="light"]) .help-open .help-toggle { background: var(--card); color: var(--green-dark); }
}

/* Charts (Infrastructure/Charts.cs) draw with fixed colours; CSS outranks SVG attributes, so dark mode retargets them */
:root[data-theme="dark"] svg [stroke="#dfe9f3"] { stroke: #26323d; }
:root[data-theme="dark"] svg [fill="#dfe9f3"] { fill: #26323d; }
:root[data-theme="dark"] svg [stroke="#e4e7e4"] { stroke: #2d3631; }
:root[data-theme="dark"] svg [stroke="#c9cfca"] { stroke: #4a554e; }
:root[data-theme="dark"] svg [fill="#5f6b62"] { fill: #a3ada6; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) svg [stroke="#dfe9f3"] { stroke: #26323d; }
    :root:not([data-theme="light"]) svg [fill="#dfe9f3"] { fill: #26323d; }
    :root:not([data-theme="light"]) svg [stroke="#e4e7e4"] { stroke: #2d3631; }
    :root:not([data-theme="light"]) svg [stroke="#c9cfca"] { stroke: #4a554e; }
    :root:not([data-theme="light"]) svg [fill="#5f6b62"] { fill: #a3ada6; }
}
