.h-chapters { margin: 0 0 24px; border-radius: 24px; overflow: hidden; background: var(--h-cloud); box-shadow: var(--h-shadow); }
.h-chapters header { padding: 54px 24px 16px; color: white; background: linear-gradient(0deg, rgb(12 29 48 / .87), transparent), url("/scene-art/harbor-panorama.jpg") center 54% / cover; }
.h-chapters h2, .h-chapters h3, .h-excerpts blockquote { margin: 0; }
.h-chapters header p { margin: 5px 0 0; }
.h-chapters ol, .h-excerpt-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.h-chapters ol { list-style: none; padding: 16px; margin: 0; }
.h-chapters li { display: grid; justify-items: start; align-content: start; gap: 6px; border-top: 3px solid var(--h-line); color: var(--h-ink-2); padding: 10px 5px; }
.h-chapters li.lit { border-color: var(--h-ok); }
.h-chapters .lit > span { color: var(--h-ok); font-weight: 650; }
.h-excerpts { margin: 24px 0; }
.h-excerpts article { min-width: 0; overflow-wrap: anywhere; padding: 16px; }
.h-excerpts blockquote { margin-block: 10px; }
.h-excerpts audio { width: 100%; }
.h-last-line { display: block; margin-top: 12px; color: var(--h-ink-2); overflow-wrap: anywhere; }
.h-unlocked { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px 18px; margin-bottom: 16px; border-radius: 16px; background: var(--h-ok-soft); color: var(--h-ok); }
@media (max-width: 620px) {
  .h-chapters ol, .h-excerpt-grid { grid-template-columns: 1fr; }
  .h-chapters li { border-top: 0; border-left: 3px solid var(--h-line); padding: 5px 12px; }
}
:root,
[data-mode="day"] {
  --h-canvas-center: #FFFFFF;
  --h-canvas-mid: #F3F7FC;
  --h-canvas-outer: #E8EFF8;
  --h-cloud: #FFFFFF;
  --h-pill: #E7EEF7;
  --h-ink-1: #102033;
  --h-ink-2: #44566C;
  --h-ink-3: #6B7D93;
  --h-accent: #2156E5;
  --h-accent-soft: #E2ECFF;
  --h-orb-ring: rgba(33, 86, 229, 0.14);
  --h-orb-core: #102033;
  --h-orb-fg: #FFFFFF;
  --h-ok: #137553;
  --h-ok-soft: #DCF5EB;
  --h-due: #9B540B;
  --h-due-soft: #FDEFD9;
  --h-line: rgba(16, 32, 51, 0.08);
  --h-shadow: 0 18px 42px rgba(16, 32, 51, 0.07);
  --h-pet-shadow: drop-shadow(0 16px 24px rgba(16, 32, 51, 0.16));
}

[data-mode="night"] {
  --h-canvas-center: #192d38;
  --h-canvas-mid: #11212b;
  --h-canvas-outer: #0c1820;
  --h-cloud: #1c303c;
  --h-pill: #293f4b;
  --h-ink-1: #e3ecee;
  --h-ink-2: #bbcdd2;
  --h-ink-3: #a4b9c1;
  --h-accent: #9bd9cd;
  --h-accent-soft: #203f43;
  --h-orb-ring: rgb(155 217 205 / 16%);
  --h-orb-core: #a8c9c8;
  --h-orb-fg: #12292e;
  --h-ok: #55C293;
  --h-ok-soft: #1B352B;
  --h-due: #F0A052;
  --h-due-soft: #36281A;
  --h-line: rgba(243, 245, 248, 0.1);
  --h-shadow: 0 20px 48px rgba(0, 0, 0, 0.34);
  --h-pet-shadow: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.48));
}

@keyframes hFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes hPulse { 0%, 100% { transform: scale(1); opacity: 0.55; } 50% { transform: scale(1.08); opacity: 0.22; } }
@keyframes hHop { 0% { transform: translateY(0) scale(1); } 40% { transform: translateY(-12px) scale(1.03); } 100% { transform: translateY(0) scale(1); } }
@media (prefers-reduced-motion: reduce) {
  body.harbor-mode *, body.harbor-mode *::before, body.harbor-mode *::after { animation: none !important; transition: none !important; }
}

body.harbor-mode {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 36% 42%, var(--h-canvas-center) 0%, var(--h-canvas-mid) 56%, var(--h-canvas-outer) 100%);
  color: var(--h-ink-1);
  overflow-x: hidden;
}
body.harbor-mode .workspace {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 24px 196px;
  background: transparent;
  box-shadow: none;
}
body.harbor-mode .shell {
  max-width: 100%;
  background: transparent;
  box-shadow: none;
  padding: 0;
  border: 0;
}
body.harbor-mode .appbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0 18px;
  border: 0;
  background: transparent;
}
body.harbor-mode .appbar .brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px 6px 8px;
  border-radius: 999px;
  background: var(--h-cloud);
  box-shadow: var(--h-shadow);
  color: var(--h-ink-1);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
}
body.harbor-mode #primary-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border-radius: 999px;
  background: var(--h-cloud);
  box-shadow: var(--h-shadow);
}
body.harbor-mode #primary-nav a {
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--h-ink-2);
  text-decoration: none;
  white-space: nowrap;
}
body.harbor-mode #primary-nav a[aria-current="page"] {
  background: var(--h-orb-core);
  color: var(--h-orb-fg);
}
.h-quick-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.h-tool-pill, .h-tool-icon {
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  background: var(--h-cloud);
  box-shadow: var(--h-shadow);
  color: var(--h-ink-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
}
.h-tool-icon {
  width: 38px;
  padding: 0;
}
.h-tool-pill:hover, .h-tool-icon:hover {
  background: var(--h-pill);
  color: var(--h-ink-1);
}
.h-ico {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
}
.h-num { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-variant-numeric: tabular-nums; }

/* Main Spatial Companion Stage */
.h-stage {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  align-items: center;
  gap: 24px;
  min-height: 480px;
  padding: 8px 0 24px;
}
.h-pedestal {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 430px;
  user-select: none;
}
.h-orbit {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--h-line);
  pointer-events: none;
}
.h-orbit-1 { width: 280px; height: 280px; background: radial-gradient(circle, var(--h-accent-soft) 0%, transparent 72%); opacity: 0.72; }
.h-orbit-2 { width: 376px; height: 376px; }
.h-orbit-3 { width: 454px; height: 454px; opacity: 0.5; }
.h-figure-btn {
  position: relative;
  z-index: 3;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  animation: hFloat 4.6s ease-in-out infinite;
}
.h-figure-btn.hop { animation: hHop 420ms ease; }
.h-figure-img {
  height: clamp(320px, 46vh, 430px);
  width: auto;
  max-width: 100%;
  object-fit: contain;
  filter: var(--h-pet-shadow);
  display: block;
}
.h-float-tag {
  position: absolute;
  top: 8px;
  left: 0;
  z-index: 4;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--h-cloud);
  box-shadow: var(--h-shadow);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.h-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--h-accent);
  color: #FFFFFF;
  display: grid;
  place-items: center;
  font-size: 11px;
}

.h-dialogue-zone {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  min-width: 0;
}
.h-district-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.h-topic-picker { max-width: 100%; }
.h-stage.h-cabin-stage { display: block; max-width: 940px; margin-inline: auto; }
.h-cabin-stage .h-pedestal { display: none; }
.h-cabin { width: 100%; overflow: hidden; }
.h-cabin-switch { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px clamp(12px, 3vw, 32px); }
.h-cabin-cover { display: grid; grid-template-columns: minmax(140px, 32%) 1fr; align-items: center; background: var(--h-cloud); }
.h-cabin-cover img { width: 100%; height: 164px; object-fit: cover; }
.h-cabin-cover header, .h-cabin-body { padding: 20px clamp(16px, 3vw, 32px); }
.h-cabin-cover h2 { margin: 6px 0; font-size: clamp(21px, 3vw, 30px); }
.h-cabin-cover button { margin-top: 12px; }
.h-cabin small, .h-cabin-cover [lang] { display: block; color: var(--h-ink-2); }
.h-cabin-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 32px; }
.h-cabin-body h3 { margin: 0; font-size: 17px; }
.h-cabin ul { list-style: none; margin: 0; padding: 0; }
.h-cabin li { display: grid; justify-items: start; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--h-line); line-height: 1.45; }
.h-cabin li small { margin-top: 4px; }
.h-cabin-note { grid-column: 1 / -1; }
@media (max-width: 640px) {
  .h-cabin-cover, .h-cabin-body { grid-template-columns: minmax(0, 1fr); }
  .h-cabin-cover img { height: 120px; }
  .h-cabin-cover header { padding-bottom: 0; }
}
.h-topic-options:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.h-topic-options .h-mini-pill[aria-pressed="true"] { color: var(--h-ink-1); font-weight: 700; }
.h-cloud-tip span[lang] { display: block; margin: 4px 0; overflow-wrap: anywhere; }
.h-soft-chip, .h-mini-pill {
  min-height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--h-pill);
  color: var(--h-ink-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.h-soft-chip[aria-selected="true"], .h-mini-pill.highlight, .h-cabin-switch [aria-pressed="true"] {
  background: var(--h-accent-soft);
  color: var(--h-accent);
}
.h-mini-pill.ok { background: var(--h-ok-soft); color: var(--h-ok); }
.h-mini-pill.due { background: var(--h-due-soft); color: var(--h-due); }

.h-speech-cloud {
  background: var(--h-cloud);
  box-shadow: var(--h-shadow);
  border-radius: 32px 32px 32px 10px;
  padding: 22px 26px;
  width: 100%;
  max-width: 540px;
}
.h-cloud-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--h-ink-3);
  margin-bottom: 8px;
}
.h-cloud-en {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--h-ink-1);
}
.h-cloud-zh {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--h-ink-2);
}
.h-cloud-tip {
  margin: 10px 0 0;
  padding: 10px 14px;
  border-radius: 16px;
  background: var(--h-pill);
  font-size: 13px;
  color: var(--h-ink-2);
}
.h-cloud-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.h-orb-cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
}
.h-orb-wrap { position: relative; display: grid; place-items: center; }
.h-orb-halo {
  position: absolute;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: var(--h-orb-ring);
  animation: hPulse 2.8s ease-in-out infinite;
  pointer-events: none;
}
.h-orb {
  position: relative;
  z-index: 2;
  width: 72px;
  height: 72px;
  border: 0;
  border-radius: 50%;
  background: var(--h-orb-core);
  color: var(--h-orb-fg);
  box-shadow: var(--h-shadow);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.h-orb.recording {
  background: #C93A2B;
  color: #FFFFFF;
}
.h-orb-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.h-orb-hint { font-size: 14px; font-weight: 600; color: var(--h-ink-1); }
.h-orb-quick { display: flex; flex-wrap: wrap; gap: 8px; }

.h-reply-capsule {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 540px;
  background: var(--h-cloud);
  box-shadow: var(--h-shadow);
  border-radius: 999px;
  padding: 6px 8px 6px 18px;
}
.h-reply-capsule input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--h-ink-1);
  outline: none;
  font-size: 14px;
}
.h-send-circle {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--h-accent);
  color: #FFFFFF;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

/* Bottom 3-step Journey Arc */
.h-rhythm-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px clamp(6px, 1.5vw, 18px);
  margin: 0 0 10px;
  padding: 7px 14px;
  border: 1px solid var(--h-line);
  border-radius: 20px;
  background: var(--h-cloud);
  color: var(--h-ink-2);
  font-size: 13px;
}
.h-rhythm-bar > * { white-space: nowrap; }
.h-rhythm-bar .lit, .h-rhythm-bar small { color: var(--h-ok); }
.h-rhythm-bar small { margin-inline-start: auto; font-size: inherit; }
@media (max-width: 480px) {
  .h-rhythm-bar { margin-inline: -4px; padding: 6px; gap: 4px 2px; font-size: 12px; }
}
.h-journey-arc {
  max-width: 980px;
  margin: 8px auto 0;
  padding: 10px;
  border-radius: 999px;
  background: var(--h-cloud);
  box-shadow: var(--h-shadow);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.h-step-cap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--h-ink-1);
  min-width: 0;
}
.h-step-cap:hover, .h-step-cap.current { background: var(--h-pill); }
.h-step-num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--h-accent-soft);
  color: var(--h-accent);
  font-weight: 700;
  font-size: 13px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.h-step-num.done { background: var(--h-ok-soft); color: var(--h-ok); }
.h-step-copy { min-width: 0; }
.h-step-copy strong { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-step-copy span { display: block; font-size: 12px; color: var(--h-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Organic Sub-views */
/* The selected illustration follows a reader from the cover into the listening canvas. */
.h-pick-hero, .h-cloud-panel.h-profile {
  display: grid;
  align-items: center;
  gap: clamp(18px, 3vw, 40px);
  padding: clamp(18px, 2.5vw, 32px);
  border: 1px solid var(--h-line);
  border-radius: 32px;
  background: linear-gradient(115deg, var(--h-cloud) 12%, var(--h-canvas-mid) 66%, var(--h-accent-soft));
  box-shadow: var(--h-shadow);
  margin-bottom: 22px;
}
.h-pick-hero { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); }
body.harbor-mode:has(.h-pick-hero, .h-profile) .appbar { height: auto; min-height: 58px; margin-bottom: 12px; padding-bottom: 6px; }
.h-pick-hero h1 span { display: inline-block; max-width: 100%; }
.h-pick-meta, .h-comfort-bar, .h-mode-capsule, .h-actions, .h-theme-filters, .h-profile-goal,
.h-audio-tools, .h-tour-stages { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.h-pick-meta > span, .h-profile-cover > span, .h-card-art > span, .h-pick-cover figcaption {
  padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 650;
}
.h-pick-meta > span:first-child { background: var(--h-due-soft); color: var(--h-due); }
.h-pick-meta > span + span { color: var(--h-ink-2); background: var(--h-pill); }
.portal #app .h-pick-hero h1, .portal #app .h-profile h1 {
  margin: 14px 0 10px; color: var(--h-ink-1); font-size: clamp(24px, 2.8vw, 38px);
  line-height: 1.28; letter-spacing: -.035em; text-wrap: balance;
}
.h-pick-copy > p, .h-profile-copy > p { color: var(--h-ink-2); line-height: 1.75; font-size: 14px; }
.h-comfort-bar { margin: 16px 0; gap: 6px; font-size: 12px; color: var(--h-ink-2); }
.h-comfort-bar button, .h-mode-capsule button { min-height: 34px; padding: 6px 12px; border-radius: 999px; font-weight: 600; }
.h-comfort-bar button { background: var(--h-cloud); border: 1px solid var(--h-line); }
.h-comfort-bar [data-h="reset-nudge"] { background: transparent; border-color: transparent; color: var(--h-accent); padding-inline: 4px; }
.h-comfort-bar button:disabled, .h-speak-box button:disabled { opacity: .55; cursor: default; }
.h-mode-capsule { display: inline-flex; flex-wrap: nowrap; gap: 2px; padding: 4px; background: var(--h-pill); border-radius: 999px; max-width: 100%; }
.h-mode-capsule button { color: var(--h-ink-2); font-size: 13px; }
.h-mode-capsule [aria-pressed="true"] { background: var(--h-orb-core); color: var(--h-orb-fg); }
.h-pick-cover, .h-reader-heading, .h-card-art, .h-profile-cover { position: relative; isolation: isolate; overflow: hidden; border-radius: 21px; margin: 0; }
.h-pick-cover { aspect-ratio: 16 / 9; }
.h-pick-cover img, .h-reader-heading img, .h-card-art img, .h-profile-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.h-card-art > span, .h-profile-cover > span, .h-pick-cover figcaption {
  position: absolute; bottom: 12px; left: 12px; color: #fff; background: rgba(20, 40, 56, .74); backdrop-filter: blur(8px);
}
.h-reader-layout, .h-pebble-flow.h-cards-layout { display: grid; grid-template-columns: minmax(260px, .9fr) minmax(0, 1.8fr); gap: 20px; align-items: start; }
.h-reader-layout > .h-cloud-panel, .h-cards-layout > .h-card-detail { padding: clamp(16px, 2vw, 24px); border-radius: 26px; }
.h-shelf-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin: 15px 0 18px; }
.h-shelf-filters .h-soft-chip { justify-content: center; }
.h-shelf-filters .h-soft-chip, .h-theme-filters .h-soft-chip { padding: 6px 12px; }
.h-shelf-filters [aria-pressed="true"], .h-theme-filters [aria-pressed="true"] { background: var(--h-orb-core); color: var(--h-orb-fg); }
.h-recommended { color: var(--h-ok); background: var(--h-ok-soft); border-radius: 999px; padding: 2px 6px; font-size: 10px; }
.h-reader-list { display: grid; gap: 8px; }
.h-shelf-panel:only-child { grid-column: 1 / -1; }
.h-shelf-panel:only-child .h-reader-list { grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); }
.h-story-card { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px; border: 1px solid var(--h-line); border-radius: 16px; }
.h-story-card img { width: 72px; height: 54px; flex: none; border-radius: 10px; object-fit: cover; }
.h-story-copy { display: grid; min-width: 0; gap: 2px; }
.h-story-copy strong { color: var(--h-ink-1); font-size: 15px; }
.h-story-copy span, .h-story-copy small { color: var(--h-ink-2); font-size: 12px; }
.h-story-card[aria-pressed="true"] { border-color: var(--h-accent); background: var(--h-accent-soft); }
.h-story-done { font-weight: 700; margin-left: auto; padding: 2px 6px; border-radius: 50%; color: var(--h-ok); background: var(--h-ok-soft); }
.h-reader-heading { display: grid; align-items: end; min-height: clamp(156px, 15vw, 210px); padding: 20px; color: white; }
.h-reader-heading::after { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(0deg, #102437f5, #10243785 58%, transparent); }
.h-reader-heading h2 { font: 600 clamp(25px, 3vw, 38px)/1.12 Georgia, "Times New Roman", serif; margin: 5px 0; color: inherit; }
.h-reader-heading span { font-size: 12px; }
.h-reader-heading p { font-size: 15px; color: #fff; }
.h-audio-tools { border-radius: 22px; background: var(--h-canvas-mid); padding: 6px; margin: 12px 0 18px; }
.h-audio-tools .h-btn-solid { min-height: 36px; }
.h-audio-tools .h-mini-pill { background: transparent; }
.h-audio-tools [aria-pressed="true"] { background: var(--h-accent-soft); color: var(--h-accent); }
.h-reader-lines { display: grid; list-style: none; gap: 8px; margin: 0; padding: 0; }
.h-reader-intro { display: flex; align-items: flex-start; gap: 12px; margin: 16px 0; }
.h-reader-intro img { flex: none; border-radius: 50%; object-fit: cover; object-position: top; background: var(--h-accent-soft); }
.h-reader-intro > div { border-radius: 4px 18px 18px; padding: 12px 16px; background: var(--h-canvas-mid); }
.h-reader-intro p { margin: 4px 0 8px; line-height: 1.5; }
.h-reader-intro p[lang="en"] { color: var(--h-ink-2); }
.h-reader-lines li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 12px; border-radius: 17px; background: var(--h-canvas-mid); line-height: 1.6; }
.h-reader-lines button[aria-pressed="true"], .h-reader-choice button[aria-pressed="true"] { background: var(--h-accent-soft); color: var(--h-accent); box-shadow: inset 0 0 0 1px currentColor; }
.h-shadow-compare { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; }
.h-shadow-compare label { display: grid; flex: 1; gap: 3px; min-width: 0; color: var(--h-ink-2); font-size: 12px; }
.h-shadow-compare audio { width: 100%; height: 36px; }
.h-supply-modes { flex-wrap: wrap; border-radius: 20px; }
.h-supply-modes button { white-space: nowrap; }
.h-pick-copy > p + .h-supply-modes { margin-top: 10px; }
@media (max-width: 600px) {
  .h-pick-hero:has([data-supply="ear"][aria-pressed="true"]) .h-pick-cover { aspect-ratio: 3 / 1; }
}
.h-ear-room { display: grid; gap: 16px; padding: clamp(16px, 3vw, 32px); }
.h-ear-room .h-theme-filters { margin: 0; }
.h-ear-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.h-ear-heading h2, .h-ear-result p, .h-spoken-feedback p { margin: 0; }
.h-ear-heading nav, .h-ear-shadow label { color: var(--h-ink-2); font-size: 13px; }
.h-ear-quiz { min-width: 0; margin: 0; padding: 14px 18px 18px; border: 1px solid var(--h-line); border-radius: 18px; }
.h-ear-quiz legend { padding-inline: 5px; font-weight: 650; }
.h-ear-quiz p { margin: 0 0 14px; font-size: clamp(18px, 2vw, 24px); line-height: 1.5; }
.h-ear-quiz [aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--h-accent); }
.h-ear-room button:disabled { opacity: .55; cursor: default; }
.h-ear-result, .h-ear-shadow, .h-spoken-feedback { display: grid; gap: 7px; justify-items: start; }
.h-ear-result:not(:empty), .h-spoken-feedback:not(:empty) { padding: 12px 16px; border-radius: 16px; background: var(--h-accent-soft); }
.h-spoken-feedback { grid-column: 1 / -1; }
.h-spoken-feedback:empty, .h-ear-result:empty { display: none; }
.h-ear-shadow label { display: grid; gap: 4px; width: min(100%, 30rem); }
.h-ear-shadow audio { width: 100%; }
.h-reader-choice { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
.h-reader-choice legend { font-weight: 600; margin-bottom: 6px; }
.h-reader-choice button { margin: 2px 6px 2px 0; }
.h-reader-lines li:has([data-playing]), .h-reader-lines li:focus-within { background: var(--h-accent-soft); }
@media (hover: hover) {
  .h-reader-lines li:hover, .h-story-card:hover { background: var(--h-accent-soft); }
  .h-comfort-bar button:enabled:hover, .h-theme-filters button:hover { box-shadow: inset 0 0 0 1px var(--h-accent); }
}
.h-line-play { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--h-cloud); color: var(--h-accent); font-size: 13px; }
.h-line-play[data-speech-label] { font-size: 0; }
.h-line-play[data-speech-label]::after { content: "…"; font-size: 18px; }
.h-line-play[data-playing]::after { content: "♫"; }
.h-reader-lines small, .h-speak-box small { display: block; color: var(--h-ink-2); font-size: 13px; margin-top: 3px; }
.h-reader-canvas h3 { margin: 24px 0 10px; font-size: 17px; }
.h-word-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
.h-word-cards > div { padding: 14px; border-radius: 18px; background: linear-gradient(135deg, var(--h-accent-soft), var(--h-canvas-mid)); }
.h-word-cards > div:nth-child(even) { background: linear-gradient(135deg, var(--h-due-soft), var(--h-canvas-mid)); }
.h-word-play { border-radius: 999px; background: var(--h-cloud); color: var(--h-accent); font-weight: 700; padding: 6px 10px; }
.h-word-cards > div:nth-child(even) .h-word-play { color: var(--h-due); }
.h-word-cards button:disabled { color: var(--h-ok); }
.h-word-cards dd { margin: 8px 0 0; font-size: 13px; color: var(--h-ink-2); line-height: 1.65; }
.h-speak-box { margin-top: 22px; padding: 18px; border-radius: 20px; background: linear-gradient(125deg, var(--h-ok-soft), var(--h-canvas-mid) 80%); }
.h-speak-box h3 { margin: 0 0 10px; }
.h-speak-box .h-textarea { margin-top: 8px; background: var(--h-cloud); }
.h-speak-box audio, #tour-modal audio { width: 100%; margin: 8px 0; }
.h-speak-box [data-h="reader-done"] { margin-top: 6px; }
.h-reader-demo { margin: 12px 0; }
.h-actions { margin: 12px 0; }
.h-dialog .h-actions, .h-tour-stages { justify-content: center; }
.h-tour-stages { margin-top: 12px; font-size: 13px; }
.h-dialog .h-actions button { padding: 9px 14px; border: 1px solid var(--h-line); border-radius: 16px; color: var(--h-ink-1); background: var(--h-cloud); }
.h-actions button:disabled { opacity: .55; }
.h-dialog textarea { margin-top: 8px; }
.h-welcome { text-align: center; margin: 12px auto; }
.h-theme-filters { margin: 0 0 16px; }
#h-card-search { margin-inline-start: auto; min-width: 0; max-width: 100%; padding: 9px 14px; border: 1px solid var(--h-line); border-radius: 18px; background: var(--h-cloud); color: var(--h-ink-1); font: inherit; }
.h-listen-quiz, .h-phrase-compare { margin: 16px 0; padding: 16px; border-radius: 18px; }
.h-listen-quiz { background: var(--h-accent-soft); }
.h-listen-quiz h3, .h-phrase-compare h3 { margin: 4px 0 12px; font-size: 17px; }
.h-listen-quiz fieldset { display: grid; gap: 6px; margin: 12px 0 0; padding: 0; border: 0; }
.h-listen-quiz legend { padding: 0 0 6px; }
.h-listen-quiz fieldset button { padding: 9px 12px; border: 1px solid var(--h-line); border-radius: 12px; text-align: left; background: var(--h-cloud); color: var(--h-ink-1); font: inherit; }
.h-listen-quiz button.is-correct { color: var(--h-ok); background: var(--h-ok-soft); border-color: var(--h-ok); opacity: 1; }
.h-listen-quiz button.is-missed { color: var(--h-due); background: var(--h-due-soft); opacity: 1; }
.h-listen-quiz [role="status"]:not(:empty) { margin-top: 12px; }
.h-phrase-compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 8px; padding: 0; }
.h-phrase-compare h3 { grid-column: 1 / -1; margin-bottom: 0; }
.h-phrase-compare > div { padding: 14px; border-radius: 16px; background: var(--h-pill); }
.h-phrase-compare > div:last-child { background: var(--h-ok-soft); }
.h-phrase-compare p { margin: 5px 0 8px; overflow-wrap: anywhere; }
.h-phrase-compare s { color: var(--h-ink-2); text-decoration-color: var(--h-due); }
.h-card-list { max-height: 610px; overflow-y: auto; padding: 3px; }
.h-card-art { height: clamp(100px, 12vw, 158px); margin-bottom: 16px; }
.h-cloud-panel.h-profile { grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); }
.h-profile-cover { min-height: 180px; align-self: stretch; }
.portal #app .h-profile h1 { margin-top: 0; }
.h-profile-goal { justify-content: space-between; margin: 10px 0; font-size: 14px; }
.h-meters { display: grid; gap: 12px; margin: 18px 0; }
.h-meter { display: grid; grid-template-columns: auto minmax(30px, 1fr) auto; align-items: center; gap: 12px; font-size: 13px; }
.h-meter > span { color: var(--h-ink-2); }
.h-meter-track { height: 8px; border-radius: 999px; background: var(--h-pill); overflow: hidden; }
.h-meter-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #83bab6, #397e82); }
.h-meter:nth-child(2) .h-meter-fill { background: linear-gradient(90deg, #91b5e0, #507ab5); }
.h-meter:nth-child(3) .h-meter-fill { background: linear-gradient(90deg, #e6bd8b, #b67c43); }
.h-profile-link { color: var(--h-accent); font-size: 14px; font-weight: 650; text-underline-offset: 3px; }
.h-finished { margin: 22px 0; }
.h-finished ul { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 10px 0 0; padding: 0; }
.h-finished li { display: flex; gap: 8px; align-items: center; padding-right: 12px; font-size: 13px; background: var(--h-cloud); border-radius: 10px; overflow: hidden; }
.h-finished img { object-fit: cover; }
@media (max-width: 760px) {
  body:has(.h-pick-hero, .h-profile) .h-pet-bubble:not(:has(.h-pet-actions)) { display: none; }
  .h-pick-hero, .h-reader-layout, .h-cloud-panel.h-profile, .h-pebble-flow.h-cards-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .h-profile-cover { min-height: 100px; }
  .h-card-list { max-height: 252px; }
}
@media (max-width: 400px) {
  .h-word-cards { grid-template-columns: minmax(0, 1fr); }
  .h-mode-capsule button { padding-inline: 9px; font-size: 12px; }
}

.h-sub-hero { text-align: center; max-width: 660px; margin: 8px auto 24px; }
.h-sub-hero h1 { margin: 0 0 8px; font-size: 27px; font-weight: 600; color: var(--h-ink-1); }
.h-sub-hero p { margin: 0; color: var(--h-ink-2); }

.h-pebble-flow {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 24px;
  align-items: start;
}
.h-pebble-stack { display: grid; gap: 12px; }
.h-pebble-card {
  background: var(--h-cloud);
  box-shadow: var(--h-shadow);
  border: 0;
  border-radius: 26px;
  padding: 18px 22px;
  text-align: left;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  color: var(--h-ink-1);
}
.h-pebble-card.selected { outline: 2px solid var(--h-accent); }
.h-cloud-panel {
  background: var(--h-cloud);
  box-shadow: var(--h-shadow);
  border-radius: 32px;
  padding: 24px 26px;
  min-width: 0;
}
.h-banner {
  background: var(--h-cloud);
  box-shadow: var(--h-shadow);
  border-radius: 34px;
  padding: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 22px;
  align-items: center;
  margin-bottom: 24px;
}
.h-art { border-radius: 24px; overflow: hidden; aspect-ratio: 16 / 9; }
.h-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.h-bento {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.h-play-card {
  background: var(--h-cloud);
  box-shadow: var(--h-shadow);
  border-radius: 26px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  text-decoration: none;
  color: var(--h-ink-1);
  min-width: 0;
}
.h-btn-solid, .h-btn-soft {
  min-height: 42px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}
.h-btn-solid { background: var(--h-orb-core); color: var(--h-orb-fg); }
.h-btn-soft { background: var(--h-pill); color: var(--h-ink-1); }
.h-textarea {
  width: 100%;
  min-height: 74px;
  border-radius: 20px;
  border: 1px solid var(--h-line);
  padding: 12px 16px;
  background: var(--h-canvas-mid);
  color: var(--h-ink-1);
  font: inherit;
  resize: vertical;
}

/* Cross-Page Floating Desk-Pet */
.h-desk-pet {
  position: fixed;
  right: 22px;
  bottom: 18px;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}
.h-desk-pet[hidden] { display: none; }
.h-pet-bubble {
  pointer-events: auto;
  max-width: 276px;
  background: var(--h-cloud);
  box-shadow: var(--h-shadow);
  border-radius: 24px 24px 6px 24px;
  padding: 14px 16px;
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--h-ink-1);
}
.h-pet-bubble p { margin: 0; line-height: 1.5; }
.h-pet-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.h-pet-btn {
  pointer-events: auto;
  position: relative;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  animation: hFloat 4s ease-in-out infinite;
}
.h-pet-btn img { height: 140px; width: auto; filter: var(--h-pet-shadow); display: block; }
.h-pet-badge {
  position: absolute;
  bottom: 8px;
  right: 2px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--h-accent);
  color: #FFFFFF;
  display: grid;
  place-items: center;
  box-shadow: var(--h-shadow);
}

/* Onboarding & Low-Key Settings Modals */
.h-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  padding: 18px;
}
.h-backdrop[hidden] { display: none; }
.h-backdrop::backdrop { background: rgb(8 20 29 / 66%); }
.h-dialog {
  max-width: 580px;
  width: 100%;
  max-height: min(88vh, 740px);
  overflow-y: auto;
  background: var(--h-cloud);
  color: var(--h-ink-1);
  border-radius: 34px;
  padding: 28px;
  box-shadow: var(--h-shadow);
}
.h-roster-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.h-roster-card {
  background: var(--h-pill);
  border: 0;
  border-radius: 22px;
  padding: 14px 10px;
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 6px;
  cursor: pointer;
  color: var(--h-ink-1);
}
.h-roster-card[aria-pressed="true"] {
  background: var(--h-accent-soft);
  outline: 2px solid var(--h-accent);
}
.h-roster-card img { height: 112px; width: auto; filter: var(--h-pet-shadow); }
.h-voices { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--h-line); }
.h-voices h3 { font-size: 15px; margin: 0 0 10px; }
.h-voice-row { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.h-voice-choice {
  flex: 1; min-width: 0; min-height: 44px; padding: 8px 12px;
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px;
  text-align: left; border: 1px solid transparent; border-radius: 12px;
  background: var(--h-pill); color: var(--h-ink-1); cursor: pointer;
}
.h-voice-choice[aria-pressed="true"] { border-color: var(--h-accent); background: var(--h-accent-soft); }
.h-voice-choice[aria-pressed="true"]::after { content: "✓"; color: var(--h-accent); margin-left: auto; }
.h-voice-choice span, .h-voices p { font-size: 12px; color: var(--h-ink-2); }
.h-voice-row .h-mini-pill { min-height: 44px; flex-shrink: 0; }
.h-roster-card.coming-soon {
  border: 1.5px dashed var(--h-line);
  background: transparent;
  color: var(--h-ink-3);
  cursor: default;
  align-content: center;
  min-height: 176px;
}
.h-goal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.h-goal-opt {
  background: var(--h-pill);
  border: 0;
  border-radius: 20px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  cursor: pointer;
  color: var(--h-ink-1);
}
.h-goal-opt[aria-checked="true"] {
  background: var(--h-accent-soft);
  outline: 2px solid var(--h-accent);
}
.h-goal-opt strong { font-size: 14px; display: flex; justify-content: space-between; gap: 6px; }
.h-goal-opt span { font-size: 12px; color: var(--h-ink-2); }

/* Mobile Dock */
.h-mobile-dock { display: none; }
@media (max-width: 880px) {
  body.harbor-mode .workspace { padding: 12px 14px 156px; }
  body.harbor-mode #primary-nav { display: none; }
  .h-stage, .h-pebble-flow, .h-banner, .h-bento, .h-journey-arc { grid-template-columns: minmax(0, 1fr); }
  .h-journey-arc { border-radius: 26px; }
  .h-pedestal { min-height: 310px; }
  .h-figure-img { height: 276px; }
  .h-orbit-2, .h-orbit-3 { display: none; }
  .h-mobile-dock {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 10px;
    z-index: 35;
    background: var(--h-cloud);
    box-shadow: var(--h-shadow);
    border-radius: 999px;
    padding: 6px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
  }
  .h-mobile-dock a {
    min-height: 40px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--h-ink-2);
    text-decoration: none;
  }
  .h-mobile-dock a[aria-current="page"] {
    background: var(--h-orb-core);
    color: var(--h-orb-fg);
  }
  .h-desk-pet { bottom: 68px; right: 10px; }
  .h-pet-btn img { height: 102px; }
}
@media (max-width: 600px) {
  .h-roster-grid, .h-goal-grid { grid-template-columns: minmax(0, 1fr); }
}

.h-reader-lines label[for] { cursor: pointer; }
.h-reader-lines > li { transition: background-color .2s ease; scroll-margin-block: 5rem; }
.h-reader-lines > li.is-reading-active { background: color-mix(in srgb, #78c9be 20%, var(--h-panel, transparent)); }
.h-audio-tools, .h-story-check .h-actions, .h-flash-review .h-actions { flex-wrap: wrap; }
.h-audio-tools .h-story-speed { margin: 0; }
.h-story-check, .h-flash-review { min-width: 0; overflow-wrap: anywhere; }
.h-story-check { margin-block: 1.25rem; padding-block: .75rem; border-block: 1px solid var(--h-line); }
.h-story-check fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.h-story-check legend, .h-flash-review details { margin-block: .75rem; }
.h-story-check [role="status"]:not(:empty) { margin-top: .75rem; color: var(--h-ink-2); }
.h-flash-review { padding: 1.25rem; }
.h-flash-review summary { cursor: pointer; color: var(--h-ink-2); }
.h-flash-review h3, .h-story-check h3 { margin-top: 0; }
@media (prefers-reduced-motion: reduce) { .h-reader-lines > li { transition: none; } }

.h-reader-lines .h-duet-line { grid-template-columns: minmax(0, 1fr); padding: 14px 16px; gap: 4px; }
.h-duet-line[aria-current="step"] { box-shadow: inset 3px 0 var(--h-accent); }
.h-duet-turn, .h-duet-finish { padding-block: 10px; color: var(--h-ink-1); }
.h-duet-turn .h-actions { margin-top: 8px; }
.h-reader-lines li > audio { grid-column: 1 / -1; width: 100%; min-width: 0; height: 36px; }
.h-duet-finish { padding: 18px; border: 1px solid var(--h-line); border-radius: 15px; background: var(--h-accent-soft); }
.h-duet-finish p, .h-archive p { color: var(--h-ink-2); line-height: 1.65; }
.h-postcard {
  display: grid; grid-template-columns: minmax(150px, 30%) minmax(0, 1fr);
  align-items: center; gap: clamp(18px, 4vw, 44px); padding: clamp(16px, 3vw, 30px);
  margin-bottom: 22px; background: var(--h-cloud); border: 1px solid var(--h-line); border-radius: 22px;
}
.h-postcard img { width: 100%; height: 148px; object-fit: cover; border: 5px solid var(--h-canvas-mid); border-radius: 7px; transform: rotate(-2deg); }
.h-postcard h2 { margin: 5px 0 12px; font: 600 clamp(21px, 3vw, 30px)/1.25 Georgia, "Songti SC", SimSun, serif; }
.h-postcard small, .h-postcard strong { color: var(--h-accent); }
.h-postcard p { margin: 4px 0; line-height: 1.7; color: var(--h-ink-2); }
.h-archive { margin-block: 22px; padding: 18px 4px; border-top: 1px solid var(--h-line); }
.h-archive h2 { font-size: 18px; margin: 0; }
.h-archive p:empty { display: none; }
@media (max-width: 600px) {
  .h-postcard { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .h-postcard img { height: 110px; transform: none; }
}
.h-mission-tabs, .h-mission-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
}
.h-mission-tabs [aria-pressed="true"] {
  color: var(--h-ok);
  background: var(--h-ok-soft);
  border-color: currentColor;
}
.h-mission-tabs { grid-column: 1 / -1; margin-top: 0; }
#dual-stage audio { width: 100%; }
#dual-stage label { display: block; margin: 10px 0 6px; }
#h-card-search { min-width: min(100%, 220px); }
.h-vocab-drawer {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--h-line);
}
.h-vocab-drawer summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--h-ink-1);
}
.h-vocab-drawer-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 10px;
}
.h-vocab-drawer-list li {
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--h-pill);
  display: grid;
  gap: 6px;
}
.h-vocab-drawer-list p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--h-ink-2);
}
.h-custom-phrase {
  display: grid;
  gap: 8px;
}
.h-custom-phrase h3 { margin: 0; font-size: 17px; }
.h-custom-phrase > p { margin: 0; font-size: 13px; color: var(--h-ink-2); }
.h-custom-phrase label { font-size: 12px; color: var(--h-ink-2); margin-top: 4px; }
.h-custom-phrase .h-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--h-line);
  border-radius: 14px;
  background: var(--h-bg);
  color: var(--h-ink-1);
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
}
.h-custom-phrase .h-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
#custom-phrase-status:empty { display: none; }
#custom-phrase-status { margin: 0; font-size: 13px; color: var(--h-ok); }
.h-sideline-cheer {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
  padding: 18px 20px;
}
.h-sideline-cheer img {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--h-pill);
}
.h-sideline-cheer p { margin: 6px 0 10px; font-size: 14px; color: var(--h-ink-2); }
.h-sideline-cheer .h-actions { display: flex; flex-wrap: wrap; gap: 8px; }

body.harbor-mode :is(button, a, input, textarea, summary):focus-visible {
  outline: 3px solid var(--h-accent);
  outline-offset: 2px;
}
[data-mode="night"] body.harbor-mode {
  color-scheme: dark;
  background-color: var(--h-canvas-outer);
  --green: var(--h-accent);
  --portal-border: var(--h-line);
}
[data-mode="night"] .harbor-mode .preview-note { color: var(--h-ink-3); }
[data-mode="night"] .h-story-card:not([aria-pressed="true"]) { background: var(--h-canvas-mid); }
[data-mode="night"] .h-reader-lines > li.is-reading-active {
  background: var(--h-accent-soft);
  box-shadow: inset 3px 0 var(--h-accent);
}
[data-mode="night"] :is(.h-cabin-cover, .h-ear-quiz) { background: var(--h-canvas-mid); }
[data-mode="night"] :is(.h-reader-canvas, .h-cabin, .h-postcard, .h-flash-review, .h-ear-room) {
  border: 1px solid var(--h-line);
}
[data-mode="night"] :is(.h-dot, .h-send-circle, .h-pet-badge) { color: var(--h-orb-fg); }
@media (pointer: coarse) {
  body.harbor-mode :is(.h-mini-pill, .h-line-play, [data-ear-listen], [data-h-speak]) { min-height: 44px; }
  body.harbor-mode .h-line-play { min-width: 44px; }
}

.h-supply-modes { margin: 0 0 1rem; max-width: 100%; }
.h-venue-tabs { display: flex; flex-wrap: wrap; gap: .65rem; margin: 1rem 0; }
.h-venue-tabs button { flex: 1 1 12rem; padding: .85rem; }
.h-legacy-vault { margin-top: 2rem; padding: 1rem; background: var(--h-cloud); border-radius: 1rem; }
.h-legacy-vault > summary { cursor: pointer; padding: .5rem; font-weight: 650; }
.h-legacy-vault[open] > summary { margin-bottom: 1rem; }
.h-reader-lines .h-spoken-feedback { grid-column: 1 / -1; min-width: 0; }
[data-roam-room] { min-width: 0; }
[data-roam-room], .system-courses .h-card-detail { scroll-margin-top: 5rem; }
[data-mode="night"] .mr {
  --ink: var(--h-ink-1); --line: var(--h-line); --teal: #205f59;
  color: var(--ink); background: var(--h-cloud); border-radius: 1rem;
}
[data-mode="night"] .mr :is(.mr-panel, button, select, input) { color: var(--ink); background: var(--h-pill); }
[data-mode="night"] .mr :is(button[aria-pressed=true], .mr-play) { color: #fff; background: var(--teal); }
[data-mode="night"] .mr :is(.mr-time, li, [data-feedback], [data-messages]) { color: var(--h-ink-2); }
[data-mode="night"] .mr li[aria-current=true] { color: var(--ink); background: var(--h-accent-soft); }
[data-mode="night"] .mr .mr-lane { background: linear-gradient(#213d48, #294b51); }

