:root {
    --ink: #15191f;
    --ink-2: #2d3640;
    --muted: #66717d;
    --line: #dce4ea;
    --soft: #f4f7f9;
    --panel: #ffffff;
    --brand: #0f6b70;
    --brand-dark: #0a464a;
    --accent: #d99a22;
    --red: #a93532;
    --shadow: 0 16px 42px rgba(18, 31, 43, .10);
    --font-main: 'Lato', Arial, Helvetica, sans-serif;
}

@font-face {
    font-family: 'Lato';
    src: url('/assets/fonts/Lato-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Lato';
    src: url('/assets/fonts/Lato-Italic.ttf') format('truetype');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Lato';
    src: url('/assets/fonts/Lato-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Lato';
    src: url('/assets/fonts/Lato-Black.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    background:
        linear-gradient(180deg, #edf4f4 0, var(--soft) 300px),
        var(--soft);
    color: var(--ink);
    font-family: var(--font-main);
    line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font-family: var(--font-main); }
:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}
.skip-link {
    position: fixed;
    left: 16px;
    top: 16px;
    z-index: 100;
    transform: translateY(-140%);
    background: #000;
    color: #fff;
    padding: 12px 16px;
    font-weight: 900;
}
.skip-link:focus {
    transform: translateY(0);
}
.admin-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 28px;
    background: rgba(21, 25, 31, .96);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(12px);
}
.admin-brand {
    font-family: var(--font-main);
    font-size: 24px;
    font-weight: 800;
}
.admin-head nav {
    display: flex;
    align-items: center;
    gap: 14px;
}
.admin-head a {
    color: #eaf0f3;
    font-weight: 800;
}
.admin-head form { margin: 0; }
.admin-head button,
.button,
.editor button,
.login-box button {
    border: 0;
    background: var(--brand);
    color: #fff;
    padding: 11px 15px;
    font-weight: 800;
    cursor: pointer;
}
.admin-head button {
    background: transparent;
    border: 1px solid rgba(255,255,255,.35);
}
.admin-head button:hover,
.button:hover,
.editor button:hover,
.login-box button:hover { background: var(--brand-dark); }
.admin-main {
    width: min(1180px, calc(100% - 32px));
    margin: 30px auto 64px;
}
.panel-title {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 18px;
    margin-bottom: 20px;
}
.panel-title h1 {
    margin: 0;
    font-family: var(--font-main);
    font-size: 42px;
    line-height: 1;
}
.panel-title p {
    margin: 6px 0 0;
    color: var(--muted);
}
.button--muted { background: #47515c; }
.table-card,
.login-box,
.editor__main,
.editor__side {
    background: var(--panel);
    border: 1px solid rgba(220, 228, 234, .9);
    box-shadow: var(--shadow);
}
.table-card { padding: 8px 20px 20px; }
table {
    width: 100%;
    border-collapse: collapse;
}
th {
    text-align: left;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}
td, th {
    border-bottom: 1px solid var(--line);
    padding: 16px 10px;
    vertical-align: top;
}
tbody tr:hover { background: #f9fbfc; }
.pill,
.status {
    display: inline-block;
    margin-left: 8px;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: 900;
    background: #e9f4f5;
    color: var(--brand);
}
.status--draft {
    background: #f8ebd5;
    color: #8a5a0a;
}
.status--published {
    background: #e3f2e8;
    color: #24733f;
}
.row-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}
.row-actions a {
    color: var(--brand);
    font-weight: 800;
}
.row-actions form { margin: 0; }
.row-actions button {
    border: 0;
    color: var(--red);
    background: transparent;
    cursor: pointer;
    padding: 0;
    font-weight: 800;
}
.login-box {
    width: min(450px, 100%);
    margin: 82px auto;
    padding: 26px;
}
.login-box h1 {
    margin: 0 0 18px;
    font-family: var(--font-main);
    font-size: 34px;
}
.alert {
    background: #fde8e8;
    color: #8f1d1d;
    padding: 10px 12px;
    border-left: 4px solid var(--red);
}
label {
    display: grid;
    gap: 7px;
    margin-bottom: 15px;
    font-weight: 800;
}
input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    padding: 12px 13px;
    background: #fff;
    color: var(--ink);
}
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid rgba(15, 107, 112, .22);
    border-color: var(--brand);
}
textarea { resize: vertical; }
.editor {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 24px;
    align-items: start;
}
.editor__main,
.editor__side { padding: 22px; }
.editor__side {
    position: sticky;
    top: 88px;
}
.check {
    display: flex;
    align-items: center;
    gap: 10px;
}
.check input { width: auto; }
.preview {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border: 1px solid var(--line);
    margin-bottom: 14px;
}
.rich-editor {
    border: 1px solid var(--line);
    background: #fff;
    margin-bottom: 15px;
}
.rich-toolbar {
    position: sticky;
    top: 70px;
    z-index: 3;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px;
    border-bottom: 1px solid var(--line);
    background: #f9fbfc;
}
.rich-toolbar button {
    min-height: 36px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    padding: 6px 10px;
    font-weight: 900;
}
.rich-toolbar button:hover,
.rich-toolbar button[aria-pressed="true"] {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}
.rich-editor__surface,
.rich-editor__source {
    width: 100%;
    min-height: 560px;
    border: 0;
    padding: 24px;
    color: var(--ink);
    background: #fff;
    font-family: var(--font-main);
    font-size: 18px;
    line-height: 1.75;
}
.rich-editor__surface:focus,
.rich-editor__source:focus {
    outline: 2px solid rgba(15, 107, 112, .22);
    outline-offset: -2px;
}
.rich-editor__surface h2,
.rich-editor__surface h3 {
    line-height: 1.15;
}
.rich-editor__surface blockquote {
    margin: 24px 0;
    padding-left: 18px;
    border-left: 4px solid var(--accent);
    color: var(--ink-2);
    font-weight: 700;
}
.settings-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}
.settings-card {
    background: var(--panel);
    border: 1px solid rgba(220, 228, 234, .9);
    box-shadow: var(--shadow);
    padding: 20px;
}
.settings-card--wide {
    grid-column: 1 / -1;
}
.settings-card h2 {
    margin: 0 0 10px;
    font-size: 24px;
}
.settings-card p {
    margin: 0 0 16px;
    color: var(--muted);
}
.logo-settings {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 18px;
    align-items: start;
}
.logo-preview {
    border: 1px solid var(--line);
    background: #f9fbfc;
    padding: 14px;
}
.logo-preview span {
    display: block;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}
.logo-preview img {
    max-width: 100%;
    max-height: 120px;
    object-fit: contain;
}
.settings-form > button {
    grid-column: 1 / -1;
    justify-self: start;
    border: 0;
    background: var(--brand);
    color: #fff;
    padding: 12px 16px;
    font-weight: 900;
    cursor: pointer;
}

@media (max-width: 840px) {
    .admin-head,
    .panel-title {
        flex-direction: column;
        align-items: stretch;
    }
    .admin-head nav { flex-wrap: wrap; }
    .editor { grid-template-columns: 1fr; }
    .editor__side { position: static; }
    .settings-form { grid-template-columns: 1fr; }
    .logo-settings { grid-template-columns: 1fr; }
    .rich-toolbar { position: static; }
    table, thead, tbody, tr, th, td { display: block; }
    thead { display: none; }
    td { padding: 10px 0; }
    .row-actions { flex-wrap: wrap; }
}

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

.access-widget {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 80;
    font-family: var(--font-main);
}
.access-toggle {
    width: 58px;
    height: 58px;
    border: 0;
    background: var(--brand);
    color: #fff;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .26);
    cursor: pointer;
    font-size: 28px;
    font-weight: 900;
}
.access-panel {
    position: absolute;
    right: 0;
    bottom: 72px;
    width: min(310px, calc(100vw - 32px));
    background: #fff;
    color: var(--ink);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}
.access-panel__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--ink);
    color: #fff;
}
.access-panel__head button {
    border: 1px solid rgba(255,255,255,.35);
    background: transparent;
    color: #fff;
    width: 34px;
    height: 34px;
    cursor: pointer;
}
.access-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px;
}
.access-actions button {
    min-height: 48px;
    border: 1px solid var(--line);
    background: var(--soft);
    color: var(--ink);
    font-weight: 800;
    cursor: pointer;
}
.access-actions button:disabled {
    cursor: not-allowed;
    opacity: .55;
}
.access-actions button[aria-pressed="true"] {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
}
.access-actions button[data-access-reset] {
    grid-column: 1 / -1;
    background: #fff;
}
.reader-guide {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    height: 36px;
    background: rgba(217, 154, 34, .22);
    border-top: 2px solid rgba(217, 154, 34, .8);
    border-bottom: 2px solid rgba(217, 154, 34, .8);
    pointer-events: none;
    z-index: 79;
}

.access-dark {
    color-scheme: dark;
}
.access-dark body {
    background: #0f1318;
    color: #edf2f5;
}
.access-dark .admin-head,
.access-dark .access-panel__head {
    background: #07090c;
}
.access-dark .table-card,
.access-dark .login-box,
.access-dark .editor__main,
.access-dark .editor__side,
.access-dark .access-panel {
    background: #171d24;
    color: #edf2f5;
    border-color: #303b46;
}
.access-dark input,
.access-dark textarea,
.access-dark select,
.access-dark .access-actions button {
    background: #10161c;
    color: #edf2f5;
    border-color: #303b46;
}
.access-dark .panel-title p,
.access-dark th {
    color: #b9c4cc;
}
.access-dark td,
.access-dark th {
    border-color: #303b46;
}
.access-dark tbody tr:hover {
    background: #10161c;
}

.access-contrast body {
    background: #000;
    color: #fff;
}
.access-contrast .admin-head,
.access-contrast .table-card,
.access-contrast .login-box,
.access-contrast .editor__main,
.access-contrast .editor__side,
.access-contrast .access-panel {
    background: #000;
    color: #fff;
    border-color: #fff;
}
.access-contrast a,
.access-contrast th {
    color: #ffdc55;
}
.access-contrast button,
.access-contrast .button {
    background: #ffdc55;
    color: #000;
}
.access-largeText body {
    font-size: 18px;
}
.access-readable body,
.access-readable .admin-brand,
.access-readable .panel-title h1,
.access-readable .login-box h1 {
    font-family: var(--font-main);
}
.access-underline a {
    text-decoration: underline;
    text-underline-offset: 3px;
}
.access-focus *:focus,
.access-focus *:focus-visible {
    outline: 4px solid #ffdc55 !important;
    outline-offset: 4px !important;
    box-shadow: 0 0 0 7px rgba(15, 107, 112, .35) !important;
}
.access-spacing body {
    letter-spacing: .04em;
    word-spacing: .08em;
    line-height: 1.8;
}
.access-readerGuide .reader-guide {
    display: block;
}
.access-grayscale body {
    filter: grayscale(1);
}
.access-reduceMotion *,
.access-reduceMotion *::before,
.access-reduceMotion *::after {
    animation: none !important;
    scroll-behavior: auto !important;
    transition: none !important;
}
