:root {
  color-scheme: light;
  --navy: #1a365d;
  --gold: #c4a265;
  --paper: #faf8f3;
  --ink: #24364e;
  --muted: #596578;
  --line: #deded8;
  --white: #fffefa;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-size: 16px; line-height: 1.6; }
a { color: var(--navy); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
button, input, textarea { font: inherit; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; }
h1, h2, p { margin: 0; }
h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.65rem, 4vw, 2.2rem); line-height: 1.2; color: var(--navy); }
h2 { font-size: 1.15rem; line-height: 1.3; color: var(--navy); }
.skip-link { position: absolute; z-index: 2; top: -100px; left: 1rem; background: var(--white); padding: .6rem 1rem; }
.skip-link:focus { top: .5rem; }
.site-header { border-top: 4px solid var(--gold); border-bottom: 1px solid var(--line); background: var(--white); }
.header-inner { max-width: 1192px; margin: auto; padding: 1rem 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: flex; align-items: baseline; gap: .8rem; color: var(--navy); }
.brand-name { font-family: Georgia, "Times New Roman", serif; font-weight: 700; font-size: 2rem; line-height: 1; }
.brand-dot { color: #94713a; }
.brand-detail { font-size: .95rem; border-left: 1px solid var(--line); padding-left: .8rem; }
nav { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
nav a { font-size: .9rem; display: inline-flex; align-items: center; min-height: 44px; }
.page { max-width: 1192px; margin: auto; padding: 2rem 1.5rem; min-height: 70vh; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 292px; gap: 1.5rem; align-items: start; }
.editor-panel, .posts-panel, .auth-panel { background: var(--white); border: 1px solid var(--line); border-radius: 12px; }
.editor-panel { padding: 1.75rem; min-width: 0; border-top: 3px solid var(--gold); }
.panel-heading, .list-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .8rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .13em; font-size: .7rem; font-weight: 700; color: var(--muted); margin-bottom: .6rem; }
.post-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .7rem; margin: 1.15rem 0 .65rem; font-size: .82rem; color: var(--muted); }
.badge { border: 1px solid #cdd6e2; background: #edf2f8; color: var(--navy); border-radius: 5px; padding: .15rem .55rem; font-weight: 650; }
.badge[data-state="published"] { color: #285440; border-color: #c6d9cc; background: #eef5ed; }
.badge[data-state="changes"] { color: #72531e; border-color: #ddcaa5; background: #faf2e3; }
.help { color: var(--muted); font-size: .875rem; line-height: 1.55; }
.public-link { display: inline-block; margin-top: .4rem; font-size: .9rem; padding: .25rem 0; }
.field { margin-top: 1.5rem; }
.label-row { display: flex; gap: .6rem; align-items: baseline; justify-content: space-between; margin-bottom: .45rem; }
label { font-weight: 700; color: var(--navy); }
.count { color: var(--muted); font-size: .75rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.field-help { margin-bottom: .7rem; }
input, textarea { display: block; width: 100%; min-width: 0; color: var(--ink); background: #fff; border: 1px solid #aeb9c7; border-radius: 6px; padding: .8rem .9rem; }
input { font-size: 1.125rem; }
textarea { min-height: 360px; resize: vertical; line-height: 1.8; font-size: 1.05rem; tab-size: 4; }
input::placeholder, textarea::placeholder { color: #687587; opacity: 1; }
input:focus, textarea:focus { border-color: var(--navy); }
input[readonly], textarea[readonly] { background: #f5f4ef; }
.editor-actions { display: flex; justify-content: flex-end; gap: .75rem; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 1.5rem; padding-top: 1.25rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 6px; border: 1px solid transparent; padding: .6rem 1rem; line-height: 1.35; font-size: .9rem; font-weight: 650; cursor: pointer; text-align: center; }
.button-primary { color: #fff; background: var(--navy); border-color: var(--navy); min-width: 115px; }
.button-primary:hover { background: #244a7c; }
.button-secondary { color: var(--navy); background: #fff; border-color: #aeb9c7; }
.button-secondary:hover { background: #f0f3f7; border-color: var(--navy); }
.button-quiet { color: var(--navy); background: transparent; padding: .5rem .4rem; }
.button-quiet:hover { text-decoration: underline; text-underline-offset: .2em; }
.button:disabled { opacity: .55; cursor: wait; }
.save-help { margin-top: .85rem; }
.posts-panel { padding: 1.15rem; min-width: 0; }
.posts-panel > .help { margin: .35rem 0 1rem; }
.post-list { margin: 0; padding: 0; list-style: none; max-height: 640px; overflow-y: auto; }
.post-list li + li { margin-top: .6rem; }
.post-choice { display: block; text-align: start; width: 100%; border: 1px solid var(--line); border-radius: 7px; background: #fff; padding: .8rem; cursor: pointer; color: var(--ink); }
.post-choice:hover { border-color: var(--navy); background: #f6f8fa; }
.post-choice[aria-current="true"] { border-color: var(--navy); background: #edf2f8; box-shadow: inset 3px 0 var(--navy); }
.post-choice:disabled { opacity: .65; cursor: wait; }
.post-title { display: block; line-height: 1.45; font-size: .95rem; overflow-wrap: anywhere; white-space: pre-wrap; }
.post-summary { display: block; color: var(--muted); font-size: .75rem; line-height: 1.55; margin-top: .35rem; }
.empty-state { padding: 1.15rem .2rem; color: var(--muted); font-size: .9rem; }
.list-footnote { font-size: .78rem; color: var(--muted); border-top: 1px solid var(--line); margin-top: 1.25rem; padding-top: 1rem; }
.notice { border: 1px solid; border-radius: 7px; padding: .9rem 1rem; margin-bottom: 1.1rem; overflow-wrap: anywhere; font-size: .95rem; }
.notice-success { background: #eef5ed; border-color: #c6d9cc; color: #285440; }
.notice-error { background: #fff0ed; border-color: #ddb1a9; color: #873427; }
.notice-warning { background: #faf2e3; border-color: #ddcaa5; color: #72531e; margin-top: 1rem; }
.notice-warning .button { margin-top: .7rem; }
.auth-panel { max-width: 620px; margin: 2rem auto; padding: 2rem; }
.auth-panel h1 { margin-bottom: 1rem; }
.auth-panel .button { margin-top: 1rem; }
.site-footer { max-width: 1192px; margin: 0 auto; padding: 0 1.5rem 1.5rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .7rem; color: var(--muted); font-size: .78rem; }
@media (max-width: 850px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .post-list { max-height: 400px; }
  .page { padding-top: 1.25rem; }
}
@media (max-width: 480px) {
  .header-inner { padding: .85rem 1rem; gap: .5rem; align-items: flex-start; }
  .brand { flex-direction: column; gap: .35rem; }
  .brand-detail { border: 0; padding: 0; font-size: .8rem; }
  nav { gap: .3rem .75rem; justify-content: flex-end; }
  .page { padding: 1rem .75rem; }
  .editor-panel { padding: 1.1rem .9rem; }
  .panel-heading { align-items: flex-start; }
  .panel-heading > .button { padding: .6rem .7rem; }
  .eyebrow { font-size: .65rem; letter-spacing: .08em; }
  textarea { min-height: 320px; }
  .editor-actions { gap: .6rem; }
  .editor-actions .button { flex: 1 1 100px; }
  .auth-panel { padding: 1.25rem; margin: 1rem 0; }
  .site-footer { padding: .5rem 1rem 1.25rem; }
}
