/* ==========================================================================
   RootsRing design system
   Motion follows Emil Kowalski's rules: custom ease-out curves, UI under 300ms,
   press feedback on everything pressable, hover gated to real pointers,
   nothing appears from scale(0), and reduced motion is respected.
   ========================================================================== */

:root {
    --paper: #f8f6f1;
    --paper-2: #f1eee6;
    --panel: #ffffff;
    --panel-2: #fbfaf7;
    --ink: #1b1d1a;
    --ink-2: #3d413b;
    --muted: #6b7068;
    --faint: #9a9e96;
    --line: #e4e1d8;
    --line-strong: #d3cfc3;

    --brand: #1e5b47;
    --brand-ink: #ffffff;
    --brand-hover: #174a3a;
    --brand-soft: #e7f0eb;
    --brand-line: #b9d3c6;
    --accent: #b5763a;
    --accent-soft: #f6ebdd;

    --good: #23704f;
    --good-soft: #e3f2ea;
    --warn: #93600f;
    --warn-soft: #fbefd6;
    --bad: #a83a32;
    --bad-soft: #fae5e2;
    --info: #2c5d8a;
    --info-soft: #e3edf7;

    --shadow-sm: 0 1px 2px rgba(27, 29, 26, .06);
    --shadow: 0 1px 2px rgba(27, 29, 26, .05), 0 8px 24px -8px rgba(27, 29, 26, .12);
    --shadow-lg: 0 2px 4px rgba(27, 29, 26, .04), 0 24px 48px -12px rgba(27, 29, 26, .22);
    --ring: 0 0 0 3px rgba(30, 91, 71, .28);

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 18px;

    --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-serif: "Fraunces", ui-serif, Georgia, "Times New Roman", serif;

    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
    --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

    --sidebar: 264px;
    --topbar: 60px;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --paper: #121412;
        --paper-2: #181b18;
        --panel: #1a1d1a;
        --panel-2: #1f231f;
        --ink: #ecebe6;
        --ink-2: #cfcfc8;
        --muted: #9fa39b;
        --faint: #747970;
        --line: #2b302b;
        --line-strong: #3a403a;
        --brand: #5fb894;
        --brand-ink: #0d1a14;
        --brand-hover: #79c9a7;
        --brand-soft: #1b2e26;
        --brand-line: #2f5345;
        --accent: #d79a5c;
        --accent-soft: #2f2418;
        --good: #6cc59c;
        --good-soft: #17291f;
        --warn: #e0b45f;
        --warn-soft: #2d2412;
        --bad: #ec8a80;
        --bad-soft: #321b18;
        --info: #8ab8e3;
        --info-soft: #172433;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -8px rgba(0, 0, 0, .5);
        --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, .6);
        --ring: 0 0 0 3px rgba(95, 184, 148, .35);
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --paper: #121412;
    --paper-2: #181b18;
    --panel: #1a1d1a;
    --panel-2: #1f231f;
    --ink: #ecebe6;
    --ink-2: #cfcfc8;
    --muted: #9fa39b;
    --faint: #747970;
    --line: #2b302b;
    --line-strong: #3a403a;
    --brand: #5fb894;
    --brand-ink: #0d1a14;
    --brand-hover: #79c9a7;
    --brand-soft: #1b2e26;
    --brand-line: #2f5345;
    --accent: #d79a5c;
    --accent-soft: #2f2418;
    --good: #6cc59c;
    --good-soft: #17291f;
    --warn: #e0b45f;
    --warn-soft: #2d2412;
    --bad: #ec8a80;
    --bad-soft: #321b18;
    --info: #8ab8e3;
    --info-soft: #172433;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -8px rgba(0, 0, 0, .5);
    --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, .6);
    --ring: 0 0 0 3px rgba(95, 184, 148, .35);
    color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--brand); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.2; letter-spacing: -.01em; color: var(--ink); }
h1 { font-family: var(--font-serif); font-weight: 600; font-size: clamp(1.7rem, 3.2vw, 2.2rem); letter-spacing: -.02em; font-variation-settings: "opsz" 60; }
h2 { font-size: 1.12rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0 0 .8rem; }
small, .small { font-size: .85rem; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86em; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.25rem 0; }
::selection { background: var(--brand-soft); color: var(--ink); }

.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }

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

/* ---------- Buttons ---------- */
.btn {
    --btn-bg: var(--panel);
    --btn-fg: var(--ink);
    --btn-border: var(--line-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 40px;
    padding: .55rem 1rem;
    border: 1px solid var(--btn-border);
    border-radius: 10px;
    background: var(--btn-bg);
    color: var(--btn-fg);
    font: 600 .92rem/1.2 var(--font-sans);
    text-decoration: none;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: transform 160ms var(--ease-out), background-color 150ms ease, border-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
    -webkit-tap-highlight-color: transparent;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }
.btn-primary { --btn-bg: var(--brand); --btn-fg: var(--brand-ink); --btn-border: var(--brand); box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 1px 2px rgba(0,0,0,.12); }
.btn-ghost { --btn-bg: transparent; --btn-border: transparent; color: var(--ink-2); }
.btn-danger { --btn-bg: var(--bad); --btn-fg: #fff; --btn-border: var(--bad); }
.btn-danger-soft { --btn-bg: var(--bad-soft); --btn-fg: var(--bad); --btn-border: transparent; }
.btn-soft { --btn-bg: var(--brand-soft); --btn-fg: var(--brand); --btn-border: transparent; }
.btn-sm { min-height: 32px; padding: .35rem .7rem; font-size: .84rem; border-radius: 8px; }
.btn-lg { min-height: 48px; padding: .8rem 1.35rem; font-size: 1rem; border-radius: 12px; }
.btn-icon { width: 40px; padding: 0; }
.btn-sm.btn-icon { width: 32px; }
.btn-block { width: 100%; }

@media (hover: hover) and (pointer: fine) {
    .btn:hover { --btn-border: var(--faint); }
    .btn-primary:hover { --btn-bg: var(--brand-hover); --btn-border: var(--brand-hover); }
    .btn-ghost:hover { --btn-bg: var(--paper-2); --btn-border: transparent; }
    .btn-danger:hover { filter: brightness(1.06); }
    .btn-soft:hover { filter: brightness(.97); }
}

/* ---------- Forms ---------- */
.field { display: grid; gap: .35rem; }
.field + .field { margin-top: .9rem; }
.label { font-weight: 600; font-size: .88rem; color: var(--ink-2); }
.hint { font-size: .82rem; color: var(--muted); }
.input, .select, .textarea {
    width: 100%;
    min-height: 42px;
    padding: .6rem .75rem;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--panel);
    color: var(--ink);
    font: 400 .95rem/1.4 var(--font-sans);
    transition: border-color 150ms ease, box-shadow 150ms ease;
    appearance: none;
}
.select {
    padding-right: 2.2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%236b7068' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .8rem center;
}
.textarea { min-height: 96px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input-group { display: flex; gap: .5rem; }
.input-group .input { flex: 1; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .92rem; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: .12rem 0 0; accent-color: var(--brand); flex: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 1rem; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .field + .field { margin-top: 0; }
.form-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: 1.25rem; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 650; margin-bottom: .6rem; }
.form-section { padding: 1.25rem 0; border-top: 1px solid var(--line); }
.form-section:first-child { border-top: 0; padding-top: 0; }

/* ---------- Surfaces ---------- */
.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card-body { padding: 1.25rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { margin: 0; }
.card-foot { padding: .85rem 1.25rem; border-top: 1px solid var(--line); background: var(--panel-2); border-radius: 0 0 var(--radius) var(--radius); }
.card-link { display: block; color: inherit; transition: border-color 150ms ease, box-shadow 200ms var(--ease-out), transform 200ms var(--ease-out); }
.card-link:hover { text-decoration: none; }
@media (hover: hover) and (pointer: fine) {
    .card-link:hover { border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
}
.card-link:active { transform: scale(0.99); }

.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.25rem; align-items: start; }
.stack { display: grid; gap: 1rem; }
.stack-sm { display: grid; gap: .5rem; }
.row { display: flex; gap: .75rem; align-items: center; }
.row-wrap { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.between { display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.spacer { flex: 1; }
.mt { margin-top: 1rem; }
.mt-lg { margin-top: 1.75rem; }
.mb-0 { margin-bottom: 0; }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head p { margin: .25rem 0 0; color: var(--muted); max-width: 62ch; }
.page-head .actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.eyebrow { display: inline-flex; align-items: center; gap: .4rem; margin: 0 0 .4rem; font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.crumbs { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; font-size: .84rem; color: var(--muted); margin-bottom: .6rem; }
.crumbs a { color: var(--muted); }
.crumbs .sep { color: var(--faint); }

/* ---------- Stats ---------- */
.stat { padding: 1rem 1.15rem; }
.stat .value { display: block; font-family: var(--font-serif); font-size: 1.9rem; font-weight: 600; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .label { display: block; margin-top: .25rem; color: var(--muted); font-weight: 500; font-size: .84rem; }
.stat .trend { font-size: .8rem; color: var(--muted); }
.stat-alert .value { color: var(--warn); }

/* ---------- Badges & pills ---------- */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .14rem .55rem; border-radius: 999px; font-size: .76rem; font-weight: 600; line-height: 1.5; white-space: nowrap; background: var(--paper-2); color: var(--ink-2); }
.badge-good { background: var(--good-soft); color: var(--good); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-info { background: var(--info-soft); color: var(--info); }
.count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Lists & tables ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; gap: .85rem; align-items: center; padding: .85rem 1.25rem; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .meta { display: block; color: var(--muted); font-size: .84rem; }
.list-link { color: inherit; }
.list-link:hover { text-decoration: none; }
.list > li.is-unread .title::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: .45rem; border-radius: 50%; background: var(--accent); vertical-align: middle; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { position: sticky; top: 0; text-align: left; font-size: .75rem; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: var(--panel-2); padding: .65rem 1rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: .7rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .actions { text-align: right; white-space: nowrap; }
@media (hover: hover) and (pointer: fine) {
    .table tbody tr { transition: background-color 120ms ease; }
    .table tbody tr:hover { background: var(--panel-2); }
}

.dl { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: .55rem 1rem; margin: 0; }
.dl dt { color: var(--muted); font-size: .88rem; }
.dl dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

/* ---------- Avatars ---------- */
.avatar { display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: .82rem; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 88px; height: 88px; font-size: 1.6rem; font-family: var(--font-serif); }
.avatar-sm { width: 28px; height: 28px; font-size: .7rem; }

/* ---------- Alerts / callouts ---------- */
.callout { display: flex; gap: .75rem; align-items: flex-start; padding: .9rem 1rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel-2); font-size: .92rem; }
.callout .icon { margin-top: .1rem; }
.callout p:last-child { margin-bottom: 0; }
.callout-warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.callout-warn strong, .callout-bad strong { color: inherit; }
.callout-bad { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.callout-good { background: var(--good-soft); border-color: transparent; color: var(--good); }
.callout-info { background: var(--info-soft); border-color: transparent; color: var(--info); }
.callout .body { color: var(--ink-2); }

.empty { padding: 2.5rem 1.25rem; text-align: center; color: var(--muted); }
.empty .icon { width: 32px; height: 32px; margin: 0 auto .75rem; color: var(--faint); }
.empty h3 { color: var(--ink); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); margin-bottom: 1.5rem; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { position: relative; display: inline-flex; gap: .4rem; align-items: center; padding: .7rem .8rem; color: var(--muted); font-weight: 600; font-size: .9rem; white-space: nowrap; text-decoration: none; transition: color 150ms ease; }
.tabs a::after { content: ""; position: absolute; left: .6rem; right: .6rem; bottom: -1px; height: 2px; border-radius: 2px; background: var(--brand); transform: scaleX(0); transition: transform 200ms var(--ease-out); }
.tabs a[aria-current="page"] { color: var(--ink); }
.tabs a[aria-current="page"]::after { transform: scaleX(1); }
@media (hover: hover) and (pointer: fine) { .tabs a:hover { color: var(--ink); } }

.segmented { display: inline-flex; max-width: 100%; overflow-x: auto; scrollbar-width: none; padding: 3px; gap: 2px; border-radius: 10px; background: var(--paper-2); }
.segmented::-webkit-scrollbar { display: none; }
.segmented a { white-space: nowrap; padding: .35rem .75rem; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: .84rem; text-decoration: none; transition: background-color 150ms ease, color 150ms ease; }
.segmented a[aria-current="page"] { background: var(--panel); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: .35rem; align-items: center; justify-content: center; padding: 1rem; }
.pagination .info { color: var(--muted); font-size: .85rem; padding: 0 .5rem; }

/* ---------- Toolbar / filters ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .85rem 1.25rem; border-bottom: 1px solid var(--line); }
.toolbar .input, .toolbar .select { min-height: 36px; padding-top: .4rem; padding-bottom: .4rem; width: auto; }
.toolbar .search { flex: 1 1 220px; }

/* ==========================================================================
   App shell
   ========================================================================== */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100dvh; }
.sidebar {
    position: sticky; top: 0; height: 100dvh; overflow-y: auto;
    display: flex; flex-direction: column; gap: .25rem;
    padding: 1rem .75rem;
    border-right: 1px solid var(--line);
    background: var(--panel-2);
}
.sidebar .brand { display: flex; align-items: center; gap: .6rem; padding: .35rem .6rem 1rem; color: var(--ink); font-family: var(--font-serif); font-size: 1.18rem; font-weight: 600; letter-spacing: -.01em; text-decoration: none; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.nav-group { margin-top: .9rem; }
.nav-label { padding: .2rem .7rem .35rem; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.nav-item {
    display: flex; align-items: center; gap: .7rem;
    padding: .5rem .7rem; border-radius: 9px;
    color: var(--ink-2); font-weight: 550; font-size: .92rem; text-decoration: none;
    transition: background-color 120ms ease, color 120ms ease;
}
.nav-item .icon { color: var(--muted); transition: color 120ms ease; }
.nav-item .count { margin-left: auto; }
.nav-item:hover { text-decoration: none; }
.nav-item[aria-current="page"] { background: var(--brand-soft); color: var(--brand); }
.nav-item[aria-current="page"] .icon { color: var(--brand); }
@media (hover: hover) and (pointer: fine) {
    .nav-item:hover { background: var(--paper-2); color: var(--ink); }
    .nav-item[aria-current="page"]:hover { background: var(--brand-soft); color: var(--brand); }
}
.sidebar-foot { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--line); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: .75rem;
    height: var(--topbar); padding: 0 1.5rem;
    background: color-mix(in srgb, var(--paper) 86%, transparent);
    backdrop-filter: saturate(1.4) blur(10px);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--line);
}
.topbar .brand { display: none; }
.content { width: 100%; max-width: 1180px; margin: 0 auto; padding: 1.75rem 1.5rem 4rem; }
.content-wide { max-width: 1400px; }
.content-narrow { max-width: 720px; }

/* User menu / popover - scales from its trigger (origin-aware), 150ms ease-out */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 50;
    min-width: 240px; padding: .4rem;
    background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg);
    transform-origin: top right;
    opacity: 1; transform: scale(1);
    transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out);
}
@starting-style { .menu[open] .menu-panel { opacity: 0; transform: scale(0.96); } }
.menu-panel a, .menu-panel button {
    display: flex; width: 100%; align-items: center; gap: .6rem;
    padding: .55rem .65rem; border: 0; border-radius: 8px; background: none;
    color: var(--ink-2); font: 500 .9rem var(--font-sans); text-align: left; text-decoration: none; cursor: pointer;
}
.menu-panel a:hover, .menu-panel button:hover { background: var(--paper-2); color: var(--ink); text-decoration: none; }
.menu-panel .menu-head { padding: .55rem .65rem .65rem; border-bottom: 1px solid var(--line); margin-bottom: .3rem; }
.menu-panel .menu-head strong { display: block; }
.menu-panel .menu-head span { color: var(--muted); font-size: .84rem; }
.menu-panel hr { margin: .3rem 0; }

.avatar-btn { display: flex; align-items: center; gap: .5rem; padding: .2rem .45rem .2rem .2rem; border-radius: 999px; transition: background-color 120ms ease, transform 160ms var(--ease-out); }
.avatar-btn:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .avatar-btn:hover { background: var(--paper-2); } }

.icon-btn { position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: var(--ink-2); transition: background-color 120ms ease, transform 160ms var(--ease-out); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn:hover { text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .icon-btn:hover { background: var(--paper-2); color: var(--ink); } }
.icon-btn .dot { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--paper); }

/* Mobile bottom navigation (spec: simple, large tap targets) */
.bottom-nav { display: none; }

/* Drawer for the sidebar on small screens - iOS-like drawer curve */
.drawer-backdrop { display: none; }

@media (max-width: 960px) {
    .shell { grid-template-columns: minmax(0, 1fr); }
    .sidebar {
        position: fixed; inset: 0 auto 0 0; z-index: 60; width: min(86vw, 300px);
        transform: translateX(-100%);
        transition: transform 320ms var(--ease-drawer);
        box-shadow: var(--shadow-lg);
        visibility: hidden;
    }
    body.drawer-open .sidebar { transform: translateX(0); visibility: visible; }
    .drawer-backdrop {
        display: block; position: fixed; inset: 0; z-index: 55;
        background: rgba(10, 12, 10, .4);
        opacity: 0; pointer-events: none;
        transition: opacity 240ms ease;
    }
    body.drawer-open .drawer-backdrop { opacity: 1; pointer-events: auto; }
    .topbar { padding: 0 1rem; }
    .topbar .brand { display: flex; align-items: center; gap: .5rem; color: var(--ink); font-family: var(--font-serif); font-weight: 600; font-size: 1.05rem; text-decoration: none; }
    .content { padding: 1.25rem 1rem 6rem; }
    .bottom-nav {
        display: grid; grid-template-columns: repeat(4, 1fr);
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
        padding: .35rem .5rem calc(.35rem + env(safe-area-inset-bottom));
        background: color-mix(in srgb, var(--panel) 92%, transparent);
        backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
        border-top: 1px solid var(--line);
    }
    .bottom-nav a { position: relative; display: grid; justify-items: center; gap: .15rem; padding: .4rem 0; border-radius: 10px; color: var(--muted); font-size: .7rem; font-weight: 600; text-decoration: none; transition: transform 160ms var(--ease-out), color 120ms ease; }
    .bottom-nav a:active { transform: scale(0.94); }
    .bottom-nav a[aria-current="page"] { color: var(--brand); }
    .bottom-nav .icon { width: 22px; height: 22px; }
    .bottom-nav .count { position: absolute; top: 0; left: calc(50% + 4px); min-width: 17px; height: 17px; font-size: .64rem; }
}
@media (min-width: 961px) { .hide-desktop { display: none !important; } }
@media (max-width: 960px) { .hide-mobile { display: none !important; } }

/* ==========================================================================
   Toasts (Sonner-style): enter from below, exit faster, pause on hover/hidden tab
   ========================================================================== */
.toaster { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 100; display: grid; gap: .6rem; width: min(380px, calc(100vw - 2rem)); pointer-events: none; }
.toast {
    pointer-events: auto;
    display: flex; gap: .7rem; align-items: flex-start;
    padding: .85rem .95rem; border-radius: 12px;
    background: var(--panel); color: var(--ink);
    border: 1px solid var(--line); box-shadow: var(--shadow-lg);
    font-size: .92rem;
    transform: translateY(0); opacity: 1;
    transition: transform 400ms var(--ease-out), opacity 400ms var(--ease-out);
}
.toast[data-state="entering"] { transform: translateY(calc(100% + 1.25rem)); opacity: 0; }
.toast[data-state="leaving"] { transform: translateY(8px) scale(0.97); opacity: 0; transition-duration: 180ms; }
.toast .icon { margin-top: 1px; }
.toast-success .icon { color: var(--good); }
.toast-error .icon { color: var(--bad); }
.toast .grow { flex: 1; }
.toast-close { border: 0; background: none; color: var(--faint); cursor: pointer; padding: 2px; border-radius: 6px; }
.toast-close:hover { color: var(--ink); }
@media (max-width: 960px) { .toaster { right: 1rem; left: 1rem; bottom: calc(76px + env(safe-area-inset-bottom)); width: auto; } }

/* ==========================================================================
   Dialog (confirmations) - centred, scale 0.96 + fade, 200ms ease-out
   ========================================================================== */
.dialog {
    width: min(440px, calc(100vw - 2rem));
    padding: 0; border: 1px solid var(--line); border-radius: var(--radius-lg);
    background: var(--panel); color: var(--ink); box-shadow: var(--shadow-lg);
    opacity: 1; transform: scale(1);
    transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out), overlay 200ms allow-discrete, display 200ms allow-discrete;
}
.dialog:not([open]) { opacity: 0; transform: scale(0.96); }
@starting-style { .dialog[open] { opacity: 0; transform: scale(0.96); } }
.dialog::backdrop { background: rgba(10, 12, 10, .45); opacity: 1; transition: opacity 200ms ease, overlay 200ms allow-discrete, display 200ms allow-discrete; }
@starting-style { .dialog[open]::backdrop { opacity: 0; } }
.dialog-body { padding: 1.4rem 1.4rem 1rem; }
.dialog-body h2 { font-size: 1.1rem; }
.dialog-body p { color: var(--muted); margin: 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: .5rem; padding: .9rem 1.4rem 1.2rem; }

/* Collapsible sections */
.disclosure > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .5rem; font-weight: 600; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary .chev { transition: transform 200ms var(--ease-out); }
.disclosure[open] > summary .chev { transform: rotate(90deg); }

/* ==========================================================================
   Tree-specific UI
   ========================================================================== */
.tree-hero { display: flex; gap: 1rem; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 1rem; }
.tree-hero h1 { margin-bottom: .2rem; }
.role-chip { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .6rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .76rem; font-weight: 700; text-transform: capitalize; }

.tree-card { padding: 1.2rem; display: grid; gap: .9rem; }
.tree-card .top { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; }
.tree-card h2 { font-family: var(--font-serif); font-weight: 600; font-size: 1.25rem; margin: 0; }
.tree-card .facts { display: flex; gap: 1.1rem; color: var(--muted); font-size: .85rem; }
.tree-card .facts strong { color: var(--ink); font-variant-numeric: tabular-nums; }

.person-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem; }
.person-tile { display: flex; gap: .75rem; align-items: center; padding: .8rem .9rem; }
.person-tile .grow { min-width: 0; }
.person-tile strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.person-tile .grow span { display: block; color: var(--muted); font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.profile-head { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
.profile-head h1 { margin-bottom: .15rem; }
.profile-facts { display: flex; flex-wrap: wrap; gap: .5rem 1.1rem; color: var(--muted); font-size: .9rem; }
.profile-facts span { display: inline-flex; gap: .35rem; align-items: center; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 1.25rem; position: relative; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--line); border-radius: 2px; }
.timeline li { position: relative; padding: 0 0 1.1rem .5rem; }
.timeline li::before { content: ""; position: absolute; left: -1.25rem; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--panel); border: 2px solid var(--brand); }
.timeline .when { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.note { padding: 1rem 1.25rem; border-top: 1px solid var(--line); }
.note:first-child { border-top: 0; }
.note p { white-space: pre-line; }
.note .by { font-size: .82rem; color: var(--muted); }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.gallery figure { margin: 0; position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--panel-2); }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.gallery .doc { display: grid; place-items: center; aspect-ratio: 1; color: var(--muted); }
.gallery figcaption { padding: .5rem .6rem; font-size: .8rem; color: var(--muted); display: flex; gap: .3rem; justify-content: space-between; align-items: center; }
.gallery figcaption span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.change { padding: 1.1rem 1.25rem; border-top: 1px solid var(--line); }
.change:first-child { border-top: 0; }
.change .diff { display: grid; grid-template-columns: 140px 1fr 1fr; gap: .25rem .75rem; margin: .75rem 0; font-size: .86rem; }
.change .diff .k { color: var(--muted); }
.change .diff .old { color: var(--bad); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--bad) 50%, transparent); }
.change .diff .new { color: var(--good); font-weight: 600; }
.change .review { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.change .review .input { flex: 1 1 220px; min-height: 36px; }

.copy-field { display: flex; gap: .5rem; align-items: center; padding: .4rem .4rem .4rem .75rem; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--panel-2); }
.copy-field code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .84rem; }

.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; padding: 1rem; border-radius: 10px; background: var(--paper-2); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .95rem; letter-spacing: .04em; text-align: center; }

.qr-box { display: grid; place-items: center; width: 196px; height: 196px; padding: 10px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }

/* ---------- Tree canvas ---------- */
.tree-toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .75rem; }
.tree-toolbar .input { max-width: 320px; min-height: 38px; }
.tree-canvas {
    position: relative; overflow: hidden; touch-action: none; cursor: grab;
    height: min(74vh, 820px); min-height: 460px;
    border: 1px solid var(--line); border-radius: var(--radius);
    background-color: var(--panel-2);
    background-image: radial-gradient(circle, var(--line) 1px, transparent 1px);
    background-size: 22px 22px;
}
.tree-canvas:active { cursor: grabbing; }
.tree-stage { position: absolute; inset: 0; transform-origin: 0 0; will-change: transform; }
/* max-width: none - the global svg { max-width: 100% } would shrink this layer (and its viewBox) out of line with the cards */
.relationship-layer { position: absolute; left: 0; top: 0; max-width: none; overflow: visible; pointer-events: none; }
.relation-line { fill: none; stroke: var(--brand-line); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.relation-line.trunk { stroke: var(--brand); stroke-width: 2.25; }
.relation-label { display: none; }
.person-card {
    position: absolute; width: 150px; min-height: 76px;
    display: flex; gap: .6rem; align-items: center;
    padding: .65rem .7rem; border-radius: 12px;
    background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow);
    cursor: pointer; user-select: none;
    transition: border-color 150ms ease, box-shadow 200ms var(--ease-out), transform 160ms var(--ease-out);
}
.person-card:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .person-card:hover { border-color: var(--brand-line); box-shadow: var(--shadow-lg); } }
.person-card .avatar { width: 34px; height: 34px; font-size: .74rem; }
.person-card .text { min-width: 0; }
.person-card strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: .95rem; line-height: 1.18; overflow: hidden; overflow-wrap: anywhere; }
.person-card .text span { display: block; color: var(--muted); font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-card.deceased .avatar { filter: grayscale(.6); }
.person-card.focused { border-color: var(--brand); box-shadow: var(--ring), var(--shadow); }
.person-card.highlight { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent), var(--shadow); }
.person-card.linked { background: var(--brand-soft); border-style: dashed; border-color: var(--brand-line); box-shadow: none; }
.person-card.linked .text span { color: var(--brand); font-weight: 600; }
.person-card.located { animation: located-pulse 1.4s var(--ease-out); }
@keyframes located-pulse {
    0%, 35% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--brand) 35%, transparent); border-color: var(--brand); }
    100% { box-shadow: var(--shadow); }
}
.couple-symbol { position: absolute; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--brand-line); background: var(--panel); color: var(--brand); font-size: .8rem; font-weight: 800; }
.generation-label { position: absolute; width: 110px; color: var(--faint); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.parents-hint { position: absolute; transform: translateX(-50%); }

/* Person detail sheet on the tree view: drawer from the right (bottom on phones) */
.sheet {
    position: absolute; right: 12px; top: 12px; z-index: 5; width: min(320px, calc(100% - 24px));
    padding: 1rem; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
    transform: translateX(0); opacity: 1;
    transition: transform 260ms var(--ease-drawer), opacity 200ms var(--ease-out);
}
.sheet[hidden] { display: block; transform: translateX(calc(100% + 24px)); opacity: 0; pointer-events: none; }
.sheet .head { display: flex; gap: .75rem; align-items: center; margin-bottom: .75rem; }
.sheet .head strong { display: block; font-size: 1.02rem; }
.sheet .head div span { color: var(--muted); font-size: .84rem; }
.sheet .close { position: absolute; top: .5rem; right: .5rem; }
@media (max-width: 640px) {
    .sheet { left: 8px; right: 8px; top: auto; bottom: 8px; width: auto; }
    .sheet[hidden] { transform: translateY(calc(100% + 16px)); }
}

/* ---------- Auth pages ---------- */
.auth { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-aside {
    position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
    padding: 2.5rem; color: #eef3ef;
    background: radial-gradient(120% 90% at 0% 0%, #2a7259 0%, #1a4d3c 45%, #0f2f25 100%);
}
.auth-aside .brand { color: #fff; display: flex; align-items: center; gap: .6rem; font-family: var(--font-serif); font-size: 1.25rem; font-weight: 600; text-decoration: none; }
.auth-aside blockquote { margin: 0; max-width: 30ch; font-family: var(--font-serif); font-size: clamp(1.4rem, 2.4vw, 2rem); line-height: 1.25; letter-spacing: -.01em; }
.auth-aside .foot { color: rgba(238, 243, 239, .7); font-size: .85rem; }
.auth-aside svg.deco { position: absolute; right: -60px; bottom: -40px; width: 420px; opacity: .14; }
.auth-main { display: grid; place-items: center; padding: 2rem 1.25rem; }
.auth-card { width: min(420px, 100%); }
.auth-card h1 { margin-bottom: .35rem; }
.auth-card .sub { color: var(--muted); margin-bottom: 1.5rem; }
.auth-card .alt { margin-top: 1.25rem; text-align: center; color: var(--muted); font-size: .92rem; }
.auth-card .mobile-brand { display: none; }
@media (max-width: 860px) {
    .auth { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
    .auth-card .mobile-brand { display: flex; align-items: center; gap: .5rem; margin-bottom: 2rem; color: var(--ink); font-family: var(--font-serif); font-weight: 600; font-size: 1.15rem; text-decoration: none; }
}
.password-meter { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.password-meter span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--bad); transition: width 240ms var(--ease-out), background-color 240ms ease; }

/* ---------- Error page ---------- */
.error-page { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 3rem 1rem; }
.error-page .code { font-family: var(--font-serif); font-size: clamp(4rem, 12vw, 7rem); line-height: 1; color: var(--brand); letter-spacing: -.04em; margin-bottom: .5rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .split { grid-template-columns: minmax(0, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    body { font-size: 15.5px; }
    .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
    .form-grid { grid-template-columns: minmax(0, 1fr); }
    .form-grid .span-2 { grid-column: auto; }
    .dl { grid-template-columns: minmax(0, 1fr); gap: .1rem; }
    .dl dd { margin-bottom: .6rem; }
    .change .diff { grid-template-columns: 1fr; }
    .page-head .actions { width: 100%; }
    .page-head .actions .btn { flex: 1; }
    .card-head { padding: .9rem 1rem; }
    .card-body { padding: 1rem; }
    .list > li { padding: .8rem 1rem; }
    .btn { min-height: 44px; }
    .btn-sm { min-height: 36px; }
    .input, .select, .textarea { font-size: 16px; min-height: 46px; }
    .table-cards thead { display: none; }
    .table-cards tr { display: grid; gap: .2rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
    .table-cards td { display: flex; justify-content: space-between; gap: 1rem; padding: .1rem 0; border: 0; }
    .table-cards td::before { content: attr(data-label); color: var(--muted); font-size: .8rem; }
    .table-cards td.actions { justify-content: flex-start; }
    .table-cards td.actions::before { content: none; }
}

/* ---------- Reduced motion: keep fades that aid comprehension, drop movement ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; }
    .btn:active, .card-link:active, .person-card:active, .icon-btn:active, .avatar-btn:active, .bottom-nav a:active { transform: none; }
    .menu-panel, .dialog, .toast, .sheet, .sidebar { transition-property: opacity !important; }
    .toast[data-state="entering"], .toast[data-state="leaving"], .sheet[hidden] { transform: none; }
    .card-link:hover { transform: none; }
    .person-card.located { animation: none; box-shadow: var(--ring); }
}

/* ---------- Tree sheet: photos & relatives ---------- */
.sheet { max-height: calc(100% - 24px); overflow-y: auto; }
.sheet .photos { margin-bottom: .75rem; }
.photo-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; margin-bottom: .6rem; }
.photo-thumb {
    padding: 0; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--paper-2);
    aspect-ratio: 1; cursor: zoom-in;
    transition: transform 160ms var(--ease-out), border-color 150ms ease;
}
.photo-thumb:active { transform: scale(0.96); }
@media (hover: hover) and (pointer: fine) { .photo-thumb:hover { border-color: var(--brand-line); } }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-upload label { cursor: pointer; }
.sheet .actions { margin-bottom: .25rem; }

/* ---------- Lightbox: centred (modal), scale 0.96 + fade, exit faster than enter ---------- */
.lightbox {
    width: min(960px, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem);
    padding: 0; overflow: hidden; background: #0d0f0d; border-color: #222; color: #eee;
}
.lightbox::backdrop { background: rgba(5, 6, 5, .82); }
.lightbox figure { margin: 0; display: grid; }
.lightbox img { width: 100%; max-height: calc(100dvh - 6rem); object-fit: contain; background: #0d0f0d; user-select: none; }
.lightbox figcaption { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 1rem; font-size: .9rem; }
.lb-btn {
    position: absolute; display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 50%;
    background: rgba(20, 22, 20, .72); color: #fff; cursor: pointer;
    transition: transform 160ms var(--ease-out), background-color 150ms ease;
}
.lb-btn:active { transform: scale(0.94); }
@media (hover: hover) and (pointer: fine) { .lb-btn:hover { background: rgba(40, 44, 40, .9); } }
.lb-prev { left: .75rem; top: calc(50% - 40px); }
.lb-next { right: .75rem; top: calc(50% - 40px); }
.lb-close { right: .75rem; top: .75rem; }
.lightbox:not([open]) { transition-duration: 150ms; }

/* ---------- Brand lockup (logo mark + wordmark) ---------- */
.brand-mark { flex: none; width: 30px; height: 30px; }
.topbar .brand-mark { width: 26px; height: 26px; }
.wordmark { font-family: var(--font-serif); font-weight: 600; letter-spacing: -.015em; white-space: nowrap; }
.wordmark .tld { color: var(--accent); font-weight: 500; }
.auth-aside .wordmark .tld { color: #f0c28d; }
.auth-aside .brand-mark { border-radius: 8px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .28); }

/* Full-screen tree: the canvas fills the display; the person sheet and controls stay usable */
.tree-canvas:fullscreen { height: 100vh; min-height: 0; border: 0; border-radius: 0; }
.tree-canvas::backdrop { background: var(--panel-2); }

/* Branch fold/unfold: small pill under a family; folded branches show how many people they hold */
.branch-toggle {
    position: absolute; z-index: 2; transform: translateX(-50%);
    min-width: 26px; height: 22px; padding: 0 .45rem;
    display: grid; place-items: center;
    border-radius: 999px; border: 1px solid var(--brand-line);
    background: var(--panel); color: var(--brand);
    font: 700 .74rem/1 var(--font-sans); cursor: pointer;
    transition: transform 160ms var(--ease-out), background-color 150ms ease, color 150ms ease;
}
.branch-toggle:active { transform: translateX(-50%) scale(0.94); }
.branch-toggle.is-collapsed { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
@media (hover: hover) and (pointer: fine) {
    .branch-toggle:hover { background: var(--brand-soft); }
    .branch-toggle.is-collapsed:hover { background: var(--brand-hover); }
}

/* reCAPTCHA v3: Google allows hiding the floating badge when this notice is shown on protected forms */
.grecaptcha-badge { visibility: hidden !important; }
.recaptcha-notice { margin: .9rem 0 0; font-size: .76rem; line-height: 1.45; color: var(--faint); text-align: center; }
.recaptcha-notice a { color: var(--muted); text-decoration: underline; }

/* ---------- Group invite links ---------- */
.group-link { padding: 1rem 1.25rem; border-top: 1px solid var(--line); }
.group-link:first-of-type { border-top: 0; }
.group-link-new { padding: 1rem 1.25rem; border-top: 1px solid var(--line); }
.btn-whatsapp { --btn-bg: #1f9d55; --btn-fg: #fff; --btn-border: #1f9d55; }
@media (hover: hover) and (pointer: fine) { .btn-whatsapp:hover { --btn-bg: #188a49; --btn-border: #188a49; } }

/* RootsRing wordmark: "Roots" in ink, "Ring" in forest green (lighter on the dark sign-in panel) */
.wordmark .accent { color: var(--brand); }
.auth-aside .wordmark .accent { color: #7fd0ac; }
