  :root {
    --bg: #070A08;
    --surface: #0C130E;
    --ink: #EAF2EA;
    --soft: #A3B8A8;
    --accent: #368450;
    --line: #2A6640;
  }
  * { 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; }

  .page {
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    line-height: 1.6;
    min-height: 100%;
  }
  .mono {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  }

  a { color: var(--accent); text-decoration-color: rgba(54,132,80,0.45); text-underline-offset: 3px; }
  a:hover { text-decoration-color: var(--accent); }
  a:focus-visible, button:focus-visible, summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 2px;
  }

  .skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    background: var(--accent);
    color: var(--bg);
    font-weight: 700;
    padding: 0.6rem 1rem;
    z-index: 200;
  }
  .skip-link:focus { left: 0.75rem; top: 0.75rem; }

  /* ---------------- NAV ---------------- */
  .nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(7, 10, 8, 0.96);
    backdrop-filter: saturate(140%) blur(6px);
    border-bottom: 4px solid var(--line);
  }
  .nav-inner {
    max-width: 980px;
    margin: 0 auto;
    padding: 0.9rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
  }
  .nav-logo {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.06em;
    color: var(--ink);
    text-decoration: none;
    border: 1px solid var(--line);
    padding: 0.3rem 0.55rem;
  }
  .nav-logo:hover { color: var(--accent); border-color: var(--accent); }
  .nav-logo span { color: var(--accent); }
  .nav-logo:hover span { color: inherit; }

  .nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--line);
    cursor: pointer;
    padding: 0;
  }
  .nav-toggle-bar {
    display: block;
    width: 20px;
    height: 2px;
    margin: 0 auto;
    background: var(--ink);
    transition: transform 0.2s ease, opacity 0.2s ease;
  }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .nav-menu {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 1.4rem;
    margin: 0;
    padding: 0;
  }
  .nav-menu a {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--soft);
    text-decoration: none;
    padding: 0.3rem 0.1rem;
    border-bottom: 2px solid transparent;
  }
  .nav-menu a:hover,
  .nav-menu a:focus-visible { color: var(--accent); border-bottom-color: var(--accent); outline: none; }

  .nav-menu a.nav-cv {
    color: var(--bg);
    background: var(--accent);
    border-bottom-color: transparent;
    border-radius: 0.4rem;
    padding: 0.3rem 0.6rem;
  }
  .nav-menu a.nav-cv:hover,
  .nav-menu a.nav-cv:focus-visible { color: var(--bg); background: var(--ink); border-bottom-color: transparent; }

  @media (max-width: 720px) {
    .nav-toggle { display: flex; }
    .nav-menu {
      display: none;
      flex-direction: column;
      gap: 0;
      width: 100%;
      order: 3;
      border-top: 1px solid var(--surface);
      margin-top: 0.9rem;
      padding-top: 0.6rem;
    }
    .nav-menu.is-open { display: flex; }
    .nav-menu li { width: 100%; }
    .nav-menu a { display: block; padding: 0.7rem 0.2rem; border-bottom: 1px solid var(--surface); }
    .nav-inner { flex-wrap: wrap; }
  }

  /* ---------------- WRAP / LAYOUT ---------------- */
  .wrap { max-width: 980px; margin: 0 auto; padding: 0 1.5rem; }

  /* ---------------- HERO HEADER ---------------- */
  .c-header {
    display: grid;
    grid-template-columns: 1fr 148px;
    gap: 1.6rem;
    align-items: start;
    padding: 2.6rem 0 1.8rem;
  }
  .stats-strip {
    border-top: 4px solid var(--line);
    margin-bottom: 2.4rem;
    padding: 1.8rem 0;
  }
  .stats-strip-inner {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
  .stat-item { text-align: left; }
  .stat-number {
    display: block;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
  }
  .stat-label {
    display: block;
    margin-top: 0.5rem;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--soft);
  }
  .stat-note {
    position: relative;
    cursor: help;
    color: var(--accent);
    text-decoration: underline dotted;
    text-underline-offset: 2px;
  }
  .stat-note::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    padding: 0.5rem 0.7rem;
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 4px;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease;
    z-index: 5;
  }
  .stat-note:hover::after,
  .stat-note:focus-visible::after {
    opacity: 1;
    visibility: visible;
  }
  @media (max-width: 560px) {
    .stat-note::after { white-space: normal; width: max-content; max-width: 200px; }
  }
  @media (max-width: 560px) {
    .stats-strip-inner { grid-template-columns: repeat(2, 1fr); gap: 1.6rem 1.2rem; }
  }
  .c-name {
    font-size: clamp(2.4rem, 6vw, 3.6rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 0.98;
    margin: 0;
    text-wrap: balance;
  }
  .c-name span { color: var(--accent); }
  .c-meta {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 0.8rem;
    color: var(--soft);
    margin: 0.9rem 0 0;
    letter-spacing: 0.02em;
  }
  .c-meta a { color: var(--soft); }
  .c-meta a:hover, .c-meta a:focus-visible { color: var(--accent); }
  .c-photo-wrap {
    width: 148px;
    height: 148px;
    overflow: hidden;
    flex-shrink: 0;
    justify-self: end;
  }
  .c-photo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* ---------------- SECTIONS ---------------- */
  .sys-section { padding: 0 0 3.6rem; scroll-margin-top: 5.5rem; }
  .sys-kicker {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0 0 0.7rem;
  }
  .sys-title {
    font-size: clamp(1.5rem, 3.4vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.01em;
    margin: 0 0 1.6rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--surface);
  }

  .c-about { font-size: 1rem; color: var(--ink); margin: 0 0 1.3rem; }
  .sys-label {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--soft);
    margin: 1.6rem 0 0.7rem;
  }
  .c-about + .sys-label { margin-top: 1.8rem; }
  .sys-list { margin: 0 0 0.4rem; padding-left: 1.2rem; }
  .sys-list li { margin-bottom: 0.5rem; }
  .sys-close { margin: 1.8rem 0 0; }

  /* ---------------- ENTRY (Experience / Education / Projects / Awards) ---------------- */
  .c-entry {
    display: grid;
    grid-template-columns: 168px minmax(0, 1fr);
    gap: 1.6rem;
    padding: 1.5rem 0;
    margin-bottom: 0.2rem;
  }
  .c-entry + .c-entry { border-top: 1px solid var(--surface); }
  .c-entry-date {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 0.74rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding-top: 0.15rem;
    line-height: 1.5;
  }
  .c-entry-title { font-weight: 700; font-size: 1.05rem; margin: 0 0 0.2rem; }
  .c-entry-org { font-size: 0.86rem; color: var(--soft); margin: 0 0 0.9rem; }
  .c-entry-org .sep { margin: 0 0.35em; }
  .c-entry-body p { font-size: 0.95rem; color: var(--ink); margin: 0 0 0.9rem; }
  .c-entry-body ul { margin: 0 0 0.9rem; padding-left: 1.2rem; }
  .c-entry-body li { margin-bottom: 0.45rem; font-size: 0.95rem; }
  .c-entry-body h3 {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--soft);
    margin: 1.1rem 0 0.5rem;
  }
  .c-entry-body h3:first-child { margin-top: 0; }

  /* details / more */
  .c-entry-body details {
    margin-top: 1rem;
    border-top: 1px dashed var(--line);
    padding-top: 0.9rem;
  }
  .c-entry-body summary {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  .c-entry-body summary::-webkit-details-marker { display: none; }
  .c-entry-body summary::before {
    content: "+";
    display: inline-block;
    width: 1em;
    color: var(--accent);
  }
  .c-entry-body details[open] summary::before { content: "–"; }
  .c-entry-body details[open] summary { margin-bottom: 0.6rem; }

  /* ---------------- PRINT vs SCREEN SPLIT ----------------
     The old categorized Experience/Education/Projects sections (wrapped in
     .print-only) stay exactly as before for the printed CV — a traditional
     categorized layout. The new My Path timeline (.screen-only) is the
     interactive on-page view. Swapped via @media print below. */
  .print-only { display: none; }
  .screen-only { display: block; }

  /* ---------------- MY PATH TIMELINE ----------------
     Reuses the existing .c-entry component as-is (same grid, same date/
     body columns) — the only addition is a connecting line + dot marker
     layered on top via ::before, so nothing about the entry markup itself
     had to change. */
  .timeline-filter { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0 0 1.8rem; }
  .timeline-filter-btn {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--soft);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  }
  .timeline-filter-btn:hover { color: var(--ink); border-color: var(--accent); }
  .timeline-filter-btn.is-active { color: var(--bg); background: var(--accent); border-color: var(--accent); }
  .timeline .timeline-node.is-filtered-out { display: none; }
  .timeline { position: relative; padding-left: 1.6rem; }
  .timeline::before {
    content: "";
    position: absolute;
    left: 0.3rem;
    top: 0.6rem;
    bottom: 0.6rem;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent), var(--line) 85%, transparent);
  }
  .timeline .timeline-node { position: relative; border-left: none; padding-left: 0; }
  .timeline .timeline-node::before {
    content: "";
    position: absolute;
    left: -1.6rem;
    top: 1.6rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--accent);
  }
  .timeline .timeline-node:first-child::before { background: var(--accent); }
  /* JS toggles this on whichever node is first among the currently visible
     ones, since :first-child still refers to DOM order regardless of a
     filter hiding earlier nodes via display: none. */
  .timeline .timeline-node.is-first-visible::before { background: var(--accent); }

  /* ---------------- SKILLS ---------------- */
  .skill-group { margin-bottom: 2rem; }
  .skill-group:last-child { margin-bottom: 0; }

  .meter-list { list-style: none; margin: 0; padding: 0; max-width: 42rem; }
  .meter-row {
    display: grid;
    grid-template-columns: 108px 1fr 48px;
    align-items: center;
    gap: 0.9rem;
    padding: 0.5rem 0;
  }
  .meter-row-label {
    font-size: 0.9rem;
    color: var(--ink);
  }
  .meter-row-value {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 0.78rem;
    color: var(--soft);
    text-align: right;
  }
  meter {
    width: 100%;
    height: 10px;
    appearance: none;
    -webkit-appearance: none;
  }
  meter::-webkit-meter-bar {
    background: var(--surface);
    border: 1px solid var(--line);
    height: 10px;
  }
  meter::-webkit-meter-optimum-value { background: var(--accent); }
  meter::-moz-meter-bar { background: var(--accent); }
  meter { background: var(--surface); border: 1px solid var(--line); color: var(--accent); }

  .c-tags { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0; padding: 0; list-style: none; }
  .c-tag {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 0.78rem;
    color: var(--accent);
    padding: 0.35rem 0.6rem;
    white-space: nowrap;
  }

  /* ---------------- AWARDS ---------------- */
  .award-entry { grid-template-columns: 96px 1fr; }
  .award-entry .c-entry-org { margin: 0; }

  /* ---------------- CONTACT FORM ---------------- */
  .contact-links {
    margin: 0 0 1.8rem;
    padding-bottom: 1.8rem;
    border-bottom: 1px solid var(--surface);
  }
  .contact-form { max-width: 32rem; }
  .contact-honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
  .contact-field { margin-bottom: 1.1rem; }
  .contact-field label {
    display: block;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--soft);
    margin-bottom: 0.45rem;
  }
  .contact-field input,
  .contact-field textarea {
    width: 100%;
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 0.95rem;
    padding: 0.65rem 0.75rem;
    box-sizing: border-box;
  }
  .contact-field textarea { resize: vertical; min-height: 6rem; }
  .contact-field input:focus-visible,
  .contact-field textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

  .contact-submit {
    background: var(--accent);
    color: var(--bg);
    border: 1px solid transparent;
    border-radius: 0.5rem;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.65rem 1.3rem;
    cursor: pointer;
  }
  .contact-submit:hover:not(:disabled) { background: var(--ink); }
  .contact-submit:disabled { opacity: 0.5; cursor: not-allowed; }

  .contact-status {
    font-size: 0.86rem;
    margin: 0.9rem 0 0;
    min-height: 1.2em;
  }
  .contact-status.is-success { color: var(--accent); }
  .contact-status.is-error { color: #E0665A; }

  /* ---------------- FOOTER ---------------- */
  .sys-footer {
    border-top: 4px solid var(--line);
    padding: 2rem 0 3rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.8rem;
  }
  .sys-footer p {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 0.74rem;
    color: var(--soft);
    margin: 0;
    letter-spacing: 0.02em;
  }
  .sys-footer a { color: var(--soft); }
  .sys-footer a:hover, .sys-footer a:focus-visible { color: var(--accent); }

  /* ---------------- RESPONSIVE ---------------- */
  @media (max-width: 560px) {
    .c-header { grid-template-columns: minmax(0, 1fr); }
    .c-photo-wrap { width: 96px; height: 96px; justify-self: start; }
    .c-entry, .award-entry { grid-template-columns: minmax(0, 1fr); gap: 0.5rem; }
    .c-entry-date { padding-top: 0; }
    .meter-row { grid-template-columns: 88px minmax(0, 1fr) 42px; gap: 0.6rem; }
  }
  @media (max-width: 400px) {
    .wrap { padding: 0 1.05rem; }
    .c-tag { white-space: normal; }
  }
  /* ---------------- CHAT WIDGET ---------------- */
  .chat-toggle {
    position: fixed;
    right: 1.2rem;
    bottom: 1.2rem;
    z-index: 150;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: 2rem;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 0.7rem 1.1rem;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  }
  .chat-toggle:hover { background: var(--ink); }
  .chat-toggle[aria-expanded="true"] { display: none; }

  .chat-panel {
    position: fixed;
    right: 1.2rem;
    bottom: 1.2rem;
    z-index: 150;
    width: min(380px, calc(100vw - 2.4rem));
    max-height: min(600px, calc(100vh - 2.4rem));
    max-height: min(600px, calc(100dvh - 2.4rem));
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: none;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  }
  .chat-panel[hidden] { display: none; }

  .chat-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid rgba(242, 233, 222, 0.08);
    flex-shrink: 0;
  }
  .chat-panel-title { font-size: 0.95rem; font-weight: 800; margin: 0; letter-spacing: -0.01em; }
  .chat-close {
    background: transparent;
    border: none;
    border-radius: 0.4rem;
    color: var(--soft);
    width: 28px;
    height: 28px;
    line-height: 1;
    font-size: 1.1rem;
    cursor: pointer;
  }
  .chat-close:hover, .chat-close:focus-visible { color: var(--accent); }

  .chat-mode-switch { display: flex; gap: 0.5rem; padding: 0.8rem 1rem 0; flex-shrink: 0; }
  .chat-mode-btn {
    flex: 1;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    color: var(--soft);
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.5rem 0.4rem;
    cursor: pointer;
  }
  .chat-mode-btn.is-active { color: var(--bg); background: var(--accent); }
  .chat-mode-btn:hover:not(.is-active) { color: var(--accent); }

  .chat-mode-hint { font-size: 0.78rem; color: var(--soft); margin: 0.7rem 1rem 0; flex-shrink: 0; }

  .chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.9rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    min-height: 120px;
  }
  .chat-msg {
    max-width: 88%;
    font-size: 0.88rem;
    line-height: 1.45;
    padding: 0.6rem 0.85rem;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    border-radius: 0.9rem;
  }
  .chat-msg-user { align-self: flex-end; background: var(--accent); color: var(--bg); border-bottom-right-radius: 0.25rem; }
  .chat-msg-assistant { align-self: flex-start; background: var(--bg); color: var(--ink); border-bottom-left-radius: 0.25rem; }
  .chat-msg-error { align-self: flex-start; background: var(--bg); color: var(--accent); border-bottom-left-radius: 0.25rem; }
  .chat-msg-pending {
    align-self: flex-start;
    background: var(--bg);
    color: var(--soft);
    opacity: 0.8;
    font-style: italic;
    border-bottom-left-radius: 0.25rem;
  }

  .chat-downloads {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1rem 0.7rem;
    flex-shrink: 0;
  }
  .chat-downloads[hidden] { display: none; }
  .chat-downloads-label { width: 100%; font-size: 0.7rem; color: var(--soft); text-transform: uppercase; letter-spacing: 0.04em; }
  .chat-download-btn {
    background: var(--bg);
    color: var(--soft);
    border: 1px solid transparent;
    border-radius: 0.5rem;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 0.4rem 0.7rem;
    cursor: pointer;
  }
  .chat-download-btn:hover { color: var(--accent); }

  .chat-form { border-top: 1px solid rgba(242, 233, 222, 0.08); padding: 0.8rem 1rem 1rem; flex-shrink: 0; }
  .chat-input-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .chat-input {
    width: 100%;
    resize: vertical;
    min-height: 2.6rem;
    max-height: 8rem;
    background: var(--bg);
    color: var(--ink);
    border: 1px solid transparent;
    border-radius: 0.6rem;
    font-family: inherit;
    font-size: 0.88rem;
    padding: 0.55rem 0.6rem;
  }
  .chat-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

  .chat-form-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 0.55rem; gap: 0.6rem; }
  .chat-char-count { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.7rem; color: var(--soft); }
  .chat-char-count.is-near-limit { color: var(--accent); }

  .chat-form-actions { display: flex; align-items: center; gap: 0.5rem; }

  .chat-skip {
    background: var(--bg);
    color: var(--soft);
    border: 1px solid transparent;
    border-radius: 0.5rem;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.5rem 0.9rem;
    cursor: pointer;
  }
  .chat-skip:hover:not(:disabled) { color: var(--accent); }
  .chat-skip:disabled { opacity: 0.5; cursor: not-allowed; }

  .chat-send {
    background: var(--accent);
    color: var(--bg);
    border: 1px solid transparent;
    border-radius: 0.5rem;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.5rem 1rem;
    cursor: pointer;
  }
  .chat-send:hover:not(:disabled) { background: var(--ink); }
  .chat-send:disabled { opacity: 0.5; cursor: not-allowed; }

  @media (max-width: 480px) {
    .chat-panel {
      right: 0.6rem;
      left: 0.6rem;
      bottom: 0.6rem;
      width: auto;
      max-height: calc(100vh - 1.2rem);
      max-height: calc(100dvh - 1.2rem);
    }
    .chat-toggle { right: 0.6rem; bottom: 0.6rem; }

    /* Smaller screens have less room to spare — trim vertical padding so
       the header/mode-switch/input controls stay visible above a mobile
       keyboard instead of pushing the message list to near-zero height. */
    .chat-panel-header { padding: 0.7rem 0.8rem; }
    .chat-mode-switch { padding: 0.6rem 0.8rem 0; }
    .chat-mode-hint { margin: 0.5rem 0.8rem 0; }
    /* min-height: 0 (not 120px, as on desktop) — when the on-screen
       keyboard shrinks the viewport, the fixed-size header/mode-switch/
       hint/form must never get pushed past the visible area, so the
       scrollable message list needs to be free to compress toward zero
       rather than hold a floor that forces the whole panel to overflow. */
    .chat-messages { padding: 0.7rem 0.8rem; min-height: 0; }
    .chat-form { padding: 0.6rem 0.8rem 0.8rem; }

    /* iOS Safari auto-zooms the whole page on focus for any text input
       under 16px — that's the "page grows and shifts" effect when typing.
       16px avoids the zoom entirely; 0.88rem (14px) was triggering it. */
    .chat-input { font-size: 16px; }

    /* Touch targets at a real tappable size (28px was mouse-only sizing). */
    .chat-close { width: 44px; height: 44px; font-size: 1.3rem; }
    .chat-mode-btn { padding: 0.65rem 0.4rem; }
    .chat-skip, .chat-send { padding: 0.65rem 1rem; }
  }

  /* ---------------- PRINT ----------------
     The screen version is deliberately dark/bold; printed pages don't
     work that way — a dark background either gets stripped (leaving
     off-white text unreadable on white paper) or burns ink for nothing.
     Print reuses the light "paper and ink" palette from the Ledger
     direction: same structure and content, legible on paper. */
  @page {
    size: A4;
    margin: 1.1cm 1.3cm;
  }

  @media print {
    * { animation: none !important; transition: none !important; box-shadow: none !important; }

    /* Traditional categorized CV on paper, not the on-screen timeline. */
    .print-only { display: block !important; }
    .screen-only { display: none !important; }

    html, body { font-size: 10pt; font-family: Calibri, Candara, "Segoe UI", Optima, Arial, sans-serif !important; }
    .page {
      background: #fff !important;
      color: #000 !important;
      font-size: 10pt;
      font-family: Calibri, Candara, "Segoe UI", Optima, Arial, sans-serif !important;
      line-height: 1.25;
    }

    .skip-link { display: none !important; }

    /* No sticky nav on paper — the header below is the only orientation needed. */
    .nav { display: none !important; }

    /* The chat widget has no meaning on paper. */
    .chat-toggle, .chat-panel { display: none !important; }

    .wrap { max-width: none !important; padding: 0 !important; }

    /* Black & white printable: no reliance on the site's accent hue anywhere
       in print — every color below is black or a neutral gray. Links keep
       their underline as the (non-color) way to tell them apart. */
    a { color: #000 !important; text-decoration: underline; }

    /* Let long entries flow across a page break between bullets instead of
       forcing the whole entry as one atomic block — a multi-bullet entry
       that doesn't fully fit was jumping to the next page whole, leaving a
       large blank gap behind. The break-inside: avoid below on individual
       list items/paragraphs (not the entry as a whole) still stops a single
       bullet or sentence being split mid-way. */
    .c-entry, .award-entry { break-inside: auto; }
    .c-entry-title, .c-entry-org { break-after: avoid; }
    .c-entry-body li, .c-entry-body p { break-inside: avoid; orphans: 2; widows: 2; }
    .c-entry-body h3 { break-after: avoid; }

    /* ---- compact header: small photo + name on one line, no hero-sized type ----
       DOM order is name-block first, photo second (matches the base 1fr 148px
       rule) — the columns here must stay in that same order or the name/meta
       text gets squeezed into the narrow photo-sized column instead of the
       photo. */
    .c-header {
      grid-template-columns: 1fr 1.7cm !important;
      gap: 0.35cm !important;
      align-items: center !important;
      padding: 0 0 0.2cm !important;
      margin-bottom: 0.25cm !important;
      border-bottom: 1pt solid #000 !important;
    }
    .c-photo-wrap { width: 1.7cm !important; height: 1.7cm !important; border: 1pt solid #000 !important; }
    .c-photo, img { filter: grayscale(1) contrast(1.05) !important; }
    .c-name, .c-name span {
      color: #000 !important;
      font-size: 12pt !important;
      line-height: 1.05 !important;
    }
    .c-meta { color: #333 !important; font-size: 10pt !important; margin-top: 0.08cm !important; }
    .c-about {
      color: #000 !important;
      font-size: 10pt !important;
      margin: 0 0 0.2cm !important;
      max-width: none !important;
    }

    /* ---- sections: tight vertical rhythm, thin rule instead of big gaps ---- */
    .sys-section { padding: 0 0 0.2cm !important; }
    .sys-kicker { color: #333 !important; font-size: 10pt !important; }
    .sys-title {
      color: #000 !important;
      font-size: 12pt !important;
      margin: 0 0 0.1cm !important;
      padding-bottom: 0.04cm !important;
      border-bottom: 0.5pt solid #999 !important;
      break-after: avoid;
    }
    .sys-list { margin: 0 0 0.15cm !important; padding-left: 0.35cm !important; }
    .sys-list li { margin-bottom: 0.06cm !important; }
    .sys-close { margin: 0.2cm 0 0 !important; }

    /* ---- entries: date as a compact left column, not a wide 128px rail ---- */
    .c-entry, .award-entry {
      grid-template-columns: 2.1cm 1fr !important;
      gap: 0.25cm !important;
      border-left: 1pt solid #999 !important;
      padding: 0.08cm 0 0.08cm 0.25cm !important;
      margin-bottom: 0.03cm !important;
    }
    .c-entry-date { color: #000 !important; font-size: 10pt !important; }
    .c-entry-title { color: #000 !important; font-size: 11pt !important; margin: 0 0 0.02cm !important; }
    .c-entry-org { color: #333 !important; font-size: 10pt !important; margin: 0 0 0.05cm !important; }
    .c-entry-body { color: #000 !important; }
    /* .c-entry-body p has its own explicit color in the base (screen) rule,
       which wins over an ancestor's inherited color regardless of !important
       on the ancestor — same bug class as .c-about above, so it needs its
       own explicit override here too, not just on the parent. */
    .c-entry-body p, .c-entry-body li {
      color: #000 !important;
      font-size: 10pt !important;
      line-height: 1.25 !important;
      margin: 0.03cm 0 !important;
    }
    .c-entry-body ul { margin: 0.03cm 0 0.08cm !important; padding-left: 0.3cm !important; }
    .c-entry-body h3 { font-size: 11pt !important; margin: 0.1cm 0 0.02cm !important; color: #000 !important; }

    /* Force every collapsed <details> open on paper, per your request —
       everything visible, just set as small/tight as the rest of the page. */
    details { break-inside: avoid; }
    details:not([open]) summary ~ * { display: block !important; }
    .c-entry-body summary {
      color: #333 !important;
      font-size: 10pt !important;
      cursor: default;
      margin: 0.04cm 0 !important;
    }
    .c-entry-body summary::before { content: "" !important; }

    /* ---- skills: compact meters and tags ---- */
    .skill-group { margin-bottom: 0.18cm !important; }
    .sys-label { font-size: 11pt !important; margin: 0 0 0.08cm !important; color: #000 !important; }
    .meter-row { padding: 0.03cm 0 !important; gap: 0.25cm !important; }
    .meter-row-label, .meter-row-value { color: #333 !important; font-size: 10pt !important; }
    meter { filter: grayscale(1) !important; }
    .c-tags { gap: 0.1cm !important; margin-top: 0.08cm !important; }
    .c-tag {
      color: #000 !important;
      background: transparent !important;
      font-size: 10pt !important;
      padding: 0.02cm 0.1cm !important;
    }

    .sys-footer { display: none !important; }
  }

  /* ---------------- PRINT: CONVERSATION TRANSCRIPT (feature 008) ----------------
     Only shown when the "Download as PDF" button adds .printing-transcript to
     <body> right before calling window.print(), and removed again on the
     browser's afterprint event — a normal Ctrl+P/File>Print of the page is
     untouched and still prints the resume as above. Reuses the same light
     "paper and ink" palette as the resume print styles. */
  .print-transcript { display: none; }

  @media print {
    body.printing-transcript { background: #fff !important; }
    body.printing-transcript .page { display: none !important; }
    body.printing-transcript .print-transcript {
      display: block !important;
      font-size: 9.5pt;
      line-height: 1.4;
      color: #1B2320;
    }
    .print-transcript h1 { font-size: 15pt; margin: 0 0 0.1cm; color: #1B2320; }
    .print-transcript .pt-meta { font-size: 8pt; color: #59635D; margin: 0 0 0.5cm; }
    .print-transcript h2 {
      font-size: 10.5pt;
      margin: 0.5cm 0 0.15cm;
      padding-bottom: 0.05cm;
      border-bottom: 0.5pt solid #C7CDC5;
      color: #1B2320;
    }
    .print-transcript h3 { font-size: 9pt; margin: 0.3cm 0 0.08cm; color: #1B2320; }
    .print-transcript p { margin: 0 0 0.2cm; font-size: 8.8pt; }
    .print-transcript ul { margin: 0 0 0.2cm; padding-left: 0.4cm; }
    .print-transcript li { font-size: 8.5pt; margin-bottom: 0.06cm; }
    .print-transcript .pt-question { font-weight: 700; margin: 0.35cm 0 0.1cm; }
    .print-transcript a { color: #1B2320 !important; text-decoration: underline; }
    .print-transcript .pt-footer {
      margin-top: 0.6cm;
      padding-top: 0.2cm;
      border-top: 0.5pt solid #C7CDC5;
      font-size: 7.3pt;
      color: #59635D;
    }
  }
