:root {
    color-scheme: dark;
    --bg-app: #06061f;
    --bg-panel-solid: #0b0b32;
    --bg-panel-raised: #0f1038;
    --bg-panel-soft: #15164a;
    --border-glass: rgba(101, 108, 196, 0.24);

    --text-main: #f5f3ff;
    --text-sub: #b6b2d8;
    --text-dim: #8581ad;
    --text-faint: #7f7aa8;

    --accent-brand: #ff6200;
    --accent-brand-ink: #ff7a1a;
    --accent-brand-soft: rgba(255, 98, 0, 0.15);
    --accent-brand-edge: rgba(255, 98, 0, 0.55);
    --accent-blue: #ff6200;
    --accent-blue-soft: rgba(255, 98, 0, 0.13);
    --accent-gold: #f6aa2f;
    --accent-gold-soft: rgba(246, 170, 47, 0.14);
    --accent-copper: #d98a4f;
    --accent-copper-soft: rgba(217, 138, 79, 0.14);

    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: "SFMono-Regular", "SF Mono", ui-monospace, Menlo, Consolas, monospace;

    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --shadow-soft: 0 18px 46px rgba(0, 0, 0, 0.24);
}

html[data-theme="light"] {
    color-scheme: light;
    --bg-app: #f4f7fb;
    --bg-panel-solid: #ffffff;
    --bg-panel-raised: #ffffff;
    --bg-panel-soft: #eef3fa;
    --border-glass: rgba(87, 101, 132, 0.22);

    --text-main: #141b2d;
    --text-sub: #465268;
    --text-dim: #68748a;
    --text-faint: #7a8598;

    --accent-brand: #f06423;
    --accent-brand-ink: #c94e16;
    --accent-brand-soft: rgba(240, 100, 35, 0.12);
    --accent-brand-edge: rgba(240, 100, 35, 0.36);
    --accent-blue: #2f6fd6;
    --accent-blue-soft: rgba(47, 111, 214, 0.10);
    --accent-gold: #b7791f;
    --accent-gold-soft: rgba(183, 121, 31, 0.12);
    --accent-copper: #a65f2d;
    --accent-copper-soft: rgba(166, 95, 45, 0.12);

    --shadow-soft: 0 18px 46px rgba(28, 38, 60, 0.13);
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
}

html {
    font-size: clamp(14px, calc(10.5px + 0.286vw), 16px);
}

body {
    background: var(--bg-app);
    color: var(--text-main);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
}

button,
input,
select {
    font: inherit;
}

*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-thumb {
    background: var(--border-glass);
    border-radius: 8px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

/* ---- Focus states ----
   No component set its own focus ring, so keyboard focus fell back to the UA
   outline (thin, low-contrast over the dark panels). Give every control one
   explicit, consistent ring. */

.sidebar-toggle:focus-visible,
.sidebar-brand:focus-visible,
.theme-toggle:focus-visible,
.unav-item:focus-visible,
.unav-sub-item:focus-visible,
.unav-leaf:focus-visible,
.portal-card:focus-visible,
.copilot-quick:focus-visible,
.copilot-action-btn:focus-visible,
.copilot-composer button:focus-visible,
.copilot-details summary:focus-visible {
    outline: 2px solid var(--accent-brand);
    outline-offset: 2px;
}

/* Home / universe cards clip their own overflow (hover sweep, rounded
   corners) and sit inside .home-view's overflow-x:hidden — draw the ring
   inside so nothing can clip it. */
.home-card:focus-visible {
    outline: 2px solid var(--accent-brand);
    outline-offset: -3px;
}

/* ---- Skip link ---- */

.skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 2000;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    background: var(--accent-brand);
    color: #fff;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
    transform: translateY(-160%);
    transition: transform 0.15s ease;
}

.skip-link:focus {
    transform: translateY(0);
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.content-area:focus {
    outline: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* ---- Touch ---- */

html {
    -webkit-tap-highlight-color: transparent;
}

button,
a,
summary {
    touch-action: manipulation;
}

.app-shell {
    display: flex;
    flex-direction: row;
    height: 100vh;
    overflow: hidden;
}

/* ---- Sidebar ---- */

.sidebar {
    width: 244px;
    min-width: 244px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-panel-solid);
    border-right: 1px solid rgba(101, 108, 196, 0.22);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 22px 18px 24px;
    border-bottom: 1px solid rgba(101, 108, 196, 0.22);
    border-top: none;
    border-left: none;
    border-right: none;
    background: transparent;
    width: 100%;
    cursor: pointer;
    text-align: left;
    color: var(--text-main);
}

.sidebar-brand:hover {
    background: rgba(255, 255, 255, 0.04);
}

html[data-theme="light"] .sidebar-brand:hover {
    background: rgba(47, 111, 214, 0.06);
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 14px 4px;
    padding: 9px 10px;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    background: var(--bg-panel-raised);
    color: var(--text-sub);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.theme-toggle:hover {
    border-color: var(--accent-brand-edge);
    color: var(--text-main);
}

.theme-toggle-track {
    position: relative;
    width: 34px;
    height: 18px;
    flex: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 0 0 1px var(--border-glass);
}

.theme-toggle-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-brand);
    transition: transform 0.18s ease, background 0.18s ease;
}

html[data-theme="light"] .theme-toggle-track {
    background: #dce5f2;
}

html[data-theme="light"] .theme-toggle-knob {
    transform: translateX(16px);
}

.theme-toggle-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-logo {
    width: 34px;
    height: 34px;
    border-radius: 6px;
    background: var(--accent-brand);
    color: #ffffff;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.24),
        0 8px 18px rgba(255, 98, 0, 0.18);
    overflow: hidden;
}

.brand-mark {
    width: 24px;
    height: 24px;
    display: block;
}

.brand-mark-bar {
    fill: rgba(255, 255, 255, 0.28);
}

.brand-mark-signal,
.brand-mark-arrow {
    fill: none;
    stroke: #ffffff;
    stroke-width: 2.25;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.brand-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 14.5px;
    line-height: 1.18;
    letter-spacing: 0.01em;
    color: var(--text-main);
}

.brand-date {
    font-size: 11px;
    color: var(--text-faint);
    margin-top: 4px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 10px 14px 14px;
    gap: 3px;
}

.unav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: transparent;
    color: #9498c2;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 13.5px;
    text-align: left;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.unav-item:hover {
    background: rgba(255, 255, 255, 0.045);
    color: var(--text-main);
}

html[data-theme="light"] .sidebar {
    border-right-color: #dfe6f1;
    box-shadow: 8px 0 24px rgba(28, 38, 60, 0.04);
}

html[data-theme="light"] .sidebar-brand {
    border-bottom-color: #e7edf5;
}

html[data-theme="light"] .brand-title {
    color: #141b2d;
}

html[data-theme="light"] .brand-date {
    color: #7a8598;
}

html[data-theme="light"] .unav-item,
html[data-theme="light"] .unav-sub-item,
html[data-theme="light"] .unav-leaf {
    color: #526078;
}

html[data-theme="light"] .unav-item:hover,
html[data-theme="light"] .unav-sub-item:hover,
html[data-theme="light"] .unav-leaf:hover {
    background: rgba(47, 111, 214, 0.08);
    color: #141b2d;
}

html[data-theme="light"] .unav-item.active,
html[data-theme="light"] .unav-sub-item.active,
html[data-theme="light"] .unav-leaf.active,
html[data-theme="light"] .unav-item-copilot.active {
    background: rgba(240, 100, 35, 0.10);
    color: #141b2d;
}

.unav-item.active {
    background: rgba(255, 98, 0, 0.13);
    color: var(--text-main);
    border-left-color: var(--accent-brand);
    box-shadow: none;
}

.unav-item-copilot {
    margin-top: 8px;
    color: var(--text-main);
    background: rgba(255, 98, 0, 0.08);
}

.unav-item-copilot.active {
    background: var(--accent-brand-soft);
}

.unav-parent-blue.active-group {
    color: var(--accent-blue);
}

.unav-parent-gold.active-group {
    color: var(--accent-gold);
}

.unav-parent-byf.active-group,
#group-byf.open > .unav-parent-byf {
    color: #aaa6ff;
}

.unav-parent-copper.active-group,
#group-emtia.open > .unav-parent-copper {
    color: var(--accent-copper);
}

.unav-chevron {
    font-size: 13px;
    transition: transform 0.15s ease;
    color: var(--text-faint);
}

.unav-group.open .unav-chevron {
    transform: rotate(90deg);
}

.unav-sub {
    display: none;
    flex-direction: column;
    padding: 2px 0 8px 10px;
    gap: 2px;
}

.unav-group.open .unav-sub {
    margin-right: 0.5rem;
    display: flex;
}

/* FX (Döviz) group: collapsible parent like Hisse/Fon/Emtia — accent uses the
   UnifiedUI brand palette (no FX-specific colour). */
.unav-parent-fx.active-group,
#group-fx.open > .unav-parent-fx {
    color: var(--accent-brand);
}

.unav-sub-item {
    display: block;
    width: 100%;
    padding: 8px 10px 8px 18px;
    border: none;
    background: transparent;
    color: #9498c2;
    font-family: var(--font-body);
    font-size: 12.3px;
    text-align: left;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border-left: 2px solid transparent;
}

.unav-sub-item:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.045);
}

.unav-sub-item.active {
    color: var(--text-main);
    font-weight: 650;
    background: rgba(255, 255, 255, 0.035);
}

#group-hisse .unav-sub-item.active,
#group-hisse .unav-leaf.active {
    border-left-color: var(--accent-brand);
}

#group-fon .unav-sub-item.active,
#group-fon .unav-leaf.active {
    border-left-color: var(--accent-brand);
}

#group-byf .unav-sub-item.active {
    border-left-color: #aaa6ff;
}

/* ---- Third level (sub-tabs nested inside a sub-item) ---- */

.unav-subgroup {
    display: flex;
    flex-direction: column;
}

.unav-subparent {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.unav-subgroup .unav-chevron {
    font-size: 11px;
}

.unav-subgroup.open > .unav-subparent .unav-chevron {
    transform: rotate(90deg);
}

.unav-subsub {
    display: none;
    flex-direction: column;
    padding: 2px 0 5px 13px;
    gap: 1px;
}

.unav-subgroup.open .unav-subsub {
    display: flex;
}

.unav-leaf {
    display: block;
    width: 100%;
    padding: 6px 9px 6px 18px;
    border: none;
    background: transparent;
    color: var(--text-faint);
    font-family: var(--font-body);
    font-size: 11.6px;
    text-align: left;
    border-radius: 6px;
    cursor: pointer;
    border-left: 2px solid transparent;
}

.unav-leaf:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.045);
}

.unav-leaf.active {
    color: var(--text-main);
    font-weight: 600;
}

/* ---- Content area ---- */

.content-area {
    flex: 1;
    min-width: 0;
    height: 100vh;
    position: relative;
    background: var(--bg-app);
}

.hidden {
    display: none !important;
}

#content-frame {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    background: var(--bg-app);
}

/* ---- Breadcrumb bar above the embedded sub-app frame ---- */

.content-area.has-breadcrumb {
    display: flex;
    flex-direction: column;
}

.content-area.has-breadcrumb #content-frame {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
}

.portal-breadcrumb {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 9px 20px;
    font-size: 12.5px;
    line-height: 1.4;
    background: var(--bg-app);
    border-bottom: 1px solid var(--border-glass);
}

.portal-breadcrumb .pbc-link {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    color: var(--text-dim);
    cursor: pointer;
}

.portal-breadcrumb .pbc-link:hover {
    color: var(--accent-brand);
    text-decoration: underline;
}

.portal-breadcrumb .pbc-mid {
    color: var(--text-dim);
}

.portal-breadcrumb .pbc-sep {
    color: var(--text-faint);
}

.portal-breadcrumb .pbc-current {
    color: var(--text-main);
    font-weight: 600;
}

@media (max-width: 768px) {
    .portal-breadcrumb {
        padding-left: calc(20px + env(safe-area-inset-left));
    }
}

/* ---- Home view (card-based welcome screen) ---- */

.home-view {
    position: relative;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
    padding: 34px 38px 54px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.home-glow {
    display: none;
}

.home-hint {
    display: none;
}

/* ---- Market rail (home-screen ticker) ---- */

.market-rail {
    position: relative;
    flex: none;               /* never let the scrollable home column shrink it */
    width: 100%;
    max-width: 1320px;
    min-height: 40px;
    margin: 0 0 22px;
    display: flex;
    align-items: stretch;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    background: var(--bg-panel-raised);
    overflow: hidden;
}

.market-rail[hidden] {
    display: none;
}

/* right-edge fade so pills don't hard-cut at the border */
.market-rail::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 48px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, var(--bg-panel-raised));
}

.rail-asof {
    flex: none;
    display: flex;
    align-items: center;
    padding: 0 14px;
    border-right: 1px solid var(--border-glass);
    background: var(--bg-panel-soft);
    color: var(--text-dim);
    font-family: var(--font-heading);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
    z-index: 1;
}

.market-rail-track {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 10px 16px;
    white-space: nowrap;
}

.market-rail-track.is-marquee {
    animation: railScroll 80s linear infinite;
}

.market-rail:hover .market-rail-track.is-marquee,
.market-rail:focus-within .market-rail-track.is-marquee {
    animation-play-state: paused;
}

.market-rail.is-static {
    overflow-x: auto;
    overscroll-behavior-x: contain;
}

@keyframes railScroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

.rail-group {
    display: flex;
    align-items: center;
    gap: 14px;
}

.rail-group-label {
    flex: none;
    color: var(--accent-brand-ink);
    font-family: var(--font-heading);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.rail-pill {
    display: inline-flex;
    align-items: baseline;
    gap: 7px;
    text-decoration: none;
    color: var(--text-sub);
    font-size: 12.5px;
    transition: color 0.15s ease;
}

.rail-pill:hover {
    color: var(--text-main);
}

.rail-pill:focus-visible {
    outline: 2px solid var(--accent-brand);
    outline-offset: 3px;
    border-radius: 4px;
}

.rail-pill-label {
    font-family: var(--font-mono);
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text-main);
}

.rail-pill-value {
    font-variant-numeric: tabular-nums;
    color: var(--text-sub);
}

.rail-pill-change {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.rail-pos .rail-pill-change { color: #23c995; }
.rail-neg .rail-pill-change { color: #ff5a67; }
.rail-flat .rail-pill-change { color: var(--text-dim); }

@media (prefers-reduced-motion: reduce) {
    .market-rail-track.is-marquee {
        animation: none;
    }
}

.home-hero {
    width: 100%;
    max-width: 1320px;
    margin: 0 0 28px;
}

.home-eyebrow {
    margin: 0 0 8px;
    color: var(--accent-brand-ink);
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.home-hero h1 {
    margin: 0;
    color: var(--text-main);
    font-family: var(--font-heading);
    font-size: clamp(34px, 3vw, 48px);
    line-height: 1.05;
    font-weight: 800;
    letter-spacing: 0;
    text-wrap: balance;
}

/* Wide enough for the full headline on one line — below this it wraps,
   balanced. */
@media (min-width: 1360px) {
    .home-hero h1 {
        white-space: nowrap;
    }
}

.home-card-grid {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1320px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    perspective: 1400px;
}

.home-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: clamp(480px, calc(100vh - 250px), 620px);
    min-height: 420px;
    padding: 0;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-glass);
    background: var(--bg-panel-raised);
    overflow: hidden;
    cursor: pointer;
    text-align: left;

    --lift: 0px;
    --enter-y: 26px;
    --rx: 0deg;
    --ry: 0deg;
    opacity: 0;
    transform:
        translateY(calc(var(--lift) + var(--enter-y)))
        rotateX(var(--rx))
        rotateY(var(--ry))
        scale(1);
    transition: transform 0.28s ease,
                opacity 0.6s ease,
                border-color 0.18s ease,
                box-shadow 0.25s ease;
}

.home-card:hover,
.home-card:focus-within {
    will-change: transform;
}

.home-card.card-visible {
    opacity: 1;
    --enter-y: 0px;
}

.home-main-card {
    height: auto;
    min-height: 0;
}

.home-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 42%, rgba(255, 98, 0, 0.08) 50%, transparent 58%);
    background-size: 220% 220%;
    background-position: 120% 0%;
    opacity: 0;
    transition: opacity 0.3s ease, background-position 0.7s ease;
    pointer-events: none;
    z-index: 2;
}

html[data-theme="light"] .home-card::before {
    background: linear-gradient(115deg, transparent 42%, rgba(240, 100, 35, 0.10) 50%, transparent 58%);
}

.home-card:hover {
    --lift: -3px;
}

.home-card:hover::before {
    opacity: 1;
    background-position: -20% 0%;
}

.home-card-blue {
    border-color: var(--border-glass);
}

.home-card-blue:hover {
    border-color: rgba(79, 142, 247, 0.55);
    box-shadow: 0 16px 42px rgba(79, 142, 247, 0.14);
}

.home-card-gold {
    border-color: var(--border-glass);
}

.home-card-gold:hover {
    border-color: rgba(255, 98, 0, 0.44);
    box-shadow: 0 16px 42px rgba(255, 98, 0, 0.11);
}

.home-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px 14px;
}

.home-card-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 22px;
    margin: 0;
    color: var(--text-main);
}

.home-card-meta,
.home-card-date {
    margin: 5px 0 0;
    color: var(--text-dim);
    font-size: 12px;
    font-weight: 650;
}

.home-card-date {
    margin: 4px 0 0;
    white-space: nowrap;
}

.home-regime-pill {
    display: inline-flex;
    margin-top: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    color: var(--accent-brand-ink);
    background: rgba(255, 98, 0, 0.18);
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.home-card-preview {
    position: relative;
    flex: 1;
    overflow: hidden;
    background: var(--bg-app);
    border-top: 1px solid var(--border-glass);
}

.home-native-preview {
    min-height: 330px;
    padding: 0 22px 20px;
    background: var(--bg-panel-raised);
}

.home-market-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0 6px;
    color: var(--text-dim);
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.home-market-strip strong {
    color: #23c995;
    font-size: 15px;
}

.home-sparkline {
    height: 130px;
    margin-bottom: 14px;
    border-radius: 8px;
    background:
        linear-gradient(rgba(101, 108, 196, 0.16) 1px, transparent 1px),
        rgba(255, 255, 255, 0.018);
    background-size: 100% 32px;
    overflow: hidden;
}

html[data-theme="light"] .home-sparkline {
    background:
        linear-gradient(rgba(87, 101, 132, 0.12) 1px, transparent 1px),
        rgba(47, 111, 214, 0.035);
}

.home-sparkline svg {
    width: 100%;
    height: 100%;
    display: block;
}

.home-spark-fill {
    fill: url(#homeSparkFill);
}

.home-spark-line {
    fill: none;
    stroke: #23c995;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 8px rgba(35, 201, 149, 0.28));
}

.home-metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.home-metric-grid span {
    min-width: 0;
    padding: 13px 12px;
    border: 1px solid rgba(101, 108, 196, 0.24);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.035);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.home-metric-grid small {
    color: var(--text-dim);
    font-family: var(--font-heading);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.home-metric-grid strong {
    color: var(--text-main);
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 800;
    line-height: 1.05;
}

.home-metric-grid em {
    color: #23c995;
    font-style: normal;
    font-size: 12px;
    font-weight: 800;
}

.home-market-strip strong.is-neg,
.home-metric-grid em.is-neg {
    color: #ff5a67;
}

.home-market-strip strong,
.home-metric-grid strong,
.home-metric-grid em,
.home-rate-strip strong,
.home-allocation-mini li b {
    font-variant-numeric: tabular-nums;
}

.home-rate-strip {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 8px;
    color: var(--text-sub);
    background: rgba(101, 108, 196, 0.12);
    font-size: 13px;
    font-weight: 650;
}

.home-rate-strip strong {
    color: var(--accent-brand-ink);
}

.home-allocation-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
    padding-top: 34px;
}

.home-allocation-mini {
    min-width: 0;
    text-align: center;
}

.home-donut {
    width: 110px;
    height: 110px;
    margin: 0 auto 14px;
    border-radius: 50%;
    position: relative;
}

.home-donut::after {
    content: "";
    position: absolute;
    inset: 31px;
    border-radius: 50%;
    background: var(--bg-panel-raised);
    box-shadow: inset 0 0 0 1px rgba(101, 108, 196, 0.22);
}

.home-donut-growth {
    background: conic-gradient(#4f8ef7 0 41%, #1fbd87 41% 65%, #6366f1 65% 77%, #a78bfa 77% 87%, #94a3b8 87% 94%, #ff6200 94% 100%);
}

.home-donut-balanced {
    background: conic-gradient(#a78bfa 0 21%, #4f8ef7 21% 43%, #6366f1 43% 63%, #1fbd87 63% 77%, #ff6200 77% 88%, #94a3b8 88% 100%);
}

.home-donut-defensive {
    background: conic-gradient(#a78bfa 0 49%, #6366f1 49% 66%, #ff6200 66% 81%, #f6aa2f 81% 88%, #4f8ef7 88% 93%, #1fbd87 93% 100%);
}

.home-allocation-mini strong {
    display: block;
    margin-bottom: 10px;
    color: var(--accent-brand-ink);
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 800;
}

.home-allocation-mini:nth-child(2) strong {
    color: var(--accent-gold);
}

.home-allocation-mini:nth-child(3) strong {
    color: #23c995;
}

.home-allocation-mini ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 7px;
}

.home-allocation-mini li {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: var(--text-sub);
    font-size: 12.5px;
    line-height: 1.25;
}

.home-allocation-mini li b {
    flex-shrink: 0;
    color: var(--text-main);
}

.home-card-foot {
    padding: 13px 22px;
    border-top: 1px solid var(--border-glass);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 13px;
    color: var(--text-sub);
}

.home-card-blue .home-card-foot {
    color: var(--accent-brand-ink);
}

.home-card-gold .home-card-foot {
    color: var(--accent-brand-ink);
}

/* ---- Universe cards (small, below the two main cards) ---- */

.universe-card-grid {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1320px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-top: 18px;
    perspective: 1200px;
}

.universe-card {
    height: auto;
    min-height: 94px;
    flex-direction: row;
    align-items: center;
    gap: 18px;
    padding: 22px 24px;
    border-radius: var(--radius-lg);
}

.universe-card:hover {
    --lift: -2px;
}

.universe-card-blue {
    border-color: var(--border-glass);
}

.universe-card-blue:hover {
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 14px 34px rgba(59, 130, 246, 0.16);
}

.universe-card-gold {
    border-color: var(--border-glass);
}

.universe-card-gold:hover {
    border-color: rgba(224, 162, 59, 0.48);
    box-shadow: 0 14px 34px rgba(224, 162, 59, 0.12);
}

.universe-card-copper,
.universe-card-fx {
    border-color: var(--border-glass);
}

.universe-card-copper:hover {
    border-color: rgba(217, 138, 79, 0.5);
    box-shadow: 0 14px 34px rgba(217, 138, 79, 0.13);
}

.universe-card-fx:hover {
    border-color: rgba(255, 98, 0, 0.48);
    box-shadow: 0 14px 34px rgba(255, 98, 0, 0.14);
}

.universe-card-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 16px;
}

.universe-card-blue .universe-card-icon {
    color: var(--accent-blue);
    background: var(--accent-blue-soft);
    border: 1px solid rgba(79, 142, 247, 0.32);
}

.universe-card-gold .universe-card-icon {
    color: var(--accent-gold);
    background: var(--accent-gold-soft);
    border: 1px solid rgba(224, 162, 59, 0.34);
}

.universe-card-copper .universe-card-icon {
    color: var(--accent-copper);
    background: var(--accent-copper-soft);
    border: 1px solid rgba(217, 138, 79, 0.34);
}

.universe-card-fx .universe-card-icon {
    color: var(--accent-brand-ink);
    background: var(--accent-brand-soft);
    border: 1px solid var(--accent-brand-edge);
}

.universe-card-body {
    flex: 1;
    min-width: 0;
}

.universe-card-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 16px;
    margin: 0 0 3px;
    color: var(--text-main);
}

.universe-card-desc {
    font-size: 13px;
    color: var(--text-sub);
    margin: 0;
}

.universe-card-modules {
    margin: 9px 0 0;
    color: var(--text-dim);
    font-size: 12px;
    line-height: 1.45;
    max-width: 560px;
}

.universe-card-arrow {
    flex-shrink: 0;
    font-size: 18px;
    color: var(--text-dim);
}

.universe-card-blue:hover .universe-card-arrow {
    color: var(--accent-blue);
}

.universe-card-gold:hover .universe-card-arrow {
    color: var(--accent-gold);
}

.universe-card-copper:hover .universe-card-arrow {
    color: var(--accent-copper);
}

.universe-card-fx:hover .universe-card-arrow {
    color: var(--accent-brand-ink);
}

/* ---- Turkish portal panels (Hisse / Fon) ---- */

.portal-panel {
    position: relative;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
    padding: 44px 48px 64px;
    background:
        radial-gradient(circle at 14% 8%, rgba(255, 98, 0, 0.08), transparent 26%),
        radial-gradient(circle at 86% 18%, rgba(101, 108, 196, 0.10), transparent 30%),
        var(--bg-app);
}

html[data-theme="light"] .portal-panel {
    background: var(--bg-app);
}

.portal-hero {
    max-width: 1320px;
    margin: 0 auto 34px;
}

.portal-eyebrow {
    margin: 0 0 10px;
    color: var(--accent-brand-ink);
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.portal-hero h1 {
    margin: 0 0 10px;
    color: var(--text-main);
    font-family: var(--font-heading);
    font-size: clamp(34px, 3.1vw, 52px);
    line-height: 1.02;
    font-weight: 800;
    letter-spacing: 0;
    text-wrap: balance;
}

.portal-hero p {
    max-width: 780px;
    margin: 0;
    color: var(--text-sub);
    font-size: 15px;
    line-height: 1.55;
    font-weight: 500;
}

.portal-card-grid {
    max-width: 1320px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.portal-card {
    min-height: 158px;
    padding: 22px 24px;
    border: 1px solid rgba(101, 108, 196, 0.30);
    border-radius: 12px;
    background: rgba(15, 16, 56, 0.78);
    color: var(--text-main);
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto 1fr;
    gap: 18px 16px;
    cursor: pointer;
    text-align: left;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

html[data-theme="light"] .portal-card {
    border-color: var(--border-glass);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 12px 30px rgba(28, 38, 60, 0.08);
}

html[data-theme="light"] .portal-card:hover {
    background: #ffffff;
    box-shadow: 0 18px 40px rgba(28, 38, 60, 0.12);
}

.portal-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 98, 0, 0.55);
    background: rgba(21, 22, 74, 0.92);
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.22);
}

.portal-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-brand-ink);
    background: rgba(255, 98, 0, 0.16);
    border: 1px solid rgba(255, 98, 0, 0.10);
}

.portal-icon svg {
    width: 22px;
    height: 22px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.portal-card-body {
    grid-column: 1 / -1;
    align-self: end;
}

.portal-card-body strong {
    display: block;
    margin-bottom: 7px;
    color: var(--text-main);
    font-family: var(--font-heading);
    font-size: 21px;
    line-height: 1.12;
    font-weight: 800;
    letter-spacing: 0;
}

.portal-card-body small {
    display: block;
    color: var(--text-dim);
    font-size: 14px;
    line-height: 1.4;
    font-weight: 600;
}

.portal-arrow {
    justify-self: end;
    align-self: center;
    color: var(--accent-brand-ink);
    font-size: 20px;
    line-height: 1;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.portal-card:hover .portal-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* ---- CoPilot ---- */

.copilot-panel {
    padding-bottom: 40px;
}

.copilot-shell {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    min-height: calc(100vh - 88px);
}

.copilot-main {
    min-width: 0;
    display: grid;
    grid-template-rows: auto auto minmax(480px, 1fr) auto;
    gap: 18px;
}

.copilot-topbar {
    display: flex;
    align-items: center;
    gap: 14px;
}

.copilot-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.copilot-mark {
    width: 36px;
    height: 36px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: linear-gradient(150deg, #ff7a1f, #c43f00);
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    box-shadow: 0 8px 22px -8px var(--accent-brand-edge), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.copilot-brand-text {
    display: grid;
    gap: 1px;
}

.copilot-brand-text .portal-eyebrow {
    margin: 0;
}

.copilot-wordmark {
    font-family: var(--font-heading);
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-main);
    line-height: 1.05;
}

.copilot-status {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border-glass);
    background: var(--bg-panel-raised);
    color: var(--text-sub);
    font-size: 12px;
}

.copilot-status i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.16);
}

/* --- Bülten Kıyaslama button + comparison card --- */
.copilot-topbar-actions {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.copilot-status {
    margin-left: 0;
}

.copilot-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 13px;
    border-radius: 999px;
    border: 1px solid var(--accent-brand-edge);
    background: var(--accent-brand-soft);
    color: var(--accent-brand-ink);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.copilot-action-btn:hover {
    background: rgba(255, 98, 0, 0.24);
    transform: translateY(-1px);
}

.copilot-action-ico {
    font-size: 14px;
    line-height: 1;
}

.bc-card {
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    background: var(--bg-panel-raised);
    padding: 16px 18px;
    display: grid;
    gap: 10px;
}

.bc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.bc-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
}

.bc-badge {
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.bc-badge.bc-high { background: rgba(52, 211, 153, 0.16); color: #34d399; }
.bc-badge.bc-mid  { background: var(--accent-gold-soft); color: var(--accent-gold); }
.bc-badge.bc-low  { background: rgba(248, 113, 113, 0.16); color: #f87171; }

.bc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    font-size: 12px;
    color: var(--text-dim);
}

.bc-meta b { color: var(--text-sub); }

.bc-warn {
    color: var(--accent-gold);
    font-weight: 600;
}

.bc-verdict {
    margin: 2px 0 4px;
    color: var(--text-sub);
    font-size: 13.5px;
    line-height: 1.5;
}

.bc-section {
    margin: 8px 0 2px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-dim);
    border-left: 3px solid var(--border-glass);
    padding-left: 8px;
}

.bc-section.bc-ok    { border-color: #34d399; color: #34d399; }
.bc-section.bc-clash { border-color: #f87171; color: #f87171; }
.bc-section.bc-num   { border-color: var(--accent-gold); color: var(--accent-gold); }

.bc-list {
    margin: 2px 0 4px;
    padding-left: 16px;
    display: grid;
    gap: 6px;
}

.bc-list li {
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-sub);
}

.bc-list b { color: var(--text-main); }
.bc-ours { color: var(--accent-brand-ink); }
.bc-theirs { color: #7aa2ff; }
.bc-note { color: var(--text-dim); font-size: 12px; }
.bc-empty { color: var(--text-faint); font-size: 12.5px; margin: 2px 0 4px; padding-left: 4px; }

.bc-coverage {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 620px) {
    .bc-coverage { grid-template-columns: 1fr; }
}

.copilot-quick-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.copilot-quick {
    min-height: 0;
    padding: 8px 15px;
    border: 1px solid var(--border-glass);
    border-radius: 999px;
    background: var(--bg-panel-raised);
    color: var(--text-sub);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.16s ease, color 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

.copilot-quick:hover {
    border-color: var(--accent-brand-edge);
    color: var(--text-main);
    background: var(--bg-panel-soft);
    transform: translateY(-1px);
}

.copilot-thread {
    min-height: 480px;
    max-height: calc(100vh - 300px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 8px 4px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.copilot-greeting {
    margin: 4px 0 2px 46px;
    color: var(--text-sub);
    font-size: 14px;
    line-height: 1.55;
    font-style: italic;
}

.copilot-message {
    display: flex;
    gap: 13px;
    margin: 0;
    animation: copilotRise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.copilot-message-user {
    justify-content: flex-end;
}

.copilot-avatar {
    width: 30px;
    height: 30px;
    flex: none;
    margin-top: 2px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: linear-gradient(150deg, #ff7a1f, #c43f00);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.copilot-bubble {
    min-width: 0;
    max-width: 64ch;
    padding: 0;
    border: 0;
    background: none;
    border-radius: 0;
}

.copilot-message-user .copilot-bubble {
    max-width: min(80%, 52ch);
    padding: 11px 16px;
    border: 1px solid rgba(255, 98, 0, 0.32);
    border-radius: 16px 16px 5px 16px;
    background: linear-gradient(180deg, rgba(255, 98, 0, 0.16), rgba(255, 98, 0, 0.10));
    color: #fff;
}

html[data-theme="light"] .copilot-message-user .copilot-bubble {
    color: var(--text-main);
}

.copilot-role {
    display: block;
    margin-bottom: 8px;
    color: var(--accent-brand-ink);
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.copilot-message-user .copilot-role {
    display: none;
}

.copilot-body {
    color: var(--text-main);
    font-size: 15px;
    line-height: 1.6;
}

.copilot-message-user .copilot-body {
    line-height: 1.5;
}

.copilot-body p {
    margin: 0;
    color: var(--text-main);
    white-space: pre-line;
}

.copilot-body p + p,
.copilot-body p + .copilot-answer-list,
.copilot-answer-list + p {
    margin-top: 11px;
}

.copilot-body strong {
    color: #ffffff;
    font-weight: 700;
}

html[data-theme="light"] .copilot-body strong,
html[data-theme="light"] .copilot-li-label {
    color: var(--text-main);
}

.copilot-body code {
    padding: 1px 6px;
    border-radius: 5px;
    background: var(--bg-panel-raised);
    color: var(--text-sub);
    font-family: var(--font-mono);
    font-size: 12px;
}

.copilot-answer-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 13px 0 2px;
    padding: 0;
    list-style: none;
    counter-reset: copilot-rank;
}

.copilot-answer-list li {
    counter-increment: copilot-rank;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 9px 11px;
    border: 0;
    border-radius: 11px;
    background: none;
    transition: background 0.15s ease;
}

.copilot-answer-list li:hover {
    background: var(--bg-panel-raised);
}

.copilot-answer-list li::before {
    content: counter(copilot-rank);
    flex: none;
    width: 20px;
    text-align: center;
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.copilot-answer-list li:first-child::before {
    color: var(--accent-brand-ink);
}

.copilot-answer-name {
    flex: none;
    min-width: 88px;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-main);
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.02em;
}

.copilot-answer-bar {
    flex: 1;
    height: 6px;
    min-width: 40px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    overflow: hidden;
    position: relative;
}

.copilot-answer-bar i {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255, 98, 0, 0.5), var(--accent-brand));
    box-shadow: 0 0 12px -2px var(--accent-brand-edge);
    transform-origin: left;
    animation: copilotGrow 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.copilot-answer-list li:first-child .copilot-answer-bar i {
    background: linear-gradient(90deg, #ff8a3d, #ffb27a);
}

.copilot-answer-score {
    flex: none;
    min-width: 56px;
    text-align: right;
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    background: none;
    border: 0;
    padding: 0;
    font-weight: 500;
}

.copilot-answer-text {
    flex: 1;
    min-width: 0;
    color: var(--text-sub);
    font-size: 14px;
}

.copilot-bullet-list {
    margin: 11px 0 2px;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.copilot-bullet-list li {
    position: relative;
    padding-left: 18px;
    color: var(--text-main);
    font-size: 15px;
    line-height: 1.55;
}

.copilot-bullet-list li::before {
    content: "";
    position: absolute;
    left: 3px;
    top: 9px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent-brand);
}

.copilot-li-label {
    color: #ffffff;
    font-weight: 700;
}

.copilot-section {
    margin: 16px 0 2px;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--accent-brand-ink);
}

.copilot-table-wrap {
    margin: 12px 0 2px;
    overflow-x: auto;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
}

.copilot-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.copilot-table th,
.copilot-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-glass);
    white-space: nowrap;
}

.copilot-table th {
    color: var(--text-dim);
    font-weight: 600;
    font-size: 11.5px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.03);
}

.copilot-table td {
    color: var(--text-main);
    font-variant-numeric: tabular-nums;
}

.copilot-table tbody tr:last-child td {
    border-bottom: 0;
}

.copilot-table tbody tr:hover td {
    background: var(--bg-panel-raised);
}

.copilot-details {
    margin-top: 14px;
    color: var(--text-dim);
    font-size: 12.5px;
}

.copilot-details summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-sub);
    font-weight: 600;
}

.copilot-details summary::-webkit-details-marker {
    display: none;
}

.copilot-details summary::before {
    content: "\203A";
    color: var(--text-faint);
    transition: transform 0.2s ease;
    display: inline-block;
}

.copilot-details[open] summary::before {
    transform: rotate(90deg);
}

.copilot-details summary:hover {
    color: var(--text-main);
}

.copilot-detail-body {
    display: grid;
    gap: 10px;
    margin-top: 10px;
    padding: 12px 14px;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    background: var(--bg-panel-raised);
}

.copilot-detail-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.copilot-detail-chips span {
    padding: 4px 10px;
    border: 1px solid var(--border-glass);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-sub);
    font-size: 11.5px;
}

.copilot-source-list {
    display: grid;
    gap: 7px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.copilot-source-list li {
    display: grid;
    gap: 3px;
    overflow-wrap: anywhere;
    padding: 0;
    border-radius: 0;
    background: none;
    color: var(--text-sub);
}

.copilot-source-list strong {
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 11.5px;
}

.copilot-source-list span {
    color: var(--accent-brand-ink);
    font-family: var(--font-mono);
    font-size: 10.5px;
}

.copilot-source-list p {
    margin: 2px 0 0;
    color: var(--text-sub);
    font-family: var(--font-body);
    font-size: 11.5px;
    line-height: 1.45;
}

.copilot-details pre {
    max-height: 150px;
    overflow: auto;
    padding: 10px;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.28);
    color: var(--text-sub);
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1.45;
}

html[data-theme="light"] .copilot-details pre {
    background: #eef5ff;
    border-color: #cfe0f6;
    color: #273246;
}

.copilot-typing {
    display: inline-flex;
    gap: 5px;
    align-items: center;
    padding: 4px 0;
}

.copilot-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-faint);
    animation: copilotBlink 1.3s infinite ease-in-out;
}

.copilot-typing span:nth-child(2) { animation-delay: 0.18s; }
.copilot-typing span:nth-child(3) { animation-delay: 0.36s; }

.copilot-composer {
    display: block;
}

.copilot-field {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 8px 8px 8px 16px;
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    background: var(--bg-panel-raised);
    box-shadow: 0 12px 34px -18px rgba(0, 0, 0, 0.7);
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.copilot-field:focus-within {
    border-color: var(--accent-brand-edge);
    box-shadow: 0 0 0 4px var(--accent-brand-soft), 0 12px 34px -18px rgba(0, 0, 0, 0.7);
}

.copilot-composer textarea {
    flex: 1;
    width: 100%;
    resize: none;
    max-height: 140px;
    padding: 9px 0;
    border: 0;
    background: none;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    outline: none;
}

.copilot-composer textarea::placeholder {
    color: var(--text-faint);
}

.copilot-composer button {
    flex: none;
    border: none;
    border-radius: 11px;
    padding: 11px 20px;
    background: linear-gradient(180deg, #ff7a2a, #e85400);
    color: #ffffff;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 14.5px;
    cursor: pointer;
    box-shadow: 0 6px 18px -6px var(--accent-brand-edge), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: filter 0.16s ease, transform 0.12s ease;
}

.copilot-composer button:hover {
    filter: brightness(1.06);
}

.copilot-composer button:active {
    transform: translateY(1px);
}

.copilot-composer button:disabled {
    opacity: 0.55;
    cursor: wait;
}

@keyframes copilotRise {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

@keyframes copilotGrow {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

@keyframes copilotBlink {
    0%, 60%, 100% { opacity: 0.25; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-3px); }
}

/* ---- Reduced motion ----
   Universal duration kill so this also beats the transitions declared inside
   the later width-based media queries (mobile drawer slide, sidebar collapse,
   content shift), then explicit neutralising of motion-only affordances. */
@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;
    }

    .home-card {
        opacity: 1 !important;
        --enter-y: 0px;
        --lift: 0px !important;
        --rx: 0deg !important;
        --ry: 0deg !important;
    }

    .home-card::before {
        display: none;
    }

    .portal-card:hover,
    .copilot-quick:hover,
    .copilot-action-btn:hover,
    .copilot-composer button:active,
    .theme-toggle:hover {
        transform: none;
    }
}

@media (max-width: 1100px) {
    .home-card-grid {
        grid-template-columns: 1fr;
    }
    .home-card {
        height: 520px;
    }
    .universe-card-grid {
        grid-template-columns: 1fr;
    }

    .portal-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .copilot-shell {
        grid-template-columns: 1fr;
    }

    .copilot-quick-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1280px) {
    .home-metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-allocation-grid {
        gap: 12px;
    }

    .home-donut {
        width: 92px;
        height: 92px;
    }

    .home-donut::after {
        inset: 26px;
    }

    /* Keep each legend row on one line at narrow widths (labels like
       "Global Hisse ETF" were wrapping into the value). */
    .home-allocation-mini li {
        font-size: 11.5px;
        gap: 6px;
    }

    .home-allocation-mini li span {
        flex: 1 1 auto;
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        text-align: left;
    }
}

@media (max-width: 900px) {
    .sidebar {
        width: 220px;
        min-width: 220px;
    }

    .portal-panel {
        padding: 34px 32px 52px;
    }

    .portal-card-grid {
        grid-template-columns: 1fr;
    }

    .copilot-answer-list li {
        flex-wrap: wrap;
    }

    .copilot-answer-name {
        min-width: 64px;
    }
}

/* ── Sidebar collapse ────────────────────────────────────────────────────── */
.sidebar {
    transition: width 0.22s ease, min-width 0.22s ease;
}
.app-shell.sidebar-collapsed .sidebar {
    width: 0;
    min-width: 0;
    border-right: none;
    overflow: hidden;
}
.sidebar-toggle {
    position: fixed;
    top: 16px;
    left: 206px;
    z-index: 60;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    border: 1px solid rgba(101, 108, 196, 0.32);
    background: var(--bg-panel-raised, #0f1038);
    color: var(--text-main, #f5f3ff);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: left 0.22s ease, background-color 0.15s ease;
}
.sidebar-toggle:hover { background: var(--bg-panel-solid, #0b0b32); }
.app-shell.sidebar-collapsed .sidebar-toggle { left: 12px; }

/* Toggle butonu sidebar sağ üstünde durduğu için brand başlığına sağ boşluk
   ver — başlık butonun altına girmesin. */
.sidebar-brand { padding-right: 48px; }

/* Sidebar daralınca reopen butonu içeriğin sol-üst köşesindeki başlığın üstüne
   binmesin — content'i butonun sağına kaydır (buton 12px'te, 30px genişlik). */
.content-area { transition: padding-left 0.22s ease; }
.app-shell.sidebar-collapsed .content-area { padding-left: 50px; }

/* --- Mobile: sidebar becomes an off-canvas drawer so content gets full width --- */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        min-width: 0;
        width: 84vw;
        max-width: 330px;
        padding-left: env(safe-area-inset-left);
        transform: translateX(-100%);
        transition: transform 0.26s ease;
        overscroll-behavior: contain;
        z-index: 1000;
        box-shadow: 24px 0 60px rgba(0, 0, 0, 0.6);
    }

    .app-shell.mobile-nav-open .sidebar,
    .app-shell.mobile-nav-open.sidebar-collapsed .sidebar {
        transform: translateX(0);
    }

    /* ignore the desktop collapse-to-rail on mobile — it's a drawer here */
    .app-shell.sidebar-collapsed .sidebar {
        width: 84vw;
        max-width: 330px;
    }

    .content-area {
        width: 100%;
        padding-top: calc(54px + env(safe-area-inset-top));
    }

    .mobile-nav-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(6, 8, 22, 0.62);
        z-index: 999;
    }

    .app-shell.mobile-nav-open .mobile-nav-backdrop {
        display: block;
    }

    .sidebar-toggle {
        top: calc(12px + env(safe-area-inset-top));
        left: calc(12px + env(safe-area-inset-left));
        width: 42px;
        height: 42px;
        z-index: 1001;
        font-size: 20px;
        background: var(--bg-panel-solid);
    }
}

.copilot-stage {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  opacity: 0.7;
}
.copilot-streaming .copilot-bubble { border-style: dashed; }

/* Live macro notification center lives in the portal shell, above embedded apps. */
.live-notification-bell {
    position: fixed;
    top: 16px;
    right: 20px;
    z-index: 1600;
    width: 42px;
    height: 42px;
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    background: var(--bg-panel-raised);
    color: var(--text-main);
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    display: grid;
    place-items: center;
}
.live-notification-bell svg { width: 21px; height: 21px; }
.live-notification-bell:hover { border-color: var(--accent-brand-edge); }
.live-notification-dot {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 0 2px var(--bg-panel-raised);
}
.live-notification-toasts {
    position: fixed;
    top: 68px;
    right: 20px;
    z-index: 1601;
    display: grid;
    gap: 10px;
    width: min(360px, calc(100vw - 28px));
    pointer-events: none;
}
.live-notification-toast {
    position: relative;
    display: flex;
    border: 1px solid var(--accent-brand-edge);
    border-left: 4px solid var(--accent-brand);
    border-radius: 14px;
    background: var(--bg-panel-solid);
    box-shadow: var(--shadow-soft);
    pointer-events: auto;
}
.live-notification-toast-main {
    display: grid;
    gap: 6px;
    width: 100%;
    padding: 16px 42px 15px 16px;
    border: 0;
    background: transparent;
    color: var(--text-main);
    text-align: left;
    cursor: pointer;
}
.live-notification-toast-main small {
    color: var(--accent-brand-ink);
    font: 700 10px var(--font-body);
    letter-spacing: .12em;
}
.live-notification-toast-main strong { font: 600 14px/1.45 var(--font-body); }
.live-notification-toast-main span { color: var(--text-dim); font: 500 11px var(--font-body); }
.live-notification-toast-main .live-notification-toast-summary {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    font-size: 12px;
    line-height: 1.45;
}
.live-notification-toast-dismiss,
.live-notification-center-head button {
    border: 0;
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 23px;
}
.live-notification-toast-dismiss { position: absolute; top: 8px; right: 10px; }
.live-notification-center {
    position: fixed;
    top: 68px;
    right: 20px;
    z-index: 1602;
    width: min(420px, calc(100vw - 28px));
    max-height: min(680px, calc(100vh - 82px));
    overflow: auto;
    border: 1px solid var(--border-glass);
    border-radius: 18px;
    background: var(--bg-panel-solid);
    color: var(--text-main);
    box-shadow: 0 26px 70px rgba(0, 0, 0, .35);
}
.live-notification-center[hidden], .live-notification-dot[hidden],
.live-notification-detail[hidden] { display: none; }
.live-notification-center-head {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: start;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border-glass);
    background: var(--bg-panel-solid);
}
.live-notification-center-head small {
    color: var(--accent-brand-ink);
    font: 700 10px var(--font-body);
    letter-spacing: .12em;
}
.live-notification-center-head h2 { margin: 4px 0 0; font: 700 20px var(--font-heading); }
.live-notification-tabs {
    display: flex;
    gap: 4px;
    padding: 9px 12px 0;
    border-bottom: 1px solid var(--border-glass);
}
.live-notification-tabs button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1;
    padding: 9px 5px 10px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--text-dim);
    font: 600 11px var(--font-body);
    cursor: pointer;
}
.live-notification-tabs button:hover { color: var(--text-main); }
.live-notification-tabs button[aria-pressed="true"] {
    border-bottom-color: var(--accent-brand);
    color: var(--accent-brand-ink);
}
.live-notification-tab-dot {
    flex: none;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ef4444;
}
.live-notification-tab-dot[hidden] { display: none; }
.live-notification-feed-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 20px 9px;
    border-bottom: 1px solid var(--border-glass);
    color: var(--text-dim);
    font: 700 10px var(--font-body);
    letter-spacing: .11em;
}
.live-notification-feed-head span {
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}
.live-notification-list { max-height: 265px; overflow: auto; }
.live-notification-empty { padding: 14px 20px; color: var(--text-dim); font-size: 13px; }
.live-notification-row {
    position: relative;
    display: grid;
    gap: 5px;
    width: 100%;
    padding: 13px 20px;
    border: 0;
    border-bottom: 1px solid var(--border-glass);
    background: transparent;
    color: var(--text-main);
    text-align: left;
    cursor: pointer;
}
.live-notification-row:hover, .live-notification-row.is-selected { background: var(--bg-panel-soft); }
.live-notification-row.is-selected { box-shadow: inset 3px 0 0 var(--accent-brand); }
.live-notification-row-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.live-notification-row-top em {
    padding: 3px 6px;
    border-radius: 5px;
    background: var(--accent-brand-soft);
    color: var(--accent-brand-ink);
    font: 700 9px var(--font-body);
    font-style: normal;
    letter-spacing: .08em;
}
.live-notification-row small, .live-notification-detail small { color: var(--text-dim); font: 500 11px var(--font-body); }
.live-notification-row strong { font: 600 13px/1.45 var(--font-body); }
.live-notification-products {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    margin-top: 3px;
}
.live-notification-product {
    padding: 3px 7px;
    border: 1px solid var(--accent-brand-edge);
    border-radius: 5px;
    background: var(--accent-brand-soft);
    color: var(--accent-brand-ink);
    font: 600 10px/1.3 var(--font-body);
}
.live-notification-product-more {
    color: var(--text-dim);
    font: 600 10px/1.3 var(--font-body);
}
.live-notification-detail {
    margin: 14px 14px 16px;
    padding: 16px 16px 20px;
    border: 1px solid var(--accent-brand-edge);
    border-radius: 14px;
    background: var(--bg-panel-raised);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
}
.live-notification-detail-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 10px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-glass);
}
.live-notification-detail-head span {
    color: var(--accent-brand-ink);
    font: 700 10px var(--font-body);
    letter-spacing: .1em;
}
.live-notification-detail-head small { color: var(--text-dim); }
.live-notification-detail h3 { margin: 8px 0; font: 700 16px/1.4 var(--font-heading); }
.live-notification-detail .live-notification-products { margin: 8px 0 12px; }
.live-notification-detail p { margin: 8px 0; color: var(--text-sub); font: 400 13px/1.6 var(--font-body); }
.live-notification-detail .live-notification-evidence { color: var(--accent-brand-ink); font-size: 11px; }
.live-notification-detail h4 { margin: 18px 0 6px; font: 700 12px var(--font-body); }
.live-notification-detail a { display: block; margin: 7px 0; color: var(--accent-brand-ink); font: 500 12px/1.45 var(--font-body); }
.live-notification-detail .live-notification-open-link {
    display: inline-block;
    margin-top: 12px;
    padding: 9px 12px;
    border: 1px solid var(--accent-brand-edge);
    border-radius: 7px;
    background: var(--accent-brand-soft);
    font-weight: 700;
    text-decoration: none;
}
@media (max-width: 768px) {
    .live-notification-bell { top: 12px; right: 12px; z-index: 1700; }
    .live-notification-toasts, .live-notification-center { top: 64px; right: 14px; }
}

.live-notification-center-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.live-notification-center-actions button {
    border: 0;
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 17px;
    padding: 4px 6px;
    border-radius: 8px;
    transition: color 0.15s, background-color 0.15s;
}
.live-notification-center-actions button:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
}
#live-notification-close {
    font-size: 22px;
}
