/* Keel Productivity — app stylesheet on top of the Keel UI kit (./keel/keel-ui.css).
   Only kit tokens (var(--k-*)): Archivo, square corners, 2px rules, flush-left labels, the
   Productivity vivid / deep / tint / light, Ocean primary actions. No external fonts or images.

   1. Shell (body, boot, sign-in, focus banner, toasts, dialogs, ⌘K palette)
   2. Shared view helpers (pd-*)
   3. Today (Apps B 3a, Routes 1r)
   4. Inbox, Tasks, Task detail (1a–1c)
   5. Priority Matrix (Apps B 3b)
   6. Recurring, Daily Planner, Daily Rituals (1d–1f)
   7. Calendar (1g)
   8. Projects (1h, 1i): board, kanban, month, timeline
   9. Docs (1j)
  10. Bookings (1k)
  11. Meetings (1l)
  12. Focus, Workload, Reports, Templates (1m–1p)
  13. Settings (1q)
  14. Public booking, dialogs, shared bits */

/* ════════════════════════════════════════════════════════════════════════
   1. Shell
   ════════════════════════════════════════════════════════════════════════ */
html { background: var(--k-bg); }
body { margin: 0; min-height: 100vh; background: var(--k-bg); color: var(--k-text); font-family: var(--k-font); font-size: var(--k-fs-14); line-height: 1.55; }
#main { display: block; min-width: 0; }
#main:focus { outline: none; }
.view { min-width: 0; }

.pd-boot { min-height: 60vh; display: grid; place-items: center; padding: 24px; }
.pd-boot .k-state { width: min(420px, 100%); }

/* Sign in / create account — Keel Public 2a / 2b */
.pd-auth { min-height: 100vh; display: grid; place-items: start center; padding: 48px 16px; background: var(--k-bg); }
.pd-auth-card { width: min(400px, 100%); display: flex; flex-direction: column; gap: 16px; }
.pd-auth-brand { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 2px solid var(--k-divider); }
.pd-auth-app { font-weight: 600; font-size: var(--k-fs-14); }
.pd-auth h1 { margin: 0; font-size: var(--k-fs-36); font-weight: 800; letter-spacing: var(--k-tracking-h1); line-height: 1.05; }
.pd-auth-form { display: flex; flex-direction: column; gap: 14px; }
.pd-auth-form .k-btn-block { margin-top: 6px; }
.pd-auth-switch { margin: 0; font-size: var(--k-fs-13-5); color: var(--k-text-2); }
.pd-link-btn {
  background: none; border: 0; padding: 0; font: inherit; color: var(--k-link-strong); cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; min-height: 24px;
}
.pd-link-btn:hover { color: var(--k-link-hover); }

.pd-shell { min-height: 100vh; display: flex; flex-direction: column; }
.pd-shell #main { flex: 1; }
.pd-focus-banner { padding: 8px 24px; font-variant-numeric: tabular-nums; }

/* Toasts — tone panels from the kit palette, bottom right */
.pd-toasts {
  position: fixed; right: 16px; bottom: 16px; z-index: 2000; display: flex; flex-direction: column; gap: 8px;
  max-width: min(420px, calc(100vw - 32px)); pointer-events: none;
}
.pd-toast {
  pointer-events: auto; padding: 12px 16px; font-size: var(--k-fs-14); line-height: 1.45;
  background: var(--k-tone-ink-bg); color: var(--k-tone-ink-fg); border-left: 4px solid var(--k-primary);
  box-shadow: var(--k-shadow-md); animation: pd-toast-in 0.18s ease-out;
}
.pd-toast--success { border-left-color: var(--k-success); }
.pd-toast--error { background: var(--k-tone-safety-bg); color: var(--k-tone-safety-fg); border-left-color: var(--k-error); }
.pd-toast.leaving { opacity: 0; transition: opacity 0.25s; }
@keyframes pd-toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* The shared modal (#modal): Keel System 1f dialog with a sticky title row */
dialog.pd-modal { width: min(720px, calc(100vw - 32px)); padding: 0; gap: 0; }
.pd-modal-head {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 12px;
  padding: 14px 16px 12px; background: var(--k-raised); border-bottom: 2px solid var(--k-divider);
}
.pd-modal-head .k-dialog-title { flex: 1; margin: 0; }
.pd-modal-close { font-size: 22px; line-height: 1; justify-content: center; }
.pd-modal-body { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.pd-modal-body > form { display: flex; flex-direction: column; gap: 14px; }
.pd-modal-body .k-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.k-dialog-title { font-size: var(--k-fs-20); font-weight: 800; letter-spacing: var(--k-tracking-h2); }

/* ⌘K — the kit palette (Keel Suite 1c) inside a native modal dialog, placed exactly where the kit's
   .k-palette-overlay puts it: top max(48px, 10vh) with 16px sides; on phones 16px from the top, 12px sides. */
dialog.pd-cmdk {
  width: min(560px, calc(100vw - 32px)); max-width: none; max-height: none; margin: max(48px, 10vh) auto auto; padding: 0;
  border: 0; background: transparent; color: var(--k-text); overflow: visible;
}
dialog.pd-cmdk::backdrop { background: var(--k-scrim-strong); }
.pd-cmdk .k-palette { width: 100%; }
.pd-cmdk-icon { display: inline-flex; flex: none; color: var(--k-muted); }
.pd-cmdk-capture-hint { display: none; }
@media (max-width: 720px) {
  dialog.pd-cmdk { width: calc(100vw - 24px); margin-top: 16px; }
  /* The kit's shorter placeholder fits a phone; the capture hint moves to the footer. */
  .pd-cmdk-capture-hint { display: inline; }
}

/* ════════════════════════════════════════════════════════════════════════
   2. Shared view helpers
   ════════════════════════════════════════════════════════════════════════ */
.k-block.pd-bare { padding: 0; gap: 0; }
.pd-mob { display: none !important; }
@container k-page (max-width: 720px) {
  .pd-desk { display: none !important; }
  .pd-mob { display: flex !important; }
  .k-grid > .k-block.pd-mob-head { padding: 0; }
}

.pd-row-link { color: var(--k-text); text-decoration: none; }
.pd-row-link:hover { color: var(--k-link-strong); text-decoration: underline; }
.k-list-row.pd-row-selected { background: var(--k-app-tint); box-shadow: inset 3px 0 0 var(--k-app-deep); padding-left: 10px; }
.k-list-row .k-btn[aria-pressed="true"] { background: var(--k-app-deep); border-color: var(--k-app-deep); color: var(--k-on-app); }
.k-list-row .k-select { width: auto; }
.k-list-meta:empty { display: none; }

.pd-datenav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.pd-datenav-step { min-width: 36px; justify-content: center; font-size: var(--k-fs-17); }
/* Workload: a start date beside prev / today / next. */
.pd-wl-start { display: flex; flex-wrap: nowrap; gap: 8px; }
.pd-wl-start .k-input { width: auto; min-width: 0; }

.pd-subhead { margin: 8px 0 0; font-size: var(--k-fs-11-5); font-weight: 600; letter-spacing: var(--k-tracking-label); text-transform: uppercase; color: var(--k-muted); }
.pd-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: var(--k-fs-13-5); }
.pd-kv dt { color: var(--k-muted); }
.pd-kv dd { margin: 0; font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; overflow-wrap: anywhere; }
.pd-kv-note { font-weight: 400; color: var(--k-text-2); }

.pd-inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.pd-inline-form .k-field { flex: 1 1 160px; }
.pd-inline-form > .k-input { flex: 1 1 180px; width: auto; }
.pd-inline-form .k-btn { min-height: 44px; }

.pd-more { border-top: 1px solid var(--k-divider); padding-top: 10px; }
.pd-more > summary { cursor: pointer; font-weight: 600; font-size: var(--k-fs-13-5); min-height: 32px; display: flex; align-items: center; color: var(--k-link-strong); }
.pd-more[open] > summary { margin-bottom: 10px; }
.pd-more > .k-btn-group, .pd-more > form { margin-top: 10px; }

.pd-check { display: flex; align-items: flex-start; gap: 10px; min-height: 32px; padding: 4px 0; font-size: var(--k-fs-14); cursor: pointer; }
.pd-check input, .pd-checkbox { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--k-primary); cursor: pointer; }
.pd-fieldset { border: 0; margin: 0; padding: 0; min-inline-size: 0; display: flex; flex-direction: column; gap: 14px; }
.pd-state { align-items: flex-start; }
.k-btn-group:empty { display: none; }
.k-form--1 { grid-template-columns: minmax(0, 1fr); }
.k-head-main .k-btn-group { margin-top: 4px; }
.k-block .k-caption a { color: var(--k-link-strong); }

/* Menu button (Calendar "Week ▾") */
.pd-menu-anchor { position: relative; display: inline-flex; }
.pd-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 180px; display: flex; flex-direction: column;
  background: var(--k-raised); border: 1px solid var(--k-divider); border-top: 2px solid var(--k-divider-strong); box-shadow: var(--k-shadow-md);
}
.pd-menu-item {
  display: flex; align-items: center; min-height: 44px; padding: 0 14px; border: 0; background: transparent; color: var(--k-text);
  font: inherit; font-size: var(--k-fs-14); text-align: left; cursor: pointer;
}
.pd-menu-item:hover { background: var(--k-hover-wash); }
.pd-menu-item[aria-checked="true"] { font-weight: 800; box-shadow: inset 3px 0 0 var(--k-app-deep); background: var(--k-app-tint); }
.pd-menu-item:focus-visible { outline-offset: -2px; }

/* Drag and drop feedback (planner, kanban) */
.pd-dragging { opacity: 0.5; }
.pd-drop-over { outline: 2px dashed var(--k-app-deep); outline-offset: -2px; background: var(--k-app-tint); }
[draggable="true"] { cursor: grab; }

/* ════════════════════════════════════════════════════════════════════════
   3. Today — Apps B 3a (desktop), Routes 1r (phone)
   ════════════════════════════════════════════════════════════════════════ */
.pd-cap-head {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 420px); gap: 32px; align-items: end;
  padding: 24px 32px; background: var(--k-app-tint); border-bottom: 2px solid var(--k-divider);
}
.pd-cap-title { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pd-cap-title .k-kicker { font-size: var(--k-fs-12); }
.pd-cap-title h1 { margin: 0; font-size: 34px; font-weight: 800; line-height: 1.1; letter-spacing: var(--k-tracking-h1); text-wrap: balance; }
.pd-cap { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pd-cap-bar { display: flex; height: 22px; border: 2px solid var(--k-divider); background: transparent; }
.pd-cap-bar--over { border-color: var(--k-caution); }
.pd-cap-seg { flex: var(--grow, 0) 1 0; min-width: 2px; }
.pd-cap-seg--meet, .pd-cap-key--meet i { background: var(--k-text); }
.pd-cap-seg--focus, .pd-cap-key--focus i { background: var(--k-productivity); }
.pd-cap-seg--task, .pd-cap-key--task i { background: var(--k-productivity-light); }
.pd-cap-seg--free { background: transparent; }
.pd-cap-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--k-fs-11-5); color: var(--k-muted); }
.pd-cap-key { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.pd-cap-key i { display: inline-block; width: 8px; height: 8px; }
.pd-cap-key--focus { color: var(--k-productivity-deep); }
.pd-cap-key--free i { border: 1px solid var(--k-muted); }
.pd-cap-key--over { color: var(--k-caution); font-weight: 600; }
.pd-cap-key--over i { background: var(--k-caution); border: 0; }

.pd-today-cols { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.pd-top { border-right: 2px solid var(--k-divider); min-width: 0; }
.pd-top-head { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 32px; border-bottom: 2px solid var(--k-divider); }
.pd-top-head h2 { margin: 0 auto 0 0; font-size: var(--k-fs-17); font-weight: 800; letter-spacing: -0.01em; }
.pd-inbox-btn { font-variant-numeric: tabular-nums; }
.pd-top-list, .pd-agenda-list { list-style: none; margin: 0; padding: 0; }
.pd-top-row {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 32px;
  border-bottom: 1px solid var(--k-divider); transition: background-color var(--k-ease);
}
.pd-top-row:hover { background: var(--k-raised); }
.pd-top-check { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--k-primary); cursor: pointer; }
.pd-top-title { flex: 1; min-width: 0; font-size: var(--k-fs-14); color: var(--k-text); text-decoration: none; overflow-wrap: anywhere; }
.pd-top-title:hover { color: var(--k-link-strong); text-decoration: underline; }
.pd-top-title.k-is-done { color: var(--k-muted); text-decoration: line-through; }
.pd-est { background: var(--k-surface); color: var(--k-text-2); font-variant-numeric: tabular-nums; }
.pd-top-empty, .pd-agenda-empty { padding: 16px 32px; }

.pd-agenda { padding: 8px 0; min-width: 0; }
.pd-agenda-row { display: grid; grid-template-columns: 72px minmax(0, 1fr); min-height: 52px; border-bottom: 1px solid var(--k-divider); }
.pd-agenda-time { padding: 10px 0 0 24px; font-size: var(--k-fs-12); color: var(--k-muted); font-variant-numeric: tabular-nums; }
.pd-agenda-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 24px 6px 0; padding: 8px 12px;
  font: inherit; font-size: var(--k-fs-13-5); text-align: left; color: var(--k-text); text-decoration: none;
  border: 0; border-left: 4px solid var(--k-track); background: transparent; min-width: 0;
}
.pd-agenda-item b { font-weight: 800; min-width: 0; overflow-wrap: anywhere; }
.pd-agenda-item span { flex: none; font-variant-numeric: tabular-nums; }
.pd-agenda--focus, .pd-agenda--task { background: color-mix(in srgb, var(--k-productivity) 14%, var(--k-raised)); border-left-color: var(--k-productivity); cursor: pointer; }
.pd-agenda--task { background: color-mix(in srgb, var(--k-productivity-light) 30%, var(--k-raised)); border-left-color: var(--k-productivity-light); }
.pd-agenda--focus:hover, .pd-agenda--task:hover { box-shadow: var(--k-shadow-sm); }
.pd-agenda--meeting { background: var(--k-tone-ink-bg); color: var(--k-tone-ink-fg); border-left-color: var(--k-tone-ink-bg); --k-focus: var(--k-ocean-500); }
a.pd-agenda--meeting:hover { color: var(--k-tone-ink-fg); box-shadow: var(--k-shadow-sm); }
.pd-agenda--protected, .pd-agenda--free { font-weight: 400; }
.pd-agenda--free b { font-weight: 600; color: var(--k-text-2); }
.pd-capture { display: flex; gap: 10px; flex-wrap: wrap; }
.pd-capture .k-input { flex: 1 1 200px; width: auto; }
.pd-capture .k-btn { min-height: 44px; }
.pd-mob-head .k-head { width: 100%; }

@container k-page (max-width: 900px) {
  .pd-cap-head { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}

/* ════════════════════════════════════════════════════════════════════════
   4. Inbox, Tasks, Task detail
   ════════════════════════════════════════════════════════════════════════ */
.pd-inbox-list .k-list-row { min-height: 64px; }
.k-block--form .pd-more { margin-top: 4px; }

.pd-chips-block { padding-top: 22px; padding-bottom: 22px; }
.pd-chips-block .k-block-head { display: none; }
.pd-tasks-table th, .pd-tasks-table td { padding: 10px 8px; }
.pd-tasks-table tbody tr.pd-row-selected { background: var(--k-app-tint); }
.pd-sel-col { width: 40px; }
/* The 20px select box sits in a 44px label hit area; negative margins keep the row height. */
.pd-hit { display: grid; place-items: center; min-width: 44px; min-height: 44px; margin: -12px -16px -12px -8px; cursor: pointer; }
.pd-tasks-table th.pd-sel-col { vertical-align: middle; }
.pd-task-link { display: block; font-weight: 600; color: var(--k-text); text-decoration: none; overflow-wrap: anywhere; }
.pd-task-link:hover { color: var(--k-link-strong); text-decoration: underline; }
.pd-cell-meta { display: block; font-size: var(--k-fs-12); font-weight: 400; color: var(--k-muted); }
.pd-cell-link { color: var(--k-text); text-decoration: none; }
.pd-cell-link:hover { color: var(--k-link-strong); text-decoration: underline; }
.pd-overdue { color: var(--k-error); font-weight: 600; }
.pd-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.pd-bulk-count { margin-right: 4px; font-variant-numeric: tabular-nums; }
.pd-bulk-pair { display: inline-flex; gap: 6px; align-items: center; }
.pd-bulk-pair .k-select, .pd-bulk-pair .k-input { width: auto; min-width: 150px; min-height: 36px; }

.pd-autosave .k-form { gap: 16px 20px; }
.pd-save-status { min-height: 1.55em; }
.pd-quick-tags { margin-top: 10px; }
.k-input[readonly] { background: var(--k-surface); color: var(--k-text-2); }

/* ════════════════════════════════════════════════════════════════════════
   5. Priority Matrix — Apps B 3b
   ════════════════════════════════════════════════════════════════════════ */
.pd-matrix-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 16px 32px; border-bottom: 2px solid var(--k-divider); }
.pd-matrix-head h1 { margin: 0 auto 0 0; font-size: var(--k-fs-28); font-weight: 800; letter-spacing: var(--k-tracking-h1); line-height: 1.15; }
.pd-matrix-hint { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: var(--k-fs-13); color: var(--k-muted); }
.pd-matrix-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 16px; padding: 12px 32px; border-bottom: 2px solid var(--k-divider); }
.pd-matrix-filters .k-field { flex: 0 1 220px; }
.pd-matrix-filters .k-input, .pd-matrix-filters .k-select { min-height: 36px; }
.pd-matrix-rule { flex: 1 1 280px; margin: 0; }
.pd-matrix { display: grid; grid-template-columns: 40px minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: 32px minmax(260px, auto) minmax(260px, auto); }
.pd-matrix-col {
  padding: 8px 16px; font-size: var(--k-fs-12); font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  border-bottom: 2px solid var(--k-divider);
}
.pd-matrix-col + .pd-matrix-col { border-left: 2px solid var(--k-divider); }
.pd-matrix-row {
  writing-mode: vertical-rl; transform: rotate(180deg); display: flex; align-items: center; justify-content: center;
  padding: 12px 8px; font-size: var(--k-fs-12); font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  /* rotated 180°: border-left draws on the right, border-top along the bottom */
  border-left: 2px solid var(--k-divider); border-top: 2px solid var(--k-divider);
}
.pd-quad { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 14px 16px; border-bottom: 2px solid var(--k-divider); }
.pd-quad + .pd-matrix-row, .pd-matrix-row + .pd-quad + .pd-quad { border-left: 2px solid var(--k-divider); }
.pd-quad--target { background: var(--k-raised); cursor: pointer; }
.pd-quad--target:hover { background: var(--k-app-tint); }
.pd-quad-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 22px; font-size: var(--k-fs-13); }
.pd-quad-head > span { color: var(--k-muted); }
.pd-quad-move { min-height: 32px; }
.pd-mtask {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; padding: 10px 12px;
  font: inherit; font-size: var(--k-fs-13-5); text-align: left; color: var(--k-text);
  background: var(--k-raised); border: 2px solid transparent; cursor: pointer;
}
.pd-mtask > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.pd-mtask:hover { border-color: var(--k-divider); }
.pd-mtask[aria-pressed="true"] { border-color: var(--k-primary); box-shadow: inset 0 0 0 1px var(--k-primary); }
.pd-quad--target .pd-mtask { background: var(--k-bg); }
.pd-mtask-est { flex: none; font-size: var(--k-fs-12); color: var(--k-muted); font-variant-numeric: tabular-nums; }
.pd-quad-empty { margin: 0; font-size: var(--k-fs-13); color: var(--k-muted); }
@container k-page (max-width: 720px) {
  .pd-matrix-head, .pd-matrix-filters { padding-inline: 16px; }
  .pd-matrix { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .pd-matrix-corner, .pd-matrix-col, .pd-matrix-row { display: none; }
  .pd-quad { min-height: 160px; border-left: 0 !important; }
}

/* ════════════════════════════════════════════════════════════════════════
   6. Recurring, Daily Planner, Daily Rituals
   ════════════════════════════════════════════════════════════════════════ */
.pd-recur-table td:last-child { width: 1%; white-space: nowrap; }
.pd-row-actions { display: inline-flex; gap: 6px; }
.pd-recur-table th:last-child { text-align: right; }

.pd-planned .k-hbar-track { height: 10px; }
.pd-unscheduled .k-list-row { min-height: 64px; }
.pd-dayplan .k-list-lead { width: 64px; font-variant-numeric: tabular-nums; }
.pd-dayplan .k-list-row { padding-left: 2px; }
.pd-place .k-form { gap: 14px; }
.pd-place .k-form-actions { margin-top: 12px; }

.pd-rollover { display: flex; flex-direction: column; max-height: 320px; overflow: auto; border-top: 1px solid var(--k-divider); border-bottom: 1px solid var(--k-divider); padding: 4px 0; }
form[data-form="shutdown"] { display: flex; flex-direction: column; gap: 10px; }
form[data-form="highlights"] .k-form-actions { margin-top: 4px; }

/* ════════════════════════════════════════════════════════════════════════
   7. Calendar
   ════════════════════════════════════════════════════════════════════════ */
.pd-cal-week .k-scroll-x { padding: 22px 28px; }
.pd-cal-week .k-week-item { cursor: pointer; }
.pd-cal-workweek .k-week { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.pd-cal-day .k-week { grid-template-columns: minmax(0, 1fr); }
.pd-cal-day .k-week-item { max-width: 520px; }
.pd-cal-month .k-scroll-x { padding: 22px 28px; }
.pd-cal-month > .k-block-head { padding: 22px 28px 0; }
.pd-month .k-month-cell { min-height: 96px; }
.pd-month-n {
  align-self: flex-start; min-width: 28px; min-height: 28px; padding: 0 4px; border: 0; background: transparent;
  font: inherit; font-size: var(--k-fs-12); color: inherit; cursor: pointer; text-align: left;
}
.pd-month-n:hover { text-decoration: underline; }
.pd-month-ev { display: block; width: 100%; border-top: 0; border-right: 0; border-bottom: 0; font: inherit; font-size: var(--k-fs-10-5); text-align: left; cursor: pointer; text-decoration: none; }
a.pd-month-ev:hover, button.pd-month-ev:hover { color: var(--k-text); box-shadow: var(--k-shadow-sm); }
.pd-milestone-ev { font-weight: 800; }
.pd-month-more { align-self: flex-start; border: 0; background: none; padding: 2px 0; font: inherit; font-size: var(--k-fs-11); color: var(--k-link-strong); cursor: pointer; text-decoration: underline; }
.pd-month-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 28px 0; }
@container k-page (max-width: 720px) {
  .pd-cal-week .k-scroll-x, .pd-cal-month .k-scroll-x { padding: 16px; }
  .pd-cal-day .k-week { min-width: 0; }
  .pd-cal-month > .k-block-head, .pd-month-nav { padding-inline: 16px; }
}

/* ════════════════════════════════════════════════════════════════════════
   8. Projects
   ════════════════════════════════════════════════════════════════════════ */
.pd-project-cards .k-card { min-height: 128px; }
.pd-stage .k-list-row { min-height: 64px; }
.pd-caption-block { padding-top: 12px; padding-bottom: 12px; }
.pd-kcards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; min-height: 80px; }
.pd-kcard { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; background: var(--k-raised); border-top: 2px solid var(--k-app); }
.pd-kcard-title { font-weight: 800; color: var(--k-text); text-decoration: none; overflow-wrap: anywhere; }
.pd-kcard-title:hover { color: var(--k-link-strong); text-decoration: underline; }
.pd-kmove { display: flex; gap: 6px; margin-top: 4px; }
.pd-kmove .k-select { flex: 1; min-width: 0; min-height: 36px; }
.pd-kempty { padding: 16px 0; font-size: var(--k-fs-13); color: var(--k-muted); }
.pd-kcol.pd-drop-over { background: var(--k-app-tint); }
.pd-inline-select { width: auto; min-width: 110px; min-height: 36px; }

.pd-gantt { overflow-x: auto; border-top: 1px solid var(--k-divider); }
.pd-gantt-inner { min-width: 720px; }
.pd-gantt-row { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 36px; border-bottom: 1px solid var(--k-divider); }
.pd-gantt-label { display: flex; align-items: center; padding: 4px 10px 4px 0; font-size: var(--k-fs-13); overflow: hidden; border-right: 1px solid var(--k-divider); }
.pd-gantt-label a { color: var(--k-text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-gantt-label a:hover { color: var(--k-link-strong); text-decoration: underline; }
.pd-gantt-track { position: relative; min-height: 36px; }
.pd-gantt-axis .pd-gantt-track, .pd-gantt-axis .pd-gantt-label { font-size: var(--k-fs-11); color: var(--k-muted); }
.pd-gantt-tick { position: absolute; top: 0; bottom: 0; left: var(--left, 0); padding: 8px 0 0 4px; border-left: 1px solid var(--k-divider); white-space: nowrap; }
.pd-gantt-bar { position: absolute; top: 10px; height: 16px; left: var(--left, 0); width: var(--w, 1%); min-width: 4px; background: var(--k-productivity); }
.pd-gantt-bar.pd-src-constraints { background: repeating-linear-gradient(45deg, var(--k-productivity-light) 0 4px, var(--k-app-tint) 4px 8px); outline: 1px solid var(--k-productivity-light); }
.pd-gantt-bar.pd-st-at_risk { background: var(--k-caution); }
.pd-gantt-bar.pd-st-cannot_fit { background: var(--k-error); }
.pd-gantt-bar.pd-done { background: var(--k-success); }
.pd-gantt-deadline { position: absolute; top: 4px; bottom: 4px; left: var(--left, 0); width: 2px; background: var(--k-error); }
.pd-gantt-ms { position: absolute; top: 11px; left: var(--left, 0); width: 14px; height: 14px; background: var(--k-text); transform: translateX(-50%) rotate(45deg); }
/* Phones: a narrow task column that stays put while the chart scrolls sideways (app.js scrolls to the current work). */
@container k-page (max-width: 720px) {
  .pd-gantt-row { grid-template-columns: 112px minmax(0, 1fr); }
  .pd-gantt-label { position: sticky; left: 0; z-index: 1; background: var(--k-ground, var(--k-bg)); }
}
@media (forced-colors: active) {
  .pd-gantt-bar, .pd-gantt-ms, .pd-cap-seg { forced-color-adjust: none; background: Highlight; }
  .pd-gantt-deadline { background: CanvasText; }
  .pd-mtask[aria-pressed="true"] { outline: 2px solid Highlight; }
}

/* Completion confetti (focusEffects.js sets --x/--delay/--turn through the CSSOM) */
.completion-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 10000; overflow: hidden; }
.completion-confetti i { position: absolute; left: var(--x); top: -20px; width: 8px; height: 12px; background: var(--k-productivity); animation: completion-fall 1.7s var(--delay) ease-in forwards; }
.completion-confetti i:nth-child(3n) { background: var(--k-primary); }
.completion-confetti i:nth-child(3n + 1) { background: var(--k-productivity-light); }
@keyframes completion-fall { to { transform: translateY(100vh) rotate(var(--turn)); opacity: 0; } }

/* ════════════════════════════════════════════════════════════════════════
   9. Docs (1j)
   ════════════════════════════════════════════════════════════════════════ */
.pd-doc-list .k-list-row { min-height: 60px; }
.pd-doc-body { gap: 14px; }
.pd-doc-body .k-text-head { margin-top: 6px; }
.pd-doc-body .k-text-head:first-child { margin-top: 0; }
.pd-doc-body .pd-doc-h2 { font-size: var(--k-fs-20); }
.pd-doc-body .pd-doc-h3 { font-size: var(--k-fs-17); }
.pd-doc-body .k-text-list { max-width: 720px; }
.pd-doc-checklist { list-style: none; padding-left: 0; }
.pd-doc-checklist li { display: flex; align-items: flex-start; gap: 10px; }
.pd-doc-box {
  flex: none; display: inline-grid; place-items: center; width: 18px; height: 18px; margin-top: 2px;
  border: 2px solid var(--k-text); font-size: var(--k-fs-12); font-weight: 800; line-height: 1;
}
.pd-doc-quote { margin: 0; padding: 4px 0 4px 14px; border-left: 4px solid var(--k-app); color: var(--k-text-2); font-size: var(--k-fs-15); }
.pd-doc-code { margin: 0; padding: 12px 14px; overflow-x: auto; background: var(--k-surface); border: 1px solid var(--k-divider); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--k-fs-13); }
.pd-doc-body code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; padding: 0 3px; background: var(--k-surface); }
.pd-task-ref { font-weight: 600; color: var(--k-link-strong); text-underline-offset: 3px; }
.pd-doc-empty { color: var(--k-muted); }
.pd-doc-editor { display: flex; flex-direction: column; gap: 14px; }
.pd-doc-textarea { min-height: 360px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--k-fs-14); line-height: 1.6; }
.pd-doc-status { align-self: center; }

/* ════════════════════════════════════════════════════════════════════════
   10. Bookings (1k)
   ════════════════════════════════════════════════════════════════════════ */
.pd-booking-cards .k-card { min-height: 140px; }
.pd-booking-cards .k-card-kicker { text-transform: uppercase; }
.pd-bookings-all .k-chips { margin-bottom: 4px; }
.pd-bookings-all .k-table td:last-child { width: 1%; white-space: nowrap; }
.pd-cell-meta + .pd-cell-meta { margin-top: 2px; }
.pd-chip-static { cursor: default; font-variant-numeric: tabular-nums; }
.pd-slots { display: flex; flex-direction: column; gap: 12px; }
.pd-slots:empty { display: none; }
.pd-slot-day { display: flex; flex-direction: column; gap: 6px; }
.pd-slot-day > b { font-size: var(--k-fs-13-5); }
.pd-modal-body .k-dialog-actions.pd-dialog-actions-start { justify-content: flex-start; }

/* ════════════════════════════════════════════════════════════════════════
   11. Meetings (1l)
   ════════════════════════════════════════════════════════════════════════ */
.pd-meet-side .k-list-lead, .pd-doc-list .k-list-lead { font-variant-numeric: tabular-nums; }
.pd-meet-side .pd-subhead:first-child { margin-top: 0; }
.pd-doc-list .k-list-row.pd-row-selected, .pd-meet-side .k-list-row.pd-row-selected { background: transparent; box-shadow: none; padding-left: 0; }
.pd-doc-list .pd-row-selected .pd-row-link, .pd-meet-side .pd-row-selected .pd-row-link { color: var(--k-text); font-weight: 800; }
.pd-meet-notes .pd-subhead:first-of-type { margin-top: 0; }
.pd-meet-notes .k-text-p, .pd-meet-notes .k-text-list { font-size: var(--k-fs-14-5); }
.pd-actions-list .k-list-row { flex-wrap: wrap; }
.pd-actions-list .pd-proposal .k-list-main { flex-basis: 100%; }
.pd-actions-list .pd-proposal .k-btn { flex: 1 1 auto; }
.pd-field-narrow { flex: 0 1 110px !important; }
.pd-notes-form .k-textarea { min-height: 120px; }

/* ════════════════════════════════════════════════════════════════════════
   12. Focus, Workload, Reports, Templates (1m–1p)
   ════════════════════════════════════════════════════════════════════════ */
.pd-focus-big { gap: 14px; }
.pd-focus-clock { font-variant-numeric: tabular-nums; }
.pd-focus-progress { max-width: 100%; }
.pd-focus-big .k-btn-group { gap: 6px 12px; }
.k-head-main > .k-chips { margin-top: 10px; }
.pd-tpl-filter { gap: 12px; }
.pd-tpl-search { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.pd-tpl-search .k-input { flex: 0 1 320px; width: auto; }
.pd-tpl-cards .k-card { min-height: 112px; }

/* ════════════════════════════════════════════════════════════════════════
   13. Settings (1q)
   ════════════════════════════════════════════════════════════════════════ */
.pd-readonly { background: var(--k-surface); color: var(--k-text-2); }
.pd-hours-table td { vertical-align: middle; }
.pd-hours-table td:first-child { width: 140px; }
.pd-hours-table td:last-child { width: 1%; white-space: nowrap; text-align: right; }
.pd-ranges { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.pd-hours-range { display: inline-flex; align-items: center; gap: 6px; }
.pd-hours-range .k-input { width: 128px; }
.pd-range-remove { min-width: 36px; justify-content: center; font-size: var(--k-fs-17); }
.pd-cal-list .k-list-row, .pd-rule-list .k-list-row { flex-wrap: wrap; }
.pd-cal-controls { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.pd-rule-list .k-list-main { flex-basis: 60%; }
[data-form="theme"] .k-field { margin: 12px 0; }

/* ════════════════════════════════════════════════════════════════════════
   14. Public booking, dialogs, shared bits
   ════════════════════════════════════════════════════════════════════════ */
.pd-public { min-height: 100vh; display: flex; flex-direction: column; background: var(--k-bg); }
.pd-public .pd-public-bar { position: static; }
.pd-public-main { flex: 1; display: block; }
.pd-public-main:focus { outline: none; }
.pd-public-pad { padding: 32px; }
.pd-hidden { display: none !important; }
.pd-subhead--minor { margin-top: 4px; text-transform: none; letter-spacing: 0; font-size: var(--k-fs-13); color: var(--k-text-2); }
.pd-modal-body .k-kpis { gap: 14px; }
.pd-modal-body .k-kpi-value { font-size: var(--k-fs-24); }
.pd-modal-body .k-note { margin-top: 4px; }

/* Distraction-free focus (dialog): the big clock on Ink */
.pd-immersive {
  display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 48px 24px; text-align: center;
  background: var(--k-tone-ink-bg); color: var(--k-tone-ink-fg);
}
.pd-immersive .k-big-value { font-size: clamp(56px, 14vw, 112px); color: var(--k-tone-ink-fg); }
.pd-immersive-kicker { font-size: var(--k-fs-12); font-weight: 600; letter-spacing: var(--k-tracking-label); text-transform: uppercase; }
.pd-immersive-line { margin: 0; font-size: var(--k-fs-15); }
.pd-immersive-hint { font-size: var(--k-fs-12-5); opacity: 0.85; }
.pd-immersive-done { font-size: var(--k-fs-36); font-weight: 800; }

@container k-page (max-width: 720px) {
  .pd-tasks-table { min-width: 680px; }
  .pd-public-pad { padding: 20px 16px; }
}
/* Headings receive focus on navigation (screen readers announce the page); they are not controls. */
h1[tabindex="-1"]:focus { outline: none; }
.pd-slot-day + .pd-slot-day { margin-top: 8px; }
.pd-bookings-all .k-table { min-width: 680px; }
.pd-bookings-all .k-table td:first-child, .pd-hours-table td:first-child { white-space: nowrap; }

/* Reports weekly and Workload day-by-day tables: dates stay on one line. */
.pd-week-table td:first-child, .pd-week-table th:first-child { white-space: nowrap; }
/* Reports trend: sparse date labels may run past their narrow column into the blank ones beside them. */
.pd-trend .k-cols-labels span { overflow: visible; }

/* ════════════════════════════════════════════════════════════════════════
   Touch targets (coarse pointers). The kit enlarges its own controls; these
   rules give the app's compact links, toggles and inputs a 44px hit area.
   ════════════════════════════════════════════════════════════════════════ */
@media (pointer: coarse) {
  /* A linked list title covers its whole row; the row's own controls stay on top. */
  .k-list-row:has(> .k-list-main > .pd-row-link) { position: relative; }
  .pd-row-link::after { content: ""; position: absolute; inset: 0; }
  .k-list-row:has(> .k-list-main > .pd-row-link) :is(a, button, input, select, textarea, label, .k-btn):not(.pd-row-link) { position: relative; z-index: 1; }
  /* Table links fill their cell, never more: the cell that holds one must be positioned
     (pd-cell-host; :has() catches any cell built without it), or the overlay covers the page. */
  .pd-cell-host, .k-table td:has(> .pd-cell-link, > .pd-task-link) { position: relative; }
  .pd-task-link::after, .pd-cell-link::after { content: ""; position: absolute; inset: 0; }
  .pd-tasks-table td { height: 48px; }
  .pd-tasks-table th.pd-sel-col { padding-block: 12px; }
  .pd-more > summary, .pd-check, .pd-month-more { min-height: 44px; }
  .pd-check { align-items: center; }
  .pd-kcard-title, .pd-month-ev { display: flex; align-items: center; min-height: 44px; }
  .k-input--sm, .pd-kmove .k-select, .pd-matrix-filters .k-input, .pd-matrix-filters .k-select,
  .pd-bulk-pair .k-select, .pd-bulk-pair .k-input, .pd-inline-select { min-height: 44px; }
  .pd-hit { position: relative; z-index: 1; }
  .pd-range-remove, .pd-month-nav .k-btn, .pd-datenav-step { min-width: 44px; min-height: 44px; }
  .pd-gantt-row, .pd-gantt-track { min-height: 44px; }
  .pd-gantt-label a { display: flex; align-items: center; min-height: 44px; }
  .pd-gantt-bar { top: 14px; }
}
