/* Shared Toolcrib identity: polished headers and a restrained green sheen. */
:root {
    --toolcrib-sheen: #34d399;
    --toolcrib-sheen-soft: rgba(52, 211, 153, 0.12);
    --toolcrib-sheen-line: rgba(110, 231, 183, 0.18);
    --toolcrib-sheen-glow: rgba(16, 185, 129, 0.055);
}

/* Flexcell: retain its existing surfaces, blue accents, and semantic colors. */
.fc-panel,
.fc-source-card,
.fc-filter-panel,
.fc-chart-controls,
.fc-chart-wrap,
.fc-chart-selection-actions,
.fc-chart-table-wrap,
.fc-tree-node-row,
.fc-modal {
    border-color: var(--toolcrib-sheen-line);
    box-shadow: 0 0 24px var(--toolcrib-sheen-glow);
}

.fc-panel-header {
    border-bottom-color: rgba(110, 231, 183, 0.10);
}

.fc-source-tabs,
.fc-workspace-tabs {
    border-bottom-color: rgba(110, 231, 183, 0.12);
}

.fc-tab:focus-visible,
.fc-button:focus-visible,
.fc-cell-value:focus-visible,
.fc-tree-toggle:focus-visible,
.fc-tree-label:focus-visible,
.fc-field input:focus-visible,
.fc-field textarea:focus-visible,
.fc-field select:focus-visible,
.fc-chart-control input:focus-visible,
.fc-chart-control select:focus-visible {
    outline: 2px solid rgba(110, 231, 183, 0.82);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.14);
}

.fc-button:hover:not(:disabled),
.fc-tab:hover {
    border-color: rgba(110, 231, 183, 0.34);
}

/* Shared, high-presence header treatment inspired by AIYO's layered identity. */
.fc-shell > .fc-topbar,
.shell.topbar {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 76px;
    padding: 14px 20px;
    border: 1px solid rgba(110, 231, 183, 0.24);
    border-radius: 16px;
    background:
        radial-gradient(ellipse at 88% 0%, rgba(34, 197, 94, 0.15), transparent 30rem),
        radial-gradient(ellipse at 12% 0%, rgba(56, 189, 248, 0.17), transparent 34rem),
        linear-gradient(112deg, rgba(15, 23, 42, 0.99), rgba(2, 6, 23, 0.98) 58%, rgba(8, 31, 48, 0.98));
    box-shadow:
        0 18px 44px rgba(0, 0, 0, 0.26),
        0 2px 22px rgba(16, 185, 129, 0.07),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.fc-shell > .fc-topbar::before,
.shell.topbar::before {
    position: absolute;
    z-index: -1;
    inset: 0;
    background: linear-gradient(115deg, transparent 18%, rgba(255, 255, 255, 0.025) 48%, transparent 76%);
    content: "";
    pointer-events: none;
}

.fc-shell > .fc-topbar::after,
.shell.topbar::after {
    position: absolute;
    right: 20px;
    bottom: 0;
    left: 20px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.46) 34%, rgba(110, 231, 183, 0.62) 72%, transparent);
    content: "";
    pointer-events: none;
}

.fc-shell > .fc-topbar > *,
.shell.topbar > * {
    position: relative;
    z-index: 1;
}

.fc-shell > .fc-topbar .fc-brand {
    gap: 13px;
    color: #f1f5f9;
    font-size: 1.3rem;
    font-weight: 850;
    letter-spacing: -0.025em;
    text-shadow: 0 0 22px rgba(52, 211, 153, 0.14);
}

.fc-shell > .fc-topbar .fc-brand-mark {
    position: relative;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(167, 243, 208, 0.55);
    border-radius: 12px;
    background: linear-gradient(140deg, #38bdf8 0%, #34d399 58%, #15803d 100%);
    box-shadow:
        0 8px 22px rgba(16, 185, 129, 0.23),
        inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.fc-shell > .fc-topbar .fc-brand-mark::after {
    position: absolute;
    inset: 7px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 7px;
    content: "";
}

.fc-shell > .fc-topbar .fc-top-actions {
    gap: 10px;
    color: #cbd5e1;
    font-size: 0.88rem;
    font-weight: 650;
}

.fc-shell > .fc-topbar .fc-button {
    border-color: rgba(110, 231, 183, 0.28);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(6, 78, 59, 0.35), rgba(30, 41, 59, 0.92));
    color: #e2e8f0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.fc-shell > .fc-topbar .fc-button:hover:not(:disabled),
.fc-shell > .fc-topbar .fc-button:focus-visible {
    border-color: rgba(110, 231, 183, 0.64);
    background: linear-gradient(135deg, rgba(6, 95, 70, 0.55), rgba(30, 41, 59, 0.98));
    box-shadow: 0 0 18px rgba(16, 185, 129, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.07);
    color: #f0fdf4;
    transform: translateY(-1px);
}

/* Toolcrib portal header: give its existing wordmark and navigation equal polish. */
.shell.topbar {
    color: #cbd5e1;
}

.shell.topbar > strong {
    color: #f1f5f9;
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-shadow: 0 0 20px rgba(52, 211, 153, 0.16);
}

.shell.topbar nav {
    align-items: center;
    gap: 7px;
}

.shell.topbar nav a {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 7px 11px;
    border: 1px solid transparent;
    border-radius: 999px;
    color: #cbd5e1;
    font-size: 0.85rem;
    font-weight: 700;
    transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.shell.topbar nav a:hover,
.shell.topbar nav a[aria-current="page"] {
    border-color: rgba(110, 231, 183, 0.3);
    background: linear-gradient(135deg, rgba(6, 78, 59, 0.34), rgba(8, 47, 73, 0.42));
    color: #d1fae5;
    text-decoration: none;
}

.shell.topbar nav a:hover {
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.09);
    transform: translateY(-1px);
}

.shell.topbar nav a:focus-visible {
    outline: 2px solid rgba(110, 231, 183, 0.82);
    outline-offset: 2px;
    color: #f0fdf4;
}

/* Toolcrib cards retain their blue palette with a coordinated green edge. */
.shell .card,
.shell .callout {
    border-color: var(--toolcrib-sheen-line);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22), 0 0 24px var(--toolcrib-sheen-glow);
}

.shell .button:focus-visible,
.shell a:focus-visible {
    outline: 2px solid rgba(110, 231, 183, 0.82);
    outline-offset: 3px;
}

.shell .button:hover {
    box-shadow: 0 0 18px var(--toolcrib-sheen-glow);
}

@media (max-width: 900px) {
    .fc-shell > .fc-topbar,
    .shell.topbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .fc-shell > .fc-topbar .fc-top-actions {
        width: 100%;
        justify-content: space-between;
    }

    .shell.topbar nav {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 520px) {
    .fc-shell > .fc-topbar,
    .shell.topbar {
        padding: 13px 14px;
        border-radius: 13px;
    }

    .fc-shell > .fc-topbar .fc-top-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .shell.topbar nav {
        gap: 5px;
    }

    .shell.topbar nav a {
        min-height: 36px;
        padding: 6px 9px;
        font-size: 0.8rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fc-shell > .fc-topbar .fc-button,
    .shell.topbar nav a {
        transition: none;
    }

    .fc-shell > .fc-topbar .fc-button:hover:not(:disabled),
    .shell.topbar nav a:hover,
    .shell .button:hover {
        transform: none;
    }
}