:root {
  --ink: #17232a;
  --ink-soft: #5b6869;
  --paper: #f4efe5;
  --paper-bright: #fffdf8;
  --line: #d8d2c6;
  --line-dark: #b9b1a3;
  --teal: #315c57;
  --terracotta: #b96347;
  --brass: #b58b42;
  --success: #386858;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: "Iowan Old Style", "Baskerville", "Palatino Linotype", "Songti SC", "STSong", serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--paper); color: var(--ink); font-family: var(--sans); }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
svg { width: 17px; height: 17px; stroke-width: 1.7; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }
.skip-link { position: fixed; z-index: 20; top: -100px; left: 12px; padding: 10px 14px; color: var(--paper-bright); background: var(--ink); opacity: 0; pointer-events: none; text-decoration: none; transition: top 160ms ease; }
.skip-link:focus { top: 10px; opacity: 1; pointer-events: auto; }
.admin-shell { width: min(1320px, calc(100% - 48px)); margin: 0 auto; }
.admin-header { position: sticky; z-index: 10; top: 0; display: flex; align-items: center; justify-content: space-between; min-height: 76px; border-bottom: 1px solid var(--line); background: rgba(244, 239, 229, .96); backdrop-filter: blur(12px); }
.brand { color: var(--ink); text-decoration: none; font-family: var(--serif); font-size: 1.25rem; }
.brand span { margin-left: 10px; color: var(--ink-soft); font-family: var(--sans); font-size: .58rem; letter-spacing: .14em; }
.header-actions, .icon-button, .primary-button, .quiet-button, .studio-tab { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.security-state { display: inline-flex; align-items: center; gap: 7px; color: var(--success); font-size: .7rem; }
.security-state::before { width: 7px; height: 7px; border-radius: 50%; background: currentColor; content: ""; }
.security-state.is-insecure { color: var(--terracotta); }
.text-button, .quiet-button { min-height: 40px; border: 1px solid var(--line); padding: 9px 13px; color: var(--ink); background: transparent; }
.text-button:hover, .quiet-button:hover { border-color: var(--ink); background: rgba(23, 35, 42, .05); }
.login-view { width: min(480px, 100%); margin: clamp(70px, 13vh, 140px) auto; }
.auth-mark { display: grid; width: 48px; height: 48px; place-items: center; margin-bottom: 26px; border: 1px solid var(--line-dark); color: var(--teal); }
.auth-mark svg { width: 23px; height: 23px; }
.kicker { margin: 0 0 14px; color: var(--terracotta); font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; }
h1 { margin: 0; font-family: var(--serif); font-size: clamp(2.6rem, 6vw, 4.8rem); font-weight: 400; line-height: .98; }
.muted { max-width: 40rem; color: var(--ink-soft); line-height: 1.75; }
.auth-form { display: grid; gap: 18px; margin-top: 30px; }
label { display: grid; gap: 8px; color: var(--ink-soft); font-size: .76rem; letter-spacing: .04em; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 0; padding: 13px 14px; color: var(--ink); outline: none; background: var(--paper-bright); }
textarea { resize: vertical; line-height: 1.7; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(49, 92, 87, .12); }
input:disabled, button:disabled { cursor: not-allowed; opacity: .5; }
.primary-button { min-height: 42px; border: 1px solid var(--ink); padding: 10px 16px; color: var(--paper-bright); background: var(--ink); }
.primary-button:hover:not(:disabled) { background: var(--teal); }
.transport-warning { display: grid; grid-template-columns: 22px 1fr; gap: 12px; margin-top: 26px; padding: 16px; border: 1px solid rgba(185, 99, 71, .5); color: var(--terracotta); background: rgba(185, 99, 71, .06); }
.transport-warning p { margin: 0; font-size: .8rem; line-height: 1.65; }
.form-message, .editor-message { min-height: 1.5em; color: var(--teal); font-size: .82rem; }
.is-error { color: var(--terracotta); }
.studio { padding: 46px 0 80px; }
.studio-heading { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 28px; }
.studio-heading h1 { font-size: clamp(2.8rem, 5vw, 4.5rem); }
.studio-tabs { display: flex; border-bottom: 1px solid var(--line-dark); }
.studio-tab { min-height: 46px; border: 0; border-bottom: 3px solid transparent; padding: 10px 16px; color: var(--ink-soft); background: transparent; }
.studio-tab:hover { color: var(--ink); }
.studio-tab.is-active { color: var(--ink); border-bottom-color: var(--brass); }
.workspace-command { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 62px; border-top: 1px solid var(--line); }
.workspace-command p { margin: 0; color: var(--ink-soft); font-size: .8rem; }
.studio-grid { display: grid; grid-template-columns: 310px minmax(0, 1fr); min-height: 650px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--paper-bright); }
.compact-editor-grid { min-height: 560px; }
.content-list-panel { border-right: 1px solid var(--line); }
.list-heading { display: flex; justify-content: space-between; padding: 17px 18px; color: var(--ink-soft); font-size: .72rem; letter-spacing: .08em; }
.list-controls { display: grid; grid-template-columns: minmax(0, 1fr) 104px; gap: 8px; padding: 0 12px 12px; border-bottom: 1px solid var(--line); }
.list-controls.single-control { grid-template-columns: 1fr; }
.list-controls input, .list-controls select { min-height: 40px; padding: 9px 10px; font-size: .74rem; }
.list-empty { margin: 0; padding: 28px 18px; color: var(--ink-soft); font-size: .78rem; text-align: center; }
.content-list { display: grid; }
.content-item { display: grid; gap: 9px; width: 100%; border: 0; border-top: 1px solid var(--line); padding: 17px 18px; color: var(--ink); text-align: left; background: transparent; }
.content-item:hover, .content-item.is-selected { background: #eee8db; }
.content-item-title { overflow: hidden; font-family: var(--serif); font-size: 1.08rem; text-overflow: ellipsis; white-space: nowrap; }
.content-item-meta { display: flex; align-items: center; gap: 7px; color: var(--ink-soft); font-size: .68rem; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--brass); }
.status-dot.draft, .status-dot.unlit { background: var(--terracotta); }
.status-dot.lit { background: var(--success); }
.editor-panel { min-width: 0; padding: 26px clamp(22px, 4vw, 56px); }
.editor-empty { display: grid; min-height: 520px; place-content: center; justify-items: center; color: var(--ink-soft); }
.empty-mark { display: grid; width: 58px; height: 58px; place-items: center; margin-bottom: 15px; border: 1px solid var(--line); color: var(--brass); }
.empty-mark svg { width: 24px; height: 24px; }
.editor-toolbar { position: sticky; z-index: 5; top: 76px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: -26px clamp(-56px, -4vw, -22px) 42px; padding: 15px clamp(22px, 4vw, 56px); border-bottom: 1px solid var(--line); color: var(--ink-soft); background: rgba(255, 253, 248, .96); backdrop-filter: blur(10px); font-size: .72rem; }
.editor-state { display: inline-flex; align-items: center; gap: 8px; }
.editor-state::before { width: 7px; height: 7px; border-radius: 50%; background: var(--brass); content: ""; }
.editor-state.is-dirty::before { background: var(--terracotta); }
.toolbar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.danger-action { color: var(--terracotta); }
.title-field { gap: 12px; }
.title-field input { border: 0; border-bottom: 1px solid var(--line); padding: 0 0 15px; font-family: var(--serif); font-size: clamp(2rem, 5vw, 3.5rem); background: transparent; }
.field-row { display: grid; grid-template-columns: minmax(180px, .7fr) minmax(0, 1fr); gap: 18px; margin-top: 27px; }
.body-field { margin-top: 28px; }
.body-field textarea { min-height: 300px; }
.editor-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 12px; color: var(--ink-soft); font-size: .72rem; }
.career-summary-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 28px; }
.editor-section { margin-top: 28px; border-top: 1px solid var(--line); }
.editor-section summary { display: flex; min-height: 58px; align-items: center; justify-content: space-between; color: var(--ink); font-family: var(--serif); font-size: 1.2rem; cursor: pointer; list-style: none; }
.editor-section summary::-webkit-details-marker { display: none; }
.editor-section summary::after { content: "+"; color: var(--brass); font-family: var(--sans); font-size: 1.2rem; }
.editor-section[open] summary::after { content: "−"; }
.section-fields { display: grid; gap: 19px; padding: 5px 0 24px; }
.section-fields .field-row { margin-top: 0; }
label small { color: var(--ink-soft); font-size: .68rem; line-height: 1.5; }
.rating-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 5px 0 25px; }
.rating-fields input { font-family: var(--serif); font-size: 1.2rem; }
fieldset { margin: 0; border: 1px solid var(--line); padding: 16px; }
legend { padding: 0 7px; color: var(--ink-soft); font-size: .75rem; }
.skill-checks > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 18px; }
.skill-checks label, .status-choice label { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.skill-checks input, .status-choice input { width: 16px; height: 16px; accent-color: var(--teal); }
.status-choice { display: flex; gap: 24px; margin-top: 26px; }
.status-choice legend { float: left; margin-right: 18px; }
.linked-careers { margin: 20px 0 0; color: var(--ink-soft); font-size: .76rem; }
.preview-backdrop { position: fixed; z-index: 40; inset: 0; display: flex; justify-content: flex-end; background: rgba(23, 35, 42, .58); backdrop-filter: blur(7px); }
.preview-panel { position: relative; width: min(680px, 100%); height: 100%; overflow-y: auto; padding: 78px 72px 70px; color: var(--ink); background: var(--paper-bright); box-shadow: -20px 0 70px rgba(23, 35, 42, .2); }
.preview-close { position: absolute; top: 24px; right: 24px; }
.icon-only { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid var(--line); color: var(--ink); background: transparent; }
.preview-kicker { color: var(--terracotta); font-size: .68rem; }
.preview-panel h2 { margin: 18px 0 16px; font-family: var(--serif); font-size: 2.75rem; font-weight: 500; line-height: 1.2; }
.preview-intro { margin: 0; padding-bottom: 28px; border-bottom: 1px solid var(--line); color: var(--ink-soft); font-family: var(--serif); font-size: 1.08rem; line-height: 1.8; }
.preview-body { margin-top: 34px; font-family: var(--serif); font-size: 1.04rem; line-height: 2; }
.preview-body p { margin: 0 0 1.4em; }

@media (max-width: 860px) {
  .admin-shell { width: min(100% - 28px, 720px); }
  .admin-header { min-height: 64px; }
  .brand span, .security-state { display: none; }
  .studio { padding-top: 32px; }
  .studio-heading { align-items: flex-start; flex-direction: column; }
  .studio-tabs { width: 100%; overflow-x: auto; }
  .studio-tab { flex: 1 0 auto; }
  .workspace-command { align-items: flex-start; flex-direction: column; padding: 14px 0; }
  .workspace-command .primary-button { width: 100%; }
  .studio-grid { display: block; min-height: 0; }
  .content-list-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .content-list { max-height: 260px; overflow-y: auto; }
  .list-controls { grid-template-columns: 1fr 110px; }
  .content-item { padding: 13px; }
  .editor-panel { padding: 22px 16px 34px; }
  .editor-empty { min-height: 170px; }
  .editor-toolbar { top: 64px; align-items: stretch; flex-direction: column; margin: -22px -16px 30px; padding: 13px 16px; }
  .toolbar-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #post-form .toolbar-actions { grid-template-columns: auto 1fr 1fr; }
  .toolbar-actions button { min-height: 44px; }
  .field-row, .career-summary-fields, .rating-fields { grid-template-columns: 1fr; }
  .title-field input { font-size: 2.1rem; }
  .editor-footer { align-items: stretch; flex-direction: column; }
  .skill-checks > div { grid-template-columns: 1fr; }
  .preview-panel { padding: 74px 24px 50px; }
  .preview-panel h2 { font-size: 2.15rem; }
}

.page-settings-panel { max-width: 1060px; border: 1px solid var(--line); }
.upload-preview { width: min(100%, 560px); max-height: 280px; object-fit: cover; border: 1px solid var(--line); }
.upload-message { font-size: .8rem; }
.upload-message.is-error { color: #a23732; }
.comment-admin-toolbar { display: flex; align-items: center; gap: 28px; margin: 20px 0; }
.comment-admin-toolbar label { display: flex; gap: 12px; align-items: center; white-space: nowrap; }
.comment-admin-toolbar select { width: 150px; }
.admin-comment-list { display: grid; gap: 16px; }
.admin-comment-item { border: 1px solid var(--line); background: white; padding: 24px; }
.admin-comment-item header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; }
.admin-comment-item header span { color: var(--ink-soft); font-size: .75rem; }
.admin-comment-item > p { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.9; }
.comment-actions { display: flex; gap: 12px; flex-wrap: wrap; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
