:root {
    --navy: #0b2946;
    --navy-light: #123b60;
    --blue: #14568a;
    --gold: #c99a2e;
    --red: #a71930;
    --ink: #18232d;
    --muted: #576675;
    --line: #d7e0e7;
    --canvas: #f2f5f7;
    --surface: #fff;
    --focus: #ffbf47;
    --radius: .4rem;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); line-height: 1.55; }
a { color: var(--blue); text-underline-offset: .15em; }
button, input, textarea, select { font: inherit; }
:focus-visible { outline: .22rem solid var(--focus); outline-offset: .15rem; }
.sr-only { position: absolute!important; width: 1px!important; height: 1px!important; padding: 0!important; margin: -1px!important; overflow: hidden!important; clip: rect(0,0,0,0)!important; white-space: nowrap!important; border: 0!important; }
.skip-link { position: fixed; z-index: 1000; top: .5rem; left: 1rem; transform: translateY(-200%); color: #000; background: var(--focus); padding: .7rem 1rem; font-weight: 800; }
.skip-link:focus { transform: none; }
.admin-header { min-height: 4.6rem; display: flex; align-items: center; gap: 1rem; padding: .75rem 1.5rem; color: #fff; background: var(--navy); border-bottom: .28rem solid var(--gold); }
.admin-brand { display: flex; align-items: center; gap: .8rem; margin-right: auto; }
.admin-brand span, .login-brand span, .installer__brand span { display: grid; place-items: center; width: 3.25rem; height: 2.8rem; color: #111; background: #fff; border: .25rem solid #111; box-shadow: inset .65rem 0 0 var(--red); padding-left: .3rem; font-weight: 900; }
.admin-account { display: flex; align-items: center; gap: 1rem; font-size: .9rem; }
.admin-account form { margin: 0; }
.link-button { color: #fff; background: transparent; border: 0; padding: .35rem; text-decoration: underline; cursor: pointer; }
.admin-menu-toggle { display: none; color: #fff; background: transparent; border: 1px solid #fff; padding: .45rem .8rem; font-weight: 700; }
.admin-layout { min-height: calc(100vh - 4.6rem); display: grid; grid-template-columns: 15.5rem 1fr; }
.admin-nav { color: #fff; background: #071a2d; padding: 1.25rem .8rem; }
.admin-nav ul { list-style: none; padding: 0; margin: 0; }
.admin-nav a { display: block; color: #fff; padding: .7rem .8rem; border-left: .25rem solid transparent; text-decoration: none; font-weight: 700; }
.admin-nav a:hover { background: var(--navy-light); }
.admin-nav a[aria-current="page"] { color: #111; background: #fff; border-left-color: var(--gold); }
.admin-nav .view-site { margin-top: 2rem; border: 1px solid rgba(255,255,255,.5); }
.admin-main { min-width: 0; max-width: 98rem; padding: clamp(1rem, 3vw, 2.2rem); }
.admin-page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem; margin-bottom: 1.6rem; }
.admin-page-heading h1 { margin: .1rem 0 .2rem; color: var(--navy); font-family: Georgia, 'Times New Roman', serif; font-size: clamp(1.8rem, 3vw, 2.5rem); line-height: 1.15; }
.admin-page-heading p { margin: .25rem 0 0; color: var(--muted); }
.eyebrow { color: var(--red)!important; font-size: .78rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.button, .secondary-button { min-height: 2.8rem; display: inline-flex; align-items: center; justify-content: center; border-radius: .25rem; padding: .55rem 1rem; font-weight: 800; text-decoration: none; cursor: pointer; }
.button { color: #fff; background: var(--navy); border: 2px solid var(--navy); }
.button:hover { background: var(--navy-light); }
.secondary-button { color: var(--navy); background: #fff; border: 2px solid var(--navy); }
.button--full { width: 100%; margin-top: .7rem; }
.panel { margin-bottom: 1.4rem; padding: 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(7,26,45,.05); }
.panel h2 { margin-top: 0; color: var(--navy); font-family: Georgia, 'Times New Roman', serif; }
.panel__heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { padding: 1.15rem; background: #fff; border: 1px solid var(--line); border-top: .28rem solid var(--gold); }
.stat-card strong, .stat-card span { display: block; }
.stat-card strong { color: var(--navy); font-size: 2rem; line-height: 1.1; }
.stat-card span { margin-top: .35rem; color: var(--muted); }
.table-wrap { max-width: 100%; overflow-x: auto; }
table { width: 100%; min-width: 44rem; border-collapse: collapse; }
th { color: #fff; background: var(--navy); text-align: left; }
th, td { padding: .72rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
td small { display: block; color: var(--muted); margin-top: .2rem; }
.status { display: inline-block; border-radius: 99rem; padding: .2rem .6rem; font-size: .82rem; font-weight: 800; }
.status--published { color: #075d31; background: #d9f6e7; }
.status--draft { color: #654800; background: #fff0bd; }
.status--archived { color: #4e5964; background: #e9edf0; }
.admin-note { margin-bottom: 1.4rem; padding: 1rem 1.2rem; color: #3a2b00; background: #fff4cf; border-left: .35rem solid var(--gold); }
.admin-note h2 { margin: 0 0 .35rem; font-size: 1.05rem; }
.admin-note p { margin: 0; }
.filter-tabs { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1rem; }
.filter-tabs a { padding: .5rem .8rem; color: var(--navy); background: #fff; border: 1px solid var(--line); border-radius: .25rem; text-decoration: none; font-weight: 700; }
.filter-tabs a[aria-current="page"] { color: #fff; background: var(--navy); border-color: var(--navy); }
.alert { margin-bottom: 1.2rem; padding: .85rem 1rem; border-left: .35rem solid; background: #fff; }
.alert h2 { margin: 0 0 .35rem; font-size: 1.1rem; }
.alert ul { margin: .3rem 0; }
.alert--success { color: #064e2c; background: #e5f8ee; border-color: #087a45; }
.alert--error { color: #761326; background: #fff0f2; border-color: var(--red); }
.alert--info { color: #123b60; background: #eaf5fc; border-color: var(--blue); }
.form-panel label, .stack-form label { display: block; margin: .85rem 0 .28rem; font-weight: 800; }
input, textarea, select { width: 100%; color: var(--ink); background: #fff; border: 2px solid #8998a5; border-radius: .25rem; padding: .6rem .7rem; }
textarea { line-height: 1.5; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); }
.field-help { margin: .3rem 0 .8rem; color: var(--muted); font-size: .88rem; }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(17rem, 22rem); gap: 1.4rem; align-items: start; }
.editor-side { position: sticky; top: 1rem; }
.editor-toolbar { display: flex; flex-wrap: wrap; gap: .45rem; margin: .35rem 0 0; padding: .55rem; background: #eaf0f4; border: 2px solid #8998a5; border-bottom: 0; border-radius: .25rem .25rem 0 0; }
.editor-toolbar[hidden], .wysiwyg-editor[hidden], .wysiwyg-source[hidden], .editor-error[hidden] { display: none; }
.editor-toolbar__group { display: flex; flex-wrap: wrap; gap: .3rem; padding-right: .45rem; border-right: 1px solid #b8c4cd; }
.editor-toolbar__group:last-child { padding-right: 0; border-right: 0; }
.editor-toolbar button { min-height: 2.5rem; color: var(--navy); background: #fff; border: 1px solid #768896; border-radius: .2rem; padding: .4rem .65rem; cursor: pointer; }
.editor-toolbar button:hover, .editor-toolbar button[aria-pressed="true"] { color: #fff; background: var(--navy-light); border-color: var(--navy-light); }
.text-strike, .wysiwyg-editor del { text-decoration: line-through; }
.wysiwyg-editor { width: 100%; min-height: 23rem; max-height: 65vh; overflow-y: auto; color: var(--ink); background: #fff; border: 2px solid #8998a5; border-radius: 0 0 .25rem .25rem; padding: 1rem; line-height: 1.65; }
.wysiwyg-editor:focus { border-color: var(--blue); }
.wysiwyg-editor:empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }
.wysiwyg-editor p, .wysiwyg-editor ul, .wysiwyg-editor ol, .wysiwyg-editor blockquote { margin: 0 0 1rem; }
.wysiwyg-editor h2, .wysiwyg-editor h3 { color: var(--navy); font-family: Georgia, 'Times New Roman', serif; line-height: 1.25; }
.wysiwyg-editor h2 { margin: 1.5rem 0 .65rem; font-size: 1.65rem; }
.wysiwyg-editor h3 { margin: 1.25rem 0 .55rem; font-size: 1.35rem; }
.wysiwyg-editor blockquote { padding: .55rem 1rem; background: #eef5fa; border-left: .3rem solid var(--gold); }
.wysiwyg-editor a { overflow-wrap: anywhere; }
.wysiwyg-editor[aria-invalid="true"] { border-color: var(--red); }
.editor-error { margin: .45rem 0 0; color: #761326; font-weight: 700; }
.wysiwyg-source { border-radius: .25rem; font-family: Arial, Helvetica, sans-serif; }
.admin-attachment-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.admin-attachment-list li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .65rem 0; border-bottom: 1px solid var(--line); }
.admin-attachment-list span { display: block; color: var(--muted); font-size: .85rem; }
.danger-link { color: #8b0f25; background: transparent; border: 0; padding: .35rem; text-decoration: underline; cursor: pointer; }
.hidden-form { display: none; }
.settings-form { max-width: 48rem; }
.settings-form hr { margin-block: 1.6rem; border: 0; border-top: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: 2fr 1fr; gap: .7rem; }
.stack-form fieldset { margin: 1rem 0; padding: 1rem; border: 1px solid var(--line); }
.stack-form legend { color: var(--navy); font-weight: 800; }
.login-body, .installer-body { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: linear-gradient(135deg, #071a2d, #123b60); }
.login-card, .installer { width: min(100%, 31rem); padding: clamp(1.4rem, 5vw, 2.2rem); background: #fff; border-top: .4rem solid var(--gold); box-shadow: 0 18px 60px rgba(0,0,0,.28); }
.installer { width: min(100%, 48rem); margin-block: 2rem; }
.login-card h1, .installer h1 { margin: .25rem 0 1rem; color: var(--navy); font-family: Georgia, 'Times New Roman', serif; font-size: 2rem; }
.login-brand, .installer__brand { margin-bottom: 1rem; }
.login-card .button, .installer .button { width: 100%; margin-top: 1rem; }
.login-back { margin: 1.2rem 0 0; text-align: center; }

@media (max-width: 65rem) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .editor-layout { grid-template-columns: 1fr; }
    .editor-side { position: static; }
}
@media (max-width: 48rem) {
    .admin-header { flex-wrap: wrap; padding-inline: 1rem; }
    .admin-menu-toggle { display: block; }
    .admin-account { width: 100%; justify-content: space-between; }
    .admin-layout { grid-template-columns: 1fr; }
    .admin-nav { display: none; }
    .admin-nav.is-open { display: block; }
    .admin-page-heading { align-items: stretch; flex-direction: column; }
    .admin-page-heading .button, .admin-page-heading .secondary-button { width: 100%; }
}
@media (max-width: 32rem) {
    .stat-grid, .form-grid { grid-template-columns: 1fr; }
    .admin-account { display: block; }
    .admin-account span { display: block; margin-bottom: .3rem; }
    .editor-toolbar__group { width: 100%; padding: 0 0 .4rem; border-right: 0; border-bottom: 1px solid #b8c4cd; }
    .editor-toolbar__group:last-child { padding-bottom: 0; border-bottom: 0; }
    .editor-toolbar button { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms!important; transition-duration: .01ms!important; } }
