:root {
  color-scheme: light;
  --paper: #faf7ee;
  --ink: #24263d;
  --muted: #5d5d70;
  --line: #e6e0d4;
  --display: "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Avenir Next", "Segoe UI", system-ui, sans-serif;
  font-family: var(--body);
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .43; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid #262947;
  outline-offset: 4px;
}
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
svg { width: 20px; height: 20px; display: block; }
.shell { width: min(1120px, calc(100% - 72px)); margin-inline: auto; }
main { padding-bottom: 42px; }
.top { border-bottom: 1px solid var(--line); background: #fffcf5; }
.top-inner { height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.backup-button { min-height: 38px; padding: 6px 12px; border: 1px solid #c9d4f8; border-radius: 10px; background: #eef2ff; color: #3047a5; font-size: .88rem; font-weight: 750; }
.backup-button:hover:not(:disabled) { background: #e1e8ff; }
.brand { display: inline-flex; gap: 11px; align-items: center; text-decoration: none; color: var(--ink); font-size: 1.43rem; font-weight: 850; letter-spacing: -.065em; }
.brand > span:last-child > span { color: #3f5fcc; }
.brand-mark { display: grid; grid-template-columns: repeat(2, 12px); gap: 3px; transform: rotate(-9deg); }
.brand-mark i { height: 12px; border-radius: 3px; background: #fa6c62; box-shadow: inset 0 -2px #26294726; }
.brand-mark i:nth-child(2) { background: #719df8; }
.brand-mark i:nth-child(3) { background: #ffce44; }
.brand-mark i:nth-child(4) { background: #70d4ab; }
.storage { display: inline-flex; align-items: center; gap: 7px; border: 1px solid #e1dbcf; border-radius: 30px; padding: 7px 12px; background: #fffef9; color: #52536a; font-size: .81rem; font-weight: 700; }
.storage svg { width: 16px; height: 16px; color: #397758; flex: none; }
.storage[data-error] { color: #922d2d; }
.storage[data-error] svg { display: none; }
.intro {
  position: relative; overflow: hidden; isolation: isolate; margin-top: 33px;
  min-height: 221px; padding: 40px 47px; display: flex; align-items: center;
  background-color: #e8edff; background-image: radial-gradient(#9daee65c 1.25px, transparent 1.25px);
  background-size: 17px 17px; border: 1.5px solid #d0d9fb; border-radius: 26px;
}
.intro > div:first-child { position: relative; z-index: 1; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--display); font-weight: 850; }
h1 { font-size: clamp(3rem, 7vw, 5.45rem); line-height: .99; letter-spacing: -.085em; }
h1 span { color: #f06357; }
.intro p { color: #454d70; margin-top: 15px; font-weight: 600; font-size: 1.06rem; }
.toy-stack { position: absolute; width: 260px; height: 169px; right: 61px; top: 25px; }
.toy { position: absolute; display: block; border-radius: 19px; border: 2px solid var(--rim); background: var(--face); box-shadow: inset 0 3px #ffffff80, inset 0 -6px #1716441c, 0 5px var(--rim), 0 10px 10px #3b458022; }
.toy::before, .toy::after { content: ""; position: absolute; top: 20%; width: 31%; aspect-ratio: 1; border-radius: 50%; background: var(--stud); box-shadow: inset 0 2px #ffffff77, 0 2px var(--rim); }
.toy::before { left: 13%; }
.toy::after { right: 13%; }
.toy-blue { --face: #7ba3ff; --rim: #476acb; --stud: #9dbbff; width: 128px; height: 70px; left: 24px; top: 77px; transform: rotate(-13deg); }
.toy-red { --face: #ff7467; --rim: #d6544d; --stud: #ff9a87; width: 124px; height: 71px; left: 111px; top: 84px; transform: rotate(13deg); }
.toy-yellow { --face: #ffd455; --rim: #dca731; --stud: #ffe487; width: 104px; height: 62px; left: 75px; top: 26px; transform: rotate(-12deg); }
.toy-spark { position: absolute; top: 6px; right: 13px; color: #4968ce; font-size: 2rem; line-height: 1; }
.board-heading { margin: 34px 0 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.board-heading h2 { font-size: 1.65rem; letter-spacing: -.045em; }
.board-heading p { margin-top: 3px; font-size: .92rem; color: var(--muted); font-weight: 600; }
.primary { display: inline-flex; justify-content: center; align-items: center; gap: 7px; white-space: nowrap; padding: 10px 17px; min-height: 44px; border: 1px solid #263eaa; border-radius: 12px; background: #3c58d4; color: white; box-shadow: 0 3px #273b9d; font-weight: 750; font-size: .91rem; }
.primary:hover { background: #324dc7; }
.primary:active { translate: 0 2px; box-shadow: 0 1px #273b9d; }
.board { --board-columns: 3; position: relative; display: grid; grid-template-columns: repeat(var(--board-columns), minmax(0, 1fr)); align-items: start; gap: 20px; }
.board.free-board { display: block; height: var(--canvas-height); isolation: isolate; }
.free-board > .block, .free-board > .add-tile { position: absolute; }
.free-board > .block { width: var(--free-width); left: var(--free-left); top: var(--free-top); }
.free-board > .add-tile { left: 0; }
.free-board > .block:focus-within { z-index: 1; }
.free-board > .block.is-manipulating { z-index: 2; user-select: none; }
[data-color="red"]    { --face: #ff8276; --edge: #de5d54; --well: #55343d; --surface: #fff0e9; --tint: #ffe0d9; }
[data-color="blue"]   { --face: #86aafa; --edge: #6488e0; --well: #2f457c; --surface: #f1f5ff; --tint: #dce8ff; }
[data-color="yellow"] { --face: #ffda65; --edge: #d9ad39; --well: #574729; --surface: #fff9df; --tint: #fff0b4; }
[data-color="green"]  { --face: #83d9b6; --edge: #54ac8c; --well: #274e45; --surface: #effff5; --tint: #d3f6e5; }
[data-color="purple"] { --face: #c6abff; --edge: #a185df; --well: #493867; --surface: #faf1ff; --tint: #ecdeff; }
.block { --block-min-width: 220px; position: relative; display: flex; flex-direction: column; min-width: 0; min-height: var(--block-height, 0px); padding: 15px 15px 30px; border: 1.5px solid var(--edge); border-radius: 22px; background: var(--face); box-shadow: inset 0 2px #ffffff66, 0 5px var(--edge); }
.block[data-type="calendar"] { --block-min-width: 242px; }
.board > .block { grid-column: span min(var(--board-columns), var(--block-columns, var(--default-columns, 1))); }
.block[data-type="notes"] { --default-columns: 2; }
.block-header { display: flex; align-items: center; margin-bottom: 13px; gap: 8px; min-width: 0; }
.block-type-icon { display: grid; place-items: center; flex: none; width: 35px; height: 35px; border-radius: 10px; background: #ffffff64; }
.block-header h3 { flex: 1; min-width: 0; font-size: 1.09rem; letter-spacing: -.025em; overflow-wrap: anywhere; }
.icon-button { display: grid; place-items: center; padding: 0; width: 34px; height: 35px; flex: none; border: 1px solid transparent; background: transparent; border-radius: 9px; }
.icon-button:hover { background: #ffffff65; }
.drag-handle { cursor: grab; touch-action: none; }
.drag-handle:active { cursor: grabbing; }
.resize-handle { position: absolute; right: 7px; bottom: 2px; width: 30px; height: 27px; cursor: nwse-resize; touch-action: none; }
.resize-handle svg { width: 16px; height: 16px; }
.block-body { flex: 1; display: flex; flex-direction: column; }
.block:not([data-custom-height]) .block-body { min-height: 144px; }
.timer-display { flex: 1; display: grid; align-content: center; background: var(--well); color: var(--surface); text-align: center; border-radius: 13px; padding: 8px 4px 10px; box-shadow: inset 0 3px #0002; }
.digits { font-size: clamp(1.85rem, 4.1vw, 3rem); line-height: 1.08; font-weight: 800; letter-spacing: -.065em; font-variant-numeric: tabular-nums; }
.timer-status { display: block; font-size: .74rem; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; margin-top: 4px; }
.timer-controls { display: grid; grid-template-columns: 1fr 45px; gap: 8px; margin-top: 10px; }
.countup { flex: 1; display: grid; grid-template-rows: 1fr auto; }
.countup-display { display: grid; align-content: center; padding: 8px 10px; background: var(--well); color: var(--surface); border-radius: 13px; box-shadow: inset 0 3px #0002; text-align: center; }
.countup-calendar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.countup-calendar > div + div { border-inline-start: 1px solid #ffffff48; }
.countup-calendar .digits { display: block; font-size: clamp(1.6rem, 3.1vw, 2.45rem); overflow-wrap: anywhere; }
.countup-unit { font-size: .76rem; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }
.countup-time { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin-top: 7px; padding: 5px 0; border-radius: 8px; background: #ffffff16; font-size: 1.18rem; line-height: 1.12; font-weight: 750; font-variant-numeric: tabular-nums; }
.countup-time .countup-unit { display: block; margin-top: 3px; font-size: .7rem; letter-spacing: .04em; }
.countup-since { padding-top: 6px; text-align: center; font-size: .82rem; font-weight: 700; color: var(--well); }
.toy-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 5px 9px; background: var(--surface); color: var(--ink); border: 1px solid #0002; border-radius: 10px; box-shadow: 0 2px #0003; font-size: .9rem; font-weight: 750; }
.toy-button:hover:not(:disabled) { background: white; }
.toy-button:active:not(:disabled) { translate: 0 1px; box-shadow: 0 1px #0003; }
.toy-button svg { width: 17px; height: 17px; }
.clock { flex: 1; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: clamp(8px, 1.5vw, 17px); padding: 10px; background: var(--surface); border-radius: 13px; box-shadow: inset 0 2px #00000014; }
.clock-face { position: relative; width: clamp(64px, 8vw, 97px); aspect-ratio: 1; flex: none; border: 3px solid var(--well); border-radius: 50%; background: #fff; box-shadow: 0 3px #0002; }
.clock-face::after { content: ""; position: absolute; z-index: 2; width: 8%; aspect-ratio: 1; border-radius: 50%; background: var(--well); top: 50%; left: 50%; translate: -50% -50%; }
.tick { position: absolute; width: 3%; height: 7%; background: var(--well); top: 6%; left: 48.5%; transform-origin: 50% 630%; border-radius: 4px; }
.hand { position: absolute; bottom: 50%; left: 50%; width: 4%; height: 29%; border-radius: 5px; background: var(--well); transform-origin: center bottom; transform: translateX(-50%) rotate(var(--angle, 0deg)); }
.hand.minute { height: 39%; width: 3%; }
.hand.second { height: 40%; width: 2%; background: #d84946; }
.clock-copy { min-width: 0; }
.clock-copy time { display: block; white-space: nowrap; font-size: clamp(1.5rem, 2.75vw, 2.25rem); }
.clock-copy time small { font-size: .46em; letter-spacing: 0; margin-left: 4px; }
.clock-copy p { margin-top: 5px; color: var(--well); font-size: .82rem; font-weight: 700; }
.calendar { flex: 1; display: flex; flex-direction: column; padding: 10px; border-radius: 13px; background: var(--surface); box-shadow: inset 0 2px #00000014; }
.calendar table { flex: 1; width: 100%; table-layout: fixed; border-collapse: collapse; text-align: center; }
.calendar caption { padding-bottom: 7px; color: var(--well); font-weight: 850; font-size: 1.02rem; }
.calendar th { height: 24px; padding: 0; color: var(--well); font-size: .72rem; font-weight: 750; }
.calendar td { height: 28px; padding: 0; font-size: .86rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.calendar td time { display: inline-grid; place-items: center; width: min(100%, 27px); height: 25px; border-radius: 8px; }
.calendar [aria-current="date"] { color: var(--surface); background: var(--well); font-weight: 850; }
.calendar-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 7px; }
.calendar-controls .toy-button { min-height: 34px; padding-inline: 3px; background: var(--tint); font-size: .81rem; }
.habit { flex: 1; display: grid; grid-template-columns: 42px minmax(0, 1fr) 42px; align-items: start; gap: 8px; padding: 13px 10px 12px; background: var(--surface); border-radius: 13px; box-shadow: inset 0 2px #00000014; }
.habit .toy-button { align-self: start; margin-top: 7px; background: var(--tint); }
.habit:has(progress[hidden]) { align-content: center; }
.habit:has(progress[hidden]) .toy-button { align-self: center; margin-top: 0; }
.habit .increment { background: var(--well); color: var(--surface); }
.habit .increment:hover:not(:disabled) { background: var(--ink); }
.habit-count { text-align: center; min-width: 0; }
.habit-count .digits { overflow-wrap: anywhere; }
.habit-count p { font-size: .79rem; color: var(--well); font-weight: 750; margin-top: 5px; overflow-wrap: anywhere; }
.habit progress { grid-column: 1 / -1; align-self: end; width: 100%; height: 9px; border: 0; border-radius: 10px; background: var(--tint); color: var(--well); overflow: hidden; }
.habit progress::-webkit-progress-bar { background: var(--tint); }
.habit progress::-webkit-progress-value { background: var(--well); border-radius: 10px; }
.habit progress::-moz-progress-bar { background: var(--well); border-radius: 10px; }
.notes { flex: 1; width: 100%; min-height: 76px; border: 1px solid #0002; border-radius: 12px; background: repeating-linear-gradient(to bottom, transparent 0 27px, var(--tint) 27px 28px), var(--surface); background-position: 0 11px; color: var(--ink); padding: 10px 13px; line-height: 28px; resize: none; }
.notes::placeholder { color: #52685f; opacity: 1; }
.add-tile { min-height: 213px; background: #fffcf552; border: 2px dashed #d5cdbb; border-radius: 22px; display: grid; place-content: center; justify-items: center; gap: 8px; color: var(--ink); }
.add-tile:hover { background: #f1edff; border-color: #9eaafb; }
.add-tile .add-icon { width: 43px; height: 43px; display: grid; place-items: center; color: #415ed4; border-radius: 12px; background: #e8edff; margin-bottom: 2px; }
.add-tile strong { font-size: 1rem; }
.add-tile small { color: var(--muted); font-size: .84rem; }
.undo-toast { position: fixed; z-index: 5; right: 18px; bottom: 18px; display: flex; align-items: center; gap: 12px; max-width: calc(100% - 36px); padding: 10px 12px 10px 15px; border: 1px solid var(--line); border-radius: 13px; background: #fffcf5; box-shadow: 0 5px 16px #24263d29; font-size: .9rem; font-weight: 700; }
.undo-toast span { overflow-wrap: anywhere; }
.undo-toast button { border: 0; padding: 7px 10px; border-radius: 7px; background: #e8edff; color: #2b449f; font-weight: 800; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
dialog { width: min(470px, calc(100vw - 30px)); max-height: calc(100dvh - 30px); padding: 24px; border: 1px solid #dcd5c7; border-radius: 22px; color: var(--ink); background: #fffcf5; box-shadow: 0 12px 28px #24263d38; }
dialog::backdrop { background: #22264170; }
.dialog-heading { display: flex; justify-content: space-between; align-items: start; margin-bottom: 18px; gap: 8px; }
.dialog-heading h2 { font-size: 1.65rem; letter-spacing: -.045em; }
.dialog-heading p { color: var(--muted); margin-top: 4px; }
.backup-section { display: grid; justify-items: start; gap: 12px; }
.backup-section + .backup-section { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.backup-section p { color: var(--muted); font-size: .9rem; }
.backup-section .field { width: 100%; margin: 0; min-width: 0; }
.backup-section input::file-selector-button { margin-inline-end: 8px; font: inherit; }
.backup-message[data-error] { color: #922d2d; }
.close { background: #eeeae0; }
.block-choices { display: grid; gap: 8px; }
.choice { display: flex; text-align: left; align-items: center; gap: 12px; padding: 9px 12px; border: 1px solid var(--edge); border-radius: 12px; background: var(--surface); }
.choice:hover { background: var(--tint); }
.choice .block-type-icon { background: var(--face); }
.choice small { display: block; font-size: .82rem; color: var(--well); margin-top: 2px; }
.field { display: grid; gap: 6px; margin-bottom: 13px; font-size: .92rem; font-weight: 700; }
.field input, .field select { width: 100%; border: 1px solid #cfc8ba; border-radius: 9px; min-height: 42px; padding: 7px 10px; background: white; }
.color-field { margin: 0; padding: 0; border: 0; font-weight: 700; font-size: .92rem; }
#colors { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 18px; }
.swatch { display: grid; place-items: center; width: 37px; height: 37px; background: var(--face); border: 1px solid var(--edge); border-radius: 10px; cursor: pointer; }
.swatch svg { visibility: hidden; }
.swatch:has(input:checked) { outline: 2px solid var(--ink); outline-offset: 2px; }
.swatch:has(input:checked) svg { visibility: visible; }
.swatch:focus-within { outline: 3px solid #364dce; outline-offset: 3px; }
.dialog-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 9px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.remove { border: 0; border-radius: 8px; padding: 10px 5px; color: #a33136; background: transparent; font-weight: 750; }
.remove:hover { background: #fae4e0; }
@media (max-width: 920px) {
  .shell { width: calc(100% - 48px); }
  .board { --board-columns: 2; }
  .block[data-type="notes"] { --default-columns: 1; }
  .toy-stack { right: 25px; }
}
@media (min-width: 601px) and (max-width: 745px) {
  .intro { padding-inline: 31px; }
  .intro p { max-width: 300px; }
  .toy-stack { transform: scale(.78); transform-origin: right center; right: 16px; }
}
@media (max-width: 600px) {
  .shell { width: calc(100% - 30px); }
  .top-inner { min-height: 61px; height: auto; padding-block: 8px; flex-wrap: wrap; }
  .intro { margin-top: 20px; min-height: 178px; padding: 24px 20px; }
  .intro p { width: min(63vw, 260px); font-size: .94rem; }
  .toy-stack { transform: scale(.59); transform-origin: top right; top: 8px; right: -5px; opacity: .85; }
  .board-heading { margin-top: 26px; }
  .board-heading h2 { font-size: 1.4rem; }
  .board-heading p { font-size: .83rem; }
  .board { --board-columns: 1; gap: 16px; }
  .clock-face { width: 90px; }
  .digits { font-size: 2.65rem; }
  .clock-copy time { font-size: 2rem; }
  .add-tile { min-height: 145px; }
}
@media (max-width: 395px) {
  .toy-stack { display: none; }
  .board-heading .primary { padding-inline: 10px; }
  .top-actions .storage:not([data-error]) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
