* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgb(255 255 255 / 0.42) 1px, transparent 1px) 0 0 / 72px 72px,
    linear-gradient(rgb(255 255 255 / 0.42) 1px, transparent 1px) 0 0 / 72px 72px,
    var(--paper);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button {
  border: 0;
}

a {
  color: inherit;
}

img,
svg {
  display: block;
  max-width: 100%;
}

.ui-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  overflow: visible;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid rgb(63 95 155 / 0.38);
  outline-offset: 3px;
}

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

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

.app-shell {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  min-height: 100vh;
}

.side-rail {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 25px 18px 22px;
  border-right: 1px solid rgb(205 214 225 / 0.78);
  background: rgb(238 243 246 / 0.91);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 4px 6px;
  text-decoration: none;
}

.brand img {
  flex: 0 0 42px;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  font-family: var(--font-display);
  font-size: 19px;
  letter-spacing: 0.08em;
}

.brand-copy small {
  color: var(--ink-faint);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.desktop-nav {
  display: grid;
  gap: 6px;
  margin-top: 44px;
}

.nav-item {
  position: relative;
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 0 13px;
  border-radius: 10px;
  color: var(--ink-soft);
  background: transparent;
  text-align: left;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.nav-item:hover {
  color: var(--ink);
  background: rgb(255 255 255 / 0.72);
}

.nav-item.is-active {
  color: var(--ink);
  background: var(--cabin);
  box-shadow: 0 5px 18px rgb(23 34 53 / 0.06);
}

.nav-item.is-active::before {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: -18px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--mars);
  content: "";
}

.nav-glyph {
  width: 21px;
  height: 21px;
}

.local-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: auto;
  padding: 14px 10px;
  border-top: 1px solid var(--dust);
  color: var(--ink-soft);
}

.local-note > span:last-child {
  display: grid;
  gap: 3px;
}

.local-note strong {
  color: var(--ink);
  font-size: 12px;
}

.local-note small {
  font-size: 10px;
  line-height: 1.45;
}

.status-dot {
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgb(38 112 93 / 0.11);
}

.workspace {
  min-width: 0;
  padding: 0 clamp(20px, 4vw, 64px) 64px;
}

.mobile-brand-row {
  display: none;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  min-height: 108px;
  padding: 18px 0;
  background: linear-gradient(var(--paper) 78%, rgb(238 243 246 / 0));
}

.topbar-title {
  min-width: 0;
}

.topbar-title p,
.eyebrow {
  margin: 0 0 6px;
  color: var(--orbit);
  font-family: var(--font-data);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.topbar-title h1 {
  margin: 0;
  overflow: hidden;
  font-family: var(--font-display);
  font-size: clamp(22px, 2.5vw, 34px);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-entry,
.mobile-account-entry,
.private-access-badge {
  display: flex;
  align-items: center;
  min-height: var(--tap-min);
  border: 1px solid var(--dust);
  color: var(--ink);
  background: var(--cabin);
  text-decoration: none;
}

.account-entry {
  gap: 9px;
  padding: 4px 10px 4px 4px;
  border-radius: 22px;
  box-shadow: 0 5px 16px rgb(44 63 87 / 0.06);
}

.account-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--orbit-night);
  font-weight: 750;
}

.account-entry-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.account-entry-copy strong,
.account-entry-copy small {
  max-width: 116px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-entry-copy strong {
  font-size: 12px;
}

.account-entry-copy small {
  color: var(--ink-faint);
  font-size: 9px;
}

.account-entry > .ui-icon,
.mobile-account-entry > .ui-icon {
  width: 14px;
  height: 14px;
  flex-basis: 14px;
  color: var(--ink-faint);
}

.mobile-wordmark {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  text-decoration: none;
}

.mobile-wordmark span {
  display: grid;
  gap: 1px;
}

.mobile-wordmark strong {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.06em;
}

.mobile-wordmark small {
  color: var(--ink-faint);
  font-family: var(--font-data);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.mobile-account-entry {
  gap: 2px;
  padding: 3px 7px 3px 3px;
  border-radius: 22px;
  box-shadow: 0 5px 16px rgb(44 63 87 / 0.06);
}

.private-access-badge {
  gap: 5px;
  padding: 0 10px;
  border-radius: 22px;
  color: var(--status-positive);
  font-size: 10px;
  font-weight: 700;
}

.private-access-badge .ui-icon {
  width: 16px;
  height: 16px;
  flex-basis: 16px;
}

.compact-field {
  display: grid;
  gap: 2px;
  min-width: 112px;
  padding: 6px 12px;
  border: 1px solid var(--dust);
  border-radius: 10px;
  background: rgb(255 255 255 / 0.78);
}

.compact-field span {
  color: var(--ink-faint);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.compact-field select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 24px;
  padding: 0 22px 0 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 650;
}

.primary-button,
.secondary-button,
.danger-button,
.ghost-button,
.text-button {
  min-height: 44px;
  padding: 0 17px;
  border-radius: 9px;
  font-weight: 650;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.primary-button {
  color: white;
  background: var(--mars);
  box-shadow: 0 8px 18px rgb(201 72 58 / 0.19);
}

.primary-button:hover {
  background: var(--mars-dark);
  box-shadow: 0 10px 24px rgb(201 72 58 / 0.25);
  transform: translateY(-1px);
}

.primary-button:disabled,
.secondary-button:disabled,
.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.secondary-button {
  border: 1px solid var(--dust);
  background: var(--cabin);
}

.secondary-button:hover,
.ghost-button:hover {
  background: var(--paper);
}

.danger-button {
  color: white;
  background: var(--danger);
}

.ghost-button {
  border: 1px solid transparent;
  color: var(--ink-soft);
  background: transparent;
}

.text-button {
  min-height: 36px;
  padding: 0 8px;
  color: var(--orbit);
  background: transparent;
}

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

.record-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 52px;
  padding-inline: 20px;
}

.record-button .ui-icon {
  width: 20px;
  height: 20px;
}

.app-view {
  max-width: 1420px;
  margin: 0 auto;
  animation: view-in var(--motion-fast) var(--ease-out) both;
}

.app-status:empty {
  display: none;
}

.loading-panel,
.error-panel,
.runtime-loading {
  display: grid;
  place-items: center;
  min-height: 420px;
  padding: 40px 20px;
  text-align: center;
}

.loading-panel p,
.error-panel p,
.runtime-loading p {
  max-width: 430px;
  color: var(--ink-soft);
  line-height: 1.7;
}

.runtime-loading p {
  margin: 18px 0 3px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
}

.runtime-loading small {
  max-width: 360px;
  color: var(--ink-faint);
  font-size: 11px;
  line-height: 1.65;
}

.runtime-error .primary-button {
  margin-top: 4px;
}

.runtime-error:focus-within {
  scroll-margin-top: 120px;
}

.orbit-loader {
  width: 54px;
  height: 54px;
  border: 1px solid var(--dust);
  border-radius: 50%;
  animation: orbit-spin 1.8s linear infinite;
}

.orbit-loader::after {
  display: block;
  width: 10px;
  height: 10px;
  margin: -5px auto 0;
  border-radius: 50%;
  background: var(--mars);
  content: "";
}

html[data-runtime-state="loading"] .app-view,
html[data-runtime-state="error"] .app-view {
  display: none;
}

@media (max-width: 680px) {
  .runtime-loading,
  .loading-panel,
  .error-panel {
    min-height: min(430px, calc(100dvh - 250px));
    padding: 34px 14px;
  }
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.panel,
.section-card {
  border: 1px solid var(--dust-light);
  border-radius: var(--radius-md);
  background: var(--cabin);
  box-shadow: var(--shadow-low);
}

.orbit-card {
  position: relative;
  min-height: 310px;
  overflow: hidden;
  border-radius: 26px 26px 26px 8px;
  color: white;
  background:
    radial-gradient(circle at 65% 30%, rgb(63 95 155 / 0.28), transparent 38%),
    linear-gradient(145deg, #1c2a41, #111a2a 72%);
  box-shadow: 0 22px 54px rgb(23 34 53 / 0.18);
}

.orbit-card::before {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 12% 24%, rgb(255 255 255 / 0.32) 0 1px, transparent 1.4px),
    radial-gradient(circle at 83% 17%, rgb(255 255 255 / 0.24) 0 1px, transparent 1.4px),
    radial-gradient(circle at 68% 78%, rgb(255 255 255 / 0.24) 0 1px, transparent 1.4px),
    radial-gradient(circle at 25% 84%, rgb(255 255 255 / 0.2) 0 1px, transparent 1.4px);
  background-size: 87px 71px, 119px 93px, 103px 83px, 127px 109px;
  content: "";
  opacity: 0.55;
}

.orbit-card::after {
  position: absolute;
  top: -55px;
  right: -42px;
  width: 190px;
  height: 190px;
  border: 1px solid rgb(255 255 255 / 0.06);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgb(255 255 255 / 0.025), 0 0 0 58px rgb(255 255 255 / 0.018);
  content: "";
}

.orbit-card-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(220px, 0.9fr);
  align-items: center;
  min-height: 238px;
  padding: 22px 28px 16px;
}

.orbit-copy {
  min-width: 0;
}

.orbit-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #aebbd0;
  font: 10px/1.3 var(--font-data);
  letter-spacing: 0.06em;
}

.signal-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--signal-teal);
  box-shadow: 0 0 0 4px rgb(47 143 131 / 0.15);
}

.orbit-verdict {
  margin: 24px 0 5px;
  color: #d7e0eb;
  font-size: 16px;
}

.orbit-net {
  margin: 0;
  color: white;
  font: 720 clamp(38px, 6vw, 64px)/1 var(--font-data);
  letter-spacing: -0.06em;
}

.orbit-card .orbit-net.positive-text {
  color: #ef8277;
}

.orbit-card .orbit-net.negative-text {
  color: #9eb4e3;
}

.orbit-card .orbit-net.neutral-text {
  color: white;
}

.orbit-unit {
  margin: 9px 0 0;
  color: #9eacc0;
  font-size: 12px;
  letter-spacing: 0.13em;
}

.orbit-visual {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 0;
}

.orbit-visual svg {
  width: min(100%, 220px);
  height: auto;
  overflow: visible;
}

.orbit-ring {
  fill: none;
  stroke: rgb(255 255 255 / 0.11);
  stroke-width: 1;
}

.orbit-zero {
  fill: none;
  stroke: rgb(255 255 255 / 0.33);
  stroke-dasharray: 4 5;
  stroke-width: 1;
}

.orbit-spoke {
  stroke: rgb(255 255 255 / 0.09);
  stroke-width: 1;
}

.orbit-area {
  fill: rgb(201 72 58 / 0.16);
  stroke: #df6a5e;
  stroke-linejoin: round;
  stroke-width: 2;
}

.orbit-node-positive {
  fill: #ef8277;
}

.orbit-node-negative {
  fill: #8aa7df;
}

.orbit-node {
  transform-box: fill-box;
  transform-origin: center;
  animation: orbit-node-in 180ms var(--ease-out) both;
  animation-delay: calc(var(--orbit-index) * 45ms);
  stroke: #172238;
  stroke-width: 1.5;
}

.orbit-month {
  fill: rgb(255 255 255 / 0.52);
  font-family: var(--font-data);
  font-size: 9px;
  text-anchor: middle;
}

.orbit-center-label {
  fill: #8798af;
  font-family: var(--font-body);
  font-size: 7px;
  letter-spacing: 0.06em;
  text-anchor: middle;
}

.orbit-center-value {
  fill: #e4ebf4;
  font-family: var(--font-data);
  font-size: 10px;
  font-weight: 600;
  text-anchor: middle;
}

.orbit-receipt {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 14px 28px 17px;
  border-top: 1px dashed rgb(255 255 255 / 0.16);
  background: rgb(255 255 255 / 0.025);
}

.orbit-receipt div + div {
  padding-left: 18px;
  border-left: 1px solid rgb(255 255 255 / 0.08);
}

.orbit-receipt span,
.orbit-receipt strong {
  display: block;
}

.orbit-receipt span {
  color: #8fa0b7;
  font-size: 10px;
}

.orbit-receipt strong {
  margin-top: 4px;
  overflow: hidden;
  color: #f2f6f8;
  font: 650 14px/1.2 var(--font-data);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-record-action {
  display: flex;
  width: 100%;
  min-height: 72px;
  padding: 12px 15px;
  align-items: center;
  gap: 13px;
  border-radius: 19px;
  color: white;
  text-align: left;
  background: var(--mars-coral);
  box-shadow: 0 13px 26px rgb(218 97 77 / 0.22);
}

.overview-record-icon {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 0.42);
  border-radius: 50%;
  background: rgb(20 34 56 / 0.14);
}

.overview-record-icon .ui-icon {
  width: 23px;
  height: 23px;
}

.overview-record-copy {
  min-width: 0;
  flex: 1;
}

.overview-record-copy strong,
.overview-record-copy small {
  display: block;
}

.overview-record-copy strong {
  font-size: 16px;
}

.overview-record-copy small {
  margin-top: 4px;
  color: rgb(255 255 255 / 0.72);
  font-size: 10px;
}

.overview-record-arrow {
  width: 19px;
  height: 19px;
}

.overview-insight {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 15px 2px;
  border-top: 1px solid var(--dust-light);
  border-bottom: 1px solid var(--dust-light);
}

.overview-insight-index {
  color: var(--loss-blue);
  font: 700 22px/1 var(--font-data);
}

.overview-insight small,
.overview-insight strong,
.overview-insight p {
  display: block;
  margin: 0;
}

.overview-insight small {
  color: var(--ink-faint);
  font-size: 9px;
}

.overview-insight strong {
  margin-top: 3px;
  font-size: 13px;
}

.overview-insight p {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.45;
}

.overview-insight button,
.overview-section-heading button {
  min-width: 44px;
  min-height: 44px;
  padding: 0 4px;
  color: var(--loss-blue);
  font-size: 11px;
  font-weight: 650;
  background: transparent;
}

.performance-card {
  position: relative;
  min-height: 242px;
  padding: 27px;
  overflow: hidden;
}

.performance-card::after {
  position: absolute;
  top: -40px;
  right: -36px;
  width: 150px;
  height: 150px;
  border: 18px solid var(--paper);
  border-radius: 50%;
  content: "";
}

.performance-label {
  margin: 18px 0 5px;
  color: var(--ink-faint);
  font-size: 12px;
}

.performance-value {
  position: relative;
  z-index: 1;
  margin: 0;
  font-family: var(--font-data);
  font-size: clamp(36px, 5vw, 59px);
  font-weight: 720;
  letter-spacing: -0.06em;
  line-height: 1.1;
}

.positive-text {
  color: var(--mars);
}

.negative-text {
  color: var(--orbit);
}

.neutral-text {
  color: var(--ink-soft);
}

.performance-subline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.performance-subline strong {
  color: var(--ink);
  font-family: var(--font-data);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--dust-light);
  border-radius: var(--radius-md);
  background: var(--dust-light);
  box-shadow: var(--shadow-low);
}

.metric-card {
  min-height: 118px;
  padding: 18px;
  background: var(--cabin);
}

.metric-card span {
  display: block;
  margin-bottom: 12px;
  color: var(--ink-faint);
  font-size: 11px;
}

.metric-card strong {
  font-family: var(--font-data);
  font-size: 24px;
}

.metric-card small {
  display: block;
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 10px;
}

.overview-lower {
  display: grid;
  gap: 13px;
  margin-top: 25px;
}

.overview-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.overview-section-heading p,
.section-kicker {
  margin: 0 0 5px !important;
  color: var(--loss-blue) !important;
  font: 650 10px/1.2 var(--font-data) !important;
  letter-spacing: 0.08em;
}

.overview-section-heading h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: -0.03em;
}

.game-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--dust-light);
  border-radius: var(--radius-md);
  background: var(--dust-light);
  box-shadow: var(--shadow-low);
}

.game-card {
  position: relative;
  min-height: 136px;
  padding: 17px;
  background: var(--cabin);
}

.game-card::before {
  position: absolute;
  top: 0;
  right: 22px;
  left: 22px;
  height: 3px;
  background: var(--game-color, var(--orbit));
  content: "";
}

.game-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.game-card h3 {
  margin: 0;
  font-size: 15px;
}

.game-glyph {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 10px 10px 10px 3px;
  color: white;
  background: var(--game-color, var(--orbit));
  font-family: var(--font-data);
  font-size: 13px;
}

.game-net {
  margin: 15px 0 6px;
  font-family: var(--font-data);
  font-size: 21px;
  font-weight: 700;
}

.game-meta {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.section-card {
  padding: 24px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 19px;
}

.section-heading p {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.recent-list,
.ledger-list,
.companion-list,
.player-list {
  display: grid;
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--dust-light);
}

.recent-list {
  border-top: 1px solid var(--dust-light);
  background: transparent;
}

.overview-timeline {
  position: relative;
}

.overview-timeline::before {
  position: absolute;
  top: 31px;
  bottom: 31px;
  left: 48px;
  width: 1px;
  background: var(--dust-light);
  content: "";
}

.recent-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.5fr) minmax(110px, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 68px;
  padding: 10px 3px;
  border-bottom: 1px solid var(--dust-light);
}

.overview-timeline-row {
  grid-template-columns: 38px 16px minmax(0, 1fr) auto;
  min-height: 76px;
  column-gap: 10px;
}

.overview-timeline-row time {
  text-align: center;
}

.overview-timeline-row time strong,
.overview-timeline-row time span {
  display: block;
}

.overview-timeline-row time strong {
  font: 700 17px/1 var(--font-data);
}

.overview-timeline-row time span {
  margin-top: 4px;
  color: var(--ink-faint);
  font-size: 9px;
}

.overview-timeline-dot {
  position: relative;
  z-index: 1;
  width: 11px;
  height: 11px;
  border: 3px solid var(--paper);
  border-radius: 50%;
  background: var(--game-color, var(--loss-blue));
  box-shadow: 0 0 0 1px var(--dust);
}

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

.recent-main {
  display: grid;
  gap: 4px;
}

.recent-main strong {
  font-size: 13px;
}

.recent-main span,
.recent-context {
  color: var(--ink-faint);
  font-size: 11px;
}

.amount {
  font-family: var(--font-data);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  white-space: nowrap;
}

.page-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 8px 0 23px;
}

.page-intro h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
}

.page-intro p {
  max-width: 560px;
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.6;
}

.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 10px;
  border: 1px solid var(--dust-light);
  border-radius: 12px;
  background: rgb(255 255 255 / 0.76);
}

.ledger-sticky-tools {
  position: sticky;
  top: 12px;
  z-index: 8;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 26px rgb(20 34 56 / 0.08);
}

.segment-control {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border-radius: 9px;
  background: var(--paper-deep);
}

.segment-control button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 7px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 12px;
}

.segment-control button.is-active {
  color: var(--ink);
  background: white;
  box-shadow: 0 3px 10px rgb(23 34 53 / 0.08);
  font-weight: 650;
}

.search-field {
  position: relative;
  width: min(100%, 280px);
}

.search-field > .ui-icon {
  position: absolute;
  top: 50%;
  left: 13px;
  z-index: 1;
  width: 17px;
  height: 17px;
  color: var(--ink-faint);
  pointer-events: none;
  transform: translateY(-50%);
}

.search-field input {
  width: 100%;
  min-height: 44px;
  padding: 0 13px 0 38px;
  border: 1px solid var(--dust);
  border-radius: 9px;
  background: white;
}

.ledger-list {
  border: 1px solid var(--dust-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-low);
}

.ledger-summary {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 2px 2px 10px;
  color: var(--ink-faint);
  font-size: 11px;
}

.ledger-summary div {
  display: grid;
  gap: 2px;
}

.ledger-summary span {
  line-height: 1.45;
}

.ledger-summary strong {
  color: var(--ink);
  font-size: 14px;
}

.ledger-timeline {
  position: relative;
  overflow: visible;
}

.ledger-timeline::before {
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 100px;
  width: 1px;
  background: var(--dust-light);
  content: "";
}

.ledger-row {
  position: relative;
  display: grid;
  grid-template-columns: 72px 16px minmax(160px, 1fr) 100px 44px;
  align-items: center;
  gap: 12px;
  min-height: 92px;
  padding: 14px 12px 14px 16px;
  background: var(--cabin);
}

.ledger-row + .ledger-row {
  border-top: 1px solid var(--dust-light);
}

.date-block {
  display: grid;
  gap: 1px;
  color: var(--ink-soft);
}

.date-block strong {
  color: var(--ink);
  font-family: var(--font-data);
  font-size: 20px;
  line-height: 1;
}

.date-block span {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 650;
}

.date-block small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-timeline-dot {
  position: relative;
  z-index: 1;
  display: block;
  width: 9px;
  height: 9px;
  border: 2px solid white;
  border-radius: 50%;
  background: var(--game-color);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--game-color) 24%, transparent);
}

.game-badge,
.mode-badge,
.quality-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 650;
}

.game-badge {
  color: var(--orbit-dark);
  background: var(--orbit-pale);
}

.game-badge.game-mahjong {
  color: #4e633d;
  background: #edf2e7;
}

.game-badge.game-guandan {
  color: #755429;
  background: #f7eee0;
}

.game-badge.game-texas {
  color: #7a3d38;
  background: var(--mars-pale);
}

.ledger-title {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.ledger-title strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-title span,
.ledger-players {
  color: var(--ink-faint);
  font-size: 11px;
  line-height: 1.5;
}

.ledger-title .game-label {
  width: fit-content;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.ledger-amount {
  white-space: nowrap;
  text-align: right;
}

.ledger-menu-wrap {
  position: relative;
}

.ledger-menu-trigger {
  display: grid;
  width: 44px;
  min-height: 44px;
  padding: 0;
  place-items: center;
  border-radius: 50%;
  color: var(--ink-soft);
  background: transparent;
}

.ledger-menu-trigger:hover,
.ledger-menu-trigger[aria-expanded="true"] {
  background: var(--paper-deep);
}

.ledger-menu-trigger .ui-icon {
  width: 20px;
  height: 20px;
}

.ledger-action-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 20;
  display: grid;
  min-width: 154px;
  padding: 6px;
  border: 1px solid var(--dust-light);
  border-radius: 12px;
  background: white;
  box-shadow: var(--shadow-float);
}

.ledger-action-menu button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  min-height: 44px;
  padding: 0 11px;
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
}

.ledger-action-menu button:hover,
.ledger-action-menu button:focus-visible {
  background: var(--paper-deep);
}

.ledger-action-menu button.danger-text {
  color: var(--negative);
}

.ledger-action-menu .ui-icon {
  width: 17px;
  height: 17px;
}

.analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.55fr);
  gap: 18px;
}

.analytics-span {
  grid-column: 1 / -1;
}

.analytics-insight-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  gap: 24px;
  margin-bottom: 18px;
  padding: 26px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  color: white;
  background: var(--orbit-night);
  box-shadow: var(--shadow-mid);
}

.analytics-insight-card::after {
  position: absolute;
  top: -100px;
  right: -70px;
  width: 260px;
  height: 260px;
  border: 1px solid rgb(255 255 255 / 0.11);
  border-radius: 50%;
  box-shadow: 0 0 0 44px rgb(255 255 255 / 0.035), 0 0 0 88px rgb(255 255 255 / 0.02);
  content: "";
  pointer-events: none;
}

.analytics-insight-card.is-positive {
  background: linear-gradient(135deg, var(--orbit-night), #1d4b47);
}

.analytics-insight-card.is-negative {
  background: linear-gradient(135deg, var(--orbit-night), #263a68);
}

.analytics-insight-copy,
.analytics-insight-facts {
  position: relative;
  z-index: 1;
}

.analytics-insight-copy .eyebrow {
  color: var(--signal-teal-bright);
}

.analytics-insight-copy h2 {
  margin: 7px 0 9px;
  font-family: var(--font-display);
  font-size: clamp(21px, 3.4vw, 31px);
  font-weight: 500;
}

.analytics-insight-copy > p:last-child {
  max-width: 660px;
  margin: 0;
  color: rgb(255 255 255 / 0.74);
  font-size: 13px;
  line-height: 1.75;
}

.analytics-insight-facts {
  display: grid;
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 0.12);
  border-radius: 13px;
  background: rgb(255 255 255 / 0.06);
}

.analytics-insight-facts > div {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border-bottom: 1px solid rgb(255 255 255 / 0.09);
}

.analytics-insight-facts > div:last-child {
  border-bottom: 0;
}

.analytics-insight-facts dt {
  color: rgb(255 255 255 / 0.52);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.analytics-insight-facts dd {
  margin: 0;
  color: rgb(255 255 255 / 0.9);
  font-size: 11px;
  line-height: 1.45;
}

.trend-wrap {
  height: 250px;
  padding-top: 12px;
}

.trend-chart {
  height: 100%;
  width: 100%;
}

.chart-grid-line {
  stroke: var(--dust-light);
  stroke-width: 1;
}

.chart-zero-line {
  stroke: var(--dust);
  stroke-dasharray: 4 4;
  stroke-width: 1.3;
}

.chart-month-label,
.chart-value-label {
  fill: var(--ink-faint);
  font-family: var(--font-data);
  font-size: 9px;
}

.chart-month-label {
  text-anchor: middle;
}

.chart-value-label {
  text-anchor: end;
}

.chart-line {
  fill: none;
  stroke: var(--mars);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}

.chart-area {
  fill: url("#trend-fill");
}

.chart-dot {
  fill: white;
  stroke: var(--mars);
  stroke-width: 2;
}

.contribution-list {
  display: grid;
  gap: 18px;
}

.contribution-row {
  display: grid;
  gap: 7px;
}

.contribution-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 12px;
}

.contribution-track {
  position: relative;
  height: 24px;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(90deg, rgb(74 103 161 / 0.08) 0 50%, rgb(218 97 77 / 0.08) 50% 100%);
}

.contribution-zero {
  position: absolute;
  z-index: 2;
  top: 3px;
  bottom: 3px;
  left: 50%;
  width: 1px;
  background: var(--ink-faint);
}

.contribution-fill {
  position: absolute;
  top: 7px;
  right: 50%;
  height: 10px;
  border-radius: 999px 0 0 999px;
  background: var(--orbit);
}

.contribution-fill.is-positive {
  right: auto;
  left: 50%;
  border-radius: 0 999px 999px 0;
  background: var(--mars);
}

.contribution-fill.is-zero {
  display: none;
}

.leaderboard {
  width: 100%;
  border-collapse: collapse;
}

.leaderboard th,
.leaderboard td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--dust-light);
  font-size: 12px;
  text-align: left;
}

.leaderboard th {
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.leaderboard th:not(:first-child),
.leaderboard td:not(:first-child) {
  text-align: right;
}

.rank-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rank-number {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  color: var(--ink-soft);
  background: var(--paper);
  font-family: var(--font-data);
  font-size: 10px;
}

.player-dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--player-color, var(--orbit));
}

.companion-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--dust-light);
}

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

.companion-name {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 650;
}

.companion-name small,
.companion-result small {
  color: var(--ink-faint);
  font-weight: 400;
}

.companion-result {
  display: grid;
  justify-items: end;
  gap: 3px;
}

.quality-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.quality-item {
  padding: 15px;
  border: 1px solid var(--dust-light);
  border-radius: 10px;
  background: var(--paper);
}

.quality-item strong {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-data);
  font-size: 20px;
}

.quality-item span {
  color: var(--ink-soft);
  font-size: 10px;
}

.data-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1.05fr) minmax(320px, 0.95fr);
  gap: 18px;
}

.data-span {
  grid-column: 1 / -1;
}

.account-summary-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 24px;
  padding: 25px;
  border-radius: var(--radius-lg);
  color: white;
  background: linear-gradient(135deg, var(--orbit-night), var(--orbit-night-soft));
  box-shadow: var(--shadow-mid);
}

.account-summary-card.is-private-provider {
  align-items: center;
  background: linear-gradient(135deg, var(--orbit-night), #29454f);
}

.account-summary-main {
  display: flex;
  align-items: center;
  gap: 17px;
  min-width: 0;
}

.account-summary-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 66px;
  height: 66px;
  border: 1px solid rgb(255 255 255 / 0.22);
  border-radius: 20px;
  color: white;
  background: linear-gradient(145deg, var(--mars-coral), var(--mars-coral-deep));
  font-family: var(--font-display);
  font-size: 27px;
  box-shadow: 0 12px 28px rgb(0 0 0 / 0.18);
}

.account-summary-avatar .ui-icon {
  width: 27px;
  height: 27px;
}

.account-summary-main .eyebrow {
  color: var(--signal-teal-bright);
}

.account-summary-main h2 {
  margin: 5px 0;
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 500;
}

.account-summary-main p:not(.eyebrow) {
  margin: 0;
  color: rgb(255 255 255 / 0.66);
  font-size: 11px;
  line-height: 1.6;
}

.account-security-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-top: 9px;
  padding: 0 9px;
  border-radius: 999px;
  color: rgb(255 255 255 / 0.82);
  background: rgb(255 255 255 / 0.1);
  font-size: 9px;
}

.account-security-chip.is-verified {
  color: #a9eee1;
  background: rgb(85 214 199 / 0.13);
}

.account-summary-side {
  display: grid;
  align-content: center;
  gap: 13px;
}

.account-summary-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 0.12);
  border-radius: 11px;
  background: rgb(255 255 255 / 0.05);
}

.account-summary-facts > div {
  padding: 10px;
  border-right: 1px solid rgb(255 255 255 / 0.1);
}

.account-summary-facts > div:last-child {
  border-right: 0;
}

.account-summary-facts dt,
.account-summary-facts dd {
  margin: 0;
}

.account-summary-facts dt {
  color: rgb(255 255 255 / 0.45);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.account-summary-facts dd {
  margin-top: 4px;
  color: rgb(255 255 255 / 0.84);
  font-size: 10px;
}

.account-settings-button {
  display: inline-flex;
  justify-self: end;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding-inline: 16px;
}

.account-settings-button .ui-icon {
  width: 17px;
  height: 17px;
}

.account-summary-badges {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.account-summary-badges span {
  padding: 7px 10px;
  border: 1px solid rgb(255 255 255 / 0.12);
  border-radius: 999px;
  color: rgb(255 255 255 / 0.68);
  font-size: 9px;
}

.more-workspace-card {
  min-width: 0;
}

.more-section-title {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.more-section-title > span:last-child > small,
.more-section-title > span:last-child > h2,
.more-section-title > span:last-child > p {
  display: block;
}

.more-section-title > span:last-child > small {
  margin-bottom: 3px;
  color: var(--signal-teal);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.more-section-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--orbit);
  background: var(--orbit-pale);
}

.more-section-icon .ui-icon {
  width: 17px;
  height: 17px;
}

.player-list {
  background: transparent;
}

.player-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 8px 0;
  border-bottom: 1px solid var(--dust-light);
}

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

.player-identity {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.player-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: white;
  background: var(--player-color, var(--orbit));
  font-family: var(--font-display);
  font-weight: 700;
}

.player-identity strong,
.player-identity small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-identity small {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 10px;
}

.backup-illustration {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 17px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--dust-light);
  border-radius: 12px;
  background: var(--paper);
}

.backup-mark {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border: 1px solid var(--dust);
  border-radius: 50%;
  color: var(--orbit);
}

.backup-mark .ui-icon {
  width: 24px;
  height: 24px;
}

.backup-illustration h3 {
  margin: 0 0 6px;
  font-size: 14px;
}

.backup-illustration p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.6;
}

.backup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.snapshot-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.snapshot-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 62px;
  padding: 9px 0;
  border-bottom: 1px solid var(--dust-light);
}

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

.snapshot-copy {
  min-width: 0;
}

.snapshot-copy strong,
.snapshot-copy small {
  display: block;
}

.snapshot-copy strong {
  font-family: var(--font-data);
  font-size: 13px;
}

.snapshot-copy small {
  margin-top: 5px;
  overflow-wrap: anywhere;
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.5;
}

.preview-card {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid rgb(38 112 93 / 0.25);
  border-radius: 11px;
  background: rgb(38 112 93 / 0.055);
}

.preview-card h3 {
  margin: 0 0 13px;
  color: var(--success);
  font-size: 14px;
}

.preview-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.preview-stats div {
  padding: 10px;
  border-radius: 8px;
  background: rgb(255 255 255 / 0.72);
}

.preview-stats strong,
.preview-stats span {
  display: block;
}

.preview-stats strong {
  font-family: var(--font-data);
}

.preview-stats span {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 9px;
}

.privacy-note {
  margin: 17px 0 0;
  padding-top: 15px;
  border-top: 1px solid var(--dust-light);
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.6;
}

.empty-state {
  display: grid;
  justify-items: center;
  min-height: 260px;
  padding: 42px 20px;
  text-align: center;
}

.empty-orbit {
  position: relative;
  width: 66px;
  height: 38px;
  margin-bottom: 19px;
  border: 1px solid var(--dust);
  border-radius: 50%;
  transform: rotate(-12deg);
}

.empty-orbit::after {
  position: absolute;
  top: -4px;
  right: 9px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--mars);
  content: "";
}

.empty-state h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
}

.empty-state p {
  max-width: 390px;
  margin: 9px 0 20px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.7;
}

.overlay {
  position: fixed;
  z-index: 100;
  top: var(--visual-viewport-top, 0px);
  right: 0;
  bottom: auto;
  left: 0;
  display: flex;
  height: var(--visual-viewport-height, 100dvh);
  align-items: stretch;
  justify-content: flex-end;
  background: rgb(12 19 31 / 0.48);
  backdrop-filter: blur(5px);
  animation: fade-in 160ms ease both;
}

.drawer {
  width: min(720px, calc(100% - 52px));
  height: var(--visual-viewport-height, 100dvh);
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--paper);
  box-shadow: var(--shadow-high);
  animation: drawer-in 220ms ease both;
}

.session-drawer {
  display: flex;
  overflow: hidden;
  flex-direction: column;
}

#session-form {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.drawer-header,
.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.drawer-header {
  position: sticky;
  z-index: 4;
  top: 0;
  padding: 22px 26px 18px;
  border-bottom: 1px solid var(--dust);
  background: rgb(238 243 246 / 0.94);
  backdrop-filter: blur(15px);
}

.drawer-header h2,
.dialog-header h2,
.confirm-dialog h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 23px;
}

.icon-button {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--dust);
  border-radius: 50%;
  background: transparent;
  font-size: 24px;
  font-weight: 300;
}

.icon-button:hover {
  background: white;
}

#session-form-content {
  display: grid;
  min-height: 0;
  flex: 1;
  gap: 14px;
  padding: 20px 26px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.form-step {
  overflow: hidden;
  border: 1px solid var(--dust-light);
  border-radius: 13px;
  background: var(--cabin);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.form-step.is-active {
  border-color: color-mix(in srgb, var(--ink) 22%, var(--dust-light));
  box-shadow: 0 10px 28px rgb(35 53 72 / 0.07);
}

.form-step.is-collapsed {
  background: rgb(255 255 255 / 0.7);
}

.step-title {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 64px;
  padding: 14px 20px;
  border: 0;
  background: transparent;
  text-align: left;
}

.step-toggle:hover {
  background: rgb(255 255 255 / 0.7);
}

.step-toggle:focus-visible {
  outline: 2px solid var(--signal-teal);
  outline-offset: -3px;
}

.step-number {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  color: white;
  background: var(--ink);
  font-family: var(--font-data);
  font-size: 10px;
}

.step-heading {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.step-heading strong {
  font-size: 14px;
}

.step-heading small {
  color: var(--ink-faint);
  font-size: 10px;
}

.step-chevron {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-left: auto;
  border-radius: 50%;
  color: var(--ink-soft);
  background: var(--mist);
  font-family: var(--font-data);
  font-size: 14px;
}

.form-step-content {
  padding: 2px 20px 20px;
  animation: session-step-in 150ms ease both;
}

.session-step-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 50px;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid var(--dust-light);
}

.session-step-actions .text-button,
.session-next-button {
  min-height: 40px;
}

.session-step-spacer {
  min-width: 1px;
}

.session-save-hint {
  margin-left: auto;
  color: var(--ink-faint);
  font-size: 11px;
}

@keyframes session-step-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.game-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.choice-card {
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--dust);
  border-radius: 10px;
  background: white;
  text-align: left;
}

.choice-card span,
.choice-card strong,
.choice-card small {
  display: block;
}

.choice-card span {
  margin-bottom: 8px;
  color: var(--orbit);
  font-family: var(--font-data);
  font-size: 16px;
}

.choice-card strong {
  font-size: 13px;
}

.choice-card small {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 9px;
}

.choice-card.is-active {
  border-color: var(--mars);
  box-shadow: 0 0 0 2px rgb(201 72 58 / 0.1);
}

.choice-card.is-active span {
  color: var(--mars);
}

.mode-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 12px;
}

.mode-button {
  min-height: 62px;
  padding: 11px 13px;
  border: 1px solid var(--dust);
  border-radius: 9px;
  background: white;
  text-align: left;
}

.mode-button strong,
.mode-button small {
  display: block;
}

.mode-button strong {
  font-size: 12px;
}

.mode-button small {
  margin-top: 4px;
  color: var(--ink-faint);
  font-size: 9px;
  line-height: 1.45;
}

.mode-button.is-active {
  border-color: var(--orbit);
  background: var(--orbit-pale);
}

.entry-list {
  display: grid;
  gap: 9px;
}

.entry-row {
  padding: 13px;
  border: 1px solid var(--dust-light);
  border-radius: 10px;
  background: var(--paper);
}

.entry-main {
  display: grid;
  grid-template-columns: minmax(120px, 1.15fr) minmax(110px, 0.85fr) 42px;
  gap: 9px;
  align-items: end;
}

.result-input-cluster {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.result-direction {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
  border-radius: 9px;
  background: var(--paper-deep);
}

.result-direction button {
  min-height: 38px;
  border-radius: 7px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 12px;
  font-weight: 650;
}

.result-direction button.is-active {
  color: var(--ink);
  background: white;
  box-shadow: 0 3px 10px rgb(23 34 53 / 0.09);
}

.result-direction button:nth-child(1).is-active { color: var(--mars-dark); }
.result-direction button:nth-child(2).is-active { color: var(--orbit-dark); }

.result-amount-field input:disabled {
  color: var(--ink-faint);
  background: var(--paper-deep);
}

.entry-main.texas-entry-main {
  grid-template-columns: minmax(110px, 1fr) repeat(3, minmax(82px, 0.78fr)) minmax(92px, 0.8fr) 42px;
}

.form-field,
.mini-field {
  display: grid;
  gap: 6px;
}

.form-field > span,
.mini-field > span,
.color-fieldset legend {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
}

.form-field input,
.form-field select,
.form-field textarea,
.mini-field input,
.mini-field select {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--dust);
  border-radius: 8px;
  outline: 0;
  background: white;
}

.form-field textarea {
  min-height: 86px;
  resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus,
.mini-field input:focus,
.mini-field select:focus {
  border-color: var(--orbit);
  box-shadow: 0 0 0 3px rgb(63 95 155 / 0.12);
}

.form-field small,
.mini-field small {
  color: var(--ink-faint);
  font-size: 9px;
  line-height: 1.5;
}

.time-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 7px;
  align-items: center;
}

.time-input-row button {
  min-width: 60px;
  min-height: 44px;
  padding-inline: 10px;
}

.input-with-suffix {
  position: relative;
}

.input-with-suffix input {
  padding-right: 52px;
  font-family: var(--font-data);
  font-variant-numeric: tabular-nums;
}

.input-with-suffix span {
  position: absolute;
  top: 50%;
  right: 10px;
  color: var(--ink-faint);
  font-size: 9px;
  transform: translateY(-50%);
}

.remove-entry-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 44px;
  border-radius: 8px;
  color: var(--ink-faint);
  background: transparent;
  font-size: 20px;
}

.remove-entry-button:hover {
  color: var(--danger);
  background: var(--mars-pale);
}

.entry-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 9px;
}

.entry-net {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--font-data);
  font-size: 13px;
  font-weight: 700;
}

.add-entry-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 11px;
}

.balance-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 13px;
  padding: 12px 14px;
  border-radius: 9px;
  color: var(--ink-soft);
  background: var(--paper);
  font-size: 11px;
}

.balance-strip strong {
  font-family: var(--font-data);
}

.balance-strip.is-balanced {
  color: var(--success);
  background: rgb(38 112 93 / 0.075);
}

.balance-strip.is-unbalanced {
  color: var(--danger);
  background: var(--mars-pale);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.form-grid .span-all {
  grid-column: 1 / -1;
}

.inline-error {
  margin: 0 26px;
  padding: 12px 14px;
  border-left: 3px solid var(--danger);
  border-radius: 5px;
  color: var(--danger);
  background: var(--mars-pale);
  font-size: 12px;
  line-height: 1.55;
}

.drawer-footer {
  position: static;
  z-index: 5;
  display: flex;
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 10px;
  width: 100%;
  padding: 16px 26px max(16px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--dust);
  background: rgb(238 243 246 / 0.94);
  backdrop-filter: blur(15px);
}

.dialog-card {
  width: min(460px, calc(100% - 32px));
  margin: auto;
  padding: 24px;
  border-radius: var(--radius-md);
  background: var(--cabin);
  box-shadow: var(--shadow-high);
  animation: dialog-in 180ms ease both;
}

.player-dialog form {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.color-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.color-options {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 10px;
}

.color-option {
  position: relative;
  width: 38px;
  height: 38px;
  border: 2px solid white;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 0 0 1px var(--dust);
}

.color-option.is-active::after {
  position: absolute;
  inset: 9px;
  border: 2px solid white;
  border-top: 0;
  border-left: 0;
  content: "";
  transform: rotate(45deg) translate(-2px, -2px);
}

.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.player-dialog .inline-error {
  margin: 0;
}

.confirm-overlay {
  align-items: center;
  justify-content: center;
}

.confirm-dialog {
  width: min(390px, calc(100% - 32px));
  text-align: center;
}

.confirm-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  border-radius: 50%;
  color: var(--danger);
  background: var(--mars-pale);
  font-family: var(--font-data);
  font-weight: 700;
}

.confirm-dialog p {
  margin: 11px 0 24px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.65;
}

.confirm-dialog .dialog-footer {
  justify-content: center;
}

.toast-region {
  position: fixed;
  z-index: 180;
  right: 22px;
  bottom: 22px;
  display: grid;
  gap: 9px;
  width: min(360px, calc(100% - 44px));
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  align-items: start;
  gap: 11px;
  padding: 14px;
  border: 1px solid rgb(255 255 255 / 0.1);
  border-radius: 11px;
  color: white;
  background: var(--ink);
  box-shadow: var(--shadow-high);
  pointer-events: auto;
  animation: toast-in 220ms ease both;
}

.toast::before {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: #74b6a3;
  content: "";
}

.toast.is-error::before {
  background: #ef8277;
}

.toast p {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
}

.toast button {
  width: 30px;
  height: 30px;
  margin: -6px -6px 0 0;
  color: rgb(255 255 255 / 0.72);
  background: transparent;
  font-size: 18px;
}

.smart-entry-overlay {
  align-items: stretch;
  justify-content: flex-end;
}

.smart-entry-sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(590px, calc(100% - 52px));
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: var(--paper);
  box-shadow: var(--shadow-high);
  animation: drawer-in 220ms ease both;
}

.sheet-grabber {
  display: none;
}

.smart-entry-header {
  position: relative;
  z-index: 2;
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--dust);
  background: rgb(238 243 246 / 0.94);
  backdrop-filter: blur(16px);
}

.smart-entry-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 25px;
  letter-spacing: 0.02em;
}

.smart-entry-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 16px 20px 24px;
  scroll-padding-bottom: 112px;
}

.smart-prompt-card,
.smart-preview-card {
  padding: 18px;
  border: 1px solid var(--dust-light);
  border-radius: 16px;
  background: var(--cabin);
  box-shadow: var(--shadow-low);
}

.smart-prompt-card > label {
  display: block;
  margin-bottom: 9px;
  font-size: 13px;
  font-weight: 700;
}

#smart-entry-text {
  display: block;
  width: 100%;
  min-height: 116px;
  padding: 13px 14px;
  border: 1px solid var(--dust);
  border-radius: 12px;
  outline: 0;
  background: #fbfcfd;
  font-size: 16px;
  line-height: 1.65;
  resize: vertical;
}

#smart-entry-text:focus {
  border-color: var(--orbit);
  box-shadow: 0 0 0 3px rgb(63 95 155 / 0.12);
  background: white;
}

.smart-entry-help,
.smart-mic-help {
  margin: 8px 0 0;
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.55;
}

.smart-mic-help:not(:empty) {
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--orbit-dark);
  background: var(--orbit-pale);
}

.smart-prompt-actions {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 9px;
  margin-top: 13px;
}

.smart-mic-button {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1px;
  min-height: 54px;
  overflow: hidden;
  border-radius: 13px;
  color: white;
  background: var(--ink);
}

.smart-mic-button::after {
  position: absolute;
  inset: 6px 11px;
  border: 1px solid rgb(255 255 255 / 0.22);
  border-radius: 50%;
  content: "";
}

.smart-mic-button .ui-icon,
.smart-mic-button small {
  position: relative;
  z-index: 1;
}

.smart-mic-button .ui-icon { width: 20px; height: 20px; }
.smart-mic-button small { font-size: 8px; }

.smart-mic-button.is-listening {
  background: var(--mars);
  animation: mic-pulse 1.15s ease-in-out infinite;
}

.smart-parse-button { min-height: 54px; border-radius: 13px; }

.smart-entry-error {
  margin: 12px 0 0;
}

.smart-preview-card {
  margin-top: 12px;
}

.smart-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.smart-preview-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
}

.confidence-chip {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--success);
  background: rgb(38 112 93 / 0.09);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.confidence-chip.is-low {
  color: var(--warning);
  background: #f7eee0;
}

.smart-preview-summary {
  display: grid;
  grid-template-columns: minmax(175px, 0.8fr) minmax(0, 1.2fr);
  gap: 8px;
  margin-top: 13px;
}

.smart-summary-result {
  display: grid;
  align-content: center;
  min-height: 104px;
  padding: 14px;
  border-radius: 13px;
  color: white;
  background: var(--ink);
}

.smart-summary-result > span,
.smart-summary-result > small {
  color: rgb(255 255 255 / 0.62);
  font-size: 9px;
}

.smart-summary-result strong {
  margin: 4px 0 2px;
  font-family: var(--font-data);
  font-size: 23px;
  letter-spacing: -0.02em;
}

.smart-summary-result .positive-text { color: #82d8c4; }
.smart-summary-result .negative-text { color: #ff9e91; }
.smart-summary-result .neutral-text { color: white; }

.smart-summary-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--dust-light);
  border-radius: 13px;
  background: var(--dust-light);
  gap: 1px;
}

.smart-summary-facts div {
  display: grid;
  align-content: center;
  min-width: 0;
  padding: 11px 9px;
  background: #fafcfd;
}

.smart-summary-facts dt {
  color: var(--ink-faint);
  font-size: 9px;
}

.smart-summary-facts dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.45;
}

.smart-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 13px;
  overflow: hidden;
  border: 1px solid var(--dust-light);
  border-radius: 12px;
  background: var(--dust-light);
}

.smart-preview-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  min-height: 77px;
  padding: 10px;
  background: #fafcfd;
}

.smart-preview-field > span {
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 650;
}

.smart-preview-field > input,
.smart-preview-field > select,
.smart-result-control input,
.smart-result-control select {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 6px 8px;
  border: 1px solid var(--dust);
  border-radius: 8px;
  outline: 0;
  background: white;
  font-size: 13px;
}

.smart-preview-field > input:focus,
.smart-preview-field > select:focus,
.smart-result-control input:focus,
.smart-result-control select:focus {
  border-color: var(--orbit);
  box-shadow: 0 0 0 2px rgb(63 95 155 / 0.11);
}

.smart-result-control {
  position: relative;
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  gap: 5px;
}

.smart-result-control input { padding-right: 48px; font-family: var(--font-data); }

.smart-result-control > span {
  position: absolute;
  right: 8px;
  bottom: 12px;
  color: var(--ink-faint);
  font-size: 8px;
  pointer-events: none;
}

.smart-entry-warnings {
  display: grid;
  gap: 5px;
  margin-top: 11px;
}

.smart-note {
  margin: 0;
  padding-left: 15px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.55;
}

.smart-note::before {
  float: left;
  margin-left: -15px;
  content: "·";
}

.smart-note.is-warning { color: var(--warning); }
.smart-note.is-blocking { color: var(--danger); font-weight: 650; }

.smart-entry-footer {
  position: relative;
  z-index: 2;
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: 1fr 1.45fr;
  gap: 10px;
  padding: 13px 20px max(13px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--dust);
  background: rgb(238 243 246 / 0.95);
  backdrop-filter: blur(16px);
}

.smart-entry-footer button {
  min-height: 50px;
  border-radius: 12px;
}

.smart-entry-footer .secondary-button {
  color: var(--ink-soft);
  background: transparent;
}

.mobile-nav {
  display: none;
}

@keyframes mic-pulse {
  50% { box-shadow: inset 0 0 0 5px rgb(255 255 255 / 0.16); }
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes orbit-node-in {
  from { opacity: 0; transform: scale(0.25); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes drawer-in {
  from { transform: translateX(32px); }
  to { transform: translateX(0); }
}

@keyframes dialog-in {
  from { opacity: 0; transform: scale(0.97) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .side-rail {
    padding-inline: 14px;
  }

  .brand {
    justify-content: center;
  }

  .brand-copy,
  .nav-item span:last-child,
  .local-note > span:last-child {
    display: none;
  }

  .nav-item {
    display: grid;
    place-items: center;
    grid-template-columns: 1fr;
    padding: 0;
  }

  .nav-item.is-active::before {
    left: -14px;
  }

  .local-note {
    justify-content: center;
  }

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

  .entry-main.texas-entry-main {
    grid-template-columns: minmax(130px, 1fr) repeat(2, minmax(92px, 0.8fr)) 42px;
  }

  .entry-main.texas-entry-main .texas-cashout,
  .entry-main.texas-entry-main .entry-net {
    grid-column: auto;
  }
}

@media (max-width: 900px) {
  .topbar {
    align-items: flex-end;
    flex-wrap: wrap;
  }

  .topbar-title {
    width: 100%;
  }

  .topbar-actions {
    width: 100%;
  }

  .compact-field {
    flex: 1;
  }

  .dashboard-grid,
  .analytics-grid,
  .data-grid {
    grid-template-columns: 1fr;
  }

  .orbit-card {
    grid-row: auto;
  }

  .analytics-span {
    grid-column: auto;
  }

  .analytics-insight-card {
    grid-template-columns: 1fr;
  }

  .account-summary-card {
    grid-template-columns: 1fr;
  }

  .data-span {
    grid-column: auto;
  }

  .ledger-row {
    grid-template-columns: 64px 16px minmax(150px, 1fr) 96px 44px;
  }

  .ledger-players {
    display: none;
  }
}

@media (max-width: 680px) {
  button,
  [role="button"] {
    min-height: 44px;
  }

  .analytics-insight-card {
    gap: 18px;
    margin-bottom: 14px;
    padding: 20px;
    border-radius: 18px;
  }

  .trend-wrap {
    height: 240px;
  }

  .account-summary-card {
    gap: 18px;
    padding: 20px;
    border-radius: 18px;
  }

  .account-summary-avatar {
    width: 58px;
    height: 58px;
    border-radius: 17px;
  }

  .account-summary-main h2 {
    font-size: 20px;
  }

  .account-summary-facts {
    grid-template-columns: 1fr;
  }

  .account-summary-facts > div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    border-right: 0;
    border-bottom: 1px solid rgb(255 255 255 / 0.1);
  }

  .account-summary-facts > div:last-child {
    border-bottom: 0;
  }

  .account-settings-button {
    justify-content: center;
    justify-self: stretch;
  }

  .account-summary-badges {
    justify-content: flex-start;
  }

  input,
  select,
  textarea {
    font-size: 16px !important;
  }

  .snapshot-row {
    grid-template-columns: 1fr;
  }

  .snapshot-row .text-button {
    width: 100%;
  }

  .time-input-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .time-input-row .text-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  body {
    background-size: 54px 54px;
  }

  .app-shell {
    display: block;
  }

  .side-rail {
    display: none;
  }

  .workspace {
    padding: 0 max(14px, env(safe-area-inset-right)) calc(96px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  }

  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    min-height: 154px;
    gap: 9px;
    padding: max(13px, env(safe-area-inset-top)) 0 10px;
  }

  .mobile-brand-row {
    display: flex;
    min-width: 0;
    min-height: 44px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .topbar-title h1 {
    font-size: 23px;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .desktop-account-entry {
    display: none;
  }

  .compact-field {
    width: 100%;
    min-width: 0;
    padding-inline: 9px;
  }

  .record-button {
    display: none;
  }

  .mobile-nav {
    position: fixed;
    z-index: 45;
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    left: max(10px, env(safe-area-inset-left));
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    min-height: 66px;
    padding: 5px 7px;
    border: 1px solid rgb(255 255 255 / 0.08);
    border-radius: 17px;
    background: rgb(23 34 53 / 0.96);
    box-shadow: 0 18px 45px rgb(23 34 53 / 0.28);
    backdrop-filter: blur(16px);
  }

  .mobile-nav button {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 3px;
    min-width: 0;
    color: rgb(255 255 255 / 0.55);
    background: transparent;
    min-height: 54px;
  }

  .mobile-nav button > .ui-icon {
    width: 19px;
    height: 19px;
  }

  .mobile-nav button > small {
    font-size: 9px;
  }

  .mobile-nav button.is-active {
    color: white;
  }

  .mobile-nav .mobile-record {
    position: relative;
    color: white;
  }

  .mobile-nav .mobile-record::before {
    position: absolute;
    z-index: -1;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--mars);
    content: "";
  }

  .mobile-nav .mobile-record small {
    position: absolute;
    bottom: -1px;
    color: rgb(255 255 255 / 0.68);
  }

  .dashboard-grid {
    gap: 12px;
  }

  .orbit-card {
    min-height: 0;
    border-radius: 24px 24px 24px 7px;
  }

  .orbit-card-grid {
    grid-template-columns: minmax(0, 1.08fr) minmax(138px, 0.92fr);
    min-height: 205px;
    padding: 21px 18px 13px;
  }

  .orbit-kicker {
    font-size: 9px;
  }

  .orbit-verdict {
    margin-top: 22px;
    font-size: 14px;
  }

  .orbit-net {
    font-size: clamp(31px, 9vw, 42px);
  }

  .orbit-visual {
    min-height: 0;
    padding: 0;
  }

  .orbit-visual svg {
    max-width: 158px;
  }

  .orbit-receipt {
    padding: 13px 18px 16px;
  }

  .orbit-receipt div + div {
    padding-left: 14px;
  }

  .overview-insight {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    margin-top: 2px;
  }

  .performance-card {
    min-height: 210px;
    padding: 21px;
  }

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

  .metric-card {
    min-height: 105px;
    padding: 14px 10px;
  }

  .metric-card strong {
    font-size: 19px;
  }

  .game-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .game-card {
    min-height: 130px;
    padding: 13px 10px 14px;
  }

  .game-card::before {
    right: 10px;
    left: 10px;
  }

  .game-card-header {
    align-items: flex-start;
    gap: 5px;
  }

  .game-card h3 {
    font-size: 12px;
  }

  .game-glyph {
    width: 27px;
    height: 27px;
    flex: 0 0 27px;
  }

  .game-net {
    margin-top: 13px;
    overflow: hidden;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .game-meta {
    font-size: 9px;
    white-space: nowrap;
  }

  .section-card {
    padding: 18px;
  }

  .recent-row {
    grid-template-columns: minmax(110px, 1fr) auto;
  }

  .recent-row.overview-timeline-row {
    grid-template-columns: 38px 16px minmax(0, 1fr) auto;
  }

  .recent-context {
    display: none;
  }

  .page-intro {
    align-items: flex-start;
    margin-bottom: 16px;
  }

  .page-intro h2 {
    font-size: 21px;
  }

  .ledger-page-intro {
    margin-bottom: 12px;
  }

  .filter-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .segment-control {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
  }

  .segment-control button {
    padding-inline: 5px;
  }

  .search-field {
    width: 100%;
  }

  .ledger-sticky-tools {
    top: 154px;
    margin-inline: -2px;
    padding: 8px;
  }

  .ledger-summary {
    align-items: center;
    margin-top: 12px;
  }

  .ledger-summary > span {
    text-align: right;
  }

  .ledger-timeline::before {
    left: 59px;
  }

  .ledger-row {
    position: relative;
    grid-template-columns: 38px 16px minmax(0, 1fr) auto 44px;
    gap: 6px;
    min-height: 92px;
    padding: 12px 8px 12px 10px;
  }

  .ledger-amount {
    max-width: 78px;
    overflow: hidden;
    padding: 0;
    font-size: 13px;
    text-overflow: ellipsis;
  }

  .date-block strong {
    font-size: 17px;
  }

  .date-block small {
    max-width: 38px;
  }

  .ledger-title strong {
    font-size: 13px;
  }

  .ledger-title > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ledger-action-menu {
    position: fixed;
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(86px + env(safe-area-inset-bottom));
    left: max(12px, env(safe-area-inset-left));
    top: auto;
    grid-template-columns: 1fr 1fr;
    min-width: 0;
    border-radius: 16px;
    box-shadow: 0 18px 50px rgb(20 34 56 / 0.22);
  }

  .ledger-action-menu button {
    justify-content: center;
  }

  .quality-grid {
    grid-template-columns: 1fr;
  }

  .leaderboard th:nth-child(3),
  .leaderboard td:nth-child(3) {
    display: none;
  }

  .player-row {
    grid-template-columns: minmax(110px, 1fr) auto;
  }

  .player-row > .player-stat {
    display: none;
  }

  .preview-stats {
    grid-template-columns: 1fr 1fr;
  }

  .drawer {
    width: 100%;
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }

  .drawer-header {
    padding: max(15px, env(safe-area-inset-top)) 16px 12px;
  }

  #session-form-content {
    gap: 10px;
    padding: 12px;
  }

  .form-step {
    border-radius: 12px;
  }

  .step-title {
    min-height: 60px;
    padding: 12px 14px;
  }

  .form-step-content {
    padding: 2px 14px 16px;
  }

  .session-step-actions {
    margin-top: 16px;
  }

  .session-save-hint {
    max-width: 170px;
    text-align: right;
  }

  .drawer-footer {
    width: 100%;
    padding: 12px max(14px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  }

  .drawer-footer button {
    flex: 1;
  }

  .game-choice-grid {
    gap: 6px;
  }

  .choice-card {
    min-height: 68px;
    padding: 9px;
  }

  .entry-main,
  .entry-main.texas-entry-main {
    grid-template-columns: minmax(120px, 1fr) minmax(105px, 0.8fr) 38px;
  }

  .entry-main.texas-entry-main .texas-rebuy,
  .entry-main.texas-entry-main .texas-cashout,
  .entry-main.texas-entry-main .entry-net {
    grid-column: auto;
  }

  .entry-main.texas-entry-main .remove-entry-button {
    grid-column: 3;
    grid-row: 1;
  }

  .entry-details,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .span-all {
    grid-column: auto;
  }

  .inline-error {
    margin-inline: 12px;
  }

  .smart-entry-sheet {
    width: 100%;
    padding-right: env(safe-area-inset-right);
    padding-left: env(safe-area-inset-left);
    border-radius: 24px 24px 0 0;
    animation-name: sheet-in;
  }

  .sheet-grabber {
    display: block;
    flex: 0 0 auto;
    width: 38px;
    height: 5px;
    margin: max(8px, env(safe-area-inset-top)) auto 1px;
    border-radius: 5px;
    background: var(--dust);
  }

  .smart-entry-header {
    padding: 12px 16px 11px;
  }

  .smart-entry-header h2 {
    font-size: 22px;
  }

  .smart-entry-scroll {
    padding: 11px 12px 20px;
  }

  .smart-prompt-card,
  .smart-preview-card {
    padding: 14px;
  }

  .smart-preview-summary {
    grid-template-columns: 1fr;
  }

  .smart-summary-result {
    min-height: 90px;
  }

  .smart-entry-footer {
    padding: 11px max(13px, env(safe-area-inset-right)) max(11px, env(safe-area-inset-bottom)) max(13px, env(safe-area-inset-left));
  }

  .result-direction button,
  .smart-preview-field > input,
  .smart-preview-field > select,
  .smart-result-control input,
  .smart-result-control select {
    min-height: 44px;
  }

  .color-option,
  .toast button,
  .text-button {
    min-width: 44px;
    min-height: 44px;
  }

  .toast-region {
    right: max(14px, env(safe-area-inset-right));
    bottom: calc(88px + env(safe-area-inset-bottom));
    left: max(14px, env(safe-area-inset-left));
    width: auto;
  }
}

@media (max-width: 390px) {
  .compact-field span {
    display: none;
  }

  .compact-field {
    min-height: 43px;
    align-content: center;
  }

  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }

  .metric-card:last-child {
    grid-column: 1 / -1;
  }

  .game-choice-grid {
    grid-template-columns: 1fr;
  }

  .choice-card {
    display: grid;
    grid-template-columns: 28px 1fr;
    align-content: center;
    min-height: 58px;
  }

  .choice-card span {
    grid-row: span 2;
    margin: 0;
  }

  .mode-choice {
    grid-template-columns: 1fr;
  }

  .entry-main,
  .entry-main.texas-entry-main {
    grid-template-columns: minmax(0, 1fr) 40px;
  }

  .entry-main > .mini-field,
  .entry-main.texas-entry-main > .mini-field,
  .entry-main.texas-entry-main > .entry-net,
  .entry-main > .result-input-cluster {
    grid-column: 1 / -1;
  }

  .entry-main > .mini-field:first-child {
    grid-column: 1;
  }

  .entry-main > .remove-entry-button,
  .entry-main.texas-entry-main .remove-entry-button {
    grid-column: 2;
    grid-row: 1;
  }
}

@media (max-width: 350px) {
  .orbit-card-grid {
    grid-template-columns: minmax(0, 1fr) 124px;
    padding-inline: 15px;
  }

  .orbit-visual svg {
    max-width: 124px;
  }

  .orbit-receipt {
    padding-inline: 15px;
  }

  .orbit-receipt div + div {
    padding-left: 10px;
  }

  .orbit-receipt strong {
    font-size: 12px;
  }

  .smart-preview-grid {
    grid-template-columns: 1fr;
  }

  .topbar-title h1 {
    font-size: 20px;
  }

  .compact-field {
    padding-inline: 6px;
  }
}

@media (max-height: 520px) and (orientation: landscape) and (pointer: coarse) {
  .app-shell { display: block; }
  .side-rail { display: none; }
  .workspace {
    padding: 0 max(14px, env(safe-area-inset-right)) calc(84px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  }
  .topbar { min-height: 76px; padding: max(8px, env(safe-area-inset-top)) 0 7px; }
  .topbar-title { width: auto; }
  .topbar-title p { margin-bottom: 2px; }
  .topbar-title h1 { font-size: 20px; }
  .topbar-actions { width: auto; }
  .record-button { display: none; }
  .mobile-nav {
    position: fixed;
    z-index: 45;
    right: max(12px, env(safe-area-inset-right));
    bottom: max(7px, env(safe-area-inset-bottom));
    left: max(12px, env(safe-area-inset-left));
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    min-height: 58px;
    padding: 3px 7px;
    border-radius: 16px;
    color: white;
    background: rgb(23 34 53 / 0.96);
  }
  .mobile-nav button { display: grid; place-items: center; align-content: center; min-height: 50px; color: rgb(255 255 255 / .58); background: transparent; }
  .mobile-nav button.is-active,
  .mobile-nav .mobile-record { color: white; }
  .mobile-nav button > small { font-size: 9px; }
  .smart-entry-sheet,
  .drawer { width: min(620px, 100%); }
  .smart-entry-header { padding-top: max(8px, env(safe-area-inset-top)); }
  .smart-entry-scroll { padding-bottom: 12px; }
  .smart-prompt-card { display: grid; grid-template-columns: minmax(0, 1fr) 180px; gap: 8px 12px; }
  .smart-prompt-card > label,
  .smart-entry-help,
  .smart-mic-help { grid-column: 1 / -1; }
  #smart-entry-text { min-height: 90px; }
  .smart-prompt-actions { align-self: stretch; grid-template-columns: 56px 1fr; margin-top: 0; }
}

@keyframes sheet-in {
  from { transform: translateY(24px); }
  to { transform: translateY(0); }
}

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

  .orbit-node {
    animation-delay: 0ms !important;
  }
}

/* v5.3.2 mobile legibility and interaction baseline. */
.app-shell {
  color: var(--ink);
  font-size: 14px;
}

.app-shell :where(small, .eyebrow, .topbar-title p, .compact-field span, .card-kicker, .data-label, .metric-label, .quality-label) {
  font-size: 12px;
  line-height: 1.45;
}

.app-shell :where(button, select, input:not([type="hidden"]), a.account-entry, a.mobile-account-entry) {
  min-height: var(--tap-min);
}

/* Native selects and the compact mobile wordmark have stronger component
   selectors above, so enforce the real hit box rather than only its wrapper. */
.app-shell .compact-field select,
.app-shell a.brand,
.app-shell a.mobile-wordmark {
  min-height: var(--tap-min);
}

.app-shell :where(.icon-button, .remove-entry-button, .ledger-menu-button, .color-option) {
  min-width: var(--tap-min);
  min-height: var(--tap-min);
}

.mobile-nav button > small {
  font-size: 11px;
  line-height: 1.15;
}

.mobile-wordmark small,
.brand-copy small,
.account-entry-copy small {
  font-size: 11px;
}

@media (max-width: 520px) {
  .topbar-title h1 {
    font-size: clamp(24px, 6.8vw, 29px);
    line-height: 1.15;
    text-wrap: balance;
  }

  .workspace {
    padding-bottom: calc(112px + env(safe-area-inset-bottom));
  }

  .mobile-nav {
    min-height: 68px;
    border-radius: 19px;
  }

  .mobile-nav button {
    min-height: 58px;
  }

  .mobile-nav .mobile-record {
    min-height: 64px;
  }
}
