:root {
  --blue: #1080c4;
  --blue-dark: #0c679c;
  --green: #6EB09F;
  --green-ink: #2f6d5c;
  --ink: #1c1c1c;
  --muted: #5c6168;
  --gray: #808184;
  --line: #c5c9ce;
  --canvas: #e6e8eb;
  --red: #9d2424;
  --red-bg: #fdf6f6;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--canvas);
  color: var(--ink);
}

body {
  font-family: system-ui, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.35;
  -webkit-font-smoothing: auto;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: 16px;
}

button {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.desk {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  background: #eceeef;
  padding: 6px 12px;
  padding-top: calc(10px + env(safe-area-inset-top));
  padding-left: calc(16px + env(safe-area-inset-left));
  padding-right: calc(16px + env(safe-area-inset-right));
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.logo-chip { line-height: 0; flex: none; }

.logo-chip img {
  display: block;
  height: 40px;
  width: auto;
}

.brand-sub {
  font-size: 13px;
  color: var(--gray);
  white-space: nowrap;
}

.top-meta {
  text-align: right;
  font-size: 12px;
  color: var(--gray);
  line-height: 1.4;
  min-width: 120px;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
}

.steps {
  list-style: none;
  display: flex;
  gap: 0;
  margin: 0;
  padding: 0 4px;
  padding-left: calc(4px + env(safe-area-inset-left));
  padding-right: calc(4px + env(safe-area-inset-right));
  background: #f3f4f5;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}

.steps::-webkit-scrollbar { display: none; }

.steps li {
  flex: none;
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 12px 7px;
  margin-bottom: -1px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.steps li.on {
  color: var(--blue);
  font-weight: 600;
  border-bottom-color: var(--blue);
}

.steps li.done { color: var(--green-ink); }

main {
  flex: 1;
  width: 100%;
  padding: 12px 12px 16px;
  padding-left: calc(16px + env(safe-area-inset-left));
  padding-right: calc(16px + env(safe-area-inset-right));
}

.panel {
  width: 100%;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 12px 12px 10px;
}

h1 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 2px;
  letter-spacing: 0;
  line-height: 1.25;
}

h2 {
  font-size: 12px;
  font-weight: 600;
  margin: 18px 0 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gray);
}

.lead {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
}

.lbl {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin: 0 0 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gray);
}

.field { margin: 0 0 12px; }

.row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.row input { flex: 1; min-width: 0; }

.row .btn { flex: none; }

input[type="text"],
input[type="date"],
input[type="number"],
input[type="password"] {
  height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
}

input[type="password"] {
  display: block;
  width: 100%;
}

input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear,
input[type="password"]::-webkit-credentials-auto-fill-button {
  display: none !important;
  visibility: hidden;
  pointer-events: none;
}

input::placeholder { color: #a4a7ad; }

input:focus {
  outline: 2px solid var(--blue);
  outline-offset: 0;
  border-color: var(--blue);
}

input:disabled {
  background: var(--canvas);
  color: var(--muted);
}

.btn {
  min-height: 44px;
  padding: 7px 12px;
  border: 1px solid #b7bcc2;
  border-bottom-color: #8e949b;
  border-radius: 2px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}

.btn:hover:not(:disabled) { background: #f7f8f9; }

.btn:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

.btn.primary {
  background: var(--blue);
  color: #fff;
  border-color: #0c679c;
  border-bottom-color: #084e76;
}

.btn.primary:hover:not(:disabled) {
  background: var(--blue-dark);
  border-color: #0a5684;
  border-bottom-color: #063a58;
}

.btn.small {
  min-height: 44px;
  padding: 8px 12px;
  font-size: 15px;
}

.btn:disabled,
.btn.primary:disabled {
  color: #a0a3a8;
  background: #f3f4f5;
  border-color: #e4e6e8;
  cursor: default;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.actions.tight { margin-top: 8px; justify-content: flex-start; }

.hint {
  margin: 8px 0 0;
  color: var(--red);
  font-weight: 600;
  font-size: 14px;
}

.file-note {
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.file-note.ok { color: var(--green-ink); }

.status-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 14px 0 0;
  font-size: 14px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gray);
  flex: none;
  transform: translateY(-1px);
}

.status-word {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--ink);
}

.status-detail {
  color: var(--muted);
  font-size: 14px;
}

.pkg-select {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 12px 0 0;
  flex-wrap: nowrap;
}

.pkg-select-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.pkg-select label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
  min-height: 32px;
}

.pkg-select input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--blue);
}

.status-line.online .dot { background: var(--green); }
.status-line.online .status-word { color: var(--green-ink); }
.status-line.missing .dot { background: var(--red); }
.status-line.missing .status-word { color: var(--red); }

.choice-list { display: flex; flex-direction: column; gap: 8px; }

.choice, .confirm-line, .terms, .switch-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 2px;
}

.choice input, .confirm-line input, .terms input, .switch-row input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: none;
  accent-color: var(--blue);
}

.choice strong, .confirm-line strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
}

.choice small, .confirm-line small, .sheet small, .quiet {
  display: block;
  color: var(--gray);
  font-weight: 400;
  font-size: 13px;
  line-height: 1.4;
  margin-top: 2px;
}

.choice:has(input:checked) {
  border-color: var(--blue);
  background: #f7fafc;
}

.paper { background: transparent; }

.paper-head, .issued-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.paper-kicker {
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.paper-no {
  margin-top: 2px;
  font-size: 14px;
  color: var(--gray);
}

.seal, .stamp {
  flex: none;
  border: 1px solid var(--line);
  color: var(--blue);
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 8px;
  border-radius: 2px;
  font-size: 11px;
  line-height: 1.3;
}

.stamp { color: var(--green-ink); }

.url-block {
  margin-top: 14px;
  padding-top: 2px;
}

.url-label, .meta dt, .sheet caption {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gray);
}

.url-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}

.url-row code {
  flex: 1;
  min-width: 0;
  display: block;
  overflow-wrap: anywhere;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 8px 10px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink);
}

.meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 16px;
  margin: 16px 0 0;
}

.meta div { min-width: 0; }

.meta dd {
  margin: 2px 0 0;
  font-weight: 600;
  font-size: 15px;
}

.ask { margin-top: 16px; }

.ask-q {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 8px;
}

.ask-options {
  display: flex;
  gap: 8px;
}

.ask-options label {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fff;
  font-size: 15px;
}

.ask-options label:has(input:checked) { border-color: var(--blue); }

#senior-extra { margin-top: 10px; }

#senior-dob { max-width: 220px; }

.sheet {
  width: 100%;
  border-collapse: collapse;
  margin-top: 4px;
}

.sheet caption {
  text-align: left;
  padding: 14px 0 4px;
}

.sheet th, .sheet td {
  border-bottom: 1px solid var(--line);
  padding: 9px 0;
  vertical-align: top;
  text-align: left;
  font-weight: 500;
  font-size: 15px;
}

.sheet td {
  text-align: right;
  white-space: nowrap;
  width: 34%;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 15px;
}

.sheet .pct {
  display: block;
  margin-bottom: 1px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--gray);
}

.sheet .struck {
  text-decoration: line-through;
  color: var(--gray);
  font-weight: 500;
}

.sheet tr.off th, .sheet tr.off td { color: #8b8e93; }

.sheet tr.on td { color: var(--green-ink); }

.partner-box {
  margin-top: 12px;
  padding: 4px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fff;
}

.partner-box .confirm-line {
  border: 0;
  padding: 8px 0 4px;
}

.partner-box.bad {
  border-color: #e0b4b4;
  background: var(--red-bg);
}

.partner-state {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.member-list {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 2px;
  max-height: 220px;
  overflow: auto;
  background: #fff;
}

.member-hit {
  display: block;
  width: 100%;
  min-height: 44px;
  text-align: left;
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
}

.member-hit:last-child { border-bottom: 0; }

.member-hit.picked {
  color: var(--blue);
  font-weight: 700;
}

.picked {
  margin: 8px 0 0;
  font-size: 14px;
  font-weight: 600;
}

.miss-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--red);
  font-weight: 600;
  font-size: 14px;
}

.sheet tr.due th,
.sheet tr.due td {
  color: var(--blue);
  font-size: 18px;
  font-weight: 700;
  border-bottom: 0;
  padding-top: 12px;
}

.sheet tr.flash th,
.sheet tr.flash td { background: #f3f8fc; }

.switch-row {
  margin-top: 8px;
  font-size: 15px;
}

.switch-row span { padding-top: 1px; }

.dialog.settings-dialog {
  width: min(720px, 100%);
  max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

.settings-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.discount-scroll {
  --discount-cols: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) 76px;
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: auto;
  max-height: calc(100dvh - 280px);
  min-height: 120px;
  margin: 0 0 10px;
}

.discount-head,
.discount-row {
  display: grid;
  grid-template-columns: var(--discount-cols);
  gap: 6px;
  align-items: end;
}

.discount-head {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 6px 8px 4px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gray);
}

.discount-row {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}

.discount-row:last-child { border-bottom: 0; }

.discount-name { min-width: 0; }

.in-effect {
  margin: 0 0 2px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
}

.discount-scroll input[type="text"],
.discount-scroll input[type="date"],
.discount-scroll input[type="number"] {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 6px 8px;
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fff;
  color: var(--ink);
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 26, 34, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  padding-top: calc(16px + env(safe-area-inset-top));
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 20;
}

.dialog {
  width: min(440px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 2px;
  box-shadow: 0 2px 6px rgba(20, 24, 32, 0.16);
}

.dialog.tall {
  width: min(640px, 100%);
  max-height: calc(100dvh - 28px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

.dialog.tall .dialog-body { overflow: auto; }

.dialog-body { padding: 12px 12px 10px; }

.dialog-body h2 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}

#block-title { color: var(--red); }

.dialog-body p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 15px;
}

.loader-dialog {
  width: min(430px, 100%);
  overflow: hidden;
  border-color: #a9aeb4;
  box-shadow: 0 2px 6px rgba(20, 24, 32, 0.25);
}

.loader-strip {
  padding: 4px 10px;
  background: #cfd2d6;
  border-bottom: 1px solid #b4b8bd;
  color: #3e4246;
  font-size: 12px;
  font-weight: 600;
}

.loader-body { padding: 10px 12px 10px; }

.loader-title {
  font-size: 15px;
  font-weight: 400;
  color: var(--ink);
  margin: 0 0 6px;
}

.loader-step {
  font-size: 13px;
  color: var(--muted);
  min-height: 1.4em;
}

.loader-op {
  font-size: 12px;
  color: var(--gray);
  min-height: 1.4em;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar {
  height: 14px;
  background: #e9ebed;
  border: 1px solid #9ea3a9;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 0;
  background: #1080c4;
  transition: none !important;
  animation: none !important;
}

.loader-nums {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 12px;
  color: var(--gray);
  font-variant-numeric: tabular-nums;
}

.loader-sub {
  font-size: 12px;
  color: var(--gray);
  min-height: 1.4em;
  margin-top: 2px;
}

.loader-foot {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #e1e3e6;
  font-size: 12px;
  color: var(--muted);
}

.price-block {
  display: flex;
  gap: 28px;
  align-items: flex-end;
  margin: 10px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fafbfb;
}

.pb-lbl {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gray);
}

.pb-old {
  font-size: 16px;
  color: var(--gray);
  text-decoration: line-through;
  font-variant-numeric: tabular-nums;
}

.pb-off {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.pb-due, .pb-new {
  font-size: 22px;
  font-weight: 700;
  color: var(--blue);
  font-variant-numeric: tabular-nums;
}

.notice {
  margin: 10px 0 0;
  padding: 8px 10px;
  border: 1px solid #d9c27a;
  border-left-width: 3px;
  border-radius: 2px;
  background: #fdf8e6;
  color: #5b4a12 !important;
  font-size: 14px !important;
  font-weight: 600;
}

.head-prices {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.hp-old {
  font-size: 14px;
  color: var(--gray);
  text-decoration: line-through;
}

.hp-row {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 8px;
}

.hp-lbl {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gray);
}

.hp-val { font-size: 17px; font-weight: 700; }

.hp-row.due .hp-val { color: var(--blue); }

.dialog.red { border: 2px solid var(--red); }

.dialog.red .miss-list { margin-bottom: 12px; }

.top-meta {
  cursor: default;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.sheet tr.total th, .sheet tr.total td { font-weight: 700; }

.member-hit .mid {
  display: inline-block;
  min-width: 64px;
  color: var(--gray);
  font-variant-numeric: tabular-nums;
}

.member-list .empty { padding: 10px; margin: 0; }

.sign-cap {
  font-size: 12px;
  color: var(--gray);
  margin-top: 2px;
}

.opt-list { display: flex; flex-direction: column; gap: 6px; }

.opt-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  width: 100%;
  text-align: left;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fff;
  color: var(--ink);
}

.opt-row strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
}

.opt-row small {
  display: block;
  margin-top: 2px;
  color: var(--gray);
  font-size: 13px;
  font-weight: 400;
}

.opt-mark {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  border: 1px solid #b7bcc3;
  border-radius: 2px;
  flex: none;
  background: #fff center / 13px 13px no-repeat;
}

.opt-row[aria-pressed="true"] {
  border-color: var(--blue);
  background: #f7fafc;
}

.opt-row[aria-pressed="true"] .opt-mark {
  border-color: var(--green-ink);
  background-color: #f3faf7;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2.6 8.7c.5.6 1.6 2.5 2.5 3.4 1.1-2.3 3.1-5.8 7.8-7.6' fill='none' stroke='%232f6d5c' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E");
}

.opt-row { align-items: center; min-height: 56px; }

.opt-text { flex: 1; min-width: 0; }

.opt-mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border-color: #9ea3a9;
  background-size: 18px 18px;
  margin-top: 0;
}

.opt-tag {
  flex: none;
  visibility: hidden;
  padding: 2px 6px;
  border: 1px solid var(--green-ink);
  border-radius: 2px;
  color: var(--green-ink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.opt-row[aria-pressed="true"] .opt-tag { visibility: visible; }

.opt-list.bad .opt-row { border-color: #e0b4b4; }

.count {
  margin: 8px 0 0;
  font-weight: 600;
  font-size: 14px;
}

.pad-wrap {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 2px;
  touch-action: none;
  overflow: hidden;
}

.pad-wrap canvas {
  display: block;
  width: 100%;
  height: 140px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  background:
    linear-gradient(#fff, #fff 78%, #d5dde6 78%, #d5dde6 79%, #fff 79%);
}

.pad-wrap.bad { border-color: var(--red); }

.terms { margin-top: 12px; }

.terms.bad { border-color: #e0b4b4; background: var(--red-bg); }

.sign-copy {
  margin-top: 12px;
  max-width: 280px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
}

.sign-copy img { display: block; width: 100%; height: auto; }

.paper .fine {
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--gray);
}

.paper ul { margin: 8px 0 0; padding-left: 18px; }
.paper ul li { margin: 3px 0; }
.paper > p { color: var(--muted); font-size: 14px; }

.status {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px calc(12px + env(safe-area-inset-bottom));
  padding-left: calc(16px + env(safe-area-inset-left));
  padding-right: calc(16px + env(safe-area-inset-right));
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--gray);
}

@media (min-width: 768px) {
  .logo-chip img { height: 44px; }
  .steps li { font-size: 14px; }
  main { padding: 12px 16px 18px; }
  .panel { padding: 12px 14px 12px; }
}

@media (min-width: 1025px) {
  .panel { max-width: 760px; }
  .panel.wide { max-width: 880px; }
}

@media (max-width: 640px) {
  .steps li {
    flex: none;
    padding: 8px 10px 6px;
    font-size: 12px;
    justify-content: center;
  }
  .price-block {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .row, .actions, .url-row, .ask-options { flex-direction: column; }
  .actions { align-items: stretch; }
  .btn, .row .btn { width: 100%; }
  .meta { grid-template-columns: 1fr; }
  .logo-chip img { height: 34px; }
  .brand-sub { display: none; }
  h1 { font-size: 20px; }
  .paper-head { flex-direction: column; }
  .head-prices { text-align: left; }
  .hp-row { justify-content: flex-start; }
}

[hidden] { display: none !important; }

/* Collapsed price sheet: only MSRP and minimum project price until details are opened. */
.sheet.collapsed tr.detail { display: none; }
.details-toggle { margin-top: 8px; }
.sheet tr.subtotal th, .sheet tr.subtotal td { font-weight: 700; }
.status-chip {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border: 1px solid var(--green);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--green-ink);
  background: #f1f8f6;
  vertical-align: 1px;
}

.job-link {
  flex: 1;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  font-family: ui-monospace, Menlo, monospace;
  font-size: 14px;
  color: var(--blue);
  text-decoration: underline;
  overflow-wrap: anywhere;
}

.sheet tr.due small { display: block; font-weight: 500; }

.loan-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 2px solid var(--blue);
  background: #eef6fc;
}
.loan-lbl { font-weight: 700; font-size: 15px; color: var(--blue-dark); }
.loan-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.loan-pay { font-size: 26px; font-weight: 800; color: var(--blue); font-variant-numeric: tabular-nums; white-space: nowrap; }
.loan-per { font-size: 15px; font-weight: 600; margin-left: 2px; }

.partner-paths { margin: 6px 0 8px; gap: 8px; }
.apr-input { max-width: 140px; margin-bottom: 10px; }

.agreed-list li { margin-bottom: 8px; }
.agreed-detail { font-size: 13px; color: var(--muted); margin-top: 2px; }
.paper.pdf-mode { box-shadow: none; border: 0; }

@media print {
  .top, .steps, .status, .actions, #step-issued .actions { display: none !important; }
  .paper { box-shadow: none !important; border: 0 !important; }
}

/* Invoice step: monthly payment is the big number, minimum price beside it. */
.pb-pay {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--blue);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pb-per { font-size: 16px; font-weight: 600; margin-left: 2px; }
.pb-monthly {
  padding: 6px 12px;
  border: 2px solid var(--blue);
  background: #eef6fc;
}
.pb-link {
  margin-left: auto;
  align-self: center;
  font-weight: 600;
  color: var(--blue);
  white-space: nowrap;
}
@media (max-width: 640px) {
  .pb-link { margin-left: 0; }
}

.sheet tr.total th, .sheet tr.total td { font-size: 17px; }

/* Partnership items: square checkboxes (more than one can be chosen). */
.opt-mark {
  border-radius: 4px;
  border: 2px solid #9ea3a9;
}
.opt-row[aria-pressed="true"] .opt-mark {
  border-color: var(--blue);
  background-color: var(--blue);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.2 8.4l3 3 6.6-6.8' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.member-row { gap: 8px; }
.member-row input { max-width: 220px; }

/* Invoice step, simplified: struck MSRP, then monthly as the main number with the total under it. */
.price-block { align-items: center; gap: 36px; padding: 14px 16px; }
.pb-monthly { padding: 0; border: 0; background: none; }
.pb-pay { font-size: 34px; }
.pb-total {
  margin-top: 2px;
  font-size: 15px;
  font-weight: 600;
  color: var(--blue);
  font-variant-numeric: tabular-nums;
}

/* Monthly payment sits to the left of the minimum project price, same line. */
.due-mo {
  margin-right: 14px;
  padding-right: 14px;
  border-right: 1px solid var(--line);
  font-weight: 600;
  color: var(--blue);
}

.pb-old.plain { text-decoration: none; color: var(--ink); }

/* PDF copy: rendered off screen at a fixed width that fits a letter page. */
.pdf-holder {
  position: absolute;
  left: 0;
  top: 0;
  z-index: -1;
  background: #fff;
  color: var(--ink);
}
/* Narrower than the page's printable width, so a scrollbar can't clip the right edge. */
.pdf-holder .paper { width: 690px !important; max-width: 690px; padding: 0; margin: 0; }
.url-block > .job-link { display: inline-block; margin-top: 4px; }

.searching { display: flex; align-items: center; gap: 8px; }
.spin {
  width: 14px;
  height: 14px;
  border: 2px solid var(--line);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Sign-in screen shown before the app. */
body.locked .desk { display: none; }
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--canvas);
}
.login-screen[hidden] { display: none; }
.login-card {
  width: 100%;
  max-width: 360px;
  padding: 22px 20px 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 2px;
  display: flex;
  flex-direction: column;
}
.login-card h1 { margin: 14px 0 0; }
.login-card .lead { margin: 2px 0 10px; }
.login-card input { width: 100%; margin-bottom: 10px; }
.login-logo { align-self: flex-start; }
.login-logo img { height: 40px; width: auto; }
.login-btn { margin-top: 6px; width: 100%; }
