:root {
  color-scheme: light;
  --bg: #fff8f0;
  --surface: #fffdf8;
  --surface-soft: #f7f0ff;
  --surface-warm: #fff0d9;
  --ink: #241733;
  --muted: #71657c;
  --soft: #9587a0;
  --line: #eaded0;
  --teal: #168978;
  --teal-dark: #0d6155;
  --coral: #ef6a64;
  --mustard: #d99a1e;
  --violet: #7b5bd6;
  --blue: #347fbc;
  --rose: #f17aa3;
  --night: #251634;
  --night-soft: #332046;
  --moon: #ffe28a;
  --danger: #b42318;
  --danger-soft: #fff0ed;
  --shadow: 0 18px 42px rgba(60, 31, 70, 0.12);
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", sans-serif;
  --font-display: "SF Pro Display", "PingFang SC", "Microsoft YaHei", var(--font-ui);
  --weight-hero: 760;
  --weight-title: 700;
  --weight-strong: 650;
  --weight-action: 720;
  font-family: var(--font-ui);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--night) 0 360px, var(--bg) 360px 100%);
  color: var(--ink);
  font-family: var(--font-ui);
  font-weight: 400;
  letter-spacing: 0;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18px 18px, rgba(255, 226, 138, 0.18) 0 2px, transparent 3px),
    radial-gradient(circle at 74px 38px, rgba(255, 253, 248, 0.12) 0 1px, transparent 2px),
    linear-gradient(135deg, rgba(241, 122, 163, 0.16), transparent 34%),
    linear-gradient(225deg, rgba(22, 137, 120, 0.18), transparent 38%);
  background-size: 116px 90px, 142px 120px, 100% 360px, 100% 360px;
  z-index: -1;
}

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

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

a {
  color: inherit;
  text-decoration: none;
}

.admin-shell {
  width: min(1420px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 44px;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 244px minmax(0, 1fr);
}

.main-column {
  min-width: 0;
  padding: 24px;
}

.topbar,
.section-head,
.brand,
.top-actions,
.submit-row,
.release-head {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  color: #fffaf0;
}

.brand {
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--moon);
  color: var(--night);
  box-shadow: inset -12px 0 0 rgba(36, 23, 51, 0.18), 0 0 32px rgba(255, 226, 138, 0.22);
}

.brand-mark svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.4;
}

.brand strong {
  display: block;
  font-size: 1.05rem;
}

.brand small,
.section-head p,
.choice-block > span,
.field span,
.range-field span,
.profile-row span,
.release-head span,
.emotion-grid span,
.emotion-sentence span,
.stat span,
.journal-item small {
  color: var(--muted);
  font-size: 0.82rem;
}

.sidebar .brand small,
.topbar .page-title p {
  color: #d8c8e7;
}

.page-title h1 {
  margin: 0;
  color: #fffaf0;
  font-size: 24px;
  line-height: 1.2;
}

.page-title p {
  margin: 5px 0 0;
  font-size: 14px;
  line-height: 1.45;
}

.moon-widget {
  display: grid;
  min-width: 220px;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(255, 226, 138, 0.32);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.1);
  color: #fffaf0;
  padding: 10px 12px;
  backdrop-filter: blur(12px);
}

.moon-face {
  position: relative;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 50%;
  background: var(--moon);
  color: var(--night);
  box-shadow: inset -12px 0 0 rgba(36, 23, 51, 0.18);
}

.moon-face::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  right: 9px;
  top: 12px;
  border-radius: 50%;
  background: rgba(36, 23, 51, 0.2);
  box-shadow: -13px 16px 0 rgba(36, 23, 51, 0.14);
}

.moon-copy strong,
.moon-copy span {
  display: block;
}

.moon-copy strong {
  font-size: 13px;
}

.moon-copy span {
  margin-top: 3px;
  color: #d8c8e7;
  font-size: 12px;
  line-height: 1.35;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  gap: 24px;
  border-right: 1px solid rgba(255, 226, 138, 0.18);
  background: linear-gradient(180deg, #21142f, #2b1a3a 54%, #fff8f0 54%);
  padding: 24px 18px;
}

.sidebar .brand {
  padding: 0 8px;
}

.sidebar .brand-mark {
  width: 34px;
  height: 34px;
  box-shadow: inset -10px 0 0 rgba(36, 23, 51, 0.18);
}

.sidebar .brand strong {
  color: #fffaf0;
  font-size: 16px;
  line-height: 1.1;
}

.brand-text small {
  display: block;
  margin-top: 3px;
  font-size: 12px;
}

.side-nav {
  display: grid;
  gap: 6px;
}

.side-nav button,
.side-nav a {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #d8c8e7;
  padding: 10px 12px;
  text-align: left;
}

.side-nav button:hover,
.side-nav a:hover {
  background: rgba(255, 226, 138, 0.12);
  color: #fffaf0;
}

.side-nav button.active {
  background: var(--moon);
  color: var(--night);
}

.nav-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  stroke-width: 2.1;
}

.side-nav button.active .nav-icon {
  stroke-width: 2.3;
}

.sidebar-note {
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  padding: 14px;
}

.sidebar-note strong {
  display: block;
  color: var(--night);
  font-size: 13px;
}

.sidebar-note p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.top-actions {
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ghost-button,
.subtle-button,
.primary-button,
.chip,
.mode-chip {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.ghost-button,
.subtle-button {
  min-height: 38px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
}

.ghost-button.active,
.chip.active,
.mode-chip.active {
  border-color: rgba(123, 91, 214, 0.24);
  background: #f2ebff;
  color: var(--violet);
  font-weight: 650;
}

.topbar .ghost-button {
  border-color: rgba(255, 253, 248, 0.22);
  background: rgba(255, 253, 248, 0.13);
  color: #fffaf0;
}

.topbar .ghost-button.active {
  border-color: transparent;
  background: var(--moon);
  color: var(--night);
}

.primary-button {
  min-height: 46px;
  padding: 0 18px;
  background: var(--night);
  color: #fffaf0;
  border: 0;
  font-weight: 760;
  box-shadow: 0 16px 34px rgba(60, 31, 70, 0.14);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.ghost-button:hover,
.subtle-button:hover,
.chip:hover,
.mode-chip:hover,
.primary-button:hover {
  transform: translateY(-1px);
}

.hero-grid,
.workspace-grid,
.lower-grid,
.admin-grid {
  display: grid;
  gap: 16px;
}

.hero-grid {
  grid-template-columns: minmax(0, 1fr) 330px;
  margin-bottom: 16px;
}

.workspace-grid {
  grid-template-columns: minmax(420px, 0.96fr) minmax(360px, 1.04fr);
}

.lower-grid {
  grid-template-columns: minmax(360px, 0.92fr) minmax(360px, 1.08fr);
  margin-top: 16px;
}

.lunar-panel,
.stats-panel,
.input-panel,
.reflection-panel,
.history-panel,
.context-panel,
.admin-login,
.admin-dashboard section,
.modal {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  border-radius: 8px;
  overflow: hidden;
}

.lunar-panel {
  min-height: 250px;
  position: relative;
  overflow: hidden;
  padding: clamp(22px, 4vw, 42px);
  border-color: rgba(255, 253, 248, 0.18);
  background:
    linear-gradient(135deg, rgba(255, 226, 138, 0.12), transparent 34%),
    linear-gradient(225deg, rgba(22, 137, 120, 0.16), transparent 42%),
    #18111f;
  color: #fffaf0;
}

.lunar-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 12% 28%, rgba(255, 253, 248, 0.13) 0 1px, transparent 2px),
    radial-gradient(circle at 22% 62%, rgba(255, 226, 138, 0.18) 0 1px, transparent 2px),
    radial-gradient(circle at 84% 18%, rgba(255, 253, 248, 0.14) 0 1px, transparent 2px);
  background-size: 120px 90px;
  opacity: 0.7;
}

.moon-scene {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.moon-disc {
  position: absolute;
  right: clamp(22px, 8vw, 92px);
  top: 28px;
  width: clamp(126px, 18vw, 220px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 36% 30%, #fff7d1 0 22%, transparent 23%),
    linear-gradient(145deg, var(--violet), var(--rose) 58%, var(--moon));
  box-shadow: 0 18px 42px rgba(123, 91, 214, 0.22), 0 0 70px rgba(255, 226, 138, 0.2);
  opacity: 0.82;
}

.orbit {
  position: absolute;
  border: 1px solid rgba(255, 253, 248, 0.12);
  border-radius: 50%;
  right: 2vw;
  top: -80px;
  width: 420px;
  height: 420px;
}

.orbit.two {
  right: -130px;
  top: 50px;
  width: 360px;
  height: 360px;
}

.hero-copy {
  position: relative;
  max-width: 720px;
  z-index: 1;
}

.hero-copy p:first-child,
.section-head p {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

h1 {
  max-width: 780px;
  margin-bottom: 14px;
  font-family: var(--font-display);
  font-weight: var(--weight-hero);
  font-size: clamp(2rem, 4.4vw, 3.75rem);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-family: var(--font-display);
  font-weight: var(--weight-title);
  font-size: clamp(1.08rem, 1.65vw, 1.34rem);
  line-height: 1.2;
}

.hero-copy p:last-child {
  max-width: 620px;
  color: #d8c8e7;
  font-size: 0.98rem;
  line-height: 1.68;
}

.stats-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
  background: #fffdf8;
}

body[data-has-entries="false"] .stats-panel {
  display: none;
}

.stat {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fffdf8, #fff7e8);
  box-shadow: 0 12px 28px rgba(60, 31, 70, 0.08);
}

.stat:nth-child(2) {
  background: linear-gradient(180deg, #fffdf8, #effaf8);
}

.stat:nth-child(3) {
  background: linear-gradient(180deg, #fffdf8, #f5efff);
}

.stat strong {
  display: block;
  margin-top: 6px;
  font-size: 1.85rem;
  color: var(--night);
}

#identityHint {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.input-panel,
.reflection-panel,
.history-panel,
.context-panel {
  padding: 18px;
}

.section-head {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

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

.field textarea,
.field input,
.profile-row input,
.profile-row select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  outline: none;
}

.field textarea {
  min-height: 220px;
  padding: 16px;
  resize: vertical;
  line-height: 1.7;
}

.field textarea:focus,
.field input:focus,
.profile-row input:focus,
.profile-row select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(31, 122, 104, 0.14);
}

.voice-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 154px;
  gap: 12px;
  align-items: stretch;
}

.voice-text-field {
  min-width: 0;
}

.dictation-card {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  min-height: 220px;
  padding: 14px;
  border: 1px solid rgba(22, 137, 120, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(232, 249, 244, 0.88), rgba(255, 253, 248, 0.94)),
    #fffdf8;
  box-shadow: 0 14px 30px rgba(60, 31, 70, 0.08);
  text-align: center;
  transition: background 420ms ease, border-color 420ms ease, box-shadow 420ms ease;
}

.dictation-card::before {
  content: "";
  position: absolute;
  inset: -36% -42% 20%;
  pointer-events: none;
  background:
    radial-gradient(circle at 25% 38%, rgba(123, 168, 231, 0.42), transparent 34%),
    radial-gradient(circle at 76% 30%, rgba(123, 91, 214, 0.34), transparent 36%),
    radial-gradient(circle at 50% 78%, rgba(22, 137, 120, 0.22), transparent 38%);
  filter: blur(18px);
  opacity: 0;
  transition: opacity 420ms ease;
}

.dictation-card > * {
  position: relative;
  z-index: 1;
}

.dictation-button {
  display: grid;
  place-items: center;
  gap: 8px;
  width: 116px;
  min-height: 116px;
  padding: 14px;
  border: 1px solid rgba(22, 137, 120, 0.28);
  border-radius: 50%;
  background: var(--teal);
  color: #fffdf8;
  cursor: pointer;
  font-weight: var(--weight-action);
  line-height: 1.18;
  text-align: center;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
  box-shadow: 0 18px 34px rgba(22, 137, 120, 0.22);
}

.dictation-button svg {
  width: 24px;
  height: 24px;
  stroke-width: 2.2;
}

.dictation-button:hover {
  transform: translateY(-1px);
}

.dictation-button.active {
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 253, 248, 0.95), transparent 16%),
    radial-gradient(circle at center, #7ba8e7, #7b5bd6 58%, #241633);
  box-shadow:
    0 0 0 8px rgba(123, 168, 231, 0.14),
    0 0 0 18px rgba(22, 137, 120, 0.08),
    0 18px 38px rgba(36, 22, 51, 0.28);
  animation: voiceMicBreath 10s ease-in-out infinite;
}

.dictation-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
  background: var(--soft);
  box-shadow: none;
}

.dictation-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

body[data-dictation-state="listening"] .dictation-card {
  border-color: rgba(123, 168, 231, 0.3);
  background:
    linear-gradient(180deg, rgba(28, 20, 61, 0.92), rgba(51, 32, 88, 0.86)),
    #241633;
  color: #fffdf8;
  box-shadow: 0 22px 48px rgba(36, 22, 51, 0.22);
}

body[data-dictation-state="listening"] .dictation-card::before {
  opacity: 1;
  animation: voicePanelBreath 10s ease-in-out infinite;
}

body[data-dictation-state="listening"] .dictation-card p {
  color: rgba(255, 253, 248, 0.78);
}

.dictation-card.unavailable {
  min-height: auto;
  justify-items: start;
  text-align: left;
  padding: 11px 12px;
  background: #fffdf8;
  box-shadow: none;
}

.self-check-details {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.72);
}

.self-check-details summary {
  min-height: 44px;
  padding: 12px 14px;
  color: var(--night);
  cursor: pointer;
  font-weight: 760;
  list-style-position: inside;
}

.self-check-body {
  padding: 0 12px 12px;
}

.control-grid,
.profile-row {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

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

.listening-note {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(22, 137, 120, 0.16);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(232, 249, 244, 0.82), rgba(255, 253, 248, 0.88));
}

.listening-note svg {
  width: 18px;
  height: 18px;
  margin: 2px auto 0;
  color: var(--teal-dark);
}

.listening-note strong {
  display: block;
  color: var(--night);
  font-size: 0.95rem;
}

.listening-note p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.93rem;
}

.range-field {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(60, 31, 70, 0.06);
}

.range-field input {
  grid-column: 1 / -1;
  width: 100%;
  accent-color: var(--violet);
}

.self-rating-grid {
  align-items: stretch;
}

.rating-field {
  --rating-accent: var(--violet);
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto minmax(152px, 1fr) auto;
  align-items: start;
  min-height: 242px;
  cursor: ns-resize;
  touch-action: none;
}

.rating-field[data-rating-field="stress"],
.rating-field[data-rating-field="post-stress"] {
  --rating-accent: var(--coral);
}

.rating-field[data-rating-field="energy"] {
  --rating-accent: var(--teal);
}

.rating-field > strong {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  color: var(--night);
  font-size: 2rem;
  line-height: 1;
}

.rating-field > small {
  grid-column: 1;
  grid-row: 2;
  min-height: 20px;
  color: var(--muted);
  line-height: 1.35;
}

.rating-field .vertical-range {
  grid-column: 1 / -1;
  grid-row: 3;
  justify-self: center;
  align-self: center;
  width: 54px;
  min-width: 54px;
  height: 154px;
  margin: 10px 0;
  border: 0;
  background: transparent;
  accent-color: var(--rating-accent);
  -webkit-appearance: slider-vertical;
  writing-mode: vertical-rl;
  direction: rtl;
  touch-action: none;
}

.rating-field.dragging {
  border-color: rgba(22, 137, 120, 0.42);
  box-shadow: 0 0 0 4px rgba(22, 137, 120, 0.1), 0 10px 26px rgba(60, 31, 70, 0.06);
}

.rating-field .vertical-range:focus-visible {
  outline: 3px solid rgba(31, 122, 104, 0.22);
  outline-offset: 4px;
}

.rating-field .vertical-range::-webkit-slider-runnable-track {
  width: 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--rating-accent), rgba(36, 23, 51, 0.12));
}

.rating-field .vertical-range::-webkit-slider-thumb {
  width: 34px;
  height: 34px;
  margin-left: -11px;
  border: 3px solid #fffdf8;
  border-radius: 50%;
  background: var(--rating-accent);
  box-shadow: 0 6px 16px rgba(60, 31, 70, 0.18);
}

.rating-field .vertical-range::-moz-range-track {
  width: 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--rating-accent), rgba(36, 23, 51, 0.12));
}

.rating-field .vertical-range::-moz-range-thumb {
  width: 30px;
  height: 30px;
  border: 3px solid #fffdf8;
  border-radius: 50%;
  background: var(--rating-accent);
  box-shadow: 0 6px 16px rgba(60, 31, 70, 0.18);
}

.rating-scale {
  grid-column: 1 / -1;
  grid-row: 4;
  display: flex;
  width: 100%;
  justify-content: space-between;
  color: var(--muted);
  font-style: normal;
  font-size: 0.78rem;
}

.post-check .rating-field {
  min-height: 214px;
  margin-top: 10px;
  box-shadow: none;
}

.choice-block {
  margin-top: 16px;
}

.choice-block > span {
  display: block;
  margin-bottom: 8px;
}

.chip-row,
.mode-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  min-height: 36px;
  padding: 0 12px;
}

.mode-chip {
  flex: 1 1 150px;
  min-height: 58px;
  padding: 10px 12px;
  text-align: left;
}

.mode-chip strong,
.mode-chip span {
  display: block;
}

.mode-chip span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.profile-row {
  grid-template-columns: 150px repeat(2, minmax(0, 1fr));
}

.profile-row label {
  display: grid;
  gap: 7px;
}

.profile-row input,
.profile-row select {
  min-height: 42px;
  padding: 0 11px;
}

.emotion-output,
.release-card,
.public-context,
.weekly-map {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.78);
  box-shadow: 0 16px 34px rgba(60, 31, 70, 0.08);
}

.emotion-output {
  border-color: rgba(123, 91, 214, 0.18);
  background:
    linear-gradient(135deg, rgba(255, 253, 248, 0.9), rgba(247, 240, 255, 0.76)),
    rgba(255, 253, 248, 0.78);
}

.draft-preview {
  box-shadow: none;
}

.draft-preview .emotion-grid,
.draft-preview .voice-row {
  display: none;
}

.draft-preview .emotion-sentence {
  margin-top: 0;
}

.response-output {
  margin-top: 0;
}

.release-head {
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.emotion-grid,
.release-metrics,
.admin-stats {
  display: grid;
  gap: 10px;
}

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

.emotion-grid article,
.release-metric,
.journal-item,
.context-item,
.admin-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(60, 31, 70, 0.06);
}

.emotion-grid article {
  padding: 12px;
}

.emotion-grid strong,
.emotion-sentence strong {
  display: block;
  margin: 6px 0 8px;
  color: var(--night);
}

.emotion-grid p,
.emotion-sentence p,
.journal-item p,
.context-item p,
.reflection-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.58;
}

.emotion-sentence {
  margin-top: 10px;
  padding: 12px;
  border-left: 4px solid var(--violet);
  background: linear-gradient(135deg, #f7f0ff 0%, #fff8e8 100%);
  border-radius: 6px;
}

.voice-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(123, 91, 214, 0.14);
  flex-wrap: wrap;
}

.voice-row span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.voice-button {
  min-height: 36px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(58, 38, 88, 0.18);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--night);
  font-weight: 760;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.voice-button:hover {
  transform: translateY(-1px);
  border-color: rgba(123, 91, 214, 0.42);
}

.voice-button.active {
  background: var(--night);
  color: #fffaf0;
  border-color: var(--night);
}

.voice-button.quiet {
  background: rgba(255, 253, 248, 0.66);
  color: var(--muted);
}

.voice-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.submit-row {
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.submit-row span {
  color: var(--muted);
}

.reflection-area {
  min-height: 320px;
}

.empty-state {
  display: grid;
  min-height: 320px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  padding: 22px;
  line-height: 1.6;
  background: #fafcfb;
}

.release-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.release-metric {
  padding: 12px;
}

.release-metric strong {
  display: block;
  margin-top: 6px;
  font-size: 1.35rem;
}

.release-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(36, 23, 51, 0.08);
  overflow: hidden;
  margin: 12px 0;
}

.release-bar i {
  display: block;
  height: 100%;
  width: var(--release-width, 30%);
  background: linear-gradient(90deg, var(--coral), var(--moon), var(--teal));
}

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

.reflection-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.reflection-item span {
  color: var(--muted);
  font-size: 0.78rem;
}

.action-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.action-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(60, 31, 70, 0.06);
}

.action-card span {
  display: block;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.45;
}

.mini-button {
  min-width: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
}

.mini-button.active {
  border-color: var(--teal);
  background: #effaf8;
  color: var(--teal-dark);
}

.feedback-row,
.continuation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}

.feedback-row > span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.feedback-row.compact {
  margin-top: 10px;
}

.continuity-card,
.memory-panel {
  border: 1px solid rgba(73, 64, 56, 0.12);
  background: rgba(255, 255, 255, 0.62);
  border-radius: 8px;
  padding: 12px;
  margin: 12px 0;
}

.continuity-card.subtle {
  background: rgba(247, 250, 244, 0.72);
}

.continuity-card strong,
.memory-item strong {
  display: block;
  color: var(--ink);
}

.continuity-card p,
.memory-item p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.memory-item {
  display: grid;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid rgba(73, 64, 56, 0.1);
}

.memory-item:first-of-type {
  border-top: 0;
}

.continuation-panel {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(22, 137, 120, 0.16);
  border-radius: 8px;
  background: #fffdf8;
}

.followup-form {
  display: grid;
  gap: 10px;
}

.followup-dictation-card {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  justify-items: stretch;
  min-height: 0;
  padding: 10px;
  text-align: left;
}

.followup-dictation-card::before {
  inset: -60% -20% -40%;
}

.followup-dictation-button {
  width: 54px;
  min-height: 54px;
  gap: 0;
  padding: 0;
}

.followup-dictation-button span {
  display: none;
}

.followup-form textarea {
  width: 100%;
  min-height: 112px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  resize: vertical;
}

.followup-list {
  display: grid;
  gap: 10px;
}

.followup-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.followup-item > p {
  margin: 0 0 10px;
  color: var(--ink);
  line-height: 1.58;
}

.post-check {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(22, 137, 120, 0.22);
  border-radius: 8px;
  background: #effaf8;
}

.journal-list {
  display: grid;
  gap: 10px;
}

.journal-item {
  padding: 13px;
}

.journal-item h3,
.journal-item h4 {
  margin: 0 0 8px;
  line-height: 1.25;
}

.tag-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  background: #eef4f2;
  color: var(--teal-dark);
  font-size: 0.76rem;
}

.context-disclosure {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(22, 137, 120, 0.16);
  border-radius: 8px;
  background: rgba(247, 250, 244, 0.72);
}

.context-disclosure summary {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--teal-dark);
  font-weight: 900;
  list-style: none;
  cursor: pointer;
}

.context-disclosure summary::-webkit-details-marker {
  display: none;
}

.context-disclosure summary::after {
  content: "+";
  width: 24px;
  height: 24px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: rgba(22, 137, 120, 0.12);
}

.context-disclosure[open] summary::after {
  content: "-";
}

.context-disclosure p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.weekly-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.weekly-day {
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #ffffff;
  color: var(--muted);
}

.weekly-day strong,
.weekly-day span {
  display: block;
}

.weekly-day span {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 5px;
}

.context-list {
  display: grid;
  gap: 10px;
}

.context-item {
  padding: 12px;
}

.support-tools {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.support-tool {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(60, 31, 70, 0.06);
}

.support-tool p {
  margin: 4px 0 10px;
  color: var(--muted);
  line-height: 1.5;
}

.tool-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: #eef4f2;
  color: var(--teal-dark);
}

.tool-icon svg,
.mini-button svg {
  width: 16px;
  height: 16px;
}

.mini-button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 11px;
}

.mini-button.active,
.support-tool .mini-button.active {
  border-color: var(--teal);
  background: #effaf8;
  color: var(--teal-dark);
}

.mini-button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.breath-visual {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(123, 91, 214, 0.12), rgba(22, 137, 120, 0.18));
  color: var(--night);
  font-weight: 780;
}

.breath-visual.active {
  animation: breathe 10s ease-in-out infinite;
}

.breath-visual.inhale {
  transform: scale(1.08);
}

.breath-visual.exhale {
  transform: scale(0.88);
}

.breath-guide.compact {
  display: grid;
  gap: 5px;
  max-width: 360px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(22, 137, 120, 0.16);
  border-radius: 8px;
  background: linear-gradient(135deg, #effaf8, #fffaf1);
}

.breath-guide.compact strong {
  color: var(--night);
  font-size: 0.9rem;
}

.breath-guide.compact span,
.breath-guide.compact em {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  line-height: 1.4;
}

.breath-guide.compact i {
  display: block;
  width: 0%;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), #7b5bd6);
  transition: width 300ms ease;
}

.mindful-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 8px 0 10px;
}

.mindful-categories button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(22, 137, 120, 0.14);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 780;
}

.mindful-categories button.active {
  border-color: var(--teal);
  background: #effaf8;
}

.mindful-prompt {
  margin-top: 10px;
  padding: 13px;
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  background: linear-gradient(135deg, #effaf8, #fff8e8);
  color: var(--night);
  line-height: 1.55;
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(0.88);
  }

  48%,
  58% {
    transform: scale(1.08);
  }
}

@keyframes voicePanelBreath {
  0%,
  100% {
    transform: scale(0.94) translate3d(0, 0, 0);
    filter: blur(18px) saturate(0.9);
  }

  40% {
    transform: scale(1.08) translate3d(2%, -1%, 0);
    filter: blur(20px) saturate(1.18);
  }
}

@keyframes voiceMicBreath {
  0%,
  100% {
    box-shadow:
      0 0 0 8px rgba(123, 168, 231, 0.12),
      0 0 0 16px rgba(22, 137, 120, 0.06),
      0 16px 36px rgba(36, 22, 51, 0.24);
  }

  40% {
    box-shadow:
      0 0 0 13px rgba(123, 168, 231, 0.18),
      0 0 0 28px rgba(123, 91, 214, 0.08),
      0 22px 54px rgba(36, 22, 51, 0.34);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dictation-button.active,
  body[data-dictation-state="listening"] .dictation-card::before,
  .breath-visual.active {
    animation: none;
  }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(23, 32, 29, 0.54);
  z-index: 20;
}

.modal {
  width: min(560px, 100%);
  padding: 22px;
}

.resource-list {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}

.resource-card {
  padding: 12px;
  border: 1px solid rgba(180, 35, 24, 0.22);
  border-radius: 8px;
  background: var(--danger-soft);
  color: var(--ink);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
  z-index: 30;
}

.brand strong,
.moon-copy strong,
.section-head h2,
.release-head strong,
.journal-item h3,
.journal-item h4,
.support-tool strong,
.action-card strong,
.reflection-item p {
  font-weight: var(--weight-title);
}

.primary-button,
.ghost-button,
.subtle-button,
.mini-button,
.chip,
.mode-chip,
.tag,
.mindful-categories button,
.side-nav button,
.side-nav a {
  font-weight: var(--weight-action);
}

.section-head p,
.reflection-item span,
.emotion-grid span,
.release-metric span {
  font-weight: var(--weight-strong);
}

.admin-shell {
  width: min(1180px, calc(100vw - 32px));
}

.admin-login {
  width: min(460px, 100%);
  margin: 12vh auto 0;
  padding: 20px;
  display: grid;
  gap: 18px;
}

.admin-dashboard {
  display: grid;
  gap: 16px;
}

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

.admin-card {
  padding: 14px;
}

.admin-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1.5rem;
}

.admin-grid {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.8fr);
}

.admin-grid section {
  padding: 18px;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .main-column {
    width: auto;
    margin: 0;
    padding: 14px 12px 36px;
  }

  .sidebar {
    position: sticky;
    top: 0;
    min-height: 100vh;
    align-items: center;
    gap: 14px;
    border-right: 1px solid rgba(255, 226, 138, 0.18);
    border-bottom: 0;
    background: linear-gradient(180deg, #21142f, #2b1a3a 72%, #fff8f0 72%);
    padding: 14px 10px;
  }

  .sidebar .brand {
    justify-content: center;
    padding: 0;
  }

  .sidebar .brand-text,
  .side-nav button span:not(.nav-icon),
  .side-nav a span:not(.nav-icon),
  .sidebar-note {
    display: none;
  }

  .side-nav {
    display: grid;
    gap: 8px;
    overflow: visible;
    width: 100%;
  }

  .side-nav button,
  .side-nav a {
    justify-content: center;
    width: 100%;
    min-width: 0;
    padding: 9px;
  }

  .hero-grid,
  .workspace-grid,
  .lower-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }

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

  .profile-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .admin-shell {
    width: min(100vw - 20px, 1420px);
    padding-top: 10px;
  }

  .app-shell {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    padding-bottom: 0;
  }

  .main-column {
    width: auto;
    min-width: 0;
    padding: 10px 10px 32px;
  }

  .main-column main {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .workspace-grid {
    order: 1;
  }

  #todaySection {
    order: 2;
  }

  .lower-grid {
    order: 3;
  }

  body[data-has-entries="false"] .stats-panel {
    display: none;
  }

  .sidebar {
    position: sticky;
    top: 0;
    inset: auto;
    z-index: 2;
    display: flex;
    min-height: 100vh;
    padding: 12px 8px;
    border-top: 0;
    border-right: 1px solid rgba(255, 226, 138, 0.18);
    background: linear-gradient(180deg, #21142f, #2b1a3a 72%, #fff8f0 72%);
  }

  .sidebar .brand {
    display: flex;
    justify-content: center;
    padding: 0;
  }

  .sidebar .brand-text,
  .sidebar-note,
  .side-nav button span:not(.nav-icon),
  .side-nav a span:not(.nav-icon) {
    display: none;
  }

  .side-nav {
    grid-template-columns: 1fr;
    gap: 8px;
    width: 100%;
  }

  .side-nav button,
  .side-nav a {
    min-height: 42px;
    justify-content: center;
    padding: 9px;
  }

  .nav-icon {
    width: 22px;
    height: 22px;
  }

  .topbar,
  .submit-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar {
    gap: 8px;
    margin-bottom: 10px;
  }

  .top-actions {
    display: grid;
    width: 100%;
    grid-template-columns: auto auto auto;
    gap: 8px;
    justify-content: start;
  }

  .moon-widget {
    display: none;
  }

  .page-title h1 {
    font-size: 18px;
  }

  .page-title p {
    display: none;
  }

  h1 {
    font-size: clamp(1.7rem, 8vw, 2.15rem);
  }

  .hero-copy p:last-child {
    font-size: 0.92rem;
  }

  .lunar-panel {
    min-height: 160px;
  }

  .lunar-panel,
  .input-panel,
  .reflection-panel,
  .history-panel,
  .context-panel {
    padding: 14px;
  }

  .voice-entry {
    grid-template-columns: 1fr;
  }

  .dictation-card {
    grid-template-columns: 88px minmax(0, 1fr);
    justify-items: start;
    min-height: 112px;
    text-align: left;
  }

  .dictation-card.unavailable {
    display: block;
    min-height: auto;
  }

  .dictation-button {
    width: 84px;
    min-height: 84px;
    padding: 10px;
    font-size: 0.78rem;
  }

  .dictation-button svg {
    width: 21px;
    height: 21px;
  }

  .control-grid,
  .stats-panel,
  .emotion-grid,
  .release-metrics,
  .reflection-grid,
  .admin-stats {
    grid-template-columns: 1fr;
  }

  .field textarea {
    min-height: 168px;
  }

  body[data-has-draft="false"] .self-check-details,
  body[data-has-draft="false"] .draft-preview {
    display: none;
  }

  .primary-flow {
    margin-top: 12px;
  }

  .self-check-details[open] .control-grid {
    margin-top: 10px;
  }

  .rating-field {
    min-height: 210px;
    grid-template-rows: auto auto minmax(120px, 1fr) auto;
  }

  .rating-field .vertical-range {
    height: 128px;
  }

  .feedback-row,
  .continuation-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .feedback-row .mini-button,
  .continuation-actions button {
    width: 100%;
    min-height: 42px;
  }

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

  .action-card {
    grid-template-columns: 1fr;
  }

  .support-tool {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .breath-visual {
    grid-column: 2;
    justify-self: start;
  }
}
