:root {
  color-scheme: light;
  --canvas: #f2f4f0;
  --canvas-soft: #f8f9f6;
  --surface: rgba(255, 255, 253, 0.9);
  --surface-solid: #fffffd;
  --ink: #18221b;
  --muted: #667069;
  --line: rgba(24, 34, 27, 0.13);
  --line-strong: rgba(24, 34, 27, 0.25);
  --sage: #dce9df;
  --sage-strong: #316647;
  --lavender: #e2e5e2;
  --lavender-strong: #59635c;
  --sky: #e5e9e5;
  --peach: #ece2c8;
  --butter: #f1e7c5;
  --gold: #9b742c;
  --danger: #9c4f54;
  --success: #4c8068;
  --shadow-sm: 0 10px 30px rgba(43, 62, 49, 0.08);
  --shadow-lg: 0 28px 80px rgba(35, 54, 41, 0.14);
  --serif: "Newsreader", Georgia, serif;
  --sans: "DM Sans", ui-sans-serif, system-ui, sans-serif;
  --header-height: 74px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #121713;
  --canvas-soft: #182019;
  --surface: rgba(28, 37, 30, 0.9);
  --surface-solid: #1d261f;
  --ink: #f2f5f1;
  --muted: #adb7af;
  --line: rgba(237, 244, 238, 0.13);
  --line-strong: rgba(237, 244, 238, 0.24);
  --sage: #273a2d;
  --sage-strong: #a6ceb0;
  --lavender: #303633;
  --lavender-strong: #c0c7c2;
  --sky: #28332c;
  --peach: #473f2c;
  --butter: #4b4228;
  --gold: #d4b568;
  --danger: #e3a3a7;
  --success: #9bd1b6;
  --shadow-sm: 0 12px 34px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 30px 90px rgba(0, 0, 0, 0.34);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  transition: background .25s ease, color .25s ease;
}
body.modal-open { overflow: hidden; }
#main-content { min-width: 0; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.skip-link { position: fixed; z-index: 200; top: 10px; left: 10px; transform: translateY(-180%); border-radius: 999px; background: var(--ink); color: var(--canvas); padding: 10px 14px; }
.skip-link:focus { transform: none; }
.section-shell { width: min(1180px, calc(100% - 44px)); margin-inline: auto; }
.eyebrow { margin: 0 0 9px; color: var(--sage-strong); font-size: .74rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: var(--sans); font-weight: 750; letter-spacing: -.035em; }
.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 10px; padding: 0 18px; cursor: pointer; font-weight: 700; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--ink); color: var(--canvas-soft); box-shadow: 0 8px 24px rgba(32, 49, 44, .16); }
.button.quiet { border-color: var(--line-strong); background: transparent; color: var(--ink); }
.button.full { width: 100%; }
.small-button { min-height: 34px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); padding: 0 12px; cursor: pointer; color: var(--sage-strong); font-weight: 800; }
.icon-button { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); cursor: pointer; }
.settings-button { color: var(--ink); font-size: 1.05rem; text-decoration: none; }
.settings-button:hover,.settings-button:focus-visible { border-color: var(--ink); outline: none; }
.form-error { min-height: 20px; margin: 7px 0 0; color: var(--danger); font-size: .84rem; }

/* Entry */
.entry-gate {
  position: fixed;
  z-index: 150;
  inset: 0;
  display: grid;
  place-items: center;
  min-height: 100svh;
  overflow: auto;
  padding: clamp(34px, 7vw, 90px);
  background:
    radial-gradient(circle at 20% 10%, rgba(80, 99, 77, .3), transparent 34%),
    radial-gradient(circle at 90% 90%, rgba(164, 122, 40, .24), transparent 34%),
    #18211a;
}
.entry-copy {
  position: relative;
  display: flex;
  width: min(1080px, 100%);
  flex-direction: column;
  justify-content: center;
  border: clamp(58px, 7vw, 86px) solid transparent;
  border-image-source: url("assets/anthony-entry-frame.png");
  border-image-slice: 18% 13% 19% 13%;
  border-image-width: 1;
  border-image-repeat: stretch;
  background:
    radial-gradient(circle at 50% 0, rgba(255, 255, 255, .68), transparent 40%),
    linear-gradient(135deg, #f8f0d9, #eee0ba 52%, #f7eed6);
  background-clip: padding-box;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .5), inset 0 0 45px rgba(104, 70, 15, .18);
  color: #211b11;
  padding: clamp(28px, 4vw, 58px);
  text-align: center;
}
.entry-kicker { margin-bottom: clamp(26px, 5vh, 64px); color: var(--sage-strong); font-size: .75rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.entry-copy blockquote { position: relative; z-index: 1; max-width: 800px; margin: 0 auto; font-family: var(--serif); font-size: clamp(1.12rem, 2vw, 1.72rem); line-height: 1.42; letter-spacing: -.012em; }
.entry-author { position: relative; z-index: 1; margin: 18px 0 30px; color: #65543b; font-family: var(--serif); font-style: italic; font-size: 1.02rem; }
.entry-form { position: relative; z-index: 1; width: min(520px, 100%); margin: 0 auto; }
.entry-form label { display: block; margin-bottom: 9px; color: #55452f; font-size: .78rem; font-weight: 800; }
.password-row { display: flex; gap: 9px; }
.password-row input { flex: 1; min-width: 0; min-height: 50px; border: 1px solid rgba(93, 63, 17, .45); border-radius: 10px; background: rgba(255, 253, 246, .88); color: #211b11; padding: 0 15px; outline: none; }
.password-row input:focus { border-color: var(--sage-strong); box-shadow: 0 0 0 4px rgba(79,119,101,.13); }
.password-row button { min-width: 116px; border: 1px solid #6b4914; border-radius: 10px; background: linear-gradient(#b98831, #7d5518); color: #fff8e8; cursor: pointer; font-weight: 800; }

/* Header and navigation */
.portal { min-height: 100vh; }
.site-header { position: sticky; z-index: 50; top: 0; display: grid; height: var(--header-height); min-height: var(--header-height); grid-template-columns: auto 1fr auto; align-items: center; gap: 28px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--canvas) 84%, transparent); padding: 0 clamp(22px, 4vw, 58px); backdrop-filter: blur(20px); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand img { width: 48px; height: 48px; object-fit: contain; }
.brand span { display: grid; }
.brand strong { font-size: .94rem; }
.brand small { color: var(--muted); font-size: .68rem; }
.primary-nav { display: flex; justify-content: center; gap: 8px; }
.nav-link { display: inline-flex; min-width: 118px; min-height: 46px; align-items: center; justify-content: center; border: 1px solid var(--line-strong); border-radius: 12px; background: transparent; padding: 0 24px; cursor: pointer; color: var(--muted); font-size: .86rem; font-weight: 800; text-decoration: none; }
.nav-link:hover,.nav-link:focus-visible,.nav-link.active { border-color: var(--sage-strong); background: var(--surface-solid); color: var(--ink); box-shadow: var(--shadow-sm); outline: none; }
.header-actions { display: flex; align-items: center; gap: 9px; }
.admin-chip { display: inline-flex; min-height: 42px; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); padding: 0 14px; cursor: pointer; color: var(--muted); font-size: .76rem; font-weight: 700; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #b58b36; box-shadow: 0 0 0 4px rgba(181,139,54,.15); }
.admin-chip.unlocked { color: var(--success); }
.admin-chip.unlocked .status-dot { background: var(--success); box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 18%, transparent); }
.mobile-menu-button { display: none; }

/* Music dock */
.music-dock { position: sticky; z-index: 45; top: var(--header-height); display: grid; grid-template-columns: auto 1fr repeat(5, auto); min-height: 68px; align-items: center; gap: 11px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--canvas-soft) 90%, transparent); padding: 10px clamp(22px, 4vw, 58px); backdrop-filter: blur(20px); }
.dock-art { display: grid; width: 44px; height: 44px; place-items: center; border: 0; border-radius: 14px; background: var(--lavender); cursor: pointer; color: var(--lavender-strong); font-size: 1.15rem; }
.dock-copy { display: grid; min-width: 0; }
.dock-copy small { color: var(--muted); font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; }
.dock-copy strong { overflow: hidden; font-size: .83rem; text-overflow: ellipsis; white-space: nowrap; }
.music-timeline { display: grid; min-width: 0; grid-template-columns: auto minmax(48px, 1fr) auto; align-items: center; gap: 6px; color: var(--muted); font-size: .58rem; font-variant-numeric: tabular-nums; line-height: 1; }
.music-timeline input[type="range"] { appearance: none; -webkit-appearance: none; width: 100%; min-height: 14px; margin: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; padding: 0; cursor: pointer; }
.music-timeline input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 999px; background: linear-gradient(90deg, var(--sage-strong) 0 var(--music-progress, 0%), var(--line-strong) var(--music-progress, 0%) 100%); }
.music-timeline input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4px; border: 2px solid var(--surface-solid); border-radius: 50%; background: var(--sage-strong); box-shadow: 0 0 0 1px var(--line-strong); }
.music-timeline input[type="range"]::-moz-range-track { height: 4px; border-radius: 999px; background: var(--line-strong); }
.music-timeline input[type="range"]::-moz-range-progress { height: 4px; border-radius: 999px; background: var(--sage-strong); }
.music-timeline input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border: 2px solid var(--surface-solid); border-radius: 50%; background: var(--sage-strong); }
.music-timeline input[type="range"]:focus-visible { outline: 2px solid var(--sage-strong); outline-offset: 2px; box-shadow: none; }
.music-timeline input[type="range"]:disabled { cursor: default; opacity: .48; }
.dock-control, .dock-play { display: grid; width: 36px; height: 36px; place-items: center; border: 0; border-radius: 50%; background: transparent; cursor: pointer; font-size: 1.35rem; }
.dock-play { background: var(--ink); color: var(--canvas-soft); font-size: .75rem; }
.dock-shuffle { width: auto; min-width: 76px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-solid); padding: 0 12px; font-size: .72rem; font-weight: 800; }
.dock-shuffle[aria-pressed="true"] { background: var(--sage); color: var(--ink); }
.dock-expanded { position: absolute; top: calc(100% + 8px); right: clamp(22px, 4vw, 58px); display: grid; width: min(360px, calc(100vw - 32px)); gap: 13px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-solid); box-shadow: var(--shadow-lg); padding: 16px; }
.dock-expanded[hidden] { display: none; }
.dock-expanded label { display: block; margin-bottom: 7px; color: var(--muted); font-size: .72rem; font-weight: 700; }
.dock-expanded select { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; background: var(--canvas-soft); color: var(--ink); padding: 0 12px; }
.quick-ai-toggle { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-solid); color: var(--ink); cursor: pointer; font-size: .65rem; font-weight: 850; }
.quick-ai-toggle[aria-expanded="true"] { background: var(--ink); color: var(--canvas); }
.quick-ai-popover { position: absolute; top: calc(100% + 8px); right: clamp(22px, 4vw, 58px); width: min(390px, calc(100vw - 28px)); max-height: min(70vh, 620px); overflow-y: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-solid); box-shadow: var(--shadow-lg); padding: 14px; }
.quick-ai-popover form { display: grid; gap: 9px; }
.quick-ai-heading { display: flex; align-items: center; justify-content: space-between; }
.quick-ai-heading strong { font-size: .8rem; }
.quick-ai-heading button { display: grid; width: 30px; height: 30px; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; font-size: 1.15rem; }
.quick-ai-popover select,.quick-ai-popover textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--canvas-soft); color: var(--ink); font: inherit; }
.quick-ai-popover select { min-height: 40px; padding: 0 10px; }
.quick-ai-popover textarea { min-height: 72px; max-height: 180px; resize: vertical; padding: 11px; line-height: 1.4; }
.quick-ai-popover .button { min-height: 42px; }
.quick-ai-answer { margin-top: 11px; border-top: 1px solid var(--line); padding: 13px 2px 2px; color: var(--ink); font-size: .82rem; line-height: 1.55; white-space: pre-wrap; }

/* Page framework */
.page-panel { display: none; min-height: calc(100vh - 142px); padding-top: 72px; padding-bottom: 100px; }
.page-panel.active { display: block; animation: page-in .28s ease both; }
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 40px; margin-bottom: 44px; }
.page-heading h1 { margin: 0; font-size: clamp(3.4rem, 8vw, 6.8rem); line-height: .86; }
.page-heading > p { max-width: 450px; margin: 0; color: var(--muted); font-size: 1.02rem; line-height: 1.65; }

/* Home */
#page-home { padding-top: 0; }
.home-hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(310px, .8fr); min-height: 650px; align-items: center; gap: clamp(40px, 8vw, 110px); padding-top: 70px; padding-bottom: 70px; }
.hero-copy h1 { margin-bottom: 24px; font-size: clamp(3.7rem, 8.5vw, 8rem); line-height: .82; }
.hero-copy h1 em { color: var(--sage-strong); font-weight: 400; }
.hero-lede { max-width: 640px; color: var(--muted); font-size: clamp(1rem, 2vw, 1.2rem); line-height: 1.68; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.hero-note { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 36px; background: linear-gradient(145deg, var(--surface-solid), var(--sage)); box-shadow: var(--shadow-lg); padding: clamp(28px, 5vw, 54px); }
.hero-seal { position: absolute; top: 20px; right: 25px; display: grid; width: 54px; height: 54px; place-items: center; border-radius: 16px; background: var(--ink); color: var(--canvas-soft); font-family: "Noto Serif SC", serif; font-size: 1.4rem; }
.hero-note > p { margin: 70px 0 14px; color: var(--muted); font-size: .73rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.hero-note blockquote { margin: 0; font-family: var(--serif); font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.02; }
.hero-rule { width: 70px; height: 1px; margin: 32px 0 17px; background: var(--line-strong); }
.hero-note small { color: var(--muted); line-height: 1.5; }
.dashboard-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; padding-bottom: 28px; }
.dashboard-card { min-height: 270px; border: 0; border-radius: 28px; padding: 25px; cursor: pointer; color: var(--ink); text-align: left; }
.dashboard-card.lavender { background: var(--lavender); }
.dashboard-card.mint { background: var(--sage); }
.dashboard-card.sky { background: var(--sky); }
.dashboard-card.peach { background: var(--peach); }
.dashboard-card > span { display: block; color: var(--muted); font-size: .7rem; font-weight: 800; }
.dashboard-card h2 { margin: 52px 0 10px; font-size: 2.2rem; }
.dashboard-card p { min-height: 62px; color: var(--muted); line-height: 1.5; }
.dashboard-card strong { font-size: .78rem; }
.home-status { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 22px; background: var(--surface); }
.home-status > div { display: flex; min-height: 88px; align-items: center; gap: 12px; border-right: 1px solid var(--line); padding: 16px 21px; }
.home-status > div:last-child { border-right: 0; }
.home-status p { margin: 0; font-size: .85rem; line-height: 1.4; }
.home-status small { color: var(--muted); }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 5px color-mix(in srgb, var(--success) 15%, transparent); }

/* Resume */
.resume-highlights { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:38px; }
.resume-highlights article { display:grid; grid-template-columns:auto minmax(0,1fr); min-height:112px; align-items:center; gap:15px; border:1px solid var(--line); border-radius:14px; background:var(--surface-solid); padding:18px; }
.resume-highlights article > span { display:grid; width:42px; height:42px; place-items:center; border:1px solid var(--line); border-radius:10px; background:var(--canvas-soft); font-size:1.2rem; font-weight:850; }
.resume-highlights h2 { margin:0; font-size:clamp(.98rem,1.8vw,1.24rem); line-height:1.25; letter-spacing:-.02em; }
.resume-highlights small { display:block; margin-top:5px; color:var(--muted); font-size:.72rem; font-weight:700; }
.resume-highlights ul { display:flex; flex-wrap:wrap; gap:5px 12px; margin:7px 0 0; padding:0; color:var(--muted); list-style:none; font-size:.74rem; font-weight:700; }
.resume-highlights .author-work { margin:7px 0 0; color:var(--ink); font-size:1rem; font-weight:850; letter-spacing:-.02em; }
.resume-highlights .language-list { gap:0; }
.resume-highlights .language-list li { display:flex; align-items:center; color:var(--ink); font-size:.86rem; font-weight:850; }
.resume-highlights .language-list li:not(:last-child)::after { color:var(--gold); margin:0 9px; content:"•"; }
.resume-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, .7fr); gap: clamp(36px, 7vw, 90px); }
.section-title-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.section-title-row h2 { margin: 0; font-size: 1.7rem; }
.timeline-list { border-top: 1px solid var(--line); }
.timeline-item { position: relative; display: grid; grid-template-columns: 150px minmax(0,1fr); gap: 24px; border-bottom: 1px solid var(--line); padding: 28px 0; }
.timeline-meta { color: var(--muted); font-size: .78rem; line-height: 1.55; }
.timeline-copy h3, .education-item h3 { margin: 0 0 5px; font-size: 1.05rem; }
.timeline-copy .organization, .education-item .organization { margin-bottom: 12px; color: var(--sage-strong); font-size: .86rem; font-weight: 700; }
.timeline-copy .description, .education-item .description { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.6; white-space: pre-line; }
.education-list { display: grid; gap: 12px; }
.education-item { position: relative; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); padding: 20px; }
.education-item .meta { color: var(--muted); font-size: .76rem; }
.resume-note { display: flex; gap: 12px; margin-top: 20px; border-radius: 18px; background: var(--sage); padding: 18px; }
.resume-note p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.55; }

/* Interests */
.interests-lock { display: grid; width: min(520px, 100%); min-height: 360px; place-content: center; gap: 14px; margin: 0 auto; border: 1px solid var(--line); border-radius: 20px; background: var(--surface-solid); padding: clamp(28px, 6vw, 54px); text-align: center; }
.interests-lock > span { display: grid; width: 52px; height: 52px; place-items: center; justify-self: center; border: 1px solid var(--line); border-radius: 14px; background: var(--canvas-soft); font-size: 1.25rem; }
.interests-lock h1 { margin: 2px 0 8px; font-size: clamp(1.8rem, 5vw, 2.6rem); }
.interests-lock form { display: grid; gap: 8px; text-align: left; }
.interests-lock label { color: var(--muted); font-size: .72rem; font-weight: 800; }
.interests-lock form > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.interests-lock input,
.interests-lock button { min-height: 48px; border: 1px solid var(--line); border-radius: 12px; color: inherit; font: inherit; }
.interests-lock input { min-width: 0; background: var(--canvas); padding: 0 14px; }
.interests-lock button { background: var(--ink); color: var(--canvas); padding: 0 20px; cursor: pointer; font-weight: 850; }
.interests-lock p { min-height: 1.2em; margin: 2px 0 0; color: var(--danger); font-size: .75rem; }
.interests-lock[hidden],
.interest-grid[hidden] { display: none !important; }
.interest-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.interest-card { position: relative; min-height: 480px; overflow: hidden; border: 1px solid var(--line); border-radius: 32px; background: var(--surface); box-shadow: var(--shadow-sm); padding: clamp(25px, 4vw, 42px); cursor: pointer; color: var(--ink); text-align: left; text-decoration: none; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.interest-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.interest-card:focus-visible { border-color: var(--sage-strong); outline: 3px solid color-mix(in srgb, var(--sage-strong) 30%, transparent); outline-offset: 3px; }
.interest-card.aviation-card { background: linear-gradient(145deg, var(--surface-solid), var(--sky)); }
.interest-card.mandarin-card { background: linear-gradient(145deg, var(--surface-solid), var(--lavender)); }
.interest-card.wide { grid-column: 1 / -1; min-height: 410px; }
.interest-icon { display: grid; width: 54px; height: 54px; place-items: center; margin-bottom: 34px; border-radius: 17px; background: var(--surface-solid); box-shadow: var(--shadow-sm); font-family: var(--serif); font-size: 1.2rem; }
.interest-icon.hanzi { font-family: "Noto Serif SC", serif; }
.interest-card h2 { margin-bottom: 13px; font-size: clamp(2.1rem, 4vw, 3.4rem); line-height: .95; }
.interest-card > p:not(.eyebrow), .book-card-copy > p:not(.eyebrow), .assistant-card > p { max-width: 580px; color: var(--muted); line-height: 1.65; }
.stat-strip { display: grid; grid-template-columns: repeat(2, 1fr); max-width: 390px; margin: 34px 0 24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat-strip.three { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 100%; }
.stat-strip.three strong { font-size: 1.45rem; }
.stat-strip div { display: grid; gap: 2px; padding: 14px 0; }
.stat-strip div + div { border-left: 1px solid var(--line); padding-left: 20px; }
.stat-strip strong { font-family: var(--serif); font-size: 1.7rem; }
.stat-strip span { color: var(--muted); font-size: .7rem; }
.book-card { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); align-items: center; gap: 50px; background: linear-gradient(120deg, var(--peach), var(--surface-solid)); }
.book-visual { position: relative; display: flex; width: min(330px, 90%); aspect-ratio: 3 / 4; flex-direction: column; justify-content: space-between; justify-self: center; border-radius: 7px 22px 22px 7px; background: #293430; box-shadow: 20px 28px 45px rgba(28,39,35,.28); padding: 30px; color: #f7f2e9; transform: rotate(2deg); }
.book-visual::before { position: absolute; inset: 0 auto 0 15px; width: 1px; background: rgba(255,255,255,.18); content: ""; }
.book-visual > span { align-self: end; font-family: var(--serif); font-size: 4rem; color: #d7c4a4; }
.book-visual small { font-family: var(--serif); font-size: 2rem; line-height: .9; }
.book-visual i { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; opacity: .65; }
.privacy-line { display: flex; max-width: 620px; gap: 12px; margin: 24px 0; border-radius: 18px; background: color-mix(in srgb, var(--surface-solid) 70%, transparent); padding: 14px 16px; }
.privacy-line p { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.assistant-card { min-height: 360px !important; background: linear-gradient(140deg, var(--sage), var(--sky)); }
.assistant-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.assistant-heading .interest-icon { margin-bottom: 28px; }
.connection-pill { border: 1px solid var(--line); border-radius: 999px; background: var(--surface); padding: 8px 12px; color: var(--muted); font-size: .7rem; font-weight: 800; }
.connection-pill.connected { color: var(--success); }
.connector-form { display: flex; max-width: 760px; align-items: end; gap: 10px; margin-top: 22px; }
.connector-form label { flex: 1; }
.connector-form label span, .stack-form label span, .book-editor-area label > span, .modal-card form label > span { display: block; margin-bottom: 7px; color: var(--muted); font-size: .72rem; font-weight: 750; }
.connector-form input, .stack-form input, .stack-form textarea, .modal-card form input { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-solid); color: var(--ink); padding: 0 14px; outline: none; }
.assistant-demo { margin-top: 22px; }
.assistant-demo > span { color: var(--muted); font-size: .7rem; font-weight: 700; }
.assistant-demo div { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.assistant-demo small, .coming-soon { border-radius: 999px; background: var(--surface); padding: 8px 11px; color: var(--muted); }
.mycology-card { grid-column: 1 / -1; min-height: 270px; background: linear-gradient(150deg, var(--surface-solid), var(--butter)); }

/* Music */
.panel-card { border: 1px solid var(--line); border-radius: 28px; background: var(--surface); box-shadow: var(--shadow-sm); padding: 24px; }
.playlist-browser-heading { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.playlist-browser-heading h2 { margin: 0; font-size: 2rem; }
.playlist-browser-actions { display: flex; align-items: center; gap: 7px; }
.music-bank-modal { position: fixed; z-index: 160; inset: 0; display: grid; place-items: center; background: rgba(15,22,16,.58); padding: 14px; backdrop-filter: blur(7px); }
.music-bank-modal[hidden] { display: none !important; }
.music-bank-dialog { display: grid; width: min(430px,100%); max-height: min(650px,calc(100dvh - 28px)); overflow: hidden; border: 1px solid var(--line-strong); border-radius: 20px; background: var(--surface-solid); box-shadow: var(--shadow-lg); }
.music-bank-dialog > header,.music-bank-dialog > footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 17px; }
.music-bank-dialog > header { border-bottom: 1px solid var(--line); }
.music-bank-dialog > footer { justify-content: flex-end; border-top: 1px solid var(--line); }
.music-bank-dialog h2 { margin: 0; font-size: 1.35rem; }
.music-bank-dialog > header button { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--ink); cursor: pointer; font-size: 1.1rem; }
.music-bank-list { display: grid; gap: 7px; overflow: auto; padding: 12px; }
.music-bank-option { display: flex; min-width: 0; align-items: center; gap: 11px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb,var(--sage) 35%,var(--surface-solid)); padding: 12px; cursor: pointer; }
.music-bank-option input { width: 18px; height: 18px; flex: 0 0 auto; margin: 0; accent-color: var(--ink); }
.music-bank-option span { display: grid; min-width: 0; gap: 2px; }
.music-bank-option strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.music-bank-option small { color: var(--muted); }
.playlist-tile-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(210px,1fr)); gap: 12px; }
.playlist-tile-list { display: contents; }
.playlist-tile { display: grid; min-height: 210px; align-content: space-between; justify-items: start; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: color-mix(in srgb,var(--surface-solid) 78%,var(--lavender)); color: var(--ink); padding: 22px; cursor: pointer; text-align: left; transition: border-color .18s ease,transform .18s ease,box-shadow .18s ease; }
.playlist-tile:nth-child(3n+2) { background: color-mix(in srgb,var(--surface-solid) 76%,var(--sage)); }
.playlist-tile:nth-child(3n) { background: color-mix(in srgb,var(--surface-solid) 76%,var(--butter)); }
.playlist-tile:hover,.playlist-tile:focus-visible { border-color: var(--line-strong); box-shadow: var(--shadow-sm); outline: 0; transform: translateY(-2px); }
.playlist-tile.active { border-color: var(--ink); }
.playlist-tile > span { font-size: 2rem; }
.playlist-tile strong { width: 100%; overflow: hidden; font-size: 1.15rem; text-overflow: ellipsis; white-space: nowrap; }
.playlist-tile small { color: var(--muted); }
.playlist-tile small b { color: var(--ink); font-size: 1rem; }
.all-songs-tile { background: color-mix(in srgb,var(--surface-solid) 68%,var(--sky)); }
.library-title-group { display: grid; gap: 8px; }
.collection-back-button { width: max-content; min-height: 36px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--muted); padding: 0 11px; cursor: pointer; font: inherit; font-size: .72rem; font-weight: 800; }
.collection-back-button:hover,.collection-back-button:focus-visible { border-color: var(--line-strong); color: var(--ink); outline: 0; }
.library-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); padding-bottom: 20px; }
.library-heading h2 { margin: 0; font-size: 2rem; }
.library-player { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 13px; margin: 18px 0 4px; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb,var(--sage) 42%,var(--surface-solid)); padding: 13px 15px; }
.library-player > button { display: grid; width: 42px; height: 42px; place-items: center; border: 0; border-radius: 50%; background: var(--ink); color: var(--canvas-soft); cursor: pointer; font-size: .76rem; }
.library-player > button:disabled { cursor: default; opacity: .45; }
.library-player-copy { display: grid; min-width: 0; gap: 3px; }
.library-player-copy > small { color: var(--muted); font-size: .62rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.library-player-copy > strong { overflow: hidden; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.library-player .music-timeline { max-width: 720px; }
.library-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.bulk-playlist-select { max-width: 165px; min-height: 42px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-solid); color: var(--ink); padding: 0 11px; font: inherit; font-size: .72rem; font-weight: 700; }
.bulk-playlist-select:disabled { opacity: .45; }
.select-all-control { display: inline-flex; min-height: 42px; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 14px; padding: 0 12px; cursor: pointer; color: var(--muted); font-size: .74rem; font-weight: 750; }
.select-all-control input,.track-select { width: 17px; height: 17px; margin: 0; accent-color: var(--ink); cursor: pointer; }
.button.danger { border-color: color-mix(in srgb, #b94040 45%, var(--line)); background: transparent; color: #a62f2f; }
.button.danger:not(:disabled):hover { background: color-mix(in srgb, #b94040 10%, transparent); }
.button:disabled { cursor: not-allowed; opacity: .42; }
.track-table-wrap { margin-top: 12px; overflow-x: auto; }
.track-table-head,.track-row { display: grid; min-width: 850px; grid-template-columns: 24px 38px minmax(190px,1.3fr) minmax(140px,.8fr) minmax(170px,.9fr) minmax(76px,auto); align-items: center; gap: 14px; }
.track-table-head { align-items: end; border-bottom: 1px solid var(--line-strong); padding: 10px 3px 12px; }
.track-column-filter { display: grid; min-width: 0; gap: 5px; }
.track-sort { display: flex; align-items: center; justify-content: space-between; gap: 7px; border: 0; background: transparent; color: var(--muted); padding: 0; cursor: pointer; font: inherit; font-size: .63rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.track-sort span { color: var(--muted); font-size: .58rem; letter-spacing: 0; }
.track-sort.active { color: var(--ink); }
.track-column-filter input,.track-column-filter select { width: 100%; min-width: 0; min-height: 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-solid); color: var(--ink); padding: 0 10px; font: inherit; font-size: .72rem; }
.artist-filter { position: relative; min-width: 0; }
.artist-filter summary { display: flex; min-height: 38px; align-items: center; justify-content: space-between; gap: 8px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-solid); padding: 0 10px; cursor: pointer; color: var(--ink); font-size: .72rem; list-style: none; }
.artist-filter summary::-webkit-details-marker { display: none; }
.artist-filter summary span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.artist-filter[open] summary { border-color: var(--line-strong); }
.artist-filter-options { position: absolute; z-index: 35; top: calc(100% + 6px); left: 0; display: grid; width: max(100%, 220px); max-height: 260px; overflow: auto; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface-solid); box-shadow: var(--shadow-lg); padding: 6px; }
.artist-filter-all,.artist-filter-option { display: flex; min-height: 36px; align-items: center; gap: 9px; border: 0; border-radius: 8px; background: transparent; padding: 7px 9px; cursor: pointer; color: var(--ink); font: inherit; font-size: .72rem; text-align: left; }
.artist-filter-all:hover,.artist-filter-all.active,.artist-filter-option:hover { background: var(--sage); }
.artist-filter-option input { width: 16px; min-height: 16px; margin: 0; padding: 0; accent-color: var(--ink); }
.artist-filter-option span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-list { display: grid; min-width: 850px; }
.track-row { border-bottom: 1px solid var(--line); padding: 14px 3px; }
.track-row.editing { background: color-mix(in srgb, var(--butter) 28%, transparent); }
.track-row.playing { background: color-mix(in srgb, var(--sage) 42%, transparent); box-shadow: inset 4px 0 0 var(--sage-strong); }
.track-row.playing .track-play { background: var(--ink); color: var(--canvas-soft); }
.track-play { display: grid; width: 38px; height: 38px; place-items: center; border: 0; border-radius: 50%; background: var(--sage); cursor: pointer; font-size: .72rem; }
.track-song { display: grid; min-width: 0; }
.track-song strong,.track-song small,.track-artist { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-song small,.track-artist { color: var(--muted); font-size: .76rem; }
.track-edit-input { width: 100%; min-width: 0; min-height: 36px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface-solid); color: var(--ink); padding: 0 9px; font: inherit; font-size: .76rem; }
.track-playlist-select { width: 100%; min-width: 0; min-height: 36px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-solid); color: var(--ink); padding: 0 8px; }
.track-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.track-row-actions button { min-width: 30px; min-height: 30px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; color: var(--muted); font: inherit; font-size: .75rem; font-weight: 800; }
.track-row-actions .track-save { background: var(--sage); color: var(--ink); padding: 0 9px; }
.library-empty { padding: 60px 20px; color: var(--muted); text-align: center; }


/* Footer */
.site-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); padding-top: 28px; padding-bottom: 38px; color: var(--muted); font-size: .8rem; }
.site-footer .footer-identity { display: flex; align-items: center; gap: 10px; }
.site-footer img { width: 40px; height: 40px; object-fit: contain; }
.site-footer p { margin: 0; }
.footer-controls { display: flex; width: 100%; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; border-top: 1px solid var(--line); padding-top: 20px; }
.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.footer-nav-link { min-width: 118px; justify-content: center; }
.footer-cloud-status { flex: 0 0 auto; }


/* Modals */
.modal-backdrop { position: fixed; z-index: 160; inset: 0; display: grid; place-items: center; overflow: auto; background: rgba(22,32,29,.72); padding: 20px; backdrop-filter: blur(14px); }
.modal-card { position: relative; width: min(620px, 100%); border: 1px solid var(--line); border-radius: 30px; background: var(--surface-solid); box-shadow: var(--shadow-lg); padding: clamp(25px, 5vw, 44px); }
.modal-card > p:not(.eyebrow) { color: var(--muted); line-height: 1.6; }
.modal-card h2 { margin-bottom: 12px; font-size: 2.5rem; }
.modal-close { position: absolute; top: 16px; right: 16px; display: grid; width: 38px; height: 38px; place-items: center; border: 0; border-radius: 50%; background: var(--canvas); cursor: pointer; font-size: 1.3rem; }
.modal-mark { display: grid; width: 48px; height: 48px; place-items: center; margin-bottom: 25px; border-radius: 16px; background: var(--sage); }
.unlock-modal form { margin-top: 22px; }
.stack-form { display: grid; gap: 15px; }
.stack-form textarea { min-height: 130px; padding-block: 12px; resize: vertical; }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
/* Book studio */
.book-modal { display: grid; min-height: calc(100svh - var(--header-height) - 68px); background: var(--canvas-soft); }
.chapter-menu-button { display: none; }
.book-workspace { display: grid; grid-template-columns: 290px 1fr; min-height: 0; }
.book-workspace.chapters-hidden { grid-template-columns: 1fr; }
.book-workspace.chapters-hidden .chapter-rail { display: none; }
.chapter-rail { display: flex; min-height: 0; flex-direction: column; border-right: 1px solid var(--line); background: var(--surface); padding: 18px 12px; }
.chapter-rail-heading { display: flex; align-items: center; justify-content: space-between; padding: 3px 8px 12px; color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.chapter-rail-heading button { display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-solid); cursor: pointer; }
.chapter-rail nav { display: grid; gap: 3px; overflow: auto; }
.chapter-button { display: grid; width: 100%; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 10px; border: 0; border-radius: 12px; background: transparent; padding: 10px 11px; cursor: pointer; color: var(--muted); text-align: left; font-size: .78rem; line-height: 1.35; }
.chapter-button span { min-width: 0; }
.chapter-button small { color: inherit; font-size: .61rem; font-weight: 800; opacity: .65; }
.chapter-button.active { background: var(--sage); color: var(--ink); font-weight: 800; }
.book-privacy { display: flex; gap: 8px; margin-top: auto; border-radius: 13px; background: var(--surface-solid); padding: 11px; }
.book-privacy p { margin: 0; color: var(--muted); font-size: .67rem; line-height: 1.45; }
.book-editor-area { display: grid; min-height: 0; grid-template-rows: auto auto minmax(0,1fr) auto; padding: 16px clamp(22px, 5vw, 72px) 18px; }
.book-editor-controls { display: grid; grid-row: 1; grid-template-columns: minmax(220px,1fr) auto; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.book-title-label { display: grid; min-width: 0; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 8px; }
.book-title-label span { color: var(--muted); font-size: .6rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.book-title-label input { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-solid); color: var(--ink); padding: 7px 9px; font: 750 .78rem/1.2 var(--sans); outline: none; }
.book-page-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 5px; }
.book-page-toolbar button { min-width: 30px; min-height: 30px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-solid); color: var(--ink); padding: 5px 9px; cursor: pointer; font-size: .66rem; font-weight: 850; }
.book-page-toolbar button:disabled { cursor: default; opacity: .35; }
.book-page-toolbar .chapter-sidebar-toggle { border-color: var(--line-strong); background: var(--butter); }
.book-page-toolbar strong { min-width: 76px; color: var(--muted); font-size: .62rem; text-align: center; }
#add-book-page { margin-left: auto; background: var(--butter); }
#book-split-pages[aria-pressed="true"] { border-color: var(--sage-strong); background: var(--sage); }
#export-book-word { border-color: var(--line-strong); background: var(--sage); }
.book-page-figure { grid-row: 2; max-height: 240px; overflow: auto; margin-top: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-solid); padding: 8px 10px; }
.book-page-figure summary { cursor: pointer; color: var(--muted); font-size: .7rem; font-weight: 850; }
.book-page-figure img { display: block; width: 100%; max-height: 255px; object-fit: contain; margin-top: 10px; border-radius: 8px; }
.book-page-spread { display: grid; min-height: 0; grid-row: 3; grid-template-columns: minmax(0,1fr); gap: 12px; margin-top: 10px; }
.book-page-spread.split { grid-template-columns: repeat(2, minmax(0,1fr)); }
.book-content-label { display: grid; min-height: 0; grid-template-rows: auto minmax(0,1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-solid); box-shadow: var(--shadow-sm); padding: 15px 18px; }
.book-content-label > span { color: var(--muted); font-size: .62rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.book-content-label textarea { width: 100%; min-height: 0; border: 0; background: transparent; color: var(--ink); padding: 8px 0; outline: none; resize: none; font-family: var(--serif); font-size: 1.22rem; line-height: 1.7; }
.book-editor-area > footer { display: flex; grid-row: 4; align-items: center; gap: 18px; border-top: 1px solid var(--line); padding-top: 10px; color: var(--muted); font-size: .68rem; }
.toast { position: fixed; z-index: 220; right: 22px; bottom: 22px; max-width: min(380px, calc(100vw - 44px)); border-radius: 15px; background: var(--ink); color: var(--canvas-soft); box-shadow: var(--shadow-lg); padding: 12px 16px; opacity: 0; pointer-events: none; transform: translateY(12px); transition: .2s ease; }
.toast.visible { opacity: 1; transform: none; }

/* Minimal workspace interface */
.page-heading { margin-bottom: 30px; }
.page-heading h1 { font-size: clamp(2.5rem, 5vw, 4.8rem); line-height: .95; }
.home-command { display: grid; min-height: calc(100svh - 142px); align-content: center; gap: 30px; padding-block: 56px; }
.detail-page-shell { height: calc(100svh - 142px); min-height: 480px; background: var(--canvas); }
.detail-page-shell iframe { display: block; width: 100%; height: 100%; border: 0; background: var(--canvas); }
.command-heading { display: flex; align-items: center; gap: 17px; }
.command-heading img { width: 62px; height: 62px; object-fit: contain; }
.command-heading h1 { margin: 0 0 3px; font: 800 clamp(1.8rem, 4vw, 3rem)/1 var(--sans); letter-spacing: -.04em; }
.command-heading span { color: var(--muted); font-size: .78rem; font-weight: 650; }
.command-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.command-grid a { display: grid; grid-template-columns: auto 1fr auto; min-height: 118px; align-items: center; gap: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-solid); padding: 24px; cursor: pointer; color: var(--ink); text-align: left; text-decoration: none; transition: border-color .18s, transform .18s, box-shadow .18s; }
.command-grid a:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.command-grid span { color: var(--muted); font-size: .68rem; font-weight: 800; }
.command-grid .command-emoji { font-size: 1.8rem; }
.command-grid strong { font-size: clamp(1rem, 2vw, 1.25rem); }
.command-grid b { font-size: 1.3rem; }
.command-status { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.command-status > span { display: flex; min-height: 66px; align-items: center; justify-content: space-between; gap: 12px; border-right: 1px solid var(--line); padding: 14px 18px; }
.command-status > span:last-child { border-right: 0; }
.command-status small { color: var(--muted); font-weight: 650; }
.command-status strong { font-size: .83rem; }

.resume-layout { grid-template-columns: minmax(0, 1fr) minmax(280px, .42fr); gap: clamp(32px, 5vw, 70px); }
.timeline-item { grid-template-columns: 82px minmax(0, 1fr) auto; gap: 17px; padding: 24px 0; }
.company-mark { display: grid; width: 50px; height: 50px; place-items: center; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-solid); color: var(--sage-strong); font-size: .72rem; font-weight: 850; letter-spacing: -.02em; }
.company-mark.has-logo { width: 78px; overflow: hidden; background: #fff; padding: 6px; }
.company-mark.has-logo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.company-mark.logo-bitwave { border-color: #202638; background: #111626; padding: 11px 8px; }
.company-mark.logo-medical { border-color: #8fb4e7; background: linear-gradient(145deg, #f7faff, #d9e8fb); box-shadow: inset 0 0 0 2px rgba(255,255,255,.82); padding: 4px; }
.company-mark.logo-medical img { width: 100%; height: 100%; object-fit: contain; }
.timeline-copy .organization, .education-item .organization { margin-bottom: 5px; color: var(--muted); }
.timeline-copy .timeline-meta { margin: 0; }
.resume-details { margin-top: 14px; }
.resume-details summary { width: max-content; cursor: pointer; color: var(--sage-strong); font-size: .76rem; font-weight: 800; }
.resume-details ul { display: grid; gap: 8px; margin: 14px 0 0; padding-left: 18px; color: var(--muted); font-size: .84rem; line-height: 1.5; }
.education-item { display: grid; grid-template-columns: 78px 1fr; column-gap: 13px; border-radius: 13px; padding: 17px; }
.education-item .company-mark { grid-row: 1 / 4; }
.education-item h3, .education-item .organization, .education-item .meta { grid-column: 2; }
.education-item h3 { padding-right: 96px; }

.interest-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.interest-card, .interest-card.aviation-card, .interest-card.mandarin-card, .book-card, .assistant-card, .mycology-card { display: flex; min-height: 280px !important; grid-column: auto; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 0; border-radius: 14px; background: var(--surface-solid); box-shadow: none; padding: 24px; }
.interest-icon { width: 46px; height: 46px; margin-bottom: 34px; border: 1px solid var(--line); border-radius: 10px; background: var(--canvas-soft); box-shadow: none; font-family: var(--sans); font-size: 1.35rem; font-weight: 800; }
.interest-icon.matrix-rain-icon { overflow: hidden; border-color: rgba(74, 217, 112, .34); background: #07100a; padding: 4px; box-shadow: inset 0 0 14px rgba(62, 255, 112, .08); }
.matrix-rain-icon img { display: block; width: 100%; height: 100%; object-fit: contain; }
.interest-card h2 { margin: 0 0 18px; font: 750 clamp(1.4rem, 2.4vw, 2rem)/1 var(--sans); letter-spacing: -.035em; }
.stat-strip { width: 100%; margin: auto 0 17px; }
.stat-strip strong { font-family: var(--sans); font-size: 1.25rem; }
.book-card-copy { display: flex; height: 100%; flex-direction: column; align-items: flex-start; }
.book-card-copy .author-card-title { margin:0; color:var(--ink); font-size:1.05rem; font-weight:850; line-height:1.25; letter-spacing:-.02em; }
.book-card-copy .author-card-status { display:block; margin-top:5px; color:var(--gold); font-size:.72rem; font-weight:800; }
.assistant-heading { display: flex; width: 100%; height: 100%; flex-direction: column; align-items: flex-start; }
.assistant-heading > div { width: 100%; }
.assistant-heading .connection-pill { margin-top: auto; }
.connection-pill, .coming-soon { border-radius: 8px; }
.mycology-card .coming-soon { margin-top: auto; }
.panel-card { border-radius: 14px; box-shadow: none; }

.assistant-heading .button { margin-top: auto; }
.assistant-heading .connection-pill { margin-top: 10px; }

@media (max-width: 980px) {
  .interest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .home-command { min-height: calc(100svh - 142px); padding-block: 34px; }
  .command-grid { grid-template-columns: 1fr; }
  .command-grid a { min-height: 86px; padding: 19px; }
  .command-status { grid-template-columns: 1fr; }
  .command-status > span { min-height: 54px; border-right: 0; border-bottom: 1px solid var(--line); }
  .command-status > span:last-child { border-bottom: 0; }
  .page-heading h1 { margin-bottom: 0; font-size: 3.2rem; }
  .timeline-item { grid-template-columns: 48px 1fr auto; }
  .timeline-copy { grid-column: 2 / -1; grid-row: auto; }
  .company-mark { width: 44px; height: 44px; }
  .interest-grid { grid-template-columns: 1fr; }
  .interests-lock form > div { grid-template-columns: 1fr; }
  .interest-card, .interest-card.wide { min-height: 240px !important; border-radius: 14px; }
  .resume-highlights { grid-template-columns:1fr; }
}

@media (min-width: 601px) and (max-width: 720px) {
  .primary-nav { position: static; display: flex; width: auto; border: 0; border-radius: 0; background: transparent; box-shadow: none; padding: 0; }
  .mobile-menu-button { display: none; }
}

@media (max-width: 980px) {
  .entry-gate { padding: 42px; }
  .entry-copy { min-height: auto; }
  .site-header { grid-template-columns: auto 1fr auto; }
  .header-actions { grid-column: 3; grid-row: 1; }
  .site-header .admin-chip span:last-child { display: none; }
  .home-hero { min-height: auto; grid-template-columns: 1fr; padding-top: 65px; }
  .hero-note { max-width: 600px; }
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
  .home-status { grid-template-columns: repeat(2, 1fr); }
  .home-status > div:nth-child(2) { border-right: 0; }
  .home-status > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .resume-layout { grid-template-columns: 1fr; }
  .interest-card { min-height: 450px; }
  .book-card { grid-template-columns: 1fr .65fr; }
  .book-workspace { grid-template-columns: 240px 1fr; }
  .book-editor-area { padding-inline: 30px; }
  .book-editor-controls { grid-template-columns: minmax(180px,1fr) auto; }
}

@media (max-width: 720px) {
  .section-shell { width: min(100% - 24px, 1180px); }
  .site-header { gap: 10px; padding: 0 12px; }
  .brand img { width: 40px; height: 40px; }
  .brand small { display: none; }
  .mobile-menu-button { padding-inline: 10px; }
  .music-dock { top: var(--header-height); grid-template-columns: auto minmax(0, 1fr) repeat(5, auto); gap: 4px; padding-inline: 12px; }
  .dock-art { display: grid; width: 34px; height: 34px; border-radius: 50%; }
  .dock-control { display: grid; }
  .dock-play,.quick-ai-toggle { grid-column: auto; }
  .quick-ai-popover { right: 12px; }
  .page-panel { padding-top: 48px; padding-bottom: 76px; }
  .page-heading { display: block; margin-bottom: 30px; }
  .page-heading h1 { margin-bottom: 22px; font-size: 4.1rem; }
  .home-hero { gap: 32px; padding-top: 45px; padding-bottom: 38px; }
  .hero-copy h1 { font-size: clamp(3.55rem, 18vw, 5.8rem); }
  .hero-note { border-radius: 27px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-card { min-height: 220px; }
  .dashboard-card h2 { margin-top: 32px; }
  .dashboard-card p { min-height: auto; }
  .home-status { grid-template-columns: 1fr; }
  .home-status > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .home-status > div:last-child { border-bottom: 0; }
  .timeline-item { grid-template-columns: 1fr; gap: 8px 12px; }
  .timeline-meta { grid-column: 1; }
  .timeline-copy { grid-column: 1 / -1; grid-row: 2; }
  .interest-grid { grid-template-columns: 1fr; }
  .interest-card, .interest-card.wide { grid-column: auto; min-height: auto; border-radius: 25px; }
  .book-card { grid-template-columns: 1fr; }
  .book-visual { display: none; }
  .assistant-heading { display: block; }
  .connection-pill { display: inline-block; margin-bottom: 18px; }
  .connector-form { display: grid; }
  .playlist-tile-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .site-footer { display: flex; text-align: left; }
  .footer-controls { align-items: stretch; }
  .footer-nav { width: 100%; }
  .footer-nav-link { justify-content: center; text-align: center; }
  .chapter-menu-button { display: inline-block; font-size: .72rem !important; }
  .chapter-sidebar-toggle { display: none; }
  .book-workspace { position: relative; grid-template-columns: 1fr; }
  .book-workspace.chapters-hidden .chapter-rail { display: flex; }
  .chapter-rail { position: absolute; z-index: 3; inset: 0 auto 0 0; width: min(290px, 100%); padding: 18px 12px; box-shadow: var(--shadow-lg); transform: translateX(-101%); transition: transform .2s ease; }
  .chapter-rail.open { transform: none; }
  .book-editor-area { padding: 12px 14px 14px; }
  .book-editor-controls { grid-template-columns: 1fr; gap: 8px; }
  .book-page-toolbar { justify-content: flex-end; }
  .book-page-figure { max-height: 245px; }
  .book-page-figure img { max-height: 195px; }
  .book-content-label { padding: 13px 14px; }
  .book-content-label textarea { font-size: 1.08rem; }
  .book-editor-area > footer { flex-wrap: wrap; }
  .book-editor-area > footer button { width: 100%; margin-left: 0; }
  .two-fields { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .primary-nav { position: absolute; top: calc(100% + 8px); right: 12px; display: none; width: min(250px,calc(100vw - 24px)); border: 1px solid var(--line); border-radius: 16px; background: var(--surface-solid); box-shadow: var(--shadow-lg); padding: 8px; }
  .primary-nav.open { display: grid; }
  .nav-link { justify-content: flex-start; text-align: left; }
  .mobile-menu-button { display: block; justify-self: end; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); padding: 10px 13px; cursor: pointer; font-size: .76rem; font-weight: 800; }
}

@media (max-width: 480px) {
  .entry-gate { align-items: start; padding: 22px 12px; }
  .entry-copy { border-width: 34px 28px; box-shadow: 0 20px 50px rgba(0,0,0,.45), inset 0 0 34px rgba(104,70,15,.18); padding: 22px 14px; }
  .entry-copy blockquote { font-size: 1.08rem; line-height: 1.42; }
  .entry-kicker { margin-bottom: 28px; }
  .password-row { display: grid; }
  .password-row button { min-height: 48px; }
  .brand strong { font-size: .82rem; }
  .icon-button { width: 38px; height: 38px; }
  .site-header .admin-chip { min-width: 38px; padding: 0 11px; }
  .hero-actions .button { width: 100%; }
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .library-heading { display: grid; align-items: start; }
  .library-actions { width: 100%; flex-wrap: wrap; justify-content: flex-start; }
  .bulk-playlist-select { max-width: none; flex: 1 1 150px; }
  .library-heading .button { min-height: 40px; padding-inline: 13px; }
  .chapter-rail { width: min(290px, 100%); }
  .book-page-toolbar { justify-content: flex-start; overflow-x: auto; }
  .book-page-toolbar button { flex: 0 0 auto; }
}

@media (max-width: 480px) {
  .playlist-tile-grid { grid-template-columns: 1fr; }
  .playlist-tile { min-height: 165px; }
}

@media (max-width: 720px) {
  .page-heading h1 { margin-bottom: 0; font-size: 3.2rem; }
  .timeline-item { grid-template-columns: 68px minmax(0,1fr); }
  .timeline-copy { grid-column: 2 / -1; grid-row: auto; }
  .company-mark.has-logo { width: 64px; }
  .interest-card, .interest-card.wide { min-height: 240px !important; border-radius: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}

/* Universal button-border contract: every enabled button renders a visible 1px border. */
button:not(:disabled) {
  border-style: solid !important;
  border-width: 1px !important;
}

/* Large-access music player */
body.accessible-player-open { overflow: hidden; }
body.accessible-player-open #page-music { animation: none; transform: none; }
.accessible-music-player { position: fixed; z-index: 220; inset: 0; overflow: auto; background:
  radial-gradient(circle at 15% 20%, rgba(205,181,84,.2), transparent 28%),
  radial-gradient(circle at 82% 8%, rgba(100,143,117,.24), transparent 30%),
  linear-gradient(145deg,#0d1510 0%,#16261c 52%,#0c120e 100%); color: #f7f3dc; display: grid; place-items: center; padding: 12px; }
.accessible-music-player[hidden] { display: none; }
.accessible-player-shell { display: grid; width: min(1040px,100%); height: auto; max-height: min(520px,calc(100dvh - 24px)); min-height: 0; overflow-y: auto; margin: auto; grid-template-rows: repeat(5,auto); gap: clamp(8px,1.5vh,14px); border: 1px solid rgba(238,220,141,.34); border-radius: clamp(18px,2.5vw,32px); background: linear-gradient(135deg,rgba(255,255,255,.09),rgba(255,255,255,.025)); box-shadow: 0 34px 100px rgba(0,0,0,.55),inset 0 1px rgba(255,255,255,.16); padding: clamp(12px,2vw,24px); backdrop-filter: blur(24px); }
.accessible-player-header { display: grid; grid-template-columns: minmax(150px,1fr) auto minmax(150px,1fr); align-items: center; gap: 16px; }
.accessible-player-header button { min-height: 48px; border-color: rgba(238,220,141,.42) !important; border-radius: 14px; background: rgba(7,12,9,.42); color: #fff8d6; padding: 0 18px; cursor: pointer; font: inherit; font-weight: 850; }
.accessible-player-header button:last-child { justify-self: end; }
.accessible-player-header button[aria-pressed="true"] { background: #f0d768; color: #172018; }
.accessible-player-status { display: grid; min-width: 0; justify-items: center; text-align: center; }
.accessible-player-status span,.accessible-player-now p { margin: 0; color: #c9d8ce; font-size: .72rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.accessible-player-status strong { max-width: 44vw; overflow: hidden; color: #f0d768; font-size: 1rem; text-overflow: ellipsis; white-space: nowrap; }
.accessible-player-selectors { display: grid; grid-template-columns: 1fr 1.45fr; gap: 15px; }
.accessible-player-selectors label { display: grid; gap: 8px; color: #c9d8ce; font-size: .72rem; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.accessible-player-selectors select { width: 100%; min-height: 52px; border: 1px solid rgba(238,220,141,.42); border-radius: 14px; background: #f8f4dc; color: #172018; padding: 0 16px; font: inherit; font-size: clamp(.9rem,1.6vw,1.05rem); font-weight: 800; }
.accessible-player-selectors select:focus-visible,.accessible-player-header button:focus-visible,.accessible-player-controls button:focus-visible { outline: 4px solid #f0d768; outline-offset: 4px; }
.accessible-player-now { display: grid; min-height: 46px; align-content: center; justify-items: center; text-align: center; }
.accessible-player-now h2 { max-width: 100%; margin: 5px 0 2px; overflow: hidden; color: #fffdf0; font-size: clamp(1.4rem,3vw,2.7rem); line-height: 1; text-overflow: ellipsis; text-shadow: 0 5px 30px rgba(0,0,0,.46); white-space: nowrap; }
.accessible-player-now > strong { max-width: 100%; overflow: hidden; color: #f0d768; font-size: clamp(.85rem,1.5vw,1.08rem); text-overflow: ellipsis; white-space: nowrap; }
.accessible-signal { display: flex; height: 26px; align-items: end; gap: 5px; margin-bottom: 7px; }
.accessible-signal i { width: 7px; height: 18%; border-radius: 8px; background: linear-gradient(#f3df7e,#7fb293); box-shadow: 0 0 18px rgba(240,215,104,.42); animation: accessible-signal 1.05s ease-in-out infinite alternate; }
.accessible-signal i:nth-child(2),.accessible-signal i:nth-child(6) { height: 55%; animation-delay: -.35s; }
.accessible-signal i:nth-child(3),.accessible-signal i:nth-child(5) { height: 82%; animation-delay: -.7s; }
.accessible-signal i:nth-child(4) { height: 100%; animation-delay: -.15s; }
.accessible-player-timeline { display: grid; grid-template-columns: 56px minmax(0,1fr) 56px; align-items: center; gap: 16px; color: #e8eadf; font-size: .9rem; font-variant-numeric: tabular-nums; font-weight: 800; }
.accessible-player-timeline input[type="range"] { appearance: none; -webkit-appearance: none; width: 100%; min-height: 34px; border: 0; background: transparent; cursor: pointer; }
.accessible-player-timeline input[type="range"]::-webkit-slider-runnable-track { height: 12px; border-radius: 99px; background: linear-gradient(90deg,#f0d768 0 var(--music-progress,0%),rgba(255,255,255,.2) var(--music-progress,0%) 100%); }
.accessible-player-timeline input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 34px; height: 34px; margin-top: -11px; border: 5px solid #16261c; border-radius: 50%; background: #fff6c6; box-shadow: 0 0 0 2px #f0d768; }
.accessible-player-timeline input[type="range"]::-moz-range-track { height: 12px; border-radius: 99px; background: rgba(255,255,255,.2); }
.accessible-player-timeline input[type="range"]::-moz-range-progress { height: 12px; border-radius: 99px; background: #f0d768; }
.accessible-player-timeline input[type="range"]::-moz-range-thumb { width: 24px; height: 24px; border: 5px solid #16261c; border-radius: 50%; background: #fff6c6; }
.accessible-player-controls { display: grid; width: min(620px,100%); margin-inline: auto; grid-template-columns: repeat(3,minmax(100px,180px)); justify-content: center; align-items: center; gap: clamp(12px,2vw,22px); }
.accessible-player-controls button { display: grid; min-height: 96px; place-items: center; gap: 4px; border-color: rgba(238,220,141,.46) !important; border-radius: 24px; background: rgba(7,12,9,.48); color: #fff8d6; cursor: pointer; font: inherit; }
.accessible-player-controls button span { font-size: 3rem; line-height: .7; }
.accessible-player-controls button small { font-size: .75rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.accessible-player-controls .accessible-main-play { min-height: 110px; border-color: #f0d768 !important; border-radius: 28px; background: linear-gradient(145deg,#f5df79,#c9ad3e); color: #162018; box-shadow: 0 16px 45px rgba(0,0,0,.35),0 0 34px rgba(240,215,104,.18); }
.accessible-player-controls button:disabled { cursor: default; opacity: .38; }
@keyframes accessible-signal { from { transform: scaleY(.45); opacity: .65; } to { transform: scaleY(1); opacity: 1; } }

@media (max-width: 700px) {
  .accessible-music-player { padding: 6px; }
  .accessible-player-shell { width: 100%; height: auto; max-height: calc(100dvh - 12px); gap: 8px; border-radius: 18px; padding: 10px; }
  .accessible-player-header { grid-template-columns: 1fr 1fr; }
  .accessible-player-status { grid-column: 1 / -1; grid-row: 1; }
  .accessible-player-header button { min-height: 44px; grid-row: 2; padding: 0 12px; }
  .accessible-player-selectors { grid-template-columns: 1fr; gap: 10px; }
  .accessible-player-selectors select { min-height: 48px; }
  .accessible-player-now { min-height: 42px; }
  .accessible-signal { display: none; }
  .accessible-player-timeline { grid-template-columns: 42px minmax(0,1fr) 42px; gap: 8px; }
  .accessible-player-controls { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
  .accessible-player-controls button { min-height: 92px; border-radius: 22px; }
  .accessible-player-controls .accessible-main-play { min-height: 104px; border-radius: 26px; }
  .accessible-player-controls button span { font-size: 2.25rem; }
}

@media (max-height: 820px) {
  .accessible-music-player { height: 100dvh; max-height: 100dvh; padding: 6px; }
  .accessible-player-shell { height: auto; max-height: calc(100dvh - 12px); min-height: 0; overflow-y: auto; grid-template-rows: repeat(5,auto); gap: 7px; border-radius: 16px; padding: 10px; }
  .accessible-player-header button { min-height: 42px; padding-inline: 12px; }
  .accessible-player-selectors { gap: 8px; }
  .accessible-player-selectors label { gap: 4px; line-height: 1.1; }
  .accessible-player-selectors select { min-height: 46px; }
  .accessible-player-now { min-height: 38px; }
  .accessible-player-now h2 { margin: 3px 0 1px; font-size: clamp(1.25rem,4vh,2.1rem); }
  .accessible-player-now > strong { font-size: clamp(.78rem,2vh,.98rem); }
  .accessible-signal { display: none; }
  .accessible-player-timeline input[type="range"] { min-height: 30px; }
  .accessible-player-controls { width: min(520px,100%); gap: 10px; }
  .accessible-player-controls button { min-height: 82px; border-radius: 20px; }
  .accessible-player-controls .accessible-main-play { min-height: 94px; border-radius: 24px; }
  .accessible-player-controls button span { font-size: 2.1rem; }
}

@media (max-height: 500px) {
  .accessible-player-shell { height: auto; max-height: calc(100dvh - 8px); gap: 4px; padding: 7px; }
  .accessible-player-header { grid-template-columns: minmax(96px,1fr) auto minmax(96px,1fr); gap: 7px; }
  .accessible-player-status { grid-column: auto; grid-row: auto; }
  .accessible-player-header button { min-height: 36px; grid-row: auto; }
  .accessible-player-selectors { grid-template-columns: 1fr 1.45fr; }
  .accessible-player-selectors select { min-height: 40px; }
  .accessible-player-now { min-height: 30px; }
  .accessible-player-now p { display: none; }
  .accessible-player-timeline input[type="range"] { min-height: 26px; }
  .accessible-player-controls button { min-height: 70px; }
  .accessible-player-controls .accessible-main-play { min-height: 78px; }
}
