@keyframes grid-reveal { from { transform: translateX(16px); } to { transform: translateX(0); } }

:where([data-calendar-surface=grid]) {
.column-heading { position:relative; }
.calendar-coverage { display:block; color:var(--muted); font-size:10px; font-weight:400; }
.column-heading > .calendar-coverage { position:absolute; bottom:2px; left:4px; right:4px; text-align:center; }
.icon-button { padding: 0; width: 34px; flex: 0 0 34px; }
&:is(main) { outline: none; flex: 1; min-height: 0; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 25px; font-weight: 400; letter-spacing: -.03em; line-height: 1.25; }
h2 { font-size: 20px; font-weight: 400; letter-spacing: -.02em; line-height: 1.35; }
h3 { font-size: 14px; font-weight: 700; }
.muted, .subtitle { color: var(--muted); }
.subtitle { margin-top: 7px; }
.workspace { display: grid; grid-template-columns: 224px minmax(0,1fr); height: 100%; min-height: 0; }
.workspace.sidebar-collapsed { grid-template-columns: minmax(0,1fr); }
.calendar-sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 28px 18px 20px; display: none; flex-direction: column; overflow: auto; min-height: 0; }
.calendar-sidebar.is-open { display: flex; }
.mini-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 3px; }
.mini-header h2 { font-size: 13px; font-weight: 700; letter-spacing: -.01em; }
.mini-header > div { display: flex; }
.mini-arrow { border: 0; background: transparent; padding: 0; width: 23px; min-height: 26px; color: var(--muted); }
.mini-arrow svg { width: 13px; height: 13px; }
.mini-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); row-gap: 4px; }
.mini-weekday { text-align: center; font-size: 10px; color: var(--muted); padding-bottom: 4px; font-weight: 400; }
.mini-date { min-height: 27px; padding: 0; border: 0; border-radius: 0; background: transparent; font-size: 11px; font-weight: 400; }
.mini-date.selected-week { background: var(--tint); }
.mini-date.mini-today { color: var(--accent); font-weight: 700; }
.mini-date.selected { background: var(--ink); color: var(--on-accent); border-radius: 50%; }
.mini-date.selected.mini-today { background: var(--accent); }
.mini-date.other-month { color: var(--muted); }
.mini-date.selected.other-month { color: var(--on-accent); }
.calendar-sources { margin-top: 36px; }
.calendar-sources > h2 { font-size: 15px; letter-spacing: -.02em; margin-bottom: 18px; }
.source-group + .source-group { margin-top: 22px; }
.source-group h3 { font-size: 11px; color: var(--muted); margin-bottom: 7px; font-weight: 400; overflow-wrap: anywhere; }
.calendar-option { display: flex; gap: 9px; align-items: center; min-height: 34px; font-size: 13px; cursor: pointer; }
.calendar-option > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-empty { font-size: 12px; color: var(--muted); }
.calendar-canvas { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--page); }
.week-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 23px 24px 20px; flex-shrink: 0; }
.date-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 16px; }
.date-range { font-size: 12px; color: var(--muted); }
.week-nav { display: flex; gap: 3px; align-items: center; flex-shrink: 0; }
.week-nav #today { margin: 0 8px; }
.calendar-scroller { isolation:isolate; overflow: auto; flex: 1; min-height: 0; overscroll-behavior: contain; scrollbar-gutter: stable; }
.time-grid { --columns: 7; min-width: calc(58px + var(--columns) * 140px); position: relative; }
.time-grid.single-day { --columns: 1; min-width: 0; }
.grid-heading { display: grid; grid-template-columns: 58px repeat(var(--columns),minmax(0,1fr)); position: sticky; top: 0; z-index: 4; background: var(--surface); border-bottom: 1px solid var(--line); }
.timezone-label { align-self: center; text-align: center; font-size: 10px; color: var(--muted); }
.column-heading { min-height: 70px; padding: 10px 12px 12px; border-left: 1px solid var(--line); }
.column-heading button { display: flex; align-items: baseline; justify-content: flex-start; gap: 8px; border: 0; background: transparent; padding: 0; min-height: 36px; }
.column-heading span { color: var(--muted); font-size: 12px; font-weight: 400; }
.column-heading strong { font-size: 25px; font-weight: 400; line-height: 1; letter-spacing: -.04em; }
.column-heading.is-today strong { background: var(--accent); color: var(--on-accent); width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; font-size: 23px; }
.column-heading.is-today span { color: var(--accent); }
.weekend { background-color: color-mix(in srgb,var(--tint) 35%,var(--page)); }
.all-day-grid { display: grid; grid-template-columns: 58px repeat(var(--columns),minmax(0,1fr)); grid-column: 1 / -1; border-top: 1px solid var(--line); max-height: 128px; overflow-y: auto; }
.all-day-label { font-size: 10px; color: var(--muted); padding-top: 7px; text-align: center; }
.all-day-cell { padding: 4px 3px; border-left: 1px solid var(--line); min-height: 35px; }
.timed-grid { display: grid; grid-template-columns: 58px repeat(var(--columns),minmax(0,1fr)); height: 1536px; }
.time-gutter { position: relative; }
.hour-label { position: absolute; right: 10px; font-size: 10px; color: var(--muted); transform: translateY(-50%); white-space: nowrap; }
.hour-label:first-child { transform: none; }
.time-column { position: relative; border-left: 1px solid var(--line); min-width: 0; }
.hour-cell { height: 64px; border-top: 1px solid var(--line); position: relative; }
.hour-cell::after { content: ''; position: absolute; top: 31px; left: 0; right: 0; border-top: 1px solid color-mix(in srgb,var(--line) 50%,transparent); }
.calendar-event { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 2px; background: var(--event-bg); color: var(--event-ink); border: 1px solid transparent; border-radius: var(--sure-radius); padding: 5px 6px; text-align: left; line-height: 1.28; min-height: 0; overflow: hidden; font-size: 12px; }
.calendar-event:hover { background: var(--event-hover); }
.calendar-event:focus-visible { outline-offset: 0; outline-color: var(--event-ink); z-index: 3; }
.calendar-event.event-selected { background: var(--event-ink); color: var(--page); }
.timed-event { position:absolute; --event-fill:var(--event-bg); --timeline-label-fill:var(--event-fill); background:var(--event-fill); border-radius:var(--sure-radius); }
.timed-event:has(:hover,.event-selected) { --event-fill:var(--event-hover); }
.timed-event > .calendar-event { position:relative; z-index:var(--layer-event-label); width:100%; height:100%; background:transparent; }
.timed-event > .calendar-event.event-selected { color:var(--event-ink); border-color:var(--event-ink); }
.block-title { font-weight: 700; overflow-wrap: normal; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; flex-shrink: 0; max-width: 100%; }
.timed-event:not([data-lanes="1"]):not([data-lanes="2"]) .block-title { display: block; white-space: nowrap; text-overflow: ellipsis; }
.block-time { font-size: 11px; opacity: .95; white-space: nowrap; }
.short-event { padding-top: 2px; padding-bottom: 1px; }
.short-event .block-title { -webkit-line-clamp: 1; font-size: 11px; }
.short-event .block-time { display: none; }
.now-line { position: absolute; left: -1px; right: 0; height: 1px; background: var(--sure-now-rule); z-index: var(--layer-now); pointer-events: none; }
.now-line span { position: absolute; width: 6px; height: 6px; left: -3px; top: -2.5px; border-radius: 50%; background: var(--accent); }
.all-day-event { width: 100%; display: block; padding: 3px 5px; margin-bottom: 3px; }
.all-day-event .block-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; font-size: 11px; }
.all-day-event .block-time { display: none; }
.month-view { flex: 1; display: flex; flex-direction: column; overflow: auto; min-height: 0; }
.month-weekdays { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); border-bottom: 1px solid var(--line); flex-shrink: 0; }
.month-weekdays > span { padding: 10px 12px; text-align: right; font-size: 12px; color: var(--muted); }
.month-grid { flex: 1; display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); grid-auto-rows: minmax(115px,1fr); }
.month-cell { min-width: 0; padding: 7px 3px 8px; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); }
.month-cell:nth-child(7n+1) { border-left: 0; }
.month-cell.other-month { background: var(--tint); }
.month-date { display: flex; margin-left: auto; border: 0; width: 28px; height: 28px; min-height: 28px; padding: 0; background: transparent; font-size: 14px; border-radius: 50%; }
.month-cell.other-month .month-date { color: var(--muted); }
.month-cell.is-today .month-date { background: var(--accent); color: var(--on-accent); }
.month-events { margin-top: 5px; }
.month-event { width: 100%; flex-direction: row; align-items: baseline; justify-content: space-between; gap: 4px; padding: 3px 5px; margin-bottom: 3px; }
.month-event .block-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.month-event .block-time { flex-shrink: 0; font-size: 10px; }
.month-event.all-day-event .block-time { display: none; }
.more-events { border: 0; background: transparent; padding: 0 5px; font-size: 11px; min-height: 23px; color: var(--muted); }
&.entry-main { width: min(700px,calc(100% - 48px)); margin: 0 auto; }
.empty-state { padding: 60px 32px; max-width: 500px; }
.empty-state p { margin: 12px 0 24px; color: var(--muted); line-height: 1.65; }
.welcome { padding: 17vh 0 80px; }
.welcome h1 { font-size: 40px; font-weight: 400; }
.welcome-note { font-size: 13px; margin-top: 18px !important; }
.notice { color: var(--danger); font-size: 13px; padding: 14px 0; line-height: 1.6; }
.notice p + p { margin-top: 6px; }
.calendar-notice { padding: 10px 24px; background: var(--sure-red-fill); border-bottom: 1px solid var(--sure-red-ink); flex-shrink: 0; }
.dot { width:6px; height:6px; border-radius:50%; background:var(--icloud); display:inline-block; flex-shrink:0; }
.dot.google { background:var(--google); }
&.event-inspector { position: fixed; top: var(--appbar-height); right: 0; bottom: 0; z-index: 10; width: 340px; background: var(--page); box-shadow: -6px 0 24px #1923161a; overflow: auto; animation: grid-reveal 170ms cubic-bezier(.16,1,.3,1); }
.inspector-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; background: var(--surface); font-size: 12px; color: var(--muted); }
.inspector-content { padding: 24px; }
.source-caption { display: flex; align-items: center; gap: 7px; color: var(--event-ink); font-size: 12px; overflow-wrap: anywhere; margin-bottom: 14px; }
.source-mark { width: 9px; height: 9px; background: var(--event-ink); flex-shrink: 0; }
.inspector-content h2 { font-size: 24px; line-height: 1.3; overflow-wrap: anywhere; outline: none; }
.detail-time { white-space: pre-line; margin-top: 16px; font-size: 14px; }
.detail-row { padding-top: 18px; margin: 18px 0 0; border-top: 1px solid var(--line); font-size: 13px; }
dt { color: var(--muted); font-size: 12px; margin-bottom: 5px; }
dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.detail-description { padding-top: 18px; margin-top: 18px; border-top: 1px solid var(--line); }
.detail-description h3 { font-weight: 400; color: var(--muted); font-size: 12px; }
.detail-description p { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 8px; font-size: 13px; line-height: 1.65; }
.event-link { display: flex; align-items: center; gap: 8px; margin-top: 24px; font-size: 13px; }
.event-link svg { width: 14px; height: 14px; }
@media (max-width: 1000px) {
  .workspace { grid-template-columns: 200px minmax(0,1fr); }
  .calendar-sidebar { padding: 24px 14px 18px; }
  .date-heading { display: block; }
  .date-range { display: block; margin-top: 5px; }
  .column-heading { padding-left: 7px; }
  .column-heading button { gap: 4px; }
}
@media (max-width: 720px) {
  .workspace, .workspace.sidebar-collapsed { grid-template-columns: minmax(0,1fr); }
  .calendar-sidebar.is-open { position: fixed; top: var(--appbar-height); bottom: 0; left: 0; width: 240px; z-index: 8; padding: 24px; box-shadow: 6px 0 24px #1923161a; }
  .mini-date { min-height: 32px; font-size: 12px; }
  .mini-weekday { font-size: 11px; }
  .calendar-option { min-height: 44px; font-size: 14px; }
  .week-header { padding: 18px 14px; gap: 5px; }
  h1 { font-size: 21px; }
  .date-range { font-size: 11px; }
  .week-nav { gap: 0; }
  .week-nav #today { margin: 0 3px; font-size: 12px; padding: 4px 8px; }
  .column-heading button { gap: 8px; }
  .single-day .column-heading { padding-left: 15px; }
  .single-day .calendar-event { padding: 6px 10px; font-size: 13px; }
  .single-day .short-event { padding-top: 2px; padding-bottom: 1px; }
  .single-day .short-event .block-title { font-size: 12px; }
  .month-weekdays > span { padding: 10px 4px; font-size: 11px; text-align: center; }
  .month-grid { grid-auto-rows: minmax(96px,1fr); }
  .month-cell { padding: 5px 1px; }
  .month-date { margin: 0 auto; font-size: 12px; }
  .month-event { padding: 3px 2px; }
  .month-event .block-title { font-size: 10px; font-weight: 400; }
  .month-event .block-time { display: none; }
  .more-events { font-size: 10px; padding: 0 2px; }
  &.event-inspector { top: var(--appbar-height); width: min(100%,390px); }
  &.event-inspector .icon-button { width: 40px; height: 40px; }
  .empty-state { padding: 40px 24px; }
  .welcome { padding: 12vh 0 50px; }
  .welcome h1 { font-size: 34px; }
  .notice { font-size: 13px; }
}
}
