:root {
  --design-width: 1180px;
  --app-scale: 1;
  --app-width: 100vw;
  --app-height: 100vh;
  --bg: oklch(0.967 0.011 92);
  --paper: oklch(0.992 0.006 90);
  --paper-warm: oklch(0.975 0.019 78);
  --paper-cool: oklch(0.973 0.013 126);
  --line: oklch(0.874 0.026 76);
  --line-strong: oklch(0.792 0.052 68);
  --ink: oklch(0.214 0.025 58);
  --muted: oklch(0.482 0.035 62);
  --soft: oklch(0.638 0.031 66);
  --orange: oklch(0.672 0.154 48);
  --orange-dark: oklch(0.508 0.128 43);
  --orange-soft: oklch(0.944 0.043 58);
  --green: oklch(0.55 0.072 136);
  --green-soft: oklch(0.949 0.026 132);
  --shadow: 0 26px 70px oklch(0.34 0.044 55 / 0.14);
  --shadow-soft: 0 14px 36px oklch(0.34 0.044 55 / 0.09);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  font-family: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: oklch(0.185 0.018 62);
  --paper: oklch(0.245 0.018 66);
  --paper-warm: oklch(0.285 0.025 68);
  --paper-cool: oklch(0.255 0.018 116);
  --line: oklch(0.39 0.025 66 / 0.72);
  --line-strong: oklch(0.5 0.045 62 / 0.82);
  --ink: oklch(0.91 0.018 78);
  --muted: oklch(0.7 0.025 72);
  --soft: oklch(0.58 0.024 72);
  --orange: oklch(0.72 0.14 50);
  --orange-dark: oklch(0.79 0.12 55);
  --orange-soft: oklch(0.32 0.055 50);
  --green: oklch(0.7 0.08 136);
  --green-soft: oklch(0.3 0.04 136);
  --shadow: 0 26px 70px oklch(0.08 0.018 58 / 0.48);
  --shadow-soft: 0 14px 36px oklch(0.08 0.018 58 / 0.34);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  overflow: hidden;
}

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

button {
  border: 0;
  cursor: pointer;
}

textarea {
  resize: none;
}

.app-shell {
  width: var(--app-width);
  min-width: var(--design-width);
  height: var(--app-height);
  min-height: var(--app-height);
  display: grid;
  grid-template-columns: 250px minmax(930px, 1fr);
  overflow: hidden;
  transform: scale(var(--app-scale));
  transform-origin: top left;
  background:
    linear-gradient(132deg, oklch(0.991 0.006 92) 0%, oklch(0.958 0.016 112) 42%, oklch(0.972 0.022 73) 100%);
}

.app-shell.auth-shell {
  width: 100vw;
  min-width: 0;
  height: auto;
  min-height: 100vh;
  display: block;
  grid-template-columns: none;
  transform: none;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 56px 28px;
  background:
    linear-gradient(132deg, oklch(0.991 0.006 92) 0%, oklch(0.958 0.016 112) 42%, oklch(0.972 0.022 73) 100%);
}

.auth-panel {
  width: min(560px, 100%);
  min-height: auto;
  display: grid;
  gap: 30px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 44px 48px;
  background: rgba(255, 253, 248, 0.88);
  box-shadow: var(--shadow);
}

.auth-brand {
  margin: 0;
  padding: 0 0 26px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.auth-brand .leaf-logo {
  width: 58px;
  height: 58px;
}

.auth-form {
  display: grid;
  gap: 20px;
}

.auth-form h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.2;
}

.auth-form p {
  margin: -8px 0 10px;
  color: var(--muted);
  line-height: 1.7;
}

.auth-form label {
  display: grid;
  gap: 8px;
  color: #604b3d;
  font-size: 14px;
  font-weight: 800;
}

.auth-form input {
  height: 48px;
  border: 1px solid #ead6c2;
  border-radius: 8px;
  outline: 0;
  padding: 0 14px;
  color: var(--ink);
  background: #fffaf3;
}

.auth-submit {
  width: 100%;
  margin-top: 6px;
}

.auth-links {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.text-link {
  justify-self: center;
  color: var(--orange-dark);
  background: transparent;
  font-weight: 800;
}

.auth-help-text {
  line-height: 1.2;
}

.sidebar {
  position: relative;
  min-height: var(--app-height);
  padding: 32px 22px 54px;
  background: rgba(255, 253, 248, 0.82);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 8px 46px;
}

.leaf-logo {
  width: 50px;
  height: 50px;
}

.brand-name {
  font-size: 26px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-subtitle {
  margin-top: 5px;
  font-size: 15px;
  color: #4d392c;
}

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

.side-nav-item {
  height: 58px;
  padding: 0 20px;
  border-radius: 9px;
  color: #4e3c31;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 17px;
  text-align: left;
}

.side-nav-item.active {
  color: var(--orange);
  background: #fbf1e6;
}

.icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.icon svg,
.header-icon svg,
.search-box svg,
.entry-card > svg {
  width: 100%;
  height: 100%;
}

.growth-card {
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px 26px;
  background: rgba(255, 253, 248, 0.72);
}

.desk-art.small {
  width: 154px;
  height: 104px;
  display: block;
  margin: 0 auto 10px;
  border-radius: 8px;
  object-fit: cover;
  object-position: center;
  border: 1px solid rgba(220, 188, 148, 0.38);
  box-shadow: 0 10px 28px rgba(124, 83, 50, 0.08);
  filter: saturate(0.9) contrast(0.94) brightness(1.03);
}

.growth-title {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 12px;
}

.growth-card p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.8;
  font-size: 14px;
}

.outline-button,
.secondary-button,
.ghost-button {
  border: 1px solid #efb58e;
  color: var(--orange-dark);
  background: rgba(255, 250, 244, 0.7);
}

.outline-button {
  width: 100%;
  height: 40px;
  border-radius: 8px;
  font-size: 14px;
}

.workspace {
  min-height: var(--app-height);
  height: var(--app-height);
  overflow-y: auto;
  scrollbar-width: none;
}

.workspace::-webkit-scrollbar {
  display: none;
}

.top-header {
  height: 76px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  padding: 0 32px;
  background: rgba(255, 253, 248, 0.65);
}

.search-box {
  width: 318px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  color: #9c8d7f;
  font-size: 13px;
  background: #fffbf6;
}

.search-box input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
}

.search-box input::placeholder {
  color: #9c8d7f;
}

.search-box svg {
  width: 20px;
  height: 20px;
  color: #5f4739;
}

.search-box button {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #5f4739;
  background: transparent;
}

.search-box button:hover,
.search-box button:focus-visible {
  background: oklch(0.94 0.026 75);
}

.search-box button svg {
  width: 18px;
  height: 18px;
}

.header-icon,
.profile-button {
  background: transparent;
  color: #5b4538;
}

.notification-wrap {
  position: relative;
  display: grid;
  place-items: center;
}

.header-icon {
  position: relative;
  width: 32px;
  height: 32px;
}

.header-icon i {
  position: absolute;
  top: 2px;
  right: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--orange);
}

.notification-panel {
  position: fixed;
  top: 72px;
  right: 178px;
  z-index: 20;
  width: 286px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffbf6;
  box-shadow: var(--shadow-soft);
}

.notification-title {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 800;
}

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

.notification-item {
  width: 100%;
  display: grid;
  gap: 5px;
  padding: 10px;
  border-radius: 8px;
  color: var(--ink);
  text-align: left;
  background: transparent;
}

.notification-item:hover,
.notification-item:focus-visible {
  background: var(--orange-soft);
}

.notification-item strong {
  font-size: 14px;
}

.notification-item span,
.notification-item small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.profile-button {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 800;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-block;
  background:
    radial-gradient(circle at 50% 34%, #f1d1ae 0 14%, transparent 15%),
    linear-gradient(90deg, #1d3029 0 50%, #d9d2bd 51%);
  border: 1px solid #d7c6ad;
}

.down {
  font-family: sans-serif;
  color: #7d6758;
  background: transparent;
  padding: 4px 0;
}

.home-page {
  position: relative;
  max-width: 1540px;
  margin: 0 auto;
  padding: 58px clamp(36px, 4vw, 70px) 28px;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(320px, 24vw, 420px);
  gap: clamp(18px, 2vw, 28px);
  align-items: start;
  min-height: 288px;
}

.hero-copy {
  position: relative;
  z-index: 2;
  width: 100%;
  min-width: 0;
}

.hero h1 {
  margin: 0 0 30px 10px;
  font-size: 49px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: 0;
}

.desk-art.hero {
  position: relative;
  z-index: 3;
  justify-self: end;
  align-self: start;
  top: 124px;
  width: 100%;
  aspect-ratio: 3 / 2;
  height: auto;
  opacity: 1;
  border-radius: 12px;
  object-fit: cover;
  object-position: center;
  border: 1px solid rgba(220, 188, 148, 0.34);
  box-shadow: 0 22px 60px rgba(124, 83, 50, 0.1);
  filter: saturate(0.88) contrast(0.92) brightness(1.04);
}

.input-panel {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 249, 0.92);
  box-shadow: var(--shadow);
  padding: 20px 24px 18px;
}

.review-context {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding-bottom: 18px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(220, 201, 181, 0.72);
}

.context-group {
  min-width: 0;
}

.context-label {
  display: block;
  margin: 0 0 8px 4px;
  color: #7a6858;
  font-size: 13px;
  font-weight: 800;
}

.review-mode-row {
  width: 320px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: #f7eee5;
}

.review-mode-row button {
  height: 38px;
  border-radius: 9px;
  color: #6d594a;
  background: transparent;
  font-size: 15px;
  font-weight: 800;
}

.review-mode-row button.active {
  color: var(--orange-dark);
  background: #fff1e5;
  border: 1px solid #edc29f;
}

.context-chips {
  gap: 8px;
}

.context-chips .chip {
  min-width: 0;
  height: 36px;
  padding: 0 15px;
}

.input-panel textarea::placeholder,
.large-textarea::placeholder {
  color: #7f766f;
}

.structured-draft {
  display: grid;
  gap: 16px;
}

.draft-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.draft-field span {
  color: #5e4838;
  font-size: 14px;
  font-weight: 800;
}

.draft-field textarea {
  width: 100%;
  min-height: 92px;
  border: 1px solid #ead6c2;
  border-radius: 9px;
  outline: 0;
  padding: 13px 15px;
  color: var(--ink);
  background: #fffaf3;
  font-size: 15px;
  line-height: 1.7;
  overflow-y: hidden;
  resize: none;
}

.draft-date-field {
  max-width: 360px;
}

.draft-date-field input {
  width: 100%;
  height: 48px;
  border: 1px solid #ead6c2;
  border-radius: 9px;
  outline: 0;
  padding: 0 15px;
  color: var(--ink);
  background: #fffaf3;
  font-size: 15px;
}

.draft-field-main textarea {
  min-height: 108px;
  font-size: 16px;
}

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

.input-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  min-height: 52px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(220, 201, 181, 0.54);
  color: var(--muted);
  font-size: 13px;
}

.input-footer strong {
  min-width: 0;
  color: #6d5b4c;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-width: 134px;
  height: 44px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  line-height: 1;
}

.primary-button svg,
.secondary-button svg,
.ghost-button svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  display: block;
}

.primary-button {
  color: #fff9f2;
  background: linear-gradient(180deg, #ee8b54, var(--orange));
  box-shadow: 0 10px 20px rgba(214, 91, 40, 0.2);
}

.primary-button:disabled,
.secondary-button:disabled,
.ghost-button:disabled {
  cursor: progress;
  opacity: 0.68;
}

button {
  transition:
    transform 220ms var(--ease-out),
    box-shadow 220ms var(--ease-out),
    border-color 220ms var(--ease-out),
    background 220ms var(--ease-out),
    color 220ms var(--ease-out);
}

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

button:active {
  transform: translateY(0);
}

@keyframes recordRise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.entry-row {
  width: min(976px, calc(100% - 40px));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
  margin: 28px 0 28px 62px;
}

.entry-card {
  height: 112px;
  padding: 0 30px;
  border-radius: 10px;
  border: 1px solid var(--line);
  display: grid;
  grid-template-columns: 62px 1fr 22px;
  align-items: center;
  gap: 20px;
  text-align: left;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.78);
}

.entry-card.event {
  background: linear-gradient(135deg, rgba(247, 249, 237, 0.95), rgba(255, 253, 248, 0.82));
  border-color: #d7d9c6;
}

.entry-card.anxiety {
  background: linear-gradient(135deg, #fff8ef, #fff3e7);
  border-color: #efc8ad;
}

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

.entry-card small {
  color: #6e5949;
  font-size: 15px;
}

.entry-card > svg {
  color: #2d211a;
}

.entry-illustration {
  width: 56px;
  height: 56px;
  position: relative;
  display: inline-block;
}

.paper-icon::before {
  content: "";
  position: absolute;
  inset: 4px 12px 4px 6px;
  border: 2px solid #8d9b6d;
  border-radius: 7px;
  background: #fffaf0;
}

.paper-icon::after {
  content: "";
  position: absolute;
  right: 6px;
  bottom: 8px;
  width: 9px;
  height: 34px;
  border-radius: 5px;
  background: #e77735;
  transform: rotate(42deg);
  box-shadow: 0 0 0 2px #f7d1a9 inset;
}

.flower-icon::before,
.flower-icon::after {
  content: "";
  position: absolute;
  border-radius: 60% 60% 60% 10%;
  background: #ee8c59;
}

.flower-icon::before {
  left: 18px;
  top: 7px;
  width: 26px;
  height: 34px;
  transform: rotate(-35deg);
}

.flower-icon::after {
  left: 7px;
  top: 24px;
  width: 30px;
  height: 18px;
  transform: rotate(18deg);
  opacity: 0.42;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.06fr 0.93fr 1.05fr;
  gap: 18px;
  margin-top: 12px;
}

.panel {
  min-height: 318px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px 24px;
  background: rgba(255, 253, 248, 0.78);
  box-shadow: var(--shadow-soft);
}

.panel h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.panel-head button {
  display: flex;
  align-items: center;
  gap: 2px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
}

.panel-head svg {
  width: 14px;
  height: 14px;
}

.week-head {
  margin-bottom: 10px;
}

.calendar-toggle {
  height: 32px;
  padding: 0 8px 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf3;
}

.calendar-toggle svg {
  transition: transform 160ms ease;
}

.calendar-toggle.open svg {
  transform: rotate(90deg);
}

.recent-list {
  display: grid;
}

.recent-item {
  min-height: 55px;
  padding: 0 10px 0 6px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 48px;
  align-items: center;
  column-gap: 12px;
  color: var(--ink);
  background: transparent;
  border-top: 1px solid #eee0cd;
  text-align: left;
}

.recent-item:last-child {
  border-bottom: 1px solid #eee0cd;
}

.recent-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #9b6d31;
  background: #fff2dc;
  font-size: 18px;
}

.recent-icon svg {
  width: 19px;
  height: 19px;
}

.tone-1 {
  color: var(--orange);
  background: #fff0e7;
}

.tone-2 {
  color: #778d5a;
  background: #edf4e6;
}

.recent-item strong {
  display: block;
  font-size: 15px;
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-item small,
.recent-item em {
  color: var(--muted);
  font-size: 14px;
  font-style: normal;
}

.recent-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-item em {
  justify-self: end;
  min-width: 42px;
  text-align: right;
}

.week-content {
  display: grid;
  grid-template-columns: 180px 1fr;
  align-items: center;
  gap: 30px;
  margin: 18px 0 10px;
}

.ring {
  width: 144px;
  height: 144px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle, #fffdf8 0 54%, transparent 55%),
    conic-gradient(var(--orange) 0 var(--progress, 0%), #f8eadb var(--progress, 0%) 100%);
  box-shadow: inset 0 0 0 14px #fff6ed;
}

.ring span {
  font-size: 44px;
}

.ring small {
  font-size: 27px;
  color: #21170f;
}

.week-days {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.week-days li {
  display: grid;
  grid-template-columns: 1fr 22px;
  gap: 10px;
  align-items: center;
  color: #4e392e;
  font-size: 15px;
}

.week-days b {
  display: block;
  font-weight: 800;
}

.week-days small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.week-days .today {
  color: var(--orange-dark);
}

.week-days .today small {
  color: var(--orange-dark);
}

.week-days i {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #d5d1c8;
  color: #fffaf3;
  font-size: 11px;
  font-style: normal;
}

.week-days .done i {
  background: var(--orange);
}

.week-panel p {
  margin: 0 0 0 30px;
  color: #574236;
  line-height: 1.7;
  font-size: 16px;
}

.month-review {
  margin-top: 0;
}

.month-review.in-panel {
  min-height: 242px;
  display: grid;
  align-content: start;
}

.month-toolbar {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.month-toolbar select {
  height: 38px;
  border: 1px solid #e4cdb6;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: linear-gradient(180deg, #fffdf8, #fff3e5);
  font-size: 14px;
  font-weight: 800;
  outline: 0;
}

.month-arrow {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: var(--orange-dark);
  background: #fff0e4;
}

.month-arrow svg {
  width: 18px;
  height: 18px;
}

.month-weekdays,
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.month-weekdays {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.month-day {
  position: relative;
  aspect-ratio: 1;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #4e392e;
  background: #fffaf3;
  font-size: 13px;
}

.month-day.outside {
  color: #b4a392;
  background: #f8efe5;
}

.month-day.today {
  border-color: #e87538;
}

.month-day.has-record {
  color: #fff9f2;
  background: var(--orange);
  box-shadow: 0 8px 16px rgba(214, 91, 40, 0.18);
}

.month-day i {
  position: absolute;
  right: 4px;
  bottom: 3px;
  min-width: 14px;
  height: 14px;
  border-radius: 7px;
  color: var(--orange-dark);
  background: #fff8ed;
  font-size: 10px;
  font-style: normal;
  line-height: 14px;
}

.quote-art {
  width: 100%;
  height: 224px;
  margin-top: 18px;
  border-radius: 10px;
  display: block;
}

.footer-line {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  margin-top: 26px;
  color: var(--muted);
  font-size: 15px;
}

.footer-line::before,
.footer-line::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.content-page {
  max-width: 1224px;
  margin: 0 auto;
  padding: 50px 42px 64px;
}

.narrow-page {
  max-width: 900px;
}

.detail-page {
  max-width: 1180px;
  padding-top: 28px;
}

.page-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.page-header h1,
.list-title {
  margin: 0;
  font-size: 42px;
  line-height: 1.2;
  letter-spacing: 0;
}

.library-page {
  max-width: 1040px;
  padding-top: 46px;
}

.library-page-head {
  display: grid;
  gap: 10px;
  margin-bottom: 30px;
}

.library-page-head p {
  max-width: 560px;
  margin: 0;
  color: oklch(0.42 0.032 62);
  font-size: 17px;
  line-height: 1.7;
}

.back-button {
  width: 40px;
  height: 40px;
  border-radius: 20px;
  color: #5a4337;
  background: #fbf1e6;
}

.back-button svg {
  width: 24px;
  height: 24px;
}

.large-textarea {
  width: 100%;
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: 0;
  padding: 24px;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.86);
  box-shadow: var(--shadow-soft);
  font-size: 17px;
  line-height: 1.8;
}

.textarea-count {
  text-align: right;
  color: var(--muted);
  margin-top: 10px;
}

.field-title {
  margin: 24px 0 12px;
  font-size: 17px;
}

.chips,
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.library-filter-stack {
  display: grid;
  gap: 14px;
  margin-bottom: 28px;
}

.library-page > .filters,
.library-filter-stack .filters {
  margin: 0;
}

.library-filter-rule {
  height: 1px;
  background: oklch(0.855 0.025 76);
}

.chip {
  min-width: 64px;
  height: 36px;
  padding: 0 18px;
  border-radius: 12px;
  color: #5b493c;
  border: 1px solid transparent;
  background: oklch(0.943 0.018 78 / 0.76);
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.52);
}

.chip.selected {
  color: var(--orange-dark);
  background: linear-gradient(180deg, oklch(0.984 0.024 66), oklch(0.946 0.04 58));
  border: 1px solid #eeb98e;
  box-shadow: 0 10px 22px oklch(0.62 0.12 47 / 0.14), inset 0 1px 0 oklch(1 0 0 / 0.7);
}

.wide {
  width: 220px;
  margin-top: 32px;
}

.flow-tabs {
  width: 360px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 20px;
  border-radius: 12px;
  background: #f7eee5;
}

.flow-tabs button {
  height: 38px;
  border-radius: 9px;
  color: #6d594a;
  background: transparent;
  font-weight: 700;
}

.flow-tabs button.active {
  color: var(--orange-dark);
  background: #fff1e5;
  border: 1px solid #edc29f;
}

.small-tabs {
  margin-top: 18px;
}

.field-grid {
  display: grid;
  gap: 14px;
}

.result-source-card,
.result-card-section {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in oklab, var(--paper) 88%, transparent);
  box-shadow: var(--shadow-soft);
}

.result-source-card {
  padding: 20px 22px;
  margin-bottom: 18px;
}

.result-source-head,
.result-card-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.result-eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--orange-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.result-source-card h2,
.result-card-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
}

.result-source-card p {
  max-width: 72ch;
  margin: 16px 0 8px;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.8;
}

.result-source-card p p {
  margin: 0;
}

.result-source-card small,
.result-card-heading p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.result-source-card small {
  display: block;
}

.result-source-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.result-source-meta span {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--paper-warm);
  font-size: 12px;
}

.result-card-section {
  padding: 20px 22px 22px;
}

.result-card-heading {
  align-items: center;
  margin-bottom: 16px;
}

.result-card-heading p {
  max-width: 34ch;
  margin: 0;
  text-align: right;
}

.result-card-section .field-grid {
  margin-top: 0;
}

.detail-page .field-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.field-card,
.list-card,
.detail-hero {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.78);
  box-shadow: var(--shadow-soft);
}

.field-card {
  position: relative;
  padding: 20px 22px;
}

.detail-page .field-card {
  padding: 20px 22px;
}

.detail-page .field-card:nth-child(1),
.detail-page .field-card:nth-child(3),
.detail-page .field-card:nth-child(5) {
  grid-column: 1 / span 5;
}

.detail-page .field-card:nth-child(2),
.detail-page .field-card:nth-child(4),
.detail-page .field-card:nth-child(6) {
  grid-column: 6 / -1;
}

.detail-page .field-card:nth-child(4) {
  grid-row: span 2;
}

.field-card .number {
  position: absolute;
  top: 20px;
  right: 22px;
  width: 28px;
  height: 28px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--orange);
  background: #fff0e4;
  font-weight: 800;
}

.field-card h3,
.list-card h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.detail-page .field-card h3 {
  font-size: 18px;
  line-height: 1.35;
}

.field-card p,
.field-card ol,
.field-card ul,
.field-card blockquote,
.field-card pre,
.field-card h4,
.field-card h5,
.list-card p,
.list-card ol,
.list-card ul {
  margin: 0;
  color: #584438;
  line-height: 1.8;
  font-size: 15px;
}

.field-card p + p,
.field-card p + ul,
.field-card p + ol,
.field-card ul + p,
.field-card ol + p,
.field-card blockquote + p,
.field-card pre + p {
  margin-top: 8px;
}

.field-card ul,
.field-card ol,
.list-card ul,
.list-card ol {
  padding-left: 22px;
}

.field-card .task-list,
.list-card .task-list {
  display: grid;
  gap: 8px;
  padding-left: 0;
  list-style: none;
}

.field-card .task-list li,
.list-card .task-list li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.field-card .task-list input,
.list-card .task-list input {
  width: 15px;
  height: 15px;
  margin: 4px 0 0;
  accent-color: var(--orange);
}

.field-card li + li,
.list-card li + li {
  margin-top: 4px;
}

.field-card h4,
.field-card h5 {
  margin: 12px 0 6px;
  color: #3d2d23;
  line-height: 1.45;
}

.field-card blockquote {
  padding: 8px 12px;
  border-left: 3px solid var(--orange);
  background: oklch(0.964 0.024 76 / 0.72);
}

.field-card blockquote p + p {
  margin-top: 6px;
}

.field-card code,
.list-card code {
  padding: 2px 5px;
  border: 1px solid oklch(0.864 0.026 76);
  border-radius: 5px;
  color: oklch(0.39 0.075 48);
  background: oklch(0.973 0.02 78);
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 0.92em;
}

.field-card del,
.list-card del {
  color: var(--muted);
}

.field-card hr,
.list-card hr {
  width: 100%;
  height: 1px;
  margin: 16px 0;
  border: 0;
  background: var(--line);
}

.field-card img,
.list-card img {
  display: block;
  max-width: min(100%, 520px);
  height: auto;
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.markdown-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.field-card table,
.list-card table {
  width: 100%;
  min-width: 360px;
  margin: 12px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-collapse: collapse;
  border-radius: 8px;
  font-size: 14px;
}

.field-card th,
.field-card td,
.list-card th,
.list-card td {
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.field-card th,
.list-card th {
  color: var(--ink);
  background: var(--orange-soft);
  font-weight: 800;
}

.field-card tr:last-child td,
.list-card tr:last-child td {
  border-bottom: 0;
}

.field-card pre {
  overflow-x: auto;
  padding: 12px 14px;
  border: 1px solid oklch(0.864 0.026 76);
  border-radius: 8px;
  background: oklch(0.245 0.019 66);
}

.field-card pre code {
  padding: 0;
  border: 0;
  color: oklch(0.93 0.018 78);
  background: transparent;
}

.field-card a,
.list-card a {
  color: var(--orange-dark);
  font-weight: 800;
}

.assisted-field {
  display: grid;
  gap: 14px;
}

.field-source {
  display: grid;
  gap: 7px;
}

.field-source + .field-source {
  padding-top: 13px;
  border-top: 1px solid oklch(0.89 0.025 70);
}

.field-source > span {
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  color: oklch(0.43 0.06 65);
  background: oklch(0.955 0.025 72);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.field-source.ai-source > span {
  color: oklch(0.48 0.11 47);
  background: oklch(0.94 0.055 58);
}

.field-source.ai-source p,
.field-source.ai-source ol,
.field-source.ai-source ul,
.field-source.ai-source blockquote {
  color: oklch(0.39 0.045 54);
}

.detail-page .field-card p,
.detail-page .field-card ol,
.detail-page .field-card ul,
.detail-page .field-card blockquote,
.detail-page .field-card pre {
  max-width: 68ch;
  font-size: 16px;
  line-height: 1.86;
}

.action-row {
  display: flex;
  gap: 14px;
  margin-top: 24px;
}

.action-row.wrap {
  flex-wrap: wrap;
}

.filters {
  margin: 20px 0 28px;
}

.card-list,
.method-grid {
  display: grid;
  gap: 24px;
}

.search-section {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.search-section h2 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
}

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

.list-card {
  position: relative;
  padding: 23px 30px 0;
  overflow: hidden;
  border: 1px solid oklch(0.835 0.032 72);
  border-radius: 8px;
  background: oklch(0.993 0.005 92 / 0.95);
  box-shadow: 0 18px 46px oklch(0.34 0.044 55 / 0.08);
  transition:
    transform 260ms var(--ease-out),
    box-shadow 260ms var(--ease-out),
    border-color 260ms var(--ease-out),
    background 260ms var(--ease-out);
}

.list-card[data-detail],
.list-card[data-edit-method],
.list-card[data-edit-calibration] {
  cursor: pointer;
}

.list-card[data-detail]:hover,
.list-card[data-edit-method]:hover,
.list-card[data-edit-calibration]:hover {
  transform: translateY(-2px);
  border-color: oklch(0.78 0.052 64);
  box-shadow: 0 22px 56px oklch(0.34 0.044 55 / 0.12);
}

.list-card > span {
  display: inline-flex;
  margin-top: 12px;
  color: var(--orange-dark);
  font-weight: 800;
}

.list-card strong {
  display: block;
  color: #3d2d23;
  line-height: 1.7;
}

.record-list-card {
  display: grid;
  gap: 18px;
  animation: recordRise 520ms var(--ease-out) both;
}

.library-card {
  display: grid;
  gap: 18px;
}

.record-list-card::before {
  content: none;
}

.record-list-card:nth-child(2) {
  animation-delay: 46ms;
}

.record-list-card:nth-child(3) {
  animation-delay: 92ms;
}

.record-list-card:nth-child(4) {
  animation-delay: 138ms;
}

.record-list-card:nth-child(5) {
  animation-delay: 184ms;
}

.record-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.library-card-sections {
  align-items: stretch;
}

.method-card .library-card-sections {
  grid-template-columns: minmax(0, 1fr);
}

.record-preview-item {
  min-width: 0;
  padding: 14px 0 15px;
  border-top: 1px solid oklch(0.862 0.024 76);
  background: transparent;
}

.record-preview-item h4 {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0 0 9px;
  color: oklch(0.23 0.025 58);
  font-size: 15px;
  font-weight: 900;
}

.record-preview-item h4::before {
  content: "";
  width: 3px;
  height: 18px;
  border-radius: 3px;
  background: var(--orange);
}

.record-preview-item p,
.record-preview-item ol,
.record-preview-item ul {
  margin: 0;
  color: #4e3a31;
  font-size: 15px;
  line-height: 1.8;
}

.record-preview-item ol,
.record-preview-item ul {
  padding-left: 20px;
}

.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.record-title-stack {
  min-width: 0;
}

.library-card-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
}

.card-badge {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 6px 13px;
  border: 1px solid oklch(0.82 0.074 52);
  border-radius: 8px;
  color: var(--orange-dark);
  background: oklch(0.966 0.039 61);
  font-size: 15px;
  font-weight: 900;
}

.card-badge.soft {
  color: oklch(0.43 0.074 129);
  border-color: oklch(0.805 0.07 128);
  background: oklch(0.945 0.035 122);
}

.record-title-stack h3 {
  max-width: 760px;
  margin: 0;
  font-size: 22px;
  line-height: 1.45;
}

.record-meta {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 0;
  color: oklch(0.455 0.035 62);
  font-size: 16px;
}

.record-meta span + span::before {
  content: "·";
  margin-right: 10px;
  color: oklch(0.62 0.035 66);
}

.library-card-tools {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 14px;
  align-items: center;
  color: var(--muted);
}

.text-button {
  align-self: start;
  min-width: 52px;
  height: 32px;
  border-radius: 8px;
  color: var(--orange-dark);
  background: oklch(0.966 0.027 58 / 0.78);
  font-size: 14px;
  font-weight: 800;
}

.card-delete-button {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #9b2f1f;
  background: #fff0ed;
}

.card-delete-button:hover {
  color: #8a2719;
  border-color: #e0a093;
  background: #ffe5df;
}

.card-delete-button svg {
  width: 20px;
  height: 20px;
}

.inline-actions {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.calibration-card {
  min-height: 156px;
}

.calibration-card[data-edit-calibration]::after {
  content: "";
  position: absolute;
  right: 28px;
  bottom: 24px;
  width: 34px;
  height: 34px;
  border: 1px solid oklch(0.858 0.032 78);
  border-radius: 50%;
  background:
    linear-gradient(135deg, transparent 46%, oklch(0.48 0.07 128) 47% 54%, transparent 55%),
    oklch(0.965 0.019 118 / 0.74);
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 220ms var(--ease-out),
    transform 220ms var(--ease-out);
}

.calibration-card[data-edit-calibration]:hover::after {
  opacity: 1;
  transform: translateY(0);
}

.method-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.method-tags.compact-tags {
  margin-bottom: 0;
}

.method-tags span {
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 14px;
  color: var(--orange-dark);
  background: #fff0e4;
  font-size: 13px;
  font-weight: 800;
}

.method-step-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
}

.method-step-chips span {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  color: #4e3a31;
  font-size: 15px;
  line-height: 1.6;
}

.method-step-chips b {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid oklch(0.82 0.074 52);
  border-radius: 999px;
  color: var(--orange-dark);
  background: oklch(0.962 0.039 61);
  font-size: 13px;
  line-height: 1;
}

.status-pill {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 6px 13px;
  border: 1px solid oklch(0.79 0.055 132);
  border-radius: 8px;
  color: oklch(0.43 0.074 129);
  background: oklch(0.93 0.036 130);
  font-size: 14px;
  font-weight: 900;
}

.library-card-footer {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 14px;
  align-items: center;
  min-height: 56px;
  padding: 0;
  border-top: 1px solid oklch(0.862 0.024 76);
  color: #4e3a31;
}

.library-card-footer > span:first-child {
  color: #4e3a31;
  font-size: 15px;
}

.source-footer {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
}

.source-footer p {
  overflow: hidden;
  margin: 0;
  color: oklch(0.42 0.045 68);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-footer time {
  color: var(--muted);
  font-size: 14px;
}

.source-icon svg,
.library-arrow svg {
  width: 22px;
  height: 22px;
}

.library-arrow {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--muted);
  background: transparent;
}

.library-card-hit {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: transparent;
}

.library-card .danger-text,
.library-card a,
.library-card input,
.library-card textarea,
.library-card select {
  position: relative;
  z-index: 3;
}

.danger-button,
.danger-text {
  color: #9b2f1f;
  border-color: #e0a093;
  background: #fff0ed;
}

.danger-button {
  min-width: 96px;
  height: 44px;
  border: 1px solid #e0a093;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 800;
}

.method-editor {
  display: grid;
  gap: 18px;
}

.method-card.method-editor {
  grid-column: 1 / -1;
  padding: 28px;
}

.method-editor label,
.detail-editor label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.method-editor input,
.method-editor textarea,
.method-editor select,
.detail-editor input,
.detail-editor textarea,
.detail-editor select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  padding: 11px 12px;
  color: var(--ink);
  background: #fffaf3;
  font-size: 15px;
  line-height: 1.6;
}

.method-editor textarea {
  min-height: 136px;
  resize: vertical;
}

.method-editor textarea[data-method-steps] {
  min-height: 260px;
}

.detail-editor {
  display: grid;
  gap: 16px;
}

.record-edit-page .detail-editor {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.record-edit-page .detail-editor > label:has(textarea[data-record-raw]),
.record-edit-page .edit-fieldset {
  grid-column: 1 / -1;
}

.detail-editor textarea {
  min-height: 96px;
}

.edit-fieldset {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.record-edit-page .edit-fieldset {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.record-edit-page .edit-fieldset label:has(textarea) {
  min-width: 0;
}

.edit-fieldset legend {
  padding: 0 8px;
  color: var(--orange-dark);
  font-weight: 800;
}

.date-picker {
  min-width: 206px;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  background: #fffaf3;
  font-size: 14px;
  font-weight: 800;
}

.date-picker input {
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.action-row.compact {
  margin-top: 4px;
}

.follow-up-panel {
  margin-top: 22px;
}

.follow-up-panel .panel-head {
  margin-bottom: 12px;
}

.follow-up-panel .panel-head span {
  max-width: 520px;
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-hero {
  padding: 28px 30px;
  margin-bottom: 22px;
  background:
    linear-gradient(180deg, oklch(0.992 0.006 92 / 0.97), oklch(0.968 0.016 82 / 0.9));
  box-shadow: 0 1px 0 oklch(1 0 0 / 0.8) inset, var(--shadow-soft);
}

.detail-hero-title {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  margin-bottom: 14px;
}

.detail-hero h1 {
  min-width: 0;
  margin: 0;
  font-size: 32px;
  line-height: 1.34;
}

.detail-hero-title b {
  flex: 0 0 auto;
  padding: 7px 12px;
  border: 1px solid oklch(0.858 0.032 78);
  border-radius: 999px;
  color: oklch(0.43 0.074 129);
  background: oklch(0.957 0.02 122 / 0.72);
  font-size: 15px;
  line-height: 1;
}

.detail-hero p {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0;
  color: var(--muted);
}

.detail-hero span {
  color: oklch(0.43 0.032 62);
}

.toast {
  position: fixed;
  right: 34px;
  bottom: 28px;
  z-index: 30;
  max-width: 360px;
  padding: 13px 18px;
  border: 1px solid #efc5a7;
  border-radius: 10px;
  color: #7a3d21;
  background: #fff4e9;
  box-shadow: 0 14px 30px rgba(98, 67, 37, 0.16);
  font-size: 14px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(47, 32, 22, 0.28);
  backdrop-filter: blur(3px);
}

.confirm-modal {
  width: min(520px, 100%);
  border: 1px solid #edc6a3;
  border-radius: 12px;
  padding: 30px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(255, 247, 236, 0.98));
  box-shadow: 0 28px 70px rgba(65, 39, 22, 0.24);
}

.modal-mark {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--orange-dark);
  background: #fff0e4;
  margin-bottom: 18px;
}

.modal-mark svg {
  width: 26px;
  height: 26px;
}

.confirm-modal h2 {
  margin: 0 0 12px;
  font-size: 25px;
}

.confirm-modal p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

:root[data-theme="dark"] .app-shell,
:root[data-theme="dark"] .auth-page {
  background:
    radial-gradient(circle at 72% 8%, oklch(0.34 0.036 92 / 0.34), transparent 32rem),
    radial-gradient(circle at 16% 10%, oklch(0.28 0.035 128 / 0.26), transparent 30rem),
    linear-gradient(132deg, oklch(0.16 0.017 62), oklch(0.19 0.02 70) 48%, oklch(0.15 0.017 56));
}

:root[data-theme="dark"] .sidebar,
:root[data-theme="dark"] .top-header {
  background: oklch(0.22 0.018 66 / 0.86);
}

:root[data-theme="dark"] .auth-panel,
:root[data-theme="dark"] .growth-card,
:root[data-theme="dark"] .input-panel,
:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .field-card,
:root[data-theme="dark"] .list-card,
:root[data-theme="dark"] .detail-hero,
:root[data-theme="dark"] .large-textarea {
  background: linear-gradient(180deg, oklch(0.275 0.019 68 / 0.94), oklch(0.225 0.017 64 / 0.9));
  border-color: var(--line);
  box-shadow: var(--shadow-soft);
}

:root[data-theme="dark"] .auth-panel,
:root[data-theme="dark"] .input-panel,
:root[data-theme="dark"] .detail-hero {
  box-shadow: var(--shadow);
}

:root[data-theme="dark"] .brand-subtitle,
:root[data-theme="dark"] .side-nav-item,
:root[data-theme="dark"] .profile-button,
:root[data-theme="dark"] .header-icon,
:root[data-theme="dark"] .down,
:root[data-theme="dark"] .context-label,
:root[data-theme="dark"] .draft-field span,
:root[data-theme="dark"] .input-footer strong,
:root[data-theme="dark"] .entry-card small,
:root[data-theme="dark"] .week-days li,
:root[data-theme="dark"] .week-panel p,
:root[data-theme="dark"] .field-card p,
:root[data-theme="dark"] .field-card ol,
:root[data-theme="dark"] .field-card ul,
:root[data-theme="dark"] .field-card blockquote,
:root[data-theme="dark"] .field-card h4,
:root[data-theme="dark"] .field-card h5,
:root[data-theme="dark"] .list-card p,
:root[data-theme="dark"] .list-card ol,
:root[data-theme="dark"] .list-card ul,
:root[data-theme="dark"] .record-preview-item p,
:root[data-theme="dark"] .record-preview-item ol,
:root[data-theme="dark"] .record-preview-item ul,
:root[data-theme="dark"] .detail-hero span {
  color: var(--muted);
}

:root[data-theme="dark"] .field-card blockquote {
  background: oklch(0.3 0.03 66 / 0.62);
}

:root[data-theme="dark"] .field-card hr,
:root[data-theme="dark"] .list-card hr {
  background: var(--line);
}

:root[data-theme="dark"] .field-card img,
:root[data-theme="dark"] .list-card img,
:root[data-theme="dark"] .field-card table,
:root[data-theme="dark"] .list-card table,
:root[data-theme="dark"] .field-card th,
:root[data-theme="dark"] .field-card td,
:root[data-theme="dark"] .list-card th,
:root[data-theme="dark"] .list-card td {
  border-color: var(--line);
}

:root[data-theme="dark"] .field-card th,
:root[data-theme="dark"] .list-card th {
  color: var(--ink);
  background: oklch(0.32 0.055 50);
}

:root[data-theme="dark"] .field-card code,
:root[data-theme="dark"] .list-card code {
  color: oklch(0.84 0.06 62);
  background: oklch(0.2 0.017 62);
  border-color: var(--line);
}

:root[data-theme="dark"] .field-card pre {
  background: oklch(0.14 0.016 62);
  border-color: var(--line);
}

:root[data-theme="dark"] .field-card pre code {
  color: oklch(0.91 0.018 78);
  background: transparent;
}

:root[data-theme="dark"] .field-source + .field-source {
  border-color: oklch(0.38 0.025 66);
}

:root[data-theme="dark"] .field-source > span {
  color: oklch(0.82 0.035 72);
  background: oklch(0.34 0.025 68);
}

:root[data-theme="dark"] .field-source.ai-source > span {
  color: oklch(0.82 0.09 55);
  background: oklch(0.34 0.06 50);
}

:root[data-theme="dark"] .side-nav-item.active,
:root[data-theme="dark"] .review-mode-row button.active,
:root[data-theme="dark"] .flow-tabs button.active {
  color: var(--orange-dark);
  background: oklch(0.335 0.06 52 / 0.74);
  border-color: oklch(0.55 0.08 54 / 0.75);
}

:root[data-theme="dark"] .review-mode-row,
:root[data-theme="dark"] .flow-tabs {
  background: oklch(0.19 0.017 62 / 0.92);
}

:root[data-theme="dark"] .review-mode-row button,
:root[data-theme="dark"] .flow-tabs button {
  color: var(--muted);
}

:root[data-theme="dark"] .search-box,
:root[data-theme="dark"] .auth-form input,
:root[data-theme="dark"] .draft-field textarea,
:root[data-theme="dark"] .draft-date-field input,
:root[data-theme="dark"] .method-editor input,
:root[data-theme="dark"] .method-editor textarea,
:root[data-theme="dark"] .method-editor select,
:root[data-theme="dark"] .detail-editor input,
:root[data-theme="dark"] .detail-editor textarea,
:root[data-theme="dark"] .detail-editor select,
:root[data-theme="dark"] .date-picker,
:root[data-theme="dark"] .month-toolbar select {
  color: var(--ink);
  background: oklch(0.18 0.016 62 / 0.94);
  border-color: var(--line);
}

:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder,
:root[data-theme="dark"] .search-box input::placeholder {
  color: var(--soft);
}

:root[data-theme="dark"] .search-box,
:root[data-theme="dark"] .search-box svg,
:root[data-theme="dark"] .search-box button {
  color: var(--muted);
}

:root[data-theme="dark"] .search-box button:hover,
:root[data-theme="dark"] .search-box button:focus-visible,
:root[data-theme="dark"] .notification-item:hover,
:root[data-theme="dark"] .notification-item:focus-visible {
  background: var(--orange-soft);
}

:root[data-theme="dark"] .outline-button,
:root[data-theme="dark"] .secondary-button,
:root[data-theme="dark"] .ghost-button,
:root[data-theme="dark"] .calendar-toggle,
:root[data-theme="dark"] .back-button,
:root[data-theme="dark"] .month-arrow,
:root[data-theme="dark"] .text-button {
  color: var(--orange-dark);
  background: oklch(0.28 0.045 52 / 0.72);
  border-color: oklch(0.52 0.085 54 / 0.72);
}

:root[data-theme="dark"] .primary-button {
  color: oklch(0.17 0.018 58);
  background: linear-gradient(180deg, oklch(0.78 0.13 55), var(--orange));
  box-shadow: 0 12px 24px oklch(0.18 0.09 45 / 0.38);
}

:root[data-theme="dark"] .chip {
  color: var(--muted);
  background: oklch(0.245 0.02 68 / 0.9);
  border-color: oklch(0.36 0.025 68 / 0.62);
  box-shadow: inset 0 1px 0 oklch(0.9 0.02 78 / 0.06);
}

:root[data-theme="dark"] .chip.selected {
  color: var(--orange-dark);
  background: linear-gradient(180deg, oklch(0.36 0.055 54 / 0.9), oklch(0.29 0.045 52 / 0.9));
  border-color: oklch(0.58 0.095 54 / 0.76);
  box-shadow: 0 10px 22px oklch(0.1 0.035 54 / 0.28);
}

:root[data-theme="dark"] .entry-card {
  color: var(--ink);
  background: linear-gradient(135deg, oklch(0.26 0.02 72 / 0.94), oklch(0.215 0.017 62 / 0.9));
  border-color: var(--line);
}

:root[data-theme="dark"] .entry-card.event {
  background: linear-gradient(135deg, oklch(0.275 0.028 120 / 0.94), oklch(0.225 0.018 70 / 0.88));
  border-color: oklch(0.43 0.045 126 / 0.72);
}

:root[data-theme="dark"] .entry-card.anxiety {
  background: linear-gradient(135deg, oklch(0.3 0.04 52 / 0.94), oklch(0.235 0.022 62 / 0.9));
  border-color: oklch(0.5 0.08 52 / 0.72);
}

:root[data-theme="dark"] .recent-item {
  color: var(--ink);
  border-top-color: var(--line);
}

:root[data-theme="dark"] .recent-item:last-child {
  border-bottom-color: var(--line);
}

:root[data-theme="dark"] .recent-icon,
:root[data-theme="dark"] .tone-1 {
  color: var(--orange-dark);
  background: oklch(0.32 0.055 52 / 0.72);
}

:root[data-theme="dark"] .tone-2 {
  color: var(--green);
  background: oklch(0.29 0.045 136 / 0.72);
}

:root[data-theme="dark"] .ring {
  background:
    radial-gradient(circle, var(--paper) 0 54%, transparent 55%),
    conic-gradient(var(--orange) 0 var(--progress, 0%), oklch(0.28 0.03 68) var(--progress, 0%) 100%);
  box-shadow: inset 0 0 0 14px oklch(0.2 0.018 62);
}

:root[data-theme="dark"] .ring small {
  color: var(--ink);
}

:root[data-theme="dark"] .week-days i {
  color: oklch(0.18 0.016 62);
  background: oklch(0.45 0.018 70);
}

:root[data-theme="dark"] .month-day {
  color: var(--ink);
  background: oklch(0.22 0.018 66);
}

:root[data-theme="dark"] .month-day.outside {
  color: var(--soft);
  background: oklch(0.19 0.016 62);
}

:root[data-theme="dark"] .month-day.today {
  border-color: var(--orange);
}

:root[data-theme="dark"] .month-day.has-record {
  color: oklch(0.16 0.017 58);
  background: var(--orange);
  box-shadow: 0 8px 16px oklch(0.16 0.075 45 / 0.35);
}

:root[data-theme="dark"] .month-day i {
  color: oklch(0.16 0.017 58);
  background: oklch(0.86 0.06 70);
}

:root[data-theme="dark"] .list-card {
  background: linear-gradient(180deg, oklch(0.27 0.02 68 / 0.96), oklch(0.215 0.017 62 / 0.92));
  box-shadow: inset 0 1px 0 oklch(0.92 0.02 78 / 0.05), var(--shadow-soft);
}

:root[data-theme="dark"] .list-card[data-detail]:hover,
:root[data-theme="dark"] .list-card[data-edit-method]:hover,
:root[data-theme="dark"] .list-card[data-edit-calibration]:hover {
  border-color: oklch(0.57 0.08 58 / 0.82);
  box-shadow: inset 0 1px 0 oklch(0.92 0.02 78 / 0.06), 0 24px 58px oklch(0.08 0.018 58 / 0.42);
}

:root[data-theme="dark"] .list-card strong {
  color: var(--ink);
}

:root[data-theme="dark"] .record-list-card::before {
  background: linear-gradient(90deg, oklch(0.48 0.04 82), oklch(0.62 0.09 52));
  opacity: 0.52;
}

:root[data-theme="dark"] .record-preview-item {
  border-top-color: var(--line);
}

:root[data-theme="dark"] .record-preview-item h4,
:root[data-theme="dark"] .detail-hero-title b {
  color: oklch(0.78 0.065 78);
  background: oklch(0.305 0.035 82 / 0.72);
  border-color: oklch(0.46 0.042 82 / 0.66);
}

:root[data-theme="dark"] .field-card .number,
:root[data-theme="dark"] .method-tags span,
:root[data-theme="dark"] .card-badge,
:root[data-theme="dark"] .status-pill,
:root[data-theme="dark"] .modal-mark {
  color: var(--orange-dark);
  background: var(--orange-soft);
}

:root[data-theme="dark"] .card-badge,
:root[data-theme="dark"] .status-pill {
  border-color: oklch(0.5 0.07 52 / 0.76);
}

:root[data-theme="dark"] .card-badge.soft {
  color: var(--green);
  border-color: oklch(0.48 0.06 128 / 0.72);
  background: oklch(0.29 0.045 136 / 0.72);
}

:root[data-theme="dark"] .calibration-card[data-edit-calibration]::after {
  border-color: var(--line);
  background:
    linear-gradient(135deg, transparent 46%, var(--green) 47% 54%, transparent 55%),
    oklch(0.27 0.03 118 / 0.74);
}

:root[data-theme="dark"] .danger-button,
:root[data-theme="dark"] .danger-text {
  color: oklch(0.76 0.105 42);
  border-color: oklch(0.48 0.065 42 / 0.72);
  background: oklch(0.285 0.04 42 / 0.76);
}

:root[data-theme="dark"] .modal-backdrop {
  background: oklch(0.08 0.017 58 / 0.68);
  backdrop-filter: blur(4px);
}

:root[data-theme="dark"] .confirm-modal {
  border-color: var(--line-strong);
  background: linear-gradient(180deg, oklch(0.29 0.023 68 / 0.98), oklch(0.23 0.02 62 / 0.98));
  box-shadow: var(--shadow);
}

:root[data-theme="dark"] .toast {
  color: var(--orange-dark);
  background: oklch(0.23 0.035 52 / 0.96);
  border-color: oklch(0.58 0.095 54 / 0.72);
  box-shadow: 0 14px 30px oklch(0.08 0.018 58 / 0.44);
}

:root[data-theme="dark"] .desk-art {
  filter: saturate(0.72) contrast(0.92) brightness(0.72);
  border-color: oklch(0.46 0.035 66 / 0.55);
  box-shadow: 0 18px 48px oklch(0.08 0.018 58 / 0.36);
}

:root[data-theme="dark"] .quote-art {
  filter: saturate(0.72) contrast(0.92) brightness(0.7);
}

.theme-toggle {
  border-radius: 9px;
  display: grid;
  place-items: center;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  background: var(--orange-soft);
}

.auth-panel {
  position: relative;
}

.auth-theme-toggle {
  position: absolute;
  top: 18px;
  right: 18px;
}

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

@media (max-width: 1280px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 18px;
  }

  .desk-art.hero {
    top: 122px;
  }

  .review-context {
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 16px;
  }

  .review-mode-row {
    width: min(300px, 100%);
  }
}

/* ─────────────────────────────────────────────────────────────
   Editorial paper workspace — shared by the generated design board
   and the quick / advanced review flow.
   ───────────────────────────────────────────────────────────── */
:root {
  --bg: #f4eee4;
  --paper: #fffdf9;
  --paper-warm: #fbf2e5;
  --paper-cool: #f1f0e8;
  --line: #e6d7c4;
  --line-strong: #cdb397;
  --ink: #302820;
  --muted: #897d70;
  --soft: #b7aa9b;
  --orange: #bd7b43;
  --orange-dark: #80512e;
  --orange-soft: #f3e4d1;
  --green: #718561;
  --green-soft: #e7eddf;
  --shadow: 0 24px 60px rgba(79, 53, 31, 0.12);
  --shadow-soft: 0 12px 30px rgba(79, 53, 31, 0.08);
  font-family: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
}

.app-shell {
  grid-template-columns: 236px minmax(0, 1fr);
  background: var(--bg) !important;
}

.sidebar {
  padding: 28px 16px 24px;
  color: #e7ddcf;
  background:
    radial-gradient(circle at 42% 94%, rgba(193, 130, 69, 0.16), transparent 11rem),
    linear-gradient(180deg, #201e1c, #1a1917) !important;
  border-right-color: rgba(220, 193, 160, 0.22);
}

.brand { margin: 0 12px 42px; }
.brand-name { color: #f4eadb; font-size: 24px; font-weight: 800; }
.brand-subtitle { color: #bcae9c; font-size: 12px; }
.leaf-logo { padding: 8px; border: 1px solid rgba(222, 189, 138, 0.68); border-radius: 50%; }
.side-nav { gap: 10px; }
.side-nav-item { color: #c8bbab; border: 1px solid transparent; font-family: inherit; }
.side-nav-item:hover { color: #fbf4e9; background: rgba(210, 165, 109, 0.10); }
.side-nav-item.active {
  color: #f5d29e;
  border-color: rgba(200, 151, 91, 0.28);
  background: linear-gradient(90deg, rgba(168, 112, 61, 0.32), rgba(114, 74, 42, 0.24));
  box-shadow: inset 2px 0 0 #c99255;
}
.side-nav-item.active .icon { color: #efbe7a; }
.growth-card { border-color: rgba(205, 174, 133, 0.22); color: #d9cbb9; background: rgba(255, 247, 233, 0.035); }
.growth-title { color: #f1e5d2; }
.growth-card p { color: #c3b4a2; }
.outline-button { border-color: rgba(208, 166, 109, 0.58); color: #e8ba7c; background: transparent; }

.workspace { background: var(--bg); }
.top-header { height: 72px; background: rgba(255, 252, 247, 0.88); border-bottom-color: var(--line); }
.search-box { border-radius: 999px; color: var(--muted); background: #fffdfa; box-shadow: none; }
.search-box button:hover, .search-box button:focus-visible, .theme-toggle:hover, .theme-toggle:focus-visible { background: var(--paper-warm); }

.home-page, .content-page { max-width: 1500px; }
.home-page { padding-top: clamp(56px, 5vw, 92px); }
.home-landing-page .hero { grid-template-columns: minmax(0, 1fr) clamp(310px, 26vw, 430px); align-items: center; }
.eyebrow { margin: 0 0 14px; color: var(--orange); font-size: 12px; font-weight: 800; letter-spacing: 0.16em; }
.home-page .hero h1 { max-width: 12ch; font-size: clamp(46px, 4.2vw, 66px); line-height: 1.16; letter-spacing: -0.08em; }
.desk-art.hero { border-radius: 8px; box-shadow: 0 22px 44px rgba(72, 48, 30, 0.14); }
.starter-panel { max-width: 940px; padding: 26px; border-radius: 12px; background: rgba(255, 253, 249, 0.94); }
.starter-draft-field textarea { min-height: 142px; }
.input-panel { border-radius: 12px; }
.review-context { grid-template-columns: 264px minmax(0, 1fr); gap: 22px; }
.review-mode-row, .flow-tabs { border-radius: 7px; background: var(--paper-cool); }
.review-mode-row button, .flow-tabs button { border-radius: 6px; font-family: inherit; }
.review-mode-row button.active, .flow-tabs button.active { color: var(--ink); background: var(--paper); box-shadow: 0 2px 7px rgba(72, 48, 30, 0.11); }
.chip { min-width: 54px; height: 32px; border-radius: 7px; color: #746658; background: #fffdfa; font-family: inherit; }
.chip:hover, .chip.selected { border-color: #c7965d; color: var(--orange-dark); background: #f6e9d8; }
.draft-field span, .context-label { color: #6f6357; font-weight: 700; }
.draft-field textarea, .draft-date-field input { border-radius: 8px; background: #fffdfa; }
.input-footer { border-top-color: var(--line); }
.input-footer strong { color: #837363; font-family: inherit; }
.primary-button { color: #fff9f1; background: linear-gradient(180deg, #ce9158, #b8733d); box-shadow: 0 10px 18px rgba(150, 88, 35, 0.2); }
.primary-button:hover { filter: brightness(1.05); }
.ghost-button, .secondary-button { border-color: var(--line-strong); color: #685648; background: #fffdfa; }

.review-setup-page { max-width: 1280px; padding-top: 46px; }
.setup-intro { max-width: 620px; margin: -10px 0 26px; color: var(--muted); font-size: 15px; line-height: 1.8; }
.review-style-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; max-width: 900px; margin-bottom: 22px; }
.review-style-switch button { min-height: 92px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: var(--paper); display: flex; align-items: center; gap: 14px; text-align: left; }
.review-style-switch button.active { color: var(--ink); border-color: #c48a50; background: linear-gradient(135deg, #fffaf3, #f5e8d7); box-shadow: var(--shadow-soft); }
.review-style-switch b, .review-style-switch small { display: block; }
.review-style-switch b { margin-bottom: 5px; font-size: 18px; }
.review-style-switch small { color: inherit; font-size: 13px; }
.style-mark { width: 34px; height: 34px; border: 1px solid currentColor; border-radius: 50%; display: grid; place-items: center; font-size: 11px; }
.advanced-method-picker { max-width: 1050px; margin: 0 0 22px; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 253, 249, 0.76); }
.picker-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.picker-head span { color: var(--ink); font-size: 16px; font-weight: 800; }
.picker-head p { margin: 0; color: var(--muted); font-size: 13px; }
.method-choice-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.method-choice { min-height: 84px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #fffdfa; display: flex; align-items: center; gap: 9px; text-align: left; }
.method-choice.selected { border-color: #bd7b43; background: #f8ecdc; box-shadow: inset 0 0 0 1px rgba(189, 123, 67, 0.12); }
.method-choice-art { width: 33px; height: 33px; display: grid; place-items: center; color: #9c744b; }
.method-choice-art svg { width: 100%; height: 100%; }
.method-choice b, .method-choice small { display: block; }
.method-choice b { font-size: 13px; white-space: nowrap; }
.method-choice small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.review-workbench { max-width: 1050px; padding: 26px; }
.workbench-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 22px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.workbench-head span { color: var(--orange-dark); font-size: 14px; font-weight: 800; }
.workbench-head p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.workbench-head .text-button { flex: 0 0 auto; }
.source-summary textarea { min-height: 100px; background: var(--paper-warm); }

.methods-library-page { max-width: 1400px; padding: 40px 66px 72px; }
.method-library-head { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; }
.method-library-head .library-page-head { margin: 0 0 22px; }
.method-library-head .list-title { font-size: 32px; letter-spacing: -0.05em; }
.library-cta { margin-top: 2px; min-width: 136px; height: 38px; padding: 0 14px; border-radius: 7px; color: #fffaf2; background: linear-gradient(180deg, #cb915b, #b87843); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.library-cta svg { width: 17px; height: 17px; }
.method-library-filters .filters { margin: 0 0 20px; }
.method-template-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; max-width: 1080px; }
.method-template-card { position: relative; min-height: 190px; overflow: hidden; padding: 20px; border: 1px solid #e6d4bc; border-radius: 9px; color: #44372c; background: linear-gradient(135deg, #fffaf1, #f7ead8); text-align: left; transition: transform 180ms var(--ease-out), box-shadow 180ms var(--ease-out), border-color 180ms var(--ease-out); }
.method-template-card:hover { transform: translateY(-3px); border-color: #bf8955; box-shadow: 0 14px 28px rgba(121, 77, 39, 0.15); }
.template-card-top { display: flex; justify-content: space-between; align-items: center; position: relative; z-index: 2; }
.template-card-top b { font-size: 17px; font-weight: 700; }
.template-card-top i { color: #bd8d58; font-style: normal; }
.template-card-lines { display: grid; gap: 8px; width: 42%; margin-top: 20px; }
.template-card-lines i { height: 1px; background: #cdbca7; }
.template-card-lines i:nth-child(2) { width: 84%; }
.template-card-lines i:nth-child(3) { width: 58%; }
.template-card-tag { position: absolute; left: 20px; bottom: 18px; padding: 4px 9px; border-radius: 5px; color: #886b4e; background: rgba(226, 204, 177, 0.66); font-size: 11px; }
.template-card-art { position: absolute; right: 12px; bottom: 8px; width: 96px; height: 96px; color: #9e845f; opacity: 0.75; }
.template-card-art svg { width: 100%; height: 100%; }
.method-template-card.grow .template-card-art { color: #74885f; }
.method-template-card.abc .template-card-art { color: #a77b50; }
.method-template-card.star .template-card-art { color: #84715c; }
.method-template-card.quadrant .template-card-art { color: #9d886b; }
.method-template-card.prep .template-card-art { color: #806a54; }
.method-template-card.feynman .template-card-art { color: #76634d; }
.method-template-card.swot .template-card-art { color: #96734c; }
.explore-methods-card { width: calc((100% - 28px) / 3); min-height: 190px; margin-top: 14px; border: 1px dashed #d7bea0; border-radius: 9px; color: #806c58; background: rgba(255, 251, 244, 0.55); font-family: inherit; }
.explore-methods-card span { display: block; margin-bottom: 8px; font-size: 28px; color: #a98a6a; }

:root[data-theme="dark"] .sidebar { background: linear-gradient(180deg, #201e1c, #1a1917) !important; }
:root[data-theme="dark"] .workspace { background: #24211d; }
:root[data-theme="dark"] .top-header { background: rgba(33, 30, 26, 0.9); }
:root[data-theme="dark"] .review-style-switch button, :root[data-theme="dark"] .advanced-method-picker, :root[data-theme="dark"] .method-choice, :root[data-theme="dark"] .method-template-card, :root[data-theme="dark"] .explore-methods-card { border-color: #51463a; background: #2b2721; }
:root[data-theme="dark"] .review-style-switch button.active, :root[data-theme="dark"] .method-choice.selected { border-color: #c58e54; background: #3b2d20; }
:root[data-theme="dark"] .method-template-card { color: #eee3d4; background: linear-gradient(135deg, #332c24, #26221d); }
:root[data-theme="dark"] .template-card-lines i { background: #7e6d5b; }
:root[data-theme="dark"] .template-card-tag { color: #e1c6a5; background: #4a3b2c; }

@media (max-width: 980px) {
  .review-style-switch, .method-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .method-template-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .explore-methods-card { width: calc((100% - 14px) / 2); }
  .methods-library-page { padding-inline: 34px; }
}

@media (max-width: 980px) {
  .record-preview,
  .method-card .library-card-sections {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .inline-actions {
    justify-content: flex-start;
  }
}


/* ─────────────────────────────────────────────────────────────
   2026 workspace refresh
   Visual-only layer: the existing DOM hooks and interaction contracts stay
   unchanged so routing, API calls, form state and editor actions continue to
   use the same selectors.
   ───────────────────────────────────────────────────────────── */
:root {
  --bg: #f3f6f5;
  --paper: #ffffff;
  --paper-warm: #fff8f4;
  --paper-cool: #effaf5;
  --line: #dce7e3;
  --line-strong: #c5d5cf;
  --ink: #18302c;
  --muted: #70837e;
  --soft: #9aa9a5;
  --orange: #ef8d71;
  --orange-dark: #d96f54;
  --orange-soft: #fff0eb;
  --green: #58b98b;
  --green-soft: #e9f8f0;
  --shadow: 0 24px 70px rgba(37, 68, 61, 0.12);
  --shadow-soft: 0 12px 30px rgba(37, 68, 61, 0.08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

:root[data-theme="dark"] {
  --bg: #171714;
  --paper: #222019;
  --paper-warm: #2b211a;
  --paper-cool: #253126;
  --line: #424338;
  --line-strong: #666557;
  --ink: #f5efe4;
  --muted: #c0b7a8;
  --soft: #8f897d;
  --orange: #e4a76c;
  --orange-dark: #ffd1a0;
  --orange-soft: #4a3423;
  --green: #a8c58e;
  --green-soft: #2b4030;
  --shadow: 0 24px 70px rgba(8, 8, 5, 0.5);
  --shadow-soft: 0 12px 30px rgba(8, 8, 5, 0.34);
}

body {
  background: var(--bg);
  letter-spacing: 0.01em;
}

.app-shell,
:root[data-theme="dark"] .app-shell {
  background: var(--bg) !important;
}

.app-shell {
  grid-template-columns: 236px minmax(0, 1fr);
}

.sidebar {
  padding: 28px 16px 20px;
  background: var(--paper);
  border-right: 1px solid var(--line);
}

.brand {
  gap: 12px;
  margin: 0 10px 36px;
}

.leaf-logo {
  width: 44px;
  height: 44px;
}

.brand-name {
  color: var(--ink);
  font-size: 20px;
  letter-spacing: 0.04em;
}

.brand-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.side-nav {
  gap: 6px;
}

.side-nav-item {
  height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  color: var(--muted);
  gap: 13px;
  font-size: 14px;
  font-weight: 700;
}

.side-nav-item:hover {
  color: var(--ink);
  background: var(--paper-cool);
}

.side-nav-item.active {
  color: var(--ink);
  background: var(--green-soft);
  box-shadow: inset 3px 0 0 var(--green);
}

.side-nav-item.active .icon {
  color: var(--green);
}

.growth-card {
  margin: auto 2px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(145deg, var(--paper-cool), var(--paper));
  box-shadow: none;
}

.desk-art.small {
  width: 100%;
  height: 82px;
  margin-bottom: 13px;
  border-radius: 12px;
}

.growth-title {
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 14px;
}

.growth-card p {
  margin-bottom: 14px;
  font-size: 12px;
  line-height: 1.65;
}

.outline-button {
  height: 36px;
  border-color: var(--green);
  border-radius: 10px;
  color: var(--green);
  background: transparent;
  font-size: 12px;
}

.workspace {
  background:
    radial-gradient(circle at 88% 0%, rgba(88, 185, 139, 0.08), transparent 30rem),
    var(--bg);
}

.top-header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 72px;
  padding: 0 38px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
}

.search-box {
  width: min(340px, 34vw);
  height: 40px;
  border-radius: 12px;
  border-color: var(--line);
  color: var(--muted);
  background: var(--paper);
  box-shadow: 0 5px 14px rgba(37, 68, 61, 0.04);
}

.search-box svg,
.search-box button,
.header-icon,
.profile-button {
  color: var(--muted);
}

.search-box button:hover,
.search-box button:focus-visible,
.theme-toggle:hover,
.theme-toggle:focus-visible {
  background: var(--green-soft);
}

.header-icon,
.profile-button {
  border-radius: 10px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-color: var(--line-strong);
}

.home-page,
.content-page {
  max-width: 1320px;
  padding: 46px clamp(30px, 4vw, 62px) 64px;
}

.hero {
  grid-template-columns: minmax(0, 1fr) clamp(260px, 24vw, 350px);
  gap: 26px;
  min-height: 246px;
}

.hero h1 {
  margin: 0 0 26px;
  color: var(--ink);
  font-size: clamp(34px, 4vw, 48px);
  letter-spacing: -0.05em;
}

.desk-art.hero {
  top: 88px;
  border-radius: 18px;
  border-color: var(--line);
  box-shadow: var(--shadow-soft);
  filter: saturate(0.76) contrast(0.94) brightness(1.04);
}

.input-panel,
.panel,
.field-card,
.list-card,
.detail-hero,
.large-textarea,
.auth-panel {
  border-color: var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}

.input-panel {
  padding: 22px;
}

.review-context {
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 26px;
  border-color: var(--line);
}

.context-label,
.draft-field span {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.review-mode-row,
.flow-tabs {
  width: 100%;
  padding: 4px;
  border-radius: 12px;
  background: var(--bg);
}

.review-mode-row button,
.flow-tabs button {
  height: 36px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 13px;
}

.review-mode-row button.active,
.flow-tabs button.active {
  border: 0;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 3px 10px rgba(37, 68, 61, 0.08);
}

.chip {
  min-width: 58px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: var(--paper);
  box-shadow: none;
  font-size: 13px;
}

.chip:hover {
  border-color: var(--green);
  color: var(--ink);
}

.chip.selected {
  border-color: rgba(88, 185, 139, 0.46);
  color: #2d8d67;
  background: var(--green-soft);
  box-shadow: none;
}

.draft-field textarea,
.draft-date-field input,
.large-textarea,
.method-editor input,
.method-editor textarea,
.method-editor select,
.detail-editor input,
.detail-editor textarea,
.detail-editor select,
.date-picker,
.month-toolbar select,
.auth-form input {
  border-color: var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--bg);
}

.draft-field textarea:focus,
.large-textarea:focus,
.method-editor input:focus,
.method-editor textarea:focus,
.detail-editor input:focus,
.detail-editor textarea:focus,
.auth-form input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(88, 185, 139, 0.14);
}

.input-footer {
  border-color: var(--line);
}

.input-footer strong {
  color: var(--muted);
  font-size: 12px;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-width: 124px;
  height: 42px;
  border-radius: 11px;
  font-size: 14px;
}

.primary-button {
  color: #10352b;
  background: var(--green);
  box-shadow: 0 10px 20px rgba(88, 185, 139, 0.22);
}

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

.secondary-button:hover,
.ghost-button:hover {
  border-color: var(--green);
  background: var(--green-soft);
}

.entry-row {
  width: 100%;
  margin: 22px 0;
  gap: 16px;
}

.entry-card {
  height: 96px;
  padding: 0 22px;
  border-radius: 16px;
  border-color: var(--line);
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}

.entry-card.event {
  border-color: rgba(88, 185, 139, 0.32);
  background: linear-gradient(135deg, var(--paper-cool), var(--paper));
}

.entry-card.anxiety {
  border-color: rgba(239, 141, 113, 0.32);
  background: linear-gradient(135deg, var(--paper-warm), var(--paper));
}

.entry-card strong {
  margin-bottom: 5px;
  font-size: 17px;
}

.entry-card small {
  color: var(--muted);
  font-size: 12px;
}

.dashboard-grid {
  gap: 16px;
  margin-top: 18px;
}

.panel {
  min-height: 290px;
  padding: 20px;
}

.panel h2,
.page-header h1,
.list-title {
  color: var(--ink);
  letter-spacing: -0.04em;
}

.panel h2 {
  font-size: 17px;
}

.panel-head {
  margin-bottom: 16px;
}

.panel-head button,
.calendar-toggle,
.month-arrow {
  color: var(--muted);
  border-color: var(--line);
  border-radius: 10px;
  background: var(--bg);
}

.recent-item,
.recent-item:last-child,
.record-preview-item,
.library-card-footer {
  border-color: var(--line);
}

.recent-icon,
.tone-1,
.tone-2 {
  border-radius: 10px;
}

.recent-icon {
  color: #2d8d67;
  background: var(--green-soft);
}

.tone-1 {
  color: var(--orange-dark);
  background: var(--orange-soft);
}

.tone-2 {
  color: #2d8d67;
  background: var(--green-soft);
}

.ring {
  background:
    radial-gradient(circle, var(--paper) 0 54%, transparent 55%),
    conic-gradient(var(--green) 0 var(--progress, 0%), var(--line) var(--progress, 0%) 100%);
  box-shadow: inset 0 0 0 14px var(--paper-cool);
}

.ring small {
  color: var(--ink);
}

.content-page,
.library-page,
.detail-page {
  max-width: 1160px;
}

.page-header {
  margin-bottom: 28px;
}

.page-header h1,
.list-title {
  font-size: clamp(30px, 3vw, 40px);
}

.library-page-head {
  margin-bottom: 24px;
}

.library-page-head p {
  color: var(--muted);
  font-size: 14px;
}

.library-filter-stack {
  gap: 12px;
  margin-bottom: 22px;
}

.library-filter-rule {
  background: var(--line);
}

.list-card {
  padding: 22px 24px 0;
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
}

.list-card[data-detail]:hover,
.list-card[data-edit-method]:hover,
.list-card[data-edit-calibration]:hover {
  border-color: rgba(88, 185, 139, 0.62);
  box-shadow: 0 18px 42px rgba(37, 68, 61, 0.14);
}

.library-card-kicker {
  margin-bottom: 12px;
}

.card-badge,
.status-pill {
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  border-color: transparent;
  font-size: 12px;
}

.card-badge {
  color: #2d8d67;
  background: var(--green-soft);
}

.card-badge.soft,
.status-pill {
  color: var(--orange-dark);
  background: var(--orange-soft);
}

.record-title-stack h3 {
  color: var(--ink);
  font-size: 19px;
}

.record-meta,
.source-footer p,
.source-footer time,
.library-card-footer > span:first-child {
  color: var(--muted);
  font-size: 12px;
}

.record-preview-item h4 {
  color: var(--ink);
  font-size: 13px;
}

.record-preview-item h4::before {
  background: var(--green);
}

.record-preview-item p,
.record-preview-item ol,
.record-preview-item ul,
.field-card p,
.field-card ol,
.field-card ul,
.field-card blockquote,
.list-card p,
.list-card ol,
.list-card ul {
  color: var(--muted);
  font-size: 14px;
}

.method-tags span,
.method-step-chips b,
.field-card .number,
.modal-mark {
  color: #2d8d67;
  background: var(--green-soft);
  border-color: rgba(88, 185, 139, 0.22);
}

.method-step-chips span {
  color: var(--muted);
  font-size: 13px;
}

.text-button {
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: var(--bg);
}

.text-button:hover {
  color: var(--green);
  border-color: var(--green);
  background: var(--green-soft);
}

.card-delete-button {
  border-radius: 9px;
  color: var(--orange-dark);
  background: var(--orange-soft);
}

.detail-hero {
  padding: 24px 26px;
  background: linear-gradient(135deg, var(--paper-cool), var(--paper));
}

.detail-hero h1 {
  color: var(--ink);
  font-size: 28px;
  letter-spacing: -0.04em;
}

.detail-hero-title b {
  color: #2d8d67;
  border-color: rgba(88, 185, 139, 0.24);
  background: var(--green-soft);
}

.detail-hero span {
  color: var(--muted);
}

.field-card {
  padding: 20px;
}

.field-card h3,
.list-card h3 {
  color: var(--ink);
  font-size: 16px;
}

.field-card blockquote {
  border-left-color: var(--green);
  background: var(--paper-cool);
}

.back-button {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--line);
}

.toast {
  right: 28px;
  bottom: 24px;
  border-color: rgba(88, 185, 139, 0.36);
  border-radius: 12px;
  color: #2d8d67;
  background: var(--green-soft);
  box-shadow: var(--shadow-soft);
}

.modal-backdrop {
  background: rgba(12, 21, 21, 0.42);
  backdrop-filter: blur(8px);
}

.confirm-modal {
  border-color: var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.auth-page,
:root[data-theme="dark"] .auth-page {
  background: var(--bg) !important;
}

.auth-panel {
  padding: 38px;
}

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

.auth-form h1 {
  color: var(--ink);
  font-size: 30px;
  letter-spacing: -0.04em;
}

.auth-form p,
.auth-help-text {
  color: var(--muted);
}

.auth-form label {
  color: var(--muted);
  font-size: 12px;
}

.auth-submit {
  height: 46px;
  border-radius: 12px;
  color: #10352b;
  background: var(--green);
  box-shadow: 0 10px 20px rgba(88, 185, 139, 0.2);
}

:root[data-theme="dark"] .input-panel,
:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .field-card,
:root[data-theme="dark"] .list-card,
:root[data-theme="dark"] .detail-hero,
:root[data-theme="dark"] .large-textarea,
:root[data-theme="dark"] .auth-panel {
  border-color: var(--line);
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}

:root[data-theme="dark"] .detail-hero {
  background: linear-gradient(135deg, var(--paper-cool), var(--paper));
}

:root[data-theme="dark"] .draft-field textarea,
:root[data-theme="dark"] .draft-date-field input,
:root[data-theme="dark"] .large-textarea,
:root[data-theme="dark"] .method-editor input,
:root[data-theme="dark"] .method-editor textarea,
:root[data-theme="dark"] .method-editor select,
:root[data-theme="dark"] .detail-editor input,
:root[data-theme="dark"] .detail-editor textarea,
:root[data-theme="dark"] .detail-editor select,
:root[data-theme="dark"] .date-picker,
:root[data-theme="dark"] .month-toolbar select,
:root[data-theme="dark"] .auth-form input {
  color: var(--ink);
  background: var(--bg);
  border-color: var(--line);
}

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

  .sidebar {
    padding: 22px 10px;
  }

  .brand {
    justify-content: center;
    margin: 0 0 28px;
  }

  .brand > div,
  .side-nav-item > span:not(.icon),
  .growth-card {
    display: none;
  }

  .side-nav-item {
    justify-content: center;
    padding: 0;
  }

  .top-header {
    padding: 0 20px;
  }

  .search-box {
    width: min(280px, 42vw);
  }

  .hero,
  .review-context {
    grid-template-columns: minmax(0, 1fr);
  }

  .desk-art.hero {
    display: none;
  }
}

/* dark theme palette: warm charcoal with candle amber and sage accents */
:root[data-theme="dark"] .app-shell,
:root[data-theme="dark"] .auth-page {
  background:
    radial-gradient(circle at 84% 0%, rgba(228, 167, 108, 0.12), transparent 32rem),
    radial-gradient(circle at 14% 12%, rgba(168, 197, 142, 0.08), transparent 28rem),
    var(--bg) !important;
}

:root[data-theme="dark"] .sidebar,
:root[data-theme="dark"] .top-header {
  background: color-mix(in srgb, var(--paper) 92%, transparent);
}

:root[data-theme="dark"] .workspace {
  background:
    radial-gradient(circle at 88% 0%, rgba(228, 167, 108, 0.08), transparent 30rem),
    var(--bg);
}

:root[data-theme="dark"] .field-card blockquote,
:root[data-theme="dark"] .field-card th,
:root[data-theme="dark"] .list-card th {
  background: var(--paper-cool);
}

:root[data-theme="dark"] .field-card code,
:root[data-theme="dark"] .list-card code,
:root[data-theme="dark"] .field-card pre {
  color: var(--orange-dark);
  background: var(--bg);
}

:root[data-theme="dark"] .record-list-card::before {
  background: linear-gradient(90deg, var(--green), var(--orange));
}

:root[data-theme="dark"] .record-preview-item h4,
:root[data-theme="dark"] .detail-hero-title b {
  color: var(--green);
  background: var(--green-soft);
  border-color: var(--line-strong);
}

:root[data-theme="dark"] .chip.selected,
:root[data-theme="dark"] .recent-icon {
  color: var(--green);
  border-color: var(--line-strong);
  background: var(--green-soft);
}

:root[data-theme="dark"] .primary-button,
:root[data-theme="dark"] .auth-submit {
  color: #2d2117;
  background: var(--orange);
  box-shadow: 0 10px 22px rgba(228, 167, 108, 0.2);
}

:root[data-theme="dark"] .outline-button,
:root[data-theme="dark"] .secondary-button:hover,
:root[data-theme="dark"] .ghost-button:hover {
  border-color: var(--orange);
  color: var(--orange-dark);
  background: var(--orange-soft);
}

:root[data-theme="dark"] .side-nav-item.active,
:root[data-theme="dark"] .review-mode-row button.active,
:root[data-theme="dark"] .flow-tabs button.active {
  color: var(--green);
  background: var(--green-soft);
  border-color: var(--line-strong);
}

:root[data-theme="dark"] .review-mode-row,
:root[data-theme="dark"] .flow-tabs {
  background: var(--bg);
}

:root[data-theme="dark"] .search-box,
:root[data-theme="dark"] .auth-form input,
:root[data-theme="dark"] .draft-field textarea,
:root[data-theme="dark"] .draft-date-field input,
:root[data-theme="dark"] .method-editor input,
:root[data-theme="dark"] .method-editor textarea,
:root[data-theme="dark"] .method-editor select,
:root[data-theme="dark"] .detail-editor input,
:root[data-theme="dark"] .detail-editor textarea,
:root[data-theme="dark"] .detail-editor select,
:root[data-theme="dark"] .date-picker,
:root[data-theme="dark"] .month-toolbar select {
  background: var(--bg);
}

:root[data-theme="dark"] .outline-button,
:root[data-theme="dark"] .secondary-button,
:root[data-theme="dark"] .ghost-button,
:root[data-theme="dark"] .calendar-toggle,
:root[data-theme="dark"] .back-button,
:root[data-theme="dark"] .month-arrow,
:root[data-theme="dark"] .text-button {
  color: var(--orange-dark);
  background: var(--paper);
  border-color: var(--line-strong);
}

:root[data-theme="dark"] .primary-button {
  color: #2d2117;
  background: linear-gradient(180deg, #f0c18a, var(--orange));
  box-shadow: 0 12px 24px rgba(228, 167, 108, 0.22);
}

:root[data-theme="dark"] .chip {
  background: var(--paper);
  border-color: var(--line);
}

:root[data-theme="dark"] .field-source > span,
:root[data-theme="dark"] .field-source.ai-source > span {
  color: var(--orange-dark);
  background: var(--orange-soft);
}

:root[data-theme="dark"] .growth-card,
:root[data-theme="dark"] .entry-card,
:root[data-theme="dark"] .entry-card.event,
:root[data-theme="dark"] .entry-card.anxiety {
  background: linear-gradient(145deg, var(--paper-cool), var(--paper));
  border-color: var(--line);
}

/* Let the dashboard use wide screens as a workspace instead of a narrow column. */
.home-page {
  width: 100%;
  max-width: 1760px;
  padding: clamp(54px, 4vw, 82px) clamp(44px, 5vw, 96px) 72px;
}

.home-page .hero {
  grid-template-columns: minmax(0, 1fr) clamp(280px, 22vw, 420px);
  gap: clamp(26px, 2.4vw, 42px);
}

.home-page .desk-art.hero {
  top: 96px;
}

.home-page .dashboard-grid {
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.94fr) minmax(0, 1.08fr);
  gap: 20px;
}

@media (max-width: 1280px) {
  .home-page {
    padding-inline: clamp(30px, 4vw, 56px);
  }

  .home-page .hero {
    grid-template-columns: minmax(0, 1fr) clamp(260px, 25vw, 330px);
    gap: 24px;
  }
}

/* Final cascade: keep the live workspace aligned with the editorial mockup. */
:root:not([data-theme="dark"]) {
  --bg: #f4eee4;
  --paper: #fffdf9;
  --paper-warm: #fbf2e5;
  --paper-cool: #f1f0e8;
  --line: #e6d7c4;
  --line-strong: #cdb397;
  --ink: #302820;
  --muted: #897d70;
  --soft: #b7aa9b;
  --orange: #bd7b43;
  --orange-dark: #80512e;
  --orange-soft: #f3e4d1;
  --green: #718561;
  --green-soft: #e7eddf;
  --shadow: 0 24px 60px rgba(79, 53, 31, 0.12);
  --shadow-soft: 0 12px 30px rgba(79, 53, 31, 0.08);
  font-family: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
}

:root:not([data-theme="dark"]) .sidebar .brand-name { color: #f4eadb; }
:root:not([data-theme="dark"]) .sidebar .brand-subtitle { color: #bcae9c; }
:root:not([data-theme="dark"]) .side-nav-item.active {
  color: #f3c988;
  border-color: rgba(200, 151, 91, 0.28);
  background: linear-gradient(90deg, rgba(168, 112, 61, 0.32), rgba(114, 74, 42, 0.24));
  box-shadow: inset 2px 0 0 #c99255;
}

:root:not([data-theme="dark"]) .side-nav-item.active .icon { color: #efbe7a; }
:root:not([data-theme="dark"]) .side-nav-item:hover { color: #fbf4e9; background: rgba(210, 165, 109, 0.10); }
:root:not([data-theme="dark"]) .side-nav-item { color: #c8bbab; }
:root:not([data-theme="dark"]) .workspace { background: var(--bg); }
:root:not([data-theme="dark"]) .top-header { background: rgba(255, 252, 247, 0.88); }
:root:not([data-theme="dark"]) .review-mode-row button.active,
:root:not([data-theme="dark"]) .flow-tabs button.active { color: var(--ink); background: var(--paper); box-shadow: 0 2px 7px rgba(72, 48, 30, 0.11); }
:root:not([data-theme="dark"]) .chip.selected { border-color: #c7965d; color: var(--orange-dark); background: #f6e9d8; }
:root:not([data-theme="dark"]) .primary-button { color: #fff9f1; background: linear-gradient(180deg, #ce9158, #b8733d); }
:root:not([data-theme="dark"]) .outline-button { border-color: rgba(208, 166, 109, 0.58); color: #e8ba7c; background: transparent; }

/* Exact screen composition layer: target-board proportions and hierarchy. */
.workspace-records .top-header,
.workspace-methods .top-header,
.workspace-calibration .top-header,
.workspace-home .top-header {
  display: none;
}

.workspace-records,
.workspace-methods {
  background: #fffdf9;
}

.workspace-calibration {
  background: #24211d !important;
}

.editorial-home-page {
  max-width: 980px;
  padding: 28px 34px 42px;
}

.home-titlebar { height: 46px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.home-titlebar h1 { margin: 0; color: #372c22; font-size: 28px; letter-spacing: -0.05em; }
.home-titlebar p { margin: 3px 0 0; color: #897666; font-size: 12px; }
.home-title-actions { display: flex; align-items: center; gap: 10px; }
.home-title-actions .compact-page-search { width: 205px; }
.home-title-actions .header-icon { width: 24px; height: 24px; color: #806d5a; background: transparent; }
.home-title-actions .header-icon svg { width: 15px; height: 15px; }
.mini-avatar { width: 22px; height: 22px; border: 1px solid #c5a884; border-radius: 50%; background: linear-gradient(90deg, #2c3f37 50%, #f2dfc3 50%); }

.home-start-card {
  position: relative;
  min-height: 150px;
  overflow: visible;
  border: 1px solid #e6caa9;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 248, 237, 0.96) 0%, rgba(255, 246, 231, 0.80) 57%, rgba(239, 205, 160, 0.20) 100%),
    url("./assets/reflective-desk.png") right center / 48% 150% no-repeat,
    #fff5e7;
  box-shadow: none;
}

.home-start-copy { position: relative; z-index: 1; width: 72%; padding: 17px 18px 14px; }
.home-start-copy h2 { margin: 0 0 10px; color: #4b3b2d; font-size: 16px; }
.home-start-copy h2 span { color: #ae804e; }
.home-draft-field { display: block; }
.home-draft-field textarea { width: 100%; height: 58px; padding: 13px; border: 1px solid #d9c1a1; border-radius: 7px; outline: 0; color: #4b3b2d; background: rgba(255, 253, 248, 0.86); font-family: inherit; font-size: 12px; }
.home-draft-field textarea:focus { border-color: #bc8850; box-shadow: 0 0 0 3px rgba(188, 136, 80, 0.12); }
.home-start-meta { position: relative; z-index: 4; display: flex; align-items: center; gap: 7px; margin-top: 10px; color: #856f5a; font-size: 10px; }
.home-meta-control { position: relative; }
.home-meta-trigger { min-height: 26px; padding: 0 7px; border: 1px solid transparent; border-radius: 5px; color: #856f5a; background: transparent; font-family: inherit; font-size: 10px; white-space: nowrap; transition: color 150ms ease, border-color 150ms ease, background 150ms ease; }
.home-meta-trigger:hover,
.home-meta-trigger[aria-expanded="true"] { color: #5b402d; border-color: #d9bea0; background: rgba(255, 250, 241, 0.82); }
.home-meta-trigger.selected { color: #795234; }
.home-meta-popover { position: absolute; left: 0; top: calc(100% + 7px); z-index: 30; width: 236px; padding: 12px; border: 1px solid #dac3a6; border-radius: 8px; color: #564233; background: #fffaf2; box-shadow: 0 14px 34px rgba(83, 54, 31, 0.18); }
.home-meta-popover-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.home-meta-popover-head strong { font-size: 12px; }
.home-meta-popover-head small { color: #9a826b; font-size: 9px; }
.home-meta-options { display: flex; flex-wrap: wrap; gap: 6px; }
.home-meta-options button { min-width: 46px; height: 25px; padding: 0 8px; border: 1px solid #e1d2c0; border-radius: 5px; color: #796651; background: #fffdf8; font-family: inherit; font-size: 10px; }
.home-meta-options button:hover { border-color: #bd8b57; }
.home-meta-options button.selected { color: #fff6e8; border-color: #8a674a; background: #6a4d38; }
.home-meta-done { height: 26px; margin-top: 10px; padding: 0 12px; border-radius: 5px; color: #fff7ea; background: #49372a; font-family: inherit; font-size: 10px; }
.review-context-summary { width: fit-content; max-width: 100%; margin: -10px 0 20px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: var(--paper); font-size: 12px; }
.home-start-button { margin-left: auto; min-width: 86px; height: 26px; border-radius: 6px; color: #fff4e5; background: #3a2d24; font-family: inherit; font-size: 11px; }
.home-start-art { position: absolute; right: 7%; bottom: 8%; width: 16%; height: 65%; color: #c4915d; opacity: 0.8; }
.home-start-art span { position: absolute; right: 15%; bottom: 5%; font-size: 48px; opacity: 0.42; }
.home-start-art i { position: absolute; bottom: 8%; width: 7px; height: 38px; border-radius: 6px 6px 2px 2px; background: #d6a16c; box-shadow: 0 0 18px rgba(210, 143, 65, 0.75); }
.home-start-art i:first-of-type { right: 42%; }
.home-start-art i:last-of-type { right: 31%; height: 50px; background: #f1c98f; }

.home-insight-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.home-insight-grid .panel { min-height: 166px; padding: 15px; border: 1px solid #ead5bb; border-radius: 8px; background: #fffaf2; box-shadow: none; }
.home-insight-grid .panel h2 { color: #4b3c2f; font-size: 14px; }
.home-insight-grid .week-panel .week-content { display: grid; grid-template-columns: 1fr 70px; align-items: center; }
.home-insight-grid .week-panel .ring { width: 62px; height: 62px; margin: 0 auto; }
.home-insight-grid .week-panel .ring span { font-size: 20px; }
.home-insight-grid .week-days { gap: 5px; }
.home-insight-grid .week-days li { font-size: 9px; }
.home-insight-grid .week-days li i { width: 12px; height: 12px; }
.home-insight-grid .week-panel > p { margin-top: 8px; font-size: 10px; }
.home-mood-panel h2 span { color: #bc8c5a; }
.mood-insight-row { display: grid; grid-template-columns: 1fr 40px 54px; align-items: center; gap: 8px; margin-top: 13px; color: #756758; font-size: 11px; }
.mood-insight-row b { color: #6d735b; font-weight: 600; }
.mood-insight-row i { height: 2px; background: linear-gradient(90deg, #a8b397 60%, transparent 60%); }
.home-insight-grid .recent-panel { order: 3; }
.home-insight-grid .inspiration-panel { order: 4; }
.home-insight-grid .recent-panel { display: flex; flex-direction: column; overflow: hidden; }
.home-insight-grid .recent-panel .panel-head { flex: 0 0 auto; }
.home-insight-grid .recent-list { flex: 1; min-height: 0; gap: 0; overflow: hidden; grid-auto-rows: minmax(0, 1fr); border-top: 1px solid var(--line); }
.home-insight-grid .recent-item { min-height: 0; height: 100%; padding: 5px 0; border-top: 0; border-bottom: 1px solid var(--line); }
.home-insight-grid .recent-item:last-child { border-bottom: 0; }
.home-insight-grid .recent-item strong { font-size: 10px; }
.home-insight-grid .recent-item small, .home-insight-grid .recent-item em { font-size: 9px; }
.home-insight-grid .recent-icon { width: 24px; height: 24px; }
.home-insight-grid .inspiration-panel .quote-art { height: 105px; width: 100%; }

.library-toolbar { height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.library-toolbar h1 { margin: 0; color: #372c22; font-size: 25px; letter-spacing: -0.05em; }
.library-toolbar-actions { display: flex; align-items: center; gap: 16px; }
.compact-page-search { width: 198px; height: 28px; padding: 0 9px; border: 1px solid #dfd3c4; border-radius: 999px; display: flex; align-items: center; background: #fffdfa; }
.compact-page-search input { flex: 1; min-width: 0; border: 0; outline: 0; color: #6b5a4a; background: transparent; font-family: inherit; font-size: 10px; }
.compact-page-search button { width: 18px; height: 18px; display: grid; place-items: center; color: #746252; background: transparent; }
.compact-page-search svg { width: 14px; height: 14px; }
.library-cta { min-width: 84px; height: 28px; padding: 0 10px; border-radius: 6px; color: #fff6ea; background: linear-gradient(180deg, #cd965e, #b67842); font-family: inherit; font-size: 10px; }
.library-cta svg { width: 12px; height: 12px; }

.methods-library-page,
.records-library-page { max-width: 1100px; padding: 0 34px 44px; }
.method-library-filters .filters,
.records-filter-row .filters { gap: 10px; margin: 0 0 12px; }
.method-library-filters .chip,
.records-filter-row .chip { min-width: 52px; height: 24px; padding: 0 11px; border-radius: 6px; color: #816c58; border-color: #eadfd1; background: #fffdfa; font-size: 10px; }
.method-library-filters .chip.selected,
.records-filter-row .chip.selected { color: #f8e1bf; border-color: #a26d3e; background: #3b2e24; }
.method-template-grid { max-width: 810px; gap: 10px; }
.method-template-card { min-height: 104px; padding: 13px; border-radius: 7px; }
.template-card-top b { font-size: 14px; }
.template-card-lines { gap: 5px; margin-top: 12px; }
.template-card-tag { left: 13px; bottom: 11px; padding: 3px 7px; font-size: 9px; }
.template-card-art { right: 8px; bottom: 4px; width: 66px; height: 66px; }
.explore-methods-card { width: calc((100% - 20px) / 3); min-height: 104px; margin-top: 10px; border-radius: 7px; font-size: 11px; }

.record-timeline { position: relative; display: grid; gap: 12px; max-width: 800px; padding-left: 68px; }
.record-timeline::before { content: ""; position: absolute; top: 4px; bottom: 4px; left: 20px; width: 1px; background: #bead9a; }
.timeline-record { position: relative; min-height: 58px; }
.timeline-record time { position: absolute; top: 17px; left: -116px; width: 82px; color: #746858; font-size: 10px; text-align: right; white-space: nowrap; }
.timeline-node { position: absolute; top: 23px; left: -26px; z-index: 1; width: 7px; height: 7px; border: 2px solid #4a3a2d; border-radius: 50%; background: #fffaf2; }
.timeline-record-card { width: 100%; min-height: 58px; padding: 8px 12px; border: 1px solid #e6d4be; border-radius: 7px; color: #4f3d2f; background: #fffaf4; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto 15px; align-items: center; gap: 10px; text-align: left; box-shadow: 0 3px 10px rgba(104, 67, 35, 0.04); }
.timeline-record-card:hover { border-color: #c78f56; }
.timeline-record-icon { width: 26px; height: 26px; border-radius: 6px; color: #aa7c4c; background: #f4e7d5; display: grid; place-items: center; font-size: 13px; }
.timeline-record-copy b, .timeline-record-copy small { display: block; }
.timeline-record-copy b { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timeline-record-copy small { margin-top: 4px; color: #9b8976; font-size: 9px; }
.timeline-stars { color: #b77b40; font-size: 10px; letter-spacing: 1px; }
.timeline-arrow svg { width: 14px; height: 14px; }

.calibration-visual-page { max-width: 1160px; min-height: 100%; padding: 30px 34px 54px; color: #f1e5d5; background: radial-gradient(circle at 78% 18%, rgba(172, 124, 67, 0.12), transparent 20rem), #24211d; }
.calibration-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.calibration-toolbar h1 { margin: 0; color: #f2e4d2; font-size: 30px; letter-spacing: -0.05em; }
.calibration-toolbar h1 span { color: #bd8d58; font-size: 17px; }
.history-button { height: 28px; padding: 0 12px; border: 1px solid #65503d; border-radius: 6px; color: #e7c798; background: rgba(66, 51, 39, 0.7); font-family: inherit; font-size: 10px; }
.calibration-hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(220px, 0.65fr); gap: 18px; }
.calibration-checkin-card { padding: 18px; border: 1px solid #5e4d3a; border-radius: 8px; background: rgba(52, 43, 34, 0.76); }
.calibration-checkin-card h2, .calibration-checkin-card h3 { margin: 0; color: #f2e4d4; font-size: 14px; }
.calibration-checkin-card h3 { margin-top: 16px; }
.mood-scale { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 14px 0 0; }
.mood-scale::before { content: ""; position: absolute; top: 20px; left: 6%; right: 6%; height: 1px; background: #88735d; }
.mood-scale button { position: relative; z-index: 1; padding: 0; color: #cbb9a6; background: transparent; display: grid; justify-items: center; gap: 6px; font-family: inherit; font-size: 10px; }
.mood-scale i { width: 38px; height: 38px; border: 1px solid #9f8567; border-radius: 50%; background: #b18758; display: grid; place-items: center; color: #30261d; font-size: 21px; font-style: normal; }
.mood-scale button.selected i { color: #293a29; border-color: #f2cd8a; background: #a8bc8c; box-shadow: 0 0 0 3px rgba(236, 180, 96, 0.25), 0 0 16px rgba(227, 163, 74, 0.65); }
.feeling-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.feeling-tags button { height: 24px; padding: 0 8px; border: 1px solid #655240; border-radius: 5px; color: #d7c1a7; background: #332a22; font-family: inherit; font-size: 9px; }
.feeling-tags button.selected { color: #f6e5c8; border-color: #c38d50; background: #60452f; box-shadow: inset 0 0 0 1px rgba(227, 179, 111, 0.18); }
.calibration-note { width: 100%; height: 58px; margin-top: 12px; padding: 10px; border: 1px solid #66513d; border-radius: 6px; outline: 0; color: #e8dac9; background: rgba(35, 29, 24, 0.6); font-family: inherit; font-size: 11px; }
.calibration-checkin-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 12px; color: #a9957e; font-size: 10px; }
.calibration-checkin-actions button { height: 30px; padding: 0 13px; border: 1px solid #c58c4e; border-radius: 6px; color: #2e241b; background: #e4b26f; font-family: inherit; font-weight: 700; }
.breathing-card { display: grid; justify-items: center; align-content: center; min-height: 250px; color: #dcc9ae; }
.breathing-card > p { margin: 0 0 8px; font-size: 13px; }
.breathing-ring { width: 160px; height: 160px; border: 8px solid #e5b46e; border-radius: 50%; box-shadow: 0 0 0 8px rgba(157, 101, 39, 0.28), 0 0 32px rgba(222, 162, 73, 0.38), inset 0 0 28px rgba(231, 183, 104, 0.16); display: grid; place-items: center; }
.breathing-card.active .breathing-ring { animation: breathing-cycle 19s linear infinite; }
.breathing-ring span { color: #f2dfc8; text-align: center; font-size: 11px; line-height: 1.45; }
.breathing-ring b { display: inline-block; margin: 5px 0; font-size: 38px; font-weight: 400; }
.breathing-ring small { font-size: 10px; }
.breathing-card > small { margin-top: 16px; color: #bda98f; font-size: 10px; }
.calibration-bottom-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(220px, 0.65fr); gap: 18px; margin-top: 18px; }
.calibration-progress-card, .calibration-advice-card { position: relative; min-height: 112px; padding: 16px; border-radius: 8px; color: #5a4735; background: #fff7e9; }
.calibration-progress-card h3, .calibration-advice-card h3 { margin: 0 0 8px; font-size: 12px; }
.calibration-progress-card p { margin: 0; font-size: 10px; }
.progress-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 14px; max-width: 300px; margin-top: 20px; }
.progress-week span { width: 17px; height: 17px; border: 1px solid #c7ad8c; border-radius: 50%; display: grid; place-items: center; color: #fbf4e6; font-size: 9px; }
.progress-week span.done { border-color: #5a744e; background: #617954; }
.calibration-advice-card strong { display: block; font-size: 16px; font-weight: 500; }
.calibration-advice-card p { margin: 8px 0; font-size: 11px; }
.calibration-advice-card button { position: absolute; bottom: 16px; right: 70px; width: 20px; height: 20px; border-radius: 50%; color: #fff5e7; background: #3a2d24; font-size: 8px; }
.calibration-advice-card > span { position: absolute; right: 18px; bottom: 14px; color: #ad956e; font-size: 42px; opacity: 0.55; }
.calibration-history-list { margin-top: 36px; }
.calibration-history-list h2 { color: #e5d3be; font-size: 15px; }
.calibration-history-panel { margin-top: 22px; padding: 18px; border: 1px solid #5e4d3a; border-radius: 8px; background: rgba(52, 43, 34, 0.62); }
.calibration-history-panel .panel-head { color: #f0dfca; }
.calibration-history-panel .panel-head span { color: #aa9780; font-size: 10px; }
.calibration-history-panel > h3 { margin: 20px 0 10px; color: #e8d6c0; font-size: 13px; }
.checkin-history-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.checkin-history-list article { padding: 12px; border: 1px solid #604d3a; border-radius: 7px; color: #d9c5ad; background: #2c241e; }
.checkin-history-list time, .checkin-history-list strong { display: block; }
.checkin-history-list time { color: #a99278; font-size: 9px; }
.checkin-history-list strong { margin-top: 6px; color: #f0ddc6; font-size: 13px; }
.checkin-history-list p, .checkin-history-list small { margin: 5px 0 0; color: #b9a58e; font-size: 10px; }
.history-button.active { color: #2e241b; background: #e4b26f; }

@keyframes breathing-cycle {
  0% {
    transform: scale(0.94);
    box-shadow: 0 0 0 8px rgba(157, 101, 39, 0.18), 0 0 24px rgba(222, 162, 73, 0.22), inset 0 0 22px rgba(231, 183, 104, 0.12);
    animation-timing-function: cubic-bezier(0.37, 0, 0.63, 1);
  }
  21.0526% {
    transform: scale(1.06);
    box-shadow: 0 0 0 13px rgba(157, 101, 39, 0.28), 0 0 48px rgba(222, 162, 73, 0.44), inset 0 0 34px rgba(231, 183, 104, 0.22);
    animation-timing-function: linear;
  }
  57.8947% {
    transform: scale(1.06);
    box-shadow: 0 0 0 13px rgba(157, 101, 39, 0.26), 0 0 44px rgba(222, 162, 73, 0.40), inset 0 0 32px rgba(231, 183, 104, 0.20);
    animation-timing-function: cubic-bezier(0.37, 0, 0.63, 1);
  }
  100% {
    transform: scale(0.94);
    box-shadow: 0 0 0 8px rgba(157, 101, 39, 0.18), 0 0 24px rgba(222, 162, 73, 0.22), inset 0 0 22px rgba(231, 183, 104, 0.12);
  }
}

/* The reference uses a symbol-first sidebar; the copy belongs in the active page header. */
.sidebar .brand { justify-content: center; margin: 0 0 40px; }
.sidebar .brand > div { display: none; }
.sidebar-candle-card { position: relative; min-height: 190px; overflow: hidden; padding: 0 18px 18px; border: 0; border-radius: 0; background: transparent !important; box-shadow: none; }
.sidebar-candle-card .sidebar-candle-glow { position: relative; height: 118px; margin: 0 -10px 8px; background: radial-gradient(circle at 62% 78%, rgba(222, 155, 67, 0.38), transparent 16%), radial-gradient(circle at 52% 84%, rgba(129, 73, 29, 0.48), transparent 34%); }
.sidebar-candle-glow i { position: absolute; right: 43%; bottom: 11px; width: 13px; height: 48px; border-radius: 6px 6px 2px 2px; background: #c88a4e; box-shadow: 0 0 18px rgba(233, 159, 61, 0.52); }
.sidebar-candle-glow i::before { content: ""; position: absolute; top: -12px; left: 3px; width: 7px; height: 15px; border-radius: 50% 50% 50% 0; transform: rotate(45deg); background: #ffd889; box-shadow: 0 0 15px #f4ae55; }
.sidebar-candle-glow b { position: absolute; right: 18%; bottom: 5px; width: 26px; height: 42px; border: 2px solid #967044; border-radius: 13px 13px 4px 4px; opacity: 0.75; }
.sidebar-candle-glow span { position: absolute; left: 17%; bottom: 3px; color: #cbaa7a; font-size: 31px; opacity: 0.65; }
.sidebar-candle-card p { position: relative; z-index: 1; color: #e2c49a; font-size: 12px; line-height: 1.55; }
.sidebar-candle-card .outline-button { position: absolute; right: 18px; bottom: 10px; width: 28px; height: 28px; border: 0; color: #d9bc8e; background: transparent; font-size: 18px; }

/* Use the real browser canvas. Do not scale a wide monitor down to a fixed mockup. */
.app-shell {
  width: 100vw;
  min-width: 0;
  height: 100vh;
  min-height: 100vh;
  transform: none;
}

.editorial-home-page {
  width: 100%;
  max-width: 2080px;
  margin: 0;
  padding: 28px clamp(34px, 4vw, 76px) 56px;
}

.home-start-card,
.home-insight-grid {
  width: 100%;
}

.home-start-card {
  min-height: 0;
  aspect-ratio: 3.96 / 1;
}

.methods-library-page,
.records-library-page {
  width: 100%;
  max-width: 2080px;
  margin: 0;
  padding-inline: clamp(34px, 4vw, 76px);
}

.method-template-grid {
  width: 100%;
  max-width: 1760px;
}

.method-template-card,
.explore-methods-card {
  min-height: 128px;
  height: clamp(128px, 9vw, 154px);
  aspect-ratio: auto;
}

.explore-methods-card {
  width: calc((100% - 20px) / 3);
}

@media (min-width: 1600px) {
  .method-template-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .explore-methods-card {
    width: calc((100% - 30px) / 4);
  }
}

.record-timeline {
  max-width: 1760px;
  padding-left: 116px;
}

.record-timeline::before {
  left: 90px;
}

.calibration-visual-page {
  width: 100%;
  max-width: 2080px;
  margin: 0;
  padding-inline: clamp(34px, 4vw, 76px);
}

:root[data-theme="dark"] .methods-library-page .library-toolbar h1,
:root[data-theme="dark"] .records-library-page .library-toolbar h1 {
  color: #f2e6d6;
}

:root[data-theme="dark"] .home-titlebar h1,
:root[data-theme="dark"] .home-insight-grid .panel h2 {
  color: #f2e6d6;
}

:root[data-theme="dark"] .home-titlebar p,
:root[data-theme="dark"] .mood-insight-row {
  color: #bbaa94;
}

:root[data-theme="dark"] .mood-insight-row b {
  color: #a9bd91;
}

:root[data-theme="dark"] .home-title-actions .header-icon {
  color: #d2b58d;
}

:root[data-theme="dark"] .home-meta-trigger {
  color: #796651;
}

:root[data-theme="dark"] .home-meta-trigger:hover,
:root[data-theme="dark"] .home-meta-trigger[aria-expanded="true"] {
  color: #4f3827;
  border-color: #c9a77e;
  background: rgba(255, 250, 241, 0.9);
}

:root[data-theme="dark"] .home-meta-trigger.selected {
  color: #5f422d;
}

:root[data-theme="dark"] .compact-page-search {
  border-color: #675a4a;
  background: #fffdf9;
}

:root[data-theme="dark"] .method-template-card {
  color: #f0e4d4;
  border-color: #655544;
  background: linear-gradient(135deg, #312920, #26221d);
}

:root[data-theme="dark"] .method-template-card .template-card-art {
  color: #c49b68;
  opacity: 1;
  filter: drop-shadow(0 0 8px rgba(199, 151, 91, 0.14));
}

:root[data-theme="dark"] .method-template-card.grow .template-card-art { color: #93a779; }
:root[data-theme="dark"] .template-card-art svg { display: block; overflow: visible; }
:root[data-theme="dark"] .template-card-lines i { background: #8f7b65; }
:root[data-theme="dark"] .template-card-tag { color: #e5c7a2; background: #54402d; }
:root[data-theme="dark"] .timeline-record time { color: #baa98f; }
:root[data-theme="dark"] .timeline-node { border-color: #c6a274; background: #24211d; }

@media (min-width: 981px) {
  .home-insight-grid {
    grid-template-rows: minmax(166px, 12.5vw) clamp(220px, 15vw, 300px);
  }

  .home-insight-grid .panel {
    min-height: 0;
    height: 100%;
  }

  .home-insight-grid .week-panel .week-content {
    grid-template-columns: minmax(0, 1fr) 72px;
    gap: 12px;
    min-height: 78px;
  }

  .home-insight-grid .week-panel .ring { order: 2; }

  .home-insight-grid .week-days {
    order: 1;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
  }

  .home-insight-grid .week-days li {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 4px;
    text-align: center;
  }

  .home-insight-grid .week-days b { font-size: 9px; }
  .home-insight-grid .week-days small { font-size: 8px; white-space: nowrap; }
  .home-insight-grid .week-panel > p { margin: 8px 0 0; }
}

@media (max-width: 980px) {
  .app-shell { min-width: 0; }
  .editorial-home-page { padding-inline: 24px; }
}

@media (max-width: 980px) {
  .home-start-copy { width: 100%; }
  .home-start-art { display: none; }
  .home-insight-grid, .calibration-hero-grid, .calibration-bottom-grid { grid-template-columns: 1fr; }
  .method-template-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .explore-methods-card { width: calc((100% - 10px) / 2); }
  .library-toolbar-actions { gap: 8px; }
  .compact-page-search { width: 156px; }
}

/* ─────────────────────────────────────────────────────────────
   Product flow consolidation
   One navigation shell, explicit review modes, and real data cards.
   ───────────────────────────────────────────────────────────── */
.workspace-home .top-header,
.workspace-records .top-header,
.workspace-methods .top-header,
.workspace-calibration .top-header {
  display: flex !important;
}

.top-header {
  justify-content: flex-end;
  gap: 14px;
  background: color-mix(in srgb, var(--paper) 88%, transparent) !important;
  backdrop-filter: blur(18px);
}

.top-header .search-box {
  width: min(440px, 46vw);
  margin-right: auto;
  border-color: var(--line);
  background: var(--paper);
}

.sidebar .brand {
  justify-content: flex-start;
  margin: 0 10px 30px;
}

.sidebar .brand > div {
  display: block;
}

:root:not([data-theme="dark"]) .sidebar .brand-name,
:root:not([data-theme="dark"]) .sidebar .brand-subtitle {
  color: var(--ink);
}

.sidebar-progress-card {
  min-height: 0;
  overflow: visible;
  padding: 16px !important;
  border: 1px solid var(--line) !important;
  border-radius: 14px !important;
  background: linear-gradient(145deg, var(--paper-cool), var(--paper)) !important;
}

.sidebar-progress-card > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.sidebar-progress-card > strong {
  display: block;
  margin-top: 9px;
  color: var(--ink);
  font-size: 27px;
  line-height: 1;
}

.sidebar-progress-card > strong small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.sidebar-progress-card > div {
  display: flex;
  gap: 6px;
  margin: 13px 0;
}

.sidebar-progress-card > div span {
  padding: 5px 7px;
  border-radius: 7px;
  color: var(--muted);
  background: var(--bg);
  font-size: 10px;
}

.sidebar-progress-card .outline-button {
  position: static;
  width: 100%;
  height: 34px;
  color: var(--green);
  border: 1px solid var(--line-strong);
  background: var(--paper);
  font-size: 11px;
}

.editorial-home-page,
.methods-library-page,
.records-library-page,
.calibration-visual-page {
  width: 100%;
  max-width: 1440px;
  padding: 34px clamp(28px, 4vw, 64px) 64px;
}

.home-titlebar {
  height: auto;
  margin-bottom: 20px;
}

.home-titlebar h1 {
  color: var(--ink) !important;
  font-size: clamp(28px, 3vw, 38px);
}

.home-titlebar p {
  color: var(--muted) !important;
  font-size: 13px;
}

.home-start-card {
  min-height: 246px;
  aspect-ratio: auto;
  border-color: var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
}

.home-start-copy {
  width: min(720px, 72%);
  padding: 24px 26px 22px;
}

.home-start-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.home-start-copy .home-start-heading h2 {
  margin: 0;
  color: #4b3b2d;
  font-size: 18px;
}

.home-mode-switch,
.library-view-tabs,
.calibration-view-switch,
.calibration-status-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}

.home-mode-switch button,
.library-view-tabs button,
.calibration-view-switch button,
.calibration-status-tabs button {
  min-height: 30px;
  padding: 0 11px;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
}

.home-mode-switch button.active,
.library-view-tabs button.active,
.calibration-view-switch button.active,
.calibration-status-tabs button.active {
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 2px 8px rgba(62, 43, 29, 0.10);
}

.home-draft-field textarea {
  height: 90px;
  padding: 15px 16px;
  color: #4b3b2d;
  font-size: 13px;
  line-height: 1.7;
}

.home-start-meta {
  margin-top: 13px;
}

.home-start-button {
  min-width: 104px;
  height: 34px;
  font-size: 11px;
}

.home-insight-grid {
  gap: 16px;
  margin-top: 16px;
}

.home-insight-grid .panel {
  min-height: 190px;
  padding: 20px;
  border-color: var(--line);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}

.mood-insight-row {
  grid-template-columns: minmax(0, 1fr) 62px 82px;
  margin-top: 17px;
  color: var(--muted) !important;
  font-size: 12px;
}

.mood-insight-row b {
  color: var(--ink) !important;
  text-align: right;
}

.mood-insight-row i {
  height: 4px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--green) 0 var(--insight-progress), var(--line) var(--insight-progress) 100%);
}

.panel-empty-state {
  min-height: 130px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  color: var(--muted);
  text-align: center;
}

.panel-empty-state > span {
  color: var(--orange);
  font-size: 22px;
}

.panel-empty-state strong {
  color: var(--ink);
  font-size: 13px;
}

.panel-empty-state small {
  font-size: 10px;
}

.panel-empty-state button {
  margin-top: 5px;
  color: var(--orange-dark);
  background: transparent;
  font-size: 10px;
  font-weight: 700;
}

.review-setup-page .review-context {
  margin: 18px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
}

.review-setup-page .review-context-summary {
  margin: -6px 0 20px;
}

.library-toolbar {
  height: auto;
  min-height: 54px;
  margin-bottom: 14px;
}

.library-toolbar h1 {
  color: var(--ink) !important;
  font-size: clamp(28px, 3vw, 38px);
}

.library-cta {
  min-width: 112px;
  height: 36px;
  font-size: 11px;
}

.library-view-tabs {
  margin-bottom: 16px;
}

.library-view-tabs button span,
.calibration-view-switch button span,
.calibration-status-tabs button span {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  display: inline-grid;
  place-items: center;
  color: var(--muted);
  background: var(--paper-cool);
  font-size: 9px;
}

.personal-method-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.personal-method-grid .method-card {
  min-width: 0;
}

.library-empty-state {
  grid-column: 1 / -1;
  min-height: 250px;
  padding: 36px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 9px;
  color: var(--muted);
  background: color-mix(in srgb, var(--paper) 70%, transparent);
  text-align: center;
}

.library-empty-state > span {
  color: var(--orange);
  font-size: 28px;
}

.library-empty-state h2,
.library-empty-state p {
  margin: 0;
}

.library-empty-state h2 {
  color: var(--ink);
  font-size: 18px;
}

.library-empty-state p {
  max-width: 460px;
  font-size: 13px;
  line-height: 1.7;
}

.library-empty-state .primary-button {
  margin-top: 8px;
}

.timeline-status {
  padding: 5px 8px;
  border-radius: 99px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.search-template-grid {
  max-width: none;
}

.workspace-calibration {
  background: var(--bg) !important;
}

.calibration-visual-page {
  min-height: 100%;
  color: var(--ink);
  background: transparent !important;
}

.calibration-toolbar {
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
}

.calibration-toolbar h1 {
  color: var(--ink) !important;
  font-size: clamp(28px, 3vw, 38px);
}

.calibration-toolbar p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.calibration-checkin-card,
.calibration-history-panel {
  padding: 22px;
  color: var(--ink);
  border-color: var(--line);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}

.calibration-checkin-card h2,
.calibration-checkin-card h3,
.calibration-history-panel .panel-head,
.calibration-history-panel > h3,
.calibration-history-list h2 {
  color: var(--ink);
}

.mood-scale::before {
  background: var(--line-strong);
}

.mood-scale button {
  color: var(--muted);
}

.mood-scale i {
  color: var(--muted);
  border-color: var(--line-strong);
  background: var(--paper-warm);
}

.mood-scale button.selected i {
  color: #244032;
  border-color: var(--green);
  background: var(--green);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 20%, transparent);
}

.mood-scale i {
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.mood-scale i svg {
  width: 23px;
  height: 23px;
  display: block;
  overflow: visible;
}

.mood-scale button:hover i,
.mood-scale button:focus-visible i {
  color: var(--ink);
  border-color: var(--green);
  background: var(--green-soft);
}

.mood-scale button:focus-visible {
  outline: 0;
}

.mood-scale button.selected i {
  transform: translateY(-2px);
}

.feeling-tags button {
  color: var(--muted);
  border-color: var(--line);
  background: var(--bg);
}

.feeling-tags button.selected {
  color: var(--ink);
  border-color: var(--green);
  background: var(--green-soft);
  box-shadow: none;
}

.calibration-note {
  color: var(--ink);
  border-color: var(--line);
  background: var(--bg);
}

.calibration-checkin-actions {
  color: var(--muted);
}

.calibration-checkin-actions button {
  color: #24372e;
  border-color: var(--green);
  background: var(--green);
}

.breathing-card {
  min-height: 280px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--muted);
  background: radial-gradient(circle, var(--paper-warm), var(--paper));
  box-shadow: var(--shadow-soft);
}

.breathing-ring {
  width: 150px;
  height: 150px;
  position: relative;
  isolation: isolate;
  overflow: visible;
  border-color: var(--orange);
  background: color-mix(in srgb, var(--orange-soft) 55%, transparent);
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--orange) 12%, transparent), inset 0 0 28px color-mix(in srgb, var(--orange) 12%, transparent);
  transform: scale(0.94);
  transform-origin: center;
  will-change: transform, box-shadow;
}

.breathing-ring span,
.breathing-card > small {
  color: var(--muted);
}

.breathing-ring::before {
  content: "";
  position: absolute;
  inset: -24px;
  z-index: 0;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, transparent 0 56%, color-mix(in srgb, var(--orange) 19%, transparent) 59%, transparent 73%);
  filter: blur(4px);
  opacity: 0.26;
  transform: scale(0.88);
  will-change: transform, opacity;
}

.breathing-card.active .breathing-ring::before {
  animation: breathing-halo-cycle 19s linear infinite;
}

.breathing-ring-copy {
  position: relative;
  z-index: 1;
}

.breathing-ring-copy [data-breathing-phase-label] {
  display: inline-block;
  min-width: 4em;
  color: var(--ink);
  font-size: 16px;
  letter-spacing: 0.08em;
}

.breathing-ring-copy [data-breathing-phase-label].phase-changing {
  animation: breathing-label-in 480ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes breathing-halo-cycle {
  0% {
    opacity: 0.22;
    transform: scale(0.88);
    animation-timing-function: cubic-bezier(0.37, 0, 0.63, 1);
  }
  21.0526% {
    opacity: 0.72;
    transform: scale(1.08);
    animation-timing-function: linear;
  }
  57.8947% {
    opacity: 0.62;
    transform: scale(1.08);
    animation-timing-function: cubic-bezier(0.37, 0, 0.63, 1);
  }
  100% {
    opacity: 0.22;
    transform: scale(0.88);
  }
}

@keyframes breathing-label-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .breathing-card.active .breathing-ring,
  .breathing-card.active .breathing-ring::before,
  .breathing-ring-copy [data-breathing-phase-label].phase-changing {
    animation: none;
  }

  .breathing-ring,
  .breathing-ring::before {
    transform: none;
  }
}

.calibration-progress-card,
.calibration-advice-card {
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}

.progress-week span {
  color: var(--muted);
  border-color: var(--line-strong);
}

.progress-week span.done {
  color: #fff;
  border-color: var(--green);
  background: var(--green);
}

.calibration-history-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.history-button {
  height: 34px;
  color: var(--muted);
  border-color: var(--line);
  background: var(--paper);
}

.history-button.active {
  color: var(--ink);
  background: var(--green-soft);
}

.checkin-history-list article {
  color: var(--ink);
  border-color: var(--line);
  background: var(--bg);
}

.checkin-history-list time,
.checkin-history-list p,
.checkin-history-list small {
  color: var(--muted);
}

.checkin-history-list strong {
  color: var(--ink);
}

.calibration-cards-view {
  display: grid;
  gap: 16px;
}

.calibration-cards-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.calibration-cards-intro {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.calibration-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.calibration-library-card {
  min-height: 250px;
  padding: 20px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  background: var(--paper);
}

.calibration-card[data-edit-calibration]::after {
  display: none;
}

.calibration-card-meta,
.calibration-facts,
.calibration-library-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.calibration-card-meta time,
.calibration-facts {
  color: var(--muted);
  font-size: 11px;
}

.calibration-library-card h3 {
  margin: 18px 0 12px;
  font-size: 18px;
  line-height: 1.55;
}

.calibration-result {
  margin-top: 18px;
  padding: 14px;
  border-radius: 12px;
  background: var(--green-soft);
}

.calibration-result.pending {
  background: var(--orange-soft);
}

.calibration-result strong {
  color: var(--ink);
  background: transparent;
  font-size: 13px;
}

.calibration-result p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.calibration-library-card footer {
  margin-top: auto;
  padding-top: 18px;
}

@media (max-width: 980px) {
  .home-start-card { background-image: linear-gradient(135deg, var(--paper-warm), var(--paper)); }
  .home-start-copy { width: 100%; }
  .personal-method-grid,
  .calibration-card-grid { grid-template-columns: 1fr; }
  .calibration-toolbar { align-items: stretch; flex-direction: column; }
  .calibration-view-switch { align-self: flex-start; }
}

@media (max-width: 760px) {
  body { overflow: hidden; }
  .app-shell { display: block; min-width: 0; }
  .workspace { height: 100vh; padding-bottom: 74px; }
  .sidebar {
    position: fixed;
    inset: auto 0 0;
    z-index: 80;
    width: 100%;
    min-height: 0;
    height: 68px;
    padding: 6px 10px;
    border-top: 1px solid var(--line);
    border-right: 0;
    background: color-mix(in srgb, var(--paper) 94%, transparent) !important;
    backdrop-filter: blur(18px);
  }
  .sidebar .brand,
  .sidebar-progress-card { display: none; }
  .side-nav { width: 100%; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .side-nav-item { height: 56px; padding: 5px; justify-content: center; flex-direction: column; gap: 2px; border-radius: 10px; font-size: 10px; }
  .side-nav-item.active { box-shadow: none; }
  .side-nav-item .icon { width: 20px; height: 20px; }
  .top-header { height: 62px; padding: 0 14px; gap: 8px; }
  .top-header .search-box { width: auto; flex: 1; }
  .profile-name { display: none; }
  .profile-button .avatar { width: 30px; height: 30px; }
  .profile-button .down { font-size: 0; }
  .profile-button .down::after { content: "退出"; font-size: 10px; }
  .editorial-home-page,
  .methods-library-page,
  .records-library-page,
  .calibration-visual-page { padding: 24px 16px 42px; }
  .home-start-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .home-mode-switch { width: 100%; }
  .home-mode-switch button { flex: 1; }
  .home-insight-grid { grid-template-columns: 1fr; }
  .review-setup-page .review-context { grid-template-columns: 1fr; }
  .method-template-grid { grid-template-columns: 1fr; }
  .record-timeline { padding-left: 34px; }
  .record-timeline::before { left: 12px; }
  .timeline-record time { position: static; display: block; width: auto; margin-bottom: 6px; text-align: left; }
  .timeline-node { left: -25px; top: 35px; }
  .timeline-record-card { grid-template-columns: 28px minmax(0, 1fr) 14px; }
  .timeline-status { display: none; }
  .calibration-hero-grid,
  .calibration-bottom-grid { grid-template-columns: 1fr; }
  .mood-scale { gap: 3px; }
  .mood-scale i { width: 32px; height: 32px; }
  .calibration-cards-head { align-items: stretch; flex-direction: column; }
  .calibration-status-tabs { width: 100%; }
  .calibration-status-tabs button { flex: 1; }
}

/* ==============================
   Comfortable reading typography
   ============================== */
body {
  font-size: 15px;
}

.brand-subtitle,
.sidebar-progress-card > span,
.sidebar-progress-card .outline-button {
  font-size: 13px;
}

.side-nav-item,
.search-box input,
.profile-button,
.growth-title,
.growth-card p,
.outline-button {
  font-size: 15px;
}

.sidebar-progress-card > strong small,
.sidebar-progress-card > div span {
  font-size: 12px;
}

.home-titlebar p,
.library-page-head p,
.calibration-toolbar p,
.calibration-cards-intro {
  font-size: 15px;
  line-height: 1.65;
}

.home-start-copy .home-start-heading h2 {
  font-size: 20px;
}

.home-mode-switch button,
.library-view-tabs button,
.calibration-view-switch button,
.calibration-status-tabs button,
.home-start-button,
.library-cta,
.history-button {
  font-size: 13px;
}

.home-draft-field textarea,
.draft-field textarea,
.draft-date-field input,
.large-textarea,
.method-editor input,
.method-editor textarea,
.method-editor select,
.detail-editor input,
.detail-editor textarea,
.detail-editor select,
.date-picker,
.month-toolbar select,
.auth-form input,
.calibration-note {
  font-size: 15px;
}

.home-start-meta,
.home-meta-trigger,
.home-meta-options button,
.home-meta-done,
.review-context-summary,
.context-label,
.draft-field span,
.input-footer strong,
.auth-form label {
  font-size: 13px;
}

.home-meta-popover-head strong {
  font-size: 14px;
}

.home-meta-popover-head small {
  font-size: 12px;
}

.home-insight-grid .panel h2,
.panel h2 {
  font-size: 17px;
}

.home-insight-grid .week-days li,
.home-insight-grid .week-days b {
  font-size: 12px;
}

.home-insight-grid .week-days small {
  font-size: 11px;
}

.home-insight-grid .week-panel > p,
.panel-empty-state small,
.panel-empty-state button {
  font-size: 12px;
}

.mood-insight-row {
  font-size: 14px;
}

.panel-empty-state strong,
.home-insight-grid .recent-item strong {
  font-size: 14px;
}

.home-insight-grid .recent-item small,
.home-insight-grid .recent-item em {
  font-size: 12px;
}

.records-filter-row .chip,
.compact-page-search input,
.template-card-tag,
.timeline-record time,
.timeline-stars,
.timeline-status {
  font-size: 12px;
}

.template-card-top b,
.timeline-record-copy b {
  font-size: 15px;
}

.timeline-record-copy small,
.calibration-card-meta time,
.calibration-facts,
.calibration-result p {
  font-size: 13px;
}

.explore-methods-card,
.method-step-chips span,
.record-preview-item h4,
.record-meta,
.source-footer p,
.source-footer time,
.library-card-footer > span:first-child,
.card-badge,
.status-pill {
  font-size: 14px;
}

.record-preview-item p,
.record-preview-item ol,
.record-preview-item ul,
.field-card p,
.field-card ol,
.field-card ul,
.field-card blockquote,
.list-card p,
.list-card ol,
.list-card ul,
.library-empty-state p {
  font-size: 15px;
  line-height: 1.75;
}

.calibration-checkin-card h2,
.calibration-checkin-card h3,
.calibration-history-list h2 {
  font-size: 17px;
}

.mood-scale button,
.feeling-tags button,
.calibration-checkin-actions,
.breathing-ring span,
.breathing-ring small,
.breathing-card > small,
.calibration-progress-card p,
.calibration-history-panel .panel-head span,
.checkin-history-list time,
.checkin-history-list p,
.checkin-history-list small {
  font-size: 12px;
}

.breathing-card > p,
.calibration-progress-card h3,
.calibration-advice-card h3,
.calibration-advice-card p,
.calibration-history-panel > h3,
.checkin-history-list strong,
.calibration-result strong {
  font-size: 14px;
}

@media (max-width: 760px) {
  body {
    font-size: 15px;
  }

  .side-nav-item {
    font-size: 11px;
  }

  .profile-button .down::after {
    font-size: 11px;
  }

  .home-titlebar p,
  .library-page-head p,
  .calibration-toolbar p {
    font-size: 14px;
  }

  .home-insight-grid .week-panel .week-content {
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 12px 0 8px;
  }

  .home-insight-grid .week-panel .ring {
    order: 2;
  }

  .home-insight-grid .week-days {
    order: 1;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
    width: 100%;
  }

  .home-insight-grid .week-days li {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 4px;
    text-align: center;
  }

  .home-insight-grid .week-days b {
    font-size: 11px;
  }

  .home-insight-grid .week-days small {
    font-size: 10px;
    white-space: nowrap;
  }
}

/* Breathing guidance should remain readable without relying on a countdown. */
.breathing-card > p {
  font-size: 18px;
  font-weight: 700;
}

.breathing-ring-copy [data-breathing-phase-label] {
  min-width: 5em;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: 0.1em;
}

.breathing-card > small {
  font-size: 14px;
  line-height: 1.6;
}

.calibration-advice-card strong {
  font-size: 19px;
}

.calibration-advice-card p {
  font-size: 15px;
}

@media (max-width: 760px) {
  .breathing-ring-copy [data-breathing-phase-label] {
    font-size: 20px;
  }
}

/* ==============================
   Large-screen reading scale
   ============================== */
body {
  font-size: 17px;
}

.side-nav-item,
.search-box input,
.profile-button,
.growth-title,
.outline-button {
  font-size: 16px;
}

.brand-subtitle,
.sidebar-progress-card > span,
.sidebar-progress-card .outline-button {
  font-size: 14px;
}

.sidebar-progress-card > strong small,
.sidebar-progress-card > div span,
.growth-card p {
  font-size: 14px;
  line-height: 1.65;
}

.home-titlebar p,
.library-page-head p,
.calibration-toolbar p,
.calibration-cards-intro,
.setup-intro {
  font-size: 17px;
  line-height: 1.7;
}

.home-start-copy .home-start-heading h2 {
  font-size: 22px;
}

.home-mode-switch button,
.library-view-tabs button,
.calibration-view-switch button,
.calibration-status-tabs button,
.home-start-button,
.library-cta,
.history-button,
.review-mode-row button,
.flow-tabs button {
  font-size: 15px;
}

.home-draft-field textarea,
.draft-field textarea,
.draft-date-field input,
.large-textarea,
.method-editor input,
.method-editor textarea,
.method-editor select,
.detail-editor input,
.detail-editor textarea,
.detail-editor select,
.date-picker,
.month-toolbar select,
.auth-form input,
.calibration-note {
  font-size: 17px;
  line-height: 1.75;
}

.home-start-meta,
.home-meta-trigger,
.home-meta-options button,
.home-meta-done,
.review-context-summary,
.context-label,
.draft-field span,
.input-footer strong,
.auth-form label {
  font-size: 15px;
}

.home-meta-popover-head strong {
  font-size: 16px;
}

.home-meta-popover-head small {
  font-size: 14px;
}

.primary-button,
.secondary-button,
.ghost-button,
.chip {
  font-size: 16px;
}

.home-insight-grid .panel h2,
.panel h2 {
  font-size: 20px;
}

.home-insight-grid .week-days li,
.home-insight-grid .week-days b {
  font-size: 14px;
}

.home-insight-grid .week-days small {
  font-size: 12px;
}

.home-insight-grid .week-panel > p,
.panel-empty-state small,
.panel-empty-state button {
  font-size: 14px;
  line-height: 1.6;
}

.mood-insight-row {
  font-size: 16px;
}

.panel-empty-state strong,
.home-insight-grid .recent-item strong {
  font-size: 17px;
}

.home-insight-grid .recent-item small,
.home-insight-grid .recent-item em {
  font-size: 14px;
}

.records-filter-row .chip,
.compact-page-search input,
.template-card-tag,
.timeline-record time,
.timeline-stars,
.timeline-status {
  font-size: 14px;
}

.template-card-top b,
.timeline-record-copy b {
  font-size: 17px;
}

.timeline-record-copy small,
.calibration-card-meta time,
.calibration-facts,
.calibration-result p {
  font-size: 15px;
}

.explore-methods-card,
.method-step-chips span,
.record-preview-item h4,
.record-meta,
.source-footer p,
.source-footer time,
.library-card-footer > span:first-child,
.card-badge,
.status-pill {
  font-size: 15px;
}

.record-title-stack h3,
.calibration-library-card h3 {
  font-size: 21px;
}

.record-preview-item p,
.record-preview-item ol,
.record-preview-item ul,
.field-card p,
.field-card ol,
.field-card ul,
.field-card blockquote,
.list-card p,
.list-card ol,
.list-card ul,
.library-empty-state p,
.detail-hero p,
.auth-form p,
.auth-help-text {
  font-size: 17px;
  line-height: 1.8;
}

.field-card h3,
.list-card h3,
.library-empty-state h2,
.calibration-checkin-card h2,
.calibration-checkin-card h3,
.calibration-history-list h2 {
  font-size: 19px;
}

.mood-scale button,
.feeling-tags button,
.calibration-checkin-actions,
.breathing-ring span,
.breathing-ring small,
.breathing-card > small,
.calibration-progress-card p,
.calibration-history-panel .panel-head span,
.checkin-history-list time,
.checkin-history-list p,
.checkin-history-list small {
  font-size: 14px;
}

.breathing-card > p,
.calibration-progress-card h3,
.calibration-advice-card h3,
.calibration-advice-card p,
.calibration-history-panel > h3,
.checkin-history-list strong,
.calibration-result strong {
  font-size: 17px;
}

.breathing-ring-copy [data-breathing-phase-label] {
  font-size: 24px;
}

.calibration-advice-card strong {
  font-size: 21px;
}

.home-insight-grid .inspiration-panel .quote-art {
  width: min(100%, 300px);
  height: 208px;
  margin: 10px auto 0;
}

@media (max-width: 760px) {
  body {
    font-size: 16px;
  }

  .profile-button {
    flex: 0 0 auto;
    gap: 5px;
  }

  .profile-button .down {
    min-width: 2em;
    white-space: nowrap;
  }

  .profile-button .down::after {
    display: inline-block;
    white-space: nowrap;
  }

  .side-nav-item {
    font-size: 12px;
  }

  .home-titlebar p,
  .library-page-head p,
  .calibration-toolbar p {
    font-size: 16px;
  }

  .result-source-head,
  .result-card-heading {
    display: block;
  }

  .result-source-meta {
    justify-content: flex-start;
    margin-top: 12px;
  }

  .result-card-heading p {
    margin-top: 10px;
    text-align: left;
  }

  .home-insight-grid .week-days b {
    font-size: 12px;
  }

  .home-insight-grid .week-days small {
    font-size: 10px;
  }

  .breathing-ring-copy [data-breathing-phase-label] {
    font-size: 21px;
  }

  .home-insight-grid .inspiration-panel .quote-art {
    width: min(100%, 270px);
    height: 188px;
  }
}
