:root {
  --navy: #071b63;
  --ink: #10204f;
  --blue: #123ea3;
  --yellow: #ffc51b;
  --red: #c61b36;
  --paper: #fff;
  --line: #dce2ef;
  --muted: #59647c;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: #f5f3ed;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 12px 18px;
  font-weight: 700;
  line-height: 1.4;
  white-space: normal;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
a {
  color: var(--blue);
  overflow-wrap: anywhere;
}
input,
select,
textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  border: 1px solid #aeb9d0;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
}
textarea {
  resize: vertical;
}
label {
  display: grid;
  gap: 8px;
  font-size: 15px;
  font-weight: 650;
  margin: 18px 0;
}
label .muted {
  display: contents;
}
h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}
h1 {
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1.15;
  letter-spacing: -0.035em;
  margin: 10px 0 16px;
}
h2 {
  font-size: 24px;
  margin: 8px 0 18px;
  letter-spacing: -0.025em;
}
h3 {
  margin: 5px 0;
}
p {
  line-height: 1.65;
}
.muted {
  color: var(--muted);
  font-weight: 400;
}
.primary {
  background: var(--navy);
  color: white;
}
.primary:hover {
  background: var(--blue);
}
.secondary {
  color: var(--navy);
  background: #fff;
  border-color: #b8c3db;
}
.danger {
  background: #fff1f3;
  color: #a4142d;
  border-color: #ebbec6;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
.portal-header {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  background: var(--navy);
  color: #fff;
  padding: 20px max(20px, calc((100vw - 960px) / 2));
  border-bottom: 5px solid var(--yellow);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
  font-size: 15px;
  font-weight: 750;
}
.brand strong {
  display: block;
  color: var(--yellow);
  letter-spacing: 0.2em;
  font-size: 12px;
  margin-top: 4px;
}
.header-label {
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-align: right;
}
.portal-main {
  width: min(960px, 100%);
  padding: 32px 20px 60px;
  margin: auto;
}
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: clamp(20px, 4vw, 32px);
  margin-bottom: 24px;
  box-shadow: 0 8px 25px #071b6307;
}
.login-panel {
  max-width: 480px;
  margin: 36px auto;
}
.login-panel form button {
  width: 100%;
  margin: 10px 0;
}
.eyebrow {
  color: var(--blue);
  font-size: 11px;
  letter-spacing: 0.16em;
  font-weight: 800;
  margin: 0 0 12px;
}
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-weight: 500;
  line-height: 1.6;
}
.check-row input {
  width: 22px;
  height: 22px;
  min-height: 22px;
  flex: 0 0 22px;
  margin-top: 2px;
  accent-color: var(--navy);
}
.workspace-heading,
.split-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.workspace-heading p {
  margin: 6px 0 14px;
}
.portal-nav,
.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 20px 0;
}
.portal-nav > * {
  flex: 1;
}
.portal-nav {
  margin-bottom: 28px;
}
.actions > * {
  max-width: 100%;
}
fieldset {
  border: 0;
  margin: 28px 0;
  padding: 0;
  min-width: 0;
}
legend {
  font-weight: 750;
  margin-bottom: 12px;
}
.charge-item {
  padding: 16px;
  background: #f4f6fb;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 14px;
}
.charge-item label {
  margin: 0 0 14px;
}
.charge-numbers {
  display: grid;
  grid-template-columns: 85px minmax(0, 1fr);
  gap: 12px;
}
.charge-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.charge-bottom button {
  min-height: 40px;
  padding: 8px 12px;
}
.total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 22px 0;
  border-block: 2px solid var(--navy);
  font-weight: 750;
}
.total-row output {
  font-size: clamp(23px, 5vw, 34px);
  overflow-wrap: anywhere;
  text-align: right;
}
.receipt-list {
  display: grid;
  gap: 12px;
}
.list-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.list-entry div {
  min-width: 0;
}
.list-entry p {
  margin: 5px 0;
  font-size: 14px;
  color: var(--muted);
}
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 5px;
  background: #edf2ff;
  color: var(--navy);
  font-size: 12px;
  font-weight: 750;
}
.badge-VOID {
  background: #fff0f2;
  color: #a4142d;
}
.status-message {
  background: #fff4cc;
  color: #553f00;
  border: 1px solid #dfbd43;
  border-radius: 10px;
  padding: 16px;
  white-space: pre-wrap;
}
.portal-footer {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  padding: 20px;
}
dialog {
  width: min(520px, calc(100% - 32px));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  color: var(--ink);
}
dialog::backdrop {
  background: #04134499;
}
.receipt-paper {
  max-width: 740px;
  margin: 0 auto 24px;
  background: #fff;
  border: 1px solid #d8dce7;
  padding: clamp(18px, 4vw, 44px);
  color: #142142;
  overflow-wrap: anywhere;
}
.receipt-top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 3px solid var(--navy);
  padding-bottom: 24px;
  margin-bottom: 24px;
}
.receipt-top h2 {
  font-size: 22px;
  margin: 0 0 8px;
}
.receipt-brand {
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}
.receipt-brand-name { color: #d71920; }
.receipt-brand-domain { color: #111; }
.receipt-top p {
  font-size: 14px;
  margin: 3px 0;
  white-space: pre-wrap;
}
.receipt-heading {
  text-align: right;
  flex: 0 0 auto;
}
.receipt-heading strong {
  font-size: 27px;
  letter-spacing: 0.06em;
  color: var(--navy);
}
.receipt-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 24px 0;
}
.receipt-meta span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}
.receipt-meta strong {
  font-size: 14px;
}
.receipt-charges {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 14px;
}
.receipt-charges th {
  background: #edf1fa;
  font-size: 12px;
  text-align: left;
}
.receipt-charges th,
.receipt-charges td {
  padding: 13px 6px;
  border-bottom: 1px solid #e1e5ee;
  vertical-align: top;
  overflow-wrap: anywhere;
}
.receipt-charges th:first-child {
  width: 40%;
}
.receipt-charges th:nth-child(2) {
  width: 15%;
  white-space: nowrap;
}
.receipt-charges th:nth-child(3) {
  width: 22%;
}
.receipt-charges td:not(:first-child),
.receipt-charges th:not(:first-child) {
  text-align: right;
}
.receipt-sum {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 6px;
  font-weight: 800;
  border-bottom: 2px solid var(--navy);
}
.receipt-sum strong {
  font-size: 23px;
}
.receipt-note {
  white-space: pre-wrap;
  font-size: 14px;
}
.receipt-footer {
  margin-top: 35px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}
.void-banner {
  background: #fff0f2;
  color: #96112b;
  padding: 14px;
  font-weight: 700;
  margin-bottom: 20px;
}
.draft-banner {
  background: #fff6d4;
  color: #624600;
  padding: 14px;
  margin-bottom: 20px;
}
@media (min-width: 700px) {
  .charge-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.65fr);
    gap: 12px;
  }
  .charge-bottom {
    grid-column: 1/-1;
  }
  .portal-main:has(.login-panel:not([hidden])) {
    padding-top: 48px;
  }
}
@media (max-width: 480px) {
  .portal-header {
    padding: 16px;
  }
  .header-label {
    font-size: 9px;
    max-width: 90px;
  }
  .portal-main {
    padding: 24px 14px 40px;
  }
  .receipt-top {
    display: block;
  }
  .receipt-heading {
    text-align: left;
    margin-top: 20px;
  }
  .receipt-meta {
    grid-template-columns: 1fr;
  }
  .actions button {
    flex: 1 1 140px;
  }
  .receipt-charges {
    font-size: 12px;
  }
  .receipt-charges th,
  .receipt-charges td {
    padding: 12px 3px;
  }
  .receipt-sum strong {
    font-size: 20px;
  }
  .workspace-heading {
    align-items: flex-start;
  }
  .list-entry {
    align-items: flex-start;
  }
  .list-entry button {
    padding-inline: 12px;
  }
}
@media print {
  @page {
    size: A4;
    margin: 14mm;
  }
  html,
  body {
    background: #fff !important;
    color: #000;
  }
  body > * {
    display: none !important;
  }
  body > .portal-main {
    display: block !important;
    width: 100%;
    padding: 0;
    margin: 0;
  }
  .portal-main > * {
    display: none !important;
  }
  #workspace,
  #detail-panel,
  #shared-paper {
    display: block !important;
  }
  #workspace > * {
    display: none !important;
  }
  #workspace > #detail-panel {
    display: block !important;
  }
  #detail-panel > * {
    display: none !important;
  }
  #detail-panel > #detail-paper {
    display: block !important;
  }
  .receipt-paper {
    border: 0;
    box-shadow: none;
    padding: 0;
    max-width: none;
    margin: 0;
  }
  .receipt-top {
    display: flex;
  }
  .receipt-meta {
    grid-template-columns: 1fr 1fr;
  }
  .receipt-charges {
    font-size: 12px;
  }
  thead {
    display: table-header-group;
  }
  tr,
  .receipt-sum {
    break-inside: avoid;
  }
  .no-print {
    display: none !important;
  }
  .receipt-heading {
    text-align: right;
    margin: 0;
  }
}
:root .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 480px) {
  .receipt-charges th:first-child {
    width: 40%;
  }
  .receipt-charges th:nth-child(2) {
    width: 17%;
    font-size: 10px;
    white-space: nowrap;
  }
  .receipt-charges th:nth-child(3) {
    width: 21%;
  }
}
