:root {
  --bg: #f4efe6;
  --bg-deep: #e6dcc9;
  --panel: rgba(255, 250, 241, 0.92);
  --line: rgba(74, 49, 24, 0.14);
  --ink: #2e2318;
  --muted: #6f5b47;
  --accent: #a2411d;
  --accent-strong: #7c2b11;
  --ok: #1d7a54;
  --warn: #a35c12;
  --shadow: 0 24px 60px rgba(76, 52, 24, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Aptos", "Segoe UI Variable Text", "PingFang SC", "Noto Sans SC", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(162, 65, 29, 0.15), transparent 30%),
    radial-gradient(circle at top right, rgba(29, 122, 84, 0.16), transparent 26%),
    linear-gradient(180deg, var(--bg) 0%, #f8f4ec 45%, var(--bg-deep) 100%);
}

.shell {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 48px;
}

body.auth-locked {
  overflow: hidden;
}

.user-auth-gate {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 0;
  background: #b4532b;
}

.user-auth-gate[hidden],
.user-sidebar[hidden] {
  display: none;
}

.auth-landing {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(430px, 0.82fr);
  width: 100%;
  min-height: 100dvh;
  overflow: hidden;
  background:
    linear-gradient(118deg, transparent 0 49%, rgba(255, 241, 222, 0.1) 49.2% 49.5%, transparent 49.7%),
    linear-gradient(24deg, transparent 0 71%, rgba(255, 241, 222, 0.08) 71.2% 71.5%, transparent 71.7%),
    radial-gradient(circle at 83% 10%, rgba(255, 212, 174, 0.34), transparent 26%),
    radial-gradient(circle at 14% 92%, rgba(107, 44, 20, 0.24), transparent 34%),
    linear-gradient(138deg, #9d431f 0%, #b9542a 54%, #cc7041 100%);
  animation: auth-landing-in 520ms ease-out both;
}

.user-auth-showcase {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: visible;
  min-height: 100dvh;
  padding: clamp(48px, 8vw, 110px);
  color: #fff7ed;
  background: transparent;
}

.user-auth-showcase::after {
  position: absolute;
  right: -120px;
  bottom: -155px;
  width: 390px;
  height: 390px;
  border: 1px solid rgba(255, 245, 232, 0.24);
  border-radius: 50%;
  box-shadow: 0 0 0 42px rgba(255, 245, 232, 0.07), 0 0 0 98px rgba(255, 245, 232, 0.05);
  content: "";
}

.auth-showcase-kicker,
.auth-showcase-label {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.auth-showcase-kicker {
  color: rgba(255, 247, 237, 0.76);
}

.auth-showcase-copy {
  position: relative;
  z-index: 1;
  max-width: 500px;
  margin: auto 0;
}

.auth-showcase-label {
  margin-bottom: 16px;
  color: #ffcfaa;
}

.auth-showcase-copy h2 {
  margin: 0;
  font-family: "Noto Serif SC", "Songti SC", "STSong", Georgia, serif;
  font-size: clamp(42px, 5.1vw, 70px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.06em;
}

.auth-showcase-copy > p:last-child {
  max-width: 420px;
  margin: 26px 0 0;
  color: rgba(255, 247, 237, 0.86);
  font-size: 16px;
  line-height: 1.8;
}

.auth-showcase-steps {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  color: rgba(255, 247, 237, 0.88);
  font-size: 13px;
}

.auth-showcase-steps span {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
}

.auth-showcase-steps b {
  color: #ffcfaa;
  font-family: Georgia, serif;
  font-size: 16px;
}

.auth-showcase-math {
  position: absolute;
  inset: 0 auto auto 0;
  width: 100vw;
  height: 100dvh;
  z-index: 0;
  pointer-events: none;
  color: rgba(255, 244, 231, 0.2);
  font-family: Georgia, "Times New Roman", serif;
}

.auth-showcase-math span {
  position: absolute;
  will-change: transform;
}

.auth-showcase-math span:nth-child(1) { top: 11%; right: 42%; font-size: 78px; animation: auth-symbol-sweep-a 12s ease-in-out infinite; }
.auth-showcase-math span:nth-child(2) { top: 52%; right: 47%; font-size: 56px; animation: auth-symbol-sweep-b 15s ease-in-out infinite -3s; }
.auth-showcase-math span:nth-child(3) { bottom: 11%; left: 22%; font-size: 62px; animation: auth-symbol-sweep-c 14s ease-in-out infinite -6s; }
.auth-showcase-math span:nth-child(4) { top: 30%; left: 11%; font-size: 44px; animation: auth-symbol-sweep-d 13s ease-in-out infinite -2s; }
.auth-showcase-math span:nth-child(5) { top: 18%; left: 43%; font-size: 30px; animation: auth-symbol-sweep-e 16s ease-in-out infinite -8s; }
.auth-showcase-math span:nth-child(6) { top: 8%; left: 32%; font-size: 40px; animation: auth-symbol-sweep-b 17s ease-in-out infinite -11s; }
.auth-showcase-math span:nth-child(7) { top: 67%; left: 8%; font-size: 50px; animation: auth-symbol-sweep-d 18s ease-in-out infinite -7s; }
.auth-showcase-math span:nth-child(8) { top: 42%; left: 39%; font-size: 42px; animation: auth-symbol-sweep-a 15s ease-in-out infinite -9s; }
.auth-showcase-math span:nth-child(9) { bottom: 12%; left: 14%; font-size: 46px; animation: auth-symbol-sweep-c 19s ease-in-out infinite -14s; }
.auth-showcase-math span:nth-child(10) { top: 61%; left: 48%; font-size: 44px; animation: auth-symbol-sweep-e 16s ease-in-out infinite -5s; }

.user-auth-card {
  position: relative;
  z-index: 2;
  align-self: center;
  justify-self: center;
  width: min(448px, calc(100% - 52px));
  margin: 0 auto;
  padding: clamp(34px, 5vw, 62px) clamp(28px, 5vw, 62px);
  border: 1px solid rgba(91, 47, 27, 0.15);
  border-radius: 30px;
  background: rgba(255, 250, 242, 0.97);
  box-shadow: 0 28px 76px rgba(80, 33, 15, 0.26);
}

.user-auth-card h1 {
  margin: 0;
  font-family: "Noto Serif SC", "Songti SC", "STSong", Georgia, serif;
  font-size: clamp(22px, 7.3vw, 40px);
  letter-spacing: -0.07em;
  white-space: nowrap;
}

.user-auth-description,
.user-auth-note {
  color: var(--muted);
  line-height: 1.7;
}

.user-auth-form {
  display: grid;
  gap: 15px;
  margin-top: 24px;
}

.user-auth-field {
  display: grid;
  gap: 7px;
  font-weight: 700;
}

.user-auth-field input {
  width: 100%;
  min-height: 50px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  font: inherit;
}

.user-auth-submit {
  min-height: 52px;
  border: 0;
  border-radius: 12px;
  color: #fffaf1;
  background: var(--accent);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.user-auth-submit:hover {
  background: var(--accent-strong);
}

.user-auth-toggle {
  margin-top: 16px;
  padding: 0;
  border: 0;
  color: var(--accent-strong);
  background: transparent;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.user-auth-error {
  min-height: 24px;
  margin: 0;
  color: #a12f2f;
  font-weight: 700;
}

@keyframes auth-landing-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes auth-symbol-sweep-a {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(-5deg); }
  50% { transform: translate3d(-76px, 42px, 0) rotate(10deg); }
}

@keyframes auth-symbol-sweep-b {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(4deg); }
  50% { transform: translate3d(72px, -62px, 0) rotate(-9deg); }
}

@keyframes auth-symbol-sweep-c {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(-2deg); }
  50% { transform: translate3d(82px, -48px, 0) rotate(10deg); }
}

@keyframes auth-symbol-sweep-d {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(5deg); }
  50% { transform: translate3d(-54px, -68px, 0) rotate(-9deg); }
}

@keyframes auth-symbol-sweep-e {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(-4deg); }
  50% { transform: translate3d(78px, 54px, 0) rotate(8deg); }
}

@media (prefers-reduced-motion: reduce) {
  .auth-landing,
  .auth-showcase-math span {
    animation: none;
  }
}

.user-session-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 12px 16px;
  border: 1px solid rgba(74, 49, 24, 0.12);
  border-radius: 16px;
  background: rgba(255, 250, 241, 0.72);
}

.session-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.user-ledger-panel {
  margin-bottom: 18px;
  padding: 20px 22px;
  border: 1px solid rgba(74, 49, 24, 0.12);
  border-radius: 24px;
  background: rgba(255, 250, 241, 0.72);
  box-shadow: 0 16px 40px rgba(74, 49, 24, 0.07);
}

.user-ledger-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.user-ledger-head h2 {
  margin: 0;
  font-family: "Georgia", "Times New Roman", serif;
  font-size: 25px;
}

.user-ledger-head .eyebrow {
  margin: 0 0 4px;
}

.user-ledger-status {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.user-ledger-head-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.user-ledger-balance-inline {
  display: grid;
  gap: 2px;
  min-width: 86px;
  padding-left: 18px;
  border-left: 1px solid rgba(74, 49, 24, 0.16);
}

.user-ledger-balance-inline span,
.user-ledger-balance-inline em,
.user-ledger-billing-note {
  color: var(--muted);
}

.user-ledger-balance-inline > div {
  display: flex;
  align-items: baseline;
  min-height: 30px;
}

.user-ledger-balance-inline strong {
  display: inline-block;
  min-width: 3ch;
  color: var(--ink);
  font: 700 26px/1 "Segoe UI", "Microsoft YaHei UI", sans-serif;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  text-align: right;
}

.user-ledger-balance-inline em {
  margin-left: 4px;
  padding-bottom: 1px;
  font-size: 12px;
  font-style: normal;
}

.user-ledger-billing-note {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.1;
}

.user-ledger-table-wrap {
  margin-top: 12px;
  overflow-x: auto;
}

.user-ledger-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.user-ledger-pagination button {
  padding: 7px 11px;
  font-size: 12px;
}

.user-ledger-pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.user-ledger-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 13px;
}

.user-ledger-table th,
.user-ledger-table td {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(74, 49, 24, 0.1);
  text-align: left;
  vertical-align: top;
}

.user-ledger-table th {
  color: var(--muted);
  font-weight: 700;
}

.user-ledger-table td.positive {
  color: var(--ok);
  font-weight: 700;
}

.user-ledger-table td.negative {
  color: var(--accent-strong);
  font-weight: 700;
}

.user-workspace-shell {
  width: 100%;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  align-items: start;
  gap: 0;
  padding: 0;
}

.user-workspace-content {
  min-width: 0;
  width: min(1380px, calc(100% - 48px));
  max-width: 1380px;
  margin: 0 auto;
  padding: 36px 0 48px;
}

.user-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding: 18px 14px 14px;
  border: 0;
  border-radius: 0;
  color: #fff7ed;
  background:
    radial-gradient(circle at 110% 4%, rgba(255, 202, 157, 0.42), transparent 34%),
    linear-gradient(160deg, #8f3518 0%, #aa4823 52%, #bd6036 100%);
  box-shadow: 0 24px 58px rgba(95, 42, 19, 0.2);
}

.user-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 7px 18px;
}

.user-sidebar-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  color: #963a1a;
  background: #fff5e8;
  font-family: Georgia, serif;
  font-size: 22px;
  font-weight: 800;
}

.user-sidebar-brand strong,
.user-sidebar-brand small {
  display: block;
}

.user-sidebar-brand strong { font-size: 15px; letter-spacing: -.02em; }
.user-sidebar-brand small { margin-top: 1px; color: rgba(255, 244, 232, .72); font-size: 11px; }

.user-sidebar-account {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid rgba(255, 245, 234, 0.2);
  border-radius: 17px;
  background: rgba(92, 33, 13, 0.16);
}

.user-sidebar-account span { color: rgba(255, 244, 232, .72); font-size: 11px; letter-spacing: .08em; }
.user-sidebar-account strong { overflow-wrap: anywhere; font-size: 16px; }

.user-sidebar-nav { display: grid; gap: 7px; margin-top: 20px; }

.user-sidebar-link,
.user-sidebar-logout {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 13px;
  color: rgba(255, 248, 239, .86);
  background: transparent;
  font: inherit;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.user-sidebar-link:hover,
.user-sidebar-link.is-active { border-color: rgba(255, 245, 234, .2); color: #fff; background: rgba(255, 248, 239, .16); }

.user-sidebar-footer {
  margin-top: auto;
  padding: 17px 5px 2px;
}

.user-sidebar-footer p {
  margin: 0 0 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 244, 232, .24);
  color: rgba(255, 244, 232, .72);
  font-size: 11px;
  line-height: 1.65;
}

.user-sidebar-logout { color: #fff; background: rgba(74, 24, 8, .2); }
.user-sidebar-logout:hover { color: #fff; background: rgba(102, 24, 13, .24); }

.user-topup-panel,
.user-redeem-panel,
.user-contact-panel {
  padding: 26px;
  border: 1px solid rgba(74, 49, 24, .12);
  border-radius: 24px;
  background: rgba(255, 250, 241, .72);
  box-shadow: 0 16px 40px rgba(74, 49, 24, .07);
}

.user-contact-panel h2 { margin: 0; font: 30px Georgia, "Times New Roman", serif; }
.user-redeem-panel h2 { margin: 0; font: 30px Georgia, "Times New Roman", serif; }
.user-redeem-form { display: grid; gap: 9px; max-width: 620px; margin-top: 24px; padding: 18px; border: 1px solid rgba(179, 70, 22, .22); border-radius: 16px; background: #fffdf9; }
.user-redeem-form > label { color: var(--muted); font-size: 13px; font-weight: 700; }
.user-redeem-actions { display: flex; gap: 10px; }
.user-redeem-actions input { min-width: 0; flex: 1; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fff; font: 700 15px/1.4 "Cascadia Mono", Consolas, monospace; text-transform: uppercase; }
.user-redeem-actions button { padding: 10px 16px; border: 1px solid var(--accent); border-radius: 10px; color: #fff; background: var(--accent); font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; }
.user-redeem-actions button:hover { background: var(--accent-strong); }
.user-redeem-actions button:disabled { cursor: wait; opacity: .65; }
.user-contact-lede { max-width: 620px; margin: 12px 0 22px; color: var(--muted); line-height: 1.75; }
.user-contact-email-card { display: grid; gap: 7px; max-width: 520px; padding: 18px; border: 1px solid rgba(179, 70, 22, .22); border-radius: 16px; background: #fffdf9; }
.user-contact-email-card span { color: var(--muted); font-size: 12px; }
.user-contact-email-card a { color: var(--accent-strong); font-weight: 700; overflow-wrap: anywhere; }
.user-contact-note { margin: 14px 0 0; color: var(--muted); font-size: 12px; }


.user-topup-notice {
  margin: 20px 0 0;
  padding: 11px 13px;
  border: 1px solid rgba(163, 92, 18, .2);
  border-radius: 13px;
  color: #754717;
  background: rgba(255, 233, 196, .46);
  font-size: 13px;
  line-height: 1.65;
}

.user-offers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.user-offer-card {
  display: grid;
  gap: 7px;
  min-height: 210px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .62);
}

.user-offer-kicker,
.user-offer-card p,
.user-offer-card small { margin: 0; color: var(--muted); }
.user-offer-kicker { font-size: 13px; font-weight: 700; }
.user-offer-card strong { color: var(--accent-strong); }
.user-offer-price {
  display: block;
  min-height: 31px;
  text-align: left;
  font: 31px/1 "Cambria", "Times New Roman", serif;
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: "lnum" 1, "tnum" 1;
  letter-spacing: .01em;
}
.user-offer-card p { font-weight: 700; }
.user-offer-card small { font-size: 12px; }
.user-offer-card button { margin-top: auto; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: #f6f1e9; font: inherit; font-size: 12px; font-weight: 700; }
.user-offer-card button:disabled { cursor: not-allowed; opacity: .86; }
.user-offer-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: auto; }
.user-offer-actions button { margin-top: 0; color: #fff; border-color: var(--accent); background: var(--accent); cursor: pointer; }
.user-offer-actions button:hover { background: var(--accent-strong); }
.user-offer-actions button:disabled { cursor: wait; }
.user-live-test-card { border-color: rgba(179, 70, 22, .35); }
.user-live-test-input { display: grid; gap: 4px; color: var(--muted); font-size: 12px; }
.user-live-test-input input { width: 100%; min-width: 0; padding: 8px 9px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #fffdf9; font: inherit; font-variant-numeric: tabular-nums; }
.user-live-test-input input:focus { outline: 2px solid rgba(179, 70, 22, .24); outline-offset: 1px; border-color: var(--accent); }
.user-empty-copy { margin: 0; padding: 18px; color: var(--muted); }
.user-order-history { margin-top: 28px; }
.user-order-history h3 { margin: 0; font: 22px Georgia, "Times New Roman", serif; }

body.review-mode {
  height: 100vh;
  overflow: hidden;
}

body.review-mode .user-workspace-shell {
  width: 100%;
  max-width: none;
  height: 100vh;
  min-height: 100vh;
  padding: 0;
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
}

body.review-mode .user-workspace-content {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 14px;
  min-height: 0;
  overflow: hidden;
}

body.review-mode #fix-review-panel {
  margin-top: 0;
  flex: 1;
  height: calc(100vh - 28px);
  max-height: calc(100vh - 28px);
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.review-mode #fix-list {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

body.review-mode #fix-review-panel .review-doc-panel {
  height: auto;
  align-self: stretch;
  min-height: 0;
  max-height: none;
}

body.review-mode #fix-review-panel .review-doc-body {
  overflow-y: auto;
  max-height: none;
}

body.review-mode #fix-review-panel .panel-head,
body.review-mode #fix-review-panel .review-page-title,
body.review-mode #fix-review-panel .review-actions,
body.review-mode #fix-review-panel #fix-result-box {
  flex: 0 0 auto;
}

.review-page-title {
  margin: 0 0 12px;
}

.review-page-title h2 {
  margin: 0;
  color: var(--ink);
  font: 28px/1.15 Georgia, "Times New Roman", serif;
}

body.review-mode #fix-review-panel .panel-head {
  position: sticky;
  top: 0;
  z-index: 18;
  background: var(--panel);
  padding-bottom: 12px;
}

.review-structure-form-wrap {
  margin-top: 20px;
}

.review-structure-layout {
  display: grid;
  gap: 18px;
}

.review-structure-section {
  padding: 18px;
  border: 1px solid rgba(163, 92, 18, 0.18);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(163, 92, 18, 0.085), rgba(163, 92, 18, 0.06));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.review-structure-section-head h3 {
  margin: 0;
  font-size: 20px;
}

.review-structure-section-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.review-structure-section-head-with-action {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.review-structure-section-head-with-action > div {
  min-width: 0;
}

.review-structure-list {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.review-structure-row-card {
  padding: 14px;
  border: 1px solid rgba(163, 92, 18, 0.13);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
}

.review-structure-row-title {
  margin: 0 0 12px;
  color: var(--accent-strong);
  font-size: 16px;
  font-weight: 700;
}

.review-structure-row-grid {
  display: grid;
  gap: 12px;
}

.review-structure-row-grid-front {
  grid-template-columns: minmax(0, 2fr) minmax(280px, 0.9fr);
  align-items: start;
}

.review-structure-row-grid-front .field {
  margin: 0;
}

.review-structure-front-body-field {
  margin-top: 10px;
}

.review-structure-row-grid-front textarea,
[data-structure-field="keywords"] {
  min-height: 46px;
  height: auto;
  resize: none;
  overflow: hidden;
  line-height: 1.6;
  padding-top: 11px;
  padding-bottom: 11px;
}

.review-structure-row-grid-title-note {
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
}

.review-structure-row-grid-author {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.review-structure-row-grid-author-top {
  grid-template-columns: minmax(180px, 0.8fr) minmax(180px, 0.8fr) minmax(260px, 1.35fr) auto auto;
  align-items: start;
}

.review-structure-row-grid-author-detail {
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.4fr);
  margin-top: 12px;
}

.review-structure-row-grid-author-detail textarea[data-author-field="contributions"] {
  min-height: 46px;
  height: auto;
  resize: none;
  overflow: hidden;
  line-height: 1.6;
  padding-top: 11px;
  padding-bottom: 11px;
}

.review-structure-row-grid-statement {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.review-structure-statement-card {
  padding: 16px;
  border-radius: 20px;
}

.review-structure-statement-card .field-full {
  margin-top: 12px;
}

.review-structure-statement-card textarea[data-statement-field="body"] {
  min-height: 46px;
  height: auto;
  resize: none;
  overflow: hidden;
  line-height: 1.6;
  padding-top: 11px;
  padding-bottom: 11px;
}

.review-structure-statement-actions {
  justify-content: flex-end;
  margin-top: 14px;
}

.review-structure-statement-toolbar {
  justify-content: flex-end;
  margin-top: 12px;
}

.review-structure-affiliation-group {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(163, 92, 18, 0.18);
}

.review-structure-affiliation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.review-structure-affiliation-head h4 {
  margin: 0;
  font-size: 18px;
  color: var(--ink);
}

.review-structure-affiliation-card {
  padding: 16px;
}

.review-structure-row-grid-affiliation {
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
}

.review-structure-row-grid-affiliation .field {
  margin: 0;
}

.review-structure-affiliation-index-field span,
.review-structure-affiliation-text-field span {
  display: none;
}

.review-structure-affiliation-text-field textarea {
  min-height: 58px;
}

.review-structure-affiliation-index-display {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-strong);
  font-weight: 700;
  white-space: nowrap;
}

.review-structure-affiliation-text-field textarea {
  height: 58px;
  resize: vertical;
}

.review-structure-affiliation-action {
  display: flex;
  align-items: flex-start;
}

.review-structure-checkbox-field {
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-height: 100%;
  padding-top: 29px;
}

.review-structure-checkbox-field span {
  margin: 0;
  text-align: right;
  line-height: 1.2;
}

.review-structure-checkbox-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  flex: 0 0 auto;
}

.review-structure-inline-actions,
.review-structure-actions {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.review-structure-title-note-toolbar {
  justify-content: flex-end;
  margin-top: 10px;
}

.review-structure-actions {
  margin-top: 20px;
  justify-content: flex-end;
  align-items: center;
}

.review-structure-primary-action {
  min-height: 48px;
  padding: 0 22px;
  border-radius: 14px;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  box-shadow: 0 16px 32px rgba(124, 43, 17, 0.22);
}

.review-structure-title-note-card {
  padding: 18px 16px;
  border: 1px dashed rgba(163, 92, 18, 0.16);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
}

.review-structure-title-note-label {
  margin: 12px 0 0;
  font-weight: 700;
  color: var(--accent-strong);
  white-space: nowrap;
}

.review-structure-title-note-field {
  margin: 0;
}

.review-structure-title-note-field span {
  display: none;
}

.review-structure-title-note-field textarea {
  min-height: 46px;
  height: 46px;
  resize: none;
  overflow: hidden;
  line-height: 1.6;
  padding-top: 11px;
  padding-bottom: 11px;
}

.review-structure-title-note-action {
  display: flex;
  align-items: flex-start;
}

.review-structure-title-note-add {
  min-width: 116px;
  height: 44px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 14px;
  border: 1px solid rgba(163, 92, 18, 0.18);
  background: rgba(163, 92, 18, 0.07);
  color: var(--accent-strong) !important;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(124, 43, 17, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.review-structure-title-note-add:hover {
  transform: translateY(-1px);
  background: rgba(163, 92, 18, 0.1);
  color: var(--accent-strong) !important;
  box-shadow: 0 10px 20px rgba(124, 43, 17, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.review-structure-title-note-add:focus,
.review-structure-title-note-add:active {
  color: var(--accent-strong) !important;
}

.review-structure-empty {
  padding: 14px 16px;
  border: 1px dashed rgba(74, 49, 24, 0.18);
  border-radius: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.68);
}

.review-structure-author-card {
  padding: 14px 16px;
  border-radius: 20px;
}

.review-structure-author-card.is-dragging {
  opacity: 0.38;
}

.review-structure-author-card.is-drop-before,
.review-structure-author-card.is-drop-after {
  position: relative;
}

.review-structure-author-card.is-drop-before::before,
.review-structure-author-card.is-drop-after::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  height: 3px;
  border-radius: 999px;
  background: rgba(163, 92, 18, 0.72);
  box-shadow: 0 4px 12px rgba(163, 92, 18, 0.22);
}

.review-structure-author-card.is-drop-before::before {
  top: -9px;
}

.review-structure-author-card.is-drop-after::after {
  bottom: -9px;
}

.review-structure-author-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.review-structure-author-handle {
  display: grid;
  grid-template-columns: repeat(2, 4px);
  gap: 4px 5px;
  padding: 6px 2px;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.review-structure-author-handle:active {
  cursor: grabbing;
}

.review-structure-author-handle span {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: rgba(74, 49, 24, 0.28);
}

.review-structure-author-drag-active {
  cursor: grabbing;
  user-select: none;
}

.review-structure-author-drag-ghost {
  position: fixed;
  z-index: 5000;
  pointer-events: none;
  box-sizing: border-box;
  border: 1px solid rgba(163, 92, 18, 0.2);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 40px rgba(74, 49, 24, 0.2);
  transform: rotate(0.2deg);
}

.review-structure-author-summary-main {
  min-width: 0;
}

.review-structure-author-summary-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.review-structure-author-order {
  color: var(--accent-strong);
  font-weight: 700;
}

.review-structure-author-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  word-break: break-word;
}

.review-structure-author-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(124, 43, 17, 0.08);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
}

.review-structure-author-summary-sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
}

.review-structure-author-summary-detail {
  margin-top: 4px;
  color: rgba(74, 49, 24, 0.72);
  font-size: 13px;
  line-height: 1.55;
  word-break: break-word;
}

.review-structure-author-summary-detail + .review-structure-author-summary-detail {
  margin-top: 2px;
}

.review-structure-author-summary-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.review-structure-author-editor {
  display: none;
  margin-top: 16px;
  padding: 16px;
  border: 1px dashed rgba(163, 92, 18, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
}

.review-structure-author-card.is-expanded .review-structure-author-editor {
  display: block;
}

.review-structure-author-corresponding-field {
  min-width: 116px;
  max-width: 132px;
}

.review-structure-author-equal-field {
  min-width: 148px;
  max-width: 168px;
}

.review-structure-author-name-field {
  max-width: 280px;
}

.review-structure-author-index-field {
  max-width: 260px;
}

.review-structure-author-email-field {
  min-width: 0;
}

.review-structure-affiliation-dropdown {
  position: relative;
}

.review-structure-affiliation-dropdown-toggle {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border: 1px solid rgba(74, 49, 24, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.review-structure-affiliation-dropdown-toggle:hover {
  border-color: rgba(163, 92, 18, 0.3);
  box-shadow: 0 8px 18px rgba(74, 49, 24, 0.06);
}

.review-structure-affiliation-dropdown-arrow {
  color: var(--accent-strong);
  font-size: 13px;
  line-height: 1;
}

.review-structure-affiliation-choice-list {
  position: absolute;
  z-index: 80;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: none;
  max-height: 220px;
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(163, 92, 18, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 34px rgba(74, 49, 24, 0.14);
}

.review-structure-affiliation-dropdown.is-open .review-structure-affiliation-choice-list {
  display: grid;
  gap: 6px;
}

.review-structure-affiliation-choice {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 12px;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
}

.review-structure-affiliation-choice:hover {
  background: rgba(163, 92, 18, 0.065);
}

.review-structure-affiliation-choice input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--accent-strong);
}

.review-structure-affiliation-choice-name {
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.review-structure-affiliation-choice-preview {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-structure-affiliation-choice-empty {
  display: block;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 13px;
}

.review-structure-author-note-field {
  margin-top: 12px;
}

.review-structure-author-top textarea {
  min-height: 46px;
  height: auto;
  resize: none;
  overflow: hidden;
}

.review-structure-row-grid-author-top textarea {
  min-height: 46px;
  height: auto;
  resize: none;
  overflow: hidden;
}

.hero {
  padding: 24px 0 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  max-width: 820px;
  font-family: "Georgia", "Times New Roman", serif;
  font-size: clamp(34px, 4.8vw, 60px);
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.lede {
  margin: 18px 0 0;
  max-width: 760px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.hero-badges span {
  padding: 10px 14px;
  border: 1px solid rgba(163, 92, 18, 0.18);
  border-radius: 16px;
  background: rgba(163, 92, 18, 0.07);
  color: var(--muted);
  font-size: 13px;
}


.panel {
  margin-top: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel-head h2 {
  margin: 0;
  font-family: "Georgia", "Times New Roman", serif;
  font-size: 28px;
}

.panel-head p {
  margin: 8px 0 0;
  color: var(--muted);
}

.panel-head-split {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.panel-head-split > div {
  min-width: 0;
}

.task-back-btn {
  align-self: flex-start;
  white-space: nowrap;
  font-weight: 700;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.field-full {
  grid-column: 1 / -1;
}

.field span {
  font-size: 14px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(74, 49, 24, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font: inherit;
  outline: none;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(162, 65, 29, 0.55);
  box-shadow: 0 0 0 4px rgba(162, 65, 29, 0.08);
}

.journal-lookup-field {
  position: relative;
  padding: 18px;
  border: 1px solid rgba(162, 65, 29, 0.18);
  border-radius: 22px;
  background: rgba(255, 247, 237, 0.72);
}

.journal-lookup-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(190px, 0.75fr) minmax(220px, 1fr);
  gap: 14px;
}

.journal-lookup-field.template-selector-hidden .journal-template-control {
  display: none;
}

.journal-lookup-field.template-selector-hidden .journal-lookup-grid {
  grid-template-columns: minmax(0, 2fr) minmax(220px, 0.75fr);
}

.journal-lookup-control {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.journal-lookup-control span,
.journal-template-control span {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.journal-suggestions {
  position: absolute;
  z-index: 30;
  top: calc(100% - 12px);
  left: 18px;
  right: 18px;
  max-height: 300px;
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(74, 49, 24, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 48px rgba(74, 49, 24, 0.16);
}

.journal-suggestion-item {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.journal-suggestion-item:hover,
.journal-suggestion-item:focus {
  background: rgba(255, 247, 237, 0.95);
  outline: none;
}

.journal-suggestion-title {
  font-weight: 700;
}

.journal-suggestion-meta,
.journal-selected-info {
  color: var(--muted);
  font-size: 13px;
}

.journal-selected-info {
  margin: 0;
}

.journal-template-note {
  margin: 2px 0 0;
  color: #865126;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.55;
}

.journal-template-control {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}

.dropzone {
  padding: 18px;
  border: 1px dashed rgba(162, 65, 29, 0.35);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 247, 237, 0.95), rgba(255, 255, 255, 0.8));
}

.dropzone.dragover {
  transform: translateY(-1px);
  border-color: rgba(162, 65, 29, 0.8);
  box-shadow: 0 18px 40px rgba(162, 65, 29, 0.12);
}

.dropzone strong {
  font-size: 18px;
}

.word-upload-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.word-upload-controls input[type="file"] {
  flex: 1 1 360px;
  min-width: min(100%, 300px);
  font-weight: 400;
}

.word-upload-file-control,
.word-upload-bib-control {
  display: grid;
  flex: 1 1 360px;
  gap: 5px;
  min-width: min(100%, 300px);
  color: var(--ink);
  font-weight: 700;
}

.word-upload-bib-control input[type="file"] {
  flex: 1 1 auto;
  min-width: 0;
}

.word-upload-actions {
  align-self: flex-end;
  margin-top: 0;
  flex: 0 0 auto;
}

.word-final-draft-hint {
  margin-top: -4px;
}

.word-upload-helper-row {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 3px;
}

.word-upload-guide-row {
  display: flex;
  align-items: center;
}

.validation-progress {
  margin-top: 4px;
  padding: 14px 16px 15px;
  border: 1px solid rgba(163, 92, 18, 0.25);
  border-radius: 14px;
  background: rgba(255, 244, 230, 0.76);
}

.validation-progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
}

.validation-progress-head strong {
  font-size: 14px;
}

.validation-progress-head span {
  color: var(--warn);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.validation-progress-track {
  height: 8px;
  margin-top: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(132, 81, 42, 0.15);
}

.validation-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #a9441f, #d47a42);
  transition: width 520ms ease;
}

.validation-progress-steps {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.validation-progress-steps li {
  position: relative;
  min-width: 0;
  padding-left: 12px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.validation-progress-steps li::before {
  position: absolute;
  top: 0.32em;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(132, 81, 42, 0.24);
  content: "";
}

.validation-progress-steps li.is-complete,
.validation-progress-steps li.is-active {
  color: #873714;
  font-weight: 700;
}

.validation-progress-steps li.is-complete::before {
  background: #a9441f;
}

.validation-progress-steps li.is-active::before {
  background: #d47a42;
  box-shadow: 0 0 0 4px rgba(212, 122, 66, 0.16);
  animation: validation-progress-pulse 1.35s ease-in-out infinite;
}

@keyframes validation-progress-pulse {
  50% {
    box-shadow: 0 0 0 7px rgba(212, 122, 66, 0.05);
  }
}

@media (max-width: 640px) {
  .validation-progress-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.upload-format-guide-btn {
  padding: 8px 12px;
  border: 1px solid rgba(163, 92, 18, 0.3);
  border-radius: 10px;
  background: rgba(163, 92, 18, 0.08);
  color: var(--accent-strong);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.upload-format-guide-dialog {
  width: min(880px, calc(100vw - 32px));
  max-width: none;
  height: min(820px, calc(100dvh - 40px));
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(162, 65, 29, 0.22);
  border-radius: 24px;
  background: #fffaf3;
  box-shadow: 0 28px 80px rgba(54, 31, 16, 0.3);
  color: var(--ink);
}

.upload-format-guide-dialog::backdrop {
  background: rgba(43, 27, 16, 0.38);
  backdrop-filter: blur(3px);
}

.upload-format-guide-dialog article {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}

.upload-format-guide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  padding: 0 26px;
  border-bottom: 1px solid rgba(111, 91, 71, 0.18);
  background: #f7e8d7;
}

.upload-format-guide-header strong {
  color: var(--ink);
  font-size: 19px;
}

.upload-format-guide-close {
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 30px;
  font-weight: 300;
  line-height: 1;
}

.upload-format-guide-content {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 26px 28px;
}

.upload-format-guide-table-wrap {
  overflow-x: auto;
}

.upload-format-guide-table {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.65;
}

.upload-format-guide-table th,
.upload-format-guide-table td {
  padding: 13px 14px;
  vertical-align: top;
  border-right: 1px solid rgba(137, 91, 52, 0.14);
  border-bottom: 1px solid rgba(137, 91, 52, 0.14);
  text-align: left;
}

.upload-format-guide-table th:first-child,
.upload-format-guide-table td:first-child {
  border-left: 1px solid rgba(137, 91, 52, 0.14);
}

.upload-format-guide-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #6d2e16;
  background: #f3d8bd;
  font-weight: 800;
}

.upload-format-guide-table thead th:first-child {
  border-top-left-radius: 12px;
}

.upload-format-guide-table thead th:last-child {
  border-top-right-radius: 12px;
}

.upload-format-guide-table tbody th {
  width: 15%;
  min-width: 110px;
  color: #873714;
  background: #fff4e7;
  font-weight: 800;
}

.upload-format-guide-table tbody td:nth-child(2) {
  width: 44%;
  background: #fffdf9;
}

.upload-format-guide-table tbody td:nth-child(3) {
  width: 41%;
  background: #fffbf5;
}

.upload-format-guide-table tbody tr:last-child th {
  border-bottom-left-radius: 12px;
}

.upload-format-guide-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 12px;
}

.upload-format-guide-table code {
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(129, 62, 22, 0.08);
  color: #743012;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

.dropzone small {
  color: var(--muted);
}

.dropzone .title-style-hint {
  color: var(--warn);
  font-weight: 600;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}

.submit-note {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(163, 92, 18, 0.18);
  border-radius: 16px;
  background: rgba(163, 92, 18, 0.07);
  color: var(--muted);
  line-height: 1.7;
}

#review-gate-note {
  margin-top: 10px;
}

button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

body.ui-busy-locked button,
body.ui-busy-locked input,
body.ui-busy-locked select,
body.ui-busy-locked textarea,
body.ui-busy-locked .download-card,
body.ui-busy-locked .history-links a,
body.ui-busy-locked .journal-suggestion-item {
  opacity: 0.55;
  cursor: not-allowed !important;
  pointer-events: none !important;
  transform: none !important;
  box-shadow: none !important;
}

.submit-note code {
  color: var(--accent-strong);
}

button,
.download-card {
  border: 0;
  border-radius: 18px;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

button:hover,
.download-card:hover {
  transform: translateY(-1px);
}

#submit-btn {
  padding: 14px 20px;
  min-width: 160px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  box-shadow: 0 16px 32px rgba(124, 43, 17, 0.22);
}

.ghost {
  padding: 14px 20px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.review-structure-action-pill {
  min-height: 40px;
  padding: 0 18px;
  white-space: nowrap;
  border-radius: 14px;
  font-weight: 700;
}

.review-structure-action-pill-danger {
  border-color: rgba(238, 100, 125, 0.34);
  background: rgba(255, 243, 246, 0.98);
  color: #e6506e;
  box-shadow: 0 6px 14px rgba(230, 80, 110, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.review-structure-action-pill-danger:hover {
  transform: none;
  background: rgba(255, 236, 241, 1);
  box-shadow: 0 8px 18px rgba(230, 80, 110, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.review-structure-action-pill-neutral {
  border-color: rgba(163, 92, 18, 0.22);
  background: rgba(255, 249, 244, 0.96);
  color: var(--accent-strong) !important;
  box-shadow: 0 6px 14px rgba(124, 43, 17, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.review-structure-action-pill-neutral:hover {
  transform: none;
  background: rgba(255, 244, 235, 1);
  box-shadow: 0 8px 18px rgba(124, 43, 17, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.result-panel {
  overflow: hidden;
}

.status-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  margin-top: 22px;
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.85), rgba(246, 240, 230, 0.88));
  border: 1px solid var(--line);
}

.status-pill {
  min-width: 92px;
  padding: 12px 14px;
  border-radius: 999px;
  text-align: center;
  font-weight: 700;
  text-transform: lowercase;
  background: rgba(111, 91, 71, 0.12);
}

.status-card[data-state="processing"] .status-pill {
  background: rgba(163, 92, 18, 0.12);
  color: var(--warn);
}

.status-card[data-state="success"] .status-pill {
  background: rgba(29, 122, 84, 0.14);
  color: var(--ok);
}

.status-card[data-state="failed"] .status-pill {
  background: rgba(162, 65, 29, 0.14);
  color: var(--accent-strong);
}

.status-meta p {
  margin: 0;
  line-height: 1.7;
}

.task-diagnostic-summary {
  grid-column: 1 / -1;
  padding: 16px 18px;
  border: 1px solid rgba(162, 65, 29, 0.24);
  border-radius: 16px;
  background: rgba(162, 65, 29, 0.07);
}

.task-diagnostic-summary h3,
.task-diagnostic-summary p {
  margin: 0;
}

.task-diagnostic-kicker {
  margin-bottom: 4px !important;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.task-diagnostic-summary h3 {
  font-size: 18px;
}

.task-diagnostic-location,
.task-diagnostic-action,
.history-diagnostic-location,
.history-diagnostic-action {
  margin-top: 8px !important;
  color: var(--muted);
}

.task-diagnostic-action,
.history-diagnostic-action {
  color: var(--ink);
  font-weight: 600;
}

.downloads,
.download-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.error-box {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(162, 65, 29, 0.2);
  background: rgba(162, 65, 29, 0.08);
}

.error-box strong {
  display: block;
  margin-bottom: 8px;
  color: var(--accent-strong);
}

.error-box p {
  margin: 0;
  color: var(--ink);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.diagnostic-box {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(29, 122, 84, 0.2);
  background: rgba(29, 122, 84, 0.08);
}

.diagnostic-box strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ok);
}

.diagnostic-box p {
  margin: 0;
  color: var(--ink);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.diagnostic-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.diagnostic-actions a,
.diagnostic-actions button {
  padding: 10px 14px;
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(29, 122, 84, 0.18);
  background: rgba(255, 255, 255, 0.8);
  color: var(--ok);
  font-weight: 700;
  text-decoration: none;
}

.fix-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.review-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.fix-global-toolbar {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
  display: grid;
  gap: 10px;
}

#fix-global-toolbar {
  display: none !important;
}

.fix-global-toolbar strong {
  font-size: 14px;
}

.fix-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.audit-report-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  padding: 14px;
  display: grid;
  gap: 10px;
}

.audit-report-card h3 {
  margin: 0;
  font-size: 16px;
}

.audit-report-table-wrap {
  overflow: auto;
}

.audit-report-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 760px;
  font-size: 13px;
  table-layout: fixed;
}

.audit-report-table th,
.audit-report-table td {
  border: 1px solid rgba(74, 49, 24, 0.18);
  padding: 7px 8px;
  text-align: left;
  vertical-align: top;
}

.audit-row {
  cursor: pointer;
}

.audit-row:hover {
  background: rgba(246, 240, 230, 0.45);
}

.audit-row.ignored {
  background: rgba(74, 154, 103, 0.08);
}

.audit-report-table th {
  background: rgba(246, 240, 230, 0.7);
}

.audit-report-table .col-rule-id {
  width: 104px;
}

.audit-report-table .col-status {
  width: 78px;
}

.audit-report-table .col-level {
  width: 78px;
}

.audit-report-table .col-paragraph-no {
  width: 72px;
}

.audit-report-table .col-location {
  width: 170px;
}

.audit-report-table .col-op {
  width: 72px;
}

.audit-report-table th:nth-child(4),
.audit-report-table td:nth-child(4) {
  white-space: nowrap;
}

.audit-report-empty {
  margin: 0;
  color: var(--muted);
}

.audit-status {
  display: inline-flex;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
}

.audit-status.passed {
  background: rgba(74, 154, 103, 0.16);
  color: #215739;
}

.audit-status.failed {
  background: rgba(210, 57, 57, 0.16);
  color: #8b2222;
}

.audit-ignore-btn {
  font-size: 12px;
  padding: 4px 8px;
}

.review-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 14px;
}

.review-workspace.review-workspace-dual {
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  align-items: stretch;
  min-height: 0;
}

.review-workspace.single-column {
  grid-template-columns: minmax(0, 1fr);
}

.review-doc-panel,
.review-issues-panel {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  padding: 14px;
  min-height: 420px;
  min-width: 0;
}

.review-doc-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 86vh;
}

.review-pdf-panel {
  min-width: 0;
}

.review-doc-panel h3,
.review-issues-panel h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.review-fixed-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(74, 49, 24, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
}

.editor-fixed-btn {
  min-width: 58px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 14px;
}

.editor-fixed-btn[data-toolbar-tool="fmt_bold"] {
  font-weight: 700;
}

.editor-fixed-btn[data-toolbar-tool="fmt_italic"] {
  font-style: italic;
}

.editor-fixed-btn[data-toolbar-tool="fmt_underline"] {
  text-decoration: underline;
}

.citation-manager {
  position: fixed;
  inset: 0;
  z-index: 12000;
}

.citation-manager-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 19, 25, 0.42);
}

.citation-manager-card {
  position: relative;
  width: min(920px, calc(100vw - 36px));
  max-height: calc(100vh - 48px);
  margin: 24px auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 44px rgba(40, 26, 16, 0.24);
  overflow: auto;
  display: grid;
  gap: 10px;
}

.citation-manager-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.citation-manager-filter {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) 150px 170px 120px;
  gap: 8px;
  align-items: center;
}

.citation-manager-filter-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}

.citation-manager-filter input,
.citation-manager-filter select {
  height: 36px;
  border: 1px solid rgba(74, 49, 24, 0.2);
  border-radius: 10px;
  padding: 0 10px;
  background: #fff;
}

.citation-manager-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
}

.citation-manager-title {
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}

.citation-manager-grid select {
  width: 100%;
  min-height: 240px;
  border: 1px solid rgba(74, 49, 24, 0.2);
  border-radius: 10px;
  padding: 8px;
  background: #fff;
}

.citation-manager-mid {
  display: grid;
  gap: 8px;
  align-content: center;
}

.citation-manager-mid button {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(74, 49, 24, 0.18);
  background: rgba(248, 244, 236, 0.9);
}

.citation-manager textarea[data-role="detail"] {
  width: 100%;
  min-height: 150px;
  border: 1px solid rgba(74, 49, 24, 0.2);
  border-radius: 10px;
  padding: 10px;
  background: #fff;
  resize: vertical;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.45;
}

.citation-manager-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.citation-manager-actions a {
  color: #2563eb;
  text-decoration: none;
}

@media (max-width: 980px) {
  .citation-manager-filter {
    grid-template-columns: 1fr 1fr;
  }
  .citation-manager-filter-label {
    grid-column: 1 / span 2;
  }
}

.review-doc-body,
.review-issues-body {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overflow-x: visible;
  display: grid;
  gap: 14px;
  padding-right: 4px;
  min-width: 0;
}

.review-pdf-viewer {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.review-pdf-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding-right: 0;
  display: flex;
}

.review-pdf-viewer-shell {
  position: relative;
  flex: 1;
  min-height: 0;
}

.review-pdf-frame {
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 1px solid rgba(74, 49, 24, 0.14);
  border-radius: 12px;
  background: #fff;
}

.review-pdf-empty {
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 20px;
  border: 1px dashed rgba(74, 49, 24, 0.22);
  border-radius: 12px;
  background: rgba(246, 240, 230, 0.48);
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}

.review-pdf-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(221, 221, 221, 0.95);
  border-radius: 12px;
  background: #fff;
}

.review-pdf-toolbar-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.review-pdf-toolbar-cluster-right {
  margin-left: auto;
}

.review-pdf-tool-btn {
  min-width: 40px;
  min-height: 40px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 16px;
  line-height: 1;
  font-weight: 700;
  background: #f1f1f1;
  color: #555;
  border: 1px solid transparent;
}

.review-pdf-tool-btn:hover {
  background: #ebebeb;
}

.review-pdf-tool-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.review-pdf-tool-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.review-pdf-tool-divider {
  width: 1px;
  height: 28px;
  background: #ddd;
  margin: 0 6px;
  flex: 0 0 auto;
}

.review-pdf-tool-icon {
  width: 24px;
  height: 24px;
  display: block;
}

.review-pdf-tool-icon path,
.review-pdf-tool-icon circle {
  stroke: #555;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.review-pdf-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 10px;
  border-radius: 6px;
  background: #fff;
  color: #333;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 20;
}

.review-pdf-tool-wrap:hover .review-pdf-tooltip,
.review-pdf-tool-wrap:focus-within .review-pdf-tooltip {
  opacity: 1;
  visibility: visible;
}

.review-pdf-page-input-wrap {
  display: inline-flex;
  align-items: center;
}

.review-pdf-page-input,
.review-pdf-zoom-select,
.review-pdf-search-input {
  height: 38px;
  border: 1px solid rgba(74, 49, 24, 0.16);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.review-pdf-page-input {
  width: 64px;
  padding: 0 8px;
  text-align: center;
  font-size: 16px;
  line-height: 38px;
}

.review-pdf-zoom-select {
  padding: 0 10px;
}

.review-pdf-toolbar-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.review-pdf-toolbar-meta a {
  color: var(--accent);
  text-decoration: none;
}

.review-pdf-toolbar-meta a:hover {
  text-decoration: underline;
}

.review-pdf-page-total {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: #555;
  font-size: 16px;
  line-height: 38px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.review-pdf-page-total-slash {
  margin-right: 2px;
}

.review-pdf-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(74, 49, 24, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
}

.review-pdf-search[hidden] {
  display: none !important;
}

.review-pdf-search-input {
  flex: 1;
  min-width: 0;
  padding: 0 12px;
}

.review-pdf-search-meta {
  color: var(--muted);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.review-pdf-search-close-btn {
  margin-left: auto;
}

.review-pdf-pages {
  position: absolute;
  inset: 0;
  overflow: auto;
  display: block;
  padding: 4px 4px 4px 0;
}

.review-pdf-pages .pdfViewer {
  padding-bottom: 8px;
}

.review-pdf-pages .pdfViewer .page {
  margin: 0 auto 18px;
  border: 1px solid rgba(74, 49, 24, 0.14);
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(74, 49, 24, 0.1);
  overflow: hidden;
}

.review-pdf-pages .pdfViewer .page.review-pdf-page-compare-flash {
  border-color: rgba(29, 122, 84, 0.55);
  box-shadow: 0 0 0 4px rgba(29, 122, 84, 0.18), 0 8px 22px rgba(74, 49, 24, 0.1);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.review-pdf-page {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.review-pdf-page-sheet {
  position: relative;
  display: block;
  background: #fff;
}

.review-pdf-page-canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border: 1px solid rgba(74, 49, 24, 0.14);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(74, 49, 24, 0.1);
}

.review-pdf-page-label {
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
}

.review-pdf-pages .textLayer {
  opacity: 1;
}

.review-pdf-pages .textLayer .highlight {
  margin: 0 !important;
  padding: 0 !important;
  background-color: rgba(255, 221, 87, 0.45) !important;
  border-radius: 2px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.review-pdf-pages .textLayer .highlight.selected {
  background-color: rgba(255, 165, 0, 0.35) !important;
  outline: 2px solid rgba(255, 140, 0, 0.9);
  outline-offset: 1px;
}

.review-pdf-status {
  padding: 14px 16px;
  border: 1px dashed rgba(74, 49, 24, 0.22);
  border-radius: 12px;
  background: rgba(246, 240, 230, 0.48);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.review-doc-stream {
  width: min(100%, 820px);
  max-width: 100%;
  margin: 0 auto;
  background: #fff;
  border: 1px solid rgba(74, 49, 24, 0.2);
  border-radius: 8px;
  padding: 24px 28px;
  box-shadow: 0 8px 22px rgba(74, 49, 24, 0.1);
  display: grid;
  gap: 10px;
  min-width: 0;
  overflow-x: visible;
}

body.review-mode .review-doc-stream {
  width: 100%;
  max-width: none;
}

.review-doc-stream > * {
  min-width: 0;
  max-width: 100%;
}

.review-doc-page {
  width: min(100%, 780px);
  margin: 0 auto;
  background: #fff;
  border: 1px solid rgba(74, 49, 24, 0.2);
  border-radius: 8px;
  padding: 24px 28px;
  min-height: 980px;
  box-shadow: 0 8px 22px rgba(74, 49, 24, 0.1);
  display: grid;
  gap: 10px;
}

.review-page-header {
  text-align: right;
  font-size: 12px;
  color: var(--muted);
}

.review-doc-paragraph {
  padding: 0;
  margin: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  transition: background-color 0.2s ease;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 0;
  min-width: 0;
}

.review-doc-table-block,
.review-doc-image-block {
  border: 1px solid rgba(74, 49, 24, 0.12);
  border-radius: 8px;
  background: rgba(250, 250, 250, 0.98);
  padding: 8px 10px;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.review-doc-paragraph.focused {
  background: rgba(29, 122, 84, 0.12);
  border-radius: 4px;
}

.review-doc-paragraph.review-compare-mapped,
.review-doc-table-block.review-compare-mapped,
.review-doc-image-block.review-compare-mapped {
  cursor: pointer;
}

.review-doc-paragraph.review-compare-active {
  background: rgba(29, 122, 84, 0.1);
  border-radius: 6px;
  box-shadow: inset 3px 0 0 rgba(29, 122, 84, 0.6);
}

.review-doc-image-block.focused,
.review-doc-table-block.focused {
  border-color: rgba(29, 122, 84, 0.45);
  box-shadow: 0 0 0 3px rgba(29, 122, 84, 0.16);
}

.review-doc-image-block.review-compare-active,
.review-doc-table-block.review-compare-active {
  border-color: rgba(29, 122, 84, 0.45);
  box-shadow: 0 0 0 3px rgba(29, 122, 84, 0.16);
}

.review-doc-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
}

.review-table-caption {
  margin: 2px 0 10px;
  font-size: 16px;
  line-height: 1.45;
  text-align: center;
  color: var(--text);
  font-weight: 400;
}

.review-table-caption-label {
  font-weight: 700;
  color: var(--muted);
  margin-right: 8px;
}

.review-table-caption-text {
  font-weight: 400;
}

.review-block-seq {
  display: none;
  min-width: 24px;
  justify-content: flex-end;
  margin-right: 4px;
}

.review-doc-text {
  margin: 0;
  line-height: 1.75;
  text-indent: 2em;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
  min-width: 0;
}

.review-line-no {
  display: none;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 12px;
  padding-top: 2px;
  user-select: none;
}

.review-doc-paragraph-main {
  display: grid;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
}

.review-doc-paragraph.front-block .review-doc-paragraph-main {
  background: rgba(74, 49, 24, 0.06);
  border: 1px solid rgba(74, 49, 24, 0.14);
  border-radius: 10px;
  padding: 8px 10px;
  overflow-x: visible;
}

.review-doc-paragraph.equation-block .review-doc-paragraph-main {
  background: rgba(62, 121, 192, 0.08);
  border: 1px solid rgba(62, 121, 192, 0.25);
  border-radius: 10px;
  padding: 8px 10px;
}

.review-doc-paragraph.equation-block .review-doc-text {
  text-indent: 0;
}

.review-equation-render {
  text-indent: 0;
  overflow: visible;
  height: auto;
  max-height: none;
  padding: 2px 0;
  cursor: text;
}

.review-equation-render:focus {
  outline: 2px solid rgba(62, 121, 192, 0.45);
  outline-offset: 2px;
  border-radius: 10px;
}

.review-equation-scroll-x {
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
  max-width: 100%;
}

.review-equation-render-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 10px;
  width: 100%;
  min-width: 0;
}

.review-equation-number {
  font-size: 1rem;
  line-height: 1.2;
  color: var(--text);
  white-space: nowrap;
  justify-self: end;
}

.review-equation-scroll-x .katex-display {
  margin: 0.2em 0 0.1em;
}

.review-equation-fallback {
  display: block;
  font-family: "Consolas", "Monaco", "Courier New", monospace;
  font-size: 0.95em;
  line-height: 1.5;
  white-space: pre-wrap;
}

.inline-math {
  display: inline;
  vertical-align: middle;
  width: auto;
  max-width: 100%;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  cursor: text;
}

.inline-math.inline-math-display {
  display: inline;
}

.inline-math .katex-display {
  display: inline !important;
  text-align: center !important;
  margin: 0 !important;
}

.inline-math .katex {
  display: inline-block !important;
  text-align: center !important;
  font-size: 1em;
  margin: 0 !important;
  padding: 0.12em 0.18em !important;
  border-radius: 6px;
  background: rgba(62, 121, 192, 0.12);
  border: 1px solid rgba(62, 121, 192, 0.26);
  width: fit-content;
  max-width: none;
  overflow: visible;
  white-space: normal;
  box-sizing: border-box;
  vertical-align: middle;
}


.inline-math *,
.inline-math .katex-html {
  text-align: center !important;
}

.review-front-label.equation-label {
  color: #1f5d9b;
  background: rgba(62, 121, 192, 0.12);
  border-color: rgba(62, 121, 192, 0.3);
}

.review-doc-paragraph.front-block .review-doc-text {
  text-indent: 0;
}

.review-doc-paragraph.front-block .review-doc-text-editable {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
  min-width: 0;
}

.review-doc-paragraph.front-block .review-doc-text sup {
  font-size: 0.72em;
  vertical-align: super;
  line-height: 0;
}

.review-front-bundle-editable div {
  margin: 0 0 2px;
}

.review-doc-paragraph.front-block.front-title .review-doc-paragraph-main {
  background: transparent;
  border: none;
  padding: 0;
}

.review-doc-paragraph.front-block.front-title .review-doc-text {
  text-align: center;
  font-size: clamp(30px, 4.2vw, 44px);
  font-weight: 800;
  line-height: 1.22;
  text-indent: 0;
}

.review-front-label {
  display: inline-flex;
  width: fit-content;
  font-size: 12px;
  font-weight: 700;
  color: #5f4629;
  background: rgba(74, 49, 24, 0.1);
  border: 1px solid rgba(74, 49, 24, 0.2);
  border-radius: 999px;
  padding: 2px 9px;
}

.review-reference-tag-wrap {
  margin: 10px 0 2px 44px;
}

.review-reference-heading .review-doc-text {
  text-indent: 0;
}

.review-doc-paragraph[data-semantic-type="biography_heading"] .review-doc-text,
.review-doc-paragraph[data-semantic-type="biography_heading"] .review-doc-text-editable {
  text-indent: 0;
  font-weight: 700;
}

.review-doc-paragraph[data-semantic-type="biography"] .review-doc-text,
.review-doc-paragraph[data-semantic-type="biography"] .review-doc-text-editable {
  text-indent: 0;
}

.review-bio-entry {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 14px;
  align-items: start;
}

.review-bio-photo-frame {
  width: var(--bio-photo-w, 108px);
  height: var(--bio-photo-h, 144px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(120, 88, 36, 0.18);
  border-radius: 6px;
  background: #fff;
}

.review-bio-photo {
  width: 100%;
  height: 100%;
  object-fit: var(--bio-photo-fit, contain);
  object-position: var(--bio-photo-position, center top);
}

.review-bio-text {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 720px) {
  .review-bio-entry {
    grid-template-columns: 1fr;
    row-gap: 12px;
  }
}

.review-doc-paragraph[data-semantic-type="reference"] .review-doc-text,
.review-doc-paragraph[data-semantic-type="reference"] .review-doc-text-editable {
  text-indent: -2em;
  padding-left: 2em;
}

/* Statement blocks (e.g., Funding) should not use first-line indent. */
.review-doc-paragraph[data-semantic-type="statement"] .review-doc-text,
.review-doc-paragraph[data-semantic-type="statement"] .review-doc-text-editable {
  text-indent: 0;
}

.review-doc-paragraph[data-semantic-type="statement"] .review-statement-title {
  display: inline;
  font-weight: 700;
}

.review-doc-paragraph[data-semantic-type="statement"] .review-statement-body {
  display: block;
  text-indent: 2em;
}

/* Body prose keeps first-line indent. */
.review-doc-paragraph[data-semantic-type="body"] .review-doc-text,
.review-doc-paragraph[data-semantic-type="body"] .review-doc-text-editable {
  text-indent: 2em;
}

.review-doc-paragraph[data-semantic-type="body_list"] .review-doc-text,
.review-doc-paragraph[data-semantic-type="body_list"] .review-doc-text-editable {
  text-indent: 0;
}

.review-doc-list-editable {
  min-height: 0;
}

.review-bullet-list {
  margin: 0;
  padding-left: 1.6em;
  list-style-type: disc;
}

.review-bullet-list li {
  margin: 0.18em 0;
}

.review-heading-line {
  display: flex;
  align-items: baseline;
  gap: 0.38em;
  min-width: 0;
  max-width: 100%;
}

.review-heading-number {
  font: inherit;
  color: inherit;
  line-height: inherit;
  font-weight: inherit;
  white-space: nowrap;
}

.review-heading-line .review-doc-text {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.review-doc-paragraph.heading-1 .review-doc-text {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.25;
  text-indent: 0;
}

.review-doc-paragraph.heading-2 .review-doc-text {
  font-size: 25px;
  font-weight: 650;
  line-height: 1.3;
  text-indent: 0;
}

.review-doc-paragraph.heading-3 .review-doc-text {
  font-size: 20px;
  font-weight: 620;
  line-height: 1.35;
  text-indent: 0;
}

.review-doc-paragraph.heading-1 .review-heading-number {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.25;
}

.review-doc-paragraph.heading-2 .review-heading-number {
  font-size: 25px;
  font-weight: 650;
  line-height: 1.3;
}

.review-doc-paragraph.heading-3 .review-heading-number {
  font-size: 20px;
  font-weight: 620;
  line-height: 1.35;
}

.review-doc-text-editable {
  outline: none;
  min-height: 1.8em;
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.review-doc-text-editable:focus {
  box-shadow: 0 0 0 2px rgba(29, 122, 84, 0.24);
  border-radius: 4px;
}

.review-equation-label {
  margin: 0 0 6px;
  color: #1f5d9b;
  font-size: 12px;
}

.semantic-env-rendered {
  display: block;
}

.semantic-env-head {
  font-weight: 800 !important;
  margin-bottom: 4px;
  font-size: 1.04em;
  letter-spacing: 0.01em;
}

.semantic-env-body {
  display: block;
}

.review-figure-caption {
  margin: 8px 2px 0;
  font-size: 16px;
  line-height: 1.45;
  text-align: center;
  color: var(--text);
}

.figure-caption-label {
  font-size: inherit;
  font-weight: 700;
  color: var(--muted);
  margin-right: 8px;
}

.figure-caption-text {
  font-size: inherit;
  color: var(--text);
}

.review-citation-token {
  background: transparent !important;
  border-radius: 0;
  padding: 0;
  font-weight: 600;
  color: inherit;
}

.review-citation-token.citation-ref {
  color: inherit;
}

.review-citation-token.citation-fig {
  color: inherit;
}

.review-citation-token.citation-table {
  color: inherit;
}

.review-citation-token.citation-eq {
  color: inherit;
}

.review-doc-text .ref {
  color: inherit;
  font-weight: inherit;
}

.review-doc-text .ref[data-ref-bound="1"] {
  color: #2563eb;
  font-weight: 700;
  cursor: text;
}

.review-doc-text .ref[data-ref-bound="0"],
.review-table .ref[data-ref-bound="0"] {
  color: inherit;
  font-weight: inherit;
}

.review-ref-tooltip {
  position: fixed;
  z-index: 2600;
  max-width: min(520px, 80vw);
  background: rgba(22, 28, 38, 0.97);
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.45);
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  pointer-events: none;
}

.review-doc-scope-inline {
  margin: 4px 0 0;
}

.review-table-wrap {
  overflow: auto;
}

.review-doc-algorithm-block {
  padding-bottom: 8px;
}

.review-algorithm-caption {
  justify-content: flex-start;
  border-top: 2px solid rgba(74, 49, 24, 0.55);
  padding-top: 10px;
}

.review-algorithm-body {
  margin-top: 8px;
  padding: 12px 14px;
  border-top: 2px solid rgba(74, 49, 24, 0.55);
  border-bottom: 2px solid rgba(74, 49, 24, 0.55);
  background: rgba(255, 252, 247, 0.56);
}

.review-algorithm-line {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 13px;
  line-height: 1.65;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
}

.review-algorithm-line + .review-algorithm-line {
  margin-top: 4px;
}

.review-algorithm-line-no {
  flex: 0 0 2.6em;
  min-width: 2.6em;
  text-align: right;
}

.review-algorithm-line-content {
  flex: 1 1 auto;
  min-width: 0;
  padding-left: calc(var(--algorithm-indent, 0) * 1.6em);
}

.review-algorithm-line-plain .review-algorithm-line-content {
  padding-left: calc(var(--algorithm-indent, 0) * 1.6em);
}

.review-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}

.review-table td,
.review-table th {
  border: 1px solid rgba(74, 49, 24, 0.2);
  padding: 6px 8px;
  vertical-align: middle;
  text-align: center;
  white-space: pre-wrap;
}

.review-table th {
  font-weight: 600;
  background: rgba(255, 248, 236, 0.5);
}

.review-table .review-table-cell-merged {
  text-align: center;
  vertical-align: middle;
}

.review-table .review-table-cell-merged .review-table-cell-editable {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
}

.review-doc-table-block.review-table-mode-booktabs .review-table td,
.review-doc-table-block.review-table-mode-booktabs .review-table th {
  border-left: 0;
  border-right: 0;
  border-top: 0;
  border-bottom: 0;
}

.review-doc-table-block.review-table-mode-booktabs .review-table .review-table-cell-toprule {
  border-top: 2px solid rgba(74, 49, 24, 0.55);
}

.review-doc-table-block.review-table-mode-booktabs .review-table .review-table-cell-bottomrule {
  border-bottom: 2px solid rgba(74, 49, 24, 0.55);
}

.review-table .ref {
  color: inherit;
  font-weight: inherit;
}

.review-table .ref[data-ref-bound="1"] {
  color: #2563eb;
  font-weight: 700;
  cursor: text;
}

.review-table-cell-editable {
  min-height: 1.4em;
  outline: none;
  text-align: center;
  line-height: 1.5;
}

.review-table-inline-math {
  display: inline-block;
  vertical-align: middle;
}

.review-table-inline-math .katex-display {
  margin: 0;
}

.review-table-inline-math .katex {
  line-height: 1.2;
}

.review-table-cell-image-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.review-table-cell-image {
  display: block;
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
}

.review-table-cell-image-missing {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 8px 10px;
  border: 1px dashed rgba(74, 49, 24, 0.24);
  border-radius: 8px;
  background: rgba(246, 240, 230, 0.55);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.review-table-cell-editable:focus {
  box-shadow: 0 0 0 2px rgba(29, 122, 84, 0.22);
  border-radius: 3px;
}

.review-image-box {
  min-height: 90px;
  border: 1px dashed rgba(74, 49, 24, 0.26);
  border-radius: 8px;
  background: rgba(246, 240, 230, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
}

.review-image-layout-tip {
  margin: 2px 0 8px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px dashed rgba(74, 49, 24, 0.22);
  background: rgba(246, 240, 230, 0.5);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.review-image-grid {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: hidden;
  gap: 10px;
  align-items: start;
  justify-content: center;
  padding-bottom: 4px;
  max-width: 100%;
  min-width: 0;
}

.review-image-grid.single-row .review-image-figure {
  flex: 0 0 clamp(120px, calc(var(--image-width-ratio, 0.48) * 100%), 100%);
}

.review-image-grid.single-row.limit-two {
  justify-content: flex-start;
  overflow-x: auto;
  padding-bottom: 8px;
}

.review-image-grid.single-row.limit-two .review-image-figure {
  /* 不强制改宽度，沿用每张图自己的比例（默认48%），可通过缩放决定是否露出后续图 */
  flex: 0 0 clamp(120px, calc(var(--image-width-ratio, 0.48) * 100%), 100%);
  max-width: clamp(120px, calc(var(--image-width-ratio, 0.48) * 100%), 100%);
}

.review-image-grid.wrapped-fill {
  display: block;
  overflow-x: visible;
}

.review-image-grid.wrapped-fill .review-image-row {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.review-image-grid.wrapped-fill .review-image-row:last-child {
  margin-bottom: 0;
}

.review-image-grid.wrapped-fill .review-image-figure {
  flex: 0 0 clamp(120px, calc(var(--image-width-ratio, 0.48) * 100%), 100%);
}

@media (max-width: 680px) {
  .review-image-grid.single-row .review-image-figure {
    flex-basis: clamp(120px, calc(var(--image-width-ratio, 0.7) * 100%), 100%);
  }
}

.review-image-figure {
  --image-width-ratio: 0.48;
  margin: 0;
  border: 1px solid rgba(74, 49, 24, 0.16);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  max-width: 100%;
  min-width: 0;
}

.review-image-figure img {
  width: 100%;
  height: auto;
  display: block;
}

.review-image-subcaption {
  margin: 0;
  padding: 6px 10px;
  font-size: 14px;
  line-height: 1.35;
  color: #4b3e2b;
  border-top: 1px dashed rgba(74, 49, 24, 0.16);
  background: rgba(248, 244, 236, 0.58);
}

.review-image-figure.is-removed {
  opacity: 0.36;
}

.review-image-figure.is-added {
  border-color: rgba(74, 154, 103, 0.45);
}

.review-image-ops {
  display: flex;
  gap: 6px;
  padding: 6px;
  border-top: 1px solid rgba(74, 49, 24, 0.12);
  background: rgba(248, 244, 236, 0.65);
  flex-wrap: wrap;
}

body.review-mode .review-fixed-toolbar {
  display: none !important;
}

.review-image-scale {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 8px;
  padding: 6px 8px;
  border-top: 1px solid rgba(74, 49, 24, 0.12);
  background: rgba(248, 244, 236, 0.45);
  min-width: 0;
  max-width: 100%;
}

.review-image-scale-label {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.review-image-scale-input {
  width: 100%;
  min-width: 0;
}

.review-image-scale-controls {
  display: grid;
  grid-template-columns: minmax(40px, auto) minmax(0, 1fr) minmax(40px, auto) minmax(52px, 64px) auto;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

.review-image-scale-step {
  min-width: 40px !important;
  padding: 4px 8px !important;
}

.review-image-scale-number {
  width: 100%;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 6px;
  text-align: right;
  background: #fff;
}

.review-image-scale-unit {
  font-size: 12px;
  color: var(--muted);
}

.review-image-replace-label,
.review-image-add-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.review-image-op-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px !important;
  line-height: 1.1;
  padding: 5px 12px !important;
  border-radius: 999px !important;
  min-height: 30px;
  min-width: 58px;
}

.review-image-add-wrap {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

.review-image-added-tip {
  font-size: 12px;
  color: #215739;
}

.review-scope-tag {
  display: inline-flex;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(74, 49, 24, 0.22);
  font-size: 11px;
  color: var(--muted);
}

.review-scope-divider {
  margin: 10px 0 4px;
  padding: 8px 10px;
  border: 1px dashed rgba(74, 49, 24, 0.3);
  border-radius: 8px;
  background: rgba(246, 240, 230, 0.55);
  color: var(--muted);
  font-size: 13px;
}

.out-of-scope {
  opacity: 0.72;
}

.review-issue-group {
  border: 1px solid rgba(74, 49, 24, 0.14);
  border-radius: 14px;
  background: rgba(248, 244, 236, 0.65);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.review-issue-group h4 {
  margin: 0;
  font-size: 14px;
}

.fix-item {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
}

.fix-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.fix-toggle input {
  width: 18px;
  height: 18px;
}

.fix-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fix-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(246, 240, 230, 0.9);
  color: var(--muted);
  font-size: 13px;
}

.fix-original {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(162, 65, 29, 0.06);
  border: 1px solid rgba(162, 65, 29, 0.12);
  word-break: break-word;
}

.fix-rationale {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.fix-paragraph-preview {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(29, 122, 84, 0.18);
  background: rgba(29, 122, 84, 0.06);
}

.fix-paragraph-preview strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ok);
}

.fix-paragraph-text {
  margin: 0;
  line-height: 1.7;
  word-break: break-word;
}

.fix-paragraph-text mark {
  background: rgba(255, 211, 106, 0.5);
  border-radius: 4px;
  padding: 0 2px;
}

.fix-symbol-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fix-symbol-tools .fix-tool-btn {
  padding: 8px 10px;
  min-height: 34px;
  border-radius: 10px;
}

.fix-item-actions {
  display: flex;
  gap: 8px;
}

@media (max-width: 980px) {
  body.review-mode {
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body.review-mode .shell {
    height: auto;
    min-height: 0;
    display: block;
  }

  body.review-mode main {
    overflow: visible;
  }

  body.review-mode #fix-review-panel {
    height: auto;
    overflow: visible;
  }

  body.review-mode #fix-list {
    overflow: visible;
  }

  body.review-mode #fix-review-panel .panel-head {
    position: static;
    padding-bottom: 0;
  }

  .review-workspace {
    grid-template-columns: 1fr;
  }

  .review-workspace.review-workspace-dual {
    grid-template-columns: 1fr;
    height: auto;
  }

  .review-workspace.review-workspace-dual .review-pdf-panel {
    display: none;
  }

  .review-doc-body,
  .review-issues-body,
  .review-pdf-body {
    max-height: none;
  }

  .review-pdf-frame,
  .review-pdf-empty {
    min-height: 56vh;
  }
}

.download-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 92px;
  padding: 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
}

.download-card.disabled {
  opacity: 0.42;
  pointer-events: none;
}

.tips {
  margin-top: 20px;
  color: var(--muted);
}

.tips summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--ink);
}

.history-list {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.history-summary {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.history-search-form,
.history-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.history-search-form {
  margin-top: 20px;
}

.history-search-form label {
  font-weight: 700;
}

.history-search-form input {
  min-width: min(320px, 100%);
  flex: 1 1 320px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font: inherit;
}

.history-search-form button,
.history-pagination button {
  min-height: 42px;
  padding: 0 16px;
}

.history-pagination {
  justify-content: center;
  margin-top: 22px;
}

.history-pagination span {
  min-width: 96px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.history-item,
.history-empty {
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
}

.history-item {
  display: grid;
  gap: 10px;
}

.history-top {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.history-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 12px;
}

.history-link-cell {
  min-width: 0;
}

.history-link-pdf {
  text-align: center;
}

.history-link-log {
  text-align: right;
}

.history-title {
  font-weight: 700;
  word-break: break-word;
}

.history-subtitle {
  color: var(--muted);
  font-size: 14px;
  word-break: break-word;
}

.history-state {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  background: rgba(111, 91, 71, 0.12);
}

.history-statuses {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.history-download-state {
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--accent);
  background: rgba(180, 69, 27, 0.1);
  font-size: 12px;
  font-weight: 700;
}

.history-state.success {
  color: var(--ok);
  background: rgba(29, 122, 84, 0.14);
}

.history-state.failed {
  color: var(--accent-strong);
  background: rgba(162, 65, 29, 0.14);
}

.history-state.processing {
  color: var(--warn);
  background: rgba(163, 92, 18, 0.14);
}

.history-links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.history-page-count {
  display: inline-block;
  min-width: 4.5ch;
  margin-left: 3px;
  font-variant-numeric: tabular-nums;
  text-align: left;
}

.history-links a.disabled {
  opacity: 0.35;
  pointer-events: none;
}

@media (max-width: 640px) {
  .history-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .history-link-log {
    grid-column: 1 / -1;
    text-align: left;
  }
}

.history-diagnostic {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(162, 65, 29, 0.2);
  background: rgba(162, 65, 29, 0.06);
}

.history-diagnostic summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  color: var(--accent-strong);
  font-weight: 800;
  list-style: none;
}

.history-diagnostic summary::-webkit-details-marker {
  display: none;
}

.history-diagnostic summary::after {
  content: "›";
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
  transition: transform 160ms ease;
}

.history-diagnostic[open] summary::after {
  transform: rotate(90deg);
}

.history-diagnostic p {
  margin: 8px 0 0;
  line-height: 1.6;
}

@media (max-width: 780px) {
  .user-auth-gate {
    display: block;
    overflow-y: auto;
    padding: 0;
  }

  .auth-landing {
    grid-template-columns: 1fr;
    min-height: 100dvh;
  }

  .user-auth-showcase {
    min-height: 250px;
    padding: 28px;
  }

  .auth-showcase-copy {
    margin: 24px 0 0;
  }

  .auth-showcase-copy h2 {
    font-size: clamp(34px, 10vw, 48px);
  }

  .auth-showcase-copy > p:last-child {
    display: none;
  }

  .auth-showcase-steps {
    margin-top: 22px;
  }

  .user-auth-card {
    width: min(500px, calc(100% - 32px));
    max-width: 500px;
    margin: 0 auto 28px;
    padding: 34px 28px 38px;
  }

  .shell {
    width: min(100% - 20px, 1100px);
    padding-top: 20px;
  }

  .user-workspace-shell {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 10px 0 28px;
  }

  .user-workspace-content {
    width: auto;
    max-width: none;
    margin: 0;
    padding: 20px 10px 28px;
  }

  .user-sidebar {
    position: static;
    min-height: 0;
    border-radius: 0;
  }

  .user-sidebar-brand { padding-bottom: 12px; }
  .user-sidebar-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 14px; }
  .user-sidebar-link { min-height: 48px; padding: 9px; font-size: 13px; }
  .user-sidebar-footer { display: flex; align-items: center; gap: 12px; padding-top: 13px; }
  .user-sidebar-footer p { margin: 0; }
  .user-sidebar-logout { width: auto; white-space: nowrap; }

  .panel {
    padding: 18px;
    border-radius: 22px;
  }

  .user-ledger-panel {
    padding: 18px;
    border-radius: 22px;
  }

  .user-topup-panel, .user-redeem-panel { padding: 18px; border-radius: 22px; }
  .user-redeem-actions { flex-direction: column; }

  body.review-mode .user-workspace-shell {
    width: 100%;
    height: auto;
    min-height: 0;
    grid-template-columns: 1fr;
    padding: 0;
  }

  body.review-mode .user-sidebar { display: none; }

  body.review-mode .user-workspace-content { overflow: visible; }

  .review-structure-row-grid-title-note {
    grid-template-columns: 1fr;
  }

  .review-structure-row-grid-front {
    grid-template-columns: 1fr;
  }

  .review-structure-row-grid-author,
  .review-structure-row-grid-author-top,
  .review-structure-row-grid-author-detail {
    grid-template-columns: 1fr;
  }

  .review-structure-section-head-with-action,
  .review-structure-author-summary {
    grid-template-columns: 1fr;
  }

  .review-structure-section-head-with-action {
    display: grid;
  }

  .review-structure-author-summary-actions {
    justify-content: flex-start;
  }

  .review-structure-title-note-label {
    margin-top: 0;
  }

  .form-grid,
  .downloads,
  .download-grid {
    grid-template-columns: 1fr;
  }

  .journal-lookup-grid {
    grid-template-columns: 1fr;
  }

  .status-card {
    grid-template-columns: 1fr;
  }
}
