:root {
  --paper: #f7f3ea;
  --warm-white: #fffdf8;
  --sand: #ead9bc;
  --sand-soft: #f2e8d7;
  --ink: #2b1a10;
  --muted: #79695f;
  --burnt: #682a16;
  --brown: #8a5837;
  --olive: #7e6606;
  --camel: #c68b4c;
  --brick: #9e3b1b;
  --line: rgba(43, 26, 16, 0.13);
  --shadow: 0 22px 70px rgba(62, 38, 22, 0.09);
  --radius: 22px;
  --sidebar: 248px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--paper); }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.eyebrow {
  margin: 0 0 8px;
  color: var(--brown);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.muted { color: var(--muted); }

.brand-mark {
  display: flex;
  align-items: end;
  gap: 5px;
  width: 54px;
  height: 56px;
}

.brand-mark span {
  display: block;
  width: 12px;
  border-radius: 2px 2px 0 0;
  background: var(--camel);
}

.brand-mark span:nth-child(1) { height: 27px; }
.brand-mark span:nth-child(2) { height: 52px; background: var(--brown); }
.brand-mark span:nth-child(3) { height: 36px; background: var(--burnt); }
.brand-mark-small { width: 38px; height: 40px; gap: 3px; }
.brand-mark-small span { width: 8px; }
.brand-mark-small span:nth-child(1) { height: 19px; }
.brand-mark-small span:nth-child(2) { height: 36px; }
.brand-mark-small span:nth-child(3) { height: 26px; }

.login-shell {
  display: grid;
  grid-template-columns: minmax(380px, 1.05fr) minmax(420px, 0.95fr);
  min-height: 100vh;
}

.login-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(48px, 8vw, 120px);
  overflow: hidden;
  color: var(--warm-white);
  background: var(--ink);
}

.login-brand::after {
  content: "";
  position: absolute;
  right: -16%;
  bottom: -25%;
  width: 520px;
  aspect-ratio: 1;
  border: 1px solid rgba(234, 217, 188, 0.22);
  border-radius: 50%;
  box-shadow: 0 0 0 70px rgba(234, 217, 188, 0.045), 0 0 0 150px rgba(234, 217, 188, 0.025);
}

.login-brand .brand-mark { margin-bottom: 42px; }
.login-brand .eyebrow { color: var(--camel); }
.login-brand h1 {
  max-width: 680px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.8rem, 5.3vw, 5.5rem);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.login-brand > p:not(.eyebrow) {
  max-width: 570px;
  margin: 30px 0;
  color: rgba(255, 253, 248, 0.7);
  font-size: 1.08rem;
  line-height: 1.7;
}

.login-proof { display: flex; align-items: center; gap: 10px; font-size: 0.88rem; }
.proof-dot, .system-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #8d9b55;
  box-shadow: 0 0 0 5px rgba(141, 155, 85, 0.13);
}

.login-panel { display: grid; place-items: center; padding: 42px; background: var(--paper); }
.login-card { width: min(430px, 100%); }
.login-card h2 { margin: 0; font: 500 2.3rem/1.15 Georgia, serif; }
.login-card > .muted { margin: 12px 0 30px; line-height: 1.55; }

.stack-form { display: grid; gap: 18px; }
label { display: grid; gap: 8px; color: var(--ink); font-size: 0.87rem; font-weight: 700; }
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 14px;
  color: var(--ink);
  background: var(--warm-white);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
input:focus, textarea:focus { border-color: var(--camel); box-shadow: 0 0 0 4px rgba(198, 139, 76, 0.14); }
textarea { resize: vertical; line-height: 1.55; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 45px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 17px;
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { opacity: 0.48; cursor: not-allowed; }
.button-primary { color: var(--warm-white); background: var(--burnt); box-shadow: 0 8px 24px rgba(104, 42, 22, 0.18); }
.button-primary:hover:not(:disabled) { background: #57200f; }
.button-secondary { color: var(--burnt); border-color: rgba(104, 42, 22, 0.25); background: transparent; }
.button-ghost { color: var(--ink); border-color: var(--line); background: rgba(255, 253, 248, 0.55); }
.button-soft { color: var(--burnt); border-color: rgba(104, 42, 22, 0.18); background: rgba(234, 217, 188, 0.46); }
.button-danger { color: var(--warm-white); background: var(--brick); }
.button-full { width: 100%; margin-top: 4px; }

.alert { margin: 18px 0; padding: 12px 14px; border-radius: 10px; font-size: 0.88rem; line-height: 1.45; }
.alert-error { color: var(--brick); border: 1px solid rgba(158, 59, 27, 0.2); background: rgba(158, 59, 27, 0.08); }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10;
  display: flex;
  width: var(--sidebar);
  flex-direction: column;
  padding: 27px 18px 20px;
  color: var(--warm-white);
  background: var(--ink);
}

.sidebar-brand { display: flex; align-items: center; gap: 13px; padding: 0 8px 30px; text-decoration: none; }
.sidebar-brand strong { display: block; font-family: Georgia, serif; font-size: 1.28rem; font-weight: 500; }
.sidebar-brand small { display: block; margin-top: 3px; color: var(--camel); font-size: 0.61rem; font-weight: 800; letter-spacing: 0.15em; }
.sidebar nav { display: grid; gap: 6px; }
.nav-link {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 9px;
  border-radius: 11px;
  padding: 11px 12px;
  color: rgba(255, 253, 248, 0.64);
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
}
.nav-link:hover, .nav-link.active { color: var(--warm-white); background: rgba(255, 253, 248, 0.08); }
.nav-link b { display: grid; place-items: center; min-width: 22px; height: 22px; border-radius: 20px; color: var(--ink); background: var(--camel); font-size: 0.7rem; }
.nav-icon { color: var(--camel); font-family: Georgia, serif; font-size: 0.72rem; }
.sidebar-bottom { display: grid; gap: 18px; margin-top: auto; }
.system-state { display: flex; align-items: center; gap: 12px; padding: 14px 10px; border-top: 1px solid rgba(255, 255, 255, 0.09); }
.system-state strong, .system-state small { display: block; }
.system-state strong { font-size: 0.75rem; }
.system-state small { margin-top: 3px; color: rgba(255, 253, 248, 0.5); font-size: 0.68rem; }
.system-dot.system-warning { background: var(--brick); }
.logout-button { width: 100%; border: 0; padding: 9px; color: rgba(255, 253, 248, 0.55); background: transparent; cursor: pointer; font-size: 0.75rem; }

.main-content { margin-left: var(--sidebar); padding: 34px clamp(24px, 4vw, 62px) 70px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 25px; margin-bottom: 30px; }
.topbar h1 { margin: 0; font: 500 clamp(2rem, 3.5vw, 3.3rem)/1 Georgia, serif; letter-spacing: -0.035em; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.owner-avatar { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--warm-white); background: var(--burnt); font-size: 0.78rem; font-weight: 800; }

.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 42px; }
.metric-card { position: relative; overflow: hidden; min-height: 132px; border: 1px solid var(--line); border-radius: 16px; padding: 20px; background: rgba(255, 253, 248, 0.63); }
.metric-card.metric-accent { color: var(--warm-white); border-color: var(--burnt); background: var(--burnt); }
.metric-label { display: block; font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.09em; opacity: 0.7; }
.metric-card strong { display: block; margin: 10px 0 6px; font: 500 2.25rem/1 Georgia, serif; }
.metric-card small { color: var(--muted); font-size: 0.72rem; }
.metric-card.metric-accent small { color: rgba(255, 253, 248, 0.63); }

.page-section { margin-top: 44px; scroll-margin-top: 22px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.section-heading h2 { margin: 0; font: 500 clamp(1.65rem, 3vw, 2.35rem)/1.1 Georgia, serif; }
.section-heading > p { margin: 0 0 3px; color: var(--muted); font-size: 0.8rem; }
.text-link { color: var(--brown); font-size: 0.78rem; font-weight: 800; }

.approval-list { display: grid; gap: 22px; }
.approval-card {
  display: grid;
  grid-template-columns: minmax(310px, 0.8fr) minmax(430px, 1.2fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--warm-white);
  box-shadow: var(--shadow);
  transition: opacity 300ms ease, transform 300ms ease;
}
.approval-card.approval-complete { opacity: 0; transform: translateY(-8px); }
.approval-visual-column { min-height: 100%; padding: 18px; background: var(--sand-soft); }
.approval-media { display: flex; height: 100%; min-height: 520px; flex-direction: column; margin: 0; }
.approval-media img { width: 100%; flex: 1; min-height: 0; border-radius: 14px; object-fit: contain; background: var(--paper); }
.approval-media figcaption { display: flex; justify-content: space-between; gap: 12px; padding: 12px 3px 0; color: var(--muted); font-size: 0.68rem; }
.media-empty { display: grid; min-height: 520px; place-content: center; justify-items: center; border: 1px dashed rgba(104, 42, 22, 0.23); border-radius: 15px; padding: 35px; text-align: center; }
.media-empty-icon { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 20px; border-radius: 50%; color: var(--warm-white); background: var(--brown); font: 500 1.6rem Georgia, serif; }
.media-empty strong { font-family: Georgia, serif; font-size: 1.2rem; }
.media-empty span { max-width: 270px; margin-top: 8px; color: var(--muted); font-size: 0.77rem; line-height: 1.5; }

.approval-content-column { padding: clamp(24px, 3.5vw, 42px); }
.approval-topline { display: flex; align-items: center; gap: 10px; margin-bottom: 27px; }
.network-badge { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px 5px 6px; font-size: 0.7rem; font-weight: 800; }
.network-badge b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; color: var(--warm-white); background: var(--ink); font-family: Georgia, serif; }
.account-name { color: var(--muted); font-size: 0.72rem; }
.integrity-badge { margin-left: auto; border-radius: 999px; padding: 6px 10px; font-size: 0.66rem; font-weight: 800; }
.integrity-valid { color: #59600a; background: rgba(126, 102, 6, 0.11); }
.integrity-invalid { color: var(--brick); background: rgba(158, 59, 27, 0.11); }
.approval-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.approval-heading h2 { max-width: 600px; margin: 0; font: 500 clamp(1.65rem, 3vw, 2.45rem)/1.08 Georgia, serif; letter-spacing: -0.025em; }
.version-chip { flex: none; border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; color: var(--muted); font-size: 0.66rem; font-weight: 700; }

.schedule-panel { display: flex; align-items: center; gap: 14px; margin: 25px 0 18px; border: 1px solid rgba(198, 139, 76, 0.25); border-radius: 13px; padding: 13px 15px; background: rgba(234, 217, 188, 0.26); }
.schedule-icon { position: relative; width: 32px; height: 32px; flex: none; border: 2px solid var(--brown); border-radius: 9px; }
.schedule-icon::before { content: ""; position: absolute; inset: 7px 4px auto; height: 2px; background: var(--brown); }
.schedule-panel small, .schedule-panel strong, .schedule-panel span { display: block; }
.schedule-panel small { color: var(--muted); font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.09em; }
.schedule-panel strong { margin: 2px 0; font-size: 0.85rem; }
.schedule-panel span { color: var(--muted); font-size: 0.66rem; }
.review-row { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 22px; }
.review-pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 6px 9px; font-size: 0.64rem; font-weight: 800; }
.review-pass { color: #59600a; background: rgba(126, 102, 6, 0.1); }
.review-block { color: var(--brick); background: rgba(158, 59, 27, 0.1); }
.review-pending { color: var(--muted); background: rgba(121, 105, 95, 0.1); }

.post-copy { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 20px 0; }
.section-label { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.65rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.post-body { margin-top: 13px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.92rem; line-height: 1.72; }
.context-details { margin: 14px 0; color: var(--muted); font-size: 0.75rem; }
.context-details summary { color: var(--brown); cursor: pointer; font-weight: 800; }
.context-details p { line-height: 1.55; }
.approval-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.approval-legal { margin: 11px 0 0; color: var(--muted); font-size: 0.65rem; line-height: 1.45; }

.revision-dialog { width: min(590px, calc(100% - 30px)); border: 0; border-radius: 20px; padding: 0; color: var(--ink); background: var(--warm-white); box-shadow: 0 28px 90px rgba(43, 26, 16, 0.3); }
.revision-dialog::backdrop { background: rgba(43, 26, 16, 0.68); backdrop-filter: blur(5px); }
.revision-dialog form { position: relative; padding: 35px; }
.revision-dialog h3 { margin: 0; font: 500 1.85rem/1.15 Georgia, serif; }
.revision-dialog .muted { margin: 10px 0 22px; font-size: 0.82rem; line-height: 1.55; }
.dialog-close { position: absolute; top: 18px; right: 20px; border: 0; color: var(--muted); background: none; font-size: 1.5rem; cursor: pointer; }
.dialog-actions { display: flex; justify-content: end; gap: 10px; margin-top: 20px; }

.empty-state { border: 1px dashed rgba(104, 42, 22, 0.22); border-radius: var(--radius); padding: 58px 30px; text-align: center; background: rgba(255, 253, 248, 0.45); }
.empty-symbol { display: grid; place-items: center; width: 55px; height: 55px; margin: 0 auto 18px; border-radius: 50%; color: var(--warm-white); background: var(--olive); font-size: 1.25rem; }
.empty-state h2 { margin: 0; font: 500 1.7rem Georgia, serif; }
.empty-state > p:last-child { max-width: 600px; margin: 12px auto 0; color: var(--muted); line-height: 1.55; }

.content-list { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 253, 248, 0.58); }
.content-row { position: relative; display: flex; align-items: center; gap: 18px; min-height: 92px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.content-row:last-child { border-bottom: 0; }
.content-state-line { width: 4px; align-self: stretch; border-radius: 4px; background: var(--camel); }
.content-state-line.status-published { background: var(--olive); }
.content-state-line.status-scheduled { background: var(--brown); }
.content-main { min-width: 0; flex: 1; }
.content-pillar { color: var(--brown); font-size: 0.62rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }
.content-main h3 { margin: 5px 0 9px; overflow: hidden; font: 600 1rem/1.25 Georgia, serif; text-overflow: ellipsis; white-space: nowrap; }
.content-meta { display: flex; flex-wrap: wrap; gap: 8px 13px; color: var(--muted); font-size: 0.67rem; }
.status-chip { border-radius: 999px; padding: 2px 7px; color: var(--brown); background: rgba(198, 139, 76, 0.12); font-weight: 800; }
.status-chip.status-published { color: #59600a; background: rgba(126, 102, 6, 0.1); }
.external-link { flex: none; color: var(--brown); font-size: 0.72rem; font-weight: 800; }
.list-empty { padding: 30px; color: var(--muted); text-align: center; }

.toast { position: fixed; z-index: 50; right: 24px; bottom: 24px; max-width: 430px; border-radius: 12px; padding: 13px 16px; color: var(--warm-white); box-shadow: 0 16px 50px rgba(43, 26, 16, 0.23); font-size: 0.8rem; font-weight: 700; }
.toast-success { background: #59600a; }
.toast-error { background: var(--brick); }
.toast[hidden] { display: none; }

.error-page { display: grid; min-height: 100vh; place-content: center; justify-items: start; padding: 30px; }
.error-page h1 { max-width: 680px; margin: 0; font: 500 clamp(2.2rem, 6vw, 4.5rem)/1 Georgia, serif; }
.error-page p:not(.eyebrow) { max-width: 600px; margin: 22px 0; color: var(--muted); line-height: 1.6; }

@media (max-width: 1150px) {
  :root { --sidebar: 210px; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .approval-card { grid-template-columns: 1fr; }
  .approval-media, .media-empty { min-height: 430px; }
}

@media (max-width: 760px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { min-height: 43vh; padding: 42px 28px; }
  .login-brand h1 { font-size: clamp(2.5rem, 12vw, 4rem); }
  .login-brand > p:not(.eyebrow) { margin: 20px 0; }
  .login-panel { padding: 42px 25px 55px; }
  .sidebar { position: static; width: auto; min-height: auto; padding: 16px 18px; }
  .sidebar-brand { padding: 0; }
  .sidebar nav, .sidebar-bottom { display: none; }
  .main-content { margin-left: 0; padding: 24px 16px 55px; }
  .topbar { align-items: start; }
  .topbar .eyebrow { font-size: 0.58rem; }
  .topbar-actions .button { display: none; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .metric-card { min-height: 115px; padding: 16px; }
  .metric-card strong { font-size: 1.8rem; }
  .section-heading { align-items: start; }
  .section-heading > p, .text-link { display: none; }
  .approval-visual-column { padding: 10px; }
  .approval-media, .media-empty { min-height: 360px; }
  .approval-content-column { padding: 24px 19px; }
  .approval-topline { flex-wrap: wrap; }
  .integrity-badge { margin-left: 0; }
  .approval-heading { display: block; }
  .version-chip { display: inline-block; margin-top: 12px; }
  .approval-actions { display: grid; grid-template-columns: 1fr; }
  .approval-actions form, .approval-actions .button { width: 100%; }
  .dialog-actions { display: grid; grid-template-columns: 1fr; }
  .content-row { align-items: start; padding: 15px; }
  .external-link { display: none; }
}

@media (max-width: 430px) {
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .metric-card small { display: none; }
  .approval-media, .media-empty { min-height: 300px; }
  .post-body { max-height: 410px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

.visual-action-bar { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 12px; }
.visual-action-bar .button { width: 100%; }
.schedule-panel > div { min-width: 0; flex: 1; }
.inline-action { flex: none; border: 0; padding: 8px 0 8px 12px; color: var(--burnt); background: transparent; font-size: 0.72rem; font-weight: 800; cursor: pointer; }
.editing-toolbar { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.editing-toolbar .button { min-height: 40px; padding: 9px 13px; font-size: 0.72rem; }
.revision-dialog { max-height: calc(100vh - 30px); overflow: auto; }
.compact-dialog { width: min(500px, calc(100% - 30px)); }
.post-editor { min-height: 390px; font-size: 0.9rem; line-height: 1.65; }
.file-picker input[type="file"] { padding: 11px; background: var(--paper); }
.file-picker small { color: var(--muted); font-weight: 500; }
.rights-check { grid-template-columns: auto 1fr; align-items: start; margin-top: 17px; border: 1px solid rgba(126, 102, 6, 0.2); border-radius: 12px; padding: 13px; background: rgba(126, 102, 6, 0.06); }
.rights-check input { width: auto; margin: 3px 0 0; accent-color: var(--olive); }
.rights-check span { font-size: 0.78rem; line-height: 1.45; }

@media (max-width: 760px) {
  .visual-action-bar { grid-template-columns: 1fr; }
  .editing-toolbar { display: grid; grid-template-columns: 1fr; }
  .editing-toolbar .button { width: 100%; }
  .revision-dialog form { padding: 30px 20px 22px; }
  .post-editor { min-height: 330px; }
}