:root {
    --navy: #01214f;
    --blue: #01a3fc;
    --ink: #152234;
    --muted: #617084;
    --line: #dbe3ec;
    --surface: #ffffff;
    --page: #f5f8fb;
    --success-bg: #edf9f1;
    --success-border: #9edbb1;
    --error-bg: #fff1f1;
    --error-border: #f0aaaa;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--page);
    line-height: 1.55;
}

a { color: inherit; }

.wrap {
    width: min(1120px, calc(100% - 36px));
    margin: 0 auto;
}

.site-header {
    background: var(--navy);
    color: #fff;
    border-bottom: 3px solid var(--blue);
}

.header-inner {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    flex-direction: column;
    text-decoration: none;
    font-weight: 800;
    letter-spacing: .04em;
}

.brand small {
    color: var(--blue);
    font-size: .72rem;
    letter-spacing: .18em;
}

nav {
    display: flex;
    gap: 20px;
}

nav a {
    text-decoration: none;
    font-weight: 600;
}

.hero {
    padding: 64px 0 30px;
    max-width: 820px;
}

.hero.compact { padding-bottom: 18px; }

.eyebrow, .category {
    color: var(--blue);
    text-transform: uppercase;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .12em;
    margin: 0 0 8px;
}

h1 {
    margin: 0;
    color: var(--navy);
    font-size: clamp(2.1rem, 5vw, 4rem);
    line-height: 1.03;
}

h2, h3 {
    color: var(--navy);
    margin-top: 0;
}

.lead {
    color: var(--muted);
    font-size: 1.15rem;
    max-width: 680px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 8px 25px rgba(1, 33, 79, .05);
}

.access-card {
    padding: 28px;
    margin-bottom: 42px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

label {
    display: grid;
    gap: 7px;
    font-size: .92rem;
    font-weight: 700;
}

input {
    width: 100%;
    min-height: 46px;
    border: 1px solid #b8c4d1;
    border-radius: 8px;
    padding: 10px 12px;
    font: inherit;
}

input:focus {
    outline: 3px solid rgba(1, 163, 252, .18);
    border-color: var(--blue);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 17px;
    border: 0;
    border-radius: 8px;
    background: var(--navy);
    color: #fff;
    text-decoration: none;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.button:hover { filter: brightness(1.08); }

.button.secondary {
    background: var(--blue);
    color: #001d3d;
}

.privacy-note, .meta, .section-heading p {
    color: var(--muted);
    font-size: .9rem;
}

.honeypot {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

.notice {
    border: 1px solid;
    border-radius: 10px;
    padding: 14px 16px;
    margin: 0 0 24px;
}

.notice.success {
    background: var(--success-bg);
    border-color: var(--success-border);
}

.notice.error {
    background: var(--error-bg);
    border-color: var(--error-border);
}

.library {
    padding: 12px 0 64px;
}

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

.document-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.document-card {
    padding: 23px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 300px;
    gap: 20px;
}

.site-footer {
    background: var(--navy);
    color: #d8e1eb;
    padding: 28px 0;
    font-size: .88rem;
}

@media (max-width: 850px) {
    .form-grid, .document-grid {
        grid-template-columns: 1fr;
    }

    .header-inner {
        align-items: flex-start;
        flex-direction: column;
        padding: 18px 0;
    }
}

/* V2 Search / Sort additions */
/* Add these rules to the end of assets/style.css */
.library-toolbar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(190px, 240px) auto auto;
    gap: 14px;
    align-items: end;
    padding: 18px;
    margin: 0 0 24px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 14px;
}

.library-toolbar label {
    margin: 0;
}

.library-toolbar select {
    width: 100%;
    min-height: 46px;
    border: 1px solid #b8c4d1;
    border-radius: 8px;
    padding: 10px 12px;
    background: #ffffff;
    color: var(--ink);
    font: inherit;
}

.library-toolbar select:focus {
    outline: 3px solid rgba(1, 163, 252, .18);
    border-color: var(--blue);
}

.format-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.format-button {
    min-width: 92px;
}

.button.tertiary {
    background: #ffffff;
    color: var(--navy);
    border: 1px solid #b8c4d1;
}

.unavailable {
    color: var(--muted);
    font-size: .88rem;
}

.empty-state {
    padding: 28px;
}

@media (max-width: 850px) {
    .library-toolbar {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
}

/* V3 Multi-format / Viewer additions */
/* Append these rules to the END of the existing assets/style.css */

.format-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 16px;
}

.format-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 3px 9px;
    border: 1px solid #cbd7e3;
    border-radius: 999px;
    background: #f7fafc;
    color: var(--muted);
    font-size: .76rem;
    font-weight: 700;
}

.view-button {
    background: var(--navy);
    color: #fff;
}

.viewer-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 18px;
}

.document-viewer {
    overflow: hidden;
    min-height: 520px;
    margin-bottom: 64px;
}

.viewer-frame {
    display: block;
    width: 100%;
    min-height: 760px;
    border: 0;
    background: #fff;
}

.powerbi-frame {
    min-height: 78vh;
}

.viewer-message {
    padding: 36px;
}

.text-render {
    margin: 0;
    padding: 28px;
    min-height: 520px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    background: #fff;
    color: var(--ink);
    font: 0.95rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.table-scroll {
    overflow: auto;
    max-height: 78vh;
}

.rendered-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: .9rem;
}

.rendered-table th,
.rendered-table td {
    padding: 10px 12px;
    border: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.rendered-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #eef4f8;
    color: var(--navy);
}

.viewer-note {
    padding: 12px 18px;
    margin: 0;
    color: var(--muted);
    font-size: .85rem;
    border-top: 1px solid var(--line);
}

@media (max-width: 850px) {
    .viewer-frame {
        min-height: 620px;
    }

    .document-viewer {
        min-height: 420px;
    }
}
/* Append these rules to the END of the existing assets/style.css */

.format-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 16px;
}

.format-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 3px 9px;
    border: 1px solid #cbd7e3;
    border-radius: 999px;
    background: #f7fafc;
    color: var(--muted);
    font-size: .76rem;
    font-weight: 700;
}

.view-button {
    background: var(--navy);
    color: #fff;
}

.viewer-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 18px;
}

.document-viewer {
    overflow: hidden;
    min-height: 520px;
    margin-bottom: 64px;
}

.viewer-frame {
    display: block;
    width: 100%;
    min-height: 760px;
    border: 0;
    background: #fff;
}

.powerbi-frame {
    min-height: 78vh;
}

.viewer-message {
    padding: 36px;
}

.text-render {
    margin: 0;
    padding: 28px;
    min-height: 520px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    background: #fff;
    color: var(--ink);
    font: 0.95rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.table-scroll {
    overflow: auto;
    max-height: 78vh;
}

.rendered-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: .9rem;
}

.rendered-table th,
.rendered-table td {
    padding: 10px 12px;
    border: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.rendered-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #eef4f8;
    color: var(--navy);
}

.viewer-note {
    padding: 12px 18px;
    margin: 0;
    color: var(--muted);
    font-size: .85rem;
    border-top: 1px solid var(--line);
}

@media (max-width: 850px) {
    .viewer-frame {
        min-height: 620px;
    }

    .document-viewer {
        min-height: 420px;
    }
}
