:root {
  --page: #f4f7fa;
  --surface: #ffffff;
  --surface-soft: #eef3f7;
  --ink: #102b3c;
  --ink-muted: #5f7381;
  --line: #dbe5eb;
  --line-strong: #c7d6df;
  --primary: #156f91;
  --primary-dark: #0e5672;
  --primary-soft: #e1f1f7;
  --success: #08765f;
  --success-soft: #ddf3ed;
  --warning: #9a6500;
  --warning-soft: #fff1ce;
  --danger: #b43b32;
  --danger-soft: #fce8e5;
  --shadow: 0 18px 54px rgba(31, 65, 86, 0.07);
  --shadow-panel: 0 22px 58px rgba(16, 43, 60, 0.085);
  --shadow-card: 0 8px 22px rgba(16, 43, 60, 0.055);
  --shadow-control: 0 3px 10px rgba(16, 43, 60, 0.06);
  --motion-ui: 180ms cubic-bezier(0.2, 0.75, 0.25, 1);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 11px;
  --font-display: "Aptos Display", "Segoe UI Variable Display", "Trebuchet MS", sans-serif;
  --font-body: "Aptos", "Segoe UI Variable Text", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-body);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(rgba(21, 111, 145, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 111, 145, 0.035) 1px, transparent 1px),
    var(--page);
  background-size: 36px 36px;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  transform: translateY(-180%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid #72c7e2;
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  min-height: 92px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.topbar-actions,
.account-actions,
.inline-actions,
.auth-secondary-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-actions {
  justify-content: flex-end;
}

.account-actions {
  color: var(--ink-muted);
  font-size: 13px;
}

.account-actions a,
.auth-secondary-actions a {
  font-weight: 700;
  text-decoration: none;
}

.account-actions a:hover,
.auth-secondary-actions a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.wordmark {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 760;
  letter-spacing: -0.035em;
  text-decoration: none;
}

.wordmark::after {
  position: absolute;
  top: 22px;
  left: 25px;
  width: 7px;
  height: 7px;
  border: 2px solid var(--page);
  border-radius: 50%;
  background: var(--primary);
  content: "";
  pointer-events: none;
}

.wordmark-mark {
  width: 32px;
  height: 32px;
  padding: 5px;
  border-radius: 8px;
  background: var(--ink);
  fill: none;
  stroke: var(--surface);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.25;
  box-shadow: 4px 4px 0 var(--primary-soft);
  transition: box-shadow var(--motion-ui), transform var(--motion-ui);
}

.wordmark:hover .wordmark-mark {
  box-shadow: 5px 5px 0 var(--primary-soft);
  transform: translate(-1px, -1px);
}

.service-pill {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border: 1px solid #b9e0d5;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 13px;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(8, 118, 95, 0.12);
}

.service-pill.is-loading {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--ink-muted);
}

.service-pill.is-error {
  border-color: #edbcb7;
  background: var(--danger-soft);
  color: var(--danger);
}

.intro {
  display: grid;
  align-items: end;
  padding: 76px 0 54px;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.75fr);
  gap: 72px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 12px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 42px;
  height: 8px;
  flex: 0 0 42px;
  background:
    linear-gradient(var(--primary), var(--primary)) left center / 11px 2px no-repeat,
    radial-gradient(circle, transparent 0 2px, var(--primary) 2.25px 3.25px, transparent 3.5px)
      11px center / 8px 8px no-repeat,
    repeating-linear-gradient(
        90deg,
        var(--primary-soft) 0 5px,
        transparent 5px 8px
      )
      right center / 22px 2px no-repeat;
  content: "";
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: var(--font-display);
  letter-spacing: -0.045em;
}

h1 {
  max-width: 740px;
  margin-bottom: 0;
  font-size: clamp(42px, 6vw, 76px);
  font-weight: 680;
  line-height: 0.98;
}

h2 {
  margin-bottom: 8px;
  font-size: clamp(27px, 3vw, 37px);
  font-weight: 680;
  line-height: 1.05;
}

.intro-copy {
  color: var(--ink-muted);
  font-size: 16px;
  line-height: 1.65;
}

.update-time {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 22px 0 0;
  font-size: 13px;
}

.update-indicator {
  width: 16px;
  height: 16px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

body.is-loaded .update-indicator {
  width: 7px;
  height: 7px;
  border: 0;
  background: var(--success);
  animation: none;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-panel);
}

.report-section {
  isolation: isolate;
  position: relative;
  overflow: hidden;
  padding: 38px;
}

.report-section::before {
  position: absolute;
  top: 0;
  left: 38px;
  width: 78px;
  height: 5px;
  border-radius: 0 0 4px 4px;
  background: var(--primary);
  content: "";
}

.report-section::after {
  position: absolute;
  top: 0;
  left: 116px;
  width: 78px;
  height: 5px;
  background: repeating-linear-gradient(
    90deg,
    var(--primary-soft) 0 6px,
    transparent 6px 10px
  );
  content: "";
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 26px;
}

.section-heading p:not(.eyebrow) {
  margin-bottom: 0;
  color: var(--ink-muted);
}

.month-control {
  display: grid;
  min-width: 292px;
  align-items: center;
  padding: 4px;
  grid-template-columns: 40px 1fr 40px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: var(--surface-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.month-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--primary);
  cursor: pointer;
  box-shadow: var(--shadow-control);
  transition:
    border-color var(--motion-ui),
    box-shadow var(--motion-ui),
    color var(--motion-ui),
    transform var(--motion-ui);
}

.month-button:hover:not(:disabled) {
  background: var(--primary-soft);
  border-color: #aad6e5;
  color: var(--primary-dark);
  transform: translateY(-1px);
}

.month-button:disabled {
  border-color: transparent;
  background: transparent;
  color: #aab9c2;
  cursor: not-allowed;
  box-shadow: none;
}

.month-button svg {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.month-label {
  margin: 0;
  text-align: center;
  font-size: 14px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.report-card {
  position: relative;
  display: flex;
  min-height: 138px;
  flex-direction: column;
  padding: 17px 54px 17px 17px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fbfdfe;
  color: var(--ink);
  box-shadow: var(--shadow-card);
  text-align: left;
  text-decoration: none;
  transition:
    border-color var(--motion-ui),
    box-shadow var(--motion-ui),
    transform var(--motion-ui);
}

.report-card::before {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 38px;
  border-left: 1px solid transparent;
  background: transparent;
  content: "";
  opacity: 0;
  pointer-events: none;
  transition:
    background-color var(--motion-ui),
    border-color var(--motion-ui),
    opacity var(--motion-ui);
}

.report-card::after {
  position: absolute;
  top: 50%;
  right: 13px;
  width: 9px;
  height: 11px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  background:
    linear-gradient(currentColor, currentColor) 2px 3px / 5px 1px no-repeat,
    linear-gradient(currentColor, currentColor) 2px 6px / 5px 1px no-repeat;
  color: var(--primary);
  content: "";
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
  transition:
    color var(--motion-ui),
    opacity var(--motion-ui),
    transform var(--motion-ui);
}

.report-card.is-available {
  border-color: #aad6e5;
  background: var(--surface);
  color: var(--primary-dark);
  cursor: pointer;
}

.report-card.is-available::before {
  border-left-color: #aad6e5;
  background-color: var(--primary-soft);
  background-image: repeating-linear-gradient(
    135deg,
    rgba(21, 111, 145, 0.06) 0 2px,
    transparent 2px 6px
  );
  opacity: 1;
}

.report-card.is-available::after {
  opacity: 1;
}

.report-card.is-available:hover:not(:disabled) {
  border-color: var(--primary);
  box-shadow: 0 11px 24px rgba(20, 96, 124, 0.12);
  transform: translateY(-2px);
}

.report-card.is-available:hover:not(:disabled)::before {
  border-left-color: var(--primary);
  background-color: var(--primary);
}

.report-card.is-available:hover:not(:disabled)::after {
  color: var(--surface);
  transform: translateY(-50%) scale(1.08);
}

.report-card:disabled {
  cursor: not-allowed;
}

.report-card.is-processing {
  border-color: #f0d28d;
  background: var(--warning-soft);
  box-shadow: none;
}

.report-card.is-loading {
  color: transparent;
  box-shadow: none;
}

.report-card.is-loading > * {
  border-radius: 5px;
  background: #e5edf2;
}

.report-card.is-loading .report-number::before {
  opacity: 0;
}

.report-card-month {
  grid-column: span 4;
  min-height: 98px;
  flex-direction: row;
  align-items: center;
  gap: 18px;
}

.report-number {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--primary);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

.report-number::before {
  width: 15px;
  height: 2px;
  flex: 0 0 15px;
  border-radius: 999px;
  background: var(--primary);
  content: "";
  transition: opacity var(--motion-ui);
}

.report-label {
  margin-top: 21px;
  font-size: 16px;
  font-weight: 740;
}

.report-card-month .report-label {
  margin: 0;
  font-size: 19px;
}

.report-action {
  margin-top: auto;
  color: var(--ink-muted);
  font-size: 12px;
}

.report-card.is-available .report-action {
  color: var(--primary-dark);
  font-weight: 750;
}

.report-card.is-downloading {
  cursor: wait;
  opacity: 0.72;
}

.report-card-month .report-action {
  margin: 0 0 0 auto;
}

.historical-sync {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 24px;
  align-items: center;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.historical-sync[hidden] {
  display: none;
}

.historical-sync strong {
  font-size: 14px;
}

.historical-sync p {
  margin: 4px 0 0;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.45;
}

.historical-sync-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.historical-sync select {
  min-height: 44px;
  padding: 9px 34px 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  box-shadow: var(--shadow-control);
  transition:
    border-color var(--motion-ui),
    box-shadow var(--motion-ui);
}

.historical-sync select:hover {
  border-color: var(--primary);
}

.historical-sync select:focus {
  box-shadow: 0 0 0 3px var(--primary-soft), var(--shadow-control);
}

.historical-sync .sync-button {
  min-height: 44px;
  white-space: nowrap;
}

.historical-sync-status {
  grid-column: 1 / -1;
  min-height: 18px;
}

.auth-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 20px 0 0;
  color: var(--ink-muted);
  font-size: 12px;
}

.auth-note svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.summary-section {
  padding: 78px 0 16px;
}

.total-block {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--ink-muted);
}

.total-block strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 46px;
  font-weight: 680;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.055em;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.metric-card {
  position: relative;
  min-height: 174px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-card);
}

.metric-card::after {
  position: absolute;
  right: -12px;
  bottom: -12px;
  width: 42px;
  height: 42px;
  border: 1px solid var(--primary-soft);
  border-radius: 50%;
  content: "";
}

.metric-icon {
  display: grid;
  width: 38px;
  height: 38px;
  margin-bottom: 25px;
  place-items: center;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  box-shadow:
    inset 0 0 0 1px rgba(21, 111, 145, 0.08),
    0 4px 12px rgba(16, 43, 60, 0.045);
}

.metric-icon svg {
  width: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.metric-card p {
  max-width: 170px;
  margin-bottom: 4px;
  color: var(--ink-muted);
  font-size: 13px;
}

.metric-card strong {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}

.empty-message {
  padding: 14px 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-muted);
}

.operations {
  display: grid;
  margin: 72px 0;
  padding: 36px 38px;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 60px;
}

.operation-list {
  position: relative;
  display: grid;
  gap: 0;
}

.operation-list::before {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 4px;
  width: 1px;
  background: var(--line);
  content: "";
}

.operation-item {
  position: relative;
  display: grid;
  padding: 16px 0;
  grid-template-columns: 12px 1fr;
  gap: 15px;
  border-bottom: 1px solid var(--line);
}

.operation-item:first-child {
  padding-top: 0;
}

.operation-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.operation-item strong {
  font-size: 13px;
}

.operation-item p {
  margin: 4px 0 0;
  color: var(--ink-muted);
  font-size: 13px;
}

.operation-icon {
  position: relative;
  z-index: 1;
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px var(--success-soft);
}

.operation-icon.is-neutral {
  background: #8da0ab;
  box-shadow: 0 0 0 4px #edf1f3;
}

.operation-icon.is-warning {
  background: var(--warning);
  box-shadow: 0 0 0 4px var(--warning-soft);
}

.operation-icon.is-error {
  background: var(--danger);
  box-shadow: 0 0 0 4px var(--danger-soft);
}

.notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding: 14px 17px;
  border: 1px solid #edbcb7;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: #812c26;
  font-size: 13px;
}

.notice[hidden] {
  display: none;
}

.notice strong,
.notice span {
  display: block;
}

.notice span {
  margin-top: 2px;
}

.text-button {
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid currentColor;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font-weight: 750;
  cursor: pointer;
  transition:
    background-color var(--motion-ui),
    color var(--motion-ui),
    transform var(--motion-ui);
}

.text-button:hover:not(:disabled) {
  background: var(--surface);
  transform: translateY(-1px);
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  padding: 28px 0 38px;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 12px;
}

footer p {
  margin: 0;
}

.noscript-message {
  position: fixed;
  right: 20px;
  bottom: 20px;
  left: 20px;
  z-index: 20;
  padding: 14px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  text-align: center;
}

.auth-shell {
  display: grid;
  width: min(100% - 32px, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 56px 0;
  place-items: center;
}

.auth-card {
  isolation: isolate;
  position: relative;
  width: 100%;
  padding: clamp(28px, 7vw, 48px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-panel);
}

.auth-card::before,
.admin-create::before {
  position: absolute;
  top: 0;
  left: clamp(28px, 7vw, 48px);
  width: 76px;
  height: 4px;
  border-radius: 0 0 4px 4px;
  background: var(--primary);
  content: "";
}

.auth-card::after,
.admin-create::after {
  position: absolute;
  top: 0;
  left: calc(clamp(28px, 7vw, 48px) + 76px);
  width: 70px;
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    var(--primary-soft) 0 6px,
    transparent 6px 10px
  );
  content: "";
}

.auth-heading {
  margin: 50px 0 28px;
}

.auth-heading h1 {
  max-width: 420px;
  margin: 8px 0 12px;
  font-size: clamp(34px, 8vw, 48px);
  line-height: 0.98;
}

.auth-heading > p:last-child {
  margin: 0;
  color: var(--ink-muted);
  line-height: 1.55;
}

.auth-card form,
.admin-form {
  display: grid;
  gap: 10px;
}

.auth-card label,
.admin-form label {
  margin-top: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
}

.auth-card input,
.admin-form input,
.admin-form select {
  width: 100%;
  min-height: 48px;
  padding: 10px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(16, 43, 60, 0.02);
  transition:
    border-color var(--motion-ui),
    box-shadow var(--motion-ui);
}

.auth-card input:hover,
.admin-form input:hover,
.admin-form select:hover {
  border-color: var(--primary);
}

.auth-card input:focus,
.admin-form input:focus,
.admin-form select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.primary-button {
  position: relative;
  min-height: 48px;
  padding: 11px 18px;
  overflow: hidden;
  border: 0;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 760;
  box-shadow: 0 8px 18px rgba(21, 111, 145, 0.16);
  transition:
    background-color var(--motion-ui),
    box-shadow var(--motion-ui),
    transform var(--motion-ui);
}

.primary-button::after {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 42px;
  background: repeating-linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.08) 0 2px,
    transparent 2px 6px
  );
  content: "";
  pointer-events: none;
}

.primary-button:hover:not(:disabled) {
  background: var(--primary-dark);
  box-shadow: 0 10px 22px rgba(21, 111, 145, 0.2);
  transform: translateY(-1px);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.6;
  box-shadow: none;
  transform: none;
}

.form-status {
  min-height: 24px;
  margin: 18px 0 0;
  color: var(--success);
  font-size: 13px;
  line-height: 1.45;
}

.form-status.is-error {
  color: var(--danger);
}

.auth-secondary-actions {
  justify-content: space-between;
  margin-top: 22px;
  font-size: 13px;
}

.admin-page {
  padding: 64px 0 96px;
}

.admin-page > .section-heading {
  margin-bottom: 34px;
}

.admin-page h1 {
  margin: 4px 0 10px;
}

.admin-create {
  isolation: isolate;
  position: relative;
  display: grid;
  margin-bottom: 58px;
  padding: 38px;
  overflow: hidden;
  grid-template-columns: minmax(220px, 0.75fr) minmax(280px, 1.25fr);
  gap: 42px;
}

.admin-create::before {
  left: 38px;
}

.admin-create::after {
  left: 114px;
}

.admin-create h2,
.temporary-secret h2 {
  margin: 6px 0 8px;
}

.temporary-secret {
  display: grid;
  margin-bottom: 58px;
  padding: 28px 30px;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
  border-color: #f0d28d;
  background: var(--warning-soft);
  box-shadow: var(--shadow-card);
}

.temporary-secret[hidden] {
  display: none;
}

.temporary-secret code {
  padding: 14px 18px;
  border: 1px solid #e6c36e;
  border-radius: 10px;
  background: #fffaf0;
  font-size: 15px;
  overflow-wrap: anywhere;
  user-select: all;
}

.temporary-secret .inline-actions {
  grid-column: 1 / -1;
}

.user-list {
  display: grid;
  gap: 12px;
}

.user-card {
  display: grid;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  grid-template-columns: minmax(180px, 1fr) minmax(170px, 0.7fr) auto;
  align-items: center;
  gap: 20px;
}

.user-card strong,
.user-card p {
  margin: 0;
}

.user-card p,
.user-state small {
  margin-top: 5px;
  color: var(--ink-muted);
  font-size: 12px;
}

.user-state {
  display: grid;
  justify-items: start;
  gap: 3px;
}

.state-badge {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.035em;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 1px rgba(95, 115, 129, 0.08);
}

.state-badge.is-active {
  background: var(--success-soft);
  color: var(--success);
}

.text-button.is-danger {
  color: var(--danger);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 820px) {
  .intro {
    padding: 58px 0 42px;
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .intro-copy {
    max-width: 600px;
  }

  .section-heading,
  .operations {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .report-heading {
    display: grid;
  }

  .month-control {
    min-width: 0;
  }

  .operations {
    gap: 30px;
  }

  .operation-list::before {
    display: none;
  }

  .historical-sync {
    grid-template-columns: 1fr;
  }

  .historical-sync-status {
    grid-column: auto;
  }

  .topbar {
    display: grid;
    min-height: 74px;
    align-items: center;
    padding: 18px 0;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px 12px;
  }

  .topbar-actions {
    display: contents;
  }

  .service-pill {
    grid-row: 1;
    grid-column: 2;
  }

  .account-actions {
    display: grid;
    width: 100%;
    padding-top: 12px;
    align-items: center;
    grid-row: 2;
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    gap: 8px;
    border-top: 1px solid var(--line);
    font-size: 12px;
  }

  .account-actions #current-user {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .admin-create,
  .temporary-secret,
  .user-card {
    grid-template-columns: 1fr;
  }

  .user-card .inline-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 24px, 1180px);
  }

  .service-pill {
    max-width: 162px;
    font-size: 11px;
  }

  .account-actions {
    font-size: 11px;
  }

  .account-actions .text-button {
    min-height: 40px;
    padding: 0 10px;
  }

  .intro {
    padding: 42px 0 36px;
    gap: 20px;
  }

  h1 {
    font-size: clamp(36px, 10vw, 44px);
  }

  .report-section,
  .operations {
    padding: 24px 18px;
    border-radius: 18px;
  }

  .report-section::before {
    left: 18px;
    width: 66px;
  }

  .report-section::after {
    left: 84px;
    width: 64px;
  }

  .report-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-card-month {
    grid-column: span 2;
  }

  .historical-sync-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .historical-sync select,
  .historical-sync .sync-button {
    width: 100%;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-card {
    min-height: 152px;
    padding: 16px;
  }

  .metric-icon {
    margin-bottom: 18px;
  }

  .summary-section {
    padding-top: 58px;
  }

  .admin-create,
  .temporary-secret {
    padding: 24px 18px;
  }

  .admin-create::before {
    left: 18px;
    width: 66px;
  }

  .admin-create::after {
    left: 84px;
    width: 64px;
  }

  .summary-section .section-heading {
    align-items: end;
  }

  footer {
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 390px) {
  .wordmark span {
    max-width: 80px;
    line-height: 1;
  }

  .report-card {
    min-height: 132px;
  }

  .report-card-month {
    align-items: flex-start;
    flex-direction: column;
  }

  .report-card-month .report-action {
    margin: auto 0 0;
  }
}

@media (max-width: 360px) {
  .report-grid {
    grid-template-columns: 1fr;
  }

  .report-card-month {
    grid-column: span 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
