:root {
  color-scheme: light;
  --background: #f8f6f0;
  --paper: #fffdf8;
  --ink: #292923;
  --muted: #656054;
  --line: #e4ded2;
  --accent: #a33626;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--background); color: var(--ink); font: 15px/1.5 var(--sans); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.frame { width: min(1200px, calc(100% - 96px)); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--line); }
.masthead { min-height: 67px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 720; font-size: 18px; letter-spacing: -.04em; }
.brand-mark { position: relative; width: 25px; height: 25px; border-radius: 50%; background: var(--accent); }
.brand-mark::before { content: ""; position: absolute; left: 12px; top: 5px; width: 5px; height: 8px; border: solid var(--paper); border-width: 0 0 1.5px 1.5px; border-radius: 0 0 0 2px; }
.storage-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.storage-label > span { background: #687e59; width: 7px; height: 7px; border-radius: 50%; }

.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; margin-block: 55px 33px; }
h1 { font: normal clamp(3rem, 6.1vw, 5.6rem)/.98 var(--serif); letter-spacing: -.075em; margin: 0 0 16px; }
h1 span { color: var(--accent); }
.hero p { color: var(--muted); margin: 0; font-size: 15px; }
.hero .primary { flex: none; margin-bottom: 2px; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 7px; padding: 9px 14px; background: transparent; font-size: 13px; font-weight: 650; white-space: nowrap; min-height: 38px; }
.primary { background: var(--accent); color: white; padding: 10px 17px; min-height: 43px; }
.primary:hover { background: #862a1e; }
.primary > span { font-size: 20px; line-height: 1; font-weight: 400; }
.secondary { border-color: var(--line); background: var(--paper); }
.secondary:hover, .icon-button:hover, .today:hover, .hours-toggle:hover, .delete:hover { background: #efeae0; }

.planner { display: grid; align-items: start; grid-template-columns: minmax(0, 1fr) minmax(235px, .34fr); gap: 24px; padding-bottom: 56px; }
.calendar, .timeline, .summary { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.calendar { padding: 15px; }
.calendar-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.date-controls { display: flex; align-items: center; gap: 5px; }
.icon-button, .today { border-color: var(--line); }
.icon-button { width: 38px; padding: 0; flex: none; }
.chevron { width: 7px; height: 7px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(-45deg); }
.chevron.left { transform: rotate(135deg); }
.date-picker input { max-width: 146px; min-height: 38px; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 7px; padding: 5px 8px; font-size: 13px; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-top: 13px; }
.week-day { position: relative; display: grid; align-content: center; justify-items: center; gap: 2px; min-height: 66px; border: 1px solid transparent; border-radius: 8px; background: #f5f2ea; }
.week-day:hover { border-color: #c8bdad; }
.week-day span:first-child { font: 650 10px/1.3 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.week-day span:nth-child(2) { font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; }
.week-day[aria-pressed="true"] { background: #f3e0d8; color: var(--accent); border-color: #dcb0a1; }
.week-day[aria-pressed="true"] span:first-child { color: var(--accent); }
.week-day[aria-current="date"]::after { content: ""; position: absolute; bottom: 5px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }

.timeline { margin-top: 16px; overflow: clip; }
.timeline-heading { min-height: 62px; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 16px 10px 20px; }
h2 { font: normal 24px/1.1 var(--serif); letter-spacing: -.037em; margin: 0; }
.hours-toggle { font-size: 12px; color: var(--muted); }
.hours { list-style: none; padding: 0; margin: 0; }
.hour { display: grid; grid-template-columns: 82px minmax(0, 1fr); min-height: 60px; border-top: 1px solid var(--line); }
.hour-label { padding: 18px 0 16px; text-align: center; border-right: 1px solid var(--line); color: var(--muted); font: 12px/1.7 var(--mono); }
.hour-content { position: relative; min-width: 0; padding: 7px 49px 7px 10px; display: grid; align-content: center; gap: 5px; }
.hour.current { background: #fdf5ee; }
.hour.current .hour-label { color: var(--accent); font-weight: 700; }
.now-label { justify-self: start; align-self: center; border-radius: 4px; background: #f3e0d8; color: var(--accent); padding: 2px 6px; font: 700 10px/1.5 var(--sans); letter-spacing: .05em; text-transform: uppercase; }
.add-at { position: absolute; align-self: start; right: 9px; top: 10px; width: 36px; height: 38px; color: #726a5d; border: 0; border-radius: 6px; background: transparent; font-size: 21px; line-height: 1; }
.add-at:hover { background: #f0ebe1; color: var(--accent); }
.block { display: grid; gap: 2px; padding: 7px 10px; text-align: left; border: 1px solid #dfd9cc; border-left: 3px solid #77715e; background: #f1eee5; border-radius: 6px; text-wrap: pretty; overflow-wrap: anywhere; }
.block:hover { filter: brightness(.96); }
.block[data-category="focus"] { background: #f6e5de; border-color: #e7c7ba; border-left-color: #a33626; }
.block[data-category="personal"] { background: #e8ece0; border-color: #d7dfcc; border-left-color: #5c7553; }
.block[data-category="break"] { background: #f5ecd8; border-color: #e6d8b7; border-left-color: #93691e; }
.block-title { font-weight: 680; font-size: 14px; }
.block-meta { color: #5d5548; font: 11px/1.5 var(--mono); }
.block-notes { color: var(--muted); white-space: pre-wrap; font-size: 12px; }

.overview { display: grid; gap: 16px; }
.clock-panel { border-radius: 12px; background: #292923; color: #f8f6f0; text-align: center; padding: 24px 16px 21px; }
.clock-panel h2 { font: 650 11px/1.4 var(--sans); text-transform: uppercase; letter-spacing: .17em; color: #e5d8c5; }
.clock { position: relative; isolation: isolate; width: min(100%, 146px); aspect-ratio: 1; margin: 20px auto 14px; border: 1px solid #6b6355; border-radius: 50%; }
.clock-ticks { position: absolute; inset: 6px; border-radius: 50%; background: repeating-conic-gradient(from -.45deg, #827764 0deg .9deg, transparent .9deg 6deg); mask: radial-gradient(closest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px)); }
.clock-number { position: absolute; font: 10px/1 var(--mono); color: #e5d8c5; }
.twelve { top: 15px; left: 50%; translate: -50% 0; }
.three { right: 14px; top: 50%; translate: 0 -50%; }
.six { bottom: 15px; left: 50%; translate: -50% 0; }
.nine { left: 14px; top: 50%; translate: 0 -50%; }
.hand { position: absolute; bottom: 50%; left: 50%; translate: -50% 0; transform-origin: 50% 100%; transform: rotate(var(--angle, 0deg)); border-radius: 5px; }
.hour-hand { width: 3px; height: 23%; background: #f8f6f0; }
.minute-hand { width: 2px; height: 33%; background: #f09477; }
.clock-pin { position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: 7px; height: 7px; border-radius: 50%; background: #f09477; }
.clock-time { display: block; font: 32px/1.2 var(--mono); letter-spacing: -.05em; }
.time-zone { margin: 3px 0 0; font-size: 11px; color: #e5d8c5; }
.summary { padding: 19px 17px 16px; }
.summary h2 { font-size: 22px; }
.summary dl { margin: 12px 0 0; }
.summary dl > div { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--line); padding: 8px 0; color: var(--muted); font-size: 13px; }
.summary dd { margin: 0; color: var(--ink); font: 600 12px/1.6 var(--mono); }
.day-status { font-size: 12px; color: var(--muted); margin: 11px 0 0; overflow-wrap: anywhere; }
.storage-error { color: var(--accent); }
.noscript { color: var(--accent); }

dialog { width: min(460px, calc(100% - 28px)); max-height: calc(100% - 28px); border: 1px solid var(--line); border-radius: 13px; background: var(--paper); color: var(--ink); padding: 23px; }
dialog::backdrop { background: #28251e75; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-heading h2 { font-size: 32px; }
.close { font-size: 21px; line-height: 1; }
.editor-date { color: var(--muted); margin: 0 0 15px; }
#block-form label { display: block; margin: 10px 0 4px; font-weight: 650; font-size: 13px; }
.optional { color: var(--muted); font-weight: 400; }
#block-form input, #block-form select, #block-form textarea { display: block; width: 100%; min-width: 0; min-height: 42px; padding: 8px 10px; color: var(--ink); border: 1px solid #cec5b7; border-radius: 6px; background: #fffefa; }
#block-form textarea { resize: vertical; }
.time-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dialog-footer { display: flex; align-items: center; justify-content: flex-end; gap: 7px; margin-top: 18px; }
.delete { margin-right: auto; color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 880px) {
  .frame { width: calc(100% - 48px); }
  .planner { gap: 16px; }
}
@media (max-width: 690px) {
  .frame { width: calc(100% - 32px); }
  .masthead { min-height: 54px; }
  .hero { margin-block: 34px 22px; }
  h1 { font-size: clamp(2.25rem, 8.2vw, 3.5rem); margin-bottom: 8px; }
  .hero p { font-size: 13px; }
  .hero .primary { padding-inline: 10px; }
  .planner { grid-template-columns: minmax(0, 1fr); padding-bottom: 24px; }
  .overview { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 10px; order: -1; }
  .clock-panel { display: flex; flex-direction: column; justify-content: center; padding: 10px; }
  .clock-panel h2 { font-size: 10px; letter-spacing: .09em; }
  .clock { display: none; }
  .clock-time { margin-top: 4px; font-size: 27px; }
  .summary { padding: 11px 12px 9px; }
  .summary h2 { font-size: 19px; }
  .summary dl { margin-top: 4px; }
  .summary dl > div { padding: 3px 0; font-size: 12px; }
  .day-status { margin-top: 5px; }
  .hour { grid-template-columns: 61px minmax(0, 1fr); }
}
@media (max-width: 360px) {
  .frame { width: calc(100% - 24px); }
  .calendar { padding: 10px; }
  .week { gap: 4px; }
  .date-picker input { max-width: 127px; }
  .hero { gap: 8px; }
  .hero .primary { font-size: 12px; }
}
