/* UAT Journals – design system. Brand tokens come from the University crest (see app/lib/brand.php).
   Pages use these classes only; no page defines its own colours or fonts. */

:root {
  /* brand */
  --green: #1e7b45; --green-dark: #0f4d2b; --green-deep: #082a17; --green-tint: #e9f5ee; --green-tint-2: #f4faf6;
  --red: #d3202b; --red-tint: #fdeced; --gold: #f7e017; --gold-ink: #5c5100; --gold-tint: #fffbd6;
  /* neutrals */
  --ink: #13241a; --ink-2: #33473b; --mute: #5d6f64; --line: #dfe8e2; --line-2: #eef3f0; --bg: #ffffff; --bg-2: #f6f9f7;
  /* status */
  --blue: #1d5fa8; --blue-tint: #e8f0fb; --amber: #8a5a00; --amber-tint: #fff4dc; --orange: #a6440f; --orange-tint: #fdeee4;
  /* type */
  --font-ui: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-read: "Source Serif 4", Georgia, "Times New Roman", serif;
  /* shape */
  --radius: 10px; --radius-sm: 6px; --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(16, 40, 26, .06), 0 4px 16px rgba(16, 40, 26, .06);
  --focus: 0 0 0 3px rgba(30, 123, 69, .35);
  --container: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.6 var(--font-ui); }
img { max-width: 100%; height: auto; }
a { color: var(--green); text-underline-offset: 2px; }
a:hover { color: var(--green-dark); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(26px, 3.4vw, 36px); letter-spacing: -.01em; }
h2 { font-size: 22px; } h3 { font-size: 18px; } h4 { font-size: 15px; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; background: var(--green-dark); color: #fff; padding: 10px 14px; border-radius: var(--radius-sm); z-index: 100; }
.skip-link:focus { top: 12px; color: #fff; }

/* ---------- layout ---------- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 820px; }
.section { padding: 48px 0; }
.section-sm { padding: 28px 0; }
.section-alt { background: var(--bg-2); border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.grid { display: grid; gap: 20px; }
.grid-2 { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); }
.grid-3 { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.with-aside { display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.muted { color: var(--mute); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
@media (max-width: 960px) { .with-aside { grid-template-columns: 1fr; } }

/* ---------- brand stripe (green / gold / red, as on the crest ribbon) ---------- */
.brand-stripe { height: 4px; background: linear-gradient(90deg, var(--green) 0 60%, var(--gold) 60% 80%, var(--red) 80% 100%); }

/* ---------- header ---------- */
.site-header { background: #fff; position: sticky; top: 0; z-index: 40; box-shadow: 0 1px 0 var(--line); }
.topbar { background: var(--green-deep); color: #cfe3d6; font-size: 12.5px; }
.topbar-in { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 34px; }
.topbar a { color: #e6f2ea; text-decoration: none; } .topbar a:hover { color: var(--gold); }
.topbar-links { display: flex; gap: 8px; align-items: center; }
.mainbar-in { display: flex; align-items: center; gap: 20px; min-height: 76px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; flex-shrink: 0; }
.brand img { width: 52px; height: 52px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 19px; font-weight: 800; letter-spacing: -.01em; color: var(--green-dark); }
.brand-text small { font-size: 12px; color: var(--mute); }
.site-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.site-nav > a:not(.btn) { padding: 8px 12px; border-radius: var(--radius-sm); color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 14px; }
.site-nav > a:not(.btn):hover { background: var(--green-tint-2); color: var(--green-dark); }
.site-nav > a[aria-current="page"] { color: var(--green); box-shadow: inset 0 -2px 0 var(--green); border-radius: 0; }
.nav-search input { width: 190px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; font: inherit; font-size: 13.5px; background: var(--bg-2); }
.nav-search input:focus { background: #fff; border-color: var(--green); outline: none; box-shadow: var(--focus); }
.nav-toggle { display: none; margin-left: auto; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; cursor: pointer; flex-direction: column; justify-content: center; align-items: center; gap: 4px; }
.nav-toggle span:not(.sr-only) { display: block; width: 18px; height: 2px; background: var(--ink); }
@media (max-width: 1080px) {
  .nav-toggle { display: inline-flex; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fff; flex-direction: column; align-items: stretch; padding: 12px 20px 20px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .site-nav.is-open { display: flex; }
  .site-nav > a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--green); }
  .nav-search input { width: 100%; }
  .mainbar { position: relative; }
}
@media (max-width: 520px) { .brand-text small { display: none; } .topbar-uni { display: none; } .topbar-in { justify-content: flex-end; } }

/* ---------- footer ---------- */
.site-footer { background: var(--green-deep); color: #b9d3c3; font-size: 14px; margin-top: 64px; }
.site-footer.is-compact { margin-top: 0; }
.site-footer a { color: #dcebe2; text-decoration: none; } .site-footer a:hover { color: var(--gold); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 36px; padding-top: 48px; padding-bottom: 36px; }
.footer-grid h2 { color: #fff; font-size: 12.5px; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 14px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-brand img { width: 220px; height: auto; margin-bottom: 14px; }
.footer-motto { font-family: var(--font-read); font-style: italic; color: var(--gold); font-size: 13.5px; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); font-size: 12.5px; }
.footer-bottom-in { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; padding-top: 16px; padding-bottom: 16px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid transparent; font: inherit; font-weight: 600; font-size: 14px; line-height: 1.2; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.btn-primary { background: var(--green); color: #fff; } .btn-primary:hover { background: var(--green-dark); color: #fff; }
.btn-secondary { background: #fff; color: var(--green-dark); border-color: var(--line); } .btn-secondary:hover { border-color: var(--green); color: var(--green-dark); }
.btn-ghost { background: transparent; color: var(--green); } .btn-ghost:hover { background: var(--green-tint-2); }
.btn-danger { background: #fff; color: var(--red); border-color: #f1c4c7; } .btn-danger:hover { background: var(--red); color: #fff; border-color: var(--red); }
.btn-gold { background: var(--gold); color: var(--gold-ink); } .btn-gold:hover { background: #e8d10c; color: var(--gold-ink); }
.btn-ms { background: #fff; color: #1b1b1b; border-color: #8c8c8c; } .btn-ms:hover { background: #f3f3f3; color: #1b1b1b; }
.btn-sm { padding: 7px 12px; font-size: 13px; } .btn-lg { padding: 13px 24px; font-size: 15px; }
.btn-block { display: flex; width: 100%; }
.btn[disabled], .btn.is-busy { opacity: .6; pointer-events: none; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--green); cursor: pointer; text-decoration: underline; }
.link-btn.danger { color: var(--red); }

/* ---------- badges, chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--line-2); color: var(--ink-2); }
.badge-brand { background: var(--green); color: #fff; }
.badge-green { background: var(--green-tint); color: var(--green-dark); }
.badge-blue { background: var(--blue-tint); color: var(--blue); }
.badge-amber { background: var(--amber-tint); color: var(--amber); }
.badge-orange { background: var(--orange-tint); color: var(--orange); }
.badge-red { background: var(--red-tint); color: #a3141d; }
.badge-gold { background: var(--gold-tint); color: var(--gold-ink); }
.badge-grey { background: var(--line-2); color: var(--mute); }
.chip { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--green-tint-2); border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); text-decoration: none; }
a.chip:hover { border-color: var(--green); color: var(--green-dark); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- cards ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.card-body { padding: 20px 22px; }
.card-header { padding: 16px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-header h2, .card-header h3 { margin: 0; font-size: 16px; }
.card-footer { padding: 14px 22px; border-top: 1px solid var(--line); background: var(--bg-2); border-radius: 0 0 var(--radius) var(--radius); }
.card + .card { margin-top: 20px; }
.card-link { display: block; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.card-link:hover { border-color: var(--green); box-shadow: var(--shadow); color: inherit; }

/* ---------- page header ---------- */
.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-header h1 { margin: 0; }
.page-header .lead { margin: 6px 0 0; }
.lead { color: var(--mute); font-size: 16px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.eyebrow { text-transform: uppercase; letter-spacing: .1em; font-size: 12px; font-weight: 700; color: var(--green); margin-bottom: 8px; }

/* ---------- breadcrumb, pagination ---------- */
.breadcrumb ol { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--mute); }
.breadcrumb li + li::before { content: "/"; margin-right: 6px; color: #b2c2b8; }
.breadcrumb a { color: var(--mute); text-decoration: none; } .breadcrumb a:hover { color: var(--green); }
.layout-app .breadcrumb ol { margin: 0 0 16px; }
.pagination { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 28px; }
.pagination a, .pagination span { padding: 7px 13px; border-radius: var(--radius-sm); border: 1px solid var(--line); text-decoration: none; font-size: 14px; color: var(--ink-2); }
.pagination a:hover { border-color: var(--green); color: var(--green); }
.pagination span[aria-current] { background: var(--green); border-color: var(--green); color: #fff; font-weight: 700; }

/* ---------- alerts, empty states ---------- */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; border: 1px solid; font-size: 14px; }
.alert-success { background: var(--green-tint); border-color: #bfe0cb; color: var(--green-dark); }
.alert-error { background: var(--red-tint); border-color: #f1c4c7; color: #8f1219; }
.alert-info { background: var(--blue-tint); border-color: #c8d9f0; color: #154a85; }
.alert-warn { background: var(--amber-tint); border-color: #f0dca8; color: #6b4600; }
.alert ul { margin: 6px 0 0; padding-left: 20px; }
.empty { text-align: center; padding: 40px 20px; color: var(--mute); border: 1px dashed var(--line); border-radius: var(--radius); background: var(--bg-2); }
.empty-title { font-weight: 700; color: var(--ink-2); margin-bottom: 4px; }

/* ---------- forms ---------- */
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field > label, .label { font-weight: 600; font-size: 14px; color: var(--ink-2); }
.field .req { color: var(--red); }
.hint { font-size: 12.5px; color: var(--mute); margin: 0; }
.error-text { font-size: 12.5px; color: #a3141d; font-weight: 600; margin: 0; }
.field-row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=url], input[type=number], input[type=date], input[type=tel], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #cbd8cf; border-radius: var(--radius-sm); background: #fff; font: inherit; font-size: 14.5px; color: var(--ink); }
textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { border-color: var(--green); outline: none; box-shadow: var(--focus); }
input[aria-invalid=true], select[aria-invalid=true], textarea[aria-invalid=true] { border-color: var(--red); }
input[type=file] { font: inherit; font-size: 14px; max-width: 100%; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check input { margin-top: 4px; width: 16px; height: 16px; accent-color: var(--green); flex-shrink: 0; }
.checks { display: grid; gap: 8px; }
.fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 0; }
.fieldset legend { font-weight: 700; padding: 0 6px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding-top: 4px; }
.counter { font-size: 12px; color: var(--mute); text-align: right; }
.counter.is-over { color: var(--red); font-weight: 700; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--mute); background: var(--bg-2); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--green-tint-2); }
.table .actions { text-align: right; white-space: nowrap; }
.table a.row-title { font-weight: 600; color: var(--ink); text-decoration: none; } .table a.row-title:hover { color: var(--green); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; }
.tabs a, .tabs button { padding: 12px 16px; border: 0; background: none; font: inherit; font-weight: 600; font-size: 14px; color: var(--mute); text-decoration: none; cursor: pointer; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a:hover, .tabs button:hover { color: var(--green-dark); }
.tabs [aria-current="page"], .tabs [aria-selected="true"] { color: var(--green-dark); border-bottom-color: var(--green); }

/* ---------- key/value + stats ---------- */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; font-size: 14px; }
.kv dt { color: var(--mute); } .kv dd { margin: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; text-decoration: none; color: inherit; display: block; }
a.stat:hover { border-color: var(--green); }
.stat-value { font-size: 28px; font-weight: 800; color: var(--green-dark); line-height: 1.1; }
.stat-label { font-size: 13px; color: var(--mute); }

/* ---------- avatar ---------- */
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--green-tint); color: var(--green-dark); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; flex-shrink: 0; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 72px; height: 72px; font-size: 20px; }

/* ---------- hero (home) ---------- */
.hero { background: radial-gradient(ellipse at 80% -20%, rgba(247, 224, 23, .18), transparent 55%), linear-gradient(160deg, var(--green-dark), var(--green-deep)); color: #e6f2ea; padding: 64px 0 56px; }
.hero h1 { color: #fff; font-family: var(--font-read); font-size: clamp(30px, 4.6vw, 48px); font-weight: 600; max-width: 780px; }
.hero p { font-size: 17px; max-width: 640px; color: #cfe3d6; }
.hero .eyebrow { color: var(--gold); }
.hero-search { display: flex; gap: 8px; max-width: 620px; margin-top: 24px; flex-wrap: wrap; }
.hero-search input { flex: 1 1 260px; padding: 14px 16px; border-radius: var(--radius-sm); border: 0; font-size: 15px; }
.hero-stats { display: flex; gap: 36px; flex-wrap: wrap; margin-top: 36px; }
.hero-stats strong { display: block; font-size: 28px; color: #fff; }
.hero-stats span { font-size: 13px; color: #b9d3c3; }

/* ---------- journal masthead + cards ---------- */
.masthead { background: linear-gradient(160deg, var(--green-dark), var(--green-deep)); color: #e6f2ea; padding: 36px 0 0; }
.masthead-in { display: flex; gap: 28px; align-items: flex-start; }
.masthead h1 { color: #fff; font-family: var(--font-read); font-weight: 600; margin-bottom: 6px; }
.masthead .meta-line { color: #b9d3c3; font-size: 14px; }
.masthead .meta-line strong { color: #fff; font-weight: 600; }
.masthead .tabs { border-bottom: 0; margin: 28px 0 0; }
.masthead .tabs a { color: #b9d3c3; } .masthead .tabs a:hover { color: #fff; }
.masthead .tabs [aria-current="page"] { color: #fff; border-bottom-color: var(--gold); }
.cover { width: 132px; aspect-ratio: 3 / 4; border-radius: var(--radius-sm); background: linear-gradient(160deg, var(--green), var(--green-dark)); color: #fff; display: flex; flex-direction: column; justify-content: space-between; padding: 12px; font-weight: 800; flex-shrink: 0; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); overflow: hidden; position: relative; }
.cover img.cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover .cover-abbr { font-size: 20px; line-height: 1.1; letter-spacing: .02em; }
.cover .cover-crest { width: 40px; height: 40px; background: #fff; border-radius: 8px; padding: 3px; object-fit: contain; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }   /* the crest needs a light tile: it vanishes on green */
.cover::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: linear-gradient(90deg, var(--green) 0 60%, var(--gold) 60% 80%, var(--red) 80% 100%); }
.cover-sm { width: 76px; padding: 8px; } .cover-sm .cover-abbr { font-size: 13px; } .cover-sm .cover-crest { width: 26px; height: 26px; border-radius: 5px; padding: 2px; }
@media (max-width: 640px) { .masthead-in { flex-direction: column; } .cover { width: 96px; } }
.journal-card { display: flex; gap: 16px; padding: 18px; }
.journal-card h3 { font-family: var(--font-read); font-size: 18px; margin-bottom: 4px; }
.journal-card p { font-size: 13.5px; color: var(--mute); margin: 0; }

/* ---------- article lists ---------- */
.article-list { list-style: none; margin: 0; padding: 0; }
.article-item { padding: 18px 0; border-bottom: 1px solid var(--line); }
.article-item:first-child { padding-top: 4px; }
.article-type { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--green); }
.article-title { font-family: var(--font-read); font-size: 19px; font-weight: 600; line-height: 1.35; margin: 4px 0 6px; }
.article-title a { color: var(--ink); text-decoration: none; } .article-title a:hover { color: var(--green); text-decoration: underline; }
.article-authors { font-size: 14px; color: var(--ink-2); margin: 0 0 4px; }
.article-meta { font-size: 13px; color: var(--mute); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.article-actions { display: flex; gap: 14px; margin-top: 8px; font-size: 13.5px; font-weight: 600; }
.article-actions a { text-decoration: none; }

/* ---------- article page ---------- */
.article-head h1 { font-family: var(--font-read); font-weight: 600; font-size: clamp(26px, 3.2vw, 34px); margin: 8px 0 14px; }
.author-line { font-size: 16px; margin-bottom: 6px; }
.author-line sup { color: var(--green); font-weight: 700; }
.affiliations { list-style: none; padding: 0; margin: 0 0 14px; font-size: 13.5px; color: var(--mute); }
.prose { font-family: var(--font-read); font-size: 17px; line-height: 1.7; color: var(--ink); }
.prose h2 { font-family: var(--font-ui); font-size: 18px; margin-top: 1.6em; }
.prose h3 { font-family: var(--font-ui); font-size: 16px; margin-top: 1.4em; }
.prose blockquote { margin: 1em 0; padding: 4px 18px; border-left: 3px solid var(--green); color: var(--ink-2); }
.prose table { border-collapse: collapse; width: 100%; font-family: var(--font-ui); font-size: 14px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 6px 10px; }
.prose-ui { font-family: var(--font-ui); font-size: 15px; }
.abstract { white-space: pre-line; }
.side-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: #fff; }
.side-box + .side-box { margin-top: 16px; }
.side-box h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--mute); margin-bottom: 12px; }
.sticky-aside { position: sticky; top: 130px; }
.cite-box { font-size: 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; font-family: var(--font-read); }
.cite-styles { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.cite-styles button { border: 1px solid var(--line); background: #fff; padding: 4px 10px; border-radius: 999px; font: inherit; font-size: 12.5px; cursor: pointer; }
.cite-styles button[aria-selected="true"] { background: var(--green); color: #fff; border-color: var(--green); }

/* ---------- workspace (signed-in) ---------- */
.layout-app { background: var(--bg-2); }
.app-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: calc(100vh - 115px); max-width: 1440px; margin: 0 auto; }
.app-nav { background: #fff; border-right: 1px solid var(--line); padding: 20px 14px; }
.app-user { display: flex; gap: 10px; align-items: center; padding: 6px 8px 18px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.app-user strong { display: block; font-size: 14px; line-height: 1.3; } .app-user small { color: var(--mute); font-size: 12px; }
.app-nav-group { margin-bottom: 16px; }
.app-nav-group h2 { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--mute); margin: 0 8px 6px; }
.app-nav-group a { display: block; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 14px; }
.app-nav-group a:hover { background: var(--green-tint-2); color: var(--green-dark); }
.app-nav-group a[aria-current="page"] { background: var(--green-tint); color: var(--green-dark); box-shadow: inset 3px 0 0 var(--green); }
.app-main { padding: 28px 32px 48px; min-width: 0; }
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-nav { border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 16px; display: flex; gap: 8px; overflow-x: auto; }
  .app-user, .app-nav-group h2 { display: none; }
  .app-nav-group { display: flex; gap: 4px; margin: 0; }
  .app-nav-group a { white-space: nowrap; }
  .app-main { padding: 20px 16px 40px; }
}

/* ---------- timeline (manuscript history) ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 18px 26px; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-tint); }
.timeline li::after { content: ""; position: absolute; left: 10px; top: 20px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline .when { font-size: 12.5px; color: var(--mute); }

/* progress steps */
.steps { display: flex; gap: 0; list-style: none; padding: 0; margin: 0 0 24px; counter-reset: step; flex-wrap: wrap; }
.steps li { flex: 1 1 0; min-width: 110px; position: relative; padding-top: 34px; text-align: center; font-size: 12.5px; color: var(--mute); counter-increment: step; }
.steps li::before { content: counter(step); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 2px solid var(--line); line-height: 22px; font-weight: 700; color: var(--mute); z-index: 1; }
.steps li::after { content: ""; position: absolute; top: 12px; left: -50%; width: 100%; height: 2px; background: var(--line); }
.steps li:first-child::after { display: none; }
.steps li.is-done::before { background: var(--green); border-color: var(--green); color: #fff; content: "✓"; }
.steps li.is-done::after, .steps li.is-current::after { background: var(--green); }
.steps li.is-current::before { border-color: var(--green); color: var(--green); }
.steps li.is-current { color: var(--ink); font-weight: 700; }
.steps li.is-stopped::before { background: var(--red); border-color: var(--red); color: #fff; content: "✕"; }

/* messages */
.thread { display: grid; gap: 12px; }
.msg { padding: 12px 14px; border-radius: var(--radius); background: var(--bg-2); border: 1px solid var(--line); }
.msg.is-mine { background: var(--green-tint-2); border-color: #cfe5d8; }
.msg-head { font-size: 12.5px; color: var(--mute); margin-bottom: 4px; }
.msg-body { white-space: pre-line; font-size: 14px; }

/* option cards (radio choices) */
.options { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }
.option { position: relative; display: block; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 14px 42px; cursor: pointer; background: #fff; }
.option input { position: absolute; left: 16px; top: 17px; accent-color: var(--green); width: 16px; height: 16px; }
.option strong { display: block; font-size: 14.5px; }
.option span { font-size: 13px; color: var(--mute); }
.option:has(input:checked) { border-color: var(--green); background: var(--green-tint-2); box-shadow: inset 0 0 0 1px var(--green); }
.option.tone-bad:has(input:checked) { border-color: var(--red); background: var(--red-tint); box-shadow: inset 0 0 0 1px var(--red); }
.option.tone-warn:has(input:checked) { border-color: #d39b2a; background: var(--amber-tint); box-shadow: inset 0 0 0 1px #d39b2a; }

/* repeatable rows (authors, reviewers) */
.repeat-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: var(--bg-2); }
.repeat-item + .repeat-item { margin-top: 12px; }
.repeat-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-weight: 700; font-size: 14px; }

/* auth pages */
.layout-auth { background: radial-gradient(ellipse at 20% 0%, var(--green-tint), transparent 60%), var(--bg-2); }
.auth-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 440px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 28px 30px 30px; }
.auth-card.is-wide { max-width: 600px; }
.auth-brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; margin-bottom: 18px; }
.auth-brand img { width: 56px; height: 56px; }
.auth-brand strong { display: block; font-size: 18px; color: var(--green-dark); font-weight: 800; }
.auth-brand small { color: var(--mute); font-size: 12.5px; }
.auth-card .brand-stripe { margin: 0 -30px 22px; }
.auth-card h1 { font-size: 22px; margin-bottom: 4px; }
.auth-foot { font-size: 12.5px; color: var(--mute); margin-top: 18px; text-align: center; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--mute); font-size: 12.5px; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

/* error page */
.error-page { text-align: center; padding-top: 72px; padding-bottom: 72px; }
.error-code { font-size: 64px; font-weight: 800; color: var(--green); margin: 0; line-height: 1; }
.error-page .btn-row { justify-content: center; }
.debug { text-align: left; background: #fff5f5; padding: 12px; border-radius: 6px; overflow: auto; font-size: 12px; }

/* dialog */
dialog { border: 0; border-radius: var(--radius-lg); padding: 0; max-width: 560px; width: calc(100% - 32px); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
dialog::backdrop { background: rgba(8, 42, 23, .55); }
.dialog-body { padding: 22px 24px; }
.dialog-actions { padding: 14px 24px; background: var(--bg-2); display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); }

@media print {
  .site-header, .site-footer, .app-nav, .article-actions, .no-print { display: none !important; }
  .with-aside { grid-template-columns: 1fr; }
}

/* ---------- tooltips & contextual help ---------- */
.tip { display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; margin-left: 4px; padding: 0; border: 1px solid #b9cbbf; border-radius: 50%; background: #fff; color: var(--mute); font: 700 11px/1 var(--font-ui); cursor: help; vertical-align: 1px; flex-shrink: 0; }
.tip:hover, .tip[aria-expanded="true"] { border-color: var(--green); color: var(--green); background: var(--green-tint-2); }
.tooltip { white-space: pre-line; position: absolute; z-index: 90; max-width: min(300px, calc(100vw - 24px)); padding: 8px 11px; border-radius: var(--radius-sm); background: var(--green-deep); color: #eef6f1; font: 500 13px/1.45 var(--font-ui); box-shadow: 0 6px 20px rgba(8, 42, 23, .25); pointer-events: none; opacity: 0; transform: translateY(2px); transition: opacity .12s, transform .12s; }
.tooltip.is-shown { opacity: 1; transform: none; }
.tooltip::after { content: ""; position: absolute; left: var(--arrow-x, 50%); width: 8px; height: 8px; background: var(--green-deep); transform: translateX(-50%) rotate(45deg); }
.tooltip[data-side="top"]::after { bottom: -4px; }
.tooltip[data-side="bottom"]::after { top: -4px; }
@media (prefers-reduced-motion: reduce) { .tooltip { transition: none; } }
.page-help { float: right; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; text-decoration: none; color: var(--green); margin: 0 0 8px 16px; }
.page-help:hover { text-decoration: underline; }
.page-help-icon { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: var(--green-tint); font-size: 11px; font-weight: 800; }
.crumb-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.crumb-row .page-help { float: none; margin: 18px 0 0; }

/* ---------- View as: read-only preview banner (layout.php view_as_bar) ---------- */
.view-as-bar { position: sticky; top: 0; z-index: 50; background: var(--gold); color: #2b2600; border-bottom: 2px solid #c9b400; font-size: 14px; }
.view-as-in { max-width: var(--container); margin: 0 auto; padding: 8px 20px; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.view-as-eye { width: 20px; height: 20px; flex: none; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 5C6 5 2 12 2 12s4 7 10 7 10-7 10-7-4-7-10-7zm0 11a4 4 0 1 1 0-8 4 4 0 0 1 0 8zm0-2a2 2 0 1 0 0-4 2 2 0 0 0 0 4z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 5C6 5 2 12 2 12s4 7 10 7 10-7 10-7-4-7-10-7zm0 11a4 4 0 1 1 0-8 4 4 0 0 1 0 8zm0-2a2 2 0 1 0 0-4 2 2 0 0 0 0 4z'/%3E%3C/svg%3E") center / contain no-repeat; }
.view-as-time { color: #5c5100; white-space: nowrap; }
.view-as-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.view-as-actions a { color: #2b2600; font-weight: 600; }
.view-as-actions form { margin: 0; }
.view-as-actions button { font: inherit; font-weight: 700; color: #fff; background: var(--green-dark); border: 0; border-radius: var(--radius-sm); padding: 6px 12px; cursor: pointer; }
body[data-view-as] button:disabled { cursor: not-allowed; }
