@import url("https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,500;0,700;1,500&family=Nunito:wght@400;600;700&family=Caveat:wght@500;700&family=Cinzel:wght@500;700&family=Cormorant+Garamond:ital,wght@500;600;700&family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=Pinyon+Script&display=swap");
:root {
  --bg: #fff3f8; --bg2: #ffe6f1; --card: #ffffff; --ink: #5b3a52; --muted: #9b7a90;
  --pink: #f4a6c6; --pink-deep: #d9679b; --lav: #cdb8ff; --lav-soft: #efe6ff; --gold: #f6d58a;
  --line: #f6d3e3; --shadow: 0 6px 20px rgba(217, 103, 155, .12); --radius: 18px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: 'Nunito', system-ui, sans-serif; color: var(--ink); line-height: 1.65;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%) fixed; min-height: 100vh;
  display: flex; flex-direction: column;
}
h1, h2, h3 { font-family: 'Lora', Georgia, serif; line-height: 1.25; margin: 0 0 .4em; }
h1 { font-size: clamp(1.8rem, 5vw, 2.5rem); }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.12rem; }
a { color: var(--pink-deep); }
code { background: var(--lav-soft); padding: 1px 6px; border-radius: 6px; }
hr { border: none; border-top: 2px dashed var(--line); margin: 18px 0; }
.small { font-size: .85rem; }
.muted { color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .75rem; color: var(--muted); margin: 0 0 6px; }

.stars { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.stars i { position: absolute; color: var(--pink); opacity: .35; font-style: normal; animation: twinkle 4s ease-in-out infinite; }
@keyframes twinkle { 0%,100% { opacity: .15; transform: scale(.8); } 50% { opacity: .6; transform: scale(1.1); } }

/* header */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px;
  padding: 10px clamp(14px, 4vw, 36px); background: rgba(255, 243, 248, .92); backdrop-filter: blur(8px);
  border-bottom: 2px dashed var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-moon { font-size: 1.8rem; color: var(--pink-deep); }
.brand small { display: block; font-size: .64rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.brand strong { font-family: 'Lora', serif; font-size: 1.2rem; }
#nav { display: flex; flex-wrap: wrap; gap: 4px; margin-right: auto; }
#nav a { text-decoration: none; color: var(--ink); padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: .92rem; }
#nav a:hover { background: var(--lav-soft); }
#nav a.active { background: linear-gradient(135deg, var(--pink), var(--lav)); color: #fff; }

.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border: 2px solid var(--line); border-radius: 999px; background: #fff; font-weight: 700; }
.menu summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: #fff; border: 2px solid var(--pink); border-radius: 16px; box-shadow: var(--shadow); padding: 8px; display: flex; flex-direction: column; z-index: 30; }
.menu-pop a, .linklike { padding: 8px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); font: inherit; font-weight: 600; background: none; border: none; text-align: left; cursor: pointer; }
.menu-pop a:hover, .linklike:hover { background: var(--lav-soft); }
.menu-head { padding: 6px 12px 8px; border-bottom: 2px dashed var(--line); margin-bottom: 4px; font-weight: 700; }

/* avatars */
.avatar { border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; border: 3px solid var(--pink); background: var(--lav-soft); width: 56px; height: 56px; flex: none; font-family: 'Lora', serif; font-weight: 700; color: var(--pink-deep); }
.avatar.xs { width: 22px; height: 22px; border-width: 2px; font-size: .7rem; }
.avatar.sm { width: 36px; height: 36px; border-width: 2px; font-size: .9rem; }
.avatar.lg { width: 84px; height: 84px; font-size: 1.8rem; }
.avatar.xl { width: 104px; height: 104px; font-size: 2.2rem; }
.ring-gryffindor { border-color: #e07a7a; } .ring-hufflepuff { border-color: #f0cf5a; }
.ring-ravenclaw { border-color: #7fa0e6; } .ring-slytherin { border-color: #6cc48a; }

/* buttons */
.btn {
  font: inherit; font-weight: 700; cursor: pointer; border: 2px solid var(--pink-deep); background: var(--pink-deep); color: #fff;
  padding: 9px 18px; border-radius: 999px; text-decoration: none; display: inline-block; text-align: center;
  transition: transform .12s, box-shadow .12s, background .12s;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, .spoiler:focus-visible, summary:focus-visible, .lcard:focus-visible, .tile:focus-visible {
  outline: 3px solid var(--lav); outline-offset: 2px;
}
.btn.ghost { background: transparent; color: var(--pink-deep); }
.btn.ghost:hover { background: #fff; }
.btn.on { background: #fff1cc; border-color: var(--gold); color: #8a6a14; }
.btn.danger { background: #fff; color: #c0396b; border-color: #e7a0bd; }
.btn.pinkgrad { background: linear-gradient(135deg, #f79ac4, #c9a8ff); border-color: transparent; }
.btn.small { padding: 6px 14px; font-size: .9rem; }
.btn.tiny { padding: 2px 10px; font-size: .78rem; }
.btn.wide { width: 100%; }
.filebtn { cursor: pointer; }

main { flex: 1; width: min(1050px, 100%); margin: 0 auto; padding: 26px clamp(14px, 4vw, 28px) 50px; position: relative; z-index: 1; }
main:focus { outline: none; }
.foot { text-align: center; padding: 18px; color: var(--muted); font-size: .85rem; position: relative; z-index: 1; }

/* auth */
.auth-wrap { display: flex; justify-content: center; padding-top: 4vh; }
.narrow { max-width: 480px; margin-left: auto; margin-right: auto; }
.auth-card { width: 100%; text-align: center; }
.auth-card form, .auth-card .field { text-align: left; }
.tabs { display: flex; gap: 6px; margin: 14px 0; justify-content: center; }
.tab { font: inherit; font-weight: 700; cursor: pointer; border: 2px solid var(--line); background: #fff; color: var(--ink); padding: 6px 16px; border-radius: 999px; }
.tab.on { background: var(--pink); border-color: var(--pink); color: #fff; }
.form-msg { color: #c0396b; font-weight: 700; min-height: 1.4em; margin: 6px 0; }

/* paper & cards */
.paper {
  background: #fffdfb; border: 2px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); padding: clamp(18px, 4vw, 38px);
  background-image: linear-gradient(transparent 31px, rgba(244,166,198,.12) 32px); background-size: 100% 32px;
}
.card { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; }
.card.pad { padding: 20px 22px; margin-bottom: 18px; }
.card h3 { margin: 0; }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.meta { color: var(--muted); font-size: .9rem; margin: 0; }
.reward { margin: 4px 0 0; font-weight: 700; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.grid.one { grid-template-columns: 1fr; }
.empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 28px; border: 2px dashed var(--line); border-radius: var(--radius); }
.plain { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.card.member { flex-direction: row; align-items: flex-start; gap: 14px; }
.page-head { margin-bottom: 14px; }
.page-head.row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.crumbs { font-size: .9rem; color: var(--muted); margin: 0 0 10px; }
.toolbar { margin: 12px 0; } .toolbar input { max-width: 420px; }

.hero { text-align: center; padding: 22px 10px 8px; }
.lead { color: var(--muted); font-size: 1.08rem; margin: 0 0 14px; }
.section-title { margin: 28px 0 10px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.tile { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); transition: transform .15s; }
.tile:hover { transform: translateY(-3px) rotate(-.4deg); border-color: var(--pink); }
.tile .ico { font-size: 1.7rem; } .tile small { color: var(--muted); }

.pill { display: inline-block; font-size: .74rem; font-weight: 700; padding: 2px 11px; border-radius: 999px; background: var(--lav-soft); color: #6a4c9a; }
.pill.gold { background: #fff1cc; color: #8a6a14; }
.pill.st-open { background: #dff6e8; color: #2f7a52; }
.pill.st-in-progress { background: #fff1cc; color: #8a6a14; }
.pill.st-done { background: #eee; color: #777; }
.pill.house-gryffindor { background: #ffd9d9; color: #9b2c2c; } .pill.house-hufflepuff { background: #fff1b8; color: #7a6200; }
.pill.house-ravenclaw { background: #d6e4ff; color: #274a8a; } .pill.house-slytherin { background: #d5f2dc; color: #25693a; }

details summary { cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 700; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: '❀'; color: var(--pink); margin-right: 8px; }
.sum-title { flex: 1; font-family: 'Lora', serif; font-size: 1.05rem; }
details[open] summary { margin-bottom: 8px; }
.version { margin: 10px 0; }

/* lessons */
.note { display: flex; gap: 14px; align-items: center; background: #fff; border: 2px solid var(--line); border-left: 6px solid var(--pink); border-radius: var(--radius); padding: 14px 18px; margin: 10px 0 18px; box-shadow: var(--shadow); }
.note-ico { font-size: 2rem; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 16px; }
.filters .field { margin: 0; min-width: 150px; }
.lesson-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; padding: 16px; background: rgba(255,255,255,.55); border: 2px solid var(--line); border-radius: 22px; }
.lcard { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink); background: #fff; border: 2px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); transition: transform .15s; }
.lcard:hover { transform: translateY(-3px) rotate(.4deg); border-color: var(--pink); }
.lcard h3 { margin: 0; }
.kicker { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--pink-deep); font-weight: 700; margin: 0; }
.kicker a { text-decoration: none; }
.byline { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .9rem; }
.byline.big { margin: 0 0 14px; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.lesson-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; padding-top: 16px; border-top: 2px dashed var(--line); }
.body h3 { color: var(--pink-deep); margin-top: 1.3em; }
.body ul { padding-left: 1.3em; } .body li::marker { color: var(--pink); }
.body figure { margin: 14px 0; } .body img { max-width: 100%; height: auto; border-radius: 14px; border: 2px solid var(--line); }
blockquote.say { margin: 14px 0; padding: 10px 16px; background: var(--lav-soft); border-left: 5px solid var(--lav); border-radius: 0 14px 14px 0; font-style: italic; }
.spoiler { background: var(--ink); color: transparent; border-radius: 8px; padding: 1px 8px; cursor: pointer; transition: background .2s, color .2s; user-select: none; }
.spoiler.open { background: #fff0c4; color: var(--ink); user-select: auto; }

/* forms */
input, textarea, select { font: inherit; color: var(--ink); background: #fff; width: 100%; border: 2px solid var(--line); border-radius: 14px; padding: 9px 14px; }
input[type=checkbox] { width: auto; }
input[type=range] { padding: 0; }
textarea { resize: vertical; }
.field { display: block; margin-bottom: 12px; }
.field > span, .lbl { display: block; font-weight: 700; margin-bottom: 4px; }
.field small { color: var(--muted); display: block; margin-top: 3px; }
.form-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.form-row .field { flex: 1 1 200px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; margin: 2px 12px 2px 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
dialog { border: 3px solid var(--pink); border-radius: 22px; padding: 22px; width: min(620px, 94vw); background: #fffafc; color: var(--ink); box-shadow: 0 20px 60px rgba(91,58,82,.3); max-height: 92vh; overflow: auto; }
dialog::backdrop { background: rgba(91,58,82,.45); }
.crop-wrap { display: flex; justify-content: center; margin: 10px 0; }
#cropCanvas { width: 280px; max-width: 100%; height: auto; border-radius: 50%; border: 4px solid var(--pink); touch-action: none; cursor: grab; background: #fff; }

.editbar { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 2px dashed var(--line); }

/* profile */
.profile-head { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.pic-row { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.pic-controls { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }

/* admin */
.admin-row { display: grid; grid-template-columns: 1.2fr .8fr 2fr; gap: 10px 16px; padding: 14px 0; border-bottom: 2px dashed var(--line); align-items: start; }
.admin-row .who { display: flex; gap: 10px; align-items: center; }
.admin-row .mini { margin: 0; }
.owner-check { grid-column: 1 / -1; }
.checks { display: flex; flex-wrap: wrap; align-items: center; }
.checks .lbl { width: 100%; font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.invite-form { background: var(--lav-soft); border-radius: 16px; padding: 14px; margin: 12px 0; }
.invites li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

#toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; background: var(--ink); color: #fff; padding: 10px 20px; border-radius: 999px; z-index: 60; transition: .25s; max-width: 92vw; text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 760px) {
  .two-col { grid-template-columns: 1fr; }
  .admin-row { grid-template-columns: 1fr; }
  .menu-name { display: none; }
  #nav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  #nav a { white-space: nowrap; }
  .brand { margin-right: auto; }
}
@media print {
  .top, .foot, .stars, .lesson-actions, .crumbs, #toast { display: none !important; }
  body { background: #fff; } .paper { border: none; box-shadow: none; background: #fff; padding: 0; }
  .spoiler { background: none; color: var(--ink); border-bottom: 1px dotted; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ===== Night-sky sign-in screen ===== */
body.night {
  --ink: #f1ebff; --muted: #b3acdf; --line: #3b4090; --card: #1b1e52;
  background: linear-gradient(180deg, #0a0c28 0%, #1a1d52 55%, #2a2f78 100%) fixed;
  color: var(--ink);
}
body.night .stars i { color: #fff3c4; opacity: .5; }
body.night .foot { color: #8f89c4; }
body.night .paper {
  background: rgba(24, 27, 76, .82); background-image: none; border-color: #3b4090;
  box-shadow: 0 10px 40px rgba(0, 0, 20, .45), 0 0 0 1px rgba(205, 184, 255, .08) inset; backdrop-filter: blur(4px);
}
body.night h1 { color: #fff; }
body.night .eyebrow { color: #c9c2f3; }
body.night input { background: #11143c; color: #f1ebff; border-color: #3b4090; }
body.night input::placeholder { color: #7f79b8; }
body.night input:focus-visible { outline-color: #cdb8ff; }
body.night .btn { background: linear-gradient(135deg, #f79ac4, #b99cff); border-color: transparent; color: #fff; }
body.night .form-msg { color: #ffb3cf; }
body.night a, body.night .linkbtn { color: #ffc2dc; }
.linkbtn { font: inherit; background: none; border: none; padding: 0; cursor: pointer; text-decoration: underline; font-weight: 700; }

.night-deco { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.moon { position: absolute; right: 4vw; bottom: 6vh; width: clamp(70px, 11vw, 120px); height: clamp(70px, 11vw, 120px); filter: drop-shadow(0 0 22px rgba(253, 233, 168, .5)); animation: bob 6s ease-in-out infinite; }
.zzz { position: absolute; top: -18px; right: -6px; color: #cdb8ff; font-size: .8rem; letter-spacing: .25em; font-weight: 700; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.candle { position: absolute; width: 12px; height: 46px; background: linear-gradient(90deg, #d9d4e8, #fff 45%, #bdb6d6); border-radius: 4px; opacity: .9; animation: floaty 7s ease-in-out infinite; }
.candle i { position: absolute; left: 50%; top: -17px; width: 10px; height: 16px; transform: translateX(-50%); background: radial-gradient(ellipse at 50% 70%, #fff6c8, #ffc45c 60%, transparent 72%); border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%; filter: drop-shadow(0 0 8px #ffd27a); animation: flick 1.4s ease-in-out infinite alternate; }
.candle.c1 { left: 12%; top: 10%; } .candle.c2 { left: 80%; top: 16%; animation-delay: 1.3s; } .candle.c3 { left: 90%; top: 52%; animation-delay: 2.6s; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes flick { from { transform: translateX(-50%) scale(1); } to { transform: translateX(-50%) scale(1.12, .94); } }

/* Library pages: pictures */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-top: 20px; }
.gallery img { width: 100%; height: 170px; object-fit: cover; border-radius: 14px; border: 2px solid var(--line); background: #fff; }
.pics { border: 2px dashed var(--line); border-radius: 16px; padding: 12px 16px; margin: 6px 0 14px; }
.pics legend { font-weight: 700; padding: 0 8px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.thumb { position: relative; }
.thumb img { width: 92px; height: 92px; object-fit: cover; border-radius: 12px; border: 2px solid var(--line); display: block; }
.thumb .btn { position: absolute; top: 4px; right: 4px; padding: 0 8px; line-height: 1.5; }
.check.box { display: flex; border: 2px dashed var(--line); border-radius: 14px; padding: 10px 14px; margin: 6px 0; }

/* =====================================================================
   COSY HOGWARTS PINK (site-wide)
===================================================================== */
:root {
  --gold-deep: #e6b445; --blush: #ffd9e8; --rose: #f79ac4; --plum: #9a5a7c;
  --glow: 0 10px 30px rgba(217, 103, 155, .18);
  --bunting: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='34'%3E%3Crect x='0' y='0' width='240' height='2' fill='%236b4a3a'/%3E%3Cpolygon points='4,2 56,2 56,33 30,25 4,33' fill='%23740001'/%3E%3Cpolygon points='4,10 56,10 56,15 4,15' fill='%23d3a625'/%3E%3Cpolygon points='4,2 56,2 56,4 4,4' fill='rgba(0,0,0,.18)'/%3E%3Cpolygon points='64,2 116,2 116,33 90,25 64,33' fill='%23ecb939'/%3E%3Cpolygon points='64,10 116,10 116,15 64,15' fill='%23372e29'/%3E%3Cpolygon points='64,2 116,2 116,4 64,4' fill='rgba(0,0,0,.18)'/%3E%3Cpolygon points='124,2 176,2 176,33 150,25 124,33' fill='%230e1a40'/%3E%3Cpolygon points='124,10 176,10 176,15 124,15' fill='%23946b2d'/%3E%3Cpolygon points='124,2 176,2 176,4 124,4' fill='rgba(0,0,0,.18)'/%3E%3Cpolygon points='184,2 236,2 236,33 210,25 184,33' fill='%231a472a'/%3E%3Cpolygon points='184,10 236,10 236,15 184,15' fill='%23b8b8b8'/%3E%3Cpolygon points='184,2 236,2 236,4 184,4' fill='rgba(0,0,0,.18)'/%3E%3C/svg%3E");
}
body:not(.night) {
  background:
    radial-gradient(900px 520px at 12% -5%, rgba(255, 190, 220, .55), transparent 60%),
    radial-gradient(800px 500px at 100% 10%, rgba(214, 190, 255, .4), transparent 60%),
    linear-gradient(180deg, #fff0f7 0%, #ffe1ef 60%, #ffd3e6 100%) fixed;
}
h1, h2, h3 { color: #6b3558; }
.top { box-shadow: 0 6px 18px rgba(217, 103, 155, .12); border-bottom: 2px solid var(--line); }
.top::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 22px; background: var(--bunting) repeat-x; background-size: auto 22px; pointer-events: none; filter: drop-shadow(0 3px 2px rgba(217, 103, 155, .18)); }
.brand strong { font-size: 1.3rem; color: #6b3558; }
#nav a { transition: background .15s, transform .15s; }
#nav a:hover { transform: translateY(-1px); }
#nav a.active { box-shadow: 0 3px 10px rgba(217, 103, 155, .35); }
main { padding-top: 40px; }
.btn { box-shadow: 0 4px 0 rgba(154, 90, 124, .28); }
.btn:hover { box-shadow: 0 6px 0 rgba(154, 90, 124, .28), var(--glow); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(154, 90, 124, .28); }
.btn.ghost, .btn.danger { box-shadow: none; }
.card, .lcard, .paper, .note { border-color: #f4c3da; box-shadow: var(--glow); }
.card, .lcard { border-radius: 22px; }
.paper { border-radius: 26px; }
.page-head h1 { display: inline-block; background: linear-gradient(transparent 72%, rgba(246, 213, 138, .55) 72%); padding: 0 6px; }
.eyebrow { color: var(--plum); }
.lcard:hover, .card:hover { box-shadow: 0 14px 34px rgba(217, 103, 155, .26); }
.lesson-cards { background: rgba(255, 255, 255, .6); border-color: #f4c3da; }
blockquote.say { background: #fff0f8; border-left-color: var(--rose); }
.foot { font-family: 'Caveat', 'Snell Roundhand', 'Apple Chancery', 'Segoe Script', 'Lucida Handwriting', 'Brush Script MT', cursive; font-size: 1.15rem; color: var(--plum); }
.avatar { box-shadow: 0 0 0 3px rgba(255, 255, 255, .9), 0 3px 10px rgba(217, 103, 155, .25); }

/* floating candles + sleepy moon on every page */
.cozy-deco { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
body.night .cozy-deco { display: none; }
.wax { position: absolute; width: 12px; height: 44px; background: linear-gradient(90deg, #f6dbe8, #fff 45%, #f2c9dc); border-radius: 4px; opacity: .85; animation: floaty 7s ease-in-out infinite; }
.wax i { position: absolute; left: 50%; top: -17px; width: 10px; height: 16px; transform: translateX(-50%); background: radial-gradient(ellipse at 50% 70%, #fff6c8, #ffc45c 60%, transparent 72%); border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%; filter: drop-shadow(0 0 9px #ffd27a); animation: flick 1.4s ease-in-out infinite alternate; }
.wax.w1 { left: 4%; top: 26%; } .wax.w2 { left: 95%; top: 36%; animation-delay: 1.5s; } .wax.w3 { left: 88%; top: 74%; animation-delay: 3s; }
.sleepy-moon { position: absolute; right: 2.5vw; bottom: 3vh; width: clamp(60px, 7vw, 96px) !important; height: clamp(60px, 7vw, 96px) !important; filter: drop-shadow(0 0 20px rgba(255, 224, 140, .6)); animation: bob 6s ease-in-out infinite; }
main, .foot { position: relative; z-index: 1; }

/* ---------- The Landing ---------- */
.landing-hero {
  position: relative; display: grid; grid-template-columns: auto 1fr auto; gap: 22px 28px; align-items: center;
  padding: 64px 34px 30px; margin-bottom: 8px; border-radius: 30px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .92), rgba(255, 231, 243, .92));
  border: 3px solid var(--rose); box-shadow: 0 0 0 5px rgba(247, 154, 196, .18), var(--glow);
}
.bunting { position: absolute; left: 14px; right: 14px; top: 0; height: 32px; background: var(--bunting) repeat-x; background-size: auto 32px; }
.crest { align-self: start; margin-top: -8px; filter: drop-shadow(0 8px 10px rgba(154, 90, 124, .25)); animation: sway 6s ease-in-out infinite; transform-origin: top center; }
@keyframes sway { 0%,100% { transform: rotate(-1.2deg); } 50% { transform: rotate(1.2deg); } }
.hero-text .eyebrow { margin: 0 0 6px; }
.hero-text h1 { font-size: clamp(1.9rem, 4.6vw, 3rem); margin-bottom: 8px; }
.accent { color: var(--pink-deep); }
.flavour { font-family: 'Caveat', 'Snell Roundhand', 'Apple Chancery', 'Segoe Script', 'Lucida Handwriting', 'Brush Script MT', cursive; font-size: 1.45rem; line-height: 1.3; color: var(--plum); margin: 0 0 14px; max-width: 34em; }
.news-pill-unused { display: inline-block; background: #fff; border: 2px solid #f4c3da; border-radius: 999px; padding: 6px 16px; font-weight: 700; font-size: .92rem; }
.gold-cards { display: flex; gap: 14px; }
.gold-card {
  width: 118px; min-height: 148px; padding: 12px 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; text-decoration: none; color: #6b3558;
  background: linear-gradient(160deg, #fff3cf, #f6d58a 60%, #eec26a); border: 3px solid #fff6dc; border-radius: 14px;
  box-shadow: 0 8px 16px rgba(154, 90, 124, .25); transition: transform .2s;
}
.gold-card:nth-child(1) { transform: rotate(-4deg); } .gold-card:nth-child(2) { transform: translateY(8px) rotate(1.5deg); } .gold-card:nth-child(3) { transform: rotate(4deg); }
.gold-card:hover { transform: translateY(-6px) rotate(0); }
.gold-card .gc-ico { font-size: 2.1rem; line-height: 1; }
.gold-card b { font-family: 'Lora', serif; font-size: .88rem; line-height: 1.2; overflow-wrap: anywhere; }
.gold-card small { font-size: .7rem; color: #8a6a14; }

.business { text-align: center; margin: 34px 0 18px; font-size: 1.7rem; }
.business span { color: var(--gold-deep); font-size: 1.1rem; vertical-align: middle; }
.arches { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; }
.arch {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; text-decoration: none; color: var(--ink);
  padding: 26px 22px 22px; border: 3px solid #f4b8d3; border-radius: 160px 160px 24px 24px / 130px 130px 24px 24px;
  background: linear-gradient(180deg, #ffe4f1 0%, #fff 55%); box-shadow: var(--glow); transition: transform .2s, box-shadow .2s;
}
.arch:hover { transform: translateY(-5px); box-shadow: 0 18px 38px rgba(217, 103, 155, .28); }
.arch-ico { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; font-size: 2.2rem; background: #fff; border: 3px solid var(--gold-deep); box-shadow: 0 0 0 4px #fff2c9, 0 6px 14px rgba(154, 90, 124, .2); margin-bottom: 4px; }
.arch h3 { font-size: 1.3rem; margin: 0; }
.arch p { margin: 0; color: var(--muted); font-size: .95rem; }
.arch .count { margin-top: 8px; background: var(--rose); color: #fff; font-weight: 700; font-size: .82rem; padding: 3px 14px; border-radius: 999px; box-shadow: 0 3px 0 rgba(154, 90, 124, .25); }

.landing-deco { position: fixed; left: 0; right: 0; bottom: 0; height: 0; pointer-events: none; z-index: 0; }
.fireplace { position: absolute; left: 10px; bottom: 0; filter: drop-shadow(0 0 22px rgba(255, 170, 120, .45)); }
.armchair { position: absolute; right: 12px; bottom: 0; }
@media (max-width: 1100px) { .landing-deco { display: none; } }
@media (max-width: 900px) {
  .landing-hero { grid-template-columns: 1fr; padding: 56px 20px 24px; text-align: center; }
  .crest { justify-self: center; } .gold-cards { justify-content: center; flex-wrap: wrap; } .flavour { margin-left: auto; margin-right: auto; }
}
@media (prefers-reduced-motion: reduce) { .crest, .wax, .wax i, .sleepy-moon { animation: none !important; } }

/* stronger contrast for white text on pink */
#nav a.active { background: linear-gradient(135deg, #e0679d, #a98be0); }
.btn.pinkgrad, body.night .btn { background: linear-gradient(135deg, #e0679d, #a98be0); }
.arch .count { background: #e0679d; }

/* =====================================================================
   ORIGINAL HOUSE COLOURS
   Gryffindor scarlet + gold, Hufflepuff yellow + black,
   Ravenclaw blue + bronze, Slytherin green + silver
===================================================================== */
.pill.house-gryffindor { background: #740001; color: #f3d77a; }
.pill.house-hufflepuff { background: #ecb939; color: #372e29; }
.pill.house-ravenclaw  { background: #0e1a40; color: #e6c48a; }
.pill.house-slytherin  { background: #1a472a; color: #dcdcdc; }
.pill.house-unsorted   { background: #f6e3ee; color: #7a4a66; }
.ring-gryffindor { border-color: #d3a625 !important; box-shadow: 0 0 0 3px #740001, 0 3px 10px rgba(116, 0, 1, .3) !important; }
.ring-hufflepuff { border-color: #372e29 !important; box-shadow: 0 0 0 3px #ecb939, 0 3px 10px rgba(236, 185, 57, .4) !important; }
.ring-ravenclaw  { border-color: #946b2d !important; box-shadow: 0 0 0 3px #0e1a40, 0 3px 10px rgba(14, 26, 64, .3) !important; }
.ring-slytherin  { border-color: #aaaaaa !important; box-shadow: 0 0 0 3px #1a472a, 0 3px 10px rgba(26, 71, 42, .3) !important; }
.house-banner { display: block; filter: drop-shadow(0 6px 8px rgba(70, 30, 50, .3)); }
.mini-banner { margin-left: auto; align-self: flex-start; flex: none; }
.mini-banner .house-banner { filter: drop-shadow(0 3px 4px rgba(70, 30, 50, .25)); }
.profile-head .mini-banner.push { margin-left: auto; }
.card.member .member-info { flex: 1; min-width: 0; }

/* =====================================================================
   THE LANDING (own layout)
===================================================================== */
.greeting { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 8px 4px 22px; }
.greet-text { max-width: 640px; }
.greet-text h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); margin: 0 0 6px; }
.banner-hang { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: -10px; transform-origin: top center; animation: sway 6s ease-in-out infinite; }
.banner-label { font-family: 'Caveat', 'Snell Roundhand', 'Apple Chancery', 'Segoe Script', 'Lucida Handwriting', 'Brush Script MT', cursive; font-size: 1.3rem; color: var(--plum); }

.sticky-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 26px; padding: 18px 4px 8px; }
.sticky { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 28px 22px 20px; text-decoration: none; color: var(--ink); border-radius: 6px 6px 22px 6px; box-shadow: 0 10px 22px rgba(154, 90, 124, .2), 0 2px 0 rgba(255, 255, 255, .6) inset; transition: transform .2s, box-shadow .2s; }
.sticky-0 { background: #ffd3e6; transform: rotate(-1.6deg); }
.sticky-1 { background: #e6d8ff; transform: rotate(1.2deg) translateY(6px); }
.sticky-2 { background: #fff0b8; transform: rotate(-.8deg); }
.sticky:hover { transform: rotate(0) translateY(-6px); box-shadow: 0 18px 32px rgba(154, 90, 124, .3); }
.tape { position: absolute; top: -12px; left: 50%; width: 84px; height: 24px; transform: translateX(-50%) rotate(-3deg); background: repeating-linear-gradient(45deg, rgba(255, 255, 255, .75) 0 8px, rgba(255, 255, 255, .45) 8px 16px); border-radius: 3px; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.sticky-ico { font-size: 2rem; line-height: 1; }
.sticky h3 { margin: 2px 0 0; font-size: 1.35rem; }
.sticky p { margin: 0; font-size: .95rem; color: #7a5470; }
.sticky-count { align-self: flex-start; margin-top: 6px; background: rgba(255, 255, 255, .8); font-weight: 700; font-size: .82rem; padding: 3px 14px; border-radius: 999px; }

.recent { margin-top: 34px; }
.recent h2 { margin-bottom: 12px; }
.ribbon-list { display: grid; gap: 10px; }
.ribbon-row { display: flex; align-items: center; gap: 14px; padding: 12px 18px 12px 14px; text-decoration: none; color: var(--ink); background: #fff; border: 2px solid #f4c3da; border-left: 10px solid var(--rose); border-radius: 6px 20px 20px 6px; box-shadow: var(--glow); transition: transform .15s, border-color .15s; }
.ribbon-row:hover { transform: translateX(6px); border-left-color: var(--gold-deep); }
.rr-ico { font-size: 1.6rem; }
.rr-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.rr-text small { color: var(--muted); }
.rr-go { color: var(--pink-deep); font-weight: 700; font-size: 1.2rem; }

.moon { width: clamp(70px, 10vw, 110px); height: clamp(70px, 10vw, 110px); }
@media (max-width: 760px) { .greeting { flex-direction: column-reverse; align-items: center; text-align: center; } .banner-hang { margin-top: 0; } .sticky-board { gap: 30px; } }

/* =====================================================================
   OWNER TAG
===================================================================== */
.pill.owner-tag { background: linear-gradient(135deg, #f6d58a, #e6b445); color: #5b3a12; box-shadow: 0 2px 0 rgba(154, 90, 124, .25); }

/* =====================================================================
   THE SERPENTS HOUR  (dark green, serpent, dark-wizard theme)
===================================================================== */
.sticky-serpent { background: linear-gradient(160deg, #0f3a28, #06180f); color: #d4f6e2; border: 2px solid #2fbf71; transform: rotate(1.4deg) translateY(4px); }
.sticky-serpent p { color: #9fd9b9; } .sticky-serpent h3 { color: #eafff2; font-family: 'Cinzel', serif; }
.sticky-serpent .sticky-count { background: #2fbf71; color: #04140b; }

body.serpent {
  --ink: #d4f6e2; --muted: #86b9a0; --line: #1d5c40; --card: #0c2419; --pink-deep: #3ddc84; --plum: #86b9a0;
  background:
    radial-gradient(700px 420px at 85% 0%, rgba(47, 191, 113, .16), transparent 60%),
    radial-gradient(800px 500px at 0% 100%, rgba(20, 110, 70, .22), transparent 60%),
    radial-gradient(circle at 10px 10px, rgba(61, 220, 132, .05) 0 8px, transparent 9px) 0 0 / 22px 22px,
    linear-gradient(180deg, #04130c 0%, #020a06 100%) fixed;
  color: var(--ink);
}
body.serpent .stars i { color: #3ddc84; opacity: .35; }
body.serpent .cozy-deco { opacity: .55; filter: hue-rotate(75deg) saturate(1.5); }
body.serpent .top { background: rgba(4, 19, 12, .94); border-bottom: 2px solid #1d5c40; box-shadow: 0 6px 22px rgba(0, 0, 0, .5); }
body.serpent .top::after { display: none; }
body.serpent .brand, body.serpent .brand strong, body.serpent #nav a { color: #d4f6e2; }
body.serpent .brand small { color: #86b9a0; }
body.serpent .brand-moon { color: #3ddc84; }
body.serpent #nav a:hover { background: #0f3a28; }
body.serpent #nav a.active { background: linear-gradient(135deg, #1f9d5c, #0d5a38); color: #fff; box-shadow: 0 0 14px rgba(61, 220, 132, .45); }
body.serpent .menu summary { background: #0c2419; border-color: #1d5c40; color: #d4f6e2; }
body.serpent .menu-pop { background: #0c2419; border-color: #2fbf71; }
body.serpent .menu-pop a, body.serpent .linklike { color: #d4f6e2; } body.serpent .menu-pop a:hover, body.serpent .linklike:hover { background: #0f3a28; }
body.serpent .menu-head { border-bottom-color: #1d5c40; }
body.serpent h1, body.serpent h2, body.serpent h3 { color: #eafff2; }
body.serpent a { color: #6df0a8; }
body.serpent .foot { color: #6fb08f; }
body.serpent .btn { background: linear-gradient(135deg, #1f9d5c, #0d5a38); border-color: #2fbf71; color: #eafff2; box-shadow: 0 4px 0 rgba(0, 0, 0, .45); }
body.serpent .btn.ghost { background: transparent; color: #6df0a8; box-shadow: none; }
body.serpent .btn.danger { background: transparent; color: #ff8aa6; border-color: #7a2a45; box-shadow: none; }
body.serpent .btn:hover { box-shadow: 0 6px 0 rgba(0, 0, 0, .45), 0 0 18px rgba(61, 220, 132, .35); }
body.serpent dialog { background: #0a1f16; color: #d4f6e2; border-color: #2fbf71; }
body.serpent dialog::backdrop { background: rgba(0, 12, 6, .75); }
body.serpent input, body.serpent textarea, body.serpent select { background: #061610; color: #d4f6e2; border-color: #1d5c40; }
body.serpent .field small { color: #86b9a0; }
body.serpent #toast { background: #0f3a28; color: #eafff2; border: 1px solid #2fbf71; }

.serp-hero { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 34px 38px; margin-bottom: 26px; border-radius: 28px; overflow: hidden;
  background: radial-gradient(500px 260px at 90% 50%, rgba(47, 191, 113, .25), transparent 70%), linear-gradient(160deg, #0d2c1f, #04130c);
  border: 2px solid #2fbf71; box-shadow: 0 0 0 5px rgba(47, 191, 113, .1), 0 0 40px rgba(47, 191, 113, .18) inset, 0 20px 50px rgba(0, 0, 0, .55); }
.serp-hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 10px 10px, rgba(61, 220, 132, .07) 0 6px, transparent 7px) 0 0 / 18px 18px; pointer-events: none; }
.serp-hero-text { position: relative; max-width: 560px; }
.serp-eyebrow { text-transform: uppercase; letter-spacing: .3em; font-size: .72rem; color: #6df0a8; margin: 0 0 8px; }
.serp-hero h1 { font-family: 'Cinzel', 'Lora', serif; font-size: clamp(2rem, 6vw, 3.6rem); letter-spacing: .06em; margin: 0 0 10px; color: #eafff2; text-shadow: 0 0 22px rgba(61, 220, 132, .55); }
.motto { font-family: 'Lora', serif; font-style: italic; font-size: 1.2rem; color: #9fd9b9; margin: 0 0 14px; }
.serpent-art { position: relative; flex: none; filter: drop-shadow(0 0 18px rgba(61, 220, 132, .5)); animation: slither 7s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes slither { 0%,100% { transform: rotate(-2deg); } 50% { transform: rotate(2.5deg) translateY(-4px); } }

.serp-section { margin: 30px 0; }
.serp-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.serp-head h2 { font-family: 'Cinzel', 'Lora', serif; letter-spacing: .08em; margin: 0; }
.serp-head h2::after { content: ''; display: block; width: 64px; height: 3px; margin-top: 6px; background: linear-gradient(90deg, #3ddc84, transparent); }
.quiet { color: #86b9a0; font-style: italic; }

.tiers { display: grid; gap: 16px; margin-top: 14px; }
.tier { background: linear-gradient(160deg, #0c2419, #071810); border: 2px solid #1d5c40; border-left: 8px solid var(--rc); border-radius: 6px 22px 22px 6px; padding: 16px 20px; box-shadow: 0 10px 26px rgba(0, 0, 0, .4); }
.tier-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.tier-head > div { flex: 1; min-width: 160px; }
.tier-head h3 { margin: 0; font-family: 'Cinzel', serif; letter-spacing: .05em; color: var(--rc); }
.tier-head p { margin: 2px 0 0; color: #9fd9b9; font-size: .92rem; }
.tier-level { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--rc); color: var(--rc); font-family: 'Cinzel', serif; font-weight: 700; background: rgba(0, 0, 0, .35); box-shadow: 0 0 14px color-mix(in srgb, var(--rc) 45%, transparent); }
.chips { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.chip { display: flex; flex-direction: column; gap: 4px; min-width: 170px; max-width: 280px; padding: 12px 14px; background: rgba(0, 0, 0, .35); border: 1px solid #1d5c40; border-radius: 14px; }
.chip-name { font-family: 'Cinzel', serif; font-weight: 700; font-size: 1.05rem; color: #eafff2; }
.chip small { color: #86b9a0; } .chip p { margin: 2px 0 0; color: #b6e4cb; font-size: .9rem; }
.rank-tag { align-self: flex-start; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 2px 11px; border-radius: 999px; color: #04140b; background: var(--rc, #2fbf71); box-shadow: 0 0 12px color-mix(in srgb, var(--rc, #2fbf71) 50%, transparent); }
.chip-tools { display: inline-flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }

.code-box { margin-top: 12px; padding: 20px 24px; background: linear-gradient(160deg, #0d2a1d, #061510); border: 2px solid #1d5c40; border-radius: 6px 22px 22px 22px; box-shadow: 0 0 30px rgba(47, 191, 113, .08) inset; }
.code-box h3 { color: #6df0a8; font-family: 'Cinzel', serif; }
.code-box li::marker { color: #3ddc84; }

.whispers { display: grid; gap: 14px; margin-top: 14px; }
.whisper { padding: 16px 20px; background: rgba(0, 0, 0, .35); border: 1px solid #1d5c40; border-left: 4px solid #3ddc84; border-radius: 6px 18px 18px 6px; }
.whisper header { display: flex; justify-content: space-between; gap: 10px; color: #86b9a0; font-size: .85rem; }
.whisper h3 { margin: 6px 0; font-family: 'Cinzel', serif; }
body.serpent .byline { color: #86b9a0; }
body.serpent .avatar { border-color: #2fbf71; background: #0f3a28; color: #6df0a8; box-shadow: 0 0 0 2px #04130c; }
@media (max-width: 760px) { .serp-hero { flex-direction: column-reverse; text-align: center; padding: 26px 20px; } .serpent-art { width: 150px; height: auto; } }
@media (prefers-reduced-motion: reduce) { .serpent-art { animation: none !important; } }

.row-actions { grid-column: 1 / -1; }

/* =====================================================================
   REDESIGN: sidebar layout, bookshelf lessons, passport profile, envelope sign-in
===================================================================== */
.nav-ico { display: none; }
.cozy-deco, .landing-deco { display: none !important; }

@media (min-width: 900px) {
  body.has-side { padding-left: 256px; }
  body.has-side .top {
    position: fixed; left: 0; top: 0; bottom: 0; width: 256px; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 16px;
    padding: 24px 14px 18px; overflow-y: auto; border-bottom: none; border-right: 2px solid #f4c3da; box-shadow: 10px 0 28px rgba(217, 103, 155, .12);
    background:
      radial-gradient(circle at 8px 8px, rgba(247, 154, 196, .2) 0 3px, transparent 4px) 0 0 / 26px 26px,
      linear-gradient(180deg, #fff3f9, #ffe0ee);
  }
  body.has-side .top::after { display: none; }
  body.has-side .brand { margin-right: 0; flex-direction: column; text-align: center; gap: 6px; padding-bottom: 14px; border-bottom: 2px dashed #f4c3da; }
  body.has-side .brand-moon { font-size: 2.3rem; }
  body.has-side #nav { flex-direction: column; flex-wrap: nowrap; margin-right: 0; gap: 4px; }
  body.has-side #nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 16px; font-size: .98rem; }
  body.has-side #nav a:hover { transform: translateX(3px); }
  body.has-side .nav-ico { display: inline-block; width: 1.7rem; text-align: center; font-size: 1.2rem; }
  body.has-side #userMenu { margin-top: auto; }
  body.has-side .menu summary { width: 100%; }
  body.has-side .menu-pop { top: auto; bottom: calc(100% + 8px); left: 0; right: 0; min-width: 0; }
  body.has-side main { padding-top: 34px; }
  body.serpent.has-side .top { border-right-color: #1d5c40; box-shadow: 10px 0 30px rgba(0, 0, 0, .5);
    background: radial-gradient(circle at 8px 8px, rgba(61, 220, 132, .08) 0 3px, transparent 4px) 0 0 / 26px 26px, linear-gradient(180deg, #06180f, #020a06); }
  body.serpent.has-side .brand { border-bottom-color: #1d5c40; }
}

/* ----- Lessons: bookshelf ----- */
.filter-panel { background: rgba(255, 255, 255, .65); border: 2px solid #f4c3da; border-radius: 22px; padding: 14px 16px; margin: 6px 0 24px; display: grid; gap: 10px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-f { font: inherit; font-weight: 700; font-size: .88rem; cursor: pointer; border: 2px solid #f4c3da; background: #fff; color: var(--ink); padding: 5px 14px; border-radius: 999px; transition: background .15s, transform .15s; }
.chip-f:hover { background: var(--lav-soft); transform: translateY(-1px); }
.chip-f.on { background: linear-gradient(135deg, #e0679d, #a98be0); color: #fff; border-color: transparent; box-shadow: 0 3px 0 rgba(154, 90, 124, .25); }
.teacher-pick { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.teacher-pick select { width: auto; min-width: 190px; padding: 5px 12px; }
.shelf { margin: 0 0 28px; }
.shelf h2 { display: flex; align-items: center; gap: 10px; font-size: 1.4rem; margin: 0 0 12px; padding-bottom: 6px; border-bottom: 4px solid var(--sc); }
.shelf h2 small { margin-left: auto; font-family: 'Nunito', sans-serif; font-size: .8rem; font-weight: 600; color: var(--muted); }
.spines { display: grid; gap: 8px; }
.spine { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); background: #fff; border: 2px solid #f4c3da; border-left: 14px solid var(--sc); border-radius: 4px 16px 16px 4px; padding: 10px 16px 10px 12px; box-shadow: var(--glow); transition: transform .15s; }
.spine:hover { transform: translateX(6px); }
.spine-year { width: 42px; height: 42px; border-radius: 50%; background: var(--sc); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex: none; text-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.spine-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.spine-main small { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.spine-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* ----- Profile: passport ----- */
.passport { background: #fffdfb; border: 3px solid #c2578a; border-radius: 22px; overflow: hidden; box-shadow: var(--glow); }
.pp-cover { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 24px; background: linear-gradient(135deg, #8c3f67, #c2578a); color: #ffe9f3; font-family: 'Lora', serif; }
.pp-cover b { letter-spacing: .25em; font-size: .78rem; color: #f6d58a; }
.pp-body { display: grid; grid-template-columns: 220px 1fr; gap: 20px 28px; padding: 24px; background-image: repeating-linear-gradient(transparent 0 31px, rgba(244, 166, 198, .14) 31px 32px); }
.pp-photo { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.pp-about, .pp-save { grid-column: 1 / -1; }
.pp-house { display: flex; align-items: center; gap: 14px; border: 2px dashed #e7a0bd; border-radius: 14px; padding: 8px 14px; background: rgba(255, 255, 255, .75); }
.pp-banner { flex: none; }
.pp-save { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pp-save p { margin: 0; }
.fold { margin-top: 16px; background: #fff; border: 2px solid #f4c3da; border-radius: 18px; box-shadow: var(--glow); }
.fold summary { padding: 14px 20px; font-family: 'Lora', serif; font-size: 1.15rem; font-weight: 700; color: #6b3558; }
.fold-body { padding: 0 20px 18px; }
@media (max-width: 700px) { .pp-body { grid-template-columns: 1fr; padding: 18px; } }

/* ----- Sign-in: wax-seal envelope ----- */
.auth-bunting { position: fixed; left: 0; right: 0; top: 0; height: 34px; background: var(--bunting) repeat-x; background-size: auto 34px; z-index: 2; pointer-events: none; }
.auth-wrap { padding-top: 44px; }
.letter { position: relative; padding-top: 36px; overflow: visible; border: 3px solid #f4a6c6; background: linear-gradient(180deg, #fffaf0, #fff3e4); animation: letterOpen .7s 1.1s ease both; transform-origin: top center; }
.letter-flap { position: absolute; left: -3px; right: -3px; top: -3px; height: 118px; background: linear-gradient(160deg, #ffc9df, #f79ac4); clip-path: polygon(0 0, 100% 0, 50% 100%); border-radius: 26px 26px 0 0; }
.seal { position: absolute; top: 64px; left: 50%; transform: translateX(-50%); filter: drop-shadow(0 6px 6px rgba(120, 30, 70, .35)); }

/* fixes */
.linkbtn { color: var(--pink-deep); }
.fold summary { justify-content: flex-start; gap: 4px; }

/* Serpents Hour: board, pictures, code names */
.notices { display: grid; gap: 14px; margin-top: 14px; }
.notice { padding: 16px 20px; background: linear-gradient(135deg, rgba(47,191,113,.14), rgba(0,0,0,.4)); border: 1px solid #2a7a55; border-radius: 6px 18px 18px 18px; }
.notice header { display: flex; align-items: center; gap: 10px; }
.notice header h3 { margin: 0; flex: 1; font-family: 'Cinzel', serif; color: #eafff2; }
.notice .when { color: #86b9a0; font-size: .85rem; }
.post-pics { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 8px; }
.post-pics img { width: 150px; height: 150px; object-fit: cover; border-radius: 12px; border: 1px solid #2a7a55; display: block; }
.chip { border-left: 4px solid var(--cc, #2fbf71); }
.chip .dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: var(--cc, #2fbf71); margin-right: 8px; box-shadow: 0 0 8px var(--cc, #2fbf71); }
.code-name { font-family: 'Caveat', 'Snell Roundhand', 'Apple Chancery', 'Segoe Script', 'Lucida Handwriting', 'Brush Script MT', cursive; font-size: 1.25rem; color: var(--cc, #7ff0b0); line-height: 1; }
body.serpent #editor input[type=file] { color: inherit; }
dialog input[type=color] { width: 64px; height: 38px; padding: 2px; border-radius: 10px; cursor: pointer; }

/* Sign-in: opens like a Hogwarts letter */
.letter-flap { transform-origin: top center; animation: flapOpen .8s .5s ease-in forwards; z-index: 3; }
.seal { z-index: 4; animation: sealCrack .5s .3s ease-in forwards; }
.letter-body { animation: inkIn .7s 1.5s ease both; }
.letter-dear { font-family: 'Caveat', 'Snell Roundhand', 'Apple Chancery', 'Segoe Script', 'Lucida Handwriting', 'Brush Script MT', cursive; font-size: 1.6rem; margin: 10px 0 0; color: var(--plum); }
.letter .eyebrow { font-family: 'Cinzel', serif; letter-spacing: .08em; }
@keyframes flapOpen { 0% { transform: rotateX(0); opacity: 1; } 60% { opacity: 1; } 100% { transform: rotateX(180deg); opacity: 0; } }
@keyframes sealCrack { 0% { transform: translateX(-50%) scale(1); opacity: 1; } 100% { transform: translateX(-50%) scale(1.5) rotate(18deg); opacity: 0; } }
@keyframes letterOpen { 0% { padding-top: 150px; } 100% { padding-top: 36px; } }
@keyframes inkIn { 0% { opacity: 0; transform: translateY(24px); } 100% { opacity: 1; transform: none; } }
.letter { min-height: 0; }
.letter.signing .letter-body { opacity: 0; transition: opacity .5s; pointer-events: none; height: 0; overflow: hidden; }
.signoff { text-align: center; padding: 40px 0 30px; }
.signoff .yours { font-family: 'Caveat', 'Snell Roundhand', 'Apple Chancery', 'Segoe Script', 'Lucida Handwriting', 'Brush Script MT', cursive; font-size: 1.7rem; color: var(--plum); margin: 0; opacity: 0; animation: inkIn .6s .5s forwards; }
.signoff .sig { font-family: 'Caveat', 'Snell Roundhand', 'Apple Chancery', 'Segoe Script', 'Lucida Handwriting', 'Brush Script MT', cursive; font-weight: 700; font-size: 3.2rem; color: #6b2d5c; margin: 6px auto 12px; width: 0; max-width: 100%; overflow: hidden; white-space: nowrap; animation: signWrite 1.2s 1s steps(18, end) forwards; }
.signoff .managed { font-family: 'Cinzel', serif; letter-spacing: .12em; color: var(--pink-deep); margin: 0; opacity: 0; animation: inkIn .6s 2.1s forwards; }
@keyframes signWrite { to { width: 100%; } }
.letter.flyaway { animation: flyAway .8s ease-in forwards; }
@keyframes flyAway { to { transform: translateY(-120vh) rotate(-8deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .letter, .letter-flap, .seal, .letter-body { animation: none; } .letter-flap, .seal { display: none; } }

/* ===== Sign-in v3: real envelope, red wax seal, then the letter expands ===== */
.auth-wrap { display: grid; justify-items: center; align-items: start; padding-top: 44px; }
.auth-wrap > * { grid-area: 1 / 1; }
.envelope { position: relative; width: min(440px, 88vw); height: min(290px, 58vw); margin-top: 140px; perspective: 900px; filter: drop-shadow(0 14px 18px rgba(120, 40, 70, .3)); animation: envExit .5s 1.7s ease-in forwards; pointer-events: none; }
.env-back { position: absolute; inset: 0; background: #ecd9b4; border-radius: 6px; }
.env-paper { position: absolute; left: 6%; right: 6%; top: 8%; height: 86%; background: #fffaf0; border-radius: 4px; animation: paperUp .6s 1.15s ease-out forwards; }
.env-front { position: absolute; inset: 0; background: #f4e6c8; }
.env-front.l { clip-path: polygon(0 0, 52% 56%, 0 100%); background: #f1e1bf; }
.env-front.r { clip-path: polygon(100% 0, 48% 56%, 100% 100%); background: #efdfbb; }
.env-front.b { clip-path: polygon(0 100%, 50% 44%, 100% 100%); background: #f7ebd0; border-radius: 0 0 6px 6px; }
.env-flap { position: absolute; left: 0; right: 0; top: 0; height: 58%; background: linear-gradient(170deg, #f7ebd0, #e7d3ab); clip-path: polygon(0 0, 100% 0, 50% 100%); transform-origin: top center; z-index: 5; animation: flapOpen2 .6s .65s ease-in forwards; }
.env-address { position: absolute; left: 0; right: 0; bottom: 14%; text-align: center; font-family: 'Caveat', 'Snell Roundhand', 'Apple Chancery', 'Segoe Script', 'Lucida Handwriting', 'Brush Script MT', cursive; font-size: 1.6rem; line-height: 1.05; color: #1f6b46; z-index: 4; }
.env-address small { font-size: 1.15rem; }
.env-seal { position: absolute; left: 50%; top: 56%; transform: translate(-50%, -50%); z-index: 6; filter: drop-shadow(0 4px 4px rgba(60, 0, 0, .45)); animation: waxCrack .35s .5s ease-in forwards; }
.letter { animation: letterExpand .7s 1.7s cubic-bezier(.2, .8, .3, 1) both; padding-top: 36px; }
@keyframes flapOpen2 { 0% { transform: rotateX(0); z-index: 5; } 49% { z-index: 5; } 50% { z-index: 0; } 100% { transform: rotateX(180deg); z-index: 0; opacity: .85; } }
@keyframes waxCrack { to { transform: translate(-50%, -50%) scale(1.35) rotate(12deg); opacity: 0; } }
@keyframes paperUp { to { transform: translateY(-34%); } }
@keyframes envExit { to { transform: translateY(40px) scale(.92); opacity: 0; visibility: hidden; } }
@keyframes letterExpand { 0% { opacity: 0; transform: translateY(70px) scale(.5); } 100% { opacity: 1; transform: none; } }
.letter .letter-body { animation: none; }
@media (prefers-reduced-motion: reduce) { .envelope { display: none; } .letter { animation: none; } }

/* ===== Click the seal first ===== */
.envelope, .env-paper, .env-flap, .env-seal { animation: none; }
.envelope { pointer-events: none; }
.env-seal { border: 0; background: none; padding: 0; cursor: pointer; pointer-events: auto; animation: sealPulse 1.8s ease-in-out infinite; }
.env-seal:hover { transform: translate(-50%, -50%) scale(1.08); }
.env-seal:focus-visible { outline: 3px solid #e8b84a; outline-offset: 4px; border-radius: 50%; }
.env-hint { position: absolute; left: 0; right: 0; bottom: -46px; text-align: center; margin: 0; font-family: 'Caveat', 'Snell Roundhand', 'Apple Chancery', 'Segoe Script', 'Lucida Handwriting', 'Brush Script MT', cursive; font-size: 1.5rem; color: var(--plum); animation: hintBob 1.8s ease-in-out infinite; }
.letter { animation: none; opacity: 0; visibility: hidden; pointer-events: none; }
@keyframes sealPulse { 0%, 100% { filter: drop-shadow(0 4px 4px rgba(60,0,0,.45)) drop-shadow(0 0 0 rgba(232,184,74,0)); } 50% { filter: drop-shadow(0 4px 4px rgba(60,0,0,.45)) drop-shadow(0 0 14px rgba(232,184,74,.95)); } }
@keyframes hintBob { 0%, 100% { transform: translateY(0); opacity: .75; } 50% { transform: translateY(4px); opacity: 1; } }
@keyframes letterExpand2 { 0% { opacity: 0; visibility: visible; transform: translateY(70px) scale(.5); } 100% { opacity: 1; visibility: visible; transform: none; } }
.auth-wrap.opening .env-seal { animation: waxCrack .35s ease-in forwards; pointer-events: none; }
.auth-wrap.opening .env-hint { opacity: 0; animation: none; }
.auth-wrap.opening .env-flap { animation: flapOpen2 .6s .15s ease-in forwards; }
.auth-wrap.opening .env-paper { animation: paperUp .6s .65s ease-out forwards; }
.auth-wrap.opening .envelope { animation: envExit .5s 1.25s ease-in forwards; }
.auth-wrap.opening .letter { animation: letterExpand2 .7s 1.25s cubic-bezier(.2, .8, .3, 1) both; pointer-events: auto; }
.auth-wrap.opening .letter.flyaway { animation: flyAway .8s ease-in forwards; }
.auth-wrap.opened .envelope { display: none; }
.auth-wrap.opened .letter { animation: none; opacity: 1; visibility: visible; pointer-events: auto; }
.auth-wrap.opened .letter.flyaway { animation: flyAway .8s ease-in forwards; }
@media (prefers-reduced-motion: reduce) { .env-seal, .env-hint { animation: none; } }

/* Landing quote */
.wiz-quote { font-family: 'Caveat', 'Snell Roundhand', 'Apple Chancery', 'Segoe Script', 'Lucida Handwriting', 'Brush Script MT', cursive; font-size: 1.55rem; line-height: 1.25; color: var(--plum); margin: 4px 0 14px; max-width: 560px; min-height: 2.5em; opacity: 0; transition: opacity .5s; }
.wiz-quote.in { opacity: 1; }
.wiz-quote::before { content: '✦ '; color: var(--pink-deep); }

/* House pennants across the top of every page (desktop sidebar layout) */
@media (min-width: 900px) {
  body.has-side::before { content: ''; position: fixed; left: 0; right: 0; top: 0; height: 24px; background: var(--bunting) repeat-x; background-size: auto 24px; z-index: 60; pointer-events: none; filter: drop-shadow(0 2px 2px rgba(120, 40, 70, .2)); }
  body.has-side .top { top: 24px; height: calc(100vh - 24px); }
}

/* ===== Owl Post ===== */
#owl { position: relative; }
.owl summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 8px 14px; border: 2px solid var(--line); border-radius: 999px; background: #fff; font-weight: 700; }
.owl summary::-webkit-details-marker { display: none; }
.owl summary:hover { background: var(--lav-soft); }
.owl-badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: #c8264d; color: #fff; font-size: .78rem; display: inline-flex; align-items: center; justify-content: center; animation: owlPing 1.6s ease-in-out infinite; }
.owl-badge[hidden] { display: none; }
@keyframes owlPing { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
.owl-pop { position: absolute; right: 0; top: calc(100% + 8px); width: min(340px, 90vw); max-height: 70vh; overflow-y: auto; background: #fff; border: 2px solid var(--pink); border-radius: 16px; box-shadow: var(--shadow); z-index: 40; }
.owl-head { display: flex; flex-direction: column; padding: 12px 16px 8px; border-bottom: 1px dashed #f4c3da; }
.owl-head small { color: var(--muted); }
.owl-item { display: flex; gap: 10px; padding: 10px 16px; text-decoration: none; color: var(--ink); border-bottom: 1px solid #fbe3ee; }
.owl-item:hover { background: var(--lav-soft); }
.owl-item.new { background: #fff4d6; }
.owl-ico { font-size: 1.3rem; }
.owl-text { display: flex; flex-direction: column; font-weight: 600; font-size: .92rem; }
.owl-text small { color: var(--muted); font-weight: 400; }
.owl-empty { padding: 18px; text-align: center; color: var(--muted); margin: 0; }
@media (min-width: 900px) {
  body.has-side #owl { margin-top: auto; }
  body.has-side #owl + #userMenu { margin-top: 0; }
  body.has-side .owl summary { width: 100%; }
  body.has-side .owl-pop { position: absolute; left: 0; right: 0; width: auto; top: auto; bottom: calc(100% + 8px); max-height: 60vh; }
}
body.serpent .owl summary { background: #0c2419; border-color: #1d5c40; color: #d4f6e2; }
body.serpent .owl-pop { background: #0c2419; border-color: #2fbf71; color: #d4f6e2; }
body.serpent .owl-item { color: #d4f6e2; border-color: #123d2a; } body.serpent .owl-item:hover { background: #0f3a28; } body.serpent .owl-item.new { background: #123d2a; }
@media (min-width: 900px) { body.has-side #owl[hidden] + #userMenu { margin-top: auto; } }
.owl summary { justify-content: flex-start; } .owl summary::before, .owl summary::after { content: none !important; }

/* ===== Member page: character sheets + diary bulletin board ===== */
.plain-link { color: inherit; text-decoration: none; } .plain-link:hover { text-decoration: underline; }
.mp-head { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; padding: 6px 4px 18px; }
.mp-info { flex: 1; min-width: 220px; } .mp-info h1 { margin-bottom: 2px; }
.mp-about { max-width: 640px; white-space: pre-wrap; }
.mp-section { margin-top: 26px; }
.mp-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 3px solid var(--pink); margin-bottom: 14px; }
.mp-title h2 { margin: 0 0 6px; }
.sheets { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.sheet { display: flex; gap: 14px; padding: 14px; background: #fffdfb; border: 2px solid var(--line); border-radius: 6px 22px 22px 6px; border-left: 10px solid var(--pink-deep); box-shadow: var(--shadow); }
.sheet-pic { flex: 0 0 104px; height: 136px; border-radius: 10px; overflow: hidden; background: linear-gradient(135deg, #ffd1e3, #d9c8ff); display: grid; place-items: center; font: 700 2.4rem 'Lora', serif; color: #fff; border: 3px solid #fff; box-shadow: 0 3px 8px rgba(120, 60, 100, .25); }
.sheet-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sheet-main { flex: 1; min-width: 0; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; margin: 8px 0; }
.facts div { min-width: 0; } .facts dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); } .facts dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.sheet-line { margin: 6px 0; font-size: .92rem; }
.sheet-story summary { cursor: pointer; font-weight: 700; color: var(--pink-deep); }
.corkboard { position: relative; padding: 26px 22px 30px; border-radius: 18px; border: 10px solid #9a6b43; box-shadow: inset 0 0 40px rgba(60, 30, 10, .35), var(--shadow);
  background: radial-gradient(circle at 20% 30%, rgba(255,255,255,.07) 0 2px, transparent 3px) 0 0 / 22px 22px, radial-gradient(circle at 70% 60%, rgba(0,0,0,.08) 0 2px, transparent 3px) 0 0 / 17px 17px, #c8955f;
  display: grid; gap: 30px 26px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); align-items: start; }
.pin-card { --ink: #4a2f40; --muted: #8a6a80; position: relative; color: var(--ink); background: #fffbe9; padding: 26px 18px 16px; border-radius: 3px; box-shadow: 2px 6px 12px rgba(50, 25, 5, .35); transform: rotate(var(--tilt, 0deg)); transition: transform .2s; }
.pin-card:hover { transform: rotate(0) scale(1.02); z-index: 2; }
.pin-card:nth-child(3n+2) { background: #ffe6f0; } .pin-card:nth-child(3n) { background: #e9f1ff; }
.pin { position: absolute; top: -9px; left: 50%; width: 20px; height: 20px; margin-left: -10px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff9, transparent 45%), var(--pin, #d9467d); box-shadow: 0 4px 5px rgba(0, 0, 0, .4); }
.pin-date { margin: 0; font-family: 'Caveat', 'Snell Roundhand', 'Apple Chancery', 'Segoe Script', 'Lucida Handwriting', 'Brush Script MT', cursive; font-size: 1.1rem; color: var(--muted); }
.pin-card h3 { font-family: 'Caveat', 'Snell Roundhand', 'Apple Chancery', 'Segoe Script', 'Lucida Handwriting', 'Brush Script MT', cursive; font-size: 1.7rem; margin: 0 0 4px; }
.pin-card .body { font-size: .95rem; overflow-wrap: anywhere; }
.polaroids { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.polaroid { background: #fff; padding: 6px 6px 18px; box-shadow: 0 3px 8px rgba(0, 0, 0, .3); transform: rotate(var(--r, 0deg)); transition: transform .15s; }
.polaroid:hover { transform: rotate(0) scale(1.06); }
.polaroid img { width: 104px; height: 104px; object-fit: cover; display: block; }
.cork-empty { grid-column: 1 / -1; text-align: center; font-family: 'Caveat', 'Snell Roundhand', 'Apple Chancery', 'Segoe Script', 'Lucida Handwriting', 'Brush Script MT', cursive; font-size: 1.5rem; color: #fff7e6; margin: 10px 0; }
.fold-link { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 16px; padding: 14px 20px; background: #fff; border: 2px solid #f4c3da; border-radius: 18px; }

/* search boxes */
.search-box { width: 100%; padding: 10px 16px; border-radius: 999px; margin-bottom: 12px; }

/* Serpents Hour door */
.serp-lock { max-width: 460px; margin: 6vh auto; text-align: center; padding: 28px 26px; background: rgba(0, 0, 0, .4); border: 1px solid #1d5c40; border-radius: 22px; }
.serp-lock .serpent-art { height: 180px; width: auto; }
.serp-lock h1 { color: #eafff2; font-family: 'Cinzel', serif; }
.gate-q { font-family: 'Cinzel', serif; font-size: 1.15rem; color: #bff0d3; }
.serp-lock input { text-align: center; margin-bottom: 8px; }

/* ===== Night theme (body.tn) ===== */
body.tn:not(.serpent) { --bg:#15102e;--bg2:#2a1f55;--card:#241c4c;--ink:#f0e8ff;--muted:#b7aadf;--pink:#c0689a;--pink-deep:#ff9ec9;--lav:#6d5cb0;--lav-soft:#32295f;--gold:#e3c06a;--line:#4b3d84;--shadow:0 6px 20px rgba(0,0,20,.4);--glow:0 4px 16px rgba(0,0,20,.4); color: var(--ink); }
body.tn:not(.serpent) .menu summary,
body.tn:not(.serpent) .menu-pop,
body.tn:not(.serpent) .btn.ghost:hover,
body.tn:not(.serpent) .btn.danger,
body.tn:not(.serpent) .tab,
body.tn:not(.serpent) .paper,
body.tn:not(.serpent) .note,
body.tn:not(.serpent) .lcard,
body.tn:not(.serpent) input,
body.tn:not(.serpent) textarea,
body.tn:not(.serpent) select,
body.tn:not(.serpent) dialog,
body.tn:not(.serpent) .chip-f,
body.tn:not(.serpent) .spine,
body.tn:not(.serpent) .passport,
body.tn:not(.serpent) .fold,
body.tn:not(.serpent) .owl summary,
body.tn:not(.serpent) .owl-pop,
body.tn:not(.serpent) .ribbon-row,
body.tn:not(.serpent) .filter-panel,
body.tn:not(.serpent) .card,
body.tn:not(.serpent) .sheet,
body.tn:not(.serpent) .fold-link,
body.tn:not(.serpent) .spoiler,
body.tn:not(.serpent) .env-paper { background: #241c4c; color: var(--ink); border-color: #4b3d84; }
body.tn:not(.serpent) .owl-item,
body.tn:not(.serpent) .owl-head { color: var(--ink); border-color: #3b3070; }
body.tn:not(.serpent) .owl-item:hover,
body.tn:not(.serpent) .menu-pop a:hover,
body.tn:not(.serpent) .linklike:hover,
body.tn:not(.serpent) .owl summary:hover,
body.tn:not(.serpent) .chip-f:hover { background: #32295f; }
body.tn:not(.serpent) .owl-item.new { background: #4a3a1e; }
body.tn:not(.serpent) input::placeholder,
body.tn:not(.serpent) textarea::placeholder { color: #8c80bd; }
body.tn:not(.serpent) .chip-f.on { background: linear-gradient(135deg, #e0679d, #a98be0); color: #fff; border-color: transparent; }
body.tn:not(.serpent) .btn.ghost { background: transparent; color: var(--ink); border-color: #6d5cb0; }
body.tn:not(.serpent) .top { background: linear-gradient(180deg, #1d1642, #2a1f55); border-color: #4b3d84; color: var(--ink); }
body.tn:not(.serpent) .brand,
body.tn:not(.serpent) #nav a,
body.tn:not(.serpent) .menu-name,
body.tn:not(.serpent) .menu-pop a,
body.tn:not(.serpent) .linklike { color: var(--ink); }
body.tn:not(.serpent) .brand strong,
body.tn:not(.serpent) .brand-moon,
body.tn:not(.serpent) .eyebrow,
body.tn:not(.serpent) .brand small { color: #e9defc; }
body.tn:not(.serpent) h1,
body.tn:not(.serpent) h2,
body.tn:not(.serpent) h3,
body.tn:not(.serpent) .section-title { color: #fff; }
body.tn:not(.serpent) .accent { color: #ff9ec9; }
body.tn:not(.serpent) .greet-text h1 { color: #fff; }
body.tn:not(.serpent) .wiz-quote,
body.tn:not(.serpent) .pin-date { color: #d9ccff; }
body.tn:not(.serpent) .pin-card .pin-date { color: #8a6a80; }
body.tn:not(.serpent) .sticky,
body.tn:not(.serpent) .pin-card,
body.tn:not(.serpent) .pill,
body.tn:not(.serpent) .sheet-pic,
body.tn:not(.serpent) .note .pill { --ink: #4a2f40; --muted: #8a6a80; color: #4a2f40; }
body.tn:not(.serpent) .sticky h3,
body.tn:not(.serpent) .sticky p,
body.tn:not(.serpent) .pin-card h3,
body.tn:not(.serpent) .pin-card .body,
body.tn:not(.serpent) .pin-card .body * { color: #4a2f40; }
body.tn:not(.serpent) .pill.owner-tag { color: #4a2f40; }
body.tn:not(.serpent) a { color: #ffb3d6; }
body.tn:not(.serpent) .btn,
body.tn:not(.serpent) .btn * { color: #fff; }
body.tn:not(.serpent) .btn.danger { color: #ff9eb9; border-color: #8a3a5c; }
body.tn:not(.serpent) code { background: #32295f; color: #ffd6ea; }
body.tn:not(.serpent) .spine-main small,
body.tn:not(.serpent) .ribbon-row small { color: #b7aadf; }
body.tn:not(.serpent) .crumbs,
body.tn:not(.serpent) .crumbs a { color: #b7aadf; }
body.tn:not(.serpent) .empty,
body.tn:not(.serpent) .quiet { color: #b7aadf; }
body.tn:not(.serpent) .stars i { color: #fff3c4; opacity: .5; }
body.tn:not(.serpent) .foot { color: #9d90d2; }
body.tn:not(.serpent) .sheet-story summary,
body.tn:not(.serpent) .small a { color: #ffb3d6; }
body.tn:not(.serpent) .facts dd,
body.tn:not(.serpent) .sheet h3 { color: var(--ink); }
body.tn:not(.serpent) blockquote.say { background: #2f2560; color: var(--ink); }
body.tn:not(.serpent) .sticky-board a,
body.tn:not(.serpent) .sticky a { color: #4a2f40; }
body.tn:not(.serpent) .mp-title { border-color: #c0689a; }
body.tn:not(.serpent) .menu-head { color: var(--ink); }
body.tn:not(.serpent) .spine-year { color: #fff; }
body.tn .poster { color: inherit; }
.sheet-story summary { justify-content: flex-start; } .sheet-story summary::before, .sheet-story summary::after { content: none !important; }
body.tn:not(.serpent) { background: linear-gradient(180deg, #15102e 0%, #231a4a 60%, #2f2360 100%) fixed; }
body.tn:not(.serpent) .lesson-cards { background: rgba(36, 28, 76, .6); border-color: #4b3d84; }
body.tn:not(.serpent) .page-head h1 { background: linear-gradient(transparent 72%, rgba(192, 104, 154, .5) 72%); }
body.tn:not(.serpent) .top { box-shadow: 6px 0 18px rgba(0, 0, 20, .4); }
body.tn:not(.serpent) .pill:not(.owner-tag) { box-shadow: none; }
body.tn:not(.serpent) .pill:not([class*="house-"]):not(.gold):not(.owner-tag):not([class*="st-"]) { background: #e4d8ff; }
body.tn:not(.serpent) .sticky-serpent, body.tn:not(.serpent) .sticky-serpent h3, body.tn:not(.serpent) .sticky-serpent p { color: #d4f6e2; }
body.tn:not(.serpent) .sticky-serpent .sticky-count { color: #06210f; }
body.tn:not(.serpent) .pp-house { background: #2f2560; border-color: #c0689a; color: var(--ink); }
body.tn:not(.serpent) .pp-house .muted, body.tn:not(.serpent) .pp-house .lbl { color: #c9bdf0; }
body.tn:not(.serpent) .pp-body { background: transparent; }
body.tn:not(.serpent) .fold summary, body.tn:not(.serpent) .fold summary * { color: #fff; }
body.tn:not(.serpent) .passport { background-image: none; }

/* ===== Floating candles, like the Great Hall ===== */
.candles { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.fc { position: absolute; width: calc(14px * var(--s)); height: calc(58px * var(--s)); opacity: var(--o); filter: blur(var(--b)); animation: fcFloat var(--d) ease-in-out var(--dl) infinite; }
.fc .wax2 { position: absolute; left: 0; right: 0; bottom: 0; top: 30%; border-radius: 40% 40% 30% 30% / 8% 8% 4% 4%; background: linear-gradient(90deg, #efd9c0 0%, #fff8ea 40%, #f3dcc2 100%); box-shadow: inset 0 -5px 7px rgba(190, 140, 110, .25); }
.fc .wick { position: absolute; left: 50%; top: 22%; width: 2px; height: 9%; margin-left: -1px; background: #6a4a3a; border-radius: 1px; }
.fc .flame { position: absolute; left: 50%; top: 0; width: 70%; height: 30%; margin-left: -35%; border-radius: 50% 50% 50% 50% / 65% 65% 35% 35%; background: radial-gradient(ellipse at 50% 70%, #fffbe0 0%, #ffd77a 45%, rgba(255, 170, 60, .0) 75%); box-shadow: 0 0 calc(18px * var(--s)) calc(6px * var(--s)) rgba(255, 175, 70, .6); animation: fcFlick 1.3s ease-in-out infinite alternate; transform-origin: 50% 100%; }
@keyframes fcFloat { 0%, 100% { transform: translate(0, 0) rotate(-1.5deg); } 33% { transform: translate(7px, -12px) rotate(1deg); } 66% { transform: translate(-6px, -5px) rotate(-.5deg); } }
@keyframes fcFlick { 0% { transform: scale(1, 1); opacity: .9; } 100% { transform: scale(.9, 1.12) translateX(1px); opacity: 1; } }
body.serpent .candles { display: none; }
body.tn .fc { opacity: calc(var(--o) + .15); }
body.tn .fc .flame { box-shadow: 0 0 calc(26px * var(--s)) calc(9px * var(--s)) rgba(255, 205, 110, .6); }
@media (max-width: 700px) { .fc:nth-child(even) { display: none; } }
@media (prefers-reduced-motion: reduce) { .fc, .fc .flame { animation: none; } }
body.tn .fc .flame { box-shadow: 0 0 calc(26px * var(--s)) calc(9px * var(--s)) rgba(255, 190, 90, .65); }

/* ===== Diary: small previews on the board, open like a book ===== */
a.pin-card { display: block; text-decoration: none; max-height: 330px; overflow: hidden; cursor: pointer; }
.pin-card h3 { overflow-wrap: anywhere; }
.pin-excerpt { margin: 6px 0 8px; font-size: .92rem; line-height: 1.45; color: var(--ink); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.pin-thumb { position: relative; display: block; width: 100%; height: 96px; margin-top: 6px; overflow: hidden; background: #fff; padding: 5px; box-shadow: 0 2px 6px rgba(0,0,0,.25); transform: rotate(-1.2deg); }
.pin-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pin-thumb em { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.6); color: #fff; font-style: normal; font-size: .75rem; padding: 1px 8px; border-radius: 999px; }
.pin-open { display: block; margin-top: 4px; font-family: 'Caveat', 'Snell Roundhand', 'Apple Chancery', 'Segoe Script', 'Lucida Handwriting', 'Brush Script MT', cursive; font-size: 1.2rem; color: #b04676; }
.book { position: relative; max-width: 980px; margin: 8px auto 0; padding: 30px clamp(18px, 5vw, 56px) 22px; background: linear-gradient(90deg, #f6ead2 0%, #fffaf0 6%, #fffdf6 48%, #efe0c4 50%, #fffdf6 52%, #fffaf0 94%, #f6ead2 100%); border: 10px solid #7a3b4f; border-radius: 10px 22px 22px 10px; box-shadow: 0 14px 34px rgba(80, 30, 50, .35), inset 0 0 40px rgba(150, 100, 60, .18); color: #4a2f40; --ink: #4a2f40; --muted: #8a6a80; }
.book::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 34px; margin-left: -17px; background: linear-gradient(90deg, transparent, rgba(110, 70, 40, .16), transparent); pointer-events: none; }
.book-head { text-align: center; margin-bottom: 18px; }
.book-from { font-family: 'Caveat', 'Snell Roundhand', 'Apple Chancery', 'Segoe Script', 'Lucida Handwriting', 'Brush Script MT', cursive; font-size: 1.3rem; margin: 0; color: #8a6a80; }
.book-head h1 { color: #6b2d5c; margin: 0; overflow-wrap: anywhere; }
.book-date { font-family: 'Caveat', 'Snell Roundhand', 'Apple Chancery', 'Segoe Script', 'Lucida Handwriting', 'Brush Script MT', cursive; font-size: 1.25rem; margin: 2px 0 0; color: #8a6a80; }
.book-pages { background: repeating-linear-gradient(transparent 0 27px, rgba(150, 120, 180, .18) 27px 28px); }
.book-text { column-count: 2; column-gap: 64px; column-rule: 1px solid rgba(120, 80, 60, .12); font-family: 'Caveat', 'Snell Roundhand', 'Segoe Script', cursive; font-size: 1.32rem; line-height: 28px; overflow-wrap: anywhere; color: #3d2535; }
.book-text p { margin: 0 0 28px; } .book-text h2, .book-text h3 { font-family: 'Caveat', 'Snell Roundhand', 'Apple Chancery', 'Segoe Script', 'Lucida Handwriting', 'Brush Script MT', cursive; margin: 0 0 4px; }
@media (max-width: 760px) { .book-text { column-count: 1; } .book::before { display: none; } }
.book-pics { margin-top: 22px; justify-content: center; }
.book-pics .polaroid img { width: 150px; height: 150px; }
.book-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 22px; padding-top: 12px; border-top: 1px dashed rgba(120, 80, 60, .3); }
.book-tools { text-align: center; margin: 14px 0 0; }
body.tn:not(.serpent) .book { background: linear-gradient(90deg, #efe2c8 0%, #fff9ec 6%, #fffbf0 48%, #e8d8ba 50%, #fffbf0 52%, #fff9ec 94%, #efe2c8 100%); }
body.tn:not(.serpent) .book *:not(.btn):not(.btn *) { color: inherit; }
body.tn:not(.serpent) .book .book-text, body.tn:not(.serpent) .book .book-text * { color: #3d2535; }
body.tn:not(.serpent) .book .book-head h1 { color: #6b2d5c; }
body.tn:not(.serpent) .book .book-from, body.tn:not(.serpent) .book .book-date { color: #8a6a80; }
body.tn:not(.serpent) .book .btn.ghost { color: #4a2f40; border-color: #b9a0b0; }

/* diary header lives on the left-hand page */
.book-text .book-head { text-align: left; margin: 0 0 22px; break-inside: avoid; break-after: avoid; }
.book-text .book-head h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.2; }
.book-text .book-from, .book-text .book-date { line-height: 1.2; }

/* ===== Common rooms ===== */
.cr-hero { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 24px 28px; border-radius: 22px; color: var(--hb); background: radial-gradient(500px 220px at 85% 40%, rgba(255, 190, 90, .35), transparent 70%), linear-gradient(135deg, var(--ha), color-mix(in srgb, var(--ha) 72%, #000)); box-shadow: var(--shadow); margin-bottom: 14px; }
.cr-hero h1 { color: var(--hb); margin: 0; } .cr-hero .eyebrow { color: var(--hb); opacity: .8; } .cr-sub { margin: 4px 0 0; opacity: .9; }
.cr-crest { filter: drop-shadow(0 6px 10px rgba(0,0,0,.5)); }
.cr-tabs { margin-bottom: 10px; }
.cr-list { display: grid; gap: 14px; margin-bottom: 14px; }
.cr-post { padding: 14px 18px; background: #fffdfb; border: 2px solid var(--line); border-left: 8px solid var(--ha); border-radius: 6px 18px 18px 6px; box-shadow: var(--shadow); }
.cr-post.pinned { background: #fff7e0; border-left-color: var(--hb); }
.cr-post header { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: .85rem; }
.post-pics { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0; } .post-pics img { width: 140px; height: 140px; object-fit: cover; border-radius: 12px; border: 2px solid var(--line); display: block; }

/* ===== Marauder's Map ===== */
.maraud { max-width: 980px; margin: 0 auto; }
.m-fold { text-align: center; padding: 70px 24px; background: linear-gradient(135deg, #e8d3a8, #f6e8c8 50%, #dcc18c); border: 3px solid #8b6a3e; border-radius: 6px; box-shadow: 0 10px 28px rgba(80, 50, 20, .4), inset 0 0 50px rgba(120, 80, 30, .35); }
.m-swear { font-family: 'Caveat', 'Snell Roundhand', 'Apple Chancery', 'Segoe Script', 'Lucida Handwriting', 'Brush Script MT', cursive; font-size: clamp(1.6rem, 4vw, 2.4rem); color: #5a3b1c; margin: 0 0 22px; overflow: hidden; white-space: nowrap; width: 0; max-width: 100%; margin-inline: auto; animation: signWrite 3s steps(40, end) .3s forwards; }
.m-map { padding: 20px; background: linear-gradient(135deg, #e8d3a8, #f6e8c8 50%, #dcc18c); border: 3px solid #8b6a3e; border-radius: 6px; box-shadow: 0 10px 28px rgba(80, 50, 20, .4), inset 0 0 60px rgba(120, 80, 30, .35); text-align: center; animation: inkIn .8s both; }
.m-title { font-family: 'Caveat', 'Snell Roundhand', 'Apple Chancery', 'Segoe Script', 'Lucida Handwriting', 'Brush Script MT', cursive; font-size: 2.6rem; color: #4a2f16; margin: 0 0 10px; }
.m-board { position: relative; height: 520px; margin: 0 auto 14px; background: repeating-linear-gradient(45deg, transparent 0 18px, rgba(120, 80, 30, .05) 18px 19px); border: 2px dashed rgba(90, 60, 30, .5); border-radius: 8px; }
.m-room { position: absolute; transform: translate(-50%, -50%); min-width: 120px; padding: 8px 10px; text-align: center; border: 2px solid rgba(90, 60, 30, .55); border-radius: 10px 4px 12px 4px; background: rgba(255, 245, 220, .45); }
.m-room.busy { background: rgba(255, 224, 150, .7); box-shadow: 0 0 14px rgba(150, 100, 30, .5); }
.m-name { display: block; font-family: 'Caveat', 'Snell Roundhand', 'Apple Chancery', 'Segoe Script', 'Lucida Handwriting', 'Brush Script MT', cursive; font-size: 1.15rem; color: #5a3b1c; line-height: 1.1; }
.m-foot { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 4px; animation: tread 2.2s ease-in-out infinite; animation-delay: calc(var(--i) * .4s); }
.m-foot b { font-family: 'Caveat', 'Snell Roundhand', 'Apple Chancery', 'Segoe Script', 'Lucida Handwriting', 'Brush Script MT', cursive; font-size: 1.15rem; color: #2f1d0c; }
.m-foot .steps { display: inline-block; transform: rotate(-20deg); filter: sepia(1) saturate(2) brightness(.45); }
@keyframes tread { 0%, 100% { transform: translateX(-3px); } 50% { transform: translateX(3px); } }
.m-empty { position: absolute; left: 0; right: 0; bottom: 8px; margin: 0; font-family: 'Caveat', 'Snell Roundhand', 'Apple Chancery', 'Segoe Script', 'Lucida Handwriting', 'Brush Script MT', cursive; font-size: 1.3rem; color: #6b4a28; }
@media (max-width: 760px) { .m-board { height: 640px; } .m-room { min-width: 90px; padding: 4px 6px; } .m-name { font-size: .95rem; } }

/* ===== Bonds ===== */
.bond-wrap { margin: 8px 0 14px; padding: 8px; background: #fffdfb; border: 2px solid var(--line); border-radius: 18px; overflow: hidden; }
.bond-svg { width: 100%; height: auto; display: block; }
.bond-label { font: 700 13px 'Nunito', sans-serif; fill: #6b3558; paint-order: stroke; stroke: #fffdfb; stroke-width: 4px; }
.bond-init { font: 700 20px 'Lora', serif; fill: #fff; } .bond-name { font: 700 14px 'Nunito', sans-serif; fill: #4a2f40; paint-order: stroke; stroke: #fffdfb; stroke-width: 4px; }
.kdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.kpill { display: inline-block; padding: 1px 10px; border-radius: 999px; color: #fff; background: var(--k); font-size: .8rem; font-weight: 700; }
.bond-list { list-style: none; padding: 0; display: grid; gap: 8px; } .bond-list li { padding: 8px 14px; background: #fffdfb; border: 1px solid var(--line); border-radius: 12px; }

/* ===== Spell & potion books ===== */
.sb-tabs { display: flex; gap: 6px; margin: 4px 0 -2px; padding-left: 10px; }
.sb-tab { font: inherit; font-weight: 700; cursor: pointer; padding: 10px 22px; border: 2px solid #7a3b4f; border-bottom: none; border-radius: 14px 14px 0 0; background: #e9d3d9; color: #5a2a3c; }
.sb-tab.on { background: #7a3b4f; color: #fff; }
.sb-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.sb-page { background: linear-gradient(180deg, #fffdf6, #fbf1dc); border: 2px solid #d9c2a0; border-radius: 4px 16px 16px 4px; border-left: 10px solid #7a3b4f; box-shadow: var(--shadow); padding: 12px 16px; color: #4a2f40; --ink: #4a2f40; --muted: #8a6a80; }
.sb-page summary { list-style: none; cursor: pointer; display: grid; gap: 4px; justify-content: stretch; }
.sb-page summary::-webkit-details-marker { display: none; } .sb-page summary::before, .sb-page summary::after { content: none !important; }
.sb-name { font-family: 'Caveat', 'Snell Roundhand', 'Apple Chancery', 'Segoe Script', 'Lucida Handwriting', 'Brush Script MT', cursive; font-size: 1.8rem; line-height: 1; color: #6b2d5c; }
.sb-words { font-style: italic; font-family: 'Lora', serif; color: #8a4a6a; }
.sb-tags { display: flex; gap: 6px; flex-wrap: wrap; } .sb-effect { font-size: .92rem; }
.sb-more { margin-top: 10px; padding-top: 8px; border-top: 1px dashed #cdb48f; } .sb-more h4 { margin: 6px 0 2px; font-family: 'Caveat', 'Snell Roundhand', 'Apple Chancery', 'Segoe Script', 'Lucida Handwriting', 'Brush Script MT', cursive; font-size: 1.3rem; color: #7a3b4f; }

/* ===== Seasons ===== */
.season { position: fixed; inset: 0; pointer-events: none; z-index: 3; overflow: hidden; }
body.serpent .season { display: none; }
.flake { position: absolute; top: -20px; border-radius: 50%; background: radial-gradient(circle, #fff 30%, rgba(255,255,255,.4) 70%, transparent); opacity: .85; filter: blur(.4px); animation: snow linear infinite; }
@keyframes snow { 0% { transform: translate(0, -5vh); } 100% { transform: translate(var(--sway), 108vh); } }
.petal { position: absolute; top: -20px; width: 12px; height: 8px; border-radius: 80% 0 80% 0; background: linear-gradient(135deg, #ffc9dc, #ff9fc4); opacity: .8; animation: petal linear infinite; }
@keyframes petal { 0% { transform: translate(0, -5vh) rotate(0); } 100% { transform: translate(var(--sway), 108vh) rotate(540deg); } }
.bat { position: absolute; left: -60px; font-style: normal; filter: drop-shadow(0 0 6px rgba(255, 140, 0, .6)); animation: batfly linear infinite; }
@keyframes batfly { 0% { transform: translate(0, 0); } 25% { transform: translate(30vw, -30px); } 50% { transform: translate(60vw, 20px); } 75% { transform: translate(85vw, -20px); } 100% { transform: translate(115vw, 0); } }
body.s-halloween { box-shadow: inset 0 0 160px rgba(255, 120, 20, .22); }
body.s-winter::after { content: ''; position: fixed; left: 0; right: 0; top: 0; height: 90px; pointer-events: none; z-index: 2; background: linear-gradient(180deg, rgba(255, 255, 255, .55), transparent); }
@media (prefers-reduced-motion: reduce) { .flake, .petal, .bat, .m-foot { animation: none; } }

/* ===== Illuminated-manuscript skin (my own look) ===== */
:root { --paper: #fbf1de; --paper2: #f4e3c2; --wine: #7a2a45; --wine-deep: #55192f; --gold: #c9a24a; --ink: #3b2230; --muted: #7d5d70; --pink: #d98aa3; --pink-deep: #9a3a58; --line: #e0c9a8; }
body:not(.serpent) { font-family: 'EB Garamond', Georgia, serif; font-size: 1.12rem; line-height: 1.55; background: radial-gradient(1200px 700px at 20% 0%, #fde9c8, transparent 60%), radial-gradient(900px 600px at 100% 100%, #f2cdb0, transparent 60%), linear-gradient(180deg, #f4dcbb, #efcfb2) fixed; }
body:not(.serpent) h1,
body:not(.serpent) h2,
body:not(.serpent) h3,
body:not(.serpent) h4,
body:not(.serpent) .section-title { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 700; color: var(--wine-deep); letter-spacing: .01em; }
body:not(.serpent) h1 { font-size: clamp(2.1rem, 5vw, 3rem); }
body:not(.serpent) .page-head h1 { background: none; padding: 0; display: block; }
body:not(.serpent) .page-head h1::after { content: '❦'; display: block; font-size: 1.1rem; color: var(--gold); letter-spacing: .4em; margin-top: 2px; }
body:not(.serpent) .eyebrow,
body:not(.serpent) .brand small { font-family: 'Cormorant Garamond', serif; letter-spacing: .22em; font-weight: 600; }
body:not(.serpent) .btn,
body:not(.serpent) .btn.pinkgrad { font-family: 'Cormorant Garamond', serif; font-weight: 700; font-size: 1.05rem; letter-spacing: .05em; background: linear-gradient(180deg, #9d3d5c, #6c2340); color: #f7dfa0; border: 1px solid var(--gold); box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 3px 0 #45152b; text-shadow: 0 1px 0 rgba(0,0,0,.3); }
body:not(.serpent) .btn:hover { filter: brightness(1.1); }
body:not(.serpent) .btn.ghost { background: transparent; color: var(--wine); border: 1px solid var(--wine); box-shadow: none; text-shadow: none; }
body:not(.serpent) .btn.danger { background: transparent; color: #8c1f3a; border: 1px solid #8c1f3a; box-shadow: none; text-shadow: none; }
body:not(.serpent) .btn.tiny,
body:not(.serpent) .btn.small { letter-spacing: .03em; }
body:not(.serpent) .paper,
body:not(.serpent) .card,
body:not(.serpent) .lcard,
body:not(.serpent) .note,
body:not(.serpent) .sheet,
body:not(.serpent) .spine,
body:not(.serpent) .ribbon-row,
body:not(.serpent) .fold,
body:not(.serpent) .filter-panel,
body:not(.serpent) .fold-link,
body:not(.serpent) .cr-post,
body:not(.serpent) .sb-page,
body:not(.serpent) .bond-wrap,
body:not(.serpent) .bond-list li,
body:not(.serpent) .lesson-cards,
body:not(.serpent) .owl-pop,
body:not(.serpent) .menu-pop,
body:not(.serpent) .m-room { background: var(--paper); border: 1px solid rgba(122, 42, 69, .35); border-radius: 6px; box-shadow: 0 0 0 4px var(--paper), 0 0 0 5px rgba(122, 42, 69, .22), 0 8px 20px rgba(90, 40, 40, .15); }
body:not(.serpent) .lcard:hover,
body:not(.serpent) .card:hover { box-shadow: 0 0 0 4px var(--paper), 0 0 0 5px rgba(201, 162, 74, .8), 0 12px 26px rgba(90, 40, 40, .25); }
body:not(.serpent) .paper,
body:not(.serpent) .passport,
body:not(.serpent) .book { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30'%3E%3Cg transform='rotate(0 15 15)'%3E%3Cpath d='M3 28 V10 Q3 3 10 3 H28' fill='none' stroke='%23c9a24a' stroke-width='1.8'/%3E%3Cpath d='M8 28 V14 Q8 8 14 8 H28' fill='none' stroke='%23c9a24a' stroke-width='.8' opacity='.7'/%3E%3Ccircle cx='10' cy='10' r='2.4' fill='%23c9a24a'/%3E%3C/g%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30'%3E%3Cg transform='rotate(90 15 15)'%3E%3Cpath d='M3 28 V10 Q3 3 10 3 H28' fill='none' stroke='%23c9a24a' stroke-width='1.8'/%3E%3Cpath d='M8 28 V14 Q8 8 14 8 H28' fill='none' stroke='%23c9a24a' stroke-width='.8' opacity='.7'/%3E%3Ccircle cx='10' cy='10' r='2.4' fill='%23c9a24a'/%3E%3C/g%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30'%3E%3Cg transform='rotate(180 15 15)'%3E%3Cpath d='M3 28 V10 Q3 3 10 3 H28' fill='none' stroke='%23c9a24a' stroke-width='1.8'/%3E%3Cpath d='M8 28 V14 Q8 8 14 8 H28' fill='none' stroke='%23c9a24a' stroke-width='.8' opacity='.7'/%3E%3Ccircle cx='10' cy='10' r='2.4' fill='%23c9a24a'/%3E%3C/g%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30'%3E%3Cg transform='rotate(270 15 15)'%3E%3Cpath d='M3 28 V10 Q3 3 10 3 H28' fill='none' stroke='%23c9a24a' stroke-width='1.8'/%3E%3Cpath d='M8 28 V14 Q8 8 14 8 H28' fill='none' stroke='%23c9a24a' stroke-width='.8' opacity='.7'/%3E%3Ccircle cx='10' cy='10' r='2.4' fill='%23c9a24a'/%3E%3C/g%3E%3C/svg%3E"); background-position: left 8px top 8px, right 8px top 8px, right 8px bottom 8px, left 8px bottom 8px; background-size: 30px 30px; background-repeat: no-repeat; background-color: var(--paper); }
body:not(.serpent) .passport { border: 1px solid rgba(122, 42, 69, .5); border-radius: 6px; box-shadow: 0 0 0 4px var(--paper), 0 0 0 5px rgba(122,42,69,.25), 0 8px 22px rgba(90,40,40,.2); }
body:not(.serpent) .pp-cover { background: linear-gradient(180deg, #8c2c4b, #5f1f36); color: #f7dfa0; font-family: 'Cormorant Garamond', serif; }
body:not(.serpent) input,
body:not(.serpent) textarea,
body:not(.serpent) select { background: #fffaf0; border: 1px solid rgba(122, 42, 69, .4); border-radius: 6px; font-family: 'EB Garamond', serif; font-size: 1.08rem; }
body:not(.serpent) input:focus-visible,
body:not(.serpent) textarea:focus-visible,
body:not(.serpent) select:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
body:not(.serpent) dialog { background: var(--paper); border: 1px solid var(--wine); border-radius: 8px; box-shadow: 0 0 0 5px var(--paper), 0 0 0 6px rgba(122,42,69,.35), 0 20px 60px rgba(40,10,20,.5); }
body:not(.serpent) .chip-f,
body:not(.serpent) .tab { font-family: 'Cormorant Garamond', serif; font-weight: 700; font-size: 1.02rem; background: var(--paper); border: 1px solid rgba(122,42,69,.4); color: var(--wine); }
body:not(.serpent) .chip-f.on { background: linear-gradient(180deg, #9d3d5c, #6c2340); color: #f7dfa0; border-color: var(--gold); }
body:not(.serpent) .pill { font-family: 'Cormorant Garamond', serif; font-weight: 700; }
body:not(.serpent) .sticky,
body:not(.serpent) .sticky-0,
body:not(.serpent) .sticky-1,
body:not(.serpent) .sticky-2 { background: var(--paper); border: 1px solid rgba(122,42,69,.4); border-radius: 4px; box-shadow: 0 0 0 4px var(--paper), 0 0 0 5px rgba(122,42,69,.22), 0 10px 22px rgba(90,40,40,.2); color: var(--ink); }
body:not(.serpent) .sticky .tape { display: none; }
body:not(.serpent) .sticky-ico { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #b8435f, #6c2340 70%); box-shadow: 0 3px 6px rgba(60,10,25,.45), inset 0 0 0 3px rgba(255,255,255,.12); font-size: 1.6rem; }
body:not(.serpent) .sticky h3 { color: var(--wine-deep); font-size: 1.5rem; }
body:not(.serpent) .sticky-count { background: transparent; border: 1px solid var(--gold); color: var(--wine); font-family: 'Cormorant Garamond', serif; font-weight: 700; }
body:not(.serpent) .accent { color: var(--wine); font-family: 'Pinyon Script', 'Cormorant Garamond', cursive; font-weight: 400; font-size: 1.15em; }
body:not(.serpent) .wiz-quote { font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 1.5rem; color: var(--wine); }

@media (min-width: 900px) {
  body.has-side:not(.serpent) .top { background: radial-gradient(circle at 10px 10px, rgba(255,255,255,.05) 0 2px, transparent 3px) 0 0 / 22px 22px, linear-gradient(90deg, #3a1122, #561b32 55%, #451528); border-right: 3px double var(--gold); color: #f4e3c1; box-shadow: 8px 0 24px rgba(40, 10, 20, .35); }
  body.has-side:not(.serpent) .brand, body.has-side:not(.serpent) .brand strong { color: #f7dfa0; }
  body.has-side:not(.serpent) .brand small, body.has-side:not(.serpent) .brand-moon { color: #d8b878; }
  body.has-side:not(.serpent) .brand strong { font-family: 'Cinzel', serif; font-size: 1.25rem; letter-spacing: .06em; text-shadow: 0 1px 0 rgba(0,0,0,.4); }
  body.has-side:not(.serpent) .top .brand { border-bottom: 1px solid rgba(201, 162, 74, .5); padding-bottom: 12px; }
  body.has-side:not(.serpent) #nav { gap: 8px; }
}
body:not(.serpent) #nav a { position: relative; display: block; margin-right: -14px; padding: 9px 26px 9px 16px; border-radius: 3px 0 0 3px; clip-path: polygon(0 0, 100% 0, calc(100% - 13px) 50%, 100% 100%, 0 100%); font-family: 'Cormorant Garamond', serif; font-weight: 700; font-size: 1.12rem; letter-spacing: .03em; color: #fff; box-shadow: none; transition: padding .15s, filter .15s; }
body:not(.serpent) #nav a:nth-child(4n+1) { background: linear-gradient(90deg, #7a1420, #a02030); color: #f3cf74; }
body:not(.serpent) #nav a:nth-child(4n+2) { background: linear-gradient(90deg, #d9a722, #efc84e); color: #2f2620; }
body:not(.serpent) #nav a:nth-child(4n+3) { background: linear-gradient(90deg, #0e1a40, #1f3170); color: #d8b27a; }
body:not(.serpent) #nav a:nth-child(4n) { background: linear-gradient(90deg, #17402a, #276a43); color: #d4d9d6; }
body:not(.serpent) #nav a:hover { padding-left: 24px; filter: brightness(1.12); transform: none; }
body:not(.serpent) #nav a.active { padding-left: 30px; filter: brightness(1.2) saturate(1.1); box-shadow: none; }
body:not(.serpent) #nav a.active::before { content: '✦'; position: absolute; left: 10px; color: currentColor; }
body:not(.serpent) .nav-ico { filter: grayscale(.2); }
body:not(.serpent) .top .menu summary, body:not(.serpent) .top .owl summary { background: #f7ecd5; border: 1px solid var(--gold); color: var(--wine-deep); font-family: 'Cormorant Garamond', serif; font-weight: 700; }
body:not(.serpent) .top .menu summary *, body:not(.serpent) .top .owl summary * { color: inherit; }
@media (max-width: 899px) {
  body:not(.serpent) .top { background: linear-gradient(90deg, #3a1122, #561b32, #451528); border-bottom: 3px double var(--gold); color: #f4e3c1; }
  body:not(.serpent) .top .brand, body:not(.serpent) .top .brand strong { color: #f7dfa0; }
  body:not(.serpent) .top .brand small, body:not(.serpent) .top .brand-moon { color: #d8b878; }
  body:not(.serpent) #nav a { margin-right: 0; clip-path: none; border-radius: 4px; padding: 6px 12px; }
}
.m-board { overflow: hidden; }
.m-room { max-width: 44%; }
@media (max-width: 760px) { .m-room { min-width: 0; max-width: 40%; } .m-name { font-size: .85rem; } }

/* common-room banner text stays readable on the dark house gradient */
body:not(.serpent) .cr-hero h1 { color: var(--hb); text-shadow: 0 1px 6px rgba(0,0,0,.25); }
body:not(.serpent) .cr-hero .eyebrow, body:not(.serpent) .cr-hero .cr-sub { color: var(--hb); opacity: .95; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
body:not(.serpent) .cr-hero h1::after { display: none; }
/* candles glow a little brighter on the warmer paper */
.fc { filter: drop-shadow(0 0 14px rgba(255, 190, 80, .75)); }

/* ===== v4: profile extras, badges, page themes ===== */
.mp-status { margin: 4px 0 6px; font-family: 'Cormorant Garamond', Georgia, serif; font-style: italic; font-size: 1.2rem; color: var(--wine, #7a2a45); }
.mini-badges { font-size: 1.15rem; letter-spacing: 2px; }
.pp-extra { grid-column: 1 / -1; padding: 14px 16px; margin-top: 6px; border: 1px dashed rgba(122, 42, 69, .4); border-radius: 8px; background: rgba(255, 255, 255, .35); }
.pp-extra h3 { margin: 0 0 8px; } .pp-extra h4 { margin: 12px 0 6px; font-family: 'Cormorant Garamond', serif; }
.form-row.three .field { flex: 1 1 130px; }
.xcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 6px 0 4px; }
.xcard { padding: 16px 18px; background: var(--paper, #fbf1de); border: 1px solid rgba(122, 42, 69, .35); border-radius: 6px; box-shadow: 0 0 0 4px var(--paper, #fbf1de), 0 0 0 5px rgba(122, 42, 69, .22), 0 8px 18px rgba(90, 40, 40, .15); color: #3b2230; }
.xcard h3 { margin: 0 0 8px; }
.xcard dl { margin: 0; display: grid; gap: 6px; } .xcard dl > div { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dotted rgba(122, 42, 69, .3); padding-bottom: 3px; }
.xcard dt { color: #7d5d70; font-size: .95rem; } .xcard dd { margin: 0; font-weight: 600; text-align: right; }
.xcard blockquote { margin: 10px 0 0; font-family: 'Cormorant Garamond', Georgia, serif; font-style: italic; font-size: 1.2rem; color: #7a2a45; }
.wand-svg { display: block; width: 100%; max-width: 220px; height: 26px; margin: 0 0 8px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.25)); }
.seals { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.seal-badge { position: relative; display: inline-flex; flex-direction: column; align-items: center; width: 92px; text-align: center; }
.seal-badge i { font-style: normal; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; font-size: 1.6rem; background: radial-gradient(circle at 35% 30%, #d4566f, #7a1f38 70%); box-shadow: 0 3px 6px rgba(60,10,25,.4), inset 0 0 0 3px rgba(255,255,255,.14); }
.seal-badge b { margin-top: 4px; font-size: .85rem; line-height: 1.15; font-family: 'Cormorant Garamond', serif; }
.seal-x { position: absolute; top: -4px; right: 8px; border: 0; width: 20px; height: 20px; border-radius: 50%; background: #5a1428; color: #fff; cursor: pointer; line-height: 1; }
/* per-person page themes (members choose in their profile) */
.pt { border-radius: 14px; padding: 4px 4px 18px; }
.pt-parchment { background: none; }
.pt-starry { background: radial-gradient(1px 1px at 20% 30%, #fff, transparent), radial-gradient(1.5px 1.5px at 70% 20%, #ffe9a8, transparent), radial-gradient(1px 1px at 40% 70%, #fff, transparent), radial-gradient(1.5px 1.5px at 85% 60%, #fff, transparent), linear-gradient(180deg, #151a45, #2b1f55); background-size: 220px 160px, 260px 200px, 180px 150px, 300px 220px, auto; color: #f4e8c8; padding: 14px; }
.pt-library { background: repeating-linear-gradient(90deg, rgba(0,0,0,.18) 0 3px, transparent 3px 46px), linear-gradient(180deg, #5b3a24, #3e2515); color: #f6e3c3; padding: 14px; box-shadow: inset 0 0 40px rgba(0,0,0,.45); }
.pt-greenhouse { background: radial-gradient(circle at 15% 20%, rgba(255,255,255,.45), transparent 40%), linear-gradient(135deg, #c9e8c4, #8fc79a); color: #1e3a28; padding: 14px; }
.pt-tea { background: radial-gradient(circle, rgba(200,120,100,.18) 3px, transparent 4px) 0 0 / 26px 26px, #f7e3d0; color: #4b2a22; padding: 14px; }
.pt-starry h1, .pt-starry h2, .pt-starry .crumbs, .pt-starry .crumbs a, .pt-starry .mp-status, .pt-starry .mp-head .meta, .pt-starry .mp-about,
.pt-library h1, .pt-library h2, .pt-library .crumbs, .pt-library .crumbs a, .pt-library .mp-status, .pt-library .mp-head .meta, .pt-library .mp-about { color: #f8e9c6 !important; }
.pt-greenhouse h1, .pt-greenhouse h2, .pt-greenhouse .mp-status, .pt-greenhouse .mp-head .meta, .pt-greenhouse .mp-about { color: #1e3a28 !important; }
.pt-tea h1, .pt-tea h2, .pt-tea .mp-status { color: #6b2a2a !important; }
.pt .cork-empty { color: inherit; }

/* ===== v4: special-day banner, weather, Christmas ===== */
.weather-line { margin: 6px 0 0; font-family: 'Cormorant Garamond', Georgia, serif; font-style: italic; font-size: 1.15rem; color: var(--muted, #7d5d70); }
.special-banner { display: flex; align-items: center; gap: 16px; margin: 4px 0 18px; padding: 14px 20px; border-radius: 8px; color: #f7dfa0; background: linear-gradient(135deg, #7a1f38, #4a1226); border: 1px solid #c9a24a; box-shadow: 0 0 0 4px #fbf1de, 0 0 0 5px rgba(122, 42, 69, .35), 0 10px 22px rgba(90, 40, 40, .25); }
.special-banner .sb-ico { font-size: 2.4rem; } .special-banner b { font-family: 'Cormorant Garamond', serif; font-size: 1.5rem; } .special-banner p { margin: 2px 0 0; color: #f4e3c1; }
.weather { position: fixed; inset: 0; pointer-events: none; z-index: 2; overflow: hidden; }
.weather .drop { position: absolute; top: -40px; width: 1.5px; height: 34px; background: linear-gradient(180deg, transparent, rgba(120, 150, 190, .65)); animation: rain linear infinite; transform: rotate(8deg); }
@keyframes rain { to { transform: translate(-40px, 110vh) rotate(8deg); } }
body.w-rain, body.w-thunder { filter: saturate(.92) brightness(.97); }
body.w-thunder::after { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 4; background: #fff; opacity: 0; animation: flash 9s infinite; }
@keyframes flash { 0%, 92%, 94.5%, 100% { opacity: 0; } 93% { opacity: .55; } 93.6% { opacity: .1; } 94% { opacity: .4; } }
body.w-mist::before { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 2; background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.35), rgba(255,255,255,0)) 0 0 / 60% 100% repeat-x, linear-gradient(180deg, transparent 40%, rgba(255,255,255,.35)); animation: mist 40s linear infinite; }
@keyframes mist { to { background-position: 100% 0, 0 0; } }
.xmas-lights { position: fixed; top: 24px; left: 0; right: 0; display: flex; justify-content: space-around; height: 26px; border-top: 2px solid rgba(40, 60, 40, .55); }
.xmas-lights b { width: 12px; height: 17px; margin-top: 2px; border-radius: 50% 50% 55% 55%; background: var(--c); box-shadow: 0 0 12px 3px var(--c); animation: bulb 3s ease-in-out infinite; }
@keyframes bulb { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
.spark { position: absolute; width: 8px; height: 8px; background: #ffe08a; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); animation: twinkle 3.5s ease-in-out infinite; filter: drop-shadow(0 0 4px #ffd166); }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(.4); } 50% { opacity: 1; transform: scale(1.3); } }
.m-foot small { display: block; font-size: .8rem; opacity: .8; }
@media (prefers-reduced-motion: reduce) { .weather, body.w-thunder::after, body.w-mist::before { display: none; } }
.pt-starry .mp-head .btn.ghost, .pt-library .mp-head .btn.ghost { color: #f7dfa0 !important; border-color: #f7dfa0 !important; }

/* ===== v5: diary hearts + full-screen reading ===== */
.read-tools { display: flex; gap: 10px; justify-content: flex-end; margin: 0 0 10px; }
.heart-btn .h-ico { font-size: 1.15em; }
.heart-btn.on { background: linear-gradient(180deg, #e0476f, #b31f4a); color: #fff; border-color: #f7c6d3; }
.pin-heart { margin-left: 8px; color: #c2285a; font-weight: 700; }
.fs-close { display: none; }
.book.fs { position: fixed; inset: 0; z-index: 400; margin: 0; max-width: none; border-radius: 0; overflow-y: auto; padding: 5vh 6vw 8vh; background: var(--paper, #fbf1de); }
.book.fs .fs-close { display: inline-block; position: fixed; top: 14px; right: 18px; z-index: 5; padding: 8px 16px; border-radius: 999px; border: 1px solid #7a2a45; background: #fffaf0; color: #7a2a45; font-weight: 700; cursor: pointer; }
.book.fs .book-pages, .book.fs .book-pics, .book.fs .book-foot { max-width: 1150px; margin-left: auto; margin-right: auto; }
.book.fs .book-text { font-size: 1.6rem; line-height: 2.1rem; }
.book.fs .book-text p { margin-bottom: 2.1rem; }
.book.fs .book-head h1 { font-size: clamp(2.2rem, 4.5vw, 3.4rem); }
@media (max-width: 760px) { .book.fs { padding: 56px 18px 40px; } .book.fs .book-text { column-count: 1; font-size: 1.4rem; } }
body.reading { overflow: hidden; }
.book.fs { box-shadow: none; border: 0; }
.book.fs .book-pages, .book.fs .book-text { background-image: none; }
.pin-by { color: #7a2a45; }
.chips + .corkboard { margin-top: 16px; }

/* ===== v6: account menu floats bottom-right so the sidebar never needs a scrollbar ===== */
@media (min-width: 900px) {
  body.has-side #userMenu, body.has-side #owl + #userMenu, body.has-side #owl[hidden] + #userMenu { position: fixed; right: 22px; bottom: 18px; z-index: 70; margin: 0 !important; width: auto; }
  body.has-side #userMenu .menu summary { width: auto; box-shadow: 0 6px 18px rgba(60, 20, 30, .3); }
  body.has-side #userMenu .menu-pop { top: auto; bottom: calc(100% + 8px); left: auto; right: 0; min-width: 250px; }
  body.has-side #owl { margin-top: auto; }
  body:not(.serpent) #nav { gap: 5px; }
  body:not(.serpent) #nav a { padding-top: 7px; padding-bottom: 7px; }
  body.has-side .top { overflow-y: auto; scrollbar-width: none; }
  body.has-side .top::-webkit-scrollbar { display: none; }
}
@media (min-width: 900px) { body.has-side .top { backdrop-filter: none; -webkit-backdrop-filter: none; } }
body:not(.serpent) .menu-head, body:not(.serpent) .menu-head * { color: var(--ink); }
@media (min-width: 900px) { body.has-side #app { padding-bottom: 84px; } }

/* ===== Phase 1: sidebar sections, owl bell, section landing pages ===== */
body:not(.serpent) #nav a[data-c="0"] { background: linear-gradient(90deg, #7a1420, #a02030); color: #f3cf74; }
body:not(.serpent) #nav a[data-c="1"] { background: linear-gradient(90deg, #d9a722, #efc84e); color: #2f2620; }
body:not(.serpent) #nav a[data-c="2"] { background: linear-gradient(90deg, #0e1a40, #1f3170); color: #d8b27a; }
body:not(.serpent) #nav a[data-c="3"] { background: linear-gradient(90deg, #17402a, #276a43); color: #d4d9d6; }
.nav-group { display: block; }
.ng-head { position: relative; display: block; }
.ng-toggle { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); z-index: 2; width: 22px; height: 22px; padding: 0; border: 1px solid #c9a24a; border-radius: 50%; background: #fbf1de; color: #7a2a45; font-size: .85rem; line-height: 1; cursor: pointer; transition: transform .2s; }
.nav-group.open .ng-toggle { transform: translateY(-50%) rotate(180deg); }
.ng-kids { display: none; margin: 3px 0 3px 18px; }
.nav-group.open .ng-kids { display: block; }
body:not(.serpent) #nav .ng-kids a { background: linear-gradient(90deg, #f7e9c9, #ecd6a6); color: #5a1f33; font-size: 1rem; margin: 0 0 3px; padding: 5px 24px 5px 12px; border-left: 3px solid #c9a24a; }
body:not(.serpent) #nav .ng-kids a.active { background: #fff6dc; font-weight: 700; filter: none; }
body:not(.serpent) #nav .ng-kids a.active::before { color: #7a2a45; }
@media (max-width: 899px) { .nav-group, .ng-head, .ng-kids { display: contents; } .ng-toggle { display: none; } body:not(.serpent) #nav .ng-kids a { border-left: 0; } }
/* owl bell, top right */
.owl summary .owl-bird { font-size: 1.35rem; display: inline-block; transform-origin: 50% 10%; }
.owl-bird.ring { animation: owlring .9s ease-in-out; }
@keyframes owlring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(-20deg); } 30% { transform: rotate(18deg); } 45% { transform: rotate(-13deg); } 60% { transform: rotate(9deg); } 80% { transform: rotate(-4deg); } }
@media (min-width: 900px) {
  body.has-side #owl, body.has-side #owl[hidden] + #userMenu { margin: 0; }
  body.has-side #owl { position: fixed; top: 34px; right: 22px; z-index: 70; }
  body.has-side .owl summary { width: 46px; height: 46px; padding: 0; justify-content: center; border-radius: 50%; position: relative; box-shadow: 0 6px 18px rgba(60, 20, 30, .3); }
  body.has-side .owl .owl-badge { position: absolute; top: -6px; right: -6px; }
  body.has-side .owl-pop { position: absolute; left: auto; right: 0; top: calc(100% + 10px); bottom: auto; width: min(360px, 92vw); }
  body.has-side #app { padding-top: 58px; }
}
/* section landing pages */
.hub { position: relative; text-align: center; padding: 34px 20px 28px; margin-bottom: 20px; border: 1px solid rgba(122, 42, 69, .35); border-radius: 8px; background: linear-gradient(180deg, #fbf1de, #f3e0bd); box-shadow: 0 0 0 4px #fbf1de, 0 0 0 5px rgba(122, 42, 69, .22), 0 10px 24px rgba(90, 40, 40, .18); overflow: hidden; }
.hub > * { position: relative; }
.hub-art { position: absolute !important; inset: 0; pointer-events: none; opacity: .16; font-size: 3.4rem; display: flex; justify-content: space-between; align-items: center; padding: 0 5%; }
.hub h1 { margin: 4px 0 6px; } .hub-sub { margin: 0 auto; max-width: 36em; font-family: 'Cormorant Garamond', Georgia, serif; font-style: italic; font-size: 1.25rem; color: #7a2a45; }
.hub-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin-bottom: 22px; }
.hub-card { display: block; text-decoration: none; color: #3b2230; text-align: center; padding: 24px 20px; background: var(--paper, #fbf1de); border: 1px solid rgba(122, 42, 69, .35); border-radius: 6px; box-shadow: 0 0 0 4px var(--paper, #fbf1de), 0 0 0 5px rgba(122, 42, 69, .22), 0 8px 20px rgba(90, 40, 40, .15); transition: transform .18s, box-shadow .18s; }
.hub-card:hover { transform: translateY(-3px); box-shadow: 0 0 0 4px var(--paper, #fbf1de), 0 0 0 5px rgba(201, 162, 74, .85), 0 14px 26px rgba(90, 40, 40, .25); }
.hub-ico { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 8px; border-radius: 50%; font-size: 1.9rem; background: radial-gradient(circle at 35% 30%, #b8435f, #6c2340 70%); box-shadow: 0 3px 6px rgba(60, 10, 25, .45), inset 0 0 0 3px rgba(255, 255, 255, .12); }
.hub-card h2 { margin: 6px 0; } .hub-card p { margin: 0 0 12px; color: #7d5d70; }

/* ===== Character Dashboard: dossier + editor ===== */
.ds-hubrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-bottom: 14px; }
.ds-mini { display: flex; gap: 16px; padding: 18px; background: var(--paper, #fbf1de); border: 1px solid rgba(122, 42, 69, .35); border-radius: 6px; border-top: 6px solid var(--ha); box-shadow: 0 0 0 4px var(--paper, #fbf1de), 0 0 0 5px rgba(122, 42, 69, .22), 0 8px 18px rgba(90, 40, 40, .15); color: #3b2230; }
.ds-mini-pic, .ed-pic, .fam-pic { flex: none; width: 84px; height: 104px; border-radius: 4px; overflow: hidden; display: grid; place-items: center; background: linear-gradient(135deg, #f9d3e5, #d9c8f5); font-family: 'Cormorant Garamond', serif; font-size: 2.4rem; font-weight: 700; color: #7a2a45; border: 2px solid #c9a24a; }
.ds-mini-pic img, .ed-pic img, .fam-pic img { width: 100%; height: 100%; object-fit: cover; }
.fam-pic { width: 64px; height: 76px; margin-bottom: 8px; } .ed-pic { width: 64px; height: 78px; }
.ds-mini h2 { margin: 0 0 2px; } .ds-newrow { text-align: center; margin: 8px 0 20px; }
.dossier { padding: 4px; }
.ds-hero { position: relative; margin-bottom: 18px; border-radius: 8px; overflow: hidden; color: var(--hb); border: 2px solid #c9a24a; box-shadow: 0 0 0 4px #fbf1de, 0 0 0 5px rgba(122, 42, 69, .35), 0 14px 30px rgba(60, 20, 30, .3);
  background: linear-gradient(120deg, var(--ha), color-mix(in srgb, var(--ha) 65%, #000)); }
.ds-hero[style*="--banner"] { background: linear-gradient(180deg, rgba(0, 0, 0, .15), rgba(0, 0, 0, .65)), var(--banner) center / cover, var(--ha); color: #fff; }
.ds-hero-in { display: flex; gap: 24px; align-items: center; padding: 28px; flex-wrap: wrap; }
.ds-portrait { flex: none; width: 150px; height: 190px; border-radius: 4px; overflow: hidden; border: 4px solid #fbf1de; box-shadow: 0 8px 20px rgba(0, 0, 0, .45); background: #f4d6e4; display: grid; place-items: center; font-family: 'Cormorant Garamond', serif; font-size: 4rem; color: #7a2a45; transform: rotate(-1.5deg); }
.ds-portrait img { width: 100%; height: 100%; object-fit: cover; }
.ds-title { flex: 1 1 320px; min-width: 0; }
body:not(.serpent) .ds-hero h1 { color: inherit; margin: 2px 0 4px; font-size: clamp(2.2rem, 5vw, 3.4rem); text-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
body:not(.serpent) .ds-hero h1::after { display: none; }
.ds-hero .eyebrow, .ds-hero .mp-status, .ds-hero .muted { color: inherit; opacity: .92; }
.ds-sub { margin: 0 0 6px; font-family: 'Cormorant Garamond', serif; font-size: 1.3rem; } .ds-glance { margin: 0 0 6px; opacity: .92; }
.ds-quote { margin: 8px 0; padding: 0; border: 0; font-family: 'Cormorant Garamond', Georgia, serif; font-style: italic; font-size: 1.45rem; }
.ds-by { margin: 4px 0 8px; font-size: .95rem; }
.ds-hero .btn { background: #fbf1de; color: #7a2a45; border-color: #c9a24a; text-shadow: none; box-shadow: none; }
.ds-crest { flex: none; opacity: .95; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .4)); } .ds-crest img { width: 96px; height: 96px; object-fit: contain; }
.ds-featured { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin: 0 4px 16px; }
.polaroid.sm { width: 92px; } .seal-badge.sm { width: 78px; } .seal-badge.sm i { width: 40px; height: 40px; font-size: 1.2rem; }
.ds-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; position: sticky; top: 24px; z-index: 6; padding: 8px 0; }
.ds-jump a { padding: 5px 14px; border-radius: 999px; background: #fbf1de; border: 1px solid #c9a24a; color: #7a2a45; text-decoration: none; font-family: 'Cormorant Garamond', serif; font-weight: 700; font-size: 1.02rem; box-shadow: 0 2px 6px rgba(60, 20, 30, .15); }
.ds-jump a:hover { background: #7a2a45; color: #f7dfa0; }
.ds-sec { margin: 0 0 22px; padding: 20px 24px; background: var(--paper, #fbf1de); color: #3b2230; border: 1px solid rgba(122, 42, 69, .35); border-radius: 6px; box-shadow: 0 0 0 4px var(--paper, #fbf1de), 0 0 0 5px rgba(122, 42, 69, .22), 0 8px 18px rgba(90, 40, 40, .12); scroll-margin-top: 70px; }
.ds-sec h2 { margin: 0 0 12px; padding-bottom: 6px; border-bottom: 2px solid var(--gold, #c9a24a); } body:not(.serpent) .dossier .ds-sec h2 { color: #55192f !important; }
.ds-sec.locked, .ds-sec.empty-sec { opacity: .8; border-style: dashed; }
.vis-tag { margin-left: 8px; padding: 2px 10px; font-family: 'EB Garamond', serif; font-size: .8rem; font-weight: 600; border-radius: 999px; background: #f1dfe6; color: #7a2a45; vertical-align: middle; }
.ds-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px 22px; margin: 0 0 12px; }
.ds-facts > div { border-bottom: 1px dotted rgba(122, 42, 69, .35); padding-bottom: 4px; } .ds-facts dt { font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; color: #7d5d70; } .ds-facts dd { margin: 0; font-weight: 600; }
.ds-long h4 { margin: 10px 0 2px; font-family: 'Cormorant Garamond', serif; font-size: 1.2rem; color: #7a2a45; }
.ds-timeline { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 3px solid #c9a24a; }
.ds-timeline li { position: relative; display: flex; gap: 16px; padding: 0 0 16px 18px; } .ds-timeline li::before { content: ''; position: absolute; left: -26px; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: #7a2a45; border: 3px solid #fbf1de; box-shadow: 0 0 0 2px #c9a24a; }
.tl-when { flex: none; width: 110px; font-family: 'Cormorant Garamond', serif; font-weight: 700; color: #7a2a45; }
.ds-people { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.ds-table { width: 100%; border-collapse: collapse; } .ds-table th { text-align: left; font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; color: #7d5d70; border-bottom: 2px solid #c9a24a; padding: 6px 8px; } .ds-table td { padding: 8px; border-bottom: 1px dotted rgba(122, 42, 69, .3); } .ds-table small { display: block; color: #7d5d70; }
.ach { display: flex; gap: 12px; align-items: flex-start; width: min(100%, 340px); padding: 10px 12px; border: 1px solid rgba(122, 42, 69, .3); border-radius: 6px; background: #fffaf0; } .ach.featured { border-color: #c9a24a; box-shadow: 0 0 0 2px rgba(201, 162, 74, .5); }
.ach img { width: 56px; height: 56px; object-fit: cover; border-radius: 50%; } .ach i { font-style: normal; font-size: 2rem; } .ach small { display: block; color: #7d5d70; }
.ds-letter { margin: 0 0 8px; border: 1px solid rgba(122, 42, 69, .3); border-radius: 6px; background: #fffaf0; } .ds-letter summary { cursor: pointer; padding: 10px 14px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; } .ds-letter summary small { color: #7d5d70; }
.letter-body { padding: 4px 18px 16px; font-family: 'Caveat', 'Snell Roundhand', 'Segoe Script', cursive; font-size: 1.35rem; line-height: 1.45; }
.ds-bonds li { padding: 6px 0; border-bottom: 1px dotted rgba(122, 42, 69, .3); }
.is-pinned::after { content: '📌 Pinned'; position: absolute; top: -10px; right: 10px; font-size: .8rem; background: #7a2a45; color: #f7dfa0; padding: 2px 8px; border-radius: 999px; }
.sheet-dossier { margin: 6px 0 0; }
/* editor */
.ed-grid { display: grid; gap: 12px; } .ed-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px dotted rgba(122, 42, 69, .3); } .ed-btns { display: flex; gap: 6px; flex: none; }
.ed-vis { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px 16px; } .ed-allow { margin: 14px 0; padding: 10px 14px; border: 1px dashed rgba(122, 42, 69, .4); border-radius: 8px; } .ed-allow .check { display: inline-flex; gap: 6px; margin: 4px 14px 4px 0; }
.ed-danger { text-align: right; margin-top: 10px; } .ed-imgs { display: flex; flex-wrap: wrap; gap: 8px; }
.ed-grid .fold-body .btn[type="submit"] { margin-top: 8px; }
@media (max-width: 700px) { .ds-hero-in { padding: 18px; } .ds-portrait { width: 120px; height: 152px; } .tl-when { width: 80px; } .ds-sec { padding: 16px; } }
.ng-head > a { padding-right: 48px !important; }
@media (max-width: 899px) { .ng-head > a { padding-right: 26px !important; } }
