/* ==========================================================
   Cursus Mentis — cloudy, trusting aesthetic
   Soft desaturated blues (trust/safety), lavender (introspection),
   warm paper (familiarity). Slow motion, low contrast, round shapes.
   ========================================================== */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sky-top: #cfdff0;
  --sky-mid: #e3ecf6;
  --sky-low: #eae7f4;
  --paper: #fbf9f3;
  --paper-line: #e6e0d2;
  --ink: #4a5568;
  --ink-soft: #7b8794;
  --ink-faint: #a3aebc;
  --trust-blue: #7d9fc4;
  --trust-blue-deep: #5a7ea8;
  --lavender: #a9a3c9;
  --forward: #7fae9e;
  --still: #a3a0bd;
  --backward: #c39a9a;
  --gold: #b18f4f;
  --cover-a: #6f8fb5;
  --cover-b: #56749b;
  --shadow: 0 18px 50px rgba(90, 126, 168, 0.28);
}

html, body { height: 100%; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: linear-gradient(175deg, var(--sky-top) 0%, var(--sky-mid) 55%, var(--sky-low) 100%);
  overflow-x: hidden;
}

/* ---------- drifting clouds ---------- */
.sky {
  position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0;
}
.cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  filter: blur(38px);
}
.c1 { width: 420px; height: 130px; top: 8%;  left: -10%; animation: drift 95s linear infinite; }
.c2 { width: 560px; height: 160px; top: 30%; left: 40%;  animation: drift 130s linear infinite; opacity: .8; }
.c3 { width: 340px; height: 110px; top: 62%; left: 10%;  animation: drift 110s linear infinite; opacity: .65; }
.c4 { width: 480px; height: 150px; top: 80%; left: 55%;  animation: drift 150s linear infinite; opacity: .7; }

@keyframes drift {
  from { transform: translateX(-30vw); }
  to   { transform: translateX(130vw); }
}

/* ---------- scene & book ---------- */
.scene {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 4vh 16px;
  perspective: 2200px;
}

.book {
  position: relative;
  width: min(700px, 94vw);
  min-height: 560px;
  transform-style: preserve-3d;
}

/* ---------- cover (opens on load) ---------- */
.cover {
  position: absolute; inset: 0; z-index: 6;
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform 1.9s cubic-bezier(0.65, 0, 0.25, 1);
  cursor: pointer;
}
.book.open .cover { transform: rotateY(-178deg); }
.book.cover-done .cover { display: none; }

.cover-front, .cover-back {
  position: absolute; inset: 0;
  border-radius: 10px 18px 18px 10px;
  backface-visibility: hidden;
}
.cover-front {
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,0.14), transparent 55%),
    linear-gradient(150deg, var(--cover-a), var(--cover-b));
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255,255,255,0.12);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px;
  border-left: 10px solid rgba(0,0,0,0.14);
}
.cover-back {
  background: linear-gradient(150deg, #ece7dc, #e2dccd);
  transform: rotateY(180deg);
  border-radius: 18px 10px 10px 18px;
}
.cover-band {
  position: absolute; top: 0; bottom: 0; right: 44px; width: 14px;
  background: rgba(255,255,255,0.18);
  border-radius: 4px;
}
.cover-logo { margin-bottom: 4px; opacity: 0.95; }
.cover-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.9rem, 6vw, 3rem);
  text-align: center;
  font-weight: 400;
  color: #f4f7fb;
  letter-spacing: 0.06em;
}
.cover-sub {
  color: rgba(244, 247, 251, 0.85);
  font-style: italic;
  font-family: Georgia, serif;
  font-size: 1.02rem;
}
.cover-hint {
  margin-top: 26px;
  color: rgba(244,247,251,0.6);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  animation: breathe 2.4s ease-in-out infinite;
}
@keyframes breathe { 0%,100% { opacity: .35; } 50% { opacity: .85; } }

/* ---------- page ---------- */
.page {
  position: relative;
  min-height: 560px;
  background:
    linear-gradient(90deg, rgba(0,0,0,0.045) 0, transparent 26px),
    var(--paper);
  border-radius: 8px 18px 18px 8px;
  box-shadow: var(--shadow);
  display: flex;
  overflow: hidden;
}
.page-margin {
  width: 54px; flex: none;
  border-right: 1.5px solid rgba(195, 154, 154, 0.35);
  background-image: radial-gradient(circle, rgba(90,126,168,0.35) 2.6px, transparent 3px);
  background-size: 100% 68px;
  background-position: center 34px;
  background-repeat: repeat-y;
}
.page-body {
  flex: 1;
  padding: clamp(26px, 5vw, 48px) clamp(22px, 5vw, 52px);
  min-width: 0;
}

/* ---------- screens ---------- */
.screen { animation: fadein 0.9s ease both; }
@keyframes fadein {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.greeting {
  color: var(--ink-soft);
  font-style: italic;
  font-family: Georgia, serif;
  margin-bottom: 6px;
}
.page-title {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: clamp(1.35rem, 3.4vw, 1.7rem);
  line-height: 1.35;
  color: #3f4a5a;
  margin-bottom: 10px;
}
.soft-note { color: var(--ink-soft); font-size: 0.97rem; margin-bottom: 22px; line-height: 1.55; }

/* choice buttons */
.choice-row { display: flex; flex-direction: column; gap: 14px; margin-bottom: 30px; }
.choice-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  text-align: left;
  padding: 18px 22px;
  border: 1.5px solid rgba(125, 159, 196, 0.35);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(255,255,255,0.85), rgba(233, 240, 248, 0.75));
  cursor: pointer;
  font-family: inherit;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.choice-btn:hover {
  transform: translateY(-2px);
  border-color: var(--trust-blue);
  box-shadow: 0 10px 26px rgba(90, 126, 168, 0.22);
}
.choice-icon { font-size: 1.4rem; }
.choice-label { font-size: 1.06rem; color: #3f4a5a; font-weight: 600; }
.choice-sub { color: var(--ink-faint); font-size: 0.86rem; font-style: italic; }

.past-pages {
  margin: -8px 0 26px;
  padding: 14px 18px;
  border: 1.5px solid rgba(169,163,201,0.4);
  border-radius: 14px;
  background: rgba(246,244,252,0.75);
  cursor: pointer;
  transition: box-shadow .25s;
}
.past-pages:hover { box-shadow: 0 8px 20px rgba(122,116,160,0.15); }
.past-label {
  font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: #6b6890; margin-bottom: 4px;
}
.past-date { font-size: 0.82rem; color: var(--ink-faint); font-weight: 600; margin-bottom: 6px; }
.past-text { font-family: Georgia, "Times New Roman", serif; color: var(--ink); font-size: 0.95rem; line-height: 1.6; white-space: pre-wrap; }

.search-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.value-input.search { flex: 1 1 240px; }

.home-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stat-line { color: var(--ink-faint); font-size: 0.88rem; }

/* buttons */
.primary-btn {
  padding: 12px 28px;
  border: none; border-radius: 999px;
  background: linear-gradient(150deg, var(--trust-blue), var(--trust-blue-deep));
  color: #fdfefe; font-size: 0.98rem; font-family: inherit; font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(90, 126, 168, 0.3);
  transition: transform .25s ease, box-shadow .25s ease, opacity .25s ease;
}
.primary-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(90,126,168,.38); }
.primary-btn:disabled { opacity: 0.4; cursor: default; box-shadow: none; }

.link-btn {
  background: none; border: none; cursor: pointer;
  color: var(--trust-blue-deep); font-family: inherit; font-size: 0.95rem;
  padding: 6px 2px;
}
.link-btn:hover { text-decoration: underline; }
.link-btn.back { margin-bottom: 14px; color: var(--ink-faint); }

.row-end { display: flex; justify-content: flex-end; margin-top: 16px; }

/* writing area — lined paper */
.paper-area {
  width: 100%;
  border: none; outline: none; resize: vertical;
  background:
    repeating-linear-gradient(transparent, transparent 31px, var(--paper-line) 31px, var(--paper-line) 32px);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem; line-height: 32px;
  color: #3d4657;
  min-height: 190px;
  caret-color: var(--trust-blue-deep);
}
.paper-area::placeholder { color: var(--ink-faint); font-style: italic; }

.date-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.date-label { color: var(--ink-faint); font-size: 0.85rem; font-style: italic; }
.date-input {
  border: 1.5px solid rgba(125,159,196,0.35);
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.75);
  font-family: inherit; font-size: 0.85rem;
  color: #3f4a5a;
  outline: none;
}
.date-input:focus { border-color: var(--trust-blue-deep); }

.period-row { display: flex; gap: 8px; flex-wrap: wrap; }
.period-btn {
  border: 1.5px solid rgba(125,159,196,0.3);
  border-radius: 999px;
  padding: 6px 14px;
  background: rgba(255,255,255,0.7);
  font-family: inherit; font-size: 0.83rem;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color .25s, background .25s, color .25s;
}
.period-btn:hover { border-color: var(--trust-blue); }
.period-btn.selected {
  border-color: var(--trust-blue-deep);
  background: rgba(233,240,248,0.95);
  color: #3f4a5a;
}

.counter { margin-top: 10px; font-size: 0.85rem; color: var(--ink-faint); transition: color .3s; }
.counter.met { color: var(--forward); }

/* reflect dots */
.dots { display: flex; gap: 8px; margin-bottom: 22px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(125,159,196,0.25); transition: background .4s; }
.dot.on { background: var(--trust-blue); }

/* direction options */
.direction-row { display: flex; flex-direction: column; gap: 12px; margin: 18px 0 8px; }
.direction-btn {
  text-align: left; padding: 15px 20px;
  border: 1.5px solid rgba(125,159,196,0.3);
  border-radius: 14px;
  background: rgba(255,255,255,0.7);
  cursor: pointer; font-family: inherit;
  display: flex; flex-direction: column; gap: 2px;
  transition: border-color .25s, background .25s, transform .2s;
}
.direction-btn:hover { transform: translateY(-1px); border-color: var(--lavender); }
.direction-btn.selected { border-color: var(--trust-blue-deep); background: rgba(233,240,248,0.95); box-shadow: 0 6px 18px rgba(90,126,168,0.18); }
.dir-label { font-weight: 600; color: #3f4a5a; }
.dir-sub { color: var(--ink-faint); font-size: 0.85rem; font-style: italic; }

.ps-note {
  font-size: 0.85rem; color: var(--ink-faint); font-style: italic;
  margin: 14px 0 20px; line-height: 1.5;
}

.weight-label { font-size: 0.9rem; color: var(--ink-soft); margin-bottom: 10px; }
.weight-row { display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
.weight-btn {
  text-align: left; padding: 11px 16px;
  border: 1.5px solid rgba(125,159,196,0.25);
  border-radius: 12px;
  background: rgba(255,255,255,0.6);
  cursor: pointer; font-family: inherit;
  display: flex; flex-direction: column; gap: 1px;
  transition: border-color .25s, background .25s;
}
.weight-btn .w-name { font-weight: 600; font-size: 0.92rem; color: #3f4a5a; }
.weight-btn .w-sub { color: var(--ink-faint); font-size: 0.8rem; font-style: italic; }
.weight-btn:hover { border-color: var(--lavender); }
.weight-btn.selected { border-color: var(--trust-blue-deep); background: rgba(233,240,248,0.9); }
.weight-btn[data-weight="significant"].selected { border-color: var(--lavender); background: rgba(246,244,252,0.95); }
.weight-btn[data-weight="transformative"].selected { border-color: var(--gold); background: rgba(250,246,236,0.95); }

/* done screen */
.done-cloud { font-size: 2.6rem; margin-bottom: 12px; animation: floaty 4s ease-in-out infinite; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.done-row { flex-direction: row; align-items: center; margin-top: 28px; }

/* journey */
.backup-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -8px 0 22px; }
.ghost-btn {
  padding: 8px 16px;
  border: 1.5px solid rgba(125, 159, 196, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--trust-blue-deep);
  font-family: inherit; font-size: 0.85rem;
  cursor: pointer;
  transition: border-color .25s, box-shadow .25s;
}
.ghost-btn:hover { border-color: var(--trust-blue); box-shadow: 0 6px 16px rgba(90,126,168,0.16); }
.backup-status { font-size: 0.82rem; color: var(--forward); font-style: italic; }

.stats-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.stat-card {
  flex: 1; min-width: 130px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(125,159,196,0.25);
  border-radius: 14px; padding: 14px 16px;
}
.stat-num { font-family: Georgia, serif; font-size: 1.55rem; color: var(--trust-blue-deep); }
.stat-label { font-size: 0.8rem; color: var(--ink-faint); margin-top: 2px; }

.section-label {
  font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-soft); margin: 22px 0 10px;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px;
}
.legend { display: flex; gap: 12px; text-transform: none; letter-spacing: 0; }
.lg { font-size: 0.78rem; }
.lg.fwd { color: var(--forward); }
.lg.stl { color: var(--still); }
.lg.bwd { color: var(--backward); }

.year-wrap { margin-bottom: 8px; }
#year-chart {
  width: 100%; height: auto;
  background: rgba(255,255,255,0.55);
  border-radius: 12px;
  border: 1px solid rgba(125,159,196,0.2);
}
.observation {
  color: var(--ink-soft); font-size: 0.9rem; font-style: italic; line-height: 1.55;
  padding: 6px 0 0 4px;
}
.observation::before { content: "◦ "; color: var(--trust-blue); font-style: normal; }

.pattern-box {
  margin: 20px 0 4px;
  padding: 14px 18px;
  border: 1.5px solid rgba(169,163,201,0.5);
  border-radius: 14px;
  background: rgba(246,244,252,0.85);
}
.pattern-title {
  font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: #6b6890; margin-bottom: 6px;
}
.pattern-text { color: var(--ink); font-size: 0.95rem; line-height: 1.6; font-family: Georgia, serif; }
.pattern-foot { margin-top: 8px; font-size: 0.76rem; color: var(--ink-faint); font-style: italic; }

.tiny-note { font-size: 0.82rem; color: var(--ink-faint); font-style: italic; margin: -4px 0 12px; line-height: 1.5; }

/* journey page turning — soft folded-corner buttons */
.page-nav { display: flex; margin-top: 30px; }
.page-nav.right { justify-content: flex-end; }
.page-nav.left { justify-content: flex-start; }
.corner-btn {
  display: inline-flex; align-items: center; gap: 9px;
  border: none; background: none; cursor: pointer;
  font-family: Georgia, "Times New Roman", serif; font-style: italic;
  color: var(--ink-faint); font-size: 0.95rem;
  padding: 10px 14px;
  border-radius: 14px;
  transition: color 0.3s ease, background 0.3s ease;
}
.corner-btn:hover {
  color: var(--trust-blue-deep);
  background: rgba(233, 240, 248, 0.7);
}
.page-nav.split { justify-content: space-between; }
/* the little dog-eared page corner */
.corner-btn.fwd::after {
  content: "";
  width: 18px; height: 18px;
  background: linear-gradient(to top left, rgba(125, 159, 196, 0.35) 49%, transparent 50%);
  border-bottom-right-radius: 6px;
  transition: background 0.3s ease;
}
.corner-btn.back::before {
  content: "";
  width: 18px; height: 18px;
  background: linear-gradient(to top right, rgba(125, 159, 196, 0.35) 49%, transparent 50%);
  border-bottom-left-radius: 6px;
  transition: background 0.3s ease;
}
.corner-btn.fwd:hover::after {
  background: linear-gradient(to top left, rgba(90, 126, 168, 0.55) 49%, transparent 50%);
}
.corner-btn.back:hover::before {
  background: linear-gradient(to top right, rgba(90, 126, 168, 0.55) 49%, transparent 50%);
}

/* identity & values snapshot */
.congruence-line {
  font-family: Georgia, "Times New Roman", serif; font-style: italic;
  color: var(--ink-soft); line-height: 1.55;
  margin: 4px 0 16px;
}
.value-card {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(125,159,196,0.22);
  border-radius: 14px;
  padding: 12px 18px;
  margin-bottom: 8px;
}
.value-card .value-name { font-weight: 600; color: #3f4a5a; }
.value-card .value-status { font-size: 0.85rem; font-style: italic; color: var(--ink-faint); }
.value-card.alive { border-color: rgba(127,174,158,0.45); }
.value-card.alive .value-status { color: #5d8a7b; }
.value-card.quiet { border-color: rgba(195,154,154,0.5); background: rgba(250,244,244,0.8); }
.value-card.quiet .value-status { color: #96625f; }
.value-suggest {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: rgba(246,244,252,0.85);
  border: 1.5px solid rgba(169,163,201,0.45);
  border-radius: 14px;
  padding: 12px 16px;
  margin: 10px 0;
}
.suggest-text { flex: 1; min-width: 200px; font-size: 0.9rem; color: var(--ink); line-height: 1.5; }
.value-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.value-input {
  border: 1.5px solid rgba(125,159,196,0.35);
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(255,255,255,0.8);
  font-family: inherit; font-size: 0.88rem;
  color: #3f4a5a;
  outline: none;
}
.value-input:focus { border-color: var(--trust-blue-deep); }
.value-input.name { flex: 0 1 180px; }
.value-input.words { flex: 1 1 240px; }
#snapshot-history { margin-top: 22px; }

#journey-page-1, #journey-page-2 { backface-visibility: hidden; }
.turn-out-fwd  { animation: turnOutFwd 0.28s ease-in both;  transform-origin: left center; }
.turn-in-fwd   { animation: turnInFwd 0.32s ease-out both;  transform-origin: right center; }
.turn-out-back { animation: turnOutBack 0.28s ease-in both; transform-origin: right center; }
.turn-in-back  { animation: turnInBack 0.32s ease-out both; transform-origin: left center; }
@keyframes turnOutFwd  { from { transform: perspective(1400px) rotateY(0); opacity: 1; } to { transform: perspective(1400px) rotateY(-70deg); opacity: 0; } }
@keyframes turnInFwd   { from { transform: perspective(1400px) rotateY(-45deg); opacity: 0; } to { transform: perspective(1400px) rotateY(0); opacity: 1; } }
@keyframes turnOutBack { from { transform: perspective(1400px) rotateY(0); opacity: 1; } to { transform: perspective(1400px) rotateY(70deg); opacity: 0; } }
@keyframes turnInBack  { from { transform: perspective(1400px) rotateY(45deg); opacity: 0; } to { transform: perspective(1400px) rotateY(0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .turn-out-fwd, .turn-in-fwd, .turn-out-back, .turn-in-back { animation-duration: 0.01s; }
}

.trajectory-wrap { margin-bottom: 8px; }
#trajectory {
  width: 100%; height: 90px;
  background: rgba(255,255,255,0.55);
  border-radius: 12px;
  border: 1px solid rgba(125,159,196,0.2);
}

.entry-card {
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(125,159,196,0.22);
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: box-shadow .25s;
}
.entry-card:hover { box-shadow: 0 8px 20px rgba(90,126,168,0.16); }
.entry-card.significant { border-color: rgba(169,163,201,0.6); background: rgba(246,244,252,0.85); }
.entry-card.transformative { border: 1.5px solid rgba(177,143,79,0.55); background: rgba(250,246,236,0.9); box-shadow: 0 6px 18px rgba(177,143,79,0.12); }

.entry-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.entry-date { font-size: 0.85rem; color: var(--ink-soft); font-weight: 600; }
.chip {
  font-size: 0.72rem; padding: 3px 10px; border-radius: 999px;
  background: rgba(125,159,196,0.15); color: var(--trust-blue-deep);
}
.chip.dir-forwards  { background: rgba(127,174,158,0.18); color: #4d7d6d; }
.chip.dir-still     { background: rgba(163,160,189,0.2);  color: #6b6890; }
.chip.dir-backwards { background: rgba(195,154,154,0.2);  color: #96625f; }
.chip.star { background: rgba(169,163,201,0.22); color: #6b6890; }
.chip.trans { background: rgba(177,143,79,0.18); color: #8a6d3b; }
.chip.tone-uplifting { background: rgba(127,174,158,0.14); color: #5d8a7b; font-style: italic; }
.chip.tone-hurting   { background: rgba(195,154,154,0.14); color: #a07a78; font-style: italic; }
.chip.tone-mixed     { background: rgba(163,160,189,0.14); color: #7b789e; font-style: italic; }

#month-summaries { margin-top: 4px; }

.entry-excerpt { color: var(--ink-soft); font-size: 0.92rem; line-height: 1.5; font-family: Georgia, serif; }

.entry-full { display: none; margin-top: 12px; border-top: 1px dashed rgba(125,159,196,0.35); padding-top: 12px; }
.entry-card.expanded .entry-full { display: block; }
.entry-q { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); margin: 12px 0 4px; }
.entry-a { color: var(--ink); font-size: 0.94rem; line-height: 1.6; font-family: Georgia, serif; white-space: pre-wrap; }

.empty-note { color: var(--ink-soft); font-style: italic; line-height: 1.6; }

/* entry editing & deleting */
.entry-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.ghost-btn.small { font-size: 0.8rem; padding: 6px 14px; }
.ghost-btn.danger { color: #96625f; border-color: rgba(195, 154, 154, 0.45); }
.ghost-btn.danger:hover { border-color: #c39a9a; box-shadow: 0 6px 16px rgba(195, 154, 154, 0.18); }
.confirm-note { font-size: 0.85rem; color: #96625f; font-style: italic; }
.edit-area { min-height: 110px; font-size: 0.98rem; }
.edit-row { display: flex; gap: 16px; flex-wrap: wrap; margin: 12px 0 4px; }
.edit-row label {
  display: flex; align-items: center; gap: 7px;
  font-size: 0.82rem; color: var(--ink-soft);
}
.edit-select {
  border: 1.5px solid rgba(125,159,196,0.35);
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.85);
  font-family: inherit; font-size: 0.85rem;
  color: #3f4a5a;
  outline: none;
}
.edit-select:focus { border-color: var(--trust-blue-deep); }
.primary-btn.small-btn { padding: 9px 22px; font-size: 0.9rem; }
.entry-card.editing { cursor: default; }

/* deeper analysis (optional AI) */
.ai-wrap { margin-top: 10px; }
.ai-key-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 10px 0 6px; }
.ai-key-input {
  flex: 1; min-width: 220px;
  padding: 9px 14px;
  border: 1.5px solid rgba(125,159,196,0.35);
  border-radius: 999px;
  background: rgba(255,255,255,0.75);
  font-family: inherit; font-size: 0.85rem;
  color: #3f4a5a;
  outline: none;
}
.ai-key-input:focus { border-color: var(--trust-blue-deep); }
.ai-output {
  margin-top: 12px;
  padding: 14px 18px;
  border: 1.5px solid rgba(125,159,196,0.4);
  border-radius: 14px;
  background: rgba(255,255,255,0.8);
}
.ai-output .pattern-text { white-space: pre-wrap; }

@media (max-width: 560px) {
  .page-margin { width: 26px; }
  .done-row { flex-direction: column; align-items: flex-start; }
}
