/* ===== Inkgility Portal & Auth Theme =====
   Light-first, matching the dashboard prototype: the bare :root is the light
   palette and [data-theme="dark"] is the opt-in override the rest of the site
   already toggles (localStorage 'inkgility-theme'). Views address colour only
   through these tokens — never a literal cream or ink hex — so both themes
   stay legible from one place. */
:root {
    /* Surfaces. --dark is the page, --dark2 the raised card. The names are
       inherited from the dark-only era; they now mean "page" and "surface". */
    --dark: #F3EBEF;
    --dark2: #FFFFFF;
    --bg-warm: #FAF5F8;
    --field-bg: #F8F5EE;

    /* Ink. --cream likewise means "primary text", light or dark. */
    --cream: #1A0F2A;
    --text-heading: #1A0F2A;
    --text-body: #3D2D52;
    --text-caption: #6B5A7A;
    --muted: rgba(26, 15, 42, 0.55);
    --border: rgba(26, 15, 42, 0.10);
    --dim: rgba(26, 15, 42, 0.06);

    /* Brand */
    --purple: #8E21CA;
    --blue: #254AAD;
    --accent: #7C3AED;
    --gold: #7C3AED; /* legacy alias — kept so existing views keep contrast */
    --btn-gradient: linear-gradient(129deg, #9B3FD4, #3A5BC7);

    /* Status */
    --error: #DC2626;
    --success: #059669;
    --warn: #B45309;
    --danger: #DC2626;
    --red: #DC2626;
    --green: #059669;
    --orange: #C2410C;
    --error-bg: rgba(220, 38, 38, 0.08);
    --error-text: #B91C1C;
    --success-bg: rgba(5, 150, 105, 0.08);
    --success-text: #047857;
    --info-bg: rgba(142, 33, 202, 0.08);
    --info-text: #6B21A8;

    --shadow-card: 0 4px 18px rgba(142, 33, 202, 0.10);
    --shadow-hover: 0 14px 36px -12px rgba(142, 33, 202, 0.22);
}

[data-theme="dark"] {
    --dark: #0A0810;
    --dark2: #120D1C;
    --bg-warm: #0E0A18;
    --field-bg: #0A0810;

    --cream: #F3EBEF;
    --text-heading: #F3EBEF;
    --text-body: #D4CDE8;
    --text-caption: #A090C0;
    --muted: rgba(243, 235, 239, 0.62);
    --border: rgba(243, 235, 239, 0.10);
    --dim: rgba(243, 235, 239, 0.08);

    --accent: #C58BEB;
    --gold: #C58BEB;

    --error: #EF4444;
    --success: #10B981;
    --warn: #F0A500;
    --danger: #E74C3C;
    --red: #E74C3C;
    --green: #2ECC71;
    --orange: #F39C12;
    --error-bg: rgba(239, 68, 68, 0.10);
    --error-text: #FCA5A5;
    --success-bg: rgba(16, 185, 129, 0.10);
    --success-text: #6EE7B7;
    --info-bg: rgba(142, 33, 202, 0.12);
    --info-text: #D8B4FE;

    --shadow-card: 0 4px 18px rgba(0, 0, 0, 0.18);
    --shadow-hover: 0 14px 36px -12px rgba(142, 33, 202, 0.32);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    background: var(--dark);
    color: var(--text-body);
    font-family: 'DM Sans', sans-serif;
    min-height: 100vh;
    position: relative;
}

/* The sticky dashboard sidebar dies inside a scroll container, and
   `overflow-x: hidden` on html/body makes one — public-site.css sets it on
   both to stop the marketing pages' decorative glows panning sideways on iOS.
   `clip` hides the same overflow without creating a scroll container, which is
   exactly what the dashboard prototype uses. `hidden` stays first as the
   fallback for browsers that don't know `clip`. */
html, body { overflow-x: hidden; overflow-x: clip; }

/* Static film grain, sitting above the page like the dashboard prototype's. */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.028;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 200px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Page atmosphere =====
   Same orbs/grid the public site uses, lifted from public-site.css so the auth
   and portal pages can render <x-page-atmosphere /> without pulling in the
   whole public stylesheet. Scoped to .pa-static to avoid the JS-injected twin. */
#page-atmosphere.pa-static {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
    contain: layout style;
}
.pa-static > * { position: absolute; pointer-events: none; }
.pa-static .pa-orb { border-radius: 50%; filter: blur(130px); will-change: transform, opacity; mix-blend-mode: multiply; }
[data-theme="dark"] .pa-static .pa-orb { mix-blend-mode: screen; }
.pa-static .pa-orb-1 { width: 600px; height: 600px; background: rgba(142, 33, 202, .14); top: -12%; left: -8%; animation: psPaOrb1 24s ease-in-out infinite; }
.pa-static .pa-orb-2 { width: 520px; height: 520px; background: rgba(142, 33, 202, .10); bottom: -10%; right: -8%; animation: psPaOrb2 28s ease-in-out infinite; }
.pa-static .pa-orb-3 { width: 460px; height: 460px; background: rgba(212, 73, 170, .10); top: 38%; right: 6%; animation: psPaOrb3 22s ease-in-out infinite; }
.pa-static .pa-orb-4 { width: 480px; height: 480px; background: rgba(37, 74, 173, .10); bottom: 20%; left: 14%; animation: psPaOrb4 26s ease-in-out infinite; }
[data-theme="dark"] .pa-static .pa-orb-1 { background: rgba(142, 33, 202, .22); }
[data-theme="dark"] .pa-static .pa-orb-2 { background: rgba(142, 33, 202, .18); }
[data-theme="dark"] .pa-static .pa-orb-3 { background: rgba(212, 73, 170, .16); }
[data-theme="dark"] .pa-static .pa-orb-4 { background: rgba(37, 74, 173, .14); }
@keyframes psPaOrb1 { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(50px, -30px, 0); } }
@keyframes psPaOrb2 { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(-40px, 25px, 0); } }
@keyframes psPaOrb3 { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(-35px, 40px, 0); } }
@keyframes psPaOrb4 { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(45px, -20px, 0); } }
.pa-static .pa-ink { border-radius: 50%; filter: blur(70px); mix-blend-mode: multiply; opacity: 0; animation: psPaInk 22s ease-in-out infinite; }
[data-theme="dark"] .pa-static .pa-ink { mix-blend-mode: screen; }
.pa-static .pa-ink-1 { width: 520px; height: 520px; background: radial-gradient(circle, rgba(142, 33, 202, .32), transparent 70%); top: 18%; left: 22%; animation-delay: 0s; }
.pa-static .pa-ink-2 { width: 460px; height: 460px; background: radial-gradient(circle, rgba(212, 73, 170, .28), transparent 70%); bottom: 14%; right: 18%; animation-delay: 11s; }
@keyframes psPaInk { 0%, 100% { opacity: 0; transform: scale(.85); } 40% { opacity: .45; transform: scale(1.08); } 70% { opacity: .25; transform: scale(1); } }
.pa-static .pa-grid { inset: 0; opacity: .05; mix-blend-mode: multiply; mask-image: radial-gradient(ellipse 90% 75% at 50% 50%, #000, transparent 92%); overflow: hidden; }
[data-theme="dark"] .pa-static .pa-grid { opacity: .12; mix-blend-mode: screen; }
.pa-static .pa-grid::before { content: ''; position: absolute; inset: -80px; background-image: linear-gradient(rgba(142, 33, 202, .16) 1px, transparent 1px), linear-gradient(90deg, rgba(142, 33, 202, .16) 1px, transparent 1px); background-size: 80px 80px; animation: psPaGrid 18s linear infinite; }
@keyframes psPaGrid { from { background-position: 0 0; } to { background-position: 80px 80px; } }
@media (max-width: 760px) {
    .pa-static .pa-orb-3, .pa-static .pa-orb-4, .pa-static .pa-ink-1, .pa-static .pa-ink-2 { display: none; }
    .pa-static .pa-grid { opacity: .025; }
    .pa-static .pa-orb, .pa-static .pa-ink { animation: none; }
}
@media (prefers-reduced-motion: reduce) {
    .pa-static .pa-orb, .pa-static .pa-ink, .pa-static .pa-grid::before { animation: none !important; }
}

/* ===== Nav ===== */
.ink-nav {
    position: relative;
    z-index: 10;
    background: color-mix(in srgb, var(--dark2) 85%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 2rem;
}
.ink-nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.ink-logo {
    font-family: 'Instrument Serif', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.05em;
}
.ink-nav-right { display: flex; align-items: center; gap: 1.5rem; }
.ink-nav-link {
    color: var(--text-body);
    font-size: 0.9rem;
    font-weight: 500;
}
.ink-nav-link:hover { color: var(--accent); text-decoration: none; }
.ink-nav-link.active { color: var(--accent); }
.ink-user-greeting { font-size: 0.95rem; color: var(--text-body); }
.ink-user-greeting .name { color: var(--accent); font-weight: 700; }

/* Theme toggle — writes the same 'inkgility-theme' key the public site uses. */
.ink-theme-toggle {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--dark2);
    color: var(--text-body);
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    transition: border-color 0.2s ease, color 0.2s ease;
}
.ink-theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
/* One glyph per theme, so the button shows where you're going. */
.ink-theme-toggle .ink-theme-icon-dark { display: none; }
[data-theme="dark"] .ink-theme-toggle .ink-theme-icon-dark { display: inline; }
[data-theme="dark"] .ink-theme-toggle .ink-theme-icon-light { display: none; }

/* ===== Layout ===== */
.ink-content {
    position: relative;
    z-index: 2;
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

/* ===== Portal shell =====
   Ported from the dashboard prototype (Inkgility-HTML-Pages/dashboard.html): a
   sticky grouped sidebar beside the page body. The prototype's own purple
   top bar is NOT ported — the portal wears the marketing site's sticky
   header (.site-nav, public-site.css) so signing in doesn't change chrome.
   That header is position:fixed and transparent until scrolled, hence the
   shell's top padding. */
.dash-shell {
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    gap: 32px;
    max-width: 1320px;
    margin: 0 auto;
    padding: 104px 28px 72px;
    position: relative;
    z-index: 2;
}
.dash-main { min-width: 0; }

/* Sidebar */
.dash-side {
    position: sticky;
    top: 96px;
    align-self: start;
    padding: 22px 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--dark2);
    box-shadow: var(--shadow-card);
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    /* The rail is taller than a short viewport, so it scrolls — but a default
       scrollbar reads as a second page scroller sitting next to the first. */
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.dash-side::-webkit-scrollbar { width: 6px; }
.dash-side::-webkit-scrollbar-track { background: transparent; }
.dash-side::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.dash-side::-webkit-scrollbar-thumb:hover { background: var(--muted); }
.dash-side-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px 18px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 14px;
}
.dash-side-brand-mark {
    width: 34px; height: 34px;
    flex-shrink: 0;
    border-radius: 9px;
    background: var(--btn-gradient);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-family: 'Instrument Serif', serif;
    font-style: italic;
    font-size: 18px; font-weight: 600; line-height: 1;
}
.dash-side-brand-name {
    font-family: 'Instrument Serif', serif;
    font-size: 20px;
    color: var(--text-heading);
    letter-spacing: -0.01em;
}
.dash-side-group { margin-bottom: 14px; }
.dash-side-label {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-caption);
    padding: 8px 12px 6px;
    font-weight: 700;
}
.dash-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    font-size: 13.5px;
    color: var(--text-body);
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.15s ease, color 0.15s ease;
    font-weight: 500;
}
.dash-link:hover { background: rgba(142, 33, 202, 0.06); color: var(--purple); text-decoration: none; }
.dash-link.active { background: rgba(142, 33, 202, 0.10); color: var(--purple); font-weight: 700; }
[data-theme="dark"] .dash-link:hover { background: rgba(142, 33, 202, 0.16); color: var(--accent); }
[data-theme="dark"] .dash-link.active { background: rgba(142, 33, 202, 0.22); color: var(--accent); }
/* Sidebar status pill — the link stays clickable and says what it is. The row
   is already justify-content:space-between, so this sits flush right. */
.dash-link-badge {
    flex: 0 0 auto;
    font-family: 'Space Mono', monospace;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--purple);
    background: rgba(142, 33, 202, 0.10);
    border-radius: 999px;
    padding: 2px 7px;
}
[data-theme="dark"] .dash-link-badge { color: var(--accent); background: rgba(142, 33, 202, 0.24); }
.dash-side-divider { height: 1px; background: var(--border); margin: 10px 6px; }

/* Sidebar collapses behind a toggle on narrow screens. */
.dash-side-toggle {
    display: none;
    width: 100%;
    padding: 11px 16px;
    margin-bottom: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--dark2);
    color: var(--text-body);
    font-family: 'DM Sans', sans-serif;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}
.dash-side-toggle:hover { border-color: var(--purple); color: var(--purple); }

@media (max-width: 900px) {
    .dash-shell { grid-template-columns: minmax(0, 1fr); padding: 88px 18px 56px; gap: 0; }
    .dash-side-toggle { display: block; }
    .dash-side { position: static; max-height: none; display: none; margin-bottom: 20px; }
    .dash-side.open { display: block; }
}

/* ===== Portal footer — the prototype's slim bar ===== */
.ink-footer {
    position: relative;
    z-index: 2;
    border-top: 1px solid var(--border);
    padding: 22px 28px;
    background: var(--dark2);
    color: var(--text-caption);
    font-size: 12.5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.ink-footer a { color: var(--text-caption); text-decoration: none; margin: 0 8px; }
.ink-footer a:hover { color: var(--purple); }
.ink-footer-brand {
    font-family: 'Instrument Serif', serif;
    font-style: italic;
    color: var(--text-heading);
    font-size: 14px;
}

.ink-content-header { margin-bottom: 2.5rem; }
.ink-content-header h1 {
    font-family: 'Instrument Serif', serif;
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-style: italic;
    color: var(--text-heading);
    margin-bottom: 0.5rem;
}
.ink-content-header p { font-size: 1rem; color: var(--muted); }
/* ===== Auth layout =====
   Removed: /login, /register, /forgot-password and /verify-email now
   render the shared auth card from public/css/auth-suite.css (the same
   one the site-wide popup and the Design Studio gate use). The old
   .ink-auth-* rules had no remaining markup and were deleted rather
   than left to rot. */

/* ===== Forms ===== */
.ink-form-group { margin-bottom: 11px; }
.ink-form-label {
    display: block;
    margin-bottom: 0.3rem;
    font-family: 'Space Mono', monospace;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}
.ink-form-input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: var(--field-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--cream);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.92rem;
    transition: border-color 0.2s ease, background 0.2s ease;
    outline: none;
}
.ink-form-input:focus { border-color: var(--accent); }
.ink-form-input::placeholder { color: var(--text-caption); }
.ink-form-hint { font-size: 0.75rem; line-height: 1.45; color: var(--muted); margin-top: 0.35rem; }
.ink-form-error {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.8rem;
    color: var(--error-text);
}

.ink-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-body);
    cursor: pointer;
    user-select: none;
}
.ink-checkbox-label input[type="checkbox"] {
    width: 15px; height: 15px;
    accent-color: var(--purple);
    cursor: pointer;
}

/* ===== Buttons ===== */
.ink-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.4rem;
    border: none;
    border-radius: 50px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    white-space: nowrap;
}
.ink-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.ink-btn-primary {
    background: linear-gradient(135deg, var(--purple) 0%, var(--blue) 100%);
    color: #FFFFFF;
}
.ink-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(142, 33, 202, 0.4);
    text-decoration: none;
}

.ink-btn-outline {
    background: transparent;
    color: var(--cream);
    border: 1.5px solid var(--border);
}
.ink-btn-outline:hover:not(:disabled) {
    border-color: var(--purple);
    background: rgba(142, 33, 202, 0.08);
    text-decoration: none;
}

.ink-btn-gold {
    background: var(--accent);
    color: #FFFFFF;
}
.ink-btn-gold:hover:not(:disabled) { filter: brightness(1.1); text-decoration: none; }

.ink-btn-block { width: 100%; }

/* Compact button variant used in nav */
.ink-btn-sm { padding: 0.5rem 1.1rem; font-size: 0.85rem; border-radius: 6px; }

.ink-logout-btn {
    padding: 0.5rem 1.25rem;
    background: rgba(142, 33, 202, 0.12);
    border: 1px solid rgba(142, 33, 202, 0.35);
    border-radius: 6px;
    color: var(--cream);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}
.ink-logout-btn:hover { background: rgba(142, 33, 202, 0.2); border-color: var(--purple); color: var(--accent); }

/* ===== Alerts ===== */
.ink-alert {
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid;
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre-line;
}
.ink-alert-error { background: var(--error-bg); color: var(--error-text); border-left-color: var(--error); }
.ink-alert-success { background: var(--success-bg); color: var(--success-text); border-left-color: var(--success); }
.ink-alert-info { background: var(--info-bg); color: var(--info-text); border-left-color: var(--purple); }

/* ===== Cards ===== */
.ink-card {
    background: var(--dark2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s ease;
    color: var(--text-body);
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.ink-card-link { text-decoration: none; }
.ink-card-link:hover {
    border-color: rgba(142, 33, 202, 0.35);
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
    text-decoration: none;
}
.ink-card-icon {
    font-size: 2rem;
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(142, 33, 202, 0.12);
    border-radius: 8px;
    border: 1px solid rgba(142, 33, 202, 0.25);
}
.ink-card-title {
    font-family: 'Instrument Serif', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-heading);
}
.ink-card-description {
    font-size: 0.9rem;
    color: var(--muted);
    flex: 1;
    line-height: 1.6;
}
.ink-card-arrow {
    color: var(--accent);
    font-weight: 700;
    font-size: 0.9rem;
    margin-top: auto;
}

.ink-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* KPI pills */
.ink-kpi {
    background: var(--dark2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
}
.ink-kpi-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-caption);
    margin-bottom: 0.5rem;
}
.ink-kpi-value {
    font-family: 'Instrument Serif', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-heading);
}

/* Plan badge / pill */
.ink-plan-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(142, 33, 202, 0.10);
    border: 1px solid rgba(142, 33, 202, 0.28);
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: 'Space Mono', monospace;
}

/* Loading spinner */
.ink-loading {
    display: flex; align-items: center; justify-content: center;
    min-height: 300px;
}
.ink-spinner {
    width: 40px; height: 40px;
    border: 3px solid rgba(142, 33, 202, 0.2);
    border-top-color: var(--purple);
    border-radius: 50%;
    animation: ink-spin 0.8s linear infinite;
}
@keyframes ink-spin { to { transform: rotate(360deg); } }

/* Section title */
.ink-section-title {
    font-family: 'Instrument Serif', serif;
    font-size: 1.5rem;
    font-style: italic;
    color: var(--text-heading);
    margin: 2rem 0 1rem;
}

/* Utility */
.ink-text-muted { color: var(--muted); }
.ink-text-center { text-align: center; }
.ink-mt-2 { margin-top: 1rem; }
.ink-mt-4 { margin-top: 2rem; }

/* Responsive */
@media (max-width: 768px) {
    .ink-content { padding: 2rem 1rem; }
    .ink-nav { padding: 1rem 1.25rem; }
    .ink-nav-right { gap: 1rem; }
    .ink-user-greeting { font-size: 0.85rem; }
}

/* ═══════════════════════════════════════════════════════════════════
   Dashboard body — ported from Inkgility-HTML-Pages/dashboard.html.
   Everything below is scoped to .dash-* so it only dresses the
   dashboard's own sections, not the portal pages sharing this shell.
   ═══════════════════════════════════════════════════════════════════ */

/* ─── Welcome strip ─── */
.dash-welcome-strip {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: center;
    padding: 24px 28px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(142, 33, 202, 0.06), rgba(37, 74, 173, 0.04));
    margin-bottom: 22px;
}
.dash-welcome-h1 {
    font-family: 'Instrument Serif', serif;
    font-size: clamp(28px, 3.4vw, 38px);
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--text-heading);
    margin-bottom: 6px;
}
.dash-welcome-h1 em {
    font-style: italic;
    background: linear-gradient(135deg, #8E21CA, #254AAD);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
[data-theme="dark"] .dash-welcome-h1 em { background: linear-gradient(135deg, #C58BEB, #6C8FE0); -webkit-background-clip: text; background-clip: text; }
.dash-welcome-strip-meta {
    font-family: 'Space Mono', monospace;
    font-size: 11.5px;
    letter-spacing: 0.06em;
    color: var(--text-caption);
    text-transform: uppercase;
}
.dash-welcome-strip-meta b { color: var(--text-body); font-weight: 700; }
.dash-readiness {
    text-align: right;
    text-decoration: none;
    color: inherit;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    padding: 14px 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--dark2);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    min-width: 200px;
}
.dash-readiness:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: rgba(142, 33, 202, 0.30); text-decoration: none; }
.dash-readiness-lbl {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-caption);
    font-weight: 700;
}
.dash-readiness-val {
    font-family: 'Instrument Serif', serif;
    font-size: 28px;
    color: var(--text-heading);
    line-height: 1;
    letter-spacing: -0.02em;
}
.dash-readiness-cta { font-size: 12px; color: var(--purple); font-weight: 600; }
[data-theme="dark"] .dash-readiness-cta { color: var(--accent); }
@media (max-width: 760px) {
    .dash-welcome-strip { grid-template-columns: minmax(0, 1fr); text-align: left; padding: 20px; }
    .dash-readiness { align-items: flex-start; text-align: left; }
}

/* ─── Post-onboarding banner ─── */
.dash-personal {
    padding: 20px 24px;
    border: 1px solid rgba(142, 33, 202, 0.30);
    border-radius: 14px;
    background: rgba(142, 33, 202, 0.05);
    margin-bottom: 22px;
}
.dash-personal-h {
    font-family: 'Instrument Serif', serif;
    font-size: 20px;
    color: var(--text-heading);
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}
.dash-personal-sub { font-size: 13.5px; color: var(--text-body); margin-bottom: 12px; }
.dash-personal-list { display: flex; gap: 10px; flex-wrap: wrap; }
.dash-personal-chip {
    padding: 8px 16px;
    border-radius: 60px;
    background: var(--dark2);
    border: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-body);
    text-decoration: none;
    font-weight: 600;
    transition: border-color 0.15s ease, color 0.15s ease;
}
.dash-personal-chip:hover { border-color: var(--purple); color: var(--purple); text-decoration: none; }

/* ─── Section heading ─── */
.dash-section { margin-bottom: 32px; }
.dash-section-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 14px;
    gap: 14px;
    flex-wrap: wrap;
}
.dash-section-h {
    font-family: 'Instrument Serif', serif;
    font-size: 24px;
    color: var(--text-heading);
    letter-spacing: -0.01em;
}
.dash-section-link { font-size: 13px; color: var(--purple); font-weight: 600; }
[data-theme="dark"] .dash-section-link { color: var(--accent); }
.dash-section-link.is-static { cursor: default; color: var(--text-caption); }
.dash-section-lede { font-size: 14.5px; color: var(--text-body); max-width: 64ch; margin: -4px 0 18px; }
.dash-empty-note { font-size: 13.5px; color: var(--text-caption); }

/* ─── Continue working ─── */
.dash-continue-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 900px) { .dash-continue-grid { grid-template-columns: minmax(0, 1fr); } }
.dash-continue-card {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--dark2);
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    text-decoration: none;
    color: inherit;
    min-height: 130px;
}
.dash-continue-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: rgba(142, 33, 202, 0.30); text-decoration: none; }
.dash-continue-tag {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--purple);
    font-weight: 700;
}
[data-theme="dark"] .dash-continue-tag { color: var(--accent); }
.dash-continue-title {
    font-family: 'Instrument Serif', serif;
    font-size: 18px;
    color: var(--text-heading);
    letter-spacing: -0.01em;
    line-height: 1.2;
}
.dash-continue-meta { font-size: 12.5px; color: var(--text-caption); margin-top: auto; }
.dash-continue-empty {
    padding: 36px 24px;
    border: 1.5px dashed var(--border);
    border-radius: 14px;
    text-align: center;
    color: var(--text-caption);
}
.dash-continue-empty h3 {
    font-family: 'Instrument Serif', serif;
    font-size: 22px;
    color: var(--text-heading);
    margin-bottom: 8px;
}
.dash-continue-empty p { font-size: 14px; margin-bottom: 18px; }
.dash-continue-empty-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ─── Product tiles ─── */
.dash-product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.dash-product-tile {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--dark2);
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    text-decoration: none;
    color: inherit;
    min-height: 170px;
}
.dash-product-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: rgba(142, 33, 202, 0.30); text-decoration: none; }
.dash-product-icon {
    width: 40px; height: 40px;
    border-radius: 11px;
    background: linear-gradient(135deg, rgba(142, 33, 202, 0.14), rgba(37, 74, 173, 0.10));
    color: var(--purple);
    display: flex; align-items: center; justify-content: center;
}
[data-theme="dark"] .dash-product-icon { color: var(--accent); }
.dash-product-icon svg { width: 20px; height: 20px; }
.dash-product-name {
    font-family: 'Instrument Serif', serif;
    font-size: 19px;
    color: var(--text-heading);
    letter-spacing: -0.01em;
    line-height: 1.2;
}
.dash-product-desc { font-size: 12.5px; color: var(--text-caption); line-height: 1.5; flex: 1; }
.dash-product-state {
    font-family: 'Space Mono', monospace;
    font-size: 10.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-body);
    font-weight: 700;
}

/* ─── Mini cards (Content Cockpit band) ─── */
.dash-mini-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.dash-mini-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px;
    background: rgba(142, 33, 202, 0.04);
    border: 1px solid var(--border);
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.18s ease;
}
.dash-mini-card:hover { border-color: var(--purple); text-decoration: none; }
.dash-mini-tag {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--purple);
    font-weight: 700;
}
[data-theme="dark"] .dash-mini-tag { color: var(--accent); }
.dash-mini-title {
    font-family: 'Instrument Serif', serif;
    font-size: 18px;
    color: var(--text-heading);
    line-height: 1.2;
}
.dash-mini-desc { font-size: 12.5px; color: var(--text-body); line-height: 1.5; }

/* ─── Stats ─── */
.dash-stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 760px) { .dash-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dash-stat {
    display: block;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--dark2);
    box-shadow: var(--shadow-card);
    /* Some tiles are links (Saved designs → /my-designs); they must read as
       tiles, not as underlined anchors. */
    color: inherit;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
a.dash-stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: rgba(142, 33, 202, 0.30); text-decoration: none; }
.dash-stat-num {
    font-family: 'Instrument Serif', serif;
    font-size: 30px;
    color: var(--text-heading);
    letter-spacing: -0.02em;
    line-height: 1;
}
.dash-stat-lbl {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-caption);
    margin-top: 8px;
    font-weight: 700;
}

/* ─── Two-col: activity + AI ─── */
.dash-twocol { display: grid; grid-template-columns: 1.55fr minmax(0, 1fr); gap: 18px; }
@media (max-width: 900px) { .dash-twocol { grid-template-columns: minmax(0, 1fr); } }
.dash-card {
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--dark2);
    box-shadow: var(--shadow-card);
}
.dash-card-title {
    font-family: 'Instrument Serif', serif;
    font-size: 22px;
    color: var(--text-heading);
    letter-spacing: -0.01em;
    margin-bottom: 14px;
}
.dash-activity-row {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) auto;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    align-items: center;
}
.dash-activity-row:last-child { border-bottom: none; }
.dash-activity-surface {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--purple);
    font-weight: 700;
}
[data-theme="dark"] .dash-activity-surface { color: var(--accent); }
.dash-activity-title { font-size: 14px; color: var(--text-heading); font-weight: 600; }
.dash-activity-time { font-family: 'Space Mono', monospace; font-size: 11px; color: var(--text-caption); letter-spacing: 0.04em; }
@media (max-width: 560px) {
    .dash-activity-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}
.dash-ai-tip {
    padding: 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(142, 33, 202, 0.08), rgba(37, 74, 173, 0.04));
    border: 1px solid rgba(142, 33, 202, 0.18);
    margin-bottom: 14px;
}
.dash-ai-tip-lbl {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--purple);
    font-weight: 700;
    margin-bottom: 6px;
}
[data-theme="dark"] .dash-ai-tip-lbl { color: var(--accent); }
.dash-ai-tip-text { font-size: 13.5px; color: var(--text-body); line-height: 1.55; margin-bottom: 10px; }
.dash-ai-tip-cta { font-size: 13px; color: var(--purple); font-weight: 700; }
[data-theme="dark"] .dash-ai-tip-cta { color: var(--accent); }

/* ─── QR codes card ─── */
.dash-qr-lede { color: var(--text-caption); font-size: 13.5px; line-height: 1.55; margin-bottom: 1rem; }
.dash-qr-row {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 0.6rem;
    flex-wrap: wrap;
}
.dash-qr-row:last-child { margin-bottom: 0; }
.dash-qr-main { flex: 1; min-width: 180px; }
.dash-qr-link { font-family: 'Space Mono', monospace; font-size: 0.9rem; }
.dash-qr-state { color: var(--text-caption); font-size: 0.78rem; margin-top: 2px; }
.dash-qr-state.is-live { color: var(--success); }
.dash-qr-state.is-waiting { color: var(--warn); }
.dash-qr-actions { display: flex; gap: 0.5rem; flex-shrink: 0; flex-wrap: wrap; }

/* ─── Buttons ─── */
.dash-btn {
    display: inline-block;
    padding: 12px 22px;
    background: var(--btn-gradient);
    color: #fff !important;
    text-decoration: none;
    border-radius: 60px;
    font-family: 'Instrument Serif', serif;
    font-style: italic;
    font-size: 15px;
    font-weight: 500;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 6px 22px rgba(142, 33, 202, 0.28);
    border: none;
    cursor: pointer;
}
.dash-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(142, 33, 202, 0.40); text-decoration: none; }
.dash-btn-ghost {
    display: inline-block;
    padding: 11px 20px;
    background: transparent;
    border: 1.5px solid rgba(142, 33, 202, 0.50);
    color: var(--purple);
    text-decoration: none;
    border-radius: 60px;
    font-family: 'Instrument Serif', serif;
    font-style: italic;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s ease;
    cursor: pointer;
}
.dash-btn-ghost:hover { background: rgba(142, 33, 202, 0.06); text-decoration: none; }
[data-theme="dark"] .dash-btn-ghost { color: var(--accent); }
.dash-btn-sm { padding: 7px 14px; font-size: 13px; box-shadow: none; }

/* ─── My Designs (/my-designs) ─── */
.dsg-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.dsg-chip {
    padding: 7px 15px;
    border-radius: 60px;
    border: 1px solid var(--border);
    background: var(--dark2);
    color: var(--text-body);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.15s ease, color 0.15s ease;
}
.dsg-chip:hover { border-color: var(--purple); color: var(--purple); text-decoration: none; }
.dsg-chip.active { border-color: var(--purple); color: var(--purple); background: rgba(142, 33, 202, 0.08); }

.dsg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.dsg-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--dark2);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.dsg-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: rgba(142, 33, 202, 0.30); }
.dsg-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 4 / 3;
    /* Designs are usually light artwork, so the well stays neutral in both
       themes rather than inheriting the card surface. */
    background: var(--field-bg);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}
.dsg-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.dsg-thumb-empty {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-caption);
}
.dsg-body { padding: 14px 16px 6px; flex: 1; }
.dsg-name {
    font-family: 'Instrument Serif', serif;
    font-size: 17px;
    color: var(--text-heading);
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin-bottom: 4px;
    overflow-wrap: anywhere;
}
.dsg-meta { font-size: 12px; color: var(--text-caption); }
.dsg-folder { color: var(--purple); font-weight: 600; }
[data-theme="dark"] .dsg-folder { color: var(--accent); }
.dsg-rename-input {
    width: 100%;
    padding: 6px 9px;
    margin-bottom: 4px;
    border: 1px solid var(--purple);
    border-radius: 8px;
    background: var(--field-bg);
    color: var(--text-heading);
    font-family: 'Instrument Serif', serif;
    font-size: 16px;
}
.dsg-rename-input:focus { outline: 2px solid rgba(142, 33, 202, 0.35); outline-offset: 1px; }
.dsg-actions { display: flex; gap: 8px; align-items: center; padding: 10px 16px 16px; }
.dsg-rename {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-caption);
    cursor: pointer;
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background 0.15s ease, color 0.15s ease;
}
.dsg-rename:hover { color: var(--purple); background: rgba(142, 33, 202, 0.08); }
[data-theme="dark"] .dsg-rename:hover { color: var(--accent); }
.dsg-rename:disabled { opacity: 0.6; cursor: default; }
.dsg-delete {
    background: none;
    border: none;
    color: var(--text-caption);
    cursor: pointer;
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background 0.15s ease, color 0.15s ease;
}
.dsg-delete:hover { color: var(--error); background: var(--error-bg); }
.dsg-delete.armed { color: var(--error); background: var(--error-bg); font-weight: 700; }
.dsg-delete:disabled { opacity: 0.6; cursor: default; }
