/* JournalOS — Science Catalogs manuscript workspace
   Plain CSS (flexbox/grid), no frameworks. Tokens match sciencecatalogs.com. */

:root {
    --navy: #013a56;
    --navy-700: #022c41;
    --navy-50: #e8f0f4;
    --orange: #eb6500;
    --orange-btn: #b84f00;
    --orange-50: #fdf0e6;
    --ink: #14212b;
    --ink-2: #3c4a55;
    --muted: #5f6d79;
    --line: #dde3e8;
    --line-2: #eef2f5;
    --bg: #f4f6f8;
    --card: #ffffff;
    --link: #0b5f8a;
    --ok: #1d7a46;
    --ok-50: #e7f4ec;
    --warn: #8a5a00;
    --warn-50: #fdf3dc;
    --bad: #b3261e;
    --bad-50: #fbe9e7;
    --info: #0b5f8a;
    --info-50: #e6f1f7;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 1px 2px rgba(1, 58, 86, .06), 0 4px 16px rgba(1, 58, 86, .06);
    --font: Montserrat, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --top: 60px;
    --side: 248px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--ink); background: var(--bg); }
a { color: var(--link); }
a:hover { color: var(--navy); }
img { max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.25; color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid rgba(235, 101, 0, .55); outline-offset: 2px; }
.jos-skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 100; border-radius: 6px; }
.jos-skip:focus { left: 8px; }
.jos-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.jos-muted { color: var(--muted); }
.jos-center { text-align: center; }
.jos-nowrap { white-space: nowrap; }

/* ---------- Top bar ---------- */
.jos-top { position: sticky; top: 0; z-index: 40; height: var(--top); display: flex; align-items: center; gap: 14px; padding: 0 20px; background: var(--navy); color: #fff; }
.jos-top__menu { display: none; background: none; border: 0; color: #fff; font-size: 18px; width: 40px; height: 40px; border-radius: 8px; cursor: pointer; }
.jos-top__menu:hover { background: rgba(255,255,255,.1); }
.jos-top__spacer { flex: 1; }
.jos-top__link { color: #d6e4ec; text-decoration: none; font-size: 13.5px; font-weight: 500; padding: 8px 10px; border-radius: 6px; }
.jos-top__link:hover { color: #fff; background: rgba(255,255,255,.08); }
.jos-brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.jos-brand__mark { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--orange); color: #fff; font-weight: 800; font-size: 18px; }
.jos-brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.jos-brand__text strong { font-size: 16px; letter-spacing: .2px; }
.jos-brand__text small { font-size: 11px; color: #9fbccc; font-weight: 500; }

.jos-user { position: relative; }
.jos-user__btn { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); color: #fff; padding: 5px 10px 5px 5px; border-radius: 999px; cursor: pointer; font-size: 13.5px; font-weight: 600; }
.jos-user__btn:hover { background: rgba(255,255,255,.14); }
.jos-user__btn .fa-chevron-down { font-size: 10px; opacity: .8; }
.jos-avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--navy); font-size: 12px; font-weight: 700; flex: none; }
.jos-user__panel { display: none; position: absolute; right: 0; top: calc(100% + 8px); width: 280px; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 10px 30px rgba(1,58,86,.18); overflow: hidden; }
.jos-user.is-open .jos-user__panel { display: block; }
.jos-user__head { padding: 14px 16px; border-bottom: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 2px; }
.jos-user__head small { color: var(--muted); word-break: break-all; }
.jos-user__head .jos-pill { margin-top: 8px; align-self: flex-start; }
.jos-user__panel a, .jos-user__panel button { display: flex; gap: 10px; align-items: center; width: 100%; padding: 11px 16px; background: none; border: 0; text-align: left; color: var(--ink); text-decoration: none; font-size: 14px; cursor: pointer; }
.jos-user__panel a:hover, .jos-user__panel button:hover { background: var(--bg); }
.jos-user__panel i { width: 16px; color: var(--muted); }
.jos-user__panel form { margin: 0; border-top: 1px solid var(--line-2); }

/* ---------- App layout ---------- */
.jos-layout { display: flex; min-height: calc(100vh - var(--top)); }
.jos-side { width: var(--side); flex: none; background: #fff; border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; justify-content: space-between; position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto; }
.jos-side__group { margin: 14px 10px 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.jos-side__group:first-child { margin-top: 0; }
.jos-side ul { list-style: none; margin: 0; padding: 0; }
.jos-side li a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 500; }
.jos-side li a i { width: 18px; text-align: center; color: var(--muted); }
.jos-side li a:hover { background: var(--bg); color: var(--ink); }
.jos-side li a.is-active { background: var(--navy-50); color: var(--navy); font-weight: 700; }
.jos-side li a.is-active i { color: var(--orange); }
.jos-side__foot a { display: flex; gap: 10px; align-items: center; padding: 9px 10px; color: var(--muted); font-size: 13.5px; text-decoration: none; }
.jos-scrim { display: none; }
.jos-main { flex: 1; min-width: 0; padding: 24px 32px 48px; max-width: 1240px; }

.jos-crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; padding: 0; font-size: 13px; color: var(--muted); }
.jos-crumbs li + li::before { content: "/"; margin-right: 6px; color: #b6c2cb; }
.jos-crumbs a { color: var(--muted); text-decoration: none; }
.jos-crumbs a:hover { color: var(--link); text-decoration: underline; }

.jos-pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.jos-pagehead h1 { margin: 0; font-size: 26px; font-weight: 700; }
.jos-pagehead__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.jos-eyebrow { margin: 0 0 4px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--orange-btn); }
.jos-sub { margin: 6px 0 0; color: var(--muted); max-width: 760px; }

/* ---------- Cards, grids ---------- */
.jos-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.jos-card--pad { padding: 22px; }
.jos-card + .jos-card { margin-top: 18px; }
.jos-card__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.jos-card__head h2 { margin: 0; font-size: 16px; }
.jos-card__head a { font-size: 13.5px; }
.jos-card__body { padding: 18px 20px; }
.jos-card h2 { font-size: 17px; margin: 0 0 12px; }
.jos-grid { display: grid; gap: 18px; }
.jos-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.jos-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.jos-split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.jos-stack > * + * { margin-top: 18px; }

.jos-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 22px; }
.jos-stat { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); text-decoration: none; color: var(--ink); border-top: 3px solid var(--navy); }
a.jos-stat:hover { box-shadow: var(--shadow); }
.jos-stat--warn { border-top-color: var(--orange); }
.jos-stat--ok { border-top-color: var(--ok); }
.jos-stat__value { font-size: 28px; font-weight: 700; line-height: 1.1; }
.jos-stat__label { font-size: 13px; color: var(--muted); font-weight: 500; }

/* ---------- Buttons ---------- */
.jos-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border-radius: var(--radius); border: 1px solid transparent; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; line-height: 1.2; transition: background .15s, border-color .15s, box-shadow .15s; }
.jos-btn--primary { background: var(--orange-btn); color: #fff; }
.jos-btn--primary:hover { background: #9a4200; color: #fff; }
.jos-btn--navy { background: var(--navy); color: #fff; }
.jos-btn--navy:hover { background: var(--navy-700); color: #fff; }
.jos-btn--ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.jos-btn--ghost:hover { border-color: var(--navy); color: var(--navy); }
.jos-btn--danger { background: #fff; border-color: #e7b9b5; color: var(--bad); }
.jos-btn--danger:hover { background: var(--bad-50); color: var(--bad); }
.jos-btn--light { background: #fff; color: var(--navy); }
.jos-btn--light:hover { background: var(--orange-50); color: var(--navy); }
.jos-btn--sm { min-height: 32px; padding: 5px 12px; font-size: 13px; }
.jos-btn--block { width: 100%; }
.jos-btn[disabled] { opacity: .55; cursor: not-allowed; }
.jos-linkbtn { background: none; border: 0; padding: 0; color: var(--link); cursor: pointer; text-decoration: underline; font-size: inherit; }

/* ---------- Badges, pills ---------- */
.jos-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--line-2); color: var(--ink-2); }
.jos-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.jos-badge--info { background: var(--info-50); color: var(--info); }
.jos-badge--ok { background: var(--ok-50); color: var(--ok); }
.jos-badge--warn { background: var(--warn-50); color: var(--warn); }
.jos-badge--bad { background: var(--bad-50); color: var(--bad); }
.jos-badge--muted { background: var(--line-2); color: var(--muted); }
.jos-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--navy-50); color: var(--navy); font-size: 12px; font-weight: 600; text-decoration: none; }
.jos-tag { display: inline-block; padding: 2px 8px; border-radius: 4px; background: var(--line-2); font-size: 12px; color: var(--ink-2); margin: 0 4px 4px 0; }
.jos-ref { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 12.5px; font-weight: 600; color: var(--navy); background: var(--navy-50); padding: 2px 7px; border-radius: 4px; white-space: nowrap; }

/* ---------- Alerts ---------- */
.jos-alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; border: 1px solid; }
.jos-alert i { margin-top: 3px; }
.jos-alert--ok { background: var(--ok-50); border-color: #bfe0cb; color: #14532f; }
.jos-alert--err { background: var(--bad-50); border-color: #f0c4bf; color: #7d1a14; }
.jos-alert--info { background: var(--info-50); border-color: #c4dceb; color: #0b4566; }
.jos-alert--warn { background: var(--warn-50); border-color: #f0dca8; color: #6b4600; }
.jos-alert ul { margin: 6px 0 0; padding-left: 18px; }

/* ---------- Tables ---------- */
.jos-tablewrap { overflow-x: auto; }
.jos-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.jos-table th { text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fafbfc; white-space: nowrap; }
.jos-table td { padding: 13px 14px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.jos-table tr:last-child td { border-bottom: 0; }
.jos-table tbody tr:hover { background: #fafcfd; }
.jos-table__title { font-weight: 600; color: var(--ink); text-decoration: none; display: block; margin: 4px 0 2px; }
.jos-table__title:hover { color: var(--link); text-decoration: underline; }
.jos-table small { color: var(--muted); }

/* ---------- Forms ---------- */
.jos-form { display: grid; gap: 16px; }
.jos-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.jos-row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.jos-field label, .jos-label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.jos-field label .jos-opt { font-weight: 500; color: var(--muted); }
.jos-field input[type=text], .jos-field input[type=email], .jos-field input[type=password], .jos-field input[type=number], .jos-field input[type=date], .jos-field input[type=search], .jos-field select, .jos-field textarea {
    width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid #c9d3da; border-radius: var(--radius); background: #fff; font-size: 14.5px; }
.jos-field textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
.jos-field input:focus, .jos-field select:focus, .jos-field textarea:focus { outline: 0; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(1, 58, 86, .14); }
.jos-field .jos-help { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.jos-field.is-invalid input, .jos-field.is-invalid select, .jos-field.is-invalid textarea { border-color: var(--bad); }
.jos-field .jos-error { margin: 6px 0 0; font-size: 12.5px; color: var(--bad); font-weight: 600; }
.jos-count { float: right; font-weight: 500; color: var(--muted); font-size: 12px; }
.jos-check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.jos-check input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--navy); flex: none; }
.jos-choice { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.jos-choice label { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; background: #fff; }
.jos-choice label:hover { border-color: #a9bac6; }
.jos-choice input { margin-top: 3px; accent-color: var(--navy); }
.jos-choice label:has(input:checked) { border-color: var(--navy); background: var(--navy-50); box-shadow: inset 0 0 0 1px var(--navy); }
.jos-choice strong { display: block; font-size: 14px; }
.jos-choice small { color: var(--muted); font-size: 12.5px; }
.jos-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.jos-actions--end { justify-content: flex-end; }
fieldset.jos-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.jos-fieldset legend { font-size: 13.5px; font-weight: 600; margin-bottom: 8px; padding: 0; }

.jos-drop { border: 2px dashed #c3cfd8; border-radius: var(--radius-lg); padding: 18px; background: #fbfcfd; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; transition: border-color .15s, background .15s; }
.jos-drop.is-over { border-color: var(--navy); background: var(--navy-50); }
.jos-drop__icon { width: 42px; height: 42px; border-radius: 10px; background: var(--navy-50); color: var(--navy); display: grid; place-items: center; font-size: 18px; flex: none; }
.jos-drop__text { flex: 1; min-width: 180px; font-size: 13.5px; }
.jos-drop__text strong { display: block; font-size: 14px; }
.jos-drop__list { width: 100%; margin: 0; padding: 0; list-style: none; font-size: 13px; }
.jos-drop__list li { padding: 6px 0; border-top: 1px solid var(--line-2); display: flex; justify-content: space-between; gap: 10px; }
.jos-drop input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }

/* ---------- Files ---------- */
.jos-files { list-style: none; margin: 0; padding: 0; }
.jos-files li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line-2); }
.jos-files li:first-child { border-top: 0; }
.jos-files__ext { width: 42px; height: 42px; flex: none; border-radius: 8px; background: var(--navy-50); color: var(--navy); font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.jos-files__main { min-width: 0; display: flex; flex-direction: column; }
.jos-files__main a { font-weight: 600; word-break: break-all; }
.jos-files__main small { color: var(--muted); font-size: 12.5px; }
.jos-files label.jos-check { margin-left: auto; font-size: 12.5px; color: var(--bad); }

/* ---------- Wizard ---------- */
.jos-steps { list-style: none; margin: 0 0 22px; padding: 0; display: flex; gap: 6px; counter-reset: step; overflow-x: auto; }
.jos-steps li { flex: 1; min-width: 120px; }
.jos-steps button { width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; cursor: pointer; display: flex; gap: 10px; align-items: center; font-size: 13px; font-weight: 600; color: var(--muted); }
.jos-steps button::before { counter-increment: step; content: counter(step); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--line-2); color: var(--muted); font-size: 12px; flex: none; }
.jos-steps button[aria-current="step"] { border-color: var(--navy); color: var(--navy); box-shadow: inset 0 -3px 0 var(--orange); }
.jos-steps button[aria-current="step"]::before { background: var(--navy); color: #fff; }
.jos-steps button.is-done::before { content: "✓"; background: var(--ok); color: #fff; }
.jos-steps button.has-error::before { content: "!"; background: var(--bad); color: #fff; }
.jos-step { display: none; }
.jos-step.is-current { display: block; }
.jos-step__nav { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line-2); }
.jos-wizard-js .jos-step__nav { display: flex; }
html:not(.js) .jos-step { display: block; }
html:not(.js) .jos-step__nav { display: none; }

.jos-author { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px; background: #fbfcfd; position: relative; }
.jos-author + .jos-author { margin-top: 12px; }
.jos-author__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.jos-author__head strong { font-size: 14px; }
.jos-author__tools { display: flex; gap: 6px; }
/* Author verification (SciNexID + e-mail must match) */
.jos-author [hidden] { display: none !important; }
.jos-author.is-verified { border-color: #b9dcc7; background: #fff; }
.jos-author__idrow { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto; align-items: end; }
.jos-author__idrow .jos-btn { height: 42px; }
.jos-author__hint { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }
.jos-author__hint.is-bad { color: var(--bad); font-weight: 600; }
.jos-author__who { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 14px; border-radius: var(--radius); background: var(--ok-50); flex-wrap: wrap; }
.jos-author__who > div { flex: 1 1 220px; min-width: 0; }
.jos-author__who strong { display: block; font-size: 15px; color: var(--ink); }
.jos-author__meta { display: block; font-size: 12.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.jos-author__avatar { width: 38px; height: 38px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--navy); color: #fff; font-weight: 700; font-size: 13px; }
@media (max-width: 720px) { .jos-author__idrow { grid-template-columns: 1fr; } .jos-author__idrow .jos-btn { width: 100%; } }
.jos-iconbtn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: #fff; display: inline-grid; place-items: center; cursor: pointer; color: var(--ink-2); }
.jos-iconbtn:hover { border-color: var(--navy); color: var(--navy); }

.jos-summary { display: grid; grid-template-columns: 200px 1fr; gap: 0; margin: 0; }
.jos-summary dt { padding: 10px 0; font-weight: 600; font-size: 13.5px; color: var(--muted); border-top: 1px solid var(--line-2); }
.jos-summary dd { margin: 0; padding: 10px 0; border-top: 1px solid var(--line-2); font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
.jos-summary dt:first-of-type, .jos-summary dd:first-of-type { border-top: 0; }

/* ---------- Manuscript view ---------- */
.jos-mhead { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px 22px; margin-bottom: 18px; }
.jos-mhead__meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: 13px; color: var(--muted); }
.jos-mhead h2 { font-size: 20px; margin: 10px 0 6px; }
.jos-mhead__authors { color: var(--ink-2); font-size: 14px; margin: 0; }
.jos-abstract { font-size: 14.5px; color: var(--ink-2); white-space: pre-line; }

.jos-timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.jos-timeline li { position: relative; padding: 0 0 16px 26px; }
.jos-timeline li::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: -6px; width: 2px; background: var(--line); }
.jos-timeline li:last-child::before { display: none; }
.jos-timeline li::after { content: ""; position: absolute; left: 1px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--navy); }
.jos-timeline li:first-child::after { background: var(--orange); border-color: var(--orange); }
.jos-timeline strong { display: block; font-size: 13.5px; }
.jos-timeline small { color: var(--muted); font-size: 12px; }
.jos-timeline p { margin: 6px 0 0; font-size: 13.5px; color: var(--ink-2); white-space: pre-line; background: var(--bg); padding: 8px 10px; border-radius: 6px; }

.jos-progress { display: flex; gap: 4px; margin: 14px 0 4px; }
.jos-progress span { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.jos-progress span.is-on { background: var(--navy); }
.jos-progress span.is-now { background: var(--orange); }
.jos-progress-labels { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); }

.jos-review { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px; }
.jos-review + .jos-review { margin-top: 12px; }
.jos-review__head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.jos-review__text { white-space: pre-line; font-size: 14px; color: var(--ink-2); background: var(--bg); border-radius: 8px; padding: 12px 14px; margin-top: 10px; }
.jos-scores { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.jos-scores span { font-size: 12.5px; background: var(--line-2); padding: 3px 9px; border-radius: 999px; }
.jos-letter { white-space: pre-line; font-size: 14px; line-height: 1.65; background: var(--bg); border-radius: 8px; padding: 14px 16px; }

.jos-scale { display: flex; gap: 6px; flex-wrap: wrap; }
.jos-scale label { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-weight: 600; background: #fff; }
.jos-scale input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.jos-scale label:has(input:checked) { background: var(--navy); border-color: var(--navy); color: #fff; }
.jos-scale label:has(input:focus-visible) { outline: 3px solid rgba(235,101,0,.55); outline-offset: 2px; }

/* ---------- Lists, empty states ---------- */
.jos-list { list-style: none; margin: 0; padding: 0; }
.jos-list li { display: flex; gap: 14px; justify-content: space-between; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line-2); }
.jos-list li:first-child { border-top: 0; }
.jos-list__main { min-width: 0; }
.jos-list__main a { font-weight: 600; text-decoration: none; color: var(--ink); }
.jos-list__main a:hover { color: var(--link); text-decoration: underline; }
.jos-list__main small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.jos-empty { text-align: center; padding: 36px 20px; color: var(--muted); }
.jos-empty i { font-size: 28px; color: #9fb1bd; }
.jos-empty h3 { margin: 10px 0 4px; font-size: 16px; color: var(--ink); }
.jos-empty p { margin: 0 0 14px; font-size: 14px; }

.jos-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 14px 20px; border-bottom: 1px solid var(--line-2); }
.jos-filters .jos-field { min-width: 160px; }
.jos-filters .jos-field input, .jos-filters .jos-field select { min-height: 38px; padding: 6px 10px; font-size: 13.5px; }
.jos-tabs { display: flex; gap: 4px; flex-wrap: wrap; padding: 0 20px; border-bottom: 1px solid var(--line-2); }
.jos-tabs a { padding: 12px 12px; font-size: 13.5px; font-weight: 600; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; }
.jos-tabs a.is-active { color: var(--navy); border-bottom-color: var(--orange); }
.jos-tabs a span { font-weight: 500; margin-left: 4px; color: var(--muted); }

/* ---------- Public pages ---------- */
.jos-top--public { position: static; }
.jos-public__main { min-height: calc(100vh - var(--top) - 64px); }
.jos-wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.jos-narrow { max-width: 560px; padding-top: 48px; padding-bottom: 48px; }
.jos-hero { background: linear-gradient(135deg, var(--navy) 0%, #024d70 100%); color: #fff; padding: 56px 0 64px; }
.jos-hero h1 { color: #fff; font-size: 38px; margin: 0 0 12px; max-width: 760px; }
.jos-hero p { font-size: 17px; color: #cfe0ea; max-width: 680px; margin: 0 0 24px; }
.jos-hero .jos-eyebrow { color: #f7a463; }
.jos-section { padding: 44px 0; }
.jos-section h2 { font-size: 24px; margin: 0 0 6px; }
.jos-journal { display: flex; gap: 16px; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.jos-journal__cover { width: 72px; height: 96px; flex: none; border-radius: 6px; background: linear-gradient(160deg, var(--navy), #035f88); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; overflow: hidden; }
.jos-journal__cover img { width: 100%; height: 100%; object-fit: cover; }
.jos-journal h3 { margin: 0 0 4px; font-size: 16px; }
.jos-journal p { margin: 0 0 10px; font-size: 13.5px; color: var(--muted); }
.jos-steps-public { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: s; }
.jos-steps-public div { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; }
.jos-steps-public div::before { counter-increment: s; content: counter(s); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--orange-50); color: var(--orange-btn); font-weight: 800; margin-bottom: 10px; }
.jos-steps-public h3 { margin: 0 0 6px; font-size: 15px; }
.jos-steps-public p { margin: 0; font-size: 13.5px; color: var(--muted); }
.jos-auth { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100vh - var(--top) - 64px); }
.jos-auth__aside { background: linear-gradient(160deg, var(--navy), #024d70); color: #d6e4ec; padding: 56px 48px; }
.jos-auth__aside h2 { color: #fff; font-size: 26px; margin: 0 0 12px; }
.jos-auth__aside ul { padding-left: 0; list-style: none; }
.jos-auth__aside li { display: flex; gap: 10px; margin: 12px 0; }
.jos-auth__aside li i { color: #f7a463; margin-top: 4px; }
.jos-auth__panel { padding: 48px; display: flex; justify-content: center; }
.jos-auth__box { width: 100%; max-width: 440px; }
.jos-seg { display: flex; background: var(--line-2); border-radius: 10px; padding: 4px; margin-bottom: 22px; }
.jos-seg a { flex: 1; text-align: center; padding: 9px; border-radius: 8px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px; }
.jos-seg a.is-active { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.jos-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 20px; border-top: 1px solid var(--line); background: #fff; font-size: 13px; color: var(--muted); }
.jos-foot nav { display: flex; gap: 16px; }
.jos-foot a { color: var(--muted); }
.jos-bigicon { font-size: 34px; color: var(--navy); }
.jos-debug { text-align: left; white-space: pre-wrap; background: #fff4f2; color: #7d1a14; padding: 10px; border-radius: 6px; font-size: 12px; }

/* ---------- Dialog ---------- */
dialog.jos-dialog { border: 0; border-radius: var(--radius-lg); padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog.jos-dialog::backdrop { background: rgba(2, 30, 45, .5); }
.jos-dialog__head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.jos-dialog__head h2 { margin: 0; font-size: 17px; }
.jos-dialog__body { padding: 18px 20px; }
.jos-dialog__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line-2); background: #fafbfc; }

/* ---------- Toasts ---------- */
.jos-toasts { position: fixed; right: 18px; bottom: 18px; z-index: 1900; display: grid; gap: 10px; width: min(360px, calc(100vw - 36px)); }
.jos-toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 10px; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.2); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .jos-split { grid-template-columns: 1fr; }
    .jos-steps-public { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
    .jos-top__menu { display: inline-grid; place-items: center; }
    .jos-top__link span, .jos-user__name { display: none; }
    .jos-side { position: fixed; left: 0; top: var(--top); bottom: 0; height: auto; z-index: 35; transform: translateX(-105%); transition: transform .2s; box-shadow: 4px 0 24px rgba(0,0,0,.12); }
    body.side-open .jos-side { transform: none; }
    body.side-open .jos-scrim { display: block; position: fixed; inset: var(--top) 0 0 0; background: rgba(2,30,45,.35); z-index: 30; }
    .jos-main { padding: 18px 16px 40px; }
    .jos-auth { grid-template-columns: 1fr; }
    .jos-auth__aside { display: none; }
    .jos-auth__panel { padding: 32px 16px; }
}
@media (max-width: 700px) {
    .jos-steps li { flex: 0 0 auto; min-width: 0; }
    .jos-steps li:has([aria-current]) { flex: 1 1 auto; }
    .jos-steps button:not([aria-current]) { font-size: 0; gap: 0; padding: 8px; }
    .jos-steps button:not([aria-current])::before { font-size: 12px; }
    .jos-grid--2, .jos-grid--3, .jos-row, .jos-row--3 { grid-template-columns: 1fr; }
    .jos-pagehead h1 { font-size: 22px; }
    .jos-hero h1 { font-size: 28px; }
    .jos-steps-public { grid-template-columns: 1fr; }
    .jos-summary { grid-template-columns: 1fr; }
    .jos-summary dd { border-top: 0; padding-top: 0; }
    .jos-top { padding: 0 12px; gap: 8px; }
    .jos-top--public .jos-top__link { display: none; }
    .jos-list li { flex-direction: column; align-items: flex-start; }
    .jos-table--stack thead { display: none; }
    .jos-table--stack tr { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line-2); }
    .jos-table--stack td { display: block; padding: 4px 0; border: 0; }
    .jos-table--stack td[data-label]::before { content: attr(data-label) ": "; font-weight: 600; color: var(--muted); font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { .jos-top, .jos-side, .jos-pagehead__actions, .jos-btn { display: none !important; } .jos-main { padding: 0; } }

/* ---------- Invoice / receipt ---------- */
.jos-invoice { overflow: hidden; }
.jos-invoice__head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 22px; border-bottom: 3px solid var(--navy); }
.jos-invoice__meta { text-align: right; }
.jos-invoice__parties { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 20px 22px; border-bottom: 1px solid var(--line-2); }
.jos-invoice__total td { font-weight: 800; font-size: 16px; background: var(--bg); }
@media (max-width: 700px) { .jos-invoice__parties { grid-template-columns: 1fr; } .jos-invoice__meta { text-align: left; } }
@media print {
    body { background: #fff; }
    .jos-noprint, .jos-crumbs, .jos-pagehead, .jos-alert, .jos-toasts { display: none !important; }
    .jos-split { display: block; }
    .jos-invoice { border: 0; }
}

/* ---------- contact form (sc-config/shared/contact.php: .scq) ---------- */
.scq-page, .scq, .scq-done { --scq-card: var(--card); --scq-line: var(--line); --scq-ink: var(--ink); --scq-muted: var(--muted); --scq-accent: var(--navy); --scq-on-accent: #fff; --scq-bad: var(--bad); --scq-input: var(--card); --scq-radius: var(--radius-lg); }

.scq-page { max-width: 760px; margin: 0 auto; padding: 28px 16px 56px; }
.scq-page h1 { margin: 0 0 8px; }
.scq-page .scq-lead { margin: 0 0 22px; color: var(--scq-muted); }
.scq, .scq-done { display: flex; flex-direction: column; gap: 16px; padding: 22px; background: var(--scq-card); border: 1px solid var(--scq-line); border-radius: var(--scq-radius); color: var(--scq-ink); }
.scq-row { display: flex; flex-wrap: wrap; gap: 16px; }
.scq-row > .scq-field { flex: 1 1 240px; min-width: 0; }
.scq-field, .scq-captcha { display: flex; flex-direction: column; gap: 6px; }
.scq label { font-size: 14px; font-weight: 600; color: var(--scq-ink); }
.scq-req { color: var(--scq-bad); font-weight: 700; }
.scq input[type=text], .scq input[type=email], .scq input[type=tel], .scq select, .scq textarea {
    width: 100%; min-height: 42px; padding: 10px 12px; font: inherit; font-size: 15px; color: var(--scq-ink);
    background: var(--scq-input); border: 1px solid var(--scq-line); border-radius: calc(var(--scq-radius) * .7); box-sizing: border-box; }
.scq textarea { min-height: 150px; resize: vertical; line-height: 1.5; }
.scq input:focus, .scq select:focus, .scq textarea:focus { outline: 0; border-color: var(--scq-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--scq-accent) 22%, transparent); }
.scq-invalid input, .scq-invalid select, .scq-invalid textarea { border-color: var(--scq-bad); }
.scq-hint { font-size: 12.5px; color: var(--scq-muted); }
.scq-err { font-size: 13px; color: var(--scq-bad); font-weight: 600; }
.scq-alert { margin: 0; padding: 10px 14px; border-radius: calc(var(--scq-radius) * .7); background: color-mix(in srgb, var(--scq-bad) 10%, transparent); color: var(--scq-bad); font-weight: 600; }
.scq-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.scq-cap-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.scq-cap-img { border-radius: 6px; flex: 0 0 auto; max-width: 100%; height: auto; }
.scq-cap-row input { flex: 1 1 160px; max-width: 220px; letter-spacing: .12em; }
.scq-consent label { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 14px; line-height: 1.45; }
.scq-consent input { margin-top: 3px; flex: 0 0 auto; width: 16px; height: 16px; }
.scq-consent a { color: var(--scq-accent); }
.scq-actions { display: flex; justify-content: flex-end; }
.scq-btn { min-height: 44px; padding: 10px 22px; border: 0; border-radius: calc(var(--scq-radius) * .7); background: var(--scq-accent); color: var(--scq-on-accent); font: inherit; font-weight: 700; cursor: pointer; }
.scq-btn:hover { filter: brightness(1.08); }
.scq-done h2 { margin: 0; font-size: 20px; }
.scq-done p { margin: 0; }
.scq-done a { color: var(--scq-accent); font-weight: 600; }
@media (max-width: 560px) { .scq, .scq-done { padding: 16px; } .scq-actions .scq-btn { width: 100%; } }
