  /* Pantone-inspired palette (screen approximations of Pantone colors) */
  :root {
    --cloud-dancer: #F0EEE9;   /* PANTONE 11-4201 Cloud Dancer */
    --classic-blue: #0F4C81;   /* PANTONE 19-4052 Classic Blue */
    --mocha-mousse: #A47864;   /* PANTONE 17-1230 Mocha Mousse */
    --peach-fuzz:   #FFBE98;   /* PANTONE 13-1023 Peach Fuzz */
    --very-peri:    #6667AB;   /* PANTONE 17-3938 Very Peri */
    --viva-magenta: #BB2649;   /* PANTONE 18-1750 Viva Magenta */
    --illuminating: #F5DF4D;   /* PANTONE 13-0647 Illuminating */

    --bg: var(--cloud-dancer);
    --surface: #ffffff;
    --ink: #1b1d24;
    --muted: #666259;
    --line: #dcd8cf;
    --accent: var(--classic-blue);
    --accent-soft: #dde6f0;
    --label: var(--mocha-mousse);
    --contact-bg: var(--peach-fuzz);
    --contact-ink: #2a1a12;
    --serif: "Fraunces", Georgia, serif;
    --sans: "Inter", system-ui, -apple-system, sans-serif;
    --max: 1040px;
  }
  @media (prefers-color-scheme: dark) {
    :root:where(:not([data-theme="light"])) {
      --bg: #13151b;
      --surface: #1b1e26;
      --ink: #eeebe5;
      --muted: #a4a09a;
      --line: #2c2f38;
      --accent: #8fb6de;
      --accent-soft: #1c2a3b;
      --label: #c9a18e;
      --contact-bg: #3a2519;
      --contact-ink: #ffd9c2;
    }
  }
  :root:where([data-theme="dark"]) {
      --bg: #13151b;
      --surface: #1b1e26;
      --ink: #eeebe5;
      --muted: #a4a09a;
      --line: #2c2f38;
      --accent: #8fb6de;
      --accent-soft: #1c2a3b;
      --label: #c9a18e;
      --contact-bg: #3a2519;
      --contact-ink: #ffd9c2;
    }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  html { scroll-behavior: smooth; }
  body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
  }
  a { color: inherit; text-decoration: none; }
  a:hover, a:focus, a:visited { text-decoration: none; }
  .wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

  /* Nav */
  header.nav {
    position: sticky; top: 0; z-index: 10;
    background: color-mix(in srgb, var(--bg) 96%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
  }
  header.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
  .logo { font-family: var(--serif); font-size: 20px; font-weight: 500; text-decoration: none; }
  .logo span { color: var(--accent); }
  nav ul { list-style: none; display: flex; gap: 28px; }
  nav a { text-decoration: none; font-size: 14px; color: var(--muted); transition: color .2s; }
  nav a:hover { color: var(--ink); }
  .menu-btn { display: none; background: none; border: 0; color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }

  /* Hero */
  .hero { padding-top: 110px; padding-bottom: 90px; }
  .eyebrow { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin-bottom: 22px; }
  .hero h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 6.4vw, 72px); line-height: 1.05; letter-spacing: -.02em; max-width: 14ch; }
  .hero h1 em { font-style: italic; color: var(--accent); }
  .hero p.lead { margin-top: 28px; font-size: 19px; color: var(--muted); max-width: 58ch; }
  .actions { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 12px; }
  .btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 999px; font-size: 15px; font-weight: 500; text-decoration: none; border: 1px solid var(--ink); transition: all .2s; }
  .btn.primary { background: var(--ink); color: var(--bg); }
  .btn.primary:hover { background: var(--accent); border-color: var(--accent); }
  .btn.ghost:hover { background: var(--ink); color: var(--bg); }

  /* Sections */
  section { padding: 90px 0; border-top: 1px solid var(--line); }
  .sec-head { display: grid; grid-template-columns: 220px 1fr; gap: 40px; }
  .sec-label { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding-top: 8px; }
  h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(28px, 3.6vw, 40px); line-height: 1.15; letter-spacing: -.01em; margin-bottom: 24px; }
  h3 { font-family: var(--serif); font-weight: 500; font-size: 22px; line-height: 1.3; }
  p + p { margin-top: 16px; }
  .muted { color: var(--muted); }

  /* Interests */
  .tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
  .tag { padding: 7px 16px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 500; }

  /* Featured course */
  .course { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 40px; margin-top: 8px; }
  .course .meta { font-size: 14px; color: var(--muted); margin: 6px 0 20px; }
  .course ol { list-style: none; counter-reset: obj; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 32px; margin-top: 24px; }
  .course li { counter-increment: obj; position: relative; padding-left: 40px; font-size: 15.5px; }
  .course li::before { content: counter(obj, decimal-leading-zero); position: absolute; left: 0; top: 1px; font-family: var(--serif); color: var(--accent); font-size: 15px; }
  .course h4 { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-top: 28px; }

  /* Timeline */
  .role { display: grid; grid-template-columns: 180px 1fr; gap: 32px; padding: 28px 0; border-bottom: 1px solid var(--line); }
  .role:last-child { border-bottom: 0; }
  .role .when { font-size: 14px; color: var(--muted); padding-top: 4px; }
  .role .where { color: var(--accent); font-size: 15px; font-weight: 500; margin: 2px 0 10px; }
  .role ul { padding-left: 18px; color: var(--muted); font-size: 15.5px; }
  .role li + li { margin-top: 4px; }

  /* Education */
  .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
  .card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 26px; }
  .card .deg { font-family: var(--serif); font-size: 19px; line-height: 1.3; }
  .card .inst { color: var(--muted); font-size: 15px; margin-top: 6px; }

  /* Skills */
  .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
  .list { list-style: none; }
  .list li { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; font-size: 15.5px; }
  .list li span:last-child { color: var(--muted); white-space: nowrap; }
  .skill-group + .skill-group { margin-top: 18px; }
  .skill-group h4 { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 8px; }

  /* Contact */
  .contact h2 { font-size: clamp(34px, 5vw, 56px); max-width: 16ch; }
  .contact-links { display: grid; gap: 4px; margin-top: 12px; }
  .contact-links a { display: flex; justify-content: space-between; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--line); text-decoration: none; font-size: 17px; transition: color .2s, padding .2s; }
  .contact-links a:hover { color: var(--accent); padding-left: 8px; }
  .contact-links a span { color: var(--muted); font-size: 14px; }

  footer { padding: 40px 0 60px; font-size: 14px; color: var(--muted); }

  /* ---------- Color layer ---------- */
  .sec-label, .role .when { color: var(--label); }
  .hero h1 em { color: var(--viva-magenta); }
  @media (prefers-color-scheme: dark) {
    :where(html:not([data-theme="light"])) .hero h1 em { color: #ef7d98; }
  }
  :where(html[data-theme="dark"]) .hero h1 em { color: #ef7d98; }

  /* Tags cycle through the palette */
  .tag:nth-child(5n+1) { background: #dde6f0; color: var(--classic-blue); }
  .tag:nth-child(5n+2) { background: #f6e3ea; color: var(--viva-magenta); }
  .tag:nth-child(5n+3) { background: #efe4de; color: #7d5543; }
  .tag:nth-child(5n+4) { background: #e5e5f3; color: #4d4e93; }
  .tag:nth-child(5n+5) { background: #faf1c4; color: #6b5a00; }
  @media (prefers-color-scheme: dark) {
    :where(html:not([data-theme="light"])) .tag:nth-child(5n+1) { background: #1c2a3b; color: #8fb6de; }
    :where(html:not([data-theme="light"])) .tag:nth-child(5n+2) { background: #3a1822; color: #ef7d98; }
    :where(html:not([data-theme="light"])) .tag:nth-child(5n+3) { background: #33251e; color: #d4ab97; }
    :where(html:not([data-theme="light"])) .tag:nth-child(5n+4) { background: #25264a; color: #a9aae0; }
    :where(html:not([data-theme="light"])) .tag:nth-child(5n+5) { background: #3a3414; color: #f5df4d; }
  }
  :where(html[data-theme="dark"]) .tag:nth-child(5n+1) { background: #1c2a3b; color: #8fb6de; }
  :where(html[data-theme="dark"]) .tag:nth-child(5n+2) { background: #3a1822; color: #ef7d98; }
  :where(html[data-theme="dark"]) .tag:nth-child(5n+3) { background: #33251e; color: #d4ab97; }
  :where(html[data-theme="dark"]) .tag:nth-child(5n+4) { background: #25264a; color: #a9aae0; }
  :where(html[data-theme="dark"]) .tag:nth-child(5n+5) { background: #3a3414; color: #f5df4d; }

  /* Featured course in Classic Blue */
  .course { background: var(--classic-blue); color: #f3f6fa; border: 0; }
  .course .meta, .course h4 { color: #b9cde3; }
  .course li::before { color: var(--peach-fuzz); }

  /* Education cards with color bars */
  .card { border-top: 6px solid; }
  .card:nth-child(1) { border-top-color: var(--classic-blue); }
  .card:nth-child(2) { border-top-color: var(--viva-magenta); }
  .card:nth-child(3) { border-top-color: var(--mocha-mousse); }
  .card:nth-child(4) { border-top-color: var(--very-peri); }

  /* Buttons */
  .btn.primary { background: var(--classic-blue); border-color: var(--classic-blue); color: #fff; }
  .btn.primary:hover { background: var(--viva-magenta); border-color: var(--viva-magenta); }

  /* Contact in Peach Fuzz */
  .contact { background: var(--contact-bg); color: var(--contact-ink); border-top: 0; }
  .contact .sec-label, .contact-links a span { color: inherit; opacity: .7; }
  .contact-links a { border-bottom-color: rgba(0,0,0,.15); }
  .contact-links a:hover { color: var(--viva-magenta); }
  @media (prefers-color-scheme: dark) {
    :where(html:not([data-theme="light"])) .contact-links a { border-bottom-color: rgba(255,255,255,.15); }
    :where(html:not([data-theme="light"])) .contact-links a:hover { color: #ef7d98; }
  }
  :where(html[data-theme="dark"]) .contact-links a { border-bottom-color: rgba(255,255,255,.15); }
  :where(html[data-theme="dark"]) .contact-links a:hover { color: #ef7d98; }
  footer { background: var(--contact-bg); color: var(--contact-ink); opacity: 1; }
  footer .wrap { opacity: .7; }

  /* Reveal */
  .reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s ease; }
  .reveal.in { opacity: 1; transform: none; }
  @media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

  /* Responsive */
  @media (max-width: 820px) {
    .sec-head, .role, .cols, .grid2 { grid-template-columns: 1fr; gap: 16px; }
    .course ol { grid-template-columns: 1fr; }
    .course { padding: 28px 22px; }
    .role { gap: 6px; }
    section { padding: 64px 0; }
    .hero { padding-top: 72px; padding-bottom: 64px; }
    .menu-btn { display: block; }
    nav ul { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 24px 16px; }
    nav ul.open { display: flex; }
    nav li a { display: block; padding: 10px 0; font-size: 16px; }
  }
  @media (max-width: 480px) { .wrap { padding-left: 16px; padding-right: 16px; } }

  /* ---------- Resources page ---------- */
  .page-hero { padding-top: 96px; padding-bottom: 64px; }
  .page-hero h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(38px, 5.6vw, 64px); line-height: 1.08; letter-spacing: -.02em; max-width: 16ch; }
  .page-hero h1 em { font-style: italic; color: var(--viva-magenta); }
  @media (prefers-color-scheme: dark) {
    :where(html:not([data-theme="light"])) .page-hero h1 em { color: #ef7d98; }
  }
  :where(html[data-theme="dark"]) .page-hero h1 em { color: #ef7d98; }
  .page-hero p.lead { margin-top: 24px; font-size: 19px; color: var(--muted); max-width: 58ch; }
  .tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
  .tool { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 26px; text-decoration: none; transition: transform .25s, box-shadow .25s; }
  .tool:hover { transform: translateY(-4px); box-shadow: 0 10px 28px rgba(0,0,0,.07); }
  .tool .icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-family: var(--serif); font-size: 20px; margin-bottom: 18px; }
  .tool h3 { font-size: 20px; margin-bottom: 8px; }
  .tool p { font-size: 15px; color: var(--muted); flex: 1; }
  .tool .status { margin-top: 18px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; color: var(--label); }
  .tool.c1 .icon { background: #dde6f0; color: var(--classic-blue); }
  .tool.c2 .icon { background: #f6e3ea; color: var(--viva-magenta); }
  .tool.c3 .icon { background: #efe4de; color: #7d5543; }
  .tool.c4 .icon { background: #e5e5f3; color: #4d4e93; }
  .tool.c5 .icon { background: #faf1c4; color: #6b5a00; }
  @media (prefers-color-scheme: dark) {
    :where(html:not([data-theme="light"])) .tool.c1 .icon { background: #1c2a3b; color: #8fb6de; }
    :where(html:not([data-theme="light"])) .tool.c2 .icon { background: #3a1822; color: #ef7d98; }
    :where(html:not([data-theme="light"])) .tool.c3 .icon { background: #33251e; color: #d4ab97; }
    :where(html:not([data-theme="light"])) .tool.c4 .icon { background: #25264a; color: #a9aae0; }
    :where(html:not([data-theme="light"])) .tool.c5 .icon { background: #3a3414; color: #f5df4d; }
  }
  :where(html[data-theme="dark"]) .tool.c1 .icon { background: #1c2a3b; color: #8fb6de; }
  :where(html[data-theme="dark"]) .tool.c2 .icon { background: #3a1822; color: #ef7d98; }
  :where(html[data-theme="dark"]) .tool.c3 .icon { background: #33251e; color: #d4ab97; }
  :where(html[data-theme="dark"]) .tool.c4 .icon { background: #25264a; color: #a9aae0; }
  :where(html[data-theme="dark"]) .tool.c5 .icon { background: #3a3414; color: #f5df4d; }
  nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

  /* ---------- Journey map ---------- */
  .journey-map { height: 420px; border-radius: 18px; border: 1px solid var(--line); overflow: hidden; background: var(--surface); z-index: 0; }
  .leaflet-container { font-family: var(--sans); }
  .pin { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: #fff; font: 600 13px var(--sans); border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
  .leaflet-popup-content-wrapper { border-radius: 12px; }
  .leaflet-popup-content { font-size: 14px; line-height: 1.5; margin: 12px 16px; }
  .stops { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 20px; }
  .stop { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; cursor: pointer; transition: border-color .2s, transform .2s; }
  .stop:hover, .stop.active { border-color: var(--accent); transform: translateY(-2px); }
  .stop-num { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 600; }
  .stop-num.s1 { background: var(--classic-blue); }
  .stop-num.s2 { background: var(--viva-magenta); }
  .stop-num.s3 { background: var(--mocha-mousse); }
  .stop-num.s4 { background: var(--very-peri); }
  .stop-place { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--label); font-weight: 600; }
  .stop .deg { font-family: var(--serif); font-size: 18px; line-height: 1.3; margin-top: 6px; }
  .stop .inst { color: var(--muted); font-size: 14.5px; margin-top: 4px; }
  @media (max-width: 820px) {
    .journey-map { height: 320px; }
    .stops { grid-template-columns: 1fr; }
  }

  /* ---------- Multi-page ---------- */
  body { min-height: 100vh; display: flex; flex-direction: column; }
  main { flex: 1; }
  .page-hero + section:last-child .sec-head { grid-template-columns: 1fr; }
  .page-hero + section:last-child .sec-label { display: none; }
  .home-links { padding: 0 0 100px; border-top: 0; }
  .explore { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .explore-card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 24px 24px 52px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; text-decoration: none; transition: transform .25s, border-color .25s, box-shadow .25s; }
  .explore-card:hover { transform: translateY(-4px); box-shadow: 0 10px 28px rgba(0,0,0,.07); }
  .explore-card .k { font-family: var(--serif); font-size: 22px; }
  .explore-card .t { font-size: 15px; color: var(--muted); }
  .explore-card .arrow { position: absolute; left: 24px; bottom: 18px; color: var(--accent); font-size: 18px; transition: transform .25s; }
  .explore-card:hover .arrow { transform: translateX(6px); }
  .explore-card:nth-child(6n+1) { border-top: 4px solid var(--classic-blue); }
  .explore-card:nth-child(6n+2) { border-top: 4px solid var(--viva-magenta); }
  .explore-card:nth-child(6n+3) { border-top: 4px solid var(--mocha-mousse); }
  .explore-card:nth-child(6n+4) { border-top: 4px solid var(--very-peri); }
  .explore-card:nth-child(6n+5) { border-top: 4px solid var(--peach-fuzz); }
  .explore-card:nth-child(6n+6) { border-top: 4px solid var(--illuminating); }
  body:has(.contact-page) { background: var(--contact-bg); }
  .contact-page { padding: 120px 0 100px; }
  nav ul { gap: 24px; }
  @media (max-width: 980px) { nav ul { gap: 16px; } nav a { font-size: 13.5px; } }
  @media (max-width: 820px) {
    .explore { grid-template-columns: 1fr; }
    .contact-page { padding: 72px 0 72px; }
    .page-hero { padding-top: 64px; padding-bottom: 48px; }
  }

  /* ---------- Phone refinements ---------- */
  @media (max-width: 820px) {
    nav ul { gap: 0; box-shadow: 0 12px 24px rgba(0,0,0,.06); }
    nav li a { padding: 12px 0; }
    .contact-links a { flex-direction: column; align-items: flex-start; gap: 2px; padding: 16px 0; }
    .contact-links a:hover { padding-left: 0; }
  }
  .contact-links a { overflow-wrap: anywhere; }
  @media (max-width: 480px) {
    .list li { flex-direction: column; gap: 2px; }
    .list li span:last-child { white-space: normal; font-size: 14px; }
  }

  /* ---------- Teaching page ---------- */
  .course-list { display: grid; gap: 24px; }
  .course { color: #f5f6fa; border: 0; border-radius: 20px; padding: 40px; margin-top: 0; box-shadow: 0 10px 30px rgba(0,0,0,.08); }
  .course.c1 { background: #0F4C81; }  /* Classic Blue */
  .course.c2 { background: #A11F3E; }  /* Viva Magenta, deepened */
  .course.c3 { background: #7A5444; }  /* Mocha Mousse, deepened */
  .course.c4 { background: #4F5096; }  /* Very Peri, deepened */
  .course.c5 { background: #0B6B57; }  /* Emerald, deepened */
  .course h3 { color: #fff; font-size: 26px; }
  .course .meta { color: rgba(255,255,255,.72); font-size: 14px; margin: 6px 0 4px; }
  .course h4 { color: #FFBE98; font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; margin: 26px 0 8px; }
  .course p { font-size: 15.5px; color: rgba(255,255,255,.9); }
  .course ul { list-style: none; padding: 0; }
  .course ul li { position: relative; padding-left: 20px; font-size: 15.5px; color: rgba(255,255,255,.9); }
  .course ul li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 7px; height: 7px; border-radius: 50%; background: #FFBE98; }
  .course ul li + li { margin-top: 8px; }
  .course li::before { color: #FFBE98; }
  .tc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 44px; }
  .ta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 24px; }
  .ta-card { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); border-radius: 14px; padding: 20px 22px; }
  .ta-card .code { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .06em; padding: 4px 10px; border-radius: 999px; background: #FFBE98; color: #3a2016; }
  .ta-card h3 { font-size: 19px; margin: 12px 0 6px; }
  .ta-card p { font-size: 14.5px; color: rgba(255,255,255,.8); }
  .ta-did { margin-top: 8px; }
  @media (max-width: 820px) {
    .tc-grid, .ta-grid { grid-template-columns: 1fr; }
    .course { padding: 28px 22px; }
    .course h3 { font-size: 22px; }
  }

  /* =========================================================
     Type system — one scale used everywhere
     Display (page titles) · H2 (section headings) · H3 (card titles)
     H4 (nested card titles) · Label (small caps) · Meta · Body
     ========================================================= */
  :root {
    --fs-display: clamp(40px, 5.6vw, 64px);
    --fs-h2: clamp(28px, 3.2vw, 36px);
    --fs-h3: 22px;
    --fs-h4: 18px;
    --fs-lead: 19px;
    --fs-body: 15.5px;
    --fs-meta: 14px;
    --fs-label: 12px;
  }

  /* Display: every page title */
  .hero h1, .page-hero h1 {
    font-family: var(--serif); font-weight: 400; font-size: var(--fs-display);
    line-height: 1.08; letter-spacing: -.02em;
  }
  .hero h1 { max-width: 15ch; }
  .page-hero h1 { max-width: 18ch; }
  .hero p.lead, .page-hero p.lead { font-size: var(--fs-lead); }

  /* H2: section headings */
  h2, .contact h2 {
    font-family: var(--serif); font-weight: 400; font-size: var(--fs-h2);
    line-height: 1.2; letter-spacing: -.01em;
  }
  .contact h2 { max-width: 20ch; }

  /* H3: primary card and entry titles */
  h3, .role h3, .course h3, .tool h3, .explore-card .k, .cols h3 {
    font-family: var(--serif); font-weight: 500; font-size: var(--fs-h3); line-height: 1.3;
  }

  /* H4: titles inside smaller / nested cards */
  .ta-card h3, .stop .deg, .card .deg {
    font-family: var(--serif); font-weight: 500; font-size: var(--fs-h4); line-height: 1.35;
  }

  /* Label: all small uppercase text */
  .eyebrow, .sec-label, .course h4, .skill-group h4, .stop-place, .tool .status, .ta-card .code {
    font-family: var(--sans); font-size: var(--fs-label); font-weight: 600;
    letter-spacing: .14em; text-transform: uppercase;
  }
  .ta-card .code { letter-spacing: .08em; }

  /* Meta: dates, places, roles under titles */
  .course .meta, .role .when, .role .where, .stop .inst, .card .inst, .list li span:last-child, .contact-links a span {
    font-size: var(--fs-meta);
  }

  /* Body text inside cards and lists */
  .course p, .course li, .role ul, .tool p, .ta-card p, .explore-card .t, .list li, .contact-links a {
    font-size: var(--fs-body);
  }
  .about-body p, #about p { font-size: 17px; }

  @media (max-width: 820px) {
    :root { --fs-h3: 20px; --fs-h4: 17px; --fs-lead: 17.5px; }
  }

  /* ---------- Research & Grants ---------- */
  .card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
  .course.compact { padding: 30px 32px; display: flex; flex-direction: column; }
  .course.compact h3 { margin-top: 16px; }
  .course.compact .meta { margin-top: 10px; }
  .code { display: inline-block; align-self: flex-start; font-family: var(--sans); font-size: var(--fs-label); font-weight: 600; letter-spacing: .08em; padding: 4px 10px; border-radius: 999px; background: #FFBE98; color: #3a2016; }
  .award-list { display: grid; gap: 12px; margin-top: 20px; }
  .award { display: flex; align-items: flex-start; gap: 18px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); border-radius: 14px; padding: 18px 22px; }
  .award .code { flex: none; margin-top: 2px; }
  .award-name { font-family: var(--serif); font-weight: 500; font-size: var(--fs-h4); line-height: 1.35; color: #fff; }
  .award-by { font-size: var(--fs-meta); color: rgba(255,255,255,.72); margin-top: 2px; }

  /* Home: 8 cards */
  .explore { grid-template-columns: repeat(4, 1fr); }
  .explore-card:nth-child(n) { border-top: 4px solid var(--classic-blue); }
  .explore-card:nth-child(2) { border-top-color: var(--viva-magenta); }
  .explore-card:nth-child(3) { border-top-color: var(--mocha-mousse); }
  .explore-card:nth-child(4) { border-top-color: var(--very-peri); }
  .explore-card:nth-child(5) { border-top-color: #0B6B57; }
  .explore-card:nth-child(6) { border-top-color: var(--peach-fuzz); }
  .explore-card:nth-child(7) { border-top-color: var(--illuminating); }
  .explore-card:nth-child(8) { border-top-color: var(--viva-magenta); }

  /* Contact page: soft blue, low contrast */
  body:has(.contact-page) { background: #E3EBF4; }
  .contact.contact-page { background: #E3EBF4; color: #1b2a3a; }
  .contact-page h2 { color: #0F4C81; }
  .contact-page .sec-label { color: #5b7896; opacity: 1; }
  .contact-page .contact-links a { color: #1b2a3a; border-bottom-color: rgba(15,76,129,.18); }
  .contact-page .contact-links a span { color: #5b7896; opacity: 1; }
  .contact-page .contact-links a:hover { color: #0F4C81; }
  body:has(.contact-page) footer { background: #E3EBF4; color: #5b7896; }
  @media (prefers-color-scheme: dark) {
    :where(html:not([data-theme="light"])) body:has(.contact-page), :where(html:not([data-theme="light"])) .contact.contact-page, :where(html:not([data-theme="light"])) body:has(.contact-page) footer { background: #1c2a3b; }
    :where(html:not([data-theme="light"])) .contact.contact-page, :where(html:not([data-theme="light"])) .contact-page .contact-links a { color: #dfe7f0; }
    :where(html:not([data-theme="light"])) .contact-page h2 { color: #bcd2ea; }
    :where(html:not([data-theme="light"])) .contact-page .sec-label, :where(html:not([data-theme="light"])) .contact-page .contact-links a span, :where(html:not([data-theme="light"])) body:has(.contact-page) footer { color: #8fa8c2; }
    :where(html:not([data-theme="light"])) .contact-page .contact-links a { border-bottom-color: rgba(255,255,255,.14); }
    :where(html:not([data-theme="light"])) .contact-page .contact-links a:hover { color: #8fb6de; }
  }
  :where(html[data-theme="dark"]) body:has(.contact-page), :where(html[data-theme="dark"]) .contact.contact-page, :where(html[data-theme="dark"]) body:has(.contact-page) footer { background: #1c2a3b; }
  :where(html[data-theme="dark"]) .contact.contact-page, :where(html[data-theme="dark"]) .contact-page .contact-links a { color: #dfe7f0; }
  :where(html[data-theme="dark"]) .contact-page h2 { color: #bcd2ea; }
  :where(html[data-theme="dark"]) .contact-page .sec-label, :where(html[data-theme="dark"]) .contact-page .contact-links a span, :where(html[data-theme="dark"]) body:has(.contact-page) footer { color: #8fa8c2; }
  :where(html[data-theme="dark"]) .contact-page .contact-links a { border-bottom-color: rgba(255,255,255,.14); }
  :where(html[data-theme="dark"]) .contact-page .contact-links a:hover { color: #8fb6de; }

  /* Navigation: switch to the Menu button earlier now that there are 9 links */
  nav ul { gap: 22px; }
  @media (max-width: 1100px) {
    .menu-btn { display: block; }
    nav ul { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 24px 16px; box-shadow: 0 12px 24px rgba(0,0,0,.06); }
    nav ul.open { display: flex; }
    nav li a { display: block; padding: 12px 0; font-size: 16px; }
    .explore { grid-template-columns: repeat(2, 1fr); }
  }
  @media (max-width: 820px) {
    .card-grid { grid-template-columns: 1fr; }
    .course.compact { padding: 24px 22px; }
    .award { flex-direction: column; gap: 10px; padding: 16px 18px; }
  }
  @media (max-width: 600px) { .explore { grid-template-columns: 1fr; } }

  /* ---------- Transition Word Finder ---------- */
  .visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .crumb { color: inherit; text-decoration: none; }
  .crumb:hover { opacity: .75; }
  .tool.live { border-color: var(--accent); }
  .tool.live .status { color: var(--accent); }

  .tw-search { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0 20px; transition: border-color .2s, box-shadow .2s; }
  .tw-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
  .tw-search svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; flex: none; }
  .tw-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 16px; color: var(--ink); padding: 14px 0; }
  .tw-sresults { margin-top: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
  .tw-srow { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; padding: 14px 20px; text-decoration: none; border-bottom: 1px solid var(--line); transition: background .15s; }
  .tw-srow:last-child { border-bottom: 0; }
  .tw-srow:hover, .tw-srow:focus-visible { background: var(--bg); }
  .tw-srow .w { font-family: var(--serif); font-weight: 500; font-size: var(--fs-h4); }
  .tw-srow .m { font-size: var(--fs-meta); color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
  .tw-srow .m i, .tw-family i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
  .tw-more { padding: 14px 20px; font-size: var(--fs-meta); color: var(--muted); }

  .tw-family + .tw-family { margin-top: 28px; }
  .tw-family h4 { font-family: var(--sans); font-size: var(--fs-label); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 12px; }
  .tw-goals { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
  .tw-goal { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 18px 20px 18px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 14px; text-decoration: none; transition: transform .2s, box-shadow .2s; }
  .tw-goal:hover, .tw-goal:focus-visible { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,.07); }
  .tw-goal .q { font-family: var(--serif); font-weight: 500; font-size: var(--fs-h4); line-height: 1.3; padding-right: 20px; }
  .tw-goal .n { font-size: var(--fs-meta); color: var(--muted); }
  .tw-goal .arrow { position: absolute; right: 16px; top: 18px; color: var(--c); transition: transform .2s; }
  .tw-goal:hover .arrow { transform: translateX(4px); }

  .tw-back { display: inline-block; margin-bottom: 16px; font-size: var(--fs-body); font-weight: 500; color: var(--accent); text-decoration: none; }
  .tw-back:hover { opacity: .75; }
  .tw-box .tw-fam { font-size: var(--fs-label); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #FFBE98; margin-bottom: 8px; }
  .tw-box .meta { font-size: var(--fs-body); }
  .course .tw-ex { margin-top: 16px; background: rgba(255,255,255,.1); border-left: 3px solid #FFBE98; border-radius: 8px; padding: 10px 14px; font-style: italic; }
  .course .tw-ex strong { font-style: normal; color: #FFBE98; font-weight: 600; }
  .tw-box .tw-toggle { margin-top: 18px; color: #fff; }
  .tw-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-body); cursor: pointer; }
  .tw-toggle input { width: 18px; height: 18px; accent-color: #FFBE98; }

  .tw-block { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px 24px; margin-top: 14px; }
  .tw-block-head h4 { font-family: var(--serif); font-weight: 500; font-size: var(--fs-h4); }
  .tw-block-head p { font-size: var(--fs-meta); color: var(--muted); margin-top: 2px; }
  .tw-words { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
  .tw-word { font: inherit; font-size: var(--fs-body); color: var(--accent); background: var(--accent-soft); border: 1px solid transparent; border-radius: 999px; padding: 6px 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: background .15s, color .15s; }
  .tw-word:hover { background: var(--accent); color: #fff; }
  .tw-word:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .tw-word.hit { background: var(--accent); color: #fff; box-shadow: 0 0 0 3px #FFBE98; }
  .tw-word small { font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 1px 7px; border-radius: 999px; background: #faf1c4; color: #6b5a00; }
  .tw-word.formal small { background: #FFBE98; color: #3a2016; }
  .tw-word sup { color: var(--viva-magenta); font-weight: 700; }
  .tw-word:hover sup, .tw-word.hit sup { color: #FFBE98; }
  .tw-notes { list-style: none; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); display: grid; gap: 6px; }
  .tw-notes li { font-size: var(--fs-meta); color: var(--muted); }
  .tw-notes strong { color: var(--ink); font-weight: 600; }
  .tw-notes li::before { content: "* "; color: var(--viva-magenta); font-weight: 700; }

  .tw-guide-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .tw-guide-grid .card:nth-child(1) { border-top-color: var(--classic-blue); }
  .tw-guide-grid .card:nth-child(2) { border-top-color: var(--viva-magenta); }
  .tw-guide-grid .card:nth-child(3) { border-top-color: var(--mocha-mousse); }
  .tw-guide-grid .inst { margin-top: 8px; font-size: var(--fs-body); }
  .tw-gex { margin-top: 12px; font-size: var(--fs-meta); font-style: italic; color: var(--ink); }
  .tw-gex strong { font-style: normal; color: var(--accent); }

  .tw-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: var(--fs-body); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60; }
  .tw-toast.show { opacity: 1; transform: translate(-50%, 0); }
  @media (prefers-color-scheme: dark) {
    :where(html:not([data-theme="light"])) .tw-word sup, :where(html:not([data-theme="light"])) .tw-notes li::before { color: #ef7d98; }
  }
  :where(html[data-theme="dark"]) .tw-word sup, :where(html[data-theme="dark"]) .tw-notes li::before { color: #ef7d98; }
  @media (max-width: 820px) {
    .tw-guide-grid { grid-template-columns: 1fr; }
    .tw-goals { grid-template-columns: 1fr 1fr; }
    .tw-block { padding: 18px 18px; }
  }
  @media (max-width: 480px) { .tw-goals { grid-template-columns: 1fr; } }

  /* ---------- Resources: live vs coming soon ---------- */
  .live-tool { text-decoration: none; transition: transform .25s, box-shadow .25s; }
  .live-tool:hover { transform: translateY(-4px); box-shadow: 0 16px 36px rgba(0,0,0,.14); }
  .live-tool p { margin-top: 8px; }
  .live-tool .open { margin-top: 18px; font-weight: 600; color: #FFBE98; font-size: var(--fs-body); }
  .tool.soon { cursor: default; background: transparent; border-style: dashed; filter: grayscale(1); opacity: .55; }
  .tool.soon:hover { transform: none; box-shadow: none; }
  .tool.soon .status { color: var(--muted); }

  /* ---------- Headline highlight: warm orange (all pages) ---------- */
  :root { --highlight: #D2622A; }
  @media (prefers-color-scheme: dark) {
    :root:where(:not([data-theme="light"])) { --highlight: #F2995C; }
  }
  :root:where([data-theme="dark"]) { --highlight: #F2995C; }
  .hero h1 em, .page-hero h1 em { color: var(--highlight); }

  /* ---------- Contact page: same structure as other pages ---------- */
  .contact-page { padding: 90px 0 120px; }
  .contact-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .contact-card { display: flex; flex-direction: column; gap: 8px; text-decoration: none; transition: transform .25s, box-shadow .25s; }
  .contact-card:hover { transform: translateY(-4px); box-shadow: 0 10px 28px rgba(0,0,0,.07); }
  .contact-card .cc-label { font-family: var(--sans); font-size: var(--fs-label); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--label); }
  .contact-card { padding-left: 24px; padding-right: 24px; }
  .contact-card .deg { font-size: min(17px, calc((100vw - 82px) / 16)); white-space: nowrap; }
  .contact-card .cc-go { margin-top: auto; padding-top: 10px; font-size: var(--fs-meta); font-weight: 600; color: var(--accent); }
  @media (max-width: 1040px) {
    .contact-cards { grid-template-columns: 1fr; }
  }
  @media (max-width: 820px) {
    .contact-page { padding: 56px 0 80px; }
  }

  /* ---------- Footer band: soft orange tint, same on every page ---------- */
  footer, body:has(.contact-page) footer { background: #F6E4D8; color: #9A4518; border-top: 3px solid var(--highlight); }
  footer .wrap { opacity: 1; font-weight: 500; }
  @media (prefers-color-scheme: dark) {
    :where(html:not([data-theme="light"])) footer, :where(html:not([data-theme="light"])) body:has(.contact-page) footer { background: #2b1d15; color: #F2995C; border-top-color: var(--highlight); }
  }
  :where(html[data-theme="dark"]) footer, :where(html[data-theme="dark"]) body:has(.contact-page) footer { background: #2b1d15; color: #F2995C; border-top-color: var(--highlight); }

  /* ---------- Background texture: very subtle dot grid (all pages) ---------- */
  :root { --dot: rgba(27, 29, 36, .07); }
  @media (prefers-color-scheme: dark) {
    :root:where(:not([data-theme="light"])) { --dot: rgba(255, 255, 255, .05); }
  }
  :root:where([data-theme="dark"]) { --dot: rgba(255, 255, 255, .05); }
  body, body:has(.contact-page) {
    background-image: radial-gradient(var(--dot) 1px, transparent 1.4px);
    background-size: 22px 22px;
    background-position: 0 0;
  }

  /* ---------- Academic Verb Finder ---------- */
  .av-strength { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; }
  .av-strength span { font-size: var(--fs-label); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #FFBE98; margin-right: 4px; }
  .av-strength a { font-size: 14px; font-weight: 500; padding: 5px 14px; border-radius: 999px; background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.2); }
  .av-strength a:hover { background: rgba(255,255,255,.22); }
  .av-strength a.on { background: #fff; color: var(--classic-blue); border-color: #fff; }
  .tw-word.av-up { flex-direction: column; align-items: flex-start; gap: 0; border-radius: 12px; padding: 6px 14px 7px; line-height: 1.3; }
  .tw-word.av-up small { background: none; padding: 0; font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); }
  .tw-word.av-up:hover small, .tw-word.av-up.hit small { color: rgba(255,255,255,.85); }
  .av-inst { font-family: var(--sans); font-style: normal; font-size: var(--fs-meta); font-weight: 400; color: var(--muted); }
  .tw-gex .no { color: var(--muted); font-style: normal; }

  /* ---------- Semantic Map Builder ---------- */
  .sm-section { padding-top: 40px; }
  .sm-section .wrap { max-width: 1340px; }
  .sm-app { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.06); }
  .sm-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface); }
  .sm-tgroup { display: flex; align-items: center; gap: 4px; padding-right: 14px; border-right: 1px solid var(--line); }
  .sm-tgroup:last-child, .sm-tgroup.sm-right { border-right: 0; padding-right: 0; }
  .sm-right { margin-left: auto; }
  .sm-tb { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--ink); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; transition: background .15s, border-color .15s; }
  .sm-tb.icon { padding: 0; width: 36px; justify-content: center; }
  .sm-tb svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
  .sm-tb:hover:not(:disabled) { background: var(--bg); border-color: var(--line); }
  .sm-tb:disabled { opacity: .35; cursor: default; }
  .sm-tb[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
  .sm-tb.primary { background: var(--accent); color: #fff; }
  .sm-tb.primary:hover { background: color-mix(in srgb, var(--accent) 85%, #000); border-color: transparent; }
  #sm-fit { min-width: 64px; justify-content: center; font-variant-numeric: tabular-nums; }
  .sm-menu { position: relative; }
  .sm-dropdown { position: absolute; top: 42px; left: 0; z-index: 20; width: 260px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 34px rgba(0,0,0,.14); padding: 6px; }
  .sm-dropdown button { display: block; width: 100%; text-align: left; border: 0; background: none; font: inherit; font-size: 15px; font-weight: 500; color: var(--ink); padding: 10px 12px; border-radius: 10px; cursor: pointer; }
  .sm-dropdown button small { display: block; font-size: 13px; font-weight: 400; color: var(--muted); margin-top: 2px; }
  .sm-dropdown button:hover { background: var(--bg); }

  .sm-main { display: grid; grid-template-columns: 1fr 290px; height: 660px; }
  .sm-canvas-wrap { position: relative; overflow: hidden; background-color: #fbfaf7;
    background-image: radial-gradient(rgba(27,29,36,.13) 1px, transparent 1.4px);
    background-size: var(--gs, 22px) var(--gs, 22px); background-position: var(--gx, 0) var(--gy, 0); }
  .sm-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
  .sm-canvas:active { cursor: grabbing; }
  .connecting .sm-canvas, .connecting .sm-node { cursor: crosshair; }
  .sm-node { cursor: move; }
  .sm-sel { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 5 4; pointer-events: none; }
  .sm-handle { cursor: crosshair; }
  .sm-handle circle { fill: var(--accent); stroke: #fff; stroke-width: 2; }
  .sm-handle path { stroke: #fff; stroke-width: 2; stroke-linecap: round; }
  .sm-handle:hover circle { fill: var(--highlight); }
  .sm-edge { cursor: pointer; }
  .sm-hit { stroke: transparent; stroke-width: 16; }
  .sm-edge.is-sel line:not(.sm-hit) { filter: drop-shadow(0 0 3px rgba(15,76,129,.55)); }
  .sm-end { fill: #fff; stroke: var(--accent); stroke-width: 2; }
  .sm-temp { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 6 5; }
  .sm-editor { position: absolute; z-index: 5; resize: none; overflow: hidden; text-align: center; padding: 6px 10px; border: 2px solid var(--accent); border-radius: 12px; background: #fff; color: #1b1d24; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; line-height: 1.3; box-shadow: 0 8px 24px rgba(0,0,0,.15); outline: 0; }
  .sm-hint { position: absolute; left: 12px; right: 12px; bottom: 10px; margin: 0 auto; width: fit-content; max-width: calc(100% - 24px); padding: 6px 14px; border-radius: 999px; background: rgba(255,255,255,.92); border: 1px solid var(--line); font-size: 12.5px; color: var(--muted); text-align: center; pointer-events: none; }
  .sm-hint b { color: var(--accent); }

  .sm-panel { border-left: 1px solid var(--line); padding: 18px 18px 24px; overflow-y: auto; background: var(--surface); }
  .sm-ptitle { font-family: var(--serif); font-weight: 500; font-size: var(--fs-h4); margin-bottom: 6px; }
  .sm-sec { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .sm-sec:last-child { border-bottom: 0; }
  .sm-sec h4 { font-size: var(--fs-label); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--label); margin-bottom: 8px; }
  .sm-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
  .sm-pb { min-width: 36px; height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); font: inherit; font-size: 15px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background .15s, border-color .15s; }
  .sm-pb:hover { border-color: var(--accent); }
  .sm-pb.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
  .sm-pb svg { width: 28px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
  .sm-pb.line svg, .sm-pb svg[viewBox="0 0 28 10"] { height: 10px; stroke-width: 2; }
  .sm-size { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }
  .sm-size span { min-width: 24px; text-align: center; font-size: 14px; font-variant-numeric: tabular-nums; }
  .sm-swatches { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
  .sm-sw { aspect-ratio: 1; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); background: var(--c); cursor: pointer; padding: 0; position: relative; }
  .sm-sw:hover { transform: scale(1.1); }
  .sm-sw.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
  .sm-sw.none { background: linear-gradient(135deg, transparent 45%, #D2622A 46%, #D2622A 54%, transparent 55%), #fff; }
  .sm-wide { width: 100%; margin-top: 8px; height: 36px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
  .sm-row .sm-wide { flex: 1; }
  .sm-wide:hover { border-color: var(--accent); color: var(--accent); }
  .sm-wide.danger { color: #A11F3E; }
  .sm-wide.danger:hover { border-color: #A11F3E; background: #fbeef2; }
  .sm-input { width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 15px; background: var(--bg); color: var(--ink); }
  .sm-input:focus { outline: 0; border-color: var(--accent); }
  .sm-tips { list-style: none; display: grid; gap: 10px; margin-top: 8px; }
  .sm-tips li { font-size: 14px; color: var(--muted); line-height: 1.5; }
  .sm-tips b { color: var(--ink); font-weight: 600; }
  .sm-note { margin-top: 16px; font-size: 13px; color: var(--muted); background: var(--bg); border-radius: 10px; padding: 10px 12px; }

  @media (max-width: 1200px) {
    .sm-tb span { display: none; }
    .sm-tb { padding: 0; width: 38px; justify-content: center; }
    #sm-fit { width: auto; padding: 0 10px; }
    #sm-fit span { display: inline; }
    .sm-tb.primary { width: auto; padding: 0 12px; }
    .sm-tb.primary span { display: inline; }
  }
  @media (max-width: 820px) {
    .sm-main { grid-template-columns: 1fr; height: auto; }
    .sm-canvas-wrap { height: 62vh; min-height: 380px; }
    .sm-panel { border-left: 0; border-top: 1px solid var(--line); }
    .sm-toolbar { gap: 6px 8px; padding: 8px 10px; }
    .sm-tgroup { padding-right: 8px; }
    .sm-right { margin-left: 0; }
    .sm-hint { font-size: 11.5px; }
    .sm-swatches { grid-template-columns: repeat(8, minmax(28px, 1fr)); }
  }
  @media (prefers-color-scheme: dark) {
    :where(html:not([data-theme="light"])) .sm-canvas-wrap { background-color: #1b1e26; background-image: radial-gradient(rgba(255,255,255,.09) 1px, transparent 1.4px); }
    :where(html:not([data-theme="light"])) .sm-hint { background: rgba(27,30,38,.92); }
  }
  :where(html[data-theme="dark"]) .sm-canvas-wrap { background-color: #1b1e26; background-image: radial-gradient(rgba(255,255,255,.09) 1px, transparent 1.4px); }
  :where(html[data-theme="dark"]) .sm-hint { background: rgba(27,30,38,.92); }
  .sm-fonts { margin-top: 8px; }
  .sm-pb.sm-font { flex: 1; font-size: 15px; }

  /* ---------- Light / dark mode toggle ---------- */
  :root { color-scheme: light; }
  @media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) { color-scheme: dark; } }
  :root:where([data-theme="dark"]) { color-scheme: dark; }
  header.nav .wrap { gap: 14px; }
  header.nav nav { margin-left: auto; }
  .theme-toggle {
    flex: none; width: 36px; height: 36px; border-radius: 50%;
    display: inline-grid; place-items: center; padding: 0;
    background: transparent; color: var(--ink); border: 1px solid var(--line);
    cursor: pointer; transition: border-color .2s, background-color .2s, color .2s;
  }
  .theme-toggle:hover { border-color: var(--ink); background: var(--surface); }
  .theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .theme-toggle svg { width: 18px; height: 18px; display: block; }
  .theme-toggle .ic-sun { display: none; }
  @media (prefers-color-scheme: dark) {
    :where(html:not([data-theme="light"])) .theme-toggle .ic-sun { display: block; }
    :where(html:not([data-theme="light"])) .theme-toggle .ic-moon { display: none; }
  }
  :where(html[data-theme="dark"]) .theme-toggle .ic-sun { display: block; }
  :where(html[data-theme="dark"]) .theme-toggle .ic-moon { display: none; }
