/*
  Hentrad — trader portal, in the Doji look (the same language as the
  website, public/site): Hentrad blue and gold, soft rounded white cards
  on light grey, black pill buttons, Outfit type with the slanted chunky
  wordmark, and Doji at a few moments. Green and red are kept for what
  they mean: buy and sell, gains and losses. IBM Plex Mono for figures.
  Dark mode keeps the same language on a deep blue-black.

  Phone first (360–430px, bottom tab bar, 44px touch targets, 16px
  inputs so iPhones don't zoom). From 1024px the tab bar becomes a
  sidebar and pages spread into two columns.
*/

/* Light is the default; brand/theme.js sets data-theme="dark" when chosen. */
:root {
  color-scheme: light;
  --bg: #F0F1F4;
  --bg-2: #E8EAEF;
  --paper: #F4F5F8;          /* quiet fills: status boxes, icon tiles */
  --card: #FFFFFF;
  --card-2: #F6F7FA;         /* inputs and raised surfaces */
  --surface-raised: #FFFFFF; /* pop-ups (brand/dialog.js) */
  --ink: #14182A;
  --muted: #5A6075;
  --faint: #8D93A8;
  --line: rgba(20, 24, 42, 0.08);
  --line-strong: rgba(20, 24, 42, 0.14);
  --track: #E3E6EE;
  --brand: #2F5BFF;          /* Hentrad blue: the website's colour */
  --brand-deep: #1B3BCC;
  --gold: #FFC83D;
  --pill: #0B0D14;           /* black pill buttons */
  --pill-ink: #FFFFFF;
  --blue: #2F5BFF;
  --blue-2: #1B3BCC;
  --blue-deep: #1B3BCC;      /* blue as text */
  --blue-soft: rgba(47, 91, 255, 0.09);
  --green: #2FAE66;
  --green-deep: #1C7A47;     /* green as text */
  --green-soft: rgba(47, 174, 102, 0.12);
  --green-light: #7CE0A3;
  --red: #E5484D;
  --red-deep: #B4232A;       /* red as text */
  --red-soft: rgba(229, 72, 77, 0.09);
  --red-light: #FFA9AB;
  --amber-soft: #FFF6DE;
  --amber-line: #F3DC9C;
  --amber-ink: #7A5A0F;
  --amber-text: #6B5418;
  --text-2: #2E3448;         /* labels and secondary text */
  --lesson-ink: #262B3D;
  --tip-text: #1B3BCC;
  --info-text: #2E3A66;
  --banner-text: #145C35;
  --strong-ink: #14182A;
  --hover: rgba(20, 24, 42, 0.04);
  --tint: rgba(20, 24, 42, 0.025);
  --input-focus-bg: #FFFFFF;
  --disabled-bg: #E3E6EE;
  --card-sheen: rgba(255, 255, 255, 0);
  --card-shadow: 0 18px 40px -26px rgba(20, 24, 42, 0.28);
  --float-shadow: 0 30px 60px -30px rgba(20, 24, 42, 0.3);
  --tab-shadow: 0 1px 3px rgba(20, 24, 42, 0.14);
  --bar-bg: rgba(240, 241, 244, 0.86);
  --nav-bg: rgba(255, 255, 255, 0.94);
  --nav-ring: rgba(255, 255, 255, 0.96);
  --side-bg: rgba(255, 255, 255, 0.8);
  --glow-1: transparent;
  --glow-2: transparent;
  --navy: #14182A;
  --navy-2: #1B2034;
  --navy-3: #232A42;
  --on-navy: #FFFFFF;
  --on-navy-muted: rgba(255, 255, 255, 0.82);
  --navy-line: rgba(255, 255, 255, 0.18);
  --display: "Outfit", "Segoe UI", system-ui, sans-serif;
  --body: "Outfit", "Segoe UI", system-ui, sans-serif;
  --figures: "Outfit", "Segoe UI", system-ui, sans-serif; /* numbers: the body font, every digit the same width */
  --wordmark: "Fredoka", "Outfit", system-ui, sans-serif;
  --radius: 22px;
  --nav-h: 74px;
  --side-w: 256px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B0E17;
  --bg-2: #0E1220;
  --paper: #121726;
  --card: #151B2C;
  --card-2: #1B2236;
  --surface-raised: #1B2236;
  --ink: #EEF1F8;
  --muted: #9AA3BD;
  --faint: #5E6782;
  --line: rgba(220, 228, 255, 0.09);
  --line-strong: rgba(220, 228, 255, 0.16);
  --track: #232B42;
  --brand: #3D66FF;
  --brand-deep: #2A4FE0;
  --pill: #FFFFFF;
  --pill-ink: #0B0D14;
  --blue: #5B7FFF;
  --blue-2: #3D66FF;
  --blue-deep: #9DB0FF;
  --blue-soft: rgba(91, 127, 255, 0.16);
  --green: #3DCB7A;
  --green-deep: #6BE29D;
  --green-soft: rgba(61, 203, 122, 0.13);
  --green-light: #8AF0B4;
  --red: #F0565B;
  --red-deep: #FF9497;
  --red-soft: rgba(240, 86, 91, 0.13);
  --red-light: #FFA9AB;
  --amber-soft: rgba(255, 200, 61, 0.1);
  --amber-line: rgba(255, 200, 61, 0.3);
  --amber-ink: #FFD677;
  --amber-text: #E0D3AE;
  --text-2: #CBD2E4;
  --lesson-ink: #D9DFEE;
  --tip-text: #C9D4FF;
  --info-text: #BCC6E6;
  --banner-text: #CFF5DD;
  --strong-ink: #FFFFFF;
  --hover: rgba(255, 255, 255, 0.04);
  --tint: rgba(255, 255, 255, 0.03);
  --input-focus-bg: #1D2540;
  --disabled-bg: #20283E;
  --card-sheen: rgba(255, 255, 255, 0.02);
  --card-shadow: 0 18px 40px -28px rgba(0, 0, 0, 0.75);
  --float-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.9);
  --tab-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  --bar-bg: rgba(11, 14, 23, 0.8);
  --nav-bg: rgba(14, 18, 32, 0.92);
  --nav-ring: rgba(14, 18, 32, 0.94);
  --side-bg: rgba(14, 18, 32, 0.8);
  --glow-1: transparent;
  --glow-2: transparent;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 520px at 0% -8%, var(--glow-1), transparent 62%),
    radial-gradient(760px 480px at 105% 4%, var(--glow-2), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(47, 91, 255, 0.35); }
.hidden { display: none !important; }
.logo-on-dark { display: none !important; }
:root[data-theme="dark"] .logo-on-dark { display: block !important; }
:root[data-theme="dark"] .logo-on-light { display: none !important; }
:root[data-theme="dark"] .splash-word img { filter: brightness(0) invert(1); }
h1, h2, h3, p { margin: 0; }
a { color: var(--blue-deep); font-weight: 600; text-decoration: none; }
a:hover { color: var(--ink); }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.mono { font-family: var(--figures); font-weight: 600; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.up { color: var(--green-deep); }
.down { color: var(--red-deep); }
.flip { transform: rotate(180deg); }

/* --- Icons --- */
.icon { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; line-height: 0; }
.icon-blue { color: var(--blue-deep); }

/* --- Type --- */
.page-title { font-family: var(--display); font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.12; }
.card-title { font-family: var(--display); font-size: 18px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
.title { font-family: var(--display); font-size: 24px; font-weight: 700; letter-spacing: -0.015em; }
.label { font-size: 11.5px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }
.label-blue { color: var(--blue-deep); }
.label-red { color: var(--red-deep); }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

/* --- Buttons --- */
button { font-family: var(--body); }
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 20px; border-radius: 14px;
  border: 1px solid transparent; font-size: 15px; font-weight: 600; letter-spacing: 0.005em;
  text-decoration: none; cursor: pointer;
  transition: transform 120ms var(--ease), box-shadow 200ms var(--ease), background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.99); }
.btn:disabled { background: var(--disabled-bg) !important; border-color: transparent !important; color: var(--faint) !important; box-shadow: none !important; cursor: not-allowed; }
.btn-primary { background: linear-gradient(180deg, #4C74FF, var(--blue-2)); color: #fff; box-shadow: 0 8px 24px -10px rgba(47, 91, 255, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.18); }
.btn-primary:hover:not(:disabled) { color: #fff; box-shadow: 0 10px 30px -8px rgba(47, 91, 255, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.22); filter: brightness(1.06); }
.btn-signal { background: linear-gradient(180deg, #5EE58F, #2FC264); color: #04140A; box-shadow: 0 8px 26px -10px rgba(61, 214, 116, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.btn-signal:hover:not(:disabled) { color: #04140A; filter: brightness(1.05); box-shadow: 0 12px 32px -8px rgba(61, 214, 116, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.4); }
.btn-ghost { background: var(--tint); color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover:not(:disabled) { background: var(--hover); color: var(--ink); border-color: rgba(160, 184, 230, 0.28); }
.btn-danger { background: transparent; color: var(--red-deep); border-color: rgba(240, 86, 91, 0.35); }
.btn-block { width: 100%; }
.btn-sm { min-height: 40px; padding: 8px 14px; font-size: 13.5px; border-radius: 12px; }
.link-btn { background: none; border: 0; padding: 10px; color: var(--blue-deep); font-weight: 600; font-size: 14px; cursor: pointer; align-self: center; }
.link-btn:hover { color: var(--ink); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer;
}
.icon-btn:hover { border-color: var(--line-strong); background: var(--card-2); }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* --- Forms --- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-2); }
input {
  width: 100%; min-height: 50px; padding: 12px 15px; border: 1px solid var(--line-strong); border-radius: 14px;
  background: var(--card-2); color: var(--ink); font-family: var(--body); font-size: 16px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}
input::placeholder { color: var(--faint); }
input:hover { border-color: rgba(160, 184, 230, 0.26); }
input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(47, 91, 255, 0.18); background: var(--input-focus-bg); }
input.locked { background: var(--paper); color: var(--muted); cursor: default; border-style: dashed; }
input.locked:focus { box-shadow: none; border-color: var(--line-strong); }
.field-hint { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.field-hint.ok { color: var(--green-deep); }
.field-hint.bad { color: var(--red-deep); }
.code-input { font-family: var(--figures); font-size: 24px; letter-spacing: 0.45em; text-align: center; }
.stack-form { display: flex; flex-direction: column; gap: 14px; }
.checkbox-row { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.5; cursor: pointer; color: var(--text-2); }
.checkbox-row input { width: 22px; height: 22px; min-height: 0; margin: 0; flex-shrink: 0; accent-color: var(--blue); }
.error { color: var(--red-deep); font-size: 13.5px; min-height: 0; }
.error:empty { display: none; }
.notice { color: var(--green-deep); font-size: 13.5px; }
.notice:empty { display: none; }

/* --- Pills --- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill-neutral { background: var(--tint); color: var(--muted); border: 1px solid var(--line); }
.pill-blue { background: var(--blue-soft); color: var(--blue-deep); }
.pill-green, .pill-success { background: var(--green-soft); color: var(--green-deep); }
.pill-red, .pill-danger { background: var(--red-soft); color: var(--red-deep); }
.pill-dark-green { background: rgba(61, 214, 116, 0.16); color: var(--green-light); }

/* --- Cards --- */
.card {
  position: relative;
  background: linear-gradient(180deg, var(--card-sheen), rgba(255, 255, 255, 0) 60%), var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: var(--card-shadow);
}
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row-start { display: flex; align-items: flex-start; gap: 12px; }
.hero-card {
  position: relative; overflow: hidden;
  background:
    radial-gradient(120% 130% at 0% 0%, rgba(47, 91, 255, 0.34), transparent 52%),
    radial-gradient(110% 120% at 100% 100%, rgba(61, 214, 116, 0.20), transparent 55%),
    linear-gradient(180deg, #13244A, #0E1A33);
  color: var(--on-navy); border-radius: 24px; padding: 22px;
  border: 1px solid rgba(47, 91, 255, 0.22);
  box-shadow: 0 30px 70px -34px rgba(47, 91, 255, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  display: flex; flex-direction: column; gap: 16px;
}
.hero-card::after { /* a faint grid, like chart paper */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.35;
  background-image: linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 28px 28px; mask-image: linear-gradient(180deg, #000, transparent 85%);
}
.hero-card > * { position: relative; z-index: 1; }
.hero-card .label { color: var(--on-navy-muted); }
.hero-title { font-family: var(--display); font-size: 25px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.15; }
.on-navy-muted { color: var(--on-navy-muted); font-size: 14px; }
.focus-card { display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; border-radius: var(--radius); border: 1px solid rgba(245, 180, 60, 0.22); background: var(--amber-soft); color: var(--amber-text); font-size: 14px; }
.focus-card .icon { color: #E8A317; }
.focus-card strong { color: var(--amber-ink); }
.quiet summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted); list-style: none; display: flex; align-items: center; justify-content: space-between; }
.quiet summary::-webkit-details-marker { display: none; }
.quiet summary::after { content: "+"; font-size: 18px; color: var(--faint); }
.quiet[open] summary::after { content: "−"; }
.quiet[open] summary { margin-bottom: 4px; }
.nav-card { flex-direction: row; align-items: center; gap: 14px; text-align: left; cursor: pointer; font: inherit; color: inherit; width: 100%; transition: border-color 160ms ease, transform 160ms var(--ease); }
.nav-card:hover { border-color: rgba(47, 91, 255, 0.32); transform: translateY(-1px); }
.nav-card-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.status-box { padding: 12px 14px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); font-size: 14px; }
.status-box:empty { display: none; }
.bank-saved { display: flex; align-items: center; gap: 12px; }
.bank-logo { width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; background: #fff; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08); }
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stat { font-size: 28px; }
.result-msg { font-size: 14.5px; font-weight: 600; }
.result-msg:empty { display: none; }

/* --- Lists inside cards --- */
.list-card { gap: 6px; }
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); }
.list-row:first-child { border-top: 0; }
.list-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.list-row-main strong { font-size: 14.5px; }
.list-row-end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.list-empty { padding: 10px 0 6px; color: var(--muted); font-size: 13.5px; }
.avatar { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 12px; background: var(--paper); font-weight: 600; font-size: 13px; flex-shrink: 0; }

/* --- Progress --- */
.bar { height: 6px; border-radius: 999px; background: var(--track); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--blue-2), #5B7FFF); box-shadow: 0 0 12px rgba(47, 91, 255, 0.55); transition: width 600ms var(--ease); }
.bar.green > span { background: linear-gradient(90deg, #2FC264, var(--green-light)); box-shadow: 0 0 12px rgba(61, 214, 116, 0.5); }
.bar.thick { height: 8px; }
.ring { --p: 0; position: relative; width: 84px; height: 84px; border-radius: 50%; flex-shrink: 0;
  background: conic-gradient(var(--green) calc(var(--p) * 1%), rgba(255, 255, 255, 0.08) 0); display: grid; place-items: center; }
.ring::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: #10203F; }
.ring > span { position: relative; font-family: var(--figures); font-weight: 600; font-size: 17px; color: #fff; }
.ring small { display: block; font-size: 10.5px; text-align: center; color: var(--on-navy-muted); font-family: var(--body); font-weight: 600; }

/* --- The daily line --- */
.gauge { display: flex; flex-direction: column; gap: 10px; }
.gauge-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.gauge-today { display: flex; align-items: baseline; gap: 8px; font-size: 13px; color: var(--muted); }
.gauge-value { font-family: var(--figures); font-size: 22px; font-weight: 600; }
.gauge-line { font-size: 13px; color: var(--muted); }
.gauge-track { position: relative; height: 12px; border-radius: 999px; background: var(--track); border: 1px solid var(--line); }
.gauge-fill { position: absolute; top: 0; bottom: 0; border-radius: 999px; box-shadow: 0 0 14px currentColor; }
.gauge-zero { position: absolute; top: -4px; bottom: -4px; left: 50%; width: 2px; margin-left: -1px; background: var(--ink); opacity: 0.35; }
.gauge-dot { position: absolute; top: -6px; width: 22px; height: 22px; margin-left: -11px; border-radius: 999px; background: var(--bg); border: 3px solid var(--green); box-shadow: 0 0 16px rgba(61, 214, 116, 0.55); transition: left 600ms var(--ease); }
.gauge-scale { display: flex; justify-content: space-between; font-family: var(--figures); font-size: 11.5px; color: var(--muted); }
.gauge.dark .gauge-today, .gauge.dark .gauge-line, .gauge.dark .gauge-scale { color: var(--on-navy-muted); }
.gauge.dark .gauge-track { background: rgba(4, 10, 24, 0.55); border-color: var(--navy-line); }
.gauge.dark .gauge-zero { background: var(--on-navy); }
.gauge.dark .gauge-value.up { color: var(--green-light); }
.gauge.dark .gauge-value.down { color: var(--red-light); }

/* --- Losing-day squares --- */
.days { display: flex; gap: 6px; }
.day { width: 28px; height: 28px; border-radius: 9px; }
.day.win { background: var(--green); box-shadow: 0 0 12px rgba(61, 214, 116, 0.35); }
.day.loss { background: var(--red); box-shadow: 0 0 12px rgba(240, 86, 91, 0.35); }
.day.flat { background: var(--track); }
.day.rest { border: 1.5px dashed rgba(160, 184, 230, 0.3); }

/* ===================== Sign in / sign up ===================== */
.auth-screen { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
.auth-aside { display: none; }
.auth-main { width: 100%; max-width: 460px; margin: 0 auto; padding: 44px 20px 40px; display: flex; flex-direction: column; gap: 22px; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.auth-mark { width: 60px; height: auto; filter: drop-shadow(0 10px 30px rgba(47, 91, 255, 0.45)); }
.auth-wordmark { height: 20px; width: auto; }
.auth-card {
  background: linear-gradient(180deg, var(--card-sheen), rgba(255, 255, 255, 0) 50%), var(--card);
  border: 1px solid var(--line-strong); border-radius: 24px; padding: 22px;
  display: flex; flex-direction: column; gap: 18px;
  box-shadow: var(--float-shadow);
}
.segmented { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 4px; border-radius: 15px; background: var(--bg-2); border: 1px solid var(--line); }
.auth-tab { min-height: 44px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); font-size: 15px; font-weight: 600; cursor: pointer; transition: background-color 160ms ease, color 160ms ease; }
.auth-tab.active { background: var(--card); color: var(--ink); box-shadow: var(--tab-shadow); }
.auth-form { display: none; flex-direction: column; gap: 16px; animation: rise 280ms var(--ease); }
.auth-form.active { display: flex; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.steps span { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.steps span::before { content: ""; height: 4px; border-radius: 999px; background: var(--track); }
.steps span.done::before { background: var(--green); }
.steps span.current::before { background: var(--blue); box-shadow: 0 0 10px rgba(47, 91, 255, 0.6); }
.steps span.current { color: var(--ink); }
.fee-amount { display: flex; align-items: baseline; gap: 8px; }
/* Account size: five sizes, each with its fee and daily line */
.size-options { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 10px 0 16px; }
.size-option { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 4px; border-radius: 14px; border: 1.5px solid var(--line-strong); background: var(--card); cursor: pointer; text-align: center; transition: border-color 160ms ease, background 160ms ease; }
.size-option input { position: absolute; opacity: 0; pointer-events: none; }
.size-option:hover { border-color: rgba(47, 91, 255, 0.45); }
.size-option:has(input:checked) { border-color: var(--brand); background: var(--blue-soft); box-shadow: 0 0 0 3px rgba(47, 91, 255, 0.14); }
.size-option:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.size-balance { font-family: var(--display); font-weight: 700; font-size: 15px; }
.size-fee { font-size: 12.5px; font-weight: 600; color: var(--blue-deep); }
.size-line { font-size: 11px; color: var(--muted); }
@media (max-width: 420px) { .size-options { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* The currency to pay in: chips, like the sizes. */
.pay-currency { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 6px; }
.pay-currency:empty { display: none; }
.currency-option { position: relative; display: inline-flex; align-items: center; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: var(--card); cursor: pointer; font-size: 14px; }
.currency-option input { position: absolute; opacity: 0; pointer-events: none; }
.currency-option:has(input:checked) { border-color: var(--brand); background: var(--blue-soft); }
.currency-option:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.fee-amount .mono { font-size: 38px; letter-spacing: -0.02em; }
.note-row { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: 14px; font-size: 14px; background: var(--paper); }
.disclosure { padding: 16px; border-radius: 14px; background: var(--amber-soft); border: 1px solid var(--amber-line); color: var(--amber-text); font-size: 13.5px; line-height: 1.6; display: flex; flex-direction: column; gap: 6px; }
.disclosure strong { color: var(--amber-ink); font-size: 14px; }
.disclosure ul { margin: 0; padding-left: 18px; }
.secure-note { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.info-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; background: rgba(47, 91, 255, 0.07); border: 1px solid rgba(47, 91, 255, 0.18); color: var(--info-text); font-size: 13px; }
.info-card .icon { color: var(--blue-deep); }

/* The brand panel beside the form on larger screens. */
.auth-aside { --ink: #EEF3FC; --muted: #8E9BB8; --faint: #5D6A88; --blue-deep: #8DB5FF; --green-deep: #5EE58F; --blue-soft: rgba(47, 91, 255, 0.14); --green-soft: rgba(61, 214, 116, 0.12); color: var(--ink); }
.auth-aside-inner { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 28px; max-width: 520px; }
.auth-aside h1 { font-family: var(--display); font-size: 52px; line-height: 1.02; letter-spacing: -0.035em; font-weight: 700; }
.auth-aside h1 .grad { background: linear-gradient(90deg, #8DB5FF, #7CF0A6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-aside .lead { font-size: 17px; line-height: 1.6; color: #B9C7E4; max-width: 440px; }
.auth-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.auth-steps li { display: flex; gap: 14px; align-items: flex-start; }
.auth-steps .n { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; flex-shrink: 0; font-family: var(--figures); font-weight: 600; font-size: 13px; color: var(--blue-deep); background: var(--blue-soft); border: 1px solid rgba(47, 91, 255, 0.25); }
.auth-steps li:last-child .n { color: var(--green-deep); background: var(--green-soft); border-color: rgba(61, 214, 116, 0.25); }
.auth-steps strong { display: block; font-size: 15px; color: var(--ink); }
.auth-steps span { font-size: 13.5px; color: var(--muted); }
.auth-chart { position: absolute; left: 0; right: 0; bottom: 84px; height: 40%; pointer-events: none; opacity: 0.9; }
.auth-chart .line { fill: none; stroke: url(#auth-grad); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1600; stroke-dashoffset: 1600; animation: draw 3.2s var(--ease) 0.3s forwards; }
.auth-chart .area { fill: url(#auth-fill); opacity: 0; animation: fade 1.6s ease 1.8s forwards; }
.auth-chart .dot { fill: #7CF0A6; opacity: 0; animation: fade 0.6s ease 3.2s forwards, pulse 2.4s ease-in-out 3.8s infinite; transform-box: fill-box; transform-origin: center; }
.auth-legal { position: relative; z-index: 1; font-size: 12px; color: var(--faint); max-width: 480px; }

/* ===================== App shell ===================== */
.app { min-height: 100vh; }
.app-bar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; padding-top: calc(12px + env(safe-area-inset-top));
  background: var(--bar-bg); backdrop-filter: saturate(140%) blur(14px); -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.app-bar-brand img { height: 16px; width: auto; display: block; }
.bar-avatar { display: flex; align-items: center; gap: 10px; padding: 3px 4px 3px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--tint); color: var(--ink); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.bar-avatar:hover { border-color: var(--line-strong); }
.app-main { padding: 16px 20px calc(var(--nav-h) + 36px + env(safe-area-inset-bottom)); max-width: 680px; margin: 0 auto; }
.tab-panel { display: none; flex-direction: column; gap: 16px; }
.tab-panel.active { display: flex; animation: rise 320ms var(--ease); }
.page-head { display: flex; align-items: center; gap: 12px; }
.page-intro { display: flex; flex-direction: column; gap: 4px; }
.greet { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding-top: 4px; }
.status-banner { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; margin-bottom: 16px; border-radius: 16px; background: var(--green-soft); border: 1px solid rgba(61, 214, 116, 0.25); color: var(--banner-text); font-size: 14px; }
.status-banner .icon { color: var(--green); }
.app-footer { margin-top: 12px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.6; color: var(--faint); display: flex; flex-direction: column; gap: 6px; }
.app-footer strong { color: var(--muted); }
.risk-line { font-size: 12px; color: var(--faint); }
.risk-line a { color: var(--muted); font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }

/* The tab bar (phones) — a sidebar from 1024px. */
.nav-brand, .nav-user, .nav-label, .nav-theme { display: none; }
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: space-around; align-items: flex-end;
  padding: 8px 8px calc(10px + env(safe-area-inset-bottom));
  background: var(--nav-bg); backdrop-filter: saturate(150%) blur(18px); -webkit-backdrop-filter: saturate(150%) blur(18px);
  border-top: 1px solid var(--line);
}
.bottom-nav .tab, .trade-tab {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 60px; min-height: 48px;
  padding: 4px 6px; border: 0; background: none; color: var(--faint); font-size: 11.5px; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: color 160ms ease;
}
.bottom-nav .tab .icon svg { width: 22px; height: 22px; }
.bottom-nav .tab:hover { color: var(--muted); }
.bottom-nav .tab.active { color: var(--ink); }
.bottom-nav .tab.active .icon { color: var(--blue-deep); filter: drop-shadow(0 0 8px rgba(47, 91, 255, 0.7)); }
.trade-tab { color: var(--ink); margin-top: -26px; }
.trade-tab:hover { color: var(--ink); }
.trade-tab-btn {
  display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 19px;
  background: linear-gradient(160deg, #5EE58F, #22A55B); color: #04140A;
  box-shadow: 0 10px 28px -6px rgba(61, 214, 116, 0.65), 0 0 0 5px var(--nav-ring), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: transform 160ms var(--ease);
}
.trade-tab:hover .trade-tab-btn { transform: translateY(-2px); }
.trade-tab-btn .icon svg { width: 25px; height: 25px; }

/* ===================== Journey ===================== */
.home-grid, .home-main, .home-side { display: flex; flex-direction: column; gap: 16px; }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hero-balance { font-family: var(--figures); font-weight: 600; font-size: 36px; letter-spacing: -0.03em; color: #fff; font-variant-numeric: tabular-nums; }
.hero-learn { display: flex; align-items: center; gap: 18px; }
.hero-learn-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.hero-next { font-size: 13.5px; color: var(--on-navy-muted); }
.hero-next strong { color: #fff; font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-actions .btn { flex: 1 1 160px; }
.hero-card .btn-ghost { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.16); color: #fff; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); min-width: 0; }
.tile .label { font-size: 10.5px; }
.tile-value { font-family: var(--figures); font-weight: 600; font-size: 20px; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-sub { font-size: 12px; color: var(--muted); }
.brief-card { border-color: rgba(47, 91, 255, 0.18); }
.stage-track { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.stage-track li { display: flex; flex-direction: column; gap: 7px; font-size: 11px; font-weight: 600; color: var(--faint); }
.stage-track li::before { content: ""; height: 6px; border-radius: 999px; background: var(--track); }
.stage-track li.done { color: var(--muted); }
.stage-track li.done::before { background: var(--green); }
.stage-track li.current { color: var(--ink); }
.stage-track li.current::before { background: linear-gradient(90deg, var(--blue-2), #5B7FFF); box-shadow: 0 0 10px rgba(47, 91, 255, 0.7); }

/* ===================== Learn ===================== */
.learn-head { display: flex; flex-direction: column; gap: 14px; }
.module { padding: 18px 18px 8px; transition: border-color 160ms ease; }
.module[open] { border-color: rgba(47, 91, 255, 0.2); }
.module-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.module-title { font-family: var(--display); font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.lesson-list { margin-top: 6px; }
/* A lesson in the outline: one tap opens it in the player. */
.lesson-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 13px 4px; min-height: 56px; border: 0; border-top: 1px solid var(--line); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: 0; }
.lesson-row:hover:not(:disabled) .lesson-title { color: var(--blue-deep); }
.lesson-row:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 10px; }
.lesson-row.next { background: var(--blue-soft); border-radius: 14px; border-top-color: transparent; padding-left: 10px; padding-right: 10px; }
.lesson-row.next + .lesson-row { border-top-color: transparent; }
.lesson-tag { flex-shrink: 0; padding: 4px 10px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 600; }
.lesson-tag.quiet { background: transparent; color: var(--muted); padding: 0; font-weight: 500; }
.lesson-status { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 11px; border: 1.5px solid var(--line-strong); color: var(--muted); flex-shrink: 0; font-family: var(--figures); font-size: 12px; font-weight: 600; }
.lesson-row.done .lesson-status { background: var(--green-soft); color: var(--green-deep); border-color: rgba(61, 214, 116, 0.3); }
.lesson-row.practice .lesson-status { background: var(--blue-soft); color: var(--blue-deep); border-color: rgba(47, 91, 255, 0.3); }
.lesson-row.next .lesson-status { border-color: var(--blue); color: var(--blue-deep); box-shadow: 0 0 0 4px rgba(47, 91, 255, 0.14); }
.lesson-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lesson-title { font-size: 14.5px; font-weight: 600; transition: color 160ms ease; }
.lesson-sub { font-size: 12.5px; color: var(--muted); }
.lesson-body { padding: 4px 0 20px 44px; display: flex; flex-direction: column; gap: 14px; }
.chev { color: var(--muted); transition: transform 160ms var(--ease); }
.lesson-text-body { display: flex; flex-direction: column; gap: 12px; font-size: 15px; line-height: 1.7; color: var(--lesson-ink); max-width: 68ch; }
.lesson-text-body p { margin: 0; white-space: normal; }
.lesson-text-body .lesson-h { margin: 12px 0 0; font-family: var(--display); font-size: 12.5px; font-weight: 700; letter-spacing: 0.08em; color: var(--blue-deep); }
.lesson-text-body ul, .lesson-text-body ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 7px; }
.lesson-text-body li::marker { color: var(--blue); font-weight: 700; }
.lesson-text-body .lesson-tip { padding: 12px 14px; border-radius: 12px; background: var(--blue-soft); border-left: 3px solid var(--blue); color: var(--tip-text); font-weight: 500; }

/* The paced course: locked lessons, checkpoints, today's steps, practice tasks */
.lesson-row.locked, .lesson-row:disabled { cursor: default; }
.lesson-row.locked .lesson-title { color: var(--muted); }
.lesson-row.locked .lesson-status { border-style: dashed; }
.check-row .lesson-status { border-color: rgba(47, 91, 255, 0.3); color: var(--blue-deep); }
.day-strip { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 4px; margin: 2px 0 4px; }
.day-strip span { height: 8px; border-radius: 3px; background: var(--track); }
.day-strip span.done { background: var(--green); }
.day-strip span.today { background: var(--blue); box-shadow: 0 0 0 3px rgba(47, 91, 255, 0.18); }
.today-next { display: flex; align-items: center; gap: 14px; margin-top: 16px; padding: 14px; border-radius: 16px; background: var(--blue-soft); }
/* Today's line (brand/lines.js): one short line, quiet, under the focus card. */
.line-pop-text { margin: 4px 0 14px; font-family: var(--display); font-size: 22px; font-weight: 600; line-height: 1.3; letter-spacing: -0.02em; color: var(--ink); }
.today-next .today-dot { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--card); color: var(--blue-deep); flex-shrink: 0; }
.today-next .today-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.today-next strong { font-family: var(--display); font-size: 17px; line-height: 1.3; }
.today-go { width: 100%; margin-top: 12px; min-height: 52px; justify-content: center; text-align: center; white-space: normal; line-height: 1.3; }
.today-steps { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; }
.today-step { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.today-dot { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 11px; border: 1.5px solid var(--line-strong); color: var(--muted); flex-shrink: 0; }
.today-step.open .today-dot { border-color: var(--blue); color: var(--blue-deep); box-shadow: 0 0 0 4px rgba(47, 91, 255, 0.14); }
.today-step.done .today-dot { background: var(--green-soft); color: var(--green-deep); border-color: rgba(61, 214, 116, 0.3); }
.today-step.locked { opacity: 0.6; }
.today-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: 14.5px; }
.today-quiz { margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; scroll-margin-top: 84px; }
.today-quiz .btn { margin-top: 10px; align-self: flex-start; }
.today-note { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--tint); font-size: 14px; }
.today-note .icon, .today-note svg { flex-shrink: 0; color: var(--green-deep); margin-top: 2px; }
.review-from { font-style: italic; }
.task { padding: 14px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.task-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14.5px; }
.task.locked { opacity: 0.65; }
.task-meters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 420px) { .task-meters { grid-template-columns: minmax(0, 1fr); } }

/* ===================== Evaluate ===================== */
.step.current { border-color: rgba(47, 91, 255, 0.45); box-shadow: 0 0 0 1px rgba(47, 91, 255, 0.15), 0 24px 50px -30px rgba(47, 91, 255, 0.6); }
.step.locked { opacity: 0.6; }
.step-head { display: flex; align-items: center; gap: 12px; }
.step-badge { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 11px; background: var(--track); color: var(--muted); font-family: var(--figures); font-weight: 600; font-size: 13px; flex-shrink: 0; }
.step.current .step-badge { background: var(--blue); color: #fff; box-shadow: 0 0 14px rgba(47, 91, 255, 0.6); }
.step.done .step-badge { background: var(--green); color: #04140A; }
.conditions { display: flex; flex-direction: column; gap: 12px; }
.condition-head { display: flex; justify-content: space-between; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; }
.needs { font-size: 13.5px; font-weight: 600; }
.quiz-question { padding: 16px 0; border-top: 1px solid var(--line); }
.quiz-question-text { font-size: 15px; font-weight: 600; margin-bottom: 10px; }
.quiz-option { display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; margin-top: 8px; border: 1px solid var(--line-strong); border-radius: 14px; font-size: 14px; cursor: pointer; background: var(--card-2); transition: border-color 160ms ease, background-color 160ms ease; }
.quiz-option:hover { border-color: rgba(47, 91, 255, 0.35); }
.quiz-option input { width: 20px; height: 20px; min-height: 0; margin: 0; flex-shrink: 0; accent-color: var(--blue); }
.quiz-option:has(input:checked) { border-color: var(--blue); background: rgba(47, 91, 255, 0.12); }
.review-item { padding: 12px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.review-item .verdict { display: flex; gap: 8px; align-items: flex-start; font-weight: 600; }
.review-item.correct .verdict .icon { color: var(--green-deep); }
.review-item.incorrect .verdict .icon { color: var(--red-deep); }

/* ===================== Account ===================== */
.balance { font-family: var(--figures); font-size: 38px; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: #fff; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.facts .label { color: var(--on-navy-muted); }
.facts .mono { font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.facts-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.on-navy-muted.small { font-size: 13px; }
.locked-card { flex-direction: row; align-items: center; gap: 14px; }
.badge-tile { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 15px; background: var(--blue-soft); color: var(--blue-deep); flex-shrink: 0; border: 1px solid rgba(47, 91, 255, 0.22); }
.badge-tile.green { background: var(--green-soft); color: var(--green-deep); border-color: rgba(61, 214, 116, 0.22); }

/* ===================== Refer ===================== */
.link-box { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 14px; background: rgba(4, 10, 24, 0.5); border: 1px solid var(--navy-line); }
.link-box .mono { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 500; color: var(--on-navy); }
.link-copy { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; min-height: 38px; padding: 6px 14px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, 0.1); color: #fff; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.link-copy:hover { background: rgba(255, 255, 255, 0.16); }

/* ===================== Profile ===================== */
.profile-cols, .profile-col { display: flex; flex-direction: column; gap: 14px; }
.profile-head { display: flex; align-items: center; gap: 16px; padding: 20px; border-radius: 22px; background: linear-gradient(120deg, rgba(47, 91, 255, 0.16), rgba(61, 214, 116, 0.06)), var(--card); border: 1px solid var(--line); }
.profile-name { font-family: var(--display); font-weight: 600; font-size: 21px; letter-spacing: -0.01em; }
.profile-handle { font-family: var(--figures); font-size: 13.5px; color: var(--blue-deep); }
.profile-avatar-btn { position: relative; padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; flex-shrink: 0; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06), 0 10px 30px -8px rgba(47, 91, 255, 0.6); }
.profile-avatar-edit { position: absolute; right: -2px; bottom: -2px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--card-2); color: var(--blue-deep); box-shadow: 0 0 0 2px var(--bg); }
.avatar-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: 10px; padding: 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--line-strong); animation: rise 240ms var(--ease); }
.avatar-picker.hidden { display: none; }
.avatar-choice { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 2px; border: 2px solid transparent; border-radius: 16px; background: none; font: inherit; font-size: 11px; color: var(--muted); cursor: pointer; transition: background-color 160ms ease; }
.avatar-choice:hover { background: var(--hover); }
.avatar-choice[aria-checked="true"] { border-color: var(--blue); color: var(--ink); font-weight: 600; background: var(--blue-soft); }
.group-label { font-size: 11.5px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); margin: 8px 0 -4px 4px; }
.settings { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.setting { display: block; width: 100%; border: 0; border-top: 1px solid var(--line); background: none; padding: 0; text-align: left; font: inherit; color: inherit; }
.setting:first-child { border-top: 0; }
.setting > summary, .setting-link { display: flex; align-items: center; gap: 14px; min-height: 62px; padding: 10px 16px; cursor: pointer; list-style: none; transition: background-color 160ms ease; }
.setting > summary:hover, .setting-link:hover { background: var(--hover); }
.setting > summary::-webkit-details-marker { display: none; }
.setting > summary > .icon:first-child, .setting-link > .icon:first-child { display: flex; width: 38px; height: 38px; border-radius: 12px; background: var(--paper); border: 1px solid var(--line); color: var(--blue-deep); }
.setting-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.setting-text strong { font-size: 14.5px; }
.setting[open] > summary .chev { transform: rotate(90deg); }
.setting-body { padding: 4px 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.setting-link.danger { color: var(--red-deep); }
.setting-link.danger > .icon:first-child { background: var(--red-soft); color: var(--red-deep); border-color: rgba(240, 86, 91, 0.25); }
.setting-link:disabled { opacity: 0.6; cursor: default; }

/* --- Offline --- */
.offline-banner {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav-h) + 16px); z-index: 50; max-width: 600px; margin: 0 auto;
  display: flex; gap: 10px; align-items: center; justify-content: center;
  background: var(--card-2); border: 1px solid var(--line-strong); color: var(--ink); border-radius: 14px; padding: 12px 14px; font-size: 13px; text-align: center;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.7);
}

/* --- Motion --- */
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.6); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
  .auth-chart .line { stroke-dashoffset: 0; }
}

@media (max-width: 480px) { .lesson-body { padding-left: 0; } }

/* ===================== Tablet ===================== */
@media (min-width: 700px) {
  .page-title { font-size: 32px; }
  .app-main { padding-top: 24px; }
}

/* ===================== Desktop: sidebar + two columns ===================== */
@media (min-width: 1024px) {
  .app-bar { display: none; }
  .bottom-nav {
    top: 0; right: auto; width: var(--side-w);
    flex-direction: column; justify-content: flex-start; align-items: stretch; gap: 4px;
    padding: 26px 16px 20px;
    background: var(--side-bg); border-top: 0; border-right: 1px solid var(--line);
  }
  .nav-brand { display: block; padding: 4px 12px 26px; }
  .nav-brand { text-decoration: none; }
  .nav-label { display: block; padding: 14px 12px 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
  .bottom-nav .tab, .trade-tab {
    flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 46px; padding: 10px 12px; border-radius: 13px;
    font-size: 14.5px; color: var(--muted); margin-top: 0;
  }
  .bottom-nav .tab:hover { background: var(--hover); color: var(--ink); }
  .bottom-nav .tab.active { background: linear-gradient(90deg, rgba(47, 91, 255, 0.18), rgba(47, 91, 255, 0.04)); color: var(--ink); box-shadow: inset 2px 0 0 var(--blue); }
  .trade-tab { order: -1; margin: 0 0 14px; padding: 12px; color: var(--ink); background: linear-gradient(135deg, rgba(61, 214, 116, 0.16), rgba(61, 214, 116, 0.04)); border: 1px solid rgba(61, 214, 116, 0.25); }
  .trade-tab:hover { border-color: rgba(61, 214, 116, 0.45); }
  .trade-tab-btn { width: 34px; height: 34px; border-radius: 11px; box-shadow: 0 6px 18px -6px rgba(61, 214, 116, 0.7); }
  .trade-tab-btn .icon svg { width: 19px; height: 19px; }
  .nav-brand { order: -2; }
  .nav-theme { order: 9; display: flex; align-items: center; gap: 12px; margin-top: auto; min-height: 42px; padding: 8px 12px; border: 0; border-radius: 13px; background: none; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
  .nav-theme:hover { background: var(--hover); color: var(--ink); }
  .theme-label-light { display: none; }
  :root[data-theme="dark"] .theme-label-light { display: inline; }
  :root[data-theme="dark"] .theme-label-dark { display: none; }
  .nav-user { order: 10; margin-top: 6px !important; display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 12px; border-radius: 16px; background: var(--tint); border: 1px solid var(--line); }
  .nav-user-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
  .nav-user-text strong { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .nav-user-text span { font-size: 12px; color: var(--muted); font-family: var(--figures); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .nav-logout { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; border: 1px solid var(--line); background: none; color: var(--muted); cursor: pointer; }
  .nav-logout:hover { color: var(--red-deep); border-color: rgba(240, 86, 91, 0.35); }
  .nav-logout.hidden { display: grid !important; }

  .app-main { margin-left: var(--side-w); max-width: none; padding: 40px 48px 64px; }
  .tab-panel { max-width: 1160px; margin: 0 auto; }
  .page-title { font-size: 36px; }
  .offline-banner { bottom: 24px; left: calc(var(--side-w) + 24px); }

  .home-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); align-items: start; gap: 20px; }
  .hero-card { padding: 30px; }
  .hero-balance { font-size: 46px; }
  .ring { width: 104px; height: 104px; }
  .ring > span { font-size: 21px; }

  #tab-curriculum > *, #tab-evaluation > * { max-width: 880px; width: 100%; }
  #tab-account > div:empty { display: none; }
  #tab-account.active { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 18px; }
  #tab-account > .page-title, #tab-account > #wallet-info, #tab-account > #reinstatement-panel, #tab-account > #risk-events-card { grid-column: 1 / -1; }
  #tab-capital-circle.active { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 18px; }
  #tab-capital-circle > .page-head, #tab-capital-circle > .hero-card { grid-column: 1 / -1; }
  .profile-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 24px; }
}

@media (min-width: 960px) {
  .auth-screen { grid-template-columns: minmax(0, 1.1fr) minmax(460px, 0.9fr); }
  .auth-aside {
    position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
    padding: 56px 64px; border-right: 1px solid var(--line);
    background:
      radial-gradient(80% 70% at 0% 0%, rgba(47, 91, 255, 0.28), transparent 60%),
      radial-gradient(70% 60% at 100% 100%, rgba(61, 214, 116, 0.16), transparent 60%),
      linear-gradient(180deg, #0A1428, #070D1B);
  }
  .auth-main { align-self: center; padding: 48px 40px; }
  .auth-main .auth-brand { display: none; }
}

/* --- Light / dark switch (brand/theme.js) --- */
.bar-end { display: flex; align-items: center; gap: 8px; }
.theme-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--tint); color: var(--muted); cursor: pointer; }
.theme-btn:hover { color: var(--ink); border-color: var(--line-strong); }
.theme-icon-sun { display: none; }
:root[data-theme="dark"] .theme-icon-sun { display: inline-flex; }
:root[data-theme="dark"] .theme-icon-moon { display: none; }
.setting-row { display: flex; align-items: center; gap: 14px; min-height: 62px; padding: 10px 16px; }
.setting-row > .icon:first-child { display: flex; width: 38px; height: 38px; border-radius: 12px; background: var(--paper); border: 1px solid var(--line); color: var(--blue-deep); }
.theme-switch { grid-template-columns: repeat(2, minmax(64px, 1fr)); flex-shrink: 0; }
.theme-switch button { min-height: 36px; padding: 0 14px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.theme-switch button[aria-checked="true"] { background: var(--card); color: var(--ink); box-shadow: var(--tab-shadow); }

/* ===================== Lesson exercises (trader/exercise.js) ===================== */
.ex-panel { display: flex; flex-direction: column; gap: 14px; padding: 16px; border-radius: 18px; background: linear-gradient(180deg, var(--blue-soft), transparent 70%), var(--card); border: 1px solid rgba(47, 91, 255, 0.28); max-width: 68ch; }
.ex-panel.passed { border-color: rgba(61, 214, 116, 0.35); background: linear-gradient(180deg, var(--green-soft), transparent 70%), var(--card); }
.ex-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ex-head p { font-size: 13.5px; color: var(--muted); flex: 1; min-width: 180px; }
.ex-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.ex-panel.passed .ex-badge { background: var(--green); color: #04140A; }
.ex-panel.passed .ex-badge::after { content: "✓"; }
.ex-step { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.ex-step:first-of-type { border-top: 0; padding-top: 0; }
.ex-step-label { font-size: 11px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--blue-deep); }
.ex-step.right .ex-step-label { color: var(--green-deep); }
.ex-step.right .ex-step-label::after { content: " · right"; }
.ex-prompt { font-size: 15px; font-weight: 600; line-height: 1.5; color: var(--ink); }
.ex-options { display: flex; flex-direction: column; gap: 8px; }
.ex-option { text-align: left; min-height: 46px; padding: 11px 14px; border-radius: 13px; border: 1px solid var(--line-strong); background: var(--card-2); color: var(--ink); font: inherit; font-size: 14.5px; cursor: pointer; transition: border-color 140ms ease, background-color 140ms ease; }
.ex-option:hover { border-color: rgba(47, 91, 255, 0.45); }
.ex-option[aria-checked="true"] { border-color: var(--blue); background: var(--blue-soft); font-weight: 600; }
.ex-step.right .ex-option[aria-checked="true"] { border-color: var(--green); background: var(--green-soft); }
.ex-step.wrong .ex-option[aria-checked="true"] { border-color: var(--red); background: var(--red-soft); }
.ex-number { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; padding: 0 14px; border-radius: 13px; border: 1px solid var(--line-strong); background: var(--card-2); font-family: var(--figures); font-weight: 600; }
.ex-number input { width: 120px; min-height: 46px; padding: 0; border: 0; background: transparent; font-family: var(--figures); font-weight: 600; box-shadow: none !important; }
.ex-number:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(47, 91, 255, 0.18); }
.ex-step.right .ex-number { border-color: var(--green); }
.ex-chart { width: 100%; height: auto; display: block; border-radius: 14px; background: var(--card-2); border: 1px solid var(--line); touch-action: none; user-select: none; -webkit-user-select: none; }
.ex-chart .xg { stroke: var(--line); stroke-width: 1; }
.ex-chart .xt { fill: var(--faint); font-family: var(--figures); font-size: 8.5px; }
.ex-chart .xnow { stroke: var(--faint); stroke-width: 1; stroke-dasharray: 3 3; }
.ex-chart .xc line { stroke-width: 1.4; }
.ex-chart .xc-up rect { fill: #22B35E; } .ex-chart .xc-up line { stroke: #22B35E; }
.ex-chart .xc-down rect { fill: #E5484D; } .ex-chart .xc-down line { stroke: #E5484D; }
.ex-chart .xc-future { opacity: 0.85; animation: rise 300ms var(--ease); }
.ex-chart .xc.picked rect, .ex-chart .xc.picked line { stroke: var(--blue); stroke-width: 2.5; }
.ex-chart .xc.picked rect { filter: drop-shadow(0 0 4px rgba(47, 91, 255, 0.8)); }
.ex-chart.pickable .xhit { fill: transparent; cursor: pointer; }
.ex-chart.pickable .xhit:hover { fill: rgba(47, 91, 255, 0.08); }
.ex-chart.pickable .xhit:focus-visible { outline: none; fill: rgba(47, 91, 255, 0.14); }
.ex-chart .xentry { stroke: var(--blue); stroke-width: 1.6; }
.ex-chart .xlabel { font-size: 9.5px; font-weight: 700; fill: var(--ink); }
.ex-chart .xlabel-entry { fill: var(--blue-deep); }
.ex-chart .xline { cursor: ns-resize; }
.ex-chart .xline-hit { fill: transparent; }
.ex-chart .xline line { stroke-width: 2.2; stroke-dasharray: 7 4; }
.ex-chart .xline-sl line { stroke: #E5484D; } .ex-chart .xline-sl .xlabel { fill: #E5484D; }
.ex-chart .xline-tp line { stroke: #22B35E; } .ex-chart .xline-tp .xlabel { fill: #22B35E; }
.ex-chart .xline-level line { stroke: var(--blue); } .ex-chart .xline-level .xlabel { fill: var(--blue-deep); }
.ex-chart .xline:focus-visible { outline: none; } .ex-chart .xline:focus-visible line { stroke-width: 3.2; }
.ex-level-controls { display: flex; align-items: center; gap: 10px; }
.ex-level-price { min-width: 84px; text-align: center; font-size: 14px; }
.ex-nudge { width: 40px; height: 36px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--card-2); color: var(--ink); cursor: pointer; font-size: 12px; }
.ex-nudge:hover { border-color: var(--blue); }
.ex-hint-line { font-size: 12.5px; color: var(--faint); }
.ex-size { display: flex; flex-direction: column; gap: 10px; }
.ex-stepper { display: inline-flex; align-items: center; align-self: flex-start; gap: 4px; padding: 3px; border-radius: 13px; border: 1px solid var(--line-strong); background: var(--card-2); }
.ex-stepper button { width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font-size: 18px; cursor: pointer; }
.ex-stepper button:hover { background: var(--hover); }
.ex-vol { min-width: 64px; text-align: center; font-size: 16px; }
.ex-risk { font-size: 13.5px; color: var(--muted); }
.ex-risk strong { font-family: var(--figures); }
.ex-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ex-step.right .ex-check { display: none; }
.ex-feedback { font-size: 13.5px; line-height: 1.5; }
.ex-feedback:empty { display: none; }
.ex-step.right .ex-feedback { color: var(--green-deep); padding: 10px 12px; border-radius: 12px; background: var(--green-soft); }
.ex-step.wrong .ex-feedback { color: var(--red-deep); padding: 10px 12px; border-radius: 12px; background: var(--red-soft); }
.ex-step:not(.right):not(.wrong) .ex-feedback { color: var(--muted); padding: 10px 12px; border-radius: 12px; background: var(--hover); }

/* ===================== Career mode: grade, path, crew ===================== */
.grade-card { display: flex; flex-direction: column; gap: 12px; }
.grade-top { display: flex; align-items: center; gap: 14px; }
.grade-doji { width: 74px; height: 96px; object-fit: contain; flex-shrink: 0; }
.grade-main { flex: 1; min-width: 0; }
.grade-letter { margin: 2px 0 0; font-family: var(--display); font-size: 54px; font-weight: 800; line-height: 1; letter-spacing: -0.04em; }
.grade-rest { margin: 6px 0 0; font-family: var(--display); font-size: 26px; font-weight: 700; color: var(--muted); }
.grade-A, .g-A { color: var(--green-deep); }
.grade-B, .g-B { color: var(--blue-deep); }
.grade-C, .g-C, .grade-D, .g-D { color: #B7791F; }
.grade-F, .g-F { color: var(--red-deep); }
.streak { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 84px; padding: 10px 12px; border-radius: 16px; background: rgba(255, 200, 61, 0.18); text-align: center; }
.streak-n { font-family: var(--display); font-size: 30px; font-weight: 800; line-height: 1; color: #9A6B00; }
.streak-label { font-size: 11.5px; font-weight: 600; color: var(--muted); line-height: 1.2; margin-top: 4px; }
.grade-line { margin: 0; font-size: 15.5px; line-height: 1.45; }
.grade-why summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--blue-deep); }
.grade-why ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.grade-why li { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.grade-why li .icon, .grade-why li svg { flex-shrink: 0; margin-top: 2px; }
.grade-why li.kept svg { color: var(--green-deep); }
.grade-why li.broke svg { color: var(--red-deep); }
.week-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.wk-day { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 6px; border-radius: 12px; background: var(--tint); border: 1px solid var(--line); }
.wk-day b { font-family: var(--display); font-size: 17px; }
.wk-day small { font-size: 11px; color: var(--muted); }
.wk-day.rest b { color: var(--faint); }

.career-path { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; }
.path-step { position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 0 8px 0; min-height: 44px; }
.path-step::before { content: ""; position: absolute; left: 11px; top: -8px; bottom: 50%; width: 2px; background: var(--line-strong); }
.path-step:first-child::before { display: none; }
.path-step.done::before, .path-step.now::before { background: var(--green); }
.path-dot { position: relative; z-index: 1; width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; background: var(--card); border: 2px solid var(--line-strong); color: #fff; }
.path-step.done .path-dot { background: var(--green); border-color: var(--green); }
.path-step.now .path-dot { background: #FFC83D; border-color: #E0A21F; box-shadow: 0 0 0 5px rgba(255, 200, 61, 0.25); }
.path-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.path-text strong { font-size: 14px; }
.path-text small { font-size: 12px; color: var(--muted); }
.path-step.ahead .path-text strong { color: var(--muted); font-weight: 600; }
.path-doji { width: 52px; height: 42px; object-fit: contain; }

.crew-card { display: flex; flex-direction: column; gap: 12px; }
.crew-empty { display: flex; gap: 14px; align-items: center; }
.crew-empty-doji { width: 70px; height: 92px; object-fit: contain; flex-shrink: 0; }
.crew-form { display: flex; gap: 8px; }
.crew-form input { flex: 1; min-width: 0; }
.crew-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.crew-member { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.crew-member:first-child { border-top: 0; }
.crew-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.crew-who strong { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crew-who small { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--muted); }
.crew-status { font-weight: 700; }
.crew-status.s-trading { color: var(--blue-deep); }
.crew-status.s-tea { color: #9A6B00; }
.crew-status.s-done { color: var(--green-deep); }
.crew-grade { min-width: 44px; text-align: center; font-family: var(--display); font-weight: 800; font-size: 20px; }
.crew-grade.rest { font-size: 13px; font-weight: 600; color: var(--faint); }
.cheer-btn, .cheer-count { min-width: 58px; min-height: 36px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--card-2); color: var(--ink); font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.cheer-btn { cursor: pointer; transition: transform .15s; }
.cheer-btn:active { transform: scale(.92); }
.cheer-btn:disabled { opacity: .55; cursor: default; }
.cheer-count { border-style: dashed; color: var(--muted); }
.crew-invite { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--tint); border: 1px solid var(--line); font-size: 14px; }
.crew-invite .mono { font-size: 16px; letter-spacing: .12em; }
.live-dot { display: inline-flex; align-items: center; gap: 5px; color: var(--green-deep); }
.live-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: live-pulse 1.6s ease-in-out infinite; }
@keyframes live-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .live-dot::before { animation: none; } }


/* ===================== The Doji look: signature pieces ===================== */
body { background: var(--bg); }
::selection { background: rgba(255, 200, 61, 0.45); }
.wm { font-family: var(--wordmark); font-weight: 700; letter-spacing: -0.03em; display: inline-block; transform: skewX(-9deg); color: var(--brand); line-height: 1; }
:root[data-theme="dark"] .wm { color: #FFFFFF; }
.app-bar-brand { text-decoration: none; }
.app-bar-brand .wm { font-size: 26px; }
.card { border-radius: var(--radius); }

/* Buttons: black pills, as on the website (white in dark mode). */
.btn { border-radius: 14px; font-family: var(--display); }
.btn-primary, .btn-signal { background: var(--pill); color: var(--pill-ink); box-shadow: none; border-color: var(--pill); }
.btn-primary:hover:not(:disabled), .btn-signal:hover:not(:disabled) { background: var(--pill); color: var(--pill-ink); box-shadow: none; filter: none; transform: scale(1.02); }
.btn-ghost { background: var(--card); border-color: var(--line-strong); }

/* The home card: the website's blue hero, in a card. */
.hero-card { background: var(--brand); border: 0; box-shadow: 0 24px 50px -30px rgba(47, 91, 255, 0.9); color: #fff; border-radius: 28px; }
.hero-card::after { display: none; }
.hero-card .label { color: rgba(255, 255, 255, 0.82); }
.hero-card .btn-signal { background: #0B0D14; color: #fff; border-color: #0B0D14; }
.hero-card .btn-ghost { background: rgba(255, 255, 255, 0.14); color: #fff; border-color: rgba(255, 255, 255, 0.35); }
.hero-card .btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.22); color: #fff; }
.hero-card .pill-dark-green, .pill-dark-green { background: rgba(255, 255, 255, 0.18); color: #fff; }
.hero-next { color: rgba(255, 255, 255, 0.85); }
.hero-next strong { color: #fff; }
.ring { background: conic-gradient(var(--gold) calc(var(--p) * 1%), rgba(255, 255, 255, 0.22) 0); }
.ring::before { background: var(--brand-deep); }
.ring small { color: rgba(255, 255, 255, 0.8); }

/* Progress: blue bars, green when complete; no glow. */
.bar > span { background: var(--blue); box-shadow: none; }
.bar.green > span { background: var(--green); box-shadow: none; }

/* The centre Trade button: Hentrad blue. */
.trade-tab-btn { background: var(--brand); color: #fff; box-shadow: 0 10px 24px -8px rgba(47, 91, 255, 0.7), 0 0 0 5px var(--nav-ring); }
.bottom-nav .tab.active .icon { filter: none; }

.profile-head { background: var(--brand); color: #fff; border: 0; }
.profile-head .muted, .profile-head .small { color: rgba(255, 255, 255, 0.82); }
.profile-head .profile-handle { color: #fff; font-size: 15px; font-weight: 600; margin: 2px 0 6px; }
.info-card { background: var(--blue-soft); border-color: rgba(47, 91, 255, 0.18); }

/* Log in / register: blue, with Doji, like the home page. */
.auth-brand .wm { font-size: 40px; }
.auth-doji { width: 120px; height: 150px; object-fit: contain; }
.auth-aside { --ink: #FFFFFF; --muted: rgba(255, 255, 255, 0.82); --faint: rgba(255, 255, 255, 0.7); --blue-deep: #FFFFFF; --green-deep: #FFFFFF; --blue-soft: rgba(255, 255, 255, 0.16); --green-soft: rgba(255, 200, 61, 0.3); }
.auth-aside .wm { color: #fff; font-size: 34px; }
.auth-aside h1 { font-size: 64px; letter-spacing: -0.045em; line-height: .95; }
.auth-aside h1 .grad { background: none; color: var(--gold); -webkit-text-fill-color: var(--gold); }
.auth-aside .lead { color: rgba(255, 255, 255, 0.85); }
.auth-steps .n { color: #fff; background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.25); }
.auth-steps li:last-child .n { color: #14182A; background: var(--gold); border-color: var(--gold); }
.auth-aside-doji { width: 220px; height: 280px; object-fit: contain; align-self: center; }
@media (min-width: 960px) {
  .auth-aside { background: var(--brand); border-right: 0; border-radius: 0 40px 40px 0; }
}
.nav-brand { text-decoration: none; }
.nav-brand .wm { font-size: 28px; }

/* ---- First visit: Doji's welcome ---- */
.welcome { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(11, 13, 24, 0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: welcome-in .3s ease both; }
.welcome.closing { opacity: 0; transition: opacity .25s ease; }
@keyframes welcome-in { from { opacity: 0; } }
.welcome-card { position: relative; width: min(420px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 26px 22px 20px; border-radius: 30px; background: var(--card); color: var(--ink); box-shadow: var(--float-shadow); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; animation: welcome-pop .45s cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes welcome-pop { from { transform: translateY(16px) scale(.97); opacity: 0; } }
.welcome-skip { position: absolute; top: 14px; right: 14px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; padding: 6px 8px; }
.welcome-doji { width: 120px; height: 150px; object-fit: contain; }
.welcome-title { margin: 0; font-family: var(--display); font-size: 26px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.welcome-body { font-size: 15.5px; line-height: 1.55; color: var(--text-2); }
.welcome-body p { margin: 0; }
.welcome-road { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; text-align: left; counter-reset: road; }
.welcome-road li { display: grid; grid-template-columns: 32px minmax(0, 1fr); column-gap: 10px; counter-increment: road; }
.welcome-road li::before { content: counter(road); grid-row: span 2; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 800; }
.welcome-road b { font-size: 15.5px; color: var(--ink); }
.welcome-road span { font-size: 14px; color: var(--muted); }
.welcome-dots { display: flex; gap: 6px; margin: 6px 0 4px; }
.welcome-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--track); transition: width .25s ease, background .25s ease; }
.welcome-dots span.on { width: 22px; border-radius: 999px; background: var(--brand); }
.welcome-actions { width: 100%; display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
@media (prefers-reduced-motion: reduce) { .welcome, .welcome-card { animation: none; } }
.desk-wait { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 16px; background: var(--blue-soft); color: var(--text-2); font-size: 14.5px; line-height: 1.45; }
.desk-wait img { width: 46px; height: 60px; object-fit: contain; flex-shrink: 0; }

/* ===================== Habits: plan, break, reminders, journal ===================== */
textarea { width: 100%; min-height: 64px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--card-2); color: var(--ink); font: inherit; font-size: 16px; resize: vertical; }
textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(47, 91, 255, 0.18); background: var(--input-focus-bg); }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.plain-fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.plain-fieldset legend { padding: 0; margin-bottom: 8px; font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.check-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.check-chip { position: relative; display: inline-flex; }
.check-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check-chip span { display: inline-flex; align-items: center; min-height: 38px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--card-2); font-family: var(--figures); font-size: 13px; font-weight: 600; cursor: pointer; }
.check-chip input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.check-chip input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.setting-toggle { display: flex; align-items: center; gap: 14px; min-height: 62px; padding: 10px 16px; cursor: pointer; }
.setting-toggle .setting-text { flex: 1; }
.setting-toggle input[type=checkbox] { appearance: none; -webkit-appearance: none; width: 46px; height: 28px; min-height: 0; padding: 0; border-radius: 999px; background: var(--track); border: 0; position: relative; cursor: pointer; transition: background .2s; flex-shrink: 0; }
.setting-toggle input[type=checkbox]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.setting-toggle input[type=checkbox]:checked { background: var(--brand); }
.setting-toggle input[type=checkbox]:checked::after { transform: translateX(18px); }

.journal-card { display: flex; flex-direction: column; gap: 12px; }
.journal-insight { margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--blue-soft); font-size: 14px; line-height: 1.45; }
.journal-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.journal-row { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line); }
.journal-row:first-child { border-top: 0; }
.journal-head { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.journal-head .mono { flex-shrink: 0; }
.journal-tags { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; }
.journal-tags .tag { padding: 3px 9px; border-radius: 999px; background: var(--tint); border: 1px solid var(--line); color: var(--text-2); }
.journal-tags .tag.yes { background: var(--green-soft); border-color: transparent; color: var(--green-deep); }
.journal-tags .tag.no { background: var(--red-soft); border-color: transparent; color: var(--red-deep); }
.journal-ask { display: flex; flex-wrap: wrap; gap: 6px; }
.journal-ask button { min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--card-2); color: var(--ink); font: 600 13px var(--display); cursor: pointer; }
.journal-week { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 16px; background: var(--tint); border: 1px solid var(--line); }
.journal-week label { font-size: 13.5px; font-weight: 600; color: var(--text-2); }

/* ---------- Onboarding: five screens with Doji (showIntro in app.js) ---------- */
.intro { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--brand); animation: welcome-in .3s ease both; touch-action: pan-y; }
.intro.closing { opacity: 0; transition: opacity .25s ease; }
.intro-card { width: min(440px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 18px 22px calc(18px + env(safe-area-inset-bottom)); border-radius: 32px; background: var(--card); color: var(--ink); box-shadow: var(--float-shadow); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; animation: intro-slide .4s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes intro-slide { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.intro-top { width: 100%; display: flex; align-items: center; justify-content: space-between; min-height: 36px; }
.intro-dots { display: flex; gap: 6px; }
.intro-dots span { width: 8px; height: 8px; border-radius: 999px; background: var(--track); transition: width .3s ease, background .3s ease; }
.intro-dots .past { background: var(--blue-soft); background: rgba(47, 91, 255, .35); }
.intro-dots .on { width: 26px; background: var(--brand); }
.intro-skip { border: 0; background: none; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; padding: 6px 8px; }
.intro-stage { position: relative; width: 100%; min-height: 210px; display: grid; place-items: center; }
.intro-doji { width: 118px; height: 150px; object-fit: contain; position: relative; z-index: 2; animation: intro-bob 3s ease-in-out infinite; }
@keyframes intro-bob { 50% { transform: translateY(-6px); } }
.intro-title { margin: 0; font-family: var(--display); font-size: 27px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.intro-text { margin: 0; font-size: 15.5px; line-height: 1.55; color: var(--text-2); max-width: 34ch; }
.intro-actions { width: 100%; display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.intro-back { align-self: center; }

/* The little pictures beside Doji */
.ia { position: absolute; inset: auto 0 0; display: flex; justify-content: center; gap: 6px; }
.ia-hello { flex-wrap: wrap; bottom: 6px; }
.ia-hello span { padding: 6px 12px; border-radius: 999px; background: var(--blue-soft); color: var(--blue-deep); font-size: 13px; font-weight: 700; opacity: 0; animation: ia-pop .5s cubic-bezier(.3, 1.5, .5, 1) forwards; }
.ia-hello span:nth-child(2) { animation-delay: .25s; }
.ia-hello span:nth-child(3) { animation-delay: .5s; }
.ia-days { flex-wrap: wrap; max-width: 300px; margin: 0 auto; bottom: 0; }
.ia-days span { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; font: 700 11px var(--figures); background: var(--track); color: var(--muted); animation: ia-day .4s ease forwards; animation-delay: calc(var(--i) * .12s + .2s); }
@keyframes ia-day { to { background: var(--green); color: #fff; } }
.ia-chart { align-items: flex-end; height: 70px; bottom: 6px; gap: 8px; }
.ia-chart span { width: 14px; height: var(--h); border-radius: 4px; background: var(--green); transform: scaleY(0); transform-origin: bottom; animation: ia-grow .45s ease forwards; animation-delay: calc(var(--i) * .1s + .15s); }
.ia-chart .dn { background: var(--red); }
@keyframes ia-grow { to { transform: scaleY(1); } }
.ia-checks { list-style: none; margin: 0; padding: 0; flex-direction: column; align-items: center; gap: 6px; bottom: 0; }
.ia-checks li { padding: 6px 12px 6px 30px; position: relative; border-radius: 10px; background: var(--paper); font-size: 13.5px; font-weight: 600; opacity: 0; animation: ia-pop .45s ease forwards; animation-delay: calc(var(--i) * .3s + .2s); }
.ia-checks li::before { content: "✓"; position: absolute; left: 10px; color: var(--green-deep); font-weight: 800; }
.ia-fund { flex-direction: column; align-items: center; gap: 8px; bottom: 4px; }
.ia-fund strong { font-size: 28px; color: var(--green-deep); animation: ia-pop .5s cubic-bezier(.3, 1.5, .5, 1) both; }
.ia-split { width: 220px; height: 26px; border-radius: 999px; background: var(--track); overflow: hidden; }
.ia-split span { display: flex; align-items: center; justify-content: center; height: 100%; width: 0; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; white-space: nowrap; animation: ia-fill .9s ease .3s forwards; }
/* The label shows once the bar has filled: never cut off while it grows. */
.ia-split span { color: transparent; animation: ia-fill .9s ease .3s forwards, ia-label .2s ease 1.2s forwards; }
@keyframes ia-label { to { color: #fff; } }
@media (prefers-reduced-motion: reduce) { .ia-split span { color: #fff; } }
@keyframes ia-fill { to { width: var(--w); } }
@keyframes ia-pop { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: none; } }
.ia-hello, .ia-days, .ia-chart, .ia-checks, .ia-fund { z-index: 1; }
.intro-stage:has(.ia) .intro-doji { margin-bottom: 64px; }
@media (prefers-reduced-motion: reduce) {
  .intro-card, .intro-doji, .ia *, .ia-fund strong { animation: none !important; opacity: 1 !important; transform: none !important; }
  .ia-days span { background: var(--green); color: #fff; }
  .ia-split span { width: var(--w); }
}

/* ---------- Journey: everything at a glance ---------- */
.journal-btn { width: 100%; display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius, 20px); border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; text-align: left; cursor: pointer; box-shadow: var(--card-shadow); transition: transform 160ms ease, border-color 160ms ease; }
.journal-btn:hover { transform: translateY(-1px); border-color: rgba(47, 91, 255, 0.35); }
.journal-btn-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--pill); color: var(--pill-ink); flex-shrink: 0; }
.journal-btn-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.journal-btn-text strong { font-family: var(--display); font-size: 17px; }
.journal-btn-text span { font-size: 13.5px; color: var(--muted); }
.journal-btn-badge { padding: 4px 10px; border-radius: 999px; background: var(--gold); color: #14182A; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.journal-btn.waiting .journal-btn-icon { background: var(--gold); color: #14182A; animation: journal-nudge 2.4s ease-in-out infinite; }
@keyframes journal-nudge { 0%, 70%, 100% { transform: none; } 80% { transform: rotate(-8deg); } 90% { transform: rotate(8deg); } }
.glance { display: flex; flex-direction: column; gap: 10px; }
.grade-glance { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--radius, 20px); border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.grade-glance:hover { border-color: rgba(47, 91, 255, 0.35); }
.grade-glance img { width: 44px; height: 54px; object-fit: contain; flex-shrink: 0; }
.grade-glance-main { flex: 1; display: flex; align-items: center; gap: 12px; }
.grade-glance-main .grade-letter { font-size: 30px; line-height: 1; margin: 0; }
.grade-glance-rest { font-size: 15px; }
.grade-glance-streak { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.grade-glance-streak strong { font-family: var(--display); font-size: 22px; }
.grade-glance-streak small { font-size: 11.5px; color: var(--muted); }
button.tile { font: inherit; color: inherit; text-align: left; cursor: pointer; transition: border-color 160ms ease, transform 160ms ease; }
button.tile:hover { border-color: rgba(47, 91, 255, 0.35); transform: translateY(-1px); }
.brief-focus { display: flex; gap: 8px; align-items: flex-start; margin: 4px 0 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: 14px; }
.brief-focus .icon { color: #E0A21F; }
.page-lead { margin: -4px 0 4px; font-size: 14.5px; }
.sub-card { display: flex; flex-direction: column; gap: 12px; }
.journal-empty { align-items: center; text-align: center; gap: 8px; }
.journal-empty img { width: 90px; height: 110px; object-fit: contain; }
.grade-why ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }

/* The career: a row of circles; tap one for the detail */
.career-card .career-path { display: flex; flex-direction: row; gap: 0; overflow-x: auto; padding: 10px 2px 4px; margin: 0; scrollbar-width: none; scroll-snap-type: x proximity; }
.career-card .career-path::-webkit-scrollbar { display: none; }
.career-card .path-step { flex: 0 0 74px; flex-direction: column; align-items: center; gap: 6px; padding: 0; min-height: 0; scroll-snap-align: center; }
.career-card .path-step::before { content: ""; position: absolute; top: 17px; left: -50%; right: 50%; bottom: auto; width: auto; height: 3px; background: var(--line-strong); z-index: 0; }
.career-card .path-step:first-child::before { display: none; }
.career-card .path-step.done::before, .career-card .path-step.now::before { background: var(--green); }
.career-card .path-dot { position: relative; z-index: 1; width: 36px; height: 36px; border-radius: 999px; display: grid; place-items: center; padding: 0; border: 2px solid var(--line-strong); background: var(--card); color: var(--muted); font: 700 12px var(--figures); cursor: pointer; transition: transform 160ms ease, box-shadow 160ms ease; }
.career-card .path-step.done .path-dot { background: var(--green); border-color: var(--green); color: #fff; }
.career-card .path-step.now .path-dot { width: 40px; height: 40px; margin-top: -2px; background: #FFC83D; border-color: #E0A21F; overflow: hidden; }
.career-card .path-step.now .path-dot img { width: 34px; height: 34px; object-fit: contain; margin-top: 8px; }
.career-card .path-dot[aria-pressed="true"] { box-shadow: 0 0 0 4px rgba(47, 91, 255, 0.28); transform: scale(1.08); }
.path-label { font-size: 11.5px; font-weight: 600; color: var(--muted); text-align: center; line-height: 1.2; }
.path-step.now .path-label { color: var(--ink); }
.career-detail { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 14px; background: var(--paper); margin-top: 8px; min-height: 58px; }

/* Sheets: the detail behind a tile */
.sheet { position: fixed; inset: 0; z-index: 85; display: flex; align-items: flex-end; justify-content: center; background: rgba(11, 13, 24, 0.45); animation: welcome-in .2s ease both; }
.sheet.closing { opacity: 0; transition: opacity .2s ease; }
.sheet-card { width: min(520px, 100%); max-height: 86dvh; overflow-y: auto; padding: 10px 20px calc(24px + env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0; background: var(--card); color: var(--ink); display: flex; flex-direction: column; gap: 12px; animation: sheet-up .3s cubic-bezier(.2, .8, .2, 1) both; }
.sheet-grip { width: 40px; height: 4px; border-radius: 999px; background: var(--line-strong); align-self: center; }
.sheet-big { margin: 0; }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 720px) { .sheet { align-items: center; } .sheet-card { border-radius: 26px; } }

/* Learn: put the day into practice; the drills */
.practice-card { display: flex; gap: 14px; align-items: flex-start; margin-top: 12px; padding: 16px; border-radius: 18px; background: var(--blue-soft); border: 1px solid rgba(47, 91, 255, 0.25); }
.practice-card img { width: 64px; height: 76px; object-fit: contain; flex-shrink: 0; }
.practice-card-text { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.practice-card-text ul { margin: 0 0 4px; padding-left: 18px; font-size: 14px; color: var(--text-2); display: grid; gap: 3px; }
.drill-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.drill-chip { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--text-2); font-size: 13px; font-weight: 600; text-decoration: none; }
.drill-chip.passed { background: var(--green-soft); border-color: rgba(47, 174, 102, 0.4); color: var(--green-deep); }
.chip-group-label { width: 100%; margin: 6px 0 0; font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.share-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.glance:not(:has(.grade-glance)):has(#home-tiles.hidden) { display: none; }

/* ---------- Help & contact ---------- */
.help-search { display: flex; align-items: center; gap: 10px; padding: 0 14px; min-height: 52px; border-radius: 16px; background: var(--card); border: 1px solid var(--line-strong); }
.help-search .icon { color: var(--muted); }
.help-search input { flex: 1; border: 0; background: transparent; font: inherit; font-size: 16px; color: var(--ink); outline: none; min-width: 0; }
.help-card { display: flex; flex-direction: column; gap: 6px; }
.help-article { border-top: 1px solid var(--line); }
.help-article:first-child { border-top: 0; }
.help-article summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; font-weight: 600; cursor: pointer; list-style: none; }
.help-article summary::-webkit-details-marker { display: none; }
.help-article summary .chev { color: var(--muted); transform: rotate(90deg); transition: transform .2s ease; }
.help-article[open] summary .chev { transform: rotate(-90deg); }
.help-article p { margin: 0 0 12px; color: var(--text-2); font-size: 14.5px; line-height: 1.55; }
.help-all { align-self: flex-start; margin-top: 4px; }
.thread-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 0; border: 0; border-top: 1px solid var(--line); background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.thread-row:first-child { border-top: 0; }
.thread-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.thread-row-main .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-row-end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.thread-row.unread strong::after { content: ""; display: inline-block; width: 8px; height: 8px; margin-left: 6px; border-radius: 50%; background: var(--brand); vertical-align: middle; }
.contact-ways { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 6px; }
.contact-way { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line-strong); text-decoration: none; color: var(--ink); }
.contact-way:hover { background: var(--hover); }
.contact-way span:last-child { display: flex; flex-direction: column; min-width: 0; }
.contact-way small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue-deep); flex-shrink: 0; }
.contact-icon.wa { background: var(--green-soft); color: var(--green-deep); }
.help-complaints { text-align: center; }
.topic-chips .check-chip span { font-family: inherit; }
.check-chip input[type=radio]:checked + span { background: var(--blue-soft); border-color: var(--brand); color: var(--blue-deep); }
.help-suggest { padding: 12px 14px; border-radius: 14px; background: var(--paper); }
.unread-badge { padding: 3px 9px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; white-space: nowrap; }
.bar-avatar { position: relative; }
.bar-avatar.has-dot::after { content: ""; position: absolute; top: 2px; right: 2px; width: 11px; height: 11px; border-radius: 50%; background: var(--red); border: 2px solid var(--card); }
.pay-help { text-align: center; }
.pay-help a { color: var(--blue-deep); font-weight: 600; }

/* One conversation */
.thread-status { margin: -4px 0 0; display: flex; align-items: center; gap: 8px; }
.thread { display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 86%; padding: 10px 14px; border-radius: 18px; display: flex; flex-direction: column; gap: 4px; }
.msg p { margin: 0; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.msg small { font-size: 11px; color: var(--muted); }
.from-you { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 6px; }
.from-you small { color: rgba(255, 255, 255, .75); }
.from-us { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg-who { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--blue-deep); }
.msg-who img { width: 20px; height: 24px; object-fit: contain; }
.solved-ask { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--blue-soft); font-weight: 600; font-size: 14px; }
.solved-ask span { flex: 1 1 100%; }
.solved-note { text-align: center; }
.thread-reply { display: flex; gap: 8px; align-items: flex-end; position: sticky; bottom: calc(84px + env(safe-area-inset-bottom)); padding: 8px; border-radius: 18px; background: var(--card); border: 1px solid var(--line-strong); box-shadow: var(--card-shadow); }
.thread-reply textarea { flex: 1; min-height: 44px; max-height: 160px; resize: vertical; border: 0; background: transparent; font: inherit; font-size: 16px; color: var(--ink); outline: none; padding: 8px; }
@media (min-width: 1000px) { .thread-reply { bottom: 16px; } }

/* Chat with Doji */
.doji-chat { min-height: 120px; }
.from-doji { background: var(--card); }
.from-doji .msg-who { color: var(--green-deep); }
.from-team { border-color: rgba(47, 91, 255, 0.35); }
.team-mark { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: var(--blue-soft); color: var(--blue-deep); }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); opacity: .4; animation: typing 1s infinite; }
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 40% { opacity: 1; transform: translateY(-3px); } }
.doji-answer { margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: var(--paper); }
.doji-answer strong { display: block; margin-bottom: 4px; font-size: 14.5px; }
.doji-answer p { font-size: 14px; color: var(--text-2); }
.quick-replies { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.quick-replies:empty { display: none; }
.quick-reply { min-height: 42px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--brand); background: var(--card); color: var(--blue-deep); font: 600 14.5px var(--body); cursor: pointer; transition: transform .15s ease; }
.quick-reply:hover { transform: translateY(-1px); }
.quick-reply.primary { background: var(--brand); color: #fff; }
.solved-ask img { width: 30px; height: 36px; object-fit: contain; }
.solved-ask span { flex: 1; }
@media (prefers-reduced-motion: reduce) { .typing span { animation: none; opacity: .7; } }

/* The evaluation, like a professional exam */
.exam-bar { position: sticky; top: 72px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 10px 14px; margin-bottom: 8px; border-radius: 14px; background: var(--card); border: 1px solid var(--line-strong); box-shadow: var(--card-shadow); font-size: 14px; }
.exam-question { padding: 14px 0 !important; border-top: 1px solid var(--line) !important; }
.q-num { display: block; margin-bottom: 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.q-multi { display: inline-block; margin: 0 0 8px; padding: 3px 9px; border-radius: 999px; background: var(--amber-soft); border: 1px solid var(--amber-line); color: var(--amber-ink); font-size: 12px; font-weight: 700; }
.q-multi + * { display: block; }
.quiz-option.multi input { border-radius: 4px; }
.review-card, .result-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 16px; background: var(--paper); border: 1px solid var(--line); }
.review-card img { width: 46px; height: 56px; object-fit: contain; flex-shrink: 0; }
.review-card div, .result-card { display: flex; flex-direction: column; gap: 4px; font-size: 14.5px; line-height: 1.5; color: var(--text-2); }
.review-card strong, .result-card strong { color: var(--ink); }
.area-list { list-style: none; margin: 6px 0; padding: 0; display: grid; gap: 4px; }
.area-list li { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.area-list li.met { color: var(--green-deep); }
.area-list li.below { color: var(--red-deep); }

/* Open country by country: the waitlist preview */
.waitlist-card { display: flex; gap: 14px; align-items: flex-start; border: 1.5px solid rgba(47, 91, 255, 0.3); }
.waitlist-card img { width: 64px; height: 80px; object-fit: contain; flex-shrink: 0; }
.waitlist-card > div { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.waitlist-card p { margin: 0; font-size: 14.5px; line-height: 1.5; }
body.preview .trade-tab, body.preview #nav-fourth, body.preview #desk-card .btn-ghost[data-goto="evaluation"], body.preview #next-step { display: none !important; }
.rate-line { display: flex; gap: 6px; align-items: flex-start; }
.rate-line:empty { display: none; }
.rate-line > svg { flex: 0 0 auto; margin-top: 3px; color: var(--muted); }
.pay-rate:empty { display: none; }
.country-note { margin: 6px 0 0; font-size: 13px; line-height: 1.45; color: var(--text-2); }
.country-note.blocked { color: var(--red-deep); }

/* ===================== The course player =====================
   A lesson or quiz, full screen, one page at a time. */
body.player-open { overflow: hidden; }
.player { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: var(--bg); }
.player.hidden { display: none; }
.player-top { display: flex; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--card); }
.player-close { width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; border: 1px solid var(--line-strong); background: transparent; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.player-close:hover { background: var(--blue-soft); }
.player-where { flex: 1; min-width: 0; }
.player-kicker { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--blue-deep); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-title { margin: 1px 0 0; font-family: var(--display); font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-count { flex-shrink: 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.player-progress { height: 4px; background: var(--track); }
.player-progress span { display: block; height: 100%; width: 0; background: var(--brand); border-radius: 0 4px 4px 0; transition: width 300ms var(--ease, ease); }
.player-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 28px 20px 40px; outline: none; }
.player-page { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; animation: player-in 260ms ease; }
.player-page[hidden] { display: none; }
@keyframes player-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .player-page { animation: none; } .player-progress span { transition: none; } }
.player-page .lesson-text-body { font-size: 17px; line-height: 1.7; max-width: none; gap: 16px; }
.player-page .lesson-text-body .lesson-h { margin: 4px 0 0; font-size: 13px; }
.lesson-intro { display: flex; flex-direction: column; gap: 6px; padding-bottom: 6px; }
.lesson-intro h1 { margin: 0; font-family: var(--display); font-size: clamp(28px, 6vw, 38px); line-height: 1.08; letter-spacing: -0.03em; outline: none; }
.lesson-intro .label, .lesson-intro p { margin: 0; }
.player-h { margin: 0; font-family: var(--display); font-size: 26px; letter-spacing: -0.02em; outline: none; }
.player-task { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
.player-task p { margin: 0; }
.player-foot { display: flex; gap: 10px; justify-content: center; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); }
.player-foot .btn { min-height: 54px; font-size: 16px; }
.player-back, .player-second { flex: 0 0 auto; min-width: 104px; }
.player-next { flex: 1; max-width: 460px; }
.player-back[hidden] { display: none; }
.player-foot .btn { white-space: nowrap; }
.player-foot.stack { flex-direction: column-reverse; align-items: stretch; }
.player-foot.stack .btn { width: 100%; max-width: none; }
@media (min-width: 720px) { .player-foot.stack { flex-direction: row; } .player-foot.stack .player-second { width: auto; } }
@media (min-width: 720px) { .player-foot { padding-left: calc(50% - 320px); padding-right: calc(50% - 320px); } .player-next { max-width: none; } }

/* Quiz pages: one question, big tappable answers */
.player-question { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.player-q { padding: 0; margin-bottom: 8px; font-family: var(--display); font-size: clamp(21px, 4.6vw, 26px); font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; outline: none; }
.player-option { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 16px; border: 1.5px solid var(--line-strong); background: var(--card); font-size: 16px; line-height: 1.45; cursor: pointer; transition: border-color 160ms ease, background 160ms ease; }
.player-option:hover { border-color: rgba(47, 91, 255, 0.45); }
.player-option input { position: absolute; opacity: 0; pointer-events: none; }
.player-option-key { width: 32px; height: 32px; flex-shrink: 0; border-radius: 10px; border: 1.5px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; color: var(--muted); }
.player-option:has(input:checked) { border-color: var(--brand); background: var(--blue-soft); }
.player-option:has(input:checked) .player-option-key { background: var(--brand); border-color: var(--brand); color: #fff; }
.player-option:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }

/* The finish: a clear result and what's next */
.player-result { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding-top: 8px; }
.player-result img { width: 110px; height: 130px; object-fit: contain; }
.player-result h2 { margin: 6px 0 0; font-family: var(--display); font-size: clamp(26px, 6vw, 34px); letter-spacing: -0.03em; outline: none; }
.player-result p { margin: 0; max-width: 34em; }
.player-result.up h2 { color: var(--green-deep); }
.player-upnext { margin-top: 10px; padding: 18px 20px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.player-upnext .label { margin: 0; }
.player-upnext strong { font-family: var(--display); font-size: 19px; }
.player-upnext-note { margin: 10px 0 0; padding: 16px 18px; border-radius: 16px; background: var(--green-soft); color: var(--green-deep); font-weight: 500; display: flex; gap: 8px; align-items: flex-start; }
.player-upnext-note svg { flex-shrink: 0; margin-top: 3px; }

/* Evaluate → Your account size: move up */
.size-up { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 6px 0 10px; }
.size-up-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line-strong); background: var(--card); color: inherit; font: inherit; text-align: left; cursor: pointer; transition: border-color 160ms ease; }
.size-up-btn:hover { border-color: var(--brand); }
.size-up-btn strong { font-family: var(--display); font-size: 17px; }
.size-up-btn span { font-size: 12.5px; color: var(--muted); }
.size-up-btn .size-up-price { color: var(--blue-deep); font-weight: 600; }

/* Coming back after a withdrawal */
.comeback-card { display: flex; gap: 14px; align-items: flex-start; padding: 14px; margin: 6px 0 10px; border-radius: 16px; background: var(--blue-soft); }
.comeback-card img { width: 52px; height: 64px; flex-shrink: 0; object-fit: contain; }
.comeback-card p { margin: 0 0 6px; }
.comeback-hello img { width: 110px; height: 130px; object-fit: contain; }
.comeback-days, .comeback-notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.comeback-days li { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.comeback-notes li { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); line-height: 1.5; }
.comeback-ico { width: 32px; height: 32px; flex-shrink: 0; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--blue-soft); color: var(--blue-deep); }
.comeback-plan { display: flex; flex-direction: column; gap: 10px; }
.comeback-plan .player-option-key svg { opacity: 0; }
.comeback-plan .player-option:has(input:checked) .player-option-key svg { opacity: 1; }
.comeback-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.comeback-facts div { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.comeback-facts strong { font-family: var(--display); font-size: 19px; }

/* ===================== Journey: one thing at a time =====================
   Doji's bubble, the Today card (one button), the path bar, three numbers
   in one strip, and plain links. Same layout at every stage. */
.jy { display: flex; flex-direction: column; gap: 18px; max-width: 640px; margin: 0 auto; width: 100%; }
.jy-hello { display: flex; flex-direction: column; gap: 4px; }
.jy-hello .page-title { margin: 0; }
.jy-doji { display: flex; align-items: flex-end; gap: 10px; margin-top: 12px; }
.jy-doji img { width: 50px; height: 64px; flex-shrink: 0; object-fit: contain; }
.jy-bubble { margin: 0; padding: 12px 15px; border-radius: 18px 18px 18px 6px; background: var(--card); border: 1px solid var(--line); font-size: 15px; line-height: 1.5; }
.jy-bubble strong { font-weight: 600; }
.jy-h { margin: 0; font-family: var(--display); font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.jy-meta { font-weight: 600; white-space: nowrap; }
.jy-today { display: flex; flex-direction: column; gap: 14px; }
.jy-today-num { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.jy-today-num > span:first-child { font-family: var(--display); font-size: 34px; font-weight: 700; letter-spacing: -0.02em; }
.jy-today-num .up { color: var(--green-deep); } .jy-today-num .down { color: var(--red-deep, #B4232A); }
.jy-today .gauge-head { display: none; }
.jy-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.jy-step { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.jy-step:first-child { border-top: 0; padding-top: 2px; }
.jy-dot { width: 28px; height: 28px; flex-shrink: 0; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 700; background: var(--card); color: var(--muted); box-shadow: inset 0 0 0 2px var(--line-strong); }
.jy-step.done .jy-dot { background: var(--green); color: #fff; box-shadow: none; }
.jy-step.now .jy-dot { background: var(--ink); color: var(--card); box-shadow: none; }
.jy-step-text { display: flex; flex-direction: column; min-width: 0; }
.jy-step-name { font-size: 15px; }
.jy-step.now .jy-step-name { font-weight: 600; }
.jy-step.done .jy-step-name { color: var(--muted); text-decoration: line-through; }
.jy-step-sub { font-size: 12.5px; color: var(--muted); }
.jy-go { min-height: 54px; font-size: 16px; justify-content: center; text-align: center; white-space: normal; line-height: 1.3; }
.jy-also { align-self: center; font-size: 14px; font-weight: 600; color: var(--blue-deep); text-decoration: none; margin-top: -4px; }
.jy-also:hover { text-decoration: underline; }
.jy-done { margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--green-soft); color: var(--green-deep); font-weight: 500; display: flex; gap: 8px; align-items: flex-start; }
.jy-done svg { flex-shrink: 0; margin-top: 3px; }
.jy-path { display: flex; flex-direction: column; gap: 10px; padding: 0 4px; }
.jy-path .row { align-items: baseline; }
.jy-bar { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.jy-seg { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.jy-seg-bar { height: 8px; border-radius: 999px; background: var(--track); }
.jy-seg.done .jy-seg-bar { background: var(--green); }
.jy-seg.now .jy-seg-bar { background: linear-gradient(90deg, var(--ink) 45%, var(--track) 45%); }
.jy-seg.paused .jy-seg-bar { background: #E8A33A; }
.jy-seg-label { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jy-seg.now .jy-seg-label, .jy-seg.paused .jy-seg-label { font-weight: 700; color: var(--ink); }
.jy-next { margin: 2px 0 0; font-size: 14px; line-height: 1.45; color: var(--muted); }
.jy-next strong { color: var(--ink); font-weight: 600; }
.jy-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 12px 4px; border-radius: var(--radius, 20px); background: var(--card); border: 1px solid var(--line); }
.jy-strip.hidden { display: none; }
.jy-tile { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 6px; border: 0; background: none; color: inherit; font: inherit; text-align: center; cursor: pointer; border-left: 1px solid var(--line); }
.jy-tile:first-child { border-left: 0; }
.jy-tile:hover .jy-tile-value { color: var(--blue-deep); }
.jy-tile-value { font-family: var(--display); font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.jy-tile-value.up { color: var(--green-deep); }
.jy-tile-label { font-size: 12px; line-height: 1.3; color: var(--muted); }
.jy-links .setting:first-child { border-top: 0; }
.jy-links #career-card:empty { display: none; }
.jy-links .unread-badge:not(.hidden) { margin-left: auto; }
body.preview .jy-links [data-goto="crew"], body.preview .jy-links #career-card { display: none !important; }

/* A status on the blue account card */
.pill-on-hero { background: #FFFFFF; color: #14182A; }
/* On the Journey, the Today card says when the day's line is reached. */
body[data-tab="journey"] #status-banner { display: none; }
.jy-money { width: 100%; display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding: 14px 16px; border-radius: var(--radius, 20px); border: 1px solid rgba(47, 174, 102, 0.35); background: var(--green-soft); color: var(--green-deep); font: inherit; text-align: left; cursor: pointer; }
.jy-money > span { flex: 1; display: flex; flex-direction: column; }
.jy-money strong { font-size: 15.5px; }
.jy-money span span { font-size: 13px; opacity: .85; }

/* Withdraw: everything waiting, from $5 */
.withdraw-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; margin-bottom: 4px; border-radius: 14px; background: var(--tint); border: 1px solid var(--line); }
.withdraw-row .label { margin: 0; }
.withdraw-amt { font-size: 1.5rem; font-weight: 700; margin: 2px 0; }
.withdraw-row .muted { margin: 0; }
.withdraw-bar { height: 6px; border-radius: 99px; background: var(--line); margin-top: 8px; overflow: hidden; max-width: 220px; }
.withdraw-bar i { display: block; height: 100%; background: var(--green); border-radius: inherit; }

/* A page that couldn't load: what happened, and Try again */
.load-failed { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin: 0 0 16px; border-radius: 16px; background: var(--red-soft); color: var(--ink, inherit); border: 1px solid var(--line); }
.load-failed > svg { flex: none; color: var(--red-deep); }
.load-failed > div { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 0.92rem; }
.load-failed > div span { color: var(--muted); }
.load-failed .btn { flex: none; }

/* The practice record: in the Today card, on Evaluate, and as a tab badge */
.jy-practice { display: flex; flex-direction: column; gap: 6px; width: 100%; margin-top: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--tint); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.jy-practice .bar { margin: 2px 0; }
.jy-practice-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; }
.jy-practice-head .mono { color: var(--muted); font-size: 13px; }
.jy-practice-kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.jy-practice-kinds span { padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface); color: var(--muted); border: 1px solid var(--line); }
.jy-practice-kinds span.done { background: var(--green-soft); color: var(--green-deep); border-color: transparent; }
.jy-practice-line { font-size: 13px; color: var(--muted); line-height: 1.4; }
.jy-practice.behind { border-color: var(--red-soft); background: color-mix(in srgb, var(--red-soft) 45%, var(--surface)); }
.jy-practice.behind .jy-practice-line { color: var(--red-deep); font-weight: 600; }
.jy-practice.passed { border-color: var(--green-soft); }

.pr-checklist { list-style: none; margin: 4px 0 8px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.pr-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pr-item:last-child { border-bottom: 0; }
.pr-item > span:nth-child(2) { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.pr-item small { color: var(--muted); font-size: 12.5px; }
.pr-mark { flex: none; width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--line); color: transparent; }
.pr-item.done .pr-mark { background: var(--green-soft); border-color: transparent; color: var(--green-deep); }
.pr-item.ok .pr-mark { background: var(--blue-soft); border-color: transparent; color: var(--blue-deep); }
.pr-item.broken .pr-mark { background: var(--red-soft); border-color: transparent; color: var(--red-deep); }

.bottom-nav .tab { position: relative; }
.nav-badge { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #E5484D; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; font-family: var(--figures, inherit); }
.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; }

/* The Trade button, before there's an account to trade */
.trade-why { display: flex; gap: 14px; align-items: center; margin: 6px 0 16px; }
.trade-why img { width: 64px; height: 64px; flex: none; }
.trade-why p { margin: 0; line-height: 1.5; }

/* Progress: the step you're on in full; later and finished ones folded */
.card.step.locked:not(.open) > :not(.step-head):not(.step-more),
.card.step.done:not(.open) > :not(.step-head):not(.step-more) { display: none !important; }
.card.step.current > .step-more { display: none; }
.card.step > .step-more { align-self: flex-start; margin-top: 2px; font-size: 13.5px; }

/* Course practice tasks: in the Today card, and a "still open" note */
.jy-tasks { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(245, 184, 61, 0.55); background: color-mix(in srgb, rgba(245, 184, 61, 0.14) 60%, var(--surface)); }
.jy-tasks-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 0; font-size: 14px; }
.jy-tasks-head span { font-size: 12px; color: var(--muted); }
.jy-task { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px; background: var(--surface); color: var(--ink); text-decoration: none; border: 1px solid var(--line); }
.jy-task span { font-weight: 600; font-size: 14px; }
.jy-task small { color: var(--muted); font-size: 12.5px; }
.jy-done.jy-done-open { background: rgba(245, 184, 61, 0.16); color: var(--ink); }
.today-note.warn { background: rgba(245, 184, 61, 0.16); }
.today-note.warn .icon, .today-note.warn svg { color: #B7791F; }

/* Notes (hentradDialog.toast) sit above the tab bar, never over it. */
body .hd-toast { bottom: calc(104px + env(safe-area-inset-bottom, 0px)); }

/* ===================== Calm app (navigation concept D) =====================
   White space, one thing in focus, flat surfaces. Phones get a floating
   three-item bar: Today, Trade, and Learn while training or Money once
   funded (body.is-funded); everything personal is under Me, behind the
   avatar. The sidebar from 1024px keeps every section. */
:root:not([data-theme="dark"]) {
  --bg: #FFFFFF;
  --bg-2: #F5F7FB;
  --paper: #F2F4F9;
  --card: #F5F7FB;
  --card-2: #FFFFFF;
  --line: rgba(17, 22, 42, 0.07);
  --card-shadow: none;
  --bar-bg: rgba(255, 255, 255, 0.92);
  --nav-bg: rgba(255, 255, 255, 0.96);
}
:root:not([data-theme="dark"]) .card { border-color: transparent; }
.card { box-shadow: var(--card-shadow); border-radius: 24px; }
.page-title { letter-spacing: -0.03em; }
.app-bar { border-bottom: 0; }

/* Today: where you are, in one tappable line (it opens Your journey, or Money once funded). */
.jy-where {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; min-height: 32px;
  padding: 0; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 500; color: var(--muted); cursor: pointer;
}
.jy-where::after {
  content: ''; width: 6px; height: 6px; margin-left: 2px;
  border-right: 1.75px solid currentColor; border-bottom: 1.75px solid currentColor; transform: rotate(-45deg);
}
.jy-where:hover { color: var(--ink); }
#tab-evaluation .jy-path { margin-bottom: 4px; }

@media (max-width: 1023px) {
  .page-title { font-size: 32px; }
  /* On a phone, Today keeps the journal (the daily habit); the plan, crew
     and help live under Me. */
  #tab-journey .jy-links > .setting:not(#journal-btn) { display: none; }

  .app-main { padding-bottom: calc(108px + env(safe-area-inset-bottom)); }
  .bottom-nav {
    left: 16px; right: 16px; bottom: calc(14px + env(safe-area-inset-bottom));
    display: flex; align-items: center; justify-content: space-between; gap: 4px;
    padding: 7px; border: 0; border-radius: 28px;
    background: #11162A; backdrop-filter: none; -webkit-backdrop-filter: none;
    box-shadow: 0 18px 40px -18px rgba(17, 22, 42, 0.55);
  }
  :root[data-theme="dark"] .bottom-nav { background: #1B2236; box-shadow: 0 0 0 1px rgba(220, 228, 255, 0.1), 0 18px 40px -18px rgba(0, 0, 0, 0.8); }
  .bottom-nav .tab[data-tab="profile"] { display: none; }
  body:not(.is-funded) #nav-fourth { display: none; }
  body.is-funded #nav-learn { display: none; }
  .bottom-nav .trade-tab { order: 2; }
  #nav-learn, #nav-fourth { order: 3; }
  .bottom-nav .tab, .bottom-nav .trade-tab {
    flex: 1; flex-direction: row; justify-content: center; gap: 8px; min-width: 0; min-height: 48px; margin: 0; padding: 0 10px;
    border-radius: 21px; color: rgba(255, 255, 255, 0.7); font-size: 14px; font-weight: 700;
    transition: background 200ms var(--ease), color 200ms var(--ease);
  }
  .bottom-nav .tab:hover, .bottom-nav .trade-tab:hover { color: #FFFFFF; }
  .bottom-nav .tab .tab-label, .bottom-nav .trade-tab .tab-label { display: none; }
  .bottom-nav .tab.active { background: #FFFFFF; color: #11162A; }
  .bottom-nav .tab.active .tab-label { display: inline; }
  .bottom-nav .tab.active .icon { color: inherit; filter: none; }
  .bottom-nav .trade-tab-btn { width: auto; height: auto; background: none; box-shadow: none; color: inherit; border-radius: 0; }
  .bottom-nav .trade-tab-btn .icon svg, .bottom-nav .tab .icon svg { width: 22px; height: 22px; }
  .bottom-nav .nav-badge { top: 6px; left: auto; right: calc(50% - 22px); box-shadow: 0 0 0 2px #11162A; }
  .bottom-nav .tab.active .nav-badge { box-shadow: 0 0 0 2px #FFFFFF; }
}
/* Flat, outline-free surfaces in the light theme (the calm look). */
:root:not([data-theme="dark"]) .jy-bubble,
:root:not([data-theme="dark"]) .jy-strip,
:root:not([data-theme="dark"]) .settings { border-color: transparent; }
/* The daily line lock: green at the profit line, red at the loss line. */
.status-banner.loss { background: var(--red-soft); border-color: rgba(229, 72, 77, 0.3); color: var(--red-deep); }
.status-banner.loss .icon { color: var(--red); }
.jy-lock { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 12px 14px; border-radius: 14px; font-size: 14px; font-weight: 600; line-height: 1.45; }
.jy-lock .icon { flex: none; margin-top: 1px; }
.jy-lock.profit { background: var(--green-soft); color: var(--green-deep); }
.jy-lock.loss { background: var(--red-soft); color: var(--red-deep); }
:root[data-theme="dark"] .jy-lock.profit { color: var(--green-light); }
:root[data-theme="dark"] .jy-lock.loss, :root[data-theme="dark"] .status-banner.loss { color: var(--red-light); }
/* Today's status line: a clear, tappable pill to Your journey (or Money). */
.jy-where { padding: 7px 12px 7px 14px; border-radius: 999px; background: var(--card); color: var(--ink); font-weight: 600; font-size: 13.5px; }
.jy-where:hover { background: var(--bg-2); }
/* A free username to tap, under a taken one. */
.field-hint .username-pick { display: inline; padding: 0; min-height: 0; font: inherit; font-weight: 700; color: var(--blue-deep); text-decoration: underline; text-underline-offset: 2px; }

/* ---- Your journey: the five steps, named (app.js renderPath) ---- */
.jy-steps-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; }
.jy-step-item { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: start; gap: 12px; padding: 10px 0; }
.jy-step-item:not(:last-child)::after { content: ""; position: absolute; left: 13px; top: 40px; bottom: -6px; width: 2px; background: var(--track); }
.jy-step-item.done:not(:last-child)::after { background: var(--green); }
.jy-step-mark { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font: 700 13px var(--display); background: var(--card-2); color: var(--muted); border: 1.5px solid var(--line-strong); box-sizing: border-box; }
.jy-step-item.done .jy-step-mark { background: var(--green); border-color: transparent; color: #fff; }
.jy-step-item.now .jy-step-mark, .jy-step-item.paused .jy-step-mark { background: var(--brand); border-color: transparent; color: #fff; box-shadow: 0 0 0 4px rgba(47, 91, 255, 0.16); }
.jy-step-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.jy-step-text strong { font-family: var(--display); font-size: 15.5px; }
.jy-step-text small { font-size: 13px; line-height: 1.4; color: var(--muted); }
.jy-step-item.next .jy-step-text strong { color: var(--muted); }
.jy-step-status { font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; padding-top: 2px; }
.jy-step-item.now .jy-step-status { color: var(--blue-deep, var(--brand)); }
.jy-step-item.done .jy-step-status { color: var(--green-deep); }

/* The practice record: progress first, the rest folded away */
.pr-progress { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 16px; background: var(--card-2); margin: 4px 0 6px; }
.pr-progress-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.pr-progress-head strong { font-family: var(--display); font-size: 16px; }
.pr-progress-head span { font-size: 13px; font-weight: 600; color: var(--muted); }
.pr-progress-bar { height: 8px; border-radius: 8px; background: var(--track); overflow: hidden; }
.pr-progress-bar i { display: block; height: 100%; border-radius: 8px; background: var(--brand); }
.pr-progress-note { margin: 0; font-size: 13px; color: var(--muted); }
.pr-more { margin: 8px 0 0; }
.pr-rules { margin-top: 10px; }
.pr-rules summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--blue-deep, var(--brand)); padding: 6px 0; }
.example-line { margin: 8px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--card-2); color: var(--muted); line-height: 1.5; }
.example-line strong { color: var(--ink); }
/* The "?" beside Hentrad's own words (app.js EXPLAIN) */
.explain-q { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin-left: 2px; vertical-align: 1px; padding: 0; border-radius: 50%; border: 1px solid var(--line-strong); background: transparent; color: var(--muted); font: 700 11px var(--body); text-transform: none; letter-spacing: 0; cursor: pointer; }
.explain-q:hover { color: var(--ink); border-color: var(--muted); }

/* ---- The evaluation: a full-screen, distraction-free exam (app.js exam) ---- */
body.exam-open { overflow: hidden; }
.exam { position: fixed; inset: 0; z-index: 120; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); overflow-y: auto; }
.exam-top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(12px + env(safe-area-inset-top)) max(16px, calc((100% - 720px) / 2)) 12px; background: var(--card); border-bottom: 1px solid var(--line); }
.exam-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.exam-name strong { font: 700 15px var(--display); }
.exam-saved { font-size: 12px; color: var(--muted); }
.exam-timer { flex: none; min-width: 74px; padding: 8px 12px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line-strong); font: 700 18px var(--figures, var(--display)); font-variant-numeric: tabular-nums; text-align: center; }
.exam-timer.low { background: rgba(232, 163, 23, 0.14); border-color: rgba(232, 163, 23, 0.5); color: #8A5A00; }
.exam-timer.last { background: rgba(229, 72, 77, 0.12); border-color: rgba(229, 72, 77, 0.5); color: #B4232A; }
.exam-progress { height: 3px; background: var(--track); }
.exam-progress i { display: block; height: 100%; background: var(--brand); transition: width .2s ease; }
.exam-body { flex: 1; width: 100%; max-width: 720px; box-sizing: border-box; margin: 0 auto; padding: 24px 16px 16px; display: flex; flex-direction: column; gap: 14px; }
.exam-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 600; color: var(--muted); }
.exam-kind { margin: 0; align-self: flex-start; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: var(--card-2); color: var(--muted); }
.exam-kind.multi { background: rgba(232, 163, 23, 0.14); color: #8A5A00; }
.exam-kind.typed { background: rgba(47, 91, 255, 0.10); color: var(--blue-deep); }
.exam-q { margin: 0; font: 600 21px/1.4 var(--display); letter-spacing: -0.01em; }
.exam-options { display: flex; flex-direction: column; gap: 10px; }
.exam-option { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border-radius: 14px; background: var(--card); border: 1.5px solid var(--line-strong); cursor: pointer; transition: border-color .15s, background .15s; }
.exam-option:hover { border-color: var(--muted); }
.exam-option.on { border-color: var(--brand); background: rgba(47, 91, 255, 0.06); }
.exam-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.exam-option:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.exam-letter { flex: none; width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: var(--card-2); border: 1px solid var(--line-strong); font: 700 13px var(--display); color: var(--muted); }
.exam-option.on .exam-letter { background: var(--brand); border-color: var(--brand); color: #fff; }
.exam-options[role="group"] .exam-letter { border-radius: 6px; }
.exam-opt-text { padding-top: 3px; font-size: 15.5px; line-height: 1.45; }
.exam-typed { display: flex; align-items: center; gap: 10px; }
.exam-typed input { flex: 1; min-width: 0; min-height: 56px; padding: 0 16px; border-radius: 14px; border: 1.5px solid var(--line-strong); background: var(--card); color: var(--ink); font: 600 22px var(--figures, var(--display)); }
.exam-typed input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47, 91, 255, 0.18); }
.exam-unit { font: 600 16px var(--display); color: var(--muted); }
.exam-foot { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px max(16px, calc((100% - 720px) / 2)) calc(12px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); }
.exam-nav { display: flex; gap: 8px; margin-left: auto; }
.exam-nav .btn { min-width: 110px; }
.exam-flag { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line-strong); background: transparent; color: var(--ink); font: 600 14px var(--body); cursor: pointer; }
.exam-flag[aria-pressed="true"] { background: rgba(232, 163, 23, 0.14); border-color: rgba(232, 163, 23, 0.55); color: #8A5A00; }
.exam-review-link { flex-basis: 100%; text-align: center; }
.exam-counts { display: flex; flex-wrap: wrap; gap: 14px; font-size: 14px; color: var(--muted); }
.exam-counts .dot { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 3px; vertical-align: -1px; }
.dot.answered { background: var(--brand); } .dot.unanswered { background: transparent; border: 1.5px solid var(--line-strong); box-sizing: border-box; } .dot.flagged { background: #E8A317; }
.exam-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.exam-cell { position: relative; min-height: 46px; border-radius: 12px; border: 1.5px solid var(--line-strong); background: var(--card); color: var(--ink); font: 700 15px var(--display); cursor: pointer; }
.exam-cell.answered { background: rgba(47, 91, 255, 0.10); border-color: rgba(47, 91, 255, 0.45); color: var(--blue-deep); }
.exam-cell.flagged::after { content: ""; position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; border-radius: 50%; background: #E8A317; }
.exam-brief { width: 100%; max-width: 560px; box-sizing: border-box; margin: auto; padding: 28px 20px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.exam-brief h2 { margin: 0; font: 700 28px var(--display); letter-spacing: -0.02em; }
.exam-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.exam-facts div { display: flex; flex-direction: column; align-items: center; padding: 14px 8px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.exam-facts strong { font: 700 26px var(--display); }
.exam-facts span { font-size: 13px; color: var(--muted); }
.exam-rules { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 10px; font-size: 14.5px; line-height: 1.5; color: var(--muted); }
.exam-rules strong { color: var(--ink); }
.exam-declare { display: flex; gap: 10px; align-items: flex-start; padding: 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line-strong); font-size: 14.5px; line-height: 1.45; cursor: pointer; }
.exam-declare input { width: 20px; height: 20px; flex: none; margin-top: 1px; accent-color: var(--brand); }
.exam-brief-actions { display: flex; flex-direction: column; gap: 8px; }
.exam-brief-note { margin: 0; text-align: center; }
.exam-sending { align-items: center; text-align: center; }
.exam-sending img { width: 96px; height: 110px; }
@media (min-width: 640px) { .exam-review-link { flex-basis: auto; order: 0; } .exam-grid { grid-template-columns: repeat(10, minmax(0, 1fr)); } }
