:root {
  --ink: #172126;
  --muted: #667179;
  --paper: #f7f5ee;
  --surface: #fffdfa;
  --mist: #e8f1ef;
  --blue: #27404a;
  --green: #4f7a68;
  --coral: #d87961;
  --gold: #d5a84f;
  --violet: #6d5b91;
  --line: rgba(23, 33, 38, 0.12);
  --shadow: 0 18px 48px rgba(28, 38, 45, 0.14);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(130deg, rgba(232, 241, 239, 0.92), rgba(247, 245, 238, 0.64) 48%, rgba(255, 239, 225, 0.86)),
    repeating-linear-gradient(90deg, rgba(39, 64, 74, 0.04) 0 1px, transparent 1px 84px);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.app-shell,
.shell {
  width: min(960px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 22px 0 112px;
}

.app-page {
  display: block;
}

#homePage {
  display: flex;
  flex-direction: column;
}

.topbar {
  order: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 24px;
  border: 1px solid rgba(23, 33, 38, 0.1);
  border-radius: 18px;
  background:
    radial-gradient(circle at 92% 12%, rgba(213, 168, 79, 0.2), transparent 30%),
    linear-gradient(135deg, rgba(255, 253, 250, 0.92), rgba(232, 241, 239, 0.74));
  box-shadow: 0 16px 44px rgba(28, 38, 45, 0.1);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.product-mark,
.microcopy,
.section-heading p,
.fact-meta span,
.source-panel span,
.memory-row span,
.account-panel span,
.learning-strip span,
.favorite-item span {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.product-mark {
  color: var(--green);
  font-weight: 800;
}

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

h1 {
  margin-top: 6px;
  font-size: 38px;
  line-height: 1.12;
  font-weight: 850;
}

.lead-copy {
  max-width: 720px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.value-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.value-pills span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid rgba(39, 64, 74, 0.12);
  border-radius: 999px;
  color: var(--blue);
  background: rgba(255, 253, 250, 0.72);
  font-size: 13px;
  font-weight: 760;
}

.session-chip,
.free-badge,
.topic-chip,
.source-chip,
.tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 250, 0.78);
}

.free-badge {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 12px;
  color: var(--green);
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
}

.session-chip {
  padding: 10px 14px;
  color: var(--blue);
  white-space: nowrap;
  box-shadow: 0 10px 28px rgba(39, 64, 74, 0.08);
}

.account-panel {
  order: 2;
  display: none;
  grid-template-columns: 1fr minmax(280px, 420px);
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.82);
}

.account-panel.open {
  display: grid;
}

.account-panel strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
}

.account-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.diary-home-card {
  order: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 20px;
  margin-bottom: 16px;
  padding: 26px;
  border: 1px solid rgba(39, 64, 74, 0.12);
  border-radius: 24px;
  background:
    radial-gradient(circle at 12% 8%, rgba(213, 168, 79, 0.18), transparent 32%),
    linear-gradient(135deg, rgba(255, 253, 250, 0.96), rgba(232, 241, 239, 0.74));
  box-shadow: 0 18px 50px rgba(39, 64, 74, 0.08);
}

.diary-home-card span {
  color: var(--green);
  font-size: 13px;
  font-weight: 850;
}

.diary-home-card h2 {
  max-width: 680px;
  margin-top: 8px;
  font-size: 32px;
}

.diary-home-card p {
  max-width: 680px;
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.75;
}

.home-action-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  min-width: 240px;
}

.learning-strip {
  order: 7;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.secondary-strip {
  margin-bottom: 16px;
}

.learning-strip article,
.strategy-strip article {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.78);
}

.learning-strip strong {
  display: block;
  margin-top: 4px;
  font-size: 28px;
  color: var(--blue);
}

#identityName {
  font-size: 24px;
  color: var(--violet);
  white-space: nowrap;
}

.mindset-band {
  order: 3;
  margin-bottom: 16px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 253, 250, 0.86), rgba(232, 241, 239, 0.76)),
    rgba(255, 253, 250, 0.72);
}

.mindset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.mindset {
  min-height: 42px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--blue);
  background: rgba(255, 253, 250, 0.72);
  font-weight: 780;
  transition:
    transform 160ms ease,
    background 160ms ease,
    color 160ms ease,
    border-color 160ms ease;
}

.mindset.active {
  color: #fffdfa;
  border-color: transparent;
  background: var(--blue);
}

.strategy-strip {
  order: 8;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.strategy-strip article {
  display: grid;
  gap: 8px;
  min-height: 96px;
  border-left: 4px solid rgba(109, 91, 145, 0.34);
}

.strategy-strip strong {
  font-size: 17px;
  color: var(--ink);
}

.strategy-strip span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.fact-stage {
  display: grid;
  gap: 14px;
  order: 4;
}

.fact-stage:not(.has-fact) .source-panel,
.fact-stage:not(.has-fact) .diary-entry-card {
  display: none;
}

.fact-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.fact-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  color: var(--blue);
}

.topic-chip {
  background: rgba(79, 122, 104, 0.15);
}

.source-chip {
  background: rgba(213, 168, 79, 0.16);
}

.fact-card {
  position: relative;
  overflow: hidden;
  min-height: 420px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 253, 250, 0.96), rgba(245, 250, 248, 0.9)),
    linear-gradient(90deg, transparent, rgba(216, 121, 97, 0.12));
  box-shadow: var(--shadow);
  transform: translateY(0) scale(1);
  transform-origin: center top;
  transition:
    opacity 240ms ease,
    transform 360ms cubic-bezier(0.2, 0.9, 0.2, 1),
    filter 240ms ease;
  will-change: opacity, transform, filter;
}

.fact-card::before {
  content: "";
  position: absolute;
  inset: 0;
  width: 9px;
  background: linear-gradient(var(--coral), var(--green), var(--gold));
}

.blindbox-mark {
  position: absolute;
  top: 26px;
  right: 28px;
  width: 82px;
  height: 82px;
  border: 1px solid rgba(39, 64, 74, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 45%, rgba(39, 64, 74, 0.16) 45% 55%, transparent 55%),
    linear-gradient(180deg, rgba(213, 168, 79, 0.18), rgba(79, 122, 104, 0.16));
}

.blindbox-mark::before,
.blindbox-mark::after {
  content: "";
  position: absolute;
  background: rgba(39, 64, 74, 0.18);
}

.blindbox-mark::before {
  left: 0;
  right: 0;
  top: 20px;
  height: 1px;
}

.blindbox-mark::after {
  top: 0;
  bottom: 0;
  left: 40px;
  width: 1px;
}

.blindbox-mark span {
  position: absolute;
  inset: 30px;
  border-radius: 50%;
  background: rgba(216, 121, 97, 0.22);
}

.microcopy {
  color: var(--coral);
  font-weight: 700;
}

h2 {
  max-width: 780px;
  margin-top: 26px;
  font-size: 44px;
  line-height: 1.16;
  font-weight: 850;
}

.fact-summary {
  max-width: 760px;
  margin-top: 22px;
  color: #253138;
  font-size: 20px;
  line-height: 1.8;
}

.memory-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.memory-row > div:last-child {
  padding: 14px;
  border: 1px solid rgba(109, 91, 145, 0.18);
  border-radius: 8px;
  background: rgba(109, 91, 145, 0.07);
}

.memory-row p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.source-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.72);
  transform: translateY(0);
  transition:
    opacity 220ms ease,
    transform 320ms cubic-bezier(0.2, 0.9, 0.2, 1);
  will-change: opacity, transform;
}

.source-panel p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.65;
}

.source-panel a {
  flex: 0 0 auto;
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
  border-bottom: 2px solid rgba(39, 64, 74, 0.28);
}

.diary-entry-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(79, 122, 104, 0.18);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(232, 241, 239, 0.84), rgba(255, 253, 250, 0.88)),
    rgba(255, 253, 250, 0.76);
}

.diary-entry-card span,
.diary-date-row span,
.linked-fact-card span,
.prompt-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.diary-entry-card strong,
.linked-fact-card strong,
.prompt-card strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  line-height: 1.45;
}

.diary-entry-card p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.6;
}

.action-dock {
  order: 5;
  position: fixed;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 2;
  display: grid;
  grid-template-columns: 52px 1fr 52px 52px 52px;
  gap: 10px;
  width: min(960px, calc(100vw - 28px));
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.9);
  box-shadow: 0 14px 42px rgba(28, 38, 45, 0.16);
  backdrop-filter: blur(12px);
  transform: translateX(-50%);
  transition:
    transform 260ms cubic-bezier(0.2, 0.9, 0.2, 1),
    box-shadow 260ms ease,
  opacity 180ms ease;
}

.action-dock:not(.has-fact) {
  grid-template-columns: 1fr;
}

.action-dock:not(.has-fact) .icon-action {
  display: none;
}

.share-toast {
  order: 10;
  position: sticky;
  bottom: 92px;
  z-index: 3;
  width: max-content;
  max-width: calc(100vw - 32px);
  margin: 10px auto 0;
  padding: 10px 14px;
  border: 1px solid rgba(39, 64, 74, 0.16);
  border-radius: 999px;
  color: #fffdfa;
  background: rgba(39, 64, 74, 0.94);
  box-shadow: 0 14px 32px rgba(28, 38, 45, 0.2);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity 180ms ease,
    transform 220ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.share-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.share-sheet {
  order: 10;
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  align-items: end;
  padding: 18px;
  background:
    radial-gradient(circle at 50% 100%, rgba(213, 168, 79, 0.22), transparent 34%),
    rgba(23, 33, 38, 0.36);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  backdrop-filter: blur(10px);
}

.share-sheet.open {
  opacity: 1;
  pointer-events: auto;
}

.share-card {
  position: relative;
  width: min(560px, 100%);
  margin: 0 auto;
  padding: 18px;
  border: 1px solid rgba(23, 33, 38, 0.12);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 253, 250, 0.98), rgba(246, 250, 248, 0.96)),
    #fffdfa;
  box-shadow: 0 24px 72px rgba(23, 33, 38, 0.28);
  transform: translateY(18px);
  transition: transform 220ms cubic-bezier(0.2, 0.9, 0.2, 1);
  overflow: hidden;
}

.share-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--green), var(--gold), var(--coral));
}

.share-sheet.open .share-card {
  transform: translateY(0);
}

.share-card-head,
.share-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.share-card-head span {
  display: block;
  color: var(--green);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.share-card-head strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
  line-height: 1.35;
}

.sheet-close {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  color: var(--blue);
  background: var(--mist);
  font-size: 22px;
  line-height: 1;
}

#shareText {
  min-height: 148px;
  max-height: 230px;
  margin-top: 14px;
  border-color: rgba(79, 122, 104, 0.18);
  background:
    linear-gradient(180deg, rgba(232, 241, 239, 0.72), rgba(255, 253, 250, 0.92)),
    #fffdfa;
  color: #243039;
  line-height: 1.72;
  resize: none;
}

.share-link-row {
  margin-top: 12px;
  padding: 8px;
  border: 1px solid rgba(23, 33, 38, 0.1);
  border-radius: 12px;
  background: rgba(255, 253, 250, 0.72);
}

.share-link-row input {
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  color: var(--muted);
}

.share-link-row .primary {
  flex: 0 0 auto;
  min-height: 42px;
  border-radius: 10px;
  padding: 0 16px;
}

.primary-action,
.icon-action,
.primary,
.secondary,
.ghost {
  min-height: 50px;
  border-radius: 8px;
  transition:
    transform 160ms ease,
    background 160ms ease,
    color 160ms ease,
    opacity 160ms ease;
}

.primary-action,
.primary {
  background: var(--blue);
  color: #fffdfa;
  font-weight: 800;
}

.icon-action,
.secondary {
  background: var(--mist);
  color: var(--blue);
  font-weight: 800;
}

.icon-action {
  font-size: 20px;
}

.quiet,
.ghost {
  border: 1px solid var(--line);
  background: rgba(255, 253, 250, 0.72);
}

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

.preference-band,
.journey-band,
.loop-band,
.favorites-band,
.panel,
.stats-grid > article {
  order: 9;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.72);
}

.preference-band,
.journey-band,
.favorites-band,
.panel {
  padding: 22px;
}

.loop-band {
  padding: 20px 22px;
  background:
    linear-gradient(135deg, rgba(39, 64, 74, 0.92), rgba(109, 91, 145, 0.86)),
    var(--blue);
}

.loop-band span {
  display: block;
  color: rgba(255, 253, 250, 0.72);
  font-size: 13px;
}

.loop-band strong {
  display: block;
  margin-top: 8px;
  color: #fffdfa;
  font-size: 22px;
  line-height: 1.45;
}

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

h3 {
  font-size: 20px;
}

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

.tag {
  padding: 10px 14px;
  color: var(--blue);
  background: rgba(255, 253, 250, 0.7);
}

.tag.active {
  color: #fffdfa;
  background: var(--green);
}

.journey-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.journey-line span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 253, 250, 0.66);
  font-size: 14px;
  font-weight: 750;
}

.journey-line span.done {
  color: #fffdfa;
  border-color: transparent;
  background: var(--violet);
}

.admin-shell {
  padding-bottom: 72px;
}

.hero {
  padding: 18px 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0;
  font-weight: 800;
}

.subtitle {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.65;
}

.token-row,
.form-row,
.card-top,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-toolbar,
.import-controls {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 180px) minmax(140px, 180px) minmax(150px, 200px);
  gap: 10px;
  margin-top: 16px;
}

.import-controls {
  grid-template-columns: minmax(120px, 160px) minmax(220px, 1fr) minmax(140px, 180px);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.stats-grid article {
  padding: 16px;
}

.stats-grid span {
  display: block;
  color: var(--muted);
  margin-bottom: 6px;
}

.stats-grid strong {
  font-size: 30px;
}

.list-grid,
.knowledge-list,
.favorite-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.list-item,
.knowledge-editor,
.favorite-item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.72);
}

.favorite-item {
  display: grid;
  gap: 8px;
}

.favorite-item a {
  width: max-content;
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
  border-bottom: 2px solid rgba(39, 64, 74, 0.24);
}

.empty-state {
  color: var(--muted);
  line-height: 1.7;
}

.list-item p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.65;
}

.admin-form,
.knowledge-editor {
  display: grid;
  gap: 12px;
}

.knowledge-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--blue);
  background: rgba(232, 241, 239, 0.9);
  font-size: 12px;
  font-weight: 800;
}

.mini-stats,
.import-result {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.import-content {
  min-height: 220px;
  margin-top: 12px;
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 13px;
}

.import-result {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.72);
}

.import-result.success {
  color: var(--green);
  border-color: rgba(79, 122, 104, 0.22);
  background: rgba(232, 241, 239, 0.72);
}

.import-result.error {
  color: #85402f;
  border-color: rgba(216, 121, 97, 0.28);
  background: rgba(255, 239, 225, 0.72);
}

.import-result ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

input,
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.86);
  color: var(--ink);
}

textarea {
  min-height: 108px;
  resize: vertical;
}

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

.is-loading .action-dock {
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 18px 52px rgba(28, 38, 45, 0.2);
}

.bottom-nav {
  position: sticky;
  top: 12px;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: min(560px, calc(100vw - 28px));
  margin: 0 auto 16px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 250, 0.92);
  box-shadow: 0 16px 42px rgba(28, 38, 45, 0.18);
  backdrop-filter: blur(14px);
}

.bottom-tab {
  min-height: 44px;
  border-radius: 999px;
  color: var(--blue);
  background: transparent;
  font-weight: 850;
}

.bottom-tab.active {
  color: #fffdfa;
  background: var(--blue);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.today-header,
.review-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.today-header {
  margin-bottom: 14px;
  padding: 10px 2px 0;
}

.today-header h1 {
  margin-top: 4px;
  font-size: clamp(30px, 7vw, 52px);
}

.quick-write-card {
  padding: 18px;
  border: 1px solid rgba(23, 33, 38, 0.1);
  border-radius: 24px;
  background:
    radial-gradient(circle at 12% 8%, rgba(213, 168, 79, 0.14), transparent 34%),
    linear-gradient(145deg, rgba(255, 253, 250, 0.98), rgba(232, 241, 239, 0.74));
  box-shadow: 0 18px 52px rgba(28, 38, 45, 0.1);
}

.compact-prompt {
  padding: 0;
  border: 0;
  background: transparent;
}

.compact-prompt strong {
  font-size: clamp(22px, 5vw, 34px);
  line-height: 1.25;
}

.compact-button {
  width: max-content;
  min-height: 38px;
  padding: 8px 12px;
}

.quick-content {
  min-height: 168px;
  padding: 18px;
  border-radius: 18px;
  font-size: 18px;
  line-height: 1.8;
  background: rgba(255, 253, 250, 0.92);
}

.draft-status {
  margin-top: -4px;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.mood-block {
  display: grid;
  gap: 10px;
}

.mood-block > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.advanced-options {
  border: 1px dashed rgba(39, 64, 74, 0.18);
  border-radius: 16px;
  background: rgba(255, 253, 250, 0.58);
}

.advanced-options summary {
  padding: 13px 14px;
  color: var(--blue);
  cursor: pointer;
  font-weight: 850;
}

.advanced-grid {
  display: grid;
  gap: 12px;
  padding: 0 14px 14px;
}

.finish-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding-top: 4px;
}

.finish-row strong,
.finish-row span {
  display: block;
}

.finish-row strong {
  color: var(--blue);
}

.finish-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.finish-button {
  min-width: 132px;
  border-radius: 16px;
}

.today-summary {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.today-done-card,
.privacy-short-note,
.settings-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 250, 0.76);
}

.today-done-card span,
.privacy-short-note span,
.settings-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.today-done-card strong {
  display: block;
  margin-top: 6px;
  color: var(--blue);
  font-size: 20px;
}

.today-done-card p,
.privacy-short-note p,
.settings-card p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.65;
}

.privacy-short-note {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.review-search {
  min-height: 52px;
  border-radius: 16px;
}

.review-filter-details {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 253, 250, 0.62);
}

.review-filter-details summary {
  padding: 13px 14px;
  cursor: pointer;
  font-weight: 850;
}

.timeline-item {
  cursor: pointer;
}

.timeline-item:hover {
  border-color: rgba(79, 122, 104, 0.28);
  transform: translateY(-1px);
}

.review-empty {
  display: grid;
  gap: 10px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.settings-card strong {
  display: block;
  margin-top: 6px;
  color: var(--blue);
  font-size: 26px;
}

.privacy-detail-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

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

.privacy-note,
.linked-fact-card,
.prompt-card,
.panel-lite,
.diary-item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 250, 0.72);
}

.privacy-note {
  display: grid;
  gap: 5px;
  border-color: rgba(79, 122, 104, 0.2);
  background: rgba(232, 241, 239, 0.68);
}

.privacy-note strong {
  color: var(--green);
}

.privacy-note span {
  color: var(--muted);
  line-height: 1.65;
}

.diary-form {
  display: grid;
  gap: 14px;
}

.diary-date-row,
.prompt-card,
.diary-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.diary-date-control {
  min-width: 180px;
}

.diary-date-control label,
.privacy-control label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.diary-date-control input {
  font-weight: 850;
}

.diary-title-input {
  min-height: 54px;
  font-size: 17px;
  font-weight: 820;
}

.diary-save-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(79, 122, 104, 0.18);
  border-radius: 14px;
  background: rgba(232, 241, 239, 0.58);
}

.diary-save-row strong,
.diary-save-row span,
.privacy-control p {
  display: block;
}

.diary-save-row strong {
  color: var(--blue);
  font-size: 15px;
}

.diary-save-row span,
.privacy-control p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.privacy-control {
  padding: 14px;
  border: 1px dashed rgba(39, 64, 74, 0.24);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 253, 250, 0.92), rgba(232, 241, 239, 0.68)),
    rgba(255, 253, 250, 0.72);
}

.diary-type-row,
.mood-row,
.export-actions,
.review-toolbar,
.diary-tags,
.diary-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.diary-type,
.mood {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--blue);
  background: rgba(255, 253, 250, 0.72);
  font-weight: 800;
}

.diary-type.active,
.mood.active {
  color: #fffdfa;
  border-color: transparent;
  background: var(--green);
}

.linked-fact-card {
  border-left: 5px solid rgba(213, 168, 79, 0.78);
}

.prompt-card {
  align-items: flex-start;
  background:
    linear-gradient(135deg, rgba(255, 253, 250, 0.9), rgba(255, 239, 225, 0.72)),
    rgba(255, 253, 250, 0.72);
}

.diary-content {
  min-height: 180px;
}

.review-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 170px) minmax(120px, 150px) minmax(140px, 170px) minmax(120px, 150px) minmax(150px, 180px);
}

.diary-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.diary-calendar button {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255, 253, 250, 0.64);
}

.diary-calendar button.has-entry {
  color: var(--blue);
  border-color: rgba(79, 122, 104, 0.28);
  background: rgba(232, 241, 239, 0.88);
}

.diary-calendar span,
.diary-calendar strong {
  display: block;
}

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

.diary-item {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 253, 250, 0.74);
}

.diary-item-actions {
  justify-content: flex-end;
  margin-top: 10px;
}

.diary-item-head span,
.diary-prompt-text,
.linked-fact-line,
.diary-version-note {
  color: var(--muted);
  font-size: 13px;
}

.diary-item p {
  margin-top: 10px;
  line-height: 1.75;
}

.diary-tags {
  margin-top: 12px;
}

.diary-tags span {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--green);
  background: rgba(232, 241, 239, 0.82);
  font-size: 12px;
  font-weight: 760;
}

.privacy-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--blue);
  background: rgba(232, 241, 239, 0.9);
  font-size: 12px;
  font-weight: 850;
}

.privacy-private {
  color: var(--blue);
  background: rgba(232, 241, 239, 0.92);
}

.privacy-asset,
.privacy-ai_authorized {
  color: #6b4f15;
  background: rgba(255, 236, 181, 0.72);
}

.privacy-product_authorized,
.privacy-public {
  color: #7b3f2c;
  background: rgba(255, 224, 210, 0.76);
}

.thought-card-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(213, 168, 79, 0.22);
  border-radius: 18px;
  background:
    radial-gradient(circle at 10% 0, rgba(213, 168, 79, 0.16), transparent 34%),
    linear-gradient(135deg, rgba(255, 253, 250, 0.94), rgba(255, 239, 225, 0.72));
}

.thought-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.thought-card {
  padding: 14px;
  border: 1px solid rgba(39, 64, 74, 0.1);
  border-radius: 14px;
  background: rgba(255, 253, 250, 0.82);
}

.thought-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.thought-card strong {
  display: block;
  margin-top: 8px;
  color: var(--blue);
  line-height: 1.35;
}

.thought-card p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.diary-lock-card {
  display: grid;
  gap: 12px;
}

.fact-card.is-exiting {
  opacity: 0;
  filter: blur(5px);
  transform: translateY(12px) scale(0.985);
}

.source-panel.is-exiting {
  opacity: 0;
  transform: translateY(8px);
}

.fact-card.is-entering {
  animation: friendIn 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.source-panel.is-entering {
  animation: sourceIn 360ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.fact-stage.is-switching .topic-chip,
.fact-stage.is-switching .source-chip {
  transition: opacity 180ms ease, transform 260ms ease;
}

@keyframes friendIn {
  from {
    opacity: 0;
    filter: blur(5px);
    transform: translateY(-10px) scale(1.012);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}

@keyframes sourceIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@media (max-width: 720px) {
  body {
    background:
      linear-gradient(160deg, rgba(232, 241, 239, 0.96), rgba(255, 253, 250, 0.78) 44%, rgba(255, 238, 226, 0.9)),
      repeating-linear-gradient(90deg, rgba(39, 64, 74, 0.035) 0 1px, transparent 1px 48px);
  }

  .app-shell,
  .shell {
    width: min(100vw - 16px, 960px);
    padding-top: 14px;
    padding-bottom: calc(104px + env(safe-area-inset-bottom));
  }

  .topbar,
  .top-actions,
  .section-heading,
  .source-panel,
  .account-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar {
    gap: 14px;
    margin-bottom: 12px;
    padding: 18px 16px;
    border-radius: 16px;
  }

  .product-mark {
    font-size: 12px;
  }

  .account-panel,
  .account-form {
    grid-template-columns: 1fr;
  }

  .account-panel {
    padding: 14px;
  }

  .learning-strip {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
  }

  .diary-home-card {
    grid-template-columns: 1fr;
    padding: 20px 16px;
    border-radius: 18px;
  }

  .today-header,
  .review-head,
  .finish-row {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .quick-write-card {
    padding: 16px;
    border-radius: 20px;
  }

  .quick-content {
    min-height: 150px;
    font-size: 16px;
  }

  .finish-button,
  .compact-button {
    width: 100%;
  }

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

  .diary-home-card h2 {
    font-size: 27px;
  }

  .home-action-row {
    min-width: 0;
    justify-content: stretch;
  }

  .home-action-row button {
    flex: 1 1 100%;
  }

  .strategy-strip {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 12px;
  }

  .strategy-strip article {
    min-height: auto;
    padding: 13px 14px;
  }

  .learning-strip article {
    min-height: 76px;
    padding: 12px 10px;
  }

  .learning-strip strong {
    font-size: 23px;
  }

  #identityName {
    font-size: 18px;
    white-space: normal;
  }

  .mindset-band {
    padding: 16px 14px;
    margin-bottom: 12px;
  }

  .mindset-row {
    gap: 8px;
    margin-top: 12px;
  }

  .mindset {
    min-height: 38px;
    padding: 8px 10px;
    font-size: 13.5px;
  }

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

  .lead-copy {
    max-width: 100%;
    margin-top: 10px;
    font-size: 15.5px;
    line-height: 1.72;
  }

  .value-pills {
    gap: 7px;
    margin-top: 13px;
  }

  .value-pills span {
    min-height: 31px;
    padding: 6px 9px;
    font-size: 12px;
  }

  .fact-stage {
    gap: 10px;
  }

  .fact-meta {
    gap: 8px;
  }

  .fact-meta span {
    min-height: 32px;
    padding: 7px 10px;
    font-size: 12px;
  }

  h2 {
    margin-top: 18px;
    font-size: 28px;
    line-height: 1.2;
  }

  .fact-card {
    min-height: 330px;
    padding: 24px 18px 22px;
  }

  .blindbox-mark {
    top: 18px;
    right: 16px;
    width: 58px;
    height: 58px;
  }

  .blindbox-mark::before {
    top: 15px;
  }

  .blindbox-mark::after {
    left: 28px;
  }

  .blindbox-mark span {
    inset: 22px;
  }

  .fact-card::before {
    width: 7px;
  }

  .microcopy {
    font-size: 12px;
  }

  .fact-summary {
    margin-top: 16px;
    font-size: 16.5px;
    line-height: 1.72;
  }

  .memory-row {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 24px;
    padding-top: 18px;
  }

  .memory-row p {
    font-size: 15.5px;
    line-height: 1.68;
  }

  .source-panel {
    gap: 12px;
    padding: 14px;
  }

  .source-panel p {
    font-size: 14.5px;
  }

  .action-dock {
    bottom: calc(8px + env(safe-area-inset-bottom));
    width: min(100vw - 16px, 960px);
    grid-template-columns: 46px 1fr 46px 46px 46px;
    gap: 8px;
    padding: 8px;
  }

  .share-toast {
    bottom: calc(82px + env(safe-area-inset-bottom));
    font-size: 14px;
  }

  .share-sheet {
    padding: 10px;
  }

  .share-card {
    padding: 16px;
    border-radius: 18px 18px 14px 14px;
  }

  .share-card-head,
  .share-link-row {
    align-items: stretch;
    flex-direction: column;
    padding: 8px;
  }

  .sheet-close {
    position: absolute;
    top: 12px;
    right: 12px;
  }

  .share-card-head {
    padding-right: 48px;
  }

  #shareText {
    min-height: 168px;
    max-height: 42vh;
  }

  .primary-action,
  .icon-action,
  .primary,
  .secondary,
  .ghost {
    min-height: 48px;
  }

  .preference-band,
  .journey-band,
  .loop-band,
  .favorites-band,
  .panel {
    padding: 18px 16px;
  }

  .loop-band strong {
    font-size: 18px;
  }

  .section-heading {
    gap: 8px;
  }

  .tag-row {
    gap: 8px;
    margin-top: 12px;
  }

  .tag {
    padding: 9px 12px;
    font-size: 14px;
  }

  .favorite-item {
    padding: 14px;
  }

  .source-panel a,
  .primary,
  .secondary,
  .ghost {
    width: 100%;
    text-align: center;
  }

  .admin-toolbar,
  .import-controls,
  .review-toolbar {
    grid-template-columns: 1fr;
  }

  .diary-entry-card,
  .diary-date-row,
  .prompt-card,
  .diary-item-head,
  .diary-save-row {
    align-items: stretch;
    flex-direction: column;
  }

  .diary-item-actions {
    justify-content: stretch;
  }

  .diary-item-actions button {
    flex: 1 1 100%;
  }

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

  .bottom-nav {
    top: 8px;
    width: min(100vw - 16px, 560px);
    border-radius: 16px;
  }

  .bottom-tab {
    min-height: 42px;
    font-size: 14px;
  }

  .diary-calendar {
    gap: 6px;
  }

  .diary-calendar button {
    min-height: 46px;
    border-radius: 10px;
  }
}
