/* ============================================================
   Dear Journal — warm paper, real ink, gentle motion.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@500;600;700&family=Nunito:wght@400;600;700;800&family=Patrick+Hand&display=swap');

:root {
  --bg: #f2e8d5;
  --bg-2: #eadcbc;
  --paper: #fffdf4;
  --paper-2: #fdf5e0;
  --ink: #3b3227;
  --ink-soft: #8a7d68;
  --faint: #c9bda3;
  --line: rgba(91, 140, 190, .30);
  --margin: rgba(224, 110, 110, .50);
  --accent: #d95d39;
  --accent-dark: #b34a2c;
  --accent-2: #2a9d8f;
  --danger: #c0392b;
  --gold: #e9b949;
  --tape: rgba(246, 205, 121, .65);
  --shadow: 0 10px 30px rgba(59, 50, 39, .14);
  --shadow-soft: 0 4px 14px rgba(59, 50, 39, .10);
}

body.night {
  --bg: #1d1a24;
  --bg-2: #16131d;
  --paper: #272233;
  --paper-2: #2e2939;
  --ink: #eae3d4;
  --ink-soft: #a99f8d;
  --faint: #5c5566;
  --line: rgba(255, 255, 255, .12);
  --margin: rgba(255, 120, 120, .30);
  --tape: rgba(246, 205, 121, .22);
  --shadow: 0 12px 34px rgba(0, 0, 0, .45);
  --shadow-soft: 0 4px 14px rgba(0, 0, 0, .35);
}

/* paper themes */
body.theme-sage { --bg: #e6ecdd; --bg-2: #dbe4d0; --paper: #fbfdf6; --paper-2: #eef4e6; --accent: #5e8c61; --accent-dark: #47714a; --margin: rgba(110, 160, 120, .45); }
body.theme-blush { --bg: #f6e4e0; --bg-2: #eed7d2; --paper: #fffaf8; --paper-2: #faecea; --accent: #c26177; --accent-dark: #a24a5f; --margin: rgba(194, 97, 119, .4); }
body.theme-ocean { --bg: #dde8ee; --bg-2: #cfdde6; --paper: #f9fcfe; --paper-2: #eaf2f7; --accent: #3a7ca5; --accent-dark: #2c6083; --accent-2: #2a9d8f; --margin: rgba(58, 124, 165, .4); }

/* pen (typography) themes */
body.font-serif, body.font-serif input, body.font-serif textarea, body.font-serif select {
  --font-body: Georgia, 'Times New Roman', serif;
}
body.font-serif p, body.font-serif li, body.font-serif .btn, body.font-serif .topnav a, body.font-serif label { font-family: Georgia, 'Times New Roman', serif; }
body.font-serif .sheet-lines, body.font-serif .sheet-title, body.font-serif .note-content, body.font-serif .entry-text strong { font-family: Georgia, serif; }
body.font-mono .sheet-lines, body.font-mono .sheet-title, body.font-mono input, body.font-mono textarea { font-family: 'Cutive Mono', ui-monospace, 'Courier New', monospace; }
body.font-mono p, body.font-mono li, body.font-mono .note-content { font-family: ui-monospace, 'Courier New', monospace; }

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: 'Nunito', sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(233, 185, 73, .10), transparent 60%),
    radial-gradient(900px 420px at -10% 30%, rgba(42, 157, 143, .08), transparent 55%),
    linear-gradient(160deg, var(--bg), var(--bg-2));
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .logo, .sheet-title { font-family: 'Caveat', cursive; }
p, li, label, td, th { font-size: .98rem; }
a { color: var(--accent-dark); }
body.night a { color: #ef9b7c; }
.muted { color: var(--ink-soft); }

:focus-visible { outline: 3px dashed var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------------- Top bar ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 1rem;
  padding: .7rem 1.4rem;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--faint);
  box-shadow: var(--shadow-soft);
}
.logo {
  font-size: 1.65rem; font-weight: 700; text-decoration: none;
  color: var(--ink); letter-spacing: .5px;
  transition: transform .2s;
}
.logo:hover { transform: rotate(-2deg) scale(1.03); }
.topnav { display: flex; align-items: center; gap: .4rem; margin-left: auto; }
.topnav a {
  font-family: 'Nunito'; font-weight: 700; font-size: .92rem;
  color: var(--ink); text-decoration: none;
  padding: .45rem .85rem; border-radius: 999px;
  transition: background .15s, transform .15s;
}
.topnav a:hover { background: var(--paper-2); transform: translateY(-1px); }
.topnav a.active { background: var(--ink); color: var(--paper); }
.top-actions { display: flex; align-items: center; gap: .5rem; }

/* ---------------- Buttons & inputs ---------------- */
.btn {
  font-family: 'Nunito'; font-weight: 700; font-size: .95rem;
  color: var(--ink); background: var(--paper);
  border: 2px solid var(--ink); border-radius: 14px;
  padding: .55rem 1.15rem; cursor: pointer; text-decoration: none;
  display: inline-block; text-align: center;
  box-shadow: 2px 3px 0 rgba(59, 50, 39, .28);
  transition: transform .16s, box-shadow .16s, background .16s;
}
.btn:hover { transform: translateY(-2px) rotate(-.6deg); box-shadow: 3px 5px 0 rgba(59, 50, 39, .28); }
.btn:active { transform: translateY(1px); box-shadow: 1px 1px 0 rgba(59, 50, 39, .28); }
.btn-primary { background: var(--accent); border-color: var(--accent-dark); color: #fff; }
.btn-primary:hover { background: #e06b48; }
.btn-danger { background: var(--danger); border-color: #8f2b20; color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--paper-2); }
.btn-small { padding: .35rem .8rem; font-size: .85rem; border-radius: 11px; }
.btn-tiny { padding: .18rem .55rem; font-size: .75rem; border-radius: 9px; border-width: 1.5px; box-shadow: 1px 2px 0 rgba(59,50,39,.25); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.icon-btn {
  font-size: 1.15rem; background: var(--paper-2); border: 1.5px solid var(--faint);
  border-radius: 999px; width: 2.4rem; height: 2.4rem; cursor: pointer;
  transition: transform .2s;
}
.icon-btn:hover { transform: rotate(18deg) scale(1.1); }

input, textarea, select {
  font-family: 'Patrick Hand', cursive; font-size: 1.1rem; color: var(--ink);
  background: var(--paper); border: 2px solid var(--faint); border-radius: 10px;
  padding: .6rem .8rem; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}
select { font-family: 'Nunito'; font-weight: 600; width: auto; }
::placeholder { color: var(--faint); opacity: 1; }

.link-btn {
  background: none; border: none; cursor: pointer;
  font-family: 'Nunito'; font-weight: 700; font-size: .85rem;
  color: var(--accent-dark); padding: .2rem .3rem; border-radius: 6px;
}
body.night .link-btn { color: #ef9b7c; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--danger); }
.link-btn:disabled { opacity: .55; cursor: default; text-decoration: none; }

/* ---------------- Tabs ---------------- */
.tabs { display: flex; gap: .3rem; border-bottom: 2px dashed var(--faint); margin-bottom: 1rem; }
.tab {
  font-family: 'Nunito'; font-weight: 800; font-size: .92rem;
  background: none; border: none; cursor: pointer; color: var(--ink-soft);
  padding: .5rem .9rem; margin-bottom: -2px;
  border-bottom: 3px solid transparent; transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--accent-dark); border-bottom-color: var(--accent); }
body.night .tab.active { color: #ef9b7c; }
.small-tabs { border-bottom: none; gap: .35rem; }
.small-tabs .tab { border: 2px solid var(--faint); border-radius: 999px; margin-bottom: 0; }
.small-tabs .tab.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* ---------------- Landing ---------------- */
.landing { max-width: 1080px; margin: 0 auto; padding: 2.5rem 1.4rem 4rem; }
.hero { display: flex; gap: 3rem; align-items: center; flex-wrap: wrap; margin-bottom: 4rem; }
.hero-paper {
  flex: 1 1 460px;
  background: var(--paper); border-radius: 8px; padding: 2.6rem 2.6rem 2.2rem;
  box-shadow: var(--shadow); transform: rotate(-.6deg); position: relative;
}
.hero-paper::before {
  content: ''; position: absolute; top: -14px; left: 50%; transform: translateX(-50%) rotate(-2deg);
  width: 110px; height: 28px; background: var(--tape); border-radius: 3px;
  box-shadow: 0 2px 4px rgba(0,0,0,.08);
}
.hero-kicker {
  font-family: 'Nunito'; font-weight: 800; text-transform: uppercase;
  letter-spacing: .18em; font-size: .72rem; color: var(--accent-2); margin: 0 0 .4rem;
}
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.2rem); line-height: 1.02; margin: 0 0 .6rem; }
.scribble {
  color: var(--accent); position: relative; display: inline-block;
}
.scribble::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 2px; height: 8px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='10'%3E%3Cpath d='M2 6 Q 18 1 34 6 T 66 6 T 98 6 T 130 5' fill='none' stroke='%23e9b949' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") repeat-x;
  background-size: 120px 10px;
}
.hero-sub { font-size: 1.05rem; line-height: 1.65; color: var(--ink-soft); max-width: 46ch; }
.hero-cta { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.4rem; }

.sticky-notes { flex: 0 1 320px; position: relative; min-height: 320px; }
.sticky {
  position: absolute; width: 150px; padding: 1.5rem 1rem 1rem;
  font-family: 'Caveat'; font-size: 1.25rem; line-height: 1.15; color: #5a4a1f;
  box-shadow: 0 8px 18px rgba(59, 50, 39, .18);
  animation: floaty 5.5s ease-in-out infinite;
}
.s1 { background: #ffe8a3; top: 8px; left: 6%; --r: -5deg; transform: rotate(var(--r)); }
.s2 { background: #ffd9d2; top: 110px; left: 38%; --r: 4deg; transform: rotate(var(--r)); animation-delay: -1.8s; }
.s3 { background: #d6f0e6; top: 224px; left: 12%; --r: -3deg; transform: rotate(var(--r)); animation-delay: -3.4s; }
.doodle {
  position: absolute; font-size: 1.6rem; opacity: .55; color: var(--accent);
  animation: floaty 6s ease-in-out infinite;
}
.d1 { top: -8px; right: 4%; animation-delay: -2s; }
.d2 { top: 150px; right: -2%; font-size: 2rem; animation-delay: -4s; color: var(--accent-2); }
.d3 { top: 300px; right: 18%; animation-delay: -1s; }

.features {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.2rem; margin-bottom: 4rem;
}
.feature-card {
  background: var(--paper); border-radius: 8px; padding: 1.5rem 1.4rem;
  box-shadow: var(--shadow-soft); border-top: 5px solid var(--gold);
  transition: transform .2s, box-shadow .2s;
}
.feature-card:nth-child(2) { border-top-color: var(--accent-2); }
.feature-card:nth-child(3) { border-top-color: var(--accent); }
.feature-card:nth-child(4) { border-top-color: #7d6cd9; }
.feature-card:hover { transform: translateY(-5px) rotate(-.4deg); box-shadow: var(--shadow); }
.feature-icon { font-size: 1.9rem; display: block; margin-bottom: .4rem; }
.feature-card h3 { margin: .1rem 0 .4rem; font-size: 1.6rem; }
.feature-card p { margin: 0; color: var(--ink-soft); line-height: 1.55; }

.privacy-strip {
  background: var(--paper); border-radius: 8px; padding: 2rem 2.2rem;
  box-shadow: var(--shadow); transform: rotate(.3deg);
  border-left: 8px solid var(--accent-2);
}
.privacy-strip h2 { margin: 0 0 .8rem; font-size: 2.2rem; }
.privacy-strip ul { margin: 0; padding-left: 1.2rem; line-height: 2; color: var(--ink-soft); }

.footer { text-align: center; padding: 2rem 1rem 3rem; color: var(--ink-soft); font-size: .9rem; }

/* ---------------- Auth ---------------- */
.auth-body { display: flex; }
.auth-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 3rem 1.2rem; }
.auth-card {
  width: 100%; max-width: 430px;
  background: var(--paper); border-radius: 10px; padding: 2rem 2.1rem 2.2rem;
  box-shadow: var(--shadow); position: relative;
}
.auth-card::before {
  content: ''; position: absolute; top: -13px; left: 34px; transform: rotate(-4deg);
  width: 90px; height: 26px; background: var(--tape); border-radius: 3px;
}
.auth-head { text-align: center; margin-bottom: 1rem; }
.auth-head .logo { font-size: 2rem; }
.auth-sub { margin: 0; color: var(--ink-soft); font-family: 'Caveat'; font-size: 1.25rem; }
.auth-form label {
  display: block; font-family: 'Nunito'; font-weight: 700; font-size: .85rem;
  color: var(--ink-soft); margin: .9rem 0 .3rem; text-transform: uppercase; letter-spacing: .06em;
}
.auth-form .btn { margin-top: 1.2rem; }
.form-error {
  color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent);
  border-left: 4px solid var(--danger); border-radius: 6px;
  padding: .5rem .7rem; font-weight: 700; font-size: .88rem;
}
.privacy-note {
  font-size: .85rem; color: var(--ink-soft); background: var(--paper-2);
  border: 1.5px dashed var(--faint); border-radius: 8px; padding: .6rem .8rem; margin: 1rem 0 0;
}
.auth-notice {
  margin-top: 1rem; text-align: center; color: var(--accent-2); font-weight: 700; font-size: .9rem;
}

/* ---------------- Journal layout ---------------- */
.journal-layout {
  display: grid; grid-template-columns: 290px minmax(0, 1fr);
  gap: 1.8rem; max-width: 1240px; margin: 0 auto; padding: 1.8rem 1.4rem 3rem;
  align-items: start;
}
.entries-panel {
  background: var(--paper); border-radius: 10px; padding: 1rem;
  box-shadow: var(--shadow-soft); position: sticky; top: 76px;
}
.entry-search { margin-top: .7rem; font-size: .95rem; padding: .4rem .6rem; }
.search-empty { font-size: .82rem; padding: .4rem .2rem; }
.entries-list { margin-top: .5rem; display: flex; flex-direction: column; gap: .45rem; max-height: 52vh; overflow-y: auto; padding-right: 2px; }
.entry-item {
  display: flex; align-items: center; gap: .55rem;
  background: var(--paper-2); border-radius: 8px; padding: .5rem .6rem;
  border-left: 4px solid transparent; cursor: pointer;
  transition: transform .15s, border-color .15s, background .15s;
}
.entry-item:hover { transform: translateX(3px); }
.entry-item.active { border-left-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--paper-2)); }
.entry-mood { font-size: 1.1rem; }
.entry-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.entry-text strong { font-family: 'Patrick Hand'; font-weight: 400; font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry-text time { font-family: 'Nunito'; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-soft); }
.entry-del {
  background: none; border: none; color: var(--faint); font-size: 1.15rem;
  cursor: pointer; border-radius: 6px; opacity: 0; transition: opacity .15s, color .15s;
}
.entry-item:hover .entry-del { opacity: 1; }
.entry-del:hover { color: var(--danger); }
.entry-pin {
  background: none; border: none; color: var(--faint); font-size: 1rem;
  cursor: pointer; border-radius: 6px; opacity: 0; transition: opacity .15s, color .15s;
  padding: 0 .1rem; line-height: 1;
}
.entry-item:hover .entry-pin { opacity: 1; }
.entry-pin:hover { color: var(--gold); }
.entry-item.pinned { border-left-color: var(--gold); }
.entry-item.pinned .entry-pin { opacity: 1; color: var(--gold); }
.trash-section { margin-top: .6rem; border-top: 2px dashed var(--faint); padding-top: .45rem; }
.trash-head {
  width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  font-family: 'Nunito'; font-weight: 700; font-size: .76rem; color: var(--ink-soft);
  padding: .15rem .2rem; border-radius: 6px;
}
.trash-head:hover { color: var(--ink); }
.trash-list { display: flex; flex-direction: column; gap: .3rem; padding: .3rem 0 .2rem; }
.trash-row {
  display: flex; align-items: center; gap: .4rem;
  background: var(--paper-2); border-radius: 7px; padding: .35rem .5rem;
}
.trash-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; font-family: 'Patrick Hand'; font-size: .92rem; }
.trash-title time { font-family: 'Nunito'; font-weight: 700; font-size: .64rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .06em; }
.trash-actions { display: flex; gap: .25rem; }
.panel-foot { margin-top: 1rem; padding-top: .8rem; border-top: 2px dashed var(--faint); display: flex; flex-direction: column; gap: .2rem; }

.journal-stats {
  display: flex; justify-content: space-between; gap: .4rem;
  margin-top: 1rem; padding: .7rem .5rem .2rem; border-top: 2px dashed var(--faint);
  text-align: center;
}
.journal-stats div { flex: 1; display: flex; flex-direction: column; }
.journal-stats strong { font-family: 'Caveat'; font-size: 1.6rem; color: var(--accent-dark); }
body.night .journal-stats strong { color: #ef9b7c; }
.journal-stats span { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); }

/* The sheet */
.sheet-wrap { min-width: 0; }
.sheet {
  background: var(--paper);
  background-image: radial-gradient(circle 7px at 20px 46px, var(--bg) 97%, transparent 100%),
                    radial-gradient(circle 7px at 20px calc(100% - 46px), var(--bg) 97%, transparent 100%);
  background-repeat: no-repeat;
  border-radius: 6px; box-shadow: var(--shadow);
  padding: 1.6rem 2.4rem 1.1rem 74px;
  position: relative; transform: rotate(-.3deg);
  animation: pageIn .5s ease both;
}
.sheet::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: 48px;
  width: 2px; background: var(--margin);
}
.sheet-date {
  font-family: 'Nunito'; font-weight: 800; font-size: .78rem; text-transform: uppercase;
  letter-spacing: .14em; color: var(--ink-soft);
}
.daily-line {
  font-family: 'Caveat'; font-size: 1.25rem; color: var(--accent-2);
  margin: .25rem 0 0;
}
.sheet-title {
  font-family: 'Caveat'; font-size: 2.1rem; font-weight: 600;
  background: transparent; border: none; border-radius: 0; padding: .3rem 0 .1rem;
  box-shadow: none; width: 100%;
}
.sheet-title:focus { box-shadow: none; border: none; }
.sheet-title::placeholder { color: var(--faint); }
.mood-row { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem; margin: .2rem 0 .6rem; }
.mood-label { font-family: 'Nunito'; font-weight: 700; font-size: .8rem; color: var(--ink-soft); margin-right: .3rem; }
.mood-btn {
  font-size: 1.3rem; background: transparent; border: 2px solid transparent; border-radius: 999px;
  width: 2.35rem; height: 2.35rem; cursor: pointer; line-height: 1;
  transition: transform .18s, background .18s, border-color .18s;
}
.mood-btn:hover { transform: scale(1.25) rotate(-8deg); }
.mood-btn.selected { background: color-mix(in srgb, var(--gold) 40%, transparent); border-color: var(--gold); transform: scale(1.12); }

.sheet-lines {
  font-family: 'Patrick Hand', cursive; font-size: 1.32rem; line-height: 40px; color: var(--ink);
  background-image: repeating-linear-gradient(to bottom, transparent 0 39px, var(--line) 39px 40px);
  background-attachment: local;
  border: none; border-radius: 0; padding: 0 4px; box-shadow: none;
  min-height: 320px; height: 46vh; resize: vertical; width: 100%;
}
.sheet-lines:focus { box-shadow: none; border: none; }
.sheet-foot {
  display: flex; align-items: center; gap: .8rem; flex-wrap: wrap;
  margin-top: .8rem; padding-top: .8rem; border-top: 2px dashed var(--faint);
}
.word-count { font-family: 'Nunito'; font-weight: 700; font-size: .8rem; color: var(--ink-soft); }
.save-state { font-family: 'Nunito'; font-weight: 700; font-size: .78rem; color: var(--accent-2); flex: 1; }
.sheet-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.privacy-line { text-align: center; color: var(--ink-soft); font-size: .85rem; margin-top: 1.1rem; }

/* Prompt card */
.prompt-card {
  position: fixed; right: 22px; bottom: 22px; z-index: 70;
  width: 300px; background: var(--paper); border-radius: 10px;
  box-shadow: var(--shadow); padding: 1.3rem 1.1rem 1rem;
  animation: slideUp .45s cubic-bezier(.2, 1.4, .4, 1) both;
}
.prompt-card.bounce { animation: slideUp .45s cubic-bezier(.2, 1.4, .4, 1) both; }
.prompt-tape {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%) rotate(3deg);
  width: 84px; height: 24px; background: var(--tape); border-radius: 3px;
}
.prompt-close {
  position: absolute; top: 6px; right: 8px; background: none; border: none;
  font-size: 1.15rem; color: var(--faint); cursor: pointer; line-height: 1;
}
.prompt-close:hover { color: var(--danger); }
.prompt-kicker { font-family: 'Nunito'; font-weight: 800; font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; color: var(--accent); margin: 0 0 .3rem; }
.prompt-question { font-family: 'Caveat'; font-size: 1.55rem; line-height: 1.15; margin: 0 0 .8rem; }
.prompt-actions { display: flex; gap: .5rem; }

/* ---------------- Community wall ---------------- */
.community { max-width: 1200px; margin: 0 auto; padding: 2rem 1.4rem 4rem; }
.community-head h1 { font-size: 3rem; margin: 0; }
.community-head > p { margin: .2rem 0 1.2rem; color: var(--ink-soft); max-width: 72ch; }
.community-controls { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

.feed { columns: 330px; column-gap: 1.4rem; margin-top: 1.6rem; }
.note {
  break-inside: avoid; margin: 0 0 1.4rem;
  background: var(--paper); border-radius: 8px; padding: 1.1rem 1.15rem .9rem;
  box-shadow: var(--shadow-soft); position: relative;
  transition: transform .2s, box-shadow .2s;
}
.note:nth-child(odd) { transform: rotate(-.7deg); }
.note:nth-child(even) { transform: rotate(.6deg); }
.note:hover { transform: rotate(0deg) translateY(-4px); box-shadow: var(--shadow); }
.note::before {
  content: ''; position: absolute; top: -11px; left: 50%; transform: translateX(-50%) rotate(-2deg);
  width: 84px; height: 22px; background: var(--tape); border-radius: 3px;
}
.note-head { display: flex; align-items: center; gap: .55rem; margin-bottom: .3rem; }
.avatar {
  --h: 20; width: 2.3rem; height: 2.3rem; border-radius: 999px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: hsl(var(--h) 55% 62%); color: #fff;
  font-family: 'Caveat'; font-size: 1.3rem; font-weight: 700;
}
.note-by { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.note-by strong { font-size: .9rem; }
.note-by time { font-size: .72rem; color: var(--ink-soft); font-weight: 700; }
.note-mood { margin-left: auto; font-size: 1.5rem; }
.note-title { margin: .2rem 0 .35rem; font-size: 1.7rem; line-height: 1.05; }
.note-body { position: relative; }
.note-content { font-family: 'Patrick Hand'; font-size: 1.12rem; line-height: 1.5; color: var(--ink); overflow-wrap: anywhere; }
.note-content.clamped { max-height: 10.5rem; overflow: hidden; }
.note .link-btn[data-more] { padding: .1rem .3rem; margin-top: .1rem; }
.note-foot { display: flex; gap: .4rem; margin-top: .5rem; padding-top: .5rem; border-top: 1.5px dashed var(--faint); }

.note.sensitive .note-content { filter: blur(7px); user-select: none; }
.note.sensitive .note-body { min-height: 11rem; display: flex; align-items: center; }
.veil {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .45rem;
  background: color-mix(in srgb, var(--paper) 55%, transparent);
  border-radius: 6px; text-align: center; padding: .6rem;
}
.veil-title { font-family: 'Nunito'; font-weight: 800; font-size: .85rem; margin: 0; }
.chip-row { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: center; }
.chip {
  font-family: 'Nunito'; font-weight: 700; font-size: .72rem;
  background: var(--paper-2); border: 1.5px solid var(--faint); border-radius: 999px;
  padding: .18rem .6rem; color: var(--ink-soft);
}

.feed-empty { text-align: center; padding: 4rem 1rem; color: var(--ink-soft); }
.feed-empty-art { font-size: 3.4rem; margin: 0; }

/* ---------------- Admin ---------------- */
.admin { max-width: 1150px; margin: 0 auto; padding: 2rem 1.4rem 4rem; }
.admin-locked { text-align: center; padding: 5rem 1rem; }
.admin-head h1 { font-size: 2.8rem; margin: 0; }
.admin-head p { color: var(--ink-soft); margin: .2rem 0 1rem; }
.admin-section { margin-top: 1.4rem; }

.stat-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem;
}
.stat-card {
  background: var(--paper); border-radius: 10px; box-shadow: var(--shadow-soft);
  padding: 1rem 1.1rem; text-align: center; border-bottom: 4px solid var(--gold);
}
.stat-card.warn { border-bottom-color: var(--accent); }
.stat-card.bad { border-bottom-color: var(--danger); }
.stat-card.good { border-bottom-color: var(--accent-2); }
.stat-card strong { display: block; font-family: 'Caveat'; font-size: 2.4rem; line-height: 1; }
.stat-card span { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-soft); }

.attention-box {
  margin-top: 1.4rem; background: var(--paper); border-radius: 10px;
  box-shadow: var(--shadow-soft); padding: 1.1rem 1.3rem;
}
.attention-box h3 { margin: 0 0 .5rem; font-size: 1.6rem; }

.table-wrap { background: var(--paper); border-radius: 10px; box-shadow: var(--shadow-soft); padding: .4rem .9rem; overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.admin-table th {
  font-family: 'Nunito'; font-size: .72rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .1em; color: var(--ink-soft); text-align: left;
  padding: .7rem .5rem; border-bottom: 2px solid var(--faint);
}
.admin-table td { padding: .65rem .5rem; border-bottom: 1.5px dashed var(--faint); vertical-align: top; }
.admin-table tr:last-child td { border-bottom: none; }
.cell-user { display: flex; align-items: center; gap: .5rem; font-family: 'Patrick Hand'; font-size: 1.05rem; }
.cell-snippet { max-width: 340px; }
.cell-snippet strong { font-family: 'Caveat'; font-size: 1.25rem; display: block; }
.cell-snippet p { margin: .1rem 0 0; color: var(--ink-soft); font-size: .85rem; }
.row-actions { display: flex; gap: .3rem; flex-wrap: wrap; }

.pill {
  font-family: 'Nunito'; font-weight: 800; font-size: .72rem; text-transform: uppercase;
  letter-spacing: .06em; border-radius: 999px; padding: .2rem .65rem; white-space: nowrap;
}
.pill.active { background: color-mix(in srgb, var(--accent-2) 18%, transparent); color: var(--accent-2); }
.pill.suspended { background: color-mix(in srgb, var(--gold) 25%, transparent); color: #a97b13; }
.pill.banned { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.posts-filter { margin-bottom: .8rem; color: var(--ink-soft); }

/* ---------------- Modals, crisis box, toasts ---------------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(30, 25, 18, .55); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 1.2rem;
}
.modal {
  background: var(--paper); border-radius: 12px; box-shadow: var(--shadow);
  max-width: 540px; width: 100%; padding: 1.6rem 1.7rem; position: relative;
  max-height: 88vh; overflow-y: auto;
}
.modal::before {
  content: ''; position: absolute; top: -12px; left: 40px; transform: rotate(-3deg);
  width: 84px; height: 24px; background: var(--tape); border-radius: 3px;
}
.modal-title { margin: 0 0 .5rem; font-size: 2rem; line-height: 1; }
.modal-message { margin: .3rem 0; line-height: 1.55; }
.modal-actions { display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; margin-top: 1.2rem; }

.crisis-box {
  background: color-mix(in srgb, var(--danger) 9%, var(--paper));
  border-left: 5px solid var(--danger); border-radius: 8px;
  padding: .8rem 1rem; margin: .9rem 0;
}
.crisis-box p { margin: 0 0 .4rem; font-weight: 700; }
.crisis-box ul { margin: 0; padding-left: 1.1rem; line-height: 1.9; }

#toast-root { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; gap: .5rem; align-items: center; }
.toast {
  background: var(--ink); color: var(--paper);
  font-family: 'Nunito'; font-weight: 700; font-size: .92rem;
  border-radius: 999px; padding: .6rem 1.3rem; box-shadow: var(--shadow);
  animation: toastIn .3s ease both; max-width: 90vw;
}
.toast.error { background: var(--danger); color: #fff; }
.toast.out { opacity: 0; transition: opacity .4s; }

/* ---------------- Animations ---------------- */
.fade-up { animation: fadeUp .7s ease both; }
.features .feature-card:nth-child(1) { animation-delay: .05s; }
.features .feature-card:nth-child(2) { animation-delay: .13s; }
.features .feature-card:nth-child(3) { animation-delay: .21s; }
.features .feature-card:nth-child(4) { animation-delay: .29s; }
.pop { animation: popIn .35s cubic-bezier(.2, 1.4, .4, 1) both; }
.shake { animation: shake .45s ease both; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes popIn { from { opacity: 0; transform: scale(.9) translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pageIn { from { opacity: 0; transform: translateY(20px) rotate(.8deg); } to { opacity: 1; transform: rotate(-.3deg); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(30px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); }
  50% { transform: translateY(-11px) rotate(var(--r, 0deg)); }
}
@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

/* ---------------- Care tools & gentle touches ---------------- */
.daily-why { display: block; font-family: 'Nunito'; font-size: .72rem; font-weight: 700; color: var(--ink-soft); margin-top: .1rem; }
.prompt-why { font-family: 'Nunito'; font-size: .78rem; font-weight: 700; color: var(--ink-soft); margin: 0 0 .8rem; }
.permission-line { display: block; font-family: 'Caveat'; font-size: 1.15rem; color: var(--accent-2); margin-top: .15rem; }

.breathe-stage { display: flex; flex-direction: column; align-items: center; gap: 1.1rem; padding: 1rem 0 .4rem; }
.breathe-circle {
  width: 84px; height: 84px; border-radius: 999px;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--accent-2) 55%, white), var(--accent-2));
  box-shadow: 0 0 0 14px color-mix(in srgb, var(--accent-2) 14%, transparent);
  transform: scale(.72);
  transition: transform 4s cubic-bezier(.45, 0, .55, 1);
}
.breathe-circle.in { transform: scale(1.28); transition-duration: 4s; }
.breathe-circle.hold { transform: scale(1.28); transition-duration: 4s; }
.breathe-circle.out { transform: scale(.72); transition-duration: 6s; }
.breathe-text { font-family: 'Caveat'; font-size: 1.5rem; color: var(--ink-soft); margin: 0; }

.ground-list { line-height: 2; padding-left: 1.1rem; margin: .6rem 0 0; }
.ground-list strong { font-family: 'Caveat'; font-size: 1.5rem; color: var(--accent-2); margin-right: .2rem; }

/* ---------------- Responsive ---------------- */
@media (max-width: 960px) {
  .journal-layout { grid-template-columns: 1fr; }
  .entries-panel { position: static; }
  .entries-list { max-height: 220px; }
  .hero { gap: 1.5rem; }
  .sticky-notes { display: none; }
}
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; padding: .6rem .9rem; }
  .topnav { order: 3; width: 100%; justify-content: center; margin: .3rem 0 0; }
  .sheet { padding: 1.3rem 1.2rem 1rem 58px; }
  .sheet::before { left: 38px; }
  .community-head h1 { font-size: 2.3rem; }
}

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

/* ============================================================
   Care tools & therapy toolkit
   ============================================================ */

/* tags under the mood row */
.tags-row { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem; margin: -.2rem 0 .6rem; }
.tag-chip {
  font-family: 'Nunito'; font-weight: 700; font-size: .74rem;
  background: color-mix(in srgb, var(--accent-2) 14%, transparent);
  border: 1.5px solid color-mix(in srgb, var(--accent-2) 45%, transparent);
  color: var(--accent-2); border-radius: 999px; padding: .14rem .3rem .14rem .6rem;
  display: inline-flex; align-items: center; gap: .15rem;
}
.tag-x {
  background: none; border: none; color: inherit; cursor: pointer;
  font-size: .85rem; line-height: 1; padding: 0 .2rem; border-radius: 999px;
}
.tag-x:hover { color: var(--danger); }
.tag-add {
  font-family: 'Nunito'; font-weight: 700; font-size: .74rem; color: var(--ink-soft);
  background: none; border: 1.5px dashed var(--faint); border-radius: 999px;
  padding: .14rem .6rem; cursor: pointer; transition: color .15s, border-color .15s;
}
.tag-add:hover { color: var(--accent); border-color: var(--accent); }

/* care menu */
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin-top: .8rem; }
.tool-card {
  display: flex; flex-direction: column; align-items: flex-start; text-align: left;
  font-family: 'Nunito'; background: var(--paper-2); border: 2px solid var(--faint);
  border-radius: 10px; padding: .7rem .8rem; cursor: pointer; gap: .1rem;
  transition: transform .16s, border-color .16s, box-shadow .16s;
}
.tool-card:hover { transform: translateY(-3px) rotate(-.4deg); border-color: var(--accent); box-shadow: var(--shadow-soft); }
.tool-icon { font-size: 1.4rem; }
.tool-name { font-weight: 800; font-size: .92rem; }
.tool-desc { font-size: .78rem; color: var(--ink); line-height: 1.35; }
.tool-why { font-size: .68rem; color: var(--ink-soft); font-weight: 700; margin-top: .15rem; }

/* 1–10 scale */
.scale-row { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .4rem 0 .8rem; }
.scale-face { display: flex; align-items: baseline; gap: .6rem; }
.scale-num { font-family: 'Caveat'; font-size: 3.2rem; font-weight: 700; color: var(--accent-dark); line-height: 1; }
body.night .scale-num { color: #ef9b7c; }
.scale-emoji { font-size: 1.7rem; }
.scale-slider {
  width: 100%; max-width: 340px; accent-color: var(--accent); cursor: pointer;
  background: transparent; border: none; box-shadow: none; padding: .2rem; height: 1.6rem;
}
.scale-hint { font-family: 'Nunito'; font-weight: 700; font-size: .78rem; color: var(--ink-soft); }

/* wizard bits */
.wiz-dots { display: flex; gap: .3rem; justify-content: center; margin: -.2rem 0 .7rem; }
.wiz-dot { width: .55rem; height: .55rem; border-radius: 999px; background: var(--faint); transition: background .2s, transform .2s; }
.wiz-dot.on { background: var(--accent); transform: scale(1.25); }
.wiz-dot.done { background: var(--accent-2); }
.ask-text { margin: .5rem 0 .2rem; }
.tiny-note { font-size: .8rem; }
.emotion-row { display: flex; flex-wrap: wrap; gap: .3rem; margin: .5rem 0 .3rem; }
.pick-grid { display: flex; flex-wrap: wrap; gap: .35rem; margin: .6rem 0 .2rem; }
.pick-chip {
  font-family: 'Nunito'; font-weight: 700; font-size: .84rem; color: var(--ink);
  background: var(--paper-2); border: 2px solid var(--faint); border-radius: 999px;
  padding: .35rem .8rem; cursor: pointer; transition: transform .15s, border-color .15s, background .15s;
}
.pick-chip:hover { transform: translateY(-2px); border-color: var(--accent); }
.pick-chip.selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }

/* distortion grid */
.distort-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; margin: .6rem 0 .2rem; }
.distort {
  display: flex; flex-direction: column; align-items: flex-start; text-align: left;
  font-family: 'Nunito'; background: var(--paper-2); border: 2px solid var(--faint);
  border-radius: 10px; padding: .5rem .6rem; cursor: pointer; gap: .05rem;
  transition: border-color .15s, background .15s, transform .15s;
}
.distort:hover { transform: translateY(-2px); }
.distort.selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.distort-icon { font-size: 1.1rem; }
.distort strong { font-size: .8rem; }
.distort-why { font-size: .7rem; color: var(--ink-soft); line-height: 1.25; }

/* expressive writing session */
.expressive-bar { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; margin: .4rem 0 .6rem; }
.timer-face {
  font-family: 'Caveat'; font-weight: 700; font-size: 2.3rem; line-height: 1;
  color: var(--accent-dark); min-width: 5.2ch; text-align: center;
  background: var(--paper-2); border: 2px dashed var(--faint); border-radius: 10px; padding: .15rem .5rem;
}
body.night .timer-face { color: #ef9b7c; }
.timer-face.ending { color: var(--danger); border-color: var(--danger); }
.timer-face.done { color: var(--accent-2); border-color: var(--accent-2); }
.no-edit-toggle {
  font-family: 'Nunito'; font-weight: 700; font-size: .8rem; color: var(--ink-soft);
  display: inline-flex; align-items: center; gap: .35rem; cursor: pointer;
}
.no-edit-toggle input { width: auto; accent-color: var(--accent); }
.ex-text {
  font-family: 'Patrick Hand', cursive; font-size: 1.22rem; line-height: 1.6;
  min-height: 260px; height: 38vh; resize: vertical; width: 100%;
}
.ex-nudge { font-family: 'Caveat'; font-size: 1.2rem; color: var(--accent-2); min-height: 1.6em; margin: .4rem 0 0; }
.wiggle { animation: shake .45s ease both; }

/* defusion preview */
.defuse-preview {
  background: var(--paper-2); border-left: 4px solid var(--accent-2); border-radius: 8px;
  padding: .6rem .9rem; margin: .6rem 0 .2rem;
}
.defuse-preview p { margin: .25rem 0; font-family: 'Patrick Hand'; font-size: 1.08rem; }

/* ============================================================
   Admin desk additions
   ============================================================ */
.table-toolbar { display: flex; gap: .6rem; align-items: center; margin-bottom: .7rem; }
.table-search { max-width: 340px; }
.announce-row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-top: .5rem; }
.announce-row input { flex: 1 1 260px; }
.temp-password {
  font-family: 'Nunito'; font-weight: 800; font-size: 1.3rem; letter-spacing: .04em;
  background: var(--paper-2); border: 2px dashed var(--accent); border-radius: 10px;
  padding: .6rem .9rem; text-align: center; user-select: all; margin: .6rem 0;
}

/* site-wide announcement banner */
.announce-bar {
  display: flex; align-items: center; justify-content: center; gap: .7rem;
  background: color-mix(in srgb, var(--gold) 26%, var(--paper));
  border-bottom: 2px solid var(--gold);
  padding: .45rem 1.2rem; z-index: 60; position: relative;
}
body.night .announce-bar { background: color-mix(in srgb, var(--gold) 14%, var(--paper-2)); }
.announce-text { font-weight: 700; font-size: .92rem; }
.announce-close {
  background: none; border: none; font-size: 1.1rem; color: var(--ink-soft);
  cursor: pointer; line-height: 1; padding: .1rem .3rem; border-radius: 6px;
}
.announce-close:hover { color: var(--danger); }

@media (max-width: 640px) {
  .tool-grid { grid-template-columns: 1fr; }
  .distort-grid { grid-template-columns: 1fr; }
  .table-search { max-width: none; }
  .table-toolbar { flex-wrap: wrap; }
}

/* ============================================================
   Insights page
   ============================================================ */
.insights { max-width: 1100px; margin: 0 auto; padding: 1.8rem 1.4rem 4rem; }
.insights-head h1 { font-size: 2.9rem; margin: 0; }
.insights-head > p { margin: .2rem 0 1rem; }
.year-picker-row { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; flex-wrap: wrap; }
.paper-card {
  background: var(--paper); border-radius: 10px; box-shadow: var(--shadow-soft);
  padding: 1.1rem 1.3rem; margin-bottom: 1.2rem; transform: rotate(-.15deg);
}
.paper-card h3 { margin: 0 0 .2rem; font-size: 1.7rem; }
.small-note { font-size: .82rem; margin: 0 0 .8rem; }

/* heatmap */
.heat-months { position: relative; height: 1.1rem; margin-left: 2px; font-family: 'Nunito'; font-weight: 700; font-size: .68rem; color: var(--ink-soft); }
.heat-month { position: absolute; top: 0; }
.heat-wrap { overflow-x: auto; padding-bottom: .3rem; }
.heat-grid {
  display: grid; grid-template-rows: repeat(7, 15px); grid-auto-flow: column;
  grid-auto-columns: 15px; gap: 3px;
}
.heat-cell {
  width: 15px; height: 15px; border-radius: 3.5px; border: none; padding: 0;
  background: color-mix(in srgb, var(--ink) 6%, transparent); cursor: default;
  transition: transform .12s;
}
.heat-cell.pad { background: transparent; }
.heat-cell.future { opacity: .35; }
.heat-cell.l0 { background: color-mix(in srgb, var(--accent-2) 10%, transparent); }
.heat-cell.l1 { background: color-mix(in srgb, var(--accent-2) 30%, transparent); }
.heat-cell.l2 { background: color-mix(in srgb, var(--accent-2) 52%, transparent); }
.heat-cell.l3 { background: color-mix(in srgb, var(--accent-2) 74%, transparent); }
.heat-cell.l4 { background: var(--accent-2); }
button.heat-cell:not(.pad):not(.future) { cursor: pointer; }
button.heat-cell:not(.pad):not(.future):hover { transform: scale(1.35); outline: 2px solid var(--accent); }
.heat-legend { display: flex; align-items: center; gap: .3rem; margin-top: .6rem; font-size: .72rem; }
.heat-legend .heat-cell { display: inline-block; }

/* mood chart */
.mood-svg { width: 100%; height: auto; background: var(--paper-2); border-radius: 10px; }
.mood-axis { stroke: var(--faint); stroke-width: 1.5; stroke-dasharray: 4 5; }
.mood-dot.v0 { fill: #d16a5a; } .mood-dot.v1 { fill: #c9873f; }
.mood-dot.v2 { fill: #c9b458; } .mood-dot.v3 { fill: var(--accent-2); }
.mood-dot:hover { r: 6; }
.mood-tick { font-family: 'Nunito'; font-weight: 700; font-size: 12px; fill: var(--ink-soft); }

/* people */
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; margin-top: 1rem; }
.person-card {
  background: var(--paper); border-radius: 10px; box-shadow: var(--shadow-soft);
  padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .25rem;
  border-top: 5px solid var(--gold); transition: transform .18s;
}
.person-card:hover { transform: translateY(-4px) rotate(-.4deg); }
.person-card:nth-child(2n) { border-top-color: var(--accent-2); }
.person-card:nth-child(3n) { border-top-color: var(--accent); }
.person-emoji { font-size: 1.6rem; }
.person-card strong { font-family: 'Caveat'; font-size: 1.55rem; line-height: 1; }
.person-moods { font-size: 1.1rem; letter-spacing: .2em; }
.delta { font-size: .82rem; color: var(--ink-soft); font-weight: 700; }
.delta.warm { color: var(--accent-2); }
.delta.cool { color: #b48a3c; }

/* timeline */
.timeline { display: flex; flex-direction: column; gap: 1.2rem; }
.tl-month { display: flex; align-items: baseline; gap: .8rem; border-bottom: 2px dashed var(--faint); padding-bottom: .3rem; }
.tl-month h3 { margin: 0; font-size: 1.9rem; }
.tl-item {
  display: flex; gap: .7rem; align-items: flex-start; text-align: left; width: 100%;
  background: var(--paper); border: none; border-radius: 10px; box-shadow: var(--shadow-soft);
  padding: .7rem .9rem; cursor: pointer; font-family: 'Nunito'; color: var(--ink);
  transition: transform .15s, box-shadow .15s;
}
.tl-item:hover { transform: translateX(4px); box-shadow: var(--shadow); }
.tl-mood { font-size: 1.4rem; }
.tl-main { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.tl-main strong { font-family: 'Patrick Hand'; font-weight: 400; font-size: 1.1rem; }
.tl-chips { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .2rem; }

/* wrapped */
.wrap-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.wrap-card {
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 14%, var(--paper)), var(--paper));
  border-radius: 14px; box-shadow: var(--shadow-soft); padding: 1.4rem 1.3rem;
  display: flex; flex-direction: column; gap: .3rem; transform: rotate(-.5deg);
  transition: transform .2s;
}
.wrap-card:nth-child(2n) { transform: rotate(.5deg); background: linear-gradient(160deg, color-mix(in srgb, var(--accent-2) 14%, var(--paper)), var(--paper)); }
.wrap-card:nth-child(3n) { background: linear-gradient(160deg, color-mix(in srgb, var(--gold) 20%, var(--paper)), var(--paper)); }
.wrap-card:hover { transform: translateY(-5px) scale(1.02); }
.wrap-card.big { grid-column: span 2; background: linear-gradient(160deg, var(--accent), var(--accent-dark)); color: #fff; }
.wrap-card.big .wrap-label, .wrap-card.big .wrap-sub { color: rgba(255,255,255,.92); }
.wrap-num { font-family: 'Caveat'; font-size: 3rem; line-height: 1; color: var(--accent-dark); }
body.night .wrap-num { color: #ef9b7c; }
.wrap-card.big .wrap-num { color: #fff; }
.wrap-label { font-weight: 800; font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-soft); }
.wrap-sub { font-size: .95rem; }
.wrap-card.wide { grid-column: span 2; }
.wrap-words { font-family: 'Patrick Hand'; font-size: 1.15rem; line-height: 1.7; }

@media (max-width: 700px) {
  .wrap-card.big, .wrap-card.wide { grid-column: span 1; }
}

/* @mention suggestions */
.mention-box {
  position: fixed; left: 22px; bottom: 22px; z-index: 70;
  width: 210px; background: var(--paper); border-radius: 10px;
  box-shadow: var(--shadow); padding: .7rem .7rem .55rem;
  animation: slideUp .3s cubic-bezier(.2, 1.4, .4, 1) both;
}
.mention-hint { font-family: 'Nunito'; font-weight: 800; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-soft); margin: 0 0 .4rem; }
.mention-item {
  display: block; width: 100%; text-align: left; font-family: 'Patrick Hand'; font-size: 1.05rem;
  background: none; border: none; color: var(--ink); padding: .3rem .4rem;
  border-radius: 7px; cursor: pointer;
}
.mention-item:hover { background: color-mix(in srgb, var(--accent-2) 14%, transparent); color: var(--accent-2); }

/* ============================================================
   Kindness Wall
   ============================================================ */
.wall { max-width: 1200px; margin: 0 auto; padding: 2rem 1.4rem 4rem; }
.wall-head h1 { font-size: 3rem; margin: 0; }
.wall-head > p { margin: .2rem 0 1.2rem; color: var(--ink-soft); max-width: 70ch; }
.compose-note {
  background: var(--paper); border-radius: 10px; box-shadow: var(--shadow);
  padding: 1rem 1.1rem .8rem; transform: rotate(-.3deg); position: relative; margin-bottom: 1.6rem;
}
.compose-note::before {
  content: ''; position: absolute; top: -12px; left: 50%; transform: translateX(-50%) rotate(2deg);
  width: 90px; height: 24px; background: var(--tape); border-radius: 3px;
}
.compose-foot { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-top: .5rem; flex-wrap: wrap; }
.kind-hint {
  margin: .5rem 0 0; font-weight: 700; font-size: .88rem; color: #a97b13;
  background: color-mix(in srgb, var(--gold) 22%, transparent);
  border-left: 4px solid var(--gold); border-radius: 6px; padding: .5rem .7rem;
}
.notes-feed { columns: 300px; column-gap: 1.2rem; }
.kind-note {
  break-inside: avoid; margin: 0 0 1.2rem; padding: 1.1rem 1rem .8rem;
  border-radius: 4px; box-shadow: 0 8px 18px rgba(59, 50, 39, .16);
  background: hsl(var(--h) 75% 88%); color: hsl(var(--h) 45% 25%);
  transform: rotate(-.8deg); transition: transform .2s, box-shadow .2s;
}
.kind-note:nth-child(2n) { transform: rotate(.7deg); }
.kind-note:nth-child(3n) { transform: rotate(-.4deg); }
.kind-note:hover { transform: rotate(0) translateY(-4px); box-shadow: 0 12px 26px rgba(59, 50, 39, .22); }
body.night .kind-note { background: hsl(var(--h) 30% 22%); color: hsl(var(--h) 45% 85%); }
.kind-text { font-family: 'Caveat'; font-size: 1.45rem; line-height: 1.25; margin: 0; overflow-wrap: anywhere; }
.kind-foot { display: flex; align-items: center; gap: .45rem; margin-top: .7rem; padding-top: .5rem; border-top: 1.5px dashed hsl(var(--h) 40% 60% / .5); }
.kind-by { font-size: .74rem; font-weight: 700; flex: 1; min-width: 0; }
.kind-del {
  background: none; border: none; cursor: pointer; font-size: .95rem;
  opacity: 0; transition: opacity .15s; border-radius: 6px; padding: .1rem .3rem;
}
.kind-note:hover .kind-del { opacity: .75; }
.kind-del:hover { opacity: 1 !important; transform: scale(1.15); }
.wall-foot { text-align: center; margin-top: 2rem; }

/* ============================================================
   Media on the page
   ============================================================ */
.media-strip { display: flex; flex-wrap: wrap; gap: .5rem; margin: .4rem 0 0; }
.media-strip:empty { display: none; }
.media-cell {
  position: relative; width: 108px; background: var(--paper-2);
  border: 1.5px solid var(--faint); border-radius: 8px; padding: .3rem;
  display: flex; flex-direction: column; gap: .2rem; align-items: center;
}
.media-holder {
  width: 100px; height: 70px; border-radius: 6px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--ink) 6%, transparent); font-size: 1.5rem;
}
.media-holder.image { padding: 0; }
.media-holder img.media-thumb { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; display: block; }
.media-holder audio { width: 100px; height: 34px; }
.media-holder video { width: 100px; height: 70px; object-fit: cover; }
.media-name {
  font-family: 'Nunito'; font-weight: 700; font-size: .62rem; color: var(--ink-soft);
  max-width: 100px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.media-x {
  position: absolute; top: -7px; right: -7px; width: 1.25rem; height: 1.25rem;
  border-radius: 999px; border: 1.5px solid var(--faint); background: var(--paper);
  color: var(--ink-soft); font-size: .8rem; line-height: 1; cursor: pointer; padding: 0;
}
.media-x:hover { color: var(--danger); border-color: var(--danger); }
.lightbox-img { max-width: 100%; max-height: 70vh; border-radius: 8px; display: block; margin: .4rem auto 0; }

/* recording / dictating pulse */
.btn.recording {
  background: color-mix(in srgb, var(--danger) 85%, white);
  border-color: var(--danger); color: #fff;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(192, 57, 43, .45); }
  50% { box-shadow: 0 0 0 7px rgba(192, 57, 43, 0); }
}

/* sketch pad */
.sketch-bar { display: flex; align-items: center; gap: .8rem; margin-bottom: .5rem; flex-wrap: wrap; }
.sketch-bar label { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; font-weight: 700; }
.sketch-canvas {
  width: 100%; height: auto; touch-action: none; border: 2px solid var(--faint);
  border-radius: 10px; background: #fffdf4; cursor: crosshair;
}

/* drop files onto the page */
.sheet.drop-hint { outline: 3px dashed var(--accent); outline-offset: 6px; }
.sheet.drop-hint::after {
  content: 'Drop your photos, audio or video right here \ud83d\udcbe';
  position: absolute; inset: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Caveat'; font-size: 2rem; color: var(--accent);
  background: color-mix(in srgb, var(--paper) 75%, transparent);
  border-radius: 6px; pointer-events: none;
}

/* ============================================================
   Palette, lock screen, quick capture
   ============================================================ */
.palette-pop {
  position: fixed; top: 58px; right: 14px; z-index: 110;
  background: var(--paper); border-radius: 10px; box-shadow: var(--shadow);
  padding: .7rem .6rem; width: 200px; display: flex; flex-direction: column; gap: .15rem;
}
.palette-title {
  font-family: 'Nunito'; font-weight: 800; font-size: .68rem; text-transform: uppercase;
  letter-spacing: .12em; color: var(--ink-soft); margin: .3rem .3rem .2rem;
}
.palette-item {
  text-align: left; font-family: 'Nunito'; font-weight: 700; font-size: .88rem;
  background: none; border: none; color: var(--ink); padding: .38rem .5rem;
  border-radius: 8px; cursor: pointer;
}
.palette-item:hover { background: var(--paper-2); }
.palette-item.on { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent-dark); }

.lock-screen {
  position: fixed; inset: 0; z-index: 300;
  background:
    radial-gradient(900px 400px at 85% -10%, rgba(233, 185, 73, .12), transparent 60%),
    linear-gradient(160deg, var(--bg), var(--bg-2));
  display: flex; align-items: center; justify-content: center; padding: 1.2rem;
}
.lock-card {
  background: var(--paper); border-radius: 12px; box-shadow: var(--shadow);
  padding: 1.8rem 1.9rem; max-width: 340px; width: 100%; text-align: center;
}
.lock-icon { font-size: 2.4rem; margin: 0 0 .3rem; }
.lock-card h3 { font-size: 1.9rem; margin: 0 0 .3rem; }
.lock-card .muted { margin: 0 0 .9rem; }
.lock-pin { text-align: center; letter-spacing: .3em; font-size: 1.3rem; margin-bottom: .6rem; }
.lock-label { display: block; text-align: left; font-family: 'Nunito'; font-weight: 700; font-size: .82rem; color: var(--ink-soft); margin: .8rem 0 .3rem; }

.capture-clip {
  display: inline-block; font-family: 'Nunito'; font-weight: 800; font-size: .95rem;
  background: var(--gold); color: #5a4a1f; border-radius: 10px;
  padding: .7rem 1.1rem; cursor: grab; box-shadow: 2px 3px 0 rgba(59, 50, 39, .28);
  text-decoration: none; transform: rotate(-1.5deg);
}
.capture-clip:active { cursor: grabbing; }
.capture-preview { text-align: left; background: var(--paper-2); border-radius: 8px; padding: .7rem .9rem; margin: .6rem 0; }
.capture-preview strong { font-family: 'Patrick Hand'; font-weight: 400; font-size: 1.1rem; }
.capture-preview p { margin: .2rem 0 0; font-size: .85rem; }
