/* Phase two: product presentation. The journal's routes and controls remain intact. */
body:has(#app), body:has(.card-auth) {
  --bg: #0c0c0d;
  --bg-2: #101011;
  --panel: #131314;
  --panel-2: #19191a;
  --panel-3: #202021;
  --border: #363535;
  --border-soft: #292829;
  --text: #f1f0ef;
  --text-2: #c0bcb7;
  --text-3: #93908b;
  --brand: #ef4338;
  --brand-2: #fa6456;
  --brand-dim: #ad3029;
  --brand-glow: rgba(239, 67, 56, .12);
  --green: #6ccb9b;
  --green-soft: #326348;
  --red: #f48276;
  --red-soft: #713d38;
  --gold: #d8b474;
  --radius: 14px;
  --radius-sm: 8px;
  --sidebar-w: 248px;
  --topbar-h: 76px;
  --font: var(--font-sans, 'Geist', sans-serif);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  color-scheme: dark;
}
body:has(#app) { line-height: 1.55; }
body:has(#app) *, body:has(.card-auth) * { scrollbar-color: #474441 transparent; scrollbar-width: thin; }
#app { height: 100dvh; isolation: isolate; }
#app .main { background: var(--bg); }
#app .view {
  padding: 34px clamp(22px, 2.7vw, 46px) 72px;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}
#app .view > * { max-width: 1480px; margin-left: auto; margin-right: auto; }
#app .view > .grid, #app .view > .stack { gap: 20px !important; }
#app .grid > *, #app .row > *, #app .stack > * { min-width: 0; }
#app .grid { gap: 18px; }
#app .stack { gap: 18px; }
body:has(#app) .starfield { opacity: .13; }
body:has(#app) .starfield::after { opacity: 0; }
#app .page-title {
  font-size: clamp(29px, 2.45vw, 38px);
  font-weight: 560;
  letter-spacing: -.055em;
  line-height: 1.13;
  margin-bottom: 9px;
  text-wrap: balance;
}
#app .page-sub { font-size: 13px; line-height: 1.65; margin-bottom: 28px; text-wrap: pretty; }
#app .section-title { font-size: 16px; font-weight: 570; line-height: 1.4; letter-spacing: -.025em; }
#app .breadcrumb { gap: 10px; margin-top: 12px; margin-bottom: 28px; font-size: 11px; }
#app .breadcrumb b { font-weight: 450; }
#app .breadcrumb .sep { opacity: .36; }
#app .muted { color: var(--text-3); }
#app .pos { color: var(--green); }
#app .neg { color: var(--red); }
#app .kpi-value, #app .stat-lg, #app .result-value, #app .field-value,
#app .table td, #app .ticket-meta, #app .lesson-dur {
  font-variant-numeric: tabular-nums;
}
#app .kpi-value, #app .stat-lg, #app .result-value, #app .field-value {
  font-family: var(--font-mono, 'Geist Mono', monospace);
  letter-spacing: -.05em;
  font-weight: 450;
}

/* A quiet navigation rail, with a single unmistakable active state. */
#app .sidebar { background: #101011; border-right-color: var(--border-soft); }
#app .sidebar-head { padding: 28px 26px 22px; }
#app .logo { min-height: 32px; }
#app .brand-lockup { gap: 11px; }
#app .brand-word { font-size: 16px; font-weight: 600; letter-spacing: -.03em; }
#app .logo svg { width: 31px; height: 31px; }
#app .logo svg g { filter: none; }
#app .nav { padding: 0 13px 24px; }
#app .nav-section { margin-top: 27px; padding: 0 13px 9px; }
#app .nav-section-label {
  font-family: var(--font-mono, monospace);
  font-size: 9px; font-weight: 450; letter-spacing: .115em;
  color: #817e7b;
}
#app .nav-item {
  min-height: 40px; gap: 11px; padding: 9px 12px; margin: 2px 0;
  border-radius: 8px; font-size: 12.5px; line-height: 1.45; font-weight: 450;
  color: #c0bbb6;
  transition: color .16s ease, background .16s ease;
}
#app .nav-item:hover { color: var(--text); background: #1c1c1d; }
#app .nav-item.active { background: #2a1c1b; color: #fff4f0; font-weight: 550; }
#app .nav-item.active::after {
  content: ''; width: 4px; height: 4px; border-radius: 50%;
  background: var(--brand); position: absolute; right: 12px;
}
#app .nav-ic { width: 17px; height: 17px; flex-basis: 17px; color: #898682; }
#app .nav-ic svg { stroke-width: 1.6; }
#app .nav-item.active .nav-ic { color: var(--brand-2); }
#app .nav-item.soon { opacity: .7; color: #8d8884; }
#app .nav-item.soon:hover { background: transparent; }
#app .soon-tag { font-size: 7.5px; letter-spacing: .03em; border-radius: 4px; padding: 2px 4px; color: #a6a09a; }
#app .sidebar-user { padding: 18px 23px; gap: 11px; background: #101011; }
#app .sidebar-user-meta { min-width: 0; }
#app .sidebar-user .name { font-size: 12px; font-weight: 550; }
#app .sidebar-user .email { font-size: 10px; color: #a49e97; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
#app .avatar { border-radius: 9px; width: 33px; height: 33px; filter: saturate(.15); }

/* Account context stays visible without competing with the content. */
#app .topbar { padding: 0 clamp(22px, 2.7vw, 46px); gap: 17px; background: #101011; border-bottom-color: var(--border-soft); }
#app .account { gap: 9px; min-width: 0; }
#app .account-badge { width: 26px; height: 26px; border-radius: 6px; background: #36312e; color: #d8d6d3; font-size: 8px; font-family: var(--font-mono, monospace); }
#app .account .acct-select { font-weight: 500; max-width: 225px; padding-right: 3px; }
#app .pill { background: #232222; color: #bbb8b4; border: 1px solid #363332; border-radius: 4px; padding: 3px 5px; font-family: var(--font-mono, monospace); font-size: 8px; font-weight: 400; }
#app .synced { font-size: 10px; }
#app .synced .dot { width: 5px; height: 5px; box-shadow: none; }
#app .topbar-right { gap: 12px; }
#app .acct-select { font-size: 12px; padding: 7px 3px; border-radius: 5px; }
#app #langSel { max-width: 85px !important; color: var(--text-3); font-size: 11px; }
#app #periodSel { border: 1px solid var(--border); border-radius: 7px; padding: 8px 9px; background: #181819; color: var(--text-2); max-width: 145px; }
#app .profile-btn { padding: 3px; border-radius: 8px; gap: 6px; }
#app .profile-menu { min-width: 236px; padding: 7px; border-color: #3a3735; border-radius: 10px; background: #1a1919; box-shadow: 0 18px 48px #09090999; }
#app .profile-head { padding: 12px 12px 14px; }
#app .profile-item { min-height: 40px; padding: 10px 12px; border-radius: 6px; font-size: 12px; }

/* Data panels keep clear spacing, fine rules, and neutral chart surfaces. */
#app .card, #app .skel-card {
  background: var(--panel); border: 1px solid var(--border-soft); border-radius: 14px;
  padding: 24px; box-shadow: inset 0 1px 0 #ffffff02;
}
#app .card.pad-lg { padding: 28px; }
#app .card:has(> .table), #app .card:has(> div > .table) { overflow-x: auto; }
#app .kpi { padding: 23px 23px 25px; }
#app .kpi .kpi-label { color: #a8a19b; font-size: 11px; font-weight: 430; line-height: 1.5; margin-bottom: 18px; }
#app .kpi-label svg { height: 14px; width: 14px; stroke-width: 1.55; color: #847e78; }
#app .kpi .kpi-value { font-size: clamp(23px, 1.95vw, 33px); line-height: 1.15; }
#app .kpi .kpi-tags { margin-top: 15px; font-size: 10px; gap: 12px; }
#app .info-i { border-color: #5a534e; color: #8d857d; width: 11px; height: 11px; font-size: 7px; }
#app .stat-lg { font-size: 39px; line-height: 1.2; }
#app .result-value { font-size: clamp(24px, 2.1vw, 34px); line-height: 1.3; }
#app .result-label { font-size: 11px; color: #a7a19c; margin-bottom: 14px; }
#app .table { width: 100%; font-size: 12px; }
#app .table th { padding: 14px 15px; border-bottom-color: #383430; font-size: 10px; font-weight: 450; color: #a09b95; white-space: nowrap; }
#app .table td { padding: 16px 15px; border-bottom-color: #242222; color: #cccac7; font-weight: 400; }
#app .table td b { font-weight: 520; }
#app .table td.pos { color: var(--green); }
#app .table td.neg { color: var(--red); }
#app .table td.muted { color: #99928c; }
#app .table tr:hover td { background: #ffffff03; }
#app .table td:first-child { white-space: nowrap; }
#app .table th:first-child, #app .table td:first-child { padding-left: 4px; }
#app .card[style*="padding:0"] > .table th:first-child,
#app .card[style*="padding:0"] > .table td:first-child { padding-left: 24px; }
#app .card[style*="padding:0"] > .table th:last-child,
#app .card[style*="padding:0"] > .table td:last-child { padding-right: 24px; }
#app .chart-host { margin-top: 15px; }
#app svg text { font-family: var(--font-mono, monospace); fill: #97918a; font-size: 9px; font-weight: 400; }
#app svg .grid-line { stroke: #242222; stroke-dasharray: 3 5; }
#app .bar { height: 5px; background: #2c2926; border-radius: 3px; }
#app .bar > span { border-radius: 3px; }

/* A single photographic lead, with the secondary feature held to the same frame. */
#app #view > .grid:has(> .hero-video) { grid-template-columns: 1.68fr 1fr !important; align-items: stretch; }
#app .promo { height: clamp(246px, 22vw, 322px); min-height: 0; border-radius: 14px; border-color: #3b302d; padding: 0; }
#app .hero-copy { padding: 30px 34px; justify-content: flex-end; }
#app .hero-video .hero-bg { object-position: 60% 45%; filter: saturate(.78); }
#app .hero-shade { background: linear-gradient(180deg, #09090908 0%, #0b090951 30%, #0b0909ec 100%), linear-gradient(90deg,#0b0909a8, transparent 80%); }
#app .hero-copy h3 { font-size: clamp(25px, 2.55vw, 39px); line-height: 1.04; font-weight: 530; letter-spacing: -.045em; margin-bottom: 12px; text-wrap: balance; }
#app .hero-copy p { max-width: 360px; font-size: 11px; line-height: 1.6; color: #cdcac8; }
#app #featPromo { display: block; border-color: var(--border-soft); background: var(--panel) !important; }
#app #featPromo .feat-img { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; filter: saturate(.7) brightness(.82); }
#app #featPromo .feat-cap { position: absolute; bottom: 0; left: 0; width: 100%; border: 0; padding: 60px 25px 25px; background: linear-gradient(transparent, #0c0b0bea 72%); }
#app #featPromo .feat-label { color: #f7897a; font-family: var(--font-mono, monospace); font-size: 8px; font-weight: 400; letter-spacing: .13em; margin-bottom: 9px; }
#app #featPromo .feat-title { font-size: 22px; font-weight: 520; letter-spacing: -.045em; line-height: 1.15; white-space: normal; text-wrap: balance; }

/* Controls feel consistent in calculators, account settings, and operations. */
#app .btn, #app .icon-btn {
  min-height: 38px; border-radius: 8px; background: #22201f; border-color: #3a3532;
  color: #e0dedc; font-size: 11.5px; font-weight: 500; line-height: 1.35;
  transition: background .17s ease, border-color .17s ease, color .17s ease, transform .17s ease;
}
#app .btn { padding: 10px 15px; justify-content: center; }
#app .btn:hover, #app .icon-btn:hover { background: #2b2826; border-color: #524e4a; color: #fff6ed; }
#app .btn:active, #app .icon-btn:active { transform: translateY(1px); }
#app .btn.primary, #app .btn.blue { background: var(--brand); color: #fff; border-color: var(--brand); box-shadow: none; }
#app .btn.primary:hover, #app .btn.blue:hover { background: #f75849; border-color: #f75849; }
#app .btn.ghost { background: transparent; }
#app .icon-btn { width: 33px; height: 33px; min-height: 33px; flex-shrink: 0; }
#app .btn svg { width: 14px; height: 14px; stroke-width: 1.65; }
#app button:disabled { opacity: .55; cursor: wait; transform: none; }
#app .inp, #app .journal-box {
  font-family: var(--font); border-radius: 8px; background: #101011; border-color: #363331;
  font-size: 12.5px; color: var(--text); padding: 12px 13px;
  transition: border-color .16s ease, box-shadow .16s ease;
}
#app .inp { min-height: 43px; }
#app .inp::placeholder, #app .journal-box::placeholder { color: #80786f; }
#app .inp:focus, #app .journal-box:focus { border-color: #ad695c; box-shadow: 0 0 0 3px #ef433815; }
#app .lbl, #app .lbl2 { color: #b2ada9; font-size: 11px; margin-bottom: 8px; font-weight: 450; }
#app .journal-box { line-height: 1.8; padding: 20px; margin-top: 20px; min-height: 248px; }
#app input[type=file].inp { padding: 8px; }
#app input[type=file]::file-selector-button { background: #292625; color: #d5d2d0; border: 0; border-radius: 5px; padding: 7px 10px; margin-right: 10px; font-family: inherit; }
#app .toggle-group { background: #0e0e0f; border: 1px solid #353230; border-radius: 7px; padding: 3px; gap: 2px; }
#app .toggle-group button { color: #a29c97; font-size: 11px; border-radius: 5px; min-height: 33px; padding: 7px 13px; }
#app .toggle-group button:hover { color: var(--text); }
#app .toggle-group button.active { background: #2c2928; color: #ffc5b9; box-shadow: none; }
#app .field { margin-bottom: 28px; }
#app .field-top { margin-bottom: 16px; gap: 10px; }
#app .field-label { font-size: 12px; color: #b5b0ac; }
#app .field-value { color: #f68474; font-size: 12px; letter-spacing: -.03em; }
#app .field-hint { line-height: 1.6; font-size: 10px; }
#app input[type=range] { background: #35322f; height: 3px; accent-color: var(--brand); }
#app input[type=range]::-webkit-slider-thumb { width: 16px; height: 16px; background: #efdad0; box-shadow: 0 0 0 4px #ef433817; }
#app input[type=range]::-moz-range-thumb { width: 16px; height: 16px; background: #efdad0; border: 0; border-radius: 50%; }
#app .tabs { gap: 25px; border-bottom-color: #373331; overflow-x: auto; }
#app .tab { font-size: 12px; padding: 13px 0; white-space: nowrap; color: #9c9690; }
#app .tab.active { color: #f0e1d4; border-bottom-color: var(--brand); }
#app .chip { font-size: 9px; font-weight: 500; padding: 4px 7px; border-radius: 5px; line-height: 1.45; }
#app .chip.gray { background: #282524; color: #b7b2ae; }
#app .chip.beginner { background: #6ccb9b16; color: var(--green); }
#app .chip.intermediate { background: #d8b47418; color: var(--gold); }
#app .chip.advanced { background: #f4827618; color: var(--red); }
#app .err-inline, #app .auth-err { border-color: #865044; background: #3a2220; color: #ffbbb0; border-radius: 8px; padding: 13px 15px; }
#app .ok-box { border-color: #365b43; background: #17271c; color: #a4dbb6; border-radius: 8px; }

/* Daily discipline, support threads, and Academy modules. */
#app .check-row { padding: 14px 0; gap: 13px; border-bottom: 1px solid #252220; }
#app .check-row:last-child { border-bottom: 0; }
#app .check-box { width: 19px; height: 19px; margin-top: 2px; border-radius: 5px; background: #ad5141; }
#app .check-row .ck-title { font-size: 12px; line-height: 1.55; }
#app .check-row .ck-sub { margin-top: 3px; font-size: 10px; }
#app .heat { gap: 3px; grid-auto-columns: minmax(9px, 1fr); overflow: auto; padding: 5px 0 12px; }
#app .heat i { width: 100%; height: auto; aspect-ratio: 1; min-width: 9px; border-radius: 2px; }
#app .day-row { transition: border-color .16s, background .16s; }
#app .day-row:hover { border-color: #4e4946; background: #1b1a19; }
#app .module { margin-top: 34px; margin-bottom: 35px; }
#app .module-head { margin-bottom: 19px; padding-bottom: 13px; border-bottom: 1px solid #35322f; gap: 12px; }
#app .module-head .section-title { font-size: 16px; }
#app .lesson-rail { gap: 19px; padding-bottom: 17px; scroll-padding: 1px; }
#app .lesson-card { flex-basis: 236px; border-radius: 9px; padding: 1px; }
#app .lesson-thumb { border-radius: 8px; border-color: #363331; background: #201e1c; }
#app .lesson-thumb img { filter: saturate(.7); transition: filter .2s, transform .3s; }
#app .lesson-card:hover .lesson-thumb { border-color: #b4644c; transform: none; }
#app .lesson-card:hover .lesson-thumb img { filter: saturate(1); transform: scale(1.025); }
#app .lesson-thumb-fallback { background: radial-gradient(ellipse at 80% 100%,#7a392b77,transparent 70%), repeating-linear-gradient(-45deg,transparent 0 13px,#ffffff04 13px 14px),#211e1d; }
#app .lesson-card-title { color: #d2cfcd; font-size: 12px; line-height: 1.55; font-weight: 470; margin: 11px 0 0; }
#app .lesson-dur { background: #141211de; border-radius: 4px; font-family: var(--font-mono, monospace); padding: 3px 5px; font-size: 9px; }
#app .lesson-done { left: 8px; top: 8px; border-radius: 5px; background: #3e664b; }
#app .modal { background: #070707c9; backdrop-filter: blur(12px); padding: 28px; }
#app .modal-card { max-width: 980px; background: #161413; border-color: #403d3a; border-radius: 14px; padding: 24px; box-shadow: 0 30px 100px #070707aa; max-height: calc(100dvh - 56px); overflow-y: auto; }
#app .lesson-shell, #app .lesson-video { border-radius: 8px; }
#app .ticket-row { padding: 19px 23px; gap: 15px; }
#app .ticket-subj { font-size: 13px; font-weight: 510; }
#app .ticket-meta { font-size: 10px; margin-top: 5px; line-height: 1.6; }
#app .msg { padding: 20px 0; }
#app .msg-head { margin-bottom: 9px; font-size: 11px; }
#app .msg-body { font-size: 13px; line-height: 1.85; overflow-wrap: anywhere; }
#app .msg.staff { margin-left: -12px; padding-left: 12px; border-left-width: 2px; }
#app .empty { min-height: 180px; font-size: 12px; line-height: 1.7; color: #9b9690; gap: 13px; }
#app .empty .em-ic, #app .em-ic { color: #a29c98; opacity: .6; width: 38px; height: 38px; }
#app .loading { font-family: var(--font-mono,monospace); font-size: 9px; font-weight: 400; color: #9a948e; }
#app .skel { background: #242221; border-radius: 5px; }
#app .loader-mark svg { filter: none; }
body:has(#app) .progress-bar { height: 2px; }
body:has(#app) .progress-bar > span { background: var(--brand); box-shadow: none; }
body:has(#app) .progress-bar > span::after { opacity: .35; }

/* Keyboard focus is visible on every interaction, including div-based source controls. */
#app :is(button, a, select, input, textarea, [tabindex]):focus-visible {
  outline: 2px solid #f89880; outline-offset: 4px;
}
#app .profile-item:focus-visible { outline: 2px solid #f89880; }
.product-skip-link { position: fixed; z-index: 250; left: 15px; top: 12px; transform: translateY(-150%); padding: 10px 16px; border-radius: 7px; background: #f0dfd1; color: #1d1b1a; font: 500 12px var(--font-sans,sans-serif); }
.product-skip-link:focus { transform: translateY(0); }

@media (min-width: 1501px) {
  #app .view > .grid[style*="repeat(5,1fr)"] { gap: 15px !important; }
  #app .view > .grid[style*="repeat(5,1fr)"] .kpi { padding: 21px; }
}
@media (max-width: 1200px) {
  body:has(#app) { --sidebar-w: 224px; --topbar-h: 70px; }
  #app .sidebar-head { padding-left: 24px; }
  #app .nav { padding-inline: 10px; }
  #app .nav-item { font-size: 12px; gap: 9px; padding-inline: 10px; }
  #app .nav-section { padding-inline: 10px; }
  #app .topbar { gap: 11px; padding-inline: 23px; }
  #app .topbar-right { gap: 8px; }
  #app .account .acct-select { max-width: 164px; }
  #app .synced { font-size: 9px; }
  #app .view { padding: 28px 23px 64px; }
  #app .card { padding: 21px; }
  #app .kpi .kpi-value { font-size: 29px; }
  #app .hero-copy { padding: 25px; }
  #app .hero-copy h3 { font-size: 30px; }
}
@media (max-width: 900px) {
  body:has(#app) { --sidebar-w: 258px; --topbar-h: 68px; }
  #app .sidebar { background: #121010; box-shadow: 14px 0 65px #07070788; }
  #app .sidebar-head { padding: 28px 25px 20px; }
  #app .nav-item { font-size: 13px; min-height: 43px; }
  #app .nav-section { margin-top: 24px; }
  #app .nav { padding-inline: 13px; }
  #app .topbar { padding: 0 23px; }
  #app .topbar .account { flex: 1; }
  #app .account .acct-select { max-width: 220px; }
  #app .topbar .account-badge, #app .topbar .pill, #app .topbar .synced { display: none; }
  #app .view { padding: 27px 22px 64px; }
  #app #view > .grid:has(> .hero-video) { grid-template-columns: 1.6fr 1fr !important; }
  #app .promo { height: 265px; }
  #app .hero-copy { padding: 25px; }
  #app #featPromo .feat-cap { padding: 60px 20px 23px; }
  #app #featPromo .feat-title { font-size: 23px; }
  #app .view .grid:has(> .card #r_lot) > .card[style*="grid-column:span 3"] { grid-column: 1 / -1 !important; }
}
@media (max-width: 640px) {
  body:has(#app) { --topbar-h: 106px; }
  #app .topbar { display: grid; grid-template-columns: 35px minmax(0, 1fr); grid-template-rows: 38px 35px; gap: 5px 11px; padding: 11px 17px 12px; height: 106px; align-content: center; }
  #app #menuBtn { grid-column: 1; grid-row: 1; min-width: 35px; }
  #app .topbar .account { grid-column: 2; grid-row: 1; min-width: 0; }
  #app .account .acct-select { max-width: none; width: 100%; font-size: 12px; padding: 9px 2px; }
  #app .topbar-right { grid-column: 1 / -1; grid-row: 2; margin-left: 0; width: 100%; justify-content: flex-end; gap: 14px; }
  #app #periodSel { max-width: 175px; margin-right: auto; padding: 7px 9px; font-size: 11px; min-height: 33px; }
  #app #langSel { max-width: 91px !important; font-size: 10px; }
  #app .topbar .avatar.sm { width: 27px; height: 27px; border-radius: 7px; }
  #app .profile-menu { right: 0; }
  #app .view { padding: 24px 16px 56px; scrollbar-gutter: auto; }
  #app .page-title { font-size: 30px; }
  #app .page-sub { font-size: 12px; margin-bottom: 25px; }
  #app .view > .grid, #app .view > .stack, #app .grid { gap: 12px !important; }
  #app #view > .grid:has(> .hero-video) { grid-template-columns: 1fr !important; }
  #app .hero-video { height: 268px; }
  #app .hero-copy { padding: 26px; }
  #app .hero-copy h3 { font-size: 34px; }
  #app .hero-copy p { font-size: 11px; max-width: 285px; }
  #app #featPromo { height: 166px; min-height: 166px; }
  #app #featPromo .feat-img { object-position: 65% 30%; }
  #app #featPromo .feat-cap { padding: 50px 23px 20px; }
  #app #featPromo .feat-title { font-size: 24px; }
  #app .card, #app .skel-card { padding: 19px; border-radius: 12px; }
  #app .kpi { padding: 18px 15px 21px; }
  #app .kpi .kpi-label { font-size: 9px; line-height: 1.55; margin-bottom: 14px; gap: 5px; }
  #app .kpi .kpi-value { font-size: clamp(21px, 5.5vw, 29px); }
  #app .kpi .kpi-tags { font-size: 9px; gap: 6px; flex-wrap: wrap; }
  #app .kpi svg[width="58"] { max-width: 38px; max-height: 38px; }
  #app .stat-lg { font-size: 34px; }
  #app .section-title { font-size: 15px; }
  #app .result-value { font-size: 24px; }
  #app .result-label { font-size: 10px; }
  #app .table { min-width: 490px; font-size: 11px; }
  #app .table td { padding: 14px 12px; }
  #app .table th { font-size: 9px; padding: 12px; }
  #app .btn { min-height: 39px; padding: 10px 13px; }
  #app .icon-btn { min-height: 35px; width: 35px; height: 35px; }
  #app .tabs { gap: 20px; }
  #app .tab { font-size: 11px; min-height: 44px; }
  #app .lesson-card { flex-basis: 215px; }
  #app .lesson-rail { gap: 14px; }
  #app .module { margin-top: 30px; margin-bottom: 30px; }
  #app .module-head { flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
  #app .module-head .section-title { width: 100%; font-size: 15px; }
  #app .module-head .chip { margin-left: auto !important; }
  #app .modal { padding: 12px; }
  #app .modal-card { padding: 17px; max-height: calc(100dvh - 24px); }
  #app .ticket-row { padding: 17px; gap: 10px; }
  #app .ticket-subj { font-size: 12px; }
  #app .ticket-meta { font-size: 9px; }
  #app .journal-box { padding: 16px; font-size: 12px; }
  #app .view [style*="repeat(7,1fr)"] > div { padding: 8px 2px !important; min-height: 46px !important; border-radius: 4px !important; }
  #app .view [style*="repeat(7,1fr)"] > div > div { font-size: 8px !important; }
  #app .view div:has(> #newRule) { flex-wrap: wrap; }
  #app #newRule { flex-basis: 100% !important; }
  #app #newCond { flex: 1; width: auto !important; }
  #app .view .grid[style*="1fr 1fr"]:has(> div > #imp_file),
  #app .view .grid[style*="repeat(4,1fr)"]:has(#a_broker) { grid-template-columns: 1fr !important; }
  #app .view .grid:has(> .card #r_lot) > .card[style*="grid-column:span 3"] { grid-column: 1 / -1 !important; }
}
@media (prefers-reduced-motion: reduce) {
  #app *, #app *::before, #app *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Authentication shares the same materials as the workspace. */
html:has(.card-auth), body:has(.card-auth) { height: auto; min-height: 100%; overflow: auto; }
body:has(.card-auth) { min-height: 100dvh; background: #0c0c0d; }
body:has(.card-auth) .wrap { min-height: 100dvh; padding: 60px 24px; align-items: center; }
body:has(.card-auth) .panel { max-width: 478px; animation: product-arrive .45s ease both; }
body:has(#formBody) .panel { max-width: 542px; }
body:has(#formBody) .wrap { align-items: flex-start; padding-top: 45px; padding-bottom: 65px; }
body:has(.card-auth) .bg { background: radial-gradient(ellipse at 10% 0%, #43201e44, transparent 50%), #0c0c0d; }
body:has(.card-auth) .bg .orb { opacity: .11; animation: none; filter: blur(110px); }
body:has(.card-auth) .bg .orb.c { opacity: .02; }
body:has(.card-auth) .bg .grid { opacity: .14; animation: none; background-size: 80px 80px; }
body:has(.card-auth) .bg .tape { opacity: .1; top: 38%; }
body:has(.card-auth) .bg .vignette { background: linear-gradient(90deg,#0c0c0d22,transparent,#0c0c0d55); }
body:has(.card-auth) .bg .noise { opacity: .024; }
body:has(.card-auth) .mark { justify-content: flex-start; margin-bottom: 12px; padding-left: 1px; }
body:has(.card-auth) .mark svg { width: 41px; height: 41px; filter: none; animation: none; }
body:has(.card-auth) .mark svg g { filter: none; }
body:has(.card-auth) .brand-title { text-align: left; font-size: 29px; font-weight: 500; letter-spacing: -.05em; line-height: 1.2; }
body:has(.card-auth) .brand-tag { text-align: left; font-family: var(--font-mono,monospace); color: #9b948e; font-size: 9px; font-weight: 400; letter-spacing: .14em; margin: 10px 0 32px; }
body:has(.card-auth) .card-auth { background: #151415; border: 1px solid #373333; padding: 36px; border-radius: 14px; backdrop-filter: none; box-shadow: 0 22px 70px #08080844, inset 0 1px 0 #ffffff04; }
body:has(.card-auth) .card-auth::before { background: none; padding: 0; }
body:has(.card-auth) .card-title { color: #f1f0ef; font-size: 28px; font-weight: 500; line-height: 1.2; letter-spacing: -.045em; margin-bottom: 27px; }
body:has(.card-auth) .fld { margin-bottom: 18px; }
body:has(.card-auth) .fld input { min-height: 49px; border-color: #3f3b39; border-radius: 8px; background: #0f0f10; font-size: 14px; padding-top: 14px; padding-bottom: 14px; color: #ebeae8; }
body:has(.card-auth) .fld input::placeholder { color: #958f89; }
body:has(.card-auth) .fld input:focus { border-color: #c07362; box-shadow: 0 0 0 3px #ef43381a; }
body:has(.card-auth) .fld .fi { color: #8f8781; width: 15px; height: 15px; stroke-width: 1.6; }
body:has(.card-auth) .peek { font: 450 9px var(--font-mono,monospace); letter-spacing: .04em; color: #a59f9a; right: 10px; min-height: 32px; padding: 8px; }
body:has(.card-auth) .go { min-height: 47px; background: #ef4338; border: 1px solid #ef4338; border-radius: 8px; font-size: 13px; font-weight: 530; letter-spacing: -.01em; margin-top: 14px; box-shadow: none; }
body:has(.card-auth) .go:hover { background: #f95d4e; transform: translateY(-1px); box-shadow: none; filter: none; }
body:has(.card-auth) .go:active { transform: translateY(0); }
body:has(.card-auth) .go::after { background: none; }
body:has(.card-auth) .lbl2 { color: #bcb8b4; font-size: 11px; font-weight: 450; margin-bottom: 8px; }
body:has(.card-auth) .hint { color: #9b9690; font-size: 10.5px; line-height: 1.65; margin-top: 8px; }
body:has(.card-auth) .consent { color: #a9a49f; font-size: 10.5px; line-height: 1.7; margin-top: 22px; margin-bottom: 20px; gap: 12px; }
body:has(.card-auth) .consent.optional { color: #9a948e; margin-top: 8px; padding-top: 18px; }
body:has(.card-auth) .consent input { accent-color: #ef4338; margin-top: 3px; width: 16px; height: 16px; }
body:has(.card-auth) .consent a { color: #efa18c; font-weight: 500; text-decoration: underline; text-decoration-color: #8b504144; text-underline-offset: 3px; }
body:has(.card-auth) .foot { color: #9d9791; font-size: 10px; max-width: 38em; margin: 22px auto 0; }
body:has(.card-auth) .foot .dot { box-shadow: none; background: #86ac8d; }
body:has(.card-auth) .env { width: 49px; height: 49px; border-radius: 9px; border-color: #694337; background: #272422; box-shadow: none; color: #e89980; margin-bottom: 24px; }
body:has(.card-auth) .env svg { width: 24px; height: 24px; filter: none; }
body:has(.card-auth) .lede { color: #b8b4b0; line-height: 1.75; font-size: 12px; margin-bottom: 25px; }
body:has(.card-auth) .callout { text-align: left; background: #1e1c1a; border-color: #3d3a37; border-radius: 8px; padding: 16px; color: #bab6b3; font-size: 11px; line-height: 1.75; }
body:has(.card-auth) .callout .ci { background: #5d5754; font-weight: 500; }
body:has(.card-auth) .ghost { border-radius: 8px; background: #1b1a19; color: #cac7c3; border-color: #403d3a; height: 43px; font-weight: 450; font-size: 12px; }
body:has(.card-auth) .err { border-color: #885247; color: #ffc2b3; background: #38201c; border-radius: 8px; font-size: 12px; animation: none; }
body:has(.card-auth) .ok { border-color: #405940; color: #b7d4b7; background: #1c2a1d; border-radius: 8px; font-size: 12px; }
body:has(.card-auth) :is(input, button, a):focus-visible { outline: 2px solid #edac94; outline-offset: 4px; }
body:has(.card-auth) .auth-foot { color: #9d9792 !important; }
@keyframes product-arrive { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) {
  body:has(.card-auth) .wrap { padding: 39px 21px; }
  body:has(.card-auth) .panel { max-width: 460px; }
  body:has(.card-auth) .card-auth { padding: 27px 24px; border-radius: 12px; }
  body:has(.card-auth) .card-title { font-size: 26px; }
  body:has(.card-auth) .fld input { font-size: 16px; }
  body:has(.card-auth) .consent { font-size: 11px; }
  body:has(.card-auth) .mark svg { width: 36px; height: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  body:has(.card-auth) *, body:has(.card-auth) *::before, body:has(.card-auth) *::after { animation: none !important; transition: none !important; }
}

/* Document pages remain calm, readable, and recognizably part of the product. */
body:has(.lhead) { background: #0c0c0d; color: #e7e6e4; font-family: var(--font-sans,sans-serif); font-size: 14px; line-height: 1.85; }
body:has(.lhead) .wrap { width: min(880px, calc(100% - 48px)); }
body:has(.lhead) .lhead { background: #101011ee; border-bottom-color: #34312e; }
body:has(.lhead) .lhead .wrap { height: 76px; }
body:has(.lhead) .lhead .brand svg g { filter: none; }
body:has(.lhead) .lang { border-color: #3d3936; border-radius: 7px; }
body:has(.lhead) .lang button { border-radius: 4px; font-family: var(--font-mono,monospace); font-weight: 400; font-size: 10px; }
body:has(.lhead) .lang button.on { color: #f6c6b3; background: #43261e; }
body:has(.lhead) main.wrap { padding: 26px 0 30px; }
body:has(.lhead) .tabs { gap: 8px; border: 0; margin-bottom: 38px; }
body:has(.lhead) .tabs a { border-radius: 7px; border-color: #3c3835; font-size: 11px; font-weight: 500; padding: 9px 14px; color: #bbb7b3; }
body:has(.lhead) .tabs a.on { background: #ef4338; color: #fff; }
body:has(.lhead) h1.doc { font-size: clamp(36px,5vw,54px); line-height: 1.1; font-weight: 490; letter-spacing: -.055em; margin-bottom: 18px; }
body:has(.lhead) .meta { font-family: var(--font-mono,monospace); font-size: 10px; color: #a8a39d; }
body:has(.lhead) .note { font-size: 11px; color: #a29d97; font-style: normal; margin-bottom: 42px; }
body:has(.lhead) section.blk { border-top-color: #34312e; padding: 28px 0; }
body:has(.lhead) section.blk h2 { font-size: 20px; font-weight: 500; letter-spacing: -.035em; }
body:has(.lhead) section.blk p { color: #bab6b1; max-width: 70ch; }
body:has(.lhead) .banner { border-radius: 8px; border-color: #704031; background: #211f1e; color: #e5b9a2; }
body:has(.lhead) footer.lfoot { font-size: 11px; color: #9d9892; border-top-color: #34312e; }
body:has(.lhead) :is(a,button):focus-visible { outline: 2px solid #edac94; outline-offset: 4px; }
@media print {
  body:has(.lhead), body:has(.lhead) section.blk p, body:has(.lhead) section.blk h2 { background: #fff; color: #111; }
}

@media (max-width: 1150px) {
  #app .view .grid:has(> .card #r_lot) > .card[style*="grid-column:span 3"] { grid-column: 1 / -1 !important; }
}

body:has(.card-auth) .auth-tools { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 0 0 32px; }
body:has(.card-auth) .auth-home { font-size: 11px; font-weight: 450; color: #b6b0aa; display: inline-flex; gap: 9px; align-items: center; }
body:has(.card-auth) .auth-home:hover { color: #f2eee9; }
body:has(.card-auth) .auth-language { display: flex; gap: 2px; padding: 3px; border: 1px solid #373333; border-radius: 7px; }
body:has(.card-auth) .auth-language button { border: 0; border-radius: 4px; background: none; color: #aaa29a; font: 450 10px var(--font-mono,monospace); min-height: 28px; padding: 6px 10px; cursor: pointer; }
body:has(.card-auth) .auth-language button.active { background: #39211d; color: #ffd0c5; }
body:has(.card-auth) .auth-language button:hover { color: #fff; }
body:has(.card-auth) .panel > div:has(> [data-auth="auth.nologin"]),
body:has(.card-auth) #live, body:has(.card-auth) #who { color: #aaa39c !important; }
body:has(.card-auth) > p, body:has(.card-auth) > p a { color: #a8a09a !important; }

/* A useful starting point before the first trading account is linked. */
#app .account-onboarding { padding-top: 4px; }
#app .onboarding-hero { display: grid; grid-template-columns: minmax(0,1.18fr) minmax(0,1fr); overflow: hidden; background: #141313; border-radius: 16px; }
#app .onboarding-copy { padding: clamp(30px,3.5vw,58px) clamp(28px,3.5vw,56px) 42px; align-self: center; }
#app .onboarding-eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 27px; color: #d9b0a6; font: 450 10px/1.5 var(--font-mono,monospace); letter-spacing: .015em; }
#app .onboarding-eyebrow::before { content: ''; width: 22px; height: 1px; background: #ec6b59; flex: 0 0 auto; }
#app .onboarding-copy h1 { margin: 0; max-width: 15ch; font-size: clamp(38px,3.5vw,58px); font-weight: 510; line-height: 1.08; letter-spacing: -.06em; text-wrap: balance; overflow-wrap: anywhere; hyphens: auto; }
#app .onboarding-intro { margin: 23px 0 28px; max-width: 43ch; color: #b5afaa; font-size: 13px; line-height: 1.8; text-wrap: pretty; }
#app .onboarding-start { min-height: 45px; gap: 22px; font-size: 12px; }
#app .onboarding-start span { font-size: 20px; font-weight: 350; line-height: 1; }
#app .onboarding-note { max-width: 37ch; margin: 15px 0 0; color: #918b85; font-size: 10px; line-height: 1.65; text-wrap: pretty; }
#app .onboarding-visual { position: relative; min-height: 425px; margin: 0; overflow: hidden; background: #200807; }
#app .onboarding-visual img { position: absolute; width: 100%; height: 100%; object-fit: cover; object-position: 51% center; }
#app .onboarding-visual::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg,#141313 0%,transparent 14%),linear-gradient(0deg,#170707 0%,#170707e8 9%,transparent 35%); pointer-events: none; }
#app .onboarding-steps { list-style: none; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 34px; padding: 34px 0 31px; margin: 0 0 0; border-bottom: 1px solid #33302e; }
#app .onboarding-steps li { display: flex; align-items: baseline; gap: 15px; min-width: 0; }
#app .onboarding-number { color: #bd7c6d; font: 400 11px var(--font-mono,monospace); flex: 0 0 auto; }
#app .onboarding-steps h2 { margin: 0 0 8px; color: #ddd7d1; font-size: 13px; line-height: 1.45; letter-spacing: -.015em; font-weight: 510; }
#app .onboarding-steps p { margin: 0; max-width: 29ch; color: #a19a93; font-size: 11px; line-height: 1.75; text-wrap: pretty; }
#app .onboarding-explore { display: flex; align-items: center; gap: 27px; padding-top: 23px; flex-wrap: wrap; }
#app .onboarding-explore > p { margin: 0 auto 0 0; color: #9d9690; font-size: 11px; }
#app .onboarding-link { display: inline-flex; align-items: center; justify-content: space-between; gap: 20px; padding: 8px 0; border: 0; border-bottom: 1px solid transparent; background: transparent; color: #d9d1c9; font: 450 11px var(--font); cursor: pointer; transition: color 180ms ease,border-color 180ms ease; }
#app .onboarding-link span { color: #de8b78; font-size: 17px; line-height: 1; }
#app .onboarding-link:hover { color: #fff4eb; border-bottom-color: #a96758; }
#app .onboarding-link:active { transform: translateY(1px); }
#app .account-onboarding button:focus-visible { outline: 2px solid #edac94; outline-offset: 5px; }
@media (max-width: 1100px) {
  #app .onboarding-hero { grid-template-columns: minmax(0,1fr); }
  #app .onboarding-copy { padding: 36px 34px 31px; }
  #app .onboarding-copy h1 { max-width: 19ch; font-size: clamp(36px,5vw,48px); }
  #app .onboarding-intro { max-width: 55ch; }
  #app .onboarding-note { max-width: none; }
  #app .onboarding-visual { min-height: 215px; }
  #app .onboarding-visual img { object-position: 50% 44%; }
  #app .onboarding-visual::after { background: linear-gradient(180deg,#141313 0%,transparent 17%),linear-gradient(0deg,#170707 0%,transparent 23%); }
  #app .onboarding-steps { gap: 23px; }
  #app .onboarding-steps li { gap: 10px; }
}
@media (max-width: 640px) {
  #app .onboarding-hero { border-radius: 12px; }
  #app .onboarding-copy { padding: 29px 23px 28px; }
  #app .onboarding-eyebrow { font-size: 9px; margin-bottom: 24px; gap: 8px; }
  #app .onboarding-eyebrow::before { width: 16px; }
  #app .onboarding-copy h1 { font-size: 37px; max-width: 14ch; }
  #app .onboarding-intro { font-size: 12px; margin-top: 20px; }
  #app .onboarding-start { width: 100%; justify-content: space-between; }
  #app .onboarding-note { font-size: 10px; }
  #app .onboarding-visual { min-height: 177px; }
  #app .onboarding-steps { grid-template-columns: minmax(0,1fr); gap: 22px; padding: 29px 0 27px; }
  #app .onboarding-steps li { gap: 17px; }
  #app .onboarding-steps h2 { margin-bottom: 4px; }
  #app .onboarding-steps p { max-width: 42ch; }
  #app .onboarding-explore { gap: 10px 24px; padding-top: 21px; }
  #app .onboarding-explore > p { flex-basis: 100%; }
  #app .onboarding-link { min-height: 37px; }
}

/* Empty account lists in forms do not need dashboard-sized vacant space. */
#app .card:has(#a_broker) > .empty{min-height:0;text-align:left;padding:12px 0 25px!important;}

/* Restrained red ambient light, shared with the public presentation. */
#app .main {
  background: radial-gradient(ellipse 760px 520px at 98% 0%,#bf271b16,transparent 72%),var(--bg);
}
#app .sidebar {
  background: radial-gradient(ellipse 290px 400px at 0% 12%,#98291d14,transparent 75%),#101011;
}
#app .topbar { box-shadow: 0 8px 30px -25px #df3c2d40; }
#app .logo svg { filter: drop-shadow(0 0 9px #e13b2e2b); }
#app .nav-item { transition: color .16s ease,background .16s ease,box-shadow .16s ease; }
#app .nav-item.active {
  background: linear-gradient(100deg,#d432282e,#a92c1f12);
  box-shadow: inset 0 0 0 1px #ef675617,0 5px 24px -12px #e13b2e45;
}
#app .nav-item.active::after { box-shadow: 0 0 10px #ef43387a; }
#app .nav-item.active .nav-ic { filter: drop-shadow(0 0 5px #ef43382e); }
#app .btn { transition: background .17s ease,border-color .17s ease,color .17s ease,transform .17s ease,box-shadow .17s ease; }
#app .btn.primary, #app .btn.blue {
  box-shadow: inset 0 1px 0 #ffffff16,0 5px 20px -7px #df392c3d;
}
#app .btn.primary:not(:disabled):hover, #app .btn.blue:not(:disabled):hover {
  box-shadow: inset 0 1px 0 #ffffff20,0 7px 28px -5px #ef43384d;
}
#app .inp:focus, #app .journal-box:focus {
  border-color: #c47766;
  box-shadow: 0 0 0 3px #ef433819,0 0 22px #ef433812;
}
#app .toggle-group button.active { box-shadow: inset 0 1px 0 #e7684e16,0 0 16px -6px #e13b2e2e; }
#app .onboarding-hero { box-shadow: 0 15px 65px -32px #cb302040,inset 0 1px 0 #e7775719; }
#app .onboarding-copy { background: radial-gradient(ellipse at 0% 0%,#a72c1d16,transparent 65%); }
#app .promo { box-shadow: 0 12px 45px -28px #df392c3b; }
#app .card:has(#imp_file), #app .card:has(.result-value) {
  box-shadow: inset 0 1px 0 #ee785510,0 12px 38px -28px #d1372836;
}
body:has(.card-auth) .bg {
  background: radial-gradient(ellipse at 10% 3%,#a129222d,transparent 50%),
              radial-gradient(ellipse at 88% 87%,#9a221b24,transparent 51%),#0c0c0d;
}
body:has(.card-auth) .bg .orb { opacity: .16; }
body:has(.card-auth) .bg .orb.c { opacity: .035; }
body:has(.card-auth) .mark svg { filter: drop-shadow(0 0 12px #ef433836); }
body:has(.card-auth) .card-auth {
  border-color: #51332f;
  background: radial-gradient(ellipse at 0% 0%,#aa352215,transparent 65%),#151415;
  box-shadow: 0 22px 70px #08080844,0 0 75px -30px #cc302b30,inset 0 1px 0 #ef826919;
}
body:has(.card-auth) .fld input:focus {
  border-color: #d47b68;
  box-shadow: 0 0 0 3px #ef43381c,0 0 24px #e13b2e14;
}
body:has(.card-auth) .go { box-shadow: inset 0 1px 0 #ffffff16,0 6px 24px -7px #df392c45; }
body:has(.card-auth) .go:not(:disabled):hover { box-shadow: inset 0 1px 0 #ffffff20,0 8px 30px -6px #ef43385c; }
body:has(.card-auth) .auth-language button.active { box-shadow: 0 0 16px -6px #ef433838; }
@media (max-width: 640px) {
  #app .main { background: radial-gradient(ellipse 420px 390px at 100% 0%,#bf271b16,transparent 74%),var(--bg); }
}

/* Public account and document pages follow the editorial landing treatment.
   These existing page markers intentionally exclude the application workspace. */
body[data-auth-page], body:has(> .lhead) {
  --public-display: 'Archivo Variable',var(--font-sans,'Geist',sans-serif);
}
body[data-auth-page] .brand-title,
body[data-auth-page] .card-title,
body:has(> .lhead) h1.doc,
body:has(> .lhead) section.blk h2 {
  font-family: var(--public-display);
  font-weight: 500;
  font-stretch: 100%;
  letter-spacing: -.03em;
  text-wrap: balance;
}
body[data-auth-page] .brand-title { line-height: 1.12; }
body[data-auth-page] .card-title { font-size: clamp(28px,3vw,34px); line-height: 1.1; }
body[data-auth-page] .card-auth,
body[data-auth-page] .card-auth::before,
body[data-auth-page] .callout,
body[data-auth-page] .env,
body[data-auth-page] .auth-language { border-radius: 8px; }
body[data-auth-page] .fld input,
body[data-auth-page] .inp,
body[data-auth-page] .go,
body[data-auth-page] .ghost,
body[data-auth-page] .peek,
body[data-auth-page] .auth-language button { border-radius: 4px; }
body[data-auth-page] .go { background: #c73c31; border-color: #e56759; }
body[data-auth-page] .go:not(:disabled):hover { background: #b93229; border-color: #f17e70; }
body[data-auth-page] .brand-tag { letter-spacing: .08em; color: #aaa09a; }
body[data-auth-page] .hint { color: #aaa19a; }
body[data-auth-page] .consent { color: #b9afa7; }
body[data-auth-page] .lede { color: #c4beb9; }
body:has(> .lhead) h1.doc { font-size: clamp(38px,5vw,56px); line-height: 1.06; }
body:has(> .lhead) section.blk h2 { font-size: 22px; line-height: 1.2; }
body:has(> .lhead) .lang,
body:has(> .lhead) .banner { border-radius: 8px; }
body:has(> .lhead) .tabs a,
body:has(> .lhead) .lang button { border-radius: 4px; }
body:has(> .lhead) .tabs a.on { background: #c73c31; border-color: #e56759; }
