@font-face {
  font-family: Stem;
  src: url("Stem-SemiLight.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Stem;
  src: url("Stem-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
:root {
  color-scheme: light;
  --ink: #171714;
  --cream: #f3efe8;
  --paper: #faf7f2;
  --line: #cfc3b3;
  --muted: #6b5e51;
  --sand: #c9b8a2;
  --deep: #141413;
  --focus: #745737;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 400 16px/1.5 Stem, Arial, sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
::selection { background: var(--sand); color: var(--ink); }
.visually-hidden { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.top { background: var(--deep); color: var(--cream); }
.top-inner { width: min(91.2%, 1560px); margin: auto; min-height: 88px; display: flex; align-items: center; gap: 16px; }
.brand { display: block; width: 205px; height: auto; filter: brightness(0) invert(1); }
.top-label { margin-left: auto; color: #e2d7c9; font-size: 14px; }
.button.top-button { color: var(--cream); border-color: #978a7b; background: transparent; }
.button.top-button:hover { background: #38322c; }
.shell { width: min(91.2%, 1560px); display: grid; grid-template-columns: minmax(0, 232px) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); margin: auto; }
.sidebar { border-right: 1px solid var(--line); padding: 35px 18px 24px 0; min-width: 0; }
.navigation { display: grid; gap: 4px; }
.navigation button { text-align: left; min-height: 44px; border: 1px solid transparent; background: transparent; color: var(--ink); padding: 8px 14px; border-radius: 999px; }
.navigation button:hover { border-color: var(--line); }
.navigation [aria-current] { background: var(--ink); color: var(--cream); }
.picker { display: grid; gap: 8px; margin-top: 22px; }
.picker label { margin-top: 4px; }
label, .route, .draft-label, .feedback { font-size: 14px; }
input:not([type=file]), select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 3px;
}
.page-list { list-style: none; padding: 0; margin: 0; max-height: 66vh; overflow-y: auto; overscroll-behavior: contain; }
.page-list button { width: 100%; text-align: left; display: block; min-height: 44px; background: transparent; border: 0; border-bottom: 1px solid var(--line); padding: 8px; overflow-wrap: anywhere; color: var(--ink); line-height: 1.3; }
.page-list button:hover, .page-list [aria-current] { background: var(--paper); }
.page-list small { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; }
#editor { min-width: 0; padding: 32px 0 40px; }
h1, h2, p { margin-top: 0; }
.page-head { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
h1 { font-weight: 400; font-size: clamp(32px, 4vw, 59px); line-height: 1.08; letter-spacing: -.035em; overflow-wrap: anywhere; margin-bottom: 8px; }
h2 { font-size: 22px; line-height: 1.2; font-weight: 500; margin-bottom: 8px; }
.route { color: var(--muted); margin-bottom: 0; }
.publish-tools, .article-tools, .preview-tools, .dialog-heading, .dialog-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.publish-tools, .article-tools { padding-block: 11px; border-bottom: 1px solid var(--line); }
.article-tools select { width: auto; max-width: 100%; }
.preview-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 9px 12px; margin: 18px 0 12px; }
.preview-head p { margin: 0; color: var(--muted); }
#preview { width: 100%; height: max(420px, 70vh); background: var(--paper); border: 1px solid var(--line); display: block; }
body.preview-expanded { overflow: hidden; }
.preview-area.is-expanded {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--cream);
}
.preview-area.is-expanded .preview-head {
  align-items: center;
  margin: 0;
  padding: 8px clamp(12px, 3vw, 36px);
  border-bottom: 1px solid var(--line);
}
.preview-area.is-expanded .preview-head h2 { margin: 0; }
.preview-area.is-expanded .preview-head p { display: none; }
.preview-area.is-expanded #preview { height: 100%; min-height: 0; border: 0; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; border: 1px solid var(--ink); border-radius: 999px; padding: 8px 15px; font-size: 14px; font-weight: 500; line-height: 1.2; }
.primary, .secondary:hover { background: var(--ink); color: var(--cream); }
.primary:hover, .secondary { background: transparent; color: var(--ink); }
.text-button { border-color: transparent; background: transparent; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.text-button:hover { background: var(--paper); }
.button:disabled, .button:disabled:hover { opacity: .55; cursor: default; }
.feedback, .draft-label { color: var(--muted); }
.feedback:empty { margin: 0; }
.feedback[data-error=true] { color: #833416; }
.login { width: min(91.2%, 460px); margin: 70px auto; }
.login form { display: grid; gap: 10px; }
.login .button { justify-self: start; margin-top: 8px; }
dialog {
  width: min(94vw, 680px);
  max-height: 88vh;
  background: var(--cream);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: clamp(16px, 3vw, 28px);
}
dialog::backdrop { background: #17171490; }
.dialog-heading { justify-content: space-between; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.dialog-heading h2 { margin: 0 0 6px; }
.dialog-form { display: grid; gap: 8px; }
.dialog-form textarea { resize: vertical; }
.dialog-form p { margin: 4px 0; }
.dialog-actions { margin: 8px 0; }
.photo-list { display: grid; gap: 8px; padding: 0; margin: 10px 0; list-style: none; }
.photo-row { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 12px; padding-block: 8px; border-bottom: 1px solid var(--line); }
.photo-row img { width: 66px; height: 48px; object-fit: cover; background: var(--sand); }
.photo-row span { flex: 1 1 110px; min-width: 0; overflow-wrap: anywhere; }
.dialog-photo { display: block; width: min(100%, 400px); max-height: 220px; object-fit: contain; object-position: left; margin-bottom: 12px; }
@media (max-width: 850px) {
  .shell { display: block; }
  .sidebar { border: 0; border-bottom: 1px solid var(--line); padding: 13px 0; }
  .navigation { display: flex; flex-wrap: wrap; }
  .picker { margin-top: 10px; }
  .page-list { max-height: 150px; }
  #editor { padding-top: 20px; }
}
@media (max-width: 480px) {
  .top-inner { min-height: 70px; gap: 8px; }
  .brand { width: min(38vw, 160px); }
  .top-label { line-height: 1.2; }
  .top-button { padding-inline: 9px; }
  .navigation button { padding-inline: 10px; }
}
