/* ════════════════════════════════════════════════════════════════
   TARA: brand foundation (16 Oct 2026)
   Drawn from Tara's portrait: night navy, an indigo glow, gold leaf, and
   a high-contrast serif for her name. Every page loads this first; the
   chat (tara.css), developer pages (account.css) and admin (admin.css)
   build on these tokens. Fonts are self-hosted (OFL, in /fonts): no
   request ever goes to an outside font service.
   ════════════════════════════════════════════════════════════════ */

@font-face { font-family: 'Playfair Display'; font-style: normal; font-weight: 400 600; font-display: swap;
    src: url(../fonts/playfair-display-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Playfair Display'; font-style: normal; font-weight: 400 600; font-display: swap;
    src: url(../fonts/playfair-display-latin-ext.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 400 700; font-display: swap;
    src: url(../fonts/dm-sans-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 400 700; font-display: swap;
    src: url(../fonts/dm-sans-latin-ext.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
    /* Night navy, from the portrait's background */
    --bg:          #0A0F2E;
    --bg-deep:     #070B23;
    --bg-elev-1:   #10173F;
    --bg-elev-2:   #182054;
    --bg-elev-3:   #222B68;
    --indigo:      #3B40A8;

    /* Ivory text with a cool blue mute */
    --text:        #F5F0E6;
    --text-mute:   #B6BBD8;
    --text-faint:  #8A91B8;

    --border:        rgba(182, 187, 216, 0.12);
    --border-strong: rgba(182, 187, 216, 0.24);

    /* Gold leaf: the coin, the lapel pin, her name */
    --gold:        #D6AE5C;
    --gold-hi:     #F2D58E;
    --gold-lo:     #A57B2E;
    --gold-grad:   linear-gradient(135deg, #F6DE9C 0%, #D6AE5C 48%, #A9792C 100%);
    --gold-soft:   rgba(214, 174, 92, 0.13);
    --gold-line:   rgba(214, 174, 92, 0.40);
    --on-gold:     #1B1405;

    /* Older names some pages still use */
    --ember:       var(--gold);
    --ember-hover: var(--gold-hi);
    --ember-glow:  rgba(214, 174, 92, 0.22);

    /* State (separate from the brand accent) */
    --ok:          #5FD7AE;
    --ok-bg:       rgba(95, 215, 174, 0.12);
    --warn:        #F2BE5C;
    --warn-bg:     rgba(242, 190, 92, 0.13);
    --danger:      #FF8F8F;
    --danger-bg:   rgba(255, 143, 143, 0.11);
    --info:        #9DB8FF;
    --info-bg:     rgba(157, 184, 255, 0.12);

    --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-body:    'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    --font-mono:    ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;

    --r-sm:   8px;
    --r-md:   12px;
    --r-lg:   18px;
    --r-xl:   24px;
    --r-full: 9999px;

    --ease:     cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out: cubic-bezier(0.34, 1.56, 0.64, 1);

    --header-h: 60px;
    --safe-bot: env(safe-area-inset-bottom);
    --shadow-lg: 0 24px 60px rgba(3, 5, 20, 0.55);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { min-height: 100%; }

body {
    background:
        radial-gradient(1100px 520px at 50% -160px, rgba(59, 64, 168, 0.30), transparent 70%),
        var(--bg);
    background-attachment: fixed;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a       { color: var(--gold-hi); text-decoration: none; }
a:hover { color: var(--text); }
button  { font-family: inherit; border: none; background: none; color: inherit; cursor: pointer; }
img     { max-width: 100%; }
code, pre, kbd { font-family: var(--font-mono); }

:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; border-radius: 4px; }

.t-sr-only, .tara-sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ─── Brand lockup: portrait, "Tara" in gold serif, the concierge line ─── */
.t-lockup { display: inline-flex; align-items: center; gap: 10px; color: var(--text); min-width: 0; }
.t-lockup:hover { color: var(--text); }
.t-face {
    width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; object-fit: cover; display: block;
    background: var(--bg-elev-2);
    box-shadow: 0 0 0 1.5px var(--gold-line), 0 4px 14px rgba(3, 5, 20, 0.5);
}
.t-face.sm { width: 28px; height: 28px; }
.t-face.lg { width: 44px; height: 44px; }
.t-wordmark { display: flex; flex-direction: column; line-height: 1; min-width: 0; }
.t-wordmark b {
    font-family: var(--font-display); font-weight: 600; font-size: 22px; letter-spacing: 0.01em;
    background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
    padding-bottom: 2px;
}
.t-wordmark small {
    font-size: 9.5px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase;
    color: var(--text-faint); margin-top: 3px; white-space: nowrap;
}
.t-gold-text { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.t-overline {
    font-size: 11px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold);
}

/* ─── Buttons ─────────────────────────────────────────────────── */
.t-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 42px; padding: 0 18px; border-radius: var(--r-full);
    font: inherit; font-size: 14px; font-weight: 600; letter-spacing: 0.01em; white-space: nowrap;
    border: 1px solid transparent; cursor: pointer; text-decoration: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.2s, transform 0.12s var(--ease-out);
}
.t-btn:active { transform: scale(0.98); }
.t-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.t-btn-gold { background: var(--gold-grad); color: var(--on-gold); box-shadow: 0 6px 20px rgba(214, 174, 92, 0.22); }
.t-btn-gold:hover { color: var(--on-gold); box-shadow: 0 8px 26px rgba(214, 174, 92, 0.34); filter: brightness(1.05); }
.t-btn-line { background: transparent; color: var(--text); border-color: var(--gold-line); }
.t-btn-line:hover { color: var(--text); background: var(--gold-soft); border-color: var(--gold); }
.t-btn-quiet { background: var(--bg-elev-2); color: var(--text); border-color: var(--border); }
.t-btn-quiet:hover { color: var(--text); background: var(--bg-elev-3); }
.t-btn-danger { background: var(--danger-bg); color: var(--danger); border-color: rgba(255, 143, 143, 0.32); }
.t-btn-danger:hover { color: #fff; background: rgba(255, 143, 143, 0.22); }
.t-btn-sm { height: 34px; padding: 0 13px; font-size: 13px; }
.t-btn-xs { height: 28px; padding: 0 10px; font-size: 12px; gap: 6px; }
.t-btn-xs svg, .t-btn-sm svg { width: 14px; height: 14px; }
.t-btn-block { width: 100%; }
.t-btn[disabled], .t-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* ─── Fields ──────────────────────────────────────────────────── */
.t-input, .t-select, .t-textarea {
    width: 100%; background: var(--bg-elev-2); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--r-md);
    font: inherit; font-size: 14px; padding: 10px 13px; outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.t-input::placeholder, .t-textarea::placeholder { color: var(--text-faint); }
.t-input:focus, .t-select:focus, .t-textarea:focus { border-color: var(--gold-line); box-shadow: 0 0 0 3px var(--gold-soft); }
.t-textarea { resize: vertical; min-height: 96px; line-height: 1.55; }
.t-select { appearance: none; padding-right: 34px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23B6BBD8' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; }
.t-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-mute); margin-bottom: 6px; letter-spacing: 0.01em; }

/* ─── Tags and state ──────────────────────────────────────────── */
.t-tag {
    display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px;
    border-radius: var(--r-full); font-size: 11.5px; font-weight: 600; white-space: nowrap;
    background: var(--bg-elev-2); color: var(--text-mute); border: 1px solid var(--border);
}
.t-tag.ok     { background: var(--ok-bg);     color: var(--ok);     border-color: rgba(95, 215, 174, 0.28); }
.t-tag.warn   { background: var(--warn-bg);   color: var(--warn);   border-color: rgba(242, 190, 92, 0.30); }
.t-tag.danger { background: var(--danger-bg); color: var(--danger); border-color: rgba(255, 143, 143, 0.30); }
.t-tag.info   { background: var(--info-bg);   color: var(--info);   border-color: rgba(157, 184, 255, 0.28); }
.t-tag.gold   { background: var(--gold-soft); color: var(--gold-hi); border-color: var(--gold-line); }
.t-tag.muted  { color: var(--text-faint); }

.t-flash { border-radius: var(--r-md); padding: 11px 14px; font-size: 14px; border: 1px solid; }
.t-flash.ok     { background: var(--ok-bg);     color: var(--ok);     border-color: rgba(95, 215, 174, 0.28); }
.t-flash.err    { background: var(--danger-bg); color: var(--danger); border-color: rgba(255, 143, 143, 0.30); }
.t-flash.info   { background: var(--info-bg);   color: var(--info);   border-color: rgba(157, 184, 255, 0.28); }

/* ─── Bar charts (ui.php tara_bar_chart) ──────────────────────── */
.t-chart { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; margin: 0; }
.t-chart-y { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end;
    font-size: 11px; color: var(--text-faint); font-variant-numeric: tabular-nums; line-height: 1; margin-top: -5px; padding-bottom: 0; }
.t-chart-y span:last-child { transform: translateY(5px); }
.t-chart-plot { min-width: 0; }
.t-chart-svg { width: 100%; display: block; overflow: visible; }
.t-chart-grid { stroke: var(--border); stroke-width: 1; }
.t-chart-bar { fill: url(#tGold); opacity: 0.88; }
.t-chart-bar:hover { opacity: 1; fill: var(--gold-hi); }
.t-chart-bar.hl { fill: var(--gold-hi); opacity: 1; }
.t-chart-x { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-faint); margin-top: 7px; }
.t-chart-empty { color: var(--text-faint); font-size: 13.5px; padding: 24px 0; text-align: center; }

/* A tiny four-point star, the sparkle under her name on the portrait */
.t-spark { display: inline-block; width: 10px; height: 10px; background: var(--gold);
    clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--bg-elev-3) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--bg-elev-3); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
