/* =============================================================================
 * basic.css — Eukleia Basic Skin
 *
 * The second skin: intentionally minimal styling, but a distinct LAYOUT
 * from the dev skin.  Sidebar + top bar + canvas + bottom-left status
 * pane.  Light/dark variant via CSS variables.
 *
 * Everything is scoped under body.euk-skin-basic so this CSS doesn't
 * accidentally leak to the dev skin.  The dev.css file uses no
 * body-prefix selectors today; coexisting them is safe because basic.css
 * is only loaded when the basic skin renders.
 *
 * To FORK this skin:
 *   1. Copy basic.css → mystyle.css
 *   2. Change the variable values in :root and html.dark
 *   3. Optionally adjust layout values (sidebar width, top-bar height)
 *   4. Register the skin module pointing at /css/mystyle.css
 *
 * See docs/skinning.md for the full skin contract + slot reference.
 * ============================================================================= */


/* ── Theme variables ────────────────────────────────────────────────────── */
/* Light (default).  body.euk-skin-basic inherits these.
   Font stacks are CSS variables so themes can swap them — the sandy
   theme replaces system-ui with Playfair Display (headings) and DM Mono
   (body text) to match the chat page's warm editorial feel.  Default
   keeps the platform sans-serif stack. */
:root {
    --euk-bg:           #fafafa;
    --euk-bg-elevated:  #ffffff;
    --euk-fg:           #1a1a1a;
    --euk-fg-muted:     #666666;
    --euk-border:       #dddddd;
    --euk-accent:       #0066cc;
    --euk-accent-soft:  #eaf2fb;
    --euk-error:        #a33333;
    --euk-success:      #2a9d5c;

    /* Chart palette — part of the skin contract (2026-11-17, Finance sketch).
       Any server-rendered SVG chart paints ONLY through these tokens, so a
       skin (or its dark mode) retints every chart by overriding them here.
       c0…c7 is the categorical cycle: c0 reads as money-in/savings, warm
       hues as spending, keep reds for .euk-fin-neg/debt accents. */
    --euk-chart-c0:    #2f8f5b;
    --euk-chart-c1:    #3b76c4;
    --euk-chart-c2:    #d9a521;
    --euk-chart-c3:    #c45b3b;
    --euk-chart-c4:    #7a5bc4;
    --euk-chart-c5:    #2fa3a0;
    --euk-chart-c6:    #b03a6e;
    --euk-chart-c7:    #8a8f98;
    --euk-chart-ink:   #555555;   /* axis + node labels */
    --euk-chart-grid:  #e3e3e3;
    --euk-chart-track: #ececec;   /* bar backgrounds */
    --euk-chart-node:  #555555;   /* sankey end nodes */
    --euk-chart-spine: #2f6f4f;   /* sankey center spine */
    --euk-sec-finance: #a83232;   /* Finance section accent (breadcrumb branding) */

    --euk-font-body:    system-ui, -apple-system, sans-serif;
    --euk-font-heading: inherit;
    --euk-font-mono:    ui-monospace, monospace;

    --euk-sidebar-w:    220px;
    --euk-topbar-h:     44px;
    --euk-statuspane-h: 36px;
    --euk-chat-bar-h:   0px;   /* updated by chat bar when present; drawer open-btn reads this */
}

/* Dark — applied via html.dark (set by inline JS before paint). */
html.dark {
    --euk-bg:           #161616;
    --euk-bg-elevated:  #1f1f1f;
    --euk-fg:           #e8e8e8;
    --euk-fg-muted:     #888888;
    --euk-border:       #333333;
    --euk-accent:       #88aaff;
    --euk-accent-soft:  #1a2540;
    --euk-error:        #ff6666;
    --euk-success:      #66cc88;
}


/* ── Body + base typography ─────────────────────────────────────────────── */
/* Body IS the layout grid — sidebar (left) + main column (right).
   Children are EXPLICITLY pinned to their grid column via grid-column
   below.  Without explicit assignment, display:none on the sidebar
   removes it from flow and auto-placement shifts .euk-main into the
   first (0-width) column — the classic grid auto-placement trap. */
body.euk-skin-basic {
    margin: 0;
    padding: 0;
    background: var(--euk-bg);
    color: var(--euk-fg);
    font-family: var(--euk-font-body);
    font-size: 14px;
    line-height: 1.45;
    display: grid;
    grid-template-columns: var(--euk-sidebar-w) 1fr auto;
    min-height: 100vh;
}
html.sidebar-collapsed body.euk-skin-basic {
    grid-template-columns: 0 1fr auto;
}
/* Pin children to their grid cell explicitly.  Two reasons:
     1. Column pins prevent .euk-main from shifting into the sidebar's
        0-width track when the sidebar is display:none (the original
        auto-placement trap).
     2. Row pins keep both children on row 1 regardless of DOM order.
        Without grid-row:1, the auto-placement cursor can advance past
        row 1 after placing the first DOM child, pushing the second
        child onto row 2 (renders below instead of beside). */
body.euk-skin-basic .euk-sidebar      { grid-column: 1; grid-row: 1; }
body.euk-skin-basic .euk-main         { grid-column: 2; grid-row: 1; }
/* Right drawer gets column 3.  When absent (page didn't pass drawer= content),
   no element occupies column 3 and the auto track collapses to 0. */
body.euk-skin-basic .euk-right-drawer { grid-column: 3; grid-row: 1; }
/* Logged-out viewing mode: no sidebar is rendered, so collapse the grid to a
   single full-width column (page_shell sets body.euk-anon for principal=nothing). */
body.euk-skin-basic.euk-anon { grid-template-columns: 1fr; }
body.euk-skin-basic.euk-anon .euk-main { grid-column: 1; }
body.euk-skin-basic a {
    color: var(--euk-accent);
    text-decoration: none;
}
body.euk-skin-basic a:hover { text-decoration: underline; }

body.euk-skin-basic code,
body.euk-skin-basic pre {
    background: var(--euk-bg-elevated);
    border: 1px solid var(--euk-border);
    border-radius: 3px;
    padding: 0.1em 0.3em;
    font-family: var(--euk-font-mono);
    font-size: 0.92em;
}
body.euk-skin-basic pre { padding: 0.8em 1em; overflow: auto; }


/* ── Main column (right of sidebar) ─────────────────────────────────────── */
/* The main column holds the top bar AND the canvas, stacked vertically.
   Top bar lives INSIDE the main column so it only spans the canvas's
   horizontal extent — never over the sidebar. */
body.euk-skin-basic .euk-main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;             /* allow flex children to shrink properly */
}


/* ── Top bar ────────────────────────────────────────────────────────────── */
/* Sticky at the top of the main column.  Scrolls within main, stays
   visible.  Width = main column's width (never spans over sidebar). */
body.euk-skin-basic .euk-top-bar {
    position: sticky;
    top: 0;
    height: var(--euk-topbar-h);
    display: flex;
    align-items: center;
    padding: 0 0.75em;
    gap: 0.5em;
    background: var(--euk-bg-elevated);
    border-bottom: 1px solid var(--euk-border);
    z-index: 50;
}
/* Shared icon-button styling for top-bar buttons + sidebar/drawer toggles. */
body.euk-skin-basic .euk-sidebar-toggle-btn,
body.euk-skin-basic .euk-drawer-toggle-btn,
body.euk-skin-basic .euk-share,
body.euk-skin-basic .euk-dark-toggle,
body.euk-skin-basic .euk-burger {
    background: transparent;
    border: 1px solid transparent;
    color: var(--euk-fg);
    cursor: pointer;
    font-size: 1.05em;
    padding: 0.25em 0.5em;
    border-radius: 4px;
}
body.euk-skin-basic .euk-sidebar-toggle-btn:hover,
body.euk-skin-basic .euk-drawer-toggle-btn:hover,
body.euk-skin-basic .euk-share:hover,
body.euk-skin-basic .euk-dark-toggle:hover,
body.euk-skin-basic .euk-burger:hover {
    border-color: var(--euk-border);
    background: var(--euk-bg);
}
/* The .euk-sidebar-show button in the top bar appears ONLY when the
   sidebar is collapsed.  Its sibling .euk-sidebar-collapse lives in the
   sidebar and disappears with it (via the sidebar's display:none). */
body.euk-skin-basic .euk-sidebar-show { display: none; }
html.sidebar-collapsed body.euk-skin-basic .euk-sidebar-show { display: revert; }

body.euk-skin-basic .euk-top-actions {
    margin-left: auto;
    display: flex;
    gap: 0.2em;
    align-items: center;
    position: relative;
}


/* ── Top-bar search form ────────────────────────────────────────────────── */
/* Sits between the breadcrumb and .euk-top-actions.  Grows to fill slack  */
/* space in the top bar but never wider than 320px so it doesn't crowd the  */
/* breadcrumb on mid-width viewports.                                        */
body.euk-skin-basic .euk-top-search {
    display: flex;
    align-items: center;
    margin: 0 0.6em;
    flex: 1 1 0;
    max-width: 320px;
}
body.euk-skin-basic .euk-top-search-input {
    flex: 1 1 0;
    min-width: 0;
    padding: 0.25em 0.5em;
    border: 1px solid var(--euk-border);
    border-right: none;
    border-radius: 0.3em 0 0 0.3em;
    background: var(--euk-bg);
    color: var(--euk-fg);
    font-size: 0.88em;
    outline: none;
    height: 1.9em;
}
body.euk-skin-basic .euk-top-search-input:focus {
    border-color: var(--euk-accent);
    box-shadow: 0 0 0 2px var(--euk-accent-soft);
}
body.euk-skin-basic .euk-top-search-btn {
    padding: 0 0.55em;
    height: 1.9em;
    border: 1px solid var(--euk-border);
    border-radius: 0 0.3em 0.3em 0;
    background: var(--euk-bg-elevated);
    color: var(--euk-fg-muted);
    cursor: pointer;
    font-size: 1em;
    display: flex;
    align-items: center;
}
body.euk-skin-basic .euk-top-search-btn:hover {
    background: var(--euk-accent-soft);
    color: var(--euk-accent);
}
/* Hide search on very narrow viewports where there is no room */
@media (max-width: 600px) {
    body.euk-skin-basic .euk-top-search { display: none; }
}


/* ── /search page ────────────────────────────────────────────────────────── */
body.euk-skin-basic .euk-search-form {
    margin-bottom: 1em;
}
body.euk-skin-basic .euk-search-bar {
    display: flex;
    gap: 0;
    max-width: 480px;
}
body.euk-skin-basic .euk-search-input {
    flex: 1 1 0;
    min-width: 0;
    padding: 0.4em 0.7em;
    border: 1px solid var(--euk-border);
    border-right: none;
    border-radius: 0.3em 0 0 0.3em;
    background: var(--euk-bg);
    color: var(--euk-fg);
    font-size: 1em;
}
body.euk-skin-basic .euk-search-submit {
    padding: 0.4em 0.9em;
    border: 1px solid var(--euk-border);
    border-radius: 0 0.3em 0.3em 0;
    background: var(--euk-accent);
    color: var(--euk-bg);
    cursor: pointer;
    font-size: 1em;
}
body.euk-skin-basic .euk-search-tabs {
    display: flex;
    gap: 0.8em;
    margin-bottom: 1.2em;
    border-bottom: 1px solid var(--euk-border);
    padding-bottom: 0.4em;
}
body.euk-skin-basic .euk-search-tab {
    color: var(--euk-fg-muted);
    text-decoration: none;
    font-weight: 500;
    padding: 0.15em 0;
}
body.euk-skin-basic .euk-search-tab-active {
    color: var(--euk-accent);
    border-bottom: 2px solid var(--euk-accent);
}


/* ── Person cards (search results, explore suggestions) ─────────────────── */
body.euk-skin-basic .euk-person-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7em;
    margin: 0.8em 0 1.2em;
}
body.euk-skin-basic .euk-person-card {
    border: 1px solid var(--euk-border);
    border-radius: 0.5em;
    padding: 0.6em 0.9em;
    display: flex;
    align-items: center;
    gap: 0.7em;
    background: var(--euk-bg-elevated);
    min-width: 180px;
    flex: 1 1 200px;
    max-width: 280px;
}
body.euk-skin-basic .euk-person-card a {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    text-decoration: none;
}
body.euk-skin-basic .euk-suggestions {
    margin: 0 0 1.5em;
    padding: 0.8em;
    background: var(--euk-bg-elevated);
    border-radius: 0.5em;
    border: 1px solid var(--euk-border);
}
body.euk-skin-basic .euk-suggestions h3 {
    margin: 0 0 0.7em;
    font-size: 1em;
}


/* ── Breadcrumb ─────────────────────────────────────────────────────────── */
body.euk-skin-basic .euk-breadcrumb {
    flex: 0 1 auto;
    color: var(--euk-fg-muted);
    font-size: 0.95em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
body.euk-skin-basic .euk-crumb       { color: var(--euk-fg-muted); }
body.euk-skin-basic .euk-crumb-sep   { color: var(--euk-fg-muted); margin: 0 0.25em; }
body.euk-skin-basic .euk-crumb-leaf  { color: var(--euk-fg); font-weight: 500; }


/* ── Burger dropdown ────────────────────────────────────────────────────── */
body.euk-skin-basic .euk-burger-wrap { position: relative; }
body.euk-skin-basic .euk-burger-menu {
    position: absolute;
    top: 110%;
    right: 0;
    margin: 0;
    padding: 0.3em 0;
    list-style: none;
    background: var(--euk-bg-elevated);
    border: 1px solid var(--euk-border);
    border-radius: 4px;
    min-width: 140px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 60;
}
body.euk-skin-basic .euk-burger-menu[hidden] { display: none; }
body.euk-skin-basic .euk-burger-menu li {
    padding: 0;
}
body.euk-skin-basic .euk-burger-menu li a,
body.euk-skin-basic .euk-burger-menu li button {
    display: block;
    width: 100%;
    padding: 0.4em 0.9em;
    background: transparent;
    border: none;
    color: var(--euk-fg);
    text-align: left;
    cursor: pointer;
    font: inherit;
    text-decoration: none;
    box-sizing: border-box;
}
body.euk-skin-basic .euk-burger-menu li a:hover,
body.euk-skin-basic .euk-burger-menu li button:hover {
    background: var(--euk-accent-soft);
    text-decoration: none;
}
body.euk-skin-basic .euk-burger-form { margin: 0; padding: 0; }


/* ── Sidebar ────────────────────────────────────────────────────────────── */
/* Full height (y=0 to bottom of viewport).  Sticky so it stays visible
   as the canvas scrolls.  Status pane pins to the bottom via mt:auto on
   .euk-status-pane below. */
body.euk-skin-basic .euk-sidebar {
    background: var(--euk-bg-elevated);
    border-right: 1px solid var(--euk-border);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}
html.sidebar-collapsed body.euk-skin-basic .euk-sidebar {
    display: none;
}
/* Collapse button at the very top of the sidebar — same icon area the
   show-button occupies in the top bar when collapsed. */
body.euk-skin-basic .euk-sidebar > .euk-sidebar-collapse {
    align-self: flex-start;
    margin: 0.5em 0 0 0.5em;
}

body.euk-skin-basic .euk-basic-nav {
    list-style: none;
    margin: 0;
    padding: 0.5em 0;
    flex: 1 1 auto;
}
body.euk-skin-basic .euk-basic-nav > li {
    padding: 0;
}
body.euk-skin-basic .euk-basic-nav > li > a {
    display: block;
    padding: 0.35em 0.9em;
    color: var(--euk-fg);
    border-left: 3px solid transparent;
}
body.euk-skin-basic .euk-basic-nav > li.euk-nav-active > a {
    background: var(--euk-accent-soft);
    border-left-color: var(--euk-accent);
    color: var(--euk-fg);
}
body.euk-skin-basic .euk-basic-nav > li > a:hover {
    background: var(--euk-bg);
    text-decoration: none;
}

/* Nested subnav under active parent. */
body.euk-skin-basic .euk-basic-subnav {
    list-style: none;
    margin: 0;
    padding: 0;
    background: var(--euk-bg);
    border-left: 3px solid var(--euk-accent);
}
body.euk-skin-basic .euk-basic-subnav li {
    padding: 0;
}
body.euk-skin-basic .euk-basic-subnav li a {
    display: block;
    padding: 0.25em 0.9em 0.25em 1.6em;
    color: var(--euk-fg-muted);
    font-size: 0.95em;
}
body.euk-skin-basic .euk-basic-subnav li.euk-subnav-active a {
    color: var(--euk-fg);
    font-weight: 500;
}
/* Depth-aware indentation for indefinitely-nested subnavs.
   Each additional .euk-basic-subnav nesting level inherits the rule above
   and is then overridden by these more-specific selectors, adding 0.8em
   per level automatically.  Four total levels (top + 3 sub) covers any
   real-world tree without JS or depth-attribute bookkeeping. */
body.euk-skin-basic .euk-basic-subnav .euk-basic-subnav li a {
    padding-left: 2.4em;
}
body.euk-skin-basic .euk-basic-subnav .euk-basic-subnav .euk-basic-subnav li a {
    padding-left: 3.2em;
}

/* ── Nav badge (unread notification count bubble) ───────────────────────── */
/* Appears inside the Notifications <a> element; the polling script removes  */
/* the [hidden] attribute and sets textContent when count > 0.               */
body.euk-skin-basic .euk-nav-badge {
    display: inline-block;
    margin-left: 0.35em;
    min-width: 1.25em;
    padding: 0 0.3em;
    border-radius: 0.75em;
    background: var(--euk-accent);
    color: var(--euk-bg);
    font-size: 0.7em;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    vertical-align: middle;
    /* Keeps the badge from inheriting the <a> hover color. */
    pointer-events: none;
}
body.euk-skin-basic .euk-nav-badge[hidden] {
    /* [hidden] sets display:none in most browsers but we make it explicit
       for skinned environments where global styles might conflict. */
    display: none !important;
}


/* ── Status pane (bottom-left of sidebar) ───────────────────────────────── */
body.euk-skin-basic .euk-status-pane {
    border-top: 1px solid var(--euk-border);
    background: var(--euk-bg-elevated);
    flex: 0 0 auto;
    /* Push to the bottom of the flex column. */
    margin-top: auto;
}
body.euk-skin-basic .euk-status-toggle {
    display: block;
    width: 100%;
    padding: 0.5em 0.9em;
    background: transparent;
    border: none;
    color: var(--euk-fg-muted);
    text-align: left;
    cursor: pointer;
    font: inherit;
    font-size: 0.85em;
}
body.euk-skin-basic .euk-status-toggle:hover {
    background: var(--euk-bg);
}
body.euk-skin-basic .euk-status-expanded {
    padding: 0.5em 0.9em 0.7em;
    border-top: 1px solid var(--euk-border);
    font-size: 0.85em;
    color: var(--euk-fg-muted);
}
body.euk-skin-basic .euk-status-expanded[hidden] { display: none; }
body.euk-skin-basic .euk-status-expanded h4 {
    margin: 0 0 0.3em;
    font-size: 0.9em;
    color: var(--euk-fg);
}
body.euk-skin-basic .euk-status-expanded dl {
    margin: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.1em 0.5em;
}
body.euk-skin-basic .euk-status-expanded dt { color: var(--euk-fg-muted); }
body.euk-skin-basic .euk-status-expanded dd { margin: 0; }


/* ── Canvas (main content) ──────────────────────────────────────────────── */
/* Horizontal padding is a percent of the main column so the canvas
   breathes regardless of width.  No max-width — the column already
   constrains things when the sidebar is expanded; when collapsed, the
   percent padding still leaves margins. */
body.euk-skin-basic .euk-canvas {
    padding: 1.4em 5% 3em;
    flex: 1;
    min-width: 0;
}
body.euk-skin-basic h1 { font-family: var(--euk-font-heading); font-size: 1.6em; margin: 0 0 0.6em; }
body.euk-skin-basic h2 { font-family: var(--euk-font-heading); font-size: 1.25em; margin: 1.4em 0 0.5em; }
body.euk-skin-basic h3 { font-family: var(--euk-font-heading); font-size: 1.05em; margin: 1.2em 0 0.4em; }


/* ── Slot wrappers ──────────────────────────────────────────────────────── */
body.euk-skin-basic .euk-page-heading { margin: 0 0 0.3em; }
body.euk-skin-basic .euk-page-actions {
    margin: 0 0 1.2em;
    display: flex;
    gap: 0.6em;
    align-items: center;
    color: var(--euk-fg-muted);
}
body.euk-skin-basic .euk-page-sidebar {
    margin-top: 2em;
    padding-top: 1em;
    border-top: 1px solid var(--euk-border);
    color: var(--euk-fg-muted);
}
body.euk-skin-basic .euk-page-footer {
    margin-top: 2em;
    padding-top: 1em;
    border-top: 1px solid var(--euk-border);
    color: var(--euk-fg-muted);
    font-size: 0.9em;
}


/* ── Banners ────────────────────────────────────────────────────────────── */
body.euk-skin-basic .euk-form-error {
    color: var(--euk-error);
    background: var(--euk-bg-elevated);
    border: 1px solid var(--euk-error);
    border-radius: 4px;
    padding: 0.6em 0.9em;
    margin: 0 0 1em;
}
body.euk-skin-basic .euk-success {
    color: var(--euk-success);
    background: var(--euk-bg-elevated);
    border: 1px solid var(--euk-success);
    border-radius: 4px;
    padding: 0.6em 0.9em;
    margin: 0 0 1em;
}


/* ── Scope banner (Stage 3 — docs/scoped_ui_design.md) ─────────────────── */
body.euk-skin-basic .euk-scope-banner {
    background: var(--euk-bg-elevated);
    border-bottom: 1px solid var(--euk-border);
    padding: 0.35em 1em;
    font-size: 0.88em;
    color: var(--euk-fg-muted);
    /* Banner spans the full canvas width, above the page heading. */
    margin: -0.5em -1em 0.75em;
}
body.euk-skin-basic .euk-scope-banner-back {
    background: none;
    border: 1px solid var(--euk-border);
    border-radius: 3px;
    padding: 0.1em 0.5em;
    font-size: 0.85em;
    cursor: pointer;
    color: var(--euk-fg-muted);
}
body.euk-skin-basic .euk-scope-banner-back:hover {
    background: var(--euk-bg-canvas);
    color: var(--euk-fg);
}
body.euk-skin-basic .euk-scope-btn {
    background: none;
    border: 1px solid var(--euk-border);
    border-radius: 3px;
    padding: 0.1em 0.45em;
    font-size: 0.82em;
    cursor: pointer;
    color: var(--euk-fg-muted);
}
body.euk-skin-basic .euk-scope-btn:hover {
    background: var(--euk-bg-elevated);
    color: var(--euk-fg);
}


/* ── Forms + tables (minimal) ───────────────────────────────────────────── */
body.euk-skin-basic input[type=text],
body.euk-skin-basic input[type=email],
body.euk-skin-basic input[type=password],
body.euk-skin-basic input[type=number],
body.euk-skin-basic select,
body.euk-skin-basic textarea {
    background: var(--euk-bg-elevated);
    color: var(--euk-fg);
    border: 1px solid var(--euk-border);
    border-radius: 3px;
    padding: 0.3em 0.5em;
    font: inherit;
}
body.euk-skin-basic .euk-input-full,
body.euk-skin-basic [class^="euk-input-full"] { width: 100%; box-sizing: border-box; }

body.euk-skin-basic button[type=submit] {
    background: var(--euk-accent);
    color: white;
    border: none;
    padding: 0.4em 1em;
    border-radius: 3px;
    cursor: pointer;
}
body.euk-skin-basic button[type=submit]:hover { opacity: 0.9; }

body.euk-skin-basic table {
    border-collapse: collapse;
    width: 100%;
    margin: 0.5em 0;
}
body.euk-skin-basic th,
body.euk-skin-basic td {
    border: 1px solid var(--euk-border);
    padding: 0.4em 0.6em;
    text-align: left;
    vertical-align: top;
}
body.euk-skin-basic th { background: var(--euk-bg-elevated); }


/* ── Feed cards ────────────────────────────────────────────────────────── */
/* Post cards used by /feed, /user/:handle, /explore, and org feed pages.
   Each card is a self-contained article with author line, post text,
   timestamp, and action bar.  Reused across the social surface. */
body.euk-skin-basic .euk-feed-card {
    background: var(--euk-bg-elevated);
    border: 1px solid var(--euk-border);
    border-radius: 6px;
    padding: 0.9em 1em;
    margin: 0 0 0.75em;
}
body.euk-skin-basic .euk-feed-card-author {
    display: flex;
    align-items: baseline;
    gap: 0.4em;
    margin: 0 0 0.4em;
}
body.euk-skin-basic .euk-feed-card-author a {
    text-decoration: none;
    color: var(--euk-fg);
}
body.euk-skin-basic .euk-feed-card-author a:hover { text-decoration: underline; }
body.euk-skin-basic .euk-feed-card-handle {
    color: var(--euk-fg-muted);
    font-weight: normal;
    font-size: 0.9em;
}
body.euk-skin-basic .euk-feed-card-time {
    margin-left: auto;
    color: var(--euk-fg-muted);
    font-size: 0.85em;
}
body.euk-skin-basic .euk-feed-card-repost-banner {
    font-size: 0.82em;
    color: var(--euk-fg-muted);
    margin-bottom: 0.35em;
}
body.euk-skin-basic .euk-feed-card-repost-banner a {
    color: var(--euk-fg-muted);
}
body.euk-skin-basic .euk-feed-card-text {
    margin: 0 0 0.6em;
    line-height: 1.5;
    white-space: pre-wrap;
}
body.euk-skin-basic .euk-feed-card-actions {
    display: flex;
    gap: 1.2em;
    color: var(--euk-fg-muted);
    font-size: 0.85em;
}
body.euk-skin-basic .euk-action-btn {
    cursor: pointer;
    color: var(--euk-fg-muted);
    text-decoration: none;
    background: transparent;
    border: none;
    font: inherit;
    font-size: 0.85em;
    padding: 0;
}
body.euk-skin-basic .euk-action-btn:hover { color: var(--euk-accent); text-decoration: none; }
body.euk-skin-basic .euk-action-btn.active { color: var(--euk-accent); }
/* Action forms render inline inside the flex action bar. */
body.euk-skin-basic .euk-action-form {
    display: inline;
    margin: 0;
    padding: 0;
}


/* ── Person cards (follows/followers lists) ────────────────────────────── */
body.euk-skin-basic .euk-person-card {
    padding: 0.5em 0.7em;
    border-bottom: 1px solid var(--euk-border);
}
body.euk-skin-basic .euk-person-card:last-child { border-bottom: none; }
body.euk-skin-basic .euk-person-card a { text-decoration: none; color: var(--euk-fg); }
body.euk-skin-basic .euk-person-card a:hover { text-decoration: underline; }
body.euk-skin-basic .euk-handle { color: var(--euk-fg-muted); font-weight: normal; font-size: 0.9em; }
body.euk-skin-basic .euk-local-badge {
    color: var(--euk-accent);
    font-size: 0.8em;
    font-weight: 500;
}

/* ── AT Proto list purpose tags (.euk-list-purpose) ────────────────────────
   Small inline labels showing list type: curate / mod / reference.
   Colour meanings: curate = accent blue (social), mod = warning amber, ref = neutral. */
body.euk-skin-basic .euk-list-purpose {
    display: inline-block;
    padding: 0 0.4em;
    border-radius: 0.25em;
    font-size: 0.75em;
    font-weight: 600;
    vertical-align: middle;
    margin-left: 0.4em;
}
body.euk-skin-basic .euk-list-curate  { background: var(--euk-accent); color: var(--euk-bg); }
body.euk-skin-basic .euk-list-mod     { background: #c0741a; color: #fff; }
body.euk-skin-basic .euk-list-ref     { background: var(--euk-border); color: var(--euk-fg-muted); }
/* ── List index page ────────────────────────────────────────────────────── */
body.euk-skin-basic .euk-list-index   { list-style: none; padding: 0; }
body.euk-skin-basic .euk-list-item    { padding: 0.5em 0; border-bottom: 1px solid var(--euk-border); }
body.euk-skin-basic .euk-list-item:last-child { border-bottom: none; }
/* ── Feed generator cards (/feeds landing) ──────────────────────────────── */
body.euk-skin-basic .euk-feed-card {
    padding: 0.75em 0;
    border-bottom: 1px solid var(--euk-border);
}
body.euk-skin-basic .euk-feed-card:last-child { border-bottom: none; }
body.euk-skin-basic .euk-feed-card p { margin: 0.25em 0 0; color: var(--euk-fg-muted); font-size: 0.9em; }


/* ── Misc semantic helpers that the dev skin defines, mirrored here ─────── */
body.euk-skin-basic .euk-muted-cell,
body.euk-skin-basic [class^="euk-muted-cell"] { color: var(--euk-fg-muted); }
body.euk-skin-basic .euk-hint-text { color: var(--euk-fg-muted); font-size: 0.9em; }
body.euk-skin-basic p.euk-subnav,
body.euk-skin-basic p[class^="euk-subnav-"] {
    /* Dev-style subnav (single <p> line) — basic skin renders subnav in
       the sidebar instead, so we hide the inline <p> if a page passed
       it through page(subnav=...).
       MUST stay scoped to p: the bare [class^="euk-subnav-"] form also
       matched <li class="euk-subnav-active"> in the sidebar nav, fully
       display:none-ing the active org and its expanded children — the
       "current org missing from sidebar" bug (2026-06-05). */
    display: none;
}


/* ─────────────────────────────────────────────────────────────────────────
 * Appearance variants (Phase E, 2026-05-24)
 *
 * Two orthogonal axes inside this skin:
 *   1. Theme — palette variant.  `default` is what :root + html.dark
 *      define above.  `sandy` and `custom` override those variables.
 *   2. Accessibility / brightness — mode, color-blindness, high contrast,
 *      low motion, monochrome.  Each lives on its own data-* attribute
 *      on <html>, set server-side from the actor's saved preferences.
 *
 * All variant rules are scoped to html[data-...]  selectors so they
 * activate purely from the data attribute the skin function emits.
 * Combining variants (theme=sandy + high_contrast=1 + low_motion=1)
 * just stacks selectors — no class explosion required.
 *
 * NOTE on "stubs": several blocks below are intentionally empty.  They
 * exist as NAMED HOOKS for future palette/contrast values to land
 * without restructuring this file.  Sandy palette values arrive from
 * the user later; color-blindness shifts need design research.  Low
 * motion and monochrome ARE fully implemented today.
 * ───────────────────────────────────────────────────────────────────── */


/* ── Theme variants ─────────────────────────────────────────────────────── */
/* `default` is the implicit no-override case — it's whatever :root +
   html.dark define above.  `sandy` is reserved for the user-provided
   palette landing later; `custom` pulls its values from the inline
   <style> the skin function emits when theme=custom (each var override
   gated on the user having actually picked that color). */
/* Sandy — warm editorial palette lifted from the /chat page.
   Terracotta accent, cream paper tones, Playfair Display headings,
   DM Mono body text.  The Google Fonts <link> is emitted by the skin
   function in page_shell.jl only when theme=sandy (so the default
   theme never loads external fonts). */
html[data-theme="sandy"] {
    --euk-bg:           #f5f0e8;
    --euk-bg-elevated:  #ede7d9;
    --euk-fg:           #1a1612;
    --euk-fg-muted:     #8a7f72;
    --euk-border:       #ccc4b5;
    --euk-accent:       #b85c2a;
    --euk-accent-soft:  #d4896a;
    --euk-error:        #9e3333;
    --euk-success:      #4a7c5c;

    --euk-font-body:    'DM Mono', ui-monospace, monospace;
    --euk-font-heading: 'Playfair Display', Georgia, serif;
    --euk-font-mono:    'DM Mono', ui-monospace, monospace;
}
/* Sandy dark — invert the warm tones rather than going cool-gray.
   Rich espresso background, warm cream text, terracotta accent stays
   consistent.  The contrast ratios mirror the default dark theme's
   accessibility: ~10:1 fg/bg, ~5:1 muted/bg. */
html[data-theme="sandy"].dark,
html[data-theme="sandy"][data-mode="dark"] {
    --euk-bg:           #1a1612;
    --euk-bg-elevated:  #2b241d;
    --euk-fg:           #f5f0e8;
    --euk-fg-muted:     #a89b8c;
    --euk-border:       #3d342b;
    --euk-accent:       #d4896a;
    --euk-accent-soft:  #3d2a1e;
    --euk-error:        #e87a7a;
    --euk-success:      #6aae82;
}
@media (prefers-color-scheme: dark) {
    html[data-theme="sandy"][data-mode="system"] {
        --euk-bg:           #1a1612;
        --euk-bg-elevated:  #2b241d;
        --euk-fg:           #f5f0e8;
        --euk-fg-muted:     #a89b8c;
        --euk-border:       #3d342b;
        --euk-accent:       #d4896a;
        --euk-accent-soft:  #3d2a1e;
        --euk-error:        #e87a7a;
        --euk-success:      #6aae82;
    }
}
html[data-theme="custom"] {
    /* Variables for this theme arrive from the inline <style> emitted
       by the skin function in page_shell.jl.  No declarations here —
       the inline style is sufficient and lets each user pick which
       variables to override individually. */
}


/* ── Brightness mode ────────────────────────────────────────────────────── */
/* `html.dark` (class) is set by the in-moment moon/sun toggle.  These
   data-mode selectors are the SAVED-preference equivalent: they fire on
   fresh page loads before any JS runs.  Both routes hit the same end
   state — we duplicate the variable overrides so the page renders
   correctly under either path. */
html[data-mode="dark"] {
    --euk-bg:           #161616;
    --euk-bg-elevated:  #1f1f1f;
    --euk-fg:           #e8e8e8;
    --euk-fg-muted:     #888888;
    --euk-border:       #333333;
    --euk-accent:       #88aaff;
    --euk-accent-soft:  #1a2540;
    --euk-error:        #ff6666;
    --euk-success:      #66cc88;
}

/* `mode=system` defers to the OS preference.  When the OS is dark, we
   apply the same overrides.  When the OS is light, the @media block
   doesn't fire and the :root light values apply.  The pre-paint JS
   adds `html.dark` to match this branch so JS-targeted code (icon
   swap on the dark toggle button) stays in sync. */
@media (prefers-color-scheme: dark) {
    html[data-mode="system"] {
        --euk-sec-finance: #e07a7a;
        --euk-bg:           #161616;
        --euk-bg-elevated:  #1f1f1f;
        --euk-fg:           #e8e8e8;
        --euk-fg-muted:     #888888;
        --euk-border:       #333333;
        --euk-accent:       #88aaff;
        --euk-accent-soft:  #1a2540;
        --euk-error:        #ff6666;
        --euk-success:      #66cc88;
    }
}


/* ── Color-blindness adjustment (stubs) ─────────────────────────────────── */
/* Each selector exists so a future research pass can drop in hue-shifted
   variable values without restructuring.  Empty today means: no shift —
   the page renders normally. */
html[data-a11y-color="deuteranopia"] {
    /* TODO: deuteranopia hue shift — research needed (red-green confusion;
       typical adjustment moves greens toward blue, reds toward yellow). */
}
html[data-a11y-color="protanopia"] {
    /* TODO: protanopia hue shift — research needed (red-green confusion;
       similar to deuteranopia but reds are darker/dimmer). */
}
html[data-a11y-color="tritanopia"] {
    /* TODO: tritanopia hue shift — research needed (blue-yellow confusion;
       relatively rare; blues read as green, yellows read as pink). */
}


/* ── High contrast (token implementation) ───────────────────────────────── */
/* Bumps the border color to match the foreground for now — a
   placeholder that's visually distinct without being final.  A real
   high-contrast pass would also boost text/background contrast, swap
   the accent for something with a guaranteed 7:1 ratio against bg, etc. */
html[data-high-contrast="1"] {
    --euk-border: var(--euk-fg);
    /* TODO: full contrast pass (WCAG AAA on all surface combinations). */
}


/* ── Low motion (functional) ────────────────────────────────────────────── */
/* Mechanically disables animations and transitions everywhere — same
   approach the `prefers-reduced-motion` media query takes, but as a
   saved actor preference so users can opt in without setting OS-level
   flags.  Lasting 0.01s rather than 0 keeps the animation system from
   skipping events (some libraries rely on the animationend event). */
html[data-low-motion="1"] *,
html[data-low-motion="1"] *::before,
html[data-low-motion="1"] *::after {
    animation-duration:        0.01s !important;
    animation-iteration-count: 1     !important;
    transition-duration:       0.01s !important;
    scroll-behavior:           auto  !important;
}


/* ── Monochrome (functional) ────────────────────────────────────────────── */
/* CSS filter on body desaturates the entire page — text, images, and
   custom colors all collapse to grayscale.  Applied on body rather than
   html to keep the filter inside the actual visual tree (filters on
   <html> behave inconsistently across browsers). */
html[data-monochrome="1"] body {
    filter: grayscale(100%);
}

/* ── Right drawer ────────────────────────────────────────────────────────── */
/* Third grid column.  Content is ALWAYS in DOM when the page passes drawer=
   content — readable by parsers/LLMs even when visually hidden at width:0.
   Transitions on width so the "push content left" effect animates smoothly.
   No JS required for sizing — clamp() responds to viewport resize.

   Two-button toggle mirrors the left sidebar pattern exactly:
     .euk-drawer-show — position:fixed at viewport bottom-right, visible
                        only when drawer is CLOSED.
     .euk-drawer-close — at top of drawer, visible only when drawer is OPEN.
   Both carry .euk-drawer-toggle-btn; a single JS handler wires both.
   CSS hides whichever button is irrelevant to the current state — no
   JS icon-swap or DOM mutation needed. */
body.euk-skin-basic .euk-right-drawer {
    grid-column: 3;
    grid-row: 1;
    width: 0;
    overflow: hidden;               /* clips all content at width:0 */
    transition: width 0.25s ease;
    background: var(--euk-bg-elevated);
    border-left: 1px solid var(--euk-border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}
/* Expand when html.drawer-open class is set (by pre-paint JS + handler).
   clamp: min 180px, target 28vw, max 380px.  Responsive without JS.
   Overflow axes split: vertical scroll for long content, horizontal clip. */
html.drawer-open body.euk-skin-basic .euk-right-drawer {
    width: clamp(180px, 28vw, 380px);
    overflow-y: auto;
    overflow-x: hidden;
}

/* Close button (▶): inside drawer at the top.  align-self:flex-end puts it
   against the right edge of the drawer column.  sticky so it stays visible
   as drawer content scrolls beneath it. */
body.euk-skin-basic .euk-right-drawer > .euk-drawer-close {
    align-self: flex-end;
    flex-shrink: 0;
    margin: 0.5em 0.5em 0 0;
    position: sticky;
    top: 0.5em;
    /* Visible background so content scrolling underneath doesn't bleed. */
    background: var(--euk-bg-elevated);
}

/* Drawer body: page-supplied content.  Fills remaining height, pads
   the content, and clips horizontal overflow from wide child elements. */
body.euk-skin-basic .euk-drawer-body {
    padding: 0.5em 0.75em 1.5em;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: hidden;
}

/* Open button (◀): fixed to viewport bottom-right so it stays reachable
   on long pages.  Lifts above the chat bar via --euk-chat-bar-h (currently
   0px; updated to the bar's height when the chat input is added).
   Override transparent background so the button is legible over any content. */
body.euk-skin-basic .euk-drawer-show {
    position: fixed;
    bottom: calc(1rem + var(--euk-chat-bar-h, 0px));
    right: 1rem;
    z-index: 200;
    background: var(--euk-bg-elevated);
    border-color: var(--euk-border);
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
/* Hide the open button when the drawer is already open — the close button
   inside the drawer handles the reverse action. */
html.drawer-open body.euk-skin-basic .euk-drawer-show {
    display: none;
}


/* ─────────────────────────────────────────────────────────────────────────
   PROFILE HEADER
   Used on /user/:handle (public profile) and /profile (own profile).
   Layout: [avatar] [meta: name / handle / bio / stats] [actions: follow btn]
   Avatar can be a real <img> or a .euk-profile-avatar-placeholder fallback.
   ───────────────────────────────────────────────────────────────────────── */

.euk-profile-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 0 1.25rem;
  border-bottom: 1px solid var(--euk-border);
  margin-bottom: 1.25rem;
}

/* Avatar — fixed 72×72 circle */
img.euk-profile-avatar,
.euk-profile-avatar-placeholder {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

img.euk-profile-avatar {
  border: 2px solid var(--euk-border);
}

.euk-profile-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--euk-accent);
  color: var(--euk-bg);
  font-size: 1.5rem;
  font-weight: 600;
}

/* Meta block stretches to fill remaining space */
.euk-profile-meta {
  flex: 1;
  min-width: 0;
}

.euk-profile-display-name {
  margin: 0 0 0.1rem;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* h1 used on own-profile; h2 used on /user/:handle — normalize both */
h1.euk-profile-display-name { font-size: 1.4rem; }
h2.euk-profile-display-name { font-size: 1.2rem; }

.euk-profile-handle {
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
  color: var(--euk-muted);
}

.euk-profile-bio {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  line-height: 1.45;
  max-width: 40em;
  white-space: pre-line;   /* preserve line breaks in bio */
}

.euk-profile-stats {
  font-size: 0.82rem;
  color: var(--euk-muted);
}

.euk-profile-stats a {
  color: var(--euk-link);
  font-weight: 500;
}

/* Action buttons (Follow / Edit profile) — right-aligned */
.euk-profile-actions {
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
}

/* Small action button — used for Follow / Edit / Following */
.euk-btn-small {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  border-radius: 1rem;
  border: 1px solid var(--euk-accent);
  background: var(--euk-accent);
  color: var(--euk-bg);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.1s;
}

.euk-btn-small:hover { opacity: 0.85; }
.euk-btn-small:active { opacity: 0.7; }

/* "Following" state is outlined, not filled */
.euk-btn-small.euk-btn-secondary {
  background: transparent;
  color: var(--euk-accent);
}

/* Optional detail block below the header (own profile only) */
.euk-profile-details {
  margin-top: 0.75rem;
}

/* Compact on narrow screens — stack avatar and meta vertically */
@media (max-width: 480px) {
  .euk-profile-header { flex-wrap: wrap; }
  .euk-profile-actions { margin-left: 0; }
}


/* ─────────────────────────────────────────────────────────────────────────
   POST THREAD VIEW
   Parent chain (breadcrumbs above the post) and reply list below.
   ───────────────────────────────────────────────────────────────────────── */

/* Parent chain — visually de-emphasized relative to the focal post */
.euk-thread-parents {
  border-left: 2px solid var(--euk-border);
  margin-bottom: 0.75rem;
  padding-left: 0.75rem;
}

.euk-thread-parent {
  padding: 0.25rem 0;
  font-size: 0.85rem;
  color: var(--euk-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.euk-thread-parent a { color: var(--euk-link); }

/* Replies section below the focal post */
.euk-thread-replies-heading {
  margin: 1.25rem 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.euk-thread-replies {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-left: 2px solid var(--euk-border);
  padding-left: 0.75rem;
  margin-bottom: 1rem;
}

.euk-thread-reply {
  display: flex;
  gap: 0.4rem;
  font-size: 0.88rem;
  align-items: baseline;
}

.euk-thread-reply-author a {
  color: var(--euk-link);
  font-weight: 500;
  white-space: nowrap;
}

.euk-thread-reply-body {
  color: var(--euk-fg);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.euk-thread-reply-body:hover { text-decoration: underline; }

/* Engagement count link (next to like/repost buttons in feed cards) */
.euk-action-count {
  font-size: 0.8rem;
  color: var(--euk-muted);
  text-decoration: none;
  padding: 0 0.2rem;
  min-width: 1.5ch;
  display: inline-block;
}

.euk-action-count:hover { color: var(--euk-link); }


/* ─────────────────────────────────────────────────────────────────────────
   CHAT BAR
   Sticky bottom input bar.  Active when body carries .euk-has-chatbar
   (set by page_shell.jl when chatbar= slot is non-empty).

   Layout intent:
     • .euk-main becomes height:100vh so the 3-column grid fills the
       viewport without page-level scroll.
     • .euk-canvas becomes overflow-y:auto so the messages area scrolls
       independently while the bar sticks at the bottom of .euk-main.
     • .euk-chat-bar uses position:sticky bottom:0 (not fixed) so it
       stays inside its grid column and never overlaps the right drawer.
   ───────────────────────────────────────────────────────────────────────── */

/* Height-constrain when chat bar is present. */
body.euk-skin-basic.euk-has-chatbar .euk-main   { height: 100vh; overflow: hidden; }
body.euk-skin-basic.euk-has-chatbar .euk-canvas  { overflow-y: auto; }

/* Outer bar wrapper — sticky bottom of .euk-main. */
body.euk-skin-basic .euk-chat-bar {
    position: sticky;
    bottom: 0;
    border-top: 1px solid var(--euk-border);
    background: var(--euk-bg-elevated);
    z-index: 100;          /* above canvas content, below burger dropdown */
}

/* Padding wrapper so inner content has breathing room. */
.euk-chat-bar-inner {
    padding: 0.6em 0.75em 0.6em;
}

/* The growing textarea. */
.euk-chat-bar-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    resize: none;
    min-height: 44px;
    max-height: 200px;       /* ~8 lines; beyond this it scrolls internally */
    overflow-y: auto;
    padding: 0.5em 0.6em;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.45;
    border: 1px solid var(--euk-border);
    border-radius: 6px;
    background: var(--euk-bg);
    color: var(--euk-fg);
    transition: border-color 0.15s;
}
.euk-chat-bar-input:focus {
    outline: none;
    border-color: var(--euk-accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--euk-accent) 25%, transparent);
}
.euk-chat-bar-input::placeholder { color: var(--euk-fg-muted); opacity: 0.75; }

/* Bottom row: hints (left) + send button (right). */
.euk-chat-bar-bottom {
    display: flex;
    align-items: center;
    gap: 0.75em;
    margin-top: 0.45em;
}

/* Hint column fills remaining width. */
.euk-chat-bar-hints {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.68rem;
    color: var(--euk-fg-muted);
    gap: 0.5em;
    min-width: 0;            /* allow flex children to shrink below content width */
}
.euk-chat-bar-hint-left  { white-space: nowrap; }
.euk-chat-bar-hint-right { white-space: nowrap; text-align: right; }

/* Send button — fixed width, accent background. */
.euk-chat-bar-send {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    padding: 0.45em 0.9em;
    background: var(--euk-accent);
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.12s, opacity 0.12s;
}
.euk-chat-bar-send:hover  { background: color-mix(in srgb, var(--euk-accent) 85%, #000); }
.euk-chat-bar-send:active { background: color-mix(in srgb, var(--euk-accent) 70%, #000); }
.euk-chat-bar-send:disabled { opacity: 0.5; cursor: not-allowed; }
.euk-chat-bar-send svg { vertical-align: middle; }


/* ─────────────────────────────────────────────────────────────────────────
   CHAT MESSAGES
   Global styles for message bubbles, typing indicator, and toast.
   Not scoped to a container — bubbles may appear in the canvas, in the
   right drawer, or inside a dialog thread.  Any page that renders chat
   output uses these classes.

   Animation philosophy: fadeSlide on entry (subtle, not distracting).
   Typing indicator uses three staggered blink dots (same animation
   pattern as the original /chat page, lifted into global CSS here).
   ───────────────────────────────────────────────────────────────────────── */

/* Message list container. */
.euk-chat-messages {
    display: flex;
    flex-direction: column;
    gap: 1em;
    overflow-y: auto;
    padding-bottom: 0.5em;
}

/* Single message row: avatar + bubble, side by side. */
.euk-chat-msg {
    display: flex;
    gap: 0.75em;
    animation: euk-fadeSlide 0.25s ease both;
}
/* User messages: reverse direction so bubble is right-aligned. */
.euk-chat-msg.user { flex-direction: row-reverse; }

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

/* Avatar circle — 32 × 32. */
.euk-chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 600;
    user-select: none;
    overflow: hidden;
}
/* User avatar: inverted fg/bg for contrast. */
.euk-chat-msg.user .euk-chat-avatar {
    background: var(--euk-fg);
    color: var(--euk-bg);
}
/* AI avatar: elevated bg with border. */
.euk-chat-msg.ai .euk-chat-avatar {
    background: var(--euk-bg-elevated);
    color: var(--euk-fg);
    border: 1px solid var(--euk-border);
}

/* Bubble wrapper — capped at 72% width for readability. */
.euk-chat-bubble {
    max-width: 72%;
    padding: 0.55em 0.8em;
    border-radius: 12px;
    word-break: break-word;
    min-width: 0;
}
/* User bubble: accent-adjacent tint. */
.euk-chat-msg.user .euk-chat-bubble {
    background: var(--euk-accent-soft);
    color: var(--euk-fg);
    border-radius: 12px 12px 2px 12px;  /* rounded except bottom-right */
}
/* AI bubble: elevated bg, subtle border + shadow. */
.euk-chat-msg.ai .euk-chat-bubble {
    background: var(--euk-bg-elevated);
    border: 1px solid var(--euk-border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border-radius: 12px 12px 12px 2px;  /* rounded except bottom-left */
}

/* Bubble footer: token / model meta shown after AI reply. */
.euk-chat-bubble-meta {
    font-size: 0.68rem;
    color: var(--euk-fg-muted);
    margin-top: 0.4em;
}
.euk-chat-msg.user .euk-chat-bubble-meta {
    text-align: right;
    opacity: 0.65;
}

/* Typing indicator — same shape as an AI message row but no text.
   JS adds/removes this element while waiting for a response. */
.euk-chat-typing {
    display: flex;
    gap: 0.75em;
    align-items: center;
}
.euk-chat-typing-dots {
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 0.55em 0.8em;
    background: var(--euk-bg-elevated);
    border: 1px solid var(--euk-border);
    border-radius: 12px 12px 12px 2px;
}
.euk-chat-typing-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--euk-accent);
    animation: euk-blink 1.2s ease-in-out infinite both;
}
.euk-chat-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.euk-chat-typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes euk-blink {
    0%, 80%, 100% { opacity: 0.2; transform: scale(0.85); }
    40%           { opacity: 1;   transform: scale(1); }
}

/* Toast notification — ephemeral error/info message above the chat bar.
   Uses --euk-chat-bar-h so it floats above the bar regardless of height.
   JS adds/removes .show to fade in/out. */
.euk-chat-toast {
    position: fixed;
    bottom: calc(4.5rem + var(--euk-chat-bar-h, 0px));
    left: 50%;
    transform: translateX(-50%) translateY(12px);
    background: var(--euk-error, #c0392b);
    color: #fff;
    border-radius: 6px;
    padding: 0.45em 1em;
    font-size: 0.78rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 500;
    white-space: nowrap;
}
.euk-chat-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}


/* ── Dialog compose: JS-free type switching via :has() ────────────────────────
   Same rule as dev.css — see the comment there. Selecting "Call" in the
   compose form hides the body + title fields live, zero JS. */
form.euk-dialog-compose:has(select[name="comm_type"] option[value="call"]:checked) .euk-dialog-body-field,
form.euk-dialog-compose:has(select[name="comm_type"] option[value="call"]:checked) .euk-dialog-title-field {
    display: none;
}

/* ── Dialog thread view: branches + unread badges (see dev.css comment) ──────*/
.euk-dialog-branch {
    margin-left: 1.4em;
    border-left: 2px solid var(--euk-border, #ddd);
    padding-left: 0.8em;
}
.euk-dialog-branch-link { font-size: 0.8em; color: var(--euk-muted, #888); text-decoration: none; }
.euk-dialog-branch-link:hover { color: var(--euk-accent, #336); }
.euk-dialog-unread { color: var(--euk-accent, #2a6fdb); font-size: 0.85em; font-weight: 600; }


/* ── Name edit form (/profile/edit) ─────────────────────────────────────────
   Uses CSS :has() + flexbox order for western/eastern field reordering and
   for show/hide of extended fields — zero JS required.
   :has() is supported in all evergreen browsers as of 2023.
   ──────────────────────────────────────────────────────────────────────── */

.euk-name-form {
    display: flex;
    flex-direction: column;
}

/* Default (western) field order */
.euk-name-order-row     { order: 0; }
.euk-name-field-prefix  { order: 1; }
.euk-name-field-given   { order: 2; }
.euk-name-field-middle  { order: 3; }
.euk-name-field-surname { order: 4; }
.euk-name-field-surnpre { order: 5; }
.euk-name-field-pref    { order: 6; }
.euk-name-field-gensfx  { order: 7; }
.euk-name-field-prosfx  { order: 8; }
.euk-name-ext-row       { order: 9; }
.euk-name-ext-wrap      { order: 10; }
.euk-name-field-bio     { order: 11; }
.euk-name-locale-sec    { order: 12; }
.euk-name-actions       { order: 13; }

/* Eastern order: surname/particle before given/middle */
.euk-name-form:has([name="sorting_order"][value="eastern"]:checked) .euk-name-field-given   { order: 4; }
.euk-name-form:has([name="sorting_order"][value="eastern"]:checked) .euk-name-field-middle  { order: 5; }
.euk-name-form:has([name="sorting_order"][value="eastern"]:checked) .euk-name-field-surname { order: 2; }
.euk-name-form:has([name="sorting_order"][value="eastern"]:checked) .euk-name-field-surnpre { order: 3; }

/* Label text that flips with order toggle */
.euk-name-form .euk-lbl-w { display: inline; }
.euk-name-form .euk-lbl-e { display: none; }
.euk-name-form:has([name="sorting_order"][value="eastern"]:checked) .euk-lbl-w { display: none; }
.euk-name-form:has([name="sorting_order"][value="eastern"]:checked) .euk-lbl-e { display: inline; }

/* Extended fields hidden until #euk-name-ext checkbox is checked */
.euk-name-ext-wrap { display: none; flex-direction: column; }
.euk-name-form:has(#euk-name-ext:checked) .euk-name-ext-wrap { display: flex; }

/* Extended toggle label */
.euk-name-ext-row { padding: 0.5em 0 0.25em; }
.euk-name-ext-row label { cursor: pointer; color: var(--euk-fg-muted, #666); font-size: 0.9em; user-select: none; }
.euk-name-ext-row label:hover { color: var(--euk-accent, #2a6fdb); }

/* Order toggle pills */
.euk-name-order-row {
    display: flex; gap: 1.5em; align-items: center; flex-wrap: wrap;
    margin-bottom: 1em; padding: 0.5em 0.75em;
    background: var(--euk-surface-alt, #f5f5f5);
    border-radius: 4px;
}
.euk-name-order-row label { cursor: pointer; font-size: 0.95em; }
.euk-name-order-row input[type="radio"] { accent-color: var(--euk-accent, #2a6fdb); }

/* Array inputs (prefix titles / professional suffix) */
.euk-name-arr { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.euk-name-arr input { max-width: 240px; }

/* Locale overrides */
.euk-name-locale-sec { margin-top: 0.5em; }
.euk-name-locale-sec > summary { cursor: pointer; color: var(--euk-fg-muted, #666); font-size: 0.9em; padding: 0.25em 0; }
.euk-name-locale-row {
    display: flex; justify-content: space-between; align-items: baseline;
    padding: 0.3em 0; border-bottom: 1px solid var(--euk-border, #ddd);
    font-size: 0.9em;
}

/* ── Action Panels ────────────────────────────────────────────────────────────
   A panel is a vertical stack of blocks; nesting (panel_ref) draws an inset
   bordered section so composition depth stays visible.  Error cards are the
   failure-isolation surface: one bad block renders as a warning strip, the
   rest of the panel stays alive. */
.euk-panel { display: flex; flex-direction: column; gap: 1em; }
.euk-panel-block {
    border: 1px solid var(--euk-border, #ddd);
    border-radius: 6px;
    padding: 0.8em 1em;
    background: var(--euk-bg-elevated, transparent);
}
.euk-panel-nested {
    border-left: 3px solid var(--euk-accent);
    padding-left: 1em;
    display: flex; flex-direction: column; gap: 0.8em;
}
.euk-panel-nested-title { margin: 0 0 0.2em; }
.euk-panel-block-error {
    color: var(--euk-error, #a33);
    border: 1px dashed var(--euk-error, #a33);
    border-radius: 4px;
    padding: 0.5em 0.8em;
    font-size: 0.9em;
}
.euk-panel-md p { margin: 0.4em 0; }

/* Action Panel data components: entity_list table + focus_panel detail list.
   Selected row uses the accent-soft background so master-detail state is
   visible without JS. */
.euk-panel-table { border-collapse: collapse; width: 100%; font-size: 0.92em; }
.euk-panel-table th, .euk-panel-table td {
    text-align: left; padding: 0.35em 0.7em;
    border-bottom: 1px solid var(--euk-border, #ddd);
}
.euk-panel-table th { color: var(--euk-fg-muted); font-weight: 600; }
.euk-panel-table tr.euk-row-selected { background: var(--euk-accent-soft, #eaf2fb); }
.euk-panel-detail { display: grid; grid-template-columns: max-content 1fr; gap: 0.3em 1.2em; }
.euk-panel-detail dt { color: var(--euk-fg-muted); }
.euk-panel-detail dd { margin: 0; word-break: break-word; }

/* Sheet component — one implementation, two mounts (editor inputs vs
   read-only computed grid in panel blocks).  Formula cells get the accent
   tint in both modes; error values (#CYCLE! etc) go error-red. */
.euk-sheet { border-collapse: collapse; font-size: 0.92em; }
.euk-sheet th, .euk-sheet td {
    border: 1px solid var(--euk-border, #ddd);
    padding: 0.25em 0.5em; text-align: left; min-width: 5.5em;
}
.euk-sheet th { background: var(--euk-bg-elevated, #fff); color: var(--euk-fg-muted); }
.euk-sheet .euk-sheet-rownum {
    background: var(--euk-bg-elevated, #fff); color: var(--euk-fg-muted);
    min-width: 2em; text-align: right; font-size: 0.85em;
}
.euk-sheet input.euk-sheet-cell {
    border: none; background: transparent; width: 100%; min-width: 5em;
    font: inherit; color: inherit; padding: 0;
}
.euk-sheet input.euk-sheet-cell:focus { outline: 2px solid var(--euk-accent); }
.euk-sheet input.euk-sheet-cell-formula { color: var(--euk-accent); font-family: var(--euk-font-mono, monospace); }
.euk-sheet td.euk-sheet-computed { color: var(--euk-accent); }
.euk-sheet td.euk-sheet-err { color: var(--euk-error, #a33); font-family: var(--euk-font-mono, monospace); }

/* Calendar components (calendar_month grid + agenda_list).  Outside-month
   days are dimmed; events are compact chips inside day cells. */
.euk-cal { border-collapse: collapse; width: 100%; font-size: 0.9em; table-layout: fixed; }
.euk-cal-caption { text-align: left; font-weight: 600; padding: 0.3em 0; }
.euk-cal th { color: var(--euk-fg-muted); font-weight: 600; padding: 0.3em; text-align: left; }
.euk-cal td.euk-cal-day {
    border: 1px solid var(--euk-border, #ddd); vertical-align: top;
    height: 5.5em; padding: 0.25em 0.4em;
}
.euk-cal td.euk-cal-outside { opacity: 0.35; }
.euk-cal .euk-cal-daynum { color: var(--euk-fg-muted); font-size: 0.85em; }
.euk-cal-event {
    background: var(--euk-accent-soft, #eaf2fb); border-radius: 3px;
    padding: 0.05em 0.3em; margin-top: 0.15em; font-size: 0.85em;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.euk-agenda { list-style: none; padding: 0; }
.euk-agenda-item { padding: 0.3em 0; border-bottom: 1px solid var(--euk-border, #ddd); }
.euk-agenda-when { color: var(--euk-fg-muted); font-family: var(--euk-font-mono, monospace);
    font-size: 0.88em; margin-right: 0.6em; }
.euk-cal-nav a { font-family: var(--euk-font-mono, monospace); }

/* kpi_tile — one big number with a caption. */
.euk-kpi { text-align: center; padding: 0.6em 0; }
.euk-kpi-value { font-size: 2.2em; font-weight: 700; }
.euk-kpi-unit { font-size: 0.45em; font-weight: 400; color: var(--euk-fg-muted); }
.euk-kpi-label { color: var(--euk-fg-muted); margin-top: 0.2em; }

/* ── Charts + Finance section (2026-11-17) ──────────────────────────────────
   Server-rendered SVG charts (Finance sketch: Sankey, donut, line, bars)
   paint ONLY through the --euk-chart-* tokens declared in :root above —
   that is the mechanism that makes every chart match the active skin.
   Dark overrides live here ONCE in a grouped selector covering all three
   dark routes (toggle class, saved preference, OS preference), unlike the
   core variables above which predate the grouping. */
html.dark, html[data-mode="dark"] {
    --euk-sec-finance: #e07a7a;
    --euk-chart-c0:    #4fae7f;
    --euk-chart-c1:    #6d9fe6;
    --euk-chart-c2:    #d9b24a;
    --euk-chart-c3:    #d97f5f;
    --euk-chart-c4:    #a08ae6;
    --euk-chart-c5:    #55b8b4;
    --euk-chart-c6:    #d06a97;
    --euk-chart-c7:    #9aa0a8;
    --euk-chart-ink:   #b8b8b8;
    --euk-chart-grid:  #2e2e2e;
    --euk-chart-track: #2a2a2a;
    --euk-chart-node:  #9a9a9a;
    --euk-chart-spine: #58a07a;
}
@media (prefers-color-scheme: dark) {
    html[data-mode="system"] {
        --euk-chart-c0:    #4fae7f;
        --euk-chart-c1:    #6d9fe6;
        --euk-chart-c2:    #d9b24a;
        --euk-chart-c3:    #d97f5f;
        --euk-chart-c4:    #a08ae6;
        --euk-chart-c5:    #55b8b4;
        --euk-chart-c6:    #d06a97;
        --euk-chart-c7:    #9aa0a8;
        --euk-chart-ink:   #b8b8b8;
        --euk-chart-grid:  #2e2e2e;
        --euk-chart-track: #2a2a2a;
        --euk-chart-node:  #9a9a9a;
        --euk-chart-spine: #58a07a;
    }
}

/* Finance layout classes — written against skin variables so they follow
   light/dark for free.  (dev.css carries a parallel copy for the dev skin;
   if the two drift, this file is canonical.) */
.euk-fin-tiles  { display: flex; flex-wrap: wrap; gap: 0.7em; margin: 1em 0; }
.euk-fin-tile   { border: 1px solid var(--euk-border); border-radius: 6px;
                  padding: 0.55em 0.9em; min-width: 9.5em; background: var(--euk-bg-elevated); }
.euk-fin-tile-label { font-size: 0.78em; color: var(--euk-fg-muted); }
.euk-fin-tile-value { font-size: 1.25em; font-weight: 600; }
.euk-fin-pos    { color: var(--euk-success); }
.euk-fin-neg    { color: var(--euk-error); }
.euk-fin-muted  { color: var(--euk-fg-muted); font-size: 0.85em; }
.euk-fin-num    { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.euk-fin-note   { color: var(--euk-fg-muted); font-size: 0.82em; margin-top: 1.2em; }
.euk-fin-cadence { font-size: 0.9em; }
.euk-fin-cadence-on { color: var(--euk-accent); }
.euk-fin-svg    { max-width: 100%; height: auto; }
.euk-fin-barsvg { vertical-align: middle; }
.euk-fin-group  { margin: 0.35em 0; }
.euk-fin-group summary { cursor: pointer; display: flex; align-items: center; gap: 0.8em; padding: 0.25em 0; }
.euk-fin-gname  { min-width: 9em; font-weight: 600; }
.euk-fin-subtable { margin: 0.3em 0 0.6em 1.5em; font-size: 0.9em; }
.euk-fin-chip   { display: inline-block; padding: 0 0.45em; border-radius: 3px;
                  background: var(--euk-accent-soft); font-size: 0.8em; }
.euk-fin-chip-warn { background: var(--euk-accent-soft); color: var(--euk-error); }
.euk-fin-daygroup th { background: var(--euk-bg-elevated); font-weight: 600; text-align: left; }
.euk-fin-cols   { display: flex; flex-wrap: wrap; gap: 1.5em; align-items: center; }
.euk-fin-legend { list-style: none; padding: 0; margin: 0; }
.euk-fin-legend li { padding: 0.15em 0; }
.euk-fin-sections li { margin: 0.4em 0; }

/* Chart paint — tokens only.  Geometry stays in the SVG markup. */
.fin-barbg  { fill: var(--euk-chart-track); }
.fin-node   { fill: var(--euk-chart-node); }
.fin-spine  { fill: var(--euk-chart-spine); }
.fin-nlabel { font-size: 11px; fill: var(--euk-chart-ink); }
.fin-nlabel-center { font-weight: 600; fill: var(--euk-fg); }
.euk-fin-ribbon { opacity: 0.45; }
.euk-fin-ribbon:hover { opacity: 0.7; }
.fin-donutseg { fill: none; stroke-width: 26; }
.fin-c0 { fill: var(--euk-chart-c0); } .fin-donutseg.fin-c0 { stroke: var(--euk-chart-c0); }
.fin-c1 { fill: var(--euk-chart-c1); } .fin-donutseg.fin-c1 { stroke: var(--euk-chart-c1); }
.fin-c2 { fill: var(--euk-chart-c2); } .fin-donutseg.fin-c2 { stroke: var(--euk-chart-c2); }
.fin-c3 { fill: var(--euk-chart-c3); } .fin-donutseg.fin-c3 { stroke: var(--euk-chart-c3); }
.fin-c4 { fill: var(--euk-chart-c4); } .fin-donutseg.fin-c4 { stroke: var(--euk-chart-c4); }
.fin-c5 { fill: var(--euk-chart-c5); } .fin-donutseg.fin-c5 { stroke: var(--euk-chart-c5); }
.fin-c6 { fill: var(--euk-chart-c6); } .fin-donutseg.fin-c6 { stroke: var(--euk-chart-c6); }
.fin-c7 { fill: var(--euk-chart-c7); } .fin-donutseg.fin-c7 { stroke: var(--euk-chart-c7); }
.fin-donut-center { font-size: 11px; fill: var(--euk-fg-muted); }
.fin-donut-total  { font-size: 15px; font-weight: 600; fill: var(--euk-fg); }
.fin-area { fill: var(--euk-chart-c0); opacity: 0.12; }
.fin-line { stroke: var(--euk-chart-c0); stroke-width: 2.5; fill: none; }
.fin-grid { stroke: var(--euk-chart-grid); stroke-width: 1; }
.fin-axis { font-size: 10px; fill: var(--euk-chart-ink); }

/* Deficit inflow (Sankey balancer) + flex chips (2026-11-17 follow-up).
   .fin-deficit must sit AFTER the .fin-c* rules so its fill wins on the
   node rect; the ribbon runs at lower opacity than real income — it is an
   accounting balancer, not money that arrived. */
.fin-deficit { fill: var(--euk-error); }
.euk-fin-ribbon.fin-deficit { opacity: 0.28; }
.euk-fin-chip-locked     { opacity: 0.75; }
.euk-fin-chip-adjustable { color: var(--euk-accent); }
.euk-fin-chip-flexible   { color: var(--euk-success); }

/* Budget P&L donut: group list flexes beside the donut (its color bars
   double as the legend — same _fins_color(i) order as the segments). */
.euk-fin-donut-side { flex: 1 1 320px; min-width: 280px; }

/* Flow editing (sketch): paused rows, inline action links */
.euk-fin-paused { opacity: 0.5; }
.euk-fin-actions { white-space: nowrap; font-size: 0.85em; }
.euk-fin-actions form { display: inline; }
.euk-fin-linkbtn { background: none; border: none; padding: 0; color: var(--euk-accent);
                   cursor: pointer; font: inherit; text-decoration: underline; }

/* Click-to-edit affordance: a single subtle green pixel at the top-left of
   an editable value, visible ONLY on hover (James's spec — the read view
   stays pristine).  The widget row inherits table styling unchanged. */
.euk-fin-ed { position: relative; cursor: text; }
.euk-fin-ed:hover::before { content: ""; position: absolute; top: 1px; left: -6px;
                            width: 4px; height: 4px; background: var(--euk-success); }
/* "+ cushion" / "+ buffer" on Budget › Funding (2026-11-19): an edit
   affordance for a value that does not exist yet.  It keeps its place but
   stays invisible until the row is hovered, so the read view stays
   pristine.  Once clicked, the input (.euk-fin-ed-open) overrides the
   hidden parent — visibility, unlike display/opacity, can be re-enabled by
   a descendant — so it does not vanish when the pointer leaves the row. */
.euk-fin-ed-hint { visibility: hidden; }
tr:hover .euk-fin-ed-hint, .euk-fin-ed-open { visibility: visible; }

/* ── Finance rules that must outrank basic-skin ELEMENT rules (2026-11-19,
   variable_bills_spec.md Part B.3/B.4).  A rule like
   `body.euk-skin-basic td { text-align: left }` has specificity (0,1,2),
   which beats a single finance class (0,1,0) — so every money column was
   left-aligned and every pause link was a solid blue button.  Each rule
   below repeats the skin's own selector and ADDS the finance class, so it
   wins without touching the skin rule (other pages keep it).  Do not
   "simplify" these back to bare .euk-fin-* selectors: they will lose again.
   Losses found and fixed here:
     td/th.euk-fin-num      vs body.euk-skin-basic th, td {text-align:left}
     .euk-fin-linkbtn       vs body.euk-skin-basic button[type=submit]
     a.euk-fin-muted        vs body.euk-skin-basic a {color}
     table.euk-fin-subtable vs body.euk-skin-basic table {margin; width}   */
body.euk-skin-basic td.euk-fin-num,
body.euk-skin-basic th.euk-fin-num { text-align: right; }
/* A numeric HEADER may wrap ("Statement closes"); only the numbers must not.
   Without this, the nowrap above made the Cards table overflow the page
   beside a 220 px sidebar. */
body.euk-skin-basic th.euk-fin-num { white-space: normal; }
body.euk-skin-basic button[type=submit].euk-fin-linkbtn {
    background: none; border: none; border-radius: 0; padding: 0;
    color: var(--euk-fg-muted); font: inherit; cursor: pointer; text-decoration: none; }
body.euk-skin-basic button[type=submit].euk-fin-linkbtn:hover {
    color: var(--euk-accent); text-decoration: underline; opacity: 1; }
body.euk-skin-basic a.euk-fin-muted { color: var(--euk-fg-muted); }
body.euk-skin-basic a.euk-fin-muted:hover { color: var(--euk-accent); }
/* The P&L / Funding detail tables are indented under their summary; the
   skin's width:100% plus that indent would overflow the column. */
body.euk-skin-basic table.euk-fin-subtable { margin: 0.3em 0 0.6em 1.5em; width: calc(100% - 1.5em); }

/* Budget › Expenses: one set of column widths for every group table
   (Part B.5).  The <colgroup> in _fins_expense_table_head gives the widths;
   fixed layout makes the browser honour them instead of sizing each
   table to its own content.  Long text wraps inside its column. */
body.euk-skin-basic table.euk-fin-expenses { table-layout: fixed; }
body.euk-skin-basic table.euk-fin-expenses td { overflow-wrap: break-word; }
body.euk-skin-basic table.euk-fin-expenses td.euk-fin-num { white-space: normal; }
.euk-fin-expenses .euk-fin-actions form { display: block; }
/* Several plain-text actions in one cell (pause · varies by month). */
.euk-fin-actions form + form { margin-left: 0.7em; }
.euk-fin-expenses .euk-fin-actions form + form { margin-left: 0; }

/* Variable bill: the twelve months under the line (2026-11-19).  One quiet
   row spanning the table; each "Jan $40.00" stays on one line. */
body.euk-skin-basic tr.euk-fin-months td { border-top: none; padding-top: 0; font-size: 0.88em; text-align: left; }
.euk-fin-month { white-space: nowrap; }

/* ── The card fix + the /finance dashboard (2026-11-19,
   card_fix_dashboard_spec.md Parts C and E).  Same rule as the block above:
   anything that competes with a basic-skin ELEMENT rule (table width and
   margin, td borders and alignment, h2/h3 margins) repeats the skin's
   selector and adds the finance class, so it wins without touching the skin.

   Budget statement: Income → … → Free cashflow.  As narrow as its content
   (the skin makes every table 100 % wide, which would push the amounts a
   screen away from their labels); result rows carry a heavier top rule;
   the locked / adjustable / flexible split under Living expenses is
   indented and borderless so it reads as part of the row above. */
body.euk-skin-basic table.euk-fin-statement { width: auto; min-width: 24em; max-width: 100%; margin: 0.6em 0 1.2em; }
body.euk-skin-basic tr.euk-fin-result td { border-top: 2px solid var(--euk-fg-muted); }
body.euk-skin-basic tr.euk-fin-subrow td { border-top: none; padding-top: 0.05em; padding-bottom: 0.05em; }
body.euk-skin-basic tr.euk-fin-subrow td:first-child { padding-left: 2em; }

/* Dashboard: a responsive grid of cards.  auto-fill + minmax keeps every
   card at least 280 px and lets the grid drop to two columns (or one) on
   its own; `dense` lets the small cards (Interest, Bank) fill the gap a
   two-column card leaves.  min-width: 0 on a card lets its SVG shrink
   instead of widening the grid (the default min-width of a grid item is its
   content's width, which is what makes grids overflow). */
.euk-fin-dash  { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
                 grid-auto-flow: row dense; gap: 1em; margin: 1em 0; }
.euk-fin-card  { border: 1px solid var(--euk-border); border-radius: 6px; padding: 0.8em 1em;
                 background: var(--euk-bg-elevated); min-width: 0; }
.euk-fin-card-wide { grid-column: span 2; }
@media (max-width: 760px) { .euk-fin-card-wide { grid-column: auto; } }
body.euk-skin-basic .euk-fin-card h2 { font-size: 1.05em; margin: 0 0 0.5em; }
body.euk-skin-basic .euk-fin-card h3 { font-size: 0.9em; margin: 0.9em 0 0.3em; color: var(--euk-fg-muted); }
.euk-fin-card p { margin: 0.4em 0; }
.euk-fin-card-split { display: flex; flex-wrap: wrap; gap: 0.8em; align-items: center; }
.euk-fin-card-split > table { flex: 1 1 13em; }
/* Label · value lists inside a card: no grid lines, just a hairline between rows. */
body.euk-skin-basic table.euk-fin-figures { width: 100%; margin: 0; font-size: 0.92em; }
body.euk-skin-basic table.euk-fin-figures td { border: none; padding: 0.22em 0.3em; }
body.euk-skin-basic table.euk-fin-figures tr + tr td { border-top: 1px solid var(--euk-border); }
body.euk-skin-basic table.euk-fin-coming td:first-child { white-space: nowrap; }
/* Small charts: the page charts' own SVG at a fixed or full card width.
   Their text is enlarged in the SVG itself (compact mode) because it
   shrinks with the drawing. */
.euk-fin-dash-donut svg { width: 130px; }
.euk-fin-dash-sankey svg,
.euk-fin-dash-line svg   { width: 100%; }
.fin-nlabel-compact { font-size: 19px; }
/* Donut segments are stroked rings, never filled.  `.fin-c* { fill }` comes
   after `.fin-donutseg { fill: none }` at the same specificity and won, so
   the last segment painted the donut's centre grey (seen on Budget too).
   The element + class selector outranks it. */
circle.fin-donutseg { fill: none; }
.fin-axis-compact   { font-size: 20px; }
.euk-fin-life .euk-fin-num { font-weight: 600; }

/* Branded breadcrumb sections (2026-11-18): capitalized + accent color,
   "you are inside the Finance side of Eukleia".  Appended after the base
   .euk-crumb rules so the brand color wins at equal specificity. */
.euk-crumb-finance { color: var(--euk-sec-finance); font-weight: 600; }

/* ── Public home page (/ — library/routes/home.jl, 2026-11-20) ──────────────
   Standalone page: links this stylesheet directly, no page-shell chrome.
   Everything paints through skin tokens, so the dark-mode token overrides
   above retint it with zero extra rules here.
   CTA hierarchy is deliberate (James): LOG IN is the filled/primary button,
   Create account the outline/secondary — returning users find their door
   first.  Do not swap these to make sign-up louder. */
body.euk-home {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--euk-bg);
    color: var(--euk-fg);
    font-family: var(--euk-font-body);
}
.euk-home-main {
    flex: 1;
    width: min(560px, calc(100% - 32px));
    margin: 0 auto;
    padding-top: 18vh;
}
.euk-home-wordmark {
    font-family: var(--euk-font-heading);
    font-size: 2.6rem;
    letter-spacing: 0.02em;
    margin: 0 0 0.3rem;
}
.euk-home-tagline {
    color: var(--euk-fg-muted);
    font-size: 1.1rem;
    margin: 0 0 1.6rem;
}
.euk-home-cta-row {
    display: flex;
    gap: 12px;
    margin-bottom: 2.2rem;
}
.euk-home-cta {
    display: inline-block;
    padding: 0.55em 1.5em;
    border-radius: 6px;
    font-size: 1.05rem;
    text-decoration: none;
    border: 1px solid var(--euk-accent);
}
.euk-home-cta-login {
    background: var(--euk-accent);
    color: var(--euk-bg-elevated);
    font-weight: 600;
}
.euk-home-cta-login:hover { filter: brightness(1.12); }
.euk-home-cta-join {
    background: transparent;
    color: var(--euk-accent);
}
.euk-home-cta-join:hover { background: var(--euk-accent-soft); }
.euk-home-points {
    list-style: none;
    padding: 0;
    margin: 0;
}
.euk-home-points li {
    margin-bottom: 0.9rem;
    line-height: 1.5;
    color: var(--euk-fg-muted);
}
.euk-home-points li strong { color: var(--euk-fg); }
.euk-home-footer {
    text-align: center;
    padding: 1.2rem 0;
    color: var(--euk-fg-muted);
    font-size: 0.9rem;
}
.euk-home-footer a { color: var(--euk-fg-muted); }
