:root {
  color-scheme: light;
  --navy: var(--service-primary, #4361ee);
  --navy-deep: var(--service-secondary, #3a0ca3);
  --ink: var(--ecosystem-ink, #212529);
  --muted: var(--ecosystem-muted, #6c757d);
  --line: var(--ecosystem-border, #dee2e6);
  --paper: var(--ecosystem-page-bg, #f5f7fa);
  --white: var(--ecosystem-surface, #fff);
  --teal: var(--service-accent, #2ec4b6);
  --gold: #ff9f1c;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }

.topbar {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 10px max(24px, calc((100vw - 1180px) / 2));
  color: white;
  background: var(--secondary, var(--navy-deep));
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; letter-spacing: .08em; }
.brand-logo { display: block; width: 120px; height: 42px; padding: 3px 5px; border-radius: 3px; object-fit: contain; background: white; }
.brand strong, .brand small { display: block; }
.brand strong { font: 700 13px Manrope, sans-serif; }
.brand small { margin-top: 2px; color: #a9becd; font-size: 9px; }
.header-journal { flex: 1; font: 600 14px Manrope, sans-serif; }
.account-area { display: flex; gap: 18px; align-items: center; font-size: 12px; }
.account-area a { color: #cbe9f2; text-decoration: none; }
.account-area a:hover { text-decoration: underline; }
.theme-toggle { padding: 7px 10px; border: 1px solid rgb(255 255 255 / 45%); border-radius: 4px; color: white; background: transparent; font-size: 11px; cursor: pointer; }
.theme-toggle:hover { background: rgb(255 255 255 / 12%); }

.main-nav { display: flex; gap: 28px; align-items: center; min-height: 46px; padding: 0 max(24px, calc((100vw - 1180px) / 2)); border-bottom: 1px solid var(--line); background: white; }
.main-nav a { display: inline-flex; align-items: center; min-height: 46px; border-bottom: 2px solid transparent; color: #435768; font-size: 12px; font-weight: 600; text-decoration: none; }
.main-nav a.active, .main-nav a:hover { border-color: var(--teal); color: var(--navy); }
.main-nav .requires-auth[hidden] { display: none; }

.page-shell { width: min(1180px, calc(100% - 48px)); min-height: calc(100vh - 180px); margin: 28px auto 64px; }
.page { display: none; }
.page.active { display: block; }
.hero { position: relative; display: flex; min-height: 305px; align-items: center; justify-content: space-between; overflow: hidden; padding: 42px 56px; border: 0; border-radius: 8px; color: white !important; background: linear-gradient(115deg, var(--navy), var(--navy-deep)) !important; }
.hero h1, .hero h2, .hero h3, .hero p { color: white !important; }
.hero::after { position: absolute; right: 16%; top: -140px; width: 520px; height: 520px; border: 1px solid rgb(255 255 255 / 12%); border-radius: 50%; content: ""; }
.hero > div:first-child { z-index: 1; max-width: 660px; }
.eyebrow { margin: 0 0 10px; color: var(--teal); font-size: 10px; font-weight: 700; letter-spacing: .16em; }
.hero .eyebrow { color: #a4d8da; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: Manrope, "Segoe UI", sans-serif; }
.hero h1 { margin-bottom: 13px; font-size: clamp(28px, 4vw, 42px); line-height: 1.17; letter-spacing: -.04em; }
.hero h1 em { color: #b9e1d8; font-style: normal; }
.hero-copy { max-width: 620px; margin-bottom: 24px; color: #d3e3ec; font-size: 14px; line-height: 1.7; }
.hero-orbit { z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 20px 55px 0 25px; color: #bbd8e2; font: 700 10px Manrope, sans-serif; letter-spacing: .17em; }
.hero-orbit b { display: grid; place-items: center; width: 64px; height: 64px; border: 1px solid #9bc9d0; border-radius: 50%; color: #f1c87e; font-size: 26px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 42px; padding: 0 18px; border: 0; border-radius: 4px; font-size: 12px; font-weight: 700; text-decoration: none; cursor: pointer; transition: transform .15s, background .15s; }
.button:hover { transform: translateY(-1px); }
.button-light { color: var(--navy); background: white; }
.button-primary { color: white; background: var(--navy); }
.button-primary:hover { background: #1a587b; }
.button:disabled { opacity: .6; cursor: wait; transform: none; }

.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin: 42px 0 18px; }
.section-heading h2, .page-title h1 { margin-bottom: 0; color: var(--navy-deep); font-size: 25px; letter-spacing: -.035em; }
.muted, .field-hint { color: var(--muted); font-size: 11px; }
.journal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.journal-card, .loading-card { padding: 21px; border: 1px solid var(--line); border-radius: 6px; background: white; }
.journal-card { min-height: 166px; }
.journal-card h3 { margin-bottom: 8px; color: var(--navy); font-size: 16px; }
.journal-card p { min-height: 40px; margin-bottom: 15px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.journal-meta { display: flex; flex-wrap: wrap; gap: 7px; color: #506676; font-size: 10px; }
.tag { padding: 5px 8px; border-radius: 3px; background: #edf3f5; }
.publication-heading { margin-top: 46px; }
.publication-list { display: grid; gap: 12px; }
.publication-card { padding: 20px 22px; border: 1px solid var(--line); border-left: 3px solid var(--teal); border-radius: 5px; background: white; }
.publication-card h3 { margin-bottom: 8px; color: var(--navy); font-size: 16px; }
.publication-card .abstract { margin-bottom: 12px; color: #506373; font-size: 12px; line-height: 1.7; }
.publication-info { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: 10px; }
.publication-info a { color: var(--teal); }
.submission-callout { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 36px; padding: 25px 30px; border-radius: 6px; background: #e8f0f2; }
.submission-callout h2 { margin-bottom: 6px; color: var(--navy); font-size: 17px; }
.submission-callout p { max-width: 720px; margin-bottom: 0; color: #526777; font-size: 12px; line-height: 1.6; }

.page-title { margin: 6px 0 24px; }
.page-title h1 { margin-bottom: 8px; font-size: 30px; }
.page-title > p:last-child { max-width: 760px; margin-bottom: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.form-card { max-width: 900px; padding: 27px; border: 1px solid var(--line); border-radius: 6px; background: white; }
.form-section { display: grid; gap: 15px; padding: 20px 0; border-bottom: 1px solid #e9eef1; }
.form-section:first-child { padding-top: 0; }
.form-section h2 { margin-bottom: 0; color: var(--navy); font-size: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.checkbox-label { display: flex; align-items: center; gap: 9px; }
.checkbox-label input { width: 16px; min-height: 16px; }
.activity-tools { display: grid; justify-items: start; gap: 12px; margin-top: 20px; }
label { display: grid; gap: 7px; color: #384f60; font-size: 11px; font-weight: 700; }
.field-hint { display: inline; font-weight: 400; }
input, select, textarea { width: 100%; min-height: 39px; padding: 9px 11px; border: 1px solid #cbd7df; border-radius: 4px; outline: none; color: var(--ink); background: white; font-size: 12px; font-weight: 400; }
textarea { min-height: 70px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { border-color: #308c99; box-shadow: 0 0 0 3px rgb(48 140 153 / 13%); }
.privacy-note { margin: 18px 0; padding: 11px 13px; border-left: 3px solid var(--gold); color: #637481; background: #fbf7ee; font-size: 11px; line-height: 1.6; }

.work-list { display: grid; gap: 12px; }
.work-card { padding: 19px 21px; border: 1px solid var(--line); border-radius: 5px; background: white; }
.work-card-header { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.work-card h3 { margin: 0 0 8px; color: var(--navy); font-size: 15px; }
.work-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.status-pill { flex: none; padding: 5px 9px; border-radius: 3px; color: #235b72; background: #e5f1f3; font-size: 10px; font-weight: 700; }
.work-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.small-button, .text-button { padding: 7px 10px; border: 1px solid #cbd7df; border-radius: 3px; color: var(--navy); background: white; font-size: 10px; font-weight: 700; cursor: pointer; }
.small-button:hover, .text-button:hover { border-color: var(--teal); color: var(--teal); }
.editor-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin: 20px 0 15px; }
.editor-toolbar label { min-width: 190px; }
.editor-toolbar .search-label { flex: 1; max-width: 430px; }
.admin-panel { margin: 20px 0; border: 1px solid var(--line); border-radius: 5px; background: white; }
.admin-panel > summary { padding: 14px 17px; color: var(--navy); font-size: 12px; font-weight: 700; cursor: pointer; }
.admin-panel-content { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; padding: 0 16px 16px; }
.admin-panel-content .inline-form { align-content: start; }
.detail-card { padding: 26px; border: 1px solid var(--line); border-radius: 6px; background: white; }
.detail-card h1 { margin-bottom: 10px; color: var(--navy); font-size: 25px; }
.detail-card h2 { margin: 22px 0 10px; color: var(--navy); font-size: 16px; }
.detail-card .manuscript-text { max-height: 440px; overflow: auto; white-space: pre-wrap; padding: 16px; border: 1px solid #e5ebef; border-radius: 4px; color: #354b5b; background: #fafcfc; font: 12px/1.7 "DM Sans", sans-serif; }
.inline-form { display: grid; gap: 12px; margin-top: 12px; padding: 16px; border: 1px solid #e5ebef; border-radius: 4px; background: #f9fbfb; }
.inline-form h3 { margin-bottom: 0; color: var(--navy); font-size: 13px; }
.inline-form .form-grid { grid-template-columns: 1fr 1fr; }
.detail-actions { display: grid; gap: 14px; margin-top: 24px; }
.empty-state { padding: 30px; border: 1px dashed #c9d5dc; border-radius: 5px; color: var(--muted); background: white; text-align: center; font-size: 12px; line-height: 1.7; }
.empty-state a { color: var(--teal); font-weight: 700; }
.notice { position: sticky; z-index: 2; top: 10px; margin: 0 0 18px; padding: 12px 16px; border: 1px solid #c9e0d8; border-radius: 5px; color: #205d48; background: #eff9f3; font-size: 12px; }
.notice.error { border-color: #efd0cc; color: #8b332a; background: #fff4f2; }
.notice[hidden] { display: none; }
.text-button { margin-bottom: 16px; border: 0; background: transparent; font-size: 11px; }
.site-footer { display: flex; justify-content: space-between; gap: 18px; padding: 20px max(24px, calc((100vw - 1180px) / 2)); color: #e2e7f2; background: var(--navy-deep); font-size: 10px; }
.site-footer a { color: white; }

body.dark-mode {
  --paper: var(--ecosystem-page-bg);
  --ink: var(--ecosystem-ink);
  --muted: var(--ecosystem-muted);
  --line: var(--ecosystem-border);
  color: var(--ink);
  background: var(--paper) !important;
}
body.dark-mode .hero { color: white !important; background: linear-gradient(115deg, var(--navy), var(--navy-deep)) !important; }
body.dark-mode .hero h1,
body.dark-mode .hero h2,
body.dark-mode .hero h3,
body.dark-mode .hero p { color: white !important; }
body.dark-mode .main-nav,
body.dark-mode .journal-card,
body.dark-mode .loading-card,
body.dark-mode .publication-card,
body.dark-mode .form-card,
body.dark-mode .work-card,
body.dark-mode .admin-panel,
body.dark-mode .detail-card,
body.dark-mode .empty-state {
  color: var(--ecosystem-ink);
  background: var(--ecosystem-surface);
  border-color: var(--ecosystem-border);
}
body.dark-mode .main-nav a,
body.dark-mode label,
body.dark-mode .section-heading h2,
body.dark-mode .page-title h1,
body.dark-mode .form-section h2,
body.dark-mode .work-card h3,
body.dark-mode .detail-card h1,
body.dark-mode .detail-card h2,
body.dark-mode .admin-panel > summary {
  color: var(--ecosystem-ink);
}
body.dark-mode .journal-card p,
body.dark-mode .publication-card .abstract,
body.dark-mode .submission-callout p,
body.dark-mode .page-title > p:last-child,
body.dark-mode .work-card p,
body.dark-mode .detail-card .manuscript-text {
  color: var(--ecosystem-muted);
}
body.dark-mode .submission-callout,
body.dark-mode .tag,
body.dark-mode .inline-form,
body.dark-mode .detail-card .manuscript-text {
  background: var(--ecosystem-soft-surface);
}
body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea,
body.dark-mode .small-button,
body.dark-mode .text-button {
  color: var(--ecosystem-ink);
  background: var(--ecosystem-soft-surface);
  border-color: var(--ecosystem-border);
}

@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; gap: 9px 16px; padding: 12px 18px; }
  .header-journal { order: 3; flex-basis: 100%; font-size: 12px; }
  .account-area { margin-left: auto; }
  .main-nav { gap: 20px; overflow-x: auto; padding: 0 18px; }
  .main-nav a { flex: none; font-size: 11px; }
  .page-shell { width: min(100% - 32px, 1180px); margin-top: 16px; }
  .hero { min-height: 290px; padding: 30px 25px; }
  .hero-orbit { display: none; }
  .section-heading { align-items: start; flex-direction: column; }
  .submission-callout { align-items: start; flex-direction: column; padding: 21px; }
  .form-card { padding: 20px 16px; }
  .site-footer { flex-direction: column; padding: 18px; }
}
@media (max-width: 520px) {
  .form-grid, .inline-form .form-grid { grid-template-columns: 1fr; }
  .editor-toolbar { align-items: stretch; flex-direction: column; }
  .editor-toolbar label, .editor-toolbar .search-label { max-width: none; }
  .admin-panel-content { grid-template-columns: 1fr; }
  .work-card-header { flex-direction: column; }
}
