@import url("https://fonts.googleapis.com/css2?family=Figtree:wght@500;600;700&family=Source+Serif+4:wght@500;600&display=swap");

body[data-page="portal"] {
  --sans: "Figtree", "Segoe UI", sans-serif;
  --serif: "Source Serif 4", Georgia, serif;
}

body[data-page="portal"] .page-head.wrap {
  background-image: linear-gradient(90deg, rgba(7, 18, 32, 0.78), rgba(7, 18, 32, 0.28)), url("../assets/library.jpg");
}

.portal-login-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.portal-account {
  display: grid;
  gap: 2px;
  text-align: left;
  background: var(--cream);
  border: 1px solid var(--line);
  padding: 14px 16px;
  color: var(--navy);
}
.portal-account:hover { border-color: var(--navy); }
.portal-account strong { font-size: 1.02rem; }
.portal-account .kicker { margin: 0; }
.mono { font-variant-numeric: tabular-nums; }

.portal-bar { background: var(--navy); color: white; }
.portal-bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  padding: 28px 0 26px;
}
.portal-bar h1 {
  color: white;
  font-size: clamp(2rem, 3.4vw, 2.8rem);
  margin: 0;
}
.portal-bar .kicker { color: #d5e4f2; margin: 0 0 0.35rem; }
.portal-bar .btn-line { border-color: rgba(255, 255, 255, 0.7); color: white; }
.portal-bar .btn-line:hover { background: white; color: var(--navy); }

.portal-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.portal-nav {
  display: grid;
  gap: 8px;
  align-content: start;
  scrollbar-width: none;
}
.portal-nav::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
.portal-nav :is(button, a) {
  text-align: left;
  text-decoration: none;
  background: white;
  border: 1px solid var(--line);
  padding: 12px 14px;
  font-weight: 650;
  color: var(--navy);
}
.portal-nav :is(button, a):hover { border-color: var(--navy); }
.portal-nav :is(button, a)[aria-current="page"] {
  background: var(--navy);
  color: white;
  border-color: var(--navy);
}

.portal-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.portal-stat {
  background: white;
  border: 1px solid var(--line);
  padding: 16px 18px;
}
.portal-stat span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.portal-stat strong {
  display: block;
  margin-top: 6px;
  font-family: var(--serif);
  font-size: 2.2rem;
  font-weight: 560;
  color: var(--navy);
  line-height: 1;
}

.portal-split {
  display: grid;
  grid-template-columns: minmax(240px, 340px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.portal-rows { display: grid; gap: 10px; }
.portal-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  text-align: left;
  background: white;
  border: 1px solid var(--line);
  padding: 16px 18px;
  color: inherit;
  min-width: 0;
}
.portal-row:hover { border-color: var(--navy); }
.portal-row.is-on { border-color: var(--navy); box-shadow: inset 3px 0 0 var(--navy); }
.portal-row > span:first-child { min-width: 0; flex: 1; }
.portal-row strong { display: block; color: var(--navy); font-size: 1.05rem; line-height: 1.35; margin-bottom: 2px; }
.portal-row span.muted {
  display: block;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  background: var(--cream);
  color: var(--navy);
}
.pill-review { background: #d9e6f2; color: #1f4e79; }
.pill-offer { background: var(--navy); color: white; }
.pill-paid, .pill-enrolled { background: #e5f2eb; color: var(--ok); }
.pill-closed { background: #f6e6e6; color: var(--danger); }

.portal-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.portal-filters button {
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 650;
  color: var(--navy);
}
.portal-filters button[aria-pressed="true"] {
  background: var(--navy);
  color: white;
  border-color: var(--navy);
}

.portal-track { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.portal-track li {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 12px;
  align-items: start;
  padding: 8px 0;
  color: var(--muted);
}
.portal-track li::before {
  content: "";
  width: 12px;
  height: 12px;
  margin-top: 6px;
  border-radius: 50%;
  border: 2px solid var(--stone);
  background: white;
}
.portal-track li.is-done { color: var(--navy); }
.portal-track li.is-done::before { background: var(--navy); border-color: var(--navy); }
.portal-track li.is-now { color: var(--navy); font-weight: 700; }
.portal-track li.is-now::before { background: white; border-color: var(--navy); box-shadow: 0 0 0 4px #d9e6f2; }

.visa-track {
  display: grid;
  gap: 6px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
  counter-reset: visa;
}
.visa-track li {
  position: relative;
  padding: 8px 12px 8px 36px;
  border: 1px solid rgba(11, 31, 56, 0.12);
  border-radius: 8px;
  color: #5a6b7d;
  font-size: 0.92rem;
}
.visa-track li::before {
  counter-increment: visa;
  content: counter(visa);
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #d7e0ea;
  color: #0b1f38;
  font-size: 0.7rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.visa-track li.is-on {
  color: #0b1f38;
  border-color: rgba(22, 48, 36, 0.35);
  background: rgba(22, 48, 36, 0.06);
}
.visa-track li.is-on::before {
  background: #163024;
  color: #fff;
}
.doc-list { display: grid; gap: 10px; }
.doc-list .doc-line > label {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: white;
  border: 1px solid var(--line);
  padding: 14px 16px;
  font-weight: 600;
  flex: 1;
}
.doc-list .doc-line > label input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--navy); }

.portal-thread { display: grid; gap: 10px; margin: 12px 0; }
.msg-thread { max-height: min(58vh, 640px); overflow: auto; padding-right: 4px; }
.portal-msg {
  background: white;
  border: 1px solid var(--line);
  padding: 12px 14px;
  border-radius: 10px;
}
.portal-msg.from-admissions { border-left: 3px solid var(--navy); }
.portal-msg.from-student { border-left: 3px solid #6f879c; }
.portal-msg.is-mine { background: #f3f7fb; }
.portal-msg.is-flash { outline: 2px solid var(--navy); }
.portal-msg p { margin: 0.35em 0 0; }
.msg-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.msg-head span { color: var(--muted); font-size: 0.82rem; }
.msg-quote {
  display: grid;
  gap: 2px;
  width: 100%;
  margin: 8px 0 0;
  padding: 8px 10px;
  border: 0;
  border-left: 3px solid #9eb0c0;
  background: #eef3f8;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.msg-quote strong { font-size: 0.82rem; color: var(--navy); }
.msg-quote span { color: var(--muted); font-size: 0.86rem; }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-actions { margin-top: 8px; }
.msg-actions .act { font-size: 0.82rem; }
.msg-file, .msg-image {
  display: grid;
  gap: 2px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-decoration: none;
  color: inherit;
}
.msg-file span { color: var(--muted); font-size: 0.82rem; }
.msg-image { padding: 6px; }
.msg-image img { display: block; max-width: min(100%, 320px); max-height: 220px; border-radius: 6px; }
.msg-audio { display: block; width: min(100%, 360px); margin-top: 10px; }
.msg-composer { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.msg-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.msg-attach-btn { margin: 0; cursor: pointer; }
.msg-attach-btn.is-ready {
  border-color: #1e5c45;
  color: #1e5c45;
  background: #e5f2eb;
}
.msg-file-ready {
  color: var(--navy);
  font-size: 0.86rem;
  font-weight: 600;
  max-width: min(100%, 280px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.msg-replying {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  background: #eef3f8;
  border-radius: 8px;
  font-size: 0.9rem;
}
.msg-voice-ready { color: var(--navy); font-size: 0.86rem; font-weight: 600; }
.btn.is-recording { border-color: #b42318; color: #b42318; }
.msg-inbox { align-items: stretch; }
.msg-desk .case-head { display: block; }

.portal-home {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.8fr);
  gap: 16px;
  align-items: start;
}
.portal-tools { display: grid; gap: 12px; margin-bottom: 12px; }
.meter-label { margin: 12px 0 6px; font-size: 0.85rem; color: var(--muted); }
.meter { height: 8px; background: #d9e4ef; }
.meter span { display: block; height: 100%; background: var(--navy); }
.task-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.task-list li { display: grid; gap: 2px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.task-list span { color: var(--muted); font-weight: 500; }
.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 28px; gap: 10px; align-items: center; font-size: 0.92rem; }
.bar { display: block; height: 8px; background: #d9e4ef; }
.bar i { display: block; height: 100%; background: var(--navy); }
.pipe {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: calc(100vh - 128px);
  min-height: 560px;
}
.pipe-tools { display: flex; align-items: center; gap: 16px; flex: none; }
.pipe-tools .desk-search { margin: 0; flex: 1; min-width: 0; max-width: 420px; }
.pipe-tools p { margin: 0; }
.board {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}
.board-col {
  min-width: 0;
  min-height: 0;
  background: white;
  border: 0;
  border-top: 3px solid #c5d3e2;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.board-col.is-review { border-top-color: #1f4e79; }
.board-col.is-offer { border-top-color: #0b1f38; }
.board-col.is-live { border-top-color: #1e5c45; }
.board-col.is-closed { border-top-color: #8d3a3a; }
.board-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px 8px; flex: none; }
.board-head h2 { font-size: 0.95rem; margin: 0; font-weight: 700; letter-spacing: -0.01em; }
.board-count {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #e7eef5;
  color: var(--navy);
  font-size: 0.8rem;
  font-weight: 700;
}
.board-cards {
  display: grid;
  gap: 8px;
  align-content: start;
  overflow: auto;
  min-height: 0;
  flex: 1;
  padding: 0 10px 12px;
}
.board-card {
  width: 100%;
  display: block;
  text-align: left;
  background: #f4f8fb;
  border: 0;
  padding: 8px;
  margin: 0;
  color: var(--navy);
  box-shadow: none;
}
.board-card .who { align-items: flex-start; min-width: 0; }
.board-card .who > span:last-child { min-width: 0; }
.board-card .who strong,
.board-card .who .muted { display: block; }
.board-card .who strong { color: var(--navy); font-size: 0.95rem; }
.board-card .muted,
.board-meta { color: var(--muted); font-size: 0.78rem; line-height: 1.35; overflow-wrap: anywhere; }
.board-meta { display: block; }
.board-card .avatar { color: white; }
.board-card:hover { background: #e8f0f7; }
.board-empty { margin: 8px 4px 0; color: #8aa0b5; font-size: 0.85rem; }
.board-more {
  justify-self: start;
  border: 0;
  background: transparent;
  color: #1f4e79;
  font-weight: 700;
  padding: 4px 4px 0;
  cursor: pointer;
}
.board-more:hover { text-decoration: underline; }
.file-pick { position: relative; cursor: pointer; display: inline-flex; align-items: center; justify-self: start; width: auto; }
.file-pick input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.file-cell { width: 72px; }
.file-empty { color: var(--muted); font-size: 0.85rem; }
.file-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(11, 31, 56, 0.12);
  background: #f4f7fb;
  color: var(--navy);
  text-decoration: none;
}
.file-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-preview.is-pdf { background: #f8ecec; color: #8f2d2d; }
.file-preview.is-word { background: #e7eef5; color: #1f4e79; }
.file-mark { display: grid; justify-items: center; gap: 2px; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.04em; }
.file-mark svg { width: 18px; height: 18px; }
.doc-stage { display: grid; justify-items: start; }
.file-preview.is-large { width: min(100%, 520px); height: 360px; max-width: 100%; background: #f4f7fb; }
.file-preview.is-large.is-pdf,
.file-preview.is-large.is-word,
.file-preview.is-large.is-file { width: auto; height: auto; }
.file-preview.is-large img { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: contain; background: #f4f7fb; }
.file-preview.is-large .file-mark { gap: 8px; padding: 28px 36px; font-size: 0.8rem; }
.file-preview.is-large .file-mark svg { width: 36px; height: 36px; }
.doc-frame {
  width: min(100%, 720px);
  height: 520px;
  border: 1px solid rgba(11, 31, 56, 0.12);
  border-radius: 12px;
  background: white;
}
.doc-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.doc-upload { display: flex; align-items: center; gap: 8px; flex: none; }
.doc-list .doc-line { padding: 10px 0; border-bottom: 1px solid rgba(11, 31, 56, 0.08); }
.doc-list .doc-line label { margin: 0; }
body.is-desk #portal-view:has(.pipe) { padding-bottom: 18px; }

.desk-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 14px; }
.desk-bar h2 { margin: 0; }
.table-wrap { overflow-x: auto; background: transparent; border: 0; max-width: 100%; }
.file-table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 820px; background: transparent; font-size: 0.84rem; }
.file-table th, .file-table td {
  text-align: left;
  padding: 6px 10px;
  border-bottom: 1px solid rgba(11, 31, 56, 0.07);
  vertical-align: middle;
}
.file-table th {
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7d8fa1;
  font-weight: 700;
  padding-top: 2px;
  padding-bottom: 6px;
  background: transparent;
}
.file-table tbody tr { transition: background-color 0.18s ease; }
.file-table tbody tr:last-child td { border-bottom: 0; }
.file-table td .muted, .file-table td strong { display: block; }
.file-table td.mono { color: #3e5368; font-size: 0.82rem; letter-spacing: 0.01em; white-space: nowrap; }
.file-table select { min-width: 0; }
.row-actions { display: flex; flex-wrap: nowrap; gap: 6px; align-items: center; }
.row-actions button, .pager button {
  background: white;
  border: 1px solid var(--line);
  padding: 6px 10px;
  font-weight: 650;
  color: var(--navy);
}
.pager button:hover { border-color: var(--navy); }
.pager { display: flex; align-items: center; gap: 10px; margin-top: 8px; color: var(--muted); font-size: 0.88rem; }
.pager button { border-radius: 999px; min-height: 34px; padding: 0 14px; }
.pager button:disabled { opacity: 0.38; }
.doc-save { display: flex; flex-wrap: nowrap; gap: 8px; align-items: center; }
.doc-save input:not([type="checkbox"]) {
  min-width: 160px;
  flex: 1;
  min-height: 36px;
  border-radius: 999px;
  border: 1px solid #d7e2ec;
  padding: 0 14px;
  background: #f7fafc;
}
.doc-save label { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 0.88rem; }

@media (max-width: 980px) {
  .portal-login-grid,
  .portal-layout,
  .portal-split,
  .portal-home,
  .portal-stats,
  .bar-row { grid-template-columns: 1fr; }
  .portal-nav { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .portal-bar-inner { flex-direction: column; align-items: flex-start; }
  .portal-nav, .portal-stats, .board { grid-template-columns: 1fr; }
  .portal-row { flex-direction: column; align-items: flex-start; }
}

body[data-page="portal"] { background: #e7eef5; }
body[data-page="portal"] .sheet,
.portal-stat,
.table-wrap,
.board-col,
.board-card,
.portal-row,
.portal-msg {
  border-radius: 14px;
  border-color: transparent;
  box-shadow: 0 1px 2px rgba(11, 31, 56, 0.05), 0 10px 28px rgba(11, 31, 56, 0.05);
}
.portal-login-grid { gap: 22px; }
.portal-account { border-radius: 12px; background: #f4f7fb; transition: transform 0.15s ease, border-color 0.15s ease; }
.portal-account:hover { transform: translateY(-1px); }

.portal-stat { position: relative; overflow: hidden; padding: 18px 18px 16px; }
.portal-stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--navy); }
.portal-stat strong { font-size: 1.85rem; letter-spacing: -0.03em; }

.file-table td:first-child, .file-table th:first-child { padding-left: 12px; }
.file-table td:last-child, .file-table th:last-child { padding-right: 12px; }
.file-table tbody tr:hover td { background: #f3f8fc; }
.file-table .who { gap: 8px; }
.file-table .avatar { width: 26px; height: 26px; font-size: 0.62rem; }
.file-table .who strong { font-size: 0.84rem; font-weight: 650; letter-spacing: -0.01em; }
.file-table .who .muted { margin-top: 0; font-size: 0.72rem; }
.file-table .clip {
  display: block;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-table .status-select {
  min-height: 26px;
  padding: 2px 22px 2px 8px;
  font-size: 0.74rem;
  background-position: right 7px center;
}
.file-table .row-actions { gap: 4px; }
.file-table .act { padding: 3px 8px !important; font-size: 0.72rem; }
.file-table .file-cell { width: 48px; }
.file-table .file-preview { width: 28px; height: 36px; border-radius: 5px; }
.file-table .file-mark svg { width: 14px; height: 14px; }
.file-table .doc-meter { gap: 6px; min-width: 0; font-size: 0.74rem; }
.file-table .mini-meter { width: 40px; height: 4px; }

.act {
  border: 1px solid transparent !important;
  background: #eef3f8 !important;
  color: var(--navy) !important;
  border-radius: 999px;
  padding: 6px 12px !important;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.2;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.act-view { background: var(--navy) !important; color: white !important; }
.act-delete { background: #f8ecec !important; color: #8d3a3a !important; }
.act:hover { filter: brightness(0.96); }

.desk-brand { display: none; }

body.is-desk #header,
body.is-desk #footer,
body.is-desk #portal-hero,
body.is-desk .skip { display: none !important; }
body.is-desk main { min-height: 100vh; }
body.is-desk {
  overflow-x: clip;
  font-family: "Figtree", "Segoe UI", sans-serif;
}
body.is-desk button,
body.is-desk input,
body.is-desk select,
body.is-desk textarea,
body.is-desk table,
body.is-desk label,
body.is-desk .kicker,
body.is-desk .pill,
body.is-desk .muted {
  font-family: "Figtree", "Segoe UI", sans-serif;
}
body.is-desk h1,
body.is-desk h2,
body.is-desk h3,
body.is-desk h4 {
  font-family: "Source Serif 4", Georgia, serif;
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
body.is-desk h1 { font-size: 1.4rem; margin: 0; }
body.is-desk h2 { font-size: 1.12rem; margin: 0 0 0.35em; }
body.is-desk h3 { font-size: 1rem; margin: 0 0 0.3em; }
body.is-desk h4 { font-size: 0.92rem; margin: 0 0 0.25em; }
body.is-desk .board-head h2 { font-size: 0.9rem; margin: 0; }
body.is-desk .portal-stat strong { font-size: 1.35rem; }
body.is-desk #portal-app {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 100vh;
  max-width: 100%;
  background:
    radial-gradient(900px 420px at 100% -10%, rgba(31, 78, 121, 0.08), transparent 60%),
    #e7eef5;
}
body.is-desk #portal-app > *,
body.is-desk #portal-view,
.inbox,
.inbox > *,
.case,
.case-grid,
.case-main,
.case-side,
.case-head,
.case-person,
.case-person > div,
.table-wrap {
  min-width: 0;
}
body.is-desk .portal-layout { display: contents; }
body.is-desk .portal-nav {
  grid-column: 1;
  grid-row: 1 / -1;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  align-content: stretch;
  background: linear-gradient(180deg, #12304d 0%, #0b1f38 220px);
  padding: 16px 14px 18px;
  gap: 4px;
}
body.is-desk .portal-nav { z-index: 5; }
body.is-desk .portal-nav a.desk-brand {
  display: block;
  flex: 0 0 auto;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  width: auto;
  margin: 4px 2px 14px;
  padding: 4px 2px 16px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: white;
  text-decoration: none;
  overflow: visible;
  height: auto;
  min-height: 0;
}
body.is-desk .portal-nav a.desk-brand:hover,
body.is-desk .portal-nav a.desk-brand[aria-current="page"] {
  background: transparent;
  color: white;
  box-shadow: none;
}
body.is-desk .portal-nav a.desk-brand img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  object-position: left center;
  background: transparent;
  padding: 0;
}
body.is-desk .desk-brand span { display: none; }
body.is-desk .portal-nav :is(button, a) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  background: transparent;
  border: 0;
  color: #d7e4f1;
  border-radius: 10px;
  padding: 10px 12px;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-align: left;
}
body.is-desk .portal-nav :is(button, a) em {
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 700;
  min-width: 1.35rem;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  text-align: center;
}
body.is-desk .portal-nav :is(button, a):hover { background: rgba(255, 255, 255, 0.07); }
body.is-desk .portal-nav :is(button, a)[aria-current="page"] {
  background: white;
  color: var(--navy);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
}
body.is-desk .portal-nav :is(button, a)[aria-current="page"] em {
  background: #e7eef5;
  color: var(--navy);
}
body.is-desk .nav-label {
  margin: 10px 12px 6px;
  color: #8eabc4;
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
body.is-desk .portal-nav :is(button, a)[data-tab="settings"] { margin-top: auto; }
body.is-desk .desk-foot {
  margin: 14px 0 0;
  padding: 18px 12px 2px;
  color: #9bb4cb;
  font-size: 0.75rem;
  line-height: 1.45;
}
body.is-desk .desk-foot strong {
  display: block;
  color: white;
  font-weight: 650;
  margin-bottom: 2px;
}
body.is-desk .portal-bar,
body.is-desk #portal-app > .wrap {
  grid-column: 2;
  background: transparent;
  color: var(--navy);
}
body.is-desk .portal-bar .wrap,
body.is-desk #portal-app > .wrap,
body.is-desk .portal-layout.wrap {
  max-width: none;
  width: auto;
}
body.is-desk .portal-bar-inner { padding: 22px 32px 4px; align-items: center; }
.bar-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.nav-toggle,
.nav-backdrop { display: none; }
body.is-desk .portal-bar h1 {
  color: var(--navy);
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.4rem;
  letter-spacing: -0.03em;
  margin: 0;
}
body.is-desk .portal-bar .kicker {
  color: #5d7390;
  font-family: "Figtree", "Segoe UI", sans-serif;
  letter-spacing: 0.16em;
  margin: 0 0 0.3rem;
}
body.is-desk .portal-bar .btn-line {
  border-color: #c5d3e2;
  color: var(--navy);
  background: white;
  border-radius: 999px;
  font-family: "Figtree", "Segoe UI", sans-serif;
}
body.is-desk .portal-bar .btn-line:hover { background: var(--navy); color: white; }
body.is-desk #portal-view { padding: 12px 32px 56px; }
body.is-desk #portal-app > .wrap.band { padding: 0 32px; }
body.is-desk .sheet {
  border-radius: 16px;
  padding: 20px 22px;
}
body.is-desk .portal-tools {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 14px;
}
body.is-desk .portal-tools .field { min-width: min(280px, 100%); margin: 0; }
body.is-desk .desk-bar h2 { font-family: var(--serif); font-weight: 560; }
body.is-desk .board-col { border-radius: 16px; background: white; }
body.is-desk .board-card { border-radius: 12px; box-shadow: none; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.portal-stat em {
  display: block;
  margin-top: 8px;
  font-style: normal;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 560;
}
.sheet-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.sheet-head h2 { margin: 0; font-family: var(--serif); font-weight: 560; font-size: 1.12rem; }
.desk-span { grid-column: 1 / -1; }
.sheet .portal-row { box-shadow: none; border: 0; border-radius: 12px; background: #f4f8fb; }
.bar { height: 10px; border-radius: 99px; overflow: hidden; }
.bar i { border-radius: 99px; }
.who { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #163556;
  color: white;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  flex: none;
}
.doc-meter { display: flex; align-items: center; gap: 8px; min-width: 78px; color: var(--muted); font-size: 0.8rem; font-weight: 700; white-space: nowrap; }
.mini-meter { display: block; width: 52px; height: 5px; border-radius: 99px; background: #d5e2ef; overflow: hidden; flex: none; }
.mini-meter i { display: block; height: 100%; background: var(--navy); border-radius: 99px; }
.flag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
}
.flag.is-live { background: #e5f2eb; color: #1e5c45; }
.flag.is-review { background: #e7f0f8; color: #1f4e79; }
.flag.is-wait { background: #eef2f6; color: #526173; }
.flag.is-closed { background: #f8ecec; color: #8d3a3a; }
.when { margin-top: 4px; font-size: 0.75rem; }
.status-select {
  appearance: none;
  border-radius: 999px;
  border: 0;
  font-weight: 700;
  font-size: 0.8rem;
  min-height: 32px;
  padding: 4px 28px 4px 12px;
  cursor: pointer;
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%230b1f38' stroke-width='1.6' stroke-linecap='round' d='M2 4.2 6 8l4-3.8'/%3E%3C/svg%3E");
}
.status-select:focus-visible { outline: 2px solid rgba(31, 78, 121, 0.35); outline-offset: 2px; }
.status-select.is-review { background-color: #e7f0f8; color: #1f4e79; }
.status-select.is-offer { background-color: #e4ebf3; color: #0b1f38; }
.status-select.is-live { background-color: #e5f2eb; color: #1e5c45; }
.status-select.is-closed { background-color: #f8ecec; color: #8d3a3a; }
.desk-user {
  display: flex;
  align-items: center;
  gap: 14px;
  background: white;
  border-radius: 999px;
  padding: 6px 6px 6px 16px;
  box-shadow: 0 8px 24px rgba(11, 31, 56, 0.06);
}
.desk-user strong, .desk-user span { display: block; line-height: 1.15; }
.desk-user strong { font-size: 0.95rem; }
.desk-user span { color: var(--muted); font-size: 0.78rem; }
.desk-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.fee-help h2 { margin: 0.25rem 0 0.75rem; }
.fee-help p { margin: 0 0 0.85rem; max-width: 52rem; line-height: 1.6; }
.fee-help p:last-child { margin-bottom: 0; }
body.is-desk #portal-view > .sheet + .sheet,
body.is-desk #portal-view > .portal-stats + .sheet,
body.is-desk #portal-view > .sheet + .gw-board,
body.is-desk #portal-view > .gw-config + .gw-board {
  margin-top: 16px;
}
body.is-desk #portal-view > .portal-stats { margin-bottom: 4px; }
.fee-price-panel { margin-bottom: 12px; }
.desk-toolbar .portal-filters { margin: 0; }
.desk-search { margin-left: auto; min-width: min(280px, 100%); }
.desk-search input {
  width: 100%;
  min-height: 42px;
  border-radius: 999px;
  border: 1px solid #d5e0ea;
  padding: 0 16px;
  background: #f7fafc;
}
.table-sheet { padding: 12px 4px 8px; }
.table-sheet .table-wrap { box-shadow: none; border-radius: 0; background: transparent; }
.table-sheet .desk-toolbar,
.table-sheet .pager { padding-left: 16px; padding-right: 16px; }
.table-sheet .pager { margin: 0; }
.file-table .sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  cursor: pointer;
}
.file-table .sort-mark { width: 0.7em; font-size: 0.72rem; line-height: 1; }
.file-table .sort-mark::before { content: "↕"; opacity: 0.35; }
.file-table th[aria-sort="ascending"] .sort-btn,
.file-table th[aria-sort="descending"] .sort-btn { color: var(--navy); }
.file-table th[aria-sort="ascending"] .sort-mark::before { content: "↑"; opacity: 1; }
.file-table th[aria-sort="descending"] .sort-mark::before { content: "↓"; opacity: 1; }
.dt-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 16px 4px;
}
.dt-foot p { margin: 0; color: var(--muted); font-size: 0.88rem; }
.dt-length { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.88rem; }
.dt-length select {
  border-radius: 999px;
  border: 1px solid #d5e0ea;
  background: #f7fafc;
  min-height: 34px;
  padding: 0 28px 0 12px;
  color: var(--navy);
}
.dt-foot .pager { margin-left: auto; }
.dt-num {
  min-width: 34px;
  min-height: 34px;
  border-radius: 999px;
  padding: 0 10px;
}
.dt-num.is-on { background: var(--navy); color: white; border-color: var(--navy); }
.dt-gap { color: var(--muted); padding: 0 2px; }
body.is-desk .btn,
body[data-page="portal"] #portal-login .btn,
body.is-desk .portal-filters button,
body.is-desk .pager button,
body.is-desk .act {
  min-height: 30px;
  padding: 0 12px;
  font-size: 0.78rem;
  line-height: 1.2;
}
body.is-desk .btn { gap: 6px; justify-self: start; width: auto; }
body.is-desk .act { padding: 0 9px !important; font-size: 0.72rem; }
body.is-desk .file-table .act { min-height: 24px; padding: 0 8px !important; }
body.is-desk .portal-nav :is(button, a) {
  padding: 7px 10px;
  font-size: 0.88rem;
  border-radius: 8px;
}
body.is-desk .desk-user { padding: 3px 3px 3px 12px; gap: 10px; }
body.is-desk .desk-user strong { font-size: 0.84rem; }
body.is-desk .desk-search input,
body[data-page="portal"] #portal-login .field input,
body.is-desk .field input,
body.is-desk .field select,
body.is-desk .dt-length select,
body.is-desk .status-select {
  min-height: 32px;
  font-size: 0.84rem;
}
body.is-desk .desk-search input { padding: 0 12px; }
body.is-desk .field input,
body.is-desk .field select { padding: 6px 10px; }
body.is-desk .field textarea { min-height: 88px; padding: 8px 10px; }
body.is-desk .case-side .status-select { min-height: 34px; font-size: 0.84rem; }
body.is-desk .pager button,
body.is-desk .dt-num {
  min-height: 28px;
  min-width: 28px;
  padding: 0 10px;
  font-size: 0.76rem;
}
body.is-desk .dt-length select { min-height: 28px; padding: 0 26px 0 10px; font-size: 0.8rem; }
body.is-desk .field input,
body.is-desk .field select,
body.is-desk .field textarea {
  border-radius: 10px;
}

@media (max-width: 1280px) {
  .board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .pipe { height: auto; min-height: 0; }
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: auto; }
  .board-col { max-height: 440px; }
}
@media (max-width: 640px) {
  .board { grid-template-columns: 1fr; }
}
.case { display: grid; gap: 16px; }
.case-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.case-person { display: flex; align-items: center; gap: 16px; min-width: 0; }
.case-person .avatar { width: 56px; height: 56px; font-size: 1rem; }
.case-person h2 { margin: 0; font-size: 1.28rem; overflow-wrap: anywhere; }
.case-person .kicker { margin: 0 0 4px; }
.case-person p { margin: 2px 0 0; }
.case-tools { display: grid; justify-items: end; gap: 10px; }
.case-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.72fr); gap: 16px; align-items: start; }
.settings-side { display: grid; gap: 16px; min-width: 0; }
.case-main, .case-side { display: grid; gap: 16px; align-content: start; }
.case h3 { margin: 0; font-family: var(--serif); font-weight: 560; font-size: 1rem; }
.case .kicker { margin-bottom: 10px; }
.case .sheet-head { align-items: center; margin-bottom: 14px; }
.case .sheet-head .kicker { margin: 0; }
.case-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.case-facts-2 { grid-template-columns: 1fr 1fr; margin-top: 0; }
.case-fact { background: #f4f8fb; border-radius: 12px; padding: 12px 14px; }
.case-fact span { display: block; color: var(--muted); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 4px; }
.case-fact strong { display: block; color: var(--ink); font-weight: 650; font-size: 0.98rem; letter-spacing: 0; text-transform: none; overflow-wrap: anywhere; }
.case-fact.is-due strong { color: #8f2d2d; }
.file-slot { width: 44px; height: 56px; border-radius: 8px; border: 1px dashed rgba(11, 31, 56, 0.2); background: white; }
.case-copy { margin: 0; line-height: 1.65; }
.case-docs { display: grid; gap: 8px; }
.case-doc {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 0;
  background: #f4f8fb;
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.case-doc:hover { background: #e8f0f7; }
.case-doc strong, .case-doc .muted { display: block; }
.case-doc .muted { font-size: 0.82rem; }
.case-doc .file-preview { pointer-events: none; }
.case-note { margin: 0 0 12px; padding-bottom: 12px; border-bottom: 1px solid rgba(11, 31, 56, 0.08); }
.case-note p { margin: 0; }
.case-note .kicker { margin-bottom: 4px; }
.case-pays { display: grid; gap: 8px; margin-top: 14px; }
.case-pay { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-top: 10px; border-top: 1px solid rgba(11, 31, 56, 0.08); }
.case-pay span { display: block; }
.case-side .status-select { width: 100%; min-height: 42px; font-size: 0.92rem; }
.case .btn { justify-self: start; width: auto; }
.pay-card { display: grid; gap: 8px; }
.pay-card h2 { margin: 0; }
.pay-card p { margin: 0; }
.pay-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.pay-card .pay-actions { margin: 8px 0 0; }
.flag.is-letter { background: #e7eef5; color: #0b1f38; }
.case-doc.is-letter { background: white; border: 1px solid rgba(11, 31, 56, 0.12); }
.letter-list { display: grid; gap: 10px; margin-bottom: 18px; }
.letter-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: white;
  border: 1px solid rgba(11, 31, 56, 0.12);
  color: inherit;
  text-decoration: none;
}
.letter-card strong, .letter-card .muted { display: block; }
.mail-list { display: grid; gap: 14px; }
.mail-list article { padding-top: 12px; border-top: 1px solid rgba(11, 31, 56, 0.08); }
.mail-list h3 { margin: 0 0 4px; font-size: 1.15rem; }
.mail-body { white-space: pre-wrap; margin: 8px 0 0; }
.pill-open { background: #d9e6f2; color: #1f4e79; }
.pill-replied { background: #e5f2eb; color: #1e5c45; }
.pill-quiet { background: #e7eef5; color: #526173; }
.inbox {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  min-width: 0;
  width: 100%;
  overflow: hidden;
}
.inbox-side {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  max-height: calc(100vh - 150px);
  position: sticky;
  top: 12px;
}
.inbox-tools { display: grid; gap: 6px; }
.inbox-tools .desk-search { margin: 0; min-width: 0; }
.inbox-tools .muted { margin: 0; font-size: 0.82rem; }
.inbox-filters { margin: 0; }
.inbox-filters button { display: inline-flex; align-items: center; gap: 6px; }
.inbox-filters button span { font-size: 0.75rem; opacity: 0.72; }
.inbox-list { overflow: auto; display: grid; align-content: start; gap: 4px; min-height: 0; }
.inbox-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 12px;
  padding: 10px;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.inbox-item:hover { background: #f4f8fb; }
.inbox-item.is-on { background: #e7eef5; }
.inbox-copy { min-width: 0; display: grid; gap: 2px; }
.inbox-meta { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; min-width: 0; }
.inbox-meta strong {
  flex: 1;
  min-width: 0;
  color: var(--navy);
  font-size: 0.98rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inbox-meta .pill { flex: none; }
.inbox-item .muted, .inbox-snip { display: block; min-width: 0; }
.inbox-item .muted {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inbox-snip {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msg-inbox .inbox-side { min-width: 260px; }
.msg-inbox .inbox-item { grid-template-columns: 36px minmax(0, 1fr); }
.inbox-empty { margin: 8px 6px; color: var(--muted); }
.req-letter { margin: 0; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; max-width: 100%; }
.mail-letter {
  white-space: normal;
  display: grid;
  gap: 0;
  min-width: 0;
  overflow: hidden;
}
.mail-letter p {
  margin: 0 0 14px;
  line-height: 1.65;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.mail-letter p:last-child { margin-bottom: 0; }
.mail-letter .mail-cta { margin: 4px 0 8px; }
.mail-letter .mail-cta .btn {
  display: inline-flex;
  max-width: 100%;
  white-space: normal;
  text-align: center;
  line-height: 1.35;
}
.mail-letter-sheet { min-width: 0; overflow: hidden; }
.req-answer { background: #f4f8fb; }
.inbox-read { min-width: 0; }
.inbox-read .case-tools { align-items: end; }
.inbox-read .case-side .btn { margin-top: 8px; }
.inbox-read .case-facts,
.inbox-read .case-facts-2 { grid-template-columns: 1fr; margin-top: 14px; }
.inbox-read .small { margin: 12px 0 0; }
.inbox-read .case-grid > .sheet,
.inbox-read .case-side { min-width: 0; max-width: 100%; }
@media (max-width: 1400px) {
  body.is-desk #portal-view { padding: 8px 20px 48px; }
  body.is-desk .portal-bar-inner { padding: 18px 20px 4px; }
  .inbox { grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); }
  .case-grid { grid-template-columns: 1fr; }
  .case-tools, .inbox-read .case-tools {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
  }
}
@media (max-width: 1100px) {
  body.is-desk #portal-app { grid-template-columns: 1fr; }
  body.is-desk .nav-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 36px;
    height: 32px;
    padding: 0;
    border: 1px solid #d5e0ea;
    border-radius: 8px;
    background: white;
    flex: none;
  }
  body.is-desk .nav-toggle span {
    display: block;
    width: 16px;
    height: 2px;
    margin: 0 auto;
    border-radius: 2px;
    background: var(--navy);
  }
  body.is-desk .portal-nav {
    position: fixed;
    z-index: 40;
    top: 0;
    left: 0;
    width: min(280px, 88vw);
    height: 100vh;
    height: 100dvh;
    grid-row: auto;
    grid-column: auto;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }
  body.is-desk.nav-open .portal-nav {
    transform: translateX(0);
    box-shadow: 16px 0 40px rgba(0, 0, 0, 0.28);
  }
  body.is-desk.nav-open { overflow: hidden; }
  body.is-desk .nav-backdrop { display: none; }
  body.is-desk.nav-open .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 30;
    border: 0;
    padding: 0;
    background: rgba(11, 31, 56, 0.46);
    cursor: pointer;
  }
  body.is-desk .portal-bar,
  body.is-desk #portal-app > .wrap,
  body.is-desk #portal-view { grid-column: 1; }
  .inbox { grid-template-columns: minmax(200px, 260px) minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .inbox { grid-template-columns: 1fr; }
  .inbox-side { position: static; max-height: 360px; }
  body.is-desk .portal-tools { display: grid; }
  .desk-user span { display: none; }
}
@media (max-width: 640px) {
  .case-facts, .case-facts-2 { grid-template-columns: 1fr; }
}

.toast-stack {
  position: fixed;
  z-index: 4000;
  top: 16px;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 28px;
  gap: 10px;
  align-items: center;
  margin: 0;
  padding: 12px 10px 12px 14px;
  border: 1px solid rgba(11, 31, 56, 0.1);
  border-left: 4px solid var(--ok);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-family: "Figtree", "Segoe UI", sans-serif;
  font-size: 0.86rem;
  line-height: 1.45;
  box-shadow: 0 16px 40px rgba(11, 31, 56, 0.16);
  opacity: 1;
  transform: none;
}
.toast.is-out { opacity: 0; }
.toast-bad { border-left-color: var(--danger); }
.toast-info { border-left-color: var(--accent); }
.toast p { margin: 0; }
.toast-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  color: white;
  background: var(--ok);
}
.toast-bad .toast-mark { background: var(--danger); }
.toast-info .toast-mark { background: var(--accent); }
.toast-close {
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}
.toast-close:hover { background: #eef3f8; color: var(--navy); }
@media (max-width: 1100px) {
  .toast-stack { top: 12px; width: min(440px, calc(100vw - 24px)); }
}
@media (prefers-reduced-motion: reduce) {
  .toast { transition: none; }
}

.wizard-sheet.apply-stage,
.wizard-sheet {
  max-width: none;
  width: 100%;
  box-sizing: border-box;
  padding: 28px 32px 40px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 251, 253, 0.98)),
    #fff;
}
.wizard-intro {
  display: grid;
  gap: 6px;
  margin: 0 0 4px;
}
.wizard-intro h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.55rem, 2.4vw, 1.9rem);
  font-weight: 560;
  letter-spacing: -0.02em;
  color: var(--navy);
}
.wizard-intro p {
  margin: 0;
  max-width: 40rem;
  color: var(--muted);
  line-height: 1.45;
}
.wizard-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}
.wizard-pane {
  display: grid;
  gap: 16px;
  width: 100%;
  max-width: 56rem;
}
.wizard-pane.is-in {
  animation: wizard-pane-in 0.38s ease both;
}
@keyframes wizard-pane-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.wizard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
}
.wizard-actions-secondary {
  margin-top: 0;
}
.wizard-block {
  display: grid;
  gap: 12px;
  padding-top: 4px;
  border-top: 1px solid rgba(11, 31, 56, 0.08);
}
.wizard-block-label {
  margin: 8px 0 0;
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.apply-section {
  display: grid;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid rgba(11, 31, 56, 0.08);
}
.apply-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}
.apply-section-title {
  margin: 4px 0 0;
  color: var(--navy);
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 560;
  letter-spacing: -0.01em;
}
.apply-section-note {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.apply-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.35;
  cursor: pointer;
}
.apply-check input {
  margin-top: 0.2rem;
  flex: 0 0 auto;
}
.apply-subgrid {
  display: grid;
  gap: 12px;
}
.wizard-disclose {
  margin: 0;
  padding: 0;
  border: 0;
  border-top: 1px solid rgba(11, 31, 56, 0.08);
}
.wizard-disclose > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  list-style: none;
  cursor: pointer;
  padding: 14px 0;
  font-weight: 650;
  color: var(--navy);
}
.wizard-disclose > summary::-webkit-details-marker { display: none; }
.wizard-disclose > summary::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--navy);
  border-bottom: 2px solid var(--navy);
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
  flex: none;
}
.wizard-disclose[open] > summary::before {
  transform: rotate(45deg);
}
.wizard-disclose-hint {
  font-weight: 500;
  color: var(--muted);
  font-size: 0.9rem;
}
.wizard-disclose-body {
  display: grid;
  gap: 14px;
  padding: 0 0 8px;
}
.wizard-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
  counter-reset: none;
}
.wizard-steps li {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  margin: 0;
  padding: 0 6px;
  text-align: center;
  color: #6a7a8c;
  font-size: 0.86rem;
  font-weight: 600;
}
.wizard-steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 0.85rem;
  left: calc(50% + 1.1rem);
  right: calc(-50% + 1.1rem);
  height: 2px;
  background: rgba(11, 31, 56, 0.12);
}
.wizard-steps li.is-done:not(:last-child)::after,
.wizard-steps li.is-on:not(:last-child)::after {
  background: rgba(11, 31, 56, 0.45);
}
.wizard-step-num {
  display: inline-grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  border: 2px solid rgba(11, 31, 56, 0.18);
  background: #fff;
  color: #526173;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  z-index: 1;
}
.wizard-step-label {
  line-height: 1.2;
}
.wizard-steps li.is-on {
  color: var(--navy);
}
.wizard-steps li.is-on .wizard-step-num {
  border-color: var(--navy);
  background: var(--navy);
  color: #fff;
}
.wizard-steps li.is-done {
  color: #1e5c45;
}
.wizard-steps li.is-done .wizard-step-num {
  border-color: #1e5c45;
  background: #1e5c45;
  color: #fff;
}
.wizard-steps li.is-clickable .wizard-step-btn {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: center;
}
.wizard-steps li.is-clickable .wizard-step-btn:hover .wizard-step-num,
.wizard-steps li.is-clickable .wizard-step-btn:focus-visible .wizard-step-num {
  transform: scale(1.06);
}
.wizard-steps li.is-clickable .wizard-step-btn:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 4px;
}
.edu-list {
  display: grid;
  gap: 0;
}
.edu-row {
  display: grid;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid rgba(11, 31, 56, 0.08);
}
.edu-row:first-child {
  border-top: 0;
  padding-top: 0;
}
.edu-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.edu-row-title {
  margin: 0;
  font-weight: 650;
  color: var(--navy);
}
.edu-remove {
  padding: 6px 12px;
  font-size: 0.86rem;
}
.edu-add-wrap {
  margin: 0;
}
.wizard-docs {
  display: grid;
  gap: 0;
}
.wizard-doc {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(11, 31, 56, 0.08);
}
.wizard-doc:last-child {
  border-bottom: 0;
}
.wizard-doc-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.wizard-doc-meta strong {
  color: var(--navy);
  font-size: 0.98rem;
  font-weight: 650;
}
.wizard-doc-status {
  color: var(--muted);
  font-size: 0.84rem;
}
.wizard-doc.is-ready .wizard-doc-status {
  color: #1e5c45;
  font-weight: 650;
}
.wizard-doc-action {
  flex: none;
}
.wizard-fee {
  display: grid;
  gap: 10px;
}
.wizard-fee-amount {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.2rem, 4vw, 2.8rem);
  font-weight: 560;
  letter-spacing: -0.03em;
  color: var(--navy);
  line-height: 1;
}
.wizard-fee p {
  margin: 0;
  max-width: 28rem;
  line-height: 1.45;
}
@media (max-width: 720px) {
  .wizard-sheet.apply-stage,
  .wizard-sheet {
    padding: 20px 16px 28px;
  }
  .wizard-pane {
    max-width: none;
  }
  .wizard-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 14px;
  }
  .wizard-steps li:nth-child(2n)::after {
    display: none;
  }
  .wizard-doc {
    flex-direction: column;
    align-items: flex-start;
  }
}
@media (prefers-reduced-motion: reduce) {
  .wizard-pane.is-in { animation: none; }
  .wizard-disclose > summary::before { transition: none; }
}

/* Card gateway ledger */
.gw-stats { margin-bottom: 4px; }
.gw-stats .portal-stat em { color: var(--muted); }
.gw-config { margin-top: 4px; }
.gw-config .sheet-head { margin-bottom: 10px; gap: 16px; }
.gw-config-line {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.gw-config-line code {
  font-size: 0.84em;
  background: #eef4f9;
  padding: 0.12em 0.4em;
  border-radius: 6px;
  word-break: break-all;
}
.gw-board {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 18px;
  align-items: start;
  margin-top: 4px;
}
.gw-list .desk-toolbar {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}
.gw-list #gw-search {
  width: 100%;
  min-height: 42px;
  border: 1px solid #c9d7e5;
  border-radius: 10px;
  padding: 0.55rem 0.8rem;
  font: inherit;
  background: #fff;
}
.gw-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.gw-chip {
  border: 1px solid #c9d7e5;
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.gw-chip.is-on {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.gw-rows {
  display: grid;
  gap: 10px;
  max-height: min(68vh, 720px);
  overflow: auto;
  padding: 2px 4px 8px 0;
}
.gw-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 12px;
  background: #f4f8fb;
  padding: 14px 16px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.gw-row:hover { border-color: #b7c9da; }
.gw-row.is-on {
  border-color: var(--navy);
  background: #e8f0f7;
}
.gw-row-main {
  display: grid;
  gap: 4px;
  min-width: 0;
  flex: 1;
}
.gw-row-main strong { font-size: 0.98rem; line-height: 1.35; }
.gw-row-main .muted {
  display: block;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.gw-row-side {
  display: grid;
  justify-items: end;
  align-content: start;
  gap: 8px;
  flex: none;
  padding-top: 1px;
}
.gw-detail h2 {
  margin: 0.15rem 0 0;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 560;
}
.gw-detail h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}
.gw-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  margin: 14px 0;
}
.gw-meta > div,
.gw-proof dl > div {
  display: grid;
  gap: 2px;
}
.gw-meta dt,
.gw-proof dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 700;
}
.gw-meta dd,
.gw-proof dd {
  margin: 0;
  word-break: break-word;
}
.gw-meta code,
.gw-proof dd {
  font-size: 0.88rem;
}
.gw-note {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f4f8fb;
}
.gw-proof {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid #d7e3ee;
}
.gw-proof dl {
  display: grid;
  gap: 8px;
  margin: 0;
  max-height: 240px;
  overflow: auto;
}
.gw-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.gw-empty {
  min-height: 220px;
  display: grid;
  place-items: center;
  text-align: center;
}
@media (max-width: 980px) {
  .gw-board { grid-template-columns: 1fr; }
  .gw-rows { max-height: none; }
}


