:root {
  color-scheme: light;
  --ink: #27231d;
  --muted: #6f6659;
  --paper: #fffdf8;
  --cream: #f6f0e6;
  --cream-strong: #eadfce;
  --forest: #315f4a;
  --forest-soft: #e7f0e9;
  --bronze: #8a6539;
  --line: rgba(67, 54, 38, 0.15);
  --danger: #a43f33;
  --shadow: 0 18px 50px rgba(45, 37, 27, 0.09);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  line-height: 1.65;
  letter-spacing: 0;
}

button, input { font: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

.tools-header {
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 9px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(250, 247, 240, 0.96);
  backdrop-filter: blur(14px);
}

.tools-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 4px 10px 4px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: #47351f;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.tools-brand img {
  display: block;
  width: 48px;
  height: 27px;
  object-fit: contain;
}

.tools-header-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tools-language {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid rgba(74, 54, 35, 0.2);
  border-radius: 999px;
  background: var(--paper);
}

.tools-language a,
.tools-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 11px;
  border: 0;
  background: transparent;
  color: #47351f;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.tools-language a.is-active {
  background: var(--ink);
  color: var(--paper);
}

.tools-menu-toggle {
  border: 1px solid rgba(74, 54, 35, 0.2);
  border-radius: 999px;
  background: var(--paper);
}

.tools-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  width: min(310px, calc(100vw - 28px));
  max-height: calc(100vh - 90px);
  max-height: calc(100dvh - 90px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.tools-header-actions.is-open .tools-menu { display: grid; }

.tools-menu a {
  padding: 10px 11px;
  border-radius: 7px;
  color: #47351f;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.tools-menu a:hover,
.tools-menu a:focus-visible,
.tools-menu a.is-current { background: #f0e6d7; }

.tools-shell {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 56px 0 120px;
}

.tools-hero {
  display: grid;
  gap: 18px;
  padding: 20px 0 40px;
}

.tools-eyebrow,
.section-kicker {
  margin: 0;
  color: var(--bronze);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tools-hero h1 {
  max-width: 900px;
  margin: 0;
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: clamp(38px, 7vw, 78px);
  font-weight: 500;
  line-height: 1.06;
}

.tools-lead {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.tools-audience-note {
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.platform-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 15px 17px;
}

.platform-item + .platform-item { border-left: 1px solid var(--line); }

.platform-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 7px;
  background: #6f5638;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.platform-item.is-primary .platform-mark { background: var(--forest); }
.platform-copy { min-width: 0; }
.platform-copy strong { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; font-size: 15px; }
.platform-copy strong em {
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--forest-soft);
  color: var(--forest);
  font-size: 10px;
  font-style: normal;
  letter-spacing: 0.02em;
}
.platform-copy p { margin: 3px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }

.tools-store-link {
  display: inline-flex;
  margin-top: 4px;
  color: var(--forest);
  font-size: 12px;
  font-weight: 900;
}

.access-panel,
.tool-workspace,
.history-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.access-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(360px, 1.2fr);
  gap: 34px;
  align-items: center;
  padding: 28px;
}

.access-copy h2,
.section-heading h2,
.tool-workspace h2,
.history-dialog h2 {
  margin: 4px 0 0;
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: 28px;
  font-weight: 500;
  line-height: 1.25;
}

.access-copy p:last-child { margin: 10px 0 0; color: var(--muted); }
.access-form { display: grid; gap: 9px; }
.access-form label { font-size: 13px; font-weight: 900; }
.access-input-row { display: grid; grid-template-columns: 1fr auto; gap: 9px; }

.access-input-row input {
  min-width: 0;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(67, 54, 38, 0.25);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.access-input-row input:focus-visible {
  outline: 3px solid rgba(49, 95, 74, 0.18);
  border-color: var(--forest);
}

.button {
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 900;
  cursor: pointer;
}

.button-dark { background: var(--ink); color: #fff; }
.button-dark:hover { background: #3c342a; }
.button:disabled { cursor: wait; opacity: 0.6; }

.button-link {
  padding: 3px 0;
  border: 0;
  background: transparent;
  color: var(--forest);
  font-weight: 900;
  cursor: pointer;
}

.access-message { min-height: 24px; margin: 0; font-size: 13px; }
.access-message[data-tone="error"] { color: var(--danger); }
.access-message[data-tone="success"] { color: var(--forest); }
.access-status-row { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 13px; }
.access-device-note { margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }

.tools-section { padding: 72px 0 0; }

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

.section-heading > p { max-width: 540px; margin: 0; color: var(--muted); }
.section-heading.compact { align-items: center; margin-bottom: 10px; }

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

.tool-card {
  position: relative;
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 15px;
  align-items: start;
  min-height: 164px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(45, 37, 27, 0.05);
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.tool-card:hover,
.tool-card:focus-visible {
  border-color: rgba(49, 95, 74, 0.55);
  box-shadow: 0 16px 38px rgba(45, 37, 27, 0.1);
  transform: translateY(-2px);
  outline: none;
}

.tool-card.is-locked { background: rgba(255, 253, 248, 0.62); }

.tool-visual {
  position: relative;
  display: block;
  width: 78px;
  height: 78px;
}

.tool-visual img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 6px;
  object-fit: cover;
  background: #ece4d8;
}

.tool-number {
  position: absolute;
  right: -5px;
  bottom: -5px;
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--forest-soft);
  color: var(--forest);
  font-family: Georgia, serif;
  font-size: 15px;
  font-weight: 700;
}

.tool-card-copy { min-width: 0; }
.tool-card h3 { margin: 0; font-size: 18px; line-height: 1.35; }
.tool-card p { margin: 7px 0 28px; color: var(--muted); font-size: 14px; }

.tool-card-status {
  position: absolute;
  right: 18px;
  bottom: 16px;
  color: var(--forest);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.tool-card.is-locked .tool-card-status { color: #876f50; }

.tool-workspace {
  margin-top: 42px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  scroll-margin-top: 84px;
}

.tool-workspace[hidden] { display: none; }

.tool-workspace-head {
  display: flex;
  gap: 15px;
  align-items: center;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.tool-back {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--cream);
  color: var(--ink);
  font-size: 21px;
  cursor: pointer;
}

.measurement-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.75fr);
  gap: 26px;
  padding-top: 24px;
}

.measurement-main,
.measurement-side { min-width: 0; }

.measurement-instructions {
  max-width: 760px;
  margin: 0 0 14px;
  color: var(--muted);
}

.measurement-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 14px;
  padding: 0;
  border-block: 1px solid var(--line);
  list-style: none;
}

.measurement-guide li {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.measurement-guide li + li { border-left: 1px solid var(--line); }
.measurement-guide span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 50%;
  background: var(--forest);
  color: #fff;
  font-family: Georgia, serif;
  font-size: 12px;
}

.measurement-stage {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 280px;
  padding: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f3ea;
  text-align: center;
}

.measurement-orbit {
  position: relative;
  display: grid;
  place-items: center;
  width: 154px;
  height: 154px;
  border: 1px solid rgba(49, 95, 74, 0.22);
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 0 0 14px rgba(49, 95, 74, 0.045), 0 0 0 29px rgba(49, 95, 74, 0.025);
}

.measurement-tool-image {
  display: block;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(45, 37, 27, 0.14);
}

.measurement-stage.is-listening .measurement-orbit {
  animation: listenPulse 1.15s ease-in-out infinite;
}

@keyframes listenPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 14px rgba(49, 95, 74, 0.045), 0 0 0 29px rgba(49, 95, 74, 0.025); }
  50% { transform: scale(1.025); box-shadow: 0 0 0 22px rgba(49, 95, 74, 0.06), 0 0 0 42px rgba(49, 95, 74, 0); }
}

.measurement-countdown {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(246, 240, 230, 0.91);
  font-family: Georgia, serif;
  font-size: 92px;
  color: var(--forest);
}

.measurement-countdown.is-visible { display: grid; }

.measurement-status { margin: 18px 0 0; font-weight: 900; }
.measurement-timer { margin: 3px 0 0; color: var(--muted); font-variant-numeric: tabular-nums; }

.level-meter {
  width: min(100%, 320px);
  height: 9px;
  margin-top: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(39, 35, 29, 0.1);
}

.level-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--forest), #9a7a43);
  transition: width 90ms linear;
}

.measurement-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.measurement-actions .button { min-width: 170px; }
.button-secondary { border-color: var(--line); background: var(--cream); color: var(--ink); }

.result-panel {
  display: grid;
  gap: 12px;
  min-height: 100%;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf7ef;
}

.result-panel[hidden] { display: none; }
.result-label { color: var(--muted); font-size: 12px; font-weight: 900; text-transform: uppercase; }
.result-primary { margin: 0; font-family: Georgia, serif; font-size: clamp(38px, 6vw, 58px); font-weight: 500; line-height: 1; }
.result-secondary { margin: 0; color: var(--forest); font-size: 20px; font-weight: 900; }
.result-copy { margin: 0; color: var(--muted); }
.result-details { display: grid; gap: 7px; margin: 4px 0 0; }
.result-details div { display: flex; justify-content: space-between; gap: 14px; padding-top: 8px; border-top: 1px solid var(--line); }
.result-details dt { color: var(--muted); }
.result-details dd { margin: 0; text-align: right; font-weight: 900; }

.tool-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

.tool-options button {
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.tool-options button.is-active { border-color: var(--forest); background: var(--forest); color: #fff; }

.history-section { margin-top: 72px; padding: 26px; }
.history-privacy { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.history-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }

.history-item {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbf7ef;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.history-item strong,
.history-item span { overflow-wrap: anywhere; }
.history-item span { color: var(--forest); font-weight: 900; }
.history-item small { color: var(--muted); }
.history-empty { grid-column: 1 / -1; margin: 0; color: var(--muted); }

.history-dialog {
  width: min(540px, calc(100% - 28px));
  max-height: calc(100vh - 40px);
  padding: 26px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 28px 80px rgba(39, 35, 29, 0.24);
}

.history-dialog::backdrop { background: rgba(39, 35, 29, 0.5); }
.dialog-close { float: right; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--cream); cursor: pointer; font-size: 20px; }
.history-dialog > p { color: var(--muted); }
.history-dialog dl { display: grid; gap: 0; margin: 18px 0 0; }
.history-dialog dl div { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 14px; padding: 11px 0; border-top: 1px solid var(--line); }
.history-dialog dt { color: var(--muted); }
.history-dialog dd { margin: 0; font-weight: 900; text-align: right; overflow-wrap: anywhere; }

.technical-details { margin-top: 16px; color: var(--muted); font-size: 12px; }
.technical-details summary { cursor: pointer; font-weight: 900; }
.technical-details p { margin: 8px 0 0; }

body.is-measuring .zuden-consult-dock,
body.is-measuring .zuden-ai-panel { display: none !important; }

@media (max-width: 860px) {
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .access-panel { grid-template-columns: 1fr; gap: 20px; }
  .measurement-layout { grid-template-columns: 1fr; }
  .history-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .tools-header { min-height: 58px; padding: 9px 12px; }
  .tools-brand { max-width: 165px; gap: 6px; padding: 4px 7px 4px 5px; font-size: 12px; }
  .tools-brand img { width: 40px; height: 24px; }
  .tools-brand span { overflow: hidden; text-overflow: ellipsis; }
  .tools-header-actions { gap: 6px; }
  .tools-language a, .tools-menu-toggle { min-height: 34px; padding: 0 8px; font-size: 12px; }
  .tools-menu { grid-template-columns: 1fr; width: min(280px, calc(100vw - 24px)); }
  .tools-shell { width: min(100% - 24px, 1180px); padding: 22px 0 102px; }
  .tools-hero { gap: 9px; padding: 10px 0 20px; }
  .tools-hero h1 { font-size: 30px; line-height: 1.12; }
  .tools-lead { font-size: 14px; line-height: 1.55; }
  .tools-audience-note { grid-template-columns: 1fr; }
  .platform-item { grid-template-columns: 38px minmax(0, 1fr); gap: 10px; padding: 10px 12px; }
  .platform-item + .platform-item { border-top: 1px solid var(--line); border-left: 0; }
  .platform-mark { width: 38px; height: 38px; font-size: 10px; }
  .platform-copy strong { font-size: 13px; }
  .platform-copy p { font-size: 11.5px; }
  .access-panel, .history-section { padding: 15px; }
  .access-panel { gap: 12px; }
  .access-copy p:last-child { font-size: 13px; }
  .access-input-row { grid-template-columns: minmax(0, 1fr) auto; }
  .access-input-row .button { width: auto; padding-inline: 13px; }
  .access-device-note { margin-top: 6px; font-size: 11px; line-height: 1.5; }
  .access-status-row { align-items: start; }
  .tools-section { padding-top: 36px; }
  .section-heading { display: grid; gap: 12px; margin-bottom: 18px; }
  .section-heading h2, .access-copy h2, .tool-workspace h2 { font-size: 23px; }
  .section-heading > p { font-size: 13px; }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tool-card { display: block; min-height: 194px; padding: 0 0 34px; overflow: hidden; }
  .tool-visual { width: 100%; height: 82px; }
  .tool-visual img { border-radius: 0; }
  .tool-number { right: 8px; bottom: -13px; width: 28px; height: 28px; font-size: 13px; }
  .tool-card-copy { display: block; padding: 12px 10px 0; }
  .tool-card h3 { font-size: 15px; line-height: 1.3; }
  .tool-card p { display: -webkit-box; margin: 5px 0 0; overflow: hidden; font-size: 11.5px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .tool-card-status { right: 10px; bottom: 10px; left: 10px; font-size: 10px; }
  .tool-workspace { margin-top: 28px; scroll-margin-top: 68px; }
  .tool-workspace-head { padding-bottom: 16px; }
  .measurement-layout { gap: 15px; padding-top: 18px; }
  .measurement-instructions { font-size: 13px; line-height: 1.55; }
  .measurement-guide { grid-template-columns: 1fr; }
  .measurement-guide li { padding: 8px 4px; }
  .measurement-guide li + li { border-top: 1px solid var(--line); border-left: 0; }
  .measurement-stage { min-height: 285px; padding: 24px 18px; }
  .measurement-orbit { width: 142px; height: 142px; }
  .measurement-tool-image { width: 108px; height: 108px; }
  .measurement-actions { display: grid; }
  .measurement-actions .button { width: 100%; }
  .result-panel { padding: 18px; }
  .result-primary { font-size: 44px; }
  .history-section { margin-top: 48px; }
  .history-list { grid-template-columns: 1fr; }
  .history-dialog { padding: 20px; }
}

@media (max-width: 350px) {
  .access-input-row { grid-template-columns: 1fr; }
  .access-input-row .button { width: 100%; }
  .tool-grid { grid-template-columns: 1fr; }
}

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

/* ── 工具七：颂钵音色光谱 ───────────────────────────────── */
.spectrum-chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 120px;
  margin: 14px 0 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--cream);
}

.spectrum-chart span {
  flex: 1 1 0;
  min-width: 2px;
  border-radius: 3px 3px 1px 1px;
  background: linear-gradient(180deg, var(--forest), var(--bronze));
}

/* ── 工具八：缽組音準檢定 ───────────────────────────────── */
.bowl-set-list {
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.bowl-set-list li {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 0.7fr) minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.bowl-set-list span { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.bowl-set-list strong { font-weight: 900; overflow-wrap: anywhere; }
.bowl-set-list em { color: var(--forest); font-style: normal; font-weight: 900; text-align: right; font-variant-numeric: tabular-nums; }

#bowl-set-finish { width: 100%; margin-top: 16px; }

/* ── 工具九：睡眠声音日记 ───────────────────────────────── */
.sleep-stage {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  text-align: center;
}

.sleep-stage .measurement-status { margin-top: 0; }

.sleep-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.sleep-stats div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--cream);
}

.sleep-stats span { display: block; color: var(--muted); font-size: 12px; }
.sleep-stats strong { display: block; margin-top: 4px; font-size: 20px; font-variant-numeric: tabular-nums; }

.sleep-curve {
  display: flex;
  align-items: flex-end;
  gap: 1px;
  height: 72px;
  margin-top: 14px;
  padding: 6px 8px;
  border-radius: 10px;
  background: var(--cream-strong);
}

.sleep-curve span {
  flex: 1 1 0;
  min-width: 1px;
  border-radius: 2px;
  background: var(--forest);
}

.sleep-note { margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

.sleep-records { display: grid; gap: 8px; margin: 12px 0; }

.sleep-record {
  display: grid;
  gap: 3px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.sleep-record strong { font-weight: 900; }
.sleep-record span { color: var(--forest); font-weight: 900; font-variant-numeric: tabular-nums; }
.sleep-record em { color: var(--muted); font-style: normal; font-size: 13px; line-height: 1.5; }

@media (max-width: 560px) {
  .spectrum-chart { height: 96px; gap: 1px; padding: 8px; }
  .bowl-set-list li { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); font-size: 13px; }
  .sleep-stage { padding: 15px; }
  .sleep-stats { gap: 8px; }
  .sleep-stats strong { font-size: 18px; }
  .sleep-note { font-size: 12px; }
}
