@font-face {
  font-family: Babayka;
  src: url('./assets/fonts/babayka.ttf') format('truetype');
  font-display: swap;
}
@font-face {
  font-family: 'Dela Gothic One';
  src: url('./assets/fonts/headline-candidates/DelaGothicOne-Regular.ttf') format('truetype');
  font-display: swap;
}
@font-face {
  font-family: Caveat;
  src: url('./assets/caveat-cyrillic.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: Caveat;
  src: url('./assets/caveat-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --desk: #e7edf3;
  --paper: #f9fbfc;
  --paper-edge: #c3ceda;
  --ink: #253240;
  --muted: #526273;
  --rule: #d6dfe8;
  --dot: #b8c8d8;
  --green: #28566d;
  --green-tint: #e1edf4;
  --marker: #a3daeb;
  --meeting: #e7eef8;
  --hand: Babayka, 'Segoe Print', cursive;
  --font: system-ui, -apple-system, sans-serif;
  --ruling: 1.75rem;
  font: 400 100%/1.5 var(--font);
}

*, ::before, ::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--desk); color: var(--ink); }
h1, h2, h3, p, ul { margin: 0; }
button, input, textarea, select { color: inherit; font: inherit; }
button, summary { cursor: pointer; }
button:disabled { cursor: default; }
button, summary, a { touch-action: manipulation; }
a { color: var(--green); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.desk { display: flex; flex-direction: column; min-height: 100svh; padding: clamp(0.75rem, 2.25vw, 2.5rem) clamp(0.75rem, 2.6vw, 3.5rem) clamp(1.25rem, 2.75vw, 3rem); }
.masthead { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-inline: clamp(0rem, 1.5vw, 1.25rem); }
.wordmark { display: flex; align-items: center; gap: 0.5rem; padding-block: 0.5rem 0.875rem; color: var(--green); font-size: 1.075rem; font-weight: 800; letter-spacing: -0.035em; }
.brand-mark { display: grid; place-items: center; width: 1.55rem; height: 1.55rem; border-radius: 0.35rem; background: var(--green); color: var(--paper); line-height: 1; }
.bookmarks { display: flex; align-self: end; padding-inline: 0.3rem; clip-path: inset(-1rem -2rem -2px); }
.bookmarks a {
  position: relative;
  display: grid;
  min-height: 2.3rem;
  place-items: center;
  isolation: isolate;
  padding: 0.4rem 1.8rem 0.5rem;
  color: var(--green);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 650;
  transition: transform 180ms cubic-bezier(.22, 1, .36, 1), color 180ms ease;
}
.bookmarks a + a { margin-inline-start: -0.55rem; }
.bookmarks a:not([aria-current="page"]) { transform: translateY(3px); }
.bookmarks a:focus-visible { z-index: 3; }
.bookmarks a::before {
  position: absolute;
  z-index: -1;
  inset: 0 -1rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-0.5 -0.5 101 41' preserveAspectRatio='none'%3E%3Cpath d='M0 40 C18 40 15 0 34 0 H66 C85 0 82 40 100 40' fill='%23dbe7f1' stroke='%23c3ceda' stroke-width='1' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  content: '';
}
.bookmarks a:not([aria-current="page"])::before { clip-path: inset(0 0 3px); }
.bookmarks a:hover::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-0.5 -0.5 101 41' preserveAspectRatio='none'%3E%3Cpath d='M0 40 C18 40 15 0 34 0 H66 C85 0 82 40 100 40' fill='%23e1edf4' stroke='%23c3ceda' stroke-width='1' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E"); }
.bookmarks a[aria-current='page'] { z-index: 2; margin-block-end: -1px; color: var(--ink); }
.bookmarks a[aria-current='page']::after { position: absolute; z-index: -2; inset: auto -.75rem -2px; height: 4px; background: var(--paper); content: ''; }
.bookmarks a[aria-current='page']::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-0.5 -0.5 101 41' preserveAspectRatio='none'%3E%3Cpath d='M0 40 C18 40 15 0 34 0 H66 C85 0 82 40 100 40' fill='%23f9fbfc' stroke='%23c3ceda' stroke-width='1' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E"); }

.book {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: clamp(0.75rem, 2.6vw, 2.5rem);
  border: 1px solid var(--paper-edge);
  border-radius: 0.75rem 0.75rem 1rem 0.75rem;
  background: var(--paper);
  box-shadow: 0 3px 0 -1px #d5dfe9, 0 6px 0 -2px #cad6e2, 0 9px 0 -3px #bdcbd9, 0 14px 24px -10px #3e56724a;
}
.page-heading { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1.25rem; padding-block-end: 1.5rem; }
.heading-year { color: var(--muted); font-size: 0.875rem; font-weight: 650; font-variant-numeric: tabular-nums; }
h1 { font-size: clamp(2rem, 4.4vw, 3.9rem); font-weight: 790; letter-spacing: -0.062em; line-height: 1.08; overflow-wrap: anywhere; }
.week-title { font-family: 'Dela Gothic One', sans-serif; font-size: clamp(2rem, 4.4vw, 3.75rem); font-weight: 400; letter-spacing: .02em; text-transform: uppercase; }
.week-navigation { display: flex; align-items: center; gap: 0.35rem; }
.control {
  display: inline-grid;
  min-height: 2.5rem;
  place-items: center;
  padding: 0.375rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: 0.45rem;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 650;
  transition: transform 130ms ease-out;
}
.control:not(:disabled):hover { background: var(--green-tint); }
.control:not(:disabled):active { transform: scale(0.97); transition-duration: 0ms; }
.control.primary { background: var(--green); border-color: var(--green); color: white; }
.control.primary:hover { background: #20475b; }
.control:disabled { color: var(--muted); opacity: 0.5; }
.icon-control { min-width: 2.5rem; }
.chevron { width: 0.45rem; height: 0.45rem; border: solid currentColor; border-width: 1.5px 1.5px 0 0; transform: rotate(45deg); }
.chevron.previous { transform: rotate(-135deg); }
.text-action { padding: 0.35rem 0; border: 0; background: none; color: var(--green); font-size: 0.875rem; text-align: start; }
.text-action:hover { text-decoration: underline; }
.danger { color: #923c32; }

.day-grid { display: grid; flex: 1; grid-template-columns: repeat(7, minmax(0, 1fr)); border-block: 1px solid var(--rule); }
.day { display: flex; min-width: 0; flex-direction: column; }
.day + .day { border-inline-start: 1px solid var(--rule); }
.day-heading { min-height: 3.5rem; padding: 0.75rem 0.65rem 0.35rem; font-size: 1rem; line-height: 1; }
.day-caption { position: relative; isolation: isolate; display: inline-flex; align-items: baseline; gap: 0.35rem; }
.day-number { font: 400 clamp(1.35rem, 2.15vw, 1.875rem)/1 'Dela Gothic One', sans-serif; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.day-name { color: var(--muted); font-size: 0.775rem; font-weight: 750; }
.current-day .day-caption::after {
  position: absolute;
  z-index: -1;
  inset: auto -0.3rem -0.17rem;
  height: 0.68em;
  transform: rotate(-3deg);
  background: var(--marker);
  clip-path: polygon(3% 14%, 35% 4%, 100% 0, 97% 31%, 100% 69%, 94% 91%, 23% 96%, 0 100%, 3% 58%, 0 32%);
  content: '';
}
.dotted { background-image: radial-gradient(circle at 1px 1px, var(--dot) 0.7px, transparent 0.95px); background-size: var(--ruling) var(--ruling); }
.writing-area { display: flex; min-height: 13.5rem; flex: 1; flex-direction: column; padding: 0.25rem 0.4rem 0.5rem; background-position: 0.5rem 1.55rem; }
.entries { display: grid; gap: 0.35rem; padding: 0; list-style: none; }
.entry { min-width: 0; overflow-wrap: anywhere; cursor: grab; user-select: none; }
.entry:active { cursor: grabbing; }
.task {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.25rem;
  min-height: var(--ruling);
  padding: 0.2rem 0.2rem 0.2rem 0.15rem;
  border-radius: 0.25rem;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
}
.task:hover, .task:focus-within { background: #eef3f7; }
.entry-check { width: 0.85rem; height: 0.85rem; margin: 0.36rem 0 0; accent-color: var(--green); }
.entry-title { padding: 0; border: 0; background: none; text-align: start; overflow-wrap: anywhere; font: 400 1.125rem/1.2 var(--hand); }
.entry-title:hover { color: var(--green); }
.entry-check:checked + .entry-title { color: var(--muted); text-decoration: line-through; }
.drag-grip { touch-action: none; user-select: none; padding-block-start: 0.1rem; color: #627389; font-size: 0.95rem; line-height: 1.4; cursor: grab; }
.drag-grip:active { cursor: grabbing; }
.drag-source { position: fixed; opacity: 0; pointer-events: none; }
.entry-placeholder { min-width: 0; border: 1px dashed #91b9a9; border-radius: .3rem; background: var(--green-tint); }
.entry-drag-ghost { position: fixed; z-index: 2147483647; margin: 0; pointer-events: none; transform-origin: 50% 0; filter: drop-shadow(0 5px 5px #41597c35); }
.ghost-time { display: none; }
.entry-drag-ghost[data-drop-time].task { grid-template-columns: auto auto minmax(0, 1fr) auto; gap: .35rem; padding: .35rem .45rem; }
.entry-drag-ghost[data-drop-time] .ghost-time { display: inline-flex; align-items: center; padding: .18rem .4rem; border-radius: .3rem; background: var(--green); color: white; font: 700 .75rem/1.2 var(--font); font-variant-numeric: tabular-nums; white-space: nowrap; }
.entry-drag-ghost[data-drop-time] :is(.entry-task-time, .entry-time) { display: none; }
.entry-drag-ghost[data-drop-time].meeting .meeting-header { gap: .4rem; }

.meeting { display: grid; gap: 0.15rem; padding: 0.35rem 0.45rem 0.4rem; border-inline-start: 2px solid #8ca9cf; border-radius: 0.25rem; background: var(--meeting); }
.meeting-header { display: flex; align-items: center; justify-content: space-between; gap: 0.25rem; }
.meeting-header .drag-grip { line-height: 1; padding: 0; }
.entry-time { color: #425e83; font-size: 0.75rem; font-weight: 750; line-height: 1.2; font-variant-numeric: tabular-nums; }

.week-boundaries { display: flex; justify-content: space-between; gap: 0.5rem; }
.boundary-drop { padding: 0.5rem 0.65rem; border: 1px dashed var(--green); border-radius: 0.35rem; color: var(--green); font-size: 0.8125rem; font-weight: 650; }
.week-boundaries { position: absolute; z-index: 5; top: 0.25rem; right: 0.75rem; left: 0.75rem; pointer-events: none; }
.boundary-drop { pointer-events: auto; background: var(--paper); }
.boundary-drop.drag-over { background: var(--green-tint); }
.day.drag-over { background: var(--green-tint); outline: 2px dashed var(--green); outline-offset: -2px; }

.entry-composer { position: relative; margin-block-start: auto; padding-block-end: 2.25rem; }
.inline-add { display: inline-flex; min-height: 2.5rem; align-items: center; padding-inline: 0.25rem; color: var(--green); font-size: 0.875rem; font-weight: 650; list-style: none; }
.inline-add::-webkit-details-marker { display: none; }
.inline-add:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.add-entry, .paper-form { display: grid; gap: 0.45rem; padding: 0.5rem; border: 1px solid var(--rule); border-radius: 0.4rem; background: var(--paper); }
.day-add-control { position: absolute; inset: auto 0 0  auto; display: grid; width: 2.125rem; min-height: 2.125rem; place-items: center; border-radius: 50%; font-size: 1.3rem; line-height: 1; }
.day-add-control:hover, .entry-composer[open] .day-add-control { background: var(--green-tint); text-decoration: none; }
.add-entry { grid-template-columns: minmax(0, 1fr); gap: 0.3rem; margin-block-end: 0.25rem; padding: 0.25rem 0.2rem 0.35rem; }
.entry-main, .entry-meta { display: flex; align-items: center; gap: 0.2rem; }
.entry-meta [name] { min-height: 1.85rem; padding: 0.2rem; font-size: 0.72rem; }
.entry-meta [name='type'] {
  flex: 0 1 4.6rem;
  width: auto;
  appearance: none;
  padding-inline: 0.12rem 0.33rem;
  font-size: 0.6875rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 0.22rem) 55%, calc(100% - 0.12rem) 55%;
  background-size: 0.1rem 0.1rem;
  background-repeat: no-repeat;
}
.entry-meta [name='time'] { flex: 1 0 3.35rem; width: auto; }
.entry-meta input[type='time']::-webkit-calendar-picker-indicator { width: 0.65rem; margin: 0; padding: 0; }
input:not([type='checkbox']), select, textarea {
  width: 100%;
  min-width: 0;
  min-height: 2.5rem;
  padding: 0.375rem 0.45rem;
  border: 1px solid var(--paper-edge);
  border-radius: 0.35rem;
  background-color: var(--paper);
  font-size: 0.875rem;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
.add-entry input[name='title'] { flex: 1 1 0; width: auto; min-height: 2.05rem; border-color: transparent; font: 650 1.2rem/1.15 var(--hand); }
.add-entry .entry-submit { flex: none; width: 1.8rem; min-height: 1.8rem; padding: 0; border-radius: 50%; font-size: 1.15rem; line-height: 1; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: end; align-items: center; gap: 0.5rem; }
.form-actions .danger { margin-inline-end: auto; }

.margins { display: grid; grid-template-columns: 4fr 3fr; gap: 0; }
.margin-section { min-width: 0; padding: 1rem 0.5rem 0.25rem; }
.margin-notes { display: flex; flex-direction: column; }
.margin-section + .margin-section { border-inline-start: 1px solid var(--rule); padding-inline-start: 1.25rem; }
.margin-header { display: flex; flex-wrap: wrap; align-items: center; column-gap: 0.875rem; }
.margin-header h2, .margin-goal > h2 { padding-block: 0.55rem; }
.margin-section h2, .edit-form h2 { color: var(--ink); font-size: 1.0625rem; letter-spacing: -0.025em; }
.note-paper { min-height: 5.25rem; flex: 1; background-position: 0.1rem 1.65rem; }
.note-area { min-height: 5.25rem; resize: vertical; background-position: 0.45rem 1.75rem; font: 650 1.45rem/var(--ruling) var(--hand); }
.annotation-add { min-height: 2.5rem; padding-inline: 0.25rem; font-weight: 650; }
.paper-annotations { position: absolute; z-index: 3; inset: 0.6rem; isolation: isolate; pointer-events: none; }
.paper-annotation {
  position: absolute;
  top: calc(var(--annotation-y) * 100%);
  left: calc(var(--annotation-x) * 100%);
  transform: translate(calc(var(--annotation-x) * -100%), calc(var(--annotation-y) * -100%));
  pointer-events: auto;
}
.paper-annotation.annotation-dragging { z-index: 2147483647 !important; }
#week-page:has(.week-boundaries:not([hidden])) :is(.paper-annotation, .annotation-operation) { pointer-events: none; }
.annotation-motion { position: relative; transform-origin: 50% 0; }
.annotation-handle { display: block; padding: 0; border: 0; background: none; cursor: grab; touch-action: none; user-select: none; }
.annotation-dragging .annotation-handle { filter: drop-shadow(0 5px 5px #41597c35); }
.annotation-dragging .annotation-handle { cursor: grabbing; }
.overlay-note { width: max-content; max-width: min(22rem, 65%); }
.overlay-note .note-text {
  display: block;
  padding: 0.45rem 0.75rem 0.55rem;
  border-radius: 0.15rem 0.2rem 0.55rem 0.1rem;
  background: #e8effe;
  box-shadow: 0 2px 5px #41597c35;
  color: var(--ink);
  font: 650 1.45rem/1.1 var(--hand);
  text-align: start;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.overlay-sticker .sticker-face { width: 2.8rem; height: 2.8rem; font-size: 1.55rem; }
.overlay-sticker:nth-child(even) .sticker-face { transform: rotate(-8deg); }
.sticker-face {
  display: inline-grid;
  width: 2.2rem;
  height: 2.2rem;
  place-items: center;
  border: 2px solid var(--paper);
  border-radius: 40% 55% 45% 50%;
  outline: 1px solid var(--paper-edge);
  box-shadow: 0 2px 2px #26395726;
  color: #42332a;
  font-size: 1.25rem;
  line-height: 1;
}
.sticker-face.peach { background: #ffad8a; }
.sticker-face.yellow { background: #f5d46c; }
.sticker-face.pink { background: #f4b9c6; }
.sticker-face.lilac { background: #d4c5ee; }
.sticker-face.mint { background: #cce3bb; }
.annotation-operation { position: absolute; top: -0.38rem; right: -0.38rem; display: grid; width: 1.45rem; height: 1.45rem; place-items: center; padding: 0; border: 1px solid var(--paper-edge); border-radius: 50%; background: var(--paper); line-height: 1; opacity: 0; pointer-events: none; }
.paper-annotation:hover .annotation-operation, .paper-annotation:focus-within .annotation-operation { opacity: 1; pointer-events: auto; }
.sticker-picker[open] { position: relative; z-index: 4; }
.sticker-swatches { position: absolute; display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; padding: 0.5rem; border: 1px solid var(--rule); border-radius: 0.45rem; background: var(--paper); box-shadow: 0 3px 8px #26395725; }
.sticker-option { display: flex; align-items: center; gap: 0.5rem; min-height: 2.5rem; padding: 0.35rem; border: 0; border-radius: 0.35rem; background: none; font-size: 0.8125rem; text-align: start; }
.sticker-option:hover { background: var(--green-tint); }
.sticker-option .sticker-face { flex: none; width: 1.75rem; height: 1.75rem; font-size: 1rem; }

.goal-progress { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-size: 0.8125rem; }
.goal-progress progress { width: min(8rem, 45%); height: 0.65rem; border: 0; border-radius: 1rem; overflow: hidden; color: var(--green); background: #e1eaf2; accent-color: var(--green); }
.goal-progress progress::-webkit-progress-bar { background: #e1eaf2; }
.goal-progress progress::-webkit-progress-value { background: var(--green); }
.goal-progress progress::-moz-progress-bar { background: var(--green); }
.goal-count { color: var(--muted); font-variant-numeric: tabular-nums; }
.goal-complete { color: var(--green); font-weight: 700; }
.paper-form label, .edit-form label { display: grid; gap: 0.3rem; font-size: 0.875rem; font-weight: 650; }
.paper-form input, .edit-form input { font-weight: 400; }
.goals-page { min-height: 29rem; }
.goals-content { border-block-start: 1px solid var(--rule); }
.empty-goals { color: var(--muted); font-size: 0.875rem; }

dialog { width: min(calc(100% - 1.5rem), 27rem); padding: 1.25rem; border: 1px solid var(--rule); border-radius: 0.65rem; background: var(--paper); color: var(--ink); box-shadow: 0 8px 28px #463a2b40; }
dialog::backdrop { background: #342a1f48; }
.edit-form { display: grid; gap: 0.85rem; }
.storage-error { padding: 0.6rem 0.75rem; border: 1px solid #d7a598; border-radius: 0.35rem; background: #fbe8df; color: #862e24; font-size: 0.875rem; }

@media (max-width: 790px) {
  .day-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .day:nth-child(5) { border-inline-start: 0; }
  .day:nth-child(n+5) { border-block-start: 1px solid var(--rule); }
  .writing-area { min-height: 10rem; }
}

@media (max-width: 540px) {
  .masthead { gap: 0.5rem; }
  .bookmarks a { padding-inline: 0.85rem; }
  .day-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .day:nth-child(odd) { border-inline-start: 0; }
  .day:nth-child(n+3) { border-block-start: 1px solid var(--rule); }
  .margins { grid-template-columns: 1fr; }
  .margin-section + .margin-section { border-inline-start: 0; border-block-start: 1px solid var(--rule); padding-inline-start: 0.5rem; }
  .sticker-swatches { inset-inline-start: -5.25rem; }
}

@media (pointer: coarse) { .annotation-operation { opacity: 1; pointer-events: auto; } }
@media (prefers-reduced-motion: reduce) {
  .control, .control:not(:disabled):active { transform: none; transition: none; }
  .bookmarks a { transition: none; }
}

/* Отдельный лист дня продолжает бумажную сетку недельного разворота. */
.daily-layout { display: grid; flex: 1; grid-template-columns: minmax(14rem, 1fr) minmax(0, 1.4fr) minmax(12rem, .75fr); grid-template-rows: auto minmax(15rem, 1fr) auto; gap: .75rem; }
.daily-panel { min-width: 0; padding: .85rem; border: 1px solid var(--rule); border-radius: .45rem; }
.daily-panel h2 { margin-bottom: .6rem; font-size: .95rem; }
.daily-schedule { display: flex; flex-direction: column; grid-row: 1 / 4; }
.daily-focus { grid-column: 2 / 4; }
.daily-tasks { display: flex; flex-direction: column; grid-column: 2 / 4; }
.daily-notes { grid-column: 2; }
.daily-calendar { grid-column: 3; }
.daily-timeline { display: grid; flex: 1; grid-auto-rows: minmax(2.35rem, auto); padding: 0; list-style: none; }
.daily-hour { position: relative; display: grid; grid-template-columns: 3.2rem minmax(0, 1fr); min-height: 2.35rem; gap: .3rem; border-block-start: 1px solid var(--rule); padding-block: .3rem; transition: min-height 260ms cubic-bezier(.22, 1, .36, 1); }
@media (prefers-reduced-motion: reduce) { .daily-hour { transition: none; } }
.daily-hour-label { color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; }
.daily-hour .meeting { margin-bottom: .2rem; }
.daily-text { width: 100%; min-height: 5rem; border: 0; resize: vertical; font: 400 1.35rem/var(--ruling) var(--hand); }
.daily-focus .daily-text { min-height: 3rem; }
.daily-task-list { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(var(--task-rows, 1), auto); grid-auto-flow: column; align-content: start; }
.daily-tasks .entry-composer { margin-top: auto; }
.daily-calendar input { min-height: 2.2rem; }
.daily-month-label { margin: .65rem 0 .35rem; font-size: .8rem; font-weight: 700; text-transform: capitalize; }
.daily-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .1rem; text-align: center; }
.daily-weekday { color: var(--muted); font-size: .65rem; }
.daily-calendar-day { min-width: 0; aspect-ratio: 1; padding: 0; border: 0; border-radius: 50%; background: transparent; font-size: .75rem; }
.daily-calendar-day:hover { background: var(--green-tint); }
.daily-calendar-day[aria-current='date'] { background: var(--green); color: white; }
.daily-calendar-day.outside-month { color: var(--muted); opacity: .65; }
@media (max-width: 790px) {
  .daily-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto; }
  .daily-schedule { grid-row: span 3; }
  .daily-focus, .daily-tasks, .daily-notes, .daily-calendar { grid-column: 2; }
}
@media (max-width: 540px) {
  .daily-layout { grid-template-columns: minmax(0, 1fr); }
  .daily-schedule, .daily-focus, .daily-tasks, .daily-notes, .daily-calendar { grid-column: 1; grid-row: auto; }
  .daily-task-list { grid-template-columns: 1fr; grid-template-rows: none; grid-auto-flow: row; }
}
.daily-page > .page-heading { flex-wrap: nowrap; align-items: end; }
.daily-page > .page-heading > div { min-width: 0; }
.daily-page .week-title { font-size: clamp(1.25rem, 3.1vw, 2.8rem); }
.daily-page .week-navigation { flex: none; }
.daily-text { overflow-y: hidden; }
.daily-tasks.drag-over { background: var(--green-tint); outline: 1px dashed var(--green); }
.daily-hour.drag-over { min-height: 6rem; }
.daily-hour.drag-over { background: var(--green-tint); }
.schedule-quarters { display: grid; grid-template-rows: repeat(4, minmax(1.5rem, 1fr)); gap: .15rem; min-height: 7rem !important; border: 0; background: transparent; }
.schedule-quarter { display: flex; align-items: center; padding: .1rem .4rem; border: 1px dashed #91b9a9; border-radius: .25rem; background: var(--green-tint); color: var(--muted); font-size: .7rem; font-variant-numeric: tabular-nums; }
.schedule-quarter.is-selected { border-color: var(--green); background: #c8ded2; color: var(--green); font-weight: 700; }
@media (prefers-reduced-motion: no-preference) { .entry-drag-ghost { transition: width 160ms cubic-bezier(.22, 1, .36, 1); } }

.daily-notes { background-position: .85rem 2.6rem; }
.daily-notes .daily-note-input { background-color: transparent; }
.daily-notes .daily-note-input:not(:placeholder-shown), .daily-shared-note { padding: .45rem .75rem .55rem; border-radius: .15rem .2rem .55rem .1rem; background: #e8effe; box-shadow: 0 2px 5px #41597c35; color: var(--ink); font: 650 1.45rem/1.1 var(--hand); }
.daily-notes .daily-note-input:not(:placeholder-shown) { margin-bottom: .35rem; }

.entry-task-time { font: 700 .75rem/1.2 var(--font); color: var(--muted); }
.daily-shared-notes { display: grid; gap: .35rem; }
.daily-shared-note { width: fit-content; max-width: 100%; border: 0; text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; }
.daily-shared-note:hover, .daily-shared-note:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
@media (max-width: 540px) {
  .daily-page .week-title { font-size: clamp(1rem, 4vw, 1.5rem); }
  .daily-page .page-heading { gap: .4rem; }
  .daily-page .week-navigation { gap: .15rem; }
  .daily-page .week-navigation .control { padding-inline: .4rem; }
  .daily-page .week-navigation .icon-control { min-width: 2rem; }
}

#edit-note { width: min(calc(100% - 1.5rem), 38rem); }
#edit-note .note-area { min-height: 8.75rem; overflow-y: hidden; }

.daily-stack { position: relative; display: flex; flex: 1; min-width: 0; isolation: isolate; }
.daily-stack > .daily-page { width: 100%; z-index: 0; transform-origin: top center; }
.daily-stack::before { position: absolute; z-index: 3; inset: 0 0 auto; height: 12px; border: 1px solid var(--paper-edge); border-bottom: 0; border-radius: .75rem .75rem 0 0; background: var(--paper); pointer-events: none; content: ""; }
.daily-stack.is-tearing { isolation: auto; }
.daily-stack.is-tearing::before { z-index: 1; }
.daily-stack.is-tearing > .daily-transition-sheet:not(.daily-transition-underlay),
.daily-stack.is-dragging > #daily-page { z-index: 5; }
.daily-stack.is-tearing > .daily-transition-underlay { z-index: 0; }
.daily-stack.is-dragging > #daily-page { border-top-color: var(--paper-edge); }
.daily-stack.is-tearing > .daily-next { z-index: 0; }
.daily-stack > .daily-next { position: absolute; z-index: -2; inset: 0; height: 100%; overflow: hidden; pointer-events: none; }
.daily-page { border-top-color: transparent; }
.daily-tear-area { position: absolute; z-index: 3; inset: 0 0 auto; height: clamp(5rem, 8vw, 7rem); border-radius: .75rem .75rem 0 0; touch-action: none; user-select: none; cursor: grab; }
.daily-page .week-navigation { position: relative; z-index: 4; }
.daily-tear-area:active { cursor: grabbing; }

.daily-transition-sheet { position: absolute; z-index: 2; inset: 0; height: 100%; overflow: hidden; pointer-events: none; transform-origin: top center; }

.week-tear-sheet { position: absolute; z-index: 10; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); box-shadow: none; overflow: hidden; pointer-events: none; transform-origin: top center; }

.week-stack { position: relative; display: flex; flex: 1; min-width: 0; isolation: isolate; }
.week-stack > #week-page { width: 100%; z-index: 0; transform-origin: top center; }
.week-stack > .week-next { position: absolute; z-index: -1; inset: 0; width: 100%; height: 100%; overflow: hidden; pointer-events: none; }
.week-stack.is-tearing { isolation: auto; }
.week-stack.is-tearing > #week-page { z-index: 5; }
.week-stack.is-tearing > .week-next { z-index: 0; }
.week-tear-area { position: absolute; z-index: 3; inset: 0 0 auto; height: clamp(5rem, 8vw, 7rem); border-radius: .75rem .75rem 0 0; touch-action: none; user-select: none; cursor: grab; }
.week-tear-area:active { cursor: grabbing; }
#week-page > .page-heading .week-navigation { position: relative; z-index: 4; }
