/* ==========================================================================
   LDP Accumulator — stylesheet
   Same design tokens as LDP Analyzer Pro, so the tools read as one product.
   The top of the page (header, stat cards, market bar) keeps the original
   shared theme; see top.css.
   ========================================================================== */

:root {
  --bg: #eef2f7;
  --surface: #ffffff;
  --surface-2: #f5f7fb;
  --surface-3: #e8edf4;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0b1733;
  --text-2: #334155;
  --text-muted: #64748b;

  --brand: #2563eb;
  --brand-600: #1d4ed8;
  --brand-soft: rgba(37, 99, 235, 0.10);
  --accent: #f59e0b;
  --accent-soft: rgba(245, 158, 11, 0.16);
  --pos: #059669;
  --neg: #dc2626;
  --pos-soft: rgba(5, 150, 105, 0.12);
  --neg-soft: rgba(220, 38, 38, 0.10);

  --chart-line: #2563eb;
  --chart-fill: rgba(37, 99, 235, 0.16);
  --chart-grid: rgba(15, 23, 42, 0.06);
  --chart-text: #64748b;
  --chart-gate: rgba(37, 99, 235, 0.11);
  --chart-gate-edge: rgba(37, 99, 235, 0.55);

  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 1px rgba(15, 23, 42, 0.03);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 10px 30px -18px rgba(15, 23, 42, 0.25);
  --ring: 0 0 0 3px rgba(37, 99, 235, 0.25);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
/* Android WebViews that already sit between the system bars (our app, most
   in-app browsers) can report the bars' insets anyway, which doubled the gap.
   A normal tab is never under the status bar, so a top inset means the insets
   are not real (same fix as LDP Pro). */
@media (display-mode: browser) {
  @supports not (-webkit-touch-callout: none) {
    :root { --safe-bottom: max(0px, env(safe-area-inset-bottom, 0px) - env(safe-area-inset-top, 0px) * 100); }
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body.accu {
  margin: 0;
  background: #ffffff;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* Not the header's original .button-3 buttons: their icon font comes from .fa. */
.accu :where(button:not(.button-3)) { font: inherit; color: inherit; }
.accu button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.accu [hidden] { display: none !important; }

.ac-wrap {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ── Connection chip (in the chart card) ─────────────────────────────── */
/* Only transform/opacity animate here, so the compositor runs them without
   touching the main thread. */
.ac-conn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font: 600 12px var(--font);
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
}
.ac-conn-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.ac-conn-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: inherit;
  opacity: 0;
}
.ac-conn[data-state="live"] .ac-conn-dot { background: var(--pos); }
.ac-conn[data-state="live"] .ac-conn-dot::after { animation: ac-ring 2.4s ease-out infinite; }
.ac-conn[data-state="reconnecting"] .ac-conn-dot,
.ac-conn[data-state="connecting"] .ac-conn-dot { animation: ac-blink 1s ease-in-out infinite; }
.ac-conn[data-state="offline"] .ac-conn-dot { background: var(--neg); }
.ac-conn-ms { color: var(--text-muted); font-family: var(--mono); font-weight: 500; }
.ac-conn-ms:empty { display: none; }
@keyframes ac-ring {
  0% { transform: scale(1); opacity: 0.55; }
  70%, 100% { transform: scale(2.6); opacity: 0; }
}
@keyframes ac-blink { 50% { opacity: 0.35; } }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.ac-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.08s, box-shadow 0.15s, opacity 0.15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.ac-btn:active { transform: translateY(1px); }
.ac-btn:focus-visible, .ac-conn:focus-visible, .ac-mkt button:focus-visible,
.ac-seg button:focus-visible, .ac-tabs button:focus-visible { outline: none; box-shadow: var(--ring); }
.ac-btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }
.ac-btn-sm { height: 34px; padding: 0 13px; font-size: 13px; }
.ac-btn-lg { height: 50px; padding: 0 18px; font-size: 15px; width: 100%; }
.ac-btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  box-shadow: 0 8px 18px -10px rgba(37, 99, 235, 0.9);
}
.ac-btn-primary:hover:not([disabled]) { background: linear-gradient(180deg, #2f76ef, #1d4ed8); }
.ac-btn-stop {
  color: #fff;
  background: linear-gradient(180deg, #ef4444, #dc2626);
  box-shadow: 0 8px 18px -10px rgba(220, 38, 38, 0.9);
}
.ac-btn-danger {
  color: var(--neg);
  background: var(--neg-soft);
  border-color: color-mix(in srgb, var(--neg) 30%, transparent);
  height: 42px;
  width: 100%;
}
.ac-btn-danger:hover:not([disabled]) { background: color-mix(in srgb, var(--neg) 18%, transparent); }
.ac-btn-ghost {
  color: var(--text-2);
  background: var(--surface);
  border-color: var(--border);
}
.ac-btn-ghost:hover { background: var(--surface-2); }
.ac-link {
  border: 0;
  background: none;
  color: var(--brand);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
}
.ac-link:hover { background: var(--brand-soft); }

/* ── Layout ─────────────────────────────────────────────────────────────── */
.ac-main { padding-top: 14px; padding-bottom: 32px; }

.ac-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 16px;
  align-items: start;
}
.ac-col-main, .ac-col-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ac-col-side { position: sticky; top: 72px; }

.ac-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  min-width: 0;
}
.ac-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.ac-card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.ac-sub { font-size: 12px; color: var(--text-muted); }
.ac-eyebrow {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Market picker: header, 2s/1s toggle, five volatility buttons ──── */
.ac-mkt {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding: 8px 8px 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.ac-mkt-head { display: flex; flex-direction: column; flex: none; line-height: 1.2; }
.ac-mkt-title { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text); }
.ac-mkt-hint { font-size: 11px; color: var(--text-muted); }
.ac-mkt-row { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.ac-mkt-speed {
  display: inline-flex;
  flex: none;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.ac-mkt-speed button {
  height: 30px;
  min-width: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
}
.ac-mkt-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; flex: 1; min-width: 0; }
.ac-mkt-list button {
  height: 38px;
  min-width: 0;
  padding: 0 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.08s;
}
.ac-mkt-list button:hover { border-color: var(--border-strong); }
.ac-mkt-speed button.active,
.ac-mkt-list button.active { background: #173262; border-color: #173262; color: #fff; }
/* Locked during a trade or a bot run: dim the other choices, not the chosen market. */
.ac-mkt.locked button:not(.active) { opacity: 0.4; pointer-events: none; }

/* ── Chart card ─/* ── Chart card ─────────────────────────────────────────────────────────── */
.ac-quote { min-width: 0; }
.ac-price {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.ac-move {
  font-size: 13px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-muted);
}
.ac-move.up { color: var(--pos); background: var(--pos-soft); }
.ac-move.down { color: var(--neg); background: var(--neg-soft); }
.ac-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.ac-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
}
.ac-chip b { font-family: var(--mono); color: var(--text); }
.ac-chip .fa { color: var(--brand); }

.ac-chart {
  position: relative;
  height: 340px;
  margin: 0 -4px;
  overflow: hidden;
}
.ac-chart canvas { position: absolute; inset: 0; display: block; }
.ac-chart-dot {
  position: absolute;
  left: -5px;
  top: -5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--chart-line);
  border: 2px solid var(--surface);
  opacity: 0;
  pointer-events: none;
  will-change: transform;
}
.ac-chart-dot::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid var(--chart-line);
  animation: ac-pulse 2s ease-out infinite;
  will-change: transform, opacity;
}
@keyframes ac-pulse {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(3.2); opacity: 0; }
}
.ac-chart-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-muted);
  font-weight: 500;
  background: var(--surface);
  transition: opacity 0.25s;
}
.ac-chart-loading.done { opacity: 0; pointer-events: none; }
.ac-spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  border-top-color: var(--brand);
  animation: ac-spin 0.8s linear infinite;
}
@keyframes ac-spin { to { transform: rotate(360deg); } }

.ac-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}
.ac-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ac-legend i { display: inline-block; flex: none; }
.lg-gate { width: 7px; height: 14px; border-radius: 2px; background: var(--chart-gate); outline: 1px solid color-mix(in srgb, var(--chart-line) 30%, transparent); }
.lg-breach { width: 9px; height: 9px; border-radius: 50%; background: var(--neg); box-shadow: 0 0 0 3px var(--neg-soft); }
.lg-next { width: 16px; height: 10px; border-top: 1px dashed var(--brand); border-bottom: 1px dashed var(--brand); background: var(--brand-soft); }

.ac-meter-row { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.ac-meter-label { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.ac-meter-label b { font-family: var(--mono); color: var(--text); margin-left: 4px; }
.ac-meter { position: relative; height: 54px; }
.ac-meter canvas, .ac-streak canvas { position: absolute; inset: 0; display: block; }

/* ── Streaks ────────────────────────────────────────────────────────────── */
.ac-streak { position: relative; height: 120px; }

.ac-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.ac-kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 12px; }
.ac-kpis > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  min-width: 0;
}
.ac-kpis span { font-size: 11px; color: var(--text-muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-kpis b {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ac-kpis b.pos, .ac-odds b.pos { color: var(--pos); }
.ac-kpis b.neg, .ac-odds b.neg { color: var(--neg); }

/* ── Growth rate cards ──────────────────────────────────────────────────── */
.ac-locked .ac-seg button:not(.active) { opacity: 0.45; pointer-events: none; }

/* ── Trade panel ────────────────────────────────────────────────────────── */
.ac-tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.ac-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.ac-tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.ac-tabs-sm button { height: 30px; font-size: 12.5px; }

.ac-form { display: flex; flex-direction: column; gap: 12px; }
.ac-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ac-field > label, .ac-label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.ac-field small { color: var(--text-muted); font-weight: 500; }
.ac-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.ac-input {
  display: flex;
  align-items: center;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ac-input:focus-within { border-color: var(--brand); box-shadow: var(--ring); }
.ac-input input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  padding: 0 12px;
  background: transparent;
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  -moz-appearance: textfield;
}
.ac-input input::-webkit-outer-spin-button, .ac-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ac-input.invalid { border-color: var(--neg); }
.ac-unit { padding: 0 10px; font-size: 12px; color: var(--text-muted); font-weight: 600; }
.ac-step {
  width: 40px;
  height: 100%;
  border: 0;
  background: var(--surface-2);
  font-size: 18px !important;
  font-weight: 500;
  cursor: pointer;
  flex: none;
}
.ac-step:hover { background: var(--surface-3); }
.ac-select {
  height: 42px;
  width: 100%;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: 500 13px var(--font);
  outline: 0;
}
.ac-select:focus { border-color: var(--brand); box-shadow: var(--ring); }

.ac-seg {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.ac-seg button {
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.ac-seg button.active { background: var(--brand); color: #fff; box-shadow: 0 4px 10px -6px rgba(37, 99, 235, 0.9); }

.ac-quick { display: flex; gap: 6px; flex-wrap: wrap; }
.ac-quick button {
  flex: 1;
  height: 28px;
  min-width: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
}
.ac-quick button:hover { background: var(--surface-2); }

.ac-odds {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 10px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
}
.ac-odds > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ac-odds span { font-size: 11px; color: var(--text-muted); }
.ac-odds b { font-family: var(--mono); font-size: 15px; font-weight: 700; white-space: nowrap; }

.ac-auto { display: flex; flex-direction: column; gap: 12px; }

.ac-status {
  margin: -2px 0 0;
  min-height: 18px;
  font-size: 12.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 7px;
}
.ac-status:empty { display: none; }
.ac-status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; animation: ac-blink 1.2s ease-in-out infinite; }
.ac-status.run .dot { background: var(--pos); }
.ac-status.stop .dot { background: var(--neg); animation: none; }

.ac-locked-fields input, .ac-locked-fields select, .ac-locked-fields .ac-step, .ac-locked-fields .ac-quick button { pointer-events: none; opacity: 0.6; }

/* Open contract */
.ac-open {
  margin-top: 14px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--pos) 35%, transparent);
  background: linear-gradient(180deg, var(--pos-soft), transparent 70%);
  animation: ac-in 0.25s ease-out;
}
.ac-open.lost { border-color: color-mix(in srgb, var(--neg) 35%, transparent); background: linear-gradient(180deg, var(--neg-soft), transparent 70%); }
@keyframes ac-in { from { opacity: 0; transform: translateY(6px); } }
.ac-open-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.ac-badge {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--pos);
  background: var(--pos-soft);
}
.ac-open.lost .ac-badge { color: var(--neg); background: var(--neg-soft); }
.ac-open-title { font-size: 12.5px; color: var(--text-2); font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-open-pl { margin-left: auto; font-family: var(--mono); font-size: 18px; font-weight: 800; color: var(--pos); }
.ac-open-pl.neg { color: var(--neg); }
.ac-progress { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-bottom: 10px; }
.ac-progress-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #10b981, #059669);
  transition: width 0.35s ease;
}
.ac-open-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px; }
.ac-open-grid div { display: flex; flex-direction: column; gap: 1px; }
.ac-open-grid span { font-size: 11px; color: var(--text-muted); }
.ac-open-grid b { font-family: var(--mono); font-size: 14px; }

/* Session */
.ac-scroll { max-height: 300px; overflow: auto; margin-top: 10px; }
.ac-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ac-table th {
  position: sticky;
  top: 0;
  background: var(--surface);
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px 6px;
  border-bottom: 1px solid var(--border);
}
.ac-table td { padding: 7px 6px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.ac-table .r { text-align: right; }
.ac-table td.r { font-family: var(--mono); }
.ac-table td.pos { color: var(--pos); font-weight: 700; }
.ac-table td.neg { color: var(--neg); font-weight: 700; }
.ac-table tr.fresh td { animation: ac-flash 1.2s ease-out; }
@keyframes ac-flash { from { background: var(--brand-soft); } to { background: transparent; } }
.ac-empty td { text-align: center; color: var(--text-muted); padding: 18px 6px; }
.ac-tag { font-size: 10px; font-weight: 700; color: var(--text-muted); margin-left: 4px; }

.ac-log { list-style: none; margin: 10px 0 0; padding: 0; font-size: 12.5px; }
.ac-log li { display: flex; gap: 8px; padding: 6px 2px; border-bottom: 1px solid var(--border); color: var(--text-2); }
.ac-log time { font-family: var(--mono); font-size: 11px; color: var(--text-muted); flex: none; padding-top: 1px; }
.ac-log li.ok { color: var(--pos); }
.ac-log li.err { color: var(--neg); }
.ac-log li.warn { color: #b45309; }

/* Shared footer: flow after the content (it is sticky elsewhere). */
.accu .site-footer-compact { position: relative; top: auto; z-index: 1; }

/* ── Phone action dock ──────────────────────────────────────────────── */
.ac-dock { display: none; }

/* ── Responsive ─────────────────────────────────────────────────────── */
/* One column: chart, then the trade panel, then the analysis. */
@media (max-width: 1023px) {
  .ac-grid { display: flex; flex-direction: column; }
  .ac-col-main, .ac-col-side { display: contents; }
  .ac-col-side { position: static; }
  .ac-chart-card { order: 1; }
  .ac-trade { order: 2; }
  .ac-streak-card { order: 3; }
  .ac-session-card { order: 4; }
  .ac-grid > *, .ac-col-main > *, .ac-col-side > * { width: 100%; }
}

/* Phones: app-like. Edge-to-edge cards, 16px inputs (no iOS focus zoom),
   44px+ touch targets, press feedback, and the main action in a dock at the
   bottom of the screen, above the gesture bar. */
@media (max-width: 720px) {
  body.accu { padding-bottom: calc(78px + var(--safe-bottom)); }
  .ac-mkt { flex-direction: column; align-items: stretch; gap: 8px; margin-bottom: 10px; padding: 10px; }
  .ac-mkt-head { flex-direction: row; align-items: baseline; justify-content: space-between; padding: 0 2px; }
  .ac-mkt-row { gap: 6px; }
  .ac-mkt-speed button { height: 32px; min-width: 32px; padding: 0 8px; }
  .ac-mkt-list { gap: 5px; }
  .ac-mkt-list button { height: 38px; font-size: 13.5px; border-radius: 9px; }
  .ac-mkt-v { display: none; }
  .ac-wrap { padding: 0 10px; }
  .ac-main { padding-top: 10px; }
  .ac-grid, .ac-col-main, .ac-col-side { gap: 10px; }
  .ac-card { padding: 14px 12px; border-radius: 16px; box-shadow: var(--shadow-sm); }
  .ac-card-head { flex-wrap: wrap; margin-bottom: 10px; }
  .ac-price { font-size: 24px; }
  .ac-chips { justify-content: flex-start; gap: 6px; }
  .ac-chip, .ac-conn { padding: 5px 8px; font-size: 11.5px; gap: 5px; }
  .ac-conn-ms { display: none; }
  .ac-chart { height: 250px; margin: 0 -6px; }
  .ac-legend { font-size: 11.5px; gap: 4px 12px; }
  .ac-input { height: 48px; }
  .ac-input input, .ac-select { font-size: 16px; }
  .ac-select { height: 48px; }
  .ac-step { width: 48px; }
  .ac-seg button { height: 40px; font-size: 15px; }
  .ac-quick button { height: 36px; font-size: 13px; }
  .ac-tabs button { height: 42px; }
  .ac-row2 { gap: 8px; }
  .ac-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ac-kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ac-scroll { max-height: 260px; }

  /* The dock carries the main button on phones. */
  #actionBtn, #ocSell { display: none; }
  .ac-dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 950;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px calc(10px + var(--safe-bottom));
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    -webkit-backdrop-filter: saturate(1.4) blur(12px);
    backdrop-filter: saturate(1.4) blur(12px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -8px 24px -16px rgba(15, 23, 42, 0.35);
    transition: transform 0.2s ease;
  }
  .ac-dock.hidden { transform: translateY(110%); }
  .ac-dock-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
  .ac-dock-info b { font: 700 16px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ac-dock-info b.pos { color: var(--pos); }
  .ac-dock-info b.neg { color: var(--neg); }
  .ac-dock-info span { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ac-dock .ac-btn { height: 48px; min-width: 132px; padding: 0 18px; font-size: 15px; border-radius: 12px; flex: none; }
  .ac-dock .ac-btn-sell { color: #fff; background: linear-gradient(180deg, #f59e0b, #d97706); box-shadow: 0 8px 18px -10px rgba(217, 119, 6, 0.9); }
}

/* Press feedback wherever there is touch. */
@media (hover: none) {
  .ac-btn:active:not([disabled]), .ac-mkt button:active, .ac-seg button:active, .ac-quick button:active, .ac-tabs button:active { transform: scale(0.97); }
}

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