:root {
  --maroon: #0b4aa2; /* primary (blue) */
  --maroon-2: #083a80; /* primary dark */
  --paper: #eef5ff;
  --panel: #ffffff;
  --border: #cfd8e3;
  --text: #222;
  --muted: #6b6b6b;
  --shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  --radius: 14px;
  --radius-sm: 10px;
  --focus: 0 0 0 3px rgba(11, 74, 162, 0.22);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family:
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Helvetica,
    Arial,
    "Noto Sans",
    "Apple Color Emoji",
    "Segoe UI Emoji";
  color: var(--text);
  background: linear-gradient(180deg, #f6f9ff, #e8f0ff);
}
body.auth-locked {
  overflow: hidden;
}
body.auth-locked .topbar,
body.auth-locked .wrap,
body.auth-locked #draftConfirmBackdrop {
  visibility: hidden;
}
a {
  color: inherit;
}
.auth-overlay[hidden] {
  display: none;
}
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    linear-gradient(rgba(2, 6, 23, 0.62), rgba(2, 6, 23, 0.68)),
    radial-gradient(circle at top, rgba(59, 130, 246, 0.22), transparent 40%);
  backdrop-filter: blur(10px);
}
.auth-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(100%, 460px);
  max-width: calc(100vw - 32px);
  margin: 0;
  padding: 0;
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 255, 0.98));
  box-shadow:
    0 30px 80px rgba(2, 6, 23, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}
.auth-dialog::backdrop {
  background: transparent;
}
.auth-dialog-inner {
  padding: 28px;
}
.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(11, 74, 162, 0.08);
  color: var(--maroon);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2px;
}
.auth-title {
  margin: 16px 0 8px;
  font-size: 30px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.3px;
}
.auth-copy {
  margin: 0 0 18px;
  color: #475569;
  line-height: 1.6;
  font-size: 15px;
}
.auth-field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}
.auth-field label {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}
.auth-field input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  font: inherit;
  outline: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}
.auth-field input:focus {
  border-color: var(--maroon);
  box-shadow: var(--focus);
  transform: translateY(-1px);
}
.auth-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.auth-actions .btn,
.auth-actions a.btn {
  min-width: 140px;
  justify-content: center;
}
.auth-status {
  min-height: 20px;
  margin-top: 12px;
  font-size: 14px;
  font-weight: 700;
  color: #b42318;
}
.auth-note {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(203, 213, 225, 0.8);
  color: #64748b;
  font-size: 12px;
  line-height: 1.6;
}
.topbar {
  background: linear-gradient(180deg, var(--maroon), var(--maroon-2));
  color: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
}
.seal {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.16);
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-weight: 700;
}
.brand-title {
  line-height: 1.1;
}
.brand-title b {
  display: block;
  font-size: 14px;
}
.brand-title span {
  display: block;
  font-size: 12px;
  opacity: 0.9;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  opacity: 0.95;
}
.nav a {
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
}
.nav a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.28);
}

.wrap {
  max-width: 1100px;
  margin: 18px auto 50px;
  padding: 0 16px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-head {
  background: var(--maroon);
  color: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.card-head h1 {
  font-size: 15px;
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.pill {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  white-space: nowrap;
}
.card-body {
  padding: 16px;
  background: var(--paper);
}
.draft-bar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid #cfe2ff;
  border-radius: 14px;
  background: linear-gradient(180deg, #f7fbff, #e8f1ff);
}
.draft-current {
  min-width: 240px;
}
.draft-current-label {
  font-size: 12px;
  font-weight: 700;
  color: #3e5d87;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.draft-current-value {
  margin-top: 4px;
  font-size: 18px;
  font-weight: 800;
  color: #123a78;
}
.draft-current-meta {
  margin-top: 4px;
  font-size: 12px;
  color: #56739f;
}
.draft-current-meta.dirty {
  color: #b65700;
  font-weight: 700;
}
.draft-tools {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}
.draft-tools .field {
  min-width: 260px;
  margin: 0;
}
.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.grid {
  display: grid;
  gap: 12px;
}
.grid.cols-2 {
  grid-template-columns: 1fr 1fr;
}
.grid.cols-3 {
  grid-template-columns: 1fr 1fr 1fr;
}
@media (max-width: 860px) {
  .grid.cols-2,
  .grid.cols-3 {
    grid-template-columns: 1fr;
  }
  .brand {
    min-width: auto;
  }
}

.field label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 6px;
}
.field input,
.field select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 14px;
  outline: none;
}
.field input:focus,
.field select:focus {
  box-shadow: var(--focus);
  border-color: var(--maroon);
}
.hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.year-field select {
  width: 280px;
  max-width: 100%;
}

.main-return {
  margin-top: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  overflow: hidden;
}
.mr-titlebar {
  background: #0c4da9;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  padding: 10px 12px;
}
.mr-kv {
  padding: 10px 12px 0;
  display: grid;
  gap: 8px;
}
.mr-kv-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: center;
}
.mr-kv-key {
  text-align: right;
  font-size: 12px;
  font-weight: 700;
  color: #333;
}
.mr-kv-val {
  font-size: 12px;
  font-weight: 700;
  color: #333;
}
.mr-instructions {
  padding: 10px 12px 0;
  font-size: 12px;
  color: #444;
  line-height: 1.4;
}
.mr-choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 10px 12px 0;
}
@media (max-width: 860px) {
  .mr-choice-grid {
    grid-template-columns: 1fr;
  }
  .mr-kv-row {
    grid-template-columns: 1fr;
  }
  .mr-kv-key {
    text-align: left;
  }
}
.mr-choice-label {
  font-size: 12px;
  font-weight: 800;
  color: #333;
  margin-bottom: 6px;
}
.mr-radio {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-right: 12px;
  font-size: 12px;
}
.mr-info {
  margin: 12px 12px 12px;
  padding: 10px 10px;
  border-radius: 10px;
  border: 1px solid #cfe2ff;
  background: #e9f2ff;
  color: #1b4d8a;
  font-size: 12px;
  line-height: 1.35;
}
.mr-section {
  border-top: 1px solid var(--border);
}
.mr-section-title {
  background: #0c4da9;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.mr-toggles {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  font-weight: 700;
  font-size: 12px;
}
.mr-toggle {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #d8e7ff;
  background: #fff;
  color: #0d4d9f;
}
.mr-toggle input {
  width: 16px;
  height: 16px;
  accent-color: #1270e3;
}
.mr-toggle.active {
  background: #0f66da;
  color: #fff;
  border-color: #0f66da;
}
.mr-subtitle {
  padding: 10px 12px 0;
  font-weight: 800;
  font-size: 12px;
  color: #333;
}
.mr-table {
  padding: 10px 12px 14px;
}
.mr-row {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) auto 44px 180px;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #eef2f7;
}
.mr-row:last-child {
  border-bottom: none;
}
.mr-row.total {
  font-weight: 800;
}
.mr-row.linkrow {
  grid-template-columns: minmax(320px, 1fr) auto 44px 180px;
}
.mr-label {
  justify-self: end;
  text-align: right;
  font-size: 13px;
  font-weight: 600;
  color: #333;
}
.mr-link {
  appearance: none;
  border: none;
  background: transparent;
  color: #1b63c9;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}
.mr-code {
  text-align: center;
  font-size: 12px;
  padding: 6px 6px;
  border-radius: 6px;
  background: #f2f2f2;
  border: 1px solid #d4d4d4;
  font-weight: 800;
  color: #333;
}
.mr-input {
  width: 100%;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid #c9c9c9;
  background: #fff;
  font-size: 12px;
  outline: none;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.mr-input:focus {
  box-shadow: var(--focus);
  border-color: var(--maroon);
}
.mr-input[readonly] {
  background: #e8e8e8;
}
.mr-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #1b63c9;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}
.table th,
.table td {
  padding: 10px 10px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.table th {
  background: #edf4ff;
  font-weight: 700;
  color: #333;
}
.table tr:last-child td {
  border-bottom: none;
}
.row-select {
  width: 34px;
  text-align: center;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fbfaf6;
}
.status .dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #999;
}
.status.new .dot {
  background: #d88a00;
}
.status.submitted .dot {
  background: #1e8e3e;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.btn {
  border: 1px solid var(--border);
  background: #fff;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}
.btn.primary {
  background: linear-gradient(180deg, #1463d6, var(--maroon));
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.note {
  margin-top: 12px;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid #cfe2ff;
  background: #e9f2ff;
  font-size: 13px;
  color: #1b4d8a;
}
.review-layout {
  position: relative;
  display: block;
  margin-top: 14px;
}
.review-sidebar {
  position: fixed;
  left: 16px;
  top: 110px;
  width: 210px;
  z-index: 15;
  max-height: calc(100vh - 130px);
  overflow: auto;
}
.review-sidebar-card {
  background: #eaf3ff;
  border: 1px solid #c7dbfb;
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 10px 24px rgba(11, 74, 162, 0.12);
}
.review-sidebar-title {
  font-size: 13px;
  font-weight: 800;
  color: #1d4d93;
  margin-bottom: 10px;
}
.review-nav {
  display: grid;
  gap: 8px;
}
.review-nav-btn {
  width: 100%;
  text-align: left;
  border: 1px solid #d7e5fa;
  background: #fff;
  color: #244a78;
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.review-nav-btn:hover {
  background: #eef5ff;
  border-color: #b5cdef;
}
.review-nav-btn.active,
.review-nav-btn[aria-current="true"] {
  background: linear-gradient(180deg, #2a73dd, #0b4aa2);
  color: #fff;
  border-color: #0b4aa2;
}
.review-content {
  display: grid;
  gap: 16px;
  min-width: 0;
  width: 100%;
}
.review-section {
  border-top: 1px solid #d9e6fb;
  padding-top: 4px;
  scroll-margin-top: 92px;
}
.review-section-title {
  margin: 12px 0 10px;
  font-size: 14px;
  font-weight: 800;
  color: #1d4d93;
}
.review-readonly input:disabled,
.review-readonly select:disabled,
.review-readonly textarea:disabled,
.review-readonly button:disabled {
  opacity: 1;
  color: #223;
  -webkit-text-fill-color: #223;
}
.review-readonly input:disabled,
.review-readonly select:disabled,
.review-readonly textarea:disabled {
  background: #f7fbff;
  border-color: #d4e1f4;
  cursor: default;
}
.review-readonly button:disabled {
  cursor: default;
}
.review-readonly .schedule-btn-row {
  display: none;
}
.review-scroll-top {
  position: fixed;
  right: 28px;
  bottom: 24px;
  z-index: 30;
  box-shadow: 0 10px 24px rgba(11, 74, 162, 0.22);
}
.section-title {
  margin: 14px 0 10px;
  font-weight: 800;
  color: #2a2a2a;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.section-badge {
  font-weight: 700;
  color: #114a87;
  font-size: 12px;
  background: #e8f2ff;
  border: 1px solid #cfe2ff;
  padding: 5px 10px;
  border-radius: 999px;
}

.schedule-menu {
  margin: 8px 0 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fbff;
}
.sched-tab {
  border: 1px solid var(--border);
  background: #fff;
  color: #2f4f74;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.sched-tab:hover {
  border-color: #a9c5ea;
  color: #104b8b;
  background: #eef5ff;
}
.sched-tab.active,
.sched-tab[aria-pressed="true"] {
  border-color: #8db2ea;
  color: #fff;
  background: linear-gradient(180deg, #2a73dd, #0b4aa2);
}

.schedule-sheet {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.schedule-sheet-head {
  background: #0c4da9;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  padding: 12px 14px;
}
.schedule-meta {
  max-width: 520px;
  margin: 18px auto;
  display: grid;
  gap: 10px;
}
.schedule-meta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.schedule-meta-key {
  text-align: right;
  font-size: 12px;
  font-weight: 800;
  color: #333;
}
.schedule-meta-val {
  font-size: 12px;
  font-weight: 700;
  color: #333;
}
.schedule-part-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: #0c4da9;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  padding: 10px 14px;
  margin-top: 14px;
}
.schedule-subtitle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 0;
  font-size: 13px;
  font-weight: 800;
  color: #333;
}
.schedule-info-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #1b63c9;
  color: #fff;
  font-size: 12px;
}
.schedule-inline-options {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  font-size: 12px;
}
.schedule-inline-options label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.schedule-toggle {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #d8e7ff;
  background: #fff;
  color: #0d4d9f;
  font-weight: 700;
}
.schedule-toggle input {
  width: 16px;
  height: 16px;
  accent-color: #1270e3;
}
.schedule-toggle.active {
  background: #0f66da;
  color: #fff;
  border-color: #0f66da;
}
.schedule-table-wrap {
  padding: 14px;
}
.schedule-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #d5d5d5;
  background: #fff;
}
.schedule-table th,
.schedule-table td {
  border: 1px solid #d5d5d5;
  padding: 8px 10px;
  font-size: 12px;
  vertical-align: top;
}
.schedule-table th {
  background: #f4f4f4;
  font-weight: 800;
  color: #333;
  text-align: left;
}
.schedule-table tfoot td {
  background: #fafafa;
}
.schedule-check-col {
  width: 34px;
  text-align: center;
}
.schedule-table .num {
  text-align: right;
  white-space: nowrap;
}
.schedule-table-empty {
  color: #777;
  text-align: center;
  padding: 24px 10px;
}
.schedule-row-link {
  appearance: none;
  border: none;
  background: transparent;
  color: #1b63c9;
  font-weight: 700;
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  text-align: left;
}
.schedule-btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 14px 10px;
}
.schedule-btn {
  border: 1px solid #d8d1a6;
  background: linear-gradient(180deg, #fff7cc, #f2e7a4);
  border-radius: 6px;
  padding: 7px 14px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}
.schedule-editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 24px;
  padding: 4px 14px 14px;
}
.schedule-editor-grid-3 {
  grid-template-columns: 1fr 1fr 1fr;
}
.schedule-editor-field label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: #333;
  margin-bottom: 6px;
}
.schedule-input-code {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
}
.schedule-input-code span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  border: 1px solid #c9c9c9;
  border-right: none;
  background: #efefef;
  border-radius: 8px 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: #444;
}
.schedule-input-code input,
.schedule-input-code select {
  width: 100%;
  height: 36px;
  border: 1px solid #c9c9c9;
  border-radius: 0 8px 8px 0;
  background: #fff;
  padding: 8px 10px;
  font-size: 12px;
  outline: none;
}
.schedule-input-code input:focus,
.schedule-input-code select:focus {
  box-shadow: var(--focus);
  border-color: var(--maroon);
}
.schedule-input-code.readonly input {
  background: #efefef;
}
.activity-code-dropdown {
  position: absolute;
  z-index: 90;
  max-height: 220px;
  overflow-y: auto;
  overflow-x: hidden;
  background: #fff;
  border: 1px solid #a9c2e8;
  border-radius: 10px;
  box-shadow: 0 14px 28px rgba(17, 68, 145, 0.2);
}
.activity-code-option {
  display: block;
  width: 100%;
  border: none;
  border-bottom: 1px solid #edf3fb;
  background: #fff;
  color: #23426d;
  text-align: left;
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.25;
  cursor: pointer;
}
.activity-code-option:last-child {
  border-bottom: none;
}
.activity-code-option:hover,
.activity-code-option.active {
  background: #eaf3ff;
  color: #0f4ea6;
}
.activity-code-empty {
  padding: 10px;
  font-size: 11px;
  color: #5a759c;
}
.schedule-total-line {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  padding: 4px 14px 0;
}
.schedule-total-label {
  font-size: 12px;
  font-weight: 800;
  color: #333;
}
.schedule-summary-grid,
.schedule-qualify-grid,
.schedule-bf-grid,
.schedule-film-grid {
  display: grid;
  gap: 10px 12px;
  padding: 14px;
  align-items: center;
}
.schedule-summary-grid {
  grid-template-columns: 1.2fr repeat(5, 1fr);
}
.schedule-qualify-grid {
  grid-template-columns: 1.3fr 1fr 1fr;
}
.schedule-bf-grid {
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
}
.schedule-film-grid {
  grid-template-columns: 1.1fr 1fr 1fr 1fr;
}
.schedule-three-col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 10px 12px;
  padding: 14px;
  align-items: center;
}
.schedule-summary-header,
.schedule-qualify-header,
.schedule-bf-header,
.schedule-film-header,
.schedule-three-col-label {
  font-size: 12px;
  font-weight: 800;
  color: #333;
}
.schedule-summary-label,
.schedule-qualify-label,
.schedule-bf-label,
.schedule-film-label,
.schedule-three-col-value {
  font-size: 12px;
  font-weight: 700;
  color: #333;
}
.schedule-qualify-note {
  grid-column: 1 / 2;
  font-size: 12px;
  font-weight: 700;
  color: #444;
}
.schedule-taxcalc-head,
.schedule-taxcalc-subhead {
  display: grid;
  grid-template-columns: 48px 1.6fr 1fr 70px 1fr;
  gap: 10px 12px;
  padding: 8px 14px 0;
  align-items: center;
}
.schedule-taxcalc-head div,
.schedule-taxcalc-subhead div {
  font-size: 12px;
  font-weight: 800;
  color: #333;
}
.schedule-taxcalc-grid {
  display: grid;
  grid-template-columns: 48px 1.6fr 1fr 70px 1fr;
  gap: 10px 12px;
  padding: 8px 14px 0;
  align-items: center;
}
.schedule-tax-letter {
  font-size: 12px;
  font-weight: 800;
  color: #333;
}
.schedule-tax-label,
.schedule-credit-label,
.schedule-payments-label {
  font-size: 12px;
  font-weight: 700;
  color: #333;
}
.schedule-tax-rate {
  font-size: 12px;
  font-weight: 800;
  color: #333;
  text-align: center;
}
.schedule-credit-grid {
  display: grid;
  grid-template-columns: 1.8fr 240px;
  gap: 10px 12px;
  padding: 14px;
  align-items: center;
}
.schedule-payments-grid {
  display: grid;
  grid-template-columns: 1fr 240px 240px;
  gap: 10px 12px;
  padding: 14px;
  align-items: center;
}
.schedule-payments-header {
  font-size: 12px;
  font-weight: 800;
  color: #333;
}
.statement-note {
  margin: 14px;
  padding: 14px 16px;
  border-radius: 10px;
  background: #dff0ff;
  color: #35536f;
  font-size: 13px;
  font-weight: 600;
}
.statement-scope-toggle {
  display: inline-flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.statement-scope-toggle label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}
.statement-subhead,
.statement-section-title,
.statement-section-subtitle {
  padding: 12px 14px 0;
  color: #333;
}
.statement-subhead {
  font-size: 13px;
  font-weight: 800;
}
.statement-section-title {
  font-size: 14px;
  font-weight: 800;
}
.statement-section-subtitle {
  font-size: 13px;
  font-weight: 800;
}
.statement-values-grid {
  display: grid;
  grid-template-columns: 1.8fr 240px;
  gap: 10px 12px;
  padding: 14px;
  align-items: center;
}
.statement-values-label {
  font-size: 12px;
  font-weight: 700;
  color: #333;
}
@media (max-width: 860px) {
  .mr-row,
  .mr-row.linkrow {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .mr-label {
    justify-self: start;
    text-align: left;
  }
  .mr-link,
  .mr-code,
  .mr-input,
  .mr-help {
    justify-self: start;
  }
}
.statement-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(24, 63, 120, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  padding: 24px;
}
.statement-modal {
  width: min(980px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: #f3f8ff;
  border: 1px solid #b7ccee;
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(26, 77, 150, 0.18);
}
.statement-modal-title {
  padding: 12px 16px;
  border-radius: 12px 12px 0 0;
  background: linear-gradient(180deg, #1f5fca, #16479c);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}
.statement-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 24px;
  padding: 18px 16px 8px;
}
.statement-modal .schedule-editor-field label {
  color: #20416f;
}
.statement-modal .schedule-input-code span {
  background: #e4efff;
  border-color: #a9c2e8;
  color: #214c87;
}
.statement-modal .schedule-input-code input,
.statement-modal .schedule-input-code select,
.statement-modal .mini-input {
  background: #fff;
  border-color: #a9c2e8;
}
.statement-modal .schedule-btn {
  border: 1px solid #8fb2ea;
  background: linear-gradient(180deg, #eef5ff, #cfe1ff);
  color: #174586;
}
.statement-modal .schedule-btn:hover {
  background: linear-gradient(180deg, #f8fbff, #dbe9ff);
}
.draft-confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(18, 56, 111, 0.3);
}
.draft-confirm-modal {
  width: min(520px, 100%);
  background: #f6faff;
  border: 1px solid #b7ccee;
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(26, 77, 150, 0.2);
  overflow: hidden;
}
.draft-confirm-title {
  padding: 12px 16px;
  background: linear-gradient(180deg, #1f5fca, #16479c);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}
.draft-confirm-body {
  padding: 16px;
  color: #21416d;
  font-size: 14px;
  line-height: 1.5;
}
.draft-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 16px 16px;
  flex-wrap: wrap;
}
@media (max-width: 860px) {
  .draft-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .draft-tools {
    align-items: stretch;
  }
  .draft-tools .field {
    min-width: 0;
    width: 100%;
  }
  .schedule-meta-row,
  .schedule-editor-grid,
  .schedule-editor-grid-3,
  .schedule-summary-grid,
  .schedule-qualify-grid,
  .schedule-bf-grid,
  .schedule-film-grid,
  .schedule-three-col,
  .schedule-taxcalc-head,
  .schedule-taxcalc-subhead,
  .schedule-taxcalc-grid,
  .schedule-credit-grid,
  .schedule-payments-grid,
  .statement-values-grid,
  .statement-modal-grid {
    grid-template-columns: 1fr;
  }
  .review-layout {
    grid-template-columns: 1fr;
  }
  .review-sidebar {
    position: static;
    width: auto;
    margin-bottom: 12px;
  }
  .schedule-meta-key {
    text-align: left;
  }
  .schedule-total-line {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 1280px) {
  .review-sidebar {
    position: static;
    width: auto;
    margin-bottom: 12px;
  }
}

.cage-row {
  display: grid;
  grid-template-columns: 1fr 70px 220px;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed #d6e4ff;
}
.cage-row:last-child {
  border-bottom: none;
}
.cage-name {
  font-size: 13px;
  font-weight: 600;
}
.cage-code {
  text-align: center;
  font-size: 12px;
  padding: 7px 8px;
  border-radius: 10px;
  background: #edf4ff;
  border: 1px solid var(--border);
  font-weight: 800;
  color: #333;
}
.cage-input input {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.readonly input {
  background: #f5f5f5;
}
.mini {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.4;
}

.progress {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: #fff;
  opacity: 0.95;
}
.bar {
  width: 140px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.18);
  overflow: hidden;
}
.bar > div {
  height: 100%;
  background: rgba(255, 255, 255, 0.75);
  width: 0%;
}
.hidden {
  display: none !important;
}

.inline-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  cursor: pointer;
}

.checklist {
  margin-top: 12px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.check-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.check-row:last-child {
  border-bottom: none;
}
.check-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  accent-color: var(--maroon);
}
.check-text {
  min-width: 0;
}
.check-title {
  font-size: 13px;
  font-weight: 600;
  color: #2a2a2a;
  line-height: 1.35;
}
.check-row.subtle .check-title {
  font-weight: 500;
  color: #444;
}
.radio-line {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 6px 0;
}

.mini-input {
  width: 100%;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 13px;
  outline: none;
}
.mini-input:focus {
  box-shadow: var(--focus);
  border-color: var(--maroon);
}
