/* Foxtap calendar: week and day grids, blocks, ghosts, drag states. */
.cal { display: flex; flex-direction: column; height: 100%; min-width: 0; }
.cal-head { display: grid; grid-template-columns: var(--gutter) repeat(var(--cols, 7), minmax(0, var(--colw, 1fr))); border-bottom: 1px solid var(--line); flex: none; padding-right: var(--scrollbar, 0px); }
.cal-day-head { padding: 10px 10px 8px; border-left: 1px solid var(--line); min-width: 0; }
.cal-day-head.today { background: var(--today-tint); }
.cal-day-head.weekend { color: var(--ink-3); }
.cdh-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; height: 24px; line-height: 1; }
.cdh-name { font-size: 12px; color: var(--ink-3); font-weight: 500; letter-spacing: .02em; text-transform: uppercase; }
.cdh-date { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; margin-left: 4px; color: var(--ink); line-height: 1; }
.today .cdh-date { color: var(--accent); }
.cdh-hours { font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.cdh-hours.empty { color: var(--ink-4); font-weight: 500; }
.cdh-bar { height: 4px; border-radius: 999px; background: var(--bg-3); margin-top: 7px; overflow: hidden; display: flex; }
.cdh-bar i { display: block; height: 100%; }
.cdh-bar .b { background: var(--ok); }
.cdh-bar .nb { background: var(--ink-4); }
.cdh-bar.over .b { background: var(--accent); }
.cal-body { flex: 1; overflow: auto; position: relative; }
.cal-grid { display: grid; grid-template-columns: var(--gutter) repeat(var(--cols, 7), minmax(0, var(--colw, 1fr))); height: calc(var(--minutes) * var(--ppm) * 1px); position: relative; }
.cal-times { position: relative; }
.cal-time { position: absolute; right: 8px; transform: translateY(-50%); font-size: 11px; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.cal-col { position: relative; border-left: 1px solid var(--line); min-width: 0;
  background-image: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px calc(60px * var(--ppm)));
  background-position: 0 -1px; }
.cal-col.today { background-color: var(--today-tint); }
.cal-col.weekend { background-color: var(--bg-2); }
.cal-col.drop-target { background-color: var(--accent-soft); }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--now); z-index: 5; pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--now); }

/* blocks */
.blk { --h: 220; --s: var(--blk-s); position: absolute; left: 2px; right: 3px; border-radius: 7px; padding: 4px 8px 4px 10px; overflow: hidden; cursor: grab; user-select: none;
  background: hsl(var(--h) var(--s) var(--blk-fill-l)); color: hsl(var(--h) 40% var(--blk-ink-l)); box-shadow: inset 3px 0 0 hsl(var(--h) var(--s) var(--blk-edge-l)), 0 0 0 1px rgba(255,255,255,.6);
  font-size: 12px; line-height: 1.3; z-index: 2; }
[data-theme="dark"] .blk { box-shadow: inset 3px 0 0 hsl(var(--h) var(--s) var(--blk-edge-l)), 0 0 0 1px rgba(0,0,0,.4); }
.blk:hover { box-shadow: inset 3px 0 0 hsl(var(--h) var(--s) var(--blk-edge-l)), 0 0 0 1px rgba(255,255,255,.6), var(--shadow-1); z-index: 3; }
.blk.selected { outline: 2px solid var(--accent); outline-offset: 1px; z-index: 4; }
.blk.dragging { opacity: .92; box-shadow: var(--shadow-2); z-index: 10; cursor: grabbing; will-change: transform; }
.blk.nb { background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(0,0,0,.045) 6px 8px); }
.blk.posted { --blk-fill-l: 95%; color: hsl(var(--h) 20% 40%); }
.blk.posted .blk-title { color: hsl(var(--h) 30% 32%); }
[data-theme="dark"] .blk.posted { --blk-fill-l: 19%; color: hsl(var(--h) 20% 70%); }
[data-theme="dark"] .blk.posted .blk-title { color: hsl(var(--h) 30% 80%); }
.blk.firm { --s: 0%; --h: 220; }
.blk.nomatter { --s: 0%; background: var(--bg-3); color: var(--ink-2); box-shadow: inset 3px 0 0 var(--ink-4), 0 0 0 1px rgba(255,255,255,.6); }
[data-theme="dark"] .blk.nomatter { box-shadow: inset 3px 0 0 var(--ink-4), 0 0 0 1px rgba(0,0,0,.4); }
.blk-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 16px; }
.blk-text { color: inherit; opacity: .85; overflow: hidden; display: -webkit-box; -webkit-line-clamp: var(--lines, 3); -webkit-box-orient: vertical; }
.blk.short { padding-top: 2px; padding-bottom: 2px; line-height: 1.2; }
.blk.short .blk-text { display: none; }
.blk.short .blk-title { font-size: 11.5px; }
.blk-status { position: absolute; top: 4px; right: 5px; width: 14px; height: 14px; color: hsl(var(--h) 40% 40%); opacity: .8; }
.blk-status svg { width: 14px; height: 14px; stroke-width: 2; }
.blk.posted .blk-status { opacity: .7; }
.blk-time { position: absolute; bottom: 3px; right: 7px; font-size: 10.5px; font-variant-numeric: tabular-nums; opacity: .65; }
.blk.short .blk-time { display: none; }
.blk-resize { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; cursor: ns-resize; }
.blk-resize::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 22px; height: 3px; margin-left: -11px; border-radius: 2px; background: hsl(var(--h) var(--s) var(--blk-edge-l)); opacity: 0; }
.blk:hover .blk-resize::after { opacity: .5; }

/* ghosts (suggestions) */
.sug { --h: 220; position: absolute; left: 2px; right: 3px; border-radius: 7px; padding: 3px 8px 3px 9px; overflow: hidden; cursor: pointer; user-select: none; z-index: 1;
  border: 1.5px dashed hsl(var(--h) 45% 62%); background: color-mix(in srgb, hsl(var(--h) 60% 95%) 55%, var(--bg)); color: hsl(var(--h) 35% 32%); font-size: 11.5px; line-height: 1.3; }
[data-theme="dark"] .sug { background: color-mix(in srgb, hsl(var(--h) 40% 25%) 50%, var(--bg)); color: hsl(var(--h) 40% 80%); }
.sug.nomatter { --h: 0; border-color: var(--line-2); color: var(--ink-3); background: color-mix(in srgb, var(--bg-3) 60%, var(--bg)); }
.sug:hover { background: hsl(var(--h) 60% 95%); box-shadow: var(--shadow-1); z-index: 3; min-height: 38px; }
.sug.short:hover .sug-sub { display: block; }
.sug.dragging { opacity: .9; box-shadow: var(--shadow-2); z-index: 10; will-change: transform; }
.sug.future { border-style: dotted; opacity: .85; }
.sug-row { display: flex; align-items: center; gap: 5px; min-width: 0; }
.sug-row svg { width: 13px; height: 13px; flex: none; opacity: .8; }
.sug-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sug-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .8; }
.sug-actions { position: absolute; top: 3px; right: 4px; display: none; gap: 2px; }
.sug:hover .sug-actions { display: flex; }
.sug-actions button { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; background: var(--bg); color: var(--ink-2); box-shadow: var(--shadow-1); }
.sug-actions button:hover { background: var(--bg-hover); color: var(--ink); }
.sug-actions button.accept { color: var(--ok); }
.sug-actions svg { width: 13px; height: 13px; stroke-width: 2.2; }
.sug.short { padding-top: 1px; padding-bottom: 1px; }
.sug.short .sug-sub { display: none; }

/* drag-create preview */
.preview { position: absolute; left: 2px; right: 3px; border-radius: 7px; background: var(--accent-soft); border: 1.5px solid var(--accent); color: var(--accent); font-size: 11.5px; font-weight: 600; padding: 3px 8px; z-index: 9; pointer-events: none; }

/* day view: wider column, suggestions list is in the rail */
.app[data-view="day"] .cal { --cols: 1; }
