  :root {
    --paper: #F5F0E8;
    --paper-2: #ECE5D8;
    --ink: #14190F;
    --ink-2: #51564A;
    --rule: rgba(20, 25, 15, .14);
    --green: #1A6B2A;
    --green-press: #13521F;
    --forest: #16281C;
    --on-dark: #F5F0E8;
    --on-dark-2: rgba(245, 240, 232, .74);
    --rule-dark: rgba(245, 240, 232, .18);
    --img-bg: #2B3026;

    --serif: "Fraunces", Georgia, "Times New Roman", serif;
    --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    --wrap: 1240px;
    --gutter: clamp(1.25rem, 4vw, 2.5rem);
    --section: clamp(4.5rem, 3rem + 6vw, 8.5rem);
    --radius: 18px;
    --header-h: 4rem;

    color-scheme: light;
  }

  *, *::before, *::after { box-sizing: border-box; }
  [hidden] { display: none !important; }

  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-top: calc(var(--header-h) + 1rem);
  }

  body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 400 1.0625rem/1.55 var(--sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  img { display: block; max-width: 100%; height: auto; }
  a { color: inherit; }
  p { margin: 0; }
  ul, ol { margin: 0; padding: 0; }

  h1, h2, h3 {
    margin: 0;
    font-family: var(--serif);
    font-weight: 400;
    font-variation-settings: "SOFT" 40;
    text-wrap: balance;
  }

  h2 {
    font-size: clamp(2.125rem, 1.5rem + 2.6vw, 3.75rem);
    line-height: 1.04;
    letter-spacing: -.025em;
  }

  :focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 3px;
    border-radius: 4px;
  }

  .wrap {
    width: 100%;
    max-width: calc(var(--wrap) + var(--gutter) * 2);
    margin-inline: auto;
    padding-inline: var(--gutter);
  }

  .visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
  }

  .skip {
    position: absolute;
    left: var(--gutter);
    top: -100px;
    z-index: 100;
    padding: .75rem 1rem;
    background: var(--ink);
    color: var(--paper);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
  }
  .skip:focus { top: .75rem; }

  /* ---------- Buttons and quiet links ---------- */

  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3rem;
    padding: 0 1.5rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font: 500 1rem/1 var(--sans);
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
  }
  .btn:active { transform: translateY(1px); }

  .btn-primary { background: var(--green); color: #fff; }
  .btn-primary:hover { background: var(--green-press); }

  .btn-quiet { border-color: rgba(20, 25, 15, .32); color: var(--ink); }
  .btn-quiet:hover { border-color: var(--ink); background: var(--ink); color: var(--paper); }

  .btn-sm { min-height: 2.5rem; padding: 0 1.125rem; font-size: .9375rem; }

  .link {
    display: inline-flex;
    align-items: baseline;
    gap: .4em;
    font-weight: 500;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: .25em;
    text-decoration-color: rgba(20, 25, 15, .35);
    transition: text-decoration-color .15s ease;
  }
  .link:hover { text-decoration-color: currentColor; }
  .link .arrow { transition: transform .15s ease; }
  .link:hover .arrow { transform: translateX(2px); }

  /* ---------- Header ---------- */

  .site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
  }

  .header-inner {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem 1rem;
    min-height: var(--header-h);
  }

  .brand {
    display: inline-flex;
    align-items: center;
    gap: .625rem;
    margin-right: auto;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: -.01em;
  }
  .brand img { width: 32px; height: 32px; border-radius: 8px; background: var(--forest); }

  @media (max-width: 399px) {
    .site-header .brand span {
      position: absolute;
      width: 1px; height: 1px;
      overflow: hidden; clip: rect(0 0 0 0);
      white-space: nowrap;
    }
  }

  .menu-toggle {
    display: none;
    align-items: center;
    gap: .5rem;
    min-height: 2.5rem;
    padding: 0 .25rem 0 .5rem;
    border: 0;
    background: none;
    color: var(--ink);
    font: 500 .9375rem/1 var(--sans);
    cursor: pointer;
  }
  .menu-toggle svg { transition: transform .15s ease; }
  .menu-toggle[aria-expanded="true"] svg { transform: rotate(45deg); }

  .nav { order: 4; width: 100%; padding-bottom: .75rem; }
  .nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem 1.5rem;
    list-style: none;
  }
  .nav-links a {
    display: inline-block;
    padding: .375rem 0;
    text-decoration: none;
    font-size: .9375rem;
    font-weight: 500;
  }
  .nav-links a:hover { text-decoration: underline; text-underline-offset: .3em; text-decoration-thickness: 1px; }

  .lang { display: inline-flex; align-items: center; gap: .125rem; font-size: .875rem; color: var(--ink-2); }
  .lang a {
    padding: .375rem .375rem;
    text-decoration: none;
    font-weight: 500;
    border-radius: 6px;
  }
  .lang a[aria-current="true"] { color: var(--ink); text-decoration: underline; text-underline-offset: .3em; text-decoration-thickness: 1px; }
  .lang a:not([aria-current="true"]):hover { color: var(--ink); }

  /* JS-enhanced mobile menu (without JS, the nav simply wraps onto its own row) */
  .js .menu-toggle { display: inline-flex; }
  .js .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: .5rem var(--gutter) 1.5rem;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
  }
  .js .nav[data-open="true"] { display: block; }
  .js .nav .nav-links { flex-direction: column; gap: 0; }
  .js .nav .nav-links li { border-bottom: 1px solid var(--rule); }
  .js .nav .nav-links a { display: block; padding: 1rem 0; font-size: 1.125rem; }
  .js .nav .lang { margin-top: 1rem; margin-left: -.375rem; }

  @media (min-width: 960px) {
    .header-inner { flex-wrap: nowrap; gap: 2rem; }
    .js .menu-toggle { display: none; }
    .nav,
    .js .nav,
    .js .nav[data-open="true"] {
      order: 0;
      display: flex;
      align-items: center;
      gap: 2rem;
      position: static;
      width: auto;
      padding: 0;
      border: 0;
      background: none;
    }
    .js .nav .nav-links { flex-direction: row; gap: 1.75rem; }
    .js .nav .nav-links li { border: 0; }
    .js .nav .nav-links a { display: inline-block; padding: .375rem 0; font-size: .9375rem; }
    .js .nav .lang { margin: 0; }
    .nav .lang { padding-left: 1.5rem; border-left: 1px solid var(--rule); }
  }

  /* ---------- Hero ---------- */

  .hero { padding-top: clamp(2.5rem, 1.5rem + 4vw, 5rem); }

  .hero-head { display: grid; gap: 1.75rem; }

  .hero h1 {
    font-size: clamp(3rem, 1rem + 7.4vw, 8.75rem);
    line-height: .94;
    letter-spacing: -.028em;
    font-variation-settings: "SOFT" 50;
  }

  .hero-side p {
    max-width: 34ch;
    margin-bottom: 1.5rem;
    color: var(--ink-2);
    font-size: 1.125rem;
    line-height: 1.5;
  }

  .hero-photo {
    margin: clamp(2rem, 1rem + 3vw, 3.5rem) 0 0;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--img-bg);
    aspect-ratio: 3 / 2;
  }
  .hero-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 40%;
  }

  .reach {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    list-style: none;
    border-bottom: 1px solid var(--rule);
  }
  .reach li + li { border-left: 1px solid var(--rule); }
  .reach a {
    display: block;
    height: 100%;
    padding: 1.5rem 0 1.5rem clamp(.875rem, 2.5vw, 2rem);
    text-decoration: none;
  }
  .reach li:first-child a { padding-left: 0; }
  .reach .num {
    display: block;
    font: 300 clamp(1.875rem, 1.1rem + 3.4vw, 4.25rem)/1 var(--serif);
    font-variation-settings: "SOFT" 30;
    letter-spacing: -.03em;
  }
  .reach .lbl {
    display: block;
    margin-top: .625rem;
    font-size: .8125rem;
    color: var(--ink-2);
  }
  .reach a:hover .lbl { color: var(--ink); text-decoration: underline; text-underline-offset: .25em; }

  @media (min-width: 720px) {
    .hero-photo { aspect-ratio: 16 / 9; }
  }

  @media (min-width: 960px) {
    .hero-photo { aspect-ratio: 2 / 1; }
  }

  @media (min-width: 1024px) {
    /* Two-line headline; the intro and CTA sit in the space beside "trading." */
    .hero-head { grid-template-columns: minmax(0, 1fr) 21rem; gap: 0 3rem; }
    .hero h1 { grid-column: 1 / -1; grid-row: 1; }
    .hero h1 span { display: block; }
    .hero-side { grid-column: 2; grid-row: 1; align-self: end; padding-bottom: .5rem; }
  }

  /* ---------- Plans: three-way chooser ---------- */

  .plans { padding-top: var(--section); }

  .plans h2 { max-width: 15ch; margin-bottom: clamp(2rem, 1.5rem + 2vw, 3.5rem); }

  .choices { list-style: none; }

  .choice {
    display: flex;
    flex-direction: column;
    padding-block: 2.5rem;
    border-top: 1px solid var(--rule);
  }
  .choice:last-child { padding-bottom: 0; }

  .want {
    max-width: 18ch;
    font-size: clamp(1.5rem, 1.25rem + .9vw, 1.875rem);
    line-height: 1.15;
    letter-spacing: -.015em;
  }

  .offer { padding-top: 1.75rem; }
  .plan-name { font-weight: 600; font-size: .9375rem; }
  .price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .25rem .625rem;
    margin-top: .5rem;
  }
  .price .amount {
    font: 300 clamp(2.75rem, 2.1rem + 2.4vw, 3.75rem)/1 var(--serif);
    font-variation-settings: "SOFT" 30;
    letter-spacing: -.03em;
  }
  .price .unit { font-size: .9375rem; color: var(--ink-2); }
  .price-alt {
    display: flex;
    align-items: baseline;
    gap: .5rem;
    margin-top: .625rem;
  }
  .price-alt .amount {
    font: 400 1.5rem/1 var(--serif);
    letter-spacing: -.02em;
  }
  .price-alt .unit { font-size: .9375rem; color: var(--ink-2); }

  .features {
    list-style: none;
    margin-top: 1.5rem;
    border-top: 1px solid var(--ink);
    font-size: .9375rem;
    line-height: 1.45;
  }
  .features li {
    padding: .75rem 0;
    border-bottom: 1px solid var(--rule);
  }
  .features a { text-underline-offset: .2em; text-decoration-thickness: 1px; }

  .choice-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
    padding-top: 1.75rem;
  }
  .next { font-size: .9375rem; }
  .next .amount { font-family: var(--serif); font-weight: 400; font-size: 1.0625rem; }

  @media (min-width: 960px) {
    .choices {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      border-top: 1px solid var(--rule);
    }
    .choice {
      padding: 2.5rem 2rem 0;
      border-top: 0;
      border-left: 1px solid var(--rule);
    }
    .choice:first-child { padding-left: 0; border-left: 0; }
    .choice:last-child { padding-right: 0; }
    .choice-actions { margin-top: auto; }

    @supports (grid-template-rows: subgrid) {
      .choices { grid-template-rows: auto auto 1fr auto; }
      .choice {
        display: grid;
        grid-row: span 4;
        grid-template-rows: subgrid;
        row-gap: 0;
      }
      .choice-actions { margin-top: 0; }
    }
  }

  /* ---------- Free course: table of contents ---------- */

  .course { padding-top: var(--section); }

  .course-grid { display: grid; gap: 2.5rem; }

  .course-intro p {
    max-width: 38ch;
    margin: 1.25rem 0 1.75rem;
    color: var(--ink-2);
  }

  .toc { list-style: none; border-top: 1px solid var(--ink); }
  .toc li {
    display: grid;
    grid-template-columns: 3rem minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 1rem;
    padding: 1.125rem 0;
    border-bottom: 1px solid var(--rule);
  }
  .toc-n {
    font: 400 1rem/1 var(--serif);
    color: var(--ink-2);
    font-variant-numeric: tabular-nums lining-nums;
  }
  .toc-t {
    font: 400 clamp(1.125rem, 1rem + .5vw, 1.4375rem)/1.25 var(--serif);
    letter-spacing: -.01em;
  }
  .toc time {
    font-size: .9375rem;
    color: var(--ink-2);
    font-variant-numeric: tabular-nums;
  }
  .toc .toc-more .toc-n { white-space: nowrap; }
  .toc .toc-more .toc-t { color: var(--ink-2); }
  .toc .toc-more svg { align-self: center; color: var(--ink-2); }

  @media (min-width: 960px) {
    .course-grid {
      grid-template-columns: 5fr 7fr;
      gap: 4rem;
      align-items: start;
    }
    .course-intro { position: sticky; top: calc(var(--header-h) + 2rem); }
    .toc li { grid-template-columns: 4rem minmax(0, 1fr) auto; }
  }

  /* ---------- About: forest band ---------- */

  .about {
    margin-top: var(--section);
    padding-block: var(--section);
    background: var(--forest);
    color: var(--on-dark);
  }
  .about :focus-visible { outline-color: var(--on-dark); }

  .about-grid { display: grid; gap: 2.5rem; }

  .about-photo {
    margin: 0;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--img-bg);
    aspect-ratio: 4 / 5;
    max-height: 34rem;
  }
  .about-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 30%;
  }

  .about-body h2 { max-width: 14ch; }
  .about-body p {
    max-width: 52ch;
    margin: 1.5rem 0 1.5rem;
    color: var(--on-dark-2);
  }
  .about-body .link { text-decoration-color: rgba(245, 240, 232, .4); }
  .about-body .link:hover { text-decoration-color: currentColor; }

  .facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    list-style: none;
    margin-top: clamp(2.5rem, 2rem + 2vw, 4rem);
    border-top: 1px solid var(--rule-dark);
  }
  .facts li {
    padding: 1.5rem 1rem 1.5rem 0;
    border-bottom: 1px solid var(--rule-dark);
  }
  .facts li:nth-child(even) { padding-left: 1.25rem; border-left: 1px solid var(--rule-dark); }
  .fact-n {
    display: block;
    font: 300 clamp(2rem, 1.5rem + 2vw, 3rem)/1 var(--serif);
    font-variation-settings: "SOFT" 30;
    letter-spacing: -.03em;
  }
  .fact-l { display: block; margin-top: .5rem; font-size: .875rem; color: var(--on-dark-2); }

  @media (min-width: 720px) {
    .about-photo { aspect-ratio: 16 / 10; max-height: none; }
  }

  @media (min-width: 960px) {
    .about-grid {
      grid-template-columns: 5fr 7fr;
      gap: 4.5rem;
      align-items: center;
    }
    .about-photo { aspect-ratio: 4 / 5; }
  }

  /* ---------- Videos ---------- */

  .videos { padding-top: var(--section); }

  .section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem 2rem;
    margin-bottom: clamp(1.75rem, 1.25rem + 2vw, 3rem);
  }

  .video-list {
    display: grid;
    gap: 1.25rem;
    list-style: none;
  }

  .video {
    display: grid;
    grid-template-columns: minmax(0, 9.5rem) minmax(0, 1fr);
    align-items: start;
    gap: 1rem;
    text-decoration: none;
  }

  .thumb {
    position: relative;
    display: block;
    border-radius: 12px;
    overflow: hidden;
    background: var(--img-bg);
    aspect-ratio: 16 / 9;
  }
  .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
  }
  .video:hover .thumb img { transform: scale(1.025); }

  .play {
    position: absolute;
    left: .625rem;
    bottom: .625rem;
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--paper);
    color: var(--ink);
  }

  .video-title {
    font: 400 1.0625rem/1.3 var(--serif);
    letter-spacing: -.005em;
    text-wrap: pretty;
  }
  .video:hover .video-title { text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }

  @media (min-width: 720px) {
    .video-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }
    .video { grid-template-columns: 1fr; gap: 1rem; }
    .thumb { border-radius: 14px; }
    .play { left: .875rem; bottom: .875rem; width: 2.5rem; height: 2.5rem; }
    .video-title { font-size: 1.25rem; }
  }

  /* ---------- FAQ ---------- */

  .faq { padding-top: var(--section); }

  .faq-grid { display: grid; gap: 2rem; }

  .faq-list { border-top: 1px solid var(--ink); }

  .faq details { border-bottom: 1px solid var(--rule); }

  .faq summary {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.375rem 0;
    cursor: pointer;
    list-style: none;
    font: 400 clamp(1.1875rem, 1.05rem + .5vw, 1.4375rem)/1.3 var(--serif);
    letter-spacing: -.01em;
  }
  .faq summary::-webkit-details-marker { display: none; }
  .faq summary:hover { color: var(--green); }
  .faq summary svg {
    flex: none;
    align-self: center;
    color: var(--ink-2);
    transition: transform .2s ease;
  }
  .faq details[open] summary svg { transform: rotate(45deg); }

  .faq .answer {
    max-width: 62ch;
    padding: 0 2.5rem 1.625rem 0;
    color: var(--ink-2);
  }
  .faq .answer a { color: var(--ink); text-underline-offset: .2em; text-decoration-thickness: 1px; }

  @media (min-width: 960px) {
    .faq-grid { grid-template-columns: 5fr 7fr; gap: 4rem; align-items: start; }
  }

  /* ---------- Closing ---------- */

  .closing { padding-block: var(--section); }

  .closing-inner {
    display: grid;
    gap: 1.75rem;
    padding-top: clamp(2.5rem, 2rem + 2vw, 4rem);
    border-top: 1px solid var(--ink);
  }
  .closing h2 { font-size: clamp(2.375rem, 1.5rem + 3.6vw, 4.75rem); line-height: 1; letter-spacing: -.03em; }
  .closing-action { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.25rem; }
  .closing-action p { font-size: .9375rem; color: var(--ink-2); }

  @media (min-width: 960px) {
    .closing-inner { grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 3rem; }
  }

  /* ---------- Footer ---------- */

  .site-footer {
    padding-block: clamp(3.5rem, 2.5rem + 3vw, 5rem) 2rem;
    background: var(--ink);
    color: var(--on-dark-2);
    font-size: .9375rem;
  }
  .site-footer :focus-visible { outline-color: var(--on-dark); }
  .site-footer a { text-decoration: none; }
  .site-footer a:hover { color: var(--on-dark); text-decoration: underline; text-underline-offset: .25em; text-decoration-thickness: 1px; }

  .footer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2.5rem 1.5rem;
  }

  .footer-brand { grid-column: 1 / -1; }
  .footer-brand .brand { color: var(--on-dark); margin-bottom: 1.25rem; }
  .footer-brand .brand:hover { text-decoration: none; }
  .footer-brand address { font-style: normal; line-height: 1.8; }

  .footer-col h2 {
    margin-bottom: .875rem;
    font: 600 .875rem/1.4 var(--sans);
    letter-spacing: 0;
    color: var(--on-dark);
  }
  .footer-col ul { list-style: none; }
  .footer-col li + li { margin-top: .5rem; }

  .footer-base {
    display: grid;
    gap: 1rem;
    margin-top: clamp(2.5rem, 2rem + 2vw, 4rem);
    padding-top: 1.5rem;
    border-top: 1px solid var(--rule-dark);
    font-size: .875rem;
  }
  .risk { color: var(--on-dark); }
  .site-footer .lang { color: var(--on-dark-2); }
  .site-footer .lang a[aria-current="true"] { color: var(--on-dark); }

  @media (min-width: 720px) {
    .footer-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  }

  @media (min-width: 1100px) {
    .footer-grid { grid-template-columns: 2fr repeat(4, minmax(0, 1fr)); gap: 2rem; }
    .footer-brand { grid-column: auto; }
    .footer-base { grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 2rem; }
  }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      transition-duration: 0s !important;
      animation-duration: 0s !important;
    }
    .video:hover .thumb img { transform: none; }
  }

/* =====================================================================
   Shared additions for the full prototype
   ===================================================================== */

:root {
  --red: #A3321F;
  --red-bg: #F6E3DC;
  --green-bg: #E1ECDD;
  --amber: #8A5A00;
  --amber-bg: #F3E7C9;
  --card: #FBF8F2;
  --sidebar-w: 15.5rem;
}

.mono { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.serif { font-family: var(--serif); font-variation-settings: "SOFT" 40; }

/* Nav: current page */
.nav-links a[aria-current="page"] { text-decoration: underline; text-underline-offset: .3em; text-decoration-thickness: 1px; }

/* Member/guest toggles (app.js sets html[data-auth]) */
html[data-auth="member"] [data-guest-only],
html:not([data-auth="member"]) [data-member-only] { display: none !important; }

/* Page header used by inner marketing pages */
.page-head { padding-top: clamp(2.5rem, 1.5rem + 4vw, 5rem); }
.page-head h1 {
  max-width: 16ch;
  font-size: clamp(2.5rem, 1.4rem + 4.6vw, 5.25rem);
  line-height: 1;
  letter-spacing: -.035em;
  font-variation-settings: "SOFT" 50;
}
.page-head .lede { max-width: 46ch; margin-top: 1.5rem; color: var(--ink-2); font-size: 1.125rem; }
.page-head .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin-top: 2rem; }

.section { padding-top: var(--section); }
.section-last { padding-bottom: var(--section); }
.rule-top { border-top: 1px solid var(--ink); padding-top: 1.5rem; }

/* Prose (legal, guide) */
.prose { max-width: 68ch; }
.prose h2 { font-size: clamp(1.625rem, 1.3rem + 1.2vw, 2.25rem); line-height: 1.15; letter-spacing: -.02em; margin: 3rem 0 1rem; }
.prose h3 { font-size: 1.375rem; line-height: 1.25; margin: 2rem 0 .75rem; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.125rem; color: var(--ink-2); }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li + li { margin-top: .375rem; }
.prose a { color: var(--ink); text-underline-offset: .2em; text-decoration-thickness: 1px; }
.prose strong { color: var(--ink); font-weight: 600; }

/* Notes */
.note {
  padding: 1.125rem 1.25rem;
  border-left: 3px solid var(--ink);
  background: var(--paper-2);
  border-radius: 0 10px 10px 0;
  font-size: .9375rem;
  color: var(--ink-2);
}
.note strong { color: var(--ink); }

/* ---------- Forms ---------- */

.field { display: grid; gap: .4rem; }
.field + .field, .field-row + .field, .field + .field-row { margin-top: 1.125rem; }
.field-row { display: grid; gap: 1.125rem; }
@media (min-width: 520px) { .field-row { grid-template-columns: 1fr 1fr; } }

.label { font-size: .875rem; font-weight: 500; }
.input, .select, .textarea {
  width: 100%;
  min-height: 3rem;
  padding: .75rem .9rem;
  border: 1px solid rgba(20, 25, 15, .24);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: 400 1rem/1.3 var(--sans);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.textarea { min-height: 7rem; resize: vertical; }
.select { appearance: none; padding-right: 2.5rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4.5l4 4 4-4' fill='none' stroke='%2314190F' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .9rem center; }
.input:hover, .select:hover, .textarea:hover { border-color: rgba(20, 25, 15, .45); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(26, 107, 42, .18); }
.input[aria-invalid="true"] { border-color: var(--red); }
.field-error { font-size: .8125rem; color: var(--red); }
.field-error:empty { display: none; }

.input-group { display: flex; }
.input-group > :first-child { flex: none; width: auto; border-radius: 10px 0 0 10px; border-right: 0; }
.input-group > :last-child { border-radius: 0 10px 10px 0; min-width: 0; }

.password-wrap { position: relative; }
.password-wrap .input { padding-right: 4.25rem; }
.reveal {
  position: absolute; right: .375rem; top: 50%; transform: translateY(-50%);
  min-height: 2.25rem; padding: 0 .75rem; border: 0; border-radius: 8px;
  background: none; color: var(--ink-2); font: 500 .8125rem/1 var(--sans); cursor: pointer;
}
.reveal:hover { color: var(--ink); background: var(--paper-2); }

.check { display: flex; gap: .75rem; align-items: flex-start; font-size: .9375rem; color: var(--ink-2); }
.check input { flex: none; width: 1.125rem; height: 1.125rem; margin-top: .2rem; accent-color: var(--green); }
.check a { color: var(--ink); text-underline-offset: .2em; }

.btn-block { width: 100%; }
.btn[disabled], .btn[aria-busy="true"] { opacity: .6; pointer-events: none; }
.btn-ghost { background: none; border-color: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--paper-2); }
.btn-dark { background: var(--ink); color: var(--paper); }
.btn-dark:hover { background: #000; }

/* Selectable option rows (radio cards) */
.options { display: grid; gap: .625rem; }
.option {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .875rem;
  padding: 1rem 1.125rem;
  border: 1px solid rgba(20, 25, 15, .2);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.option:hover { border-color: rgba(20, 25, 15, .45); }
.option input { width: 1.125rem; height: 1.125rem; margin: 0; accent-color: var(--green); }
.option:has(input:checked) { border-color: var(--green); box-shadow: 0 0 0 1px var(--green); }
.option:has(input:focus-visible) { outline: 2px solid var(--green); outline-offset: 3px; }
.option-title { font-weight: 500; }
.option-sub { display: block; font-size: .875rem; color: var(--ink-2); margin-top: .125rem; }
.option-end { font-family: var(--serif); font-size: 1.25rem; letter-spacing: -.01em; }

/* ---------- Auth layout (split: form + photo) ---------- */

.auth { min-height: 100vh; min-height: 100dvh; display: grid; background: var(--paper); }
.auth-main { display: flex; flex-direction: column; padding: 1.25rem var(--gutter) 2rem; }
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.auth-top .brand { margin-right: 0; }
.auth-top p { font-size: .9375rem; color: var(--ink-2); }
.auth-top p a { color: var(--ink); font-weight: 500; text-underline-offset: .2em; }
.auth-body { width: 100%; max-width: 26rem; margin: auto; padding-block: 3rem; }
.auth-body h1 { font-size: clamp(2.25rem, 1.8rem + 2vw, 3.25rem); line-height: 1.02; letter-spacing: -.03em; }
.auth-body .lede { margin: .875rem 0 2rem; color: var(--ink-2); }
.auth-body form .btn-block { margin-top: 1.5rem; }
.auth-alt { margin-top: 1.5rem; font-size: .9375rem; color: var(--ink-2); text-align: center; }
.auth-alt a { color: var(--ink); font-weight: 500; text-underline-offset: .2em; }
.auth-foot { font-size: .8125rem; color: var(--ink-2); }
.auth-aside { display: none; position: relative; margin: .75rem; border-radius: var(--radius); overflow: hidden; background: var(--img-bg); color: var(--on-dark); }
.auth-aside img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.auth-aside::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(10, 14, 8, .82), rgba(10, 14, 8, 0) 55%); }
.auth-aside-copy { position: absolute; z-index: 1; left: clamp(1.5rem, 3vw, 2.75rem); right: clamp(1.5rem, 3vw, 2.75rem); bottom: clamp(1.5rem, 3vw, 2.75rem); }
.auth-aside-copy p { font: 300 clamp(1.75rem, 1.2rem + 1.6vw, 2.75rem)/1.08 var(--serif); letter-spacing: -.02em; max-width: 18ch; }
@media (min-width: 960px) {
  .auth { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .auth-aside { display: block; }
}

/* Plan summary inside auth/checkout */
.plan-chip {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 1rem 1.125rem; margin-bottom: 1.75rem;
  border: 1px solid var(--rule); border-radius: 12px; background: var(--card);
}
.plan-chip strong { font-weight: 600; }
.plan-chip span { font-size: .875rem; color: var(--ink-2); }

/* ---------- Toast ---------- */

.toast-region { position: fixed; z-index: 200; left: 50%; bottom: 1.25rem; transform: translateX(-50%); display: grid; gap: .5rem; width: min(92vw, 26rem); pointer-events: none; }
.toast {
  padding: .875rem 1.125rem; border-radius: 12px;
  background: var(--ink); color: var(--paper);
  font-size: .9375rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
  animation: toast-in .2s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------- Status pills (used sparingly, only where state matters) ---------- */

.status { display: inline-flex; align-items: center; gap: .375rem; padding: .25rem .625rem; border-radius: 999px; font-size: .8125rem; font-weight: 500; white-space: nowrap; }
.status::before { content: ""; width: .4375rem; height: .4375rem; border-radius: 50%; background: currentColor; }
.status-live { background: var(--green-bg); color: var(--green); }
.status-loss { background: var(--red-bg); color: var(--red); }
.status-wait { background: var(--amber-bg); color: var(--amber); }
.status-done { background: var(--paper-2); color: var(--ink-2); }

/* ---------- Member area shell ---------- */

.app { min-height: 100vh; min-height: 100dvh; background: var(--paper); }
.app-bar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 1rem;
  min-height: 3.75rem; padding: 0 var(--gutter);
  background: var(--paper); border-bottom: 1px solid var(--rule);
}
.app-bar .brand { margin-right: auto; }
.app-menu { display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; margin-left: -.625rem; border: 0; border-radius: 10px; background: none; color: var(--ink); cursor: pointer; }
.app-menu:hover { background: var(--paper-2); }

.sidebar {
  position: fixed; z-index: 60; inset: 0 auto 0 0;
  width: min(84vw, var(--sidebar-w));
  display: flex; flex-direction: column;
  padding: 1rem .75rem;
  background: var(--paper); border-right: 1px solid var(--rule);
  transform: translateX(-100%); transition: transform .2s ease;
}
.sidebar[data-open="true"] { transform: none; box-shadow: 0 0 60px rgba(0, 0, 0, .2); }
.sidebar .brand { padding: .25rem .625rem 1.25rem; margin: 0; }
.side-nav { list-style: none; display: grid; gap: .125rem; }
.side-nav a {
  display: flex; align-items: center; gap: .75rem;
  min-height: 2.625rem; padding: 0 .75rem; border-radius: 10px;
  text-decoration: none; font-size: .9375rem; font-weight: 500; color: var(--ink-2);
}
.side-nav a:hover { background: var(--paper-2); color: var(--ink); }
.side-nav a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.side-nav svg { flex: none; width: 18px; height: 18px; }
.side-group { margin-top: 1.5rem; padding: 0 .75rem .5rem; font-size: .75rem; font-weight: 600; color: var(--ink-2); }
.side-foot { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--rule); }
.side-user { display: flex; align-items: center; gap: .75rem; padding: .5rem .75rem; }
.avatar { display: grid; place-items: center; flex: none; width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--forest); color: var(--paper); font-weight: 600; font-size: .875rem; }
.side-user .who { min-width: 0; font-size: .875rem; line-height: 1.3; }
.side-user .who strong { display: block; font-weight: 600; }
.side-user .who span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.scrim { position: fixed; z-index: 55; inset: 0; background: rgba(20, 25, 15, .4); }
.scrim[hidden] { display: none; }

.app-main { padding: clamp(1.5rem, 1rem + 2vw, 3rem) var(--gutter) 4rem; }
.app-inner { max-width: 72rem; margin-inline: auto; }
.app-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem 2rem; margin-bottom: clamp(1.5rem, 1rem + 1.5vw, 2.5rem); }
.app-head h1 { font-size: clamp(2rem, 1.5rem + 2vw, 3rem); line-height: 1.05; letter-spacing: -.03em; }
.app-head p { margin-top: .5rem; color: var(--ink-2); }

@media (min-width: 1024px) {
  .app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .app-bar { display: none; }
  .sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; width: auto; transform: none; transition: none; }
  .sidebar[data-open="true"] { box-shadow: none; }
  .scrim { display: none !important; }
}

/* Cards / panels */
.panel { padding: clamp(1.25rem, 1rem + 1vw, 1.75rem); border: 1px solid var(--rule); border-radius: 16px; background: var(--card); }
.panel h2, .panel-title { font: 400 1.375rem/1.2 var(--serif); letter-spacing: -.015em; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.panel-head a { font-size: .9375rem; font-weight: 500; text-underline-offset: .2em; }
.panel-dark { background: var(--forest); color: var(--on-dark); border-color: transparent; }
.panel-dark .muted { color: var(--on-dark-2); }
.panel-dark :focus-visible { outline-color: var(--on-dark); }

.grid-2 { display: grid; gap: 1.25rem; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; } }

/* Signal ticket */
.signal { border: 1px solid var(--rule); border-radius: 14px; background: #fff; overflow: hidden; }
.signal-top { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: 1rem 1.125rem; border-bottom: 1px solid var(--rule); }
.signal-pair { font: 400 1.375rem/1 var(--serif); letter-spacing: -.01em; }
.signal-side { font-size: .8125rem; font-weight: 600; margin-left: .5rem; }
.signal-side.buy { color: var(--green); }
.signal-side.sell { color: var(--red); }
.signal-levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.signal-levels div { padding: .875rem 1.125rem; }
.signal-levels div + div { border-left: 1px solid var(--rule); }
.signal-levels dt { font-size: .75rem; color: var(--ink-2); }
.signal-levels dd { margin: .25rem 0 0; font-weight: 500; font-variant-numeric: tabular-nums; }
.signal-foot { display: flex; justify-content: space-between; gap: 1rem; padding: .75rem 1.125rem; border-top: 1px solid var(--rule); font-size: .8125rem; color: var(--ink-2); }

/* Data table */
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: 14px; background: #fff; }
.table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.table th { padding: .75rem 1rem; text-align: left; font-size: .8125rem; font-weight: 500; color: var(--ink-2); border-bottom: 1px solid var(--rule); white-space: nowrap; }
.table td { padding: .875rem 1rem; border-bottom: 1px solid var(--rule); font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }

/* Tabs (segmented) */
.tabs { display: inline-flex; gap: .25rem; padding: .25rem; border-radius: 999px; background: var(--paper-2); }
.tabs button, .tabs a { min-height: 2.25rem; padding: 0 1rem; border: 0; border-radius: 999px; background: none; color: var(--ink-2); font: 500 .875rem/1 var(--sans); text-decoration: none; display: inline-flex; align-items: center; cursor: pointer; }
.tabs [aria-selected="true"], .tabs [aria-current="page"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }

/* Progress bar */
.progress { height: 6px; border-radius: 999px; background: var(--paper-2); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--green); border-radius: inherit; }

/* Empty / locked state */
.locked { display: grid; justify-items: start; gap: 1rem; padding: clamp(1.5rem, 1rem + 2vw, 2.5rem); border: 1px dashed rgba(20, 25, 15, .3); border-radius: 16px; }
.locked h2 { font: 400 clamp(1.5rem, 1.2rem + 1vw, 2rem)/1.15 var(--serif); letter-spacing: -.02em; max-width: 22ch; }

/* Dialog */
dialog.modal { width: min(92vw, 30rem); padding: 0; border: 0; border-radius: 18px; background: var(--paper); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .3); }
dialog.modal::backdrop { background: rgba(20, 25, 15, .45); }
.modal-body { padding: 1.75rem; }
.modal-body h2 { font-size: 1.75rem; line-height: 1.1; letter-spacing: -.02em; margin-bottom: .75rem; }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .75rem; margin-top: 1.5rem; }

/* Prototype ribbon (bottom-left, tiny) */
.proto-tag { position: fixed; z-index: 150; left: .75rem; bottom: .75rem; padding: .375rem .625rem; border-radius: 8px; background: var(--ink); color: var(--paper); font-size: .75rem; opacity: .85; }
.proto-tag button { margin-left: .5rem; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  .sidebar { transition: none; }
  .toast { animation: none; }
}

.proto-note { margin-top: 1rem; font-size: .8125rem; color: var(--ink-2); }
.field-row > .field + .field { margin-top: 0; }

/* =====================================================================
   Form controls (assets/controls.js upgrades native select + date)
   Native elements stay in the DOM for value, validation and no-JS use.
   ===================================================================== */

:root {
  --control-h: 3rem;
  --control-r: 10px;
  --control-border: rgba(20, 25, 15, .24);
  --control-border-hover: rgba(20, 25, 15, .45);
  --focus-ring: 0 0 0 3px rgba(26, 107, 42, .18);
  --pop-shadow: 0 1px 2px rgba(20, 25, 15, .06), 0 16px 40px rgba(20, 25, 15, .14);
}

/* Shared trigger look: same box as .input */
.control-trigger {
  position: relative;
  display: flex;
  align-items: center;
  gap: .625rem;
  width: 100%;
  min-height: var(--control-h);
  padding: .5rem 2.5rem .5rem .9rem;
  border: 1px solid var(--control-border);
  border-radius: var(--control-r);
  background: #fff;
  color: var(--ink);
  font: 400 1rem/1.3 var(--sans);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.control-trigger:hover { border-color: var(--control-border-hover); }
.control-trigger:focus-visible,
.control-trigger[aria-expanded="true"] { outline: none; border-color: var(--green); box-shadow: var(--focus-ring); }
.control-trigger[disabled] { background: var(--paper-2); color: var(--ink-2); cursor: not-allowed; }
.control-trigger .chev, .control-trigger .cal {
  position: absolute; right: .875rem; top: 50%; transform: translateY(-50%);
  color: var(--ink-2); pointer-events: none; transition: transform .15s ease;
}
.control-trigger[aria-expanded="true"] .chev { transform: translateY(-50%) rotate(180deg); }
.control-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.control-value small { display: block; font-size: .8125rem; color: var(--ink-2); }
.control-placeholder { color: rgba(20, 25, 15, .45); }

.cselect, .cdate { position: relative; width: 100%; }
.cselect > select, .cdate > input {
  position: absolute !important; inset: 0; width: 100%; height: 100%;
  opacity: 0; pointer-events: none; margin: 0;
}
.cselect:has(> select[aria-invalid="true"]) .control-trigger,
.cdate:has(> input[aria-invalid="true"]) .control-trigger { border-color: var(--red); }

/* Inside input groups (e.g. country code + number) */
.input-group > .cselect:first-child { flex: none; width: auto; min-width: 7.25rem; }
.input-group > .cselect:first-child .control-trigger { border-radius: var(--control-r) 0 0 var(--control-r); border-right: 0; background: var(--card); }

/* Popover surface */
.pop {
  position: absolute; z-index: 90; left: 0; top: calc(100% + 6px);
  min-width: 100%;
  border: 1px solid var(--rule); border-radius: 14px;
  background: #fff; box-shadow: var(--pop-shadow);
  animation: pop-in .14s ease-out;
}
.pop[data-side="top"] { top: auto; bottom: calc(100% + 6px); }
.pop[hidden] { display: none; }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px) scale(.985); } }

/* Listbox */
.listbox { max-height: 18rem; overflow-y: auto; padding: .375rem; list-style: none; overscroll-behavior: contain; }
.listbox [role="option"] {
  display: grid; grid-template-columns: minmax(0, 1fr) 1rem; align-items: center; gap: .75rem;
  min-height: 2.75rem; padding: .5rem .75rem; border-radius: 8px;
  cursor: pointer; font-size: .9375rem;
}
.listbox [role="option"] small { display: block; font-size: .8125rem; color: var(--ink-2); }
.listbox [role="option"].is-active { background: var(--paper-2); }
.listbox [role="option"][aria-selected="true"] { font-weight: 500; }
.listbox [role="option"] .tick { visibility: hidden; color: var(--green); }
.listbox [role="option"][aria-selected="true"] .tick { visibility: visible; }
.listbox [role="option"][aria-disabled="true"] { color: rgba(20, 25, 15, .35); cursor: not-allowed; }
.listbox .group-label { padding: .625rem .75rem .25rem; font-size: .75rem; font-weight: 600; color: var(--ink-2); }

/* Calendar */
.calendar { width: 19.5rem; max-width: calc(100vw - 2rem); padding: 1rem; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .75rem; }
.cal-title { display: flex; align-items: baseline; gap: .375rem; font: 400 1.25rem/1 var(--serif); letter-spacing: -.01em; }
.cal-title select {
  appearance: none; border: 0; padding: .25rem .125rem; border-radius: 6px;
  background: none; color: var(--ink); font: inherit; cursor: pointer;
}
.cal-title select:hover { background: var(--paper-2); }
.cal-title select:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; }
.cal-nav { display: flex; gap: .25rem; }
.cal-nav button {
  display: grid; place-items: center; width: 2.25rem; height: 2.25rem;
  border: 1px solid var(--rule); border-radius: 50%; background: #fff; color: var(--ink); cursor: pointer;
}
.cal-nav button:hover { background: var(--paper-2); }
.cal-nav button[disabled] { opacity: .35; cursor: not-allowed; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-dow { padding-bottom: .375rem; font-size: .75rem; font-weight: 500; color: var(--ink-2); text-align: center; }
.cal-day {
  display: grid; place-items: center; aspect-ratio: 1; width: 100%;
  border: 0; border-radius: 50%; background: none; color: var(--ink);
  font: 400 .9375rem/1 var(--sans); font-variant-numeric: tabular-nums; cursor: pointer;
}
.cal-day:hover { background: var(--paper-2); }
.cal-day.is-outside { color: rgba(20, 25, 15, .32); }
.cal-day.is-today { box-shadow: inset 0 0 0 1px var(--ink); }
.cal-day[aria-selected="true"] { background: var(--green); color: #fff; font-weight: 500; box-shadow: none; }
.cal-day[aria-disabled="true"] { color: rgba(20, 25, 15, .25); text-decoration: line-through; cursor: not-allowed; background: none; }
.cal-day:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; }
.cal-foot { display: flex; justify-content: space-between; margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--rule); }
.cal-foot button { min-height: 2.25rem; padding: 0 .75rem; border: 0; border-radius: 8px; background: none; color: var(--ink); font: 500 .875rem/1 var(--sans); cursor: pointer; }
.cal-foot button:hover { background: var(--paper-2); }

/* Phones: popovers become bottom sheets */
.sheet-scrim { position: fixed; z-index: 85; inset: 0; background: rgba(20, 25, 15, .35); }
.sheet-scrim[hidden] { display: none; }
@media (max-width: 559px) {
  .pop {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto !important;
    min-width: 0; max-height: 75vh; overflow: auto;
    border-radius: 18px 18px 0 0; border-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom);
    animation: sheet-in .2s ease-out;
  }
  .pop[data-side="top"] { bottom: 0; }
  .pop::before { content: ""; display: block; width: 2.5rem; height: 4px; margin: .5rem auto .25rem; border-radius: 999px; background: var(--rule); }
  .listbox { max-height: none; padding: .25rem .5rem .75rem; }
  .listbox [role="option"] { min-height: 3rem; font-size: 1rem; }
  .calendar { width: 100%; max-width: none; padding: .5rem 1.25rem 1.25rem; }
}
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } }

/* Checkbox + radio (all of them) */
input[type="checkbox"]:not(.switch), input[type="radio"] {
  appearance: none; -webkit-appearance: none;
  flex: none; display: inline-grid; place-content: center;
  width: 1.25rem; height: 1.25rem; margin: 0;
  border: 1.5px solid rgba(20, 25, 15, .4); background: #fff;
  cursor: pointer; transition: background-color .12s ease, border-color .12s ease;
}
input[type="checkbox"]:not(.switch) { border-radius: 5px; }
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]:not(.switch):hover, input[type="radio"]:hover { border-color: var(--ink); }
input[type="checkbox"]:not(.switch):checked {
  border-color: var(--green);
  background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2 5 8.5l4.5-5' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
}
input[type="radio"]:checked { border-color: var(--green); border-width: 6px; }
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
input[type="checkbox"][aria-invalid="true"]:not(:checked) { border-color: var(--red); }
input[type="checkbox"]:disabled, input[type="radio"]:disabled { opacity: .45; cursor: not-allowed; }
.check input { margin-top: .125rem; width: 1.25rem; height: 1.25rem; }
.option input { width: 1.25rem; height: 1.25rem; }

/* Switch: <input type="checkbox" class="switch" role="switch"> */
input.switch {
  appearance: none; -webkit-appearance: none; flex: none; position: relative;
  width: 2.75rem; height: 1.625rem; margin: 0; border-radius: 999px;
  background: rgba(20, 25, 15, .22); cursor: pointer; transition: background-color .15s ease;
}
input.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 1.25rem; height: 1.25rem;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
  transition: transform .15s ease;
}
input.switch:checked { background: var(--green); }
input.switch:checked::after { transform: translateX(1.125rem); }
input.switch:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .875rem 0; border-bottom: 1px solid var(--rule); }

/* Segmented choice: radios that look like a two/three-way toggle */
.segmented { display: inline-flex; gap: .25rem; padding: .25rem; border-radius: 12px; background: var(--paper-2); }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
  display: inline-flex; align-items: center; min-height: 2.5rem; padding: 0 1rem;
  border-radius: 9px; color: var(--ink-2); font-size: .9375rem; font-weight: 500; cursor: pointer;
}
.segmented input:checked + span { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.segmented input:focus-visible + span { outline: 2px solid var(--green); outline-offset: 1px; }
.segmented-block { display: flex; }
.segmented-block label { flex: 1; }
.segmented-block span { justify-content: center; width: 100%; }

/* Number + affixes */
input[type="number"].input { -moz-appearance: textfield; font-variant-numeric: tabular-nums; }
input[type="number"].input::-webkit-inner-spin-button,
input[type="number"].input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.affix { position: relative; display: flex; align-items: center; }
.affix .input { flex: 1; }
.affix-start, .affix-end { position: absolute; top: 50%; transform: translateY(-50%); color: var(--ink-2); font-size: .9375rem; pointer-events: none; }
.affix-start { left: .9rem; }
.affix-end { right: .9rem; }
.affix:has(.affix-start) .input { padding-left: 2rem; }
.affix:has(.affix-end) .input { padding-right: 3.5rem; }

/* Stepper: <div class="stepper"><button>−</button><input type="number" class="input"><button>+</button></div> */
.stepper { display: flex; }
.stepper .input { border-radius: 0; text-align: center; min-width: 0; }
.stepper button {
  flex: none; width: 3rem; border: 1px solid var(--control-border); background: var(--card);
  color: var(--ink); font: 400 1.25rem/1 var(--sans); cursor: pointer;
}
.stepper button:first-child { border-radius: var(--control-r) 0 0 var(--control-r); border-right: 0; }
.stepper button:last-child { border-radius: 0 var(--control-r) var(--control-r) 0; border-left: 0; }
.stepper button:hover { background: var(--paper-2); }

/* Search */
input[type="search"].input { padding-left: 2.5rem; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Ccircle cx='7' cy='7' r='4.75' fill='none' stroke='%2351564A' stroke-width='1.5'/%3E%3Cpath d='m10.5 10.5 3 3' stroke='%2351564A' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") .9rem center no-repeat; }
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }

/* File / screenshot drop zone: <label class="dropzone"><input type="file">…</label> */
.dropzone {
  position: relative; display: grid; justify-items: center; gap: .375rem;
  padding: 1.5rem; border: 1.5px dashed var(--control-border); border-radius: 14px;
  background: #fff; text-align: center; font-size: .9375rem; color: var(--ink-2); cursor: pointer;
}
.dropzone strong { color: var(--ink); font-weight: 500; }
.dropzone:hover, .dropzone.is-over { border-color: var(--green); background: var(--green-bg); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone:has(input:focus-visible) { outline: 2px solid var(--green); outline-offset: 3px; }

/* Placeholder + autofill */
.input::placeholder, .textarea::placeholder { color: rgba(20, 25, 15, .45); }
.input:-webkit-autofill { -webkit-box-shadow: 0 0 0 100px #fff inset; -webkit-text-fill-color: var(--ink); }
.input:disabled, .textarea:disabled { background: var(--paper-2); color: var(--ink-2); cursor: not-allowed; }
.field-hint { font-size: .8125rem; color: var(--ink-2); }

@media (prefers-reduced-motion: reduce) {
  .pop { animation: none; }
  input.switch::after, .control-trigger .chev { transition: none; }
}
dialog.modal { overflow: visible; }
.pop.calendar { min-width: 0; }
.control-value small { display: inline; margin-left: .5rem; }
.cal-title select { field-sizing: content; }
fieldset.segmented { margin: 0; border: 0; min-inline-size: 0; justify-self: start; }
.segmented { flex-wrap: wrap; }
.proto-tag { left: auto; right: .75rem; }
.signal { container-type: inline-size; }
.signal-levels dt { white-space: nowrap; }
@container (max-width: 27rem) {
  .signal-levels { grid-template-columns: 1fr; }
  .signal-levels div { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: .625rem 1.125rem; }
  .signal-levels div + div { border-left: 0; border-top: 1px solid var(--rule); }
  .signal-levels dd { margin: 0; }
}
.signal-levels { margin: 0; }
.proto-tag { z-index: 80; }

/* Select options with flags / trailing meta (country codes) */
.flag { flex: none; width: 20px; height: 15px; border-radius: 2px; object-fit: cover; box-shadow: 0 0 0 1px rgba(20, 25, 15, .12); background: var(--paper-2); }
.control-trigger > .flag + .control-value { margin-left: 0; }
.listbox [role="option"] { grid-template-columns: minmax(0, 1fr) auto 1rem; white-space: nowrap; }
.listbox [role="option"] .opt-label { display: flex; align-items: center; gap: .625rem; min-width: 0; }
.listbox [role="option"] .opt-label > span { overflow: hidden; text-overflow: ellipsis; }
.listbox [role="option"]:not(:has(.opt-meta)) { grid-template-columns: minmax(0, 1fr) 1rem; }
.opt-meta { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cselect > .pop:not(.calendar) { width: max-content; min-width: 100%; max-width: min(22rem, calc(100vw - 2rem)); }
.input-group > .cselect:first-child { min-width: 0; }
.input-group > .cselect:first-child .control-trigger { padding-right: 2.25rem; white-space: nowrap; }
