:root {
  --paper: #f3eee4;
  --paper-deep: #e9e1d3;
  --card: #fffaf1;
  --card-strong: #fffdf8;
  --ink: #20302d;
  --ink-soft: #40524c;
  --muted: #657169;
  --line: #ded4c4;
  --line-strong: #c9bca8;
  --teal: #2f6f63;
  --teal-deep: #24574e;
  --teal-soft: #e1ece7;
  --clay: #bd6b4c;
  --clay-deep: #965039;
  --clay-soft: #f3e2d7;
  --gold: #b08a4f;
  --danger: #a3483c;
  --shadow: 0 10px 30px rgba(72, 58, 38, 0.06), 0 1px 0 rgba(255, 255, 255, 0.7) inset;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "SFMono-Regular", "Cascadia Mono", "Consolas", monospace;
  --radius: 18px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  background:
    radial-gradient(1100px 600px at 8% -8%, rgba(255, 250, 241, 0.95), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(225, 236, 231, 0.55), transparent 55%),
    radial-gradient(800px 600px at 50% 110%, rgba(243, 226, 215, 0.45), transparent 60%),
    var(--paper);
}

.paper-grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.12;
  background-image: radial-gradient(rgba(70, 58, 42, 0.18) 0.55px, transparent 0.55px);
  background-size: 4px 4px;
  mix-blend-mode: multiply;
}

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

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 36px;
  border-bottom: 1px solid rgba(201, 188, 168, 0.55);
  background: rgba(243, 238, 228, 0.82);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  color: var(--teal);
  border: 1px solid rgba(47, 111, 99, 0.35);
  border-radius: 50%;
  padding: 3px;
  background: rgba(255, 250, 241, 0.55);
}

.brand-mark svg { width: 100%; height: 100%; display: block; }

.brand-text { display: grid; line-height: 1.15; }
.brand-text strong {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.brand-text small { color: var(--muted); font-size: 11.5px; letter-spacing: 0.06em; margin-top: 4px; }

.topbar-actions { display: flex; align-items: center; gap: 12px; }

.pills { display: flex; flex-wrap: wrap; gap: 7px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 26px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 241, 0.55);
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); flex: none; }
.pill.is-online { color: var(--teal-deep); border-color: rgba(47, 111, 99, 0.3); background: var(--teal-soft); }
.pill.is-online .dot { background: var(--teal); box-shadow: 0 0 0 3px rgba(47, 111, 99, 0.12); }
.pill.is-warn { color: #7c5d2e; border-color: rgba(176, 138, 79, 0.35); background: #f6eedc; }
.pill.is-warn .dot { background: var(--gold); }
.pill.is-offline { color: var(--danger); border-color: rgba(163, 72, 60, 0.3); background: #f6e7e2; }
.pill.is-offline .dot { background: var(--danger); }

.layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 26px;
  width: min(1360px, 100%);
  margin: 0 auto;
  padding: 0 36px 64px;
  align-items: start;
}

.column { min-width: 0; }
.column-input { display: flex; flex-direction: column; gap: 18px; }
.column-result { display: flex; flex-direction: column; gap: 18px; }

.page-intro { position: relative; z-index: 1; width: min(1360px, 100%); margin: auto; padding: 36px 36px 30px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.page-intro h1 { font-family: var(--serif); font-size: clamp(28px, 3vw, 38px); font-weight: 600; line-height: 1.35; letter-spacing: .025em; margin: 0; }
.page-intro p:last-child { color: var(--muted); margin: 12px 0 0; font-size: 14px; }
.intro-note { color: var(--teal-deep); font-size: 13px; padding-left: 18px; border-left: 2px solid var(--line-strong); flex: none; }
.intro-note span { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
#advice-form { display: grid; gap: 16px; }
.relation-selects { margin-top: 16px; }
.question-tools { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12px; margin-top: 12px; }
#question-count { font-variant-numeric: tabular-nums; white-space: nowrap; }
.prompt-chips { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 9px; }
.prompt-chips button { cursor: pointer; padding: 7px 12px; border: 1px solid var(--line); border-radius: 30px; background: transparent; color: var(--teal-deep); font-size: 12px; }
.prompt-chips button:hover { background: var(--teal-soft); border-color: var(--teal); }
.prompt-chips button.is-selected { color: #fff; background: var(--teal); border-color: var(--teal); }
.safety-entry { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 11px; }
.safety-entry span { color: var(--muted); font-size: 11.5px; }
.safety-link { padding: 0; border: 0; background: transparent; color: var(--clay-deep); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.safety-followup { margin-top: 10px; padding: 12px 13px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--paper-deep); }
.safety-followup p { margin: 0 0 9px; color: var(--ink-soft); font-size: 12.5px; line-height: 1.7; }
.safety-answers { display: flex; gap: 8px; flex-wrap: wrap; }
.safety-answers button { cursor: pointer; border: 1px solid var(--line); border-radius: 30px; background: var(--card-strong); color: var(--teal-deep); padding: 6px 14px; font-size: 12px; }
.safety-answers button:hover { border-color: var(--teal); background: var(--teal-soft); }
.safety-panel { border-color: rgba(189, 107, 76, 0.55); background: linear-gradient(180deg, var(--clay-soft), var(--card)); }
.safety-panel h2 { color: var(--clay-deep); }
.safety-panel p { color: var(--ink-soft); font-size: 13px; line-height: 1.8; margin: 0 0 10px; }
.safety-panel .btn { margin-top: 3px; }
.birth-unknown-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; }
.check-line { display: inline-flex; align-items: flex-start; gap: 7px; color: var(--muted); font-size: 11.5px; line-height: 1.5; cursor: pointer; }
.check-line input { margin: 2px 0 0; accent-color: var(--teal); }
.calibration { margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); display: grid; gap: 9px; }
.calibration-question { margin: 0; color: var(--ink-soft); font-size: 13px; }
.calibration-options { display: flex; gap: 8px; flex-wrap: wrap; }
.calibration-options button { cursor: pointer; border: 1px solid var(--line); border-radius: 30px; background: transparent; color: var(--teal-deep); padding: 6px 14px; font-size: 12px; }
.calibration-options button:hover { border-color: var(--teal); background: var(--teal-soft); }
.calibration-options button.is-selected { color: #fff; background: var(--teal); border-color: var(--teal); }
.calibration-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.card.optional-section { padding: 0; overflow: hidden; }
.optional-section > summary { display: flex; align-items: center; gap: 14px; padding: 18px 22px; cursor: pointer; list-style: none; }
.optional-section > summary::-webkit-details-marker { display: none; }
.optional-section > summary > span { flex: 1; }
.optional-section > summary strong { font-size: 15px; font-weight: 500; }
.optional-section > summary small { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.optional-section > summary em { font-size: 12px; font-style: normal; color: var(--muted); }
.optional-section > summary::after { content: '+'; color: var(--teal); font-size: 22px; line-height: 1; }
.optional-section[open] > summary::after { content: '−'; }
.optional-body { padding: 0 22px 22px; display: grid; gap: 20px; border-top: 1px solid var(--line); }
.optional-body > .card { padding: 20px 0 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.optional-body .card-head h2 { font-size: 20px; }
.optional-body .field-help { font-size: 12px; color: var(--muted); line-height: 1.6; }
.submit-area { display: grid; gap: 10px; padding: 0 2px; }
.submit-hint { font-size: 12px; color: var(--teal-deep); margin: 0; }
.submit-area .fineprint { margin: 0; font-size: 12px; }
.history-notice { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; color: var(--teal-deep); font-size: 13px; }
.history-item:disabled { cursor: wait; opacity: .6; }
.empty-footnote { font-size: 12px; color: var(--muted); margin: 28px 0 0; }
.result-tabs { display: flex; padding: 5px; background: var(--paper-deep); border-radius: 12px; gap: 5px; }
.result-tabs button { flex: 1; cursor: pointer; border: 0; border-radius: 8px; background: transparent; color: var(--muted); padding: 11px 16px; font-size: 14px; }
.result-tabs button[aria-pressed="true"] { color: var(--teal-deep); background: var(--card-strong); box-shadow: 0 2px 7px #20302d0d; font-weight: 600; }
.result-panel { display: grid; gap: 18px; }
.reference-intro { color: var(--muted); font-size: 13px; margin: 0; padding: 0 4px; }
#result, .result-loading { scroll-margin-top: 108px; }
#result:focus { outline: none; }
.result-loading { padding: 64px 28px; text-align: center; }
.result-loading h2 { font-family: var(--serif); font-size: 25px; margin: 24px 0 12px; }
.result-loading p { color: var(--ink-soft); font-size: 14px; }
.result-loading small { color: var(--muted); }
.loading-ring { display: inline-block; width: 38px; height: 38px; border: 2px solid var(--line); border-top-color: var(--teal); border-radius: 50%; animation: spin 1s linear infinite; }

.card {
  position: relative;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--card-strong), var(--card));
  box-shadow: var(--shadow);
}

.card-head { margin-bottom: 16px; }
.card-head:last-child { margin-bottom: 0; }
.card-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.card-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.25;
}
.card-head p { margin: 7px 0 0; color: var(--muted); font-size: 12.5px; }
.card-head p + h2 { margin-top: 3px; }

.eyebrow {
  margin: 0 0 7px;
  color: var(--teal);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.eyebrow .badge { margin-right: 4px; vertical-align: 1px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 14px; }
.grid-2 + .grid-2 { margin-top: 14px; }

.field { display: grid; gap: 6px; min-width: 0; }
.field > span { color: var(--ink-soft); font-size: 12px; letter-spacing: 0.02em; }
.field em { color: var(--muted); font-size: 10.5px; font-style: normal; margin-left: 4px; }

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  padding: 10px 12px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
input::placeholder, textarea::placeholder { color: #a39a8a; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(47, 111, 99, 0.6);
  box-shadow: 0 0 0 3px rgba(47, 111, 99, 0.1);
  background: #fffdf8;
}
textarea { resize: vertical; min-height: 62px; line-height: 1.65; }
select { cursor: pointer; }
input[type="date"], input[type="datetime-local"] { font-family: var(--mono); font-size: 12px; color: var(--ink-soft); }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.45);
  font-size: 10px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.badge-a { color: var(--teal-deep); border-color: rgba(47, 111, 99, 0.3); background: var(--teal-soft); }
.badge-b { color: var(--clay-deep); border-color: rgba(189, 107, 76, 0.3); background: var(--clay-soft); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary {
  color: #fffdf8;
  background: linear-gradient(135deg, var(--teal), var(--teal-deep));
  border-color: rgba(36, 87, 78, 0.55);
  box-shadow: 0 8px 20px rgba(36, 87, 78, 0.16);
}
.btn-primary:hover:not(:disabled) { background: linear-gradient(135deg, #347c6e, var(--teal-deep)); }
.btn-ghost {
  color: var(--ink-soft);
  border-color: var(--line);
  background: rgba(255, 250, 241, 0.45);
}
.btn-ghost:hover:not(:disabled) { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.7); }
.btn-small { min-height: 32px; padding: 0 11px; font-size: 12px; border-radius: 8px; }
.btn-icon { width: 30px; min-height: 30px; padding: 0; color: var(--muted); font-size: 18px; line-height: 1; }
.btn-icon:hover { color: var(--danger); border-color: rgba(163, 72, 60, 0.3); }

.btn-submit { width: 100%; min-height: 50px; font-size: 15px; letter-spacing: 0.04em; }
.btn-spinner {
  display: none;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.btn-submit.is-loading .btn-spinner { display: inline-block; }
.btn-submit.is-loading { pointer-events: none; }

.fineprint { margin: -4px 2px 0; color: var(--muted); font-size: 11px; line-height: 1.6; }

.banner {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre-line;
}
.banner-error { color: var(--danger); background: #f8e9e4; border: 1px solid rgba(163, 72, 60, 0.25); }
.banner strong { font-family: var(--mono); font-size: 11px; margin-right: 6px; }

.report-list { display: grid; gap: 12px; }
.report-row {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.35);
}
.report-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.report-index { color: var(--muted); font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; }
.report-at { width: auto; min-width: 128px; margin-left: auto; padding: 5px 8px; font-size: 11px; border-radius: 7px; }
.report-text { min-height: 54px; border-radius: 9px; background: rgba(255, 255, 255, 0.6); }
.signal-details { margin-top: 8px; }
.signal-details summary { color: var(--muted); font-size: 11.5px; cursor: pointer; user-select: none; }
.signal-details summary:hover { color: var(--teal); }
.signal-hint { margin: 7px 0 6px; color: var(--muted); font-size: 10.5px; }
.signal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.signal-grid label { display: grid; gap: 4px; color: var(--muted); font-size: 10.5px; }
.signal-grid input { padding: 6px 8px; font-family: var(--mono); font-size: 11px; border-radius: 7px; }

.emotion-state { min-height: 58px; }
.emotion-loading, .emotion-empty { display: flex; align-items: flex-start; gap: 10px; color: var(--muted); font-size: 12.5px; line-height: 1.65; }
.emotion-loading::before {
  content: "";
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  flex: none;
}
.emotion-empty::before {
  content: "—";
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  flex: none;
}
.emotion-summary { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.emotion-summary .status-dot { width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px rgba(47, 111, 99, 0.1); flex: none; }
.emotion-summary strong { display: block; font-size: 13px; font-weight: 600; }
.emotion-summary small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.emotion-readings { display: grid; gap: 7px; }
.emotion-reading {
  display: grid;
  gap: 6px;
  padding: 9px 10px;
  border: 1px solid rgba(222, 212, 196, 0.8);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.38);
}
.emotion-reading-head { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.emotion-at { color: var(--muted); font-family: var(--mono); font-size: 10px; flex: none; }
.emotion-text { overflow: hidden; color: var(--ink-soft); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.energy-bars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.energy-bar { position: relative; display: grid; gap: 3px; }
.energy-bar::before { content: ""; display: block; height: 4px; border-radius: 99px; background: var(--line); }
.energy-bar i { position: absolute; top: 0; left: 0; height: 4px; border-radius: 99px; background: var(--teal); }
.energy-bar:nth-child(2) i { background: var(--gold); }
.energy-bar:nth-child(3) i { background: var(--clay); }
.energy-bar em { color: var(--muted); font-family: var(--mono); font-size: 9.5px; font-style: normal; }

.history-card { margin-top: 2px; }
.history { display: grid; gap: 8px; }
.history-empty { color: var(--muted); font-size: 12px; padding: 8px 2px; }
.history-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.35);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}
.history-item:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.65); }
.history-item.is-active { border-color: rgba(47, 111, 99, 0.45); background: var(--teal-soft); }
.history-date { color: var(--muted); font-family: var(--mono); font-size: 10px; }
.history-question { overflow: hidden; color: var(--ink); font-size: 12.5px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.history-meta { color: var(--muted); font-size: 10.5px; }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 550px;
  padding: 42px 32px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(600px 300px at 50% 18%, rgba(225, 236, 231, 0.6), transparent 70%),
    rgba(255, 250, 241, 0.34);
  text-align: center;
}
.empty-mark { width: min(290px, 70%); color: var(--teal); margin-bottom: 20px; opacity: 0.85; }
.empty-mark svg { display: block; width: 100%; height: auto; }
.wave-a { animation: drift 8s ease-in-out infinite; }
.wave-b { animation: drift 8s ease-in-out infinite reverse; }
.empty-state h2 { margin: 0; font-family: var(--serif); font-size: 30px; font-weight: 600; letter-spacing: 0.02em; }
.empty-copy { max-width: 520px; margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.steps { display: grid; gap: 9px; width: min(420px, 100%); margin: 26px 0 0; padding: 0; list-style: none; text-align: left; }
.steps li { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); font-size: 12.5px; }
.steps li span {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--teal);
  font-family: var(--mono);
  font-size: 10px;
  flex: none;
}

.result { display: grid; gap: 18px; animation: rise 0.35s ease both; }

.advice-card { border-color: rgba(47, 111, 99, 0.22); }
.advice-card .card-head { margin-bottom: 10px; }
.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 10px 0 12px;
  border-bottom: 1px dashed var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
}
.meta-line span { display: inline-flex; gap: 5px; align-items: baseline; }
.meta-line b { color: var(--ink-soft); font-weight: 500; margin-right: 5px; }
.advice-text { display: grid; gap: 15px; padding-top: 14px; }
.advice-section { display: grid; grid-template-columns: 34px 1fr; gap: 12px; }
.advice-num { color: var(--clay); font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; padding-top: 3px; }
.advice-body h3 { margin: 0 0 5px; font-family: var(--serif); font-size: 18px; font-weight: 600; letter-spacing: 0.01em; }
.advice-body p { margin: 0; color: var(--ink-soft); font-size: 15px; line-height: 1.95; white-space: pre-wrap; overflow-wrap: anywhere; }
.advice-plain { margin: 0; color: var(--ink-soft); font-size: 15px; line-height: 1.95; white-space: pre-wrap; overflow-wrap: anywhere; }

.readout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.readout-card { padding: 19px; }
.readout-self { border-top: 2px solid rgba(47, 111, 99, 0.35); }
.readout-partner { border-top: 2px solid rgba(189, 107, 76, 0.35); }
.rhythm-body { display: grid; gap: 8px; }
.rhythm-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding-bottom: 6px; border-bottom: 1px dashed var(--line); }
.rhythm-steps { color: var(--muted); font-family: var(--mono); font-size: 10.5px; }
.rhythm-source { color: var(--ink-soft); font-size: 10.5px; }
.triplet { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; padding: 3px 0 5px; }
.trip { display: grid; gap: 4px; }
.trip-label { color: var(--muted); font-family: var(--mono); font-size: 9.5px; }
.trip-track { height: 5px; border-radius: 99px; background: var(--line); overflow: hidden; }
.trip-fill { display: block; height: 100%; border-radius: 99px; background: var(--teal); }
.readout-partner .trip-fill { background: var(--clay); }
.trip-value { color: var(--ink-soft); font-family: var(--mono); font-size: 10.5px; }
.metric-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-top: 6px; border-top: 1px dotted var(--line); font-size: 11.5px; }
.metric-row span { color: var(--muted); }
.metric-row b { color: var(--ink-soft); font-family: var(--mono); font-size: 11.5px; font-weight: 500; text-align: right; }
.metric-row b em { color: var(--muted); font-style: normal; font-size: 9.5px; margin-left: 3px; }
.model-note { margin: 10px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--clay-soft); color: var(--clay-deep); font-size: 10.5px; line-height: 1.6; }

.relation-card .card-head { margin-bottom: 14px; }
.axes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 9px; }
.axis {
  display: grid;
  gap: 4px;
  padding: 11px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.35);
}
.axis-value { color: var(--teal-deep); font-family: var(--mono); font-size: 19px; line-height: 1.2; letter-spacing: -0.03em; }
.axis-label { color: var(--ink-soft); font-size: 11px; }
.axis-sub { color: var(--muted); font-size: 9.5px; line-height: 1.45; }
.axis-track { height: 3px; margin-top: 3px; border-radius: 99px; background: var(--line); overflow: hidden; }
.axis-fill { display: block; height: 100%; border-radius: 99px; background: var(--teal); opacity: 0.65; }
.axis.is-muted .axis-value { color: var(--muted); }
.relation-note { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 11px; line-height: 1.7; }

.flow-card { border-top: 2px solid rgba(176, 138, 79, 0.45); }
.flow-card .card-head { margin-bottom: 12px; }
.flow-meta { margin: -4px 0 8px; color: var(--muted); font-family: var(--mono); font-size: 10px; line-height: 1.6; }
.flow-summary {
  margin: 0 0 12px;
  padding: 11px 13px;
  border: 1px solid rgba(176, 138, 79, 0.22);
  border-radius: 10px;
  background: rgba(246, 238, 220, 0.55);
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.7;
}
.flow-self { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 9px; }
.flow-self-item {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.4);
  color: var(--muted);
  font-size: 10.5px;
}
.flow-self-item b { color: var(--ink-soft); font-family: var(--mono); font-weight: 600; margin-right: 2px; }
.flow-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.flow-chip {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.35);
  font-size: 10.5px;
}
.flow-states { display: grid; gap: 7px; }
.flow-row {
  display: grid;
  grid-template-columns: 86px minmax(80px, 1fr) 200px;
  align-items: center;
  gap: 10px;
}
.flow-name { color: var(--ink-soft); font-size: 11.5px; }
.flow-bar { height: 7px; border-radius: 99px; background: var(--line); overflow: hidden; }
.flow-fill { display: block; height: 100%; border-radius: 99px; background: var(--teal); opacity: 0.75; }
.flow-nums { color: var(--muted); font-family: var(--mono); font-size: 10px; text-align: right; }
.flow-supplyAToB .flow-fill { background: #2f6f63; }
.flow-supplyBToA .flow-fill { background: #4f8d7f; }
.flow-repulse .flow-fill { background: var(--clay); }
.flow-parallelSelf .flow-fill { background: var(--gold); }
.flow-stuck .flow-fill { background: #9a8e7a; }
.flow-oneSide .flow-fill { background: #78938b; }
.flow-sameWay .flow-fill { background: #8a7a5c; }
.flow-neutral .flow-fill { background: #c9bca8; }
.flow-highlights { display: grid; gap: 7px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.flow-highlight {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 10px;
  align-items: baseline;
  padding-left: 10px;
  border-left: 2px solid var(--line-strong);
}
.flow-highlight b { color: var(--ink-soft); font-size: 11.5px; font-weight: 600; }
.flow-highlight span { color: var(--muted); font-size: 11.5px; line-height: 1.65; }
.flow-highlight.flow-supplyAToB { border-left-color: var(--teal); }
.flow-highlight.flow-supplyBToA { border-left-color: #4f8d7f; }
.flow-highlight.flow-repulse { border-left-color: var(--clay); }
.flow-highlight.flow-parallelSelf { border-left-color: var(--gold); }
.flow-highlight.flow-stuck { border-left-color: #9a8e7a; }
.flow-highlight.flow-oneSide { border-left-color: #78938b; }
.flow-highlight.flow-sameWay { border-left-color: #8a7a5c; }

.limits-card { background: linear-gradient(180deg, #fbf4e8, var(--card)); }
.limits { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.limits li { position: relative; padding: 8px 0 8px 14px; border-bottom: 1px dotted var(--line); color: var(--ink-soft); font-size: 12px; line-height: 1.65; }
.limits li:last-child { border-bottom: 0; }
.limits li::before { content: "·"; position: absolute; left: 1px; color: var(--clay); font-weight: 700; }
.limits-card .muted { margin: 12px 0 0; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 10.5px; line-height: 1.65; }

.feedback-card .card-head { margin-bottom: 14px; }
.rating { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 14px; }
.rating-btn {
  display: grid;
  gap: 2px;
  padding: 9px 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.35);
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.rating-btn span { font-family: var(--sans); color: var(--muted); font-size: 9.5px; }
.rating-btn:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.7); }
.rating-btn.is-selected { border-color: rgba(47, 111, 99, 0.5); background: var(--teal-soft); color: var(--teal-deep); }
.rating-btn.is-selected span { color: var(--teal); }
.feedback-card .field + .field { margin-top: 10px; }
.feedback-card .btn { margin-top: 13px; }
.feedback-status { min-height: 18px; margin: 9px 0 0; color: var(--teal-deep); font-size: 11.5px; }
.feedback-status.is-error { color: var(--danger); }

.muted { color: var(--muted); }
.small { font-size: 11.5px; }
.hidden { display: none !important; }

.footer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 18px 24px 26px;
  border-top: 1px solid rgba(201, 188, 168, 0.5);
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.02em;
}
.footer-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes drift { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(5px); } }

@media (min-width: 1051px) {
  .column-result:has(> #result[hidden]) { position: sticky; top: 106px; }
}

@media (max-width: 1050px) {
  .layout { grid-template-columns: 1fr; width: min(900px, 100%); }
  .column-result:has(#result[hidden]):has(#result-loading[hidden]) { display: none; }
  .empty-state { min-height: 36vh; }
  .axes { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 760px) {
  body { font-size: 14px; }
  .topbar { position: relative; align-items: flex-start; flex-direction: column; gap: 12px; padding: 16px 18px; }
  .topbar-actions { width: 100%; justify-content: space-between; }
  .pills { gap: 5px; }
  .pill { font-size: 10.5px; }
  .layout { padding: 18px 14px 48px; gap: 18px; }
  .page-intro { padding: 24px 18px 0; }
  .page-intro h1 { font-size: 28px; }
  .page-intro p:last-child { font-size: 13px; }
  .intro-note { display: none; }
  .brand-text small { font-size: 11px; }
  .pill { max-width: 100%; white-space: normal; }
  .topbar-actions { align-items: flex-start; gap: 8px; }
  #new-session { flex: none; }
  .optional-section { padding: 0; }
  .optional-section > summary { padding: 17px; }
  .optional-body { padding: 0 17px 17px; }
  .optional-body .card { padding: 17px 0 0; }
  .field > span { font-size: 13px; }
  input, select, textarea { font-size: 16px; }
  input[type="date"], input[type="datetime-local"] { min-width: 0; font-size: 14px; }
  #result, .result-loading { scroll-margin-top: 16px; }
  .btn-small { min-height: 38px; }
  .prompt-chips button { min-height: 38px; }
  .btn-icon { min-width: 38px; min-height: 38px; }
  .rating-btn { min-height: 56px; }
  .card { padding: 17px; border-radius: 15px; }
  .card-head h2 { font-size: 22px; }
  .grid-2, .grid-3, .readout-grid { grid-template-columns: 1fr; }
  .card-head-row { flex-direction: column; }
  .card-head-row .btn { align-self: flex-start; }
  .empty-state { min-height: 36vh; padding: 30px 20px; }
  .empty-state h2 { font-size: 25px; }
  .axes { grid-template-columns: repeat(2, 1fr); }
  .flow-row { grid-template-columns: 72px 1fr; }
  .flow-nums { grid-column: 2; text-align: left; }
  .flow-highlight { grid-template-columns: 72px 1fr; }
  .advice-section { grid-template-columns: 26px 1fr; gap: 9px; }
  .rating { gap: 5px; }
  .rating-btn { padding: 8px 3px; }
  .report-at { margin-left: 0; flex: 1; min-width: 0; }
  .report-head { flex-wrap: wrap; }
  .footer { text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
