:root {
  color-scheme: light;
  --paper: #f3f0e8;
  --paper-raised: #faf8f2;
  --ink: #17221c;
  --ink-soft: #405048;
  --muted: #778078;
  --line: #d7d4ca;
  --line-dark: #a9aea7;
  --moss: #2d4a39;
  --acid: #c8ef77;
  --blue: #d9e8f2;
  --amber: #f5df9e;
  --red: #9b3a32;
  --radius: 3px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Baskerville, Georgia, serif;
  --sans: "Avenir Next", Avenir, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--paper); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.assignment-row {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 12px;
  margin-block: 20px;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--paper-raised);
}
.assignment-row label { flex: 1 1 200px; min-width: 0; }
.assignment-row select { width: 100%; }
.assignment-row .security-note { flex-basis: 100%; margin: 0; }

.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;
}

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

.boot-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--serif);
  font-size: 26px;
  font-style: italic;
  animation: breathe 1.3s ease-in-out infinite alternate;
}

@keyframes breathe { to { transform: scale(.92); opacity: .65; } }

.wordmark {
  font-family: var(--serif);
  font-size: 22px;
  font-style: italic;
  letter-spacing: -.04em;
}

.environment-pill {
  padding: 5px 7px 4px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.environment-pill--dark { border-color: #65746b; color: #b7c0b9; }

.overline, .kicker, .rail-label {
  margin: 0;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(420px, 560px);
}

.login-note {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(48px, 8vw, 120px);
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
  position: relative;
}

.login-note::after {
  content: "";
  position: absolute;
  width: 34vw;
  aspect-ratio: 1;
  right: -14vw;
  bottom: -15vw;
  border: 1px solid #5a695f;
  border-radius: 50%;
  box-shadow: 0 0 0 5vw var(--ink), 0 0 0 calc(5vw + 1px) #44534a, 0 0 0 10vw var(--ink), 0 0 0 calc(10vw + 1px) #34433a;
}

.login-note .kicker { color: #aeb8b0; }

.login-note h1 {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 28px 0 20px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(50px, 6.5vw, 104px);
  line-height: .93;
  letter-spacing: -.06em;
}

.login-copy {
  position: relative;
  z-index: 1;
  max-width: 530px;
  margin: 0;
  color: #c4ccc6;
  font-size: 15px;
  line-height: 1.7;
}

.safety-sequence {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  max-width: 650px;
  margin: 64px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid #516158;
  border-left: 1px solid #516158;
}

.safety-sequence li {
  min-height: 82px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border-right: 1px solid #516158;
  border-bottom: 1px solid #516158;
  font-size: 12px;
  letter-spacing: .02em;
}

.safety-sequence span { color: var(--acid); font-family: var(--mono); font-size: 10px; }

.login-panel {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 42px clamp(32px, 5vw, 72px);
  background: var(--paper-raised);
  border-left: 1px solid var(--line);
}

.login-panel__heading, .rail-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.login-form { display: grid; gap: 22px; }
.login-form h2 { margin: 8px 0 6px; font-family: var(--serif); font-size: 42px; font-weight: 400; letter-spacing: -.04em; }
.login-form p { margin: 0; color: var(--muted); font-size: 13px; }

label { display: grid; gap: 7px; }
label > span, .slug-field + span {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
label small { color: var(--muted); text-transform: none; letter-spacing: 0; }

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  background: #fffef9;
  color: var(--ink);
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

input, select { min-height: 45px; padding: 10px 12px; }
textarea { padding: 12px; line-height: 1.55; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--moss); box-shadow: 0 0 0 3px rgb(45 74 57 / 12%); }

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
}

.button:disabled { cursor: not-allowed; opacity: .45; }
.button--ink { background: var(--ink); color: #fff; }
.button--ink:hover:not(:disabled) { background: #2a382f; }
.button--outline { border-color: var(--line-dark); background: transparent; }
.button--outline:hover:not(:disabled) { border-color: var(--ink); }
.button--approve { background: var(--acid); border-color: #9ec557; color: #20301f; }
.button--approve:hover:not(:disabled) { background: #d5fa8b; }

.form-message { min-height: 18px; color: var(--red) !important; }
.security-note { max-width: 390px; color: var(--muted); font-family: var(--mono); font-size: 9px; line-height: 1.65; }

.desk { min-height: 100vh; display: grid; grid-template-columns: 232px minmax(0, 1fr); }

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px 20px;
  background: var(--ink);
  color: var(--paper);
}

.rail-label { margin-top: 56px; color: #89978e; }
.rail-nav { display: grid; margin: 14px -8px 0; }
.rail-nav__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 43px;
  padding: 0 10px;
  border: 0;
  border-left: 2px solid transparent;
  background: transparent;
  color: #aeb8b0;
  cursor: pointer;
  text-align: left;
}
.rail-nav__item:hover { color: #fff; }
.rail-nav__item.is-active { border-left-color: var(--acid); color: #fff; background: rgb(255 255 255 / 5%); }
.rail-nav__item b { font-family: var(--mono); font-size: 10px; font-weight: 400; color: #89978e; }

.rail-footer { display: grid; gap: 25px; }
.safety-card { display: flex; align-items: flex-start; gap: 10px; padding: 14px; border: 1px solid #45554b; }
.safety-card__signal { flex: 0 0 auto; width: 8px; height: 8px; margin-top: 3px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 0 3px rgb(200 239 119 / 12%); }
.safety-card strong { display: block; font-size: 10px; letter-spacing: .05em; text-transform: uppercase; }
.safety-card p { margin: 6px 0 0; color: #9eaaa2; font-size: 10px; line-height: 1.45; }

.text-button { width: fit-content; padding: 0; border: 0; border-bottom: 1px solid currentColor; background: transparent; color: inherit; cursor: pointer; font-size: 11px; }
.text-button--danger { color: var(--red); }

.workspace { min-width: 0; }
.workspace-header {
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 34px;
  border-bottom: 1px solid var(--line);
}
.workspace-header h1 { margin: 4px 0 0; font-family: var(--serif); font-weight: 400; font-size: 36px; letter-spacing: -.04em; }
.workspace-header__actions { display: flex; align-items: center; gap: 18px; }
.signed-in { max-width: 220px; overflow: hidden; text-overflow: ellipsis; font-family: var(--mono); font-size: 9px; color: var(--muted); }

.status-banner { margin: 16px 34px 0; padding: 11px 14px; border: 1px solid #c6a95d; background: #fff5d8; font-size: 12px; line-height: 1.5; }
.status-banner.is-error { border-color: #d8a49f; background: #fff0ee; color: #762d27; }
.status-banner.is-success { border-color: #9cb88e; background: #edf7e8; color: #30482b; }

.workspace-grid { display: grid; grid-template-columns: minmax(270px, 360px) minmax(520px, 1fr); min-height: calc(100vh - 112px); }
.queue { border-right: 1px solid var(--line); background: #ece9e1; }
.queue-toolbar { min-height: 65px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.queue-toolbar h2 { margin: 0; font-size: 12px; letter-spacing: .07em; text-transform: uppercase; }
.compact-field select { min-height: 32px; width: 122px; padding: 5px 8px; border-color: var(--line); background: transparent; font-size: 10px; }
.queue-list { display: grid; }
.queue-item {
  width: 100%;
  display: grid;
  gap: 9px;
  padding: 20px 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.queue-item:hover { background: rgb(255 255 255 / 40%); }
.queue-item.is-active { background: var(--paper-raised); box-shadow: inset 3px 0 var(--ink); }
.queue-item__meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-family: var(--mono); font-size: 9px; color: var(--muted); text-transform: uppercase; }
.state-group { display: inline-flex; align-items: center; gap: 7px; }
.queue-item h3 { margin: 0; font-family: var(--serif); font-size: 19px; line-height: 1.2; font-weight: 500; letter-spacing: -.025em; }
.queue-item p { margin: 0; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.state-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-dark); }
.state-dot--approved { background: #7ea150; }
.state-dot--published { background: #5b89a6; }
.state-dot--archived { background: #9b726e; }
.empty-queue { min-height: 300px; display: grid; place-content: center; justify-items: center; padding: 30px; text-align: center; color: var(--muted); }
.empty-queue > span { font-size: 24px; color: var(--line-dark); }
.empty-queue h3 { margin: 12px 0 5px; color: var(--ink); font-family: var(--serif); font-size: 22px; font-weight: 400; }
.empty-queue p { max-width: 230px; margin: 0; font-size: 11px; line-height: 1.5; }

.editor { padding: 34px clamp(30px, 5vw, 70px) 80px; background: var(--paper-raised); }
.editor-empty { min-height: 60vh; display: grid; place-content: center; justify-items: start; max-width: 500px; }
.editor-empty h2 { margin: 10px 0; font-family: var(--serif); font-size: 42px; line-height: 1.05; font-weight: 400; letter-spacing: -.045em; }
.editor-empty > p:last-child { color: var(--muted); font-size: 13px; }
#editor-form { display: grid; gap: 22px; max-width: 820px; }
.editor-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.editor-heading h2 { margin: 10px 0 0; font-family: var(--serif); font-size: 34px; font-weight: 400; letter-spacing: -.04em; }
.editor-state-line { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 9px; color: var(--muted); text-transform: uppercase; }
.state-badge { display: inline-flex; padding: 5px 7px 4px; border: 1px solid var(--line-dark); border-radius: 999px; color: var(--ink-soft); }
.state-badge[data-state="approved"] { background: #edf5db; border-color: #a8bd78; }
.state-badge[data-state="published"] { background: var(--blue); border-color: #9db9c8; }
.state-badge[data-state="archived"] { background: #f1e1df; border-color: #caa29d; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.slug-field { display: flex; align-items: center; min-height: 45px; border: 1px solid var(--line-dark); border-radius: var(--radius); background: #fffef9; overflow: hidden; }
.slug-field:focus-within { border-color: var(--moss); box-shadow: 0 0 0 3px rgb(45 74 57 / 12%); }
.slug-field span { flex: 0 0 auto; padding-left: 12px; font-family: var(--mono); font-size: 10px; color: var(--muted); }
.slug-field input { min-width: 0; border: 0; box-shadow: none; }
.body-field { min-height: 360px; font-family: var(--mono); font-size: 12px; line-height: 1.65; }
.seo-fields { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.seo-fields summary { padding: 14px 0; cursor: pointer; font-size: 11px; font-weight: 600; }
.details-content { display: grid; gap: 18px; padding: 4px 0 20px; }

.preview-panel { border: 1px solid var(--line); background: #fffef9; }
.preview-panel__heading { display: flex; justify-content: space-between; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 9px; text-transform: uppercase; color: var(--muted); }
#content-preview { padding: 32px clamp(22px, 5vw, 54px) 42px; }
#content-preview h3 { margin: 0; max-width: 680px; font-family: var(--serif); font-size: 38px; line-height: 1.06; font-weight: 400; letter-spacing: -.045em; }
#preview-summary { margin: 15px 0 28px; max-width: 600px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.preview-body { border-top: 1px solid var(--line); padding-top: 24px; font-family: var(--serif); font-size: 16px; line-height: 1.7; }
.preview-body h2, .preview-body h3 { margin: 1.5em 0 .5em; font-size: 23px !important; }
.preview-body p { margin: 0 0 1em; }
.preview-body ul { padding-left: 20px; }

.editor-actions { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-top: 6px; }
.editor-actions > div { display: flex; align-items: center; gap: 12px; }
.save-state { font-family: var(--mono); font-size: 9px; color: var(--muted); }
.approval-note { margin: -13px 0 0; color: var(--muted); font-family: var(--mono); font-size: 9px; line-height: 1.55; text-align: right; }

@media (max-width: 1100px) {
  .desk { grid-template-columns: 190px minmax(0, 1fr); }
  .workspace-grid { grid-template-columns: 290px minmax(460px, 1fr); }
  .editor { padding-inline: 28px; }
}

@media (max-width: 850px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-note { min-height: auto; padding: 56px 32px; }
  .login-note h1 { font-size: clamp(48px, 13vw, 74px); }
  .login-panel { grid-row: 1; min-height: min(620px, 100dvh); }
  .desk { display: block; }
  .rail { position: static; height: auto; min-height: 0; padding: 17px 20px; }
  .rail > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
  .rail-brand { gap: 12px; }
  .rail-label, .rail-footer .safety-card { display: none; }
  .rail-footer { display: flex; justify-content: flex-end; margin-top: 12px; }
  .rail-nav { display: flex; margin: 0; }
  .rail-nav__item { min-width: 110px; border-left: 0; border-bottom: 2px solid transparent; }
  .rail-nav__item.is-active { border-left: 0; border-bottom-color: var(--acid); }
  .workspace-grid { grid-template-columns: 1fr; }
  .queue { border-right: 0; border-bottom: 1px solid var(--line); }
  .queue-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .safety-sequence { grid-template-columns: 1fr; }
  .login-panel { padding-inline: 24px; }
  .rail > div:first-child { align-items: flex-start; }
  .rail-nav { display: grid; }
  .rail-nav__item { min-height: 32px; }
  .environment-pill--dark { display: none; }
  .workspace-header { align-items: flex-start; padding: 22px 20px; }
  .workspace-header__actions { display: grid; justify-items: end; }
  .signed-in { max-width: 130px; }
  .status-banner { margin-inline: 20px; }
  .queue-list { grid-template-columns: 1fr; }
  .editor { padding: 28px 20px 60px; }
  .field-row { grid-template-columns: 1fr; }
  .editor-actions { align-items: stretch; flex-direction: column; }
  .editor-actions > div { justify-content: space-between; }
  .approval-note { text-align: left; }
  #content-preview h3 { font-size: 31px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
