/* V16: four collected tools, with a common upper-left light source.
   Position and drag transforms belong to the outer nodes; these materials
   never run their own positional animations. */
#space .overlay-shell {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
#space .overlay[data-parked="true"] { display: none; }

/* A real pile of paper, with one quiet, editable front sheet. */
#space > .overlay[data-type="note"][data-size] {
  width: 218px;
  height: 174px;
  padding: 10px 8px 8px;
  --instrument-paper: #fcf5df;
  --instrument-ink: #365363;
}
#space > .overlay[data-type="note"][data-color="blue"] { --instrument-paper: #edf4f6; --instrument-ink: #345b78; }
#space > .overlay[data-type="note"][data-color="sage"] { --instrument-paper: #eff2df; --instrument-ink: #46634a; }
#space > .overlay[data-type="note"][data-color="blush"] { --instrument-paper: #f9eae2; --instrument-ink: #7d5362; }
#space > .overlay[data-type="note"]::before,
#space > .overlay[data-type="note"]::after {
  inset: 14px 10px 10px;
  border: 1px solid #fdfcf3c9;
  border-radius: 2px 4px 3px 2px;
  box-shadow: 1px 3px 2px #536b6f12, 0 11px 17px -13px #29485680;
  animation: none;
}
#space > .overlay[data-type="note"]::before {
  background: linear-gradient(112deg, #c8dce1, #afcbd4);
  transform: translate(-7px, -3px) rotate(-8deg);
}
#space > .overlay[data-type="note"]::after {
  background: repeating-linear-gradient(0deg, transparent 0 23px, #b69c731b 23px 24px), #eee0bd;
  transform: translate(7px, 2px) rotate(6deg);
}
#space > .overlay[data-type="note"][data-size] .overlay-shell {
  height: 156px;
  border: 1px solid #fffdf3;
  border-radius: 2px 3px 13px 2px;
  background: linear-gradient(90deg, transparent 18px, #c8947940 18px 19px, transparent 19px), linear-gradient(110deg, #ffffff50, #ffffff00 60%), var(--instrument-paper);
  color: var(--instrument-ink);
  box-shadow: 0 2px 1px #ad9f791c, 1px 2px #e0d5b9, 2px 3px #fbf2d8, 0 12px 20px -15px #284750aa;
  rotate: -2deg;
}
#space > .overlay[data-type="note"] .overlay-shell::before {
  width: 31px;
  height: 13px;
  top: -8px;
  right: 22px;
  border-radius: 2px 2px 0 0;
  background: repeating-linear-gradient(90deg, #ffffff12 0 2px, #5f879915 2px 3px), #9bb5be;
  box-shadow: inset 0 1px #d8e3e6;
}
#space > .overlay[data-type="note"][data-size] .overlay-header {
  height: 33px;
  min-height: 33px;
  padding: 3px 12px 0 25px;
  margin: 0;
  border: 0;
  background: transparent;
  color: var(--instrument-ink);
}
#space > .overlay[data-type="note"] .overlay-title {
  margin: 0;
  color: inherit;
  font: italic 15px/1.3 Georgia, serif !important;
  letter-spacing: -.15px;
}
#space > .overlay[data-type="note"][data-size] .overlay-body { height: 122px; padding: 5px 14px 14px 25px; }
#space > .overlay[data-type="note"][data-size] .note-input {
  height: 101px;
  min-height: 101px;
  max-height: 101px;
  padding: 0;
  margin: 0;
  color: var(--instrument-ink);
  font: 12px/24px -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: repeating-linear-gradient(transparent 0 23px, #7f9ea629 23px 24px);
  resize: none;
}
#space > .overlay[data-type="note"] .note-input::placeholder { color: #6a7979; }
#space > .overlay[data-type="note"][data-size="compact"] { width: 202px; height: 160px; }
#space > .overlay[data-type="note"][data-size="compact"] .overlay-shell { height: 142px; }
#space > .overlay[data-type="note"][data-size="compact"] .overlay-body { height: 108px; }
#space > .overlay[data-type="note"][data-size="compact"] .note-input { height: 87px; min-height: 87px; max-height: 87px; }

/* Today is one folio. Existing task and timer records remain independent
   controls inside the same draggable surface. */
#space > .today-folio {
  position: absolute;
  left: 0;
  top: 0;
  width: 218px;
  min-height: 202px;
  padding: 0 11px 9px;
  display: flex;
  flex-direction: column;
  isolation: isolate;
  pointer-events: auto;
  touch-action: none;
  cursor: grab;
  color: #36505a;
  border: 1px solid #fafbf7;
  border-radius: 5px 12px 12px 5px;
  background: linear-gradient(90deg, #b9ccc7 0 5px, #f8f5e9 5px 100%);
  box-shadow: inset 6px 0 0 #fcf8eb, inset 7px 0 0 #91a69c35, 1px 3px #e0e3d7, 2px 4px #becac4, 0 15px 24px -17px #214553a6;
}
#space > .today-folio::before {
  content: "";
  position: absolute;
  inset: 6px 0 auto auto;
  width: 35px;
  height: 8px;
  border-radius: 2px 0 0 2px;
  background: linear-gradient(#c8d7b9, #a8bea2);
  box-shadow: 0 1px 0 #73917a30;
  pointer-events: none;
  z-index: -1;
  transform: translate(5px, 7px);
}
#space .today-folio-header {
  order: 0;
  height: 28px;
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 4px 0 6px;
  border-bottom: 1px solid #8caaa324;
  user-select: none;
}
#space .today-folio-header h2,
#space .today-folio-header > span {
  margin: 0;
  font: 600 12px/1.3 -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  letter-spacing: -.1px;
}
#space .today-folio-date { color: #7a8e83; font: 500 9px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .3px; text-transform: uppercase; }
#space .today-folio > .overlay.folio-tool[data-type][data-size] {
  position: relative;
  inset: auto;
  width: 100%;
  min-width: 0;
  height: auto;
  margin: 0;
  padding: 0;
  max-width: none;
  transform: none !important;
  pointer-events: auto;
  --folio-ink: #36594c;
  --folio-surface: #eaf0e2;
}
#space .today-folio > .overlay.folio-tool[data-color="blue"] { --folio-ink: #335978; --folio-surface: #e0eaf3; }
#space .today-folio > .overlay.folio-tool[data-color="sage"] { --folio-ink: #466347; --folio-surface: #e3ebd8; }
#space .today-folio > .overlay.folio-tool[data-color="blush"] { --folio-ink: #805768; --folio-surface: #f1e0e4; }
#space .today-folio > .folio-tool::before,
#space .today-folio > .folio-tool::after,
#space .today-folio > .folio-tool .overlay-shell::before,
#space .today-folio > .folio-tool .overlay-shell::after { display: none; }
#space .today-folio > .folio-tool[data-type][data-size] .overlay-shell {
  width: 100%;
  height: auto;
  min-height: 0;
  overflow: visible;
  clip-path: none;
  border: 0;
  border-radius: 0;
  color: var(--folio-ink);
  background: transparent;
  box-shadow: none;
  rotate: 0deg;
  transition: none;
}
#space .today-folio > .folio-tool .mobile-reorder { display: none; }
#space .today-folio > .folio-tool[data-type="checklist"] { order: 1; }
#space .today-folio > .folio-tool[data-type="checklist"] .overlay-header { position: absolute; inset: 0; height: 0; min-height: 0; padding: 0; margin: 0; border: 0; pointer-events: none; z-index: 2; }
#space .today-folio > .folio-tool[data-type="checklist"] .overlay-title,
#space > .overlay[data-type="clock"] .overlay-title {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  white-space: nowrap;
  clip-path: inset(50%);
}
#space .today-folio .keyboard-move { pointer-events: auto; }
#space .today-folio .keyboard-move:focus-visible { position: absolute; right: 2px; top: -23px; width: 28px; height: 28px; background: #edf3eb; border: 1px solid #88a697; border-radius: 6px; z-index: 3; }
#space .today-folio > .folio-tool[data-type="checklist"][data-size] .checklist-items {
  min-height: 88px;
  max-height: 88px;
  height: 88px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 3px;
  background: transparent;
  scrollbar-width: thin;
  scrollbar-color: #a4b7ac transparent;
}
#space .today-folio > .folio-tool[data-type="checklist"] .checklist-items label { min-height: 44px; height: 44px; gap: 4px; border-bottom: 1px solid #a1b1a51c; }
#space .today-folio > .folio-tool[data-type="checklist"] .checklist-items input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  margin: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
#space .today-folio > .folio-tool[data-type="checklist"] input[type="checkbox"]::before { content: ""; position: absolute; width: 15px; height: 15px; top: 14px; left: 13px; border: 1px solid #9fae9c; border-radius: 4px; background: #fffdf6; box-shadow: inset 0 1px #617d6515, 0 1px #fff; }
#space .today-folio > .folio-tool[data-type="checklist"] input[type="checkbox"]:checked::before { background: var(--folio-ink); border-color: var(--folio-ink); }
#space .today-folio > .folio-tool[data-type="checklist"] input[type="checkbox"]:checked::after { content: ""; position: absolute; top: 17px; left: 18px; width: 5px; height: 8px; border: solid #fff; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
#space .today-folio > .folio-tool[data-type="checklist"] .checklist-text { height: 44px; min-height: 44px; padding: 0; color: var(--folio-ink); font: 11px/1.4 -apple-system, BlinkMacSystemFont, system-ui, sans-serif; }
#space .today-folio > .folio-tool[data-type="checklist"][data-color]:not([data-color="pearl"]) .checklist-items { background: color-mix(in srgb, var(--folio-surface) 55%, transparent); border-radius: 4px; }
#space .today-folio > .folio-tool[data-type="timer"] { order: 2; }
#space .today-folio > .folio-tool[data-type="timer"][data-size] .overlay-shell {
  height: 74px;
  margin-top: 1px;
  border: 1px solid #c8d3c44f;
  border-radius: 8px;
  background: linear-gradient(125deg, #ffffff5e, transparent 70%), var(--folio-surface);
  box-shadow: inset 0 1px 2px #415f4610, 0 1px #ffffffe0;
}
#space .today-folio > .folio-tool[data-type="timer"] .overlay-header {
  position: absolute;
  left: 9px;
  right: 94px;
  top: 8px;
  height: 12px;
  min-height: 12px;
  margin: 0;
  padding: 0;
  border: 0;
  pointer-events: none;
}
#space .today-folio > .folio-tool[data-type="timer"] .overlay-title { display: block; margin: 0; color: var(--folio-ink); font: 600 8px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace !important; letter-spacing: 1px; text-transform: uppercase; opacity: .7; }
#space .today-folio > .folio-tool[data-type="timer"] .tool-indicator { display: none; }
#space .today-folio > .folio-tool[data-type="timer"][data-size] .overlay-body { height: 72px; min-height: 72px; padding: 0; }
#space .today-folio > .folio-tool[data-type="timer"][data-size] .timer-value { position: absolute; left: 9px; right: auto; top: 23px; width: 80px; margin: 0; color: var(--folio-ink); font: 500 27px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: -1.8px; text-align: left; }
#space .today-folio > .folio-tool[data-type="timer"] .timer-dial { display: none; }
#space .today-folio > .folio-tool[data-type="timer"] .timer-track { display: block; position: absolute; left: 9px; right: 9px; bottom: 9px; width: auto; height: 2px; margin: 0; border-radius: 2px; background: #829c7b24; overflow: hidden; }
#space .today-folio > .folio-tool[data-type="timer"] .timer-track i { height: 2px; background: var(--folio-ink); box-shadow: none; }
#space .today-folio > .folio-tool[data-type="timer"][data-size] .timer-actions { position: absolute; inset: 11px 3px auto auto; display: flex; margin: 0; gap: 1px; }
#space .today-folio > .folio-tool[data-type="timer"] .timer-actions .round-control { width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 10px; border: 4px solid transparent; background: linear-gradient(#fffef5, #e0e7d9) padding-box; border-radius: 50%; box-shadow: none; transition: transform 100ms ease-out; }
#space .today-folio > .folio-tool[data-type="timer"] .timer-toggle { background: linear-gradient(var(--folio-ink), var(--folio-ink)) padding-box !important; border-color: transparent !important; }
#space .today-folio > .folio-tool[data-type="timer"] .timer-actions .round-control img { width: 14px; height: 14px; }
#space .today-folio > .folio-tool[data-type="timer"] .timer-state { display: none; }
#space .today-folio > .folio-tool[data-type="timer"] .round-control:active { transform: scale(.94); }
#space .today-folio > .folio-tool[data-type="timer"][data-size="compact"] .timer-value { font-size: 24px; letter-spacing: -1.4px; }
#space .today-folio > .folio-tool[data-type="checklist"][data-size="compact"] .checklist-text { font-size: 10px; }
#space .today-folio:has(.folio-tool[data-type="timer"][data-size="compact"]):has(.folio-tool[data-type="checklist"][data-size="compact"]) { width: 206px; }
#space .today-folio:focus-visible,
#space .today-folio.moving { outline: 2px solid #6093bc; outline-offset: 5px; }
#space .today-folio.dragging { cursor: grabbing; will-change: transform; z-index: 60 !important; }
#space .today-folio.dragging .overlay-shell { cursor: grabbing; }

/* A small two-city travel clock, subordinate to the useful tools. */
#space > .overlay[data-type="clock"][data-size] { width: 145px; height: 64px; }
#space > .overlay[data-type="clock"][data-size] .overlay-shell {
  height: 64px;
  overflow: visible;
  border: 1px solid #f6faf8;
  border-radius: 11px;
  background: linear-gradient(125deg, #f3f6f2, #d8e0dc 48%, #e9ede8);
  color: #3f5660;
  box-shadow: inset 0 1px #fff, inset 0 -2px #bcc9c7, 0 9px 15px -11px #284b62bd;
  rotate: 2deg;
}
#space > .overlay[data-type="clock"][data-color="blue"] .overlay-shell { background: linear-gradient(125deg, #f0f7fc, #c6dae5, #e4eef4); }
#space > .overlay[data-type="clock"][data-color="sage"] .overlay-shell { background: linear-gradient(125deg, #f1f5eb, #d4dfc9, #e8eede); }
#space > .overlay[data-type="clock"][data-color="blush"] .overlay-shell { background: linear-gradient(125deg, #fff2ee, #e9d8d5, #f4e9e5); }
#space > .overlay[data-type="clock"] .overlay-shell::before,
#space > .overlay[data-type="clock"] .overlay-shell::after { display: none; }
#space > .overlay[data-type="clock"][data-size] .overlay-header { position: absolute; inset: 0; height: 0; min-height: 0; padding: 0; margin: 0; border: 0; pointer-events: none; }
#space > .overlay[data-type="clock"] .keyboard-move { pointer-events: auto; }
#space > .overlay[data-type="clock"] .keyboard-move:focus-visible { position: absolute; right: -5px; top: -12px; width: 28px; height: 28px; background: #f1f7f3; border: 1px solid #9aacb3; border-radius: 7px; z-index: 3; }
#space > .overlay[data-type="clock"][data-size] .world-times { height: 62px; min-height: 62px; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; padding: 10px 10px 9px !important; }
#space > .overlay[data-type="clock"][data-size] .world-times > div { position: relative; display: flex; flex-direction: column; gap: 5px; min-width: 0; padding: 0; border: 0; }
#space > .overlay[data-type="clock"] .world-times > div + div { padding-left: 8px; border-left: 1px solid #98adad45; }
#space > .overlay[data-type="clock"][data-size] .world-times span { color: #667c82; font: 9px/1.2 -apple-system, BlinkMacSystemFont, system-ui, sans-serif; letter-spacing: 0; }
#space > .overlay[data-type="clock"] .world-times span::before { display: none; }
#space > .overlay[data-type="clock"] .world-times .zone-label { display: flex; align-items: center; gap: 4px; padding-left: 0; white-space: nowrap; }
#space > .overlay[data-type="clock"] .world-times .zone-daylight { position: static; flex: 0 0 5px; width: 5px; height: 5px; border-radius: 50%; background: #ca9c49; box-shadow: 0 0 0 1px #a6833f14; }
#space > .overlay[data-type="clock"] .world-times [data-night="true"] .zone-daylight { background: #6c8fa6; box-shadow: none; }
#space > .overlay[data-type="clock"][data-size] .world-times time { font: 500 18px/1.1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: -1px; color: #345263; }
#space > .overlay[data-type="clock"][data-size="compact"] { width: 137px; }
#space > .overlay[data-type="clock"][data-size="compact"] .world-times { gap: 6px; padding-inline: 8px !important; }

/* Breakout is a slim handheld window, with a shallow edge and usable keys. */
#space > .overlay[data-type="game"][data-size] { width: 234px; }
#space > .overlay[data-type="game"][data-size] .overlay-shell {
  height: 194px;
  border: 1px solid #899ba2;
  border-radius: 13px;
  background: linear-gradient(120deg, #4d5d66, #273841 42%, #24343c);
  box-shadow: inset 0 1px #d5e4e966, inset 0 -2px #0a1c26, 0 3px #283d47, 0 13px 21px -15px #18384dcc;
  rotate: -2deg;
}
#space > .overlay[data-type="game"][data-color="blue"] .overlay-shell { background: linear-gradient(120deg, #557186, #2d495e 42%, #233b4b); }
#space > .overlay[data-type="game"][data-color="sage"] .overlay-shell { background: linear-gradient(120deg, #65776b, #3c574b 42%, #2a423a); }
#space > .overlay[data-type="game"][data-color="blush"] .overlay-shell { background: linear-gradient(120deg, #806d7c, #59485d 42%, #403444); }
#space > .overlay[data-type="game"][data-size] .overlay-header { height: 22px; min-height: 22px; padding: 2px 12px 0; border: 0; }
#space > .overlay[data-type="game"] .overlay-title { margin: 0; color: #d8deea; font: 500 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace !important; letter-spacing: 2px; text-transform: uppercase; }
#space > .overlay[data-type="game"] .tool-indicator { width: 3px; height: 3px; background: #91acb5; }
#space > .overlay[data-type="game"][data-size] .game-wrap { padding: 0 8px 8px; }
#space > .overlay[data-type="game"][data-size] .game-scorebar { height: 21px; min-height: 21px; margin: 0 0 5px; padding: 2px 6px; gap: 9px; justify-content: flex-start; color: #9fb2c0; border: 1px solid #142832; border-radius: 5px; background: #1e3039; box-shadow: inset 0 1px 2px #091d253d; font: 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
#space > .overlay[data-type="game"] .game-scorebar span { display: flex; gap: 3px; align-items: center; white-space: nowrap; }
#space > .overlay[data-type="game"] .game-scorebar b { color: #e7dfbb; font-size: 10px; }
#space > .overlay[data-type="game"] .game-scorebar .game-lives { margin-left: auto; letter-spacing: -1px; font-size: 8px; }
#space > .overlay[data-type="game"][data-size] .game-canvas { box-sizing: border-box; width: 100%; height: 88px; aspect-ratio: auto !important; border: 3px solid #152630; border-radius: 6px; background: #0d1c26; box-shadow: 0 1px #768f9e5c, inset 0 2px 5px #0005; }
#space > .overlay[data-type="game"][data-size] .game-bottom { height: 48px; min-height: 48px; margin: 0; padding: 4px 0 0; gap: 7px; }
#space > .overlay[data-type="game"] .game-bottom::before { width: 28px; height: 11px; background: repeating-linear-gradient(90deg, #10252f 0 2px, #95a7b323 2px 3px, transparent 3px 5px); }
#space > .overlay[data-type="game"] .game-controls { gap: 4px; }
#space > .overlay[data-type="game"] .game-controls button { width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 12px; border: 4px solid transparent; border-radius: 50%; background: linear-gradient(#e7ece7, #c4cfcb) padding-box; box-shadow: none; transition: transform 100ms ease-out; }
#space > .overlay[data-type="game"] .game-controls [data-game-play],
#space > .overlay[data-type="game"] .game-controls [data-game-pause] { border-color: transparent; border-radius: 14px; color: #253640; background: linear-gradient(#e2ddf3, #b9b2d5) padding-box; }
#space > .overlay[data-type="game"] .game-controls button:active { transform: scale(.94); }
#space > .overlay[data-type="game"] .game-controls img { width: 16px; height: 16px; }
#space > .overlay[data-type="game"][data-size="compact"] { width: 220px; }
#space > .overlay[data-type="game"][data-size="compact"] .game-scorebar { gap: 6px; }

#space > .overlay:is([data-type="note"], [data-type="clock"], [data-type="game"]):is(.dragging, :focus-within) .overlay-shell { rotate: 0deg; }
#space .today-folio .folio-tool.moving .overlay-shell { outline: 2px solid #6093bc; outline-offset: 2px; }

@media (min-width: 900px) and (max-height: 700px) {
  #space > .overlay[data-type="note"][data-size="comfortable"] { width: 208px; height: 164px; }
  #space > .overlay[data-type="note"][data-size="comfortable"] .overlay-shell { height: 146px; }
  #space > .overlay[data-type="note"][data-size="comfortable"] .overlay-body { height: 112px; }
  #space > .overlay[data-type="note"][data-size="comfortable"] .note-input { height: 91px; min-height: 91px; max-height: 91px; }
}

@media (max-width: 899px) {
  #space > .today-folio { position: relative; inset: auto; flex: 0 0 auto; margin: 14px auto 64px; max-width: calc(100% - 24px); touch-action: pan-y; cursor: auto; }
  #space > .today-folio .folio-tool { touch-action: pan-y; }
  #space > .overlay:is([data-type="note"], [data-type="clock"], [data-type="game"])[data-size] { flex: 0 0 auto; max-width: calc(100% - 24px); margin: 14px auto 64px; }
  #space > .overlay[data-type="note"][data-size] .overlay-shell { rotate: -2deg; }
  #space > .overlay[data-type="game"][data-size] .overlay-shell { overflow: visible; }
  #space > .overlay:is([data-type="game"], [data-type="clock"]) .mobile-reorder { position: absolute; top: calc(100% + 14px); left: 50%; width: 250px; max-width: calc(100vw - 48px); min-height: 44px; padding: 0 8px; border: 0; border-radius: 11px; background: #edf3ecdb; color: #405c60; transform: translateX(-50%); }
  #space > .overlay:is([data-type="game"], [data-type="clock"]) .mobile-reorder button { min-height: 44px; color: #385b60; }
  #space .today-folio > .folio-tool[data-type="checklist"] .mobile-reorder { display: flex; position: absolute; top: calc(100% + 89px); left: 50%; width: 250px; max-width: calc(100vw - 48px); min-height: 44px; padding: 0 8px; border: 0; border-radius: 11px; background: #edf3ecdb; color: #405c60; transform: translateX(-50%); }
  #space .today-folio > .folio-tool[data-type="checklist"] .mobile-reorder button { min-height: 44px; color: #385b60; }
  #space .today-folio > .folio-tool[data-type="timer"] .mobile-reorder { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  #space > .overlay .overlay-shell,
  #space .today-folio .round-control,
  #space > .overlay[data-type="game"] .game-controls button { transition: none; }
}
@media (prefers-contrast: more) {
  #space > .today-folio { border-color: #657e79; }
  #space > .overlay[data-type="note"] .overlay-shell { border-color: #908571; }
  #space > .overlay[data-type="clock"] .overlay-shell { border-color: #617f8b; }
  #space > .overlay[data-type="game"] .overlay-shell { border-color: #c6dbe7; }
}
