html { min-height: 100%; color-scheme: dark; }
body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 10%, #ff5a2a18 0, transparent 30rem),
    linear-gradient(145deg, #0c0c0a, var(--paper) 58%, #1a1711);
}
.portal-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}
.portal-card {
  width: min(100%, 440px);
  padding: 36px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--orange);
  border-radius: var(--r-lg);
  background: #14130ff2;
  box-shadow: 0 26px 80px #0009;
}
.portal-header { display: grid; gap: 10px; margin-bottom: 28px; }
.portal-header h1 {
  max-width: 12ch;
  font-family: var(--font-display);
  font-size: clamp(32px, 8vw, 48px);
  line-height: .98;
  letter-spacing: -.035em;
}
.portal-intro, .portal-footnote, .portal-seam p { color: var(--muted); }
.portal-form { display: grid; gap: 10px; }
.portal-form label {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.portal-form input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper-2);
  color: var(--ink);
  font: inherit;
}
.portal-form input:focus-visible, button:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
}
.portal-link:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
}
button {
  min-height: 48px;
  margin-top: 14px;
  padding: 11px 20px;
  border: 1px solid var(--orange);
  border-radius: var(--r-pill);
  background: var(--orange);
  color: #0e0e0c;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
}
button:hover { filter: brightness(1.08); }
button:disabled { cursor: wait; opacity: .72; }
.portal-secondary { background: transparent; color: var(--ink); }
.portal-status {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-left: 3px solid var(--orange);
  background: var(--orange-soft);
}
.portal-footnote { margin-top: 22px; font-size: 12px; }
.portal-client { color: var(--orange); font-family: var(--font-mono); }
.portal-seam {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 12px;
  margin: 8px 0 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper-2);
}
.portal-seam-mark {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 5px #5fc7771f;
}
.portal-actions { margin-top: 22px; }
.portal-progress {
  min-height: 20px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
}
.portal-progress:empty { display: none; }
.is-busy::before {
  content: "";
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: portal-spin .7s linear infinite;
}
@keyframes portal-spin { to { transform: rotate(360deg); } }

.report-shell { min-height: 100vh; padding: 28px 16px; }
.report-card {
  width: min(100%, 960px);
  margin: 0 auto;
  padding: 32px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--orange);
  border-radius: var(--r-lg);
  background: #14130ff2;
  box-shadow: 0 26px 80px #0009;
}
.report-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 22px;
  align-items: end;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.report-header h1 {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: clamp(30px, 6vw, 46px);
  line-height: 1;
  letter-spacing: -.035em;
}
.report-meta, .report-period, .report-empty {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
}
.report-meta { margin-top: 9px; }
.report-period { color: var(--orange); font-weight: 700; }
.section-title {
  margin: 28px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px dotted var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.report-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.report-metrics > div {
  min-height: 98px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper-2);
}
.report-metrics dt, .report-metrics small {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.report-metrics dd {
  margin: 8px 0 2px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
}
.no-usage {
  margin-top: 22px;
  padding: 16px;
  border-left: 3px solid var(--good);
  background: #5fc77712;
}
.no-usage h2 { font-size: 16px; }
.no-usage p { margin-top: 4px; color: var(--muted); }
.report-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.report-table-wrap::-webkit-scrollbar { display: none; }
.report-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.report-table th, .report-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}
.report-table th:first-child, .report-table td:first-child { text-align: left; }
.report-table thead th {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.actions {
  width: min(100% - 32px, 960px);
  margin: 18px auto 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}
.actions form { display: contents; }
.actions button { margin-top: 0; }
.actions .portal-progress { flex-basis: 100%; text-align: right; }
.portal-link {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid var(--orange);
  border-radius: var(--r-pill);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-decoration: none;
  text-transform: uppercase;
}
.portal-primary { background: var(--orange); color: #0e0e0c; }
@media (max-width: 520px) {
  .portal-card { padding: 28px 22px; }
  .report-card { padding: 24px 18px; }
  .report-header { grid-template-columns: 1fr; }
  .report-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .actions { justify-content: stretch; }
  .actions > * { flex: 1 1 auto; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .is-busy::before { animation: none; }
}
@media print {
  body { background: var(--paper); }
  .report-shell { padding: 0; }
  .report-card { width: 100%; box-shadow: none; }
  .actions { display: none; }
}
