/* In-app calendar beside the task list (R1.1.1, docs/11 §74). Scoped, token-coloured, no inline styles. */

@import url('calendar-slots.css?h=abdafa77baf1');

.view-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  min-height: 0;
  height: 100%;
}
.task-pane {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding-right: 0.75rem;
  border-right: 1px solid var(--border);
}
.calendar-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  padding-left: 0.75rem;
}
@media (max-width: 900px) {
  .view-split {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    height: auto;
  }
  .task-pane {
    order: 2;
    padding-right: 0;
    border-right: 0;
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
    overflow: visible;
  }
  .calendar-pane {
    order: 1;
    padding-left: 0;
    padding-bottom: 0.5rem;
    height: auto;
    overflow: visible;
  }
  .cal-scroll {
    flex: 0 0 auto;
    height: 24rem;
  }
}

.cal-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
  padding: 0.15rem 0 0.55rem;
  flex-shrink: 0;
}
.cal-toolbar-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
  flex: 1 1 auto;
  min-width: 8rem;
  color: var(--text);
}
.cal-tz {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.cal-toolbar-nav,
.cal-toolbar-mode {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}
.cal-toolbar .btn { font-size: 0.85rem; }
.cal-mode-btn[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--accent-soft-text);
}

.cal-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.cal-allday {
  display: grid;
  grid-template-columns: var(--cal-gutter, 3.4rem) 1fr;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  min-height: 1.8rem;
}
.cal-allday-label {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 0.25rem 0.4rem;
  font-size: 0.68rem;
  color: var(--text-muted);
  border-right: 1px solid var(--border);
}
.cal-allday-days {
  display: grid;
  grid-template-columns: repeat(var(--cal-days, 1), minmax(0, 1fr));
}
.cal-allday-day {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.25rem 0.3rem;
  min-height: 1.6rem;
  border-left: 1px solid var(--border-faint, var(--border));
}
.cal-allday-day:first-child { border-left: 0; }
.cal-deadline {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  border: 1px dashed var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.72rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--danger);
}
.cal-deadline:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.cal-scroll-head {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--surface-2);
}
.cal-weekhead {
  display: grid;
  grid-template-columns: var(--cal-gutter, 3.4rem) 1fr;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.cal-weekhead-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.cal-weekhead-day {
  padding: 0.35rem 0.4rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-left: 1px solid var(--border);
}
.cal-weekhead-day.is-today {
  color: var(--accent-soft-text);
  font-weight: 650;
}
.cal-weekhead-day.is-today .cal-weekhead-num {
  background: var(--accent);
  color: var(--accent-contrast);
  border-radius: 999px;
  display: inline-flex;
  width: 1.5rem;
  height: 1.5rem;
  align-items: center;
  justify-content: center;
}

.cal-body {
  display: grid;
  grid-template-columns: var(--cal-gutter, 3.4rem) 1fr;
  --cal-minute: 1.15px;
}
.cal-gutter {
  display: grid;
  grid-template-rows: repeat(1440, var(--cal-minute));
  border-right: 1px solid var(--border);
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface);
}
.cal-hour-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-align: right;
  padding: 0 0.4rem 0 0.15rem;
  transform: translateY(-0.45em);
  grid-row-end: span 60;
}
.cal-hour-label.cal-h-0 { visibility: hidden; }

.cal-days {
  display: grid;
  grid-template-columns: repeat(var(--cal-days, 1), minmax(0, 1fr));
  min-height: calc(1440 * var(--cal-minute));
}
.cal-day {
  display: grid;
  grid-template-rows: repeat(1440, var(--cal-minute));
  /* Column count comes from .cal-cols-N (calendar-slots.css) so overlapping
     events/blocks can share the lane assigner. We always set at least cal-cols-1. */
  position: relative;
  border-left: 1px solid var(--border);
  min-height: calc(1440 * var(--cal-minute));
}
.cal-days > .cal-day:first-child { border-left: 0; }
.cal-day.is-today { background: color-mix(in srgb, var(--accent) 5%, transparent); }

.cal-hour-line {
  grid-column: 1 / -1;
  grid-row-end: span 1;
  border-top: 1px solid var(--border);
  pointer-events: none;
  z-index: 0;
}
.cal-hour-line.minor {
  border-top-style: dotted;
  border-top-color: color-mix(in srgb, var(--border) 70%, transparent);
}

.cal-now {
  grid-column: 1 / -1;
  grid-row-end: span 1;
  border-top: 2px solid var(--danger);
  z-index: 4;
  pointer-events: none;
}
.cal-now::before {
  content: '';
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  transform: translate(-4px, -5px);
}

.cal-block {
  z-index: 3;
  margin: 1px 3px 1px 2px;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
  background: var(--accent-soft);
  color: var(--accent-soft-text);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 550;
  text-align: left;
  overflow: hidden;
  cursor: pointer;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  line-height: 1.25;
}
.cal-block:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
  z-index: 5;
}
.cal-block.is-completed {
  opacity: 0.62;
  text-decoration: line-through;
  filter: grayscale(0.25);
}
.cal-block .cal-block-time {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
}
.cal-block .cal-block-dur {
  font-size: 0.65rem;
  font-style: italic;
  color: var(--text-muted);
  font-weight: 400;
}
.cal-block-p1 { border-color: var(--p1); background: color-mix(in srgb, var(--p1) 18%, var(--surface)); }
.cal-block-p2 { border-color: var(--p2); background: color-mix(in srgb, var(--p2) 18%, var(--surface)); }
.cal-block-p3 { border-color: var(--p3); background: color-mix(in srgb, var(--p3) 18%, var(--surface)); }
.cal-block-p4 { border-color: var(--p4); background: color-mix(in srgb, var(--p4) 14%, var(--surface)); }

.cal-form {
  flex-shrink: 0;
  margin-top: 0.65rem;
  padding: 0.65rem 0.7rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.cal-form h3 {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--text);
}
.cal-form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.45rem 0.6rem;
  margin-bottom: 0.45rem;
}
.cal-form-row.wide { grid-template-columns: minmax(0, 1fr); }
.cal-form-row > *, .cal-form label { min-width: 0; }
.cal-form label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.cal-form input,
.cal-form select {
  font: inherit;
  font-size: 0.88rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 0.3rem 0.45rem;
  color-scheme: light dark;
}
.cal-form input:focus-visible,
.cal-form select:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}
.cal-form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 0.45rem;
}
.cal-form-hint.is-default { color: var(--text-muted); font-style: italic; }
.cal-form-error {
  font-size: 0.8rem;
  color: var(--danger);
  margin: 0 0 0.4rem;
  min-height: 1em;
}
.cal-form-error:empty { display: none; }
.cal-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.cal-overlap {
  font-size: 0.8rem;
  color: var(--text);
  background: color-mix(in srgb, var(--p2) 16%, var(--surface));
  border: 1px solid var(--p2);
  border-radius: 6px;
  padding: 0.4rem 0.55rem;
  margin: 0 0 0.45rem;
}

/* Panel schedule section */
.panel-schedule {
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}
.panel-schedule h3 {
  margin: 0 0 0.4rem;
  font-size: 0.82rem;
  font-weight: 650;
}

.cal-ndays-1 .cal-allday-days,
.cal-ndays-1 .cal-days { grid-template-columns: minmax(0, 1fr); }
.cal-ndays-7 .cal-allday-days,
.cal-ndays-7 .cal-days,
.cal-ndays-7 .cal-weekhead-days { grid-template-columns: repeat(7, minmax(0, 1fr)); }

.cal-block-check,
.cal-block-open {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  text-align: left;
}
.cal-block-check {
  flex: 0 0 1rem;
  width: 1rem;
  height: 1rem;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  align-self: flex-start;
  margin-top: 0.15rem;
  margin-right: 0.25rem;
}
.cal-block {
  flex-direction: row;
  align-items: flex-start;
}
.cal-block-open { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.cal-block-check[aria-pressed="true"] {
  background: currentColor;
}
.cal-block-check:focus-visible,
.cal-block-open:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}


/* ---- R1.1.3 Stage 4: drag, resize, drop, sticky Schedule, touch ---- */
.cal-block { touch-action: none; position: relative; }
.cal-block.is-cal-dragging { opacity: 0.92; z-index: 8; box-shadow: var(--shadow); }
.cal-resize-handle {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 10px;
  min-height: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: ns-resize;
  touch-action: none;
  z-index: 3;
}
.cal-resize-handle::after {
  content: "";
  display: block;
  width: 28px;
  height: 3px;
  margin: 4px auto 0;
  border-radius: 2px;
  background: color-mix(in srgb, var(--text-muted) 55%, transparent);
}
.cal-block:focus-visible .cal-resize-handle::after,
.cal-block:hover .cal-resize-handle::after { background: var(--accent); }
.cal-drop-preview {
  pointer-events: none;
  opacity: 0.55;
  border-style: dashed;
  z-index: 4;
}
.cal-msg {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
  margin: 0 0 0.4rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.88rem;
}
.cal-msg[hidden] { display: none; }
.cal-msg-text { flex: 1 1 12rem; }

.cal-schedule-dock { flex: none; }
.cal-schedule-toggle { display: none; }

/* Keep the Schedule action on screen under ~600px without scrolling the grid. */
@media (max-width: 599px) {
  .cal-schedule-dock {
    position: sticky;
    bottom: 0;
    z-index: 6;
    background: var(--bg);
    padding: 0.45rem 0 calc(0.45rem + var(--sab));
    border-top: 1px solid var(--border);
  }
  .cal-schedule-toggle { display: flex; width: 100%; justify-content: center; }
  .cal-schedule-dock:not(.is-open) #cal-form-host { display: none; }
  .cal-schedule-dock.is-open .cal-schedule-toggle { margin-bottom: 0.4rem; }
  /* Day default is roomier than Week; keep the grid a comfortable height, no 100dvh (§42A). */
  .cal-scroll { height: 22rem; }
}

body.is-cal-dragging { cursor: grabbing; }
body.is-cal-dragging .cal-scroll { touch-action: none; }


/* R1.1.5 Stage 8: inbound iCloud events (read-only, muted vs task blocks).
   Color is a fixed class palette — no inline styles, no element.style (style-src 'self'). */
.cal-event {
  /* Normal grid item (like .cal-block): cal-s-N / cal-sp-N set row and height.
     Relative positioning is only so z-index applies. Insets come from margin,
     not left/right, so the item stays in grid flow and honors the span. */
  position: relative;
  z-index: 2; /* below .cal-block (3) so tasks stay in front */
  box-sizing: border-box;
  /* Horizontal inset replaces the old left/right. No vertical margin: the
     grid span is the height, and the ±2px assertion is tight. */
  margin: 0 3px 0 2px;
  padding: 0.12rem 0.35rem 0.12rem 0.45rem;
  border-radius: 4px;
  border: 1px solid;
  border-left-width: 3px;
  font-size: 0.72rem;
  font-weight: 550;
  line-height: 1.2;
  text-align: left;
  overflow: hidden;
  cursor: default;
  opacity: 0.88;
  background-clip: padding-box;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.cal-event:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  z-index: 4;
}
.cal-event-title { display: block; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-event-cal { display: block; font-size: 0.64rem; opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-event.is-free { border-style: dashed; opacity: 0.72; }
.cal-event.is-recurring .cal-event-title::after { content: " \21bb"; font-weight: 400; opacity: 0.8; }

.cal-event-allday {
  position: relative;
  width: 100%;
  min-height: 1.35rem;
  z-index: 1;
  margin: 0;
}
.cal-allday-day { gap: 0.2rem; }

/* Fixed 10-swatch palette. Null / unknown hex → c-9 (slate). */
.cal-ev-c-0 { background: #f8d0d0; border-color: #e03131; color: #5c1010; }
.cal-ev-c-1 { background: #f8d9c4; border-color: #e8590c; color: #5c2a08; }
.cal-ev-c-2 { background: #f8e6bd; border-color: #f08c00; color: #5c3a00; }
.cal-ev-c-3 { background: #cfead4; border-color: #2f9e44; color: #0f3d18; }
.cal-ev-c-4 { background: #c6e6eb; border-color: #0c8599; color: #053a42; }
.cal-ev-c-5 { background: #c9dff6; border-color: #1c7ed6; color: #0a335c; }
.cal-ev-c-6 { background: #d0d6f6; border-color: #3b5bdb; color: #16225c; }
.cal-ev-c-7 { background: #ddd0f6; border-color: #7048e8; color: #2c1a5c; }
.cal-ev-c-8 { background: #f3c9d8; border-color: #c2255c; color: #541028; }
.cal-ev-c-9 { background: #d8dbdf; border-color: #5f6874; color: #2a2e34; }

:root[data-theme="dark"] .cal-ev-c-0 { background: #3a1515; border-color: #fa5252; color: #f8d0d0; }
:root[data-theme="dark"] .cal-ev-c-1 { background: #3a1e0d; border-color: #fd7e14; color: #f8d9c4; }
:root[data-theme="dark"] .cal-ev-c-2 { background: #3a2a0a; border-color: #fab005; color: #f8e6bd; }
:root[data-theme="dark"] .cal-ev-c-3 { background: #0f2e16; border-color: #51cf66; color: #cfead4; }
:root[data-theme="dark"] .cal-ev-c-4 { background: #0a2c32; border-color: #22b8cf; color: #c6e6eb; }
:root[data-theme="dark"] .cal-ev-c-5 { background: #0c2744; border-color: #4dabf7; color: #c9dff6; }
:root[data-theme="dark"] .cal-ev-c-6 { background: #161e44; border-color: #748ffc; color: #d0d6f6; }
:root[data-theme="dark"] .cal-ev-c-7 { background: #22164a; border-color: #9775fa; color: #ddd0f6; }
:root[data-theme="dark"] .cal-ev-c-8 { background: #3a1020; border-color: #e64980; color: #f3c9d8; }
:root[data-theme="dark"] .cal-ev-c-9 { background: #2a2e34; border-color: #868e96; color: #d8dbdf; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) .cal-ev-c-0 { background: #3a1515; border-color: #fa5252; color: #f8d0d0; }
  :root:not([data-theme="light"]):not([data-theme="dark"]) .cal-ev-c-1 { background: #3a1e0d; border-color: #fd7e14; color: #f8d9c4; }
  :root:not([data-theme="light"]):not([data-theme="dark"]) .cal-ev-c-2 { background: #3a2a0a; border-color: #fab005; color: #f8e6bd; }
  :root:not([data-theme="light"]):not([data-theme="dark"]) .cal-ev-c-3 { background: #0f2e16; border-color: #51cf66; color: #cfead4; }
  :root:not([data-theme="light"]):not([data-theme="dark"]) .cal-ev-c-4 { background: #0a2c32; border-color: #22b8cf; color: #c6e6eb; }
  :root:not([data-theme="light"]):not([data-theme="dark"]) .cal-ev-c-5 { background: #0c2744; border-color: #4dabf7; color: #c9dff6; }
  :root:not([data-theme="light"]):not([data-theme="dark"]) .cal-ev-c-6 { background: #161e44; border-color: #748ffc; color: #d0d6f6; }
  :root:not([data-theme="light"]):not([data-theme="dark"]) .cal-ev-c-7 { background: #22164a; border-color: #9775fa; color: #ddd0f6; }
  :root:not([data-theme="light"]):not([data-theme="dark"]) .cal-ev-c-8 { background: #3a1020; border-color: #e64980; color: #f3c9d8; }
  :root:not([data-theme="light"]):not([data-theme="dark"]) .cal-ev-c-9 { background: #2a2e34; border-color: #868e96; color: #d8dbdf; }
}

.cal-ext-stale {
  margin: 0 0.5rem 0 0;
  padding: 0.15rem 0.45rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
}
.cal-ext-stale.is-error { color: var(--danger); border-color: var(--danger); }
/* R1.1.7 §99.11: error pill = headline + hint (wraps on narrow toolbars); partial is quiet (muted, dashed). */
.cal-ext-stale { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 0.05rem 0.4rem; max-width: 100%; overflow-wrap: anywhere; }
.cal-ext-stale.is-error { border-radius: 0.6rem; }
.cal-ext-stale.is-partial { border-style: dashed; }
.cal-ext-msg { font-weight: 600; }
.cal-ext-stale.is-partial .cal-ext-msg, .cal-ext-stale.is-stale .cal-ext-msg { font-weight: 400; }
.cal-ext-hint { color: var(--text-muted); font-weight: 400; }

#cal-event-card {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 40;
  width: min(22rem, calc(100vw - 2rem));
  max-height: calc(100vh - 4rem);
  overflow: auto;
  padding: 1rem 1.1rem 1.1rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.cal-event-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}
#cal-event-card-title { margin: 0; font-size: 1.05rem; font-weight: 700; }
.cal-event-card-when, .cal-event-card-cal, .cal-event-card-meta { margin: 0 0 0.3rem; font-size: 0.9rem; }
.cal-event-card-note { margin: 0.7rem 0 0; font-size: 0.8rem; color: var(--text-muted); }
#cal-event-card-close { flex: 0 0 auto; }

/* R1.1.6 Stage 9: per-block iCloud sync state. Glyph + aria-label carry meaning (not color alone);
   shape also differs (solid / dashed / square). Classes only — style-src 'self'. Never covers the
   resize handle or the complete button. */
/* Pinned to the block's top-right corner so it never takes width from the title;
   the opener reserves room with padding. Container query compacts Retry in narrow week columns. */
.cal-block.has-sync { container-type: inline-size; }
.cal-block-sync {
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}
.cal-block.has-sync .cal-block-open { padding-right: 1.15rem; }
.cal-block.has-sync-retry .cal-block-open { padding-right: 3.6rem; }
.cal-sync-retry-glyph { margin-right: 0.15rem; }
@container (max-width: 120px) {
  .cal-sync-retry-text { display: none; }
  .cal-sync-retry-glyph { margin-right: 0; }
  .cal-block.has-sync-retry .cal-block-open { padding-right: 2.3rem; }
}
/* Very narrow week columns: the badge alone (glyph + aria-label still say "Not sent");
   Retry stays available in Task Details. The badge never captures clicks meant for the block. */
@container (max-width: 70px) {
  .cal-block-sync { pointer-events: none; }
  .cal-block-sync .cal-sync-retry { display: none; }
  .cal-block.has-sync-retry .cal-block-open { padding-right: 1.15rem; }
}
.cal-sync {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.15rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
  background: var(--surface);
}
.cal-sync.is-synced { color: var(--success); }
.cal-sync.is-pending { color: var(--text-muted); border-style: dashed; }
.cal-sync.is-failed { color: var(--danger); border-radius: 3px; background: var(--danger-soft); }
/* R1.1.7 §99.12(B): conflict + unknown never use the pending (dashed "Sending") look. */
.cal-sync.is-conflict { color: var(--danger); border-radius: 3px; border-width: 2px; padding: 0 0.1rem; }
.cal-sync.is-unknown { color: var(--text-muted); }
.cal-sync-retry {
  font: inherit;
  font-size: 0.62rem;
  font-weight: 650;
  line-height: 1;
  padding: 0.12rem 0.3rem;
  border-radius: 4px;
  border: 1px solid var(--danger);
  color: var(--danger);
  background: var(--surface);
  cursor: pointer;
  touch-action: manipulation;
}
.cal-sync-retry:hover { background: var(--danger-soft); }
.cal-sync-retry:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.cal-sync-retry:disabled { opacity: 0.6; cursor: default; }

.panel-sync {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
  font-size: 0.82rem;
}
.panel-sync .cal-sync-retry { font-size: 0.78rem; padding: 0.2rem 0.5rem; }

/* ---- R1.1.7 B03: the Complete control is always clickable ----
   The check sits above the resize handle; on short blocks (< 30 min, ~15 px tall at the default scale) the check
   shrinks to fit the block, the handle starts after it, and only the title shows (time/duration stay in aria-label). */
.cal-block-check { position: relative; z-index: 4; }
.cal-block-check[aria-busy="true"] { opacity: 0.55; cursor: progress; }
.cal-block.is-short { padding: 0 0.3rem; align-items: center; }
.cal-block.is-short .cal-block-check { flex-basis: 0.7rem; width: 0.7rem; height: 0.7rem; margin-top: 0; align-self: center; border-width: 1.25px; }
.cal-block.is-short .cal-block-open { flex-direction: row; align-self: stretch; align-items: center; }
.cal-block.is-short .cal-block-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-block.is-short .cal-block-time,
.cal-block.is-short .cal-block-dur { display: none; }
.cal-block.is-short .cal-resize-handle { left: 1.2rem; height: 6px; min-height: 6px; }
.cal-block.is-short .cal-resize-handle::after { margin-top: 2px; }
.cal-block.is-saving { opacity: 0.7; }
.calendar-pane.is-saving { cursor: progress; }
