/* ui-ux-design-system: shared surfaces, typography, controls and states.
   Palette and font preferences remain owned by theme.js. */
:root {
  --ui-text-caption: .75rem;
  --ui-text-body: .875rem;
  --ui-text-label: .875rem;
  --ui-text-heading: 1.125rem;
  --ui-radius-control: .75rem;
  --ui-radius-panel: 1.25rem;
  --ui-gap: .75rem;
  --ui-panel-padding: 1.25rem;
  --ui-control-height: 2.75rem;
  --ui-canvas: var(--bg);
  --ui-surface: var(--panel);
  --ui-inset: var(--panel-2);
  --ui-ink: var(--text);
  --ui-muted: var(--muted);
  --ui-accent: var(--sage-main);
  --ui-selected: color-mix(in srgb, var(--ui-accent) 10%, var(--ui-surface));
  --ui-highlight: color-mix(in srgb, var(--ui-ink) 5%, transparent);
  --ui-elevation: inset 0 1px 0 var(--ui-highlight), 0 8px 24px color-mix(in srgb, var(--ui-ink) 7%, transparent);
  --ui-error: var(--danger, #c42b32);
}
body { font-size: 1rem; line-height: 1.5; }
button, input, select, textarea { font-family: inherit; }
button { font-weight: 500; }
h1, h2, h3, h4 { text-wrap: balance; }
.app :is(h1, h2, h3, h4, .page-title, .lp-title), dialog :is(h2, h3) { font-family: var(--font-ui); }
p { text-wrap: pretty; }
.main { background: var(--bg); }
.column, .feed-column { min-width: 0; }
.column:not(.feed-column) { max-width: 78rem; margin-inline: auto; padding: 1.25rem clamp(1rem, 2.5vw, 2rem) 2rem; }
.page-title { font-size: clamp(1.625rem, 2.5vw, 2rem); font-weight: 600; letter-spacing: -.035em; line-height: 1.2; margin-bottom: 1rem; }
:is(.section-head, .section-row, .g-section-head, .inbox-heading, .m-toolbar) { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1rem; }
:is(.section-head, .section-row, .g-section-head) h2 { font-size: var(--ui-text-heading); font-weight: 600; letter-spacing: -.02em; line-height: 1.35; margin: 0; }
.small { font-size: var(--ui-text-body); line-height: 1.5; }
.g-kicker { font-size: var(--ui-text-caption); letter-spacing: .06em; font-weight: 500; }
:is(.card, .cc, .compose-card, .g-settings, .p-card, .lp-card, .lj-card, .qa-item, .skills-listing, .match-card, .listing-card, .exchange-card, .m-me, .m-campaign, .m-progress, .m-propose, .m-stance, .m-request, .m-kudos, .m-role, .m-profile, .a-panel, .a-request) {
  border-radius: var(--ui-radius-panel);
  padding: var(--ui-panel-padding);
  box-shadow: none;
  min-width: 0;
  border: 1px solid var(--border);
  background: var(--ui-surface);
}
:is(.g-settings, .p-card, .lp-card, .m-me, .a-panel) { gap: var(--ui-gap); }
:is(.g-settings, .p-card, .lp-card, .qa-item, .m-role, .a-panel) :is(h2, h3) { font-size: var(--ui-text-heading); font-weight: 600; line-height: 1.35; letter-spacing: -.02em; }
:is(.primary, .ghost, .g-cta) { min-height: var(--ui-control-height); padding: .625rem 1rem; border-radius: var(--ui-radius-control); font-size: var(--ui-text-label); font-weight: 600; line-height: 1.4; gap: .5rem; max-width: 100%; white-space: normal; overflow-wrap: anywhere; box-shadow: none; }
:is(.primary, .ghost, .g-cta) > .icon { flex-shrink: 0; width: 1.125rem; height: 1.125rem; }
.ghost { border: 1px solid var(--border); background: transparent; color: var(--text); }
.icon-btn { min-width: var(--ui-control-height); min-height: var(--ui-control-height); border-radius: var(--ui-radius-control); flex-shrink: 0; }
:is(button, input, select, textarea, a, summary):focus-visible { outline: 2px solid var(--sage-main); outline-offset: 3px; }
button:disabled { cursor: not-allowed; opacity: .55; box-shadow: none; }
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]), textarea, select {
  width: 100%; min-width: 0; max-width: 100%; min-height: var(--ui-control-height); padding: .625rem .75rem;
  border: 1px solid var(--border); border-radius: var(--ui-radius-control); background: var(--panel); color: var(--text); font-size: 1rem; line-height: 1.5; box-shadow: none;
}
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input[aria-invalid=true], textarea[aria-invalid=true] { border-color: var(--danger, #c42b32); }
:is(.auth-form, .m-form, .skills-form, .task-form) { gap: 1rem; }
:is(.auth-form, .m-form, .skills-form, .task-form) label { min-width: 0; font-size: var(--ui-text-label); font-weight: 500; line-height: 1.5; }
:is(.filters, .dialog-actions, .m-chips, .skills-actions, .notif-tools) { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.filters > :is(input, select) { flex: 1 1 10rem; width: auto; }
.dialog-actions { justify-content: flex-end; margin-top: 1rem; }
.dialog-actions > button { flex: 0 1 auto; }
.form-error { padding: .75rem; border-radius: var(--ui-radius-control); font-size: var(--ui-text-body); line-height: 1.5; overflow-wrap: anywhere; }
.seg { padding: .25rem; gap: .25rem; border: 1px solid var(--border); border-radius: .875rem; background: var(--panel); }
.seg button { min-width: 0; min-height: var(--ui-control-height); padding: .5rem .75rem; border-radius: .625rem; font-size: var(--ui-text-label); line-height: 1.35; overflow-wrap: anywhere; }
.seg button.on { background: var(--ui-selected); color: var(--ui-ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ui-accent) 35%, var(--border)); }
.chip { min-height: 2.5rem; font-size: var(--ui-text-label); }
.topbar { gap: .5rem; background: var(--panel); border-bottom: 1px solid var(--border); }
#view-title { min-width: 0; font-family: var(--font-ui); font-size: 1.125rem; font-weight: 600; letter-spacing: -.025em; }
body #app #view-title { font-family: var(--font-ui); font-size: 1.125rem; font-weight: 600; line-height: 1.35; }
.workspace-links button, .rail-bottom button { min-height: var(--ui-control-height); border-radius: var(--ui-radius-control); font-size: var(--ui-text-label); font-weight: 500; }
.workspace-links button.active { font-weight: 600; background: var(--ui-selected); color: var(--text); }
.rail-section { font-weight: 500; letter-spacing: .06em; }
.post { border-radius: var(--ui-radius-panel); box-shadow: none; }
.post-desc { font-size: 1rem; font-weight: 400; line-height: 1.65; overflow-wrap: anywhere; }
.post-actions button { min-height: var(--ui-control-height); min-width: var(--ui-control-height); }
.post .comment-cloud { filter: none; transform: none; margin-left: 0; animation: none; }
.post .comment-cloud > .comment-text { mask: none; -webkit-mask: none; padding: .75rem; border-radius: .25rem .875rem .875rem; background: var(--panel-2); background-image: none; font-size: var(--ui-text-body); line-height: 1.6; }
.post .comment-cloud::before, .post .comment-cloud::after { display: none; }
.post .comments .comment-item .comment-cloud { animation: none; transform: none; }
.post .comment-form { box-shadow: none; border: 1px solid var(--border); border-radius: .875rem; padding: .25rem; }
.post .comment-form:focus-within { box-shadow: none; outline: 2px solid var(--sage-main); outline-offset: 2px; }
.home-hero, .lp-head, .skills-hero { border-radius: var(--ui-radius-panel); }
.lp-title { font-size: 1.125rem; font-weight: 600; line-height: 1.4; }
.lp-level { grid-template-columns: 2.75rem minmax(0, 1fr); }
:is(.lp, .qa-list, .skills-content, .skills-section, .m-content, .m-list, .a-panel) { gap: var(--ui-gap); }
.ib-row, .m-leader, .new-message-member, .share-member-row { min-height: 4rem; border-radius: .75rem; }
.ib-name { font-size: 1rem; font-weight: 600; }
.ib-preview { font-size: var(--ui-text-body); line-height: 1.5; }
.m-stat, .a-tile, .p-stat { border-radius: .75rem; box-shadow: none; }
:is(.m-stat strong, .a-tile strong, .m-leader-pts, .p-stat strong) { font-variant-numeric: tabular-nums; }
.m-hero { background: var(--panel); border: 0; color: var(--text); border-radius: var(--ui-radius-panel); padding: 1.25rem; }
.m-hero::after { display: none; }
:root .m-hero .m-statement { color: var(--text); font-size: clamp(1.375rem, 2.6vw, 1.875rem); line-height: 1.25; max-width: 45ch; }
:root .m-hero .g-kicker { color: var(--muted); }
:root .m-hero .m-stat { background: var(--bg); color: var(--text); border: 0; }
:root .m-hero .m-stat span { color: var(--muted); }
#mission-body .m-hero .m-statement { color: var(--text); }
#mission-body .m-hero :is(.g-kicker, .m-stat span) { color: var(--muted); }
#mission-body .m-hero .m-stat strong { color: var(--text); }
#mission-body .m-hero .m-edit { color: var(--sage-deep); }
#app :is(.primary, .ghost, .g-cta), dialog :is(.primary, .ghost, .g-cta) { border-radius: var(--ui-radius-control); min-height: var(--ui-control-height); }
.m-impact { grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr)); }
.empty-moments, .feed-empty { padding: 1.5rem 1rem; border-radius: var(--ui-radius-panel); }
.empty-moments p, .feed-empty p { max-width: 48ch; margin-inline: auto; font-size: var(--ui-text-body); line-height: 1.6; }
.auth-card { border-radius: 1.25rem; padding: clamp(1.25rem, 3vw, 2rem); box-shadow: none; }
.auth-form h2 { font-size: 1.5rem; font-weight: 600; }
dialog { border-radius: 1.25rem; max-width: calc(100vw - 2rem); max-height: calc(100dvh - 2rem); }
dialog :is(h2, h3) { font-weight: 600; line-height: 1.3; letter-spacing: -.025em; }
dialog form { min-width: 0; }
.main table { width: 100%; border-collapse: collapse; font-size: var(--ui-text-body); }
.main :is(th, td) { padding: .75rem; text-align: left; border-bottom: 1px solid var(--border); }
.main th { color: var(--muted); font-weight: 500; }
/* Neutral content surfaces; the brand colour stays on actions and selection. */
#app :is(.home-hero, .lp-head, .home-skills, .home-mission-main) { background: var(--ui-surface); border: 1px solid var(--border); color: var(--ui-ink); }
#app .home-hero .home-hero-text h1 { color: var(--ui-ink); }
#app .home-hero .home-hero-lead { color: var(--ui-muted); font-weight: 400; font-style: normal; }
#app .home-mission-main strong { font-family: var(--font-ui); font-size: 1.125rem; line-height: 1.45; font-weight: 600; }
#app .lp-card { background: var(--ui-surface); }
.auth-card { box-shadow: var(--ui-elevation); }
dialog[open] { background: var(--ui-surface); color: var(--ui-ink); border: 1px solid var(--border); box-shadow: var(--ui-elevation); }
.form-error { color: var(--ui-error); background: color-mix(in srgb, var(--ui-error) 8%, var(--ui-surface)); border: 1px solid color-mix(in srgb, var(--ui-error) 30%, var(--border)); }
button[aria-busy=true] { cursor: progress; }
.loading-dots { display: grid; justify-content: stretch; gap: .75rem; padding: 1rem; min-height: 8rem; width: 100%; max-width: 32rem; margin-inline: auto; }
.loading-dots > span { display: block; width: 100%; height: 1rem; border-radius: .375rem; background: var(--hover); animation: none; }
.loading-dots > span:first-child { width: 45%; height: 1.5rem; }
.loading-dots > span:last-child { width: 70%; }
.main thead { background: var(--ui-inset); }
.main :is(td, th)[data-numeric] { text-align: right; font-variant-numeric: tabular-nums; }
@media (hover: hover) {
  .ghost:not(:disabled):hover, .icon-btn:hover, .m-leader:hover, .ib-row:hover { background: var(--hover); }
}
@media (max-width: 680px) {
  :root { --ui-panel-padding: .875rem; }
  .column:not(.feed-column) { padding: 1rem 1rem 1.5rem; }
  .topbar { padding-inline: max(.75rem, env(safe-area-inset-left)); }
  .page-title { font-size: 1.625rem; }
  .top-actions { gap: 0; }
  .topbar .top-brand { min-width: 0; }
  .seg.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #mission-body .m-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #mission-body .m-tabs button { overflow-wrap: normal; }
  .seg button { padding-inline: .5rem; }
  .filters > :is(input, select) { flex-basis: 8rem; }
  .dialog-actions > button { flex: 1 1 7rem; }
  dialog { max-width: calc(100vw - 1.5rem); max-height: calc(100dvh - 1.5rem); padding: 1rem; }
  .lp-head { align-items: flex-start; padding: 1rem; }
  .path-art.il { width: 5rem; max-width: 25%; }
  .lp-head .page-title { font-size: 1.5rem; }
  .m-impact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .m-stat { padding: .625rem; }
  .m-stat strong { font-size: 1.25rem; }
  .m-stat span { font-size: var(--ui-text-caption); overflow-wrap: anywhere; }
  .tabbar { background: var(--panel); }
  .tabbar button { min-width: 0; min-height: 3.5rem; }
  .tabbar .tab-label { font-size: .6875rem; font-weight: 500; }
  .tabbar button.active .tab-label { font-weight: 600; }
  .tabbar button.active::after { display: none; }
  .auth { padding-inline: 1rem; }
}
@media (min-width: 1000px) {
  .workspace-rail { padding: 1.5rem 1rem; }
  .workspace-brand { white-space: nowrap; font-size: 1.5rem; line-height: 1.5; padding-inline: .375rem; }
  .workspace-brand .brand-mark { margin-right: .2em; }
  #app .rail-create { white-space: nowrap; font-size: .8125rem; padding-inline: .5rem; }
  .topbar { min-height: 4rem; }
}
@media (min-width: 1000px) and (max-height: 850px) {
  .workspace-rail { padding-block: .75rem; }
  .rail-caption { margin-block: .5rem .75rem; }
  .rail-bottom > span { display: none; }
}
@media (min-width: 1000px) and (max-height: 700px) {
  .rail-caption, .rail-section { display: none; }
  .workspace-brand { margin-bottom: .5rem; }
  .workspace-links { gap: 0; }
  .workspace-links button, .rail-bottom button { padding-block: .5rem; }
  .rail-divider { margin-block: .5rem; }
  .rail-create { margin-top: .5rem; padding-block: .625rem; }
  .rail-bottom { padding-top: 0; }
}


/* Floating navigation for phone and tablet app canvases. */
#app .main { padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px)); }
#app .tabbar.floating-nav {
  --nav-orange: #FF6B2C;
  --nav-muted: #B8B5B2;
  position: absolute;
  inset-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  height: 80px;
  min-height: 80px;
  padding: 8px;
  gap: 4px;
  background: #121110;
  border: 1px solid color-mix(in srgb, var(--nav-orange) 55%, #121110);
  border-radius: 999px;
  box-shadow: 0 8px 24px #00000038, inset 0 1px 0 #ffffff05;
  isolation: isolate;
}
#app .floating-nav > button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  min-width: 44px;
  min-height: 60px;
  width: 100%;
  padding: 6px 2px;
  gap: 4px;
  border: 0;
  border-radius: 20px;
  background: transparent;
  color: var(--nav-muted);
  font-family: var(--font-ui);
  cursor: pointer;
  transform: none;
  transition: color 160ms cubic-bezier(.2,.7,.2,1), background-color 160ms cubic-bezier(.2,.7,.2,1), transform 120ms cubic-bezier(.2,.7,.2,1);
}
#app .floating-nav > button.active { background: #FF6B2C17; color: var(--nav-orange); }
#app .floating-nav > button::after, #app .floating-nav .tab-glow { display: none; }
#app .floating-nav .tab-label { font-size: .6875rem; line-height: 1.25; font-weight: 500; color: inherit; white-space: nowrap; letter-spacing: .01em; }
#app .floating-nav > button.active .tab-label { color: var(--nav-orange); font-weight: 600; }
#app .floating-nav .icon, #app .floating-nav > button.active .icon {
  display: block; flex: none; width: 24px; height: 24px; padding: 0;
  color: inherit; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; background: transparent !important;
  border-radius: 0; transform: none; filter: none; transition: none;
}
#app .floating-nav .tab-create .tab-create-disc {
  display: grid; place-items: center; flex: none; width: 42px; height: 42px;
  margin-top: -14px; padding: 0; border: 0; border-radius: 13px !important;
  background: var(--nav-orange); color: #121110; box-shadow: 0 4px 12px #00000029;
  transform: none;
}
#app .floating-nav .tab-create .tab-create-disc .icon { color: #121110; width: 25px; height: 25px; }
#app .floating-nav > button:focus-visible { outline: 2px solid var(--nav-orange); outline-offset: 2px; transition: none; }
#app .floating-nav > button:active:not(:focus-visible) { transform: scale(.96); background: #FF6B2C24; }
#app .floating-nav .tab-create:active .tab-create-disc { transform: none; }
#app .main > .scroll { scroll-padding-bottom: 24px; }
#app .mobile-feed-top { bottom: calc(120px + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 999px) {
  #app #theme-btn, #app #topbar-create, #app .story-create { display: none; }
}
@media (min-width: 1000px) {
  #app .tabbar.floating-nav { display: none; }
  #app .main { padding-bottom: 0; }
}
@media (hover: hover) {
  #app .floating-nav > button:hover { background: #FF6B2C12; color: #E5E1DD; }
  #app .floating-nav > button.active:hover { color: var(--nav-orange); background: #FF6B2C24; }
}
@media (prefers-reduced-motion: reduce) {
  #app .floating-nav > button { transition: none; }
  #app .floating-nav > button:active { transform: none; }
}


/* Learning directions replace the sequential level timeline. */
.learning-intro { margin-block: 1.5rem 1rem; }
.learning-intro .page-title { margin-bottom: .5rem; }
.learning-intro p { max-width: 55ch; margin: 0; font-size: 1rem; line-height: 1.6; }
.learning-directions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.learning-direction { display: grid; grid-template-columns: 40px minmax(0, 1fr); align-content: start; align-items: center; gap: .875rem; min-width: 0; width: 100%; padding: 1.25rem; text-align: left; border: 1px solid var(--border); border-radius: var(--ui-radius-panel); background: var(--ui-surface); color: var(--ui-ink); font: inherit; cursor: pointer; }
.direction-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: .75rem; background: var(--ui-selected); color: var(--ui-accent); }
.direction-icon .icon { width: 23px; height: 23px; }
.direction-title { font-size: 1.5rem; font-weight: 600; letter-spacing: -.025em; }
.direction-description { grid-column: 1 / -1; max-width: 45ch; color: var(--ui-muted); line-height: 1.6; font-size: .9375rem; }
.direction-topics { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .5rem; }
.direction-topics > span { padding: .25rem .5rem; border-radius: .375rem; background: var(--ui-inset); color: var(--ui-muted); font-size: .75rem; font-weight: 400; }
.direction-action { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: .25rem; padding-top: .875rem; border-top: 1px solid var(--border); color: var(--ui-accent); font-size: .875rem; font-weight: 600; }
.direction-action .icon { width: 18px; height: 18px; }
.direction-back { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; margin-top: .75rem; }
.direction-summary { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; padding-bottom: .875rem; font-size: .875rem; }
.direction-lessons { display: grid; gap: .625rem; }
.track-cards { display: grid; gap: .625rem; margin: .75rem 0 1.5rem; }
.track-card { border: 1px solid color-mix(in srgb, var(--border) 65%, transparent); border-radius: 1rem; background: var(--panel); }
.track-card[open] { border-color: var(--border); }
.track-card > summary { display: flex; align-items: center; gap: .875rem; padding: .875rem 1rem; border-radius: 1rem; list-style: none; cursor: pointer; transition: background-color .2s; }
.track-card > summary::-webkit-details-marker { display: none; }
.track-card > summary:hover { background: var(--hover); }
.track-card > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.track-number { flex: none; display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: .625rem; background: var(--hover); font-weight: 600; font-variant-numeric: tabular-nums; }
.track-card.finished .track-number { background: color-mix(in srgb, var(--answer-right) 16%, transparent); color: var(--answer-right); }
.track-summary { flex: 1; min-width: 0; display: grid; gap: .25rem; }
.track-summary strong { font-weight: 600; overflow-wrap: anywhere; }
.track-summary .bar-track { display: block; height: 4px; margin-top: .25rem; }
.track-summary .bar-fill { background: var(--answer-right); }
.track-chevron { flex: none; display: grid; place-items: center; color: var(--muted); transition: transform .2s; }
.track-card[open] .track-chevron { transform: rotate(90deg); }
.track-body { display: grid; gap: .75rem; padding: 0 1rem 1rem; }
.track-body > p { margin: 0; }
.track-body .direction-lessons { gap: .375rem; }
.track-body .direction-lesson { min-height: 0; padding: .5rem .75rem; border-radius: .625rem; }
.track-body .direction-lesson strong { font-size: .9375rem; font-weight: 500; }
.track-body .direction-lesson-status { font-size: .8125rem; }
.track-body .task-row { width: 100%; }
@media (prefers-reduced-motion: reduce) { .track-chevron, .track-card > summary { transition: none; } }
.candle-sets { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: .75rem; margin-top: .75rem; }
.candle-sets .chart-card { margin: 0; padding-bottom: .75rem; }
.candle-sets .chart-card p { margin: .5rem 0 0; }
/* The contour image and its text, in each theme. Sign-in and the Home greeting share these. */
:root {
  --hero-ink: #f2f6f1;
  --hero-soft: #c0cfc7;
  --hero-kicker: #9fd3bd;
  --hero-bg: #0b1512;
  --hero-image: url(/img/hero-doodle.jpg); /* scripts/build-doodle-pattern.js */
  --hero-scrim: linear-gradient(100deg, rgb(8 16 13 / .78) 0%, rgb(8 16 13 / .42) 46%, rgb(8 16 13 / .08) 100%);
  --hero-scrim-phone: linear-gradient(180deg, rgb(8 16 13 / .62) 0, rgb(8 16 13 / .78) 14rem, #0b1512 26rem);
  --hero-line: rgb(255 255 255 / .12);
  --hero-shadow: 0 24px 70px rgb(4 12 9 / .5);
}
:root[data-theme="light"] {
  --hero-ink: #14231c;
  --hero-soft: #46594f;
  --hero-kicker: #1f6f55;
  --hero-bg: #eef3ee;
  --hero-image: url(/img/hero-doodle-light.jpg);
  --hero-scrim: linear-gradient(100deg, rgb(246 249 245 / .86) 0%, rgb(246 249 245 / .5) 50%, rgb(246 249 245 / .04) 100%);
  --hero-scrim-phone: linear-gradient(180deg, rgb(246 249 245 / .7) 0, rgb(246 249 245 / .86) 14rem, #eef3ee 26rem);
  --hero-line: rgb(20 35 28 / .13);
  --hero-shadow: 0 20px 56px rgb(46 84 68 / .16);
}
/* Sign-in page: one large image, a confident headline and the form as the only panel. */
#auth.auth {
  --auth-ink: var(--hero-ink);
  --auth-soft: var(--hero-soft);
  position: relative;
  isolation: isolate;
  background: var(--hero-bg) var(--hero-image) center / cover no-repeat;
}
#auth.auth::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--hero-scrim);
}
#auth .auth-wrap { width: min(1200px, 100%); grid-template-columns: minmax(0, 1.2fr) minmax(340px, 26rem); gap: clamp(40px, 8vw, 120px); }
#auth .auth-hero { color: var(--auth-ink); }
#auth .auth-hero .brand { color: var(--auth-ink); }
#auth .auth-hero .g-kicker { color: var(--hero-kicker); }
#auth .auth-hero h1 { color: var(--auth-ink); font-size: clamp(2.75rem, 5.4vw, 5rem); font-weight: 600; line-height: 1.04; letter-spacing: -.035em; text-wrap: balance; }
#auth .auth-hero h1 span { color: inherit; }
#auth .auth-hero .lead { max-width: 46ch; color: var(--auth-soft); font-size: 1.0625rem; line-height: 1.65; }
#auth .auth-hero .muted { color: var(--auth-soft); }
#auth .auth-hero a { color: var(--auth-ink); text-underline-offset: .2em; }
#auth .auth-hero a:hover { opacity: .8; }
#auth .auth-art, #auth .auth-points { display: none; }
#auth .auth-card { border-color: var(--hero-line); box-shadow: var(--hero-shadow); }
#auth .auth-form .primary { transition: background-color .2s, transform .12s; }
#auth .auth-form .primary:active { transform: translateY(1px); }
#auth .g-footer { position: relative; border: 0; border-top: 1px solid var(--hero-line); border-radius: 0; background: none; color: var(--auth-soft); }
#auth .g-footer * { color: var(--auth-soft); }
#auth .g-footer .gf-inner, #auth .g-footer :is(a, button) { border-color: var(--hero-line); background: none; }
#auth .g-footer :is(a, button):hover, #auth .g-footer .brand { color: var(--auth-ink); }
@media (max-width: 860px) {
  #auth.auth { background-position: 70% top; background-size: auto 26rem; }
  #auth.auth::before { background: var(--hero-scrim-phone); }
  #auth .auth-wrap { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  #auth .auth-hero .brand { margin-bottom: .75rem; }
  #auth .auth-hero .g-kicker { display: none; }
  #auth .auth-hero h1 { font-size: clamp(2rem, 9vw, 3.25rem); margin-block: .25rem .5rem; }
  #auth .auth-hero .lead { font-size: .875rem; line-height: 1.5; }
  #auth .auth-hero .small { margin-block: .375rem 0; font-size: .75rem; }
  /* Keep the sign-in button on the first screen of a phone. */
  #auth .auth-wrap { gap: 16px; }
  #auth .auth-card { padding: 16px; }
  #auth .auth-form { gap: 8px; }
  #auth .auth-form > h2 { font-size: 1.25rem; }
}
/* Home: the greeting carries the sign-in image, and orange is kept for actions. */
#app #feed-view .home-hero {
  position: relative;
  isolation: isolate;
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  overflow: hidden;
  border: 1px solid var(--hero-line);
  border-radius: 1rem;
  background: var(--hero-bg) var(--hero-image) 70% 30% / cover no-repeat;
  color: var(--hero-ink);
}
#app #feed-view .home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--hero-scrim);
}
#app #feed-view .home-hero-art { display: none; }
#app #feed-view .home-hero-text { gap: .5rem; max-width: 42rem; }
#app #feed-view .home-hero .g-kicker { color: var(--hero-kicker); }
#app #feed-view .home-hero h1 { max-width: none; color: var(--hero-ink); font-size: clamp(1.75rem, 3.2vw, 2.625rem); font-weight: 600; line-height: 1.1; letter-spacing: -.03em; text-wrap: balance; }
#app #feed-view .home-hero :is(.daily-quote, .daily-quote *, .home-facts) { color: var(--hero-soft); }
#app #feed-view .home-hero .daily-quote { font-size: .9375rem; line-height: 1.55; }
#app #feed-view .home-hero .home-facts { margin: .25rem 0 0; font-size: .8125rem; }
/* Labels and shortcuts stay quiet, and the blocks share one lighter edge. */
#app #feed-view :is(.home-mission, .feed-heading) .g-kicker { color: var(--muted); }
#app #feed-view .compose-chips .icon { color: var(--muted); }
#app #feed-view .compose-chips button { color: var(--text); font-weight: 500; transition: background-color .2s; }
#app #feed-view .compose-chips button:hover { background: var(--hover); }
#app #feed-view :is(.compose-card, .home-mission, #feed-daily > *, #feed-skills > *) { border-color: color-mix(in srgb, var(--border) 65%, transparent); box-shadow: none; }
#app #feed-view .market-news-status { border: 0; border-top: 1px solid color-mix(in srgb, var(--border) 65%, transparent); border-radius: 0; background: none; padding-inline: 0; padding-bottom: 0; }
#app #feed-view .feed-heading h2 { font-weight: 600; letter-spacing: -.02em; }
/* In the narrow side column, the words and arrow keep to one row without the small dots. */
@media (min-width: 1100px) {
  #app #feed-view .home-daily { flex-wrap: nowrap; }
  #app #feed-view .home-daily .daily-mini-dots { display: none; }
  #app #feed-view .home-daily .home-skills-text { flex: 1; min-width: 0; }
}
/* Posts: each one a card like the blocks above, with quiet actions and pictures sized to fit a screen. */
#app .post-list > .card.post {
  margin: 0 0 .75rem;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border) 65%, transparent);
  border-radius: 1rem;
  background: var(--panel);
}
#app .post-list :is(.post-title, .post-desc) { color: var(--text); font-size: .9375rem; font-weight: 400; line-height: 1.6; text-wrap: pretty; }
#app .post-list :is(.post-title, .post-desc) :is(.hashtag, .mention) { color: var(--hero-kicker); font-weight: 500; }
#app .post-list .post-actions .icon-action:not([aria-pressed="true"]) { color: var(--muted); transition: color .2s; }
#app .post-list .post-actions .icon-action:not([aria-pressed="true"]):hover { color: var(--text); }
#app .post-list .post-body { padding-bottom: .375rem; }
#app .post-list .market-news-card.has-square { max-width: 34rem; margin-inline: auto; border: 0; background: none; }
.news-live { display: grid; gap: .625rem; padding: .875rem; border: 1px solid color-mix(in srgb, var(--border) 65%, transparent); border-radius: .75rem; background: var(--bg); }
.news-live-head, .news-live-tag { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; }
.news-live-brand { color: var(--accent); font-size: 1.0625rem; font-weight: 700; letter-spacing: -.01em; }
.news-live-label { color: var(--muted); font-size: .6875rem; font-weight: 600; letter-spacing: .08em; }
.news-live-picture { overflow: hidden; border-radius: .625rem; aspect-ratio: 976 / 480; }
.news-live-picture img { display: block; width: 100%; height: 100%; object-fit: cover; }
.news-art-light { display: none !important; }
:root[data-theme="light"] .news-art-dark { display: none !important; }
:root[data-theme="light"] .news-art-light { display: block !important; }
.news-live-tag { flex-wrap: wrap; row-gap: .125rem; }
.news-live-source { color: var(--text); font-size: .75rem; font-weight: 500; white-space: nowrap; }
.news-live-note { color: var(--muted); font-size: .6875rem; }
#app .news-live h3 { margin: 0; color: var(--text); font-family: var(--font-display); font-size: clamp(1.25rem, 2.6vw, 1.5rem); font-weight: 700; line-height: 1.22; letter-spacing: -.015em; text-wrap: balance; overflow-wrap: anywhere; }
.news-live-line { margin: 0; color: var(--muted); font-size: .75rem; }
.news-live-kicker { display: block; color: var(--accent); font-size: .6875rem; font-weight: 600; letter-spacing: .08em; }
.news-live-body { margin: .25rem 0 0; color: var(--text); font-size: .9375rem; line-height: 1.5; overflow-wrap: anywhere; }
.news-live-strong { font-weight: 500; }
.news-live-box { padding: .75rem; border-radius: .625rem; background: var(--panel-2); }
.news-live-picture { display: block; }

/* Only admins publish news, so members don't get the news button. */
body:not([data-role="admin"]) #compose-news { display: none !important; }

/* Settings: a menu whose rows open each section. */
html #app #settings-body { display: block; box-sizing: border-box; width: 100%; max-width: 46rem; margin-inline: auto; }
html #app #settings-body .page-title { margin-bottom: .25rem; }
html #app .settings-intro { margin: 0 0 1.25rem; }
html #app .settings-menu { display: grid; gap: 0; padding: .375rem; border: 1px solid var(--border); border-radius: 1rem; background: var(--panel); }
html #app .settings-row { display: flex; align-items: center; gap: 1rem; width: 100%; min-height: 4.5rem; padding: .625rem .875rem; border: 1px solid transparent; border-radius: .75rem; background: transparent; color: var(--text); text-align: left; cursor: pointer; transition: border-color .2s ease, background-color .2s ease; }
html #app .settings-row + .settings-row { margin-top: 1px; box-shadow: 0 -1px 0 color-mix(in srgb, var(--border) 70%, transparent); }
html #app .settings-row:hover, html #app .settings-row:focus-visible { border-color: var(--accent); background: var(--hover); box-shadow: none; outline: 0; }
html #app .settings-row:hover + .settings-row, html #app .settings-row:focus-visible + .settings-row { box-shadow: none; }
html #app .settings-row > .icon { flex: none; width: 1.125rem; height: 1.125rem; color: var(--muted); transition: color .2s ease; }
html #app .settings-row:hover > .icon, html #app .settings-row:focus-visible > .icon { color: var(--accent); }
html #app .settings-row-icon { display: grid; flex: none; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: .75rem; background: var(--panel-2); color: var(--accent); }
html #app .settings-row-icon .icon { width: 1.375rem; height: 1.375rem; }
html #app .settings-row-text { display: grid; flex: 1; gap: .125rem; min-width: 0; }
html #app .settings-row-text strong { font-size: .9375rem; font-weight: 600; }
html #app .settings-row-text span { color: var(--muted); font-size: .8125rem; line-height: 1.35; }
html #app .settings-back { display: inline-flex; align-items: center; gap: .375rem; min-height: 2.75rem; margin-bottom: .5rem; }
html #app #settings-body > .g-settings { margin: 0 0 1rem; }

/* Saved posts: thumbnails and collections. */
html #app #saved-body { box-sizing: border-box; width: 100%; max-width: 60rem; margin-inline: auto; }
html #app .saved-collections { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
html #app .saved-chip { display: inline-flex; align-items: center; gap: .375rem; min-height: 2.75rem; padding: .25rem .875rem; border: 1px solid var(--border); border-radius: 999px; background: var(--panel); color: var(--text); font-size: .8125rem; font-weight: 500; cursor: pointer; transition: border-color .2s ease, background-color .2s ease; }
html #app .saved-chip:hover { border-color: var(--border-strong); background: var(--panel-2); }
html #app .saved-chip.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--panel)); }
html #app .saved-chip-count { color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; }
html #app .saved-chip-new { border-style: dashed; color: var(--muted); }
html #app .saved-chip-new .icon { width: 1rem; height: 1rem; }
html #app .saved-collection-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .75rem; }
html #app .saved-collection-head[hidden] { display: none; }
html #app .saved-collection-head h2 { margin: 0; font-size: 1.125rem; font-weight: 600; overflow-wrap: anywhere; }
html #app .saved-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
html #app .saved-tile { position: relative; min-width: 0; }
html #app .saved-tile .thumb { display: block; width: 100%; min-width: 0; min-height: 0; aspect-ratio: 1; padding: 0; overflow: hidden; border: 1px solid var(--border); border-radius: .75rem; background: var(--panel); }
html #app .saved-tile .thumb img { width: 100%; height: 100%; object-fit: cover; }
html #app .saved-tile .thumb-stats { display: none; }
html #app .saved-tile .thumb-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; overflow: hidden; box-sizing: border-box; height: auto; padding: .75rem; background: transparent; color: var(--text); font-family: inherit; font-size: .8125rem; font-weight: 500; line-height: 1.35; text-align: left; }
html #app .saved-tile .thumb-card-body { padding: .625rem; }
html #app .saved-tile .news-live-picture img { border-radius: 0; }
/* Tiles with no picture start their words below the ⋮ button. */
html #app .saved-tile .thumb-text, html #app .saved-tile .thumb-card-body:not(:has(.news-live-picture)) { padding-top: 2.75rem; }
html #app .saved-tile-menu { position: absolute; top: .25rem; right: .25rem; display: grid; place-items: center; width: 2.25rem; height: 2.25rem; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: color-mix(in srgb, var(--panel) 88%, transparent); color: var(--text); cursor: pointer; }
html #app .saved-tile-menu:hover { border-color: var(--accent); }
html #app .saved-tile-menu .icon { width: 1.125rem; height: 1.125rem; }
html #app .saved-empty { padding: 2.5rem 1rem; }
.new-collection-form { display: grid; gap: .75rem; }
@media (max-width: 47.99rem) {
  html #app .settings-row { gap: .75rem; padding-inline: .625rem; }
  html #app .saved-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .25rem; }
  html #app .saved-tile .thumb { border-radius: .5rem; }
  html #app .saved-tile .thumb-card-body { gap: .25rem; padding: .375rem; }
  html #app .saved-tile .news-live-kicker { display: none; }
  html #app .saved-tile .news-live-picture { height: 2.75rem; aspect-ratio: auto; border-radius: .25rem; }
  html #app .saved-tile .thumb-card-title { -webkit-line-clamp: 3; font-size: .6875rem; line-height: 1.25; }
  html #app .saved-tile .thumb-text { -webkit-line-clamp: 4; padding: 2rem .5rem 0; font-size: .6875rem; line-height: 1.3; }
  html #app .saved-tile .thumb-card-body:not(:has(.news-live-picture)) { padding-top: 2rem; }
  html #app .saved-tile-menu { top: 0; right: 0; width: 2.75rem; height: 2.75rem; border: 0; background: transparent; }
  html #app .saved-tile-menu .icon { padding: .25rem; box-sizing: content-box; width: .875rem; height: .875rem; border-radius: 50%; background: color-mix(in srgb, var(--panel) 88%, transparent); }
}

/* Messages: older stylesheets load later, so these carry "html" to win. */
html #app #inbox-view { background: var(--bg); }
html #app #inbox-view .column { box-sizing: border-box; width: 100%; max-width: 46rem; margin-inline: auto; }
html #app #inbox-view .inbox-heading { display: none; }
html #app #inbox-view .section-head { display: flex; align-items: center; justify-content: space-between; min-height: 2.75rem; margin: 1rem 0 .25rem; padding: 0 .25rem; color: var(--muted); font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
html #app #inbox-view .section-head:first-of-type { margin-top: 0; }
html #app #inbox-view .section-head button { letter-spacing: 0; text-transform: none; }
html #app #inbox-view .conv-list { display: block; overflow: hidden; border: 1px solid var(--border); border-radius: 1rem; background: var(--panel); }
html #app #inbox-view .conv-list:empty { display: none; }
html #app #inbox-view .conv-list > li + li { border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent); }
html #app #inbox-view .conv-list .empty { padding: 1rem; }
html #app #inbox-view .ib-row { min-height: 4rem; padding: .375rem .5rem; border: 0; border-radius: 0; background: transparent; box-shadow: none; transition: background-color .2s ease; }
html #app #inbox-view .ib-row:hover { background: var(--hover); }
html #app #inbox-view .ib-row.unread { background: color-mix(in srgb, var(--accent) 8%, transparent); }
html #app #inbox-view .ib-row.unread .ib-name { font-weight: 700; }
html #app #chat-view { background: var(--bg); }
html #app #messages { padding-inline: max(1rem, calc((100% - 46rem) / 2)); }
html #app #chat-view > :not(#messages, #composer) { box-sizing: border-box; width: 100%; max-width: 46rem; margin-inline: auto; }
html #app #chat-view .msg { max-width: 78%; }
html #app #chat-view .msg:not(.mine, .deleted) .msg-bubble { border: 1px solid var(--border); background: var(--panel); }
html #app #chat-view .msg.mine:not(.deleted) .msg-bubble { border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border)); background: color-mix(in srgb, var(--accent) 20%, var(--panel)); color: var(--text); }
html #app #chat-view .msg-meta { color: var(--muted); }
html #app #composer { align-items: flex-end; padding-inline: max(1rem, calc((100% - 46rem) / 2)); }
html #app #composer textarea { min-height: 2.75rem; border: 1px solid var(--border); border-radius: 1.375rem; background: var(--panel); transition: border-color .2s ease; }
html #app #composer textarea:focus { border-color: var(--accent); }
html #app #composer .send-btn { flex: none; width: 2.75rem; height: 2.75rem; min-height: 2.75rem; border-radius: 50%; }

/* Profile */
/* compact-system.css loads later with the same selectors, so these carry "html" to win. */
#app #profile-head { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: .5rem; }
#app #profile-head > * { grid-column: 1 / -1; min-width: 0; }
#app #profile-head > .p-dashboard:has(+ .p-invite), #app #profile-head > .p-invite { grid-column: auto; }
html #app #profile-view .p-card {
  grid-template-columns: 6rem minmax(0, 1fr) auto;
  grid-template-areas: "photo info stats" "photo bio stats";
  align-items: start; gap: .5rem 1.25rem; padding: 1.5rem;
  border: 1px solid var(--hero-line); border-radius: 1rem;
  background: var(--hero-scrim), var(--hero-image) center / cover no-repeat, var(--hero-bg);
  color: var(--hero-ink);
}
html #app #profile-view .p-photo { grid-area: photo; width: 6rem; margin: 0; }
html #app #profile-view .p-ring .avatar.xl { width: 6rem; height: 6rem; min-width: 6rem; font-size: 2.25rem; }
html #app #profile-view .p-info { grid-area: info; gap: .375rem .5rem; }
html #app #profile-view .p-name { color: var(--hero-ink); font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 1.875rem); font-weight: 700; line-height: 1.15; letter-spacing: -.02em; }
html #app #profile-view .p-bio-block { grid-area: bio; display: flex; flex-wrap: wrap; gap: .25rem 1rem; max-width: 34rem; }
html #app #profile-view :is(.p-handle, .p-bio) { width: 100%; }
html #app #profile-view :is(.p-handle, .p-bio, .p-bio.muted, .p-joined, .p-level) { color: var(--hero-soft); }
html #app #profile-view .p-bio { color: var(--hero-ink); }
html #app #profile-view .p-bio.muted { color: var(--hero-soft); }
html #app #profile-view :is(.p-level, .p-joined) .icon { color: var(--hero-soft); }
html #app #profile-view .p-joined { margin: 0; }
html #app #profile-view .p-statbar { grid-area: stats; display: flex; align-self: end; width: auto; gap: 1.75rem; box-shadow: none; }
html #app #profile-view .ps-text strong { color: var(--hero-ink); font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
html #app #profile-view .ps-text span { color: var(--hero-soft); }
html #app #profile-view .p-shortcuts { flex-wrap: wrap; gap: .5rem; padding: 0; }
html #app #profile-view .p-shortcut { display: inline-flex; flex: 0 0 auto; align-items: center; gap: .5rem; padding: .25rem .875rem .25rem .25rem; border: 1px solid var(--border); border-radius: 999px; background: var(--panel); font-size: .8125rem; font-weight: 500; transition: border-color .2s ease, background-color .2s ease; }
html #app #profile-view .p-shortcut:hover { border-color: var(--border-strong); background: var(--panel-2); }
html #app #profile-view .p-shortcut-ring { width: 2.25rem; height: 2.25rem; padding: 0; border: 0; background: var(--panel-2); }
html #app #profile-view .p-shortcut-ring .icon { width: 1.125rem; height: 1.125rem; }
html #app #profile-view .profile-tabs button[aria-selected="true"]::after { background: var(--accent); }
html #app #profile-view #profile-grid { gap: .5rem; margin-top: .75rem; overflow: visible; }
html #app #profile-view .thumb { aspect-ratio: 1; border-radius: .75rem; }
html #app #profile-view .thumb.thumb-card { border: 1px solid var(--border); background: var(--panel); }
html #app #profile-view .thumb:not(.thumb-card) { border: 1px solid var(--border); background: var(--panel); }
html #app #profile-view .thumb-text { display: -webkit-box; height: 100%; padding: .75rem .75rem 2rem; background: transparent; text-align: left; }
.thumb-card-body { display: flex; flex-direction: column; gap: .375rem; box-sizing: border-box; height: 100%; padding: .625rem .625rem 2rem; overflow: hidden; color: var(--text); text-align: left; }
.thumb-card-body .news-live-picture { flex: none; border-radius: .5rem; }
.thumb-card-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; font-size: .8125rem; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
html #app #profile-view :is(.thumb-card, .thumb:has(.thumb-text)) .thumb-stats { background: var(--panel); padding: .375rem .625rem; color: var(--muted); }
html #app #profile-view .p-buttons { width: 100%; max-width: none; }
@media (max-width: 47.99rem) {
  #app #profile-head > .p-dashboard:has(+ .p-invite), #app #profile-head > .p-invite { grid-column: 1 / -1; }
  html #app #profile-view .p-card { grid-template-columns: 4.5rem minmax(0, 1fr); grid-template-areas: "photo info" "bio bio" "stats stats"; gap: .75rem 1rem; padding: 1rem; background: var(--hero-scrim-phone), var(--hero-image) center / cover no-repeat, var(--hero-bg); }
  html #app #profile-view .p-photo { width: 4.5rem; }
  html #app #profile-view .p-ring .avatar.xl { width: 4.5rem; height: 4.5rem; min-width: 4.5rem; font-size: 1.625rem; }
  html #app #profile-view .p-statbar { justify-content: space-between; width: 100%; padding-top: .75rem; border-top: 1px solid var(--hero-line); }
  html #app #profile-view #profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); box-sizing: border-box; padding-inline: .75rem; }
  .thumb-card-title { -webkit-line-clamp: 2; }
  .thumb-card-body .news-live-picture { height: 3.5rem; aspect-ratio: auto; }
}
#app .post-list .market-news-card.has-square .market-news-footer { padding-inline: .75rem; color: var(--muted); }
#app .post-list > .suggest { margin-bottom: .75rem; padding: 1rem; border: 1px solid color-mix(in srgb, var(--border) 65%, transparent); border-radius: 1rem; }
/* Lessons: one comfortable reading column, a quiet disclaimer, and clear right and wrong answers. */
:root { --answer-right: #146b45; --answer-wrong: #b0262c; }
:root[data-theme="dark"] { --answer-right: #6fdcaa; --answer-wrong: #f58a8e; }
#app #lesson-body { width: min(100%, 48rem); margin-inline: auto; }
#app #lesson-body .lesson-top { margin-bottom: 1.5rem; }
#app #lesson-body .mins { color: var(--muted); font-size: .8125rem; font-weight: 500; }
#app #lesson-body .lesson-title { margin: 0 0 1rem; font-size: clamp(1.75rem, 3.6vw, 2.5rem); font-weight: 600; line-height: 1.12; letter-spacing: -.028em; text-wrap: balance; }
#app #lesson-body .prose p, #app #lesson-body .prose li { max-width: none; text-wrap: pretty; }
#app #lesson-body .lesson-disclaimer { margin: 0 0 1.5rem; padding: .625rem .875rem; border-left: 2px solid var(--border); color: var(--muted); font-size: .8125rem; line-height: 1.55; }
#app #lesson-body .lesson-disclaimer strong { color: inherit; font-weight: 600; }
#app #lesson-body :is(.example, .practice, .question) { border-color: color-mix(in srgb, var(--border) 65%, transparent); box-shadow: none; }
#app #lesson-body .example { margin-block: 2rem; }
#app #lesson-body .practice { margin-top: 2rem; border-left: 1px solid color-mix(in srgb, var(--border) 65%, transparent); }
#app #lesson-body :is(.example, .quiz, .practice, .lesson-thread) h2 { font-size: 1.25rem; font-weight: 600; letter-spacing: -.015em; }
#app #lesson-body .quiz { margin-top: 2rem; }
#app #lesson-body .quiz > h2 { margin-bottom: .75rem; }
#app #lesson-body .prompt { font-weight: 600; line-height: 1.4; }
#app #lesson-body .qnum { background: var(--hover); color: var(--text); font-weight: 600; }
#app :is(#lesson-body, #review-body) .option.right { border-color: var(--answer-right); background: color-mix(in srgb, var(--answer-right) 12%, transparent); color: var(--text); opacity: 1; }
#app :is(#lesson-body, #review-body) .option.right .radio { border-color: var(--answer-right); }
#app :is(#lesson-body, #review-body) .option.wrong { border-color: var(--answer-wrong); background: color-mix(in srgb, var(--answer-wrong) 10%, transparent); }
#app :is(#lesson-body, #review-body) .option.wrong .radio { border-color: var(--answer-wrong); }
#app :is(#lesson-body, #review-body) .feedback.right { color: var(--answer-right); font-weight: 500; }
#app :is(#lesson-body, #review-body) .feedback.wrong { color: var(--answer-wrong); font-weight: 500; }
.course-zone-label { paint-order: stroke; stroke: var(--panel, #17221e); stroke-width: 3px; stroke-linejoin: round; }
.chart .bar.s0.gain { fill: var(--success, #3dd68c); }
.chart .bar.s0.loss { fill: var(--danger, #e5484d); }
#learn-view .journal-page { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
#toast:has(.toast-action) { pointer-events: auto; }
.toast-action { margin-left: .5rem; padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.top-search { display: inline-flex; align-items: center; gap: .5rem; min-height: 2.25rem; padding: 0 .75rem; border: 1px solid var(--border); border-radius: 999px; background: var(--panel); color: var(--muted); font: inherit; font-size: .875rem; cursor: pointer; }
.top-search:hover { color: var(--text); border-color: var(--accent); }
.top-search-key { padding: .0625rem .375rem; border: 1px solid var(--border); border-radius: .375rem; font: inherit; font-size: .6875rem; }
@media (max-width: 760px) {
  .top-search { padding: 0 .5rem; border: 0; background: none; color: inherit; }
  .top-search-label, .top-search-key { display: none; }
}
.search-dialog { width: min(40rem, calc(100vw - 2rem)); max-height: min(80vh, 44rem); margin: 8vh auto auto; padding: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 1rem; background: var(--panel); color: var(--text); }
.search-dialog[open] { display: flex; flex-direction: column; }
.search-box { display: flex; align-items: center; gap: .5rem; padding: .75rem; border-bottom: 1px solid var(--border); }
.search-box input { flex: 1; min-width: 0; margin: 0; border: 0; background: none; color: inherit; font: inherit; font-size: 1rem; }
.search-box input:focus { outline: none; }
.search-results { padding: .75rem; overflow-y: auto; }
.search-group { margin-bottom: .75rem; }
.search-group h3 { margin: 0 0 .25rem; font-size: .8125rem; }
.search-result { display: grid; gap: .125rem; width: 100%; padding: .5rem .625rem; border: 0; border-radius: .625rem; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.search-result:hover, .search-result:focus-visible { background: var(--hover); }
.search-result .pill { margin-left: .5rem; }
.homework-status:empty { display: none; }
.homework-review { display: grid; gap: .5rem; margin-bottom: .75rem; }
.homework-note { margin: 0; padding: .625rem .75rem; border-radius: .625rem; background: var(--hover); white-space: pre-wrap; overflow-wrap: anywhere; }
.journal-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 120px), 1fr)); gap: .5rem; margin: .75rem 0; }
.journal-stat { display: grid; gap: .125rem; padding: .625rem .75rem; border: 1px solid var(--border); border-radius: .75rem; }
.journal-actions { margin: .75rem 0; }
.journal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: .625rem; }
.journal-form, .journal-breakdown, .journal-trade, .journal-chart { margin-bottom: .75rem; }
.journal-essentials { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.journal-essentials input, .journal-essentials select { min-width: 0; width: 100%; }
.journal-stat .stat-label { color: var(--muted); font-weight: 500; }
.journal-highlights { grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr)); }
.journal-highlights .journal-stat strong { font-size: 1.375rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.journal-more > summary, .journal-details > summary { width: fit-content; padding: .25rem 0; color: var(--muted); font-size: .875rem; font-weight: 500; cursor: pointer; }
.journal-more > summary:hover, .journal-details > summary:hover { color: var(--text); }
.journal-details[open] { display: grid; gap: .75rem; }
.journal-risk { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: .75rem 1.25rem; align-items: start; padding: .875rem; border-radius: .75rem; background: var(--hover); }
.journal-risk-output { display: grid; gap: .25rem; min-width: 0; }
.journal-risk-output p { margin: 0; }
.journal-risk-output .link { justify-self: start; }
.journal-risk-line { display: flex; justify-content: space-between; gap: .75rem; font-size: .875rem; font-variant-numeric: tabular-nums; }
.journal-risk-line span { color: var(--muted); }
.journal-risk-line strong { font-weight: 600; }
.journal-risk-line.warn strong { color: var(--answer-wrong); }
.journal-close { display: grid; gap: .625rem; margin-top: .5rem; }
.journal-chart svg { display: block; width: 100%; height: auto; }
.journal-chart h2 { margin: 0; font-size: 1rem; }
.journal-total { font-variant-numeric: tabular-nums; }
.journal-total.up { color: var(--answer-right); }
.journal-total.down { color: var(--answer-wrong); }
.journal-chart-zero { stroke: var(--border); stroke-dasharray: 4 4; }
.journal-chart-line { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.journal-chart-line.up { stroke: var(--answer-right); }
.journal-chart-line.down { stroke: var(--answer-wrong); }
.journal-chart-dot.up { fill: var(--answer-right); }
.journal-chart-dot.down { fill: var(--answer-wrong); }
.journal-chart-label { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
@media (max-width: 520px) {
  .journal-risk { grid-template-columns: minmax(0, 1fr); }
  .journal-essentials { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.journal-trades h2 { margin: 1rem 0 .5rem; }
.journal-trade p { margin: .375rem 0; overflow-wrap: anywhere; }
.direction-lesson { display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: 100%; min-height: 72px; padding: 1rem; border: 1px solid var(--border); border-radius: .875rem; background: var(--ui-surface); color: var(--ui-ink); text-align: left; font: inherit; cursor: pointer; }
.direction-lesson > span:first-child { display: grid; min-width: 0; gap: .25rem; }
.direction-lesson strong { font-weight: 600; font-size: 1rem; overflow-wrap: anywhere; }
.direction-lesson-status { display: flex; align-items: center; flex-shrink: 0; gap: .375rem; font-size: .75rem; color: var(--ui-muted); }
.direction-lesson-status .icon { width: 18px; height: 18px; }
.direction-practices { margin-top: 1.5rem; }
.direction-practices h2, .direction-empty h2 { font-size: 1.125rem; font-weight: 600; }
.direction-empty { display: grid; justify-items: start; gap: .875rem; padding: 1.25rem; background: var(--ui-surface); border: 1px solid var(--border); border-radius: var(--ui-radius-panel); }
.direction-empty > .icon { color: var(--ui-accent); width: 28px; height: 28px; }
.direction-empty :is(h2, p) { margin: 0; }
.learning-direction:focus-visible, .direction-lesson:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 3px; }
@media (hover: hover) {
  .learning-direction:hover, .direction-lesson:hover { border-color: var(--ui-accent); background: var(--hover); }
}
@media (max-width: 540px) {
  .learning-directions { grid-template-columns: minmax(0, 1fr); gap: .75rem; }
  .learning-intro { margin-block: 1rem .75rem; }
  .learning-intro .page-title { font-size: 1.375rem; }
  .learning-intro p { font-size: .875rem; line-height: 1.5; }
  .learning-direction { grid-template-columns: 32px minmax(0, 1fr); padding: .875rem; gap: .5rem; }
  .direction-icon { width: 32px; height: 32px; }
  .direction-title { font-size: 1.25rem; }
  .direction-description { font-size: .875rem; line-height: 1.5; }
  .direction-topics { display: none; }
  .direction-action { margin: 0; padding-top: .25rem; border: 0; }
  .direction-lesson { padding: .875rem; gap: .5rem; }
  .direction-lesson-status { font-size: 0; gap: 0; }
}

/* ---- Admin content assistant (public/content.js) ---- */
.ca-card { position: relative; display: grid; gap: var(--ui-gap); padding: var(--ui-panel-padding); border-radius: var(--ui-radius-panel); background: var(--ui-surface); }
.ca-card h2 { display: flex; align-items: center; gap: .5rem; margin: 0; font-size: var(--ui-text-heading); font-weight: 600; letter-spacing: -.02em; }
.ca-card h2 .icon { width: 20px; height: 20px; color: var(--ui-accent); }
.ca-card h3 { margin: 0; font-size: var(--ui-text-label); font-weight: 600; }
.ca-card p { margin: 0; }
.ca-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.ca-meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; min-width: 0; }
.ca-field { display: grid; gap: .5rem; }
.ca-label { font-weight: 600; font-size: var(--ui-text-label); }
.ca-gen .chip.on, .ca-list .chip.on { background: var(--ui-ink); border-color: var(--ui-ink); color: var(--ui-canvas); }
.ca-note { display: flex; align-items: flex-start; gap: .5rem; padding: .75rem .875rem; border-radius: var(--ui-radius-control); background: var(--ui-inset); color: var(--ui-muted); font-size: var(--ui-text-body); line-height: 1.5; }
.ca-note .icon { flex: none; width: 18px; height: 18px; margin-top: .1rem; color: var(--ui-accent); }
.ca-note.warn { background: color-mix(in srgb, var(--warning) 14%, var(--ui-surface)); color: var(--ui-ink); }
.ca-busy { display: flex; align-items: center; gap: .75rem; padding: .75rem .875rem; border-radius: var(--ui-radius-control); background: var(--ui-inset); }
.ca-spin { flex: none; width: 20px; height: 20px; border: 2px solid color-mix(in srgb, var(--ui-accent) 25%, transparent); border-top-color: var(--ui-accent); border-radius: 50%; animation: ca-spin .8s linear infinite; }
@keyframes ca-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ca-spin { animation-duration: 2.4s; } }
.ca-editor-head { flex-wrap: nowrap; align-items: flex-start; }
.ca-editor-head .ca-meta { flex: 1; }
.ca-editor textarea { line-height: 1.55; font-size: var(--ui-text-body); }
.ca-editor :is(input, textarea):disabled { opacity: .75; }
.ca-counter { display: flex; justify-content: space-between; gap: .75rem; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.ca-counter .danger { color: var(--ui-error); font-weight: 600; }
.ca-sources { display: grid; gap: .5rem; padding: .875rem; border-radius: var(--ui-radius-control); background: var(--ui-inset); }
.ca-sources ul { display: grid; gap: .375rem; margin: 0; padding-left: 1.1rem; }
.ca-sources a { color: var(--link, var(--sage-deep)); font-weight: 600; overflow-wrap: anywhere; }
.ca-issues { display: grid; gap: .375rem; margin: 0; padding: 0; list-style: none; }
.ca-issues li { display: flex; align-items: flex-start; gap: .5rem; font-size: var(--ui-text-body); color: var(--ui-error); }
.ca-issues .icon { flex: none; width: 16px; height: 16px; margin-top: .15rem; }
.ca-tools { display: grid; gap: .5rem; padding-top: .75rem; border-top: 1px solid var(--border); }
.ca-tool-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.ca-translate { display: inline-flex; align-items: center; gap: .375rem; }
.ca-translate select { width: auto; min-height: 2.25rem; padding-block: .25rem; }
.ca-editor.is-busy > :not(.ca-overlay) { opacity: .45; pointer-events: none; }
.ca-overlay { position: absolute; inset: 0; display: grid; place-items: start center; padding-top: 8rem; border-radius: inherit; }
.ca-overlay-box { position: sticky; top: 6rem; display: flex; align-items: center; gap: .75rem; padding: .875rem 1.25rem; border-radius: var(--ui-radius-control); background: var(--ui-surface); box-shadow: var(--ui-elevation), 0 0 0 1px var(--border); font-weight: 600; }
.ca-list .a-row.on { background: var(--ui-selected); }
.ca-status-draft { background: var(--gold-mark-soft); color: var(--gold-mark); }
.ca-status-approved { background: color-mix(in srgb, var(--ui-accent) 16%, var(--ui-surface)); color: var(--ui-accent); }
.ca-status-published { background: color-mix(in srgb, var(--positive) 16%, var(--ui-surface)); color: var(--positive-deep); }
.ca-gen .row-actions .primary, .ca-editor .row-actions .primary { min-height: var(--ui-control-height); padding-inline: 1.25rem; }
@media (max-width: 540px) {
  .ca-card { padding: 1rem; }
  .ca-tool-row .ghost { flex: 1 1 auto; }
}

/* ---- Access levels: Observer (pending) and Community (verified), public/observer.js ---- */
.access-badge { display: inline-flex; align-items: center; gap: .3rem; width: fit-content; }
.access-badge .icon { width: 14px; height: 14px; }
.access-detail { font-weight: 500; opacity: .85; }
.access-observer { background: var(--gold-mark-soft); color: var(--gold-mark); }
.access-community { background: color-mix(in srgb, var(--positive) 16%, var(--ui-surface)); color: var(--positive-deep); }
.p-info > .access-badge { margin-block: .25rem; }
/* Other modules retain their existing Observer visibility rules. Post actions stay visible. */
body[data-access="observer"] :is(.track-btn, .p-track, #new-message-btn, #new-channel-btn,
  [data-nav="qa"], [data-nav="skills"], [data-nav="support"], [data-nav="reviews"], [data-nav="lessons"], [data-open-channel]) { display: none !important; }
.observer-banner { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .75rem; margin-bottom: var(--ui-gap); padding: .875rem 1rem; border-radius: var(--ui-radius-panel); background: var(--ui-surface); }
.observer-banner p { margin: 0; font-size: var(--ui-text-body); color: var(--ui-muted); }
@media (max-width: 540px) {
  .observer-banner { grid-template-columns: 1fr; gap: .5rem; }
}
.access-card { display: grid; gap: var(--ui-gap); padding: var(--ui-panel-padding); border-radius: var(--ui-radius-panel); }
.access-card p { margin: 0; }
.access-card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.access-card-head h2 { margin: 0; font-size: var(--ui-text-heading); }
.access-journey { display: flex; gap: .25rem; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.access-journey li { flex: 1; padding: .5rem .625rem; border-radius: var(--ui-radius-control); background: var(--ui-inset); font-size: var(--ui-text-caption); font-weight: 600; color: var(--ui-muted); text-align: center; }
.access-journey li.done { color: var(--gold-mark); }
.access-journey li.now { background: var(--ui-selected); color: var(--ui-accent); }
.access-table { width: 100%; border-collapse: collapse; font-size: var(--ui-text-body); }
.access-table :is(th, td) { padding: .5rem .5rem .5rem 0; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.access-table thead th { font-size: var(--ui-text-caption); color: var(--ui-muted); font-weight: 600; }
.access-table tbody th { font-weight: 600; white-space: nowrap; }
.access-note { display: grid; gap: .5rem; justify-items: start; }
.access-note label { width: 100%; }


/* Mission dashboard only. Uses the existing charcoal, orange, brown and ink tokens. */
body[data-view="mission"] #app .topbar { position: sticky; top: 0; z-index: 12; min-height: 56px; padding-inline: 16px; background: var(--panel); }
body[data-view="mission"] #app #view-title { visibility: visible; font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; }
body[data-view="mission"] :is(.top-brand, #theme-btn, #topbar-create) { display: none; }
body[data-view="mission"] #app .top-actions { margin-left: auto; gap: 4px; }
body[data-view="mission"] #app .top-actions .icon-btn { width: 44px; height: 44px; padding: 10px; }
body[data-view="mission"] .top-actions .icon { width: 22px; height: 22px; }
#mission-body { --mission-radius: 20px; --mission-gap: 12px; padding: 16px 12px 24px; width: 100%; max-width: 1100px; margin-inline: auto; }
#mission-body .m-tabs { display: flex; flex-wrap: nowrap; gap: 4px; padding: 4px; margin: 0 0 16px; border: 1px solid var(--border); border-radius: 999px; background: var(--panel); overflow-x: auto; scrollbar-width: none; }
#mission-body .m-tabs::-webkit-scrollbar { display: none; }
#mission-body .m-tabs button { flex: 1 0 auto; min-width: 0; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: .8125rem; font-weight: 500; white-space: nowrap; overflow-wrap: normal; line-height: 1.35; transition: background-color 160ms cubic-bezier(.2,.7,.2,1), color 160ms cubic-bezier(.2,.7,.2,1); }
#mission-body .m-tabs button.on { background: var(--text); color: var(--bg); font-weight: 600; box-shadow: none; }
#mission-body .m-tabs button:focus-visible { outline: 2px solid var(--sage-main); outline-offset: -3px; transition: none; }
#mission-body .m-content { gap: var(--mission-gap); }
#mission-body .m-overview { display: grid; grid-template-columns: minmax(0, 1fr); }
#mission-body .m-overview > * { min-width: 0; }
#mission-body .m-overview > .g-section-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; margin: 6px 0 -4px; }
#mission-body .m-overview > .g-section-head h2 { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; line-height: 1.3; margin: 0; }
#mission-body .m-overview > .g-section-head button { min-height: 44px; padding: 8px 0; font-size: .8125rem; }
#mission-body .m-overview .m-hero { position: relative; overflow: hidden; padding: 18px; background: var(--mint); color: var(--text); border: 1px solid color-mix(in srgb, var(--sage-main) 12%, var(--mint)); border-radius: var(--mission-radius); }
#mission-body .m-overview .m-hero > :is(.g-kicker, .m-statement, .m-edit) { position: relative; z-index: 1; }
#mission-body .m-overview .m-hero .g-kicker { margin: 0 0 8px; color: var(--sage-main); font-size: .6875rem; font-weight: 500; letter-spacing: .09em; text-transform: uppercase; }
#mission-body .m-overview .m-hero .m-statement { max-width: 33ch; margin: 0; padding: 0; font-family: var(--font-display); font-size: clamp(1.25rem, 4.5vw, 1.625rem); font-weight: 600; letter-spacing: -.02em; line-height: 1.2; color: var(--sage-main); text-wrap: pretty; }
#mission-body .m-overview .m-hero .m-edit { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin: 0; padding: 6px 0; color: var(--sage-deep); font-size: .75rem; }
#mission-body .m-overview .m-hero .m-edit .icon { width: 14px; height: 14px; }
#mission-body .m-hero-art { position: absolute; top: 28px; right: -10px; width: 132px; height: 160px; pointer-events: none; opacity: .22; }
#mission-body .m-hero-sun { position: absolute; width: 106px; height: 106px; border-radius: 50%; right: -2px; bottom: 0; background: color-mix(in srgb, var(--sage-main) 30%, var(--mint)); }
#mission-body .m-hero-mountain { position: absolute; inset: 48px 0 0; clip-path: polygon(0 100%, 25% 68%, 43% 59%, 64% 15%, 100% 100%); background: color-mix(in srgb, var(--panel) 80%, var(--mint)); }
#mission-body .m-hero-mountain.near { inset: 68px -24px 0 14px; clip-path: polygon(0 100%, 28% 68%, 49% 18%, 60% 48%, 73% 35%, 100% 100%); background: var(--panel); }
#mission-body .m-hero-art > .icon { position: absolute; right: 30px; top: 8px; width: 42px; height: 56px; color: var(--sage-main); }
#mission-body .m-overview .m-impact { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
#mission-body .m-overview .m-hero .m-stat { display: grid; grid-template-columns: 22px minmax(0, 1fr); align-items: center; align-content: start; gap: 4px 8px; min-width: 0; min-height: 70px; padding: 10px; border: 0; border-radius: 12px; background: var(--panel); }
#mission-body .m-overview .m-stat .icon { width: 20px; height: 20px; color: var(--sage-main); --duo: transparent; }
#mission-body .m-overview .m-hero .m-stat strong { color: var(--text); font-family: var(--font-ui); font-size: 1.375rem; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
#mission-body .m-overview .m-hero .m-stat > span { grid-column: 1 / -1; color: var(--muted); font-size: .75rem; line-height: 1.35; overflow-wrap: anywhere; }
#mission-body .m-overview .m-me { display: grid; gap: 7px; padding: 16px; border: 1px solid var(--border); border-radius: var(--mission-radius); background: var(--panel); }
#mission-body .m-overview .m-me p { margin: 0; }
#mission-body .m-overview .m-me-head { gap: 10px; align-items: center; }
#mission-body .m-overview .m-tier-mark { width: 40px; height: 40px; border-radius: 12px; }
#mission-body .m-overview .m-tier-mark .icon { width: 24px; height: 24px; }
#mission-body .m-overview .m-me .g-kicker { color: var(--sage-main); font-size: .625rem; line-height: 1.4; text-transform: uppercase; letter-spacing: .07em; }
#mission-body .m-overview .m-me-head h2 { margin: 2px 0 0; font-size: 1rem; line-height: 1.3; }
#mission-body .m-overview .m-me .small { font-size: .75rem; line-height: 1.5; }
#mission-body .m-overview .m-bar { height: 6px; margin-block: 2px; background: var(--hover); }
#mission-body .m-overview .m-bar-fill { background: var(--sage); }
#mission-body .m-overview .m-me .m-note { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; row-gap: 0; }
#mission-body .m-overview .m-me .m-note button { min-height: 44px; font-size: .75rem; padding: 4px 0; }
#mission-body .m-overview .m-campaign-invite { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 6px 12px; padding: 16px; border: 1px solid var(--border); border-left: 3px solid var(--sage-main); border-radius: var(--mission-radius); background: var(--panel); }
#mission-body .m-overview .m-invite-icon { grid-column: 1; grid-row: 1 / 3; width: 40px; height: 40px; border-radius: 12px; background: var(--mint); color: var(--sage-main); }
#mission-body .m-overview .m-invite-copy h3 { margin: 0 0 4px; font-size: 1rem; font-weight: 600; }
#mission-body .m-overview .m-invite-copy p { margin: 0; max-width: 50ch; color: var(--muted); font-size: .8125rem; line-height: 1.45; }
#mission-body .m-overview .m-campaign-invite > button { grid-column: 2; justify-self: start; min-height: 44px; margin-top: 2px; padding: 8px 12px; border-radius: 10px; font-size: .8125rem; }
#mission-body .m-overview .m-campaign-proposals { min-height: 64px; margin: 0; padding: 10px 14px; gap: 10px; border: 1px solid var(--border); border-radius: 14px; background: transparent; }
#mission-body .m-overview .m-proposals > span { min-width: 0; }
#mission-body .m-overview .m-proposals strong { font-size: .875rem; line-height: 1.35; }
#mission-body .m-overview .m-proposals .small { font-size: .75rem; line-height: 1.45; margin-top: 3px; }
#mission-body .m-overview .m-volunteer-section { margin: 2px 0 0; padding: 0; border-block: 1px solid var(--border); }
#mission-body .m-overview .m-volunteer-section > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-height: 52px; padding: 10px 2px; list-style: none; font-size: .875rem; }
#mission-body .m-overview .m-volunteer-section > summary::-webkit-details-marker { display: none; }
#mission-body .m-overview .m-volunteer-section > summary > strong { margin: 0; font-weight: 600; }
#mission-body .m-overview .m-volunteer-section > summary > .small { color: var(--muted); font-size: .75rem; }
#mission-body .m-volunteer-chevron { display: grid; place-items: center; margin-left: auto; color: var(--muted); }
#mission-body .m-volunteer-chevron .icon { width: 18px; height: 18px; transition: transform 160ms cubic-bezier(.2,.7,.2,1); }
#mission-body details[open] .m-volunteer-chevron .icon { transform: rotate(90deg); }
#mission-body .m-overview .m-volunteer-section[open] { padding-bottom: 12px; }
#mission-body .m-overview .m-volunteer-section .m-note { margin: 0 0 12px; font-size: .8125rem; }
#mission-body .m-overview .m-volunteer-section > .m-proposals { margin-bottom: 12px; padding: 12px; border-style: solid; border-radius: 12px; }
#mission-body .m-overview .m-roles { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
#mission-body .m-overview .m-role { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--panel); }
#mission-body .m-overview .m-role-head { align-items: start; gap: 10px; }
#mission-body .m-overview .m-role-head > div { min-width: 0; }
#mission-body .m-overview .m-role-head strong { font-size: .875rem; line-height: 1.4; overflow-wrap: anywhere; }
#mission-body .m-overview .m-role-head p { display: block; margin-top: 4px; font-size: .8125rem; line-height: 1.5; }
#mission-body .m-overview .m-role-icon { width: 32px; height: 32px; border-radius: 10px; }
#mission-body .m-overview .m-role-time { grid-column: 1; padding: 0; font-size: .75rem; }
#mission-body .m-overview .m-role-foot { display: flex; grid-column: 1; grid-row: auto; padding: 0; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
#mission-body .m-overview .m-role-count { display: inline-flex; font-size: .75rem; }
#mission-body .m-overview .m-role-foot button { min-height: 44px; max-width: 100%; font-size: .75rem; padding: 8px 12px; }
#mission-body .m-overview .m-leaders { gap: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 16px; background: var(--panel); }
#mission-body .m-overview .m-leaders > li + li { border-top: 1px solid var(--border); }
#mission-body .m-overview .m-leader { min-height: 64px; width: 100%; padding: 10px 12px; gap: 10px; border: 0; border-radius: 0; background: transparent; }
#mission-body .m-overview .m-leaders > li:first-child { background: color-mix(in srgb, var(--gold-mark) 5%, var(--panel)); }
#mission-body .m-overview .m-rank { width: 28px; height: 28px; font-size: .8125rem; }
#mission-body .m-overview .m-leader .avatar { width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; }
#mission-body .m-overview .m-leader-name { min-width: 0; flex: 1; font-size: .875rem; line-height: 1.4; }
#mission-body .m-overview .m-leader-name .small { font-size: .75rem; }
#mission-body .m-overview .m-leader-pts { flex-shrink: 0; font-size: .9375rem; font-weight: 600; }
#mission-body .m-overview .m-leader-pts .small { font-size: .75rem; font-weight: 400; }
#mission-body :is(button, summary):focus-visible { outline: 2px solid var(--sage-main); outline-offset: 3px; }
@media (hover: hover) {
  #mission-body .m-tabs button:not(.on):hover { background: var(--hover); color: var(--text); }
  #mission-body .m-overview :is(.m-leader, .m-campaign-proposals):hover { background: var(--hover); }
}
@media (min-width: 768px) {
  #mission-body { padding: 24px; }
  #mission-body .m-overview .m-impact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #mission-body .m-overview .m-hero { padding: 24px; }
  #mission-body .m-overview .m-hero .m-statement { max-width: 36ch; font-size: 1.875rem; padding-right: 64px; }
  #mission-body .m-hero-art { width: 200px; height: 190px; top: 10px; right: 18px; opacity: .4; }
  #mission-body .m-overview .m-roles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  body[data-view="mission"] #app .topbar { padding-inline: 28px; }
  #mission-body .m-overview .m-me { padding: 18px 20px; }
}
@media (max-width: 767px) {
  body[data-view="mission"] #app .floating-nav .tab-create .tab-create-disc { border-radius: 50% !important; }
}
@media (prefers-reduced-motion: reduce) {
  #mission-body .m-tabs button, #mission-body .m-volunteer-chevron .icon { transition: none; }
}


/* Circles: one responsive discovery page; all data and actions stay in gather.js. */
#circles-body { width: 100%; max-width: 1000px; padding: 16px; margin-inline: auto; }
#circles-body .c-hero { position: relative; display: block; overflow: hidden; min-height: 0; margin: 0 0 16px; padding: 24px; border: 1px solid var(--border); border-radius: 22px; background: var(--mint); color: var(--text); }
#circles-body .c-hero-text { position: relative; z-index: 1; display: grid; justify-items: start; align-content: start; gap: 10px; width: 64%; padding: 0; max-width: none; }
#circles-body .c-hero-text .g-kicker { margin: 0; max-width: none; font-size: .6875rem; line-height: 1.4; letter-spacing: .08em; color: var(--sage-main); text-transform: uppercase; }
#circles-body .c-hero-text h2 { margin: 0; max-width: 23ch; font-family: var(--font-ui); font-size: clamp(1.375rem, 2.6vw, 1.875rem); font-weight: 600; line-height: 1.15; letter-spacing: -.025em; text-wrap: balance; }
#circles-body .c-hero-text > p:not(.g-kicker) { max-width: 48ch; margin: 0; color: var(--muted); font-size: .875rem; line-height: 1.55; }
#circles-body .c-hero .g-cta { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 44px; margin-top: 2px; padding: 10px 16px; border-radius: 999px; font-size: .875rem; }
#circles-body .c-hero-media { position: absolute; inset: 0 0 0 auto; z-index: 0; width: 34%; height: 100%; margin: 0; overflow: hidden; opacity: 1; pointer-events: none; }
#circles-body .c-hero::after { display: none; }
#circles-body .c-hero-media > :is(svg, img) { position: static; display: block; width: 100%; height: 100%; object-fit: cover; }
#circles-body .c-filters { display: flex; flex-wrap: nowrap; width: 100%; gap: 8px; padding: 0 0 4px; margin: 0 0 16px; overflow-x: auto; scrollbar-width: none; }
#circles-body .c-filters::-webkit-scrollbar { display: none; }
#circles-body .c-filter { display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: 1 0 auto; min-height: 44px; padding: 10px 16px; border: 1px solid var(--border); border-radius: 999px; background: var(--panel); color: var(--muted); font-family: var(--font-ui); font-size: .8125rem; font-weight: 500; white-space: nowrap; }
#circles-body .c-filter.on { background: var(--sage-main); border-color: var(--sage-main); color: var(--on-accent); font-weight: 600; }
#circles-body .c-filter .icon { flex: none; width: 17px; height: 17px; }
#circles-body .cc-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin: 0; }
#circles-body .cc { position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr) 84px; align-items: start; gap: 8px 14px; padding: 16px; margin: 0; min-width: 0; min-height: 0; border: 1px solid var(--border); border-radius: 20px; background: var(--panel); color: var(--text); box-shadow: none; cursor: pointer; overflow: visible; }
#circles-body .cc-tile { grid-column: 1; grid-row: 1 / 3; align-self: start; display: grid; place-items: center; width: 64px; height: 72px; min-width: 0; margin: 0; padding: 8px; border-radius: 14px; background: var(--mint); font-size: 2rem; line-height: 1; }
#circles-body .cc-body { grid-column: 2; grid-row: 1; min-width: 0; padding: 0; margin: 0; }
#circles-body .cc-kicker { display: block; margin: 0 0 4px; color: var(--sage-main); font-size: .625rem; font-weight: 600; line-height: 1.4; letter-spacing: .08em; text-transform: uppercase; }
#circles-body .cc-name { display: block; overflow: visible; margin: 0; padding: 0; max-width: none; color: var(--text); font-family: var(--font-ui); font-size: 1rem; font-weight: 600; line-height: 1.35; letter-spacing: -.015em; }
#circles-body .cc-open { display: block; width: 100%; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 3px; background: transparent; color: inherit; font: inherit; text-align: left; white-space: normal; overflow-wrap: anywhere; cursor: pointer; }
#circles-body .cc-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 6px 0 0; max-width: 60ch; padding: 0; color: var(--muted); font-size: .8125rem; font-weight: 400; line-height: 1.5; }
#circles-body .cc-foot { display: contents; }
#circles-body .cc-people { grid-column: 2; grid-row: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; align-self: center; }
#circles-body .cc-stack { display: inline-flex; flex: none; align-items: center; padding: 0; }
#circles-body .cc-stack .avatar { width: 24px; height: 24px; margin-right: 0; border-radius: 50%; border: 2px solid var(--panel); box-shadow: none; font-size: .625rem; }
#circles-body .cc-stack .avatar + .avatar { margin-left: -8px; }
#circles-body .cc-meta { min-width: 0; color: var(--muted); font-size: .75rem; line-height: 1.4; white-space: normal; overflow: visible; overflow-wrap: anywhere; }
#circles-body .cc-join { grid-column: 3; grid-row: 2; display: inline-flex; align-items: center; justify-content: center; justify-self: end; align-self: end; gap: 4px; min-width: 80px; min-height: 44px; max-width: 100%; margin: 0; padding: 10px 12px; border: 1px solid var(--sage-main); border-radius: 999px; background: var(--sage-main); color: var(--on-accent); font-family: var(--font-ui); font-size: .8125rem; font-weight: 600; line-height: 1.3; cursor: pointer; }
#circles-body .cc-join.joined { background: var(--hover); color: var(--text); border-color: var(--border); }
#circles-body .cc-join .icon { width: 14px; height: 14px; }
#circles-body .cc-join:disabled { opacity: .65; cursor: progress; }
#circles-body .cc-menu { position: static; grid-column: 3; grid-row: 1; display: grid; place-items: center; justify-self: end; align-self: start; width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 10px; margin: -6px -6px 0 0; background: transparent; border: 0; border-radius: 12px; color: var(--muted); }
#circles-body .cc-menu .icon { width: 20px; height: 20px; }
#circles-body .g-footer { margin-top: 24px; background: var(--panel); border: 1px solid var(--border); border-radius: 20px; padding: 16px; }
#circles-body .g-footer .gf-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 0; }
#circles-body .g-footer .gf-brand { font-size: 1.125rem; }
#circles-body .g-footer .gf-tag { display: none; }
#circles-body .g-footer .gf-links { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 4px 12px; width: 100%; }
#circles-body .g-footer .gf-link { min-height: 44px; padding: 6px 0; font-size: .75rem; }
#circles-body .g-footer .gf-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; width: 100%; }
#circles-body .g-footer .gf-bottom p { margin: 0; font-size: .6875rem; line-height: 1.5; }
#circles-body .g-footer .gf-top { min-height: 44px; border-radius: 999px; }
#circles-body :is(button, a):focus-visible { outline: 2px solid var(--sage-main); outline-offset: 3px; }
#circles-body .cc:focus-within { border-color: var(--sage-main); }
#circles-body .cc, #circles-body .cc.rise { transform: none; animation: none; opacity: 1; }
@media (hover: hover) {
  #circles-body .cc:hover { border-color: var(--border-strong); }
  #circles-body .c-filter:not(.on):hover, #circles-body .cc-menu:hover { background: var(--hover); color: var(--text); }
}
@media (max-width: 540px) {
  #circles-body .c-hero { display: grid; grid-template-columns: minmax(0, 1fr) 80px; gap: 10px 12px; padding: 16px; }
  #circles-body .c-hero-text { display: contents; }
  #circles-body .c-hero .g-kicker { grid-column: 1 / -1; grid-row: 1; }
  #circles-body .c-hero h2 { grid-column: 1; grid-row: 2; align-self: center; max-width: none; font-size: 1.375rem; text-wrap: pretty; }
  #circles-body .c-hero-media { position: relative; inset: auto; grid-column: 2; grid-row: 2; width: 80px; height: 80px; align-self: center; border-radius: 12px; }
  #circles-body .c-hero-text > p:not(.g-kicker) { grid-column: 1 / -1; font-size: .8125rem; }
  #circles-body .c-hero .g-cta { grid-column: 1 / -1; justify-self: start; margin: 0; }
  #circles-body .c-filter { flex: 0 0 auto; padding-inline: 14px; }
  #circles-body .cc { grid-template-columns: 56px minmax(0, 1fr) 32px; gap: 12px 14px; }
  #circles-body .cc-tile { grid-row: 1; width: 56px; height: 64px; font-size: 1.75rem; }
  #circles-body .cc-body { grid-column: 2; }
  #circles-body .cc-foot { display: flex; grid-column: 1 / -1; grid-row: 2; align-items: center; justify-content: space-between; gap: 12px; }
  #circles-body .cc-people { flex: 1; min-width: 0; }
  #circles-body .cc-join { flex: none; min-width: 80px; }
  #circles-body .cc-menu { grid-column: 3; margin-right: -8px; }
}


/* Mobile-only refinements. Tablet and desktop rules above remain untouched. */
@media (max-width: 767px) {
  :root { --ui-panel-padding: .875rem; --ui-control-height: 44px; }
  #auth { padding: calc(24px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-left, 0px)) 0; gap: 20px; }
  #auth .auth-wrap { width: 100%; min-width: 0; grid-template-columns: minmax(0, 1fr); gap: 24px; }
  #auth .auth-hero h1 { font-size: clamp(1.875rem, 8vw, 2.5rem); line-height: 1.1; }
  #auth .auth-hero .lead { max-width: 48ch; font-size: .9375rem; line-height: 1.6; }
  #auth .auth-card { width: 100%; min-width: 0; padding: 20px; }
  #auth .form-error:empty { display: none; }
  #auth .auth-art { max-width: 160px; height: auto; }
  #auth :is(button, input:not([type=checkbox]):not([type=radio])) { min-height: 44px; }
  #auth button { min-width: 44px; }
  #auth :is(input:not([type=checkbox]):not([type=radio]), select, textarea) { min-width: 0; max-width: 100%; font-size: 1rem; }
  #app .main { padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px)); }
  #app .topbar { min-height: calc(56px + env(safe-area-inset-top, 0px)); padding-top: env(safe-area-inset-top, 0px); padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); gap: 4px; }
  #app #view-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #app .top-actions { gap: 0; flex-shrink: 0; }
  #app :is(.column, .feed-column), #circles-body, #mission-body { min-width: 0; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  #app :is(.view, .column, .feed-column, .card, .cc-body, .grow, .ca-field) { min-width: 0; }
  #app :is(.page-title, .skills-hero h1) { font-size: clamp(1.375rem, 6vw, 1.75rem); line-height: 1.25; letter-spacing: -.025em; }
  #app :is(.section-head, .g-section-head, .section-row, .inbox-heading, .m-toolbar) { flex-wrap: wrap; gap: 8px 12px; }
  #app :is(.g-section-head, .section-head, .section-row) h2 { max-width: 100%; font-size: 1.125rem; line-height: 1.35; overflow-wrap: anywhere; }
  #app :is(.post-desc, .msg-text, .prose, .cc-desc, .direction-description, .ca-note) { overflow-wrap: anywhere; }
  #app :is(.post-desc, .msg-text) { font-size: .9375rem; line-height: 1.6; }
  #app :is(.card, .g-settings, .p-card, .lp-card, .match-card, .listing-card, .exchange-card, .a-panel, .a-request, .ca-card) { padding: 14px; }
  #app :is(.row-2, .row-3, .skills-grid, .learning-directions), #settings-body { grid-template-columns: minmax(0, 1fr); }
  #app :is(.row-2, .row-3, .skills-grid, .skills-content, .skills-section, .qa-list, .a-panel) { gap: 12px; }
  #app .a-tiles, #app .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  #app .a-tile { min-width: 0; padding: 12px; }
  #app :is(.a-tile, .stat-grid) strong { overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
  #app :is(.dialog-actions, .row-actions, .p-buttons, .filters, .ca-head, .ca-actions) { flex-wrap: wrap; gap: 8px; }
  #app .filters > :is(input, select) { flex: 1 1 128px; min-width: 0; }
  #app .main button, dialog button { min-width: 44px; min-height: 44px; touch-action: manipulation; }
  #app :is(.icon-btn, .back-btn), dialog .icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 10px; flex-shrink: 0; }
  #app .icon-btn > .icon, dialog .icon-btn > .icon { width: 20px; height: 20px; }
  #app button:active, dialog button:active { transform: none; }
  #app :is(.reveal, .reveal.revealed, .rise) { transform: none; animation: none; opacity: 1; }
  #app :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), textarea, select), dialog :is(input:not([type=checkbox]):not([type=radio]), textarea, select) { max-width: 100%; min-width: 0; font-size: 1rem; }
  #app :is(img:not(.avatar img):not(.brand-mark), video, canvas), dialog :is(img, video, canvas) { max-width: 100%; }
  #app :is(.post-img, .post-preview, .chart, .video iframe) { max-width: 100%; }
  #app :is(.chart, .post-preview) { height: auto; }
  #app .video iframe { width: 100%; }
  #app :is(pre, .code-block) { max-width: 100%; overflow-x: auto; }
  #app table { display: block; max-width: 100%; overflow-x: auto; }
  dialog { max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); overflow-y: auto; padding: 16px; }
  #app .dialog-actions > button, dialog .dialog-actions > button { flex: 1 1 112px; }
  #app .floating-nav { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
  #app .floating-nav > button { min-width: 44px; min-height: 60px; }
  #app .floating-nav .icon { width: 24px; height: 24px; }
  #app .main > .scroll { scroll-padding-bottom: 24px; }
  #app .g-footer { max-width: 100%; }
  #app .g-footer :is(.gf-inner, .gf-links, .gf-bottom) { flex-wrap: wrap; }
  #app .g-footer :is(.gf-link, .gf-top) { min-height: 44px; }
  #app :is(button, a, input, textarea, select):focus-visible, dialog :is(button, a, input, textarea, select):focus-visible { outline: 2px solid var(--sage-main); outline-offset: 3px; }
}

/* The top bar's back button only shows on inner screens, on every screen size. */
body[data-depth="top"] #app .back-btn { display: none; }

/* Mission on phones: all four tabs fit, and the banner art stays clear of the words. */
@media (max-width: 47.99rem) {
  #mission-body .m-tabs button { flex: 1 1 0; padding: 10px 4px; font-size: .75rem; }
  #mission-body .m-hero-art { display: none; }
}

/* Classroom: the class's Zoom call. */
.chart-zoom-join { display: inline-flex; align-items: center; gap: .375rem; min-height: 2.75rem; padding: .375rem .875rem; border-radius: .625rem; background: var(--accent); color: var(--on-accent); font-size: .8125rem; font-weight: 600; text-decoration: none; white-space: nowrap; transition: filter .2s ease; }
.chart-zoom-join:hover { filter: brightness(1.08); }
.chart-zoom-join:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.chart-zoom-join .icon { width: 1rem; height: 1rem; }

/* Learn tabs: five across; on phones they scroll sideways instead of wrapping. */
#app .seg.learn-tabs { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 47.99rem) {
  #app .seg.learn-tabs { display: flex; overflow-x: auto; scrollbar-width: none; }
  #app .seg.learn-tabs::-webkit-scrollbar { display: none; }
  #app .seg.learn-tabs > button { flex: 1 0 auto; padding-inline: .875rem; white-space: nowrap; }
}

/* Learn → Practice: paper trading on practice charts. */
#learn-view .practice-page { -webkit-user-select: text; user-select: text; }
.practice-head .page-title { margin-bottom: .25rem; }
.practice-head .muted { margin: 0 0 1rem; max-width: 60ch; }
.practice-stat-value { font-variant-numeric: tabular-nums; }
.practice-page :is(.gain, .practice-stat-value.gain) { color: var(--answer-right); }
.practice-page :is(.loss, .practice-stat-value.loss) { color: var(--answer-wrong); }
.practice-picker h2, .practice-session h2 { margin: 1rem 0 .25rem; font-size: 1.125rem; font-weight: 600; }
.practice-charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: .5rem; margin: .75rem 0 1rem; }
.practice-chart-card { display: flex; align-items: center; gap: .75rem; min-height: 4rem; padding: .625rem .75rem; border: 1px solid var(--border); border-radius: .75rem; background: var(--panel); color: var(--text); text-align: left; cursor: pointer; transition: border-color .2s ease, background-color .2s ease; }
.practice-chart-card:hover, .practice-chart-card:focus-visible { border-color: var(--accent); background: var(--hover); }
.practice-chart-card > .icon { flex: none; width: 1.125rem; height: 1.125rem; color: var(--muted); }
.practice-chart-icon { display: grid; flex: none; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: .625rem; background: var(--panel-2); color: var(--accent); }
.practice-chart-icon .icon { width: 1.25rem; height: 1.25rem; }
.practice-chart-text { display: grid; flex: 1; gap: .125rem; min-width: 0; }
.practice-rules, .practice-done, .practice-position, .practice-order, .practice-trades { padding: .875rem; border: 1px solid var(--border); border-radius: .75rem; background: var(--panel); }
.practice-page h3 { margin: 0 0 .5rem; font-size: .9375rem; font-weight: 600; }
.practice-rules ul { display: grid; gap: .25rem; margin: 0; padding-left: 1.125rem; color: var(--muted); font-size: .875rem; }
.practice-rules + .link { margin-top: .75rem; min-height: 2.75rem; }
.practice-session-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem 1rem; }
.practice-session-head h2 { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.practice-sim { font-size: .6875rem; font-weight: 600; letter-spacing: .04em; }
.practice-price { color: var(--muted); font-size: .875rem; font-variant-numeric: tabular-nums; }
.practice-figure { margin: .5rem 0 .75rem; padding: .5rem; border: 1px solid var(--border); border-radius: .75rem; background: var(--bg); }
.practice-svg { display: block; width: 100%; height: auto; }
.practice-grid { stroke: var(--border); stroke-width: 1; opacity: .6; }
.practice-axis { fill: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.practice-up line, .practice-up rect { stroke: var(--answer-right); fill: var(--answer-right); }
.practice-down line, .practice-down rect { stroke: var(--answer-wrong); fill: var(--answer-wrong); }
.practice-up line, .practice-down line { stroke-width: 1.5; }
.practice-level line { stroke-width: 1.5; stroke-dasharray: 6 5; }
.practice-level text { font-size: 13px; font-weight: 600; paint-order: stroke; stroke: var(--bg); stroke-width: 4px; }
.practice-level.entry line { stroke: var(--accent); }
.practice-level.entry text { fill: var(--accent); }
.practice-level.stop line { stroke: var(--answer-wrong); }
.practice-level.stop text { fill: var(--answer-wrong); }
.practice-level.target line { stroke: var(--answer-right); }
.practice-level.target text { fill: var(--answer-right); }
.practice-controls { display: grid; gap: .75rem; }
.practice-step { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.practice-step .primary { display: inline-flex; align-items: center; gap: .375rem; }
.practice-step .primary .icon { width: 1rem; height: 1rem; }
.practice-step .link { min-height: 2.75rem; margin-left: auto; }
.practice-order { display: grid; gap: .625rem; }
.practice-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
.practice-fields label { display: grid; gap: .25rem; min-width: 0; font-size: .8125rem; font-weight: 500; }
.practice-fields :is(input, select) { width: 100%; min-width: 0; }
.practice-order .link { justify-self: start; min-height: 2.75rem; }
.practice-order .primary { justify-self: start; }
.practice-risk { margin: 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.practice-risk.over { color: var(--answer-wrong); font-weight: 500; }
.practice-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .5rem 1rem; margin: 0 0 .75rem; }
.practice-facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.practice-done p { margin: 0 0 .625rem; max-width: 65ch; }
.practice-result { font-weight: 600; }
.practice-trades { margin-top: .75rem; }
.practice-trade { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .125rem .75rem; padding: .5rem 0; font-size: .875rem; font-variant-numeric: tabular-nums; }
.practice-trade + .practice-trade { border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent); }
.practice-trade-result { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-weight: 600; }
.practice-note { margin-top: 1rem; max-width: 70ch; }
@media (max-width: 47.99rem) {
  .practice-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .practice-step .link { margin-left: 0; }
  .practice-order .primary { justify-self: stretch; }
}

/* Practice: the switch between practice charts and live NSE charts, and the live chart's forms. */
#app .seg.practice-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 26rem; margin: .25rem 0 .5rem; }
.practice-connect { display: grid; gap: .625rem; max-width: 40rem; padding: 1rem; border: 1px solid var(--border); border-radius: .75rem; background: var(--panel); }
.practice-connect h2 { margin: 0; font-size: 1.125rem; font-weight: 600; }
.practice-connect p { margin: 0; }
.practice-connect ul { display: grid; gap: .25rem; margin: 0; padding-left: 1.125rem; }
.practice-connect .row-actions { align-items: center; gap: .75rem 1rem; }
.practice-live { display: grid; gap: .75rem; margin-top: .5rem; }
.practice-live > p { margin: 0; }
.practice-live-form { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; align-items: end; gap: .5rem; max-width: 34rem; }
.practice-live-form label { display: grid; gap: .25rem; min-width: 0; font-size: .8125rem; font-weight: 500; }
.practice-live-form :is(input, select) { width: 100%; min-width: 0; }
.practice-live .practice-session h2 { margin-top: 0; }
@media (max-width: 47.99rem) {
  .practice-live-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .practice-live-form button { grid-column: 1 / -1; }
}

/* One banner style for Circles, Skill exchange and Mission: the same contour image as sign-in,
   Home and Profile, in place of the cartoon scenes and the brown mountain art. */
html #app :is(#circles-body .c-hero, #skills-body .skills-hero, #mission-body .m-hero) {
  position: relative; overflow: hidden; padding: 1.5rem; border: 1px solid var(--hero-line); border-radius: 1rem;
  background: var(--hero-scrim), var(--hero-image) center / cover no-repeat, var(--hero-bg); color: var(--hero-ink); box-shadow: none;
}
html #app :is(#circles-body .c-hero-media, #skills-body .skills-hero-art, #mission-body .m-hero-art) { display: none; }
html #app :is(#circles-body .c-hero, #skills-body .skills-hero, #mission-body .m-hero) .g-kicker { color: var(--hero-kicker); }
html #app :is(#circles-body .c-hero-text h2, #skills-body .skills-hero h1, #mission-body .m-hero .m-statement) { max-width: 30ch; color: var(--hero-ink); font-family: var(--font-display); font-weight: 700; letter-spacing: -.02em; }
html #app :is(#circles-body .c-hero-text > p:not(.g-kicker), #skills-body .skills-hero .muted) { max-width: 52ch; color: var(--hero-soft); }
html #app #skills-body .skills-hero { display: block; margin-bottom: 1rem; }
html #app #mission-body .m-hero .m-edit { color: var(--hero-kicker); }
html #app #mission-body .m-hero .m-stat { border: 1px solid var(--hero-line); background: color-mix(in srgb, var(--panel) 82%, transparent); color: var(--text); }
html #app #mission-body .m-hero .m-stat span { color: var(--muted); }
html #app #mission-body .m-hero .m-stat .icon { color: var(--accent); }
@media (max-width: 47.99rem) {
  html #app :is(#circles-body .c-hero, #skills-body .skills-hero, #mission-body .m-hero) { padding: 1.125rem; background: var(--hero-scrim-phone), var(--hero-image) center / cover no-repeat, var(--hero-bg); }
}
@media (max-width: 26rem) {
  #mission-body .m-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-radius: 1rem; }
  #mission-body .m-tabs button { font-size: .8125rem; }
}

/* Each section's own banner art (scripts/build-section-banners.js), in each theme. */
html #app #circles-body .c-hero { --hero-image: url(/img/banner-circles.jpg); }
html #app #skills-body .skills-hero { --hero-image: url(/img/banner-skills.jpg); }
html #app #mission-body .m-hero { --hero-image: url(/img/banner-mission.jpg); }
html[data-theme="light"] #app #circles-body .c-hero { --hero-image: url(/img/banner-circles-light.jpg); }
html[data-theme="light"] #app #skills-body .skills-hero { --hero-image: url(/img/banner-skills-light.jpg); }
html[data-theme="light"] #app #mission-body .m-hero { --hero-image: url(/img/banner-mission-light.jpg); }
/* The art sits on the right; on wide screens show it whole, on phones keep its right side. */
html #app :is(#circles-body .c-hero, #skills-body .skills-hero, #mission-body .m-hero) { background-position: center, right center, center; }

/* Profile cover: the doodle pattern, like sign-in and the section banners. */
html body #app #profile-view .pf-head .pf-cover { background: var(--hero-image) center / cover no-repeat, var(--hero-bg); border-bottom: 1px solid var(--hero-line); }
html body #app #profile-view .pf-head .pf-waves { display: none; }

/* Home: the doodle pattern sits behind the feed; the posts stay on their own solid cards. */
html #app #feed-view { background: url(/img/pattern-tile.png) 0 0 / 480px repeat fixed, var(--bg); }
html[data-theme="light"] #app #feed-view { background-image: url(/img/pattern-tile-light.png); }

/* Home: the member's next lesson, first under the circles row. A warm panel, the one orange action. */
html #app .learn-next { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1rem; max-width: 640px; margin: .75rem 0 0; padding: 1.125rem 1.25rem; border-radius: var(--ui-radius-panel); background: var(--mint); color: var(--text); }
html #app .learn-next-text { display: grid; gap: .25rem; min-width: 0; }
html #app .learn-next h2 { margin: 0; font-family: var(--font-display); font-size: 1.125rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.25; text-wrap: balance; }
html #app .learn-next-text p { margin: 0; font-size: .9375rem; line-height: 1.4; }
html #app .learn-next-text p strong { font-weight: 500; }
html #app .learn-next-meta { color: var(--muted); font-size: .8125rem !important; font-variant-numeric: tabular-nums; }
html #app .learn-next-bar { display: block; height: 6px; margin-top: .375rem; border-radius: 999px; background: color-mix(in srgb, var(--text) 12%, transparent); overflow: hidden; }
html #app .learn-next-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--sage-main); }
html #app .learn-next .primary { min-height: 44px; padding-inline: 1.25rem; }
@media (max-width: 420px) { html #app .learn-next { grid-template-columns: 1fr; } html #app .learn-next .primary { justify-self: start; } }

/* Home: today's imported headlines as one list, above members' posts. */
html #app #feed-news-digest { margin: .75rem 0; padding: 1.125rem 1.25rem .875rem; border: 1px solid var(--border); border-radius: var(--ui-radius-panel); background: var(--panel); color: var(--text); }
html #app .news-digest-head h2 { margin: 0; font-family: var(--font-display); font-size: 1.125rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.25; }
html #app .news-digest-head p { margin: .25rem 0 0; color: var(--muted); font-size: .8125rem; line-height: 1.45; }
html #app .news-digest-head { display: grid; gap: .25rem; }
/* Lead story: a wide doodle panel above the headline, the whole tile one link. */
html #app .nd-story { display: grid; color: inherit; text-decoration: none; border-radius: .75rem; transition: background-color .2s ease; }
html #app a.nd-story:focus-visible { outline: 2px solid var(--sage-main); outline-offset: 2px; }
html #app a.nd-story:hover .nd-title { text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }
html #app .nd-art { display: grid; place-items: center; color: var(--sage-main); background: var(--panel-2) url(/img/pattern-tile.png) 0 0 / 320px; border-radius: .75rem; }
html[data-theme="light"] #app .nd-art { background-image: url(/img/pattern-tile-light.png); }
html #app .nd-art svg { display: block; }
html #app .nd-text { display: grid; gap: .3125rem; min-width: 0; }
html #app .nd-title { font-weight: 500; line-height: 1.35; text-wrap: pretty; }
html #app .nd-meta { color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; }
html #app .nd-topic { color: var(--text); font-weight: 500; }
html #app .nd-lead { gap: .875rem; margin-top: .875rem; }
html #app .nd-lead .nd-art { height: 9.5rem; }
html #app .nd-lead .nd-art svg { width: 7.5rem; height: 7.5rem; transform: rotate(-6deg); }
html #app .nd-lead .nd-title { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.25; }
@media (min-width: 640px) {
  html #app .nd-lead { grid-template-columns: 13rem minmax(0, 1fr); align-items: center; gap: 1.125rem; }
  html #app .nd-lead .nd-art { height: 8.5rem; }
}
/* The rest: a swipeable row of picture cards. */
html #app .nd-rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(12.5rem, 42%); gap: .75rem; margin: 1rem -1.25rem 0; padding: 0 1.25rem .375rem; list-style: none; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 1.25rem; scrollbar-width: thin; scrollbar-color: var(--border) transparent; overscroll-behavior-x: contain; }
html #app .nd-rail > li { scroll-snap-align: start; display: grid; }
html #app .nd-card { align-content: start; gap: .625rem; padding: .625rem; border: 1px solid var(--border); background: var(--panel); }
html #app a.nd-card:hover { background: var(--hover); }
html #app .nd-card .nd-art { height: 5.5rem; }
html #app .nd-card .nd-art svg { width: 3.75rem; height: 3.75rem; }
html #app .nd-card .nd-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; font-size: .9375rem; }
html #app .nd-card .nd-text { padding: 0 .125rem .125rem; }
@media (max-width: 520px) { html #app .nd-rail { grid-auto-columns: 72%; } }
@media (prefers-reduced-motion: reduce) { html #app .nd-story { transition: none; } }
html #app .news-digest-note { margin: .75rem 0 0; color: var(--muted); font-size: .75rem; }
html #app .visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* Topic photos in the news cards: cover the frame, with a small honest label. */
html #app .nd-photo { position: relative; overflow: hidden; background: var(--panel-2); }
html #app .nd-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
html #app .nd-photo-tag { position: absolute; left: .5rem; bottom: .5rem; padding: .125rem .5rem; border-radius: 999px; background: color-mix(in srgb, #0A0A0A 72%, transparent); color: #EBEAE4; font-size: .75rem; line-height: 1.5; }
html #app .nd-card .nd-photo-tag { display: none; }

/* ===== Whole-app consistency pass (critique 2026-11-16): DESIGN.md's One Lamp rule, data-only
   market colours, sentence case, 12px minimum text, no side stripes, no glows, no overshoot. ===== */
html { --fs-2xs: .75rem; --ease-spring: cubic-bezier(.22, 1, .36, 1); }
:root { --hero-kicker: #c0cfc7; }
:root[data-theme="light"] { --hero-kicker: #46594f; }

/* Small labels: sentence case, muted, readable. */
html #app .g-kicker { font-size: .75rem; text-transform: none; letter-spacing: 0; color: var(--muted); }
html #app .tabbar .tab-label { font-size: .75rem; }
html #app .comment-meta time, html #app .rail-bottom > span, html #app .course-level-label { font-size: .75rem; }
html #app .compose-chips button { font-size: .8125rem; }
html #app .exam-code { color: var(--muted); font-size: .75rem; }

/* One orange per screen: joining a circle, the next candle and selected chips are secondary. */
html #app #circles-body .cc-join:not(.joined) { background: transparent; color: var(--text); border-color: var(--border-strong); }
html #app #circles-body .cc-join:not(.joined):hover { background: var(--hover); }
html #app .chip.on, html #app .m-chips .chip.on { background: var(--text); border-color: var(--text); color: var(--bg); }
html #app .settings-row:hover > .icon, html #app .settings-row:focus-visible > .icon { color: var(--text); }
html body #app #profile-view .pf-fact .pf-fact-label { color: var(--muted); font-weight: 600; }
html body #app #profile-view .pf-cta-btn { border-radius: 999px; box-shadow: none; }

/* Progress is never gain green; it is the accent. */
html #app .bar-fill, html #app .track-summary .bar-fill { background: var(--sage-main); }

/* No coloured glows: tonal layering only (DESIGN.md Elevation). */
html #app :is(.new-posts-pill, .g-create, .g-create:hover, .learn-continue:hover) { box-shadow: none; }
html #app .tabbar .tab-create .tab-create-disc { box-shadow: none; }

/* No thick side stripes on rounded cards. */
html #app :is(.daily-quote, .a-note, .listing-card.is-offer, .listing-card.is-request, .m-campaign, .home-mission-campaign, .exchange-message, .practice, .shared-teaser, .course-key-point, .exam-review-item, .m-campaign-invite) { border-left-width: 1px; border-left-color: var(--border); }
html #app .m-campaign { box-shadow: none; }
html #app .msg.bot .msg-bubble { border-left-width: 1px; }
html body .toast { border-left-width: 1px; }

/* Mission: honest start line and the new first actions. */
html #app .m-impact-start { margin: .75rem 0 0; color: var(--hero-soft, var(--muted)); font-size: .9375rem; line-height: 1.5; max-width: 46ch; }
html #app .m-invite-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }

/* Learn: extras after the path. */
html #app .learn-extras { display: grid; gap: .5rem; margin-top: 1.5rem; }
html #app .learn-extras h2, html #app .exam-prep h2 { margin: 0; font-family: var(--font-display); font-size: 1.125rem; font-weight: 600; letter-spacing: -.02em; }
html #app .exam-prep { display: grid; gap: .5rem; margin-top: 1.5rem; }
html #app .exam-prep > p, html #app .learn-extras > p { margin: 0; }
html #app #learn-view .learn-next { max-width: 640px; margin: 0 0 1rem; }

/* Inside a conversation the composer owns the bottom of the screen; the tab bar steps aside. */
html body[data-view="chat"] .tabbar { display: none !important; }

/* Scene props (formerly mascots): ink doodles, one in the accent. */
html .il-doodle { color: color-mix(in srgb, var(--text) 62%, transparent); }
html .il-doodle.is-accent { color: var(--sage-main); }
html #app .journal-r-note { margin: .75rem 0 0; max-width: 62ch; line-height: 1.5; }

/* Home layout. Phones: one column (the side group dissolves into the page order).
   Wide screens: the feed, plus a side column (Daily 5, Mission, Skill exchange) that stays in view. */
html #app #feed-view .feed-side { display: contents; }
html #app #feed-view #feed-hero:not(:has(> :not([hidden]))) { display: none; }
@media (min-width: 1200px) {
  html #app #feed-view .feed-column { display: grid; grid-template-columns: minmax(0, 640px) 300px; justify-content: center; column-gap: 28px; row-gap: 0; align-items: start; }
  html #app #feed-view .feed-column > * { grid-area: auto; grid-column: 1; width: 100%; }
  html #app #feed-view .feed-column > .feed-side { display: grid; gap: 12px; grid-column: 2; grid-row: 1 / span 30; position: sticky; top: 16px; align-self: start; max-height: calc(100dvh - 32px); overflow-y: auto; scrollbar-width: none; }
  html #app #feed-view .feed-side > * { grid-area: auto; order: 0; margin: 0; width: 100%; }
  html #app #feed-view .feed-side > :empty { display: none; }
  html #app #feed-view .feed-column > .g-footer { grid-column: 1 / -1; }
}

/* Shared error state: plain words and one way forward. */
html .load-error { display: grid; justify-items: center; gap: .75rem; margin: 1.5rem auto; padding: 1.25rem; max-width: 34rem; border: 1px solid var(--border); border-radius: var(--ui-radius-panel, 14px); background: var(--panel); color: var(--text); text-align: center; }
html .load-error p { margin: 0; color: var(--muted); line-height: 1.5; }
/* Settings and Profile: icons and labels in ink and muted, orange left for actions. */
html #app .settings-row-icon, html #app .settings-row-icon .icon { color: var(--text); }
html body #app #profile-view .pf-fact[class*="tone-"] .pf-fact-label { color: var(--muted); }

/* Market news by day: Today / Yesterday / earlier tabs, a lead story, then a scannable list. */
html #app .nd-days { display: flex; gap: .5rem; margin: .875rem -1.25rem 0; padding: 0 1.25rem .125rem; overflow-x: auto; scrollbar-width: none; }
html #app .nd-days button { display: inline-flex; align-items: center; gap: .375rem; flex: none; min-height: 40px; padding: .25rem .875rem; border: 1px solid var(--border); border-radius: 999px; background: transparent; color: var(--text); font: 500 .875rem/1 var(--font-ui, inherit); cursor: pointer; transition: background-color .2s ease, border-color .2s ease; }
html #app .nd-days button:hover { background: var(--hover); }
html #app .nd-days button.on { background: var(--text); border-color: var(--text); color: var(--bg); }
html #app .nd-days button:focus-visible { outline: 2px solid var(--sage-main); outline-offset: 2px; }
html #app .nd-count { font-size: .75rem; font-variant-numeric: tabular-nums; opacity: .7; }
html #app .nd-list { margin: .5rem 0 0; padding: 0; list-style: none; }
html #app .nd-list > li + li { border-top: 1px solid var(--border); }
html #app .nd-row { display: grid; grid-template-columns: 4rem minmax(0, 1fr); gap: .875rem; align-items: start; padding: .75rem 0; color: inherit; text-decoration: none; border-radius: .5rem; }
html #app a.nd-row:hover .nd-title { text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }
html #app a.nd-row:focus-visible { outline: 2px solid var(--sage-main); outline-offset: 2px; }
html #app .nd-thumb { position: relative; display: block; width: 4rem; height: 4rem; overflow: hidden; border-radius: .625rem; background: var(--panel-2); }
html #app .nd-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
html #app .nd-thumb .nd-art { width: 100%; height: 100%; border-radius: 0; }
html #app .nd-thumb .nd-art svg { width: 2.5rem; height: 2.5rem; }
html #app .nd-row .nd-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; font-size: .9375rem; }
html #app .nd-row .nd-meta { margin-top: .25rem; display: block; }
html #app .nd-more { width: 100%; margin-top: .25rem; }
html #app .nd-day > .nd-lead { margin-top: .875rem; }

/* ===== Insights: a teaser in the feed, a 2-minute lesson when opened ===== */
html #app .is-teaser { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr) auto; align-items: center; gap: 1rem; width: 100%; margin: .5rem 0 0; padding: .875rem; border: 1px solid var(--border); border-radius: var(--ui-radius-panel, 14px); background: var(--mint); color: var(--text); text-align: left; font: inherit; cursor: pointer; transition: border-color .2s ease, transform .2s cubic-bezier(.22, 1, .36, 1); }
html #app .is-teaser:hover { border-color: var(--border-strong); }
html #app .is-teaser:active { transform: translateY(1px); }
html #app .is-teaser:focus-visible { outline: 2px solid var(--sage-main); outline-offset: 2px; }
html #app .is-teaser-art { display: grid; place-items: center; aspect-ratio: 1; border-radius: .75rem; background: var(--bg) url(/img/pattern-tile.png) 0 0 / 240px; color: var(--sage-main); }
html[data-theme="light"] #app .is-teaser-art { background-image: url(/img/pattern-tile-light.png); }
html #app .is-teaser-art svg { width: 3.5rem; height: 3.5rem; }
html #app .is-teaser-text { display: grid; gap: .25rem; min-width: 0; }
html #app .is-meta { color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; }
html #app .is-teaser-title { font-family: var(--font-display); font-size: 1.125rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.25; text-wrap: balance; }
html #app .is-teaser-go { color: var(--muted); }
html #app .is-teaser.is-done { background: var(--panel); }
html #app .is-teaser.is-done .is-teaser-art { color: var(--muted); }

/* The lesson: full screen on phones, a tall centred sheet on wide screens. */
html dialog.insight-story { width: 100%; max-width: 32rem; height: 100dvh; max-height: 100dvh; margin: 0 auto; padding: 0; border: 0; background: var(--bg) url(/img/pattern-tile.png) 0 0 / 420px; color: var(--text); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; }
html[data-theme="light"] dialog.insight-story { background-image: url(/img/pattern-tile-light.png); }
html dialog.insight-story:not([open]) { display: none; }
html dialog.insight-story::backdrop { background: color-mix(in srgb, #0A0A0A 82%, transparent); }
@media (min-width: 640px) { html dialog.insight-story { height: min(48rem, calc(100dvh - 3rem)); margin: auto; border-radius: 1.25rem; border: 1px solid var(--border); } }
html .insight-story .is-top { display: grid; gap: .75rem; padding: max(.875rem, env(safe-area-inset-top)) 1rem .5rem; }
html .insight-story .is-bars { display: grid; grid-auto-flow: column; gap: .375rem; }
html .insight-story .is-bars > span { height: 3px; border-radius: 999px; background: color-mix(in srgb, var(--text) 18%, transparent); overflow: hidden; }
html .insight-story .is-bars > span > i { display: block; height: 100%; width: 0; background: var(--sage-main); transition: width .35s cubic-bezier(.22, 1, .36, 1); }
html .insight-story .is-bars > span.on > i { width: 100%; }
html .insight-story .is-top-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
html .insight-story .is-counter { color: var(--muted); font-size: .8125rem; font-variant-numeric: tabular-nums; }
html .insight-story .is-close { min-width: 44px; min-height: 44px; color: var(--text); }
html .insight-story .is-stage { position: relative; overflow-y: auto; padding: 1rem 1.5rem; display: grid; align-content: center; touch-action: pan-y; }
html .insight-story .is-page { display: grid; gap: 1rem; max-width: 30rem; margin: 0 auto; width: 100%; padding: 1.5rem; border-radius: 1.25rem; background: color-mix(in srgb, var(--panel) 94%, transparent); border: 1px solid var(--border); }
html .insight-story .is-page.step-1 { background: var(--mint); text-align: left; }
html .insight-story .is-doodle { display: block; width: 7.5rem; height: 7.5rem; color: var(--sage-main); }
html .insight-story .is-doodle svg { width: 100%; height: 100%; transform: rotate(-6deg); }
html .insight-story .is-cat { margin: 0; color: var(--muted); font-size: .875rem; font-weight: 500; }
html .insight-story .is-title { margin: 0; font-family: var(--font-display); font-size: clamp(1.75rem, 7vw, 2.375rem); font-weight: 600; letter-spacing: -.03em; line-height: 1.1; text-wrap: balance; }
html .insight-story .is-step-head { margin: 0; font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; letter-spacing: -.02em; }
html .insight-story .is-text { margin: 0; font-size: 1.0625rem; line-height: 1.6; max-width: 62ch; text-wrap: pretty; }
html .insight-story .is-example { padding: 1.125rem 1.25rem; border-radius: .875rem; background: var(--panel-2); border: 1px dashed var(--border-strong); }
html .insight-story .is-example p { margin: 0; font-size: 1.0625rem; line-height: 1.7; }
html .insight-story mark.is-num { padding: 0 .25em; border-radius: .3em; background: color-mix(in srgb, var(--sage-main) 18%, transparent); color: inherit; font-weight: 600; font-variant-numeric: tabular-nums; }
html .insight-story .is-takeaway { margin: 0; font-family: var(--font-display); font-size: clamp(1.375rem, 5.5vw, 1.75rem); font-weight: 600; letter-spacing: -.02em; line-height: 1.25; text-wrap: balance; }
html .insight-story .is-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .25rem; }
html .insight-story .is-actions.is-final { display: grid; gap: .5rem; }
html .insight-story .is-actions.is-final > button { width: 100%; min-height: 48px; }
html .insight-story .is-bottom { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; align-items: center; gap: .5rem; padding: .5rem 1rem max(.875rem, env(safe-area-inset-bottom)); }
html .insight-story .is-note { margin: 0; text-align: center; color: var(--muted); font-size: .75rem; }
html .insight-story .is-nav { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid var(--border); border-radius: 999px; background: var(--panel); color: var(--text); cursor: pointer; }
html .insight-story .is-nav:disabled { opacity: .35; cursor: default; }
html .insight-story .is-nav[hidden] { visibility: hidden; display: grid; }
html .insight-story .is-prev .icon { transform: rotate(180deg); }
html .insight-story .is-nav:focus-visible, html .insight-story .is-close:focus-visible { outline: 2px solid var(--sage-main); outline-offset: 2px; }
/* One authored moment: each step slides in from the side it came from. */
@keyframes is-in-next { from { opacity: 0; transform: translateX(24px); } }
@keyframes is-in-prev { from { opacity: 0; transform: translateX(-24px); } }
html .insight-story .is-page.in-next { animation: is-in-next .38s cubic-bezier(.22, 1, .36, 1); }
html .insight-story .is-page.in-prev { animation: is-in-prev .38s cubic-bezier(.22, 1, .36, 1); }
@media (prefers-reduced-motion: reduce) {
  html .insight-story .is-page { animation: none !important; }
  html .insight-story .is-bars > span > i, html #app .is-teaser { transition: none; }
}
html #app .circle-chat-hint { padding: .75rem 1rem; color: var(--muted); font-size: .875rem; line-height: 1.5; }

/* ===== Home: "Learn in 2 minutes", a shelf of Insight lesson covers ===== */
html #app #feed-insights { margin: .75rem 0; }
html #app .is-shelf-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 0 0 .625rem; }
html #app .is-shelf-head h2 { margin: 0; font-family: var(--font-display); font-size: 1.125rem; font-weight: 600; letter-spacing: -.02em; }
html #app .is-shelf-head .link { display: inline-flex; align-items: center; gap: .25rem; }
html #app .is-shelf { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(10.5rem, 31%); gap: .75rem; margin: 0 -1rem; padding: 0 1rem .375rem; list-style: none; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 1rem; scrollbar-width: none; overscroll-behavior-x: contain; }
html #app .is-shelf > li { display: grid; scroll-snap-align: start; }
@media (max-width: 520px) { html #app .is-shelf { grid-auto-columns: 44%; } }

/* A cover: picture on doodle paper, a small flag, then topic, title and length. */
html .is-cover { display: grid; grid-template-rows: auto 1fr; width: 100%; padding: 0; border: 1px solid var(--border); border-radius: var(--ui-radius-panel, 14px); overflow: hidden; background: var(--panel); color: var(--text); text-align: left; font: inherit; cursor: pointer; transition: border-color .2s ease, transform .25s cubic-bezier(.22, 1, .36, 1); }
html .is-cover:hover { border-color: var(--border-strong); transform: translateY(-2px); }
html .is-cover:active { transform: translateY(0); }
html .is-cover:focus-visible { outline: 2px solid var(--sage-main); outline-offset: 2px; }
html .is-cover-art { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; background: var(--mint) url(/img/pattern-tile.png) 0 0 / 260px; color: var(--sage-main); }
html[data-theme="light"] .is-cover-art { background-image: url(/img/pattern-tile-light.png); }
html .is-cover.tone-desk .is-cover-art { background-color: var(--panel-2); }
html .is-cover.tone-glow .is-cover-art { background-color: color-mix(in srgb, var(--sage-main) 12%, var(--panel)); }
html .is-cover-art .is-doodle { width: 54%; height: 72%; }
html .is-cover-art .is-doodle svg { width: 100%; height: 100%; transform: rotate(-5deg); }
html .is-flag { position: absolute; top: .5rem; left: .5rem; display: inline-flex; align-items: center; gap: .25rem; padding: .125rem .5rem; border-radius: 999px; background: var(--sage-main); color: var(--on-accent, #2E160A); font-size: .75rem; font-weight: 600; }
html .is-flag-done { background: var(--panel); color: var(--text); border: 1px solid var(--border); }
html .is-flag .icon { width: .875rem; height: .875rem; }
html .is-cover-text { display: grid; align-content: start; gap: .25rem; padding: .75rem .875rem .875rem; }
html .is-cover-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; font-family: var(--font-display); font-size: 1rem; font-weight: 600; letter-spacing: -.015em; line-height: 1.25; }
html .is-cover .is-meta { color: var(--muted); font-size: .75rem; }
html .is-cover.is-done .is-cover-art { color: var(--muted); }

/* See all: every Insight as a grid of covers. */
html dialog.is-library { width: min(56rem, calc(100% - 1.5rem)); max-height: calc(100dvh - 2rem); padding: 0; border: 1px solid var(--border); border-radius: 1.25rem; background: var(--bg); color: var(--text); overflow: hidden; }
html dialog.is-library[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
html dialog.is-library::backdrop { background: color-mix(in srgb, #0A0A0A 72%, transparent); }
html .is-library-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.125rem 1.25rem .75rem; border-bottom: 1px solid var(--border); }
html .is-library-head h2 { margin: 0; font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; letter-spacing: -.02em; }
html .is-library-head .is-meta { margin: .25rem 0 0; color: var(--muted); font-size: .8125rem; }
html .is-library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: .75rem; margin: 0; padding: 1rem 1.25rem 1.25rem; list-style: none; overflow-y: auto; }
html .is-library-grid > li { display: grid; }
@media (prefers-reduced-motion: reduce) { html .is-cover { transition: none; } html .is-cover:hover { transform: none; } }
html #app #feed-view #feed-insights { order: 4; }
/* Covers are buttons: beat the app's general button padding and let the art fill the width. */
html #app #feed-insights .is-cover, html body dialog.is-library .is-cover { padding: 0; min-height: 0; grid-template-columns: minmax(0, 1fr); align-items: stretch; justify-items: stretch; gap: 0; }
html .is-cover-art { width: 100%; }
html #app #feed-insights .is-cover-text, html body dialog.is-library .is-cover-text { padding: .75rem .875rem .875rem; }
html #app #feed-insights .is-shelf { margin: 0; padding: 0 0 .375rem; scroll-padding-inline: 0; }
html body dialog.is-library .is-library-grid { grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); }

/* ===== "In real life": one plain sentence and a real-data chart you can scrub ===== */
html .rl-say { margin: 0; font-size: 1.0625rem; line-height: 1.55; text-wrap: pretty; }
html .rl-figure { display: grid; gap: .375rem; margin: .25rem 0 0; padding: .75rem .75rem .625rem; border-radius: .875rem; background: var(--panel-2); border: 1px solid var(--border); }
html .rl-chart { display: block; width: 100%; height: auto; touch-action: none; cursor: crosshair; overflow: visible; }
html .rl-band { fill: color-mix(in srgb, var(--sage-main) 14%, transparent); }
html .rl-base { stroke: var(--border-strong); stroke-width: 1; }
html .rl-line { fill: none; stroke: var(--sage-main); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: rl-draw 1.4s cubic-bezier(.22, 1, .36, 1) .15s forwards; }
html .rl-line.rl-soft { stroke: var(--muted); stroke-width: 2; }
@keyframes rl-draw { to { stroke-dashoffset: 0; } }
html .rl-axis { fill: var(--muted); font-size: 11px; font-family: var(--font-ui, inherit); }
html .rl-cursor { stroke: var(--text); stroke-width: 1; stroke-dasharray: 3 3; opacity: .55; }
html .rl-dot { fill: var(--sage-main); stroke: var(--panel-2); stroke-width: 2; }
html .rl-dot.rl-soft { fill: var(--muted); }
html .rl-readout { margin: 0; min-height: 1.4em; color: var(--muted); font-size: .8125rem; font-variant-numeric: tabular-nums; }
html .rl-legend { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin: 0; font-size: .8125rem; color: var(--muted); }
html .rl-key::before { content: ""; display: inline-block; width: .875rem; height: 3px; margin: 0 .375rem .2rem 0; border-radius: 2px; background: var(--sage-main); vertical-align: middle; }
html .rl-key.rl-soft::before { background: var(--muted); }
html .rl-note { margin: 0; font-size: .9375rem; line-height: 1.55; }
html .rl-source { margin: 0; color: var(--muted); font-size: .75rem; line-height: 1.45; }
@media (prefers-reduced-motion: reduce) { html .rl-line { animation: none; stroke-dashoffset: 0; } }
/* In a lesson page the block sits as a card of its own. */
html #app .rl-lesson { display: grid; gap: .625rem; margin: 1.5rem 0; padding: 1.125rem 1.25rem; border-radius: var(--ui-radius-panel, 14px); background: var(--panel); border: 1px solid var(--border); }
html #app .rl-lesson .is-step-head { margin: 0; font-family: var(--font-display); font-size: 1.125rem; font-weight: 600; letter-spacing: -.02em; }

/* Home: "Ideas worth sharing" heading, with its line underneath. */
html #app #feed-view .feed-heading { display: grid; gap: .25rem; justify-items: start; padding: 1.25rem 0 .75rem; }
html #app #feed-view .feed-heading h2 { margin: 0; font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; letter-spacing: -.02em; }
html #app #feed-view .feed-heading-sub { margin: 0; color: var(--muted); font-size: .875rem; line-height: 1.45; }

/* Home: conversation starters, shown while the feed has only a few posts. */
html #app .feed-starters { order: 6; display: grid; gap: .5rem; margin: .75rem 0 0; padding: 1.125rem 1.25rem; border: 1px dashed var(--border-strong); border-radius: var(--ui-radius-panel, 14px); background: color-mix(in srgb, var(--panel) 70%, transparent); }
html #app .feed-starters[hidden] { display: none; }
html #app .feed-starters h3 { margin: 0; font-family: var(--font-display); font-size: 1.0625rem; font-weight: 600; letter-spacing: -.02em; }
html #app .feed-starters p { margin: 0; }
html #app .starter-list { display: grid; gap: .5rem; margin-top: .25rem; }
html #app .starter { display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-height: 44px; padding: .5rem .875rem; border: 1px solid var(--border); border-radius: 999px; background: var(--panel); color: var(--text); font: 500 .9375rem/1.3 var(--font-ui, inherit); text-align: left; cursor: pointer; transition: background-color .2s ease, border-color .2s ease; }
html #app .starter:hover { background: var(--hover); border-color: var(--border-strong); }
html #app .starter:focus-visible { outline: 2px solid var(--sage-main); outline-offset: 2px; }
html #app .starter .icon { flex: none; color: var(--muted); }
@media (min-width: 640px) { html #app .starter-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } html #app .starter { border-radius: .75rem; } }

/* Home: "get involved" tiles under the mission (answer a question, swap skills). */
html #app :is(.involve-tile, .home-skills) { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr) auto; align-items: center; gap: .75rem; width: 100%; min-height: 56px; margin: .5rem 0 0; padding: .75rem .875rem; border: 1px solid var(--border); border-radius: .75rem; background: var(--panel); color: var(--text); text-align: left; font: inherit; cursor: pointer; transition: background-color .2s ease, border-color .2s ease; }
html #app :is(.involve-tile, .home-skills):hover { background: var(--hover); border-color: var(--border-strong); }
html #app :is(.involve-tile, .home-skills):focus-visible { outline: 2px solid var(--sage-main); outline-offset: 2px; }
html #app .involve-icon { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: .625rem; background: var(--mint); color: var(--sage-main); }
html #app .involve-icon .icon { width: 1.25rem; height: 1.25rem; }
html #app :is(.involve-text, .home-skills-text) { display: grid; gap: .125rem; min-width: 0; }
html #app :is(.involve-text, .home-skills-text) strong { font-size: .9375rem; font-weight: 600; line-height: 1.3; }
html #app :is(.involve-text, .home-skills-text) span { color: var(--muted); font-size: .8125rem; line-height: 1.4; }
html #app .home-skills .home-skills-faces { display: none; }
html #app :is(.involve-tile, .home-skills) > .icon { color: var(--muted); }

/* Home: the daily 5-minute session (public/today.js). Neutral panel; the ring is the one accent. */
html #app #feed-today:empty { display: none; }
html #app .today-card { max-width: 640px; margin: .75rem 0 0; padding: 1.125rem 1.25rem .875rem; border: 1px solid var(--border); border-radius: var(--ui-radius-panel); background: var(--panel); color: var(--text); }
html #app .today-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .875rem; }
html #app .today-head h2 { margin: 0; font-family: var(--font-display); font-size: 1.125rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.25; }
html #app .today-sub { margin: .125rem 0 0; color: var(--muted); font-size: .8125rem; line-height: 1.45; }
.today-ring { position: relative; width: 56px; height: 56px; flex: none; }
.today-ring svg { width: 100%; height: 100%; }
.today-ring circle { fill: none; stroke-width: 5; }
.today-ring-track { stroke: color-mix(in srgb, var(--text) 12%, transparent); }
.today-ring-fill { stroke: var(--sage-main); stroke-linecap: round; transition: stroke-dasharray .6s cubic-bezier(.22, 1, .36, 1); }
.today-ring-count { position: absolute; inset: 0; display: grid; place-items: center; font-size: .8125rem; font-weight: 600; font-variant-numeric: tabular-nums; }
html #app .today-streak { display: grid; justify-items: center; min-width: 3rem; color: var(--text); }
html #app .today-streak .icon { width: 1.125rem; height: 1.125rem; color: var(--muted); }
html #app .today-streak strong { font-family: var(--font-display); font-size: 1.375rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
html #app .today-streak span { color: var(--muted); font-size: .75rem; }
html #app .today-steps { list-style: none; margin: .875rem 0 0; padding: 0; display: grid; gap: .375rem; }
html #app .today-step { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .75rem; width: 100%; min-height: 52px; padding: .5rem .75rem; border: 1px solid var(--border); border-radius: 12px; background: transparent; color: var(--text); text-align: left; cursor: pointer; transition: background-color .2s, transform .12s; }
html #app .today-step:hover:not(:disabled) { background: var(--hover); }
html #app .today-step:active:not(:disabled) { transform: scale(.99); }
html #app .today-step:disabled { cursor: default; opacity: .7; }
html #app .today-step-icon { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 999px; background: var(--panel-2); }
html #app .today-step-icon .icon { width: 1rem; height: 1rem; }
html #app .today-step.is-done .today-step-icon { background: color-mix(in srgb, var(--sage-main) 18%, transparent); color: var(--sage-main); }
html #app .today-step-text { display: grid; min-width: 0; }
html #app .today-step-text strong { font-size: .9375rem; font-weight: 500; }
html #app .today-step-text span { overflow: hidden; color: var(--muted); font-size: .8125rem; text-overflow: ellipsis; white-space: nowrap; }
html #app .today-step-go { width: 1rem; height: 1rem; color: var(--muted); }
html #app .today-week { margin: .75rem 0 0; color: var(--text); font-size: .875rem; line-height: 1.5; font-variant-numeric: tabular-nums; }
html #app .today-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .25rem .75rem; margin-top: .5rem; }
html #app .today-note { color: var(--muted); font-size: .75rem; }
html #app .today-foot .link { display: inline-flex; align-items: center; gap: .375rem; min-height: 44px; }
html #app .today-foot .link .icon { width: 1rem; height: 1rem; }
html #app .today-card.just-finished .today-ring { animation: today-pop .5s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes today-pop { 0% { transform: scale(.85); } 100% { transform: scale(1); } }

/* The chart and question sheet. Dialogs sit outside #app. */
dialog.today-sheet { width: min(640px, 100vw); max-width: 100vw; max-height: 100dvh; margin: auto; padding: 0; border: 1px solid var(--border); border-radius: 18px; background: var(--bg); color: var(--text); }
dialog.today-sheet::backdrop { background: rgb(10 10 12 / .55); }
@media (max-width: 640px) { dialog.today-sheet { width: 100vw; height: 100dvh; border: 0; border-radius: 0; } }
.today-sheet-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 1rem .75rem 1.25rem; border-bottom: 1px solid var(--border); background: var(--bg); }
.today-sheet-head h2 { margin: 0; font-family: var(--font-display); font-size: 1.125rem; font-weight: 600; letter-spacing: -.02em; }
.today-sheet-body { display: grid; gap: .875rem; padding: 1rem 1.25rem 1.5rem; }
.today-lead { margin: 0; color: var(--muted); font-size: .875rem; line-height: 1.5; }
.today-q { margin: .25rem 0 0; font-size: 1rem; font-weight: 600; line-height: 1.4; }
.today-text { margin: 0; font-size: .9375rem; line-height: 1.55; }
.today-text.muted { color: var(--muted); font-size: .875rem; }
.today-chart { margin: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); overflow: hidden; }
.today-chart svg { display: block; width: 100%; height: auto; }
.today-hidden-zone { fill: color-mix(in srgb, var(--text) 5%, transparent); }
.today-cut { stroke: var(--border-strong); stroke-dasharray: 4 4; }
.today-hidden-label { fill: var(--muted); font-size: 40px; font-weight: 600; }
.today-later { animation: today-reveal .35s both; animation-delay: calc(var(--i, 0) * 50ms); }
@keyframes today-reveal { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .today-later, html #app .today-card.just-finished .today-ring { animation: none; } }
.today-choices { display: grid; gap: .5rem; }
.today-choice { min-height: 48px; padding: .625rem .875rem; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); color: var(--text); font: inherit; font-size: .9375rem; text-align: left; cursor: pointer; transition: background-color .2s, border-color .2s, transform .12s; }
.today-choice:hover:not(:disabled) { background: var(--hover); border-color: var(--border-strong); }
.today-choice:active:not(:disabled) { transform: scale(.99); }
.today-choice:disabled { cursor: default; }
.today-choice.is-right { border-color: var(--answer-right); box-shadow: inset 3px 0 0 var(--answer-right); }
.today-choice.is-wrong { box-shadow: inset 3px 0 0 var(--muted); }
.today-verdict { margin: 0; font-weight: 600; }
.today-score { display: flex; align-items: baseline; gap: .625rem; }
.today-score strong { font-family: var(--font-display); font-size: 1.75rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.today-score > span { color: var(--muted); font-size: .9375rem; }
.today-crowd { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.today-crowd li { display: grid; grid-template-columns: minmax(0, 1fr) 3rem; gap: .25rem .75rem; align-items: center; font-size: .8125rem; }
.today-crowd-label { grid-column: 1 / -1; color: var(--text); }
.today-crowd-label em { color: var(--muted); font-style: normal; }
.today-crowd-bar { display: block; height: 8px; border-radius: 999px; background: color-mix(in srgb, var(--text) 10%, transparent); overflow: hidden; }
.today-crowd-bar i { display: block; height: 100%; border-radius: inherit; background: var(--muted); }
.today-crowd li.is-mine .today-crowd-bar i { background: var(--sage-main); }
.today-crowd-pc { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.today-mentor { padding: .875rem 1rem; border-radius: 12px; background: var(--panel-2); }
.today-mentor strong { font-size: .8125rem; }
.today-mentor p { margin: .25rem 0 0; font-size: .9375rem; line-height: 1.55; }
dialog.today-sheet[open] { display: flex; flex-direction: column; }
dialog.today-sheet .today-sheet-body { flex: 1 1 auto; align-content: start; overflow-y: auto; }
dialog.today-sheet .today-chart { padding: 0; line-height: 0; }
html #app .today-presence { display: flex; flex-wrap: wrap; align-items: center; gap: 0 .375rem; margin: .75rem 0 0; color: var(--muted); font-size: .8125rem; line-height: 1.5; }
html #app .today-live { width: .5rem; height: .5rem; border-radius: 999px; background: var(--answer-right); box-shadow: 0 0 0 3px color-mix(in srgb, var(--answer-right) 22%, transparent); }
.qs-group { display: grid; gap: .5rem; margin: 0; padding: 0; border: 0; }
.qs-group legend { margin-bottom: .5rem; padding: 0; font-size: 1rem; font-weight: 600; }
.qs-options { display: flex; flex-wrap: wrap; gap: .5rem; }
.qs-option { min-height: 44px; padding: .5rem .875rem; border: 1px solid var(--border); border-radius: 999px; background: var(--panel); color: var(--text); font: inherit; font-size: .875rem; cursor: pointer; transition: background-color .2s, border-color .2s; }
.qs-option:hover { background: var(--hover); }
.qs-option[aria-pressed="true"] { border-color: var(--sage-main); background: color-mix(in srgb, var(--sage-main) 14%, var(--panel)); }
.qs-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.qs-steps .today-choice { display: grid; gap: .125rem; width: 100%; }
.qs-steps .today-choice span { color: var(--muted); font-size: .8125rem; }
html #app .circle-starters { display: grid; gap: .625rem; max-width: 30rem; margin: 1rem auto 0; text-align: left; }
html #app .circle-starters-note { margin: 0; color: var(--text); font-size: .875rem; line-height: 1.5; }
html #app .circle-starters-list { display: grid; gap: .375rem; }
html #app .circle-starters-list .ghost { justify-content: flex-start; min-height: 44px; text-align: left; white-space: normal; }

/* Focus mode: lessons, revision and practice hide the menus (app.js setView). */
body.focus-mode .workspace-rail, body.focus-mode .tabbar { display: none !important; }
@media (min-width: 900px) { html body.focus-mode #app.app { grid-template-columns: minmax(0, 1fr); } }
html body.focus-mode #app .main > .view { padding-bottom: 1.5rem; }

/* Today: the next live class. */
html #app .today-class { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .75rem; margin-top: .75rem; padding: .625rem .75rem; border: 1px dashed var(--border-strong); border-radius: 12px; }
html #app .today-class .today-step-text span { white-space: normal; font-variant-numeric: tabular-nums; }
html #app .today-class .small { min-height: 40px; }

/* A milestone moment: a finished level or a streak landmark. */
dialog.moment-sheet { width: min(360px, calc(100vw - 2rem)); padding: 2rem 1.5rem 1.5rem; border: 1px solid var(--border); border-radius: 20px; background: var(--panel); color: var(--text); text-align: center; overflow: visible; }
dialog.moment-sheet::backdrop { background: rgb(10 10 12 / .6); }
dialog.moment-sheet h2 { margin: 1rem 0 .375rem; font-family: var(--font-display); font-size: 1.375rem; font-weight: 600; letter-spacing: -.02em; text-wrap: balance; }
dialog.moment-sheet p { margin: 0 0 1.25rem; color: var(--muted); font-size: .9375rem; line-height: 1.5; }
dialog.moment-sheet .primary { min-height: 44px; padding-inline: 1.5rem; }
.moment-badge { position: relative; display: grid; place-items: center; width: 72px; height: 72px; margin: 0 auto; border-radius: 999px; background: color-mix(in srgb, var(--sage-main) 16%, var(--panel)); color: var(--sage-main); animation: moment-pop .6s cubic-bezier(.34, 1.56, .64, 1) both; }
.moment-badge .icon { width: 2rem; height: 2rem; }
.moment-burst { position: absolute; top: calc(2rem + 36px); left: 50%; width: 0; height: 0; }
.moment-burst i { position: absolute; width: 4px; height: 12px; margin: -6px -2px; border-radius: 2px; background: var(--sage-main); opacity: 0; transform: rotate(var(--a)) translateY(-30px); animation: moment-ray .7s .15s cubic-bezier(.22, 1, .36, 1) both; }
.moment-burst i:nth-child(even) { background: var(--muted); }
@keyframes moment-pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes moment-ray { 0% { opacity: 0; transform: rotate(var(--a)) translateY(-30px); } 30% { opacity: 1; } 100% { opacity: 0; transform: rotate(var(--a)) translateY(-64px); } }
@media (prefers-reduced-motion: reduce) { .moment-badge, .moment-burst i { animation: none; } .moment-burst { display: none; } }

/* Learn: the skill map above the two directions. */
html #app .skill-map { display: grid; gap: 1rem; margin: 0 0 1.25rem; padding: 1.125rem 1.25rem; border: 1px solid var(--border); border-radius: var(--ui-radius-panel); background: var(--panel); }
html #app .skill-map h2 { margin: 0; font-family: var(--font-display); font-size: 1.125rem; font-weight: 600; letter-spacing: -.02em; }
html #app .skill-row h3 { margin: 0 0 .5rem; font-size: .9375rem; font-weight: 600; }
html #app .skill-row h3 span { color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
html #app .skill-nodes { position: relative; display: flex; gap: .25rem; margin: 0; padding: 0 0 .25rem; list-style: none; overflow-x: auto; scrollbar-width: thin; }
html #app .skill-node { position: relative; flex: 0 0 5.5rem; }
html #app .skill-node:not(:last-child)::after { content: ''; position: absolute; top: 22px; left: calc(50% + 22px); width: calc(100% - 44px + .25rem); height: 2px; background: var(--border-strong); }
html #app .skill-node.is-complete:not(:last-child)::after { background: var(--sage-main); }
html #app .skill-node button { display: grid; justify-items: center; gap: .375rem; width: 100%; padding: 0; border: 0; background: none; color: var(--text); cursor: pointer; }
html #app .skill-dot { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 999px; background: var(--panel-2); transition: transform .15s; }
html #app .skill-node button:hover .skill-dot { transform: scale(1.06); }
html #app .skill-dot svg { position: absolute; inset: 0; width: 100%; height: 100%; }
html #app .skill-dot circle { fill: none; stroke-width: 3; }
html #app .skill-track { stroke: color-mix(in srgb, var(--text) 10%, transparent); }
html #app .skill-fill { stroke: var(--sage-main); stroke-linecap: round; }
html #app .skill-dot .icon { position: relative; width: 1.125rem; height: 1.125rem; color: var(--muted); }
html #app .skill-node.is-complete .skill-dot { background: color-mix(in srgb, var(--sage-main) 16%, var(--panel)); }
html #app .skill-node.is-complete .skill-dot .icon { color: var(--sage-main); }
html #app .skill-node.is-locked { opacity: .55; }
html #app .skill-label { display: -webkit-box; overflow: hidden; font-size: .75rem; line-height: 1.3; text-align: center; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }


/* Admin: return rate. */
html #app .a-return { display: grid; gap: 1rem; margin: 1rem 0; }
html #app .a-return h2 { margin: 0; font-size: 1.0625rem; }
html #app .a-return-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .75rem; }
html #app .a-return-stats > div { display: grid; gap: .125rem; padding: .75rem .875rem; border: 1px solid var(--border); border-radius: 12px; }
html #app .a-return-stats strong { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; font-variant-numeric: tabular-nums; }
html #app .a-return-stats span { font-size: .875rem; }
html #app .a-return-stats small { color: var(--muted); font-size: .75rem; }
html #app .a-return-chart { margin: 0; }
html #app .a-return-chart ol { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); align-items: end; gap: 4px; height: 96px; margin: 0 0 .375rem; padding: 0; list-style: none; }
html #app .a-return-chart li { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 2px; }
html #app .a-return-bar { display: block; width: 100%; border-radius: 4px 4px 0 0; background: color-mix(in srgb, var(--text) 22%, transparent); }
html #app .a-return-chart li:last-child .a-return-bar { background: var(--sage-main); }
html #app .a-return-n { color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; }

/* Create: the plus sits in the middle of the bottom bar (viewers, who can't post, keep four tabs). */
body:not([data-role="viewer"]) #app .tabbar.floating-nav { grid-template-columns: repeat(5, minmax(0, 1fr)); }
#app .tabbar.floating-nav .tab-create { display: grid; justify-items: center; gap: 2px; }

/* ---------- Polish pass: readable sizes, sentence-case labels, AA contrast in both themes ---------- */

/* Nothing below 12px (DESIGN.md caption floor). */
html #app :is(.tabbar .tab-label, .pill, .gf-pulse, .icon-attribution, .site-foot small, .bell-badge) { font-size: .75rem; }
html #app .bell-badge { min-width: 1.125rem; height: 1.125rem; line-height: 1.125rem; padding-inline: .25rem; }
html #app .icon-attribution { display: inline-block; padding-block: .1875rem; }

/* Small labels read in sentence case, not shouted capitals. */
html :is(#app, dialog) :is(.g-kicker, .cc-kicker) { font-size: .75rem; text-transform: none; letter-spacing: 0; }

/* Light theme: small orange text needs the deeper ink to reach 4.5:1 on paper. */
:root:not([data-theme="dark"]) #app :is(.direction-action, .g-kicker, .pf-fact-label, .cc-kicker) { color: var(--sage-deep); }
/* Light theme: muted text on tinted chips and tiles. */
:root:not([data-theme="dark"]) #app :is(.m-badge, .practice-sim, .a-tile span, .a-return .pill) { color: color-mix(in srgb, var(--text) 80%, var(--panel)); }
/* Light theme: the selected Mission tab matches the other selected tabs (ink chip, not orange). */
:root:not([data-theme="dark"]) #app #mission-body .m-tabs .on { background: var(--text); color: var(--panel); }

/* Dark theme: secondary text on the ember panels. */
html[data-theme="dark"] #app .home-skills-text > span:not(:first-child),
html[data-theme="dark"] #app .home-skills-text small { color: color-mix(in srgb, var(--text) 74%, var(--mint)); }

/* Create tab label follows the other tabs in both themes. */
#app .tabbar.floating-nav .tab-create .tab-label { color: inherit; }
/* Win over compact-system.css, which loads later. */
html body #app .floating-nav > button .tab-label { font-size: .75rem; }
html body #app #profile-view .access-badge { font-size: .75rem; }
html body :is(#app, dialog) .g-footer :is(p, .gf-bottom, .gf-bottom *, .icon-attribution) { font-size: .75rem; }
html body #app .home-skills-text > span:not(:first-child) { color: color-mix(in srgb, var(--text) 74%, var(--mint)); }
/* Light theme: orange text on the profile (fact labels, active tab) uses the deeper ink. */
:root:not([data-theme="dark"]) body #app #profile-view :is(.pf-fact-label, .pf-tabs button span) { color: var(--sage-deep); }
:root:not([data-theme="dark"]) body #app #profile-view .pf-tabs button:not(.active):not([aria-selected="true"]) span { color: var(--muted); }
/* Button labels on orange come from the theme (--on-accent), which picks the readable ink. */
body :is(#app, dialog) :is(button.primary:not(:disabled), .g-cta) { color: var(--on-accent); }
html body #app .thumb-stats, html body #app .thumb-stats * { font-size: .75rem; }

/* Keyboard focus is always visible, on every screen size and in dialogs. */
html body :is(#app, dialog, #auth) :is(button, a[href], input, textarea, select, summary, [tabindex]:not([tabindex="-1"])):focus-visible { outline: 2px solid var(--sage-main); outline-offset: 2px; }
/* Browser surfaces carry the palette too. */
::selection { background: color-mix(in srgb, var(--sage-main) 32%, transparent); color: var(--text); }
:root { caret-color: var(--sage-main); accent-color: var(--sage-main); }

/* Skill map, responsive to its own width: a horizontal path when every step fits,
   a vertical path with lesson counts when it doesn't. */
html #app .skill-map { container-type: inline-size; container-name: skillmap; }
html #app .skill-nodes { overflow: visible; gap: 0; }
html #app .skill-node { flex: 0 1 8.5rem; min-width: 0; }
html #app .skill-node:not(:last-child)::after { left: calc(50% + 24px); width: calc(100% - 48px); }
html #app .skill-node button { padding: 0 .125rem; border-radius: 12px; }
html #app .skill-node button:focus-visible { outline-offset: 4px; }
html #app .skill-text { display: grid; gap: .125rem; min-width: 0; }
html #app .skill-label { text-align: center; }
html #app .skill-meta { display: none; color: var(--muted); font-size: .75rem; line-height: 1.3; font-variant-numeric: tabular-nums; }

@container skillmap (max-width: 600px) {
  html #app .skill-nodes { flex-direction: column; gap: .25rem; }
  html #app .skill-node { flex: none; }
  html #app .skill-node button { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; justify-items: start; gap: .75rem; min-height: 52px; padding: .25rem .375rem .25rem 0; text-align: left; }
  html #app .skill-node button:hover { background: var(--hover); }
  html #app .skill-node button:hover .skill-dot { transform: none; }
  html #app .skill-label { display: block; -webkit-line-clamp: unset; font-size: .9375rem; font-weight: 500; text-align: left; }
  html #app .skill-meta { display: block; }
  /* The connector runs down from each dot to the next. */
  html #app .skill-node:not(:last-child)::after { top: calc(50% + 22px); left: 21px; width: 2px; height: calc(100% + .25rem - 44px); }
}

/* Text for screen readers only. */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Today, finished: one calm line that opens to the week. */
html #app .today-card.is-finished { padding: .375rem .375rem .375rem; }
html #app .today-done-bar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .75rem; width: 100%; min-height: 56px; padding: .5rem .75rem; border: 0; border-radius: 12px; background: transparent; color: var(--text); text-align: left; cursor: pointer; transition: background-color .2s; }
html #app .today-done-bar:hover { background: var(--hover); }
html #app .today-done-tick { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 999px; background: color-mix(in srgb, var(--answer-right) 16%, transparent); color: var(--answer-right); }
html #app .today-done-tick .icon { width: 1.125rem; height: 1.125rem; }
html #app .today-done-text { display: grid; min-width: 0; }
html #app .today-done-text strong { font-size: 1rem; font-weight: 600; }
html #app .today-done-text span { color: var(--muted); font-size: .8125rem; font-variant-numeric: tabular-nums; }
html #app .today-done-chevron { width: 1rem; height: 1rem; color: var(--muted); transform: rotate(90deg); transition: transform .25s cubic-bezier(.22, 1, .36, 1); }
html #app .today-card.is-open .today-done-chevron { transform: rotate(-90deg); }
html #app .today-more { padding: 0 .875rem .5rem; }
html #app .today-more[hidden] { display: none; }
html #app .today-card.is-finished .today-class { margin: .25rem .5rem .5rem; }
html #app .today-card.just-finished .today-done-tick { animation: today-pop .5s cubic-bezier(.34, 1.56, .64, 1); }

/* The week strip: seven dots, Monday to Sunday. */
html #app .today-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .25rem; max-width: 22rem; margin: .875rem 0 0; padding: 0; list-style: none; }
html #app .today-strip li { display: grid; justify-items: center; gap: .3125rem; }
html #app .today-strip-dot { width: 1.125rem; height: 1.125rem; border-radius: 999px; border: 2px solid transparent; }
html #app .today-strip-day { color: var(--muted); font-size: .75rem; line-height: 1; }
html #app .today-strip .is-learned .today-strip-dot { background: var(--text); }
html #app .today-strip .is-rest .today-strip-dot { background: linear-gradient(90deg, var(--muted) 50%, transparent 50%); border-color: var(--muted); }
html #app .today-strip .is-missed .today-strip-dot { border-color: var(--border-strong); }
html #app .today-strip .is-today .today-strip-dot { border-color: var(--sage-main); }
html #app .today-strip .is-ahead .today-strip-dot { width: .375rem; height: .375rem; margin-block: .375rem; background: var(--border-strong); }
html #app .today-strip .is-now .today-strip-day { color: var(--text); font-weight: 600; }
html #app .today-strip .is-now.is-learned .today-strip-dot { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--text); }

/* Quieter details: streak flame and the reminder link stay neutral, so the next step is the one accent. */
html #app .today-streak .icon { color: var(--muted); }
html body #app .today-foot .today-remind { color: var(--muted); text-decoration-color: color-mix(in srgb, var(--muted) 50%, transparent); }
html body #app .today-foot .today-remind:hover { color: var(--text); }

/* Daily 5 on Home: the arrow stays on the same row as the title. */
html body #app #feed-view .home-skills.home-daily { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; column-gap: .75rem; }
html body #app #feed-view .home-skills.home-daily > .icon:last-child { grid-row: 1; grid-column: 4; width: 1rem; height: 1rem; color: var(--muted); }

/* Paper trading desk (Learn → Practice → Live NSE charts): chart, Buy/Sell ticket, account tabs. */
.desk { display: grid; gap: .75rem; }
.desk > .form-error:empty { display: none; }
.desk-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.desk-search { display: flex; gap: .375rem; flex: 1 1 14rem; max-width: 20rem; }
.desk-search input { flex: 1; min-width: 0; text-transform: uppercase; }
.desk-search .ghost { min-width: 2.75rem; padding-inline: .625rem; }
.desk-search .icon { width: 1.125rem; height: 1.125rem; }
html body #app .seg.desk-frames { display: inline-grid; grid-auto-flow: column; grid-auto-columns: minmax(2.5rem, auto); }
.desk-quote { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .75rem; margin-left: auto; font-variant-numeric: tabular-nums; }
.desk-quote strong { font-size: 1rem; }
.desk-ltp { font-size: 1.25rem; font-weight: 700; }
.desk-change { font-weight: 600; }
.desk-change.gain, .desk-table .gain { color: var(--answer-right); }
.desk-change.loss, .desk-table .loss { color: var(--answer-wrong); }
.desk-market { color: var(--muted); font-size: .8125rem; }
.desk-market.is-open { color: var(--answer-right); font-weight: 600; }
.desk-market.is-open::before { content: ''; display: inline-block; width: .5rem; height: .5rem; margin-right: .375rem; border-radius: 50%; background: currentColor; animation: desk-pulse 2s ease-in-out infinite; }
@keyframes desk-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .desk-market.is-open::before { animation: none; } }
.desk-chart .practice-figure { margin: 0; }
.desk-asof { margin: .375rem 0 0; }
.practice-ltp line { stroke: var(--text); stroke-width: 1; stroke-dasharray: 2 3; opacity: .7; }
.practice-ltp rect { fill: var(--text); }
.practice-ltp text { fill: var(--bg); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.practice-level.order line { stroke: var(--muted); }
.practice-level.order text { fill: var(--muted); }


.desk-ticket { display: grid; gap: .75rem; max-width: 46rem; padding: 1rem; border: 1px solid var(--border); border-radius: .75rem; background: var(--panel); }
.desk-ticket-head { display: flex; align-items: center; gap: .75rem; }
.desk-ticket-head strong { display: flex; align-items: center; gap: .5rem; margin-right: auto; }
.desk-ticket-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem 1rem; }
.desk-field { display: grid; gap: .25rem; min-width: 0; font-size: .8125rem; font-weight: 500; }
.desk-field input[type="number"] { width: 100%; min-width: 0; }
.desk-check { display: inline-flex; align-items: center; gap: .375rem; min-height: 1.5rem; cursor: pointer; }
.desk-pct { min-height: 1rem; font-variant-numeric: tabular-nums; }
.desk-risk { display: flex; flex-wrap: wrap; align-items: end; gap: .5rem .75rem; }
.desk-risk label { display: grid; gap: .25rem; font-size: .8125rem; font-weight: 500; }
.desk-risk input { width: 9rem; }
.desk-ticket-summary { margin: 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.desk-ticket-summary.over { color: var(--answer-wrong); }
html body #app .desk-submit { justify-self: start; min-width: 12rem; border: 0; color: #fff; }

.desk-panel { display: grid; gap: .5rem; padding: .875rem; border: 1px solid var(--border); border-radius: .75rem; background: var(--panel); }
.desk-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem 1rem; font-variant-numeric: tabular-nums; }
.desk-summary div { display: grid; gap: .125rem; }
.desk-summary span { color: var(--muted); font-size: .75rem; }
.desk-summary b.gain { color: var(--answer-right); }
.desk-summary b.loss { color: var(--answer-wrong); }
html body #app .seg.desk-tabs { display: inline-grid; grid-auto-flow: column; grid-auto-columns: minmax(5.5rem, auto); justify-self: start; }
.desk-count { display: inline-grid; place-items: center; min-width: 1.25rem; height: 1.25rem; margin-left: .375rem; padding: 0 .3rem; border-radius: 999px; background: var(--sage-main); color: var(--on-accent); font-size: .75rem; font-weight: 700; }
.desk-table-wrap { overflow-x: auto; }
.desk-table { width: 100%; border-collapse: collapse; font-size: .8125rem; font-variant-numeric: tabular-nums; }
.desk-table th { padding: .5rem; color: var(--muted); font-weight: 500; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--border); }
.desk-table td { padding: .5rem; border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent); vertical-align: top; }
.desk-table .num { text-align: right; white-space: nowrap; }
.desk-table tr.is-closed { color: var(--muted); }
.desk-table .link { min-height: 0; padding: 0; font-weight: 600; }
.desk-table .ghost.small { min-height: 2rem; padding: .25rem .625rem; }
.desk-row-actions { display: flex; gap: .375rem; justify-content: flex-end; }
.desk-status { font-weight: 600; }
.desk-status.is-open { color: var(--sage-deep); }
.desk-status.is-filled { color: var(--answer-right); }
.desk-status.is-cancelled { color: var(--muted); }
.desk-empty { margin: .5rem 0; }
.desk-rules { display: grid; gap: .25rem; margin: 0 0 .75rem; padding-left: 1.125rem; max-width: 70ch; }
.desk-reset { display: flex; flex-wrap: wrap; align-items: end; gap: .5rem; }
.desk-reset label { display: grid; gap: .25rem; font-size: .8125rem; font-weight: 500; }
.desk-reset input { width: 10rem; }
@media (max-width: 47.99rem) {
  .desk-quote { margin-left: 0; width: 100%; }
  .desk-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html body #app .desk-submit { justify-self: stretch; }
}
html body #app .seg.desk-seg { display: grid; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
html body #app .desk-check { display: inline-flex; flex-direction: row; justify-content: flex-start; align-items: center; gap: .5rem; width: auto; font-weight: 500; }
html body #app .desk-check input[type="checkbox"] { width: 1.125rem; height: 1.125rem; min-height: 0; margin: 0; flex: none; }
html body #app button.desk-submit.primary, html body #app button.desk-submit.primary:hover { color: #fff; border: 0; }
.desk-ticket-summary.warn { color: var(--sage-deep); }

/* Chart workspace (Live NSE charts): toolbar, drawing tools, chart, watchlist, range bar.
   One panel with hairline-separated regions; numbers tabular; orange only for the selected state. */
html body #app #learn-view:has(.ws) .learn-body, html body #app #learn-body:has(.ws) { max-width: none; }
.desk, .practice-live { min-width: 0; grid-template-columns: minmax(0, 1fr); }
.ws { container: ws / inline-size; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto; min-width: 0; border: 1px solid var(--border); border-radius: 14px; background: var(--panel); overflow: hidden; font-variant-numeric: tabular-nums; }
.ws button { font: inherit; }
.ws-toolbar { display: flex; align-items: center; gap: .25rem .5rem; min-width: 0; padding: .375rem .5rem; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.ws-toolbar::-webkit-scrollbar, .ws-tools::-webkit-scrollbar, .ws-ranges::-webkit-scrollbar { display: none; }
.ws-search { display: flex; align-items: center; gap: .375rem; flex: 0 0 auto; height: 2.25rem; padding: 0 .625rem; border: 1px solid var(--border); border-radius: 999px; background: var(--bg); }
.ws-search:focus-within { border-color: var(--sage-main); }
.ws-search .icon { width: 1rem; height: 1rem; color: var(--muted); }
html body #app .ws-search input { width: 7.5rem; min-height: 0; height: 100%; padding: 0; border: 0; background: transparent; box-shadow: none; color: var(--text); font-weight: 700; text-transform: uppercase; outline: none; }
.ws-frames, .ws-range-group { display: flex; flex: 0 0 auto; gap: .125rem; }
.ws-frames button, .ws-range-group button, .ws-toggle { min-width: 2.25rem; height: 2.25rem; padding: 0 .5rem; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: .8125rem; font-weight: 500; cursor: pointer; transition: background-color .15s, color .15s; }
.ws-frames button:hover, .ws-range-group button:hover, .ws-toggle:hover { background: var(--hover); color: var(--text); }
.ws-frames button.on, .ws-range-group button.on { color: var(--sage-main); font-weight: 700; background: color-mix(in srgb, var(--sage-main) 12%, transparent); }
.ws-toggle.on { color: var(--text); background: var(--hover); }
.ws-bar-sep { flex: 0 0 1px; align-self: stretch; margin: .25rem .25rem; background: var(--border); }
html body #app .ws-type { flex: 0 0 auto; width: auto; min-height: 0; height: 2.25rem; padding: 0 2rem 0 .625rem; border-radius: 8px; font-size: .8125rem; }

.ws-main { display: grid; grid-template-columns: 2.75rem minmax(0, 1fr); min-height: 0; }
.ws.has-side .ws-main { grid-template-columns: 2.75rem minmax(0, 1fr) 20rem; }
.ws:not(.has-side) .ws-side { display: none; }
.ws-live { margin-left: auto; }
.ws-side-toggle { margin-left: .25rem; }
.ws-tools { display: flex; flex-direction: column; align-items: center; gap: .125rem; padding: .375rem .25rem; border-right: 1px solid var(--border); }
.ws-tools button { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; flex: 0 0 auto; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; transition: background-color .15s, color .15s; }
.ws-tools button:hover { background: var(--hover); color: var(--text); }
.ws-tools button.on { color: var(--sage-main); background: color-mix(in srgb, var(--sage-main) 12%, transparent); }
.ws-tool-icon { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ws-tools-sep { flex: 0 0 auto; width: 1.5rem; height: 1px; margin: .25rem 0; background: var(--border); }

.ws-stage { position: relative; min-width: 0; }
.ws-pane { position: absolute; inset: 0; }
.ws-pane .draw-layer { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.ws-legend { position: absolute; z-index: 4; top: .5rem; left: .625rem; right: 5.5rem; display: grid; justify-items: start; gap: .375rem; pointer-events: none; font-size: .8125rem; }
.ws-legend > * { pointer-events: auto; }
.ws-legend-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .5rem; padding: .125rem .375rem; border-radius: 6px; background: color-mix(in srgb, var(--panel) 82%, transparent); }
.ws-legend-title strong { font-size: .9375rem; }
.ws-legend-title > span { color: var(--muted); }
.ws-ohlc { display: inline-flex; flex-wrap: wrap; gap: .125rem .625rem; }
.ws-ohlc b { color: var(--muted); font-weight: 500; }
.ws-trades { display: flex; gap: 1px; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; background: var(--border-strong); }
.ws-trade { display: grid; justify-items: center; min-width: 5.75rem; padding: .25rem .625rem; border: 0; background: var(--panel); color: var(--text); cursor: pointer; line-height: 1.2; transition: background-color .15s; }
.ws-trade span { color: var(--muted); font-size: .75rem; }
.ws-trade b { font-size: .9375rem; }
.ws-trade:hover { background: var(--hover); }
.ws-trade:active { transform: translateY(1px); }
.ws-mas { display: flex; flex-wrap: wrap; gap: .125rem .625rem; padding: .125rem .375rem; color: var(--muted); font-size: .75rem; }
.ws-ma-0 { color: var(--text); }
.ws-countdown { position: absolute; z-index: 4; right: 0; padding: .0625rem 0; background: var(--text); color: var(--bg); font-size: .6875rem; font-weight: 700; text-align: center; pointer-events: none; opacity: .85; }
.ws-status { position: absolute; z-index: 5; inset: 0; display: grid; place-items: center; padding: 1rem; background: color-mix(in srgb, var(--panel) 70%, transparent); color: var(--muted); text-align: center; }
.ws-status[hidden], .ws-countdown[hidden] { display: none; }

.ws-side { display: grid; align-content: start; min-width: 0; border-left: 1px solid var(--border); overflow-y: auto; }
.ws-watch { display: grid; gap: .25rem; padding: .75rem .75rem .5rem; border-bottom: 1px solid var(--border); }
.ws-side-head { display: flex; align-items: baseline; justify-content: space-between; }
.ws-side-head h3 { margin: 0; font-size: .9375rem; font-weight: 600; }
.ws-watch-cols, .ws-watch-row { display: grid; grid-template-columns: minmax(5.25rem, 1.3fr) minmax(0, 1fr) minmax(0, .8fr) minmax(0, .8fr); gap: .25rem; align-items: center; }
.ws-watch-cols { padding: .25rem 1.75rem .25rem .375rem; color: var(--muted); font-size: .75rem; }
.ws-watch-cols span:not(:first-child) { text-align: right; }
.ws-watch-list { margin: 0; padding: 0; list-style: none; }
.ws-watch-list li { position: relative; display: flex; align-items: center; border-radius: 8px; }
.ws-watch-list li.on { background: color-mix(in srgb, var(--sage-main) 10%, transparent); }
.ws-watch-row { flex: 1; min-width: 0; min-height: 2.5rem; padding: 0 .375rem; border: 0; border-radius: 8px; background: transparent; color: var(--text); font-size: .8125rem; text-align: left; cursor: pointer; }
.ws-watch-row:hover { background: var(--hover); }
.ws-watch-sym { overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.ws-watch-num { text-align: right; white-space: nowrap; }
.ws .gain { color: var(--answer-right); }
.ws .loss { color: var(--answer-wrong); }
.ws-watch-remove { display: grid; place-items: center; width: 1.5rem; height: 1.5rem; margin-right: .125rem; border: 0; border-radius: 6px; background: transparent; color: var(--muted); opacity: 0; cursor: pointer; transition: opacity .15s; }
.ws-watch-list li:hover .ws-watch-remove, .ws-watch-remove:focus-visible { opacity: 1; }
.ws-watch-remove .icon { width: .875rem; height: .875rem; }
.ws-watch-add { display: flex; gap: .375rem; margin-top: .25rem; }
html body #app .ws-watch-add input { flex: 1; min-width: 0; min-height: 0; height: 2.25rem; padding: 0 .625rem; font-size: .8125rem; text-transform: uppercase; }
html body #app .ws-watch-add .ghost { min-width: 2.25rem; min-height: 0; height: 2.25rem; padding: 0; }
.ws-watch-add .icon { width: 1rem; height: 1rem; }
.ws-details { display: grid; gap: .375rem; padding: .875rem .75rem; }
.ws-details-head { display: flex; align-items: baseline; gap: .5rem; }
.ws-details-head strong { font-size: 1rem; }
.ws-details-head .muted, .ws-details-price .muted { font-size: .75rem; }
.ws-details-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .5rem; }
.ws-details-price b { font-family: 'Bricolage Grotesque', Outfit, system-ui, sans-serif; font-size: 1.75rem; font-weight: 600; letter-spacing: -0.02em; }
.ws-details-price span:last-child { font-weight: 600; }
.ws-market { margin: 0; color: var(--muted); font-size: .8125rem; }
.ws-market.is-open { color: var(--answer-right); }
.ws-market.is-open::before { content: ''; display: inline-block; width: .5rem; height: .5rem; margin-right: .375rem; border-radius: 50%; background: currentColor; animation: desk-pulse 2s ease-in-out infinite; }
.ws-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem .75rem; margin: .25rem 0; }
.ws-stats div { display: grid; gap: .0625rem; }
.ws-stats dt { color: var(--muted); font-size: .75rem; }
.ws-stats dd { margin: 0; font-weight: 600; font-size: .875rem; }
.ws-details > .small { margin: 0; }

.ws-ranges { display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-width: 0; padding: .25rem .5rem; border-top: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.ws-credit { display: flex; flex: 0 0 auto; align-items: center; gap: .75rem; color: var(--muted); font-size: .75rem; }
.ws-credit a { color: var(--muted); text-decoration-color: color-mix(in srgb, var(--muted) 45%, transparent); }
.ws-clock { flex: 0 0 auto; color: var(--muted); font-size: .8125rem; }

/* Narrow: the tools become a row above the chart, the watchlist moves below it. */
@container ws (max-width: 56rem) {
  .ws-main, .ws.has-side .ws-main { grid-template-columns: minmax(0, 1fr); }
  .ws-tools { flex-direction: row; order: -1; min-width: 0; padding: .25rem .375rem; border-right: 0; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
  .ws-tools-sep { width: 1px; height: 1.5rem; margin: 0 .25rem; }
  .ws-side { grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); border-left: 0; border-top: 1px solid var(--border); }
  .ws-watch { border-bottom: 0; }
  .ws-watch-remove { opacity: 1; }
}
@container ws (max-width: 30rem) {
  .ws-plot { height: max(26rem, 62vh); }
  .ws-legend { right: 4.5rem; }
  .ws-ohlc { font-size: .75rem; }
  .ws-trade { min-width: 4.75rem; }
  .ws-mas { display: none; }
}

/* The order ticket follows the app's own rules: orange for the one action, gain and loss
   colours only on numbers. */
html body #app .seg.desk-side button.on.buy, html body #app .seg.desk-side button.on.sell { background: var(--text); color: var(--bg); }
html body #app button.desk-submit.primary.buy, html body #app button.desk-submit.primary.sell { background: var(--sage-main); color: var(--on-accent); }

/* Chart workspace, part 2: indicators, their panels, the drawing style bar and scale controls. */
/* Indicator lines get their own calm data palette, separate from the orange accent and from
   gain/loss colours. Dark first, then light. */
:root { --study-1: #7DA7D9; --study-2: #5FC4B8; --study-3: #B49AE0; --study-4: #D9B26F; --study-5: #8EC9E8; --study-6: #A9B86A; }
:root:not([data-theme="dark"]) { --study-1: #2F6DB5; --study-2: #1E8C80; --study-3: #7A5BC2; --study-4: #9A6B1F; --study-5: #2C8AB3; --study-6: #6E7D2A; }
html[data-theme="dark"] { --study-1: #7DA7D9; --study-2: #5FC4B8; --study-3: #B49AE0; --study-4: #D9B26F; --study-5: #8EC9E8; --study-6: #A9B86A; }

.ws { position: relative; }
.ws-stage { display: flex; flex-direction: column; }
.ws-plot { position: relative; flex: 0 0 auto; height: clamp(28rem, 74vh, 54rem); }
.ws-panes { display: grid; flex: 0 0 auto; }
.ws-sub { position: relative; height: 7.5rem; border-top: 1px solid var(--border); }
.ws-sub-chart { position: absolute; inset: 0; }
.ws-sub-title { position: absolute; z-index: 2; top: .25rem; left: .625rem; }
.ws-studies { display: grid; justify-items: start; gap: .125rem; }
.ws-study { display: inline-flex; align-items: center; gap: .5rem; padding: .0625rem .375rem; border-radius: 6px; background: color-mix(in srgb, var(--panel) 82%, transparent); font-size: .75rem; }
.ws-study-name { color: var(--muted); }
.ws-study-value { color: var(--line, var(--text)); font-weight: 600; }
.ws-study-remove { display: grid; place-items: center; width: 1.25rem; height: 1.25rem; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--muted); opacity: 0; cursor: pointer; transition: opacity .15s; }
.ws-study:hover .ws-study-remove, .ws-study-remove:focus-visible { opacity: 1; }
.ws-study-remove .icon { width: .75rem; height: .75rem; }
@media (hover: none) { .ws-study-remove { opacity: 1; } }

.ws-menu-wrap { position: relative; flex: 0 0 auto; }
.ws-toggle .ws-tool-icon { width: 1rem; height: 1rem; margin-right: .25rem; vertical-align: -0.2em; }
.ws-menu { position: absolute; z-index: 20; top: 3.25rem; left: .5rem; width: min(22rem, calc(100% - 1rem)); display: grid; gap: .75rem; padding: .875rem; border: 1px solid var(--border-strong); border-radius: 14px; background: var(--panel); box-shadow: 0 12px 32px -12px color-mix(in srgb, var(--bg) 70%, transparent); }
.ws-menu[hidden] { display: none; }
.ws-menu-head { display: flex; align-items: center; justify-content: space-between; }
.ws-menu-head h3, .ws-menu-on h4 { margin: 0; font-size: .9375rem; font-weight: 600; }
.ws-menu-on h4 { font-size: .8125rem; color: var(--muted); font-weight: 500; }
.ws-menu-list { display: grid; gap: .25rem; }
.ws-menu-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: .5rem; min-height: 2.5rem; padding: 0 .25rem; border-radius: 8px; font-size: .875rem; }
.ws-menu-row:hover { background: var(--hover); }
.ws-menu-row small { color: var(--muted); font-size: .75rem; }
.ws-menu-row > span { grid-column: 1; }
div.ws-menu-row > button { grid-column: 3; }
html body #app .ws-menu-row input[type="number"] { width: 4.25rem; min-height: 0; height: 2rem; padding: 0 .5rem; font-size: .8125rem; }
html body #app .ws-menu-row .ghost.small { min-height: 0; height: 2rem; padding: 0 .75rem; }
.ws-menu-check { cursor: pointer; }
.ws-menu-check input { grid-column: 3; width: 1.125rem; height: 1.125rem; }
.ws-menu-on { display: grid; gap: .375rem; padding-top: .625rem; border-top: 1px solid var(--border); }
.ws-menu-on ul { display: grid; gap: .125rem; margin: 0; padding: 0; list-style: none; }
.ws-menu-on li { display: flex; align-items: center; justify-content: space-between; min-height: 2rem; font-size: .875rem; }

.ws-style { position: absolute; z-index: 6; top: .5rem; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: .125rem; padding: .25rem; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--panel); box-shadow: 0 8px 24px -12px color-mix(in srgb, var(--bg) 70%, transparent); }
.ws-style[hidden] { display: none; }
.ws-style-group { display: flex; gap: .125rem; }
.ws-style button { display: grid; place-items: center; width: 2rem; height: 2rem; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.ws-style button:hover { background: var(--hover); color: var(--text); }
.ws-style button.on { color: var(--sage-main); background: color-mix(in srgb, var(--sage-main) 12%, transparent); }
.ws-style .ws-tool-icon { width: 1.125rem; height: 1.125rem; }
.ws-style .ws-swatch::before { content: ''; width: 1rem; height: 1rem; border-radius: 50%; background: var(--swatch); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 18%, transparent); }
.ws-style .ws-swatch.on { background: transparent; box-shadow: inset 0 0 0 2px var(--text); }
.ws-width { display: block; width: 1.125rem; border-radius: 2px; background: currentColor; }
.ws-width-1 { height: 1px; } .ws-width-2 { height: 2px; } .ws-width-3 { height: 3px; }
.ws-style-sep { width: 1px; height: 1.5rem; margin: 0 .25rem; background: var(--border); }

.ws-scale { display: inline-flex; gap: .125rem; }
.ws-scale button { min-width: 2rem; height: 2rem; padding: 0 .5rem; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: .8125rem; cursor: pointer; }
.ws-scale button:hover { background: var(--hover); color: var(--text); }
.ws-scale button.on { color: var(--sage-main); font-weight: 700; }
@container ws (max-width: 30rem) {
  .ws-sub { height: 6rem; }
  .ws-style { left: .5rem; right: .5rem; transform: none; overflow-x: auto; }
  .ws-studies { display: none; }
}

/* Live ticks badge: shown while prices stream from Alice Blue. */
.ws-live { display: inline-flex; flex: 0 0 auto; align-items: center; gap: .375rem; height: 1.75rem; padding: 0 .625rem; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font-size: .75rem; font-weight: 600; }
.ws-live[hidden] { display: none; }
.ws-live::before { content: ''; width: .5rem; height: .5rem; border-radius: 50%; background: var(--muted); }
.ws-live.is-live { color: var(--answer-right); border-color: color-mix(in srgb, var(--answer-right) 40%, var(--border)); }
.ws-live.is-live::before { background: currentColor; animation: desk-pulse 2s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .ws-live.is-live::before { animation: none; } }
.ws-live[hidden] + .ws-side-toggle { margin-left: auto; }

/* Chart workspace, matched to the member's TradingView layout: blue rising candles, a market
   badge in the legend, and today's volume against the 30-day average. */
/* Exactly the member's TradingView candles on the light theme; the navy is lifted on the dark
   theme so rising candles stay visible against the dark chart. */
:root { --candle-up: #0c3299; --candle-down: #f23645; }
html[data-theme="dark"], :root[data-theme="dark"] { --candle-up: #4a74e0; --candle-down: #f23645; }
.ws-session { padding: 0 .375rem; border: 1px solid var(--border-strong); border-radius: 4px; color: var(--muted); font-size: .75rem; }
.ws-session.is-open { border-color: var(--answer-right); color: var(--answer-right); }
.ws-volume { display: grid; gap: .3125rem; margin: .25rem 0; }
.ws-volume-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem .75rem; color: var(--muted); font-size: .75rem; }
.ws-volume-head b { color: var(--text); font-weight: 600; }
.ws-volume-bar { height: .3125rem; border-radius: 999px; background: var(--border-strong); overflow: hidden; }
.ws-volume-bar span { display: block; height: 100%; width: 100%; border-radius: inherit; background: var(--candle-up); transform-origin: left center; transform: scaleX(var(--fill, 0)); }
.ws-menu-check select { min-height: 2rem; }

/* Indicators menu: grouped, and scrolls when the list is longer than the chart. */
.ws-menu { max-height: min(36rem, calc(100% - 4rem)); overflow-y: auto; overscroll-behavior: contain; }
.ws-menu-list h4 { margin: .5rem 0 .125rem; color: var(--muted); font-size: .75rem; font-weight: 600; letter-spacing: .02em; }
.ws-menu-list h4:first-child { margin-top: 0; }
/* A candle pattern under the pointer, explained in the legend. */
.ws-pattern { max-width: 26rem; margin: .25rem 0 0; padding: .25rem .5rem; border-radius: 6px; background: color-mix(in srgb, var(--panel) 88%, transparent); color: var(--muted); font-size: .8125rem; }
.ws-pattern b { color: var(--text); font-weight: 600; }

/* Bar replay: a control bar under the chart, and a prompt while picking the start candle. */
.ws-replay { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .5rem .75rem; border-top: 1px solid var(--border); background: var(--panel); }
.ws-replay[hidden], .ws-replay-pick[hidden] { display: none; }
.ws-replay-group { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem; }
.ws-replay-group select, .ws-replay-group input { min-height: 2rem; }
.ws-replay-group .icon-button .ws-tool-icon { width: 1.125rem; height: 1.125rem; }
.ws-replay-time { color: var(--muted); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.ws-replay-fields { display: flex; flex-wrap: wrap; gap: .375rem; }
.ws-replay-fields label { display: flex; align-items: center; gap: .25rem; color: var(--muted); font-size: .75rem; }
.ws-replay-fields input { width: 5.5rem; }
.ws-replay-sides { display: flex; gap: .375rem; }
.ws-replay-sides .ws-buy { background: var(--candle-up); color: var(--panel); border-color: transparent; }
.ws-replay-sides .ws-sell { background: var(--candle-down); color: var(--panel); border-color: transparent; }
.ws-replay-open, .ws-replay-score { font-size: .875rem; font-variant-numeric: tabular-nums; }
.ws-replay-score { margin-left: auto; color: var(--muted); }
.ws-replay-note { flex-basis: 100%; margin: 0; color: var(--muted); font-size: .8125rem; }
.ws-replay-note:empty { display: none; }
.ws-replay-pick { position: absolute; z-index: 6; top: 3.5rem; left: 50%; transform: translateX(-50%); padding: .375rem .75rem; border-radius: 999px; background: var(--sage-main); color: var(--panel); font-size: .8125rem; font-weight: 600; pointer-events: none; }
.ws.is-replay .ws-live, .ws.is-replay .ws-countdown { display: none; }
.ws-replay-group select { width: auto; min-width: 0; }
.ws-replay-group input { width: 5.5rem; min-width: 0; }

/* Selected long/short drawing: send its levels to the order ticket or the replay. */
.ws-style .ws-style-use { width: auto; padding: 0 .625rem; border-radius: 6px; background: var(--sage-main); color: var(--panel); font-size: .8125rem; font-weight: 600; white-space: nowrap; }

/* One chart or several: the switch above the chart, and the 2- or 4-chart grid. */
.desk-layout { justify-self: start; }
.grid-charts { display: grid; gap: .75rem; }
.grid-charts[hidden] { display: none; }
.grid-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.grid-bar p { margin: 0; }
.grid-cells { display: grid; gap: .75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cell { display: grid; grid-template-rows: auto 1fr; min-width: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); overflow: hidden; }
.grid-head { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem .5rem; padding: .5rem .625rem; border-bottom: 1px solid var(--border); }
.grid-symbol input { width: 8rem; min-width: 0; min-height: 2rem; font-weight: 600; text-transform: uppercase; }
.grid-head select { width: auto; min-width: 0; min-height: 2rem; }
.grid-quote { flex: 1 1 auto; font-size: .8125rem; font-variant-numeric: tabular-nums; }
.grid-quote b { font-weight: 600; }
.grid-pane { position: relative; min-height: 0; height: 22rem; }
.grid-4 .grid-pane { height: 16rem; }
@container ws (max-width: 760px) { .grid-cells { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .grid-cells { grid-template-columns: minmax(0, 1fr); } }

/* Price alerts popover. */
.ws-alerts { left: auto; right: .5rem; }
.ws-alert-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: .5rem; align-items: end; }
.ws-alert-form label { display: grid; gap: .25rem; color: var(--muted); font-size: .75rem; }
.ws-alert-list { display: grid; gap: .25rem; margin: 0; padding: 0; list-style: none; }
.ws-alert-list li { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .375rem 0; border-top: 1px solid var(--border); font-size: .875rem; font-variant-numeric: tabular-nums; }
.ws-alert-list li.is-fired { color: var(--muted); }
.ws-alert-list small { color: var(--muted); }

/* Market depth in the stock panel: bids on the left, asks on the right, bars for quantity. */
.ws-depth { display: grid; gap: .375rem; margin: .25rem 0; }
.ws-depth h4 { margin: 0; font-size: .8125rem; font-weight: 600; }
.ws-depth-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.ws-depth-head, .ws-depth-row { display: grid; grid-template-columns: 1.3fr 1fr .6fr; gap: .25rem; font-size: .75rem; font-variant-numeric: tabular-nums; }
.ws-depth-head { color: var(--muted); }
.ws-depth-row { position: relative; padding: .125rem .25rem; border-radius: 4px; isolation: isolate; }
.ws-depth-row::before { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; transform-origin: left center; transform: scaleX(var(--fill, 0)); }
.ws-depth-row.is-bid::before { background: color-mix(in srgb, var(--candle-up) 16%, transparent); }
.ws-depth-row.is-ask::before { background: color-mix(in srgb, var(--candle-down) 16%, transparent); }
.ws-depth-row.is-bid span:first-child { color: var(--candle-up); font-weight: 600; }
.ws-depth-row.is-ask span:first-child { color: var(--candle-down); font-weight: 600; }
.ws-depth-total { display: grid; grid-template-columns: auto 1fr auto; gap: .5rem; align-items: center; color: var(--muted); font-size: .75rem; }
.ws-depth-total .ws-volume-bar { background: color-mix(in srgb, var(--candle-down) 45%, transparent); }

/* Share popover, and the note while class drawings are shown. */
.ws-share-form { display: grid; gap: .5rem; }
.ws-share-form textarea { width: 100%; resize: vertical; }
.ws-share-form p { margin: 0; }
.ws-class-note { position: absolute; z-index: 6; left: .75rem; bottom: 2.25rem; display: flex; align-items: center; gap: .5rem; padding: .25rem .625rem; border-radius: 999px; background: color-mix(in srgb, var(--panel) 90%, transparent); border: 1px solid var(--border-strong); font-size: .75rem; }
.ws-class-note[hidden] { display: none; }

/* Toolbar with alerts, replay, class and share: buttons keep icon and label on one line; on a
   narrower chart the labels go and the icons stay (each keeps its name for screen readers). */
.ws-toolbar .ws-toggle { display: inline-flex; flex: 0 0 auto; align-items: center; gap: .25rem; white-space: nowrap; }
.ws-toolbar .ws-toggle .ws-tool-icon { margin-right: 0; }
@container ws (max-width: 72rem) {
  .ws-toolbar .ws-toggle:has(.ws-tool-icon) { font-size: 0; gap: 0; padding-inline: .5rem; }
  .ws-toolbar .ws-toggle:has(.ws-tool-icon) .ws-tool-icon { width: 1.125rem; height: 1.125rem; }
}

/* The live pill is a button: "Live off" opens the reason, with Reconnect and Try again. */
button.ws-live { background: transparent; font-family: inherit; cursor: pointer; }
button.ws-live:hover { color: var(--text); border-color: var(--border-strong); }
.ws-live.is-off { border-style: dashed; }
.ws-live.is-off::before { background: transparent; border: 1.5px solid var(--muted); }
/* The desk's message line doubles as a plain note when live prices are off (not an error). */
.desk > .form-error.is-note { color: var(--muted); background: transparent; border-color: var(--border); }

/* Focus: the paper desk on the whole screen. Only applies once the desk adds .is-focus. The chart
   fills the height; the account is one line under it; the order ticket opens over the chart's
   right edge, so a trade never means leaving the chart. */
.desk.is-focus { position: fixed; inset: 0; z-index: 55; display: grid; grid-template-rows: minmax(0, 1fr) auto auto; gap: 0; padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); background: var(--bg); }
.desk.is-focus:fullscreen { background: var(--bg); }
.desk.is-focus::backdrop { background: var(--bg); }
html.desk-focus-open, html.desk-focus-open body { overflow: hidden; }
.desk.is-focus > .desk-layout { display: none; }
.desk.is-focus > .ws { grid-row: 1; height: 100%; border: 0; border-radius: 0; }
.desk.is-focus .ws-main { min-height: 0; }
.desk.is-focus .ws-stage { min-height: 0; }
.desk.is-focus .ws-plot { flex: 1 1 auto; height: auto; min-height: 14rem; }
.desk.is-focus .ws-side { max-height: 100%; }
.desk.is-focus > .form-error { grid-row: 2; margin: 0; border-radius: 0; }
.desk.is-focus > .desk-panel { grid-row: 3; padding: .5rem .875rem; border-width: 1px 0 0; border-radius: 0; }
.desk.is-focus > .desk-panel > :not(.desk-summary) { display: none; }
.desk.is-focus .desk-summary { grid-template-columns: repeat(4, max-content); justify-content: start; gap: .25rem 2rem; }
.desk.is-focus .desk-summary div { display: flex; align-items: baseline; gap: .5rem; }
.desk.is-focus > .desk-ticket-box:not(:empty) { position: absolute; z-index: 8; top: 3.25rem; right: .75rem; width: min(24rem, calc(100% - 1.5rem)); max-height: calc(100% - 7rem); overflow-y: auto; border-radius: 14px; box-shadow: 0 18px 40px -18px color-mix(in srgb, var(--text) 45%, transparent); }
.desk.is-focus > .desk-ticket-box .desk-ticket { margin: 0; }
.ws-focus-toggle.on { color: var(--sage-main); }
@media (max-width: 640px) {
  .desk.is-focus .desk-summary { grid-template-columns: repeat(2, max-content); gap: .125rem 1.25rem; }
  .desk.is-focus > .desk-ticket-box:not(:empty) { top: auto; bottom: 0; right: 0; left: 0; width: auto; max-height: 70%; border-radius: 14px 14px 0 0; }
}
@media (prefers-reduced-motion: no-preference) {
  .desk.is-focus > .ws { animation: desk-focus-in .28s cubic-bezier(.16, 1, .3, 1); }
  @keyframes desk-focus-in { from { opacity: .4; transform: scale(.985); } }
}

/* Phone: the account panel stays inside the screen (its table scrolls on its own). */
.desk-panel { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 640px) { .desk-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
html body .desk.is-focus > .desk-panel > :not(.desk-summary) { display: none; }
.desk.is-focus .ws-main { overflow: hidden; }
.desk.is-focus .ws-side, .desk.is-focus .ws-tools { min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.desk.is-focus .ws-tools { overflow-x: hidden; }
.desk > .form-error.is-note button { margin-left: .75rem; }
html body #app .desk.is-focus > .desk-panel > :not(.desk-summary) { display: none; }
/* A narrow ticket (focus drawer, phone): one column, so the segmented labels never break. */
.desk.is-focus .desk-ticket-grid { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 640px) { .desk-ticket-grid { grid-template-columns: minmax(0, 1fr); } }
.desk-ticket .seg button { white-space: nowrap; }
@container ws (max-width: 56rem) { .desk.is-focus .ws-side { display: none; } }
@media (max-width: 760px) { .desk.is-focus .ws-side { display: none; } }
.desk.is-focus > .form-error.is-note { padding: .375rem .875rem; font-size: .75rem; }
@container ws (max-width: 56rem) { .desk.is-focus .ws-main { grid-template-rows: auto minmax(0, 1fr); } }

/* ---- Critique follow-up ---- */
/* The order ticket opens over the chart's right edge, in the normal view and in Focus. */
.ws > .desk-ticket-box:not(:empty) { position: absolute; z-index: 8; top: 3.25rem; left: 3.25rem; right: auto; width: min(24rem, calc(100% - 4rem)); max-height: calc(100% - 6.5rem); overflow-y: auto; overscroll-behavior: contain; border-radius: 14px; box-shadow: 0 18px 40px -18px color-mix(in srgb, var(--text) 45%, transparent); }
.ws > .desk-ticket-box .desk-ticket { margin: 0; }
.ws > .desk-ticket-box .desk-ticket-grid { grid-template-columns: minmax(0, 1fr); }
@container ws (max-width: 40rem) {
  .ws > .desk-ticket-box:not(:empty) { top: auto; right: 0; bottom: 0; left: 0; width: auto; max-height: 72%; border-radius: 14px 14px 0 0; }
}
/* Indicator values: readable text, with the line's colour as a dot before it. */
.ws-study-value { color: var(--text); display: inline-flex; align-items: center; gap: .3rem; }
.ws-study-value::before { content: ''; width: .5rem; height: .5rem; border-radius: 50%; background: var(--line, var(--muted)); flex: 0 0 auto; }
/* Selected timeframe and range: the deeper accent, for text contrast on the tint. */
.ws-frames button.on, .ws-range-group button.on { color: var(--sage-deep, var(--sage-main)); }
/* Status and replay buttons: market colours stay on data; actions and states are neutral. */
.desk-status.is-filled { color: var(--text); }
.ws-replay-sides .ws-buy, .ws-replay-sides .ws-sell { background: var(--panel); color: var(--text); border: 1px solid var(--border-strong); }
.ws-replay-sides .ws-buy:hover, .ws-replay-sides .ws-sell:hover { background: var(--hover); }
/* Strips that scroll sideways on narrow charts fade at the edge, so it's clear there is more. */
@container ws (max-width: 56rem) {
  .ws-toolbar, .ws-ranges { mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent); }
  .ws-tools { mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent); }
}
/* Market-open dots stop pulsing when the member prefers less motion. */
@media (prefers-reduced-motion: reduce) {
  .desk-market.is-open::before, .ws-market.is-open::before, .ws-live.is-live::before { animation: none; }
}
.grid-back { justify-self: start; }
@container ws (max-width: 92rem) {
  .ws-toolbar .ws-toggle:has(.ws-tool-icon) { font-size: 0; gap: 0; padding-inline: .5rem; }
  .ws-toolbar .ws-toggle:has(.ws-tool-icon) .ws-tool-icon { width: 1.125rem; height: 1.125rem; }
}

/* ---- Drawing rail in groups, with flyouts (as on TradingView) ---- */
.ws-group { position: relative; display: grid; }
.ws-group-main { position: relative; }
.ws-tools .ws-group-more { position: absolute; right: -2px; bottom: 2px; width: .875rem; height: .875rem; min-width: 0; padding: 0; border: 0; border-radius: 3px; background: transparent; color: var(--muted); opacity: .55; cursor: pointer; display: grid; place-items: center; }
.ws-tools .ws-group-more .ws-tool-icon { width: .625rem; height: .625rem; stroke-width: 2.5; }
.ws-tools .ws-group:hover .ws-group-more, .ws-tools .ws-group-more:focus-visible { opacity: 1; background: var(--hover); color: var(--text); }
.ws-flyout { position: absolute; z-index: 30; min-width: 15rem; max-height: min(30rem, calc(100% - 1rem)); overflow-y: auto; padding: .375rem; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--panel); box-shadow: 0 16px 36px -16px color-mix(in srgb, var(--text) 40%, transparent); }
.ws-flyout[hidden] { display: none; }
.ws-flyout-title { margin: .5rem .5rem .25rem; color: var(--muted); font-size: .6875rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.ws-flyout-title:first-child { margin-top: .25rem; }
.ws-flyout hr { margin: .375rem .25rem; border: 0; border-top: 1px solid var(--border); }
.ws-flyout button { display: flex; width: 100%; align-items: center; gap: .625rem; min-height: 2.25rem; padding: 0 .625rem; border: 0; border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-size: .875rem; text-align: left; cursor: pointer; }
.ws-flyout button:hover, .ws-flyout button:focus-visible { background: var(--hover); }
.ws-flyout button.on { background: color-mix(in srgb, var(--sage-main) 12%, transparent); color: var(--sage-deep, var(--text)); font-weight: 600; }
.ws-flyout .ws-tool-icon { flex: 0 0 auto; width: 1.25rem; height: 1.25rem; }
.ws-pane[data-cursor="arrow"] { cursor: default; }
.ws-pane[data-cursor="dot"] { cursor: crosshair; }
@container ws (max-width: 56rem) { .ws-tools .ws-group-more { opacity: 1; } }

/* ---- Right-click menu on the chart ---- */
.ws-ctx { position: absolute; z-index: 40; min-width: 17rem; padding: .375rem; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--panel); box-shadow: 0 16px 36px -16px color-mix(in srgb, var(--text) 40%, transparent); }
.ws-ctx[hidden] { display: none; }
.ws-ctx hr { margin: .25rem; border: 0; border-top: 1px solid var(--border); }
.ws-ctx hr + hr, .ws-ctx hr:first-child { display: none; }
.ws-ctx button { display: grid; grid-template-columns: 1.25rem 1fr auto; align-items: center; gap: .625rem; width: 100%; min-height: 2rem; padding: 0 .625rem; border: 0; border-radius: 7px; background: transparent; color: var(--text); font: inherit; font-size: .8125rem; text-align: left; cursor: pointer; }
.ws-ctx button:hover:not(:disabled), .ws-ctx button:focus-visible { background: var(--hover); }
.ws-ctx button:disabled { color: var(--muted); cursor: default; }
.ws-ctx .ws-tool-icon, .ws-ctx-gap { width: 1.125rem; height: 1.125rem; }
.ws-ctx kbd { color: var(--muted); font: inherit; font-size: .75rem; }

/* ---- Settings dialog ---- */
.ws-settings { position: absolute; inset: 0; z-index: 45; display: grid; place-items: center; padding: 1rem; background: color-mix(in srgb, var(--bg) 55%, transparent); }
.ws-settings[hidden] { display: none; }
.ws-settings-card { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: .75rem; width: min(40rem, 100%); max-height: min(36rem, 100%); padding: 1rem; border: 1px solid var(--border-strong); border-radius: 16px; background: var(--panel); box-shadow: 0 24px 60px -24px color-mix(in srgb, var(--text) 50%, transparent); }
.ws-settings-main { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 1rem; min-height: 0; }
.ws-settings-tabs { display: grid; align-content: start; gap: .125rem; }
.ws-settings-tabs button { min-height: 2.25rem; padding: 0 .75rem; border: 0; border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-size: .875rem; text-align: left; cursor: pointer; }
.ws-settings-tabs button.on { background: var(--hover); font-weight: 600; }
.ws-settings-body { display: grid; align-content: start; gap: .5rem; overflow-y: auto; padding-right: .25rem; }
.ws-settings-body h4 { margin: .5rem 0 0; color: var(--muted); font-size: .6875rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.ws-settings-body h4:first-child { margin-top: 0; }
.ws-set-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 2.25rem; font-size: .875rem; }
.ws-set-check { justify-content: flex-start; gap: .625rem; cursor: pointer; }
.ws-set-row select { width: auto; min-width: 8rem; }
.ws-set-colour { display: inline-flex; align-items: center; gap: .5rem; }
.ws-set-colour input[type="color"] { width: 2.25rem; min-width: 0; height: 2rem; padding: .125rem; border-radius: 8px; cursor: pointer; }
.ws-set-num { display: inline-flex; align-items: center; gap: .375rem; color: var(--muted); }
.ws-set-num input { width: 4.5rem; min-width: 0; }
.ws-settings-foot { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.ws-settings-foot > span { display: inline-flex; gap: .5rem; }
@container ws (max-width: 40rem) {
  .ws-settings-main { grid-template-columns: minmax(0, 1fr); }
  .ws-settings-tabs { grid-auto-flow: column; overflow-x: auto; }
}

/* ---- Legend options from the Status line settings ---- */
.ws-legend-title.no-title > strong, .ws-legend-title.no-title > span:not(.ws-ohlc):not(.ws-session) { display: none; }
.ws-legend-title.no-ohlc .ws-ohlc > span:not(:last-child) { display: none; }
.ws-legend-title.no-change .ws-ohlc > span:last-child:not(:first-child) { display: none; }
.ws-legend.no-values .ws-study-value { display: none; }
.ws-legend.no-studies .ws-studies { display: none; }
.ws-toggle.ws-icon-only { padding-inline: .5rem; }
.ws-toggle.ws-icon-only .ws-tool-icon { width: 1.125rem; height: 1.125rem; margin: 0; }
.ws-tree h4 { margin: .25rem 0 0; color: var(--muted); font-size: .75rem; font-weight: 600; }
.ws-tree-pick { display: inline-flex; align-items: center; gap: .375rem; text-align: left; }
.ws-tree-pick .ws-tool-icon { width: 1rem; height: 1rem; }
html body #app .ws-settings .ws-set-check input[type="checkbox"] { width: 1.125rem; min-width: 0; height: 1.125rem; min-height: 0; flex: 0 0 auto; margin: 0; }
html body #app .ws-settings .ws-set-check span { flex: 1 1 auto; text-align: left; }
