:root {
  color-scheme: dark;
  --canvas: #0a0d10;
  --surface-1: #11161a;
  --surface-2: #161c20;
  --surface-interactive: #1a2227;
  --border-subtle: #263139;
  --border-strong: #37454e;
  --content-primary: #eef3f1;
  --content-secondary: #a8b3b1;
  --content-tertiary: #788684;
  --action-primary: #53c7a5;
  --action-primary-hover: #73d9bb;
  --bg: var(--canvas);
  --surface: var(--surface-1);
  --surface-raised: var(--surface-2);
  --surface-hover: var(--surface-interactive);
  --line: var(--border-subtle);
  --line-strong: var(--border-strong);
  --text: var(--content-primary);
  --text-secondary: var(--content-secondary);
  --text-muted: var(--content-tertiary);
  --accent: var(--action-primary);
  --accent-strong: var(--action-primary-hover);
  --accent-violet: #b556ff;
  --accent-ink: #07110e;
  --positive: #67c9a6;
  --negative: #e57979;
  --warning: #d7ac63;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --header-height: 64px;
  --z-effects: 55;
  --z-header: 20;
  --z-modal: 50;
  --z-toast: 60;
  --motion-immediate: 100ms;
  --motion-fast: 160ms;
  --motion-state: 240ms;
  --motion-panel: 360ms;
  --motion-data: 500ms;
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --ease-enter: cubic-bezier(0.16, 1, 0.3, 1);
  font-family: "Segoe UI Variable", "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  position: relative;
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 14% 16%, rgba(49, 232, 210, 0.085), transparent 34%),
    radial-gradient(circle at 86% 72%, rgba(83, 199, 165, 0.045), transparent 36%),
    linear-gradient(145deg, #080b10 0%, #090d12 48%, #0b0d14 100%);
  color: var(--text);
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 75% 28% at 55% -8%, rgba(83, 199, 165, 0.15), transparent 72%),
    linear-gradient(rgba(83, 199, 165, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(83, 199, 165, 0.022) 1px, transparent 1px);
  background-size: auto, 72px 72px, 72px 72px;
  content: "";
  -webkit-mask-image: linear-gradient(to bottom, #000 0, rgba(0, 0, 0, 0.82) 54%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0, rgba(0, 0, 0, 0.82) 54%, transparent 100%);
}

body::after {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(110deg, transparent 0 42%, rgba(91, 244, 218, 0.03) 48%, transparent 54%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 5px);
  content: "";
  opacity: 0.56;
  animation: cyber-scan-drift 16s linear infinite;
}

@keyframes cyber-scan-drift {
  from { transform: translateY(-16px); }
  to { transform: translateY(16px); }
}

.ambient-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.94;
  mix-blend-mode: screen;
  transition: opacity var(--motion-fast) var(--ease-standard);
}

.burst-field {
  position: fixed;
  inset: 0;
  z-index: var(--z-effects);
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: screen;
  transition: opacity var(--motion-immediate) var(--ease-standard);
}

.burst-field.is-active {
  opacity: 1;
}

.boot-screen,
.auth-view,
.app-view {
  position: relative;
  z-index: 1;
}

button,
input {
  font: inherit;
}

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

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  stroke-width: 1.7;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  transform: translateY(-160%);
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--bg);
  padding: 8px 12px;
}

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

:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

::selection {
  background: rgba(83, 199, 165, 0.3);
}

.boot-screen {
  min-height: 100dvh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  color: var(--text-secondary);
}

.boot-screen p {
  margin: 0;
  font-size: 13px;
}

.brand-mark {
  display: block;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
}

.auth-view {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(420px, 0.75fr);
}

.auth-intro {
  display: flex;
  min-height: 100dvh;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--line);
  padding: clamp(28px, 5vw, 72px);
  background-color: #0c1013;
}

.auth-brand,
.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: fit-content;
  font-size: 18px;
  font-weight: 680;
}

.auth-copy {
  max-width: 760px;
  padding: 8vh 0;
}

.kicker,
.section-label {
  margin: 0 0 9px;
  color: var(--text-muted);
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  line-height: 1.3;
  text-transform: uppercase;
}

.auth-copy h1 {
  max-width: 17ch;
  margin: 0;
  font-size: clamp(38px, 4.2vw, 68px);
  font-weight: 630;
  line-height: 1.11;
  text-wrap: balance;
}

.auth-copy > p:last-child {
  max-width: 54ch;
  margin: 28px 0 0;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.8;
}

.auth-foot,
.service-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 12px;
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--positive);
  box-shadow: 0 0 0 3px rgba(103, 201, 166, 0.1);
}

.status-dot.neutral {
  background: var(--text-muted);
  box-shadow: none;
}

.status-dot.warning {
  background: var(--warning);
  box-shadow: 0 0 0 3px rgba(215, 172, 99, 0.1);
}

.status-dot.error {
  background: var(--negative);
  box-shadow: 0 0 0 3px rgba(229, 121, 121, 0.1);
}

.auth-panel {
  display: flex;
  width: min(100%, 520px);
  min-height: 100dvh;
  flex-direction: column;
  justify-content: center;
  justify-self: center;
  padding: 48px clamp(28px, 5vw, 68px);
}

.auth-panel-head h2,
.page-heading h1,
.panel-heading h2,
.market-head h2,
.task-panel h2,
.report-head h2,
.deposit-order h2,
.modal h2 {
  margin: 0;
  font-weight: 620;
  line-height: 1.25;
}

.auth-panel-head h2 {
  font-size: 28px;
}

.auth-panel-head > p:last-child {
  margin: 9px 0 0;
  color: var(--text-secondary);
}

.segmented {
  display: grid;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #0d1114;
}

.segmented button {
  min-width: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}

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

.segmented button[aria-selected="true"],
.segmented button[aria-pressed="true"] {
  background: var(--surface-raised);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.auth-mode {
  grid-template-columns: 1fr 1fr;
  margin: 28px 0 24px;
}

.auth-mode button {
  height: 38px;
  font-size: 13px;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
}

.field label {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 560;
}

.field label span {
  margin-left: 4px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 400;
}

input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: #0c1114;
  color: var(--text);
  padding: 0 12px;
  transition: border-color 160ms ease, background-color 160ms ease;
}

input::placeholder {
  color: #687572;
}

input:hover {
  border-color: #4a5a63;
}

input:focus {
  border-color: var(--accent);
  background: #0f1518;
}

.form-message {
  min-height: 20px;
  margin: -2px 0 10px;
  color: var(--negative);
  font-size: 12px;
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 0 14px;
  font-size: 13px;
  font-weight: 620;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 100ms ease;
}

.button:active:not(:disabled),
.icon-button:active:not(:disabled) {
  transform: translateY(1px);
}

.button:disabled,
.icon-button:disabled,
.text-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.button-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.button-primary:hover:not(:disabled) {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

.button-secondary {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--text-secondary);
}

.button-secondary:hover:not(:disabled) {
  border-color: #53646d;
  background: var(--surface-hover);
  color: var(--text);
}

.button-block {
  width: 100%;
  min-height: 44px;
}

.text-button {
  width: fit-content;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  padding: 0;
  font-size: 12px;
  cursor: pointer;
}

.text-button:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.local-entry {
  align-self: center;
  margin-top: 18px;
}

.auth-privacy {
  margin: 24px 0 0;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.65;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  height: var(--header-height);
  border-bottom: 1px solid var(--line);
  background: rgba(10, 13, 16, 0.96);
  backdrop-filter: blur(12px);
}

.header-inner {
  display: grid;
  width: min(100% - 32px, 1540px);
  height: 100%;
  grid-template-columns: minmax(190px, 1fr) auto minmax(280px, 1fr);
  align-items: center;
  gap: 24px;
  margin: 0 auto;
}

.app-brand .brand-mark {
  width: 31px;
  height: 31px;
  flex-basis: 31px;
}

.preview-tag {
  border-left: 1px solid var(--line);
  color: var(--text-muted);
  padding-left: 10px;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 9px;
  font-weight: 500;
}

.main-nav {
  display: flex;
  align-items: stretch;
  align-self: stretch;
}

.main-nav a {
  position: relative;
  display: flex;
  min-width: 104px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--text-muted);
  font-size: 13px;
  transition: color 160ms ease, background-color 160ms ease;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.018);
  color: var(--text);
}

.main-nav a[aria-current="page"]::after {
  position: absolute;
  right: 16px;
  bottom: -1px;
  left: 16px;
  height: 2px;
  background: var(--accent);
  content: "";
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.service-state {
  min-width: 74px;
  justify-content: flex-end;
}

.balance-chip {
  display: flex;
  height: 34px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0 10px;
  color: var(--text-muted);
  font-size: 11px;
}

.balance-chip:hover {
  border-color: var(--line-strong);
  background: var(--surface);
}

.balance-chip strong {
  color: var(--text);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.icon-button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 100ms ease;
}

.icon-button:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: var(--surface-hover);
  color: var(--text);
}

.icon-button.small {
  width: 36px;
  height: 36px;
}

.icon-button.small svg {
  width: 15px;
  height: 15px;
}

.app-main {
  width: min(100% - 32px, 1540px);
  margin: 0 auto;
  padding: 32px 0 80px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.page-heading h1 {
  font-size: 27px;
}

.page-heading > div > p:last-child {
  max-width: 62ch;
  margin: 7px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.analysis-heading {
  align-items: center;
}

.heading-meta {
  display: grid;
  min-width: min(100%, 520px);
  grid-template-columns: repeat(4, minmax(88px, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(13, 17, 20, 0.72);
}

.heading-metric {
  position: relative;
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px 11px;
}

.heading-metric + .heading-metric {
  border-left: 1px solid var(--line);
}

.heading-metric small {
  color: var(--text-muted);
  font-size: 8px;
  line-height: 1.2;
}

.heading-meta strong {
  overflow: hidden;
  color: var(--text-secondary);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.heading-metric[data-status] {
  padding-left: 24px;
}

.heading-metric[data-status]::before {
  position: absolute;
  top: 13px;
  left: 11px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-muted);
  content: "";
  box-shadow: 0 0 0 3px rgba(120, 134, 132, 0.08);
}

.heading-metric[data-status="live"]::before {
  background: var(--positive);
  box-shadow: 0 0 0 3px rgba(103, 201, 166, 0.11);
}

.heading-metric[data-status="warning"]::before {
  background: var(--warning);
  box-shadow: 0 0 0 3px rgba(215, 172, 99, 0.1);
}

.heading-metric[data-status="error"]::before {
  background: var(--negative);
  box-shadow: 0 0 0 3px rgba(229, 121, 121, 0.1);
}

.mobile-market-switch {
  display: none;
}

.surface {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(17, 23, 29, 0.91), rgba(12, 17, 23, 0.87));
  box-shadow:
    0 16px 40px rgba(2, 7, 8, 0.22),
    0 0 28px rgba(83, 199, 165, 0.025),
    inset 0 1px rgba(255, 255, 255, 0.025);
  backdrop-filter: blur(14px) saturate(112%);
}

.analysis-workspace {
  display: grid;
  grid-template-columns: minmax(240px, 290px) minmax(480px, 1fr) minmax(250px, 300px);
  gap: 14px;
  align-items: stretch;
}

.command-panel,
.task-panel {
  min-height: 510px;
  padding: 20px;
}

.panel-heading,
.market-head,
.report-head,
.deposit-order-head,
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.panel-heading h2,
.market-head h2,
.report-head h2,
.deposit-order h2,
.modal h2 {
  font-size: 16px;
}

.panel-heading > svg {
  color: var(--text-muted);
}

.market-selector {
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin-top: 20px;
}

.market-selector button {
  min-height: 66px;
  padding: 8px;
  text-align: left;
}

.market-selector strong,
.market-selector span {
  display: block;
}

.market-selector strong {
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.market-selector span {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 10px;
}

.command-facts {
  margin: 22px 0;
}

.command-facts div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid rgba(38, 49, 57, 0.78);
  padding: 10px 0;
  font-size: 11px;
}

.command-facts div:last-child {
  border-bottom: 1px solid rgba(38, 49, 57, 0.78);
}

.command-facts dt {
  color: var(--text-muted);
}

.command-facts dd {
  margin: 0;
  color: var(--text-secondary);
  text-align: right;
}

.quota-line {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--text-muted);
  font-size: 11px;
}

.quota-line strong {
  color: var(--text);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.microcopy {
  margin: 12px 0 0;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.6;
}

.market-panel {
  position: relative;
  display: grid;
  min-height: 510px;
  grid-template-rows: auto minmax(350px, 1fr) auto;
  overflow: hidden;
  isolation: isolate;
}

.market-panel::before {
  position: absolute;
  inset: 0;
  z-index: 3;
  border: 1px solid transparent;
  pointer-events: none;
  content: "";
  opacity: 0;
}

.market-panel.market-pulse-up::before {
  animation: market-pulse-up 900ms cubic-bezier(0.22, 1, 0.36, 1);
}

.market-panel.market-pulse-down::before {
  animation: market-pulse-down 900ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes market-pulse-up {
  0% { opacity: 0; box-shadow: inset 0 0 0 rgba(83, 199, 165, 0); }
  28% { opacity: 0.72; box-shadow: inset 0 0 34px rgba(83, 199, 165, 0.12); border-color: rgba(83, 199, 165, 0.34); }
  100% { opacity: 0; box-shadow: inset 0 0 52px rgba(83, 199, 165, 0); }
}

@keyframes market-pulse-down {
  0% { opacity: 0; box-shadow: inset 0 0 0 rgba(229, 121, 121, 0); }
  28% { opacity: 0.66; box-shadow: inset 0 0 34px rgba(229, 121, 121, 0.1); border-color: rgba(229, 121, 121, 0.3); }
  100% { opacity: 0; box-shadow: inset 0 0 52px rgba(229, 121, 121, 0); }
}

.market-head {
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 17px 18px 14px;
}

.market-symbol-row,
.market-price-row,
.market-source,
.market-foot {
  display: flex;
  align-items: center;
}

.market-symbol-row {
  gap: 9px;
}

.timeframe {
  border-left: 1px solid var(--line);
  color: var(--text-muted);
  padding-left: 9px;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 9px;
}

.market-price-row {
  gap: 10px;
  margin-top: 7px;
}

.market-price-row strong {
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 21px;
  font-variant-numeric: tabular-nums;
}

.market-price-row span {
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.price-positive {
  color: var(--positive);
}

.price-negative {
  color: var(--negative);
}

.market-source {
  gap: 9px;
  color: var(--text-muted);
  font-size: 10px;
}

.market-source > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(13, 17, 20, 0.7);
  padding: 4px 8px;
  white-space: nowrap;
}

.market-source > span::before {
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--text-muted);
  content: "";
}

.market-source > span[data-state="live"]::before { background: var(--positive); }
.market-source > span[data-state="warning"]::before { background: var(--warning); }
.market-source > span[data-state="error"]::before { background: var(--negative); }

.chart-wrap {
  position: relative;
  min-height: 350px;
  background: #0d1114;
}

.market-chart {
  position: absolute;
  inset: 0;
}

.chart-skeleton {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  align-content: end;
  grid-template-columns: repeat(4, 1fr);
  gap: 13%;
  padding: 10% 12% 14%;
  background: #0d1114;
}

.chart-skeleton span {
  align-self: end;
  height: 35%;
  background: #182126;
  animation: skeleton-pulse 1.2s ease-in-out infinite alternate;
}

.chart-skeleton span:nth-child(2) { height: 72%; animation-delay: 120ms; }
.chart-skeleton span:nth-child(3) { height: 50%; animation-delay: 240ms; }
.chart-skeleton span:nth-child(4) { height: 84%; animation-delay: 360ms; }

@keyframes skeleton-pulse {
  from { opacity: 0.42; }
  to { opacity: 0.88; }
}

.chart-error {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  color: var(--text-muted);
  text-align: center;
}

.chart-error svg {
  width: 26px;
  height: 26px;
  margin-bottom: 12px;
}

.chart-error strong {
  color: var(--text-secondary);
  font-size: 13px;
}

.chart-error span {
  max-width: 34ch;
  margin-top: 5px;
  font-size: 10px;
}

.market-foot {
  min-height: 36px;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding: 0 18px;
  color: var(--text-muted);
  font-size: 9px;
}

.market-foot span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.market-foot a:hover {
  color: var(--text-secondary);
}

.legend-candle {
  width: 5px;
  height: 12px;
  border: 1px solid var(--accent);
  background: rgba(83, 199, 165, 0.2);
}

.task-panel {
  display: flex;
  flex-direction: column;
}

.task-topline {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 10px;
}

.task-progress-value {
  margin-left: auto;
  color: var(--accent-strong);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.task-time {
  border-left: 1px solid var(--line);
  padding-left: 8px;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.task-panel h2 {
  margin-top: 20px;
  font-size: 19px;
}

.task-description {
  min-height: 54px;
  margin: 8px 0 18px;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.65;
}

.progress-track {
  position: relative;
  height: 4px;
  overflow: visible;
  border-radius: 999px;
  background: #222c32;
}

.progress-track div {
  position: relative;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(83, 199, 165, 0.34);
  transition: width var(--motion-data) var(--ease-standard);
}

.progress-track[data-activity="running"] div::before,
.progress-track[data-activity="running"] div::after {
  position: absolute;
  pointer-events: none;
  content: "";
}

.progress-track[data-activity="running"] div::after {
  top: 50%;
  right: -5px;
  width: 10px;
  height: 10px;
  transform: translateY(-50%);
  border: 1px solid rgba(226, 255, 247, 0.9);
  border-radius: 50%;
  background: var(--accent-strong);
  box-shadow:
    0 0 5px rgba(226, 255, 247, 0.95),
    0 0 13px rgba(83, 199, 165, 0.9),
    0 0 26px rgba(83, 199, 165, 0.42);
  animation: progress-orb-pulse 900ms var(--ease-enter) infinite alternate;
}

.progress-track[data-activity="running"] div::before {
  top: 50%;
  right: -1px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(226, 255, 247, 0.95);
  box-shadow:
    -8px -6px 0 rgba(83, 199, 165, 0.75),
    -15px 5px 0 rgba(115, 217, 187, 0.58),
    -24px -3px 0 rgba(226, 255, 247, 0.42),
    -34px 4px 0 rgba(83, 199, 165, 0.28);
  animation: progress-particle-trail 760ms linear infinite;
}

@keyframes progress-orb-pulse {
  from { transform: translateY(-50%) scale(0.86); filter: brightness(0.92); }
  to { transform: translateY(-50%) scale(1.18); filter: brightness(1.24); }
}

@keyframes progress-particle-trail {
  from { opacity: 0.28; transform: translate(2px, -50%) scale(0.72); }
  45% { opacity: 1; }
  to { opacity: 0; transform: translate(-12px, -50%) scale(1.18); }
}

.analysis-cores {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-height: 0;
  margin-top: 0;
  overflow: hidden;
  opacity: 0;
  transition:
    max-height var(--motion-data) var(--ease-standard),
    margin-top var(--motion-data) var(--ease-standard),
    opacity var(--motion-fast) linear;
}

.task-panel[data-active="true"] .analysis-cores {
  max-height: 38px;
  margin-top: 13px;
  opacity: 1;
}

.analysis-cores::before,
.analysis-cores::after {
  position: absolute;
  top: 5px;
  left: 17%;
  width: 66%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(83, 199, 165, 0.42), transparent);
  content: "";
  transform: scaleX(0.2);
  opacity: 0.25;
  transition: transform var(--motion-data) var(--ease-standard), opacity var(--motion-fast) linear;
}

.analysis-cores::after {
  background: linear-gradient(90deg, transparent, rgba(181, 86, 255, 0.5), transparent);
  filter: blur(2px);
}

.task-panel[data-phase="synthesis"] .analysis-cores::before,
.task-panel[data-phase="synthesis"] .analysis-cores::after,
.task-panel[data-phase="validating"] .analysis-cores::before,
.task-panel[data-phase="validating"] .analysis-cores::after,
.task-panel[data-phase="saving"] .analysis-cores::before,
.task-panel[data-phase="saving"] .analysis-cores::after {
  transform: scaleX(1);
  opacity: 0.9;
  animation: core-link-flow 1.2s linear infinite;
}

.analysis-cores > span {
  display: grid;
  justify-items: center;
  gap: 5px;
  color: var(--text-muted);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 8px;
}

.analysis-cores i {
  position: relative;
  z-index: 1;
  width: 10px;
  height: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
}

.task-panel[data-phase="analysis"] .analysis-cores i {
  border-color: rgba(83, 199, 165, 0.88);
  background: rgba(83, 199, 165, 0.32);
  box-shadow: 0 0 12px rgba(83, 199, 165, 0.58);
  animation: analysis-core-pulse 950ms ease-in-out infinite alternate;
}

.task-panel[data-phase="analysis"] .analysis-cores > span:nth-child(2) i { animation-delay: 160ms; }
.task-panel[data-phase="analysis"] .analysis-cores > span:nth-child(3) i { animation-delay: 320ms; }

.task-panel[data-phase="synthesis"] .analysis-cores i,
.task-panel[data-phase="validating"] .analysis-cores i,
.task-panel[data-phase="saving"] .analysis-cores i {
  border-color: rgba(181, 86, 255, 0.84);
  background: rgba(181, 86, 255, 0.28);
  box-shadow: 0 0 14px rgba(181, 86, 255, 0.45);
}

@keyframes analysis-core-pulse {
  from { transform: scale(0.78); opacity: 0.55; }
  to { transform: scale(1.18); opacity: 1; }
}

@keyframes core-link-flow {
  from { filter: brightness(0.72); }
  50% { filter: brightness(1.45); }
  to { filter: brightness(0.72); }
}

.phase-list {
  display: grid;
  margin-top: 18px;
}

.phase-list div {
  position: relative;
  display: grid;
  min-height: 34px;
  grid-template-columns: 7px minmax(0, 1fr);
  align-items: flex-start;
  align-content: start;
  gap: 10px;
  color: var(--text-muted);
  font-size: 10px;
}

.phase-list div:not(:last-child)::after {
  position: absolute;
  top: 9px;
  bottom: -3px;
  left: 3px;
  width: 1px;
  background: var(--line);
  content: "";
}

.phase-list span {
  position: relative;
  z-index: 1;
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  margin-top: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
}

.phase-list b {
  font-weight: 500;
}

.phase-list small {
  display: none;
  grid-column: 2;
  margin-top: -6px;
  color: var(--text-muted);
  font-size: 9px;
  line-height: 1.45;
}

.phase-list div.complete,
.phase-list div.active {
  color: var(--text-secondary);
}

.phase-list div.complete span {
  border-color: var(--positive);
  background: var(--positive);
}

.phase-list div.active span {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(83, 199, 165, 0.13);
  animation: phase-node-scan 1.15s ease-in-out infinite alternate;
}

@keyframes phase-node-scan {
  from { box-shadow: 0 0 0 2px rgba(83, 199, 165, 0.08); }
  to { box-shadow: 0 0 0 5px rgba(83, 199, 165, 0.2), 0 0 14px rgba(83, 199, 165, 0.32); }
}

.phase-list div.active b {
  color: var(--text);
  font-weight: 620;
}

.phase-list div.active small {
  display: block;
}

.research-term {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.research-term > span {
  color: var(--text-muted);
  font-size: 9px;
}

.research-term strong {
  display: block;
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 11px;
}

.research-term p {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 9px;
  line-height: 1.55;
}

.task-panel > .text-button {
  margin-top: 12px;
}

.failure-panel {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
  border: 1px solid rgba(229, 121, 121, 0.36);
  border-radius: var(--radius-lg);
  background: rgba(229, 121, 121, 0.055);
  padding: 14px 16px;
}

.failure-panel > div {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--negative);
  font-size: 12px;
}

.failure-panel p {
  flex: 1;
  margin: 0;
  color: var(--text-secondary);
  font-size: 11px;
}

.report-panel {
  margin-top: 14px;
  overflow: hidden;
}

.report-head {
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 20px;
}

.report-head h2 {
  font-size: 20px;
}

.report-head p:last-child {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.report-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  background: rgba(215, 172, 99, 0.045);
  color: var(--warning);
  padding: 10px 20px;
  font-size: 10px;
}

.report-notice svg {
  width: 14px;
  height: 14px;
}

.report-panel pre {
  max-height: 72vh;
  margin: 0;
  overflow: auto;
  background: #0d1114;
  color: #cbd4d2;
  padding: clamp(18px, 3vw, 36px);
  font-family: "Cascadia Mono", "Microsoft YaHei UI", Consolas, monospace;
  font-size: 12px;
  line-height: 1.8;
  tab-size: 2;
  white-space: pre-wrap;
  word-break: break-word;
}

.history-table {
  overflow: hidden;
}

.history-header,
.history-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.7fr) minmax(90px, 0.6fr) minmax(80px, 0.6fr) 92px;
  align-items: center;
  gap: 18px;
  padding: 0 18px;
}

.history-header {
  min-height: 42px;
  border-bottom: 1px solid var(--line);
  background: #0d1114;
  color: var(--text-muted);
  font-size: 10px;
}

.history-row {
  min-height: 72px;
  border-bottom: 1px solid rgba(38, 49, 57, 0.76);
  transition: background-color 160ms ease;
}

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

.history-row:hover {
  background: var(--surface-hover);
}

.history-identity strong,
.history-identity span {
  display: block;
}

.history-identity strong {
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.history-identity span,
.history-duration {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 10px;
}

.status-text {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-secondary);
  font-size: 11px;
}

.status-text::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  content: "";
}

.status-text.done::before { background: var(--positive); }
.status-text.failed::before { background: var(--negative); }
.status-text.running::before { background: var(--accent); }
.status-text.queued::before { background: var(--warning); }

.history-action {
  justify-self: start;
}

.table-empty {
  min-height: 220px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  font-size: 12px;
}

.wallet-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.86fr) minmax(420px, 1.14fr);
  gap: 14px;
}

.wallet-balance,
.deposit-panel {
  min-height: 330px;
  padding: 24px;
}

.wallet-balance h2 {
  margin: 12px 0 24px;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 42px;
  font-weight: 560;
  font-variant-numeric: tabular-nums;
}

.wallet-balance h2 small {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}

.wallet-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.wallet-metrics div {
  min-width: 0;
  padding: 14px 10px 14px 0;
}

.wallet-metrics div + div {
  border-left: 1px solid var(--line);
  padding-left: 14px;
}

.wallet-metrics span,
.wallet-metrics strong {
  display: block;
}

.wallet-metrics span {
  color: var(--text-muted);
  font-size: 9px;
}

.wallet-metrics strong {
  margin-top: 5px;
  overflow: hidden;
  color: var(--text-secondary);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wallet-balance > p:last-child {
  margin: 18px 0 0;
  color: var(--text-muted);
  font-size: 11px;
}

.deposit-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.55fr);
  align-content: start;
  column-gap: 18px;
}

.deposit-panel .panel-heading,
.deposit-panel .microcopy {
  grid-column: 1 / -1;
}

.deposit-panel .field {
  margin-top: 22px;
  margin-bottom: 12px;
}

.amount-input {
  position: relative;
}

.amount-input input {
  padding-right: 62px;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.amount-input span {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 10px;
}

.deposit-presets {
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  align-self: end;
  margin-bottom: 12px;
}

.deposit-presets button {
  height: 44px;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 10px;
}

.deposit-estimate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 10px;
}

.deposit-estimate strong {
  color: var(--text-secondary);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.deposit-panel > .button {
  align-self: center;
}

.deposit-order {
  margin-top: 14px;
  padding: 24px;
}

.deposit-order-head {
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.deposit-order-head > span {
  color: var(--text-muted);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 10px;
}

.deposit-instructions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}

.deposit-instructions span,
.deposit-instructions code {
  display: block;
}

.deposit-instructions span {
  color: var(--text-muted);
  font-size: 10px;
}

.deposit-instructions code {
  margin-top: 6px;
  overflow-wrap: anywhere;
  color: var(--text-secondary);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  user-select: all;
}

.txid-field {
  margin-top: 18px;
}

.inline-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.deposit-status-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--text-muted);
  font-size: 10px;
}

.payment-rules {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.payment-rules div {
  padding: 18px 18px 20px 0;
}

.payment-rules div + div {
  border-left: 1px solid var(--line);
  padding-left: 18px;
}

.payment-rules strong,
.payment-rules span {
  display: block;
}

.payment-rules strong {
  font-size: 11px;
}

.payment-rules span {
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 9px;
  line-height: 1.55;
}

.mobile-nav {
  display: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: grid;
  place-items: center;
  overflow-y: auto;
  background: rgba(2, 5, 6, 0.78);
  padding: 24px;
  backdrop-filter: blur(6px);
}

.modal {
  width: min(100%, 520px);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
}

.modal-small {
  width: min(100%, 430px);
}

.modal-head {
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 18px 20px;
}

.modal-body {
  padding: 20px;
}

.confirm-summary {
  margin: 0;
}

.confirm-summary div,
.account-summary > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding: 11px 0;
}

.confirm-summary div:first-child,
.account-summary > div:first-child {
  border-top: 1px solid var(--line);
}

.confirm-summary dt,
.account-summary span {
  color: var(--text-muted);
  font-size: 11px;
}

.confirm-summary dd,
.account-summary strong {
  margin: 0;
  color: var(--text-secondary);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.check-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  margin-top: 18px;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.6;
  cursor: pointer;
}

.check-row input {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  accent-color: var(--accent);
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 16px 20px 20px;
}

.modal-actions.single {
  grid-template-columns: 1fr;
}

.modal-lead {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.warning-block {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  margin-top: 18px;
  border-left: 2px solid var(--warning);
  background: rgba(215, 172, 99, 0.055);
  padding: 12px;
  color: var(--warning);
}

.warning-block svg {
  width: 16px;
  height: 16px;
  margin-top: 1px;
}

.warning-block p {
  margin: 0;
  font-size: 10px;
  line-height: 1.6;
}

.account-summary p {
  margin: 16px 0 0;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.6;
}

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: var(--z-toast);
  display: grid;
  width: min(360px, calc(100vw - 36px));
  gap: 8px;
}

.toast {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: #172025;
  padding: 12px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.35);
  color: var(--text-secondary);
  font-size: 11px;
  animation: toast-in 180ms ease-out;
}

.toast.error {
  border-color: rgba(229, 121, 121, 0.45);
}

.toast svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

.toast.error svg {
  color: var(--negative);
}

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

@media (max-width: 1180px) {
  .analysis-workspace {
    grid-template-columns: minmax(240px, 290px) minmax(0, 1fr);
  }

  .task-panel {
    min-height: auto;
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(260px, 0.8fr) minmax(260px, 1.2fr);
    column-gap: 34px;
  }

  .task-topline,
  .task-panel h2,
  .task-description,
  .progress-track,
  .task-panel > .text-button {
    grid-column: 1;
  }

  .phase-list,
  .research-term {
    grid-column: 2;
  }

  .phase-list {
    grid-row: 1 / span 4;
    margin-top: 0;
  }

  .research-term {
    margin-top: 8px;
  }
}

@media (max-width: 900px) {
  .header-inner {
    grid-template-columns: 1fr auto;
  }

  .main-nav,
  .service-state,
  .balance-chip {
    display: none;
  }

  .analysis-workspace {
    grid-template-columns: 1fr;
  }

  .command-panel,
  .market-panel,
  .task-panel {
    min-height: auto;
  }

  .market-panel {
    grid-row: 1;
  }

  .command-panel {
    grid-row: 2;
  }

  .task-panel {
    grid-row: 3;
    grid-template-columns: 1fr;
  }

  .task-topline,
  .task-panel h2,
  .task-description,
  .progress-track,
  .phase-list,
  .research-term,
  .task-panel > .text-button {
    grid-column: 1;
  }

  .phase-list {
    grid-row: auto;
    margin-top: 18px;
  }

  .wallet-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  :root {
    --header-height: 56px;
  }

  body::before {
    background-size: auto, 54px 54px, 54px 54px;
  }

  .ambient-field {
    opacity: 0.72;
  }

  .icon-button,
  .icon-button.small {
    width: 44px;
    height: 44px;
  }

  .auth-view {
    grid-template-columns: 1fr;
  }

  .auth-intro {
    min-height: 270px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 24px 20px;
  }

  .auth-copy {
    padding: 42px 0 26px;
  }

  .auth-copy h1 {
    max-width: 20ch;
    font-size: 29px;
  }

  .auth-copy > p:last-child {
    display: none;
  }

  .auth-foot {
    display: none;
  }

  .auth-panel {
    min-height: auto;
    padding: 34px 20px 48px;
  }

  .brand-word {
    font-size: 16px;
  }

  .preview-tag {
    display: none;
  }

  .app-main {
    width: min(100% - 20px, 680px);
    padding: 22px 0 calc(88px + env(safe-area-inset-bottom));
  }

  .header-inner {
    width: calc(100% - 20px);
  }

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

  .page-heading h1 {
    font-size: 22px;
  }

  .analysis-heading {
    display: block;
  }

  .heading-meta {
    margin-top: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .heading-metric:nth-child(3) {
    border-left: 0;
  }

  .heading-metric:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .mobile-market-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    margin-top: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #0d1114;
    padding: 3px;
  }

  .mobile-market-switch button {
    min-height: 40px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    font-family: "Cascadia Mono", Consolas, monospace;
    cursor: pointer;
  }

  .mobile-market-switch button[aria-pressed="true"] {
    background: var(--surface-raised);
    color: var(--text);
    box-shadow: inset 0 0 0 1px var(--line-strong);
  }

  .analysis-workspace {
    gap: 10px;
  }

  .command-panel,
  .task-panel,
  .wallet-balance,
  .deposit-panel,
  .deposit-order {
    padding: 17px;
  }

  .market-panel {
    grid-template-rows: auto 300px auto;
  }

  .chart-wrap {
    min-height: 300px;
  }

  .market-head {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 14px;
  }

  .market-head > div:first-child {
    flex: 1 1 100%;
  }

  #marketTitle {
    white-space: nowrap;
  }

  .market-source {
    width: 100%;
    justify-content: space-between;
    margin-top: 9px;
  }

  .market-source > span {
    max-width: calc(100% - 52px);
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .market-foot {
    padding: 0 14px;
  }

  .failure-panel {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .failure-panel p {
    flex-basis: calc(100% - 100px);
  }

  .report-head {
    align-items: flex-start;
    padding: 17px;
  }

  .report-head .button span {
    display: none;
  }

  .report-panel pre {
    max-height: none;
    font-size: 11px;
  }

  .history-header {
    display: none;
  }

  .history-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 16px;
    padding: 14px;
  }

  .history-status {
    align-self: start;
  }

  .history-duration {
    margin-top: 0;
  }

  .history-action {
    justify-self: end;
  }

  .wallet-balance h2 {
    font-size: 34px;
  }

  .wallet-metrics {
    grid-template-columns: 1fr;
  }

  .wallet-metrics div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
    padding-left: 0;
  }

  .deposit-panel {
    grid-template-columns: 1fr;
  }

  .deposit-panel .panel-heading,
  .deposit-panel .microcopy {
    grid-column: 1;
  }

  .deposit-presets {
    margin-bottom: 16px;
  }

  .deposit-estimate {
    margin-bottom: 14px;
  }

  .inline-action {
    grid-template-columns: 1fr;
  }

  .deposit-status-line {
    align-items: flex-start;
    flex-direction: column;
  }

  .payment-rules {
    grid-template-columns: 1fr;
  }

  .payment-rules div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
    padding-left: 0;
  }

  .mobile-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: var(--z-header);
    display: grid;
    height: calc(62px + env(safe-area-inset-bottom));
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--line);
    background: rgba(10, 13, 16, 0.97);
    padding-bottom: env(safe-area-inset-bottom);
    backdrop-filter: blur(12px);
  }

  .mobile-nav a {
    display: flex;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 3px;
    color: var(--text-muted);
    font-size: 9px;
  }

  .mobile-nav a[aria-current="page"] {
    color: var(--accent-strong);
  }

  .mobile-nav svg {
    width: 18px;
    height: 18px;
  }

  .modal-backdrop {
    align-items: end;
    padding: 10px;
  }

  .modal {
    max-height: calc(100dvh - 20px);
    overflow: auto;
  }

  .modal-actions {
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }

  input {
    font-size: 16px;
  }

  .toast-region {
    right: 10px;
    bottom: calc(72px + env(safe-area-inset-bottom));
    width: calc(100vw - 20px);
  }
}

@media (max-width: 390px) {
  .market-price-row strong {
    font-size: 18px;
  }

  .market-foot {
    min-height: 52px;
    align-items: flex-start;
    justify-content: center;
    flex-direction: column;
    gap: 3px;
  }

  .modal-actions {
    grid-template-columns: 1fr;
  }
}

@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;
  }

  .ambient-field {
    opacity: 0.38;
  }

  .burst-field {
    display: none;
  }

  .progress-track[data-activity="running"] div::before {
    display: none;
  }

  .progress-track[data-activity="running"] div::after {
    animation: none;
  }

  body::after {
    animation: none;
  }
}
