/* The calendar view (public/calendar-view.js), in the editorial style: no boxes or coloured blocks; hairline rules; serif day numbers;
   one typographic marker per kind (• shop, ◦ mine, ◇ meeting, ✶ birthday, § pay, ☐ task); today underlined in brown. Loaded after shell.css. */
#calapp { --cv-hour: 48px; --cv-gut: 52px; min-width: 0; }
#calapp button { margin: 0; }
#calapp [hidden] { display: none !important; }
.cv-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* the bar: Today ‹ › title, then the four views as plain words */
.cv-bar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 6px 24px; border-bottom: 1px solid var(--line); margin: 0 0 12px; }
.cv-nav { display: flex; align-items: center; gap: 8px; min-width: 0; padding-bottom: 10px; }
.cv-nav .cv-arrow { min-width: 36px; padding: 4px 10px; font-size: 18px; line-height: 1; }
.cv-title { margin: 0 0 0 6px !important; font: 400 var(--h2)/1.2 var(--disp); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cv-title::after { display: none !important; }
:root #calapp .cv-views { margin: 0 !important; border-bottom: 0 !important; gap: 20px !important; }
:root #calapp .cv-views > button { min-height: 40px; padding: 8px 0 9px !important; }

/* filters (plain words with their marker) and the actions */
.cv-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; margin: 0 0 8px; }
.cv-filters { display: flex; flex-wrap: wrap; gap: 4px 16px; }
#calapp .cv-f { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 13.5px; color: var(--ink-2); cursor: pointer; min-height: 32px; }
#calapp .cv-f input { margin: 0; }
#calapp .cv-f:has(input:not(:checked)) { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.cv-acts { display: flex; flex-wrap: wrap; gap: 8px; }
#cv-msg:empty { display: none; }

.cv-mk { display: inline-block; width: 1.15em; text-align: center; margin-right: 3px; font-family: var(--ui); color: var(--ink-3); font-style: normal; }
.cv-k-shop .cv-mk, .cv-mk.cv-k-shop { color: var(--walnut-ink); }
.cv-k-meeting .cv-mk, .cv-mk.cv-k-meeting { color: var(--accent); }
.cv-own { font-style: italic; }
.cv-done { text-decoration: line-through; text-decoration-color: var(--ink-3); color: var(--ink-3); }

.cv-body { display: block; }
@media (min-width: 1100px) { #calapp:not([data-view="agenda"]) .cv-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); gap: var(--colgap); align-items: start; } }
.cv-main { min-width: 0; }
.cv-side { border-top: 1px solid var(--line-strong); padding-top: 14px; margin-top: 18px; min-width: 0; }
@media (min-width: 1100px) { .cv-side { margin-top: 0; position: sticky; top: calc(var(--top-h) + 16px); max-height: calc(100vh - var(--top-h) - 32px); overflow: auto; } }
.cv-sh { margin: 0 0 10px !important; }
.cv-sh::after { display: none !important; }
.cv-sh em, .cv-aw em { font: 600 11px var(--ui); letter-spacing: .09em; text-transform: uppercase; color: var(--walnut-ink); font-style: normal; margin-left: 6px; }
.cv-note:empty { display: none; }

/* ---------- month ---------- */
.cv-month { border-top: 1px solid var(--line-strong); }
.cv-mhead, .cv-mrow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cv-mhead div { font: 600 11px/1 var(--ui); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); padding: 10px 6px 8px; }
.cv-mrow { border-top: 1px solid var(--line); }
.cv-cell { min-width: 0; border-left: 1px solid var(--line); }
.cv-cell:first-child { border-left: 0; }
#calapp .cv-day { display: flex; flex-direction: column; align-items: stretch; gap: 2px; width: 100%; min-height: 112px; height: 100%; padding: 6px 6px 8px; margin: 0; text-align: left; background: none; border: 0; border-radius: 0; color: var(--ink); font: 400 12.5px/1.35 var(--ui); box-shadow: none; cursor: pointer; overflow: hidden; transform: none; }
#calapp .cv-day:hover { background: var(--hover); }
#calapp .cv-day:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; border-radius: 0; }
.cv-out .cv-day { color: var(--ink-3); }
.cv-out .cv-dn, .cv-out .cv-its { opacity: .55; }
.cv-dn { font: 400 17px/1.1 var(--disp); color: var(--ink-2); align-self: flex-start; padding-bottom: 2px; font-variant-numeric: lining-nums; }
.cv-today .cv-dn { color: var(--ink); font-weight: 600; border-bottom: 2px solid var(--rule); }
.cv-sel .cv-day { background: var(--hover); box-shadow: inset 0 -2px 0 var(--rule); }
.cv-its { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cv-it { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.cv-it .cv-tm { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.cv-more { color: var(--ink-3); font-size: 12px; }
.cv-dots { display: none; }
@media (max-width: 699px) {
  #calapp .cv-day { min-height: 54px; padding: 5px 2px 6px; align-items: center; text-align: center; }
  .cv-its { display: none; }
  .cv-dots { display: block; font-size: 10px; line-height: 1; letter-spacing: -1px; white-space: nowrap; overflow: hidden; max-width: 100%; }
  .cv-dots .cv-mk { width: auto; margin: 0 1px; }
  .cv-dn { align-self: center; font-size: 16px; }
  .cv-mhead div { padding: 8px 0 6px; text-align: center; letter-spacing: .04em; }
}

/* ---------- entries (day panel, agenda) ---------- */
.cv-entry { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 4px 14px; padding: 10px 0; border-top: 1px solid var(--line); }
.cv-entry:first-of-type { border-top: 0; }
.cv-when { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; padding-top: 1px; }
.cv-what b { font-weight: 600; }
.cv-tag { font: 600 10.5px var(--ui); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); margin-left: 8px; white-space: nowrap; }
.cv-det { font-size: 13px; color: var(--ink-2); margin-top: 2px; overflow-wrap: anywhere; }
.cv-notes { white-space: pre-line; }
.cv-acts-i { margin-top: 4px; }
.cv-join { font: 500 13.5px var(--ui); color: var(--walnut-ink); text-decoration: none; }
.cv-join::after { content: " \203A"; }
.cv-join:hover { text-decoration: underline; }
.cv-rsvp { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
:root #calapp .cv-rsvp button.on, :root #calapp .cv-rsvp button[aria-pressed="true"] { border-color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--rule); }
.cv-entry [data-edit] { margin-top: 8px !important; }
@media (max-width: 699px) { .cv-entry { grid-template-columns: 64px minmax(0, 1fr); gap: 2px 10px; } }

/* ---------- agenda ---------- */
.cv-aday { border-top: 1px solid var(--line-strong); padding: 10px 0 6px; }
.cv-ah { display: flex; align-items: baseline; gap: 12px; margin: 0 0 2px; font: 400 15px var(--ui); }
.cv-ad { font: 400 30px/1 var(--disp); min-width: 40px; color: var(--ink-2); font-variant-numeric: lining-nums; }
.cv-today .cv-ad { color: var(--ink); text-decoration: underline 2px var(--rule); text-underline-offset: 6px; }
.cv-aw { flex: 1; color: var(--ink-2); }
#calapp .cv-plus { background: none; border: 1px solid var(--line-strong); color: var(--ink-2); border-radius: 999px; width: 32px; min-height: 32px; height: 32px; padding: 0; font: 400 18px/1 var(--ui); }
#calapp .cv-plus:hover { color: var(--ink); border-color: var(--ink-3); }
.cv-aday .cv-entry { margin-left: 52px; }
@media (max-width: 699px) { .cv-aday .cv-entry { margin-left: 0; } .cv-ad { font-size: 26px; min-width: 34px; } }
.cv-none, .cv-empty { margin: 10px 0; }

/* phone: the small month picker above the agenda */
.cv-mini { border-bottom: 1px solid var(--line); padding: 0 0 10px; margin: 0 0 6px; }
.cv-mini-nav { display: flex; align-items: center; justify-content: space-between; margin: 0 0 4px; font: 400 16px var(--disp); }
.cv-mini-nav b { font-weight: 400; }
.cv-mini-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cv-mini-h { font: 600 10.5px var(--ui); color: var(--ink-3); text-align: center; padding: 4px 0; }
#calapp .cv-mini-d { position: relative; background: none; border: 0; border-radius: 0; color: var(--ink); min-height: 38px; padding: 0; font: 400 15px var(--ui); font-variant-numeric: tabular-nums; box-shadow: none; }
#calapp .cv-mini-d.cv-out { color: var(--ink-3); }
#calapp .cv-mini-d.cv-today { font-weight: 700; text-decoration: underline 2px var(--rule); text-underline-offset: 5px; }
#calapp .cv-mini-d.cv-sel { background: var(--hover); box-shadow: inset 0 0 0 1px var(--line-strong); }
#calapp .cv-mini-d i { position: absolute; left: 50%; bottom: 4px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--walnut-ink); }

/* ---------- week and day: the hours grid ---------- */
.cv-week { border-top: 1px solid var(--line-strong); }
.cv-whead, .cv-allday, .cv-hgrid { display: grid; grid-template-columns: var(--cv-gut) repeat(var(--cv-days), minmax(0, 1fr)); }
.cv-gut { font: 500 11px var(--ui); color: var(--ink-3); padding: 6px 8px 0 0; text-align: right; position: relative; }
#calapp .cv-wd { background: none; border: 0; border-left: 1px solid var(--line); border-radius: 0; color: var(--ink-2); padding: 8px 6px; min-height: 0; font: 500 12px var(--ui); text-align: left; box-shadow: none; }
#calapp .cv-wd b { font: 400 20px/1 var(--disp); color: var(--ink); margin-left: 2px; }
#calapp .cv-wd.cv-today b { font-weight: 600; text-decoration: underline 2px var(--rule); text-underline-offset: 5px; }
#calapp .cv-wd.cv-sel { box-shadow: inset 0 -2px 0 var(--rule); }
.cv-allday { border-top: 1px solid var(--line); min-height: 28px; }
.cv-adcell { border-left: 1px solid var(--line); padding: 3px 4px; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
#calapp .cv-chipbtn { display: block; width: 100%; background: none; border: 0; border-radius: 0; padding: 1px 2px; min-height: 0; text-align: left; font: 400 12px/1.3 var(--ui); color: var(--ink); box-shadow: none; }
#calapp .cv-chipbtn:hover { background: var(--hover); }
.cv-hours { max-height: min(66vh, 760px); overflow-y: auto; overflow-x: hidden; border-top: 1px solid var(--line-strong); overscroll-behavior: contain; }
.cv-hgrid { height: calc(24 * var(--cv-hour)); position: relative; }
.cv-hl { position: absolute; right: 8px; transform: translateY(-50%); font-variant-numeric: tabular-nums; }
.cv-hl:first-child { transform: none; }
.cv-col { position: relative; border-left: 1px solid var(--line); min-width: 0; }
.cv-col.cv-today { background: color-mix(in srgb, var(--rule) 4%, transparent); }
#calapp .cv-slot { display: block; width: 100%; height: var(--cv-hour); min-height: 0; padding: 0; background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; cursor: copy; }
#calapp .cv-slot:hover { background: var(--hover); }
#calapp .cv-ev { position: absolute; z-index: 1; min-height: 0; margin: 0; padding: 2px 6px; overflow: hidden; text-align: left; white-space: normal; background: var(--bg); color: var(--ink); border: 0; border-top: 1px solid var(--line-strong); border-left: 2px solid var(--rule); border-radius: 0; box-shadow: none; font: 400 12px/1.3 var(--ui); }
#calapp .cv-ev:hover { background: var(--surface); }
#calapp .cv-ev.cv-k-mine { border-left-style: dotted; }
#calapp .cv-ev.cv-k-meeting { border-left: 3px double var(--accent); }
#calapp .cv-ev .cv-tm { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.cv-now { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--warn); z-index: 2; pointer-events: none; }
.cv-now::before { content: ""; position: absolute; left: -4px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
#calapp[data-view="day"] .cv-week { --cv-days: 1; }

/* ---------- dialogs ---------- */
.cv-dlg { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; padding: 0; color: var(--ink); background: var(--bg); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: var(--pop-shadow); }
.cv-dlg.cv-wide { width: min(720px, calc(100vw - 32px)); }
.cv-dlg::backdrop { background: rgba(20, 19, 17, .42); }
.cv-form { padding: 22px 24px 20px; }
@media (max-width: 699px) { .cv-form { padding: 18px 16px 16px; } }
.cv-form h2 { margin: 0 0 10px; }
.cv-form h2::after { display: none !important; }
.cv-form h3 { margin: 22px 0 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.cv-form input[type=text], .cv-form input[type=url], .cv-form input[type=password], .cv-form input[type=date], .cv-form input[type=time], .cv-form select, .cv-form textarea { width: 100%; font-size: 16px; padding: 9px 11px; }
.cv-form textarea { resize: vertical; }
.cv-two { display: flex; flex-wrap: wrap; gap: 0 12px; }
.cv-two > div { flex: 1 1 150px; min-width: 0; }
.cv-row { margin-top: 14px; gap: 8px; }
.cv-hint { font-size: 12.5px; margin: 4px 0 0; }
.cv-state { font-weight: 600; margin: 6px 0; }
.cv-linkbox { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 8px 0 12px; margin: 10px 0; }
.cv-copyrow { display: flex; gap: 8px; align-items: center; }
.cv-copyrow input { flex: 1; min-width: 0; font: 13px var(--mono) !important; }
.cv-add { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 12px 0 0; }
.cv-how { border-top: 1px solid var(--line); padding: 8px 0; }
.cv-how summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.cv-how ol { margin: 6px 0 4px; padding-left: 20px; }
.cv-how li { margin: 3px 0; }
.cv-itable { max-height: 300px; overflow: auto; margin: 8px 0; }
.cv-itable td { font-size: 13px; vertical-align: top; }

/* ---------- print: the month, every entry, nothing else ---------- */
@media print {
  @page { size: landscape; margin: 12mm; }
  main > :not(#calapp):not(h1) { display: none !important; }
  #calapp > :not(#cv-print-area) { display: none !important; }
  #calapp:not(.cv-printing) > .cv-body { display: block !important; }
  #calapp:not(.cv-printing) .cv-side, #calapp:not(.cv-printing) .cv-mini { display: none !important; }
  .cv-ptitle { font: 400 18pt var(--disp); margin: 0 0 8pt; }
  .cv-printmonth .cv-day { min-height: 90px !important; color: #000 !important; }
  .cv-printmonth .cv-its { display: flex !important; }
  .cv-printmonth .cv-dots { display: none !important; }
  .cv-printmonth .cv-it { white-space: normal; font-size: 8.5pt; color: #000; }
  .cv-printmonth .cv-mrow, .cv-printmonth .cv-cell { border-color: #999 !important; break-inside: avoid; }
  .cv-printmonth .cv-sel .cv-day { background: none; box-shadow: none; }
  dialog { display: none !important; }
}
