/* Shared semantic palette. Brand is a fill; accent-text is the readable link role. */
:root {
  color-scheme: light;
  --bg: #FAF7F3;
  --bg-soft: #F3EDE6;
  --paper: #FFFDFC;
  --elevated: #FFFDFC;
  --ink: #2E2724;
  --muted: #6E625C;
  --line: #E6D9CF;
  --accent: #B61D1C;
  --accent-hover: #9F1A19;
  --accent-text: #B61D1C;
  --primary-dark: #8F1716;
  --active-ink: #8F1716;
  --accent-ink: #FFFFFF;
  --accent-subtle: #F3D8D4;
  --gold: #C98B6B;
  --gold-soft: #F3EDE6;
  --deep: #2E2724;
  --decor: #F3D8D4;
  --blue-soft: #F3EDE6;
  --admin-bg: #F3EDE6;
  --admin-sidebar: #FFFDFC;
  --admin-surface: #FFFDFC;
  --tag: #F3D8D4;
  --outline-focus: #B61D1C;
  --success: #2E7D5A;
  --warning: #B7791F;
  --danger: #C53A2F;
  --info: #3F6E8C;
  --paper-rgb: 255,253,252;
  --shadow: 0 13px 45px rgba(46, 39, 36, .065);
  --shadow-strong: 0 18px 65px rgba(46, 39, 36, .15);
  --status-success-bg: #E9F3ED;
  --status-warning-bg: #FBF0DC;
  --status-danger-bg: #FAEBE9;
  --status-info-bg: #EBF1F5;
  --status-success-text: #286C4E;
  --status-warning-text: #865715;
  --status-danger-text: #B12F25;
  --status-info-text: #3F6E8C;
  --control-border: #89776D;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #181312;
  --bg-soft: #302422;
  --paper: #241C1A;
  --elevated: #302422;
  --ink: #F5EEE9;
  --muted: #CBBDB4;
  --line: #463633;
  --accent: #B61D1C;
  --accent-hover: #C32827;
  --accent-text: #F0A09A;
  --primary-dark: #8F1716;
  --active-ink: #F5EEE9;
  --accent-ink: #FFFFFF;
  --accent-subtle: #3A2322;
  --gold: #C98B6B;
  --gold-soft: #45302A;
  --deep: #302422;
  --decor: #3A2322;
  --blue-soft: #302422;
  --admin-bg: #181312;
  --admin-sidebar: #241C1A;
  --admin-surface: #241C1A;
  --tag: #3A2322;
  --outline-focus: #F0A09A;
  --success: #78CDA4;
  --warning: #DBB27C;
  --danger: #F17F75;
  --info: #91B8D6;
  --paper-rgb: 36,28,26;
  --shadow: 0 13px 45px rgba(0, 0, 0, .18);
  --shadow-strong: 0 18px 65px rgba(0, 0, 0, .29);
  --status-success-bg: #1D3329;
  --status-warning-bg: #382A1A;
  --status-danger-bg: #3B211F;
  --status-info-bg: #20303C;
  --status-success-text: #78CDA4;
  --status-warning-text: #DBB27C;
  --status-danger-text: #F17F75;
  --status-info-text: #91B8D6;
  --control-border: #9B877E;
}
:root {
  /* Legacy component names are aliases, never a second palette. */
  --white: var(--paper); --green: var(--accent); --lime: var(--accent-subtle);
  --clay: var(--accent-text); --red: var(--accent-text); --cream: var(--bg-soft);
  --home-paper: var(--bg); --home-ink: var(--ink); --home-muted: var(--muted);
  --home-line: var(--line); --home-brand: var(--accent);
  --on-deep: #F5EEE9; --on-deep-muted: #CBBDB4;
  --success-fill: #176846; --danger-fill: #B12F25;
  --overlay: rgba(0,0,0,.62);
}
html { background: var(--bg); }
body { background: var(--bg); }
:where(input,select,textarea) { color: var(--ink); accent-color: var(--accent); }
:where(input,textarea)::placeholder { color: var(--muted); opacity: 1; }
:where(a,button,input,select,textarea,summary):focus-visible { outline: 3px solid var(--outline-focus); outline-offset: 3px; }
.theme-control { position: relative; display: inline-flex; align-items: center; flex: none; }
.theme-control:not([data-theme-ready]) { visibility: hidden; }
.theme-control .theme-toggle { display: grid; place-items: center; width: 44px; height: 44px; min-height: 44px; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); cursor: pointer; }
.theme-control .theme-toggle:hover { border-color: var(--outline-focus); background: var(--bg-soft); }
.theme-control svg { display: block; width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.theme-menu { position: absolute; z-index: 110; top: calc(100% + 8px); inset-inline-end: 0; width: 226px; max-width: calc(100vw - 16px); max-height: min(300px,calc(100dvh - 76px)); overflow: auto; padding: 7px; border: 1px solid var(--line); border-radius: 14px; background: var(--elevated); box-shadow: var(--shadow-strong); }
.theme-control .theme-option { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 9px 10px; margin: 0; border: 0; border-radius: 8px; background: transparent; color: var(--ink); text-align: start; font: inherit; font-size: 12px; cursor: pointer; }
.theme-option>span:not(.theme-check) { flex: 1; }
.theme-option small { display: block; margin-top: 1px; color: var(--muted); font-size: 10px; line-height: 1.7; }
.theme-control .theme-option:hover { background: var(--bg-soft); }
.theme-control .theme-option[aria-checked="true"] { background: var(--accent-subtle); font-weight: 700; }
.theme-option[aria-checked="true"] small { color: var(--ink); }
.theme-check { margin-inline-start: auto; color: var(--accent-text); visibility: hidden; }
.theme-option[aria-checked="true"] .theme-check { visibility: visible; }
.theme-control :is(.theme-toggle,.theme-option):focus-visible { outline: 2px solid var(--outline-focus); outline-offset: 2px; }
.parna-logo,.brand-icon { fill: currentColor; stroke: none; color: var(--accent-text); background: transparent; flex: none; }
.brand-icon { width: 36px; height: 36px; }
.site-header .header-actions,.admin-topbar-actions { display: flex; align-items: center; gap: 12px; flex: none; }
.site-header .header-actions { margin-inline-start: auto; }
.site-header .header-entry { color: var(--accent-text); font-size: 13px; white-space: nowrap; }
.admin-topbar-account { display: inline-flex; align-items: center; gap: 7px; color: var(--ink); font-size: 12px; }
.admin-topbar-account span { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media(max-width:760px) {
  .site-header .header-inner { gap: 10px; }
  .site-header .header-actions { gap: 8px; }
  .site-header .header-entry { font-size: 11px; }
  .admin-topbar-actions { gap: 6px; }
  .admin-topbar-account span { max-width: 58px; }
}
@media(forced-colors:active) {
  .theme-control :is(.theme-toggle,.theme-option) { border: 1px solid ButtonText; }
  .theme-option[aria-checked="true"] { outline: 1px solid Highlight; }
}
