:root{
  /* Ocean cyan. Brand = --accent only. Green / red (--profit / --loss) mean data only. */
  --ink:#06121a; --ink2:#0a1822; --card:#0c1f2b; --card2:#112736;
  --line:#173344; --line-soft:#10293a; --hover:#112a39;
  /* Borders of controls (inputs, outlined buttons) need 3:1; panel borders stay --line. */
  --field-line:#52788c;
  --text:#e6f3f8; --muted:#7fa0b0; --dim:#7293a3;
  --accent:#22b8e6; --accent-deep:#1596c2; --accent-soft:rgba(34,184,230,.16); --on-accent:#04222d;
  --on-loss:#2a0a12;
  /* Older names, now the accent: every former blue/violet brand use follows it. */
  --blue:var(--accent); --blue-deep:var(--accent-deep); --blue-soft:#5cd0f0;
  --teal:#3ddcc4; --sky:#60a5fa; --rose:#ff7a92; --amber:#f59e0b;
  --profit:#4ade80; --loss:#ff6b81;
  /* Categorical tag colours (mistakes, emotions): data, not brand. */
  --cat-1:#22b8e6; --cat-2:#f4628c; --cat-3:#f59e4b;
  --cat-4:#ebc65c; --cat-5:#35c9a6; --cat-6:#4d9bf0; --cat-7:#c9a27a; --cat-8:#8b93a8;
  --indigo:var(--accent);
  /* Mistake types: ONE map for the whole site (slot order in journal/mistake_colors.py).
     Not green or red (profit / loss) and not the brand cyan. >= 3:1 on the card. The name
     is always shown as text beside the colour. --mk-other is any tag the trader added. */
  --mk-1:#8b93a8; --mk-2:#c4b0ff; --mk-3:#f0d264; --mk-4:#c9a27a;
  --mk-5:#5a7cf0; --mk-6:#d77ad6; --mk-7:#ee8f3a; --mk-8:#e3e7ee; --mk-other:#b0b8c4;
  /* Shares of a whole (assets, loss causes): accent shades, then neutrals. Never green or red. */
  --asset-1:#22b8e6; --asset-2:#8fdff5; --asset-3:#1596c2; --asset-4:#5cd0f0; --asset-5:#0e6f91;
  --asset-6:#7fa0b0; --asset-7:#52788c; --asset-8:#3a5a6b; --asset-others:#7293a3;
  /* Direction / style badges (.badge). Dark: deep tinted fill, light text. */
  --badge-long-bg:#123524; --badge-long-line:#1f6b43; --badge-long-text:#86efac;
  --badge-short-bg:#3d1620; --badge-short-line:#7a2a3b; --badge-short-text:#fda4af;
  --badge-style-bg:#12303f; --badge-style-line:#1f4558; --badge-style-text:#c4dde8;
  --display:"Bricolage Grotesque","Segoe UI",system-ui,sans-serif;
  --sans:"Inter",system-ui,-apple-system,"Segoe UI",sans-serif;
  --radius:10px;
  --sidebar-w:236px;
  --sidebar-bg:#040d13;
  --shadow:0 30px 70px -32px rgba(0,0,0,.9);
  --header-bg:rgba(6,18,26,.86);
  color-scheme:dark;
}

html[data-theme="light"]{
  --ink:#f5f8fa; --ink2:#edf2f5; --card:#ffffff; --card2:#f3f7f9;
  --line:#d9e4ea; --line-soft:#e6eef2; --hover:#edf3f6;
  --field-line:#738996;
  --text:#0f1a22; --muted:#5a6b77; --dim:#5f707c;
  --accent:#087091; --accent-deep:#065a75; --accent-soft:rgba(8,112,145,.10); --on-accent:#ffffff;
  --on-loss:#ffffff;
  --blue-soft:#087091;
  --teal:#0e9683; --teal-text:#0a6e60; --sky:#2563eb; --rose:#d1435e; --amber:#b45309;
  --profit:#0a7842; --loss:#bd2a42;
  --cat-1:#087091; --cat-2:#d94472; --cat-3:#d97c1a;
  --cat-4:#c4930a; --cat-5:#1a9a7d; --cat-6:#2563eb; --cat-7:#8a6a4a; --cat-8:#6b7591;
  --indigo:var(--accent);
  --mk-1:#6b7591; --mk-2:#5b2fc2; --mk-3:#a67c00; --mk-4:#8a6a4a;
  --mk-5:#4a78e8; --mk-6:#b43fb3; --mk-7:#b84a00; --mk-8:#3f4756; --mk-other:#7d8a96;
  --asset-1:#087091; --asset-2:#6cc3de; --asset-3:#065a75; --asset-4:#2aa3c8; --asset-5:#04435a;
  --asset-6:#5a6b77; --asset-7:#738996; --asset-8:#9fb0ba; --asset-others:#8b9ba6;
  --badge-long-bg:#e3f6ea; --badge-long-line:#a7dcbb; --badge-long-text:#0f5c32;
  --badge-short-bg:#fde8eb; --badge-short-line:#f1b4be; --badge-short-text:#9b1c33;
  --badge-style-bg:#e4eef3; --badge-style-line:#c9dae3; --badge-style-text:#25414f;
  --sidebar-bg:#ffffff;
  --shadow:0 18px 44px -26px rgba(15,26,34,.25);
  --header-bg:rgba(245,248,250,.92);
  color-scheme:light;
}

*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;scroll-behavior:smooth}

body{
  margin:0;
  font-family:var(--sans);
  font-size:15px;line-height:1.58;
  color:var(--text);
  background:var(--ink);
}

h1,h2,h3,h4{font-family:var(--display);font-weight:600;line-height:1.12;margin:0 0 .5em;letter-spacing:-.02em}
h1{font-size:clamp(2.1rem,4.6vw,3.3rem);letter-spacing:-.015em}
h2{font-size:clamp(1.5rem,2.8vw,2.1rem)}
h3{font-size:1.12rem}
p{margin:0 0 1rem;max-width:68ch}

a{color:var(--blue);text-decoration-thickness:1px;text-underline-offset:2px}
/* The ONE focus ring, for everything interactive: 2px in the brand accent (>= 3:1 against the page and
   card backgrounds in both themes), offset so it also shows on filled buttons. !important so no
   component can switch it off by accident; components may add their own extra cue on top. */
:where(a[href],button,input,select,textarea,summary,[role="button"],[role="tab"],[tabindex]:not([tabindex="-1"])):focus-visible{
  outline:2px solid var(--accent)!important;
  outline-offset:2px;
}
main[tabindex="-1"]:focus{outline:none}
/* "Skip to main content": the first thing a keyboard user tabs to; invisible until focused. */
.skip-link{position:absolute;left:.75rem;top:-4rem;z-index:2000;padding:.6rem 1rem;border-radius:.5rem;
  background:var(--accent);color:var(--on-accent);font-weight:700;text-decoration:none;transition:top .1s}
.skip-link:focus{top:.75rem}
.req-mark{font-weight:500;font-size:.78em;color:var(--muted);white-space:nowrap}

.num,td.num,.stat-value,.money{
  font-variant-numeric:tabular-nums;
  font-feature-settings:"tnum" 1;
}

/* Sign colours. The html prefix lifts them above single-class colours (.rpt-tile-value, .st-sub ...) that load later. */
html .profit{color:var(--profit)}
html .loss{color:var(--loss)}
.muted{color:var(--muted)}

.wrap{width:min(1120px,100% - 3rem);margin-inline:auto}

.btn{
  display:inline-flex;align-items:center;gap:.4rem;
  padding:.6rem 1.15rem;
  border:1px solid transparent;
  border-radius:var(--radius);
  font:inherit;font-weight:500;white-space:nowrap;
  cursor:pointer;text-decoration:none;
  transition:background-color .13s ease,border-color .13s ease,transform .13s ease;
}
.btn svg{width:1em;height:1em;stroke:currentColor;stroke-width:1.8;fill:none;flex-shrink:0}
.btn-primary{
  background:linear-gradient(135deg,var(--accent) 0%,var(--accent-deep) 100%);
  color:var(--on-accent);
  box-shadow:0 6px 22px -8px color-mix(in srgb,var(--blue-deep) 90%,transparent);
}
.btn-primary:hover{transform:translateY(-1px);box-shadow:0 10px 30px -8px var(--blue-deep)}
.btn-outline{border-color:var(--field-line);background:color-mix(in srgb,var(--text) 3%,transparent);color:var(--text)}
.btn-outline svg{color:var(--accent)}
.btn-outline:hover{border-color:var(--blue);background:color-mix(in srgb,var(--blue) 8%,transparent)}
.btn-sm{padding:.35rem .75rem;font-size:.85rem}
.btn-danger{background:var(--loss);color:var(--on-loss);font-weight:600}

.site-header{
  border-bottom:1px solid var(--line-soft);
  background:var(--header-bg);
  backdrop-filter:blur(12px);
  position:sticky;top:0;z-index:20;
}
.site-header .wrap{
  display:flex;align-items:center;justify-content:space-between;
  min-height:68px;gap:1rem;
}
.brand{
  font-family:var(--display);font-size:1.3rem;font-weight:600;
  color:var(--text);text-decoration:none;
}
.brand-lockup{display:flex;align-items:center;gap:.625rem}
.brand-lockup svg{width:34px;height:34px;flex-shrink:0}
.brand-text{display:flex;flex-direction:column;line-height:1}
.brand-name{font-family:var(--display);font-size:.88rem;font-weight:700;letter-spacing:.06em;color:var(--text)}
.brand-intra{color:var(--blue)}
.brand-sub{font-size:.58rem;font-weight:500;letter-spacing:.14em;text-transform:uppercase;color:var(--muted);margin-top:.2rem}
.site-nav{display:flex;align-items:center;gap:1.6rem}
.site-nav a{color:var(--muted);text-decoration:none;font-size:.92rem}
.site-nav a:hover{color:var(--text)}
/* Underline and weight, not just colour, mark the current page. */
.site-nav a[aria-current="page"],
.site-nav a.nav-scroll-active{
  color:var(--text);font-weight:600;
  text-decoration:underline;text-decoration-color:var(--blue);
  text-decoration-thickness:2px;text-underline-offset:6px;
}
.site-nav a.btn-primary,.site-nav a.btn-primary:hover{color:var(--on-accent)}

.hero{padding:5rem 0 4rem}
.hero-grid{display:grid;grid-template-columns:0.88fr 1.12fr;gap:3.5rem;align-items:center}
.hero p.lede{font-size:1.12rem;color:var(--muted);max-width:46ch}
.hero-actions{display:flex;gap:.75rem;margin-top:1.8rem;flex-wrap:wrap}
/* Hero pill */
.hero-pill{
  display:inline-block;font-size:.75rem;font-weight:600;letter-spacing:.1em;
  text-transform:uppercase;color:var(--blue);
  background:color-mix(in srgb,var(--blue) 12%,transparent);
  border:1px solid color-mix(in srgb,var(--blue) 28%,transparent);
  border-radius:999px;padding:.25rem .85rem;margin-bottom:1.1rem;
}
/* Hero headline */
.hero-headline{font-size:clamp(2rem,4.5vw,3rem);line-height:1.18;letter-spacing:-.03em;margin:0 0 .9rem}
.hero-accent{font-style:normal;color:var(--blue)}
/* Hero trust ticks */
.hero-trust{
  list-style:none;padding:0;margin:1.5rem 0 0;
  display:flex;flex-wrap:wrap;gap:.4rem 1.4rem;
  font-size:.83rem;color:var(--muted);
}
.hero-trust li::before{content:"✓ ";color:var(--accent)}
/* Hero app mock */
.mock-scene{position:relative}
.mock-browser{
  position:relative;
  background:var(--ink2);
  border:1px solid var(--line);
  border-radius:14px;overflow:hidden;
  box-shadow:0 0 0 1px var(--line),0 0 48px color-mix(in srgb,var(--blue) 22%,transparent),0 32px 64px -8px rgba(0,0,0,.52);
  font-size:13px;line-height:1.35;
  user-select:none;pointer-events:none;
  /* A slight tilt, with the hints that keep its text sharp. */
  transform:rotateY(-2.5deg);
  will-change:transform;backface-visibility:hidden;
}
.mock-caption{
  position:absolute;
  bottom:-5rem;right:.5rem;
  margin:0;max-width:none;
  font-family:'Caveat',cursive;
  font-size:1.1rem;line-height:1.45;
  color:var(--accent);
  text-align:right;
  pointer-events:none;user-select:none;
}
.mock-caption-arrow{
  display:block;
  width:36px;height:40px;
  margin-left:auto;margin-bottom:.2rem;
}
.mock-sample-badge{
  position:absolute;top:.55rem;right:.75rem;z-index:2;
  font-size:11px;letter-spacing:.04em;color:var(--muted);
  background:color-mix(in srgb,var(--blue) 10%,transparent);
  border:1px solid color-mix(in srgb,var(--blue) 22%,transparent);
  border-radius:999px;padding:.18rem .6rem;
}
.mock-chrome{
  display:flex;align-items:center;gap:.4rem;
  padding:.55rem .85rem;border-bottom:1px solid var(--line-soft);
  background:var(--card);
}
.mock-dot{width:.8em;height:.8em;border-radius:50%;flex-shrink:0;background:var(--line)}
.mock-url{
  margin-left:.3rem;font-size:11px;color:var(--dim);
  background:var(--ink2);border:1px solid var(--line-soft);
  border-radius:999px;padding:.18rem .65rem;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:15em;
}
.mock-app{display:flex}  /* height comes from the content, so no empty band */
.mock-sidebar{
  width:11.5em;flex-shrink:0;
  background:var(--sidebar-bg);
  border-right:1px solid var(--line-soft);
  display:flex;flex-direction:column;overflow:hidden;
}
.mock-brand{
  display:flex;align-items:center;gap:.4rem;
  padding:.65rem .75rem .6rem;
  font-family:var(--display);font-size:12px;font-weight:700;letter-spacing:.05em;color:var(--text);
  border-bottom:1px solid var(--line-soft);flex-shrink:0;
}
.mock-nav{display:flex;flex-direction:column;overflow:hidden}
.mock-nav-a{
  padding:.28rem .8rem;font-size:12px;color:var(--muted);
  border-left:2px solid transparent;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex-shrink:0;
}
.mock-nav-a.mock-active{
  color:var(--text);
  border-left-color:var(--blue);
  background:color-mix(in srgb,var(--blue) 8%,transparent);
}
.mock-group{
  padding:.48rem .8rem .15rem;
  font-size:11px;font-weight:600;letter-spacing:.1em;
  text-transform:uppercase;color:var(--dim);flex-shrink:0;
}
.mock-main{flex:1;display:flex;flex-direction:column;min-width:0;overflow:hidden}
.mock-topbar{
  display:flex;align-items:center;justify-content:space-between;
  padding:.55rem .8rem;border-bottom:1px solid var(--line-soft);
  background:var(--card);flex-shrink:0;
}
.mock-topbar-title{font-family:var(--display);font-size:15px;font-weight:700;color:var(--text)}
.mock-chip{
  font-size:11px;color:var(--muted);
  background:var(--ink2);border:1px solid var(--line-soft);
  border-radius:999px;padding:.18rem .55rem;
}
.mock-body{flex:1;display:flex;flex-direction:column;padding:.6rem .7rem;gap:.55rem;overflow:hidden}
.mock-tiles{display:grid;grid-template-columns:repeat(4,1fr);gap:.4rem;flex-shrink:0}
.mock-tile{
  background:var(--card);border:1px solid var(--line);
  border-radius:7px;padding:.45rem .5rem;
}
.mock-tile-label{
  font-size:11px;font-weight:600;text-transform:uppercase;
  letter-spacing:.07em;color:var(--muted);margin-bottom:.25rem;
}
.mock-tile-val{font-family:var(--display);font-size:16px;font-weight:700;color:var(--text)}
.mock-charts{display:flex;gap:.55rem;flex:none;align-items:flex-start}
.mock-equity{flex:1;display:flex;flex-direction:column;min-width:0}
.mock-chart-hd{
  font-size:11px;font-weight:600;text-transform:uppercase;
  letter-spacing:.07em;color:var(--muted);margin-bottom:.3rem;flex-shrink:0;
}
.mock-eq-svg{width:100%;height:8em;display:block}
.mock-eq-fill{fill:url(#mock-eq-grad)}
.mock-eq-line{
  fill:none;stroke:var(--accent);stroke-width:2;
  stroke-linecap:round;stroke-linejoin:round;
  vector-effect:non-scaling-stroke;
}
.mock-outcome{width:8.6em;flex-shrink:0;display:flex;flex-direction:column;align-items:center}
.mock-donut-svg{width:7.2em;height:6.4em;display:block}
.mock-donut-pct{
  font-family:var(--display);font-size:16px;font-weight:700;
  fill:var(--text);dominant-baseline:middle;
}
.mock-legend{display:flex;flex-direction:column;gap:.3rem;font-size:11px;color:var(--muted);width:100%;margin-top:.25rem}
.mock-legend-row{display:flex;align-items:center;gap:.35rem}
.mock-ldot{width:.5em;height:.5em;border-radius:50%;display:inline-block;flex-shrink:0}
.mock-trades{flex:none}
.mock-trade-table{width:100%;border-collapse:collapse;font-size:11px}
.mock-trade-table th,.mock-trade-table td{padding:.3rem .25rem;border-bottom:1px solid var(--line-soft);text-align:left;white-space:nowrap}
.mock-trade-table th{font-size:11px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--dim)}
.mock-trade-table td{color:var(--text)}
.mock-trade-table .num{text-align:right}
.mock-trade-table tr:last-child td{border-bottom:0}
.mock-trade-table .profit{color:var(--profit)}
.mock-trade-table .loss{color:var(--loss)}
/* Scale down on mid-width screens; hide on phone */
@media (max-width:1080px){
  .mock-browser{transform:none}
  .feat-strip{grid-template-columns:repeat(3,1fr)}
}
@media (max-width:480px){.mock-browser{display:none}.mock-caption{display:none}.feat-strip{grid-template-columns:1fr}.hiw-steps{grid-template-columns:1fr}.pricing-grid{grid-template-columns:1fr}.pricing-card--featured{order:-1}}
/* Feature strip */
.feat-strip{
  display:grid;grid-template-columns:repeat(6,1fr);
  gap:1px;background:var(--line);
  border:1px solid var(--line);border-radius:14px;overflow:hidden;
  margin-top:2.4rem;
}
.feat-tile{
  background:var(--ink2);
  padding:1.25rem 1.2rem;position:relative;
}
.feat-tile h3{font-size:.9rem;font-weight:700;margin:.65rem 0 .25rem}
.feat-tile p{color:var(--muted);font-size:.8rem;margin:0;line-height:1.55;min-height:2.48rem}
.feat-icon{
  display:inline-grid;place-items:center;
  width:2rem;height:2rem;border-radius:8px;
  background:color-mix(in srgb,var(--accent) 12%,transparent);
  color:var(--accent);
}
.feat-tile--soon .feat-icon,
.feat-tile--soon h3,
.feat-tile--soon p{opacity:.4}
.feat-tile--soon p,.feat-tile--soon h3{opacity:1;color:var(--muted)}
.feat-cs{
  position:absolute;top:.75rem;right:.75rem;
  font-size:.65rem;font-weight:600;letter-spacing:.04em;
  color:var(--dim);
  background:color-mix(in srgb,var(--text) 6%,transparent);
  border:1px solid var(--line);border-radius:999px;
  padding:.12rem .48rem;
}

.band{border-top:1px solid var(--line-soft);padding:4rem 0}
#features,#how-it-works,#pricing,#faq{scroll-margin-top:80px}
.band.tinted{background:var(--ink2)}
.inner{max-width:800px;margin-inline:auto}
.feature h3{margin-bottom:.3rem}
.feature p{color:var(--muted);font-size:.94rem;margin:0}
.plan{
  border:1px solid var(--line);border-radius:14px;
  padding:1.8rem;background:var(--card);
}
.plan.highlight{
  border-color:color-mix(in srgb,var(--blue) 55%,transparent);
  background:linear-gradient(165deg,color-mix(in srgb,var(--blue) 20%,var(--card)) 0%,var(--card) 62%);
  box-shadow:var(--shadow);
}
.plan .price{font-family:var(--display);font-size:2.7rem;line-height:1}
.plan ul{list-style:none;padding:0;margin:1.25rem 0 1.5rem}
.plan li{padding:.35rem 0 .35rem 1.4rem;position:relative;font-size:.93rem;color:var(--muted)}
.plan li::before{content:"\2713";position:absolute;left:0;color:var(--accent);font-size:.85rem}

/* Landing page: eyebrow labels, How it works, comparison, FAQ accordion,
   footer columns. Colours come only from the theme tokens above. */
.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;
}
.eyebrow{font-size:.78rem;font-weight:600;letter-spacing:.12em;color:var(--blue-soft);margin:0 0 .5rem}

/* How it works */
.hiw-header{position:relative;text-align:center;margin-bottom:2.4rem}
.hiw-pill{
  display:block;width:fit-content;margin:0 auto .6rem;
  font-size:.68rem;font-weight:700;letter-spacing:.1em;
  color:var(--accent);
  background:color-mix(in srgb,var(--accent) 10%,transparent);
  border:1px solid color-mix(in srgb,var(--accent) 28%,transparent);
  border-radius:999px;padding:.25rem .9rem .25rem .75rem;
}
.hiw-header h2{margin:0}
.hiw-aside{
  position:absolute;right:0;top:0;
  text-align:right;margin:0;
  font-family:'Caveat',cursive;font-size:1.1rem;line-height:1.4;
  color:var(--accent);
  pointer-events:none;user-select:none;
}
.hiw-aside-arrow{display:block;width:36px;height:44px;margin-left:auto;margin-top:.3rem}
.hiw-steps{
  display:grid;
  grid-template-columns:1fr auto 1fr auto 1fr auto 1fr;
  align-items:start;gap:0 1rem;
}
.hiw-step{display:flex;flex-direction:column}
.hiw-step-lead{display:flex;align-items:center;gap:.6rem;margin-bottom:.65rem}
.hiw-icon{
  display:inline-grid;place-items:center;
  width:2.2rem;height:2.2rem;border-radius:999px;
  background:color-mix(in srgb,var(--accent) 12%,transparent);
  color:var(--accent);flex-shrink:0;
}
.hiw-num{
  font-family:var(--display);font-size:1.05rem;font-weight:700;
  color:var(--accent);line-height:1;
}
.hiw-step h3{font-size:.95rem;font-weight:700;margin:0 0 .3rem}
.hiw-step p{color:var(--muted);font-size:.85rem;margin:0;line-height:1.55}
.hiw-connector{display:flex;align-items:center;padding-top:.5rem;color:var(--dim)}

/* Pricing */
.pricing-sub{color:var(--muted);font-size:1.05rem;margin:.4rem auto 2.4rem;max-width:52ch;text-align:center}
.inner h2,.page-block h2{text-align:center}
/* Pricing, FAQ and comparison sections share the page container (.wrap), so their
   edges line up with the feature tiles. */
.pricing-grid{
  display:grid;grid-template-columns:1fr 1fr;gap:1px;   /* the feature tiles' gap */
  align-items:stretch;
}
.pricing-card{
  background:var(--card);border:1px solid var(--line);border-radius:16px;
  padding:2rem;position:relative;
  display:flex;flex-direction:column;
}
.pricing-card--featured{
  border-color:var(--accent);
  box-shadow:0 0 0 1px var(--accent),0 0 40px color-mix(in srgb,var(--accent) 10%,transparent);
}
.pricing-badge{
  position:absolute;top:-1px;right:1.5rem;
  font-size:.68rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;
  background:var(--accent);color:var(--on-accent);
  border-radius:0 0 8px 8px;padding:.22rem .65rem;
}
.pricing-plan{font-size:.75rem;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);margin:0 0 .75rem}
.pricing-amount{display:flex;align-items:baseline;gap:.4rem;flex-wrap:wrap;margin-bottom:.3rem}
.pricing-price{font-family:var(--display);font-size:2.4rem;font-weight:700;line-height:1;letter-spacing:-.02em;color:var(--text)}
.pricing-unit{color:var(--muted);font-size:.88rem}
.pricing-was{color:var(--dim);font-size:.88rem;text-decoration:line-through}
.pricing-pill{
  font-size:.65rem;font-weight:700;letter-spacing:.05em;
  color:var(--amber);
  border:1px solid color-mix(in srgb,var(--amber) 30%,transparent);
  background:color-mix(in srgb,var(--amber) 10%,transparent);
  border-radius:999px;padding:.12rem .48rem;white-space:nowrap;align-self:center;
}
.pricing-billing{font-size:.84rem;color:var(--muted);margin:.15rem 0 .25rem}
.pricing-save{font-size:.82rem;color:var(--teal-text,var(--teal));font-weight:500;margin:0 0 1.1rem}
.pricing-feat-head{font-size:.8rem;font-weight:600;color:var(--muted);margin:1.1rem 0 .6rem}
.pricing-features{
  list-style:none;margin:0 0 1.8rem;padding:0;
  display:flex;flex-direction:column;gap:.5rem;
  flex-grow:1;
}
.pricing-features li{
  display:grid;grid-template-columns:.9rem 1fr;gap:.5rem;
  font-size:.86rem;color:var(--muted);line-height:1.45;
}
.pricing-features li::before{content:"✓";color:var(--accent);font-weight:700;font-size:.9rem;line-height:1.45}
.btn-block{width:100%;justify-content:center;margin-top:auto}
.pricing-footnote{margin:1.5rem 0 0;font-size:.82rem;color:var(--dim);max-width:none}

.compare-heading{font-size:clamp(2rem,3.8vw,2.9rem);line-height:1.06;letter-spacing:-.03em;margin:.5rem 0}
.compare-vs-accent{color:var(--accent);white-space:nowrap}
.compare-sub{color:var(--muted);font-size:1.05rem;margin:.4rem auto 2.4rem;max-width:52ch;text-align:center}
.compare-block h2{text-align:center}
.compare-scroll{margin-top:2rem;overflow-x:auto}
.compare{
  width:100%;border-collapse:collapse;font-size:.9rem;
  background:var(--card);border:1px solid var(--line);border-radius:var(--radius);
  /* Fixed layout: the Feature column takes a third, the four others split the rest,
     so no header or option cell is squeezed into a wrap. */
  table-layout:fixed;
}
.compare th,.compare td{padding:.75rem .75rem;border-bottom:1px solid var(--line-soft);text-align:left;vertical-align:top;white-space:nowrap}
.compare th:first-child,.compare td:first-child{padding-left:1rem}
.compare thead th:first-child{width:32%}
.compare thead th:not(:first-child){width:17%}
.compare tbody th{white-space:normal}  /* feature names may wrap; the rest never do */
.compare thead th{font-weight:500;color:var(--dim);font-size:.8rem;border-bottom-color:var(--line)}
.compare tbody th{font-weight:500}
.compare tbody tr:last-child th,.compare tbody tr:last-child td{border-bottom:0}
.compare-ours{background:color-mix(in srgb,var(--accent) 7%,transparent)}
.compare td .compare-word{color:var(--muted)}
.compare-ours .compare-word{color:var(--text)}
.mark{font-weight:700}
.mark-yes{color:var(--accent)}
.mark-no{color:var(--muted)}

.accordion{margin-top:1.5rem;border-top:1px solid var(--line-soft)}
.acc-item{border-bottom:1px solid var(--line-soft)}
.acc-item h3{margin:0}
.acc-trigger{
  display:flex;justify-content:space-between;align-items:center;gap:1rem;
  width:100%;padding:1.2rem 0;border:0;background:none;cursor:pointer;
  font:inherit;font-family:var(--display);font-size:1.12rem;font-weight:600;
  color:var(--text);text-align:left;letter-spacing:-.02em;
}
.acc-trigger:hover{color:var(--blue)}
/* Plus made of two bars; the vertical one folds away to leave a minus. */
.acc-icon{position:relative;flex-shrink:0;width:14px;height:14px;color:var(--muted)}
.acc-icon::before,.acc-icon::after{
  content:"";position:absolute;left:0;top:6px;width:14px;height:2px;
  border-radius:1px;background:currentColor;transition:transform .13s ease;
}
.acc-icon::after{transform:rotate(90deg)}
.acc-trigger[aria-expanded="true"] .acc-icon{color:var(--blue)}
.acc-trigger[aria-expanded="true"] .acc-icon::after{transform:rotate(0deg)}
.acc-panel{padding:0 2rem 1.3rem 0}
.acc-panel p{color:var(--muted);margin:0;max-width:70ch}  /* about 70 characters a line */

.footer-cols{display:flex;flex-wrap:wrap;gap:2rem 4rem;margin-bottom:2rem}
.footer-head{font-family:var(--sans);font-size:.78rem;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--text);margin:0 0 .75rem}
.footer-cols ul{list-style:none;margin:0;padding:0;display:grid;gap:.45rem}
.footer-cols a{text-decoration:none}
.footer-cols a:hover{color:var(--text);text-decoration:underline}
.footer-base{
  display:flex;justify-content:space-between;align-items:flex-start;gap:1rem;
  padding-top:1.5rem;border-top:1px solid var(--line-soft);
}
.footer-base p{margin:0}

@media (max-width:720px){
  .hiw-steps{grid-template-columns:1fr 1fr;gap:2rem}
  .hiw-connector{display:none}
  .hiw-aside{display:none}
  .compare th,.compare td{padding:.65rem .75rem}
  /* Below tablet width the table keeps its columns and scrolls inside its own box,
     with the Feature column pinned on the left. */
  /* The scroll box must be the containing block of the screen-reader-only spans
     (position:absolute) inside the cells; otherwise they escape its clip and widen the page. */
  .compare-scroll{position:relative}
  .compare{table-layout:auto;min-width:760px}
  .compare thead th:first-child,.compare thead th:not(:first-child){width:auto}
  .compare th:first-child,.compare td:first-child{position:sticky;left:0;z-index:1;background:var(--card)}
  .compare tbody th:first-child{min-width:11rem}
  /* Header on phone: logo, the main button and a menu button. The links, Log in and
     the theme switch wait inside the menu. display:contents lets the nav's children
     sit in the header row without a second wrapper. */
  .site-header .wrap{flex-wrap:wrap;padding:.5rem 0;gap:.5rem}
  .site-header .brand{margin-right:auto;min-width:0}
  .site-nav{display:contents}
  .site-nav>a:not(.btn),.site-nav>.theme-toggle{display:none}
  .site-nav>a.btn{order:1}
  .site-header .nav-toggle{order:2}
  .site-header.menu-open .site-nav>a:not(.btn){display:block;order:3;flex:1 0 100%;padding:.7rem 0;border-top:1px solid var(--line-soft);font-size:1rem}
  .site-header.menu-open .site-nav>.theme-toggle{display:inline-grid;order:4;margin:.25rem 0 .5rem}
  /* Hero: stack mock below text on mobile */
  .hero-grid{grid-template-columns:1fr}
}

/* Feature tiles, pricing and the comparison table on a phone. These sit after the
   base rules they override; the same rules placed higher up lose to them. */
@media (max-width:480px){
  .feat-strip,.pricing-grid{grid-template-columns:minmax(0,1fr)}
  /* Feature column pinned and narrow, so the TradeIntra column shows without scrolling. */
  .compare{min-width:0;font-size:.82rem}
  .compare th,.compare td{padding:.6rem .5rem}
  .compare thead th:first-child,.compare tbody th:first-child{width:6.75rem;min-width:0}
  .compare th:first-child,.compare td:first-child{padding-left:.75rem}
}
@media (min-width:481px) and (max-width:720px){
  .feat-strip{grid-template-columns:repeat(2,minmax(0,1fr))}
}

.site-footer{
  border-top:1px solid var(--line-soft);padding:2.5rem 0;
  font-size:.87rem;color:var(--dim);
}
.site-footer a{color:var(--muted)}
.footer-legal{display:flex;flex-wrap:wrap;gap:.25rem .5rem;margin:.75rem 0 0}

/* Legal pages (templates/pages/legal_base.html): one readable column, about 70 characters a line. */
.legal{padding:3rem 0 4rem}
.legal-inner{max-width:72ch;margin-inline:auto}
.legal-head{margin-bottom:1.75rem;padding-bottom:1.25rem;border-bottom:1px solid var(--line-soft)}
.legal-head h1{font-size:clamp(1.9rem,4.2vw,2.6rem);margin:0 0 .5rem}
.legal-updated{margin:0;color:var(--muted);font-size:.9rem}
.legal-body{line-height:1.7;overflow-wrap:anywhere}
.legal-body h2{font-size:1.25rem;margin:2.25rem 0 .6rem;scroll-margin-top:5.5rem}
.legal-body p{margin:0 0 1rem}
.legal-body ul{margin:0 0 1rem;padding-left:1.25rem}
.legal-body li{margin:0 0 .45rem}
.legal-body li::marker{color:var(--muted)}
.legal-tbc{color:var(--amber);font-weight:600}
.legal-pending-note{margin-bottom:1.5rem}
.legal-contact{display:grid;grid-template-columns:max-content 1fr;gap:.6rem 1.5rem;margin:1.5rem 0 2rem;
  padding:1.25rem 1.4rem;background:var(--card);border:1px solid var(--line);border-radius:var(--radius)}
.legal-contact dt{color:var(--muted);font-size:.9rem}
.legal-contact dd{margin:0}
@media (max-width:480px){
  .legal{padding:2rem 0 3rem}
  .legal-contact{grid-template-columns:1fr;gap:.15rem;padding:1rem 1.1rem}
  .legal-contact dd{margin-bottom:.6rem}
}

.app{display:flex;min-height:100vh}

.sidebar{
  width:var(--sidebar-w);flex-shrink:0;
  background:var(--sidebar-bg);color:var(--muted);
  border-right:1px solid var(--line-soft);
  padding:1.25rem 0;position:sticky;top:0;height:100vh;
  display:flex;flex-direction:column;overflow:hidden;
}
.sidebar .brand{flex-shrink:0;color:var(--text);display:flex;align-items:center;padding:0 1.25rem 1.25rem}
/* Only the nav scrolls on a short screen; the logo stays at the top. */
.sidebar nav{
  flex:1 1 auto;min-height:0;overflow-y:auto;
  display:flex;flex-direction:column;gap:10px;padding-bottom:.25rem;
}
/* Each item is 44px tall, rows sit 54px apart (44 + the 10px gap). The
   inset rounds the active highlight; the 2px accent bar stays on its left
   edge, and the icon sits 20px from the sidebar edge (8 + 2 + 10). */
.sidebar nav a{
  box-sizing:border-box;min-height:44px;
  display:flex;align-items:center;gap:1rem;padding:0 .625rem;margin:0 .5rem;
  color:var(--muted);text-decoration:none;font-size:.92rem;
  border-left:2px solid transparent;border-radius:8px;
}
.sidebar nav a:hover{color:var(--text);background:color-mix(in srgb,var(--blue) 7%,transparent)}
.sidebar nav a.active{
  color:var(--accent);border-left-color:var(--accent);font-weight:500;
  background:color-mix(in srgb,var(--accent) 12%,transparent);
}
.nav-ico{color:var(--accent);width:18px;height:18px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.sidebar nav .nav-logout-form{margin:0;padding:0 .5rem;display:block}
.sidebar nav .nav-logout{
  display:flex;align-items:center;gap:1rem;box-sizing:border-box;
  width:100%;min-height:44px;margin:0;padding:0 .625rem;
  border:0;border-left:2px solid transparent;border-radius:8px;
  background:none;color:var(--muted);
  font:inherit;font-size:.92rem;text-align:left;
  box-shadow:none;transform:none;cursor:pointer;
}
.sidebar nav .nav-logout:hover,
.sidebar nav .nav-logout:focus-visible{color:var(--text);background:color-mix(in srgb,var(--blue) 7%,transparent);box-shadow:none;transform:none}
.sidebar .group-label{
  padding:1.25rem 1.25rem .35rem;font-size:.75rem;color:var(--dim);
}
/* Terms · Privacy · Refund · Contact, pinned under the scrolling nav. It is a <nav> too, so the
   .sidebar nav rules are undone here (and on a phone it shows only while the menu is open). */
.sidebar nav.sidebar-legal{
  flex:0 0 auto;overflow:visible;flex-direction:row;flex-wrap:wrap;gap:.15rem .35rem;
  padding:.85rem 1.25rem 0;margin-top:.5rem;border-top:1px solid var(--line-soft);font-size:.75rem;color:var(--dim);
}
.sidebar nav.sidebar-legal a{
  display:inline;min-height:0;margin:0;padding:0;border:0;border-radius:0;
  font-size:inherit;color:var(--muted);text-decoration:none;background:none;
}
.sidebar nav.sidebar-legal a:hover{color:var(--text);text-decoration:underline;background:none}

.main{flex:1;min-width:0}
/* No page title here (the sidebar shows where you are): just the page's actions, the theme toggle and the
   avatar, on the right. A fixed minimum height keeps the content starting at the same place on every page,
   with or without an action button. */
.topbar{
  display:flex;align-items:center;justify-content:flex-end;
  gap:1rem;padding:.5rem 2rem;min-height:3.5rem;
  border-bottom:1px solid var(--line-soft);background:var(--ink2);
}
.content{padding:1.75rem 2rem 4rem}

.toolbar{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;margin-bottom:1.5rem}
.chip{
  padding:.3rem .8rem;border:1px solid var(--field-line);border-radius:999px;
  font-size:.85rem;color:var(--muted);text-decoration:none;background:var(--card);
}
.chip:hover{border-color:var(--blue);color:var(--text)}
.chip.active{
  background:linear-gradient(135deg,var(--blue),var(--blue-deep));
  color:var(--on-accent);border-color:transparent;font-weight:500;
}

.theme-toggle{
  display:inline-grid;place-items:center;
  width:32px;height:32px;padding:0;
  border:1px solid var(--line);border-radius:8px;
  background:var(--card);color:var(--accent);
  font-size:.95rem;line-height:1;cursor:pointer;
}
.theme-toggle:hover{border-color:var(--blue);color:var(--text)}
.theme-toggle .sun{display:none}
html[data-theme="light"] .theme-toggle .sun{display:block}
html[data-theme="light"] .theme-toggle .moon{display:none}

.user-menu{position:relative}
.user-menu-btn{background:none;border:none;cursor:pointer;display:flex;align-items:center;gap:.3rem;font-size:.85rem;color:var(--muted);padding:.3rem .5rem;border-radius:var(--radius);transition:color .13s ease}
.user-menu-btn:hover{color:var(--text)}
.user-menu-btn{padding:2px;border-radius:50%}
.user-menu-btn:hover .user-avatar,.user-menu-btn:focus-visible .user-avatar,.user-menu-btn[aria-expanded="true"] .user-avatar{box-shadow:0 0 0 2px var(--card),0 0 0 4px var(--accent)}
.user-avatar{display:inline-grid;place-items:center;flex-shrink:0;width:32px;height:32px;border-radius:50%;background:var(--accent);color:var(--on-accent);font-weight:700;font-size:.9rem;line-height:1;user-select:none}
.user-menu-head{padding:.5rem .75rem .35rem;min-width:0}
.user-menu-fullname{font-size:.85rem;font-weight:600;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.user-menu-email{font-size:.75rem;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.user-menu-dropdown{max-width:min(280px,calc(100vw - 1.5rem))}
.user-menu-dropdown{display:none;position:absolute;right:0;top:calc(100% + .35rem);background:var(--card);border:1px solid var(--line);border-radius:var(--radius);min-width:170px;box-shadow:0 8px 20px rgba(0,0,0,.25);z-index:200;padding:.3rem}
.user-menu-dropdown.open{display:block}
.user-menu-item{display:flex;align-items:center;gap:.65rem;width:100%;padding:.5rem .75rem;font-size:.88rem;text-align:left;text-decoration:none;color:var(--text);border-radius:calc(var(--radius) - 2px);background:none;border:none;cursor:pointer;transition:background .1s ease;font-family:inherit}
.user-menu-item:hover,.user-menu-item:focus{background:var(--hover);color:var(--text);outline:none}
/* Log out is not an error or a delete: it keeps the normal menu colours. */
.user-menu-sep{height:1px;background:var(--line-soft);margin:.3rem 0}
.user-menu-logout{padding:0}
.user-menu-logout .user-menu-item{display:flex;width:100%}
.user-menu-item .nav-ico{color:var(--accent)}

.stat-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:1rem;margin-bottom:1.75rem}
.stat{
  background:var(--card);border:1px solid var(--line);
  border-radius:var(--radius);padding:1.05rem 1.15rem;
}
.stat .label{font-size:.82rem;color:var(--muted);margin-bottom:.3rem}
.stat-value{font-family:var(--display);font-size:1.9rem;line-height:1.1}
.stat .sub{font-size:.8rem;color:var(--dim);margin-top:.25rem}

/* AI Summarizer: icon chip on the left of each stat tile */
.stat-row--icons .stat{display:flex;align-items:flex-start;gap:.8rem}
.stat-row--icons .stat-body{flex:1;min-width:0}
.stat-ico{
  display:grid;place-items:center;flex-shrink:0;
  width:2.2rem;height:2.2rem;border-radius:8px;
  color:var(--accent);background:var(--accent-soft);
}
.stat-ico svg{width:1.05rem;height:1.05rem;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

.dash-note{font-size:.85rem}
.dash-empty{margin:0;font-size:.9rem}
.dash-chart{position:relative;height:190px}
.dash-chart-tall{height:250px}
.panel-tools{display:flex;align-items:center;gap:.6rem;margin-left:auto;white-space:nowrap}
.equity-panel > header{flex-wrap:wrap;gap:.4rem .75rem}
.equity-panel > header h2{white-space:nowrap}
.fs-toggle[hidden]{display:none}
.fs-toggle svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.fs-toggle .fs-exit,.fs-toggle.is-on .fs-enter{display:none}
.fs-toggle.is-on .fs-exit{display:block}
/* Fullscreen: solid page colour, since the default backdrop is black, and
   the chart takes whatever height the profit line leaves. */
.equity-panel:fullscreen{
  display:flex;flex-direction:column;
  margin:0;border:0;border-radius:0;background:var(--ink);
}
.equity-panel:fullscreen > .panel-body{flex:1;display:flex;flex-direction:column;min-height:0}
.equity-panel:fullscreen .dash-chart-tall{flex:1;height:auto;min-height:0}
.equity-panel::backdrop{background:var(--ink)}

/* Winstreak: days on the left, trades on the right. */
.streak{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}

/* Trades page filter bar. Heading left, filters and count right. When both
   do not fit, the filters move under the heading together (they never wrap
   among themselves; a select shrinks a little first). When the list itself
   is phone-narrow, they stack full width. Sized on the list's width, not the
   screen's, because the sidebar comes and goes. */
.tl-body{container-type:inline-size}
/* The history table is wider than a mid-size window beside the sidebar: it scrolls inside its panel, never the page. */
.tl-body .table-scroll{overflow-x:auto;max-width:100%;min-width:0}
.tl-body td.num{white-space:nowrap}
.tl-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.75rem 1.5rem;margin-bottom:.75rem}
.tl-head>.page-head-info{flex:0 1 auto;margin-right:auto}
.tl-filters{display:flex;align-items:center;gap:.6rem;margin-left:auto;min-width:0}
.tl-filters select{width:auto;min-width:0;max-width:12rem;flex:0 1 auto;text-overflow:ellipsis}
/* The market names are the longest option ("Stocks & Options/Futures"): let that select grow to show it in full. */
.tl-filters select[name="market"]{max-width:none;flex:0 1 auto}
.tl-foot{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.6rem 1.5rem;margin-top:.75rem}
.tl-showing{margin:0;font-size:.85rem;color:var(--muted);max-width:none}
.pager{display:flex;flex-wrap:wrap;align-items:center;gap:.35rem}
.pager-btn{display:inline-grid;place-items:center;min-width:34px;height:34px;padding:0 .7rem;border:1px solid var(--field-line);border-radius:8px;background:var(--card);color:var(--text);font-size:.85rem;text-decoration:none}
a.pager-btn:hover{border-color:var(--accent)}
.pager-btn.is-current{background:var(--accent);border-color:var(--accent);color:var(--on-accent);font-weight:700}
.pager-btn.is-disabled{color:var(--dim);opacity:.55;cursor:not-allowed}
.pager-gap{color:var(--muted);padding:0 .2rem}
@media (max-width:600px){.tl-foot{flex-direction:column;align-items:stretch}.pager{justify-content:flex-start}.pager-btn{min-width:44px;height:44px}}
.tl-count{font-size:.85rem;color:var(--muted);white-space:nowrap}
@container (max-width:800px){
  .tl-filters{display:grid;grid-template-columns:minmax(0,1fr);width:100%;margin-left:0}
  .tl-filters select{width:100%;max-width:none}
}
.mk-note{margin:0;padding:.75rem 1.1rem;font-size:.78rem;color:var(--dim);border-top:1px solid var(--line-soft)}

.panel{
  background:var(--card);border:1px solid var(--line);
  border-radius:var(--radius);margin-bottom:1.5rem;
}
.panel > header{
  display:flex;justify-content:space-between;align-items:center;
  padding:.9rem 1.1rem;border-bottom:1px solid var(--line-soft);
}
.panel > header h2,.panel > header h3{margin:0;font-size:1.05rem}
.panel-body{padding:1.1rem}

.two-col{display:grid;grid-template-columns:1.6fr 1fr;gap:1.5rem;align-items:start}

.table{width:100%;border-collapse:collapse;font-size:.9rem}
.table th{
  text-align:left;font-weight:500;color:var(--dim);
  padding:.6rem 1.1rem;border-bottom:1px solid var(--line);font-size:.82rem;
}
.table td{padding:.65rem 1.1rem;border-bottom:1px solid var(--line-soft)}
.table tr:last-child td{border-bottom:0}
.table tbody tr:hover{background:var(--hover)}
.table .num,.table th.num{text-align:right}

.table a{color:var(--text);text-decoration:none}
.table a:hover{color:var(--blue);text-decoration:underline}

.tag{
  display:inline-block;padding:.1rem .5rem;margin:0 .2rem .2rem 0;
  border:1px solid var(--line);border-radius:4px;
  font-size:.78rem;color:var(--muted);background:var(--ink2);
}
/* Direction and holding-style badge: one component for the Trades list,
   Dashboard recent trades, trade detail and the Calendar day popup.
   Colours are theme tokens (--badge-*), so each theme sets its own. */
.badge{
  display:inline-flex;align-items:center;padding:6px 12px;border-radius:8px;
  border:1px solid var(--badge-style-line);background:var(--badge-style-bg);color:var(--badge-style-text);
  font-family:var(--sans);font-size:13px;font-weight:500;line-height:1.2;white-space:nowrap;vertical-align:middle;
}
.badge--long{background:var(--badge-long-bg);border-color:var(--badge-long-line);color:var(--badge-long-text)}
.badge--short{background:var(--badge-short-bg);border-color:var(--badge-short-line);color:var(--badge-short-text)}

.form-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:1.1rem}
.field{display:flex;flex-direction:column;gap:.3rem}
.field > label{font-size:.85rem;color:var(--muted)}
.field .helptext{font-size:.78rem;color:var(--dim)}
.field .errorlist{color:var(--loss);font-size:.82rem;margin:.2rem 0 0;padding-left:1rem}
/* F&O lot size: one line + total in the normal case; the input appears on demand. */
.lot-hint{margin:.3rem 0 0}
.symbol-hint{margin:.2rem 0 0;font-weight:600;color:var(--text)}
.stop-hint{margin:.2rem 0 0;color:var(--text)}
.stop-hint[hidden]{display:none}
.symbol-hint[hidden]{display:none}
.lot-hint[hidden]{display:none}
.lot-hint--warn{color:var(--text);font-weight:600;border-left:3px solid var(--accent);padding-left:.5rem}
.form-error-summary{border:1px solid var(--loss);border-radius:var(--radius);padding:.75rem 1rem;margin-bottom:1.25rem;color:var(--loss);background:color-mix(in srgb,var(--loss) 10%,transparent)}
.form-error-summary strong{display:block;margin-bottom:.3rem;font-size:.9rem}
.form-error-summary ul{margin:0;padding-left:1.25rem;font-size:.85rem}
.form-error-summary li{margin:.15rem 0}
.field-wide{grid-column:1 / -1}

/* Entry and exit. The HTML is in phone order (one column). From 700px up it is
   three columns, placed by grid area:
     Quantity | Entry date and time | Exit date and time
     Entry price | Exit price | Charges
     Stop loss | Target
   Crypto and gold fill all six cells:
     Entry date and time | Entry price | Stop loss
     Exit date and time | Exit price | Target
   Their HTML order is already that reading order, so phone and desktop agree.
   For equity, trade-form.js moves the DOM into the desktop order so Tab follows it. */
/* What you traded: Symbol | Direction | Holding style. */
.form-grid--trio{grid-template-columns:1fr}
@media (min-width:700px){.form-grid--trio{grid-template-columns:repeat(3,minmax(0,1fr))}}
.form-grid--entry{grid-template-columns:1fr}
@media (min-width:700px){
  .form-grid--entry{grid-template-columns:repeat(3,minmax(0,1fr))}
  .form-grid--entry[data-order-desktop^="qty"]{
    grid-template-areas:"qty edt xdt" "ep xp ch" "sl tg .";
  }
  .form-grid--entry[data-order-desktop^="edt"]{
    grid-template-areas:"edt ep sl" "xdt xp tg";
  }
  .form-grid--entry > [data-area="qty"]{grid-area:qty}
  .form-grid--entry > [data-area="edt"]{grid-area:edt}
  .form-grid--entry > [data-area="xdt"]{grid-area:xdt}
  .form-grid--entry > [data-area="ep"]{grid-area:ep}
  .form-grid--entry > [data-area="xp"]{grid-area:xp}
  .form-grid--entry > [data-area="ch"]{grid-area:ch}
  .form-grid--entry > [data-area="sl"]{grid-area:sl}
  .form-grid--entry > [data-area="tg"]{grid-area:tg}
}

.input,input[type="text"],input[type="email"],input[type="password"],
input[type="number"],input[type="date"],input[type="datetime-local"],
select,textarea{
  width:100%;padding:.55rem .7rem;
  border:1px solid var(--field-line);border-radius:8px;
  font:inherit;color:var(--text);background:var(--ink2);
}
input:focus,select:focus,textarea:focus{border-color:var(--blue)}
input::placeholder,textarea::placeholder{color:var(--dim)}
textarea{resize:vertical}
select option{background:var(--ink2);color:var(--text)}
input[type="checkbox"]{accent-color:var(--blue)}

.ac-shell{position:relative}
.ac-list{
  position:absolute;top:calc(100% + 4px);left:0;right:0;z-index:30;
  margin:0;padding:.25rem;list-style:none;
  max-height:260px;overflow-y:auto;
  background:var(--card2);border:1px solid var(--line);
  border-radius:8px;box-shadow:var(--shadow);
}
.ac-list li{
  display:flex;align-items:baseline;gap:.6rem;
  padding:.45rem .6rem;border-radius:6px;cursor:pointer;
}
.ac-list li.active{background:var(--accent);color:var(--on-accent)}
.ac-code{font-weight:500;font-size:.92rem}
.ac-name{font-size:.79rem;color:var(--dim);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ac-list li.active .ac-name{color:var(--on-accent);opacity:.8}

.checkbox-list{display:flex;flex-wrap:wrap;gap:.5rem 1rem;margin:0;padding:0;list-style:none}
.checkbox-list li label{display:flex;align-items:center;gap:.4rem;font-size:.9rem;font-weight:400}
/* Options / Stocks / Swing picker on the trade form (static/js/trade-form.js).
   No display on .style-picker itself, so its hidden attribute still works. */
.style-picker{margin-bottom:1.75rem}
.style-picker-title{font-family:var(--display);font-size:1.15rem;font-weight:600;color:var(--blue-soft);margin:0 0 .75rem}
.style-picker-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:.75rem}
.style-card{
  display:flex;flex-direction:column;gap:.2rem;
  padding:.9rem 1rem;text-align:left;cursor:pointer;
  border:1px solid var(--line);border-radius:var(--radius);
  background:var(--ink2);color:var(--text);font:inherit;
  transition:border-color .13s ease,background-color .13s ease;
}
.style-card:hover{border-color:var(--blue)}
.style-card[aria-pressed="true"]{
  border-color:var(--blue);
  background:color-mix(in srgb,var(--blue) 12%,transparent);
  box-shadow:inset 0 0 0 1px var(--blue);
}
.style-card-name{font-weight:600;font-size:1rem}
.style-card[aria-pressed="true"] .style-card-name{color:var(--blue)}
.style-card-desc{font-size:.82rem;color:var(--muted)}

/* First step of Log a trade: two equal cards with an icon, side by side (one per
   row on phones). Only these two top cards; the Stocks / Options and Crypto /
   Gold sub-pickers keep their own layout. */
.style-picker .style-picker-grid:not([style]){grid-template-columns:repeat(2,minmax(0,1fr))}
.style-card--icon{flex-direction:row;align-items:center;gap:.8rem}
.style-card-ico{
  width:40px;height:40px;padding:9px;flex-shrink:0;box-sizing:border-box;
  fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;
  color:var(--blue-soft);border-radius:10px;
  background:color-mix(in srgb,var(--blue) 12%,transparent);
}
.style-card[aria-pressed="true"] .style-card-ico{color:var(--blue)}
.style-card-text{display:flex;flex-direction:column;gap:.2rem;min-width:0}
@media (max-width:480px){
  .style-picker .style-picker-grid:not([style]){grid-template-columns:1fr}
}

.form-actions{display:flex;gap:.75rem;margin-top:1.5rem;padding-top:1.25rem;border-top:1px solid var(--line-soft)}
/* ── Custom strategy picker ───────────────────────────────────────────── */
.strat-wrap{display:flex;align-items:center;gap:.4rem}
.strat-picker-wrap{position:relative;flex:1;min-width:0}
.strat-picker-trigger{display:flex;align-items:center;width:100%;padding:.55rem .7rem;border:1px solid var(--field-line);border-radius:8px;font:inherit;font-size:inherit;color:var(--text);background:var(--ink2);cursor:pointer;text-align:left;gap:.4rem;appearance:none}
.strat-picker-trigger:focus-visible{outline:2px solid var(--blue);outline-offset:1px}
.strat-picker-val{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.strat-picker-chevron{width:10px;height:6px;flex-shrink:0;transition:transform .15s}
.strat-picker-trigger[aria-expanded="true"] .strat-picker-chevron{transform:rotate(180deg)}
.strat-picker-list{position:absolute;top:calc(100% + 3px);left:0;right:0;z-index:300;list-style:none;margin:0;padding:.25rem 0;background:var(--card2);border:1px solid var(--line);border-radius:8px;box-shadow:0 4px 20px rgba(0,0,0,.28);max-height:260px;overflow-y:auto}
.strat-picker-opt{display:flex;align-items:center;padding:.5rem .75rem;cursor:pointer;gap:.45rem;outline:none}
.strat-picker-opt:hover,.strat-picker-opt:focus{background:var(--hover)}
.strat-picker-opt[aria-selected="true"]{color:var(--blue)}
.strat-picker-opt--placeholder{color:var(--dim)}
.strat-picker-name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.strat-picker-trash{display:inline-grid;place-items:center;width:22px;height:22px;padding:0;flex-shrink:0;border:none;border-radius:5px;background:transparent;color:var(--muted);cursor:pointer;opacity:0;pointer-events:none;transition:opacity .1s,color .1s}
.strat-picker-trash svg{width:13px;height:13px}
.strat-picker-opt:hover .strat-picker-trash,.strat-picker-opt:focus .strat-picker-trash,.strat-picker-opt:focus-within .strat-picker-trash{opacity:1;pointer-events:auto}
.strat-picker-trash:hover,.strat-picker-trash:focus-visible{color:var(--loss)}
@media(hover:none){.strat-picker-trash{opacity:1;pointer-events:auto}}
.strat-picker-opt--confirming .strat-picker-name,.strat-picker-opt--confirming .strat-picker-trash{display:none}
.strat-picker-confirm{display:flex;align-items:center;flex-wrap:wrap;gap:.35rem;flex:1;min-width:0;font-size:.82rem}
.strat-picker-confirm[hidden]{display:none}
.strat-picker-confirm-msg{flex-basis:100%;color:var(--text);line-height:1.35;margin:0 0 .2rem}
.strat-picker-confirm-err{flex-basis:100%;font-size:.78rem}

fieldset{border:0;padding:0;margin:0 0 1.75rem}
fieldset > legend{
  font-family:var(--display);font-size:1.15rem;font-weight:600;
  padding:0 0 .75rem;color:var(--blue-soft);
  border-bottom:1px solid var(--line-soft);width:100%;margin-bottom:1.1rem;
}

.auth{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:100vh;padding:2rem;gap:1.75rem}
.auth-card{width:min(420px,100%)}
/* Auth pages: the page is a column (header, card, disclaimer), so the card is centred in the space left and the
   disclaimer sits under it with no empty strip. */
body.page-auth{display:flex;flex-direction:column;min-height:100vh}
body.page-auth>main{flex:1;display:flex;flex-direction:column}
body.page-auth .auth{flex:1;min-height:0}
.auth-footer{padding:0 1rem 1.75rem;text-align:center}
.auth-disclaimer{max-width:34rem;margin:0 auto;font-size:.78rem;line-height:1.55;color:var(--muted);text-wrap:balance}
.auth-footer-links{display:flex;flex-wrap:wrap;justify-content:center;gap:.25rem 1rem;margin-top:.6rem;font-size:.8rem}
.auth-footer-links a{color:var(--muted)}
/* Signup consent: the label wraps to two lines on a phone, so the box sits at the top of the first line. */
.auth-check.auth-consent{align-items:flex-start;line-height:1.45}
.auth-check.auth-consent input{margin-top:.15rem}
.auth-consent+.field-error{margin-top:.4rem}
/* The logo above the card is centred, so the heading (and the line under it) is centred too, on every auth page. */
.auth-card>h1{text-align:center;margin-top:0;font-size:2rem}
.auth-card .panel{margin-bottom:0}
/* Auth form pieces (partials/auth_field.html and friends): the same on every auth page. */
.auth-note{margin:0 0 1rem;font-size:.8rem;color:var(--muted)}
.auth-note span,.auth-field .req,.auth-consent .req{color:var(--accent);font-weight:700}
.auth-field+.auth-field{margin-top:1rem}
.auth-label-row{display:flex;align-items:baseline;justify-content:space-between;gap:.75rem}
.auth-aside{font-size:.8rem;color:var(--muted)}
.pw-wrap{position:relative}
.pw-wrap input{padding-right:2.75rem}
.pw-toggle{position:absolute;top:0;right:0;bottom:0;width:2.75rem;display:flex;align-items:center;justify-content:center;
  padding:0;background:none;border:0;border-radius:0 8px 8px 0;cursor:pointer;color:var(--accent)}
.pw-toggle:hover{background:var(--accent-soft)}
.pw-toggle[hidden]{display:none}
.pw-toggle svg{width:1.2rem;height:1.2rem;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.pw-toggle .pw-eye-off{display:none}
.pw-toggle[aria-pressed="true"] .pw-eye{display:none}
.pw-toggle[aria-pressed="true"] .pw-eye-off{display:block}
.auth-check{display:flex;align-items:center;gap:.55rem;margin:1rem 0 0;font-size:.9rem;color:var(--text);cursor:pointer}
.auth-check input{width:1.05rem;height:1.05rem;margin:0;accent-color:var(--accent);flex:none}
.auth-submit{width:100%;justify-content:center;margin-top:1.5rem}
.auth-switch{margin:1.25rem 0 0;text-align:center;font-size:.9rem;color:var(--muted)}
.auth-switch a{white-space:nowrap;font-weight:600;color:var(--accent);text-decoration:underline;text-underline-offset:3px;text-decoration-thickness:1px}
.auth-switch a:hover{text-decoration-thickness:2px}
.auth-back{margin:0;text-align:center;font-size:.9rem}
/* "Check your email" page: the same card as login, one cyan envelope, two buttons. */
.auth-notice{text-align:center}
.auth-notice-icon{width:3rem;height:3rem;margin:0 auto .75rem;display:block;fill:none;stroke:var(--accent);stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.auth-notice-text{margin:0;line-height:1.55}
.auth-email{overflow-wrap:anywhere;word-break:break-word}
.auth-notice-sent{margin:1rem 0 0;font-size:.9rem;color:var(--muted)}
.auth-notice .form-alert{text-align:left;margin-bottom:1rem}
.auth-actions{display:flex;flex-wrap:wrap;gap:.75rem;margin-top:1.5rem}
.auth-actions>*{flex:1 1 9rem;min-width:0}
.auth-actions form{display:flex}
.auth-actions .btn{width:100%;justify-content:center}
.auth-card>h1+p.muted{text-align:center}
/* Form errors on the auth pages: one calm amber style (red stays for losses). Markup in
   partials/form_alerts.html (the box) and partials/field_errors.html (under a field). */
.form-alert{display:flex;gap:.65rem;align-items:flex-start;margin:0 0 1.1rem;padding:.7rem .85rem;
  color:var(--text);font-size:.9rem;line-height:1.45;border-left:3px solid var(--amber);border-radius:.45rem;
  background:color-mix(in srgb,var(--amber) 12%,transparent)}
.form-alert svg{flex:none;width:1.15rem;height:1.15rem;margin-top:.1rem;fill:none;stroke:var(--amber);stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.form-alert-body{min-width:0;overflow-wrap:anywhere}
.form-alert-body p{margin:0}
.form-alert-body p+p{margin-top:.25rem}
.field-error{margin:.1rem 0 0;font-size:.82rem;line-height:1.4;color:var(--amber-text,var(--amber));overflow-wrap:anywhere}
.field-error p{margin:0}
.field-error p+p{margin-top:.15rem}
.field input[aria-invalid="true"]{border-color:var(--amber)}
.auth-card .panel-body{padding:1.75rem}

/* P&L calendar. Day tints mix the theme's own --profit / --loss into
   transparent, so they follow light and dark mode with no extra rules. */
.cal-controls{display:flex;align-items:center;justify-content:flex-end;gap:.6rem;margin-bottom:1.5rem}
.cal-nav{display:flex;align-items:center;gap:.25rem}
.cal-nav .cal-month{margin:0 .5rem;font-size:1.25rem;font-weight:700;min-width:9.5ch;text-align:center}

/* Calendar tiles reuse .stat-tile / .st-* from the Dashboard. */
.cst-slash{color:var(--dim);font-weight:400}

.cal-scroll{overflow-x:auto}
.cal{width:100%;min-width:680px;border-collapse:collapse;table-layout:fixed}
.cal th{
  font-weight:500;color:var(--dim);font-size:.8rem;text-align:left;
  padding:.6rem .7rem;border-bottom:1px solid var(--line);
}
.cal td{
  vertical-align:top;height:5.4rem;padding:.5rem .7rem;
  border-right:1px solid var(--line-soft);border-bottom:1px solid var(--line-soft);
}
.cal tbody tr:last-child td{border-bottom:0}
.cal-date{display:block;font-size:.8rem;color:var(--muted)}
.cal-pnl{display:block;margin-top:.35rem;font-weight:600;font-size:.95rem}
.cal-count{display:block;font-size:.75rem;color:var(--dim)}
.cal-day.is-green{background:color-mix(in srgb,var(--profit) 11%,transparent)}
.cal-day.is-red{background:color-mix(in srgb,var(--loss) 11%,transparent)}
.cal-day.is-outside{background:var(--ink2)}
.cal-day.is-outside .cal-date{color:var(--dim);opacity:.6}
.cal-day.is-today{box-shadow:inset 0 0 0 2px var(--blue)}
.cal-day.is-today .cal-date{color:var(--blue);font-weight:600}
.cal-week-head,.cal-week{text-align:right;width:8.5rem}
.cal td.cal-week{background:var(--card2);border-right:0}
.cal-week .cal-pnl{margin-top:1.55rem}
/* The button fills the cell, so the whole day is the click target. */
.cal td.cal-day:has(.cal-day-btn){padding:0}
.cal-day-btn{
  display:block;width:100%;height:100%;min-height:5.4rem;
  padding:.5rem .7rem;border:0;background:none;
  font:inherit;color:inherit;text-align:left;cursor:pointer;
}
.cal-day-btn:hover{background:color-mix(in srgb,var(--blue) 9%,transparent)}
.cal-day-btn:focus-visible{outline-offset:-2px}

/* Native <dialog>; see static/js/calendar-day.js. Padding is zero so a click
   landing on the dialog element itself can only be the backdrop. */
.modal{
  width:min(820px,100% - 2rem);max-height:min(86vh,720px);
  padding:0;border:1px solid var(--line);border-radius:14px;
  background:var(--card);color:var(--text);box-shadow:var(--shadow);
}
.modal::backdrop{background:rgba(0,0,0,.62);backdrop-filter:blur(2px)}
.modal > header{
  display:flex;justify-content:space-between;align-items:center;gap:1rem;
  padding:1rem 1.25rem;border-bottom:1px solid var(--line-soft);
}
.modal > header h2{margin:0;font-size:1.15rem}
.modal-close{
  display:inline-grid;place-items:center;width:32px;height:32px;padding:0;
  border:1px solid var(--line);border-radius:8px;background:var(--card);
  color:var(--muted);font-size:1.3rem;line-height:1;cursor:pointer;
}
.modal-close:hover{border-color:var(--blue);color:var(--text)}
.modal-body{padding:1.25rem}
.modal-status{margin:1.5rem 0;text-align:center;max-width:none}
.modal-stats{grid-template-columns:repeat(auto-fit,minmax(150px,1fr));margin-bottom:1.25rem}
.modal-stats .stat-value{font-size:1.5rem}
.modal-table{overflow-x:auto;border:1px solid var(--line-soft);border-radius:var(--radius)}
.modal-table .table{min-width:560px}
.modal-table:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
@media(max-width:600px){
  .modal-table .table{min-width:470px}
  .modal-table .table th,.modal-table .table td{padding:.55rem .5rem}
}
/* No page scrolling behind any open modal. */
html:has(.modal[open]){overflow:hidden}

/* Log a trade modal (static/js/trade-modal.js). The form is long, so only the
   body scrolls and the header with its close button stays in view. display is
   set on [open] alone: a closed <dialog> must keep its display:none. */
.modal-form{width:min(940px,100% - 2rem);max-height:min(92vh,1000px);overflow:hidden;transition:width .18s ease}
/* Step 1 (no card chosen yet, or the form is still loading): a narrow dialog.
   trade-form.js sets data-step on the form; trade-modal.js adds is-loading until
   the form arrives, so the dialog never opens wide and then shrinks. */
.modal-form.is-loading,
.modal-form:has(form[data-step="pick"]){width:min(560px,100% - 2rem)}
/* Nothing to save until a card is chosen; Cancel stays. */
form[data-step="pick"] [data-save]{display:none}
.modal-form[open]{display:flex;flex-direction:column}
.modal-form > header{flex-shrink:0}
.modal-form .modal-body{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain}
.modal-form .form-actions{margin-bottom:0}
@media (max-width:600px){
  .modal-form{
    width:100%;max-width:100%;height:100%;max-height:100%;
    margin:0;border:0;border-radius:0;
  }
  .modal-form .modal-body{padding:1rem}
  /* Step 1 on a phone: a card with a 16px gutter, not full screen. */
  .modal-form.is-loading,
  .modal-form:has(form[data-step="pick"]){
    width:calc(100% - 32px);max-width:calc(100% - 32px);
    height:fit-content;max-height:calc(100% - 32px);margin:auto;
    border:1px solid var(--line);border-radius:14px;
  }
}
@media (max-width:600px){
  .modal-form{interpolate-size:allow-keywords;transition:width .18s ease,height .18s ease}
}

.empty{padding:2.5rem 1rem;text-align:center;color:var(--dim)}
.empty p{margin-inline:auto}

.messages{list-style:none;padding:0;margin:0 0 1.25rem}
.messages li{
  padding:.65rem 1rem;border-left:3px solid var(--blue);
  background:color-mix(in srgb,var(--blue) 12%,transparent);
  border-radius:0 var(--radius) var(--radius) 0;
  font-size:.9rem;
}
.messages li.error{
  border-left-color:var(--loss);
  background:color-mix(in srgb,var(--loss) 12%,transparent);
}

/* Daily checklist */
.cl-nav .cl-day{margin:0 .5rem;font-size:1.2rem}
.cl-nav .cl-day .tag{vertical-align:middle;font-family:var(--sans);font-weight:500}
.cl-edit-toggle{margin-left:auto}
/* Layout: narrow timeline rail on the left, stacked section cards on the right */
.cl-layout{display:grid;grid-template-columns:4.5rem 1fr;gap:.75rem 1.5rem;position:relative;align-items:start}
.cl-layout::before{content:'';position:absolute;left:calc(2.25rem - 1px);top:2.25rem;bottom:2.25rem;width:2px;background:var(--line-soft);pointer-events:none}
/* Timeline markers */
.cl-tml{display:flex;flex-direction:column;align-items:center;text-align:center;padding-top:.65rem;position:relative;z-index:1}
.cl-tml-circle{width:2rem;height:2rem;border-radius:50%;border:2px solid var(--accent);background:color-mix(in srgb,var(--accent) 8%,var(--card));color:var(--accent);display:flex;align-items:center;justify-content:center;font-size:.72rem;font-weight:700;flex-shrink:0;line-height:1}
.cl-tml--complete .cl-tml-circle{background:color-mix(in srgb,var(--accent) 12%,var(--card))}
.cl-tml--current .cl-tml-circle{background:color-mix(in srgb,var(--accent) 12%,var(--card))}
.cl-tml--past .cl-tml-circle,.cl-tml--future .cl-tml-circle{border-color:color-mix(in srgb,var(--accent) 45%,transparent);color:color-mix(in srgb,var(--accent) 45%,transparent)}
.cl-tml-label{font-size:.67rem;color:var(--muted);margin-top:.3rem;line-height:1.3;max-width:4rem}
.cl-tml-now{font-size:.63rem;font-weight:700;color:var(--blue);margin-top:.15rem;text-transform:uppercase;letter-spacing:.05em}
/* Section cards */
.cl-section-card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden}
.cl-section-card--pre{--sec:var(--amber)}
.cl-section-card--trade{--sec:var(--blue)}
.cl-section-card--post{--sec:var(--muted)}
.cl-section-card--active{border-color:var(--sec)}
.cl-section-header{display:flex;justify-content:space-between;align-items:center;gap:.75rem;padding:.85rem 1rem;flex-wrap:wrap}
.cl-section-phone-stage{display:none;font-size:.65rem;text-transform:uppercase;letter-spacing:.09em;font-weight:700;color:var(--muted);margin-bottom:.15rem}
.cl-section-title{margin:0;font-size:1rem;font-weight:600}
.cl-section-sub{margin:.2rem 0 0;font-size:.82rem;color:var(--muted)}
.cl-section-head{display:flex;align-items:center;gap:.7rem;min-width:0}
.cl-progress{flex:0 0 14rem;min-width:0}
.cl-progress-top{display:flex;justify-content:space-between;font-size:.8rem;color:var(--muted);font-variant-numeric:tabular-nums;margin-bottom:.35rem}
.cl-progress-bar{height:6px;border-radius:999px;background:var(--line-soft);overflow:hidden}
.cl-progress-fill{height:100%;border-radius:999px;background:var(--accent);transition:width .2s ease}
/* Items grid inside each card: 3-across on desktop */
.cl-items-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.55rem;padding:.75rem 1rem 1rem}
.cl-items-empty{font-size:.86rem;grid-column:1/-1;margin:0}
/* Delete icon on the trader's own checklist items */
.cl-item-row{display:flex;align-items:stretch;gap:.3rem;min-width:0}
.cl-item-row>.cl-item{flex:1;min-width:0}
.cl-row-actions{display:flex;align-items:center;gap:.3rem;flex-shrink:0}
.cl-del{background:none;border:0;padding:.3rem;margin:0;color:var(--muted);cursor:pointer;opacity:0;border-radius:.3rem;display:flex;align-items:center;justify-content:center;transition:opacity .12s,color .12s;box-shadow:none;transform:none}
.cl-del[hidden],.cl-del-confirm[hidden]{display:none}
.cl-del svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.cl-item-row:hover .cl-del,.cl-del:focus-visible{opacity:1}
.cl-del:hover,.cl-del:focus-visible{color:var(--loss)}
@media (hover:none){.cl-del{opacity:1}}
.cl-del-confirm{display:flex;align-items:center;gap:.35rem;font-size:.8rem;color:var(--muted);white-space:nowrap}
.cl-del-confirm .cl-del-yes{color:var(--loss);border-color:var(--loss)}

/* Item box: checkbox + text, equal height per row via grid stretch */
.cl-item-time{font-size:.75rem;color:var(--muted);font-variant-numeric:tabular-nums;white-space:nowrap;margin-top:.12rem}
.cl-item{display:grid;grid-template-columns:1.1rem minmax(0,1fr) auto;gap:0 .5rem;align-items:start;border:1px solid var(--line-soft);border-radius:.4rem;padding:.5rem .65rem;cursor:pointer;transition:border-color .12s;user-select:none}
.cl-item:hover{border-color:var(--sec,var(--blue))}
/* Visually hidden but still in the tab order (display:none made the ticks unreachable by keyboard). */
.cl-item{position:relative}
.cl-item-cb{position:absolute;opacity:0;width:1.1rem;height:1.1rem;margin:0;pointer-events:none}
.cl-item-cb:focus-visible + .cl-item-check{outline:2px solid var(--accent);outline-offset:2px}
.cl-item-check{width:1.1rem;height:1.1rem;border:1.5px solid var(--line);border-radius:.28rem;display:flex;align-items:center;justify-content:center;flex-shrink:0;margin-top:.1rem;background:transparent;color:transparent;transition:background .1s,border-color .1s,color .1s}
.cl-item-cb:checked + .cl-item-check{background:var(--sec,var(--blue));border-color:var(--sec,var(--blue));color:var(--on-accent)}
.cl-item-text{font-size:.875rem;line-height:1.45;color:var(--text)}
.cl-item--done .cl-item-text{color:var(--dim);text-decoration:line-through;text-decoration-color:var(--muted)}
/* Save strip */
.cl-save{display:flex;gap:.75rem;align-items:center;min-height:2rem;margin-top:.75rem}
.cl-save .btn[hidden]{display:none}
.cl-note{font-size:.82rem;margin:.75rem 0}
/* Info button beside a card title and its click-to-open popover (static/js/info-pop.js). */
.stat-row--icons .stat{position:relative}
.cl-nowrap{white-space:nowrap}
.cl-label .info-btn{margin-left:.35rem;vertical-align:middle}
.info-btn{width:1.4rem;height:1.4rem;border-radius:50%;border:1px solid var(--field-line);background:var(--line-soft);color:var(--muted);
  font-family:var(--sans);font-size:.72rem;font-weight:700;font-style:italic;line-height:1;padding:0;cursor:pointer;
  display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;position:relative;top:-1px}
.info-btn:hover,.info-btn[aria-expanded="true"]{border-color:var(--accent);color:var(--accent)}
.info-btn:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.info-pop{position:absolute;left:.6rem;right:.6rem;top:2.6rem;z-index:20;box-sizing:border-box;padding:.65rem .8rem;
  background:var(--card);border:1px solid var(--field-line);border-radius:.5rem;box-shadow:0 8px 22px -8px rgba(0,0,0,.5);
  color:var(--text);font-size:.78rem;line-height:1.45;font-weight:400;font-family:var(--sans)}
.info-pop[hidden]{display:none}
.cl-open{font-size:.76rem;color:var(--muted)}
.cl-rule{margin:0 0 1rem}
.cl-add-note{margin:.4rem 0 0;font-size:.78rem}
.cl-nav{justify-content:space-between;row-gap:.6rem}
.cl-nav-left{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem;min-width:0}
.cl-nav-right{display:flex;align-items:center;gap:.5rem;margin-left:auto;min-width:0}
.cl-market{display:flex;min-width:0}
.cl-nav-right .chip{white-space:nowrap;flex-shrink:0}
@media (max-width:700px){
  .cl-nav-right{width:100%;margin-left:0}
  .cl-market{flex:1}.cl-market > *{flex:1;min-width:0}
}
/* Edit mode: 3-column grid the same way the old layout did */
.cl-edit-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1.25rem;align-items:start}
.cl-edit-grid .panel{margin-bottom:0}
.cl-edit-grid .panel > header{gap:.75rem;flex-wrap:wrap}
.cl-edit-grid .cl-row-edit{display:grid;grid-template-columns:1fr auto auto;gap:.5rem}
.cl-edit-grid .cl-row-edit form{display:contents}
.cl-edit-grid .cl-row-edit input[type="text"]{grid-column:1/-1}
.cl-edit-grid .cl-row-edit .btn-outline{grid-column:2}
.cl-edit-grid .cl-row-edit .cl-remove{grid-column:3}
.cl-edit-grid + .cl-save,.cl-edit-grid + .cl-note{margin-top:1rem}
.cl-list{list-style:none;margin:0;padding:.25rem 1.1rem}
.cl-row{padding:.6rem 0;border-bottom:1px solid var(--line-soft)}
.cl-row:last-child{border-bottom:0}
.cl-row-edit{display:flex;gap:.5rem;align-items:center}
.cl-edit-form{display:flex;gap:.5rem;align-items:center;flex:1;min-width:0}
.cl-edit-form input[type="text"]{flex:1;min-width:0}
.cl-remove{background:none;border-color:var(--line);color:var(--loss)}
.cl-remove:hover{border-color:var(--loss)}
@media (max-width:1100px){.cl-edit-grid{grid-template-columns:1fr}}
@media (max-width:600px){
  .cl-layout{grid-template-columns:1fr}
  .cl-layout::before{display:none}
  .cl-tml{display:none}
  .cl-section-phone-stage{display:block}
  .cl-items-grid{grid-template-columns:1fr}
  .cl-progress{flex:1 1 100%}
}
/* Trading Summary: Performance panel. Solid site tokens only, so both themes follow. */
.panel > .perf-head{justify-content:flex-start;gap:.8rem}
.perf-head h2{margin:0;font-size:1.05rem}
.perf-sub{margin:.15rem 0 0;font-size:.82rem;color:var(--muted)}
.perf-body{display:grid;gap:1.1rem}
.perf-highlight{display:flex;align-items:center;gap:.9rem;padding:.9rem 1rem;border:1px solid var(--line);border-radius:var(--radius);background:var(--card2)}
.perf-highlight .stat-ico{flex-shrink:0}
.perf-divider{width:1px;align-self:stretch;background:var(--line);flex-shrink:0}
.perf-highlight-text{min-width:0;font-size:.95rem;line-height:1.5;color:var(--muted)}
.perf-highlight-text p{margin:0}
.perf-highlight-text p + p{margin-top:.3rem;font-size:.88rem}
.perf-highlight-text strong{font-weight:700;color:var(--text)}
.perf-highlight-text strong.profit{color:var(--profit)}
.perf-highlight-text strong.loss{color:var(--loss)}
.perf-health{display:grid;gap:.55rem}
.perf-health-row{display:flex;align-items:center;gap:.6rem;font-size:.92rem}
.perf-tiles{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:1.1rem}
.perf-tiles .st-value{white-space:nowrap}
.perf-tiles .st-sub{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* Six tiles share one row, so their labels are a little smaller to stay on one line. */
.perf-tiles .st-label{white-space:nowrap;font-size:.68rem;letter-spacing:.03em}
.perf-tiles .st-head{gap:.5rem}
.perf-health-text{flex:1;min-width:0;display:grid;gap:.15rem}
.perf-health-name{color:var(--text)}
.perf-health-note{font-size:.78rem;line-height:1.4;color:var(--muted)}
.perf-health-value{font-family:var(--display);font-size:1.25rem;color:var(--text);white-space:nowrap}
.perf-pill{display:inline-block;padding:.14rem .55rem;border-radius:999px;font-size:.75rem;font-weight:600;color:var(--blue);background:color-mix(in srgb,var(--blue) 12%,transparent);border:1px solid color-mix(in srgb,var(--blue) 35%,transparent);white-space:nowrap}
.perf-track{height:8px;border-radius:999px;background:var(--line-soft);overflow:hidden}
.perf-fill{height:100%;border-radius:inherit;background:var(--blue)}
.perf-card-unit{font-family:var(--sans);font-size:.8rem;color:var(--muted)}
@media (max-width:1100px){
  .perf-tiles{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media (max-width:640px){
  .perf-tiles{grid-template-columns:1fr}
}
.ai-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:1.25rem;align-items:start}
.ai-section{border-radius:var(--radius);overflow:hidden;border:1px solid var(--line)}
.ai-strengths,.ai-weaknesses{--pa:var(--accent)}
.ai-focus{--pa:var(--blue)}
.ai-section-head{display:flex;align-items:center;gap:.6rem;padding:.85rem 1rem;background:color-mix(in srgb,var(--pa) 10%,var(--card));border-bottom:1px solid color-mix(in srgb,var(--pa) 15%,transparent)}
.ai-section-chip{display:flex;align-items:center;justify-content:center;width:1.7rem;height:1.7rem;border-radius:.45rem;background:color-mix(in srgb,var(--pa) 22%,transparent);color:var(--pa);flex-shrink:0}
.ai-section-info{flex:1;min-width:0}
.ai-section-label{display:block;font-size:.72rem;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--pa)}
.ai-section-caption{display:block;font-size:.75rem;color:var(--muted);margin-top:.06rem}
.ai-section-count{font-family:var(--display);font-size:1.75rem;font-weight:600;color:var(--pa);line-height:1;flex-shrink:0}
.ai-section-body{padding:.65rem .75rem .8rem;display:grid;gap:.5rem}
.ai-point{background:color-mix(in srgb,var(--pa) 7%,transparent);border-left:2px solid var(--pa);border-radius:.4rem;padding:.6rem .75rem}
.ai-point-figure{font-family:var(--display);font-size:1.25rem;font-weight:600;color:var(--text);line-height:1.1;margin-bottom:.2rem}
.ai-point-figure.profit,.st-sub.profit{color:var(--profit)}
.ai-point-figure.loss,.st-sub.loss{color:var(--loss)}
.ai-point-text{font-size:.85rem;line-height:1.5;color:var(--muted)}
.ai-point--focus{display:grid;grid-template-columns:1.6rem 1fr;gap:0 .5rem;align-items:start;background:color-mix(in srgb,var(--pa) 7%,transparent);border-left:2px solid var(--pa);border-radius:.4rem;padding:.6rem .75rem}
.ai-point--focus .ai-point-text{font-size:.88rem;color:var(--text)}
.ai-focus-num{display:flex;align-items:center;justify-content:center;width:1.3rem;height:1.3rem;border-radius:50%;background:color-mix(in srgb,var(--pa) 22%,transparent);color:var(--pa);font-size:.68rem;font-weight:700;flex-shrink:0;margin-top:.13rem}
.ai-focus-btn{width:100%;margin-top:.15rem}
.ai-empty{font-size:.88rem;color:var(--muted);font-style:italic;padding:.3rem .25rem}
.ai-disclaimer{margin-top:1.75rem;font-size:.8rem;max-width:72ch}

@media (max-width:900px){
  .ai-grid{grid-template-columns:1fr}
  .hero-grid,.two-col{grid-template-columns:1fr}
  .app{flex-direction:column}
  /* The sidebar becomes a top bar: logo and a menu button. The links open under it. */
  .sidebar{width:100%;height:auto;position:static;padding:.6rem 1.1rem;border-right:0;border-bottom:1px solid var(--line-soft);flex-direction:row;flex-wrap:wrap;align-items:center;justify-content:space-between}
  .sidebar .brand{padding:0;min-width:0}
  .sidebar nav{display:none;flex:1 0 100%;overflow:visible;gap:2px;padding:.6rem 0 .25rem}
  .sidebar.nav-open nav{display:flex}
  .sidebar nav a{margin:0}
  .sidebar nav .nav-logout-form{padding:0}
  .sidebar .group-label{display:none}
  .sidebar nav.sidebar-legal{flex:1 0 100%;padding:.75rem 0 .35rem;margin-top:.25rem}
  .nav-toggle{display:inline-grid;place-items:center;width:40px;height:40px;padding:0;flex-shrink:0;border:1px solid var(--field-line);border-radius:8px;background:var(--card);color:var(--text);cursor:pointer}
  .nav-toggle:hover{border-color:var(--blue)}
  .nav-toggle svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
  .nav-toggle .nav-toggle-close,.nav-toggle[aria-expanded="true"] .nav-toggle-open{display:none}
  .nav-toggle[aria-expanded="true"] .nav-toggle-close{display:block}
  .content,.topbar{padding-inline:1.1rem}
  .topbar{flex-wrap:wrap;row-gap:.5rem;padding-block:.4rem;min-height:3rem}
  .table-scroll{overflow-x:auto;max-width:100%;min-width:0}
  /* By Strategy: the wrapper and its panel may never be wider than the page, and the wrapper
     clips any absolutely positioned cell content instead of letting it widen the page. */
  .rpt-bs{min-width:0;max-width:100%}
  .rpt-bs .table-scroll{position:relative}
}

@media (min-width:901px){.sidebar .nav-toggle{display:none}}
@media (min-width:721px){.site-header .nav-toggle{display:none}}

@media (prefers-reduced-motion:reduce){
  *{transition:none !important;animation:none !important}
}

/* Emotional State rows (Dashboard panel) */
.em-row{display:flex;align-items:baseline;justify-content:space-between;gap:.75rem;padding:.55rem 1.1rem;border-bottom:1px solid var(--line-soft)}
.em-row:last-child{border-bottom:none}
.em-tag{font-size:.875rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.em-val{flex-shrink:0;text-align:right;font-size:.875rem;font-variant-numeric:tabular-nums}
.em-count{font-size:.75rem;color:var(--muted);margin-left:.3rem;font-weight:400}
.em-none{color:var(--muted)}
.em-no-trades{font-size:.75rem;color:var(--muted);font-style:italic}

/* Dashboard rebuild */
.dash-greeting{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;margin-bottom:1.5rem;flex-wrap:wrap}
.dash-greet-line{font-size:1.35rem;font-weight:700;line-height:1.2;font-family:var(--display)}
.dash-greet-word{color:var(--muted);font-weight:500}
.dash-greet-name{color:var(--text)}
.dash-greet-sub{font-size:.85rem;color:var(--muted);margin-top:.25rem}

/* Page controls bar — market dropdown + date range + action button */
.page-controls{display:flex;gap:.6rem;align-items:center;flex-shrink:0}

/* Date range control */
.dr-trigger{display:inline-flex;align-items:center;gap:.5rem;padding:.45rem .8rem;background:var(--card);border:1px solid var(--line);border-radius:var(--radius);color:var(--text);font-size:.875rem;cursor:pointer;transition:border-color .15s}
.dr-trigger:hover{border-color:var(--blue)}
.dr-trigger svg{width:15px;height:15px;color:var(--accent);stroke:currentColor;stroke-width:1.8;fill:none;flex-shrink:0}
.dr-chevron{color:var(--accent)}
.dr-menu{position:absolute;top:calc(100% + 6px);right:0;left:auto;z-index:200;background:var(--card2);border:1px solid var(--line);border-radius:var(--radius);min-width:210px;max-width:calc(100vw - 1rem);padding:.4rem 0;box-shadow:0 8px 24px rgba(0,0,0,.28)}
.dr-item{display:block;padding:.45rem 1rem;font-size:.875rem;color:var(--text);text-decoration:none;transition:background .12s}
.dr-item:hover{background:var(--hover)}
.dr-item-active{color:var(--blue);font-weight:600}
.dr-divider{height:1px;background:var(--line);margin:.4rem 0}
.dr-custom{padding:.5rem 1rem .75rem;display:grid;gap:.5rem}
.dr-custom-label{font-size:.75rem;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.07em}
.dr-custom-row{display:flex;align-items:center;gap:.4rem}
.dr-custom-to{font-size:.8rem;color:var(--muted);white-space:nowrap}
.dr-date-input{flex:1;min-width:0;padding:.35rem .5rem;background:var(--ink2);border:1px solid var(--line);border-radius:6px;color:var(--text);font-size:.82rem;font-family:inherit}
.dr-date-input:focus{outline:none;border-color:var(--blue)}
.dr-apply{margin-top:.15rem;width:100%;justify-content:center}

/* Figures never break across lines. static/js/fit-values.js shrinks the font
   of a figure that is wider than its box, and only then. */
.stat-value,.st-value,.cst-value,.avg-value,.mkt-tile-value,.rpt-tile-value,.perf-health-value{white-space:nowrap}

/* 5-tile row */
.dash-tiles-4{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1.1rem;margin-bottom:1.25rem}
.stat-tile{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:1.1rem 1.1rem .7rem;display:flex;align-items:flex-start;gap:.75rem}
.st-body{flex:1;min-width:0}
.st-label{font-size:.78rem;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.07em;margin-bottom:.5rem}
.st-head{display:flex;align-items:center;gap:.6rem;margin-bottom:.5rem}
.st-head .st-label{margin-bottom:0;min-width:0}
.dash-tiles-4 .st-value{white-space:nowrap}
.st-value{font-family:var(--display);font-size:1.5rem;font-weight:700;line-height:1.1;overflow-wrap:anywhere}
.st-sub{font-size:.78rem;color:var(--dim);margin-top:.3rem}

/* Row 2: equity + outcome donut + symbols */
.dash-row2{display:grid;grid-template-columns:minmax(0,2.2fr) minmax(0,1fr) minmax(0,1fr);gap:1.1rem;margin-bottom:1.25rem;align-items:stretch}
.dash-row2 .equity-panel,.oc-panel,.sym-panel{margin-bottom:0;display:flex;flex-direction:column}
.dash-row2 .equity-panel > .panel-body{flex:1;display:flex;flex-direction:column}
.dash-row2 .dash-chart-tall{flex:1;height:auto;min-height:200px}
.oc-panel > .panel-body{flex:1;display:flex;flex-direction:column;justify-content:center}
.sym-panel > .panel-body{flex:1;display:flex;flex-direction:column}
.oc-body{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1rem}
.oc-donut{width:120px;height:120px;flex-shrink:0}
.oc-donut svg{width:100%;height:100%;display:block;overflow:visible}
.oc-count-label{font-size:1.4rem;font-weight:700;fill:var(--text);font-family:var(--display)}
.oc-count-sub{font-size:.65rem;fill:var(--muted);letter-spacing:.05em}
.oc-legend{list-style:none;margin:0;padding:0;display:grid;gap:.45rem;width:100%}
.oc-legend-item{display:flex;align-items:center;gap:.5rem;font-size:.83rem}
.oc-swatch{width:10px;height:10px;border-radius:3px;flex-shrink:0}
.oc-legend-label{flex:1;color:var(--muted)}
.oc-legend-val{font-variant-numeric:tabular-nums;font-weight:600}
.oc-pct{font-weight:400;color:var(--dim)}

/* Symbols bars */
.sym-body{flex:1;display:grid;gap:.6rem;align-content:start}
.sym-row{display:grid;grid-template-columns:4.5rem 1fr 5rem;align-items:center;gap:.5rem}
.sym-name{font-size:.82rem;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sym-bar-wrap{height:6px;background:var(--line-soft);border-radius:99px;overflow:hidden}
.sym-bar{height:100%;border-radius:inherit;transition:width .25s}
.sym-bar-profit{background:var(--profit)}
.sym-bar-loss{background:var(--loss)}
.sym-pnl{font-size:.82rem;font-variant-numeric:tabular-nums;font-weight:600;text-align:right}
.sym-more{font-size:.78rem;color:var(--muted);margin-top:.25rem}

/* Row 3 */
.dash-row3{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr);gap:1.1rem;align-items:start;margin-bottom:1.25rem}
.dash-row3-right{display:grid;gap:1.1rem}
.dash-row3-main{display:grid;gap:1.1rem;align-content:start;min-width:0}
.dash-row3-main > .panel{margin-bottom:0}
/* Every Dashboard grid column may shrink below its content, so a wide child
   (long prices in Recent trades) cannot push into its neighbour. */
.dash-tiles-4 > *,.dash-row2 > *,.dash-row3 > *,.dash-row3-main > *,.dash-row3-right > *,.dash-greeting > *{min-width:0}
.dash-row3 .table-scroll{overflow-x:auto;max-width:100%}
/* Recent trades: no cell wraps; the Date column goes first when the card is narrow. */
.dash-recent{container-type:inline-size}
.recent-table th,.recent-table td{white-space:nowrap;padding-left:.75rem;padding-right:.75rem}
.recent-table th:first-child,.recent-table td:first-child{padding-left:1.1rem}
.recent-table th:last-child,.recent-table td:last-child{padding-right:1.1rem}
.recent-table .col-sym .badge{margin-left:.45rem}
@container (max-width:800px){
  .recent-table .col-date{display:none}
}
/* R:R badge: profit green, loss red, exactly zero grey, rounded. */
.rr-badge{
  display:inline-block;padding:.18rem .55rem;border-radius:99px;
  font-size:.78rem;font-weight:600;font-variant-numeric:tabular-nums;white-space:nowrap;
}
.rr-profit{color:var(--profit);background:color-mix(in srgb,var(--profit) 15%,transparent)}
.rr-loss{color:var(--loss);background:color-mix(in srgb,var(--loss) 15%,transparent)}
.rr-zero{color:var(--muted);background:var(--line-soft)}
.panel-link{font-size:.82rem;color:var(--blue);text-decoration:none;margin-left:auto}
.panel-link:hover{text-decoration:underline}

/* Average win / loss panel */
.avg-pair{display:grid;grid-template-columns:1fr 1fr;gap:0}
.avg-half{padding-right:1rem;min-width:0}
.avg-half + .avg-half{padding:0 0 0 1rem;border-left:1px solid var(--line-soft)}
.avg-label{font-size:.8rem;color:var(--muted)}
.avg-value{font-family:var(--display);font-size:1.6rem;font-weight:600;line-height:1.15;margin:.3rem 0 .25rem;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.avg-count{font-size:.78rem}
.avg-ratio{margin:1rem 0 0;font-size:.875rem;color:var(--muted);line-height:1.5}

/* Takeaways */
.takeaways{list-style:none;margin:0;padding:0;display:grid;gap:.75rem}
.takeaway-tick{display:flex;gap:.65rem;align-items:flex-start;font-size:.875rem}
.takeaway-icon{width:16px;height:16px;stroke:var(--accent);stroke-width:2.5;fill:none;flex-shrink:0;margin-top:.15rem}
.takeaway-tick strong{display:block;margin-bottom:.1rem}
.takeaway-tick p{margin:0;color:var(--muted);font-size:.82rem;line-height:1.5}

/* Discipline summary */
.disc-summary{display:grid;gap:.6rem}
.disc-row{display:flex;justify-content:space-between;align-items:baseline;gap:.5rem;font-size:.875rem;flex-wrap:wrap}

/* Outcome pills */
.pill{display:inline-flex;align-items:center;padding:.15rem .55rem;border-radius:99px;font-size:.72rem;font-weight:700;letter-spacing:.04em;white-space:nowrap}

/* Responsive tweaks for dashboard rebuild */
@media(max-width:1100px){
  .dash-tiles-4{grid-template-columns:repeat(2,minmax(0,1fr))}
  .dash-row2{grid-template-columns:minmax(0,2fr) minmax(0,1fr);grid-template-rows:auto auto}
  .sym-panel{grid-column:1/-1}
}
@media(max-width:800px){
  .dash-tiles-4{grid-template-columns:repeat(2,minmax(0,1fr))}
  .dash-row2{grid-template-columns:1fr}
  .dash-row3{grid-template-columns:1fr}
}
@media(max-width:500px){
  .dash-tiles-4{grid-template-columns:1fr}
  .dash-tiles-4.cal-tiles{grid-template-columns:repeat(2,minmax(0,1fr));gap:.75rem}
  .cal-tiles .stat-tile{padding:.9rem .8rem .6rem}
  .cal-tiles .st-head{flex-wrap:wrap;gap:.4rem}
  .cal-tiles .st-value{font-size:1.2rem}
  .dash-greeting{flex-direction:column;align-items:stretch}
  .dash-greeting .btn{justify-content:center}
  /* Market and date each get a full row, text on one line; Add trade sits under them. */
  .page-controls{width:100%;flex-direction:column;align-items:stretch}
  .page-controls>*{flex:none;width:100%;min-width:0}
  .page-controls .dr-trigger{width:100%;box-sizing:border-box;justify-content:space-between}
  .page-controls .btn{justify-content:center}
  .dr-trigger{max-width:100%;white-space:nowrap}
  .dr-trigger>span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;text-align:left}
  .cal-controls{flex-wrap:wrap}
  .cal-controls>div{width:100%}
  .cal-controls .dr-trigger{width:100%;box-sizing:border-box;justify-content:space-between}
  .cal-controls .cal-nav{width:100%;justify-content:space-between}
}

/* ── Mistake Tracker page ────────────────────────────────── */
.mkt-header{display:flex;align-items:center;flex-wrap:wrap;gap:1rem;margin-bottom:1.5rem}
.mkt-icon-chip{
  display:inline-flex;align-items:center;justify-content:center;
  width:44px;height:44px;border-radius:12px;flex-shrink:0;
  background:var(--accent-soft);color:var(--accent);
}
.mkt-icon-chip svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
/* An <h2>: the top bar holds the page's one <h1>. Spacing matches the old h1. */

.mkt-tiles{
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));
  gap:1rem;margin-bottom:1.25rem;
}
.mkt-tile{
  background:var(--card);border:1px solid var(--line);border-radius:var(--radius);
  padding:1rem 1.1rem;display:flex;flex-direction:row;align-items:flex-start;gap:.65rem;min-width:0;
}
.mkt-tile-icon{
  flex-shrink:0;width:30px;height:30px;border-radius:7px;
  display:flex;align-items:center;justify-content:center;margin-top:.1rem;
}
.mkt-tile-icon{background:var(--accent-soft)}
.mkt-tile-icon svg{stroke:var(--accent);width:15px;height:15px;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.mkt-tile-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:.1rem}
.mkt-tile-label{font-size:.75rem;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--dim);line-height:1.4;min-height:2.1rem}
.mkt-tile-value{font-size:1.625rem;font-weight:700;line-height:1.15;font-family:var(--display);overflow-wrap:anywhere}
.mkt-tile-body .stat-value{font-size:1.625rem;font-weight:700;line-height:1.15;font-family:var(--display);overflow-wrap:anywhere}
.mkt-tile-sub{font-size:.78rem;color:var(--muted);margin-top:.05rem}
.mkt-tile-sub--dim{font-size:.72rem;opacity:.55;margin-top:.15rem}
.mkt-delta{font-size:.82rem;font-weight:600;display:inline-flex;align-items:center;gap:.2rem;margin-top:.15rem}
.mkt-delta.good{color:var(--profit)}
.mkt-delta.bad{color:var(--loss)}
.mkt-delta svg{width:13px;height:13px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}

.mkt-ph{display:flex;align-items:center;gap:.5rem}
.mkt-ph h2,.mkt-ph h3{margin:0}
.mkt-card .mkt-ph{margin-bottom:.75rem}
.mkt-ph-chip{flex-shrink:0;width:30px;height:30px;border-radius:7px;display:flex;align-items:center;justify-content:center}
.mkt-ph-chip{background:var(--accent-soft)}
.mkt-ph-chip svg{stroke:var(--accent);width:15px;height:15px;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

/* Two independent columns: each stacks its own panels, and every gap is 1rem,
   the same as the gap between the stat tiles and between the two columns. */
.mkt-cols{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);gap:1rem;margin-bottom:1.25rem;align-items:start}
@media(max-width:600px){.mkt-cols{grid-template-columns:minmax(0,1fr)}}  /* two columns overflowed the donut legend by 3px at 600 */
.mkt-col{display:flex;flex-direction:column;gap:1rem;min-width:0}
.mkt-cols .panel{margin-bottom:0}  /* the column gap is the only space between panels */
.mkt-card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:1rem 1.1rem}
.mkt-card h3{font-size:.95rem;font-weight:600}

/* Mistake bars */
.mkt-bars{display:flex;flex-direction:column;gap:.6rem;padding:.25rem 0}
.mkt-bar-row{display:flex;align-items:center;gap:.6rem;font-size:.85rem}
/* The minus of a figure in the display font: set in the body font, where the glyph is full width. */
.money-sign{font-family:var(--sans)}
/* A mistake name is never cut off: it wraps onto a second line. */
.mkt-bar-label{flex:0 0 140px;white-space:normal;overflow-wrap:break-word;line-height:1.3;font-size:.82rem}
.mkt-bar-track{flex:1;height:8px;border-radius:4px;background:var(--line-soft);overflow:hidden}
/* display:block is required: the fill is a span, and an inline span ignores width. */
.mkt-p--recent td.num,.mkt-p--type header .loss{white-space:nowrap}
.mkt-bar-fill{display:block;height:100%;border-radius:4px;transition:width .3s}
.mkt-bar-count{flex:0 0 auto;font-size:.8rem;color:var(--muted);font-variant-numeric:tabular-nums;white-space:nowrap}
.mkt-bar-row--zero .mkt-bar-label,.mkt-bar-row--zero .mkt-bar-count{color:var(--dim);opacity:.55}

/* Asset donut */
.mkt-donut-wrap{display:flex;flex-direction:row;align-items:center;gap:1.2rem;padding:.5rem 0}
.mkt-donut-svg{flex-shrink:0}
.mkt-donut-legend{flex:1;min-width:0;display:flex;flex-direction:column;gap:.4rem}
.mkt-donut-row{display:flex;align-items:center;gap:.5rem;font-size:.82rem}
.mkt-donut-dot{width:9px;height:9px;border-radius:50%;flex-shrink:0}
.mkt-donut-name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500;font-size:.8rem;letter-spacing:.02em}
.mkt-donut-pct{color:var(--muted);font-variant-numeric:tabular-nums;font-size:.78rem;white-space:nowrap}

/* Mistake pill (category color) */
.mkt-pill,.mk-tag{
  --mk:var(--mk-other);
  display:inline-flex;align-items:center;gap:.35rem;padding:.15rem .55rem;border-radius:20px;
  font-size:.72rem;font-weight:600;white-space:nowrap;
  background:color-mix(in srgb,var(--mk) 16%,var(--card));border:1px solid var(--mk);color:var(--text);
}
.mkt-pill::before,.mk-tag::before{content:"";width:.5rem;height:.5rem;border-radius:50%;background:var(--mk);flex-shrink:0}
.mkt-pill{margin:0 .2rem .2rem 0}
/* A long type name wraps inside its pill instead of being cut off on a phone. */
.mkt-pill{white-space:normal;overflow-wrap:anywhere;max-width:100%;border-radius:14px;line-height:1.25;align-items:flex-start}
.mkt-pill::before{margin-top:.28rem}
.mkt-p--recent td:nth-child(3){min-width:9.5rem;max-width:13rem}

/* Recent mistakes table */
.mkt-recent-btn{
  display:inline-flex;align-items:center;justify-content:center;
  padding:.2rem .55rem;font-size:.75rem;border:1px solid var(--line);
  border-radius:6px;color:var(--muted);text-decoration:none;white-space:nowrap;
}
.mkt-recent-btn:hover{border-color:var(--blue);color:var(--blue)}

/* Trends chart */
.mkt-trends-wrap{padding:.25rem 0}
.mkt-trends-canvas{width:100%;height:160px}
.mkt-trends-legend{display:flex;flex-wrap:wrap;gap:.4rem .75rem;padding-top:.75rem}
.mkt-trends-swatch{width:10px;height:10px;border-radius:2px;display:inline-block;flex-shrink:0}
.tip-swatch{width:9px;height:9px;border-radius:2px;display:inline-block;margin-right:.4rem;vertical-align:baseline}

/* Top mistakes list */
.mkt-top-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.4rem}
.mkt-top-item{display:flex;align-items:center;gap:.6rem;font-size:.85rem}
.mkt-rank{
  display:inline-flex;align-items:center;justify-content:center;
  width:20px;height:20px;border-radius:6px;font-size:.72rem;font-weight:700;
  flex-shrink:0;--mk:var(--mk-other);
  background:color-mix(in srgb,var(--mk) 18%,var(--card));border:2px solid var(--mk);color:var(--text);
}
.mkt-top-name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mkt-top-count{color:var(--muted);font-size:.8rem;font-variant-numeric:tabular-nums}

/* Your learning card */
.mkt-learning{font-size:.85rem;color:var(--muted);line-height:1.6}

/* Empty state */
.mkt-empty{display:flex;flex-direction:column;align-items:flex-start;gap:.5rem;padding:2rem 1.5rem}
.mkt-empty h2{margin:0;font-size:1.1rem;font-weight:700}
.mkt-empty p{margin:0;color:var(--muted);max-width:58ch;font-size:.9rem;line-height:1.6}
.mkt-period-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.6rem;min-height:11rem;padding:2rem 1.25rem;text-align:center}
.mkt-period-empty h2{margin:0;font-size:1.05rem;font-weight:700;color:var(--text)}
.mkt-period-empty p{margin:0;font-size:.9rem;color:var(--muted);max-width:44ch}
.mkt-period-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:.6rem;margin-top:.4rem}
.mkt-period-actions .btn{min-height:40px;text-decoration:none}

@media(max-width:1100px){
  .mkt-tiles{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:700px){
  .mkt-bar-label{flex:0 0 100px}
}
@media(max-width:500px){
  .mkt-tiles{grid-template-columns:minmax(0,1fr)}
  .mkt-header{flex-direction:column}
  .mkt-header-controls{flex-direction:column;align-items:stretch;width:100%;min-width:0}
  .mkt-header-controls>div{width:100%;min-width:0}
  .mkt-header-controls .dr-trigger{width:100%;box-sizing:border-box;justify-content:space-between}
  /* One column on phone, in this order: type, asset, recent, top, trends, how to use. */
  .mkt-cols{grid-template-columns:minmax(0,1fr)}
  .mkt-col{display:contents}
  .mkt-p--type{order:1}
  .mkt-p--asset{order:2}
  .mkt-p--recent{order:3}
  .mkt-p--top{order:4}
  .mkt-p--trends{order:5}
  .mkt-p--how{order:6}
}

/* ── Reports page ─────────────────────────────────────────── */
.rpt-header,.page-head{display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap;margin-bottom:1.5rem}
.rpt-header-info,.page-head-info{display:flex;align-items:center;gap:.875rem;flex:1;min-width:0}
.rpt-header-chip,.page-head-chip{width:2.75rem;height:2.75rem;border-radius:.75rem;background:linear-gradient(135deg,var(--accent) 0%,var(--accent-deep) 100%);display:flex;align-items:center;justify-content:center;flex-shrink:0}
.rpt-header-chip svg,.page-head-chip svg{width:1.65rem;height:1.65rem}
.rpt-header-title,.page-head-title{font-size:1.2rem;font-weight:800;font-family:var(--display);color:var(--text);line-height:1.2}
.rpt-header-sub,.page-head-sub{font-size:.78rem;color:var(--muted);margin-top:.2rem}
/* The page heading is an h1: undo the global h1 size and margins so it matches the Reports title exactly,
   and draw the sidebar's line icons in white inside the chip. */
.page-head-title{margin:0;letter-spacing:normal}
.page-head-chip svg{fill:none;stroke:#fff;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.page-head{margin-bottom:1.5rem}
.page-head-back{font-size:.9rem;white-space:nowrap}
/* A filter row that now starts with the heading: heading left, controls right, wrapping cleanly. */
.cal-controls,.page-controls--head{flex-wrap:wrap;row-gap:.6rem}
.cal-controls>.page-head-info,.page-controls--head>.page-head-info,.mkt-header>.page-head-info,.dd-header>.page-head-info{margin-right:auto}
.rpt-header-controls{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;flex-shrink:0}

.rpt-steps{display:flex;align-items:stretch;margin-bottom:1.5rem;gap:.625rem}
.rpt-step{flex:1 1 0;min-width:0;background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:.875rem 1rem;display:flex;flex-direction:row;align-items:center;gap:.875rem;text-decoration:none;color:inherit;transition:border-color .15s,box-shadow .15s}
a.rpt-step:hover{border-color:var(--muted);box-shadow:0 2px 12px -4px color-mix(in srgb,var(--muted) 25%,transparent)}
.rpt-step-icon-wrap{flex-shrink:0;color:var(--accent);display:flex;align-items:center;justify-content:center;width:2.75rem}
.rpt-step-icon-wrap svg{width:2.25rem;height:2.25rem}
.rpt-step-body{display:flex;flex-direction:column;gap:.25rem;min-width:0;flex:1}
.rpt-step-head{display:flex;align-items:center;gap:.4rem}
.rpt-step-badge{width:1.2rem;height:1.2rem;border-radius:50%;background:var(--accent);color:var(--on-accent);font-size:.68rem;font-weight:700;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.rpt-step-title{font-size:.74rem;font-weight:600;color:var(--text);line-height:1.2;overflow-wrap:anywhere}
.rpt-step-sub{font-size:.67rem;color:var(--muted);overflow-wrap:anywhere}
.rpt-step-arrow{display:flex;align-items:center;justify-content:center;color:var(--accent);padding:0 .05rem;flex-shrink:0;align-self:center}
.rpt-step-arrow svg{width:.9rem;height:.9rem}

.rpt-tiles{display:flex;gap:.875rem;flex-wrap:wrap;margin-bottom:1.5rem}
.rpt-tile{flex:1;min-width:9.5rem;background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:.875rem 1rem;display:flex;gap:.875rem;align-items:flex-start}
.rpt-tile-body{min-width:0;flex:1}
.rpt-tile-label{font-size:.74rem;color:var(--muted);white-space:nowrap;font-weight:500}
.rpt-tile-value{font-size:1.1rem;font-weight:700;color:var(--text);line-height:1.25;margin:.15rem 0 0}

@media(max-width:860px){
  .rpt-steps{flex-wrap:wrap}
  .rpt-step{flex:1 1 calc(50% - .625rem)}
  .rpt-step-arrow{display:none}
  .rpt-step-sub{white-space:normal}
}
@media(max-width:500px){
  .rpt-step{flex:1 1 100%}
  .rpt-tiles{gap:.625rem}
  .rpt-tile{min-width:calc(50% - .3125rem);flex:1 1 calc(50% - .3125rem)}
  .rpt-header,.page-head{gap:.75rem}
  /* Same filter rows as the dashboard: each control on its own full-width row. */
  .rpt-header-controls{flex-shrink:1;width:100%;flex-direction:column;align-items:stretch;min-width:0}
  .rpt-header-controls>div{width:100%;min-width:0}
  .rpt-header-controls .dr-trigger{width:100%;box-sizing:border-box;justify-content:space-between}
}

/* ── Four insight panels ─────────────────────────────────────────── */
.rpt-panels{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.875rem;margin-bottom:1.5rem}
.rpt-ip{display:flex;flex-direction:column;gap:.875rem;min-width:0}
/* Body padding + cancel per-.panel margin-bottom (grid gap handles row spacing) */
/* overflow-x:clip: anything wider than the panel (a hidden tooltip, a long name) is cut at the panel's edge
   and can never widen the page. */
.panel.rpt-ip{padding:0 .875rem 1.25rem;margin-bottom:0;overflow-x:clip}
/* Override .panel > header — container provides horizontal padding now */
.panel.rpt-ip > header{justify-content:flex-start;padding-left:0;padding-right:0}
.rpt-ip-header{display:flex;align-items:center;gap:.625rem}
.rpt-ip-header h2{font-size:.875rem;font-weight:700;color:var(--text);margin:0}
.rpt-ip-icon{width:1.9rem;height:1.9rem;border-radius:.45rem;display:flex;align-items:center;justify-content:center;flex-shrink:0;background:var(--accent-soft);color:var(--accent)}
.rpt-ip-icon svg{width:1rem;height:1rem}

/* Donut */
.rpt-donut-wrap{display:flex;align-items:flex-start;gap:1.125rem}
.rpt-donut-pos{position:relative;flex-shrink:0}
.rpt-donut-svg{display:block;width:5.5rem;height:5.5rem}
.rpt-donut-center{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;pointer-events:none;padding:.25rem}
.rpt-donut-lbl{font-size:.9rem;font-weight:700;color:var(--text);line-height:1.2;width:100%;white-space:nowrap}
.rpt-donut-sub{font-size:.68rem;color:var(--muted);margin-top:.1rem}
/* Loss donut: large, thick ring, donut beside legend and centred */
.rpt-donut-wrap--row{align-items:center}
/* Summary box: pinned to the bottom of its panel, so spare height falls between
   the chart and the box, never above the chart. The panel's gap keeps a
   minimum space above it. All three panels use this, so the boxes share a baseline. */
.rpt-ip > .rpt-callout{margin-top:auto}
.rpt-callout-lines{display:flex;flex-direction:column;gap:.2rem;min-width:0}
.rpt-callout > svg{margin-top:.15rem}
/* Shared info tooltip (static/js/tooltip.js). The trigger is a small "i" button;
   the popover is one fixed element, placed by the script. */
.tip-btn{width:1.15rem;height:1.15rem;border-radius:50%;border:1px solid var(--line);background:var(--line-soft);color:var(--muted);font-family:var(--sans);font-size:.7rem;font-weight:700;line-height:1;padding:0;cursor:help;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}
.tip-btn:focus-visible{outline:2px solid var(--blue);outline-offset:2px}
.tip-pop{position:fixed;top:0;left:0;width:260px;max-width:calc(100vw - 16px);box-sizing:border-box;padding:.6rem .75rem;background:var(--card);border:1px solid var(--line);border-radius:.5rem;box-shadow:0 6px 18px -6px rgba(0,0,0,.45);color:var(--text);font-family:var(--sans);font-size:.75rem;font-weight:400;line-height:1.45;text-align:left;white-space:normal;overflow-wrap:break-word;z-index:1000;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .15s}
.tip-pop.is-open{opacity:1;visibility:visible}
.tip-pop .tip-muted{opacity:.7}
.tip-pop .tip-strong{font-weight:700}
.tip-pop .tip-profit{color:var(--profit)}
.tip-pop .tip-loss{color:var(--loss)}
/* Hole is about 108px across at this size; the figure's box is 90px wide,
   so the text stays clear of the ring even at its corners. */
.rpt-donut-wrap--row .rpt-donut-svg{width:9rem;height:9rem}
.rpt-donut-wrap--row .rpt-donut-center{padding:0 1.7rem}
.rpt-donut-wrap--row .rpt-donut-lbl{font-size:1.05rem}
.rpt-donut-wrap--row .rpt-donut-sub{font-size:.72rem}

/* Legend */
.rpt-legend{display:flex;flex-direction:column;gap:.3rem;flex:1;min-width:0}
.rpt-legend-item{display:flex;align-items:center;gap:.45rem;font-size:.8rem}
.rpt-legend-dot{width:.55rem;height:.55rem;border-radius:50%;flex-shrink:0}
.rpt-legend-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted)}
.rpt-legend-pct{font-weight:600;color:var(--text);font-size:.8rem}

/* Weekday heat */
.rpt-heat-rows{display:flex;flex-direction:column;gap:.3rem}
.rpt-heat-row{display:flex;align-items:center;gap:.625rem}
.rpt-heat-day{width:2.5rem;font-size:.82rem;font-weight:500;color:var(--muted);flex-shrink:0}
.rpt-heat-bar-wrap{flex:1;height:.45rem;border-radius:.25rem;background:var(--line);overflow:hidden}
.rpt-heat-bar{height:100%;border-radius:.25rem;transition:width .3s}
.rpt-heat-bar--profit{background:var(--profit)}
.rpt-heat-bar--loss{background:var(--loss)}
.rpt-heat-val{width:5.5rem;text-align:right;font-size:.8rem;font-weight:500}

/* Time-of-day heatmap grid */
.rpt-tg{display:grid;grid-template-columns:2.4rem repeat(4,minmax(0,1fr));gap:3px;align-items:center;min-width:0}
.rpt-tg-corner{/* spacer */}
.rpt-tg-shdr{font-size:.58rem;color:var(--muted);text-align:center;line-height:1.3;padding-bottom:.15rem;word-break:break-word}
.rpt-tg-day{font-size:.72rem;font-weight:600;color:var(--muted)}
.rpt-tg-cell{height:1.6rem;border-radius:.3rem;background:var(--line)}
.rpt-tg-cell--on{cursor:default;position:relative}
.rpt-tg-cell--on::after{content:attr(data-tip);position:absolute;bottom:calc(100% + 5px);left:50%;transform:translateX(-50%);width:max-content;max-width:11rem;background:rgba(6,18,26,.92);color:#e6f3f8;padding:.3rem .5rem;border-radius:.3rem;font-size:.65rem;white-space:normal;z-index:20;pointer-events:none;opacity:0;transition:opacity .15s;border:1px solid rgba(255,255,255,.08)}
.rpt-tg-cell--on:hover::after{opacity:1}
/* The tooltip is always dark, so it uses the dark-theme sign colours in both themes. */
.rpt-tg-cell--profit::after{color:#4ade80}
.rpt-tg-cell--loss::after{color:#ff6b81}
/* Keep tooltip inside the panel on edge cells */
.rpt-tg-cell--on:first-of-type::after,.rpt-tg-cell--on:nth-child(2)::after{left:0;transform:none}
.rpt-tg-cell--on:last-child::after{left:auto;right:0;transform:none}
/* Phone: the hover tooltip is one nowrap line, centred on its cell. Even invisible (opacity 0) it
   still counts as page content, so on the right-hand columns it pushed the page ~31px wider than the
   screen. Let it wrap and anchor it inside the grid: left edge in the first two columns, right edge
   in the last two. Cells sit at children 7-10, 12-15, ... of the grid (the corner, 4 headers, then a
   day label and 4 cells per row). */
.rpt-tg-cell--on:nth-child(5n+2)::after,.rpt-tg-cell--on:nth-child(5n+3)::after{left:0;right:auto;transform:none}
.rpt-tg-cell--on:nth-child(5n+4)::after,.rpt-tg-cell--on:nth-child(5n)::after{left:auto;right:0;transform:none}
.rpt-tg-excl{font-size:.65rem;color:var(--dim);margin:0}
/* A figure with its label and brackets is one unit: it never breaks across a
   line. */
.rpt-unit{white-space:nowrap}
/* Callout box (lightbulb insight) */
.rpt-callout{display:flex;align-items:flex-start;gap:.5rem;background:var(--line-soft);border:1px solid var(--line);border-radius:.45rem;padding:.55rem .7rem;font-size:.78rem;color:var(--muted);line-height:1.45}
.rpt-callout svg{width:.875rem;height:.875rem;flex-shrink:0;color:var(--accent);margin-top:.1rem}

/* Weekday highlight rows */

/* Tablet: two per row */
@media(max-width:900px){
  /* minmax(0,..): a bare 1fr is minmax(auto,1fr) and will not shrink below the panel's content. */
  .rpt-panels{grid-template-columns:repeat(2,minmax(0,1fr))}
  .rpt-ip{min-width:0}
}
/* Phone: one per row — legend drops below donut */
@media(max-width:600px){
  .rpt-panels{grid-template-columns:minmax(0,1fr)}
  .rpt-donut-wrap--row{flex-direction:column;align-items:center}
  .rpt-unit{white-space:normal}  /* "Best: ... (+₹x, n trades)" is wider than the callout at 320px */
}

/* ── By strategy panel ───────────────────────────────────────────── */
.rpt-bs-header{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.875rem 1.1rem .625rem;flex-wrap:wrap}
.rpt-bs-title-wrap{display:flex;align-items:center;gap:.625rem}
.rpt-bs-title{font-size:.9rem;font-weight:700;color:var(--text)}
.rpt-bs-desc{font-size:.72rem;color:var(--muted);margin-top:.1rem}
.rpt-bs-toggle{display:flex;background:var(--line-soft);border-radius:.45rem;padding:3px;gap:2px;flex-shrink:0}
.rpt-bs-tog{font-size:.72rem;font-weight:600;color:var(--muted);background:transparent;border:none;border-radius:.3rem;padding:.28rem .65rem;cursor:pointer;transition:background .15s,color .15s;line-height:1.4}
.rpt-bs-tog--on{background:var(--accent);color:var(--on-accent)}
.rpt-bs-tog:not(.rpt-bs-tog--on):hover{background:var(--hover);color:var(--text)}
.rpt-bs-strat{display:flex;align-items:center;gap:.5rem}
.rpt-bs-ic{width:1.5rem;height:1.5rem;border-radius:.35rem;display:flex;align-items:center;justify-content:center;flex-shrink:0;background:var(--accent-soft);color:var(--accent)}
.rpt-bs-ic svg{width:.8rem;height:.8rem}
.rpt-bs-wr{display:inline-block;padding:.1rem .45rem;border-radius:9999px;font-size:.72rem;font-weight:600;white-space:nowrap}
.rpt-bs-wr--profit,.rpt-bs-wr--loss{background:var(--line-soft);color:var(--text)}   /* a win rate is a percentage: neutral */
.rpt-bs-wr--avg{background:var(--line-soft);color:var(--text)}
.rpt-bs-row{cursor:pointer}
.rpt-bs-ph{min-width:7rem}
.rpt-bs-pc{display:flex;align-items:center;gap:.5rem;min-width:7rem;white-space:nowrap}
.rpt-bs-bar-wrap{flex:1;height:.35rem;background:var(--line);border-radius:.25rem;overflow:hidden;min-width:3rem}
.rpt-bs-bar{height:100%;border-radius:.25rem;width:0;background:var(--accent);transition:width .3s,background .15s}
.rpt-bs-bar--profit{background:var(--profit)}
.rpt-bs-bar--loss{background:var(--loss)}
.rpt-bs-pct{font-size:.78rem;font-weight:600;color:var(--muted);min-width:2.5rem;text-align:right}
.rpt-bs-cv{width:1.25rem;padding-left:.25rem}
.rpt-bs-cv svg{width:.875rem;height:.875rem;color:var(--accent);vertical-align:middle}
@media(max-width:600px){.rpt-bs-ph,.rpt-bs-pc{display:none}}

/* ── Do's & Don'ts page ──────────────────────────────────── */
/* Green and red are kept for do's and don'ts. The cyan accent (--accent)
   is the sidebar's active colour: steps, the selected week, the rules box. */
/* A sidebar label with a badge. The label never wraps: its font size and the
   icon gap stay those of every other item (so it lines up); the badge sits
   closer (.5rem instead of the 1rem item gap) and the item's right padding is
   tighter, so a long label runs nearer the right edge instead of breaking. */
.sidebar nav a:has(.nav-label){padding-right:.35rem}
.nav-label{flex:1;min-width:0;display:flex;align-items:center;gap:.5rem;white-space:nowrap}
/* If the sidebar is ever too narrow for label + badge, the badge gives way. */
@media (min-width:901px){.sidebar nav{container-type:inline-size}}
@container (max-width:214px){.nav-badge{display:none}}
.nav-badge{
  margin-left:auto;flex-shrink:0;padding:.05rem .4rem;border-radius:999px;
  font-size:.62rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;
  color:var(--accent);background:var(--accent-soft);
}
.dd-good-text{color:var(--profit)}
.dd-bad-text{color:var(--loss)}

/* Header */
.dd-header{display:flex;align-items:center;gap:1rem;margin-bottom:1.5rem}
.dd-month-nav{margin-left:auto;display:flex;align-items:center;gap:.5rem;flex-shrink:0}
.dd-month{margin:0 .6rem;font-size:1.05rem;font-weight:700;white-space:nowrap}
.dd-month-btn{
  padding:.4rem .8rem;border:1px solid var(--line);border-radius:8px;background:var(--card);
  color:var(--text);font-size:.85rem;text-decoration:none;white-space:nowrap;
}
.dd-month-btn:hover{border-color:var(--accent)}

/* Step cards */
.dd-steps{list-style:none;margin:0 0 1.25rem;padding:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem}
.dd-steps a{
  height:100%;display:flex;align-items:center;gap:.8rem;padding:.9rem 1.1rem;
  background:var(--card);border:1px solid var(--line);border-radius:12px;
  color:var(--text);text-decoration:none;
}
.dd-steps a:hover{border-color:color-mix(in srgb,var(--accent) 55%,var(--line))}
.dd-steps strong{display:block;font-size:.92rem;font-weight:600}
.dd-steps small{display:block;font-size:.8rem;color:var(--muted)}
.dd-step-n{
  display:inline-grid;place-items:center;width:26px;height:26px;border-radius:50%;flex-shrink:0;
  background:var(--accent);color:var(--on-accent);font-size:.78rem;font-weight:700;
}

/* Week tabs */
.dd-weeks{display:flex;flex-wrap:wrap;gap:.5rem;margin-bottom:1rem}
.dd-week-tab{
  padding:.4rem .9rem;border:1px solid var(--line);border-radius:8px;background:var(--card);
  color:var(--muted);font-size:.88rem;text-decoration:none;white-space:nowrap;
}
.dd-week-tab:hover{color:var(--text);border-color:color-mix(in srgb,var(--accent) 55%,var(--line))}
.dd-week-tab.active{
  color:var(--text);font-weight:600;border-color:var(--accent);
  background:color-mix(in srgb,var(--accent) 12%,var(--card));
}
.dd-week-dates{margin-left:.3rem;font-size:.75rem;font-weight:400;color:var(--muted)}
.dd-week-tab.active .dd-week-dates{color:var(--accent)}

/* Step 1 · day cards */
.dd-section{margin-bottom:1.5rem;scroll-margin-top:1rem}
.dd-eyebrow{
  margin:0 0 .65rem;font-family:var(--sans);font-size:.75rem;font-weight:600;
  letter-spacing:.12em;text-transform:uppercase;color:var(--muted);
}
.dd-days{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:1rem}
.dd-day{
  background:var(--card);border:1px solid var(--line);border-radius:12px;
  padding:1rem .95rem 1.1rem;display:flex;flex-direction:column;gap:.75rem;min-width:0;
}
.dd-day--today{border-color:var(--accent);box-shadow:0 0 0 1px color-mix(in srgb,var(--accent) 35%,transparent)}
.dd-day--future{opacity:.55}
.dd-day-head{display:flex;justify-content:space-between;align-items:baseline;gap:.5rem}
.dd-day-name{font-weight:700;font-size:1rem}
.dd-day-meta{font-size:.75rem;color:var(--muted);white-space:nowrap}
.dd-group{display:flex;flex-direction:column;gap:.45rem}
.dd-group--donts{padding-top:.75rem;border-top:1px solid var(--line-soft)}
.dd-group-label{
  display:flex;align-items:center;gap:.3rem;
  font-size:.72rem;font-weight:700;letter-spacing:.1em;text-transform:uppercase;
}
.dd-group-label svg{color:var(--accent);width:12px;height:12px;fill:none;stroke:currentColor;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}

/* A do or don't: one full-width row */
.dd-rows{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.45rem}
.dd-row{
  display:flex;align-items:center;gap:.4rem;min-height:2.1rem;padding:.35rem .4rem .35rem .7rem;
  border:1px solid;border-radius:7px;font-size:.84rem;line-height:1.3;color:var(--text);
}
.dd-row--do{background:color-mix(in srgb,var(--profit) 12%,var(--card));border-color:color-mix(in srgb,var(--profit) 40%,transparent)}
.dd-row--dont{background:color-mix(in srgb,var(--loss) 12%,var(--card));border-color:color-mix(in srgb,var(--loss) 40%,transparent)}
.dd-row--lg{min-height:2.6rem;padding:.5rem .9rem;font-size:.92rem}
.dd-row-text{flex:1;min-width:0;overflow-wrap:anywhere}
.dd-row form{display:contents}
.dd-row-x{
  display:inline-grid;place-items:center;width:20px;height:20px;padding:0;flex-shrink:0;
  border:0;border-radius:5px;background:transparent;color:var(--muted);font-size:1rem;line-height:1;cursor:pointer;
  opacity:0;transition:opacity .12s;
}
.dd-row:hover .dd-row-x,.dd-row-x:focus-visible{opacity:1}
.dd-row-x:hover{color:var(--text);background:color-mix(in srgb,var(--text) 10%,transparent)}
@media (hover:none){.dd-row-x{opacity:1}}
.dd-count{font-weight:700;font-variant-numeric:tabular-nums;white-space:nowrap}
.dd-row--do .dd-count{color:var(--profit)}
.dd-row--dont .dd-count{color:var(--loss)}
.dd-add{
  width:100%;min-height:2.1rem;padding:.35rem .7rem;text-align:left;
  border:1px dashed var(--line);border-radius:7px;background:transparent;
  color:var(--dim);font:inherit;font-size:.84rem;cursor:pointer;
}
.dd-add:hover{border-color:var(--accent);color:var(--accent)}

/* Steps 2 and 3: two panels side by side */
.dd-bottom{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);gap:1.25rem;align-items:start;margin-bottom:1.5rem}
.dd-panel{background:var(--card);border:1px solid var(--line);border-radius:12px;scroll-margin-top:1rem;min-width:0}
.dd-panel-head{display:flex;align-items:center;gap:.85rem;padding:1.1rem 1.4rem;border-bottom:1px solid var(--line-soft)}
.dd-panel-head h2{margin:0;font-size:1.1rem;font-weight:700}
.dd-panel-head p{margin:.1rem 0 0;font-size:.84rem;color:var(--muted)}
.dd-panel-ico{display:inline-grid;place-items:center;width:38px;height:38px;border-radius:9px;flex-shrink:0}
.dd-panel-ico svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.dd-panel-ico--week{background:color-mix(in srgb,var(--accent) 15%,transparent);color:var(--accent)}
.dd-panel-ico--focus{background:color-mix(in srgb,var(--accent) 15%,transparent);color:var(--accent)}
.dd-panel-body{padding:1.25rem 1.4rem 1.4rem}

.dd-review{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1.25rem}
.dd-review .dd-group-label{margin-bottom:.55rem}
.dd-empty{margin:0;font-size:.85rem;color:var(--muted)}
.dd-once{margin:.85rem 0 0;font-size:.85rem;color:var(--muted);max-width:none;text-align:right}
.dd-note-form{margin-top:1.25rem}
.dd-note{border:1px solid var(--line);border-radius:10px;background:var(--ink2);padding:.8rem 1rem}
.dd-note:focus-within{border-color:var(--accent)}
.dd-note-label{display:block;margin-bottom:.3rem;font-size:.72rem;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:var(--muted)}
.dd-note textarea{
  display:block;width:100%;padding:0;border:0;background:transparent;resize:vertical;min-height:3rem;
  color:var(--text);font:inherit;font-size:.92rem;line-height:1.55;
}
.dd-actions{display:flex;align-items:center;flex-wrap:wrap;gap:.75rem;margin-top:1.1rem}
.dd-actions .btn[hidden]{display:none}
.dd-status{font-size:.8rem;color:var(--muted)}

.dd-week-tops{list-style:none;margin:0 0 1.1rem;padding:0;display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:.6rem}
.dd-week-top{
  display:flex;flex-direction:column;gap:.2rem;padding:.75rem .8rem;
  border:1px solid var(--line);border-radius:9px;background:var(--ink2);min-width:0;
}
.dd-week-top-label{font-size:.72rem;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--muted)}
.dd-week-top-name{font-size:.86rem;line-height:1.35;overflow-wrap:anywhere}
.dd-week-top-none{font-size:.84rem;line-height:1.35;color:var(--dim)}

.dd-rules{
  border:1px solid color-mix(in srgb,var(--accent) 55%,var(--line));border-radius:12px;padding:1.1rem 1.2rem .4rem;
  background:linear-gradient(160deg,color-mix(in srgb,var(--accent) 12%,var(--card)),var(--card) 75%);
}
.dd-rules-head{display:flex;justify-content:space-between;align-items:baseline;gap:.75rem;flex-wrap:wrap}
.dd-rules-head h3{margin:0;font-size:1.05rem;font-weight:700}
.dd-rules-tag{font-size:.7rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--accent)}
.dd-rules-sub{margin:.25rem 0 .75rem;font-size:.85rem;color:var(--muted);max-width:none}
.dd-rule-list{list-style:none;margin:0;padding:0}
.dd-rule{display:flex;align-items:center;gap:.75rem;padding:.7rem 0;border-top:1px solid color-mix(in srgb,var(--accent) 18%,var(--line-soft))}
.dd-rule-n{
  display:inline-grid;place-items:center;width:26px;height:26px;flex-shrink:0;border-radius:7px;
  background:var(--accent);color:var(--on-accent);font-size:.82rem;font-weight:700;
}
.dd-rule input{
  flex:1;min-width:0;padding:.25rem .4rem;margin-left:-.4rem;
  border:1px solid transparent;border-radius:6px;background:transparent;
  color:var(--text);font:inherit;font-size:.95rem;font-weight:700;
}
.dd-rule input:hover{border-color:var(--line)}
.dd-rule input:focus{outline:none;border-color:var(--accent);background:var(--ink2)}
.dd-rule-meta{flex-shrink:0;font-size:.78rem;color:var(--muted);white-space:nowrap}

.dd-footer{margin:1.1rem 0 0;font-size:.8rem;color:var(--dim);max-width:none}

/* Picker dialog */
.dd-picker{width:min(460px,100% - 2rem)}
.dd-picker .modal-body{display:flex;flex-direction:column;gap:.6rem}
.dd-picker-search{
  width:100%;font:inherit;font-size:.9rem;color:var(--text);background:var(--ink2);
  border:1px solid var(--line);border-radius:8px;padding:.55rem .7rem;
}
.dd-picker-list{list-style:none;margin:0;padding:0;max-height:300px;overflow:auto;display:flex;flex-direction:column;gap:.15rem}
.dd-picker-opt{
  width:100%;text-align:left;padding:.5rem .65rem;border:1px solid transparent;border-radius:8px;
  background:transparent;color:var(--text);font:inherit;font-size:.88rem;cursor:pointer;
}
.dd-picker-opt:hover,.dd-picker-opt:focus-visible{background:var(--hover);border-color:var(--line)}
.dd-picker-opt--new.is-do{color:var(--profit)}
.dd-picker-opt--new.is-dont{color:var(--loss)}
/* A typed suggestion: the choice button and its own remove button side by side. */
.dd-picker-row{display:flex;align-items:center;gap:.15rem}
.dd-picker-row .dd-picker-opt{flex:1;min-width:0;text-align:left}
.dd-picker-del{flex:0 0 auto;width:32px;height:32px;display:inline-flex;align-items:center;justify-content:center;
  background:none;border:1px solid transparent;border-radius:6px;color:var(--muted);font:inherit;font-size:.85rem;
  line-height:1;cursor:pointer;padding:0}
.dd-picker-del:hover,.dd-picker-del:focus-visible{color:var(--loss);border-color:var(--loss);background:var(--hover)}
.dd-picker-del:focus-visible{outline:2px solid var(--loss);outline-offset:1px}
@media (max-width:700px){.dd-picker-del{width:40px;height:40px}}
.dd-removed{font-size:.8rem;margin:0;color:var(--muted)}
.dd-removed:empty{display:none}
.dd-undo{background:none;border:0;padding:.1rem .25rem;font:inherit;font-weight:600;color:var(--accent);text-decoration:underline;cursor:pointer;border-radius:4px}
.dd-picker-hint{font-size:.8rem;margin:0}
.dd-picker-hint:empty{display:none}

@media(max-width:1280px){
  .dd-bottom{grid-template-columns:minmax(0,1fr)}
}
@media(max-width:1100px){
  .dd-days{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:800px){
  .dd-steps{grid-template-columns:minmax(0,1fr)}
  .dd-header{flex-wrap:wrap}
  .dd-month-nav{margin-left:0;width:100%;justify-content:space-between}
}
@media(max-width:640px){
  /* Phone: one day per row, and the review columns stack. */
  .dd-days,.dd-review{grid-template-columns:minmax(0,1fr)}
  .dd-week-tops{grid-template-columns:repeat(2,minmax(0,1fr))}
  .dd-panel-head,.dd-panel-body{padding-left:1rem;padding-right:1rem}
  .dd-once{text-align:left}
  .dd-rule{flex-wrap:wrap}
  .dd-rule-meta{width:100%;padding-left:calc(26px + .75rem)}
}

/* ── Error pages: 404.html, 500.html, 403_csrf.html (_error_base.html) ── */
.err-page{min-height:100vh;display:grid;place-items:center;padding:2rem 1rem;background:var(--ink)}
.err-card{
  width:min(440px,100%);padding:2.25rem 2rem 2rem;text-align:center;
  background:var(--card);border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow);
}
.err-brand{justify-content:center;margin-bottom:1.75rem;text-decoration:none}
.err-title{font-size:1.5rem;margin:0 0 .5rem}
.err-text{margin:0 auto 1.5rem;color:var(--muted);font-size:.95rem}
.err-actions{display:flex;justify-content:center}

/* Collapsed "Advanced" block on the crypto / gold form */
details.advanced{margin-top:1rem}
details.advanced>summary{cursor:pointer;color:var(--muted);font-size:.9rem;padding:.25rem 0}
details.advanced[open]>summary{margin-bottom:.75rem}

/* Chart screenshots: thumbnails on the form and the detail page */
.chart-thumbs{list-style:none;margin:.75rem 0 0;padding:0;display:flex;flex-wrap:wrap;gap:.75rem}
.chart-thumbs li{display:flex;flex-direction:column;gap:.35rem;align-items:flex-start}
.chart-thumbs img{width:160px;height:110px;object-fit:cover;border:1px solid var(--line);border-radius:4px;display:block}
.chart-thumb{padding:0;border:0;background:none;cursor:zoom-in}
/* Chart screenshots on the trade form: one row per file, name and an X on the right.
   Neutral colours; red only when hovering the remove button. */
.chart-msg{margin:.4rem 0 0;padding:.4rem .6rem;border:1px solid var(--line);border-radius:4px;background:var(--card2);color:var(--text);font-size:.82rem}
.chart-msg span{display:block}
.chart-list{list-style:none;margin:.5rem 0 0;padding:0;display:flex;flex-direction:column;gap:.4rem}
.chart-list[hidden]{display:none}
.chart-row{display:flex;align-items:center;gap:.6rem;min-width:0;padding:.35rem .4rem .35rem .35rem;border:1px solid var(--line);border-radius:4px;background:var(--card2)}
.chart-row-thumb{flex:none;width:44px;height:44px;object-fit:cover;border-radius:3px;border:1px solid var(--line);display:block}
.chart-row-name{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.88rem;color:var(--text)}
.chart-remove{flex:none;display:inline-flex;align-items:center;justify-content:center;min-width:36px;height:36px;padding:0 .5rem;border:1px solid var(--field-line);border-radius:4px;background:transparent;color:var(--muted);font:inherit;font-size:.82rem;cursor:pointer}
.chart-remove svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}
.chart-remove:hover{color:var(--loss);border-color:var(--loss)}
.chart-remove:focus-visible{outline:2px solid var(--muted);outline-offset:2px}
.chart-undo:hover{color:var(--text);border-color:var(--muted)}
.chart-row.is-removed .chart-row-thumb{opacity:.35}
.chart-row.is-removed .chart-row-name{color:var(--dim);text-decoration:line-through}
.chart-dialog{max-width:min(92vw,1200px);border:1px solid var(--line);background:var(--card);padding:.75rem}
.chart-dialog img{max-width:100%;max-height:80vh;display:block;margin-top:.5rem}
.chart-dialog::backdrop{background:rgba(0,0,0,.7)}
