:root {
  color-scheme: light;
  --ink: #2d2937;
  --muted: #62576b;
  --accent: #624276;
  --paper: #fffcf8;
  --edge: #e9dfdb;
  --sans: "Avenir Next", "Nunito", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --numbers: "Avenir Next", "Nunito", "Arial Rounded MT Bold", "Trebuchet MS", var(--sans);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: radial-gradient(ellipse at 72% 0%, #f1e8ed, transparent 57%), #f9f6f1; font: 1rem/1.45 var(--sans); }
body:has(.day-dialog[open]) { overflow: hidden; }
html { scrollbar-gutter: stable; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible, canvas:focus-visible { outline: 2px solid #75538b; outline-offset: 3px; }
button:disabled { cursor: default; opacity: .4; }
p, h1, h2, h3 { margin: 0; }
svg { width: 1.14em; height: 1.14em; flex: none; }
canvas { display: block; }
[data-model-interactive] { cursor: grab; touch-action: none; }
[data-model-interactive]:active { cursor: grabbing; }
[data-icon] { display: inline-flex; align-items: center; justify-content: center; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:not(:focus) { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
.skip:focus { position: fixed; z-index: 5; top: 5px; left: 5px; background: white; padding: 8px; border-radius: 8px; }
.shell { width: min(1460px, 100%); margin-inline: auto; padding: 0 clamp(20px, 4.2vw, 66px) 48px; }
.topbar, .brand, .top-actions { display: flex; align-items: center; }
.topbar { min-height: clamp(82px, 7.5vw, 106px); justify-content: space-between; }
.brand { gap: 10px; color: #423733; }
.brand-art { display: block; width: 66px; height: auto; flex: none; }
.brand strong { font-size: 1.45rem; line-height: 1; letter-spacing: .09em; font-weight: 800; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; border: 1px solid #e7ded3; background: #fffdf8; border-radius: 11px; padding: 6px 12px; font-size: .88rem; font-weight: 670; transition: background .24s ease, transform .26s cubic-bezier(.22,.7,.28,1); }
.button:hover { background: #f4ecf5; }
.button:active { transform: translateY(1px); }
.button.icon-button { width: 36px; min-height: 36px; padding: 0; }
.spread { display: grid; grid-template-columns: minmax(270px, .44fr) minmax(0, 1fr); gap: clamp(22px, 3.1vw, 44px); align-items: start; }
.book-sidebar { display: grid; gap: 20px; min-width: 0; }
.hero {
  min-height: 420px; position: relative; isolation: isolate; overflow: hidden;
  border: 1px solid #eadde5; border-radius: 26px;
  background: radial-gradient(ellipse at 11% 1%, #fffbec 0%, transparent 74%),
    radial-gradient(ellipse at 89% 86%, #e3d1ed, transparent 67%), linear-gradient(148deg, #f3e6ec 15%, #f1e3ea 90%);
  box-shadow: inset 0 1px 1px #ffffffda, 0 4px 14px #62485512;
}
.hero-copy { position: relative; z-index: 2; pointer-events: none; padding: 28px 25px 0; }
.hero-label { display: flex; gap: .46em; align-items: center; color: #5b4966; font-size: .92rem; font-weight: 720; letter-spacing: .12em; }
.hero-label span { font-family: var(--numbers); color: #8765a0; }
.hero h1 { margin-top: 5px; font-size: clamp(3rem,4.8vw,4.75rem); line-height: 1.11; font-weight: 860; letter-spacing: -.085em; }
.hero-scene { position: absolute; inset: 30% 0 2%; }
.orbit-line { position: absolute; inset: 31% 10% 20% 9%; pointer-events: none; border: 1px solid #a98abf85; border-radius: 50%; transform: rotate(-22deg); }
.orbit-line::before, .orbit-line::after { content: ""; position: absolute; border-radius: 50%; }
.orbit-line::before { inset: -17% 7%; border: 1px solid #ffffffa0; }
.orbit-line::after { width: 7px; height: 7px; left: 17%; bottom: 0; background: #ae92bf; box-shadow: 140px -94px 0 -1px #a67fb7; }
.hero-model { position: absolute; z-index: 1; width: 54%; height: 76%; border-radius: 17px; filter: drop-shadow(0 12px 8px #62415e31); }
.taurus-model { left: 1%; bottom: 3%; transform: rotate(-11deg); }
.virgo-model { right: 2%; bottom: 13%; transform: rotate(9deg); }
.tray { min-width: 0; position: relative; isolation: isolate; }
.tray-toolbar { min-height: 49px; display: flex; justify-content: space-between; align-items: flex-start; gap: 9px; padding: 0 2px 7px; }
.tray-toolbar h2 { font-size: 1.27rem; font-weight: 790; padding-top: 5px; }
.month-navigation { display: flex; align-items: center; gap: 6px; }
.navigation-month { min-width: 6.65rem; text-align: center; font: 700 1rem/1.2 var(--numbers); font-variant-numeric: tabular-nums; }
.grid { display: grid; grid-template-columns: repeat(12,minmax(0,1fr)); gap: clamp(11px, 1.2vw, 17px); user-select: none; }
.tile-slot { grid-row: var(--row); grid-column: var(--column) / span var(--span); position: relative; perspective: 610px; min-width: 0; min-height: var(--size); }
.tile-slot:focus-within { z-index: 4; }
.tile {
  --tile-light: #fffdfa; --tile-base: #f6efec; --tile-rim: #e3d6d7; --tile-label: #4e375b; --tile-radius: 17px 14px 18px 14px;
  position: absolute; inset: 0;
  width: 100%; height: 100%; display: block; padding: 0; text-align: left; border: 0; border-radius: var(--tile-radius);
  background: transparent; transform-style: preserve-3d;
}
.tile-face {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: start; gap: 3px; padding: 11px 12px 10px;
  pointer-events: none; border: 1px solid #ffffff75; border-radius: inherit; transform-style: preserve-3d; transform-origin: center;
  color: var(--ink); background: linear-gradient(150deg,var(--tile-light),var(--tile-base));
  box-shadow: 0 2px 0 var(--tile-rim),0 4px 6px #53435912,inset 0 1px 0 #ffffff80;
  transition: transform .48s cubic-bezier(.22,.64,.27,1), box-shadow .48s cubic-bezier(.22,.64,.27,1), border-color .24s;
}
.tile-face::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(ellipse at var(--shine-x,50%) var(--shine-y,40%), #fff8, transparent 73%); opacity: 0; transition: opacity .38s ease; }
.tile.blush { --tile-light: #fcf1ef; --tile-base: #f2dedf; --tile-rim: #dfc8cf; --tile-radius: 15px 21px 14px 18px; }
.tile.sage { --tile-light: #edf3e8; --tile-base: #dceadd; --tile-rim: #c2d4c6; --tile-radius: 19px 14px 20px 14px; }
.tile.mist { --tile-light: #f4eef9; --tile-base: #e8deef; --tile-rim: #d2c2df; --tile-radius: 14px 18px 14px 23px; }
.tile.pearl { --tile-light: #fff8e9; --tile-base: #f5e9d9; --tile-rim: #ded0b9; --tile-radius: 22px 15px 20px 14px; }
.tile.halloween { --tile-light: #f8e2ca; --tile-base: #edc5c2; --tile-rim: #cba0a5; --tile-label: #623b4e; }
.tile.mid-autumn { --tile-light: #f8efda; --tile-base: #dce7c9; --tile-rim: #bbc9a9; --tile-label: #3b5036; }
.tile.thanksgiving { --tile-light: #f8e9cd; --tile-base: #ecd1bd; --tile-rim: #d4b5a2; --tile-label: #603c36; }
.tile.christmas { --tile-light: #edf1df; --tile-base: #d4e2ce; --tile-rim: #b1c6ad; --tile-label: #375743; }
.tile.holiday { --tile-light: #f8eee6; --tile-base: #efe1d7; --tile-rim: #dfc9b9; --tile-label: #63413a; }
.tile.is-selected .tile-face { border-color: #b393c1; box-shadow: 0 3px 0 #b393c1, 0 6px 11px #4933592d, inset 0 0 0 1px #fffc; }
.tile:focus-visible .tile-face { transform: translateY(-4px) translateZ(14px); box-shadow: 0 4px 0 var(--tile-rim), 0 10px 18px #4b305d28; }
.tile-date, .tile-caption, .tile-tasks, .tile-note, .tile-editing { position: relative; z-index: 1; transform: translateZ(30px); }
.tile-date { display: inline-grid; place-items: center; font: 680 clamp(1.4rem,2.45vw,2.06rem)/1 var(--numbers); font-variant-numeric: tabular-nums; letter-spacing: -.076em; }
.tile[aria-current="date"] .tile-date::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 3px; border-radius: 4px; background: #8a60a3; }
.tile-art { position: absolute; right: 2%; bottom: 0; width: 67%; height: 90%; pointer-events: none; filter: drop-shadow(0 4px 3px #63463b3b); transform: translateZ(7px); transition: transform .38s cubic-bezier(.23,1,.32,1), filter .35s; }
.tile-slot.wide .tile-art { width: 68%; height: 103%; }
.tile-caption { margin-top: auto; max-width: 90%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .79rem; line-height: 1.2; font-weight: 730; color: var(--tile-label); padding: 2px 4px; border-radius: 5px; background: #fffef1bb; }
.tile-tasks { display: grid; gap: 3px; margin-top: auto; width: 100%; min-width: 0; }
.tile.has-tasks .tile-caption { margin-top: 0; }
.tile.has-tasks .tile-art { width: 45%; height: 68%; right: 1%; }
.tile:has(.tile-art) .tile-tasks { width: 65%; }
.tile:has(.tile-caption, .tile-editing).has-tasks .tile-face { padding-top: 8px; }
.tile-slot:has(.tile-more) { min-height: max(109px, var(--size)); }
.tile-slot:has(.has-tasks .tile-caption) { min-height: max(127px, var(--size)); }
.tile-task { display: flex; align-items: flex-start; gap: 5px; min-width: 0; color: #392e42; font-size: .84rem; line-height: 1.17; }
.tile-task-title { display: block; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-task:only-child .tile-task-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow-wrap: anywhere; white-space: normal; }
.tile-task.done .tile-task-title { color: #695b6b; text-decoration: line-through; }
.tile-more, .tile-note { color: #66516d; font-size: .71rem; line-height: 1.2; }
.tile-note { margin-top: auto; padding: 1px 4px; border-radius: 6px; background: #fffaf1cc; }
.tile-caption + .tile-note { margin-top: 0; }
.tile-editing { position: absolute; top: 6px; right: 5px; max-width: 59%; padding: 3px 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #553464; background: #f9eefb; border-radius: 6px; font-size: .67rem; line-height: 1.13; font-weight: 740; }
@media (hover: hover) and (pointer: fine) {
  .tile-slot:hover { z-index: 5; }
  .tile:hover .tile-face {
    transform: translateY(-7px) translateZ(20px) scale(1.025) rotateX(calc(var(--tilt-x, 4deg) * .55)) rotateY(calc(var(--tilt-y, -3deg) * .55));
    box-shadow: 0 4px 0 var(--tile-rim), 0 12px 24px #4b305d29, inset 0 1px 1px #fff8;
    transition-duration: .34s;
  }
  .tile:hover .tile-face::before { opacity: 1; }
  .tile:hover .tile-art { transform: translateY(-5px) translateZ(19px) scale(1.045); filter: drop-shadow(0 6px 5px #50324f34); }
}
.tile:active .tile-face { transform: translateY(1px) scale(.986); box-shadow: 0 1px 0 var(--tile-rim), 0 2px 4px #57355926; transition-duration: .16s; }
.day-dialog[open] {
  display: block; padding: 0; width: min(560px, calc(100% - 32px)); max-width: 100%; max-height: min(86dvh, 720px);
  border: 1px solid #ebe0e5; border-radius: 23px; background: var(--paper); color: var(--ink);
  box-shadow: 0 22px 95px #281c3857; overflow: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: #bdacc5 transparent;
}
.day-dialog::backdrop { background: #2f243853; backdrop-filter: blur(4px); }
@media (prefers-reduced-motion: no-preference) {
  .day-dialog:has(.day-sheet.opening) { animation: open-day .35s cubic-bezier(.22,.68,.26,1) both; }
  @keyframes open-day { from { opacity: 0; transform: translateY(10px) scale(.99); } }
}
.day-header { position: relative; isolation: isolate; min-height: 117px; overflow: hidden; padding: 20px 22px 19px; border-bottom: 1px solid #eee4eb; background: linear-gradient(118deg,#faf2f4,#f0e5f4); }
.day-header.mid-autumn { background: linear-gradient(100deg,#fbf1c9,#dceacb 78%); }
.day-header.halloween { background: linear-gradient(110deg,#fae4d2,#ebd1e4 87%); }
.day-header.thanksgiving { background: linear-gradient(112deg,#faeace,#f1d1c4 87%); }
.day-header.christmas { background: linear-gradient(106deg,#eef1d9,#dce9d5 87%); }
.day-header.holiday { background: linear-gradient(105deg,#fbf0e3,#f1ddd7 87%); }
.day-stamp { color: #674f73; font-size: .86rem; font-weight: 690; }
.day-header h2 { margin: 4px 0 1px; font: 770 clamp(1.85rem,5vw,2.45rem)/1.18 var(--numbers); letter-spacing: -.065em; }
.day-header .attribution, .day-occasion { color: #5c4d63; font-size: .83rem; max-width: 65%; }
.day-occasion { font-weight: 720; }
.day-art { position: absolute; bottom: 4px; right: 85px; width: 36%; height: 93%; filter: drop-shadow(0 4px 5px #4a29412b); border-radius: 9px; }
.close-day { position: absolute; z-index: 2; top: 12px; right: 12px; }
.day-body { padding: 17px 22px 22px; }
.day-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 4px; }
.day-section-heading h3 { font-size: 1rem; }
.day-meta { font-size: .83rem; color: var(--muted); }
.task-row { min-height: 42px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 10px; border-bottom: 1px solid #f1eaf2; }
.task-check { width: 24px; height: 24px; padding: 0; display: grid; place-items: center; border: 1px solid #bda9c5; border-radius: 7px; color: transparent; background: #fffcff; font-size: 13px; }
.task-check[aria-pressed="true"] { background: #805c8f; border-color: #805c8f; color: white; animation: check-pop .28s ease-out; }
@keyframes check-pop { 50% { transform: scale(1.17); } }
.task-description { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
.task-title { min-width: 0; padding-block: 7px; font-size: .95rem; line-height: 1.38; overflow-wrap: anywhere; }
.task-row.done .task-title { color: #6c6072; text-decoration: line-through; }
.task-edit { display: grid; place-items: center; background: transparent; color: #755883; border: 0; border-radius: 6px; min-width: 27px; height: 27px; font-size: 14px; padding: 0; }
.task-edit:hover { background: #f4ecf7; }
.add-form { display: flex; gap: 7px; margin-top: 10px; }
.add-form input { flex: 1 0 0; min-width: 0; padding: 8px 10px; min-height: 41px; background: #faf6fc; border: 1px solid #e5d8ea; border-radius: 9px; font-size: 1rem; }
.add-form input::placeholder { color: #74627a; }
.add-form .button { background: #765486; border-color: #765486; color: white; padding-inline: 8px; min-width: 41px; }
.add-form .button:hover { background: #60406f; }
.task-edit-form { margin-top: 5px; padding-bottom: 6px; }
.task-edit-form .button { font-size: .82rem; }
.task-edit-form .button.cancel, .task-edit-form .button.remove { background: #fffafd; color: #744e76; border-color: #e4d6e9; min-width: 30px; }
.note-section { margin-top: 15px; }
.note-section textarea { width: 100%; resize: vertical; margin-top: 4px; min-height: 40px; padding: 8px 9px; border: 1px solid transparent; border-radius: 8px; background: #faf6fc; font-size: 1rem; line-height: 1.4; }
.note-section textarea:focus { background: #fff; border-color: #d7bedf; }
.note-section textarea::placeholder { color: #736178; }
.note-section label { font-size: .87rem; color: #624f6c; font-weight: 650; }
.undo-row { display: flex; gap: 7px; align-items: center; margin-top: 7px; }
.undo-row .button { min-height: 25px; padding: 2px 6px; font-size: .77rem; }
.author-badge { flex: none; display: inline-block; padding: 2px 6px; border-radius: 6px; color: #5e4c62; background: #ede4f0; font-size: .75rem; line-height: 1.15; font-weight: 740; white-space: nowrap; }
.author-badge.boy { color: #244e3b; background: #d5ebdb; }
.author-badge.girl { color: #76394d; background: #f6dce4; }
.tile .author-badge { padding: 2px 3px; border-radius: 4px; font-size: .7rem; line-height: 1.05; }
.board-self { color: #65596b; font-size: .76rem; white-space: nowrap; }
.partner-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 1.35rem; margin-bottom: 11px; color: #65596b; font-size: .84rem; }
.presence-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #b0a4af; }
.presence-dot.is-online { background: #4b8c6c; box-shadow: 0 0 0 3px #4b8c6c18; }
.partner-edit { color: #624276; padding: 2px 6px; background: #f2e7f5; border: 1px solid #e8d9ec; border-radius: 6px; font-size: .77rem; font-weight: 680; }
.partner-edit:hover { background: #ead8ef; }
.notice { position: fixed; z-index: 3; right: 16px; bottom: 18px; padding: 9px 12px; background: #53385e; color: white; border-radius: 9px; box-shadow: 0 4px 15px #3c244338; font-size: .89rem; }
.day-notice { position: sticky; bottom: 0; margin: 0 12px 12px; }
@media (max-width: 1030px) {
  .shell { padding-inline: clamp(16px, 3vw, 28px); }
  .spread { grid-template-columns: minmax(224px,.39fr) minmax(0,1fr); gap: 20px; }
  .hero { min-height: 320px; }
  .hero-copy { padding: 20px 17px; }
  .grid { gap: 10px; }
  .tile-slot { min-height: calc(var(--size) - 16px); }
  .tile-face { padding-inline: 7px; }
}
@media (max-width: 830px) {
  .shell { padding: 0 clamp(13px, 3.6vw, 28px) 34px; }
  .topbar { min-height: 64px; }
  .brand-art { width: 52px; }
  .brand strong { font-size: 1.22rem; }
  .spread { grid-template-columns: minmax(0,1fr); gap: 18px; }
  .book-sidebar { display: contents; }
  .hero { min-height: 170px; grid-row: 1; border-radius: 19px 22px 17px 21px; }
  .hero-copy { padding: 20px 14px; }
  .hero h1 { font-size: clamp(2.5rem,8vw,3.45rem); }
  .hero-label { font-size: .76rem; }
  .hero-scene { inset: 6% -1% 0 32%; }
  .hero-model { height: 85%; }
  .taurus-model { bottom: 0; }
  .virgo-model { bottom: 9%; }
  .tray { grid-row: 2; }
  .tray-toolbar { min-height: 41px; }
  .tray-toolbar h2 { font-size: 1.07rem; }
  .month-navigation { gap: 4px; }
  .navigation-month { min-width: 5.9rem; font-size: .92rem; }
  .grid { grid-template-columns: repeat(8,minmax(0,1fr)); gap: clamp(7px, 1.9vw, 12px); }
  .tile-slot { grid-row: var(--phone-row); grid-column: var(--phone-column) / span var(--phone-span); min-height: clamp(73px, 15vw, 98px); }
  .tile { border-radius: 11px 9px 12px 9px; }
  .tile-face { padding: 6px 5px 4px; gap: 2px; }
  .tile-date { font-size: clamp(1.21rem,4vw,1.5rem); }
  .tile-art, .tile-slot.wide .tile-art { width: 72%; height: 91%; }
  .tile-caption { font-size: .7rem; padding: 1px 2px; }
  .tile-slot:has(.has-tasks) { min-height: clamp(78px, 16vw, 98px); }
  .tile-slot:has(.has-tasks .tile-caption, .tile-more) { min-height: 98px; }
  .tile-slot:has(.tile-caption ~ .tile-tasks .tile-more) { min-height: 112px; }
  .tile.has-tasks .tile-art { width: 50%; height: 54%; top: 1%; bottom: auto; }
  .tile:has(.tile-art) .tile-tasks { width: 100%; }
  .tile-tasks { gap: 3px; }
  .tile-task { gap: 3px; font-size: .74rem; }
  .tile-editing { top: 4px; right: 3px; padding: 2px 3px; font-size: .61rem; }
  .day-dialog[open] { width: min(100%, 560px); max-height: 88dvh; position: fixed; inset: auto 0 0; margin: 0 auto; border-radius: 19px 19px 0 0; }
  .day-header { padding: 17px 15px 15px; min-height: 107px; }
  .day-art { right: 58px; bottom: 0; height: 70%; }
  .day-body { padding: 14px 15px max(20px, env(safe-area-inset-bottom)); }
}
@media (max-width: 460px) {
  .hero-scene { inset: 24% -1% 0 38%; }
  .hero-model { width: 53%; height: 83%; }
  .taurus-model { left: 4%; }
  .tile .author-badge { padding: 2px; font-size: .62rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
  .tile:hover .tile-face, .tile:active .tile-face, .tile:focus-visible .tile-face { transform: none; }
  .tile:hover .tile-art { transform: translateZ(7px); }
}
