/* AtmosBoost — customer cabinet design system ("user mode").
   A separate design language for regular users: light-first, warm
   paper background, the public face's orange accent, one clean
   column, large readable cards. Nothing here reuses the owner
   console's stylesheet; every rule is scoped under body.user-mode
   so the owner console (owner.css) is completely unaffected.
   Theme: light by default; html[data-utheme="dark"] switches the
   tokens. The choice persists in localStorage (atmos-user-theme)
   and is applied pre-paint by a one-line script in the shells. */

html:has(> body.user-mode) { background: #F6F3EF; }
html[data-utheme="dark"]:has(> body.user-mode) { background: #131110; }

body.user-mode {
  --um-bg: #F6F3EF;
  --um-surface: #FFFFFF;
  --um-surface-soft: #FBF9F5;
  --um-ink: #1C1710;
  --um-ink-2: #5A5044;
  --um-muted: #8A7D6B;
  --um-line: #E9E1D3;
  --um-accent: #F46500;
  --um-accent-2: #FF7A1A;
  --um-accent-soft: rgba(244, 101, 0, .10);
  --um-ok: #178A5B;
  --um-ok-soft: rgba(23, 138, 91, .12);
  --um-bar: rgba(246, 243, 239, .86);
  --um-shadow: 0 12px 32px rgba(74, 50, 16, .08), 0 2px 6px rgba(74, 50, 16, .05);
  --um-radius: 20px;
  background: var(--um-bg);
  color: var(--um-ink);
  font-family: "Avenir Next", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

html[data-utheme="dark"] body.user-mode {
  --um-bg: #131110;
  --um-surface: #1F1A16;
  --um-surface-soft: #262019;
  --um-ink: #F4EFE7;
  --um-ink-2: #C8BBA6;
  --um-muted: #9A8C76;
  --um-line: #3A3126;
  --um-accent-soft: rgba(244, 101, 0, .18);
  --um-ok: #3ECF8E;
  --um-ok-soft: rgba(62, 207, 142, .14);
  --um-bar: rgba(19, 17, 16, .86);
  --um-shadow: 0 12px 32px rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .4);
}

body.user-mode * { box-sizing: border-box; }
body.user-mode a { -webkit-tap-highlight-color: transparent; }
body.user-mode button { font: inherit; }

.um-wrap { min-height: 100dvh; display: flex; flex-direction: column; }

/* ---------- top bar ---------- */
.um-topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--um-bar);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--um-line);
}
.um-topbar-in {
  width: min(920px, calc(100% - 40px)); margin: 0 auto;
  padding: 13px 0; display: flex; align-items: center; gap: 14px;
}
.um-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--um-ink); }
.um-logo { width: 38px; height: 36px; object-fit: contain; display: block; }
.um-brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.um-brand-text b { font-size: 19px; font-weight: 800; letter-spacing: .01em; }
.um-brand-text small { font-size: 10px; font-weight: 700; letter-spacing: .34em; color: var(--um-accent); }
.um-top-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.um-theme-toggle {
  width: 42px; height: 42px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--um-line); background: var(--um-surface);
  color: var(--um-ink-2); display: grid; place-items: center;
  transition: border-color .2s ease, color .2s ease, transform .2s ease;
}
.um-theme-toggle:hover { border-color: var(--um-accent); color: var(--um-accent); transform: translateY(-1px); }
.um-theme-toggle svg { width: 20px; height: 20px; display: block; }
.um-userchip { display: flex; align-items: center; gap: 10px; }
.um-avatar {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--um-accent), var(--um-accent-2));
  color: #fff; font-weight: 800; font-size: 16px;
  box-shadow: 0 6px 14px rgba(244, 101, 0, .3);
}
.um-username { font-weight: 700; font-size: 15.5px; }
.um-signout {
  border: 1.5px solid var(--um-line); background: transparent; color: var(--um-ink);
  padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: 15px; cursor: pointer;
  transition: border-color .2s ease, color .2s ease;
}
.um-signout:hover { border-color: var(--um-accent); color: var(--um-accent); }

/* ---------- tabs ---------- */
.um-tabs {
  width: min(920px, calc(100% - 40px)); margin: 22px auto 0;
  display: flex; gap: 10px;
}
.um-tab {
  flex: 1; text-align: center; text-decoration: none;
  padding: 16px 10px; border-radius: 16px;
  font-size: 17px; font-weight: 800; color: var(--um-ink-2);
  background: var(--um-surface); border: 1px solid var(--um-line);
  transition: transform .2s ease, border-color .2s ease, color .2s ease;
}
.um-tab:hover { transform: translateY(-1px); border-color: var(--um-accent); color: var(--um-accent); }
.um-tab.active {
  background: linear-gradient(135deg, var(--um-accent), var(--um-accent-2));
  color: #fff; border-color: transparent;
  box-shadow: 0 10px 22px rgba(244, 101, 0, .32);
}
.um-tab.active:hover { color: #fff; }

/* ---------- main column ---------- */
.um-main { width: min(920px, calc(100% - 40px)); margin: 8px auto 0; flex: 1; }
/* No entrance animation on the user views (ghost-fix, 2026-11-27):
   a view switch is a clean cut — content paints at full opacity in
   its final position. The previous um-rise fade (.45s, staggered)
   ran on BOTH the pre-paint static chrome and the live render, so
   every tab switch ghosted the incoming heading in twice. */

.um-hero { position: relative; padding: 26px 2px 4px; overflow: visible; }
.um-hero::before {
  content: ""; position: absolute; top: -70px; right: -40px; width: 340px; height: 240px;
  background: radial-gradient(closest-side, var(--um-accent-soft), transparent);
  filter: blur(6px); pointer-events: none;
}
.um-eyebrow {
  position: relative; margin: 0 0 12px; display: flex; align-items: center; gap: 9px;
  color: var(--um-accent); font-weight: 800; font-size: 12px;
  letter-spacing: .24em; text-transform: uppercase;
}
.um-eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 999px; background: var(--um-accent); box-shadow: 0 0 0 4px var(--um-accent-soft); }
.um-hero h1 { position: relative; margin: 0 0 12px; font-size: clamp(38px, 6vw, 54px); line-height: 1.02; letter-spacing: -.03em; font-weight: 850; }
.um-accent-dot { color: var(--um-accent); }
.um-lede { position: relative; margin: 0; font-size: 18px; line-height: 1.55; color: var(--um-ink-2); max-width: 58ch; }

.um-section { margin-top: 36px; }
.um-section > h2 { margin: 0 0 16px; font-size: 24px; font-weight: 800; letter-spacing: -.02em; }

.um-card {
  background: var(--um-surface); border: 1px solid var(--um-line);
  border-radius: var(--um-radius); padding: 26px; box-shadow: var(--um-shadow);
}
.um-section .um-card + .um-card { margin-top: 16px; }
.um-card h3 { margin: 0 0 6px; font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.um-card-title { margin: 0 0 18px; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }

.um-identity { margin-top: 26px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.um-identity h3 { font-size: 21px; }
.um-identity p { margin: 0; color: var(--um-ink-2); font-size: 15.5px; }

.um-service-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.um-tagline { margin: 0; color: var(--um-ink-2); font-size: 15.5px; line-height: 1.5; }
.um-note { margin: 14px 0 0; color: var(--um-ink-2); font-size: 15.5px; line-height: 1.6; }
.um-pill {
  flex: none; font-size: 12.5px; font-weight: 800; letter-spacing: .02em;
  padding: 7px 12px; border-radius: 999px; white-space: nowrap;
  background: var(--um-surface-soft); border: 1px solid var(--um-line); color: var(--um-ink-2);
}
.um-pill.on { background: var(--um-ok-soft); border-color: transparent; color: var(--um-ok); }
.um-service-actions { margin-top: 20px; }

.um-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 50px; padding: 0 24px; border-radius: 14px; border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--um-accent), var(--um-accent-2));
  color: #fff; font-weight: 800; font-size: 16px; text-decoration: none;
  box-shadow: 0 8px 18px rgba(244, 101, 0, .28);
  transition: transform .2s ease, filter .2s ease;
}
.um-btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.um-btn--soft { background: var(--um-accent-soft); color: var(--um-accent); box-shadow: none; }
.um-btn--ghost {
  background: transparent; border: 1.5px solid var(--um-line);
  color: var(--um-muted); box-shadow: none; cursor: not-allowed;
}
.um-btn--ghost:hover { transform: none; filter: none; }

/* ---------- forms ---------- */
.um-form label { display: block; font-weight: 700; font-size: 14.5px; margin: 20px 0 8px; }
.um-form label:first-child { margin-top: 0; }
.um-input {
  width: 100%; min-height: 54px; padding: 0 16px; font: inherit; font-size: 16.5px;
  border-radius: 14px; border: 1.5px solid var(--um-line);
  background: var(--um-surface-soft); color: var(--um-ink);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.um-input:focus { outline: none; border-color: var(--um-accent); box-shadow: 0 0 0 4px var(--um-accent-soft); }
.um-input[disabled] { opacity: .6; }
.um-form .um-btn { margin-top: 24px; }
.um-hint { margin: 12px 0 0; color: var(--um-muted); font-size: 14.5px; line-height: 1.55; }
.um-msg { margin: 14px 0 0; font-size: 15px; font-weight: 600; color: var(--um-ink-2); }
.um-sub { margin-top: 32px; }
.um-sub:first-child { margin-top: 0; }
.um-sub h3 { margin: 0 0 8px; font-size: 19px; }
.um-totp-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.um-totp-row p { margin: 0; font-size: 16px; font-weight: 600; }

/* ---------- footer ---------- */
.um-footer { margin-top: 60px; border-top: 1px solid var(--um-line); background: var(--um-surface-soft); }
.um-footer-grid {
  width: min(920px, calc(100% - 40px)); margin: 0 auto; padding: 40px 0 6px;
  display: grid; grid-template-columns: 1.7fr 1fr 1fr 1fr; gap: 30px;
}
.um-footer-brand p { margin: 14px 0 0; color: var(--um-ink-2); font-size: 14.5px; line-height: 1.65; max-width: 34ch; }
.um-footer-status { display: flex; align-items: center; gap: 9px; font-weight: 700; color: var(--um-ink) !important; }
.um-dot { flex: none; width: 8px; height: 8px; border-radius: 999px; background: var(--um-ok); box-shadow: 0 0 0 4px var(--um-ok-soft); }
.um-footer-contact a { color: var(--um-accent); text-decoration: none; font-weight: 600; }
.um-footer-col h4 { margin: 5px 0 13px; font-size: 12.5px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--um-muted); }
.um-footer-col a { display: block; padding: 5px 0; color: var(--um-ink-2); text-decoration: none; font-size: 15px; }
.um-footer-col a:hover { color: var(--um-accent); }
.um-footer-bottom {
  width: min(920px, calc(100% - 40px)); margin: 24px auto 0; padding: 18px 0 28px;
  border-top: 1px solid var(--um-line);
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  color: var(--um-muted); font-size: 14px;
}

/* ---------- Trader panel (2026-11-28) ---------- */
.um-kpis { margin-top: 26px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.um-kpi {
  background: var(--um-surface); border: 1px solid var(--um-line);
  border-radius: var(--um-radius); padding: 20px 22px; box-shadow: var(--um-shadow);
  display: flex; flex-direction: column; gap: 4px;
}
.um-kpi span { font-size: 12.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--um-muted); }
.um-kpi strong { font-size: 26px; font-weight: 850; letter-spacing: -.02em; }
.um-kpi small { font-size: 13.5px; color: var(--um-ink-2); }
.um-pos { color: var(--um-ok) !important; }
.um-neg { color: #C23B2A !important; }
html[data-utheme="dark"] body.user-mode .um-neg { color: #E0655A !important; }
.um-kv-list { display: flex; flex-direction: column; }
.um-kv {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  padding: 10px 0; border-bottom: 1px solid var(--um-line);
}
.um-kv:last-child { border-bottom: 0; }
.um-kv span { flex: 0 0 170px; color: var(--um-ink-2); font-size: 15px; }
.um-kv b { font-size: 15.5px; font-weight: 700; }
.um-kv .um-outlook-reason { flex: 1 1 220px; color: var(--um-ink-2); font-size: 14.5px; }
.um-outlook-text {
  white-space: pre-wrap; word-break: break-word;
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  font-size: 13.5px; line-height: 1.55; color: var(--um-ink-2);
  background: var(--um-surface-soft); border: 1px solid var(--um-line);
  border-radius: 14px; padding: 14px 16px; max-height: 480px; overflow: auto;
}
.um-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; filter: none; }
.um-table-wrap { width: 100%; overflow-x: auto; }
.um-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.um-table th, .um-table td { padding: 11px 10px; text-align: left; border-bottom: 1px solid var(--um-line); white-space: nowrap; }
.um-table th { font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--um-muted); }
.um-table tbody tr:last-child td { border-bottom: 0; }
.um-trade { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 0; border-bottom: 1px solid var(--um-line); }
.um-trade:last-child { border-bottom: 0; }
.um-trade-main { display: flex; align-items: center; gap: 10px; }
.um-trade-meta { display: flex; gap: 16px; color: var(--um-ink-2); font-size: 14.5px; }
.um-trade time { margin-left: auto; color: var(--um-muted); font-size: 13.5px; }
.um-trade p { margin: 0; color: var(--um-ink-2); font-size: 15px; }

/* ---------- small screens ---------- */
@media (max-width: 640px) {
  .um-topbar-in { width: calc(100% - 28px); padding: 11px 0; gap: 10px; }
  .um-logo { width: 32px; height: 30px; }
  .um-brand-text b { font-size: 17px; }
  .um-username { display: none; }
  .um-signout { padding: 9px 14px; font-size: 14.5px; }
  .um-tabs { width: calc(100% - 28px); margin-top: 16px; }
  .um-tab { font-size: 16px; padding: 15px 6px; border-radius: 14px; }
  .um-main { width: calc(100% - 28px); }
  .um-hero { padding-top: 20px; }
  .um-lede { font-size: 16.5px; }
  .um-card { padding: 21px; }
  .um-service-top { flex-direction: column; gap: 10px; }
  .um-service-top .um-pill { order: -1; }
  .um-identity .um-btn { width: 100%; }
  .um-service-actions .um-btn { width: 100%; }
  .um-kpis { grid-template-columns: 1fr 1fr; gap: 12px; }
  .um-kpi strong { font-size: 21px; }
  .um-kv span { flex-basis: 128px; }
  .um-trade time { margin-left: 0; }
  .um-footer-grid { width: calc(100% - 28px); grid-template-columns: 1fr 1fr; gap: 24px; padding-top: 32px; }
  .um-footer-brand { grid-column: 1 / -1; }
  .um-footer-bottom { width: calc(100% - 28px); }
}

@media (prefers-reduced-motion: reduce) {
  body.user-mode *, body.user-mode *::before, body.user-mode *::after {
    animation: none !important; transition: none !important;
  }
}
