:root {
  color-scheme: light;
  --paper: #faf8f1;
  --white: #fffefa;
  --ink: #28203a;
  --muted: #60566d;
  --purple: #593b9a;
  --lavender: #e4d8fb;
  --line: #e7e0e9;
  --serif: Georgia, "Times New Roman", serif;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, a, select, summary { touch-action: manipulation; }
button, summary { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid #8d55dc; outline-offset: 4px; }
h1, h2, p { margin: 0; }
h1, h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -.055em; }
.masthead { border-bottom: 1px solid #e9e3da; background: var(--paper); }
.shell, .header-inner { max-width: 1280px; padding-inline: 42px; margin-inline: auto; }
.header-inner { min-height: 76px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; width: fit-content; font: bold 2.05rem/.9 var(--serif); letter-spacing: -.065em; text-decoration: none; white-space: nowrap; }
.brand-mark { flex: 0 0 auto; display: block; margin-right: 8px; }
.brand-accent { color: #6944a5; }
nav { display: flex; align-items: center; gap: 5px; }
nav a { text-decoration: none; font-size: .925rem; font-weight: 650; padding: 8px 15px; color: var(--muted); border-radius: 8px; }
nav a:hover, nav a[aria-current] { background: #eee6f9; color: #4c2c80; }
.profile { justify-self: end; position: relative; z-index: 4; }
.profile summary { display: flex; gap: 8px; align-items: center; list-style: none; font-size: .9rem; font-weight: 650; }
.profile summary::-webkit-details-marker { display: none; }
.profile summary::after { content: ""; width: 7px; height: 7px; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; rotate: 45deg; margin: -4px 2px 0 4px; }
.profile-menu { position: absolute; right: 0; top: calc(100% + 12px); min-width: 195px; background: var(--white); padding: 8px; border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 8px 26px #39265317; }
.profile-menu p { padding: 7px 9px; color: var(--muted); font-size: .8rem; }
.profile-menu button { color: var(--ink); padding: 8px 9px; display: flex; gap: 8px; align-items: center; border: 0; border-radius: 8px; background: transparent; width: 100%; text-align: left; }
.profile-menu button:hover, .profile-menu button:disabled { background: #f1ebf8; }
#status { padding-top: 35px; }
.hero { isolation: isolate; position: relative; overflow: hidden; margin-top: 30px; min-height: 360px; background: #e3d6fa; border: 1px solid #d9c8f2; border-radius: 22px; display: flex; align-items: center; }
.hero-copy { z-index: 1; position: relative; padding: 34px 48px 40px; }
.eyebrow { color: #654388; font-size: .76rem; font-weight: 750; letter-spacing: .135em; line-height: 1.4; }
.date-star { color: #703eb2; font-size: 1rem; padding-right: 4px; vertical-align: middle; }
.hero .eyebrow { text-transform: uppercase; }
.hero h1 { font-size: clamp(3.8rem, 7vw, 6.6rem); line-height: .88; margin-top: 12px; }
.hero h1 em { color: #61409e; font-weight: inherit; }
.hero-description { margin: 17px 0 22px; font-size: 1rem; color: #514161; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; padding: 9px 17px; border: 1px solid transparent; border-radius: 9px; font-weight: 700; }
.primary { color: #fff; background: #3e2868; box-shadow: 0 2px 0 #271742; }
.primary:hover { background: #523682; }
.primary:disabled { opacity: .6; cursor: wait; }
.button-symbol { font-size: 1.2rem; line-height: 1; }
[data-log] { white-space: nowrap; }
.hero-actions { display: grid; justify-items: start; gap: 12px; }
.today-count { display: flex; align-items: center; gap: 9px; padding: 7px 12px; border: 1px solid #cdb7ed; border-radius: 9px; background: #f4ecff; font-size: .875rem; color: #4c3469; }
.tiny-check { font-weight: 800; color: #603a9a; }
.cover-art { position: absolute; inset: 0 0 0 42%; background: radial-gradient(ellipse at 58% 55%, #ccb3ec, transparent 64%); pointer-events: none; }
.orbit { position: absolute; border-radius: 50%; border: 1px solid #b195d4; width: 73%; aspect-ratio: 1; top: 48%; left: 54%; transform: translate(-50%, -50%); opacity: .6; }
.orbit-outer { width: 92%; }
.sun { position: absolute; top: 9%; left: 52%; width: 30%; aspect-ratio: 1; border-radius: 50%; background: #f9c86f; box-shadow: inset -14px -13px #f2b45d; }
.art-star { color: #643d9a; position: absolute; line-height: 1; }
.star-one { left: 22%; top: 24%; font-size: 47px; }
.star-two { left: 84%; top: 31%; font-size: 38px; }
.star-three { left: 78%; top: 71%; font-size: 25px; }
.book { position: absolute; width: 56%; height: 42%; left: 23%; top: 39%; transform: rotate(-13deg); filter: drop-shadow(8px 16px 0 #51317a24); }
.book-cover { position: absolute; inset: 12px -8px -12px; background: #7545b2; border-radius: 10px 10px 15px 15px; transform: skewX(-5deg); border: 2px solid #432765; }
.page { display: flex; flex-direction: column; justify-content: center; gap: 10%; position: absolute; width: 50%; height: 100%; padding: 11% 10%; border: 2px solid #432765; border-bottom-width: 6px; }
.left-page { left: 0; transform: skewY(10deg); border-radius: 18% 11% 8% 11%; background: #fff2d2; }
.right-page { right: 0; transform: skewY(-10deg); border-radius: 11% 18% 11% 8%; background: #fff8e7; }
.page i { display: block; flex: 0 0 2px; background: #b299ac; border-radius: 50%; }
.page i:last-child { width: 62%; }
.right-page span { color: #8956b6; font-size: clamp(1rem, 3vw, 2.7rem); line-height: .8; }
.ribbon { position: absolute; z-index: 1; left: 54%; top: 91%; width: 6%; height: 29%; background: #e17c69; clip-path: polygon(0 0,100% 0,100% 100%,50% 78%,0 100%); transform: rotate(-8deg); }
.content { display: grid; gap: 21px; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); margin-top: 23px; align-items: start; }
.content.single { grid-template-columns: minmax(0, 1fr); margin-top: 30px; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 17px; padding: 24px; min-width: 0; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 18px; }
h2 { font-size: clamp(1.95rem, 3vw, 2.45rem); line-height: 1.08; margin-top: 4px; }
.week-controls { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.week-controls span { font-size: .85rem; font-weight: 650; white-space: nowrap; }
.week-controls button, .close { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: var(--white); font-size: 1.3rem; line-height: 1; padding: 0 0 2px; }
.week-controls button:hover:not(:disabled), .close:hover { background: #efe7fa; }
.week-controls button:disabled { color: #a69bad; cursor: default; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th, td { text-align: center; }
thead th { color: var(--muted); font-weight: 700; font-size: .75rem; padding-block: 5px 8px; }
thead th:first-child { width: 31%; text-align: left; }
thead th:last-child { width: 15%; text-align: right; }
tbody tr { border-top: 1px solid #eee8eb; }
tbody td, tbody th { padding-block: 10px; }
.member { display: flex; align-items: center; gap: 9px; text-align: left; padding-right: 6px; font-size: .875rem; font-weight: 650; }
.member > span:last-child { overflow-wrap: anywhere; }
.avatar { display: inline-grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; font-size: .72rem; font-weight: 750; letter-spacing: .01em; }
.lavender { color: #503075; background: #eadcfb; }
.peach { color: #823d30; background: #fbe0d5; }
.mint { color: #2d5d4b; background: #dcece1; }
.yellow { color: #73520e; background: #f9eac0; }
.day { display: inline-grid; place-items: center; width: min(27px, 88%); height: 27px; border-radius: 6px; background: #f1edf3; color: #593689; font-size: .85rem; font-weight: 800; vertical-align: middle; }
.day.done { background: #e9dcfa; }
.day.current { outline: 1px dashed #8e67bd; outline-offset: -1px; }
.day.future { background: transparent; color: #9c91a4; }
.streak-number { text-align: right; white-space: nowrap; font-size: .9rem; font-weight: 750; color: #5d397e; }
.streak-number span { color: var(--muted); font-size: .75rem; font-weight: 600; }
.legend { margin-top: 13px; display: flex; flex-wrap: wrap; align-items: center; gap: 7px 14px; font-size: .78rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 11px; height: 11px; border-radius: 3px; }
.legend-done { background: #e9dcfa; }
.legend-today { border: 1px dashed #8e67bd; }
.legend-note { margin-left: auto; }
.journal { background: #fffdf7; }
.text-link { color: #563685; font-size: .875rem; font-weight: 700; text-underline-offset: 3px; padding-bottom: 2px; white-space: nowrap; }
.entry { padding: 14px 0; border-top: 1px solid #eee8eb; }
.entry:last-child { padding-bottom: 0; }
.entry-byline { display: flex; align-items: center; gap: 9px; font-size: .875rem; font-weight: 700; }
.entry-byline .avatar { width: 28px; height: 28px; font-size: .65rem; }
.entry-byline time { font-size: .8rem; font-weight: 500; color: var(--muted); margin-left: auto; white-space: nowrap; }
.entry h3 { font: 700 1.12rem/1.3 var(--serif); margin: 8px 0 4px; overflow-wrap: anywhere; }
.entry p { color: var(--muted); font-size: .95rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.spoiler-note { margin-top: 7px; }
.spoiler-note summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; min-height: 42px; width: fit-content; list-style: none; color: #563685; font-size: .875rem; font-weight: 650; }
.spoiler-note summary::-webkit-details-marker { display: none; }
.spoiler-tag { padding: 4px 8px; border-radius: 6px; background: #f8e6bd; color: #62460d; }
.spoiler-reveal, .spoiler-hide { text-decoration: underline; text-underline-offset: 3px; }
.spoiler-hide, .spoiler-note[open] .spoiler-reveal { display: none; }
.spoiler-note[open] .spoiler-hide { display: inline; }
.spoiler-note p { padding-top: 4px; }
.empty { color: var(--muted); border-top: 1px solid var(--line); padding-top: 15px; }
.footer { display: flex; justify-content: space-between; gap: 12px; margin: 20px 0 25px; color: var(--muted); font-size: .8rem; }
.signin { max-width: 440px; margin: 50px auto; }
.signin h1 { font-size: 3.5rem; margin: 5px 0 20px; }
.auth-link { color: var(--muted); text-align: center; margin-top: 17px; }
.auth-hint { margin-top: -7px; }
.filter { display: flex; gap: 8px; align-items: center; font-size: .875rem; }
select { appearance: none; padding: 7px 30px 7px 10px; background: var(--white); border: 1px solid #cfc2d9; border-radius: 7px; color: var(--ink); }
.filter::after { content: ""; width: 7px; height: 7px; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; rotate: 45deg; margin: -4px 0 0 -27px; pointer-events: none; }
.field-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.link-button { border: 0; background: transparent; padding: 7px 2px; text-decoration: underline; }
.select-field { position: relative; margin-top: 3px; }
.select-field select { width: 100%; min-height: 42px; text-overflow: ellipsis; }
.select-field::after { content: ""; position: absolute; top: calc(50% - 5px); right: 13px; width: 8px; height: 8px; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; rotate: 45deg; pointer-events: none; }
.book-editor { padding: 10px; border: 1px solid #e0d5ec; border-radius: 8px; background: #faf6ff; }
.book-editor-actions { display: flex; align-items: center; justify-content: end; gap: 12px; margin-top: 9px; }
.book-editor-actions .button { min-height: 38px; }
.book-editor .form-error { margin-top: 9px; }
dialog { width: min(490px, calc(100% - 24px)); max-height: calc(100% - 24px); color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: 23px; box-shadow: 0 15px 80px #26183845; }
dialog::backdrop { background: #2e204b77; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
dialog h2 { margin-bottom: 17px; }
form { display: grid; gap: 13px; }
form label { display: block; font-size: .94rem; font-weight: 700; }
input, textarea { display: block; width: 100%; padding: 9px 10px; margin-top: 5px; border: 1px solid #cfc2d9; border-radius: 7px; background: #fffefa; color: var(--ink); font-size: 1rem; font-weight: 400; }
textarea { resize: vertical; min-height: 76px; }
.summary-label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.summary-count, .form-note { color: var(--muted); font-size: .82rem; font-weight: 400; }
.summary-count { white-space: nowrap; font-variant-numeric: tabular-nums; }
.summary-label + textarea { margin-top: -8px; }
form .spoiler-toggle { min-height: 48px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; gap: 12px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #faf6ff; }
.spoiler-toggle input { flex: 0 0 auto; appearance: none; position: relative; width: 42px; height: 24px; padding: 0; margin: 0; border: 1px solid #a08ab3; border-radius: 100px; background: #e6dced; cursor: pointer; }
.spoiler-toggle input::before { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fffefa; box-shadow: 0 1px 3px #28203a48; }
.spoiler-toggle input:checked { background: #63409e; border-color: #63409e; }
.spoiler-toggle input:checked::before { transform: translateX(18px); }
.form-error { color: #912b3d; font-size: .9rem; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 24px); z-index: 6; padding: 10px 16px; border-radius: 9px; background: #3e2868; color: #fff; box-shadow: 0 3px 14px #39265337; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 900px) {
  .shell, .header-inner { padding-inline: 24px; }
  .content { grid-template-columns: minmax(0, 1fr); }
  .hero-copy { padding-left: 32px; }
}
@media (max-width: 570px) {
  .shell, .header-inner { padding-inline: 13px; }
  .header-inner { min-height: 90px; grid-template-columns: minmax(0, 1fr) auto; padding-block: 10px 4px; gap: 4px; }
  nav { grid-row: 2; grid-column: 1 / -1; justify-content: center; }
  nav a { padding: 7px 12px; }
  .brand { font-size: clamp(1.35rem, 5.2vw, 1.85rem); }
  .brand-mark { width: 30px; height: 30px; margin-right: 6px; }
  .profile { grid-row: 1; grid-column: 2; }
  .hero { margin-top: 15px; min-height: 320px; align-items: start; }
  .hero-copy { padding: 23px 13px 14px; }
  .hero h1 { font-size: clamp(3.3rem, 10vw, 4.4rem); }
  .hero-description { max-width: 195px; font-size: .95rem; margin-top: 13px; }
  .cover-art { inset: 37px -11px 115px 59%; }
  .book { width: 75%; height: 34%; left: 8%; top: 40%; filter: drop-shadow(4px 7px 0 #51317a24); }
  .sun { width: 60%; top: 13%; left: 32%; box-shadow: inset -6px -5px #f2b45d; }
  .orbit { top: 45%; }
  .star-one { font-size: 22px; top: 11%; left: 10%; }
  .star-two { font-size: 18px; left: 83%; top: 14%; }
  .star-three { font-size: 16px; left: 80%; top: 74%; }
  .content { margin-top: 14px; gap: 14px; }
  .panel { padding: 14px 11px 16px; }
  .section-head { align-items: center; gap: 8px; }
  .week-controls { gap: 4px; }
  .week-controls button { width: 28px; height: 34px; }
  .week-controls span { font-size: .75rem; }
  .member { gap: 4px; font-size: .79rem; }
  .member .avatar { width: 24px; height: 24px; font-size: .59rem; }
  .legend-note { display: none !important; }
  .streak-number { font-size: .83rem; }
  .streak-number span { font-size: .68rem; }
}
