:root{
    --bg:#fbfbfd;
    --bg-alt:#f5f5f7;
    --ink:#1d1d1f;
    --ink-2:#6e6e73;
    --line:#d2d2d7;
    --accent:#1a7d3c;
    --accent-dark:#125c2b;
    --accent-tint:#e8f5ec;
    --radius:18px;
    --sand:#a97a2b;
    --sand-tint:#faf1de;
    --slate:#52525b;
    --slate-tint:#f0f0f2;
    --sky:#2b6cb0;
    --sky-tint:#eaf3ff;
    --olive:#6b7f23;
    --olive-tint:#f3f7e6;
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  }
  *{box-sizing:border-box;}
  html{scroll-behavior:smooth;}
  @media (prefers-reduced-motion: reduce){ html{scroll-behavior:auto;} *{transition:none !important; animation:none !important;} }
  body{
    margin:0; font-family:var(--font); background:var(--bg); color:var(--ink);
    -webkit-font-smoothing:antialiased;
  }
  a{color:inherit; text-decoration:none;}
  button{font-family:inherit;}
  :focus-visible{outline:2px solid var(--accent); outline-offset:2px; border-radius:4px;}

  /* header */
  header.top{
    position:sticky; top:0; z-index:50;
    background:rgba(251,251,253,0.86); backdrop-filter:saturate(180%) blur(14px);
    border-bottom:1px solid var(--line);
  }
  .top-inner{
    max-width:1020px; margin:0 auto; padding:0 22px; height:52px;
    display:flex; align-items:center; justify-content:space-between; gap:16px;
  }
  .brand{display:flex; align-items:center; gap:8px; font-weight:600; font-size:15px; letter-spacing:-0.01em; cursor:pointer; flex:none;}
  .brand svg{width:20px; height:20px; flex:none;}
  .main-nav{display:flex; align-items:center; gap:6px; margin-right:auto; margin-left:20px; min-width:0; overflow-x:auto; scrollbar-width:none; -ms-overflow-style:none; -webkit-overflow-scrolling:touch;}
  .main-nav::-webkit-scrollbar{display:none;}
  .main-nav a{font-size:13.5px; font-weight:500; color:var(--ink); white-space:nowrap; padding:6px 12px; border-radius:980px;}
  .main-nav a:hover{color:var(--accent-dark); background:var(--bg-alt);}
  .main-nav a.active{background:var(--accent-tint); color:var(--accent-dark); font-weight:600;}
  .header-right{display:flex; align-items:center; gap:6px; min-width:0; position:relative; flex:none;}
  .top-inner.search-active .header-right{flex:1; min-width:0;}
  .top-inner.search-active .brand,
  .top-inner.search-active .main-nav,
  .top-inner.search-active .menu-toggle,
  .top-inner.search-active .toggles-panel{display:none;}

  /* search: icon by default, expands to a full-width bar (Apple-style) */
  .search-wrap{position:relative; display:flex; align-items:center; flex:none;}
  .top-inner.search-active .search-wrap{flex:1; min-width:0;}
  .search-toggle{
    display:flex; align-items:center; justify-content:center; flex:none;
    width:32px; height:32px; border-radius:50%; border:none; background:transparent;
    color:var(--ink-2); cursor:pointer;
  }
  .search-toggle:hover{background:var(--bg-alt); color:var(--ink);}
  .search-toggle svg{width:17px; height:17px;}
  .top-inner.search-active .search-toggle{display:none;}
  .search-form{
    display:none; align-items:center; gap:8px; width:100%;
    background:var(--bg-alt); border:1px solid var(--line); border-radius:980px; padding:7px 14px;
  }
  .top-inner.search-active .search-form{display:flex;}
  .search-form input{
    flex:1; min-width:0; border:none; outline:none; background:transparent;
    font-size:14px; font-family:inherit; color:var(--ink);
  }
  .search-form .search-icon{width:15px; height:15px; color:var(--ink-2); flex:none;}
  .search-close{border:none; background:transparent; color:var(--ink-2); cursor:pointer; flex:none; padding:2px; display:flex;}
  .search-close svg{width:16px; height:16px;}
  .suggest{
    position:absolute; top:calc(100% + 6px); left:0; right:0; background:#fff; border:1px solid var(--line);
    border-radius:12px; box-shadow:0 8px 30px rgba(0,0,0,0.12); overflow:hidden; z-index:60;
  }
  .suggest a{display:flex; align-items:center; gap:10px; padding:9px 12px; font-size:13px; border-bottom:1px solid var(--line);}
  .suggest a:last-child{border-bottom:none;}
  .suggest a:hover, .suggest a:focus-visible{background:var(--bg-alt);}
  .suggest .cat-tag{margin-left:auto; font-size:11px; color:var(--ink-2); background:var(--bg-alt); padding:2px 8px; border-radius:980px;}

  /* hamburger menu: hidden on desktop, toggles the lang/hand panel on mobile */
  .menu-toggle{
    display:none; align-items:center; justify-content:center; flex:none;
    width:32px; height:32px; border-radius:50%; border:none; background:transparent;
    color:var(--ink-2); cursor:pointer;
  }
  .menu-toggle:hover, .menu-toggle[aria-expanded="true"]{background:var(--bg-alt); color:var(--ink);}
  .menu-toggle svg{width:18px; height:18px;}

  .toggles-panel{display:flex; align-items:center; gap:10px; flex:none;}
  .hand-toggle{display:flex; align-items:center; gap:2px; border:1px solid var(--line); border-radius:980px; padding:3px; background:var(--bg-alt); flex:none;}
  .hand-toggle button{border:none; background:transparent; padding:6px 10px; border-radius:980px; font-size:12px; color:var(--ink-2); cursor:pointer; white-space:nowrap; font-weight:500;}
  .hand-toggle button.active{background:#fff; color:var(--ink); box-shadow:0 1px 3px rgba(0,0,0,.15); font-weight:600;}
  .lang-toggle{display:flex; align-items:center; gap:2px; border:1px solid var(--line); border-radius:980px; padding:3px; background:var(--bg-alt); flex:none;}
  .lang-toggle a{border:none; background:transparent; padding:6px 10px; border-radius:980px; font-size:12px; color:var(--ink-2); cursor:pointer; white-space:nowrap; font-weight:500; text-decoration:none;}
  .lang-toggle a.active{background:#fff; color:var(--ink); box-shadow:0 1px 3px rgba(0,0,0,.15); font-weight:600;}

  main{max-width:1020px; margin:0 auto; padding:0 22px 80px;}

  /* hero */
  .hero{text-align:center; padding:56px 10px 34px;}
  .hero-illustration{width:150px; height:auto; margin:0 auto 14px;}
  .hero h1{font-size:40px; letter-spacing:-0.02em; margin:0 0 8px; font-weight:600;}
  .hero p{color:var(--ink-2); font-size:17px; max-width:480px; margin:0 auto 26px;}
  .hero-search{position:relative; max-width:560px; margin:0 auto;}
  .hero-search input{
    width:100%; padding:14px 20px 14px 42px; border-radius:980px; border:1px solid var(--line);
    background:var(--bg-alt); font-size:16px; font-family:inherit; color:var(--ink);
  }
  .hero-search input:focus{background:#fff; border-color:var(--accent);}
  .hero-search .search-icon{left:18px; width:17px; height:17px;}
  .hero-search .suggest{text-align:left; font-size:14px;}

  .chips{display:flex; flex-wrap:wrap; gap:8px; justify-content:center; margin:22px 0 0;}
  .chip{
    font-size:13px; padding:6px 14px; border-radius:980px; border:1px solid var(--line); background:#fff; color:var(--ink);
  }
  .chip:hover{border-color:var(--accent); color:var(--accent-dark);}

  /* section headings */
  .section-title{font-size:13px; text-transform:uppercase; letter-spacing:.06em; color:var(--ink-2); margin:44px 0 14px; font-weight:600;}

  /* category grid */
  .cat-grid{display:grid; grid-template-columns:repeat(auto-fit, minmax(172px,1fr)); gap:14px;}
  .cat-card{
    border:1px solid var(--line); border-radius:var(--radius); background:#fff; padding:22px 20px;
    display:flex; flex-direction:column; gap:12px; transition:box-shadow .15s ease, transform .15s ease;
  }
  .cat-card:hover{box-shadow:0 8px 24px rgba(0,0,0,0.08); transform:translateY(-1px);}
  .cat-icon{width:56px; height:56px; border-radius:16px; display:flex; align-items:center; justify-content:center;}
  .cat-icon svg{width:32px; height:32px;}
  .cat-card h3{margin:0; font-size:17px; font-weight:600;}
  .cat-card p{margin:0; font-size:13.5px; color:var(--ink-2); line-height:1.4;}
  .cat-card .arrow-line{margin-top:auto; display:flex; align-items:center; gap:4px; font-size:13px; color:var(--accent-dark); font-weight:500;}

  /* breadcrumb */
  .crumb{display:flex; align-items:center; gap:6px; font-size:13px; color:var(--ink-2); margin:26px 0 6px; flex-wrap:wrap;}
  .crumb a:hover{color:var(--accent-dark); text-decoration:underline;}
  .crumb .sep{opacity:.5;}

  /* category page */
  .cat-hero{padding:10px 0 20px;}
  .cat-hero h1{font-size:32px; letter-spacing:-0.02em; margin:6px 0 8px;}
  .cat-hero p{color:var(--ink-2); font-size:16px; max-width:640px; margin:0;}

  .issue-list{border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; background:#fff;}
  .issue-row{
    display:flex; align-items:center; gap:14px; padding:16px 18px; border-bottom:1px solid var(--line);
  }
  .issue-row:last-child{border-bottom:none;}
  .issue-row:hover{background:var(--bg-alt);}
  .issue-row .thumb{width:52px; height:40px; flex:none; display:flex; align-items:center; justify-content:center;}
  .issue-row .thumb svg{width:100%; height:100%;}
  .issue-row .txt{flex:1; min-width:0;}
  .issue-row .txt h4{margin:0 0 3px; font-size:15.5px; font-weight:600;}
  .issue-row .txt p{margin:0; font-size:13px; color:var(--ink-2); line-height:1.4;}
  .issue-row .cat-badge{font-size:11px; color:var(--ink-2); background:var(--bg-alt); border:1px solid var(--line); padding:2px 8px; border-radius:980px; white-space:nowrap; margin-right:4px;}
  .issue-row .chev{flex:none; width:9px; height:9px; border-right:2px solid var(--ink-2); border-bottom:2px solid var(--ink-2); transform:rotate(-45deg);}

  /* issue detail */
  .issue-head{padding:10px 0 8px;}
  .issue-head h1{font-size:34px; letter-spacing:-0.02em; margin:6px 0 10px;}
  .issue-head .tag{font-size:19px; color:var(--ink); line-height:1.55; max-width:640px; margin:0;}

  .diagram-box{
    margin:28px 0; border:1px solid var(--line); border-radius:var(--radius); background:var(--bg-alt);
    display:flex; align-items:center; justify-content:center; padding:26px;
  }
  .diagram-box svg{width:100%; max-width:280px; height:auto;}
  .diagram-box.wide{padding:26px 18px;}
  .diagram-box.wide svg{max-width:640px;}

  .why-box{
    background:var(--accent-tint); border-left:4px solid var(--accent); border-radius:12px;
    padding:18px 20px; margin:26px 0;
  }
  .why-box h3{margin:0 0 8px; font-size:15px; color:var(--accent-dark); font-weight:700; text-transform:uppercase; letter-spacing:.03em;}
  .why-box p{margin:0; font-size:15.5px; line-height:1.6;}

  h2.causes-h{font-size:20px; margin:34px 0 12px; font-weight:600;}

  details.cause{
    border:1px solid var(--line); border-radius:14px; margin-bottom:10px; background:#fff; overflow:hidden;
  }
  details.cause summary{
    list-style:none; cursor:pointer; padding:15px 18px; display:flex; align-items:center; gap:12px; font-weight:600; font-size:15px;
  }
  details.cause summary::-webkit-details-marker{display:none;}
  details.cause summary .num{
    flex:none; width:24px; height:24px; border-radius:50%; background:var(--bg-alt); color:var(--ink-2);
    display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:700;
  }
  details.cause[open] summary .num{background:var(--accent); color:#fff;}
  details.cause summary .chev-s{margin-left:auto; width:9px; height:9px; border-right:2px solid var(--ink-2); border-bottom:2px solid var(--ink-2); transform:rotate(45deg); transition:transform .15s ease;}
  details.cause[open] summary .chev-s{transform:rotate(-135deg);}
  .cause-body{padding:0 18px 18px 54px;}
  .cause-body p{margin:0 0 12px; font-size:14.5px; line-height:1.6; color:var(--ink);}
  .fix-box{background:var(--bg-alt); border-radius:10px; padding:12px 14px; font-size:14px; line-height:1.55;}
  .fix-box b{color:var(--accent-dark);}

  .related{margin-top:48px;}
  .related-grid{display:grid; grid-template-columns:repeat(auto-fit, minmax(180px,1fr)); gap:12px;}
  .related-card{border:1px solid var(--line); border-radius:14px; padding:14px; background:#fff; display:flex; gap:12px; align-items:center;}
  .related-card:hover{background:var(--bg-alt);}
  .related-thumb{width:52px; height:38px; flex:none;}
  .related-thumb svg{width:100%; height:100%;}
  .related-card h4{margin:0 0 4px; font-size:14.5px; font-weight:600;}
  .related-card p{margin:0; font-size:12.5px; color:var(--ink-2);}

  .spotlight-grid{display:grid; grid-template-columns:repeat(auto-fit, minmax(140px,1fr)); gap:12px;}
  .spotlight-card{border:1px solid var(--line); border-radius:16px; background:#fff; padding:14px 10px 12px; text-align:center; transition:box-shadow .15s ease, transform .15s ease;}
  .spotlight-card:hover{box-shadow:0 8px 24px rgba(0,0,0,0.08); transform:translateY(-1px);}
  .spotlight-diagram{width:100%; height:74px; margin-bottom:8px;}
  .spotlight-diagram svg{width:100%; height:100%;}
  .spotlight-card h4{margin:0; font-size:13.5px; font-weight:600;}

  .glossary-teaser{
    margin-top:44px; border:1px solid var(--line); border-radius:var(--radius); background:var(--bg-alt);
    padding:22px 24px; display:flex; align-items:center; justify-content:space-between; gap:20px; flex-wrap:wrap;
  }

  .glossary-filters{display:flex; flex-wrap:wrap; gap:8px; margin:16px 0 22px;}
  .glossary-filter-chip{
    font-size:12.5px; padding:6px 13px; border-radius:980px; border:1px solid var(--line); background:#fff; color:var(--ink-2);
  }
  .glossary-filter-chip:hover{border-color:var(--accent); color:var(--accent-dark);}
  .glossary-filter-chip.active{background:var(--ink); color:#fff; border-color:var(--ink);}

  .glossary-grid{display:grid; grid-template-columns:repeat(auto-fill, minmax(220px,1fr)); gap:14px;}
  .glossary-card{
    border:1px solid var(--line); border-radius:16px; background:#fff; overflow:hidden;
    display:flex; flex-direction:column; transition:box-shadow .15s ease, transform .15s ease;
  }
  .glossary-card:hover{box-shadow:0 8px 24px rgba(0,0,0,0.08); transform:translateY(-1px);}
  .glossary-card-diagram{height:80px; background:var(--bg-alt); display:flex; align-items:center; justify-content:center; padding:10px;}
  .glossary-card-diagram svg{width:100%; height:100%;}
  .glossary-card-body{padding:12px 14px 14px;}
  .glossary-card-body h4{margin:0 0 4px; font-size:14.5px; font-weight:600;}
  .glossary-card-body p{margin:0; font-size:12.5px; color:var(--ink-2); line-height:1.4;}

  @media (max-width:700px){
    .menu-toggle{display:flex;}
    .toggles-panel{
      display:none; position:absolute; top:calc(100% + 10px); right:0;
      flex-direction:column; align-items:stretch; gap:10px;
      background:#fff; border:1px solid var(--line); border-radius:14px;
      box-shadow:0 8px 30px rgba(0,0,0,0.12); padding:14px; min-width:210px; z-index:60;
    }
    .toggles-panel.open{display:flex;}
    .toggles-panel .lang-toggle, .toggles-panel .hand-toggle{width:100%;}
    .toggles-panel .lang-toggle a, .toggles-panel .hand-toggle button{flex:1; text-align:center;}
  }

  @media (max-width:480px){
    .top-inner{gap:6px;}
    .main-nav{margin-left:10px;}
    .brand-text{display:none;}
  }

  .empty-state{padding:60px 10px; text-align:center; color:var(--ink-2);}
  .empty-state h2{color:var(--ink); font-size:22px; margin-bottom:8px;}

  footer{border-top:1px solid var(--line); margin-top:60px;}
  .footer-inner{max-width:1020px; margin:0 auto; padding:26px 22px; font-size:12px; color:var(--ink-2); line-height:1.6;}
  .footer-inner strong{color:var(--ink);}

  /* glossary auto-links inside article text */
  .gloss-link{
    color:var(--accent-dark); text-decoration:underline; text-decoration-style:dotted;
    text-underline-offset:3px; text-decoration-thickness:1px;
  }
  .gloss-link:hover{text-decoration-style:solid;}

  /* causes section header + hint */
  .causes-header{margin:34px 0 12px;}
  .causes-header .causes-h{margin:0 0 4px;}
  .causes-hint{margin:0 0 12px; font-size:13px; color:var(--ink-2);}

  /* "when to get a lesson" callout */
  .lesson-note{
    margin:30px 0 0; border:1px solid var(--line); border-radius:14px; background:var(--bg-alt);
    padding:18px 20px;
  }
  .lesson-note h3{margin:0 0 8px; font-size:14px; font-weight:700; text-transform:uppercase; letter-spacing:.03em; color:var(--ink-2);}
  .lesson-note p{margin:0; font-size:14.5px; line-height:1.6;}

  /* guided diagnosis */
  .diag-card{
    border:1px solid var(--line); border-radius:var(--radius); background:#fff; padding:26px 26px 22px;
    max-width:640px; margin:0 auto;
  }
  .diag-q{margin:0 0 18px; font-size:22px; font-weight:600; letter-spacing:-0.01em;}
  .diag-back{
    border:none; background:transparent; color:var(--ink-2); font-size:13px; cursor:pointer;
    padding:0; margin:0 0 14px; font-family:inherit;
  }
  .diag-back:hover{color:var(--accent-dark);}
  .diag-options{display:flex; flex-direction:column; gap:10px;}
  .diag-option{
    display:flex; align-items:center; gap:14px; text-align:left; width:100%;
    border:1px solid var(--line); border-radius:14px; background:#fff; padding:14px 16px;
    font-size:15px; font-weight:500; color:var(--ink); cursor:pointer; font-family:inherit;
    transition:border-color .12s ease, background .12s ease;
  }
  .diag-option:hover{border-color:var(--accent); background:var(--accent-tint);}
  .diag-option .diag-icon{width:54px; height:34px; flex:none;}
  .diag-option .diag-icon svg{width:100%; height:100%;}
  .diag-option .chev{margin-left:auto; flex:none; width:9px; height:9px; border-right:2px solid var(--ink-2); border-bottom:2px solid var(--ink-2); transform:rotate(-45deg);}
  .diag-result{text-align:center;}
  .diag-result .diag-back{display:block; text-align:left;}
  .diag-verdict{margin:4px 0 0; color:var(--ink-2); font-size:14px;}
  .diag-result-diagram{max-width:250px; margin:14px auto;}
  .diag-result-diagram svg{width:100%; height:auto;}
  .diag-tag{color:var(--ink-2); font-size:14.5px; max-width:460px; margin:0 auto 20px; line-height:1.5;}
  .diag-cta{
    display:inline-block; background:var(--accent); color:#fff; font-weight:600; font-size:15px;
    padding:12px 22px; border-radius:980px;
  }
  .diag-cta:hover{background:var(--accent-dark);}
  .diag-catlink{margin:16px 0 0; font-size:12.5px; color:var(--ink-2);}
  .diag-catlink a{color:var(--accent-dark); text-decoration:underline;}

  /* homepage primary chip */
  .chip-primary{
    background:var(--accent); color:#fff; border-color:var(--accent); font-weight:600;
  }
  .chip-primary:hover{background:var(--accent-dark); color:#fff; border-color:var(--accent-dark);}

  /* footer nav */
  .footer-nav{display:flex; flex-wrap:wrap; gap:40px; margin-bottom:26px;}
  .footer-col{display:flex; flex-direction:column; gap:7px; min-width:150px;}
  .footer-col h4{margin:0 0 4px; font-size:12px; text-transform:uppercase; letter-spacing:.05em; color:var(--ink); font-weight:700;}
  .footer-col a{font-size:13px; color:var(--ink-2);}
  .footer-col a:hover{color:var(--accent-dark); text-decoration:underline;}
  .footer-legal{border-top:1px solid var(--line); padding-top:18px;}

  /* prose pages (about / contact / privacy) */
  .prose{max-width:640px; font-size:15.5px; line-height:1.7;}
  .prose h2{font-size:19px; margin:30px 0 10px; letter-spacing:-0.01em;}
  .prose p{margin:0 0 14px;}
  .prose a{color:var(--accent-dark); text-decoration:underline;}

  /* glossary popover (opened by clicking an in-article term link) */
  .gloss-pop-backdrop{
    position:fixed; inset:0; background:rgba(0,0,0,.32); z-index:200;
    display:flex; align-items:center; justify-content:center; padding:20px;
  }
  .gloss-pop{
    background:#fff; border-radius:18px; max-width:440px; width:100%;
    box-shadow:0 20px 60px rgba(0,0,0,.25); padding:22px 24px 20px; position:relative;
    max-height:85vh; overflow-y:auto;
  }
  .gloss-pop-close{
    position:absolute; top:12px; right:12px; width:30px; height:30px; border-radius:50%;
    border:none; background:var(--bg-alt); color:var(--ink-2); font-size:16px; cursor:pointer;
    display:flex; align-items:center; justify-content:center; font-family:inherit; line-height:1;
  }
  .gloss-pop-close:hover{background:var(--line); color:var(--ink);}
  .gloss-pop-kicker{font-size:11px; text-transform:uppercase; letter-spacing:.06em; color:var(--ink-2); font-weight:700; margin:0 0 4px;}
  .gloss-pop h3{margin:0 0 10px; font-size:21px; letter-spacing:-0.01em; padding-right:28px;}
  .gloss-pop-diagram{background:var(--bg-alt); border-radius:12px; padding:14px; margin:0 0 12px; display:flex; justify-content:center;}
  .gloss-pop-diagram svg{width:100%; max-width:210px; height:auto;}
  .gloss-pop p{margin:0 0 14px; font-size:15px; line-height:1.6; color:var(--ink);}
  .gloss-pop-link{
    display:inline-block; font-size:13.5px; font-weight:600; color:var(--accent-dark);
    text-decoration:underline; text-underline-offset:3px;
  }
  .gloss-pop.wide{max-width:660px;}
  .gloss-pop.wide .gloss-pop-diagram svg{max-width:600px;}
