:root {
    color-scheme: light;
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    background: #f3f4f6;
    color: #172033;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    padding: 32px 16px;
    background:
        radial-gradient(circle at top, #ffffff 0%, #f3f4f6 55%);
}

.container {
    width: min(780px, 100%);
    margin: 0 auto;
    padding: 32px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.09);
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 8px;
    font-size: clamp(2rem, 7vw, 2.6rem);
}

h2 {
    margin-bottom: 18px;
    font-size: 1.4rem;
}

.subtitle {
    margin-bottom: 28px;
    color: #5f6b7a;
}

textarea {
    display: block;
    width: 100%;
    min-height: 150px;
    resize: vertical;
    padding: 16px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font: inherit;
    line-height: 1.5;
    color: inherit;
    background: #ffffff;
}

textarea:focus {
    outline: 3px solid rgba(37, 99, 235, 0.16);
    border-color: #2563eb;
}

.input-hint {
    margin: 8px 0 0;
    color: #7c8797;
    font-size: 0.85rem;
}

button {
    margin-top: 16px;
    padding: 12px 20px;
    border: 0;
    border-radius: 10px;
    background: #1d4ed8;
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

button:hover {
    background: #1e40af;
}

button:disabled {
    cursor: wait;
    opacity: 0.65;
}

.status-message {
    min-height: 24px;
    margin: 10px 0 0;
    color: #5f6b7a;
    font-size: 0.92rem;
}

.status-message.success {
    color: #147a43;
}

.status-message.error {
    color: #b42318;
}

hr {
    margin: 28px 0;
    border: 0;
    border-top: 1px solid #e2e8f0;
}

.memory-list {
    display: grid;
    gap: 16px;
}

.memory-card {
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
}

.memory-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.memory-heading h3 {
    margin-bottom: 10px;
    font-size: 1.05rem;
    line-height: 1.35;
}

.importance {
    flex: 0 0 auto;
    padding: 4px 8px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 0.78rem;
    font-weight: 800;
}

.memory-metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.metadata-chip {
    padding: 5px 8px;
    border-radius: 8px;
    background: #e8edf4;
    color: #475569;
    font-size: 0.76rem;
}

.memory-content {
    margin-bottom: 16px;
    color: #334155;
    line-height: 1.55;
    white-space: pre-wrap;
}

.memory-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: #7c8797;
    font-size: 0.78rem;
}

.empty-state {
    margin: 0;
    padding: 20px;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    color: #64748b;
    text-align: center;
}

.empty-state.error {
    color: #b42318;
}

@media (max-width: 600px) {
    body {
        padding: 0;
        background: #ffffff;
    }

    .container {
        min-height: 100vh;
        padding: 24px 18px;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .memory-heading,
    .memory-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    button {
        width: 100%;
    }
}

.search-result{

    border:1px solid #ddd;

    border-radius:12px;

    padding:18px;

    margin-top:15px;

    cursor:pointer;

    transition:.2s;

}

.search-result:hover{

    background:#f7f9fc;

    transform:translateY(-2px);

}

.search-meta{

    color:#777;

    font-size:.85rem;

}

.search-result {

    background: white;

    border: 1px solid #dce3ef;

    border-radius: 14px;

    padding: 18px;

    margin: 18px 0;

    box-shadow: 0 2px 6px rgba(0,0,0,.06);

    transition: .18s ease;

    cursor: pointer;

}

.search-result:hover{

    transform: translateY(-2px);

    box-shadow:0 8px 18px rgba(0,0,0,.12);

}

.search-title{

    font-size:1.2rem;

    font-weight:700;

    margin-bottom:10px;

}

.search-summary{

    color:#444;

    line-height:1.5;

    margin-bottom:14px;

}

.badge-row{

    display:flex;

    flex-wrap:wrap;

    gap:8px;

    margin:10px 0;

}

.badge{

    background:#eef3fb;

    color:#234;

    padding:5px 10px;

    border-radius:999px;

    font-size:.82rem;

}

.entity-chip{

    display:inline-block;

    margin:4px 6px 0 0;

    padding:5px 10px;

    border-radius:999px;

    background:#dcecff;

    color:#124;

    font-size:.82rem;

}

.search-footer{

    margin-top:15px;

    display:flex;

    justify-content:space-between;

    color:#777;

    font-size:.85rem;

}

/* --------------------------------------------------
   Barnabas OS Search
-------------------------------------------------- */

.search-page {
    width: min(900px, calc(100% - 32px));
    margin: 40px auto;
}

.search-page-header {
    position: sticky;
    top: 0;
    z-index: 10;

    padding: 28px;
    margin-bottom: 22px;

    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #dce3ef;
    border-radius: 18px;
    box-shadow: 0 8px 30px rgba(25, 40, 75, 0.08);

    backdrop-filter: blur(12px);
}

.brand-link {
    display: inline-block;

    margin-bottom: 6px;

    color: #10264a;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.1;
    text-decoration: none;
}

.brand-link:hover {
    color: #1f4ed8;
}

.search-page-subtitle {
    margin: 0 0 22px;

    color: #53627a;
    font-size: 1rem;
}

.search-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
}

.search-input {
    width: 100%;
    min-height: 52px;

    padding: 12px 16px;

    background: #ffffff;
    border: 1px solid #bfcbe0;
    border-radius: 12px;

    color: #15233b;
    font: inherit;
    font-size: 1rem;

    outline: none;
    transition:
        border-color 160ms ease,
        box-shadow 160ms ease;
}

.search-input:focus {
    border-color: #2356dc;
    box-shadow: 0 0 0 4px rgba(35, 86, 220, 0.12);
}

.search-button {
    min-height: 52px;

    padding: 0 24px;

    border: 0;
    border-radius: 12px;

    background: #2356dc;
    color: #ffffff;

    font: inherit;
    font-weight: 700;

    cursor: pointer;
    transition:
        transform 160ms ease,
        background 160ms ease,
        box-shadow 160ms ease;
}

.search-button:hover {
    background: #1947c4;
    box-shadow: 0 7px 18px rgba(35, 86, 220, 0.22);
    transform: translateY(-1px);
}

.search-button:active {
    transform: translateY(0);
}

.search-hint {
    margin: 9px 0 0;

    color: #748197;
    font-size: 0.84rem;
}

.search-results {
    display: grid;
    gap: 16px;
}

.search-result-count {
    margin: 0 2px 2px;

    color: #647087;
    font-size: 0.92rem;
}

.search-result {
    padding: 20px;

    background: #ffffff;
    border: 1px solid #dce3ef;
    border-radius: 16px;
    box-shadow: 0 3px 12px rgba(25, 40, 75, 0.06);

    transition:
        border-color 160ms ease,
        box-shadow 160ms ease,
        transform 160ms ease;
}

.search-result:hover {
    border-color: #b7c7e5;
    box-shadow: 0 10px 26px rgba(25, 40, 75, 0.11);
    transform: translateY(-2px);
}

.search-card-topline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;

    margin-bottom: 10px;
}

.search-title {
    margin: 0;

    color: #14233d;
    font-size: 1.12rem;
    font-weight: 750;
    line-height: 1.35;
}

.relevance-label {
    flex: 0 0 auto;

    padding: 5px 9px;

    border-radius: 999px;

    background: #e7efff;
    color: #1947b9;

    font-size: 0.76rem;
    font-weight: 700;
    white-space: nowrap;
}

.search-summary {
    margin: 0 0 14px;

    color: #46546b;
    font-size: 0.96rem;
    line-height: 1.55;
}

.badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;

    margin: 0 0 12px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;

    padding: 5px 9px;

    border-radius: 999px;

    background: #f0f4fa;
    color: #34445d;

    font-size: 0.79rem;
    font-weight: 600;
}

.badge-prayer {
    background: #f2eaff;
    color: #6940a5;
}

.badge-commitment {
    background: #e7efff;
    color: #1947b9;
}

.badge-goal {
    background: #e5f7ec;
    color: #237341;
}

.badge-meeting {
    background: #fff1de;
    color: #995816;
}

.badge-idea {
    background: #fff8d8;
    color: #826a00;
}

.entity-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;

    margin-top: 4px;
}

.entity-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;

    padding: 5px 9px;

    border-radius: 999px;

    background: #eaf3ff;
    color: #234d80;

    font-size: 0.79rem;
}

.entity-link {
    text-decoration: none;
    cursor: pointer;

    transition:
        background 150ms ease,
        color 150ms ease,
        transform 150ms ease;
}


.entity-link:hover {
    background: #d9eaff;
    color: #173f73;
    transform: translateY(-1px);
}

.entity-link:focus-visible {
    outline: 3px solid rgba(35, 86, 220, 0.2);
    outline-offset: 2px;
}

.search-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;

    margin-top: 16px;
    padding-top: 13px;

    border-top: 1px solid #edf0f5;

    color: #7a8699;
    font-size: 0.8rem;
}

.search-empty-state {
    padding: 52px 28px;

    background: #ffffff;
    border: 1px dashed #cbd5e5;
    border-radius: 16px;

    text-align: center;
}

.search-empty-state h2 {
    margin: 8px 0;

    color: #1b2b46;
    font-size: 1.25rem;
}

.search-empty-state p {
    max-width: 520px;
    margin: 0 auto;

    color: #69768b;
    line-height: 1.5;
}

.search-empty-icon {
    color: #2356dc;
    font-size: 2.4rem;
}

.search-error {
    padding: 20px;

    background: #fff1f1;
    border: 1px solid #f2c4c4;
    border-radius: 14px;

    color: #912c2c;
}

.visually-hidden {
    position: absolute;

    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;

    overflow: hidden;
    clip: rect(0, 0, 0, 0);

    white-space: nowrap;
    border: 0;
}

@media (max-width: 640px) {
    .search-page {
        width: min(100% - 20px, 900px);
        margin-top: 12px;
    }

    .search-page-header {
        padding: 20px;
        border-radius: 14px;
    }

    .search-controls {
        grid-template-columns: 1fr;
    }

    .search-button {
        width: 100%;
    }

    .search-card-topline,
    .search-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* --------------------------------------------------
   Executive Briefing Sections
-------------------------------------------------- */

.brief-section-eyebrow {
    margin: 0 0 4px;

    color: #2356dc;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.executive-situation {
    border-left: 5px solid #2356dc;
}

.situation-text {
    max-width: 900px;
    margin: 0;

    color: #2c3c55;
    font-size: 1.08rem;
    line-height: 1.7;
}

.executive-two-column {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.section-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 34px;
    height: 28px;
    padding: 0 9px;

    background: #e7efff;
    border-radius: 999px;

    color: #1947b9;
    font-size: 0.78rem;
    font-weight: 800;
}

.risk-count {
    background: #fff0e8;
    color: #a34114;
}

.executive-item-list {
    display: grid;
    gap: 12px;
}

.executive-item {
    padding: 16px;

    background: #f8faff;
    border: 1px solid #e0e6f0;
    border-radius: 14px;
}

.commitment-item {
    border-left: 4px solid #2356dc;
}

.risk-item {
    background: #fff9f6;
    border-left: 4px solid #d35b28;
}

.executive-item-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.executive-item-heading h3 {
    margin: 0;

    color: #14233d;
    font-size: 1rem;
    line-height: 1.4;
}

.executive-item p {
    margin: 9px 0 0;

    color: #53627a;
    font-size: 0.9rem;
    line-height: 1.5;
}

.executive-item-score {
    flex: 0 0 auto;

    padding: 4px 8px;

    background: #edf2fb;
    border-radius: 999px;

    color: #53627a;
    font-size: 0.73rem;
    font-weight: 750;
}

.executive-item-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;

    margin-top: 12px;
    padding-top: 10px;

    border-top: 1px solid #e8edf5;

    color: #7a8699;
    font-size: 0.76rem;
}

.executive-empty {
    padding: 18px;

    background: #f8faff;
    border: 1px dashed #cad5e6;
    border-radius: 13px;

    color: #718096;
    font-size: 0.88rem;
    text-align: center;
}

.recommendation-list {
    display: grid;
    gap: 11px;

    margin: 0;
    padding: 0;

    list-style: none;
}

.recommendation-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;

    padding: 15px;

    background:
        linear-gradient(
            180deg,
            #f7faff,
            #f1f6ff
        );

    border: 1px solid #dce5f5;
    border-radius: 13px;

    color: #34445d;
    line-height: 1.5;
}

.recommendation-icon {
    display: grid;
    place-items: center;

    width: 28px;
    height: 28px;

    flex: 0 0 auto;

    background: #2356dc;
    border-radius: 50%;

    color: #ffffff;
    font-weight: 800;
}

.timeline-list {
    position: relative;

    display: grid;
    gap: 0;
}

.timeline-list::before {
    position: absolute;
    top: 9px;
    bottom: 9px;
    left: 7px;

    width: 2px;

    background: #dce5f5;

    content: "";
}

.timeline-item {
    position: relative;

    display: grid;
    grid-template-columns: 16px 1fr;
    gap: 16px;

    padding-bottom: 22px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    position: relative;
    z-index: 1;

    width: 16px;
    height: 16px;
    margin-top: 4px;

    background: #2356dc;
    border: 4px solid #e7efff;
    border-radius: 50%;
}

.timeline-content {
    padding: 0 0 2px;
}

.timeline-date {
    margin-bottom: 4px;

    color: #2356dc;
    font-size: 0.76rem;
    font-weight: 750;
}

.timeline-content h3 {
    margin: 0 0 6px;

    color: #14233d;
    font-size: 1rem;
}

.timeline-content p {
    margin: 0 0 10px;

    color: #53627a;
    font-size: 0.9rem;
    line-height: 1.5;
}

@media (max-width: 780px) {
    .executive-two-column {
        grid-template-columns: 1fr;
    }

    .executive-item-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* --------------------------------------------------
   Barnabas Insight
-------------------------------------------------- */

.insight-card {
    position: relative;
    overflow: hidden;

    border: 1px solid #c8d8fb;
    border-left: 5px solid #6d5dfc;

    background:
        radial-gradient(
            circle at top right,
            rgba(109, 93, 252, 0.12),
            transparent 34%
        ),
        linear-gradient(
            180deg,
            #ffffff,
            #f7f8ff
        );
}

.insight-card::after {
    position: absolute;
    top: -48px;
    right: -40px;

    width: 150px;
    height: 150px;

    border-radius: 50%;
    background:
        rgba(109, 93, 252, 0.08);

    content: "";
}

.insight-header {
    position: relative;
    z-index: 1;

    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;

    margin-bottom: 18px;
    padding-bottom: 14px;

    border-bottom: 1px solid #e6e8f5;
}

.insight-header h2 {
    margin: 0;

    color: #17233f;
    font-size: 1.35rem;
}

.insight-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.insight-confidence,
.insight-provider {
    display: inline-flex;
    align-items: center;

    padding: 5px 9px;

    border-radius: 999px;

    font-size: 0.75rem;
    font-weight: 750;
}

.insight-confidence {
    background: #e9f7ee;
    color: #287348;
}

.insight-provider {
    background: #eceaff;
    color: #5747c5;
}

.insight-summary {
    position: relative;
    z-index: 1;

    margin: 0;

    border: 0;

    color: #2a3752;
    font-size: 1.08rem;
    font-style: normal;
    line-height: 1.75;
}

.insight-recommendations {
    position: relative;
    z-index: 1;

    margin-top: 22px;
    padding: 16px;

    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #e2e5f2;
    border-radius: 13px;
}

.insight-recommendations h3 {
    margin: 0 0 10px;

    color: #27344f;
    font-size: 0.95rem;
}

.insight-recommendations ul {
    display: grid;
    gap: 8px;

    margin: 0;
    padding-left: 20px;

    color: #536078;
    line-height: 1.5;
}

.insight-footer {
    position: relative;
    z-index: 1;

    display: flex;
    justify-content: space-between;
    gap: 12px;

    margin-top: 20px;
    padding-top: 12px;

    border-top: 1px solid #e6e8f5;

    color: #7a8498;
    font-size: 0.76rem;
}

@media (max-width: 650px) {
    .insight-header,
    .insight-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .insight-meta {
        justify-content: flex-start;
    }
}


/* --------------------------------------------------
   Barnabas OS Entity Brief
-------------------------------------------------- */

.brief-page {
    width: min(1080px, calc(100% - 32px));
    margin: 30px auto 70px;
}

.brief-nav {
    display: flex;
    gap: 20px;
    margin-bottom: 18px;
}

.brief-nav a {
    color: #53627a;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
}

.brief-nav a:hover {
    color: #2356dc;
}

.brief-page-header {
    margin-bottom: 18px;
}

.brief-content {
    display: grid;
    gap: 24px;
}

.brief-hero {
    padding: 34px;

    background:
        radial-gradient(
            circle at top right,
            rgba(255, 255, 255, 0.18),
            transparent 34%
        ),
        linear-gradient(
            135deg,
            #0f2346,
            #2558db
        );

    border-radius: 24px;

    box-shadow:
        0 18px 42px
        rgba(16, 38, 74, 0.22);

    color: #ffffff;
}

.brief-hero-content {
    display: flex;
    align-items: center;
    gap: 22px;
}

.brief-entity-avatar {
    display: grid;
    place-items: center;

    width: 82px;
    height: 82px;

    flex: 0 0 auto;

    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 22px;

    font-size: 2.2rem;

    backdrop-filter: blur(8px);
}

.brief-hero h1 {
    margin: 5px 0 9px;

    font-size: clamp(
        2.1rem,
        5vw,
        3.6rem
    );

    line-height: 1.05;
}

.brief-eyebrow {
    margin: 0;

    color: #dce7ff;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.brief-description {
    max-width: 700px;
    margin: 0;

    color: #e8eeff;
    font-size: 1rem;
    line-height: 1.55;
}

.brief-stat-grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.brief-stat-card {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 12px;
    row-gap: 3px;
    align-items: center;

    min-height: 112px;
    padding: 18px;

    background: #ffffff;
    border: 1px solid #dce3ef;
    border-radius: 17px;

    box-shadow:
        0 5px 16px
        rgba(25, 40, 75, 0.06);
}

.brief-stat-icon {
    grid-row: 1 / 3;

    display: grid;
    place-items: center;

    width: 42px;
    height: 42px;

    background: #eef3ff;
    border-radius: 12px;

    font-size: 1.2rem;
}

.brief-stat-card strong {
    color: #14233d;
    font-size: 1.28rem;
    line-height: 1.2;
}

.brief-stat-card span:last-child {
    color: #718096;
    font-size: 0.8rem;
}

.brief-section {
    padding: 26px;

    background: #ffffff;
    border: 1px solid #dce3ef;
    border-radius: 20px;

    box-shadow:
        0 7px 22px
        rgba(25, 40, 75, 0.06);
}

.brief-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;

    margin-bottom: 18px;
    padding-bottom: 14px;

    border-bottom: 1px solid #edf0f5;
}

.brief-section-heading h2 {
    margin: 0;

    color: #14233d;
    font-size: 1.3rem;
}

.brief-section-heading p {
    max-width: 520px;
    margin: 0;

    color: #718096;
    font-size: 0.88rem;
    line-height: 1.45;
}

.brief-memory-list {
    display: grid;
    gap: 14px;
}

.brief-memory-card {
    padding: 19px;

    background:
        linear-gradient(
            180deg,
            #fbfcff,
            #f6f9ff
        );

    border: 1px solid #e0e6f0;
    border-radius: 15px;

    transition:
        transform 150ms ease,
        box-shadow 150ms ease,
        border-color 150ms ease;
}

.brief-memory-card:hover {
    border-color: #b9c8e4;

    box-shadow:
        0 9px 20px
        rgba(25, 40, 75, 0.08);

    transform: translateY(-1px);
}

.brief-related-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.brief-related-entity {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;

    padding: 17px;

    background:
        linear-gradient(
            180deg,
            #f9fbff,
            #f3f7ff
        );

    border: 1px solid #dce5f5;
    border-radius: 14px;

    color: #14233d;
    font: inherit;
    text-align: left;

    cursor: pointer;

    transition:
        transform 150ms ease,
        border-color 150ms ease,
        box-shadow 150ms ease;
}

.brief-related-entity:hover {
    border-color: #9eb6e8;

    box-shadow:
        0 8px 18px
        rgba(35, 86, 220, 0.1);

    transform: translateY(-2px);
}

.brief-related-entity strong {
    font-size: 0.98rem;
}

.brief-related-entity span {
    color: #718096;
    font-size: 0.8rem;
}

@media (max-width: 820px) {
    .brief-stat-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 650px) {
    .brief-page {
        width: min(100% - 20px, 1080px);
        margin-top: 16px;
    }

    .brief-hero {
        padding: 22px;
    }

    .brief-hero-content {
        align-items: flex-start;
        flex-direction: column;
    }

    .brief-stat-grid,
    .brief-related-grid {
        grid-template-columns: 1fr;
    }

    .brief-section {
        padding: 20px;
    }

    .brief-section-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }
}

/* =========================================================
   Barnabas Executive Dashboard
   ========================================================= */

.dashboard-body {
    padding: 0;
    background: #eef2f7;
}

.dashboard-page {
    width: min(1380px, 100%);
    min-height: 100vh;
    margin: 0 auto;
    padding: 0 28px 48px;
}

.dashboard-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 72px;
    border-bottom: 1px solid #dbe2ea;
}

.dashboard-brand {
    color: #172033;
    font-size: 1.08rem;
    font-weight: 850;
    text-decoration: none;
}

.dashboard-nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dashboard-nav-links a {
    padding: 9px 13px;
    border-radius: 9px;
    color: #596579;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
}

.dashboard-nav-links a:hover,
.dashboard-nav-links a.active {
    background: #ffffff;
    color: #1d4ed8;
}

.dashboard-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    padding: 42px 0 28px;
}

.dashboard-header h1 {
    margin-bottom: 8px;
    font-size: clamp(2rem, 5vw, 3.2rem);
    letter-spacing: -0.04em;
}

.dashboard-eyebrow,
.dashboard-panel-eyebrow,
.executive-status-label {
    margin-bottom: 8px;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 850;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.dashboard-subtitle {
    margin: 0;
    color: #64748b;
    font-size: 1.03rem;
}

.dashboard-refresh {
    flex: 0 0 auto;
    margin: 0;
}

.dashboard-message {
    padding: 42px;
    border: 1px solid #dbe2ea;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.06);
    text-align: center;
}

.dashboard-message h2 {
    margin-bottom: 10px;
}

.dashboard-message p {
    max-width: 620px;
    margin: 0 auto;
    color: #64748b;
    line-height: 1.6;
}

.dashboard-message button {
    margin-top: 20px;
}

.dashboard-error {
    border-color: #fecaca;
    background: #fff7f7;
}

.dashboard-primary-link {
    display: inline-block;
    margin-top: 22px;
    padding: 12px 18px;
    border-radius: 10px;
    background: #1d4ed8;
    color: #ffffff;
    font-weight: 800;
    text-decoration: none;
}

.executive-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    padding: 26px 28px;
    border: 1px solid #dbe2ea;
    border-left: 6px solid #64748b;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.executive-status.status-stable {
    border-left-color: #16844b;
}

.executive-status.status-attention {
    border-left-color: #d97706;
}

.executive-status.status-high_attention {
    border-left-color: #c2410c;
}

.executive-status.status-critical {
    border-left-color: #b42318;
}

.executive-status-heading {
    display: flex;
    align-items: center;
    gap: 12px;
}

.executive-status-heading h2 {
    margin: 0;
}

.executive-status p:last-child {
    margin: 8px 0 0;
    color: #64748b;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: #64748b;
    box-shadow: 0 0 0 6px rgba(100, 116, 139, 0.12);
}

.status-indicator.status-stable {
    background: #16844b;
    box-shadow: 0 0 0 6px rgba(22, 132, 75, 0.12);
}

.status-indicator.status-attention {
    background: #d97706;
    box-shadow: 0 0 0 6px rgba(217, 119, 6, 0.13);
}

.status-indicator.status-high_attention {
    background: #c2410c;
    box-shadow: 0 0 0 6px rgba(194, 65, 12, 0.13);
}

.status-indicator.status-critical {
    background: #b42318;
    box-shadow: 0 0 0 6px rgba(180, 35, 24, 0.13);
}

.status-updated {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    color: #64748b;
    font-size: 0.78rem;
}

.status-updated strong {
    color: #334155;
    font-size: 0.88rem;
}

.dashboard-metric-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    margin: 18px 0;
}

.dashboard-metric-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 19px;
    border: 1px solid #dbe2ea;
    border-radius: 15px;
    background: #ffffff;
}

.dashboard-metric-card strong {
    color: #172033;
    font-size: 1.65rem;
}

.dashboard-metric-card span {
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 750;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(320px, 0.8fr);
    gap: 18px;
}

.dashboard-main-column,
.dashboard-side-column {
    display: grid;
    align-content: start;
    gap: 18px;
}

.dashboard-panel {
    padding: 24px;
    border: 1px solid #dbe2ea;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.045);
}

.dashboard-panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.dashboard-panel-heading h2 {
    margin: 0;
}

.dashboard-card-list,
.dashboard-action-list,
.dashboard-entity-list {
    display: grid;
    gap: 12px;
}

.executive-item-card {
    padding: 17px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
}

.executive-item-topline {
    display: flex;
    align-items: flex-start;
    gap: 13px;
}

.executive-item-number,
.dashboard-action-number {
    display: grid;
    flex: 0 0 auto;
    width: 29px;
    height: 29px;
    place-items: center;
    border-radius: 9px;
    background: #e0e7ff;
    color: #3730a3;
    font-size: 0.78rem;
    font-weight: 850;
}

.executive-item-content {
    min-width: 0;
    width: 100%;
}

.executive-item-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.executive-item-heading h3,
.dashboard-action-card h3 {
    margin: 2px 0 0;
    font-size: 0.98rem;
    line-height: 1.4;
}

.executive-item-detail,
.executive-item-source,
.dashboard-action-card p {
    margin: 8px 0 0;
    color: #64748b;
    font-size: 0.86rem;
    line-height: 1.5;
}

.executive-item-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 14px;
    margin-top: 12px;
    color: #7c8797;
    font-size: 0.74rem;
}

.severity-badge {
    flex: 0 0 auto;
    padding: 5px 8px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #475569;
    font-size: 0.7rem;
    font-weight: 850;
}

.severity-badge.severity-critical {
    background: #fee2e2;
    color: #b42318;
}

.severity-badge.severity-high {
    background: #ffedd5;
    color: #c2410c;
}

.severity-badge.severity-medium {
    background: #fef3c7;
    color: #92400e;
}

.severity-badge.severity-low {
    background: #dcfce7;
    color: #166534;
}

.dashboard-action-card {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 16px;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    background: #f5f8ff;
}

.dashboard-entity-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    color: inherit;
    text-decoration: none;
    transition: 0.18s ease;
}

.dashboard-entity-card:hover {
    transform: translateY(-1px);
    border-color: #bfdbfe;
    background: #ffffff;
    box-shadow: 0 7px 18px rgba(15, 23, 42, 0.07);
}

.dashboard-entity-card div {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
}

.dashboard-entity-card strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-entity-card span {
    color: #64748b;
    font-size: 0.76rem;
}

.dashboard-entity-score {
    display: grid;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 10px;
    background: #e0e7ff;
    color: #3730a3 !important;
    font-size: 0.78rem !important;
    font-weight: 850;
}

.dashboard-list-empty {
    padding: 18px;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    color: #64748b;
    font-size: 0.86rem;
    text-align: center;
}

@media (max-width: 980px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }

    .dashboard-metric-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .dashboard-page {
        padding: 0 16px 32px;
    }

    .dashboard-nav,
    .dashboard-header,
    .executive-status {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-nav {
        justify-content: center;
        padding: 16px 0;
    }

    .dashboard-nav-links {
        width: 100%;
    }

    .dashboard-nav-links a {
        flex: 1;
        text-align: center;
    }

    .dashboard-header {
        padding: 28px 0 22px;
    }

    .dashboard-refresh {
        width: 100%;
    }

    .status-updated {
        align-items: flex-start;
    }

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

    .dashboard-panel {
        padding: 18px;
    }

    .executive-item-heading {
        flex-direction: column;
    }
}

.home-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 22px 0;
}

.home-links a {
    padding: 10px 14px;
    border: 1px solid #dbe2ea;
    border-radius: 10px;
    background: #f8fafc;
    color: #1d4ed8;
    font-weight: 750;
    text-decoration: none;
}

.home-links a:hover {
    border-color: #bfdbfe;
    background: #eff6ff;
}


/* =========================================================
   Daily Executive Summary
   ========================================================= */

.daily-summary-panel {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 18px;
    padding: 28px;
    border: 1px solid #cbd5e1;
    border-radius: 18px;
    background:
        linear-gradient(
            135deg,
            #ffffff 0%,
            #f7f9ff 100%
        );
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.055);
}

.daily-summary-icon {
    display: grid;
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 14px;
    background: #1d4ed8;
    color: #ffffff;
    font-size: 1.15rem;
    font-weight: 900;
}

.daily-summary-content {
    min-width: 0;
}

.daily-summary-content h2 {
    margin-bottom: 10px;
    font-size: clamp(1.25rem, 3vw, 1.65rem);
    line-height: 1.35;
}

.daily-summary-content > p:last-of-type {
    max-width: 1000px;
    margin: 0;
    color: #56657a;
    font-size: 0.98rem;
    line-height: 1.65;
}

.summary-first-action {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 10px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #dbe2ea;
}

.summary-first-action span {
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 850;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.summary-first-action strong {
    color: #172033;
    font-size: 0.92rem;
}

@media (max-width: 700px) {
    .daily-summary-panel {
        flex-direction: column;
        padding: 22px;
    }
}

.engineering-page {
    width: min(560px, 100%);
}

.engineering-load-row {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.engineering-load-row input {
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font: inherit;
}

.engineering-load-row button {
    margin-top: 0;
}

.engineering-run-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.engineering-run-header h2 {
    margin-bottom: 0;
}

.engineering-awaiting-banner {
    display: inline-block;
    margin: 4px 0 20px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-weight: 700;
    font-size: 0.85rem;
}

.engineering-identity {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 0 0 24px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.engineering-identity dt {
    margin: 0 0 4px;
    color: #7c8797;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.engineering-identity dd {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.engineering-decision-panel textarea {
    min-height: 90px;
    margin: 10px 0 0;
}

.engineering-decision-panel label {
    display: block;
    margin-top: 20px;
    font-weight: 700;
}

.engineering-secondary-button {
    background: #ffffff;
    color: #b42318;
    border: 1px solid #fca5a5;
}

.engineering-secondary-button:hover {
    background: #fef2f2;
}

@media (max-width: 480px) {
    .engineering-identity {
        grid-template-columns: 1fr;
    }
}
