/* Shared interface foundations. Tailwind utilities remain available. */
:root {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #243335;
  background: #f7f8fa;
  font-size: 14px;
  font-synthesis: none;
  --accent: #176b60;
  --accent-soft: #eaf3ef;
  --muted: #69777c;
  --line: #e3e8e9;
  --surface: #fff;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: #104e46; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 1.9rem; font-weight: 650; line-height: 1.25; letter-spacing: -.045em; margin-bottom: 10px; }
h2 { font-size: 1.05rem; font-weight: 650; letter-spacing: -.015em; margin-bottom: 14px; }
h3 { font-size: 1rem; font-weight: 600; }
p { line-height: 1.65; margin-bottom: 16px; }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 3px solid #73aaa0; outline-offset: 3px; }
[hidden] { display: none !important; }
.skip-link { position: fixed; left: 16px; top: -100px; z-index: 20; padding: 12px; background: white; }
.skip-link:focus { top: 12px; }
.shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: #fff; border-right: 1px solid var(--line); padding: 28px 16px 20px; position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 12px; text-decoration: none; color: #233536; margin-bottom: 40px; }
.brand-mark { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 10px; background: var(--accent); color: white; font-size: 27px; font-weight: 750; letter-spacing: -4px; padding-right: 4px; }
.brand strong { display: block; font-size: 20px; font-weight: 700; letter-spacing: -.06em; line-height: 1.05; }
.brand small { margin: 4px 0 0; font-size: 10px; letter-spacing: .06em; color: var(--muted); }
.nav-label { color: #6d7b7f; font-size: .69rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; margin: 0 12px 10px; }
.nav-label-admin { margin-top: 32px; }
.main-navigation .nav-link { display: flex; gap: 10px; align-items: center; padding: 11px 12px; border-radius: 7px; color: #5d6b70; font-size: .88rem; text-decoration: none; margin: 3px 0; line-height: 1.35; }
.nav-icon { width: 18px; height: 18px; flex: 0 0 auto; }
.main-navigation .nav-link:hover { background: #f5f7f7; color: #243335; }
.main-navigation .nav-link.is-active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.sidebar-footer { margin-top: auto; padding: 24px 12px 0; color: #8a9598; font-size: .72rem; display: flex; align-items: center; gap: 7px; }
.main-column { min-width: 0; }
.topbar { height: 72px; border-bottom: 1px solid var(--line); background: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 36px; gap: 16px; }
.workspace-label { font-size: .88rem; color: #58686b; font-weight: 500; }
.account-menu { display: flex; align-items: center; gap: 10px; font-size: .82rem; color: var(--muted); }
.avatar { border: 1px solid #dde6e2; border-radius: 50%; width: 29px; height: 29px; background: #f1f5f3; display: grid; place-items: center; color: #59756a; font-size: .75rem; }
.content { width: 100%; max-width: 1400px; padding: 32px 36px 56px; margin: 0 auto; min-width: 0; }
.content > h1 { margin-top: 12px; }
.content > h1 + p, .page-heading p:not(.eyebrow) { color: var(--muted); max-width: 68ch; }
.content > .eyebrow { margin-top: 28px; margin-bottom: 8px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin: 28px 0 24px; }
.page-heading:first-child { margin-top: 0; }
.page-heading h1 { margin: 4px 0 8px; }
.page-heading p { margin-bottom: 0; }
.eyebrow { font-size: .68rem; font-weight: 600; letter-spacing: .11em; color: #71817d; margin-bottom: 8px; }
.breadcrumbs { color: #9aa5a7; font-size: .8rem; margin-bottom: 10px; }
.breadcrumbs a { text-decoration: none; color: #718084; }
.breadcrumbs a:hover { color: var(--accent); }
.tabs { display: flex; gap: 24px; padding: 0; border-bottom: 1px solid var(--line); overflow-x: auto; white-space: nowrap; scrollbar-width: thin; }
.tabs .nav-link { padding: 14px 0; color: var(--muted); text-decoration: none; font-size: .85rem; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs .nav-link:hover { color: var(--accent); }
.tabs .nav-link.is-active { border-bottom-color: var(--accent); color: var(--accent); font-weight: 600; }
.card, form:not(.button_to), .table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin: 20px 0; }
.card, form:not(.button_to) { padding: 24px; }
.card > :last-child { margin-bottom: 0; }
.card > :first-child { margin-top: 0; }
form .card, .card form:not(.button_to) { border: 0; padding: 0; background: transparent; }
form.button_to { display: inline-block; background: transparent; border: 0; padding: 0; margin: 0; }
.card-title { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.card-title h2 { margin: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: white; margin: 20px 0; text-align: left; font-size: .88rem; }
.table-wrap table { margin: 0; }
th { padding: 13px 18px; color: #69777c; background: #fcfdfd; font-size: .74rem; font-weight: 500; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 16px 18px; border-bottom: 1px solid #edf0f1; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafcfb; }
td a { color: #293e3c; font-weight: 550; text-decoration: none; }
td a:hover { color: var(--accent); text-decoration: underline; }
td small { max-width: 50ch; }
td button, td .button { padding: 6px 10px; font-size: .75rem; }
label { display: block; margin: 18px 0 7px; color: #495b5e; font-size: .85rem; font-weight: 500; }
input, select, textarea { padding: 10px 12px; border: 1px solid #d9e1e3; border-radius: 6px; max-width: 100%; background: #fff; color: #293c3e; min-height: 40px; }
input::placeholder, textarea::placeholder { color: #98a2a7; }
form input:not([type=checkbox]):not([type=submit]), form select { width: 100%; }
textarea { width: 100%; min-height: 100px; line-height: 1.6; resize: vertical; }
input[type=submit], button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--accent); color: white; border: 1px solid var(--accent); border-radius: 6px; padding: 10px 16px; font-size: .85rem; font-weight: 550; line-height: 1.3; text-decoration: none; cursor: pointer; margin-top: 16px; min-height: 39px; white-space: normal; }
input[type=submit]:hover, button:hover, .button:hover { background: #135a50; color: #fff; }
.page-heading .button, .actions .button, .actions button, .actions input[type=submit], .filters input[type=submit], .topbar button { margin-top: 0; }
.secondary, button.secondary, input.secondary { background: white; color: #526565; border: 1px solid #dce3e4; }
.secondary:hover, button.secondary:hover, input.secondary:hover { background: #f0f5f3; color: var(--accent); border-color: #c6d6d0; }
.button-quiet, button.button-quiet { background: transparent; border-color: transparent; color: #7a888c; padding: 6px 9px; font-size: .8rem; min-height: 32px; }
.button-quiet:hover, button.button-quiet:hover { background: #f3f6f5; color: #3d5d56; }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
form.filters { padding: 14px 16px; margin-bottom: 16px; }
.filters input:not([type=submit]):not([type=checkbox]), .filters select { width: auto; min-width: 150px; max-width: 230px; flex: 1; font-size: .82rem; }
.filters input[type=search] { min-width: 200px; }
.filters label { margin: 0 6px; font-size: .8rem; font-weight: 400; }
.filters input[type=submit] { margin: 0; background: white; color: #4d6361; border-color: #d6e1dd; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.checkbox-label input { width: 15px; min-height: 15px; accent-color: var(--accent); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin: 24px 0; }
legend { color: #637574; font-size: .83rem; padding: 0 6px; }
.field-hint { color: #6e7c82; font-size: .79rem; margin-top: 8px; line-height: 1.6; }
.form-error, .flash-alert { color: #9f483d; background: #fff1ed; padding: 12px 16px; border-radius: 6px; }
.flash { padding: 12px 16px; background: #eaf4ee; color: #396956; border: 1px solid #dcebe1; border-radius: 7px; font-size: .88rem; }
.muted { color: var(--muted); }
small { display: block; color: #6e7a80; font-size: .76rem; line-height: 1.6; margin-top: 5px; font-weight: 400; }
.metadata, .tags { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: .81rem; color: var(--muted); }
.badge { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 5px; background: #f0f3f5; color: #65767b; font-size: .72rem; font-weight: 500; line-height: 1.4; white-space: nowrap; }
.badge[data-status=PUBLISHED], .badge[data-status=APPROVED], .badge-success { color: #317761; background: #edf6ef; }
.badge[data-status=IN_REVIEW] { color: #9a762f; background: #fcf5e7; }
.badge[data-status=REJECTED], .danger { background: #fff0ee; color: #aa5a50; }
.notice { background: #f0f5f4; border-left: 2px solid #a6c6b9; border-radius: 4px; padding: 14px 18px; font-size: .86rem; line-height: 1.7; color: #627a73; margin: 20px 0; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 18px; }
.project-grid .card { margin: 0; display: flex; flex-direction: column; align-items: flex-start; }
.project-grid .card > p { color: var(--muted); font-size: .88rem; }
.project-grid .card .button { margin-top: auto; }
.project-grid .card h2 a { color: inherit; text-decoration: none; }
.empty-state { padding: 44px 24px; text-align: center; border: 1px dashed #d8e2e0; border-radius: 10px; margin: 24px 0; color: var(--muted); background: #fcfdfd; }
.empty-state h2 { color: #526762; }
.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.actions form:not(.button_to) { flex: 1; min-width: 240px; margin: 0; padding: 20px; }
.workflow { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 18px; margin: 20px 0; padding: 18px 20px; background: white; border: 1px solid var(--line); border-radius: 8px; }
.workflow p { margin: 0; font-size: .82rem; color: var(--muted); }
.workflow strong { color: #425f56; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 258px; align-items: start; gap: 20px; }
.article-layout .card { margin-top: 0; }
.article-layout aside { font-size: .8rem; }
.article-layout aside p { overflow-wrap: anywhere; }
.version-list { padding: 0; list-style: none; margin: 0; }
.version-list li { padding: 12px 0; border-bottom: 1px solid #edf0f1; }
.version-list li:last-child { border: 0; }
.prose { line-height: 1.8; overflow-wrap: anywhere; }
.prose h1 { font-size: 1.65rem; }
.prose h2 { font-size: 1.2rem; margin-top: 1.8em; font-weight: 650; }
.prose h3 { font-size: 1.05rem; margin-top: 1.5em; }
.prose p { margin: 1em 0; }
.prose ul, .card > ol { list-style: disc; padding-left: 22px; }
.prose ol, .card > ol, .details-card > ol { list-style: decimal; padding-left: 22px; }
.prose li, .card > ol li, .details-card > ol li { padding: 3px 0; line-height: 1.7; }
.prose pre { padding: 16px; background: #f5f7f8; border-radius: 6px; overflow: auto; }
.prose blockquote { border-left: 2px solid #bacfc8; padding-left: 16px; color: var(--muted); }
.prose table { display: block; overflow: auto; }
article code { font-size: .87em; }
code { overflow-wrap: anywhere; font-size: .84em; }
.editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 18px 0 8px; }
.editor-heading label { margin: 0; }
.editor-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.editor-tools button { padding: 5px 8px; font-size: .75rem; min-height: 29px; margin: 0; background: #f5f7f7; color: #647b74; border-color: var(--line); }
.markdown-input { font-family: ui-monospace, monospace; font-size: .88rem; line-height: 1.8; min-height: 360px; }
.markdown-preview { padding: 24px; border: 1px solid var(--line); background: #fbfcfc; border-radius: 6px; margin-top: 16px; }
details { margin: 20px 0; border-top: 1px solid var(--line); padding-top: 16px; }
summary { cursor: pointer; font-size: .88rem; font-weight: 500; color: #617670; }
details[open] > summary { margin-bottom: 18px; }
.details-card { background: white; border: 1px solid var(--line); border-radius: 8px; padding: 18px 22px; }
.details-card > :last-child { margin-bottom: 0; }
.details-card > form:not(.button_to) { border: 0; padding: 0; background: transparent; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 24px; font-size: .8rem; color: #6e7a80; margin: 24px 0; }
.source-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .88rem; line-height: 1.7; color: #5c6c71; }
.test-question { min-height: 135px; font-size: 1rem; }
.stat-value { font-size: 2.7rem; letter-spacing: -.06em; color: #304f45; line-height: 1; margin: 4px 0 12px; font-weight: 600; }
.section-heading { margin-top: 32px; margin-bottom: 18px; }
.menu-toggle { display: none; }
.guest .shell { display: flex; flex-direction: column; align-items: center; padding: 40px 20px; }
.guest .sidebar { height: auto; position: static; padding: 0; border: 0; background: transparent; }
.guest .brand { margin-bottom: 24px; }
.guest .main-column { width: 100%; max-width: 440px; }
.guest .content { background: white; padding: 32px; border: 1px solid var(--line); border-radius: 12px; }
.guest form:not(.button_to) { padding: 0; border: 0; }
.guest .content > a { font-size: .83rem; }
@media (min-width: 1600px) { .content { padding-right: 52px; padding-left: 52px; } }
@media (max-width: 1100px) {
  .shell { grid-template-columns: 200px minmax(0, 1fr); }
  .sidebar { padding-right: 10px; padding-left: 10px; }
  .main-navigation .nav-link { font-size: .8rem; }
  .content { padding: 28px 24px 44px; }
  .topbar { padding: 0 24px; }
  .article-layout { grid-template-columns: minmax(0, 1fr) 220px; }
  .tabs { gap: 20px; }
}
@media (max-width: 900px) {
  .article-layout { grid-template-columns: 1fr; }
  .article-layout aside { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .article-layout aside .card { margin-bottom: 0; }
}
@media (max-width: 760px) {
  .shell { display: block; }
  .sidebar { position: static; height: auto; padding: 16px 20px; display: grid; grid-template-columns: 1fr auto; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { margin: 0; padding: 0; }
  .brand-mark { width: 31px; height: 31px; font-size: 24px; }
  .brand strong { font-size: 18px; }
  .brand small { font-size: 9px; }
  .menu-toggle { display: inline-flex; margin: 0; padding: 7px 12px; min-height: 33px; }
  .main-navigation { display: none; grid-column: 1 / -1; padding-top: 24px; }
  .navigation-open .main-navigation { display: block; }
  .nav-label-admin { margin-top: 20px; }
  .sidebar-footer { display: none; }
  .topbar { height: 55px; padding: 0 20px; }
  .account-menu { gap: 6px; }
  .account-email { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .73rem; }
  .avatar { display: none; }
  .content { padding: 24px 20px 40px; }
  h1 { font-size: 1.65rem; }
  .page-heading { align-items: flex-start; gap: 16px; margin: 24px 0 20px; }
  .page-heading .button { flex: 0 0 auto; padding: 9px 12px; font-size: .78rem; }
  .page-heading p { font-size: .85rem; }
  .tabs { gap: 23px; margin-right: -20px; padding-right: 20px; }
  .tabs .nav-link { font-size: .8rem; }
  .card, form:not(.button_to) { padding: 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .filters input:not([type=submit]):not([type=checkbox]), .filters select { max-width: 100%; flex-basis: calc(50% - 10px); min-width: 120px; }
  .filters input[type=search] { flex-basis: 100%; }
  .filters label { margin-left: 0; }
  .workflow { align-items: flex-start; }
  .article-layout aside { grid-template-columns: 1fr; }
  th, td { padding: 13px 14px; }
  .content > table, details > table { display: block; overflow-x: auto; }
  .actions { gap: 8px; }
  .actions form:not(.button_to) { min-width: 100%; }
  .project-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: no-preference) { a, button, input[type=submit] { transition: background-color .12s, color .12s, border-color .12s; } }
