/* ============================================================
   Sentinel Docs — CALENDAR. One short line per thing in a day, its
   words in ink and its kind a dot; a click on the day opens the day's
   panel, and the list is an agenda. Colour lives only in the dots and
   the tags - late, done, today (the owner, 2026-10-15).
============================================================ */
.dx .cp-act, .dx .wk-act, .dx .cd-act, .dx .cl-act { --k: var(--red); }
.dx .cp-renew, .dx .wk-renew, .dx .cd-renew, .dx .cl-renew { --k: var(--amber); }
.dx .cp-obl, .dx .wk-obl, .dx .cd-obl, .dx .cl-obl { --k: var(--blue); }
.dx .cp-pin, .dx .wk-pin, .dx .cd-pin, .dx .cl-pin { --k: var(--green); }
.dx .cp-pout, .dx .wk-pout, .dx .cd-pout, .dx .cl-pout { --k: var(--ink-4); }

.dx .cal-wrap { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 100%; }
.dx .pg-cal { max-width: 1240px; width: 100%; padding: 32px 40px 80px; }

.dx .cal-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dx .cal-head h1 { margin: 0; min-width: 210px; font-size: 26px; font-weight: 600; letter-spacing: -.022em; }
.dx .cal-head h1 span { color: var(--ink-3); font-weight: 400; }
.dx .cal-nav { display: flex; align-items: center; gap: 2px; }
.dx .cal-nav .btn { margin-right: 6px; }
.dx .cal-sum { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 20px; margin: 6px 0 20px; font-size: 13px; color: var(--ink-3); }
.dx .cal-layers { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 14px; }
.dx .cl { display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 10px; border: 1px solid var(--line); border-radius: 13px; background: var(--canvas); font: 12.5px var(--font-ui); color: var(--ink-2); cursor: pointer; transition: opacity .12s, border-color .12s; }
.dx .cl:hover { border-color: var(--line-2); }
.dx .cl i { width: 8px; height: 8px; border-radius: 50%; background: var(--k); box-sizing: border-box; }
.dx .cl.is-off { opacity: .5; }
.dx .cl.is-off i { background: transparent; border: 1.5px solid var(--k); }

/* the tags - late, done: with a line's dot, the only colour it has. Never wider than their place: a narrow day cuts the word
   short with "…" ("просрочено" is three times "late") rather than letting it run over the next day */
.dx .cal-tag { display: inline-flex; align-items: center; gap: 3px; flex: none; min-width: 0; max-width: 100%; height: 18px; padding: 0 7px; border-radius: 9px; background: var(--hover-2); font: 500 11px/1 var(--font-ui); color: var(--ink-3); white-space: nowrap; }
.dx .cal-tag > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.dx .cal-tag.is-late { background: color-mix(in srgb, var(--red) 11%, transparent); color: var(--red); }
.dx .cal-tag .ic { flex: none; width: 10px; height: 10px; }
.dx .cal-sum .cal-tag { height: 20px; font-size: 12px; }
/* the List's "N late" opens them all on Obligations' Late tab */
.dx a.cal-tag { text-decoration: none; transition: background .12s; }
.dx a.cal-tag:hover { background: color-mix(in srgb, var(--red) 18%, transparent); }
.dx a.cal-tag:focus-visible { outline: 2px solid var(--focus, var(--blue)); outline-offset: 1px; }

/* a contract as a chip (to its Dates tab), its clause beside it (to the Document) */
.dx .cal-doc { display: inline-flex; align-items: center; gap: 5px; min-width: 0; max-width: 100%; height: 22px; padding: 0 8px 0 6px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--canvas); font-size: 12px; color: var(--ink-2); white-space: nowrap; transition: border-color .12s, color .12s; }
.dx .cal-doc span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.dx .cal-doc .ic { color: var(--ink-4); }
.dx .cal-doc:hover { border-color: var(--ink-4); color: var(--ink); }
.dx .cal-doc:focus-visible { outline: 2px solid var(--focus, var(--blue)); outline-offset: 1px; }

/* ---------------- month ---------------- */
.dx .mo { --rows: 5; position: relative; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: auto repeat(var(--rows), minmax(clamp(96px, calc(var(--mo-room, calc(100vh - 296px)) / var(--rows)), 118px), auto)); border: 1px solid var(--line); border-radius: 12px; background: var(--canvas); }
/* A MONTH FITS THE WINDOW where it can: at 118 px a row a month of six ran ~95 px past a 900 px window (one of five, 12 px past an
   820 px one) - its last row cut, and a crowded day opened there pulled the page up to show its panel. Its rows are as tall as the
   room under the heading allows (`--mo-room`, measured: clm.js calFit), 96 to 118 px (a month of five in a 900 px window keeps
   its 118), and a day's lines sit close
   enough that three of them, or two and "+N more", fit a row of 100 px: 4 + 24 + 21 + 2 + 21 + 2 + 21 + 5. A row that needs more
   grows alone (`auto`, not `1fr`): a Russian "просрочено" under a late day's number made that row 120 px, and every row with it
   as 1fr - a tablet's March 52 px past its window; the others give it the room (calFit measures what each row needs) */
/* six rows when the month's last week starts in it (clm.js: an attribute - the patch keeps a sliding grid's own style) */
.dx .mo[data-rows="6"] { --rows: 6; }
.dx .mo-wd { padding: 10px 10px 8px; font-size: 12px; font-weight: 500; color: var(--ink-3); border-bottom: 1px solid var(--line); }
.dx .mo-c { position: relative; display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 4px 6px 5px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; transition: background .12s, box-shadow .12s; }
.dx .mo-c:nth-child(7n) { border-right: 0; }
.dx .mo-c:nth-last-of-type(-n+7) { border-bottom: 0; }
.dx .mo-c:nth-last-of-type(7) { border-bottom-left-radius: 11px; }
.dx .mo-c:last-of-type { border-bottom-right-radius: 11px; }
.dx .mo-c:hover { background: color-mix(in srgb, var(--hover) 70%, transparent); }
.dx .mo-c.is-out { background: color-mix(in srgb, var(--hover) 45%, transparent); }
.dx .mo-c.is-sel { background: color-mix(in srgb, var(--blue) 6%, var(--canvas)); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--blue) 55%, transparent); }
/* a day's number and its "late": side by side, the tag under the number where the day is too narrow for both (Russian, a tablet) */
.dx .mo-h { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 2px 4px; min-height: 22px; margin: 0 0 2px; }
.dx .mo-n { min-width: 22px; height: 22px; padding: 0 6px; border: 0; border-radius: 11px; background: none; font: 500 12.5px var(--font-ui); color: var(--ink-2); font-variant-numeric: tabular-nums; cursor: pointer; transition: background .12s, color .12s; }
.dx .mo-n:hover { background: var(--hover-2); color: var(--ink); }
.dx .mo-n:focus-visible { outline: 2px solid var(--focus, var(--blue)); outline-offset: 1px; }
.dx .mo-c.is-out .mo-n { color: var(--ink-4); }
.dx .mo-c.is-today .mo-n { background: var(--ink); color: var(--canvas); }
.dx .mo-h .cal-tag { flex: 0 1 auto; height: 17px; padding: 0 6px; }
/* a thing of the day as a chip: a quiet neutral fill (a draft's is none, its outline dashed), its kind's dot, its words in ink */
.dx .cp { display: flex; align-items: center; flex: none; gap: 6px; width: 100%; min-width: 0; height: 21px; padding: 0 7px; border: 0; border-radius: 6px; background: color-mix(in srgb, var(--ink) 4.5%, transparent); font: 12px var(--font-ui); color: var(--ink); text-align: left; cursor: pointer; transition: background .12s; }
.dx .cp:hover { background: color-mix(in srgb, var(--ink) 9%, transparent); }
.dx .cp:focus-visible { outline: 2px solid var(--focus, var(--blue)); outline-offset: -1px; }
.dx .cp i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--k); box-sizing: border-box; }
.dx .cp span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dx .cp b { font-weight: 500; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.dx .mo-c.is-out .cp { opacity: .6; }
.dx .cp.is-done span { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--ink-4); }
.dx .mo .cp.is-done i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--k); }
/* a draft's line: dashed, its dot an open dashed ring in its kind's colour (v2/home.css draws the outline) */
.dx .mo .cp.is-draft i { background: transparent !important; outline: 1.5px dashed var(--k) !important; outline-offset: -1.5px; }
.dx .mo-more { align-self: flex-start; height: 18px; margin-top: 1px; padding: 0 6px; border: 0; border-radius: 5px; background: none; font: 500 11.5px var(--font-ui); color: var(--ink-3); cursor: pointer; }
.dx .mo-more:hover { background: var(--hover-2); color: var(--ink); }

/* ---------------- week ----------------
   the days' heads one row of the grid, the days' things the other (each day a subgrid of the two): a head with its "late" under
   its number is as tall as the others, their lines level */
.dx .wk { position: relative; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: auto minmax(0, 1fr); min-height: 520px; border: 1px solid var(--line); border-radius: 12px; background: var(--canvas); }
.dx .wk-d { display: grid; grid-row: span 2; grid-template-rows: subgrid; min-width: 0; border-right: 1px solid var(--line); transition: background .12s; }
.dx .wk-d:last-of-type { border-right: 0; }
.dx .wk-d.is-sel { background: color-mix(in srgb, var(--blue) 5%, var(--canvas)); }
.dx .wk-h { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; min-width: 0; padding: 12px 0 10px; border: 0; border-bottom: 1px solid var(--line); background: none; color: inherit; cursor: pointer; font-family: var(--font-ui); }
.dx .wk-h:hover b { background: var(--hover-2); }
.dx .wk-h:focus-visible { outline: 2px solid var(--focus, var(--blue)); outline-offset: -2px; }
.dx .wk-h > span:not(.cal-tag) { font-size: 12px; color: var(--ink-3); }
.dx .wk-h b { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 19px; font-weight: 400; color: var(--ink); transition: background .12s; }
/* the day's "late" on a line of its own under its number (top right, the Russian word lay over the weekday's name) */
.dx .wk-h .cal-tag { flex: 0 1 auto; max-width: calc(100% - 12px); height: 17px; margin-top: 3px; padding: 0 6px; }
.dx .wk-d.is-today .wk-h b { background: var(--ink); color: var(--canvas); }
.dx .wk-l { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 8px 6px; cursor: pointer; }
.dx .wk-e { display: flex; flex-direction: column; gap: 3px; width: 100%; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--canvas); text-align: left; font-family: var(--font-ui); color: inherit; cursor: pointer; transition: background .12s, border-color .12s; }
.dx .wk-e:hover { border-color: var(--line-2); background: var(--hover); }
.dx .wk-e:focus-visible { outline: 2px solid var(--focus, var(--blue)); outline-offset: 1px; }
/* its kind, then its tags - under the kind when the card is too narrow for both (the tag squeezed "Задача" to "З…") */
.dx .wk-k { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-width: 0; font-size: 11.5px; font-weight: 500; color: var(--ink-3); }
.dx .wk-k > span:not(.cal-tag) { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.dx .wk-k i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--k); box-sizing: border-box; }
.dx .wk-k .cal-tag { flex: 0 1 auto; }
.dx .wk-e b { font-size: 12.5px; font-weight: 500; line-height: 1.35; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dx .wk-s { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dx .wk-e.is-done b { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--ink-4); }
.dx .wk-e.is-done .wk-k i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--k); }
.dx .wk-e.is-draft { border-color: var(--line-2); }
.dx .wk-e.is-draft .wk-k i { background: transparent; outline: 1.5px dashed var(--k); outline-offset: -1.5px; }

/* ---------------- the day's panel ----------------
   laid over its day (Month) or its column's things (Week, under the
   days' heads) - placed out of the flow, in the day's own grid area, so
   it takes no cell of the grid - the panel beside it: right of the
   first four days, left of the last three; in a month's lower rows it
   rises from the day's foot. On a phone it is a row of the grid of its
   own, the width of it, under the day's week (Month) or under the day
   (Week). Out of the flow, a line left `auto` is the grid's edge: each
   area is spanned, start and end. */
.dx .cal-anchor { position: absolute; inset: 0; z-index: 6; grid-column: var(--c) / span 1; grid-row: var(--r) / span 1; min-width: 0; pointer-events: none; }
/* beside the day, kept inside the grid: 100% is a day's width (and its height), the grid seven of them across (a middle day of a
   narrow month) and `--room` of them the way it opens - its list scrolls past that. Three days wide, 4 px from its day and 4 px
   short of the fourth: it covers whole days and cuts none (at 8 px the next day's number circle showed a sliver under its edge;
   a far edge in the middle of a day cut its tag and its lines). `--room-h`: those rows' height, measured (clm.js calFit) - a row
   that needs more grows alone, so `--room` days of this one's height is not always the grid's edge */
.dx .cal-pop { --pw: calc(3 * 100% - 8px); position: absolute; top: -8px; left: clamp(calc((1 - var(--c)) * 100%), calc(100% + 4px), calc((8 - var(--c)) * 100% - var(--pw))); display: flex; flex-direction: column; width: var(--pw); max-height: min(600px, calc(100vh - 140px), calc(var(--room-h, var(--room, 1) * 100%) + 8px)); border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface-raised, var(--canvas)); box-shadow: var(--e3, var(--shadow)); text-align: left; cursor: default; pointer-events: auto; outline: 0; transform-origin: top left; animation: cal-in .16s var(--ease) both; }
.dx .cal-anchor.is-left .cal-pop { left: clamp(calc((1 - var(--c)) * 100%), calc(-4px - var(--pw)), calc((8 - var(--c)) * 100% - var(--pw))); transform-origin: top right; }
.dx .cal-anchor.is-up .cal-pop { top: auto; bottom: -4px; transform-origin: bottom left; animation-name: cal-in-up; }
.dx .cal-anchor.is-up.is-left .cal-pop { transform-origin: bottom right; }
/* its entrance: a short rise out of the day, as the app's other panels (the old popover's dx-pop) */
@keyframes cal-in { from { opacity: 0; transform: translateY(-4px) scale(.985); } }
@keyframes cal-in-up { from { opacity: 0; transform: translateY(4px) scale(.985); } }
@keyframes cal-fade { from { opacity: 0; } }
.dx .cal-pop:focus-visible { box-shadow: var(--e3, var(--shadow)), 0 0 0 2px var(--focus, var(--blue)); }
.dx .dp-h { display: flex; align-items: center; gap: 10px; padding: 14px 10px 12px 18px; border-bottom: 1px solid var(--line); }
.dx .dp-ht { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.dx .dp-ht b { font-size: 16px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.dx .dp-ht span { font-size: 12.5px; color: var(--ink-3); }
.dx .dp-rel { flex: none; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.dx .dp-rel.is-today, .dx .ag-rel.is-today { padding: 0 8px; border-radius: 10px; line-height: 20px; background: color-mix(in srgb, var(--blue) 10%, transparent); color: var(--blue); font-weight: 500; }
.dx .dp-b { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 6px 8px; }
.dx .dp-g { margin: 12px 10px 2px; font: 600 11px/16px var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.dx .dp-l { list-style: none; margin: 0; padding: 0; }
.dx .dp-i { position: relative; display: grid; grid-template-columns: 8px minmax(0, 1fr); column-gap: 12px; align-items: start; padding: 12px 10px 10px; border-radius: 10px; transition: background .2s; }
.dx .dp-i + .dp-i::before { content: ""; position: absolute; top: 0; left: 30px; right: 10px; height: 1px; background: var(--line); }
.dx .dp-i.is-focus { background: color-mix(in srgb, var(--blue) 7%, transparent); }
.dx .dp-i.is-focus::before, .dx .dp-i.is-focus + .dp-i::before { opacity: 0; }
.dx .dp-dot { width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: var(--k); box-sizing: border-box; }
.dx .dp-i.is-done .dp-dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--k); }
.dx .dp-i.is-draft .dp-dot { background: transparent; outline: 1.5px dashed var(--k); outline-offset: -1.5px; }
.dx .dp-m { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.dx .dp-k { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12px; font-weight: 500; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.dx .dp-k > span:not(.cal-tag):not(.dr-tag) + span:not(.cal-tag):not(.dr-tag)::before { content: "·"; margin-right: 6px; }
/* draft and edited on the kind's line, as late and done (after words that wrap, "draft" began an indented line of its own) */
.dx .dp-k .dr-tag { margin-left: 0; }
.dx .dp-t { font-size: 14px; font-weight: 500; line-height: 1.4; color: var(--ink); overflow-wrap: anywhere; }
.dx .ag-main .dr-tag { vertical-align: 1px; }
/* why a contract's own day is that day - the engine's reading, quiet under its words */
.dx .dp-why { font-size: 12.5px; line-height: 1.45; color: var(--ink-3); }
.dx .dp-i.is-done .dp-t { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--ink-4); }
.dx .dp-p { font-size: 12.5px; line-height: 1.4; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dx .dp-p b { font-weight: 500; }
.dx .dp-p span { color: var(--ink-3); }
.dx .dp-n { font-size: 12.5px; line-height: 1.45; color: var(--ink-2); white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
/* its contract and clause, and what can be done with it - Mark done, Edit - on one line at its foot; the contract's name gives way
   to the button down to a readable stub, past it (a long Russian "Mark done") the button goes under them, at the right */
.dx .dp-c { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 28px; margin-top: 6px; min-width: 0; }
.dx .dp-c .cal-doc { flex: 1 1 0; min-width: 120px; max-width: max-content; }
.dx .dp-c .c-sec { flex: none; }
.dx .dp-c .btn { flex: none; margin-left: auto; }
.dx .dp-c .btn .ic { width: 13px; height: 13px; }
.dx .dp-none { margin: 18px 10px; font-size: 13px; color: var(--ink-3); }
.dx .dp-f { padding: 10px 12px 12px; border-top: 1px solid var(--line); }
.dx .dp-f .btn { width: 100%; justify-content: center; }

/* ---------------- the agenda (List) ---------------- */
.dx .ag { margin-top: 2px; }
.dx .ag-m { margin: 30px 0 4px; font-size: 13px; font-weight: 600; color: var(--ink); }
.dx .ag-m:first-child { margin-top: 0; }
.dx .ag-m span { color: var(--ink-3); font-weight: 400; }
.dx .ag-d { margin-bottom: 10px; }
.dx .ag-h { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; margin: 0; padding: 12px 4px 8px 4px; background: var(--dx-page-bg, var(--sh-page, var(--surface-app, var(--canvas)))); font-size: 13px; font-weight: 400; }
/* a day's things on a card of their own: the page is not one run of text */
.dx .ag-card { padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-card, var(--canvas)); }
.dx .ag-day { font-weight: 600; color: var(--ink); }
.dx .ag-d.is-past .ag-day { color: var(--ink-2); }
.dx .ag-rel { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.dx .ag-add { width: 28px; height: 28px; margin-left: auto; opacity: 0; transition: opacity .12s; }
.dx .ag-d:hover .ag-add, .dx .ag-add:focus-visible { opacity: 1; }
@media (hover: none) { .dx .ag-add { opacity: 1; } }
/* a line: its hour or kind, its dot, its words, its contract and clause, its tags - the tags' column as wide as the List's widest
   tag (`--ag-st`, clm.js calFit: "просрочено" spilled out of the 72 px the English needs), the same on every line. Its words
   wrap at every width, never cut; the rest sits level with their first line (a line box of 32 px: the hour, the dot, the chips,
   the tags each centred in it), a line of one line as before */
.dx .ag-r { position: relative; display: grid; grid-template-columns: 84px 16px minmax(0, 1fr) minmax(0, 300px) var(--ag-st, 72px); column-gap: 12px; align-items: start; min-height: 42px; padding: 5px 8px 5px 12px; border-radius: 9px; transition: background .12s; }
/* a date's line opens its day, there (clm.js calDayOpen) */
.dx .ag-r[data-act] { cursor: pointer; }
.dx .ag-r + .ag-r::before { content: ""; position: absolute; top: 0; left: 108px; right: 8px; height: 1px; background: var(--line); }
.dx .ag-r:hover { background: var(--hover); }
.dx .ag-r:hover::before, .dx .ag-r:hover + .ag-r::before { opacity: 0; }
.dx .ag-mine { cursor: pointer; }
.dx .ag-t { font-size: 12.5px; line-height: 32px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.dx .ag-dot { justify-self: center; width: 8px; height: 8px; margin-top: 12px; border-radius: 50%; background: var(--k); box-sizing: border-box; }
.dx .ag-r.is-done .ag-dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--k); }
.dx .ag-r.is-draft .ag-dot { background: transparent; outline: 1.5px dashed var(--k); outline-offset: -1.5px; }
/* a signed contract's duty: its dot is a circle to tick - Mark done in one click, Reopen as well */
.dx .ag-tick { display: grid; place-items: center; width: 16px; height: 16px; margin-top: 8px; padding: 0; border: 1.5px solid var(--k); background: transparent; color: transparent; cursor: pointer; transition: background .15s, color .15s; }
.dx .ag-tick:hover { background: color-mix(in srgb, var(--k) 14%, transparent); color: var(--k); }
.dx .ag-tick:focus-visible { outline: 2px solid var(--focus, var(--blue)); outline-offset: 2px; }
.dx .ag-r.is-done .ag-tick { background: var(--k); box-shadow: none; color: var(--surface-card, #fff); }
/* its words and what goes with them (draft, edited, "until …", who must act): beside the words while they fit, under them past
   that - the words a line of their own, wrapping */
.dx .ag-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-width: 0; padding: 6px 0; }
.dx .ag-main > b, .dx .ag-w { flex: 0 1 auto; min-width: 0; font: 500 14px/20px var(--font-ui); color: var(--ink); white-space: normal; overflow-wrap: anywhere; }
/* a date's words: a button (the keyboard's way to its day), drawn as the words they are */
.dx .ag-w { padding: 0; border: 0; border-radius: 3px; background: none; text-align: left; cursor: pointer; }
.dx .ag-w:focus-visible { outline: 2px solid var(--focus, var(--blue)); outline-offset: 2px; }
.dx .ag-main .dr-tag, .dx .ag-main .dl-edited { flex: none; margin-left: 0; }
.dx .ag-p { flex: 0 1 auto; min-width: 0; font-size: 12.5px; line-height: 20px; color: var(--ink-3); }
/* a repeating event's "Every week", beside its title at every width */
.dx .ag-rep { flex: none; font-size: 12.5px; line-height: 20px; color: var(--ink-3); white-space: nowrap; }
.dx .ag-r.is-done .ag-w { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--ink-4); }
.dx .ag-c { display: flex; align-items: center; gap: 6px; min-width: 0; min-height: 32px; }
.dx .ag-c .c-sec { flex: none; }
.dx .ag-st { display: flex; align-items: center; justify-content: flex-end; gap: 4px; min-height: 32px; }
.dx .ag-st .cal-tag { max-width: none; }
/* how long it runs ("until 3 Mar 2027"), beside its words */
.dx .ag-main .cal-until { flex: none; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.dx .ag-none { margin: 0; padding: 11px 12px 11px 124px; font-size: 13px; color: var(--ink-3); }
/* THE OPEN DAY in the List: its card says what the day's panel says (clm.js calDayBody) - each thing whole, the line clicked
   lit - its heading's x (or Escape, or a click beside it) folds it back */
.dx .ag-open { padding: 2px 6px; border-color: var(--line-2); box-shadow: var(--e1, none); outline: 0; }
.dx .ag-open:focus-visible { box-shadow: var(--e1, none), 0 0 0 2px var(--focus, var(--blue)); }
.dx .ag-open .dp-g:first-child { margin-top: 10px; }
.dx .ag-x { width: 28px; height: 28px; }

@container main (max-width: 1000px) {
  .dx .ag-r { grid-template-columns: 84px 16px minmax(0, 1fr) minmax(0, 200px) var(--ag-st, 64px); }
  /* who must act gives way (the open day says it); the words stay whole, a repeat's "Every week" with them */
  .dx .ag-p { display: none; }
}
/* a tablet's week: days of about a hundred pixels - the cards' margins give way so a Russian "late" still fits on its line */
@container main (min-width: 761px) and (max-width: 900px) {
  .dx .wk-l { padding: 8px 4px; }
  .dx .wk-e { padding: 7px; }
  .dx .wk-k .cal-tag { padding: 0 5px; }
}
@container main (max-width: 760px) {
  .dx .pg-cal { padding: 24px 16px 64px; }
  .dx .mo { overflow: hidden; grid-template-rows: auto; grid-auto-rows: minmax(64px, auto); }
  .dx .mo-c { flex-direction: row; flex-wrap: wrap; align-content: flex-start; justify-content: center; gap: 3px; padding: 4px 3px 6px; }
  .dx .mo-c:nth-last-of-type(7), .dx .mo-c:last-of-type { border-radius: 0; }
  .dx .mo-h { width: 100%; justify-content: center; margin: 0 0 2px; }
  .dx .mo-h .cal-tag { display: none; }
  .dx .cp { width: auto; height: 10px; padding: 0 2px; background: transparent !important; outline: 0 !important; }
  .dx .cp span { display: none; }
  .dx .mo-more { display: none; }
  .dx .wk { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; min-height: 0; overflow: hidden; }
  .dx .wk-d { display: flex; flex-direction: column; grid-row: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .dx .wk-d:last-of-type { border-bottom: 0; }
  .dx .wk-h { flex-direction: row; justify-content: flex-start; gap: 10px; padding: 8px 12px; }
  .dx .wk-h .cal-tag { margin-top: 0; }
  .dx .cal-layers .cl { height: 24px; padding: 0 8px; font-size: 12px; }
  /* the day under its week (under itself in a week): a row of its own, the width of the grid - the days after it flow on below */
  .dx .cal-anchor { position: static; grid-column: 1 / -1; grid-row: var(--pr); z-index: auto; pointer-events: auto; }
  .dx .cal-pop, .dx .cal-anchor.is-up .cal-pop { position: static; width: auto; max-height: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: color-mix(in srgb, var(--blue) 3%, var(--canvas)); box-shadow: none; animation-name: cal-fade; }
  .dx .cal-anchor.is-last .cal-pop { border-top: 1px solid var(--line); border-bottom: 0; }
  .dx .dp-h { padding: 12px 8px 10px 16px; }
  .dx .dp-b { padding: 4px 6px; }
  /* an agenda line on a phone: its kind (or hour) and tags over its words, its contract under them */
  .dx .ag-r { grid-template-columns: 16px minmax(0, 1fr) auto; grid-template-areas: "dot t st" ". main main" ". c c"; row-gap: 3px; align-items: center; padding: 10px 6px 10px 8px; }
  .dx .ag-t { line-height: inherit; }
  .dx .ag-dot, .dx .ag-tick { margin-top: 0; }
  .dx .ag-main { padding: 0; }
  .dx .ag-c, .dx .ag-st { min-height: 0; }
  .dx .ag-r + .ag-r::before { left: 36px; right: 6px; }
  .dx .ag-r > .ag-t { grid-area: t; }
  .dx .ag-r > .ag-dot { grid-area: dot; }
  .dx .ag-r > .ag-main { grid-area: main; }
  .dx .ag-r > .ag-c { grid-area: c; }
  .dx .ag-r > .ag-c:empty { display: none; }
  .dx .ag-r > .ag-st { grid-area: st; }
  .dx .ag-h { padding: 12px 2px 8px 4px; }
  .dx .ag-none { padding-left: 38px; }
}

/* ---- YOUR OWN EVENTS (the owner, 2026-10-13): their colour (a dot, as every other thing's), the drop target, the event sheet ---- */
.dx .c-blue { --k: var(--blue); }
.dx .c-green { --k: var(--green); }
.dx .c-amber { --k: var(--amber); }
.dx .c-red { --k: var(--red); }
.dx .c-violet { --k: #7c5cff; }
.dx .c-grey { --k: var(--ink-4); }
.dx .cl-mine { --k: var(--ink-2); }
.dx .cp-mine[draggable="true"], .dx .wk-mine[draggable="true"] { cursor: grab; }
.dx .mo-c.is-drop, .dx .wk-l.is-drop { background: color-mix(in srgb, var(--blue) 10%, var(--canvas)); outline: 2px dashed color-mix(in srgb, var(--blue) 45%, transparent); outline-offset: -3px; }
.dx .row-mine { cursor: pointer; }
.dx .ev-allday { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.dx .ev-colors { display: flex; gap: 10px; padding: 2px 0; }
.dx .ev-color { width: 24px; height: 24px; padding: 0; border-radius: 50%; border: 2px solid var(--canvas); background: var(--k); cursor: pointer; box-shadow: 0 0 0 1px var(--line-2); }
.dx .ev-color.is-on { box-shadow: 0 0 0 2px var(--k); }
.dx .fld textarea { padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--canvas); font: 14px/1.5 var(--font-ui); color: var(--ink); resize: vertical; outline: 0; }
.dx .fld textarea:focus { border-color: var(--ink-4); box-shadow: 0 0 0 3px var(--hover); }
.dx .ev-del { margin-right: auto; }
