:root {
  color-scheme: light;
  --ink: #243b36;
  --muted: #6d7871;
  --paper: #f6f5f0;
  --line: #e3e7df;
  --green: #23614e;
  --soft-green: #e9f1e8;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font-size: 15px; line-height: 1.6; }
button, input, textarea, select { font: inherit; }
a { color: var(--green); text-underline-offset: 3px; }
button, a, input, textarea, [contenteditable] { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #b07e21; outline-offset: 4px; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
[hidden], .hidden { display: none !important; }
.site-header { min-height: 82px; border-bottom: 1px solid var(--line); background: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 max(24px, calc((100vw - 1240px) / 2)); gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; font-size: 23px; text-decoration: none; letter-spacing: -.7px; }
.brand-mark { display: inline-grid; place-items: center; width: 37px; height: 37px; background: var(--ink); color: white; border-radius: 11px 3px 11px 3px; font-family: Georgia, serif; font-size: 24px; font-weight: normal; }
.prototype { border: 1px solid var(--line); padding: 1px 7px; border-radius: 5px; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-left: 7px; }
.site-header .admin-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.site-header .admin-tools a { display: inline-flex; align-items: center; color: var(--muted); text-decoration: none; padding: 7px 12px; border: 1px solid transparent; border-radius: 6px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.site-header .admin-tools a:hover { color: var(--green); background: #f1f4ef; }
.site-header .admin-tools a[aria-current] { color: var(--green); background: var(--soft-green); }
.site-header .admin-tools .edit-shortcut { color: var(--green); border-color: var(--line); }
.site-header .admin-tools form { margin: 0; }
.site-header .admin-tools button { color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 7px 12px; font-size: 13px; white-space: nowrap; }
.site-header .admin-tools button:hover { color: var(--green); background: #f1f4ef; }
.admin-main { max-width: 1288px; padding: 46px 24px 70px; margin: auto; min-height: calc(100vh - 152px); }
.admin-layout { display: grid; grid-template-columns: 196px minmax(0, 1fr); align-items: start; gap: 32px; max-width: 1528px; margin: auto; padding: 32px 24px 70px; min-height: calc(100vh - 152px); }
.admin-layout > .admin-main { min-width: 0; width: 100%; max-width: none; margin: 0; padding: 12px 0 0; min-height: 0; }
.admin-sidebar { position: sticky; top: 24px; background: var(--ink); color: #fff; border-radius: 10px; padding: 22px 10px 12px; }
.admin-sidebar h2 { margin: 0 14px 17px; color: #becfc5; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.7px; }
.admin-sidebar ul { list-style: none; padding: 0; margin: 0; }
.admin-sidebar li + li { margin-top: 4px; }
.admin-sidebar a { display: block; padding: 11px 12px; border-left: 3px solid transparent; border-radius: 5px; color: #dce6df; font-size: 13px; text-decoration: none; }
.admin-sidebar a:hover { background: #ffffff0d; color: #fff; }
.admin-sidebar a[aria-current] { border-left-color: #b4d7ac; background: #ffffff17; color: #fff; font-weight: 650; }
.admin-sidebar a:focus-visible { outline-color: #d6b35f; outline-offset: 1px; }
.section-placeholder { padding: 28px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.section-placeholder h2 { margin: 0 0 8px; font-size: 16px; }
.section-placeholder p { margin: 0; color: var(--muted); font-size: 14px; }
.public-main { max-width: 1120px; padding: 40px 24px 70px; margin: auto; min-height: calc(100vh - 152px); }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.page-heading h1 { margin: 4px 0; font-size: clamp(27px, 3vw, 36px); line-height: 1.25; letter-spacing: -1.15px; font-weight: 650; }
.eyebrow { color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: 1.8px; margin: 0 0 9px; }
.lead { color: var(--muted); font-size: 16px; margin: 9px 0 0; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 17px; min-height: 43px; border-radius: 7px; font-size: 13px; font-weight: 600; text-decoration: none; line-height: 1.5; border: 1px solid transparent; white-space: nowrap; }
.primary { color: white; background: var(--green); }
.primary:hover { background: #174d3c; }
.secondary { color: var(--ink); background: #fff; border-color: #d7dfd6; }
.secondary:hover { background: #f1f4ef; }
.pages-card, .editor-card, .history-panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 3px 15px #243b3604; }
.pages-card > .section-heading { padding: 20px 25px; border-bottom: 1px solid var(--line); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.section-heading h2 { font-size: 15px; margin: 0; letter-spacing: -.2px; font-weight: 650; }
.section-heading > span { font-size: 11px; color: var(--muted); }
.page-row { display: flex; align-items: center; gap: 22px; padding: 23px 25px; text-decoration: none; border-bottom: 1px solid var(--line); color: var(--ink); }
.page-row:last-child { border-bottom: 0; }
.page-row:hover { background: #fafbf8; }
.page-row > div { flex: 1; min-width: 0; }
.page-row strong { display: block; font-size: 16px; font-weight: 600; }
.page-row > div > span { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; overflow-wrap: anywhere; }
.row-arrow { color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; font-size: 11px; font-weight: 500; border-radius: 30px; white-space: nowrap; }
.status::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.published { background: var(--soft-green); color: #3f6b43; }
.draft { background: #f9f0dd; color: #85662c; }
.breadcrumb { display: flex; gap: 10px; font-size: 12px; color: var(--muted); margin-bottom: 23px; }
.breadcrumb a { text-decoration: none; }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; align-items: start; gap: 26px; }
.editor-card { min-width: 0; overflow: hidden; }
#editor-form { padding: 26px; }
.field-label { display: block; font-size: 12px; font-weight: 650; margin: 0 0 8px; }
input { min-width: 0; width: 100%; border: 1px solid #d9e0d8; border-radius: 6px; padding: 11px 12px; background: #fff; color: var(--ink); }
#page-title { font-size: 18px; font-weight: 550; }
.page-path { color: var(--muted); font-size: 11px; margin: 9px 0 26px; overflow-wrap: anywhere; }
.page-path a { margin-left: 5px; }
.slug-field { display: flex; align-items: center; gap: 7px; }
.slug-field + p { margin-bottom: 26px; }
.editor-tabs { display: flex; gap: 4px; padding: 4px; background: #f2f4ef; border-radius: 7px; width: fit-content; }
.editor-tabs button { border: 0; background: transparent; color: var(--muted); padding: 7px 14px; font-size: 12px; border-radius: 5px; }
.editor-tabs button[aria-selected=true] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px #243b3614; font-weight: 600; }
.editor-note { color: var(--muted); font-size: 11px; margin: 12px 0; min-height: 18px; }
#source-panel, #visual-panel { border: 1px solid #dce3d9; border-radius: 7px; overflow: hidden; background: #fff; }
#html-source { display: block; width: 100%; min-height: 425px; padding: 20px; border: 0; resize: vertical; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; line-height: 1.8; color: #304e46; tab-size: 2; background: #fcfdfb; white-space: pre-wrap; overflow-wrap: anywhere; }
#html-source:focus { outline-offset: -3px; }
.format-toolbar { display: flex; flex-wrap: wrap; gap: 3px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: #fafbf8; }
.format-toolbar button { border: 0; background: transparent; color: var(--ink); font-size: 12px; padding: 5px 10px; border-radius: 4px; min-width: 32px; }
.format-toolbar button:hover { background: var(--soft-green); }
#visual-editor { min-height: 385px; padding: 15px 23px; outline-offset: -3px; overflow-wrap: anywhere; }
.content-body { font-family: Georgia, "Times New Roman", serif; font-size: 18px; line-height: normal; color: #30443b; }
.content-body h1, .content-body h2, .content-body h3, .content-body h4 { font-family: ui-sans-serif, system-ui, sans-serif; line-height: normal; letter-spacing: -.6px; color: var(--ink); }
.content-body h1 { font-size: clamp(29px, 4vw, 40px); margin: 0 0 30px; letter-spacing: -1.2px; }
.content-body h2 { font-size: 24px; margin: 1.5em 0 .65em; }
.content-body h3 { font-size: 20px; }
.content-body p { margin: 0 0 1.2em; }
.content-body ul, .content-body ol { padding-left: 1.4em; }
.content-body img, .content-body iframe { max-width: 100%; }
.content-body img { height: auto; border-radius: 5px; }
.content-body table { border-collapse: collapse; width: 100%; margin: 25px 0; font: 14px/normal ui-sans-serif, system-ui, sans-serif; }
.content-body td, .content-body th { padding: 12px 14px; border: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.content-body th { background: #f0f4ed; text-align: left; }
.content-body tr:nth-child(even) { background: #fafbf8; }
.content-body pre, .content-body code { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.content-body blockquote { border-left: 3px solid #a7bca5; margin-left: 0; padding-left: 20px; color: var(--muted); }
.editor-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 22px; flex-wrap: wrap; }
.action-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.editor-actions .button { padding: 9px 12px; font-size: 11px; min-height: 39px; }
.editor-actions > span { font-size: 10px; }
.unsaved { color: #946a1e !important; }
.history-panel { padding: 20px; }
.history-panel h2 { font-size: 14px; margin: 0; }
.history-panel > p { font-size: 11px; margin: 11px 0 22px; line-height: 1.7; }
.revision-list { list-style: none; margin: 0; padding: 0; max-height: 680px; overflow-y: auto; }
.revision-list li { padding: 17px 0; border-top: 1px solid var(--line); }
.revision-heading { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.revision-heading > a { font-weight: 600; text-decoration: none; font-size: 12px; }
.tiny-label { border-radius: 3px; background: #f0f3ec; font-size: 9px; padding: 1px 4px; }
.revision-list time { display: block; color: var(--muted); font-size: 9px; margin-top: 5px; }
.revision-list p { font-size: 11px; margin: 5px 0; overflow-wrap: anywhere; }
.text-button { color: var(--green); background: none; border: 0; padding: 0; font-size: 11px; text-decoration: underline; text-underline-offset: 3px; }
.muted { color: var(--muted); font-size: 12px; }
.feedback { padding: 13px 17px; margin: -7px 0 22px; font-size: 13px; background: var(--soft-green); border: 1px solid #d0dfc9; border-radius: 7px; }
.feedback.error { background: #fff0e9; border-color: #efcdb9; color: #984428; }
.preview-section { border-top: 1px solid var(--line); padding: 23px 26px; background: #f9faf6; }
.preview-section iframe { width: 100%; min-height: 560px; background: white; border: 1px solid var(--line); border-radius: 6px; }
.preview-document { background: white; padding: 30px; }
.preview-document article { max-width: 760px; margin: auto; }
.page-nav { position: relative; z-index: 20; margin-bottom: 30px; font-size: 14px; }
.page-nav a { text-decoration: none; color: var(--ink); }
.page-nav a[aria-current] { color: var(--green); font-weight: 600; }
.page-nav ul { margin: 0; padding: 0; list-style: none; }
.page-nav > ul { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px; padding: 5px; background: white; border: 1px solid var(--line); border-radius: 8px; }
.page-nav li { min-width: 0; max-width: 100%; }
.page-nav li > ul { margin: 0 0 5px 14px; padding-left: 10px; border-left: 1px solid var(--line); }
.nav-link, .nav-submenu-toggle, .nav-mobile-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 44px; padding: 10px 14px; border: 0; border-radius: 5px; background: transparent; color: var(--ink); text-align: left; line-height: 1.5; overflow-wrap: anywhere; }
.nav-link:hover, .nav-submenu-toggle:hover, .nav-mobile-toggle:hover { background: #f1f4ef; }
.nav-submenu-toggle[aria-expanded=true], .nav-submenu-toggle.nav-current { background: var(--soft-green); color: var(--green); }
.nav-link:focus-visible, .nav-submenu-toggle:focus-visible, .nav-mobile-toggle:focus-visible { outline-offset: -3px; }
.nav-mobile-toggle { width: auto; gap: 10px; border: 1px solid var(--line); background: white; font-weight: 600; }
.nav-chevron { flex: 0 0 auto; font-size: 21px; line-height: 1; }
.nav-list > li > .nav-submenu-toggle .nav-chevron { transform: rotate(90deg); }
.nav-list > li > .nav-submenu-toggle[aria-expanded=true] .nav-chevron { transform: rotate(270deg); }
.nav-submenu .nav-submenu-toggle[aria-expanded=true] .nav-chevron { transform: rotate(180deg); }
.page-nav.nav-enhanced .nav-submenu { position: fixed; z-index: 30; width: max-content; min-width: min(220px, calc(100vw - 24px)); max-width: min(320px, calc(100vw - 24px)); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain; margin: 0; padding: 5px; border: 1px solid #d6dfd2; border-radius: 7px; background: white; box-shadow: 0 8px 25px #243b3624; }
.nav-overview { border-bottom: 1px solid var(--line); margin-bottom: 4px; padding-bottom: 4px; }
.nav-overview .nav-link { color: var(--muted); font-size: 12px; }
@media (max-width: 760px) {
  .page-nav > ul { display: block; margin-top: 8px; }
  .nav-mobile-toggle { margin-left: auto; }
  .page-nav.nav-enhanced .nav-submenu { position: static; width: auto; min-width: 0; max-width: none; max-height: none; overflow: visible; margin: 0 0 5px 12px; padding: 0 0 0 8px; border: 0; border-left: 2px solid var(--line); border-radius: 0; box-shadow: none; }
  .nav-submenu .nav-submenu-toggle .nav-chevron { transform: rotate(90deg); }
  .nav-submenu .nav-submenu-toggle[aria-expanded=true] .nav-chevron { transform: rotate(270deg); }
}
.menu-editor-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; align-items: start; }
.menu-picker, .menu-tree-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; min-width: 0; padding: 20px; }
.menu-picker { position: sticky; top: 24px; }
.menu-picker h2 { margin: 0 0 15px; font-size: 15px; }
#menu-page-filter { font-size: 12px; }
.menu-page-options { max-height: 420px; overflow-y: auto; margin: 12px 0 17px; }
.menu-page-choice { display: flex; align-items: flex-start; gap: 9px; padding: 10px 0; cursor: pointer; border-bottom: 1px solid var(--line); font-size: 12px; overflow-wrap: anywhere; }
.menu-page-choice input { width: 16px; height: 16px; padding: 0; margin: 3px 0 0; flex: 0 0 16px; accent-color: var(--green); }
.menu-page-choice small { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }
#menu-add { width: 100%; font-size: 12px; }
.menu-tree, .menu-children { list-style: none; margin: 0; padding: 0; }
.menu-children { margin: 8px 0 0 18px; padding-left: 12px; border-left: 1px dashed #c8d6c2; }
.menu-children:empty { display: none; }
.menu-node + .menu-node { margin-top: 10px; }
.menu-node-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: #fafbf8; }
.menu-node-fields { flex: 1 1 170px; min-width: 0; }
.menu-node-fields .field-label { font-size: 10px; margin-bottom: 5px; }
.menu-label { padding: 7px 9px; font-size: 13px; }
.menu-target { display: flex; flex-wrap: wrap; gap: 3px 8px; margin: 6px 0 0; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.menu-draft-note { color: #85662c; }
.menu-node-actions { display: flex; flex-wrap: wrap; max-width: 100%; gap: 4px; }
.menu-node-actions button { border: 1px solid #d8e1d3; background: #fff; color: var(--green); border-radius: 4px; min-width: 28px; min-height: 30px; padding: 3px 7px; font-size: 13px; }
.menu-node-actions button:hover:not(:disabled) { background: var(--soft-green); }
.menu-node-actions .menu-remove { color: #91533d; font-size: 10px; }
.menu-help { margin: 20px 0; line-height: 1.7; }
.menu-save-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; border-top: 1px solid var(--line); padding-top: 18px; }
@media (max-width: 1100px) {
  .menu-editor-layout { grid-template-columns: minmax(0, 1fr); }
  .menu-picker { position: static; }
  .menu-page-options { max-height: 210px; }
}
.published-page { padding: clamp(25px, 5vw, 60px); border: 1px solid var(--line); border-radius: 12px; background: white; }
.published-page > .eyebrow { font-family: ui-sans-serif, system-ui, sans-serif; }
.revision-preview { background: white; border: 1px solid var(--line); border-radius: 10px; padding: 35px; }
.source-details { margin-top: 25px; }
.source-details pre { padding: 20px; overflow-x: auto; border: 1px solid var(--line); background: white; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.error-card { max-width: 650px; margin: 40px auto; padding: 35px; background: white; border: 1px solid var(--line); border-radius: 10px; }
.error-card h1 { font-size: 28px; line-height: 1.3; }
.login-card { max-width: 500px; margin: 35px auto; padding: 32px; background: white; border: 1px solid var(--line); border-radius: 12px; }
.login-card h1 { margin: 0 0 18px; font-size: 28px; line-height: 1.3; letter-spacing: -.6px; }
.login-card > p:not(.eyebrow) { color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.login-card .feedback.error { color: #984428; }
.login-card form { margin-bottom: 22px; }
.login-card button { width: 100%; margin-top: 16px; }
.login-card > a { font-size: 12px; }
.login-card .field-label:not(:first-child) { margin-top: 18px; }
.development-login { margin: 24px 0; padding-top: 15px; border-top: 1px solid var(--line); font-size: 12px; }
.development-login summary { cursor: pointer; color: var(--muted); }
.development-login p { color: var(--muted); }
.users-table-wrapper { overflow-x: auto; }
.users-table { width: 100%; min-width: 630px; border-collapse: collapse; font-size: 13px; text-align: left; }
.users-table th, .users-table td { padding: 18px 22px; border-top: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.users-table thead th { background: #fafbf8; font-size: 11px; color: var(--muted); }
.users-table th small { display: block; color: var(--muted); font-size: 11px; font-weight: 400; margin-top: 4px; }
.users-table .user-login-note { display: block; max-width: 230px; font-size: 11px; color: #85662c; margin-top: 8px; }
.user-card { max-width: 760px; padding: 28px; }
.user-card .field-label { margin-top: 20px; }
.user-card .field-label:first-of-type { margin-top: 0; }
.user-card select { width: 100%; background: white; color: var(--ink); padding: 10px 12px; border: 1px solid #d9e0d8; border-radius: 6px; }
.user-card input[readonly] { background: #f3f5f0; }
.user-enabled { display: flex; align-items: center; gap: 10px; margin-top: 20px; }
.user-enabled input { width: 18px; height: 18px; accent-color: var(--green); }
.user-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 15px; border-top: 1px solid var(--line); margin-top: 25px; padding-top: 20px; }
.site-footer { min-height: 70px; border-top: 1px solid var(--line); padding: 23px 24px; color: #8a938b; font-size: 10px; text-align: center; letter-spacing: .4px; }
.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; }
@media (max-width: 960px) {
  .editor-layout { grid-template-columns: minmax(0, 1fr); }
  .history-panel { padding: 24px; }
  .revision-list { max-height: 360px; }
}
@media (max-width: 900px) {
  .admin-layout { grid-template-columns: minmax(0, 1fr); gap: 22px; padding: 24px 14px 45px; }
  .admin-layout > .admin-main { padding: 0; }
  .admin-sidebar { position: static; padding: 16px 10px 10px; }
  .admin-sidebar h2 { margin-bottom: 10px; }
  .admin-sidebar ul { display: flex; flex-wrap: wrap; gap: 4px; }
  .admin-sidebar li + li { margin-top: 0; }
  .admin-sidebar a { padding: 9px 11px; font-size: 12px; }
}
@media (max-width: 600px) {
  .site-header .admin-tools { flex-basis: 100%; flex-wrap: wrap; justify-content: flex-end; }
  .site-header .admin-tools button { font-size: 12px; padding: 7px 9px; }
  .user-card { padding: 18px; }
  .menu-picker, .menu-tree-card { padding: 14px; }
  .menu-children { margin-left: 8px; padding-left: 8px; }
  .menu-save-row .button { width: 100%; }
  .site-header { min-height: 68px; padding: 12px 16px; gap: 12px; flex-wrap: wrap; }
  .brand { font-size: 18px; gap: 7px; }
  .brand-mark { width: 30px; height: 30px; font-size: 21px; }
  .prototype { display: none; }
  .site-header .admin-tools { gap: 4px; }
  .site-header .admin-tools a { font-size: 12px; padding: 7px 9px; }
  .admin-main, .public-main { padding: 28px 14px 45px; }
  .page-heading { align-items: flex-start; gap: 15px; flex-wrap: wrap; }
  .page-heading .button { font-size: 11px; padding: 8px 12px; }
  .page-row { padding: 18px; gap: 10px; flex-wrap: wrap; }
  .page-row strong { font-size: 14px; }
  .page-row .status { font-size: 9px; padding: 4px 7px; }
  #editor-form { padding: 18px; }
  #html-source { padding: 14px; font-size: 11px; min-height: 350px; }
  #visual-editor { padding: 15px; }
  .editor-actions { align-items: flex-start; }
  .action-buttons { width: 100%; }
  .editor-actions .button { flex: 1; padding: 9px 8px; }
  .preview-section { padding: 18px; }
  .content-body { font-size: 16px; }
  .content-body td, .content-body th { padding: 8px; }
}

.media-upload-card, .media-detail { padding: 1.5rem; }
.media-upload-card form, .media-detail form { max-width: 48rem; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem; margin: 1rem 0 2rem; }
.media-card { display: flex; flex-direction: column; gap: .5rem; padding: .8rem; border: 1px solid var(--border, #d6ddd9); background: white; border-radius: .5rem; text-align: left; color: inherit; overflow-wrap: anywhere; text-decoration: none; min-width: 0; cursor: pointer; }
.media-card[hidden] { display: none; }
.media-thumbnail { height: 130px; display: grid; place-items: center; background: #edf1ef; overflow: hidden; }
.media-thumbnail img { max-width: 100%; max-height: 130px; object-fit: contain; }
.media-card small { color: #53605a; }
.media-library-heading { margin-top: 2rem; }
.media-detail-image, .media-detail video { max-width: 100%; max-height: 500px; object-fit: contain; }
#media-picker { width: min(900px, calc(100vw - 2rem)); max-height: 85vh; padding: 1.5rem; border: 1px solid #bac6bf; border-radius: .8rem; }
#media-picker::backdrop { background: #14271c88; }
#insert-media { margin: 1rem 0; }
.content-body img, .content-body video { max-width: 100%; height: auto; }
.content-body figure { max-width: 100%; margin: 1.5rem 0; }
.content-body figcaption { font-size: .9rem; color: #53605a; margin-top: .5rem; }
.content-body iframe { max-width: 100%; }
@media (max-width: 600px) { .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } #media-picker { padding: 1rem; } }

/* Site identity. Public theme settings override these defaults in /theme.css. */
.site-header { background: var(--header-background, #000); border-bottom-color: #222; padding-top: 12px; padding-bottom: 12px; }
.site-header .brand { color: var(--header-text, #fff); min-width: 0; max-width: 100%; }
.site-logo { display: block; height: var(--logo-height, 88px); width: auto; max-width: min(65vw, 360px); object-fit: contain; }
.brand-name { overflow-wrap: anywhere; }
.site-header .admin-tools a, .site-header .admin-tools button { color: var(--header-text, #fff); }
.site-header .admin-tools a:hover, .site-header .admin-tools button:hover { color: var(--header-text, #fff); background: #ffffff20; }
.site-header .admin-tools .edit-shortcut { color: var(--header-text, #fff); border-color: #ffffff50; }
.site-header .admin-tools a[aria-current] { color: #174d3c; background: #e9f1e8; }
.footer-content { white-space: pre-line; }
.settings-card { padding: 28px; }
.settings-card h2 { margin-top: 0; }
.theme-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; }
.theme-tabs button { border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); padding: 10px 16px; }
.theme-tabs button[aria-selected=true] { color: #fff; background: var(--green); border-color: var(--green); }
.theme-panel { padding: 26px; margin-bottom: 20px; }
.theme-panel h2 { margin: 0 0 22px; font-size: 21px; }
.theme-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; margin-top: 20px; }
.theme-field { min-width: 0; }
.theme-field select, .theme-actions select { width: 100%; max-width: 100%; padding: 11px 12px; border: 1px solid #d9e0d8; border-radius: 6px; background: #fff; color: var(--ink); }
.theme-field input[type=color] { width: 100%; height: 46px; padding: 5px; cursor: pointer; }
.theme-logo-preview { background: #000; padding: 20px; border-radius: 7px; }
.theme-logo-preview img { display: block; height: 88px; width: auto; max-width: 100%; object-fit: contain; }
#theme-footer_text, #theme-custom_css { display: block; width: 100%; padding: 14px; border: 1px solid #d9e0d8; border-radius: 7px; resize: vertical; }
#theme-custom_css { min-height: 340px; background: #fcfdfb; color: #304e46; font: 13px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace; tab-size: 2; }
.theme-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 8px 0 24px; }
.theme-actions select { width: auto; }
.theme-actions label, #theme-save-state { font-size: 12px; }
.theme-preview-section { padding: 24px; margin-top: 20px; }
#theme-preview-frame { width: 100%; height: 700px; border: 1px solid var(--line); margin-top: 18px; background: #fff; }
@media(max-width:600px) {
  .theme-fields { grid-template-columns: minmax(0, 1fr); }
  .theme-panel { padding: 18px; }
  .theme-tabs button { padding: 9px 12px; font-size: 12px; }
  .theme-actions { align-items: stretch; }
  .theme-actions .button { flex: 1; }
  .theme-actions label { align-self: center; }
  .theme-preview-section { padding: 14px; }
}

/* Header layout: menu and account controls share the logo's top bar. */
.site-header { display: block; color: var(--header-text, #fff); }
.header-layout-root { width: 100%; }
.header-layout-node { --part-align-x: initial; --part-align-y: initial; min-width: 0; min-height: var(--part-size, 0px); flex: var(--part-weight, 500) 1 0%; }
.header-layout-row { display: flex; flex-direction: row; align-items: stretch; gap: var(--part-gap, 12px); }
.header-layout-column { display: flex; flex-direction: column; justify-content: center; gap: var(--part-gap, 12px); }
.header-layout-leaf { display: flex; flex-direction: column; align-items: stretch; justify-content: center; }
.header-layout-node[data-align-x=start] { --part-align-x: flex-start; }
.header-layout-node[data-align-x=center] { --part-align-x: center; }
.header-layout-node[data-align-x=end] { --part-align-x: flex-end; }
.header-layout-node[data-align-y=start] { --part-align-y: flex-start; }
.header-layout-node[data-align-y=center] { --part-align-y: center; }
.header-layout-node[data-align-y=end] { --part-align-y: flex-end; }
.header-layout-node:is(.header-layout-column, .header-layout-leaf) { align-items: var(--part-align-x, stretch); justify-content: var(--part-align-y, center); }
.header-layout-row { align-items: var(--part-align-y, stretch); justify-content: var(--part-align-x, flex-start); }
.header-layout-row:not([data-align-x=auto]) > .header-layout-node,
.header-layout-column:not([data-align-y=auto]) > .header-layout-node { flex-grow: 0; flex-basis: auto; }
.header-layout-node > :is(nav, a) { max-width: 100%; }
.header-layout-column > .header-layout-node { width: 100%; flex-basis: auto; }
.header-layout-column:not([data-align-x=auto]) > .header-layout-node { width: auto; }
.header-layout-row > .header-layout-logo { flex: 0 1 auto; }
.header-layout-logo .brand { display: inline-flex; max-width: 100%; }
.header-title { display: block; color: inherit; text-decoration: none; font-weight: 650; font-size: var(--title-size, 26px); line-height: 1.2; letter-spacing: -.5px; overflow-wrap: anywhere; }
.header-layout-subtitle { color: inherit; font-size: var(--subtitle-size, 14px); line-height: 1.5; overflow-wrap: anywhere; opacity: .85; }
.header-layout-admin .admin-tools { margin: 0; justify-content: flex-end; flex-wrap: wrap; gap: 4px; }
.site-header .admin-tools a, .site-header .admin-tools button { padding: 7px 9px; }
.site-header .admin-tools :is(a, button) { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 9px; flex: 0 0 auto; }
.admin-icon { display: block; width: 20px; height: 20px; flex-shrink: 0; }
.site-header .header-nav { margin: 0; }
.site-header .header-nav > ul { padding: 0; border: 0; background: transparent; align-items: center; gap: 0; }
.site-header .header-nav :is(a, .nav-submenu-toggle, .nav-mobile-toggle) { color: var(--header-text, #fff); }
.site-header .header-nav :is(.nav-link, .nav-submenu-toggle) { padding: 8px 10px; font-size: 13px; }
.site-header .header-nav :is(.nav-link:hover, .nav-submenu-toggle:hover, .nav-submenu-toggle[aria-expanded=true]) { background: #ffffff20; color: var(--header-text, #fff); }
.site-header .header-nav .nav-submenu { background: var(--header-background, #000); border-color: #ffffff40; }
.site-header .header-nav .nav-mobile-toggle { margin: 0; background: transparent; border-color: #ffffff50; }
.site-header .header-nav .nav-overview .nav-link { opacity: .8; }
.page-nav.nav-hover-links .nav-branch { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; }
.page-nav.nav-hover-links .nav-branch > .nav-submenu { grid-column: 1 / -1; }
.page-nav.nav-hover-links .nav-branch > .nav-submenu-toggle { width: 32px; min-width: 32px; padding-left: 6px; padding-right: 6px; justify-content: center; }
.page-nav.nav-hover-links .nav-branch > .nav-fallback { padding-right: 4px; }
@media(max-width:1100px) {
  .site-header .admin-tools :is(a, button) { width: 44px; height: 44px; }
  .site-header .header-nav.nav-hover-links .nav-submenu-toggle { width: 44px; min-width: 44px; }
  .header-layout-root.header-layout-row { flex-wrap: wrap; }
  .header-layout-root.header-layout-row > .header-layout-node { flex-basis: 100%; }
  .site-header .header-nav > ul { display: block; margin-top: 8px; }
  .site-header .header-nav.nav-enhanced .nav-submenu { position: static; width: auto; min-width: 0; max-width: none; max-height: none; overflow: visible; margin: 0 0 5px 12px; padding: 0 0 0 8px; border: 0; border-left: 2px solid #ffffff40; border-radius: 0; box-shadow: none; }
  .site-header .header-nav .nav-submenu .nav-submenu-toggle .nav-chevron { transform: rotate(90deg); }
  .site-header .header-nav .nav-submenu .nav-submenu-toggle[aria-expanded=true] .nav-chevron { transform: rotate(270deg); }
}

.header-designer { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 24px; }
.header-designer h3 { margin: 0; font-size: 18px; }
.header-designer p { font-size: 13px; }
.layout-palette, .layout-history { display: flex; flex-wrap: wrap; gap: 6px; }
.header-designer button { border: 1px solid #cbd8cf; border-radius: 5px; background: #fff; color: var(--ink); padding: 7px 10px; font-size: 12px; }
.layout-palette button[aria-pressed=true] { background: var(--green); border-color: var(--green); color: white; }
.layout-palette button[draggable=true], .layout-part-label[draggable=true] { cursor: grab; }
.header-layout-canvas { overflow: auto; max-height: 800px; margin: 14px 0; border: 1px solid #b7c9bf; border-radius: 7px; background: #f5f8f5; padding: 12px; }
.header-layout-canvas > .layout-part { min-width: 620px; }
.layout-part { --layout-align-x: initial; --layout-align-y: initial; min-width: 64px; flex: 500 1 0%; border: 1px solid #b9cbbf; border-radius: 5px; padding: 6px; background: #fff; display: flex; flex-direction: column; gap: 6px; }
.layout-part.selected { outline: 2px solid var(--green); outline-offset: -2px; }
.layout-part.drop-target { outline: 3px solid #b07e21; outline-offset: -3px; background: #fff9e9; }
.header-designer .layout-part-label { border: 0; background: #edf3ef; text-align: left; overflow-wrap: anywhere; padding: 5px 6px; font-size: 11px; }
.layout-children { display: flex; flex: 1; min-width: 0; }
.layout-children-row { flex-direction: row; align-items: stretch; }
.layout-children-column { flex-direction: column; min-height: 120px; }
.layout-children-column > .layout-part { flex-basis: auto; }
.header-designer .layout-empty { display: grid; place-content: center; min-height: 70px; width: 100%; flex: 1; border: 1px dashed #9eb7a7; color: #506c5d; background: #f7faf7; white-space: normal; overflow-wrap: anywhere; }
.header-designer .layout-content { flex: 1; min-height: 56px; width: 100%; white-space: normal; overflow-wrap: anywhere; border: 0; color: #244b3c; background: #f2f7f3; }
.layout-divider { flex: 0 0 12px; position: relative; touch-action: none; cursor: col-resize; }
.layout-divider::after { content: ''; position: absolute; background: #a0b6aa; width: 4px; border-radius: 4px; top: 20%; bottom: 20%; left: 4px; }
.layout-children-column > .layout-divider { cursor: row-resize; min-height: 12px; }
.layout-children-column > .layout-divider::after { width: auto; height: 4px; top: 4px; bottom: auto; left: 20%; right: 20%; }
.layout-divider:hover::after, .layout-divider:focus-visible::after { background: var(--green); }
.layout-properties { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; border: 1px solid var(--line); border-radius: 6px; margin: 14px 0; padding: 16px; }
.layout-properties legend { font-size: 13px; font-weight: 650; }
#layout-selection-label { flex-basis: 100%; font-size: 13px; font-weight: 650; }
.layout-properties label { display: grid; gap: 5px; font-size: 11px; flex: 1 1 120px; min-width: 0; }
.layout-properties input, .layout-properties select { width: 100%; padding: 8px; border: 1px solid #d9e0d8; border-radius: 5px; background: #fff; color: var(--ink); }
@media(max-width:600px) {
  .header-designer .section-heading { flex-wrap: wrap; }
  .layout-properties { padding: 12px; }
  .layout-palette button { flex: 1 1 100px; }
}
.header-designer .layout-part-label, .header-designer .layout-content { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.header-designer .layout-empty { white-space: nowrap; overflow: hidden; }
.layout-part[data-align-x=start] { --layout-align-x: flex-start; }
.layout-part[data-align-x=center] { --layout-align-x: center; }
.layout-part[data-align-x=end] { --layout-align-x: flex-end; }
.layout-part[data-align-y=start] { --layout-align-y: flex-start; }
.layout-part[data-align-y=center] { --layout-align-y: center; }
.layout-part[data-align-y=end] { --layout-align-y: flex-end; }
.header-designer .layout-content { display: flex; justify-content: var(--layout-align-x, center); align-items: var(--layout-align-y, center); }

/* Home article rail; complete articles use the normal page width. */
.home-content-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; gap: 24px; }
.home-content-layout > .published-page { min-width: 0; padding: 32px; }
.articles-sidebar { min-width: 0; padding: 24px; border: 1px solid var(--line); border-radius: 9px; background: var(--article-surface, #fff); color: var(--ink); }
.articles-sidebar h2 { margin: 0 0 20px; font-size: 21px; }
.articles-sidebar h3 { margin: 0 0 10px; font-size: 16px; line-height: 1.4; }
.articles-sidebar a { overflow-wrap: anywhere; }
.articles-sidebar time { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }
.articles-sidebar p { font-size: 14px; line-height: 1.7; margin: 12px 0; }
.articles-sidebar section + section, .article-archive { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.articles-sidebar ul { list-style: none; padding: 0; margin: 0; }
.recent-articles li { margin: 0 0 14px; font-size: 14px; line-height: 1.5; }
.article-read-more { font-size: 14px; font-weight: 600; }
.article-archive details { border-top: 1px solid var(--line); }
.article-archive summary { cursor: pointer; min-height: 44px; padding: 10px 0; font-weight: 600; }
.article-archive summary:focus-visible { outline-offset: 0; }
.article-archive li { font-size: 13px; line-height: 1.5; padding: 5px 0 9px 14px; }
.archive-count { color: var(--muted); font-size: 12px; font-weight: 400; }
.article-date { display: block; color: var(--muted); font-size: 14px; margin: -8px 0 24px; }
.articles-empty { padding: 24px; }
#article-date { display: block; max-width: 220px; padding: 10px; border: 1px solid var(--line); border-radius: 5px; }
@media(max-width:900px) {
  .home-content-layout { grid-template-columns: minmax(0, 1fr); }
  .home-content-layout > .published-page { padding: 26px; }
}
@media(max-width:600px) { .home-content-layout > .published-page, .articles-sidebar { padding: 20px; } }

/* Shared content layout: identical in the visual editor, preview and public pages. */
.published-page, #visual-editor, .preview-document .content-body { display: flow-root; }
.content-body .content-frame { border: 1px solid var(--line); padding: 1rem; margin: 1rem 0; max-width: 100%; box-sizing: border-box; overflow-wrap: anywhere; display: flow-root; overflow: auto; }
.content-body :is(.content-align-left, .alignleft) { float: left; margin: 0 1.2rem 1rem 0; }
.content-body :is(.content-align-right, .alignright) { float: right; margin: 0 0 1rem 1.2rem; }
.content-body :is(.content-align-center, .aligncenter) { float: none; display: block; margin-left: auto; margin-right: auto; }
.content-body figure:is(.content-align-left, .content-align-right) { width: fit-content; }
.content-body figure.content-align-center { width: fit-content; }
.public-main .articles-sidebar :is(p, li, h3) { line-height: normal; }
.object-properties { margin: 0; padding: 14px; border: 0; border-bottom: 1px solid var(--line); background: #f5f8f4; font-size: 13px; }
.object-properties[hidden], .object-properties [hidden] { display: none; }
.object-fields, .object-actions, .table-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.object-properties label { display: block; margin: 5px 0; }
.object-properties input:not([type=checkbox]), .object-properties select { display: block; max-width: 100%; padding: 7px; border: 1px solid var(--line); border-radius: 4px; }
.object-fields input { width: 130px; }
.object-properties .object-check { display: flex; align-items: center; gap: 6px; }
.object-actions { margin-top: 12px; }
.object-actions button, .table-actions button { min-height: 36px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 4px; background: white; cursor: pointer; }
#visual-editor [data-editor-selected] { outline: 2px solid #327c69; outline-offset: 2px; }
#visual-editor [data-editor-embed] { border: 1px dashed #73958a; padding: 20px; min-height: 80px; max-height: 160px; max-width: 100%; background: #edf4ef; font: 14px/normal ui-sans-serif, system-ui, sans-serif; color: #30443b; overflow-wrap: anywhere; cursor: pointer; box-sizing: border-box; }
#visual-editor .content-frame:empty::before { content: 'Kirjoita kehyksen sisään'; color: #6e7d75; }

.object-properties { position: fixed; z-index: 20; right: max(24px, calc((100vw - 1528px) / 2 + 24px)); top: 130px; width: 280px; max-height: calc(100vh - 154px); overflow: auto; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 25px #203d3026; }
@media(max-width:1100px) { .object-properties { top: auto; bottom: 12px; right: 12px; width: min(360px, calc(100vw - 24px)); max-height: 45vh; } }

.object-properties .object-check input { width: auto; min-height: 0; margin: 0; }

@media(max-width:600px) {
  .content-body table { display: block; overflow-x: auto; }
  .content-body :is(td, th) { overflow-wrap: normal; }
}

/* Editor controls remain compact, with full labels available to assistive tools. */
.format-toolbar { align-items: center; gap: 6px; }
.format-toolbar .toolbar-group { display: flex; align-items: center; gap: 2px; border-left: 1px solid var(--line); padding-left: 6px; }
.format-toolbar button { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 7px; }
.format-toolbar button[aria-pressed=true] { background: #dbece3; color: #194f40; }
.format-toolbar button:focus-visible, .format-toolbar select:focus-visible { outline: 2px solid #327c69; outline-offset: 2px; }
.format-toolbar select { max-width: 100%; min-height: 36px; border: 1px solid var(--line); border-radius: 5px; padding: 5px 8px; background: white; color: var(--ink); font: inherit; font-size: 13px; }
.object-properties #object-heading { margin: 0 0 12px; padding: 0 0 10px; border-bottom: 1px solid var(--line); font: 700 17px/1.3 ui-sans-serif, system-ui, sans-serif; color: var(--ink); }
.content-body pre, .content-body code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.content-body hr { border: 0; border-top: 1px solid var(--line); margin: 1.5em 0; clear: both; }
