/* ==========================================================================
   Family Ideas edition: its worlds and its features' styles.
   Loaded after core's sheet (core/style.css). Zero external requests,
   strict CSP (style-src 'self').
   ========================================================================== */

/* ============ Worlds: tokens, palettes, atmospheres and header art ============ */

:root[data-mode="light"] { --shelf: #DFD7CA; }
:root[data-mode="dark"]  { --shelf: #2D2A24; }
:root[data-world="dinosaurs"] { --radius: 20px; --radius-sm: 14px; }
:root[data-world="ocean"]     { --radius: 22px; --radius-sm: 15px; }
:root[data-world="robots"]    { --radius: 8px;  --radius-sm: 6px;  --num-font: var(--font-mono); }
:root[data-world="space"][data-mode="light"] {
  --bg: #F5F7FA; --surface: #FFFFFF; --surface-2: #ECEFF5; --border: #DFE4EE; --border-strong: #C2CCE0;
  --track: #E5EAF4; --text: #161925; --text-2: #2D344A; --muted: #647087;
  --accent: #3B5BDB; --link: #2F4BC2; --button: #3B5BDB; --button-text: #FFFFFF;
  --soft: #EDF2FF; --soft-text: #2A43AD; --shelf: #D8DFEC;
}
:root[data-world="space"][data-mode="dark"] {
  --bg: #0F1117; --surface: #171A23; --surface-2: #202431; --border: #2A3042; --border-strong: #3E4761;
  --track: #23293A; --text: #F1F4FA; --text-2: #D4DCF0; --muted: #93A0B8;
  --accent: #748FFC; --link: #99AFFF; --button: #748FFC; --button-text: #10152B;
  --soft: #1D2440; --soft-text: #DBE4FF; --shelf: #252B3B;
}
:root[data-world="dinosaurs"][data-mode="light"] {
  --bg: #F5F7F4; --surface: #FFFFFF; --surface-2: #ECF0EA; --border: #DDE4DA; --border-strong: #BFCCB9;
  --track: #E4ECE1; --text: #171E15; --text-2: #2D392A; --muted: #606D5E;
  --accent: #2E7D32; --link: #236527; --button: #2E7D32; --button-text: #FFFFFF;
  --soft: #E9F4EA; --soft-text: #1E5821; --shelf: #D6DFD1;
}
:root[data-world="dinosaurs"][data-mode="dark"] {
  --bg: #101410; --surface: #171D17; --surface-2: #202820; --border: #2A352A; --border-strong: #405040;
  --track: #222C22; --text: #EFF4EE; --text-2: #D2E0D0; --muted: #94A693;
  --accent: #7BC96F; --link: #99DC8F; --button: #7BC96F; --button-text: #112110;
  --soft: #1B2D1C; --soft-text: #D7F5D2; --shelf: #253025;
}
:root[data-world="robots"][data-mode="light"] {
  --bg: #F4F7F8; --surface: #FFFFFF; --surface-2: #EAF0F2; --border: #DAE5E8; --border-strong: #B8CBD1;
  --track: #E2ECEF; --text: #121E22; --text-2: #253940; --muted: #5D7076;
  --accent: #0C8599; --link: #096C7D; --button: #0C8599; --button-text: #FFFFFF;
  --soft: #E3F7FA; --soft-text: #085E6D; --shelf: #D2DFE3;
}
:root[data-world="robots"][data-mode="dark"] {
  --bg: #0F1316; --surface: #161C20; --surface-2: #1F272D; --border: #28343C; --border-strong: #3E4F5B;
  --track: #1D272E; --text: #EFF6F8; --text-2: #CEE0E6; --muted: #91AAB3;
  --accent: #4DD0E1; --link: #80E2EE; --button: #4DD0E1; --button-text: #0A2024;
  --soft: #162E34; --soft-text: #CCF7FC; --shelf: #232F36;
}
:root[data-world="ocean"][data-mode="light"] {
  --bg: #F2F8FA; --surface: #FFFFFF; --surface-2: #E5F2F6; --border: #D1E6EE; --border-strong: #ADCEDB;
  --track: #DDF0F5; --text: #0F222D; --text-2: #244050; --muted: #547282;
  --accent: #0E7490; --link: #0B5E75; --button: #0E7490; --button-text: #FFFFFF;
  --soft: #E0F4F9; --soft-text: #0A5166; --shelf: #C9E1EA;
}
:root[data-world="ocean"][data-mode="dark"] {
  --bg: #0C151B; --surface: #132029; --surface-2: #1A2B36; --border: #253D4C; --border-strong: #395B70;
  --track: #182A36; --text: #EAF6FA; --text-2: #C7E2ED; --muted: #8DB0C2;
  --accent: #38BDF8; --link: #7DD3FC; --button: #38BDF8; --button-text: #08202E;
  --soft: #132E40; --soft-text: #C7ECFE; --shelf: #1F3542;
}
:root[data-world="forest"][data-mode="light"] {
  --bg: #F6F5F0; --surface: #FDFDFB; --surface-2: #ECECE2; --border: #DDDCD0; --border-strong: #C2C0B0;
  --track: #E7E6DB; --text: #1D231B; --text-2: #343D31; --muted: #636B5E;
  --accent: #3F6A4A; --link: #2E5237; --button: #3F6A4A; --button-text: #FFFFFF;
  --soft: #E6EFE7; --soft-text: #284730; --shelf: #D3D1C2;
}
:root[data-world="forest"][data-mode="dark"] {
  --bg: #111512; --surface: #181E1A; --surface-2: #212923; --border: #2D3830; --border-strong: #445448;
  --track: #1E2720; --text: #F0F3EE; --text-2: #D4DDD2; --muted: #99A69A;
  --accent: #E0A44B; --link: #EDC076; --button: #E0A44B; --button-text: #241907;
  --soft: #2D2518; --soft-text: #F8DFB4; --shelf: #273029;
}
:root[data-world="cosy"] .stage {
  background-image: radial-gradient(rgba(130, 100, 75, 0.05) 1px, transparent 0);
  background-size: 18px 18px;
}
:root[data-world="space"] .stage {
  background-image: linear-gradient(180deg, rgba(59, 91, 219, 0.045) 0%, rgba(59, 91, 219, 0.018) 55%, rgba(59, 91, 219, 0.03) 100%);
}
:root[data-world="dinosaurs"] .stage {
  background-image:
    radial-gradient(ellipse at 0% 100%, rgba(46, 125, 50, 0.055) 0%, transparent 55%),
    radial-gradient(ellipse at 100% 0%, rgba(46, 125, 50, 0.045) 0%, transparent 50%);
}
:root[data-world="robots"] .stage {
  background-image:
    linear-gradient(rgba(12, 133, 153, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(12, 133, 153, 0.05) 1px, transparent 1px);
  background-size: 24px 24px;
}
:root[data-world="ocean"] .stage {
  background-image: linear-gradient(180deg, rgba(14, 116, 144, 0.05) 0%, rgba(14, 116, 144, 0.01) 55%, rgba(14, 116, 144, 0.06) 100%);
}
:root[data-world="forest"] .stage {
  background-image:
    radial-gradient(circle at 25% 30%, rgba(217, 155, 42, 0.08) 1.5px, transparent 2.5px),
    radial-gradient(circle at 80% 60%, rgba(74, 124, 89, 0.07) 1.5px, transparent 2.5px);
  background-size: 120px 120px;
}
.world-backdrop-svg { width: 100%; height: 100%; display: block; }
.world-scene { width: 132px; height: 50px; flex: 0 0 auto; color: var(--accent); opacity: 0.9; }
:root[data-world="robots"] .step-toggle .box { border-radius: 3px; }

/* ============ Screen time ============ */

.screen-time-pill { width: 100%; justify-content: center; }

/* ============ Voice input ============ */

.mic-wrap { display: inline-flex; align-self: flex-start; }
.mic[data-state="listening"] {
  background: var(--danger-soft); border-color: var(--danger); color: var(--danger);
  animation: mic-pulse 1.4s ease-in-out infinite;
}
.mic[data-state="working"] { cursor: progress; }

/* ============ Videos ============ */

.step-badge {
  margin-left: auto; display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.18rem 0.55rem; border-radius: 999px;
  background: var(--surface-2); color: var(--link); font-size: 0.74rem; font-weight: 600;
}
.video-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.85rem; }
.player, .thumb-button {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm); overflow: hidden; border: 0; padding: 0;
  background: var(--track); cursor: pointer;
}
.thumb-button img, .player iframe { width: 100%; height: 100%; object-fit: cover; border: 0; display: block; }
.thumb-still { cursor: default; margin-bottom: 0.4rem; }
/* The hidden player that checks a newly added video plays here (parents only). */
.yt-check { position: fixed; left: -10000px; top: 0; width: 320px; height: 180px; border: 0; opacity: 0; pointer-events: none; }
.play-dot {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--button); color: var(--button-text);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}
.fullscreen-btn {
  position: absolute; right: 10px; bottom: 10px; width: 42px; height: 42px;
  border-radius: 10px; border: 0; background: rgba(15, 12, 20, 0.82); color: #FFFFFF;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.manage-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.7rem; }
.manage-item { display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem; padding: 0.85rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.manage-item .mini-thumb { width: 120px; aspect-ratio: 16 / 9; border-radius: 8px; object-fit: cover; background: var(--track); flex: 0 0 auto; }
.manage-item .grow { flex: 1 1 200px; min-width: 0; }

/* ============ Cheers ============ */

/* Square Sticky-Note Parent Cheers (side-by-side on desktop, 2-up on phone) */
.cheers-grid { display: flex; flex-wrap: wrap; gap: 0.65rem; }
.cheer-tile {
  width: 138px; height: 138px;
  padding: 0.7rem; border-radius: var(--radius-sm);
  background: var(--soft); border: 1px solid var(--border);
  display: flex; flex-direction: column; justify-content: space-between; gap: 0.35rem;
  box-shadow: 0 2px 8px -4px var(--shadow);
}
.cheer-tile-head { display: flex; align-items: center; gap: 0.4rem; min-width: 0; }
.cheer-from { font-size: 0.74rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cheer-body {
  font-size: 0.76rem; line-height: 1.35; color: var(--text);
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical;
  margin: auto 0;
}
.cheer-when { font-size: 0.66rem; color: var(--muted); }
.cheer-composer {
  padding: 0.65rem; border-radius: var(--radius-sm);
  background: var(--bg); border: 1px solid var(--border);
}
.cheer-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.cheer-chip {
  padding: 0.22rem 0.55rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  font-size: 0.72rem; font-weight: 600; cursor: pointer;
}
.cheer-chip:hover { color: var(--text); border-color: var(--accent); }
.cheer-input-row { display: flex; gap: 0.45rem; align-items: flex-start; }

/* ============ Books: shelf, covers and quiz ============ */

.shelf-wrap { display: flex; flex-direction: column; gap: 0.5rem; }
.book-shelf-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 1.5rem 1.25rem;
  list-style: none; margin: 0; padding: 0.5rem 0.5rem 0;
  align-items: end;
}
.book-card { display: flex; flex-direction: column; gap: 0.65rem; }
.book-cover-link { text-decoration: none; display: block; }
.book-cover {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 3px 12px 12px 3px;
  padding: 1rem 1rem 1rem 1.45rem;
  background: var(--spine);
  color: var(--spine-text);
  display: flex; flex-direction: column; justify-content: space-between;
  box-shadow:
    -3px 0 0 rgba(0, 0, 0, 0.08) inset,
    0 10px 22px -10px rgba(0, 0, 0, 0.28),
    0 2px 5px -1px rgba(0, 0, 0, 0.12);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s ease;
}
.book-cover::before {
  content: ""; position: absolute; left: 10px; top: 0; bottom: 0; width: 2px;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.22), rgba(255, 255, 255, 0.18));
  pointer-events: none;
}
.book-cover::after {
  content: ""; position: absolute; right: -4px; top: 5px; bottom: 5px; width: 4px;
  border-radius: 0 3px 3px 0;
  background: repeating-linear-gradient(to right, #EFECE6 0px, #EFECE6 1px, #D8D3C8 1px, #D8D3C8 2px);
  pointer-events: none;
}
.book-cover-link:hover .book-cover {
  transform: translateY(-5px);
  box-shadow:
    -3px 0 0 rgba(0, 0, 0, 0.08) inset,
    0 18px 28px -12px rgba(0, 0, 0, 0.34),
    0 4px 8px -2px rgba(0, 0, 0, 0.14);
}
.cover-top { display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; }
.cover-eyebrow { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; opacity: 0.8; }
.cover-done { font-size: 0.68rem; font-weight: 700; padding: 0.1rem 0.35rem; border-radius: 4px; background: rgba(255, 255, 255, 0.2); }
.cover-center { margin: auto 0; display: flex; justify-content: center; padding: 0.4rem 0; }
.book-emblem { width: 34px; height: 34px; opacity: 0.85; }
.cover-bottom { display: flex; flex-direction: column; gap: 0.2rem; }
.cover-title { font-weight: 700; font-size: 0.92rem; line-height: 1.25; overflow-wrap: anywhere; }
.cover-author { font-size: 0.72rem; opacity: 0.78; }
.book-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; padding: 0 0.2rem; }
.book-status { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.76rem; color: var(--muted); font-weight: 500; }
.book-quiz-link { font-size: 0.76rem; font-weight: 600; color: var(--accent); text-decoration: none; }
.book-quiz-link:hover { text-decoration: underline; }
.shelf-rail {
  height: 8px; border-radius: 4px;
  background: var(--shelf);
  box-shadow: 0 4px 10px -2px var(--shadow);
}
.focused-book-layout {
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1.75rem; align-items: start;
}
.focused-book-cover { width: 100%; }
.b-blue   { --spine: #364F7C; --spine-edge: #26395C; --spine-text: #F2F6FF; }
.b-brown  { --spine: #6B5A4E; --spine-edge: #4F4239; --spine-text: #FAF5F0; }
.b-green  { --spine: #2F684E; --spine-edge: #214B38; --spine-text: #EFFBF4; }
.b-purple { --spine: #5E4B7A; --spine-edge: #44355A; --spine-text: #F7F2FF; }
.b-red    { --spine: #9B4D36; --spine-edge: #753826; --spine-text: #FFF3EE; }
.b-teal   { --spine: #2A6B70; --spine-edge: #1D4E52; --spine-text: #EEFAFA; }
.mini-spine { width: 24px; height: 36px; border-radius: 2px 5px 5px 2px; border-left: 4px solid var(--spine-edge); background: var(--spine); flex: 0 0 auto; }
.quiz-option {
  width: 100%; min-height: 48px; padding: 0.7rem 1rem;
  border-radius: var(--radius-sm); text-align: left;
  border: 1px solid var(--border); background: var(--bg);
  font-weight: 500; font-size: 0.95rem; cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.quiz-option:hover:not(:disabled) { border-color: var(--accent); background: var(--soft); }
.quiz-option.right { border-color: var(--good); background: var(--good-soft); color: var(--good-text); font-weight: 600; }
.quiz-option.picked { border-color: var(--danger); background: var(--danger-soft); }
.quiz-option:disabled { cursor: default; }
.feedback { padding: 0.85rem 1rem; border-radius: var(--radius-sm); background: var(--soft); color: var(--soft-text); font-size: 0.9rem; }
.feedback.yes { background: var(--good-soft); color: var(--good-text); }

/* ============ Drawings gallery ============ */

.gallery-grid {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem;
}
.gallery-card {
  width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.65rem;
  display: flex; flex-direction: column; gap: 0.6rem; cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease;
}
.gallery-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.gallery-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: calc(var(--radius) - 6px); background: var(--track); }
.gallery-card-foot { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; padding: 0 0.2rem 0.15rem; }
.gallery-caption { font-weight: 600; font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gallery-dialog {
  max-width: min(92vw, 880px); width: 100%;
  border: 1px solid var(--border); border-radius: var(--radius); padding: 1.15rem;
  background: var(--surface); color: var(--text);
}
.gallery-dialog::backdrop { background: rgba(0, 0, 0, 0.65); }
.gallery-full { width: 100%; max-height: 70vh; object-fit: contain; border-radius: var(--radius-sm); background: var(--track); }
.search-thumb {
  width: 40px; height: 40px; flex: 0 0 auto;
  border-radius: var(--radius-sm); object-fit: cover;
  border: 1px solid var(--border); background: var(--surface-2);
}

/* ============ Ask a parent (questions) ============ */

.question-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 0.55rem; }
.question-item { display: flex; gap: 0.7rem; align-items: center; padding: 0.7rem 0.9rem; border-radius: var(--radius-sm); background: var(--bg); border: 1px solid var(--border); }
.question-item .grow { flex: 1; min-width: 0; }
.answer-row { display: flex; gap: 0.55rem; align-items: center; }
.answer-row input[type="radio"] { width: 18px; height: 18px; margin: 0; accent-color: var(--good); flex: 0 0 auto; }
.qa-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 0.9rem;
}
.qa-card { padding: 1.1rem 1.25rem; }
.qa-question { font-size: 1.04rem; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.qa-answer {
  padding: 0.8rem 1rem; border-radius: var(--radius-sm);
  background: var(--surface-2); border-left: 3px solid var(--accent);
}
.qa-answer-text { white-space: pre-wrap; line-height: 1.5; overflow-wrap: anywhere; }
.qa-waiting { font-style: italic; }
.qa-draft-note {
  padding: 0.45rem 0.7rem; border-radius: var(--radius-sm);
  background: var(--soft); color: var(--soft-text); font-weight: 500;
}
.qa-foot { padding-top: 0.55rem; border-top: 1px solid var(--border); }

/* ============ Adult space: week, quotes, bookmarks, supplies ============ */

.adult-subnav {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  padding: 0.3rem; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  width: fit-content; max-width: 100%;
}
.adult-subnav-link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.42rem 0.85rem; border-radius: calc(var(--radius-sm) - 3px);
  font-size: 0.86rem; font-weight: 600; color: var(--muted);
  text-decoration: none; transition: background 0.15s ease, color 0.15s ease;
}
.adult-subnav-link:hover { color: var(--text); }
.adult-subnav-link[aria-current="page"] {
  background: var(--surface); color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.quote-grid {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 0.95rem;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.quote-card, .bookmark-card {
  display: flex; flex-direction: column; justify-content: space-between;
  height: 100%;
}
.quote-body {
  display: flex; align-items: flex-start; gap: 0.5rem;
}
.quote-mark {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.2rem; line-height: 1; color: var(--muted); opacity: 0.55;
  flex: none; margin-top: -0.15rem;
}
.quote-text {
  font-size: 1.06rem; line-height: 1.55; font-weight: 500;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.quote-context {
  color: var(--muted); font-size: 0.86rem; line-height: 1.45;
  padding-left: 1.65rem; font-style: italic; overflow-wrap: anywhere;
}
.quote-foot {
  padding-top: 0.65rem; border-top: 1px solid var(--border);
  flex-wrap: wrap; gap: 0.5rem;
}
.quote-meta { flex-wrap: wrap; gap: 0.45rem; }
.quote-date-input { width: auto; min-width: 9.5rem; padding: 0.35rem 0.55rem; font-size: 0.86rem; }
.bookmark-form-grid {
  display: grid; gap: 0.6rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.bookmark-grid {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 0.85rem;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
}
.bookmark-head { gap: 0.5rem; flex-wrap: wrap; }
.bookmark-host {
  font-size: 0.76rem; font-weight: 600; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 14rem;
}
.bookmark-link {
  display: inline-flex; align-items: baseline; gap: 0.35rem;
  text-decoration: none; color: var(--text); overflow-wrap: anywhere;
}
.bookmark-link:hover { text-decoration: underline; }
.bookmark-ext { color: var(--muted); flex: none; display: inline-flex; }
.bookmark-foot {
  padding-top: 0.55rem; margin-top: auto; border-top: 1px solid var(--border);
}
.supply-form-grid {
  display: grid; gap: 0.6rem;
  grid-template-columns: minmax(0, 2fr) minmax(150px, 1fr);
}
.supply-item { list-style: none; }
.supply-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.65rem; flex-wrap: wrap;
}
.supply-toggle { flex: 1 1 220px; }
.supply-main {
  display: inline-flex; align-items: center; flex-wrap: wrap; gap: 0.45rem;
}
.supply-actions { flex-wrap: wrap; gap: 0.4rem; }
.supply-idea-link {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.78rem; color: var(--muted); text-decoration: none;
  padding: 0.2rem 0.55rem; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  max-width: 15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.supply-idea-link:hover { color: var(--text); }
.supply-edit { margin: 0.35rem 0; }
.week-pulse {
  display: grid; gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.week-tile {
  display: flex; flex-direction: column; gap: 0.15rem;
  text-decoration: none; color: inherit; padding: 0.9rem 1.05rem;
  transition: transform 0.12s ease;
}
.week-tile:hover { transform: translateY(-1px); }
.week-tile-num { font-size: 1.65rem; font-weight: 700; line-height: 1.1; }
.week-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  align-items: start;
}
.week-quotes {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 0.7rem;
}
.week-quote-item {
  padding-left: 0.8rem; border-left: 3px solid var(--border);
  display: flex; flex-direction: column; gap: 0.2rem;
}
.week-quote-text { font-size: 0.95rem; line-height: 1.45; }

/* ============ Edition utilities & responsive ============ */

.home-canvas { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.home-tile-wrap { display: flex; flex-direction: column; gap: 0.45rem; min-width: 0; }
.home-span-full { grid-column: 1 / -1; }
.home-tile-wrap.is-arranging { padding: 0.55rem; border: 1.5px dashed var(--border-strong); border-radius: var(--radius); cursor: grab; }
.home-tile-wrap.is-dragging { opacity: 0.45; cursor: grabbing; }
.home-tile-wrap.is-drop-target { border-color: var(--accent); background: var(--soft); }
.home-tile-bar { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }
.home-tile-handle { user-select: none; }
.home-tile-actions { flex-wrap: wrap; gap: 0.35rem; }
.home-search { width: 100%; display: flex; flex-direction: column; gap: 0.5rem; }
.home-search .search-bar { width: 100%; transition: max-width 0.18s ease; }
.home-search.size-compact .search-bar { max-width: 14rem; }
.home-search.size-compact .search-bar:focus-within { max-width: 24rem; }
.home-search.size-medium .search-bar { max-width: 28rem; }
.home-search.size-wide .search-bar { max-width: 100%; }
.home-search.align-center .search-bar { margin-inline: auto; }
.home-search.align-center .tag-filter-bar { justify-content: center; }
.home-search.align-right .search-bar { margin-left: auto; }
.home-search.align-right .tag-filter-bar { justify-content: flex-end; }
.home-search [hidden] { display: none; }
.home-dialog { max-width: 540px; width: min(540px, calc(100vw - 2rem)); }
.home-custom-list { list-style: none; padding: 0; margin: 0; }
.home-custom-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; padding: 0.7rem 0.85rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); }
.home-custom-row.is-on { background: var(--surface); border-color: var(--border-strong); }
.home-custom-main { flex: 1; min-width: 0; }
.home-custom-label { display: flex; align-items: flex-start; gap: 0.65rem; cursor: pointer; }
.home-custom-label input { margin-top: 0.25rem; flex: none; }
.home-search-size-row { padding-left: 1.55rem; flex-wrap: wrap; gap: 0.5rem; }
.home-custom-order { display: flex; gap: 0.3rem; flex: none; }
.danger-text { color: var(--danger); font-weight: 600; }
.avatar.tiny { width: 22px; height: 22px; font-size: 0.68rem; }
.card.dashed { border: 1.5px dashed var(--border-strong); background: transparent; }
.btn-soft { background: var(--soft); border-color: transparent; color: var(--soft-text); font-weight: 600; }
.btn-soft:hover:not(:disabled) { border-color: var(--accent); }
.status-dot.dot-accent { background: var(--accent); }
.status-dot.dot-good { background: var(--good); }
.privacy-note { display: flex; gap: 0.45rem; align-items: flex-start; font-size: 0.78rem; color: var(--muted); }
.switch-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.25rem; }
.kind-select { width: auto; min-width: 0; font-weight: 600; font-size: 0.78rem; }
.cat-row { gap: 0.65rem; flex-wrap: wrap; } .cat-row input { flex: 1 1 140px; min-width: 120px; } .cat-row select { width: auto; flex: none; }
.nav-sep { border: 0; border-top: 1px solid var(--border); margin: 0.45rem 0.25rem; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 0.35rem; }
.sidebar-toggle { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--radius-sm); border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; flex: none; } .sidebar-toggle:hover { background: var(--surface-2); color: var(--text); }
@media (min-width: 781px) { .topbar { transition: width 0.16s ease, flex-basis 0.16s ease; } body.sidebar-collapsed .topbar { width: 64px; flex-basis: 64px; } body.sidebar-collapsed .topbar-inner { padding: 1.15rem 0.55rem; } body.sidebar-collapsed .world-backdrop { left: 64px; } body.sidebar-collapsed .brand, body.sidebar-collapsed .nav a span, body.sidebar-collapsed .sidebar-status, body.sidebar-collapsed .who-meta { display: none; } body.sidebar-collapsed .sidebar-head, body.sidebar-collapsed .nav a, body.sidebar-collapsed .who-button { justify-content: center; padding-inline: 0; } }
@keyframes mic-pulse { 0%, 100% { box-shadow: 0 0 0 0 var(--danger-border); } 50% { box-shadow: 0 0 0 8px transparent; } }
@media (max-width: 780px) {
  .world-scene, .nav-sep, .sidebar-toggle { display: none; }
  .cheers-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.55rem; }
  .cheer-tile { width: auto; height: auto; aspect-ratio: 1 / 1; padding: 0.6rem; }
  .focused-book-layout, .home-canvas, .supply-form-grid { grid-template-columns: 1fr; }
  .focused-book-cover { max-width: 185px; margin: 0 auto; }
}
