:root {
  color-scheme: light;
  --ink: #172126;
  --muted: #637078;
  --line: #d7dedb;
  --paper: #fffdfa;
  --surface: #f6f3ed;
  --surface-2: #eaf1ef;
  --teal: #235c62;
  --teal-dark: #17454a;
  --copper: #a65f3f;
  --gold: #caa65a;
  --green: #506f49;
  --shadow: 0 18px 45px rgba(23, 33, 38, 0.12);
  font-family: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 18%, rgba(202, 166, 90, 0.16), transparent 24rem),
    linear-gradient(135deg, #f7f1e8 0%, #edf4f2 48%, #f5efe6 100%);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

#app {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 56px;
}

.app-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 6px 0 28px;
}

.brand-block {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--copper);
  font-size: 13px;
  font-weight: 700;
}

.app-header .eyebrow {
  display: none;
}

body[data-page-kind="test"] .app-header .eyebrow {
  display: block;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  color: var(--teal);
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.02;
  letter-spacing: 0;
}

.tagline {
  margin-bottom: 0;
  color: var(--copper);
  font-size: clamp(16px, 2vw, 22px);
  font-weight: 700;
  line-height: 1.4;
}

h2 {
  margin-bottom: 8px;
  font-size: 28px;
  letter-spacing: 0;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.section-heading p {
  margin-bottom: 0;
  color: var(--muted);
}

.inline-action {
  flex: 0 0 auto;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -10px 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.breadcrumbs a,
.seo-related a {
  color: var(--teal);
  font-weight: 800;
  text-decoration: none;
}

.breadcrumbs a:hover,
.seo-related a:hover {
  text-decoration: underline;
}

.test-overview {
  margin: 0 0 24px;
  padding: 18px 0;
  border-top: 1px solid rgba(35, 92, 98, 0.18);
  border-bottom: 1px solid rgba(35, 92, 98, 0.18);
}

.test-overview h2 {
  margin-bottom: 10px;
  font-size: 22px;
}

.test-overview p {
  max-width: 850px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.test-overview p:last-child {
  margin-bottom: 0;
}

.seo-detail {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid rgba(35, 92, 98, 0.2);
}

#seoDetailSections {
  display: grid;
  gap: 32px;
}

.seo-detail-section h2,
.seo-faq h2,
.seo-related h2 {
  margin-bottom: 12px;
  font-size: 22px;
  line-height: 1.35;
}

.seo-detail-section p,
.seo-faq p {
  max-width: 880px;
  margin-bottom: 10px;
  color: #48585e;
  font-size: 15px;
  line-height: 1.8;
}

.seo-detail-section ul {
  display: grid;
  gap: 8px;
  max-width: 880px;
  margin: 14px 0 0;
  padding-left: 22px;
  color: #48585e;
  font-size: 15px;
  line-height: 1.7;
}

.seo-detail-section li::marker {
  color: var(--copper);
}

.seo-faq,
.seo-related {
  margin-top: 36px;
}

.seo-faq details {
  max-width: 880px;
  border-bottom: 1px solid rgba(35, 92, 98, 0.16);
}

.seo-faq summary {
  padding: 14px 28px 14px 0;
  color: var(--ink);
  cursor: pointer;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.5;
}

.seo-faq details p {
  padding: 0 0 14px;
}

#seoRelatedLinks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
}

.seo-related a::after {
  margin-left: 5px;
  content: "›";
}

.hidden {
  display: none !important;
}

.test-list {
  display: grid;
  gap: 14px;
}

.promise-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.promise-list li {
  position: relative;
  min-height: 42px;
  padding: 11px 12px 11px 34px;
  border: 1px solid rgba(35, 92, 98, 0.16);
  border-radius: 8px;
  color: #48585e;
  background: rgba(255, 253, 250, 0.64);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.42;
}

.promise-list li::before {
  position: absolute;
  top: 13px;
  left: 13px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(202, 166, 90, 0.14);
  content: "";
}

.test-card {
  display: grid;
  grid-template-columns: 64px 1fr 28px;
  align-items: center;
  width: 100%;
  min-height: 132px;
  padding: 24px;
  border: 1px solid rgba(35, 92, 98, 0.22);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 253, 250, 0.9);
  box-shadow: var(--shadow);
  text-align: left;
  text-decoration: none;
}

.test-card:hover {
  border-color: rgba(35, 92, 98, 0.55);
}

.featured-test {
  border-left: 4px solid var(--gold);
  background: #fffefb;
}

.test-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: conic-gradient(from 180deg, var(--teal), var(--green), var(--gold), var(--copper), var(--teal));
  font-size: 24px;
  font-weight: 800;
}

.mbti-mark {
  background: conic-gradient(from 150deg, #235c62, #6f8f7a, #caa65a, #a65f3f, #235c62);
  font-size: 16px;
  letter-spacing: 0;
}

.big-five-mark {
  background: conic-gradient(from 140deg, #7f5960, #a65f3f, #c59a45, #5f7865, #235c62, #7f5960);
  font-size: 16px;
  letter-spacing: 0;
}

.big-five-full-mark {
  background: conic-gradient(from 140deg, #235c62, #c59a45, #7f5960, #5f7865, #a65f3f, #235c62);
  font-size: 13px;
  letter-spacing: 0;
}

.bazi-mark {
  background: conic-gradient(from 160deg, #18282d, var(--teal), var(--copper), #5d4535, #18282d);
}

.deep-bazi-mark {
  background: conic-gradient(from 160deg, #0f1a1d, #235c62, #9b5b35, #caa65a, #0f1a1d);
}

.async-bazi-mark {
  background: conic-gradient(from 150deg, #47726b, #caa65a, #a65f3f, #6f8f7a, #47726b);
}

.test-copy {
  min-width: 0;
}

.test-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 23px;
}

.test-card small {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.test-arrow {
  color: var(--teal);
  font-size: 42px;
  line-height: 1;
}

.mbti-heading {
  align-items: center;
}

.mbti-heading .eyebrow {
  margin-bottom: 7px;
}

.local-only-note {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(70, 107, 80, 0.2);
  border-radius: 6px;
  color: #42644d;
  background: #eef6ef;
  font-size: 13px;
  font-weight: 800;
}

.mbti-panel {
  display: grid;
  gap: 18px;
}

.mbti-progress-row {
  display: grid;
  grid-template-columns: minmax(180px, auto) minmax(220px, 1fr);
  align-items: center;
  gap: 24px;
  padding: 16px 18px;
  border: 1px solid rgba(35, 92, 98, 0.18);
  border-radius: 6px;
  background: rgba(255, 253, 250, 0.96);
}

.mbti-progress-row > div {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.mbti-progress-row strong {
  color: var(--teal);
  font-size: 17px;
}

.mbti-progress-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.mbti-progress-row progress {
  width: 100%;
  height: 12px;
  border: 0;
  border-radius: 6px;
  overflow: hidden;
  color: var(--teal);
  background: #e4ece9;
}

.mbti-progress-row progress::-webkit-progress-bar {
  border-radius: 6px;
  background: #e4ece9;
}

.mbti-progress-row progress::-webkit-progress-value {
  border-radius: 6px;
  background: var(--teal);
  transition: width 180ms ease;
}

.mbti-progress-row progress::-moz-progress-bar {
  border-radius: 6px;
  background: var(--teal);
}

.mbti-question-list {
  display: grid;
  gap: 12px;
}

.mbti-question {
  padding: 18px;
  border: 1px solid rgba(35, 92, 98, 0.18);
  border-radius: 6px;
  background: rgba(255, 253, 250, 0.94);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.mbti-question:focus-within {
  border-color: rgba(35, 92, 98, 0.48);
  box-shadow: 0 0 0 3px rgba(35, 92, 98, 0.08);
}

.mbti-question.is-missing {
  border-color: #c97867;
  box-shadow: 0 0 0 3px rgba(169, 75, 57, 0.09);
}

.mbti-question legend {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  margin-bottom: 15px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
}

.mbti-question legend span {
  display: inline-grid;
  flex: 0 0 34px;
  width: 34px;
  height: 28px;
  margin: 0;
  place-items: center;
  border-radius: 4px;
  color: var(--teal);
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 900;
}

.mbti-question legend strong {
  font-size: 16px;
}

.mbti-scale {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding-left: 46px;
}

.mbti-scale label {
  position: relative;
  cursor: pointer;
}

.mbti-scale input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.mbti-scale label span {
  display: grid;
  min-height: 46px;
  margin: 0;
  padding: 5px 7px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #526168;
  background: #fff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
}

.mbti-scale label:hover span {
  border-color: rgba(35, 92, 98, 0.45);
  background: #f6faf8;
}

.mbti-scale input:focus-visible + span {
  outline: 3px solid rgba(35, 92, 98, 0.16);
  outline-offset: 2px;
}

.mbti-scale input:checked + span {
  border-color: var(--teal);
  color: #fff;
  background: var(--teal);
}

.mbti-navigation {
  display: grid;
  grid-template-columns: minmax(120px, 0.35fr) minmax(180px, 0.65fr);
  gap: 12px;
}

.mbti-navigation button {
  width: 100%;
}

.mbti-validation {
  min-height: 22px;
  margin: -4px 0;
  color: #8a2d24;
  font-size: 14px;
  font-weight: 800;
}

.mbti-disclaimer {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.site-footer {
  display: grid;
  gap: 10px;
  margin-top: 34px;
  padding: 22px 0 0;
  border-top: 1px solid rgba(35, 92, 98, 0.14);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
}

.site-footer p {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 0;
}

.site-footer a,
.legal-page a,
.guide-page a,
.ghost-link {
  color: var(--teal);
  font-weight: 800;
  text-decoration: none;
}

.site-footer a:hover,
.legal-page a:hover,
.guide-page a:hover,
.ghost-link:hover {
  text-decoration: underline;
}

.legal-page {
  display: grid;
  gap: 16px;
}

.legal-page section {
  padding: 22px;
  border: 1px solid rgba(35, 92, 98, 0.18);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.9);
  box-shadow: 0 14px 36px rgba(23, 33, 38, 0.08);
}

.legal-page h2 {
  margin-bottom: 10px;
  font-size: 22px;
}

.legal-page p {
  margin-bottom: 10px;
  color: #425057;
  line-height: 1.8;
}

.legal-page p:last-child {
  margin-bottom: 0;
}

.guide-page {
  display: grid;
  width: min(900px, 100%);
  min-width: 0;
  gap: 0;
}

.guide-page > *,
.guide-section,
.comparison-wrap {
  min-width: 0;
  max-width: 100%;
}

.guide-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 9px;
  margin: -8px 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.guide-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.guide-intro {
  padding: 22px 0;
  border-top: 1px solid rgba(35, 92, 98, 0.2);
  border-bottom: 1px solid rgba(35, 92, 98, 0.2);
}

.guide-intro p,
.guide-section p,
.guide-section li,
.guide-cta p,
.ocean-map p,
.trait-continuum p,
.model-lens p,
.result-profile p {
  color: #425057;
  font-size: 16px;
  line-height: 1.85;
}

.guide-intro p,
.guide-section p {
  margin-bottom: 12px;
}

.guide-intro p:last-child,
.guide-section p:last-child {
  margin-bottom: 0;
}

.guide-section {
  padding: 34px 0;
  border-bottom: 1px solid rgba(35, 92, 98, 0.16);
}

.guide-section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.guide-section-heading > p,
.guide-section-heading > span {
  flex: 0 0 auto;
  margin: 0;
  color: var(--copper);
  font-size: 13px;
  font-weight: 900;
}

.guide-section-heading h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.35;
}

.guide-row-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  padding: 15px 0;
  border-top: 1px solid rgba(35, 92, 98, 0.14);
  border-bottom: 1px solid rgba(35, 92, 98, 0.14);
  text-decoration: none;
}

.guide-row-link strong {
  color: var(--ink);
  font-size: 18px;
}

.guide-row-link span {
  flex: 0 0 auto;
  color: var(--copper);
  font-size: 13px;
  font-weight: 900;
}

.ocean-map,
.trait-continuum,
.model-lens,
.result-profile {
  margin: 30px 0 0;
  padding: 24px 0;
  border-top: 1px solid rgba(35, 92, 98, 0.2);
  border-bottom: 1px solid rgba(35, 92, 98, 0.2);
}

.ocean-map figcaption,
.trait-continuum figcaption,
.model-lens figcaption,
.result-profile figcaption {
  margin-bottom: 18px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
}

.ocean-map-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.ocean-map-grid > div {
  display: grid;
  align-content: start;
  justify-items: start;
  min-height: 128px;
  padding: 14px;
  border: 1px solid rgba(35, 92, 98, 0.16);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.72);
}

.ocean-map-grid strong {
  margin: 12px 0 3px;
  font-size: 15px;
}

.ocean-map-grid small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.trait-symbol {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #fff;
  font-size: 15px;
  font-weight: 900;
}

.trait-o { background: #39737a; }
.trait-c { background: #a65f3f; }
.trait-e { background: #b08a37; }
.trait-a { background: #55744d; }
.trait-n { background: #80586a; }

.continuum-row {
  display: grid;
  grid-template-columns: 36px 112px minmax(120px, 1fr) minmax(90px, auto) minmax(90px, auto);
  align-items: center;
  gap: 10px;
  min-height: 58px;
}

.continuum-row strong {
  font-size: 15px;
}

.continuum-row small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.continuum-line {
  position: relative;
  display: block;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, #d8dedb, #6c918d);
}

.continuum-line::before,
.continuum-line::after,
.continuum-line i {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--teal);
  content: "";
  transform: translateY(-50%);
}

.continuum-line::before { left: 0; }
.continuum-line::after { right: 0; }
.continuum-line i { left: calc(50% - 5px); }

.comparison-wrap {
  overflow-x: auto;
  padding-bottom: 4px;
}

.comparison-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  background: rgba(255, 253, 250, 0.7);
}

.comparison-table th,
.comparison-table td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(35, 92, 98, 0.15);
  color: #425057;
  font-size: 14px;
  line-height: 1.55;
  text-align: left;
  vertical-align: top;
}

.comparison-table thead th {
  color: var(--ink);
  background: rgba(234, 241, 239, 0.72);
}

.comparison-table tbody th {
  width: 120px;
  color: var(--ink);
}

.model-lens-grid,
.tradeoff-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.model-lens-grid > section,
.tradeoff-grid > section {
  padding: 18px;
  border: 1px solid rgba(35, 92, 98, 0.16);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.72);
}

.lens-label {
  margin-bottom: 8px;
  color: var(--copper) !important;
  font-size: 12px !important;
  font-weight: 900;
}

.type-code {
  display: block;
  min-height: 42px;
  color: var(--teal);
  font-size: 34px;
}

.mini-bars {
  display: grid;
  gap: 5px;
  margin: 13px 0;
}

.mini-bars i {
  display: block;
  width: var(--value);
  height: 5px;
  border-radius: 3px;
  background: var(--teal);
}

.type-axes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin: 13px 0;
}

.type-axes span {
  padding: 5px 8px;
  border-left: 3px solid var(--copper);
  color: var(--muted);
  background: rgba(166, 95, 63, 0.07);
  font-size: 12px;
  font-weight: 800;
}

.decision-list,
.guide-sources ul {
  display: grid;
  gap: 9px;
  margin: 15px 0;
  padding-left: 22px;
}

.result-bar {
  display: grid;
  grid-template-columns: 150px minmax(120px, 1fr) 36px;
  align-items: center;
  gap: 12px;
  min-height: 52px;
}

.result-bar > span {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.result-bar .trait-symbol {
  width: 28px;
  height: 28px;
  font-size: 12px;
}

.result-bar > i {
  display: block;
  height: 10px;
  overflow: hidden;
  border-radius: 5px;
  background: #dce4e1;
}

.result-bar em {
  display: block;
  width: var(--value);
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.result-bar > strong {
  color: var(--teal);
  font-size: 15px;
  text-align: right;
}

.tradeoff-grid {
  margin: 16px 0;
}

.tradeoff-grid h3 {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 17px;
}

.tradeoff-grid p {
  margin: 0;
  font-size: 14px;
}

.reading-steps {
  display: grid;
  gap: 16px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.reading-steps li {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
}

.reading-steps li > span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--copper);
  border-radius: 50%;
  color: var(--copper);
  font-size: 13px;
  font-weight: 900;
}

.reading-steps strong {
  color: var(--ink);
}

.reading-steps p {
  margin: 3px 0 0;
  font-size: 14px;
}

.guide-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 36px;
  padding: 24px 0;
  border-top: 2px solid var(--teal);
  border-bottom: 2px solid var(--teal);
}

.guide-cta h2 {
  margin-bottom: 5px;
  font-size: 23px;
}

.guide-cta p {
  margin: 0;
  font-size: 14px;
}

.guide-cta-links {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.primary-link,
.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 900;
  text-decoration: none !important;
}

.primary-link {
  color: #fff !important;
  background: var(--teal);
}

.secondary-link {
  border: 1px solid rgba(35, 92, 98, 0.32);
  color: var(--teal) !important;
  background: rgba(255, 253, 250, 0.8);
}

.guide-next {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 28px;
}

.guide-next a {
  display: grid;
  gap: 4px;
  padding: 16px 0;
  border-top: 1px solid rgba(35, 92, 98, 0.18);
  border-bottom: 1px solid rgba(35, 92, 98, 0.18);
  text-decoration: none;
}

.guide-next span {
  color: var(--muted);
  font-size: 12px;
}

.guide-next strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
}

.input-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 24px;
  border: 1px solid rgba(35, 92, 98, 0.2);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.94);
  box-shadow: var(--shadow);
}

label,
fieldset {
  min-width: 0;
  width: 100%;
}

label span,
legend {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

input[type="date"],
input[type="time"],
input[type="text"],
input[type="email"],
input[type="number"] {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  -webkit-appearance: none;
  appearance: none;
  color: var(--ink);
  background: #fff;
  outline: none;
}

select,
textarea {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  -webkit-appearance: none;
  appearance: none;
  color: var(--ink);
  background: #fff;
  outline: none;
  font: inherit;
}

select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(35, 92, 98, 0.12);
}

input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(35, 92, 98, 0.12);
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.split-field {
  display: grid;
  gap: 8px;
}

.number-parts {
  display: grid;
  gap: 8px;
}

.date-parts {
  grid-template-columns: minmax(104px, 1.35fr) minmax(70px, 1fr) minmax(70px, 1fr);
}

.time-parts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 340px;
}

.number-part {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.number-part input[type="text"] {
  padding-inline: 8px;
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

.number-part span {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  height: 48px;
}

.segmented label {
  position: relative;
}

.segmented input {
  position: absolute;
  opacity: 0;
  inset: 0;
}

.segmented span {
  display: grid;
  height: 48px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
}

.segmented input:checked + span {
  border-color: var(--teal);
  color: #fff;
  background: var(--teal);
}

.wide,
.notice,
.primary-button {
  grid-column: 1 / -1;
}

.solar-time-field {
  display: grid;
  gap: 12px;
}

.toggle-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.toggle-row > span,
.toggle-row strong,
.toggle-row small {
  display: block;
  margin: 0;
}

.toggle-row strong {
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 14px;
}

.toggle-row small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.toggle-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-row i {
  position: relative;
  width: 46px;
  height: 26px;
  border-radius: 13px;
  background: #cbd5d2;
  transition: background 160ms ease;
}

.toggle-row i::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(23, 33, 38, 0.2);
  content: "";
  transition: transform 160ms ease;
}

.toggle-row input:checked + i {
  background: var(--teal);
}

.toggle-row input:checked + i::after {
  transform: translateX(20px);
}

.toggle-row:has(input:focus-visible) {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(35, 92, 98, 0.12);
}

.coordinate-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.geocoding-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.geocode-button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 12px;
}

.geocoding-row p {
  min-width: 0;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.geocoding-row p.is-error {
  color: #8a2d24;
}

.notice {
  margin: 0;
  padding: 12px 14px;
  border-left: 4px solid var(--gold);
  color: #5f5545;
  background: #fbf4df;
  font-size: 14px;
}

.async-submit-panel {
  grid-column: 1 / -1;
  padding: 16px;
  border: 1px solid rgba(35, 92, 98, 0.22);
  border-radius: 6px;
  color: #29484c;
  background: #edf5f2;
  line-height: 1.7;
}

.async-submit-panel strong,
.async-submit-panel span {
  display: block;
}

.async-submit-panel strong {
  margin-bottom: 4px;
  color: var(--teal);
}

.async-submit-panel span {
  font-size: 14px;
}

.async-submit-panel.is-error {
  border-color: #e5b7ad;
  color: #7c342b;
  background: #fff3ef;
}

.async-submit-panel.is-error strong {
  color: #8a2d24;
}

.primary-button,
.ghost-button {
  min-height: 48px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-weight: 800;
}

.primary-button {
  color: #fff;
  background: var(--teal);
}

.primary-button:hover {
  background: var(--teal-dark);
}

.primary-button:disabled,
.ghost-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.ghost-button:disabled {
  color: #7b9297;
  background: rgba(255, 253, 250, 0.42);
  border-color: rgba(99, 112, 120, 0.22);
}

.primary-button.compact {
  grid-column: auto;
  min-width: 120px;
  padding: 0 18px;
}

.ghost-button {
  min-width: 88px;
  padding: 0 16px;
  color: var(--teal);
  background: rgba(255, 253, 250, 0.7);
  border-color: rgba(35, 92, 98, 0.24);
}

.ghost-button.compact {
  min-width: 76px;
  min-height: 42px;
}

.ghost-link {
  display: grid;
  min-height: 48px;
  min-width: 96px;
  padding: 0 16px;
  place-items: center;
  border: 1px solid rgba(35, 92, 98, 0.24);
  border-radius: 6px;
  color: var(--teal);
  background: rgba(255, 253, 250, 0.7);
  font-weight: 800;
  text-decoration: none;
}

.text-button {
  min-height: 42px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}

.text-button:hover {
  color: #8a2d24;
  background: #fff3ef;
}

.history-list {
  display: grid;
  gap: 12px;
}

.history-card {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(35, 92, 98, 0.2);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.92);
  box-shadow: var(--shadow);
}

.history-copy {
  min-width: 0;
}

.history-copy strong {
  display: block;
  margin-bottom: 6px;
  font-size: 19px;
}

.history-copy small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.history-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-status {
  display: inline-grid;
  min-height: 36px;
  padding: 0 12px;
  place-items: center;
  border: 1px solid rgba(35, 92, 98, 0.18);
  border-radius: 6px;
  color: var(--teal);
  background: #edf5f2;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.history-status.status-failed {
  border-color: #e5b7ad;
  color: #8a2d24;
  background: #fff3ef;
}

.history-status.status-sent {
  color: #42644d;
  background: #eef6ef;
}

.empty-panel {
  padding: 28px;
  border: 1px solid rgba(35, 92, 98, 0.18);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.94);
  box-shadow: var(--shadow);
}

.empty-panel strong {
  display: block;
  margin-bottom: 8px;
}

.empty-panel p {
  margin-bottom: 0;
  color: var(--muted);
}

.report-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.report-toolbar h2 {
  margin-bottom: 0;
}

.report-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

.report-meta {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.loading-panel,
.error-panel,
.report-paper {
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.loading-panel,
.error-panel {
  padding: 28px;
  border: 1px solid rgba(35, 92, 98, 0.18);
  background: rgba(255, 253, 250, 0.94);
}

.loading-panel {
  display: grid;
  justify-items: center;
  gap: 10px;
  min-height: 220px;
  text-align: center;
}

.loading-panel p {
  margin-bottom: 0;
  color: var(--muted);
}

.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(35, 92, 98, 0.18);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.error-panel {
  color: #8a2d24;
  background: #fff3ef;
  border-color: #e5b7ad;
}

.report-paper {
  padding: min(7vw, 54px);
  background: var(--paper);
}

.mind-card-panel {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid rgba(35, 92, 98, 0.18);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.94);
  box-shadow: var(--shadow);
}

.report-feedback-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.8fr);
  gap: 16px;
  margin-top: 18px;
  padding: 20px;
  border: 1px solid rgba(35, 92, 98, 0.18);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.94);
  box-shadow: var(--shadow);
}

.feedback-page {
  max-width: 760px;
  margin: 0 auto;
}

.report-feedback-panel > div:first-child,
.feedback-rating,
.report-feedback-panel .feedback-status {
  grid-column: 1 / -1;
}

.report-feedback-panel strong {
  display: block;
  margin-bottom: 6px;
  color: var(--teal);
  font-size: 18px;
}

.report-feedback-panel p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.feedback-rating {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.feedback-rating button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  font-weight: 800;
}

.feedback-rating button[aria-pressed="true"] {
  border-color: var(--teal);
  color: #fff;
  background: var(--teal);
}

.report-feedback-panel .feedback-status.is-error {
  color: #8a2d24;
}

.mind-card-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.mind-card-toolbar strong {
  display: block;
  margin-bottom: 6px;
}

.mind-card-toolbar p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.mind-card-preview {
  display: grid;
  place-items: center;
  padding: 18px;
  border-radius: 8px;
  background: var(--surface);
}

.mind-card-preview img {
  display: block;
  width: min(100%, 360px);
  height: auto;
  border-radius: 22px;
  box-shadow: 0 16px 38px rgba(23, 33, 38, 0.16);
}

.report-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.report-brand span {
  color: var(--teal);
  font-size: 20px;
  font-weight: 900;
}

.markdown-body {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.78;
  font-size: 16px;
}

.markdown-body h1 {
  margin: 0 0 22px;
  color: var(--teal);
  font-size: 38px;
  line-height: 1.18;
}

.markdown-body h2 {
  margin: 34px 0 12px;
  color: var(--teal);
  font-size: 25px;
}

.markdown-body h3 {
  margin: 26px 0 10px;
  color: #5d4535;
  font-size: 19px;
}

.markdown-body h4 {
  margin: 20px 0 8px;
  color: #315b5e;
  font-size: 16px;
  line-height: 1.45;
}

.markdown-body p,
.markdown-body ul,
.markdown-body ol,
.markdown-body blockquote,
.markdown-body hr,
.markdown-body table {
  margin-bottom: 16px;
}

.markdown-body hr {
  height: 1px;
  margin-top: 24px;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 1.4em;
}

.markdown-body code {
  padding: 2px 5px;
  border-radius: 4px;
  color: #315b5e;
  background: var(--surface-2);
}

.markdown-body pre {
  overflow: auto;
  padding: 16px 18px;
  border: 1px solid rgba(35, 92, 98, 0.16);
  border-radius: 8px;
  color: #2d4548;
  background: #f2f7f5;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.markdown-body pre code {
  display: block;
  padding: 0;
  color: inherit;
  background: transparent;
  font-size: 14px;
  line-height: 1.75;
  white-space: pre;
}

.markdown-body blockquote {
  margin-left: 0;
  padding: 12px 16px;
  border-left: 4px solid var(--teal);
  background: var(--surface);
}

.markdown-body table {
  display: block;
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  overflow-x: auto;
}

.markdown-body th,
.markdown-body td {
  padding: 10px 12px;
  border: 1px solid var(--line);
  vertical-align: top;
}

.markdown-body th {
  background: var(--surface-2);
  text-align: left;
}

.admin-app {
  max-width: 1180px;
}

.admin-header h1 {
  font-size: clamp(36px, 5vw, 58px);
}

.admin-token-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 14px;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid rgba(35, 92, 98, 0.2);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.94);
  box-shadow: var(--shadow);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.stat-card,
.stats-section {
  border: 1px solid rgba(35, 92, 98, 0.2);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.94);
  box-shadow: var(--shadow);
}

.stat-card {
  padding: 18px;
}

.stat-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.stat-card strong {
  color: var(--teal);
  font-size: 30px;
  line-height: 1;
}

.stats-section {
  margin-bottom: 18px;
  padding: 22px;
}

.stats-table-wrap {
  overflow-x: auto;
}

.admin-subtable + .admin-subtable,
.async-stats-summary + .admin-subtable {
  margin-top: 18px;
}

.stats-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.stats-table th,
.stats-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.stats-table th {
  color: var(--teal);
  font-size: 13px;
}

.async-stats-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.openai-key-status {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.openai-key-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #42644d;
}

.openai-key-status > div {
  min-width: 0;
}

.openai-key-status strong,
.openai-key-status span {
  display: block;
}

.openai-key-status strong {
  color: var(--ink);
  font-size: 14px;
}

.openai-key-status div span,
.openai-key-status small {
  color: var(--muted);
  font-size: 12px;
}

.openai-key-status small {
  white-space: nowrap;
}

.openai-key-status[data-mode="fallback"] .openai-key-indicator {
  background: var(--copper);
}

.openai-key-status[data-mode="unconfigured"] .openai-key-indicator {
  background: #8a2d24;
}

.async-stats-summary article {
  padding: 12px;
  border: 1px solid rgba(35, 92, 98, 0.14);
  border-radius: 6px;
  background: #fbfcfb;
}

.async-stats-summary span,
.async-stats-summary strong {
  display: block;
}

.async-stats-summary span {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.async-stats-summary strong {
  color: var(--teal);
  font-size: 17px;
}

.async-jobs-table {
  min-width: 1480px;
}

.admin-job-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.compact-action {
  min-height: 32px;
  padding: 0 8px;
  white-space: nowrap;
}

.muted-text {
  color: var(--muted);
}

.admin-job-status {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  color: var(--teal);
  background: #edf5f2;
  font-size: 12px;
  font-weight: 800;
}

.admin-job-status.status-failed {
  color: #8a2d24;
  background: #fff3ef;
}

.admin-job-status.status-cancelled {
  color: #6b6253;
  background: #f4f1eb;
}

.admin-job-status.status-bounced {
  color: #8a2d24;
  background: #fff0ea;
}

.admin-job-status.status-sent {
  color: #42644d;
  background: #eef6ef;
}

.daily-bars {
  display: grid;
  grid-template-columns: repeat(14, minmax(24px, 1fr));
  align-items: end;
  gap: 10px;
}

.active-streams {
  display: grid;
  gap: 10px;
}

.active-stream,
.empty-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(35, 92, 98, 0.14);
  border-radius: 6px;
  background: #fbfcfb;
}

.active-stream strong,
.active-stream span,
.active-stream small,
.empty-inline strong,
.empty-inline span {
  display: block;
}

.active-stream span,
.active-stream small,
.empty-inline span {
  color: var(--muted);
  font-size: 13px;
}

.daily-bar {
  display: grid;
  gap: 8px;
  justify-items: center;
  position: relative;
  outline: none;
}

.bar-stack {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: end;
  gap: 3px;
  width: 100%;
  height: 132px;
  padding: 8px 5px;
  border: 1px solid rgba(35, 92, 98, 0.14);
  border-radius: 6px;
  background: #fbfcfb;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.daily-bar:hover .bar-stack,
.daily-bar:focus-visible .bar-stack {
  border-color: rgba(35, 92, 98, 0.34);
  box-shadow: 0 12px 24px rgba(23, 33, 38, 0.12);
  transform: translateY(-2px);
}

.daily-bar::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 5;
  min-width: 112px;
  padding: 8px 10px;
  border: 1px solid rgba(35, 92, 98, 0.14);
  border-radius: 6px;
  background: rgba(251, 252, 251, 0.98);
  box-shadow: 0 14px 30px rgba(23, 33, 38, 0.16);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  transform: translate(-50%, 6px);
  transition: opacity 160ms ease, transform 160ms ease;
  white-space: pre-line;
}

.daily-bar::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  z-index: 6;
  width: 10px;
  height: 10px;
  border-right: 1px solid rgba(35, 92, 98, 0.14);
  border-bottom: 1px solid rgba(35, 92, 98, 0.14);
  background: rgba(251, 252, 251, 0.98);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 6px) rotate(45deg);
  transition: opacity 160ms ease, transform 160ms ease;
}

.daily-bar:hover::after,
.daily-bar:hover::before,
.daily-bar:focus-visible::after,
.daily-bar:focus-visible::before {
  opacity: 1;
}

.daily-bar:hover::after,
.daily-bar:focus-visible::after {
  transform: translate(-50%, 0);
}

.daily-bar:hover::before,
.daily-bar:focus-visible::before {
  transform: translate(-50%, 0) rotate(45deg);
}

.bar {
  display: block;
  min-height: 4px;
  border-radius: 4px 4px 2px 2px;
}

.bar.page {
  background: var(--teal);
}

.bar.report {
  background: var(--gold);
}

.bar.pdf {
  background: var(--copper);
}

.bar.mind-card {
  background: #6f8f7a;
}

.daily-bar small {
  color: var(--muted);
  font-size: 11px;
}

.recent-list {
  display: grid;
  gap: 12px;
}

.recent-day {
  border: 1px solid rgba(35, 92, 98, 0.14);
  border-radius: 8px;
  background: #fbfcfb;
  overflow: hidden;
}

.recent-day summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
  list-style: none;
}

.recent-day summary::-webkit-details-marker {
  display: none;
}

.recent-day summary::before {
  content: "›";
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: var(--teal);
  font-size: 20px;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 160ms ease;
}

.recent-day[open] summary::before {
  transform: rotate(90deg);
}

.recent-day summary span {
  flex: 1;
}

.recent-day summary small {
  color: var(--muted);
  font-size: 13px;
}

.recent-day-events {
  padding: 0 14px;
  border-top: 1px solid var(--line);
}

.recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.recent-item:last-child {
  border-bottom: 0;
}

.recent-item strong,
.recent-item span,
.recent-item small {
  display: block;
}

.recent-item span,
.recent-item small {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 720px) {
  #app {
    width: min(100% - 28px, 1120px);
    padding-top: 18px;
  }

  .app-header,
  .report-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .report-actions,
  .mind-card-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .report-actions .primary-button,
  .report-actions .ghost-button,
  .mind-card-toolbar .primary-button {
    width: 100%;
  }

  .app-header {
    gap: 12px;
    padding: 0 0 18px;
  }

  h1 {
    margin-bottom: 6px;
    font-size: 34px;
    line-height: 1.05;
  }

  .tagline {
    max-width: 14em;
    font-size: 15px;
    line-height: 1.45;
  }

  h2 {
    font-size: 23px;
  }

  .section-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
  }

  .section-heading p {
    font-size: 14px;
  }

  .mbti-heading {
    align-items: flex-start;
  }

  .local-only-note {
    min-height: 32px;
    font-size: 12px;
  }

  .mbti-panel {
    gap: 14px;
  }

  .mbti-progress-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px;
  }

  .mbti-progress-row > div {
    justify-content: space-between;
    gap: 8px;
  }

  .mbti-progress-row strong {
    font-size: 15px;
  }

  .mbti-question-list {
    gap: 10px;
  }

  .mbti-question {
    padding: 14px 12px;
  }

  .mbti-question legend {
    gap: 9px;
    margin-bottom: 12px;
    line-height: 1.48;
  }

  .mbti-question legend span {
    flex-basis: 30px;
    width: 30px;
    height: 26px;
  }

  .mbti-question legend strong {
    font-size: 15px;
  }

  .mbti-scale {
    gap: 5px;
    padding-left: 0;
  }

  .mbti-scale label span {
    min-height: 52px;
    padding: 5px 2px;
    font-size: 11px;
    line-height: 1.2;
  }

  .mbti-navigation {
    grid-template-columns: minmax(94px, 0.34fr) minmax(0, 0.66fr);
    padding: 8px;
    border: 1px solid rgba(35, 92, 98, 0.18);
    border-radius: 8px;
    background: rgba(250, 248, 243, 0.96);
    box-shadow: 0 10px 26px rgba(23, 33, 38, 0.12);
    backdrop-filter: blur(8px);
  }

  .mbti-navigation button {
    min-height: 46px;
  }

  .inline-action {
    width: 100%;
  }

  .input-panel {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
  }

  .coordinate-fields {
    grid-template-columns: 1fr;
  }

  .geocoding-row {
    align-items: stretch;
    flex-direction: column;
  }

  .geocode-button {
    width: 100%;
  }

  .promise-list {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 14px;
  }

  .promise-list li {
    min-height: 38px;
    padding-top: 9px;
    padding-bottom: 9px;
    font-size: 13px;
  }

  input[type="date"],
  input[type="time"],
  input[type="text"] {
    padding-inline: 12px;
  }

  .number-parts {
    gap: 7px;
  }

  .date-parts {
    grid-template-columns: minmax(100px, 1.35fr) minmax(68px, 1fr) minmax(68px, 1fr);
  }

  .time-parts {
    max-width: none;
  }

  .number-part {
    gap: 4px;
  }

  .number-part input[type="text"] {
    padding-inline: 6px;
    font-size: 17px;
  }

  .number-part span {
    font-size: 12px;
  }

  .segmented {
    width: 100%;
  }

  .test-card {
    grid-template-columns: 46px 1fr 14px;
    min-height: 104px;
    padding: 16px;
  }

  .test-mark {
    width: 38px;
    height: 38px;
    font-size: 20px;
  }

  .test-card strong {
    margin-bottom: 5px;
    font-size: 18px;
  }

  .test-card small {
    font-size: 13px;
    line-height: 1.45;
  }

  .test-arrow {
    font-size: 30px;
  }

  .site-footer {
    margin-top: 24px;
    padding-top: 18px;
  }

  .footer-links,
  .site-footer p {
    gap: 8px 12px;
  }

  .legal-page section {
    padding: 16px;
  }

  .legal-page h2 {
    font-size: 19px;
  }

  .guide-intro {
    padding: 18px 0;
  }

  .guide-intro p,
  .guide-section p,
  .guide-section li {
    font-size: 15px;
  }

  .guide-section {
    padding: 26px 0;
  }

  .guide-section-heading {
    align-items: flex-start;
  }

  .guide-section-heading h2 {
    font-size: 20px;
  }

  .ocean-map-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ocean-map-grid > div {
    min-height: 118px;
  }

  .continuum-row {
    grid-template-columns: 36px 1fr;
    gap: 7px 10px;
    padding: 10px 0;
  }

  .continuum-line {
    grid-column: 1 / -1;
  }

  .continuum-row small:first-of-type {
    grid-column: 1 / 2;
  }

  .continuum-row small:last-child {
    text-align: right;
  }

  .model-lens-grid,
  .tradeoff-grid,
  .guide-next {
    grid-template-columns: 1fr;
  }

  .result-bar {
    grid-template-columns: 124px minmax(90px, 1fr) 30px;
    gap: 8px;
  }

  .result-bar > span {
    font-size: 12px;
  }

  .guide-cta {
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
  }

  .guide-cta-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .primary-link,
  .secondary-link {
    width: 100%;
  }

  .history-card {
    grid-template-columns: 42px 1fr;
    gap: 12px;
    padding: 16px;
  }

  .history-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 8px;
  }

  .history-actions .primary-button,
  .history-actions .ghost-button {
    min-width: 0;
    width: 100%;
  }

  .history-copy strong {
    font-size: 17px;
  }

  .mind-card-panel {
    padding: 14px;
  }

  .report-feedback-panel {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .mind-card-preview {
    padding: 10px;
  }

  .mbti-report .markdown-body h1 {
    font-size: 30px;
    line-height: 1.24;
  }

  .report-brand {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-token-panel {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-card {
    padding: 14px;
  }

  .admin-token-panel .primary-button {
    width: 100%;
  }

  .stats-section {
    padding: 16px;
  }

  .async-stats-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .openai-key-status {
    grid-template-columns: 10px minmax(0, 1fr);
  }

  .openai-key-status small {
    grid-column: 2;
    white-space: normal;
  }

  .daily-bars {
    overflow-x: auto;
    grid-template-columns: repeat(14, 42px);
    padding-bottom: 4px;
  }

  .bar-stack {
    height: 112px;
  }

  .recent-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .active-stream,
  .empty-inline {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media print {
  body {
    background: #fff;
  }

  #app {
    width: 100%;
    padding: 0;
  }

  .app-header,
  .report-toolbar,
  .loading-panel,
  .error-panel {
    display: none !important;
  }

  .view {
    display: none !important;
  }

  #reportView {
    display: block !important;
  }

  .report-paper {
    display: block !important;
    padding: 0;
    box-shadow: none;
    border-radius: 0;
  }
}

/* Observation ledger visual system */
:root {
  --ink: #182c38;
  --muted: #50616a;
  --line: #c4d1d6;
  --paper: #ffffff;
  --surface: #eef3f3;
  --surface-2: #e5edef;
  --teal: #2d6373;
  --teal-dark: #204957;
  --copper: #c74332;
  --gold: #8b6a24;
  --green: #456a57;
  --shadow: none;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
}

html {
  background: #f7f9f6;
  scroll-behavior: smooth;
}

body {
  color: var(--ink);
  background: #f7f9f6;
  font-size: 16px;
  line-height: 1.65;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
a,
input,
select,
textarea,
summary {
  -webkit-tap-highlight-color: transparent;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

#app {
  width: min(1080px, calc(100% - 48px));
  padding: 36px 0 64px;
}

.app-header {
  align-items: flex-end;
  min-height: 86px;
  padding: 0 0 20px;
}

.brand-block {
  max-width: 900px;
}

.app-header .eyebrow,
.report-toolbar .eyebrow,
.mbti-heading .eyebrow {
  margin-bottom: 7px;
  color: var(--copper);
  font: 700 12px/1.4 "SFMono-Regular", Menlo, Consolas, monospace;
}

h1 {
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 44px;
  font-weight: 750;
  line-height: 1.05;
  letter-spacing: 0;
}

h2,
h3 {
  color: var(--ink);
  letter-spacing: 0;
}

h2 {
  font-size: 28px;
  line-height: 1.28;
}

.tagline {
  max-width: 46rem;
  color: var(--muted);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.6;
}

.ledger-meta {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 42px;
  margin-bottom: 32px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
}

body[data-page-kind="home"] .ledger-meta {
  display: flex;
}

.ledger-history-button {
  min-height: 40px;
  padding: 0;
  border: 0;
  color: var(--teal);
  background: transparent;
  font: inherit;
  font-weight: 700;
}

.ledger-history-button:hover {
  color: var(--copper);
}

.section-heading {
  align-items: flex-end;
  margin-bottom: 24px;
}

.section-heading h2 {
  margin-bottom: 6px;
}

.section-heading p {
  max-width: 62ch;
  color: var(--muted);
  font-size: 15px;
}

#listView .inline-action {
  display: none;
}

.breadcrumbs {
  margin: 0 0 24px;
  padding: 10px 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
  font: 600 12px/1.5 "SFMono-Regular", Menlo, Consolas, monospace;
}

.breadcrumbs a,
.seo-related a {
  color: var(--teal);
  font-weight: 700;
}

.breadcrumbs a:hover,
.seo-related a:hover {
  color: var(--copper);
}

.test-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 24px;
}

.directory-group {
  min-width: 0;
  padding: 18px 20px 2px;
  border-top: 2px solid var(--teal);
  background: #eaf1f3;
}

.traditional-group {
  border-top-color: #55705d;
  background: #eef2ed;
}

.directory-entries {
  display: grid;
}

.directory-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--ink);
}

.directory-heading.traditional-heading {
  margin-top: 0;
}

.directory-heading h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.4;
}

.directory-heading > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.4;
}

.test-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 12px;
  min-height: 124px;
  padding: 16px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  box-shadow: none;
  text-decoration: none;
  transition: background-color 220ms cubic-bezier(0.16, 1, 0.3, 1), color 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.test-card:hover {
  border-color: var(--line);
  background: #dfe9eb;
}

.traditional-group .test-card:hover {
  background: #e1e9e2;
}

.test-card:focus-visible {
  outline-offset: 1px;
}

.featured-test {
  grid-template-columns: 42px minmax(0, 1fr) 24px;
  min-height: 124px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.featured-test:hover {
  border-bottom-color: var(--line);
  background: #dfe9eb;
}

.directory-entries .test-card:last-child {
  border-bottom: 0;
}

.test-mark,
.mbti-mark,
.big-five-mark,
.big-five-full-mark,
.bazi-mark,
.deep-bazi-mark,
.async-bazi-mark {
  display: block;
  align-self: start;
  width: auto;
  height: auto;
  padding-top: 4px;
  border-radius: 0;
  color: var(--teal);
  background: transparent;
  font: 700 12px/1.4 "SFMono-Regular", Menlo, Consolas, monospace;
  letter-spacing: 0;
}

.featured-test .test-mark {
  color: var(--teal);
}

.traditional-group .test-mark {
  color: #55705d;
}

.test-copy {
  min-width: 0;
}

.test-card strong {
  margin-bottom: 5px;
  font-size: 17px;
  font-weight: 750;
  line-height: 1.4;
}

.featured-test strong {
  font-size: 17px;
  line-height: 1.4;
}

.test-card small {
  display: block;
  max-width: 64ch;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.test-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  margin-top: 8px;
}

.test-meta > span {
  color: var(--muted);
  font: 600 11px/1.6 "SFMono-Regular", Menlo, Consolas, monospace;
  white-space: nowrap;
}

.test-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  align-self: center;
  color: var(--teal);
  font-size: 0;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

.test-arrow b {
  color: var(--copper);
  font-size: 20px;
  font-weight: 500;
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.test-card:hover .test-arrow b {
  transform: translateX(4px);
}

.ledger-notes {
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--ink);
}

.ledger-notes h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.promise-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 28px;
  margin: 0;
}

.promise-list li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: baseline;
  min-height: 42px;
  padding: 9px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 500;
}

.promise-list li::before {
  display: none;
}

.promise-list li > span {
  color: var(--teal);
  font: 700 11px/1.4 "SFMono-Regular", Menlo, Consolas, monospace;
}

.test-overview {
  max-width: 820px;
  margin: 52px 0 0;
  padding: 30px 0 0;
  border-top: 1px solid var(--ink);
  border-bottom: 0;
}

.test-overview h2 {
  margin-bottom: 12px;
  font-size: 21px;
}

.test-overview p,
.seo-detail-section p,
.seo-faq p {
  max-width: 72ch;
  color: var(--muted);
  line-height: 1.8;
}

.seo-detail {
  max-width: 860px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

#seoDetailSections {
  gap: 38px;
}

.seo-faq details {
  border-bottom-color: var(--line);
}

.seo-faq summary {
  min-height: 48px;
  font-weight: 700;
}

.local-only-note,
.history-status,
.admin-job-status {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--teal);
  background: var(--surface);
}

.mbti-panel {
  gap: 16px;
}

.mbti-progress-row {
  padding: 14px 0 16px;
  border: 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.mbti-progress-row strong {
  color: var(--ink);
}

.mbti-progress-row progress,
.mbti-progress-row progress::-webkit-progress-bar {
  height: 8px;
  border-radius: 1px;
  background: var(--surface-2);
}

.mbti-progress-row progress::-webkit-progress-value,
.mbti-progress-row progress::-moz-progress-bar {
  border-radius: 1px;
  background: var(--teal);
}

.mbti-question-list {
  gap: 10px;
}

.mbti-question {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  box-shadow: none;
}

.mbti-question:focus-within {
  border-color: var(--teal);
  box-shadow: none;
  outline: 2px solid #cbdde1;
  outline-offset: 1px;
}

.mbti-question.is-missing {
  border-color: var(--copper);
  box-shadow: none;
  outline: 2px solid #f1d4ce;
  outline-offset: 1px;
}

.mbti-question legend span {
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--teal);
  background: var(--surface);
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
}

.mbti-scale label span {
  min-height: 48px;
  border-color: var(--line);
  border-radius: 3px;
  color: var(--muted);
  font-weight: 650;
}

.mbti-scale label:hover span {
  border-color: var(--teal);
  background: var(--surface);
}

.mbti-scale input:checked + span {
  border-color: var(--ink);
  color: var(--paper);
  background: var(--ink);
}

.mbti-navigation {
  gap: 10px;
}

.mbti-disclaimer {
  text-align: left;
}

.input-panel {
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-top: 2px solid var(--ink);
  border-radius: 4px;
  background: var(--paper);
  box-shadow: none;
}

.input-panel fieldset,
.input-panel > label {
  min-width: 0;
}

.input-panel legend,
.input-panel label > span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.input-panel input,
.input-panel select,
.input-panel textarea,
.report-feedback-panel select,
.report-feedback-panel textarea,
.admin-token-panel input {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--ink);
  background: #fff;
  box-shadow: none;
}

.input-panel input:hover,
.input-panel select:hover,
.input-panel textarea:hover {
  border-color: #8fa6ae;
}

.input-panel input:focus,
.input-panel select:focus,
.input-panel textarea:focus,
.report-feedback-panel select:focus,
.report-feedback-panel textarea:focus,
.admin-token-panel input:focus {
  border-color: var(--teal);
  box-shadow: none;
  outline: 2px solid #cbdde1;
  outline-offset: 1px;
}

.segmented {
  border-radius: 3px;
}

.segmented span {
  min-height: 46px;
  border-color: var(--line);
  border-radius: 0;
  background: #fff;
}

.segmented input:checked + span {
  color: #fff;
  background: var(--ink);
}

.toggle-row {
  border-color: var(--line);
  border-radius: 3px;
  background: var(--surface);
}

.notice {
  padding: 12px 0;
  border: 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
}

.async-submit-panel {
  border-color: var(--line);
  border-radius: 3px;
  color: var(--ink);
  background: var(--surface);
}

.primary-button,
.ghost-button,
.ghost-link,
.primary-link,
.secondary-link {
  min-height: 46px;
  border-radius: 4px;
  font-weight: 750;
}

.primary-button,
.primary-link {
  color: #fff;
  background: var(--ink);
}

.primary-button:hover,
.primary-link:hover {
  background: var(--teal-dark);
}

.primary-button:active,
.ghost-button:active,
.primary-link:active,
.secondary-link:active {
  transform: translateY(1px);
}

.primary-button:disabled,
.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 1;
}

.primary-button:disabled {
  color: #7b888e;
  background: #dce3e4;
}

.ghost-button,
.ghost-link,
.secondary-link {
  border-color: var(--line);
  color: var(--ink);
  background: var(--paper);
}

.ghost-button:hover,
.ghost-link:hover,
.secondary-link:hover {
  border-color: var(--teal);
  color: var(--teal);
  background: var(--surface);
}

.history-list {
  gap: 0;
  border-top: 1px solid var(--ink);
}

.history-card {
  grid-template-columns: 56px minmax(0, 1fr) auto;
  min-height: 104px;
  padding: 16px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.history-card .test-mark {
  align-self: center;
  padding-top: 0;
}

.history-copy strong {
  font-size: 18px;
}

.empty-panel,
.loading-panel,
.error-panel,
.mind-card-panel,
.report-feedback-panel {
  border-color: var(--line);
  border-radius: 4px;
  background: var(--paper);
  box-shadow: none;
}

.empty-panel {
  border-top: 2px solid var(--ink);
}

.report-toolbar {
  align-items: flex-end;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ink);
}

.report-paper {
  border: 1px solid var(--line);
  border-top: 2px solid var(--ink);
  border-radius: 2px;
  background: var(--paper);
  box-shadow: none;
}

.ai-insight-panel {
  display: grid;
  gap: 16px;
  margin-bottom: 22px;
  padding: 18px 20px;
  border-top: 2px solid var(--teal);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.ai-insight-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.ai-insight-heading .eyebrow {
  margin-bottom: 4px;
}

.ai-insight-heading h3 {
  margin: 0;
  font-size: 19px;
  line-height: 1.35;
}

.ai-insight-heading > p {
  max-width: 42ch;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  text-align: right;
}

.ai-insight-panel legend {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.ai-insight-focus {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: #fff;
}

.ai-insight-focus label {
  position: relative;
  min-width: 0;
}

.ai-insight-focus label + label {
  border-left: 1px solid var(--line);
}

.ai-insight-focus input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.ai-insight-focus span {
  display: grid;
  min-height: 44px;
  margin: 0;
  padding: 8px 10px;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}

.ai-insight-focus label:hover span {
  background: #edf3f3;
}

.ai-insight-focus input:checked + span {
  color: var(--paper);
  background: var(--ink);
}

.ai-insight-focus input:focus-visible + span {
  outline: 2px solid var(--teal);
  outline-offset: -3px;
}

.ai-insight-focus input:disabled + span {
  cursor: wait;
  opacity: 0.65;
}

.ai-insight-action {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ai-insight-action .primary-button {
  flex: 0 0 auto;
  width: auto;
}

.ai-insight-action small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.ai-insight-status {
  min-height: 20px;
  margin: -8px 0 0;
  color: var(--teal-dark);
  font-size: 12px;
  line-height: 1.5;
}

.ai-insight-status.is-error {
  color: #8a2d24;
}

.ai-insight-paper {
  margin-top: 24px;
  border-top-color: var(--teal);
}

.ai-insight-paper + .report-paper {
  margin-top: 24px;
}

.ai-insight-placeholder {
  color: var(--muted);
}

.report-brand {
  border-bottom-color: var(--line);
}

.report-brand span,
.markdown-body h1,
.markdown-body h2 {
  color: var(--ink);
}

.markdown-body h3,
.markdown-body h4 {
  color: var(--teal-dark);
}

.markdown-body hr {
  background: var(--line);
}

.markdown-body pre {
  border-color: var(--line);
  border-radius: 3px;
  background: var(--surface);
  box-shadow: none;
}

.markdown-body blockquote {
  padding: 12px 16px;
  border-left: 1px solid var(--teal);
  background: var(--surface);
}

.markdown-body th {
  background: var(--surface);
}

.report-feedback-panel strong {
  color: var(--ink);
}

.feedback-rating button {
  min-height: 44px;
  border-radius: 3px;
}

.feedback-rating button[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
}

.mind-card-preview {
  border-radius: 3px;
  background: var(--surface);
}

.site-footer {
  margin-top: 56px;
  padding-top: 20px;
  border-top-color: var(--ink);
}

.footer-links {
  gap: 8px 22px;
}

.site-footer a,
.legal-page a,
.guide-page a {
  color: var(--teal);
  font-weight: 700;
}

.legal-page {
  gap: 0;
  max-width: 820px;
  border-top: 1px solid var(--ink);
}

.legal-page section {
  padding: 26px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.guide-page {
  width: min(860px, 100%);
}

.guide-intro,
.guide-section,
.ocean-map,
.trait-continuum,
.model-lens,
.result-profile {
  border-color: var(--line);
}

.guide-section-heading > p,
.guide-section-heading > span,
.lens-label,
.guide-row-link span {
  color: var(--copper) !important;
}

.ocean-map-grid > div,
.model-lens-grid > section,
.tradeoff-grid > section {
  border-color: var(--line);
  border-radius: 3px;
  background: var(--paper);
}

.continuum-line {
  background: #8ca8ae;
}

.type-axes span {
  border-left-width: 1px;
}

.guide-cta {
  border-color: var(--ink);
}

.admin-header h1 {
  font-size: 48px;
}

.admin-token-panel,
.stat-card,
.stats-section {
  border-color: var(--line);
  border-radius: 4px;
  background: var(--paper);
  box-shadow: none;
}

.stat-card strong,
.stats-table th,
.async-stats-summary strong {
  color: var(--teal-dark);
}

.daily-bar:hover .bar-stack,
.daily-bar:focus-visible .bar-stack {
  box-shadow: none;
}

@media (max-width: 900px) {
  .test-list {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

@media (max-width: 720px) {
  #app {
    width: min(100% - 32px, 1120px);
    padding: 22px 0 44px;
  }

  .app-header {
    align-items: stretch;
    min-height: 0;
    gap: 14px;
    padding: 0 0 18px;
  }

  h1 {
    font-size: 34px;
    line-height: 1.08;
  }

  body[data-page-kind="test"] h1 {
    font-size: 28px;
    line-height: 1.18;
  }

  .tagline {
    max-width: none;
    font-size: 14px;
    line-height: 1.55;
  }

  body[data-page-kind="test"] .tagline {
    display: none;
  }

  body[data-page-kind="test"] .breadcrumbs {
    display: none !important;
  }

  body[data-page-kind="test"] #backButton {
    order: -1;
    align-self: flex-start;
    min-width: 0;
    min-height: 44px;
    padding: 0 4px;
    border: 0;
    background: transparent;
  }

  body[data-page-kind="test"] #mbtiView.active > .section-heading h2,
  body[data-page-kind="test"] #formView.active > .section-heading h2 {
    display: none;
  }

  .ledger-meta {
    gap: 10px;
    margin-bottom: 25px;
    font-size: 9px;
  }

  .ledger-meta span:first-child {
    display: none;
  }

  .ledger-history-button {
    margin-left: auto;
  }

  .section-heading {
    gap: 8px;
    margin-bottom: 18px;
  }

  .section-heading h2 {
    font-size: 23px;
  }

  .test-list {
    gap: 0;
  }

  .directory-group {
    padding: 14px 14px 0;
  }

  .directory-heading {
    min-height: 40px;
    gap: 10px;
    padding-bottom: 10px;
  }

  .directory-heading.traditional-heading {
    margin-top: 0;
  }

  .directory-heading h3 {
    font-size: 16px;
  }

  .directory-heading > span {
    font-size: 10px;
  }

  .test-card,
  .featured-test {
    grid-template-columns: 38px minmax(0, 1fr) 20px;
    gap: 10px;
    min-height: 106px;
    padding: 15px 0;
  }

  .test-card strong {
    font-size: 16px;
  }

  .featured-test strong {
    font-size: 16px;
  }

  .test-card small {
    font-size: 12px;
    line-height: 1.55;
  }

  .test-meta {
    gap: 4px 12px;
    margin-top: 8px;
  }

  .test-meta > span {
    font-size: 10px;
  }

  .test-card .test-meta > span:nth-child(n + 3) {
    display: none;
  }

  .test-arrow {
    gap: 3px;
    font-size: 0;
  }

  .test-arrow b {
    font-size: 19px;
  }

  .ledger-notes {
    margin-top: 34px;
  }

  .promise-list {
    grid-template-columns: 1fr;
  }

  .promise-list li {
    min-height: 42px;
    padding: 9px 0;
  }

  .breadcrumbs {
    margin-bottom: 20px;
  }

  .mbti-progress-row {
    padding: 12px 0 14px;
  }

  .mbti-question {
    padding: 14px 12px;
  }

  .mbti-navigation {
    position: sticky;
    bottom: 0;
    z-index: 3;
    padding: 8px 0;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    background: #f7f9f6;
    box-shadow: none;
    backdrop-filter: none;
  }

  .input-panel {
    gap: 16px;
    margin-inline: -4px;
    padding: 18px 14px;
  }

  .date-parts {
    grid-template-columns: minmax(88px, 1.35fr) minmax(58px, 1fr) minmax(58px, 1fr);
  }

  .number-parts {
    gap: 6px;
  }

  .number-part input[type="text"] {
    min-width: 0;
    padding-inline: 5px;
  }

  .report-toolbar {
    align-items: stretch;
  }

  .report-paper {
    margin-inline: -8px;
    padding: 24px 18px;
  }

  .ai-insight-panel {
    margin-inline: -4px;
    padding: 16px 14px;
  }

  .ai-insight-heading,
  .ai-insight-action {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .ai-insight-heading > p {
    max-width: none;
    text-align: left;
  }

  .ai-insight-focus {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ai-insight-focus label:nth-child(3) {
    border-left: 0;
  }

  .ai-insight-focus label:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .ai-insight-action .primary-button {
    width: 100%;
  }

  .markdown-body {
    font-size: 15px;
  }

  .markdown-body h1 {
    font-size: 28px;
  }

  .markdown-body h2 {
    font-size: 22px;
  }

  .history-card {
    grid-template-columns: 40px minmax(0, 1fr);
    padding: 16px 0;
  }

  .history-actions {
    grid-column: 2;
  }

  .site-footer {
    margin-top: 42px;
  }

  .footer-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .legal-page section {
    padding: 22px 0;
  }

  .admin-header h1 {
    font-size: 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
