:root {
  color-scheme: dark;
  --bg: #050b0e;
  --surface: #081217;
  --surface-2: #0b171c;
  --border: #1b2a2f;
  --border-strong: #304349;
  --text: #edf3f1;
  --muted: #8d9d99;
  --teal: #28caa0;
  --teal-soft: #0c2822;
  --blue: #68a9ff;
  --amber: #f6bd5b;
  --red: #ff7b7b;
  --font-body: 1rem;
  --font-meta: 0.875rem;
  --radius: 0.4rem;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  font-family: "Noto Sans TC", Inter, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); font-size: var(--font-body); line-height: 1.5; }
button, table { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: var(--space-3);
  left: var(--space-3);
  padding: var(--space-3) var(--space-4);
  color: #03130f;
  background: var(--teal);
  border-radius: 0.5rem;
  transform: translateY(-200%);
}
.skip-link:focus { transform: translateY(0); }

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4rem;
  padding: var(--space-3) clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--border);
  background: rgba(5, 11, 14, 0.92);
  backdrop-filter: blur(18px);
}
.brand, .topbar-actions, .topbar-controls, .source-status { display: flex; align-items: center; }
.brand { position: relative; padding-bottom: 0.55rem; color: inherit; text-decoration: none; }
.brand-accent { position: absolute; left: 0; bottom: 0; width: 2.75rem; height: 2px; background: var(--teal); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1rem; letter-spacing: 0.01em; }
.brand small { margin-top: 0.1rem; color: var(--muted); font-size: var(--font-meta); }
.topbar-actions { gap: var(--space-4); }
.topbar-controls { gap: var(--space-2); }
.source-status { gap: var(--space-2); color: var(--muted); font-size: var(--font-meta); }
.source-status time { padding-left: var(--space-2); border-left: 1px solid var(--border); }
.status-dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--amber); }
.source-status.is-fresh .status-dot { background: var(--teal); }
.source-status.is-stale .status-dot { background: var(--amber); }
.source-status.is-error .status-dot { background: var(--red); }
.language-select {
  min-height: 2.75rem;
  padding: 0 2.25rem 0 var(--space-3);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 0.5rem;
  background: var(--surface);
  cursor: pointer;
}
.language-select:hover { border-color: var(--teal); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

.primary-button, .secondary-button, .danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.8rem;
  padding: 0.7rem 1.1rem;
  border: 1px solid transparent;
  border-radius: 0.35rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.primary-button { color: #04140f; background: var(--teal); }
.primary-button:hover { background: #5ae0ba; }
.secondary-button { border-color: var(--border-strong); background: var(--surface); }
.danger-button { border-color: #783f45; color: #ffb4b4; background: #261518; }
.compact-button { min-height: 2.75rem; padding-inline: var(--space-4); }
button:disabled { cursor: wait; opacity: 0.65; }

.auth-view {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(24rem, 0.85fr);
  align-items: center;
  gap: clamp(3rem, 8vw, 8rem);
  width: 100%;
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(7.5rem, 12vh, 10rem) clamp(2rem, 5vw, 4.5rem) clamp(3rem, 8vh, 6rem);
  overflow: hidden;
}
.auth-background { position: fixed; z-index: -2; inset: 0; width: 100vw; height: 100vh; overflow: hidden; background: #03090b; }
.auth-background::after { position: absolute; content: ""; inset: 0; background: rgba(2, 8, 9, 0.08); }
.auth-gem-motion {
  position: absolute;
  inset: -2.5%;
  animation: auth-gem-drift 20s ease-in-out infinite alternate;
  will-change: transform;
}
.auth-background img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: 50% 50%;
  opacity: 1;
  transform: translate3d(0, var(--auth-gem-scroll-y, 0), 0) scale(1.035);
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
@supports (animation-timeline: scroll()) {
  .auth-background img {
    animation: auth-gem-scroll-parallax linear both;
    animation-timeline: scroll(root block);
    animation-range: 0 356px;
    transition: none;
  }
}
@keyframes auth-gem-scroll-parallax {
  from { transform: translate3d(0, 0, 0) scale(1.035); }
  to { transform: translate3d(0, -64px, 0) scale(1.035); }
}
@keyframes auth-gem-drift {
  0% { transform: translate3d(-0.35%, -0.2%, 0) scale(1.008); }
  50% { transform: translate3d(0.2%, 0.35%, 0) scale(1.015); }
  100% { transform: translate3d(0.45%, -0.1%, 0) scale(1.01); }
}
.auth-hero, .auth-card { position: relative; z-index: 1; }
.auth-hero { align-self: start; margin-top: clamp(10rem, 25vh, 17rem); padding-top: 0; }
.auth-hero .eyebrow { font-size: var(--font-meta); font-weight: 600; letter-spacing: 0.14em; }
.auth-hero h1 { max-width: 15ch; margin-top: 1.9rem; font-size: clamp(2.75rem, 3.4vw, 3.5rem); font-weight: 400; line-height: 1.45; letter-spacing: -0.02em; }
.auth-hero > p:not(.eyebrow) { max-width: 34rem; margin: 2rem 0; color: #c3cfcd; font-size: 1.15rem; font-weight: 300; line-height: 1.8; }
.trust-list { display: grid; grid-template-columns: repeat(3, max-content); margin: clamp(3.5rem, 10vh, 6.5rem) 0 0; padding: 0; list-style: none; }
.trust-list li { padding: 0 var(--space-6); color: #cad2d1; font-size: 0.88rem; font-weight: 300; letter-spacing: 0.02em; }
.trust-list li:first-child { padding-left: 0; }
.trust-list li + li { border-left: 1px solid rgba(203, 226, 222, 0.24); }
.auth-card { align-self: center; justify-self: end; width: min(100%, 31rem); padding: clamp(1.5rem, 4vw, 3rem) clamp(1.5rem, 2.4vw, 2rem); background: transparent; }
.auth-card h2 { font-size: clamp(1.9rem, 2.4vw, 2.15rem); font-weight: 600; letter-spacing: 0; }
.auth-card > p:not(.eyebrow) { margin: var(--space-3) 0 var(--space-6); color: #aebcba; font-size: 1rem; font-weight: 300; line-height: 1.7; }
.auth-card .primary-button { width: 100%; }
.auth-card small { display: block; margin-top: var(--space-4); color: var(--muted); line-height: 1.5; }
.auth-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0 0 clamp(2rem, 5vh, 3.25rem); border-bottom: 1px solid rgba(142, 165, 180, 0.28); }
.auth-tab { min-height: 4rem; padding: 0; border: 0; border-bottom: 3px solid transparent; color: #aebcba; background: transparent; font-size: 1.1rem; font-weight: 500; cursor: pointer; }
.auth-tab.is-active { color: var(--text); border-bottom-color: var(--teal); }
.account-form { display: grid; gap: var(--space-4); }
.account-form > h2 { margin-bottom: 0; }
.account-form > p { margin: 0 0 var(--space-2); color: var(--muted); line-height: 1.6; }
.account-form .secondary-button { width: 100%; }
.auth-card .field-group { gap: 0.7rem; }
.auth-card .field-group label { font-size: 0.9rem; font-weight: 500; }
.auth-card .field-group input { min-height: 4rem; border-color: rgba(174, 195, 191, 0.38); border-radius: 0.65rem; background: rgba(3, 10, 12, 0.76); }
.auth-card .field-group input:focus { border-color: var(--teal); }
.auth-card .primary-button { min-height: 4rem; margin-top: var(--space-2); color: #f2fffb; border-radius: 0.6rem; background: #168f6d; font-size: 1.08rem; font-weight: 500; }
.auth-card .primary-button:hover { background: #169a75; }
.auth-card .text-button { justify-self: end; }
.text-button { justify-self: center; padding: 0.25rem; border: 0; color: var(--teal); background: transparent; font: inherit; font-size: var(--font-meta); font-weight: 800; cursor: pointer; }
.text-button:hover { text-decoration: underline; }
.password-hint { font-size: var(--font-meta); }

body.auth-mode { background: #03090b; font-family: "Noto Sans TC", "Segoe UI", sans-serif; }
body.auth-mode :focus-visible { outline: 2px solid rgba(65, 220, 177, 0.7); outline-offset: 2px; }
body.auth-mode .auth-tab:focus-visible { outline-offset: -4px; }
body.auth-mode .topbar { position: absolute; top: clamp(2.5rem, 5.5vh, 3.75rem); width: 100%; min-height: 3.5rem; padding: 0 clamp(2rem, 4.5vw, 4.5rem); border-bottom: 0; background: transparent; backdrop-filter: none; }
body.auth-mode .brand strong { font-size: 1.35rem; font-weight: 500; }
body.auth-mode .brand small { margin-top: 0.35rem; font-size: var(--font-meta); font-weight: 300; letter-spacing: 0.28em; }
body.auth-mode .language-select { min-height: 3.4rem; padding: 0 3rem 0 1.5rem; border-color: rgba(205, 226, 223, 0.32); border-radius: 2rem; background: rgba(4, 12, 14, 0.42); font-size: 1rem; font-weight: 400; }
body.auth-mode .dashboard, body.auth-mode .footer, body.auth-mode .skip-link { display: none; }

.portal-intro { display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); margin-bottom: var(--space-6); }
.portal-intro h1 { font-size: clamp(1.8rem, 3vw, 2.5rem); }
.security-badge { padding: 0; color: var(--teal); border: 0; background: transparent; font-size: var(--font-meta); font-weight: 600; white-space: nowrap; }

.connection-panel { margin-bottom: var(--space-6); }
.connection-header { align-items: flex-start; }
.panel-description.flush { padding: 0; margin-top: var(--space-2); }
.connection-status { padding: 0.45rem 0.7rem; border: 1px solid var(--border-strong); border-radius: 0.3rem; color: var(--muted); font-size: var(--font-meta); font-weight: 600; white-space: nowrap; }
.connection-status[data-state="connected"] { color: var(--teal); border-color: #276e5e; background: var(--teal-soft); }
.connection-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(17rem, 0.45fr); gap: var(--space-8); padding: var(--space-6); }
.connection-form { display: grid; gap: var(--space-4); }
.field-group { display: grid; gap: var(--space-2); }
.field-group label { color: #c8d9df; font-size: var(--font-meta); font-weight: 750; }
.field-group input { width: 100%; min-height: 3rem; padding: 0.75rem 0.9rem; border: 1px solid var(--border-strong); border-radius: 0.5rem; color: var(--text); background: #08131e; }
.field-group input::placeholder { color: #647d8d; }
.field-group input:focus { border-color: var(--teal); }
.password-field { position: relative; }
.password-field input { padding-right: 5rem; }
.reveal-button { position: absolute; top: 50%; right: 0.45rem; transform: translateY(-50%); padding: 0.4rem 0.6rem; border: 0; color: var(--teal); background: transparent; cursor: pointer; font-size: var(--font-meta); font-weight: 800; }
.form-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-2); }
.form-message { min-height: 1.25rem; margin: 0; color: var(--muted); font-size: var(--font-meta); }
.permission-card { padding: var(--space-2) 0 var(--space-2) var(--space-6); border: 0; border-left: 1px solid var(--border); border-radius: 0; background: transparent; }
.permission-card h3 { margin: 0; font-size: 1rem; }
.permission-card ul { display: grid; gap: var(--space-3); margin: var(--space-4) 0; padding-left: 1.2rem; color: var(--muted); font-size: var(--font-meta); line-height: 1.5; }
.permission-card li::marker { color: var(--teal); }
.connection-summary { display: grid; gap: var(--space-3); margin: var(--space-5) 0 0; padding-top: var(--space-4); border-top: 1px solid var(--border); }
.connection-summary div { display: grid; gap: var(--space-1); }
.connection-summary dt { color: var(--muted); font-size: var(--font-meta); }
.connection-summary dd { margin: 0; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: var(--font-meta); overflow-wrap: anywhere; }

.bot-control-panel { display: grid; grid-template-columns: minmax(15rem, 1fr) minmax(24rem, 1.3fr) auto; align-items: center; gap: var(--space-6); margin-bottom: var(--space-6); padding: var(--space-5); }
.bot-control-panel[data-state="running"] { border-color: #276e5e; background: var(--surface); }
.bot-control-panel[data-state="faulted"] { border-color: #783f45; }
.bot-status-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); margin: 0; }
.bot-status-grid div { min-width: 0; padding-left: var(--space-3); border-left: 1px solid var(--border); }
.bot-status-grid dt { color: var(--muted); font-size: var(--font-meta); }
.bot-status-grid dd { margin: var(--space-1) 0 0; font-size: var(--font-meta); font-weight: 750; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.bot-actions { display: flex; gap: var(--space-2); }
.bot-control-panel > .form-message { grid-column: 1 / -1; }

.dashboard { width: min(88rem, 100%); margin: 0 auto; padding: clamp(1.5rem, 3vw, 2.5rem) clamp(1rem, 3vw, 2.5rem) 4rem; }
.dashboard .eyebrow { display: none; }
.warning-panel, .hero, .panel-header, .chart-legend { display: flex; align-items: center; }
.warning-panel[hidden] { display: none; }
.warning-panel {
  justify-content: space-between;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
  padding: var(--space-4) var(--space-5);
  border: 1px solid #7a5929;
  border-left: 0.3rem solid var(--amber);
  border-radius: 0.4rem;
  background: #18150f;
}
.warning-panel h2 { margin: 0.1rem 0 0; font-size: 1rem; }
.warning-panel ul { margin: 0; color: #f5dba8; font-size: var(--font-meta); }

.hero { justify-content: space-between; gap: var(--space-8); margin: var(--space-8) 0 var(--space-5); }
.eyebrow { margin: 0 0 var(--space-2); color: var(--teal); font-size: var(--font-meta); font-weight: 800; letter-spacing: 0.14em; }
h1, h2, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1.08; letter-spacing: -0.04em; }
h2 { margin: 0; font-size: 1.05rem; letter-spacing: -0.01em; }
.hero-copy { max-width: 52rem; margin: var(--space-3) 0 0; color: var(--muted); line-height: 1.65; }
.metric-strip { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: var(--space-5); border: 1px solid var(--border); border-radius: 0.4rem; background: var(--surface); overflow: hidden; }
.metric-strip.three-metrics { grid-template-columns: repeat(3, 1fr); }
.metric { min-width: 0; padding: var(--space-5); border-right: 1px solid var(--border); }
.metric:last-child { border-right: 0; }
.metric span, .metric small { display: block; color: var(--muted); }
.metric span { font-size: var(--font-meta); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.metric strong { display: block; margin: var(--space-2) 0; font-size: clamp(1.35rem, 2.4vw, 2rem); font-variant-numeric: tabular-nums; }
.metric small { font-size: var(--font-meta); }
.metric.primary strong { color: var(--teal); }
.metric.accent { background: var(--surface); }
.metric.accent strong { color: var(--teal); }

.content-grid, .details-grid { display: grid; gap: var(--space-5); }
.overview-grid { grid-template-columns: minmax(19rem, 0.78fr) minmax(28rem, 1.22fr); }
.overview-grid > * { min-width: 0; }
.panel { border: 1px solid var(--border); border-radius: 0.4rem; background: var(--surface); }
.panel-header { justify-content: space-between; gap: var(--space-4); min-height: 4.5rem; padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border); }
.readonly-pill, .count-pill { padding: var(--space-1) var(--space-3); border: 1px solid var(--border-strong); border-radius: 0.3rem; color: var(--muted); font-size: var(--font-meta); white-space: nowrap; }
.readonly-pill { color: var(--teal); border-color: #276e5e; }

.portfolio-list { margin: 0; padding: var(--space-3) var(--space-5) var(--space-5); }
.portfolio-list > div { display: flex; justify-content: space-between; gap: var(--space-4); padding: var(--space-3) 0; border-bottom: 1px solid var(--border); }
.portfolio-list > div:last-child { border-bottom: 0; }
.portfolio-list dt { color: var(--muted); }
.portfolio-list dd { margin: 0; font-weight: 750; font-variant-numeric: tabular-nums; }
.portfolio-list .portfolio-total { margin-top: var(--space-2); padding-top: var(--space-4); color: var(--teal); font-size: 1.1rem; }

.chart-panel { margin-top: var(--space-5); }
.chart-header { align-items: flex-start; }
.chart-legend { flex-wrap: wrap; gap: var(--space-4); color: var(--muted); font-size: var(--font-meta); }
.chart-legend span { display: flex; align-items: center; gap: var(--space-2); }
.chart-legend i { width: 1.4rem; height: 0.18rem; border-radius: 999px; }
.legend-frr { background: var(--teal); }
.legend-bid { background: var(--red); }
.legend-ask { background: var(--blue); }
.chart-values { display: flex; flex-wrap: wrap; gap: var(--space-3); margin: 0; padding: var(--space-4) var(--space-5) 0; }
.chart-values div { min-width: 8.5rem; padding: 0 var(--space-5) 0 0; }
.chart-values div + div { border-left: 1px solid var(--border); padding-left: var(--space-5); }
.chart-values dt { color: var(--muted); font-size: var(--font-meta); text-transform: uppercase; }
.chart-values dd { margin: var(--space-1) 0 0; font-size: 1.05rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.chart-stage { min-height: 18rem; padding: var(--space-5); overflow-x: auto; }
.chart-stage svg { display: block; width: 100%; min-height: 15rem; overflow: visible; }
.chart-grid { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-hour-grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 7; opacity: 0.55; vector-effect: non-scaling-stroke; }
.chart-axis-label { fill: var(--muted); font-size: var(--font-meta); font-variant-numeric: tabular-nums; }
.chart-hour-label { font-size: var(--font-meta); }
.chart-line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart-line-frr { stroke: var(--teal); }
.chart-line-bid { stroke: var(--red); }
.chart-line-ask { stroke: var(--blue); }
.chart-sparse-segment { opacity: 0.85; }
.chart-point { stroke: var(--bg); stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart-point-frr { fill: var(--teal); }
.chart-point-bid { fill: var(--red); }
.chart-point-ask { fill: var(--blue); }

.panel-description { margin: 0; padding: var(--space-4) var(--space-5) 0; color: var(--muted); font-size: var(--font-meta); }
.earnings-scroll { max-height: 15rem; margin-top: var(--space-3); }
.earnings-amount { color: var(--teal); font-weight: 750; }

.details-grid { grid-template-columns: 1fr; margin-top: var(--space-5); }
.details-grid > * { min-width: 0; }
.table-summary-header { align-items: flex-start; min-height: 8.5rem; }
.table-header-meta { display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-2); min-width: min(20rem, 62%); }
.table-header-meta small { color: var(--muted); font-size: var(--font-meta); }
.position-yield { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); width: 100%; margin: 0; }
.position-yield div { min-width: 0; text-align: right; }
.position-yield dt { color: var(--muted); font-size: var(--font-meta); }
.position-yield dd { margin: var(--space-1) 0 0; color: var(--teal); font-size: 0.95rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.table-scroll { max-height: 25rem; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: var(--font-meta); }
th, td { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
th { position: sticky; z-index: 1; top: 0; color: var(--muted); background: var(--surface); font-size: var(--font-meta); text-transform: uppercase; letter-spacing: 0.05em; }
td { font-variant-numeric: tabular-nums; }
.sort-button { display: inline-flex; align-items: center; justify-content: flex-start; gap: var(--space-2); width: 100%; padding: var(--space-3) var(--space-4); border: 0; background: transparent; color: inherit; font-weight: 700; text-align: left; text-transform: inherit; letter-spacing: inherit; cursor: pointer; }
th:has(.sort-button) { padding: 0; }
.sort-button:hover { color: var(--text); }
.sort-indicator { display: inline-grid; place-items: center; width: 1rem; color: var(--muted); font-size: var(--font-meta); line-height: 1; }
th[aria-sort="ascending"] .sort-button, th[aria-sort="descending"] .sort-button { color: var(--teal); }
th[aria-sort="ascending"] .sort-indicator, th[aria-sort="descending"] .sort-indicator { color: var(--teal); }
.empty-cell, .empty-copy { color: var(--muted); text-align: center; }
.type-pill { display: inline-flex; padding: 0.18rem 0.45rem; border: 1px solid var(--border-strong); border-radius: 0.35rem; font-size: var(--font-meta); font-weight: 800; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.footer { display: flex; justify-content: space-between; gap: var(--space-4); padding: var(--space-6) clamp(1rem, 4vw, 3rem); border-top: 1px solid var(--border); color: var(--muted); font-size: var(--font-meta); }

@media (min-width: 901px) and (max-height: 800px) {
  .auth-view { padding-top: 6rem; padding-bottom: 1.5rem; }
  .auth-hero { margin-top: 7rem; }
  .auth-hero h1 { margin-top: 1.25rem; line-height: 1.35; }
  .auth-hero > p:not(.eyebrow) { margin: 1.25rem 0; }
  .trust-list { margin-top: 2.75rem; }
  .auth-card { padding-block: 0.75rem; }
  .auth-tabs { margin-bottom: 1.5rem; }
  .auth-tab { min-height: 3.25rem; }
  .account-form { gap: 0.75rem; }
  .auth-card h2 { font-size: 1.75rem; }
  .auth-card > p:not(.eyebrow) { margin: 0.4rem 0 1rem; }
  .auth-card .field-group input, .auth-card .primary-button { min-height: 3.4rem; }
  .auth-card small { margin-top: 0.75rem; }
}

@media (max-width: 900px) {
  .auth-background img { object-fit: cover; }
  .auth-view, .connection-layout { grid-template-columns: 1fr; }
  .bot-control-panel { grid-template-columns: 1fr; align-items: start; }
  .bot-control-panel > .form-message { grid-column: auto; }
  .auth-view { align-items: start; gap: var(--space-8); padding-top: 7rem; }
  .auth-hero { align-self: auto; margin-top: 0; padding-top: 0; }
  .auth-hero h1 { max-width: 12ch; }
  .auth-card { justify-self: stretch; width: min(100%, 34rem); }
  .metric-strip, .metric-strip.three-metrics { grid-template-columns: repeat(2, 1fr); }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .content-grid, .details-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .topbar, .topbar-actions, .hero, .warning-panel, .footer { align-items: flex-start; flex-direction: column; }
  .topbar { position: static; }
  .topbar-actions { width: 100%; }
  .language-select, .compact-button { flex: 1; }
  .portal-intro, .connection-header { align-items: flex-start; flex-direction: column; }
  .auth-view { min-height: 100vh; padding: 6.5rem 1rem 2.5rem; }
  .auth-hero h1 { font-size: clamp(2.55rem, 13vw, 3.4rem); }
  .auth-hero > p:not(.eyebrow) { font-size: 0.95rem; }
  .trust-list { grid-template-columns: 1fr; gap: 0; margin-top: 2.25rem; }
  .trust-list li { padding: 0.75rem 0; border-top: 1px solid rgba(203, 226, 222, 0.2); }
  .trust-list li + li { border-left: 0; }
  .auth-card { padding: 1.5rem 0; background: transparent; }
  body.auth-mode .topbar { position: absolute; flex-direction: row; align-items: center; min-height: 4.75rem; padding: 1rem; }
  body.auth-mode .topbar-actions { width: auto; }
  body.auth-mode .source-status, body.auth-mode .compact-button { display: none !important; }
  body.auth-mode .brand small { display: none; }
  body.auth-mode .language-select { min-width: 8rem; }
  .bot-status-grid { grid-template-columns: 1fr; }
  .topbar-controls { width: 100%; }
  .source-status { flex-wrap: wrap; }
  .dashboard { padding-top: var(--space-6); }
  .hero { gap: var(--space-4); }
  .metric-strip, .metric-strip.three-metrics { grid-template-columns: 1fr; }
  .metric { border-right: 0; border-bottom: 1px solid var(--border); }
  .metric:last-child { border-bottom: 0; }
  .panel-header { align-items: flex-start; }
  .table-summary-header { flex-direction: column; }
  .table-header-meta { align-items: flex-start; width: 100%; max-width: none; }
  .position-yield div { text-align: left; }
  .chart-header { flex-direction: column; }
  .table-scroll { max-height: 20rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
  .auth-gem-motion { animation: none !important; }
  .auth-background img { animation: none !important; transform: scale(1.035) !important; }
}

/* Authenticated portal — restrained financial workspace */
body:not(.auth-mode) {
  background:
    radial-gradient(circle at 88% 0%, rgba(18, 105, 81, 0.12), transparent 28rem),
    linear-gradient(180deg, #03090b 0%, #050c0f 100%);
}
body:not(.auth-mode) .topbar {
  position: relative;
  min-height: 5rem;
  padding-inline: max(2rem, calc((100vw - 80rem) / 2));
  border-bottom: 0;
  background: rgba(3, 9, 11, 0.82);
}
body:not(.auth-mode) .brand { padding-bottom: 0.65rem; }
body:not(.auth-mode) .brand strong { font-size: 1.05rem; font-weight: 500; }
body:not(.auth-mode) .brand small { font-weight: 300; letter-spacing: 0.08em; }
body:not(.auth-mode) .brand-accent { width: 2rem; height: 1px; }
body:not(.auth-mode) .portal-nav {
  display: flex;
  align-self: stretch;
  align-items: stretch;
  gap: 2rem;
  margin-left: auto;
}
body:not(.auth-mode) .portal-nav[hidden] { display: none; }
body:not(.auth-mode) .portal-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  color: #879995;
  font-size: var(--font-meta);
  font-weight: 450;
  letter-spacing: 0.04em;
  text-decoration: none;
}
body:not(.auth-mode) .portal-nav a::after {
  position: absolute;
  right: 0;
  bottom: 0.85rem;
  left: 0;
  height: 1px;
  background: transparent;
  content: "";
}
body:not(.auth-mode) .portal-nav a:hover,
body:not(.auth-mode) .portal-nav a:focus-visible,
body:not(.auth-mode) .portal-nav a[aria-current="page"] { color: #edf5f3; }
body:not(.auth-mode) .portal-nav a[aria-current="page"]::after { background: var(--teal); }
body:not(.auth-mode) .portal-page h1[tabindex="-1"]:focus { outline: none; }
body:not(.auth-mode) .topbar-actions { margin-left: 2rem; }
body:not(.auth-mode) .language-select,
body:not(.auth-mode) .secondary-button {
  border-color: rgba(149, 175, 169, 0.3);
  border-radius: 0.3rem;
  background: rgba(5, 14, 17, 0.72);
  font-weight: 500;
}
body:not(.auth-mode) .dashboard {
  width: min(80rem, 100%);
  padding: clamp(2.5rem, 5vw, 4.75rem) clamp(1.25rem, 4vw, 3rem) 5rem;
}
body:not(.auth-mode) .legal-reacceptance-panel {
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid rgba(181, 138, 64, 0.42);
  border-radius: 0.55rem;
  background:
    linear-gradient(135deg, rgba(181, 138, 64, 0.12), transparent 48%),
    rgba(5, 14, 17, 0.78);
  box-shadow: 0 1.25rem 3rem rgba(0, 0, 0, 0.2);
}
body:not(.auth-mode) .legal-reacceptance-panel form {
  display: grid;
  gap: 1.4rem;
}
body:not(.auth-mode) .legal-reacceptance-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 1rem;
}
body:not(.auth-mode) .legal-reacceptance-mark {
  display: grid;
  width: 2.6rem;
  height: 2.6rem;
  border: 1px solid rgba(224, 181, 101, 0.62);
  border-radius: 50%;
  color: #f2cf8b;
  font-size: 1.2rem;
  font-weight: 650;
  place-items: center;
}
body:not(.auth-mode) .legal-reacceptance-header .eyebrow {
  margin: 0 0 0.35rem;
  color: #d2aa61;
  font-size: var(--font-meta);
  font-weight: 650;
  letter-spacing: 0.15em;
}
body:not(.auth-mode) .legal-reacceptance-header h2 {
  margin: 0;
  color: #eef5f2;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  font-weight: 550;
}
body:not(.auth-mode) .legal-reacceptance-header p:last-child {
  max-width: 46rem;
  margin: 0.55rem 0 0;
  color: #9aaba6;
  line-height: 1.7;
}
body:not(.auth-mode) .legal-reacceptance-confirmation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem 1.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(181, 138, 64, 0.24);
}
body:not(.auth-mode) .legal-reacceptance-confirmation .legal-checkbox {
  margin: 0;
  color: #cad7d3;
  font-size: var(--font-body);
}
body:not(.auth-mode) .legal-reacceptance-confirmation a {
  color: #69d5b6;
  text-underline-offset: 0.18em;
}
body:not(.auth-mode) .legal-reacceptance-confirmation .primary-button {
  min-width: 10rem;
  min-height: 3rem;
}
body:not(.auth-mode) .legal-reacceptance-message {
  min-height: 0;
  margin: -0.65rem 0 0 3.6rem;
}
body:not(.auth-mode) .portal-intro {
  align-items: flex-end;
  margin-bottom: 2.75rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid rgba(129, 157, 151, 0.22);
}
body:not(.auth-mode) .portal-intro h1,
body:not(.auth-mode) .hero h1 {
  font-size: clamp(1.8rem, 3vw, 2.35rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.025em;
}
body:not(.auth-mode) .portal-intro .hero-copy,
body:not(.auth-mode) .hero-copy {
  margin-top: 0.65rem;
  color: #95a5a1;
  font-size: 0.92rem;
  font-weight: 300;
  letter-spacing: 0.015em;
}
body:not(.auth-mode) .tutorial-intro {
  max-width: 48rem;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(129, 157, 151, 0.22);
}
body:not(.auth-mode) .tutorial-intro .eyebrow {
  display: block;
  margin-bottom: 0.75rem;
  color: var(--teal);
  font-size: var(--font-meta);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
body:not(.auth-mode) .tutorial-intro h1 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 450;
  line-height: 1.15;
  letter-spacing: -0.035em;
}
body:not(.auth-mode) .tutorial-intro p:last-child {
  max-width: 42rem;
  margin: 1rem 0 0;
  color: #95a5a1;
  font-size: 0.95rem;
  font-weight: 300;
  line-height: 1.8;
}
body:not(.auth-mode) .pricing-page {
  padding-bottom: 2rem;
}
body:not(.auth-mode) .pricing-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 2rem;
  margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(129, 157, 151, 0.22);
}
body:not(.auth-mode) .pricing-intro .eyebrow {
  display: block;
  margin-bottom: 0.8rem;
  color: var(--teal);
  font-size: var(--font-meta);
  font-weight: 600;
  letter-spacing: 0.16em;
}
body:not(.auth-mode) .pricing-intro h1 {
  max-width: 42rem;
  font-size: clamp(2rem, 4vw, 3.6rem);
  font-weight: 450;
  line-height: 1.08;
  letter-spacing: -0.045em;
}
body:not(.auth-mode) .pricing-intro > div > p:last-child {
  max-width: 42rem;
  margin: 1rem 0 0;
  color: #95a5a1;
  font-size: 0.95rem;
  font-weight: 300;
  line-height: 1.75;
}
body:not(.auth-mode) .pricing-payment {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(45, 196, 154, 0.4);
  border-radius: 0.4rem;
  background: rgba(8, 22, 24, 0.58);
}
body:not(.auth-mode) .pricing-account-meta {
  display: grid;
  gap: 0.75rem;
  width: 15rem;
}
body:not(.auth-mode) .pricing-payment-mark {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid rgba(45, 196, 154, 0.55);
  border-radius: 50%;
  color: #70e2c1;
  font-size: 1rem;
  font-weight: 650;
  place-items: center;
}
body:not(.auth-mode) .pricing-payment > span:last-child {
  display: grid;
  gap: 0.2rem;
}
body:not(.auth-mode) .pricing-payment strong {
  color: #edf7f4;
  font-size: var(--font-meta);
  font-weight: 550;
}
body:not(.auth-mode) .pricing-payment small {
  color: #82948f;
  font-size: var(--font-meta);
}
body:not(.auth-mode) .pricing-membership {
  display: grid;
  gap: 0.25rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(129, 157, 151, 0.24);
  border-radius: 0.4rem;
  background: rgba(8, 22, 24, 0.42);
}
body:not(.auth-mode) .pricing-membership > span {
  color: #82948f;
  font-size: var(--font-meta);
}
body:not(.auth-mode) .pricing-membership > strong {
  color: #edf7f4;
  font-size: 1rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
body:not(.auth-mode) .pricing-membership > small {
  color: #61736e;
  font-size: var(--font-meta);
}
body:not(.auth-mode) .pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid rgba(129, 157, 151, 0.3);
  border-bottom: 1px solid rgba(129, 157, 151, 0.3);
}
body:not(.auth-mode) .pricing-billing-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1rem;
}
body:not(.auth-mode) .pricing-billing-bar > p {
  margin: 0;
  color: #71837e;
  font-size: var(--font-meta);
  line-height: 1.6;
}
body:not(.auth-mode) .pricing-billing-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(7rem, 1fr));
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid rgba(45, 196, 154, 0.35);
  border-radius: 0.4rem;
  background: rgba(8, 22, 24, 0.58);
}
body:not(.auth-mode) .pricing-billing-toggle button {
  min-height: 2.6rem;
  padding: 0 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border: 0;
  border-radius: 0.25rem;
  color: #93a49f;
  background: transparent;
  font: 600 var(--font-meta)/1 "Noto Sans TC", "Segoe UI", sans-serif;
  cursor: pointer;
}
body:not(.auth-mode) .pricing-billing-toggle button.is-active {
  color: #03120d;
  background: var(--teal);
}
body:not(.auth-mode) .pricing-billing-toggle button:focus-visible {
  outline: 2px solid #dff9ed;
  outline-offset: 2px;
}
body:not(.auth-mode) .pricing-billing-toggle small {
  margin: 0;
  padding: 0.3rem 0.5rem;
  border: 1px solid rgba(45, 196, 154, 0.32);
  border-radius: 999px;
  color: #7de1c3;
  background: rgba(45, 196, 154, 0.08);
  font-size: var(--font-meta);
}
body:not(.auth-mode) .pricing-billing-toggle button.is-active small {
  border-color: rgba(3, 18, 13, 0.2);
  color: #062118;
  background: rgba(3, 18, 13, 0.1);
}
body:not(.auth-mode) .pricing-card {
  min-width: 0;
  padding: clamp(1.4rem, 2.5vw, 2rem);
}
body:not(.auth-mode) .pricing-card + .pricing-card {
  border-left: 1px solid rgba(129, 157, 151, 0.2);
}
body:not(.auth-mode) .pricing-card header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
body:not(.auth-mode) .pricing-card header span {
  color: var(--teal);
  font-size: var(--font-meta);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.1em;
}
body:not(.auth-mode) .pricing-card header small {
  color: #71837e;
  font-size: var(--font-meta);
  font-weight: 450;
}
body:not(.auth-mode) .pricing-card h2 {
  margin: 0;
  color: #dfe9e6;
  font-size: clamp(1.05rem, 1.7vw, 1.3rem);
  font-weight: 500;
  letter-spacing: -0.015em;
}
body:not(.auth-mode) .pricing-card h2 small {
  color: #71837e;
  font-size: var(--font-meta);
  font-weight: 500;
  letter-spacing: 0.06em;
}
body:not(.auth-mode) .pricing-rate {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: flex-end;
  gap: 0.25rem 0.65rem;
  margin: clamp(2.4rem, 5vw, 4rem) 0 0;
}
body:not(.auth-mode) .pricing-rate > del {
  grid-column: 1 / -1;
  color: #71837e;
  font-size: var(--font-meta);
  font-weight: 500;
  text-decoration-color: #e59a79;
  text-decoration-thickness: 1px;
}
body:not(.auth-mode) .pricing-rate > strong {
  color: #f2faf7;
  font-size: clamp(2.6rem, 4vw, 4.3rem);
  font-weight: 400;
  line-height: 0.8;
  letter-spacing: -0.055em;
}
body:not(.auth-mode) .pricing-rate > span {
  display: grid;
  gap: 0.1rem;
}
body:not(.auth-mode) .pricing-rate b {
  color: #b9c7c3;
  font-size: var(--font-meta);
  font-weight: 550;
}
body:not(.auth-mode) .pricing-rate small {
  color: #71837e;
  font-size: var(--font-meta);
}
body:not(.auth-mode) .pricing-custom {
  display: grid;
  grid-template-columns: 10rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 2rem;
  margin-top: 2rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid rgba(129, 157, 151, 0.22);
}
body:not(.auth-mode) .pricing-custom > span {
  color: var(--teal);
  font-size: var(--font-meta);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}
body:not(.auth-mode) .pricing-custom h2 {
  margin: 0 0 0.3rem;
  font-size: 1rem;
  font-weight: 500;
}
body:not(.auth-mode) .pricing-custom p {
  margin: 0;
  color: #82948f;
  font-size: var(--font-meta);
  line-height: 1.6;
}
body:not(.auth-mode) .pricing-custom > strong {
  color: #dbe7e3;
  font-size: var(--font-meta);
  font-weight: 500;
}
body:not(.auth-mode) .pricing-footnote {
  margin: 1rem 0 0;
  color: #61736e;
  font-size: var(--font-meta);
  line-height: 1.6;
}
body:not(.auth-mode) .return-calculator {
  margin-top: clamp(3rem, 6vw, 5rem);
  border-top: 1px solid rgba(129, 157, 151, 0.3);
  border-bottom: 1px solid rgba(129, 157, 151, 0.22);
}
body:not(.auth-mode) .calculator-page .return-calculator {
  margin-top: 0;
}
body:not(.auth-mode) .return-calculator-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  padding: 2rem 0;
}
body:not(.auth-mode) .return-calculator-header .eyebrow {
  display: block;
  margin: 0 0 0.65rem;
  color: var(--teal);
  font-size: var(--font-meta);
  font-weight: 600;
  letter-spacing: 0.16em;
}
body:not(.auth-mode) .return-calculator-header h2 {
  margin: 0;
  color: #edf7f4;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 450;
  letter-spacing: -0.035em;
}
body:not(.auth-mode) .return-calculator-header p:last-child {
  max-width: 42rem;
  margin: 0.75rem 0 0;
  color: #82948f;
  font-size: var(--font-meta);
  line-height: 1.7;
}
body:not(.auth-mode) .calculator-net-badge {
  flex: 0 0 auto;
  padding: 0.55rem 0.8rem;
  border: 1px solid rgba(45, 196, 154, 0.38);
  border-radius: 999px;
  color: #8de7cc;
  font-size: var(--font-meta);
  font-weight: 550;
}
body:not(.auth-mode) .return-calculator-body {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(22rem, 0.85fr);
  border-top: 1px solid rgba(129, 157, 151, 0.2);
  border-bottom: 1px solid rgba(129, 157, 151, 0.2);
}
body:not(.auth-mode) .calculator-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  padding: 2rem 2rem 2rem 0;
}
body:not(.auth-mode) .calculator-inputs > label,
body:not(.auth-mode) .calculator-inputs fieldset {
  display: grid;
  align-content: start;
  gap: 0.55rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  color: #a8b8b3;
  font-size: var(--font-meta);
}
body:not(.auth-mode) .calculator-inputs legend {
  margin-bottom: 0.55rem;
  padding: 0;
}
body:not(.auth-mode) .calculator-input-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 3.25rem;
  border: 1px solid rgba(129, 157, 151, 0.28);
  border-radius: 0.35rem;
  background: rgba(5, 17, 18, 0.78);
}
body:not(.auth-mode) .calculator-input-shell:focus-within {
  border-color: rgba(45, 196, 154, 0.75);
  box-shadow: 0 0 0 2px rgba(45, 196, 154, 0.12);
}
body:not(.auth-mode) .calculator-input-shell input {
  width: 100%;
  min-width: 0;
  padding: 0 0.9rem;
  border: 0;
  outline: 0;
  color: #edf7f4;
  background: transparent;
  font: 500 1rem/1 "Noto Sans TC", "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
}
body:not(.auth-mode) .calculator-input-shell input:disabled {
  color: #60716c;
  cursor: not-allowed;
}
body:not(.auth-mode) .calculator-input-shell b {
  padding: 0 0.9rem;
  color: #71837e;
  font-size: var(--font-meta);
  font-weight: 550;
}
body:not(.auth-mode) .calculator-rate-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}
body:not(.auth-mode) .calculator-rate-options label {
  position: relative;
  cursor: pointer;
}
body:not(.auth-mode) .calculator-rate-options input {
  position: absolute;
  opacity: 0;
}
body:not(.auth-mode) .calculator-rate-options span {
  display: grid;
  min-height: 3.25rem;
  padding: 0 0.7rem;
  place-items: center;
  border: 1px solid rgba(129, 157, 151, 0.24);
  border-radius: 0.35rem;
  color: #879993;
  background: rgba(5, 17, 18, 0.58);
  text-align: center;
}
body:not(.auth-mode) .calculator-rate-options input:checked + span {
  border-color: rgba(45, 196, 154, 0.65);
  color: #dff9ef;
  background: rgba(24, 86, 70, 0.28);
}
body:not(.auth-mode) .calculator-rate-options input:focus-visible + span {
  outline: 2px solid #dff9ed;
  outline-offset: 2px;
}
body:not(.auth-mode) .calculator-frr-line {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0;
  padding-top: 0.25rem;
  color: #71837e;
  font-size: var(--font-meta);
}
body:not(.auth-mode) .calculator-frr-line strong {
  color: #9ce8d1;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
}
body:not(.auth-mode) .calculator-message {
  grid-column: 1 / -1;
  min-height: 1.5rem;
  margin: 0;
  color: #ffb4a8;
  font-size: var(--font-meta);
  line-height: 1.5;
}
body:not(.auth-mode) .calculator-message:empty {
  visibility: hidden;
}
body:not(.auth-mode) .calculator-results {
  display: grid;
  border-left: 1px solid rgba(129, 157, 151, 0.2);
}
body:not(.auth-mode) .calculator-results div {
  display: grid;
  align-content: center;
  gap: 0.45rem;
  min-height: 6.5rem;
  padding: 1.4rem 2rem;
}
body:not(.auth-mode) .calculator-results div + div {
  border-top: 1px solid rgba(129, 157, 151, 0.16);
}
body:not(.auth-mode) .calculator-results span {
  color: #71837e;
  font-size: var(--font-meta);
}
body:not(.auth-mode) .calculator-results strong {
  color: #edf7f4;
  font-size: clamp(1.5rem, 3vw, 2.3rem);
  font-weight: 430;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}
body:not(.auth-mode) .calculator-fee-note {
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr);
  gap: 0.4rem 2rem;
  padding: 1.5rem 0;
}
body:not(.auth-mode) .calculator-fee-note strong {
  grid-row: 1 / span 2;
  color: #dce9e5;
  font-size: var(--font-meta);
  font-weight: 550;
}
body:not(.auth-mode) .calculator-fee-note p,
body:not(.auth-mode) .calculator-fee-note small {
  margin: 0;
  color: #82948f;
  font-size: var(--font-meta);
  line-height: 1.65;
}
body:not(.auth-mode) .calculator-fee-note small {
  color: #61736e;
}
body:not(.auth-mode) .tutorial-layout {
  display: grid;
  grid-template-columns: minmax(11rem, 0.38fr) minmax(0, 1.62fr);
  gap: clamp(2.5rem, 6vw, 6rem);
}
body:not(.auth-mode) .tutorial-index {
  display: grid;
  align-content: start;
  border-top: 1px solid rgba(129, 157, 151, 0.22);
}
body:not(.auth-mode) .tutorial-index a {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.65rem;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(129, 157, 151, 0.16);
  color: #93a39f;
  font-size: var(--font-meta);
  line-height: 1.5;
  text-decoration: none;
}
body:not(.auth-mode) .tutorial-index a:hover,
body:not(.auth-mode) .tutorial-index a:focus-visible { color: #eef7f4; }
body:not(.auth-mode) .tutorial-index a span:first-child {
  color: var(--teal);
  font-variant-numeric: tabular-nums;
}
body:not(.auth-mode) .tutorial-content { border-top: 1px solid rgba(129, 157, 151, 0.22); }
body:not(.auth-mode) .tutorial-step {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr);
  gap: clamp(1.5rem, 3vw, 3rem);
  padding: clamp(2rem, 4vw, 3.5rem) 0;
  border-bottom: 1px solid rgba(129, 157, 151, 0.22);
  scroll-margin-top: 2rem;
}
body:not(.auth-mode) .tutorial-step-number {
  color: #2dc49a;
  font-size: var(--font-meta);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.12em;
}
body:not(.auth-mode) .tutorial-step h2 {
  margin: -0.35rem 0 0.85rem;
  font-size: clamp(1.3rem, 2vw, 1.75rem);
  font-weight: 500;
  letter-spacing: -0.02em;
}
body:not(.auth-mode) .tutorial-step p {
  max-width: 46rem;
  margin: 0;
  color: #91a39e;
  font-size: 0.9rem;
  font-weight: 300;
  line-height: 1.8;
}
body:not(.auth-mode) .tutorial-detail-list {
  display: grid;
  gap: 0.75rem;
  margin: 1.5rem 0;
  padding: 0;
  list-style: none;
}
body:not(.auth-mode) .tutorial-detail-list li {
  position: relative;
  padding-left: 1.25rem;
  color: #d6e3df;
  font-size: var(--font-meta);
}
body:not(.auth-mode) .tutorial-detail-list li::before {
  position: absolute;
  top: 0.62em;
  left: 0;
  width: 0.35rem;
  height: 1px;
  background: var(--teal);
  content: "";
}
body:not(.auth-mode) .tutorial-reference {
  margin: 2rem 0 0;
}
body:not(.auth-mode) .tutorial-reference img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 48rem;
  border: 1px solid rgba(129, 157, 151, 0.3);
  background: #132c3e;
  object-fit: contain;
  object-position: left top;
}
body:not(.auth-mode) .tutorial-reference img[hidden] { display: none; }
body:not(.auth-mode) .tutorial-reference figcaption {
  margin-top: 0.75rem;
  color: #778a84;
  font-size: var(--font-meta);
  line-height: 1.5;
}
body:not(.auth-mode) .tutorial-step .tutorial-note {
  margin-top: 1.5rem;
  padding-left: 1rem;
  border-left: 1px solid #b58a40;
  color: #c7b997;
  font-size: var(--font-meta);
}
body:not(.auth-mode) .tutorial-action {
  display: inline-flex;
  margin-top: 1.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--teal);
  color: #dff8f0;
  font-size: var(--font-meta);
  text-decoration: none;
}
body:not(.auth-mode) .tutorial-action:hover,
body:not(.auth-mode) .tutorial-action:focus-visible { color: var(--teal); }
body:not(.auth-mode) .tutorial-preferences {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 1.75rem 0 0;
  border-top: 1px solid rgba(129, 157, 151, 0.16);
}
body:not(.auth-mode) .tutorial-preferences div {
  min-width: 0;
  padding: 1.1rem 1.25rem 1.1rem 0;
  border-bottom: 1px solid rgba(129, 157, 151, 0.16);
}
body:not(.auth-mode) .tutorial-preferences div:nth-child(even) { padding-left: 1.25rem; }
body:not(.auth-mode) .tutorial-preferences dt {
  color: #dce8e4;
  font-size: var(--font-meta);
  font-weight: 500;
}
body:not(.auth-mode) .tutorial-preferences dd {
  margin: 0.4rem 0 0;
  color: #778a84;
  font-size: var(--font-meta);
  line-height: 1.5;
}
body:not(.auth-mode) .security-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: #9bb3ad;
  font-weight: 400;
  letter-spacing: 0.04em;
}
body:not(.auth-mode) .security-badge::before {
  width: 1.75rem;
  height: 1px;
  background: var(--teal);
  content: "";
}
body:not(.auth-mode) .panel {
  border: 0;
  border-top: 1px solid rgba(129, 157, 151, 0.22);
  border-bottom: 1px solid rgba(129, 157, 151, 0.22);
  border-radius: 0;
  background: transparent;
}
body:not(.auth-mode) .panel-header {
  min-height: 0;
  padding: 1.2rem 0;
  border-color: rgba(129, 157, 151, 0.16);
}
body:not(.auth-mode) .panel-header h2,
body:not(.auth-mode) .bot-control-panel h2 {
  font-size: 1rem;
  font-weight: 550;
  letter-spacing: 0;
}
body:not(.auth-mode) .connection-panel { margin-bottom: 2.75rem; }
body:not(.auth-mode) .funding-settings-panel { margin-bottom: 2.75rem; }
body:not(.auth-mode) .funding-settings-form { padding: 1.75rem 0 2rem; }
body:not(.auth-mode) .strategy-mode-fieldset {
  min-width: 0;
  margin: 0 0 1.75rem;
  padding: 0 0 1.75rem;
  border: 0;
  border-bottom: 1px solid rgba(129, 157, 151, 0.16);
}
body:not(.auth-mode) .strategy-mode-fieldset legend {
  padding: 0;
  color: #e6efec;
  font-size: var(--font-meta);
  font-weight: 550;
}
body:not(.auth-mode) .strategy-mode-description {
  margin: 0.35rem 0 1rem;
  color: #83958f;
  font-size: var(--font-meta);
}
body:not(.auth-mode) .strategy-mode-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}
body:not(.auth-mode) .strategy-mode-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 5rem;
  padding: 1rem 1.15rem;
  border: 1px solid #29413b;
  border-radius: 0.4rem;
  background: rgba(8, 22, 24, 0.58);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}
body:not(.auth-mode) .strategy-mode-option:hover {
  border-color: #45675e;
}
body:not(.auth-mode) .strategy-mode-option:has(input:checked) {
  border-color: var(--accent);
  background: rgba(27, 154, 121, 0.1);
}
body:not(.auth-mode) .strategy-mode-option:has(input:focus-visible) {
  outline: 2px solid #7ee8d0;
  outline-offset: 3px;
}
body:not(.auth-mode) .strategy-mode-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
body:not(.auth-mode) .strategy-mode-copy {
  display: grid;
  gap: 0.35rem;
}
body:not(.auth-mode) .strategy-mode-copy strong {
  color: #e8f2ef;
  font-size: 0.88rem;
  font-weight: 600;
}
body:not(.auth-mode) .strategy-mode-copy small {
  color: #82958f;
  font-size: var(--font-meta);
  line-height: 1.45;
}
body:not(.auth-mode) .strategy-mode-indicator {
  position: relative;
  width: 1.15rem;
  height: 1.15rem;
  margin-left: auto;
  flex: 0 0 auto;
  border: 1px solid #55736b;
  border-radius: 50%;
}
body:not(.auth-mode) .strategy-mode-option:has(input:checked) .strategy-mode-indicator {
  border-color: var(--accent);
}
body:not(.auth-mode) .strategy-mode-option:has(input:checked) .strategy-mode-indicator::after {
  position: absolute;
  content: "";
  inset: 0.22rem;
  border-radius: 50%;
  background: var(--accent);
}
body:not(.auth-mode) .settings-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}
body:not(.auth-mode) .settings-fields small {
  color: #748681;
  font-size: var(--font-meta);
  line-height: 1.45;
}
body:not(.auth-mode) .settings-apply-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin-top: 1.75rem;
  padding: 1.35rem 0;
  border-top: 1px solid rgba(129, 157, 151, 0.16);
  border-bottom: 1px solid rgba(129, 157, 151, 0.16);
}
body:not(.auth-mode) .settings-apply-row strong { font-size: var(--font-meta); font-weight: 550; }
body:not(.auth-mode) .settings-apply-row p { margin: 0.35rem 0 0; color: #83958f; font-size: var(--font-meta); }
body:not(.auth-mode) .funding-settings-form > .form-actions { margin-top: 1.5rem; }
.switch-control { position: relative; display: inline-flex; flex: 0 0 auto; cursor: pointer; }
.switch-control input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch-control > span[aria-hidden="true"] {
  position: relative;
  width: 2.9rem;
  height: 1.55rem;
  border: 1px solid #45615a;
  border-radius: 999px;
  background: #071115;
  transition: border-color 160ms ease, background 160ms ease;
}
.switch-control > span[aria-hidden="true"]::after {
  position: absolute;
  top: 0.22rem;
  left: 0.24rem;
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 50%;
  background: #9badA7;
  content: "";
  transition: transform 160ms ease, background 160ms ease;
}
.switch-control input:checked + span { border-color: #21b88e; background: rgba(22, 143, 109, 0.28); }
.switch-control input:checked + span::after { transform: translateX(1.42rem); background: #36d5aa; }
.switch-control input:focus-visible + span { outline: 2px solid #60a5fa; outline-offset: 3px; }
body:not(.auth-mode) .connection-layout {
  grid-template-columns: minmax(0, 1.7fr) minmax(15rem, 0.55fr);
  gap: 3rem;
  padding: 1.75rem 0 2rem;
}
body:not(.auth-mode) .connection-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
body:not(.auth-mode) .connection-form .form-actions,
body:not(.auth-mode) .connection-form .form-message { grid-column: 1 / -1; }
body:not(.auth-mode) .field-group label { color: #aab9b5; font-size: var(--font-meta); font-weight: 500; }
body:not(.auth-mode) .field-group input {
  min-height: 3.35rem;
  border-color: rgba(129, 157, 151, 0.28);
  border-radius: 0.3rem;
  background: rgba(4, 13, 16, 0.78);
}
body:not(.auth-mode) .permission-card {
  padding: 0.2rem 0 0.2rem 2rem;
  border-color: rgba(129, 157, 151, 0.18);
}
body:not(.auth-mode) .permission-card h3 { font-weight: 500; }
body:not(.auth-mode) .permission-card ul { color: #91a09c; font-weight: 300; }
body:not(.auth-mode) .connection-status,
body:not(.auth-mode) .readonly-pill,
body:not(.auth-mode) .count-pill {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-weight: 400;
}
body:not(.auth-mode) .connection-status[data-state="connected"] { background: transparent; }
body:not(.auth-mode) .primary-button {
  color: #f0fbf7;
  border-radius: 0.3rem;
  background: #168f6d;
  font-weight: 550;
}
body:not(.auth-mode) .primary-button:hover { background: #1aa37b; }
body:not(.auth-mode) .secondary-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.72rem 1.15rem;
  border: 1px solid rgba(129, 157, 151, 0.38);
  border-radius: 0.3rem;
  color: #dce9e5;
  background: transparent;
  font-size: var(--font-meta);
  font-weight: 500;
  text-decoration: none;
}
body:not(.auth-mode) .secondary-link-button:hover,
body:not(.auth-mode) .secondary-link-button:focus-visible {
  border-color: #24c99a;
  color: #ecfff8;
}
body:not(.auth-mode) .bot-control-panel {
  grid-template-columns: minmax(15rem, 1fr) minmax(24rem, 1.25fr) auto;
  gap: 2.25rem;
  margin-bottom: 2.75rem;
  padding: 1.5rem 0;
}
body:not(.auth-mode) .bot-status-grid div { border-color: rgba(129, 157, 151, 0.18); }
body:not(.auth-mode) .bot-status-grid dt,
body:not(.auth-mode) .bot-status-grid dd { font-weight: 400; }
body:not(.auth-mode) .warning-panel {
  margin: 0 0 3rem;
  padding: 1rem 0;
  border: 0;
  border-top: 1px solid rgba(246, 189, 91, 0.42);
  border-bottom: 1px solid rgba(246, 189, 91, 0.42);
  border-radius: 0;
  background: transparent;
}
body:not(.auth-mode) .warning-panel h2 { font-size: var(--font-meta); font-weight: 500; }
body:not(.auth-mode) .warning-panel ul { font-size: var(--font-meta); font-weight: 300; }
body:not(.auth-mode) .hero { margin: 0 0 1.75rem; }
body:not(.auth-mode) .metric-strip {
  margin-bottom: 2.75rem;
  border: 0;
  border-top: 1px solid rgba(129, 157, 151, 0.24);
  border-bottom: 1px solid rgba(129, 157, 151, 0.24);
  border-radius: 0;
  background: transparent;
}
body:not(.auth-mode) .metric { padding: 1.4rem 1.5rem; border-color: rgba(129, 157, 151, 0.18); }
body:not(.auth-mode) .metric.accent { background: transparent; }
body:not(.auth-mode) .metric:first-child { padding-left: 0; }
body:not(.auth-mode) .metric:last-child { padding-right: 0; }
body:not(.auth-mode) .metric span { font-size: var(--font-meta); font-weight: 550; letter-spacing: 0.12em; }
body:not(.auth-mode) .metric strong { margin: 0.65rem 0 0.35rem; font-size: clamp(1.55rem, 2.8vw, 2.25rem); font-weight: 450; }
body:not(.auth-mode) .metric small { font-size: var(--font-meta); font-weight: 300; }
body:not(.auth-mode) .overview-grid { grid-template-columns: minmax(18rem, 0.72fr) minmax(28rem, 1.28fr); gap: 2.5rem; }
body:not(.auth-mode) .portfolio-list { padding: 0.8rem 0 1.25rem; }
body:not(.auth-mode) .portfolio-list > div { border-color: rgba(129, 157, 151, 0.16); }
body:not(.auth-mode) .portfolio-list dt { font-weight: 300; }
body:not(.auth-mode) .portfolio-list dd { font-weight: 500; }
body:not(.auth-mode) .panel-description { padding: 1rem 0 0; font-weight: 300; }
body:not(.auth-mode) .earnings-scroll { margin-top: 0.75rem; }
body:not(.auth-mode) .chart-panel { margin-top: 3.5rem; }
body:not(.auth-mode) .chart-values { padding: 1rem 0 0; }
body:not(.auth-mode) .chart-stage { min-height: 17rem; padding: 1.5rem 0; }
body:not(.auth-mode) .chart-stage:has(.empty-copy) { display: grid; min-height: 8rem; place-items: center; }
body:not(.auth-mode) .details-grid { gap: 3.5rem; margin-top: 3.5rem; }
body:not(.auth-mode) .table-summary-header { min-height: 7rem; }
body:not(.auth-mode) .table-header-meta { min-width: min(22rem, 68%); }
body:not(.auth-mode) .position-yield dd { font-weight: 500; }
body:not(.auth-mode) th { background: #050c0f; font-weight: 500; }
body:not(.auth-mode) th,
body:not(.auth-mode) td { border-color: rgba(129, 157, 151, 0.16); }
body:not(.auth-mode) .footer {
  width: min(80rem, 100%);
  margin: 0 auto;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
  border-color: rgba(129, 157, 151, 0.18);
}

body:not(.auth-mode) .support-page {
  --support-line: rgba(129, 157, 151, 0.2);
  --support-surface: rgba(6, 17, 20, 0.8);
  padding-bottom: 2rem;
}
body:not(.auth-mode) .support-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--support-line);
}
body:not(.auth-mode) .support-intro .eyebrow,
body:not(.auth-mode) .support-admin .eyebrow {
  margin-bottom: 0.7rem;
  color: var(--teal);
  font-size: var(--font-meta);
  font-weight: 600;
  letter-spacing: 0.16em;
}
body:not(.auth-mode) .support-intro h1 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 450;
  letter-spacing: -0.04em;
}
body:not(.auth-mode) .support-intro p:last-child {
  max-width: 42rem;
  margin: 0.8rem 0 0;
  color: #91a39e;
  line-height: 1.7;
}
body:not(.auth-mode) .support-privacy {
  max-width: 14rem;
  padding-left: 1rem;
  border-left: 1px solid rgba(45, 196, 154, 0.45);
  color: #7f938e;
  font-size: var(--font-meta);
  line-height: 1.55;
}
body:not(.auth-mode) .support-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(17rem, 0.8fr);
  min-height: 39rem;
  border: 1px solid var(--support-line);
  border-radius: 0.45rem;
  background:
    linear-gradient(145deg, rgba(14, 35, 34, 0.28), transparent 42%),
    var(--support-surface);
  overflow: hidden;
}
body:not(.auth-mode) .support-thread-panel {
  display: grid;
  grid-template-rows: auto minmax(18rem, 1fr) auto auto;
  min-width: 0;
}
body:not(.auth-mode) .support-payment-panel {
  padding: 0 1.3rem 1.3rem;
  border-left: 1px solid var(--support-line);
  background: rgba(3, 11, 13, 0.46);
}
body:not(.auth-mode) .support-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 5.25rem;
  padding: 1.1rem 1.3rem;
  border-bottom: 1px solid var(--support-line);
}
body:not(.auth-mode) .support-payment-panel .support-panel-header {
  margin-inline: -1.3rem;
}
body:not(.auth-mode) .support-kicker {
  color: #66807a;
  font-size: var(--font-meta);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
body:not(.auth-mode) .support-panel-header h2 {
  margin-top: 0.2rem;
  color: #e7f0ed;
  font-size: 1.05rem;
  font-weight: 520;
}
body:not(.auth-mode) .support-state {
  padding: 0.35rem 0.6rem;
  border: 1px solid rgba(45, 196, 154, 0.35);
  border-radius: 999px;
  color: #71dabe;
  font-size: var(--font-meta);
}
body:not(.auth-mode) .support-state[data-state="closed"] {
  border-color: rgba(129, 157, 151, 0.26);
  color: #82948f;
}
body:not(.auth-mode) .support-messages {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-height: 18rem;
  max-height: 34rem;
  padding: 1.35rem;
  overflow-y: auto;
  scrollbar-color: rgba(45, 196, 154, 0.35) transparent;
}
body:not(.auth-mode) .support-message {
  align-self: flex-start;
  width: min(75%, 34rem);
  padding: 0.85rem 1rem;
  border: 1px solid rgba(129, 157, 151, 0.2);
  border-radius: 0.35rem 0.9rem 0.9rem 0.9rem;
  background: rgba(13, 29, 31, 0.78);
}
body:not(.auth-mode) .support-message[data-role="CUSTOMER"] {
  align-self: flex-end;
  border-color: rgba(45, 196, 154, 0.28);
  border-radius: 0.9rem 0.35rem 0.9rem 0.9rem;
  background: rgba(14, 77, 63, 0.38);
}
body:not(.auth-mode) .support-admin-messages .support-message[data-role="STAFF"] {
  align-self: flex-end;
  border-color: rgba(45, 196, 154, 0.28);
  border-radius: 0.9rem 0.35rem 0.9rem 0.9rem;
  background: rgba(14, 77, 63, 0.38);
}
body:not(.auth-mode) .support-message[data-role="SYSTEM"] {
  align-self: center;
  width: auto;
  max-width: 82%;
  border-style: dashed;
  background: transparent;
  color: #8b9b97;
  text-align: center;
}
body:not(.auth-mode) .support-message p {
  margin: 0;
  color: #e1ebe8;
  font-size: var(--font-meta);
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
body:not(.auth-mode) .support-message time {
  display: block;
  margin-top: 0.45rem;
  color: #60736e;
  font-size: var(--font-meta);
}
body:not(.auth-mode) .support-message-images {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  margin-top: 0.65rem;
}
body:not(.auth-mode) .support-message-images a {
  min-width: 0;
  border: 1px solid rgba(129, 157, 151, 0.22);
  border-radius: 0.35rem;
  overflow: hidden;
}
body:not(.auth-mode) .support-message-images img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
body:not(.auth-mode) .support-empty {
  margin: auto;
  padding: 1.5rem;
  color: #667a75;
  font-size: var(--font-body);
  line-height: 1.65;
  text-align: center;
}
body:not(.auth-mode) .support-composer {
  padding: 1rem 1.3rem 1.2rem;
  border-top: 1px solid var(--support-line);
}
body:not(.auth-mode) .support-composer textarea {
  width: 100%;
  min-height: 5rem;
  resize: vertical;
}
body:not(.auth-mode) .support-composer-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 0.75rem;
}
body:not(.auth-mode) .support-composer-actions small {
  margin-right: auto;
  color: #61736e;
  font-size: var(--font-meta);
}
body:not(.auth-mode) .support-upload-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.45rem;
  padding: 0 0.8rem;
  border: 1px solid rgba(129, 157, 151, 0.28);
  border-radius: 0.3rem;
  color: #adc0bb;
  font-size: var(--font-meta);
  cursor: pointer;
}
body:not(.auth-mode) .support-upload-button:hover,
body:not(.auth-mode) .support-upload-button:focus-within {
  border-color: rgba(45, 196, 154, 0.58);
  color: #e3eeeb;
}
body:not(.auth-mode) .support-image-previews {
  display: flex;
  gap: 0.55rem;
  padding: 0.8rem 1.3rem 0;
  border-top: 1px solid var(--support-line);
  overflow-x: auto;
}
body:not(.auth-mode) .support-image-previews[hidden] { display: none; }
body:not(.auth-mode) .support-image-preview {
  position: relative;
  flex: 0 0 4.5rem;
}
body:not(.auth-mode) .support-image-preview img {
  display: block;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 0.3rem;
  object-fit: cover;
}
body:not(.auth-mode) .support-image-preview button {
  position: absolute;
  top: -0.35rem;
  right: -0.35rem;
  display: grid;
  width: 1.3rem;
  height: 1.3rem;
  padding: 0;
  border: 1px solid rgba(211, 232, 226, 0.45);
  border-radius: 50%;
  background: #071114;
  color: #dbe8e4;
  cursor: pointer;
  place-items: center;
}
body:not(.auth-mode) .support-payments {
  display: grid;
  gap: 0.8rem;
  margin-top: 1.2rem;
}
body:not(.auth-mode) .support-payment-card {
  padding: 1rem;
  border: 1px solid rgba(129, 157, 151, 0.2);
  border-radius: 0.35rem;
  background: rgba(9, 23, 25, 0.72);
}
body:not(.auth-mode) .support-payment-card header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}
body:not(.auth-mode) .support-payment-card h3 {
  color: #e7f1ee;
  font-size: 1.15rem;
  font-weight: 500;
}
body:not(.auth-mode) .support-payment-card .payment-status {
  color: #67d6b6;
  font-size: var(--font-meta);
  letter-spacing: 0.06em;
}
body:not(.auth-mode) .support-payment-card dl {
  display: grid;
  gap: 0.55rem;
  margin: 0.9rem 0 0;
}
body:not(.auth-mode) .support-payment-card dl div {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr);
  gap: 0.7rem;
}
body:not(.auth-mode) .support-payment-card dt {
  color: #62756f;
  font-size: var(--font-meta);
}
body:not(.auth-mode) .support-payment-card dd {
  color: #b9c8c4;
  font-size: var(--font-meta);
  overflow-wrap: anywhere;
}
body:not(.auth-mode) .support-payment-card form,
body:not(.auth-mode) .support-payment-review {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.9rem;
}
body:not(.auth-mode) .support-payment-review input {
  flex: 1 1 12rem;
}
body:not(.auth-mode) .support-payment-card form {
  align-items: stretch;
  flex-direction: column;
}
body:not(.auth-mode) .support-payment-card form > button {
  width: 100%;
  white-space: normal;
}
body:not(.auth-mode) .support-payment-card .payment-legal-checkbox {
  min-width: 0;
  margin: 0;
}
body:not(.auth-mode) .support-payment-card input:not([type="checkbox"]) { min-width: 0; width: 100%; }
body:not(.auth-mode) .support-payment-address-block {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem 1rem;
  align-items: start;
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid rgba(45, 196, 154, 0.24);
  background: rgba(7, 17, 20, 0.7);
}
body:not(.auth-mode) .support-payment-address-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
}
body:not(.auth-mode) .support-payment-address-row code {
  min-width: 0;
  color: #dbe8e4;
  line-height: 1.65;
  word-break: break-all;
}
body:not(.auth-mode) .support-payment-qr {
  grid-column: 1;
  grid-row: auto;
  justify-self: start;
  width: 10rem;
  height: 10rem;
  background: #fff;
}
body:not(.auth-mode) .support-payment-network-warning {
  margin: 0;
  color: #f0c58c;
  font-size: var(--font-meta);
  line-height: 1.6;
}
body:not(.auth-mode) .support-payment-address-block small { color: #71837e; }
body:not(.auth-mode) .support-payment-note {
  margin-top: 1rem;
  color: #61736e;
  font-size: var(--font-body);
  line-height: 1.6;
}
body:not(.auth-mode) .support-admin {
  margin-top: 3rem;
  border-top: 1px solid var(--support-line);
}
body:not(.auth-mode) .support-admin-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  padding: 2rem 0 1.25rem;
}
body:not(.auth-mode) .support-admin-header h2 {
  font-size: 1.35rem;
  font-weight: 500;
}
body:not(.auth-mode) .support-admin-tools {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
body:not(.auth-mode) .support-admin-tools input {
  width: min(18rem, 38vw);
  min-height: 2.45rem;
}
body:not(.auth-mode) .support-admin-tools select {
  min-height: 2.45rem;
  border-color: rgba(129, 157, 151, 0.28);
  border-radius: 0.3rem;
  background: rgba(5, 14, 17, 0.9);
  color: #adc0bb;
}
body:not(.auth-mode) .support-admin-grid {
  display: grid;
  grid-template-columns: 18rem minmax(0, 1fr);
  min-height: 34rem;
  border: 1px solid var(--support-line);
  border-radius: 0.45rem;
  overflow: hidden;
}
body:not(.auth-mode) .support-conversation-list {
  border-right: 1px solid var(--support-line);
  background: rgba(3, 11, 13, 0.46);
}
body:not(.auth-mode) .support-conversation-button {
  display: grid;
  width: 100%;
  gap: 0.25rem;
  padding: 1rem;
  border: 0;
  border-bottom: 1px solid var(--support-line);
  background: transparent;
  color: #dce8e4;
  text-align: left;
  cursor: pointer;
}
body:not(.auth-mode) .support-conversation-button:hover,
body:not(.auth-mode) .support-conversation-button[aria-current="true"] {
  background: rgba(25, 90, 74, 0.25);
}
body:not(.auth-mode) .support-conversation-button small {
  color: #657a74;
  overflow: hidden;
  text-overflow: ellipsis;
}
body:not(.auth-mode) .support-unread-count {
  justify-self: start;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  background: rgba(45, 196, 154, 0.18);
  color: #71dabe;
  font-size: var(--font-meta);
}
body:not(.auth-mode) .support-admin-detail {
  min-width: 0;
}
body:not(.auth-mode) .support-admin-customer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.5rem;
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid var(--support-line);
}
body:not(.auth-mode) .support-admin-customer div { display: grid; gap: 0.2rem; }
body:not(.auth-mode) .support-admin-customer small,
body:not(.auth-mode) .support-admin-customer > span {
  color: #62756f;
  font-size: var(--font-meta);
}
body:not(.auth-mode) .support-admin-customer strong {
  color: #e0ebe7;
  font-size: var(--font-meta);
}
body:not(.auth-mode) .support-admin-messages { max-height: 28rem; }
body:not(.auth-mode) .support-payment-request-form {
  padding: 1.2rem;
  border-top: 1px solid var(--support-line);
}
body:not(.auth-mode) .support-payment-request-form h3 {
  margin-bottom: 0.8rem;
  color: #dbe8e4;
  font-size: var(--font-meta);
  font-weight: 500;
}
body:not(.auth-mode) .support-payment-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 0.7rem;
}
body:not(.auth-mode) .support-payment-fields label {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}
body:not(.auth-mode) .support-payment-fields label span {
  color: #71837e;
  font-size: var(--font-meta);
}
body:not(.auth-mode) .support-payment-fields > button { grid-column: 1 / -1; }
body:not(.auth-mode) .support-whale-fields {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  min-width: 0;
  margin: 0;
  padding: 0.8rem;
  border: 1px solid rgba(45, 196, 154, 0.24);
}
body:not(.auth-mode) .support-whale-fields[hidden] { display: none; }
body:not(.auth-mode) .support-whale-fields legend,
body:not(.auth-mode) .support-payment-quote-preview dt {
  color: #71837e;
  font-size: var(--font-meta);
}
body:not(.auth-mode) .support-payment-quote-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem 1rem;
  margin: 1rem 0 0;
  padding: 1rem;
  border: 1px solid var(--support-line);
}
body:not(.auth-mode) .support-payment-quote-preview div {
  display: grid;
  grid-template-columns: minmax(5rem, 0.7fr) minmax(0, 1fr);
  gap: 0.5rem;
}
body:not(.auth-mode) .support-payment-quote-preview dd {
  color: #dbe8e4;
  overflow-wrap: anywhere;
}
body:not(.auth-mode) .support-payment-rail-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.8rem 1.2rem;
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid rgba(45, 196, 154, 0.24);
  background: rgba(7, 17, 20, 0.62);
}
body:not(.auth-mode) .support-payment-rail-preview[hidden] { display: none; }
body:not(.auth-mode) .support-payment-rail-preview dl {
  display: grid;
  gap: 0.45rem;
  margin: 0;
}
body:not(.auth-mode) .support-payment-rail-preview dl div {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 0.65rem;
}
body:not(.auth-mode) .support-payment-rail-preview dt { color: #71837e; }
body:not(.auth-mode) .support-payment-rail-preview dd { color: #dbe8e4; overflow-wrap: anywhere; }
body:not(.auth-mode) .support-payment-address-actions {
  display: grid;
  gap: 0.7rem;
  justify-items: start;
}
body:not(.auth-mode) .support-payment-address-actions img {
  width: 10rem;
  height: 10rem;
  background: #fff;
}
body:not(.auth-mode) .support-payment-rail-preview > p,
body:not(.auth-mode) .support-payment-rail-preview > small { grid-column: 1 / -1; }
body:not(.auth-mode) .support-admin-detail > .support-empty {
  display: grid;
  min-height: 34rem;
  place-items: center;
}
body:not(.auth-mode) #support-admin-payments {
  padding: 0 1.2rem 1.2rem;
}
body:not(.auth-mode) .support-membership-admin {
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  border: 1px solid var(--support-line);
  border-radius: 0.45rem;
  background: rgba(4, 13, 16, 0.5);
}
body:not(.auth-mode) .support-membership-admin > header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
body:not(.auth-mode) .support-membership-admin h3,
body:not(.auth-mode) .membership-audit-section h4 {
  color: #dbe8e4;
  font-weight: 500;
}
body:not(.auth-mode) .support-membership-admin header p,
body:not(.auth-mode) .support-membership-search label,
body:not(.auth-mode) .membership-reason-field span,
body:not(.auth-mode) .membership-custom-actions label {
  color: #71837e;
  font-size: var(--font-meta);
}
body:not(.auth-mode) .support-membership-search,
body:not(.auth-mode) .membership-reason-field,
body:not(.auth-mode) .membership-custom-actions form {
  display: grid;
  gap: 0.4rem;
}
body:not(.auth-mode) .support-membership-search > div,
body:not(.auth-mode) .membership-custom-actions form > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}
body:not(.auth-mode) .support-membership-search input {
  width: min(20rem, 42vw);
}
body:not(.auth-mode) .support-membership-grid {
  display: grid;
  grid-template-columns: 18rem minmax(0, 1fr);
  min-height: 22rem;
  border-top: 1px solid var(--support-line);
}
body:not(.auth-mode) .membership-customer-results {
  border-right: 1px solid var(--support-line);
  overflow: auto;
}
body:not(.auth-mode) .membership-customer-detail {
  display: grid;
  gap: 1rem;
  min-width: 0;
  padding: 1rem 0 0 1rem;
}
body:not(.auth-mode) .membership-customer-detail[hidden] { display: none; }
body:not(.auth-mode) .membership-customer-detail > header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
body:not(.auth-mode) .membership-customer-detail > header div { display: grid; gap: 0.2rem; }
body:not(.auth-mode) .membership-customer-detail > header small,
body:not(.auth-mode) .membership-customer-detail > header code { color: #71837e; }
body:not(.auth-mode) .membership-customer-detail > header code { overflow-wrap: anywhere; }
body:not(.auth-mode) .membership-current-period { margin: 0; }
body:not(.auth-mode) .membership-current-period div {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 0.75rem;
}
body:not(.auth-mode) .membership-current-period dt { color: #71837e; }
body:not(.auth-mode) .membership-current-period dd { color: #dbe8e4; }
body:not(.auth-mode) .membership-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}
body:not(.auth-mode) .membership-custom-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
body:not(.auth-mode) .membership-custom-actions input { flex: 1 1 10rem; min-width: 0; }
body:not(.auth-mode) .membership-audit-section {
  padding-top: 0.8rem;
  border-top: 1px solid var(--support-line);
}
body:not(.auth-mode) .membership-audit-list { display: grid; gap: 0.65rem; margin-top: 0.65rem; }
body:not(.auth-mode) .membership-audit-list article {
  display: grid;
  gap: 0.25rem;
  padding: 0.75rem;
  border-left: 2px solid rgba(45, 196, 154, 0.5);
  background: rgba(7, 17, 20, 0.62);
}
body:not(.auth-mode) .membership-audit-list span,
body:not(.auth-mode) .membership-audit-list small { color: #71837e; overflow-wrap: anywhere; }
body:not(.auth-mode) .membership-audit-list p { color: #b9c8c4; overflow-wrap: anywhere; }

@media (max-width: 900px) {
  body:not(.auth-mode) .topbar { padding-inline: 1.5rem; }
  body:not(.auth-mode) .connection-form { grid-template-columns: 1fr; }
  body:not(.auth-mode) .connection-form .form-actions,
  body:not(.auth-mode) .connection-form .form-message { grid-column: auto; }
  body:not(.auth-mode) .connection-layout,
  body:not(.auth-mode) .overview-grid,
  body:not(.auth-mode) .tutorial-layout { grid-template-columns: 1fr; }
  body:not(.auth-mode) .pricing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body:not(.auth-mode) .return-calculator-body { grid-template-columns: 1fr; }
  body:not(.auth-mode) .calculator-inputs { padding-right: 0; }
  body:not(.auth-mode) .calculator-results {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid rgba(129, 157, 151, 0.2);
    border-left: 0;
  }
  body:not(.auth-mode) .calculator-results div + div {
    border-top: 0;
    border-left: 1px solid rgba(129, 157, 151, 0.16);
  }
  body:not(.auth-mode) .support-shell,
  body:not(.auth-mode) .support-admin-grid,
  body:not(.auth-mode) .support-membership-grid { grid-template-columns: 1fr; }
  body:not(.auth-mode) .support-payment-panel {
    border-top: 1px solid var(--support-line);
    border-left: 0;
  }
  body:not(.auth-mode) .support-conversation-list {
    display: flex;
    max-width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--support-line);
    overflow-x: auto;
  }
  body:not(.auth-mode) .membership-customer-results {
    display: flex;
    border-right: 0;
    border-bottom: 1px solid var(--support-line);
    overflow-x: auto;
  }
  body:not(.auth-mode) .membership-customer-detail { padding-left: 0; }
  body:not(.auth-mode) .support-conversation-button {
    flex: 0 0 15rem;
    border-right: 1px solid var(--support-line);
    border-bottom: 0;
  }
  body:not(.auth-mode) .support-payment-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body:not(.auth-mode) .pricing-card:nth-child(3) { border-left: 0; }
  body:not(.auth-mode) .pricing-card:nth-child(n + 3) { border-top: 1px solid rgba(129, 157, 151, 0.2); }
  body:not(.auth-mode) .tutorial-index { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  body:not(.auth-mode) .tutorial-index a {
    grid-template-columns: 1fr;
    padding-right: 1rem;
    border-right: 1px solid rgba(129, 157, 151, 0.16);
  }
  body:not(.auth-mode) .settings-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body:not(.auth-mode) .bot-control-panel { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  body:not(.auth-mode) .topbar {
    flex-flow: row wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    padding-top: 0.9rem;
    padding-bottom: 0;
  }
  body:not(.auth-mode) .brand { padding-bottom: 0; }
  body:not(.auth-mode) .topbar-actions { width: auto; margin-left: auto; }
  body:not(.auth-mode) .source-status { display: none; }
  body:not(.auth-mode) .strategy-mode-options { grid-template-columns: 1fr; }
  body:not(.auth-mode) .settings-fields { grid-template-columns: 1fr; }
  body:not(.auth-mode) .settings-apply-row { align-items: flex-start; }
  body:not(.auth-mode) .portal-nav {
    order: 3;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    width: 100%;
    min-height: 2.8rem;
    margin: 0;
    gap: 0.75rem;
  }
  body:not(.auth-mode) .portal-nav a { justify-content: center; }
  body:not(.auth-mode) .portal-nav a::after { bottom: 0; }
  body:not(.auth-mode) .dashboard { padding-top: 2rem; }
  body:not(.auth-mode) .portal-intro { align-items: flex-start; }
  body:not(.auth-mode) .connection-layout { padding-top: 1.25rem; }
  body:not(.auth-mode) .permission-card { padding: 1.25rem 0 0; border-top: 1px solid rgba(129, 157, 151, 0.18); border-left: 0; }
  body:not(.auth-mode) .tutorial-index { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body:not(.auth-mode) .tutorial-step { grid-template-columns: 2rem minmax(0, 1fr); }
  body:not(.auth-mode) .tutorial-preferences { grid-template-columns: 1fr; }
  body:not(.auth-mode) .tutorial-preferences div:nth-child(even) { padding-left: 0; }
  body:not(.auth-mode) .pricing-intro { grid-template-columns: 1fr; align-items: start; }
  body:not(.auth-mode) .pricing-account-meta { width: 100%; }
  body:not(.auth-mode) .pricing-billing-bar,
  body:not(.auth-mode) .return-calculator-header {
    align-items: stretch;
    flex-direction: column;
  }
  body:not(.auth-mode) .pricing-billing-toggle { width: 100%; }
  body:not(.auth-mode) .pricing-grid { grid-template-columns: 1fr; }
  body:not(.auth-mode) .pricing-card + .pricing-card {
    border-top: 1px solid rgba(129, 157, 151, 0.2);
    border-left: 0;
  }
  body:not(.auth-mode) .pricing-rate { margin-top: 2.25rem; }
  body:not(.auth-mode) .pricing-custom {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  body:not(.auth-mode) .calculator-net-badge { align-self: flex-start; }
  body:not(.auth-mode) .calculator-inputs { grid-template-columns: 1fr; padding-block: 1.5rem; }
  body:not(.auth-mode) .calculator-frr-line { grid-column: auto; }
  body:not(.auth-mode) .calculator-results { grid-template-columns: 1fr; }
  body:not(.auth-mode) .calculator-results div + div {
    border-top: 1px solid rgba(129, 157, 151, 0.16);
    border-left: 0;
  }
  body:not(.auth-mode) .calculator-results div { min-height: 5.5rem; padding-inline: 1rem; }
  body:not(.auth-mode) .calculator-fee-note { grid-template-columns: 1fr; gap: 0.6rem; }
  body:not(.auth-mode) .calculator-fee-note strong { grid-row: auto; }
  body:not(.auth-mode) .support-intro {
    align-items: start;
    flex-direction: column;
  }
  body:not(.auth-mode) .support-admin-header {
    align-items: stretch;
    flex-direction: column;
    gap: 1rem;
  }
  body:not(.auth-mode) .support-membership-admin > header,
  body:not(.auth-mode) .membership-customer-detail > header {
    align-items: stretch;
    flex-direction: column;
  }
  body:not(.auth-mode) .support-membership-search input,
  body:not(.auth-mode) .support-membership-search button { width: 100%; }
  body:not(.auth-mode) .membership-custom-actions { grid-template-columns: 1fr; }
  body:not(.auth-mode) .membership-custom-actions form > div { display: grid; grid-template-columns: 1fr; }
  body:not(.auth-mode) .membership-custom-actions button { width: 100%; white-space: normal; }
  body:not(.auth-mode) .membership-current-period div { grid-template-columns: 1fr; gap: 0.2rem; }
  body:not(.auth-mode) .support-payment-review > * { flex: 1 1 100%; min-width: 0; }
  body:not(.auth-mode) .support-admin-tools {
    display: grid;
    grid-template-columns: 1fr;
  }
  body:not(.auth-mode) .support-admin-tools input { width: 100%; }
  body:not(.auth-mode) .support-admin-tools button { width: 100%; }
  body:not(.auth-mode) .support-admin-customer {
    align-items: start;
    flex-direction: column;
    gap: 0.75rem;
  }
  body:not(.auth-mode) .legal-reacceptance-panel { padding: 1.15rem; }
  body:not(.auth-mode) .legal-reacceptance-header {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }
  body:not(.auth-mode) .legal-reacceptance-mark {
    width: 2.25rem;
    height: 2.25rem;
  }
  body:not(.auth-mode) .legal-reacceptance-confirmation { grid-template-columns: 1fr; }
  body:not(.auth-mode) .legal-reacceptance-confirmation .primary-button { width: 100%; }
  body:not(.auth-mode) .legal-reacceptance-message { margin-left: 0; }
  body:not(.auth-mode) .support-privacy { max-width: none; }
  body:not(.auth-mode) .support-message { width: min(88%, 34rem); }
  body:not(.auth-mode) .support-payment-fields,
  body:not(.auth-mode) .support-whale-fields,
  body:not(.auth-mode) .support-payment-quote-preview { grid-template-columns: 1fr; }
  body:not(.auth-mode) .support-payment-address-row { grid-template-columns: 1fr; }
  body:not(.auth-mode) .support-payment-address-row button { justify-self: start; }
  body:not(.auth-mode) .support-payment-rail-preview,
  body:not(.auth-mode) .support-payment-address-block { grid-template-columns: 1fr; }
  body:not(.auth-mode) .support-payment-rail-preview dl div { grid-template-columns: 1fr; gap: 0.2rem; }
  body:not(.auth-mode) .support-payment-address-actions img,
  body:not(.auth-mode) .support-payment-qr {
    grid-column: 1;
    grid-row: auto;
    width: min(100%, 14rem);
    height: auto;
    aspect-ratio: 1;
  }
  body:not(.auth-mode) .support-composer-actions { flex-wrap: wrap; }
  body:not(.auth-mode) .support-composer-actions small { width: 100%; }
  body:not(.auth-mode) .metric { padding-inline: 0; }
}

.legal-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.6;
}

.legal-checkbox input[type="checkbox"] {
  flex: 0 0 auto;
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 0.2rem;
  accent-color: var(--accent, #70d8ac);
}

.withdrawal-warning {
  padding: 0.25rem 0;
  border: 0;
  border-radius: 0;
  color: #ffe0a1;
  background: transparent;
}

.strategy-mode-recommendation {
  color: #e8c86f;
  font-size: 0.875rem;
  line-height: 1.45;
}
body:not(.auth-mode) .strategy-mode-copy .strategy-mode-recommendation {
  color: #e8c86f;
}

.membership-overview { display: grid; gap: 1.25rem; }
.membership-overview-header,
.membership-history-card > header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.membership-overview-header h1 { margin: 0.15rem 0 0.35rem; }
.membership-overview-header p { margin: 0; color: #8ca19a; }
.membership-overview-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
.membership-overview-summary article,
.membership-history-card { padding: 1rem; border: 1px solid rgba(129, 180, 162, 0.18); background: rgba(6, 22, 18, 0.62); }
.membership-overview-summary article { display: grid; gap: 0.4rem; }
.membership-overview-summary span { color: #8ca19a; font-size: 0.8rem; }
.membership-overview-summary strong { color: #ecf8f2; font-size: 1.1rem; }
.membership-overview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.membership-history-card h2 { margin: 0; font-size: 1rem; }
.membership-history-list { display: grid; gap: 0.65rem; margin-top: 0.85rem; }
.membership-history-list article { padding: 0.75rem; border-left: 2px solid rgba(232, 200, 111, 0.7); background: rgba(255, 255, 255, 0.025); }
.membership-history-list strong { display: block; color: #ecf8f2; }
.membership-history-list span,
.membership-history-list small { display: block; color: #8ca19a; overflow-wrap: anywhere; }
.membership-history-list p { margin: 0.35rem 0 0; color: #c4d2cd; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .membership-overview-summary,
  .membership-overview-grid { grid-template-columns: 1fr; }
  .membership-overview-header { align-items: flex-start; flex-direction: column; }
  .membership-overview-header button { width: 100%; }
}

.portal-legal-links,
.portal-legal-links a {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}

.payment-legal-checkbox { margin: 1rem 0; }
