/* TRELLAN: the comms screens. Reports 258, 259.

   Page-specific rules for this area only, after trellan.css and
   trellan-shell.css. Scope every rule to the page (its own class or
   `.t-<kind>` wrapper); do not restyle shared components here.
   See planning/trellan-screen-guide.md.

   Boards: comms-*, m-comms-* in ~/adealia/design/trellan-canvas/project/. */

/* ── 1. Events: the list and the calendar (events/index.html) ────────── */

.ev-index .ev-bar__label {
  font-family: var(--font-display); font-weight: 300; font-size: 22px;
  letter-spacing: 2px; text-transform: uppercase; color: var(--ink);
}
.ev-index .ev-bar__arrow {
  width: 40px; height: 40px; border: 1px solid var(--edge); border-radius: 0;
  display: inline-flex; align-items: center; justify-content: center; color: var(--charcoal);
}
.ev-index .ev-bar__arrow:hover { background: var(--mist); }

/* The list: no box round a month, an ink rule under its head. */
.ev-index .ev-list .of-list { border: 0; background: transparent; }
.ev-index .ev-list .of-list__head { border-bottom: 1px solid var(--charcoal); }
.ev-index .ev-row { border-bottom: 1px solid var(--hairline); }
.ev-index .ev-date {
  border: 1px solid var(--hairline); border-radius: 0; background: var(--card-bg);
}
.ev-index .ev-date__month {
  font-family: var(--font-display); font-weight: 500; font-size: 10px;
  letter-spacing: 1.5px; text-transform: uppercase; color: var(--gray);
}
.ev-index .ev-date__day { font-family: var(--font-display); font-weight: 300; color: var(--ink); }
.ev-index .ev-row.is-cancelled { background: var(--alert-bg); box-shadow: inset 3px 0 0 var(--alert-dot); }
.ev-index .ev-row.is-cancelled .ev-row__title, .ev-index .ev-row.is-cancelled .ev-row__when { color: var(--gray); }

/* "Full" and "Registration closed" open the event; drawn as chips. */
.ev-index [data-event-full], .ev-index .ev-closed, .ev-detail [data-event-full] {
  min-height: 0; padding: 2px 8px; border: 0; gap: 6px;
  font-family: var(--font-sans); font-weight: 400; font-size: 13px;
  letter-spacing: 0; text-transform: none;
}
.ev-index [data-event-full] { background: var(--warn-bg); color: var(--warn-fg); }
.ev-index .ev-closed { background: var(--muted-bg); color: var(--muted-fg); }
.ev-index [data-event-full]::before, .ev-index .ev-closed::before {
  content: ""; width: 8px; height: 8px; flex: none; background: currentColor;
}
.ev-index [data-event-full]::before { background: var(--warn-dot); }
.ev-index .ev-closed::before { background: var(--muted-dot); }

/* The calendar. */
.ev-index .evc-month { border-radius: 0; box-shadow: none; }
.ev-index .evc-dow {
  border-bottom: 1px solid var(--charcoal);
  font-family: var(--font-display); font-weight: 500; font-size: 10px;
  letter-spacing: 2px; text-transform: uppercase; color: var(--charcoal);
}
.ev-index .evc-cell.is-out { background: var(--mist); }
.ev-index .evc-cell.is-today { background: var(--mist); }
.ev-index .evc-cell.is-today .evc-cell__n { background: var(--charcoal); color: var(--card-bg); border-radius: 0; }
.ev-index .evc-cell__n { border-radius: 0; }
.ev-index .evc-chip {
  border-radius: 0; background: var(--card-bg); color: var(--charcoal);
  border: 1px solid var(--hairline); box-shadow: inset 2px 0 0 var(--green);
}
.ev-index .evc-chip--cancelled { background: var(--alert-bg); color: var(--alert-fg); box-shadow: inset 2px 0 0 var(--alert-dot); }
/* ADE-734 (16 Nov audit, A9): each chip's edge in its kind's colour, the
   key's own variables, so the key under the month matches the chips. */
.ev-index .evc-chip--ce { box-shadow: inset 3px 0 0 var(--evc-ce-dot); }
.ev-index .evc-chip--orientation { box-shadow: inset 3px 0 0 var(--evc-or-dot); }
.ev-index .evc-chip--other { box-shadow: inset 3px 0 0 var(--evc-ot-dot); }
.ev-index .evc-chip--cancelled { box-shadow: inset 3px 0 0 var(--evc-x-dot); }
.ev-index .evc-dot { border-radius: 0; }
.ev-index .evc-day { border-radius: 0; box-shadow: none; }
.ev-index .evc-day__title {
  font-family: var(--font-display); font-weight: 300; font-size: 18px;
  letter-spacing: 2px; text-transform: uppercase; color: var(--ink);
}

/* ── 2. One event (events/detail.html) ───────────────────────────────── */

/* The head on the page ground, a hairline under it. */
.ev-detail .ev-hcard {
  border: 0; border-bottom: 1px solid var(--hairline); background: transparent;
  box-shadow: none; padding-inline: 0;
}
.ev-detail .ev-hcard__tag { border-radius: 0; }
.ev-detail .of-section, .ev-detail .ev-details { border-radius: 0; box-shadow: none; }
.ev-detail .ev-card__title, .ev-detail .evp-register__title {
  font-family: var(--font-display); font-weight: 300; font-size: 20px;
  letter-spacing: 2px; text-transform: uppercase; color: var(--ink);
}
.ev-detail .ev-details .ev-card__title { padding-bottom: 10px; border-bottom: 1px solid var(--charcoal); }
.ev-detail .ev-facts dt, .ev-detail .prof-readonly dt {
  font-family: var(--font-display); font-weight: 500; font-size: 10px;
  letter-spacing: 2px; text-transform: uppercase; color: var(--charcoal);
}
.ev-detail .ev-calendar-clock { background: var(--mist); padding: 12px 14px; }

/* The register: initials square, Present / Didn't come a square
   segment (charcoal when chosen), Remove a quiet brick word. */
.ev-detail .evp-register__head { border-bottom: 1px solid var(--charcoal); }
.ev-detail .evp-person { border-bottom: 1px solid var(--hairline); }
.ev-detail .evp-person__ini { border-radius: 0; background: var(--mist); color: var(--charcoal); }
.ev-detail .evp-person .ev-seg[role="group"] { border: 1px solid var(--charcoal); border-radius: 0; padding: 0; background: var(--card-bg); }
.ev-detail .evp-person .ev-seg[role="group"] .ev-seg__btn,
.ev-detail .evp-person .ev-seg[role="group"] .ev-seg__on {
  border-radius: 0; background: var(--card-bg); color: var(--charcoal);
  font-family: var(--font-display); font-weight: 500; font-size: 10px;
  letter-spacing: 2px; text-transform: uppercase;
}
.ev-detail .evp-person .ev-seg[role="group"] .ev-seg__on,
.ev-detail .evp-person .ev-seg[role="group"] .ev-seg__on--present { background: var(--charcoal); color: var(--card-bg); }
.ev-detail .evp-person .ev-seg[role="group"] .ev-seg__btn:hover { background: var(--mist); }
.ev-detail .evp-person .ev-seg--quiet { border: 1px solid var(--hairline); border-radius: 0; color: var(--gray); }
.ev-detail .evp-person .ev-row__remove { color: var(--alert-fg); }
.ev-detail .ev-add-person { background: var(--mist); padding: 12px 14px; }
.ev-detail .ev-add-person label, .ev-detail .ev-add-person .field__label {
  font-family: var(--font-display); font-weight: 500; font-size: 10px;
  letter-spacing: 2px; text-transform: uppercase; color: var(--charcoal);
}

/* Who it reaches now: two columns of names, each with its chip. */
.ev-detail .attendees { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 0 24px; }
.ev-detail .attendees > li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--hairline); }
.ev-detail .person-status, .ev-calloff-page .person-status {
  display: inline-block; padding: 2px 8px; white-space: nowrap; border-radius: 0;
  background: var(--muted-bg); color: var(--muted-fg); font-size: 12px; text-transform: none;
}
.ev-detail .person-status::first-letter, .ev-calloff-page .person-status::first-letter { text-transform: uppercase; }
.ev-calloff-page .of-section { border-radius: 0; box-shadow: none; }
/* ADE-732 (16 Nov audit, D18): the call-off button starts its line; with a
   border in its own colour its edge, not its text, lines up with the
   paragraph above. */
.ev-calloff-page .lic-actions .ui-btn--danger { border-color: currentColor; }
.ev-calloff-page .of-section__title {
  font-family: var(--font-display); font-weight: 300; font-size: 20px;
  letter-spacing: 2px; text-transform: uppercase; color: var(--ink);
}

/* ── 3. New / edit event (events/form.html) and cancel (cancel.html) ─── */
.ev-form-page .ev-card { border-radius: 0; box-shadow: none; }
/* ADE-734 (D29): the call-off page's heading as the form's. */
.ev-form-page .ev-card__title, .ev-calloff-page .ev-card__title {
  font-family: var(--font-display); font-weight: 300; font-size: 20px;
  letter-spacing: 2px; text-transform: uppercase; color: var(--ink);
}
.ev-form-page .ev-field, .ev-form-page #evKindLabel, .ev-form-page label[for="evDescription"] {
  font-family: var(--font-display); font-weight: 500; font-size: 11px;
  letter-spacing: 2px; text-transform: uppercase; color: var(--ink);
}
.ev-form-page .ev-field input, .ev-form-page .ev-field select, .ev-form-page .ev-field textarea,
.ev-form-page .ev-field__hint, .ev-form-page .ev-field__opt {
  font-family: var(--font-sans); font-weight: 400; font-size: 15px;
  letter-spacing: 0; text-transform: none;
}
.ev-form-page .ev-field__hint, .ev-form-page .ev-field__opt { font-size: 12px; color: var(--gray); }
.ev-form-page .ev-kind {
  border-radius: 0; font-family: var(--font-sans); font-weight: 400; font-size: 14px;
  letter-spacing: 0; text-transform: none; color: var(--charcoal);
}
.ev-form-page .ev-kind:has(input:checked) { background: var(--charcoal); color: var(--card-bg); border-color: var(--charcoal); }
.ev-form-page .ev-form__foot { border-top: 1px solid var(--hairline); }

/* ── 4. Connect (connect/*; styling only, the chat's script untouched) ──
   Connect draws with its own --cx-* tokens; here they take Trellan's. */
html .cx {
  --cx-navy: var(--charcoal); --cx-copper: var(--charcoal); --cx-link: var(--leaf);
  --cx-line: var(--hairline); --cx-line-2: var(--hairline); --cx-muted: var(--gray);
  --cx-label: var(--charcoal); --cx-soft: var(--mist); --cx-chip: var(--mist);
  --cx-list-bg: var(--card-bg); --cx-red: var(--bloom);
  --cx-me-bg: var(--mist); --cx-me-chip: var(--mist); --cx-me-ink: var(--ink);
}
.cx .cx-list__title, .cx .cx-head__name, .cx .cx-intro__title, .cx .cx-pane__title {
  font-family: var(--font-display); font-weight: 300; letter-spacing: 2px;
  text-transform: uppercase; color: var(--ink);
}
.cx .cx-list__title { font-size: 22px; }
.cx .cx-intro__title { font-size: 22px; }
.cx .cx-intro__ico { border-radius: 0; background: var(--card-bg); border: 1px solid var(--hairline); }
/* The open channel: Mist with the green rule, as the rail. */
.cx .cx-row { border-radius: 0; }
.cx .cx-row.is-open, .cx .cx-row.is-open:hover {
  background: var(--mist); color: var(--ink); font-weight: 700; box-shadow: inset 2px 0 0 var(--green);
}
.cx .cx-row.is-open .cx-badge { background: var(--charcoal); color: var(--card-bg); }
.cx .cx-av, .cx .cx-face { border-radius: 0; background: var(--mist); color: var(--charcoal); border: 1px solid var(--hairline); }
.cx .cx-av--me { background: var(--charcoal); color: var(--card-bg); border-color: var(--charcoal); }
/* Danny, 28 Oct: a light colour per person (`domain/connect.tone`), the same
   everywhere. Yours too, so you read as one of the room. Text stays ink. */
.cx .cx-av[class*="cx-av--t"], .cx .cx-face[class*="cx-av--t"] { color: var(--ink); border-color: transparent; }
.cx .cx-av--t0 { background: #E3F1D6; }
.cx .cx-av--t1 { background: #FBE3EC; }
.cx .cx-av--t2 { background: #E1EAF7; }
.cx .cx-av--t3 { background: #F8EDD2; }
.cx .cx-av--t4 { background: #EAE3F5; }
.cx .cx-av--t5 { background: #DCEFEC; }
.cx .cx-av--t6 { background: #F7E4DC; }
.cx .cx-av--t7 { background: #E8EAE0; }
/* The person's photo where they have one; the initials otherwise. */
.cx .cx-av--photo { padding: 0; overflow: hidden; background: var(--mist); }
.cx .cx-av--photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cx .cx-msg__by { color: var(--ink); }
.cx .cx-day span {
  height: auto; padding: 0 4px; border: 0; border-radius: 0; background: transparent;
  font-family: var(--font-display); font-weight: 500; font-size: 10px;
  letter-spacing: 2px; text-transform: uppercase; color: var(--charcoal);
}
.cx .cx-threadlink { border: 1px solid var(--hairline); border-radius: 0; }
.cx .cx-box { border-radius: 0; border-color: var(--edge); }
.cx .cx-send { border-radius: 0; width: 40px; height: 40px; }
.cx .cx-send:disabled { background: var(--stone); }
.cx .cx-headbtn { border-radius: 0; }
/* 28 Oct click-through, N11. The header grows with its lines and keeps a
   gap under the top bar; a channel with a description has three. The
   square faces sit side by side with a shared edge: the round ones
   overlapped by 8 px and that cut the initials ("AE AS AL"). */
.cx .cx-head { height: auto; min-height: 64px; padding-block: 12px; }
.cx .cx-face { width: 26px; height: 26px; margin-left: -1px; font-size: 10px; letter-spacing: 0; }
.cx .cx-face:first-child { margin-left: 0; }
.cx .cx-threadlink .cx-face { width: 22px; height: 22px; font-size: 8.5px; }
@media (max-width: 759.98px) { .cx .cx-head { min-height: 60px; padding-block: 12px; } }

/* Report 276. The folded QB groups section: a summary line with its count
   and a chevron, and a filter box when it is open. */
.cx .cx-sec--fold > .cx-sec__sum { cursor: pointer; list-style: none; }
.cx .cx-sec--fold > .cx-sec__sum::-webkit-details-marker { display: none; }
.cx .cx-sec--fold > .cx-sec__sum:hover { background: var(--mist); }
.cx .cx-sec__chev { margin-left: auto; font-size: 19px; transition: transform .15s; }
.cx .cx-sec--fold[open] > .cx-sec__sum .cx-sec__chev { transform: rotate(180deg); }
.cx .cx-find--sec { margin: 4px 10px 6px; border-radius: 0; }
.cx .cx-find--sec input { font-size: 14px; }
.cx .cx-sec--fold .cx-list__none { padding: 8px 10px; }

/* Report 276. The Buy/Sell Board: photos on a post, as a grid. One photo
   is wide; two or three sit two across; four or more sit three across. Tap opens it large. */
.cx .cx-gallery { display: grid; gap: 4px; margin: 6px 0 2px; max-width: 520px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cx .cx-gallery--1 { grid-template-columns: minmax(0, 1fr); max-width: 420px; }
.cx .cx-gallery--2 { max-width: 420px; }
.cx .cx-gallery--4 { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 460px; }
.cx .cx-gallery--3 .cx-gallery__item:first-child { grid-column: 1 / -1; }
.cx .cx-gallery__item { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--mist); border: 1px solid var(--hairline); }
.cx .cx-gallery--1 .cx-gallery__item { aspect-ratio: auto; max-height: 360px; }
.cx .cx-gallery--3 .cx-gallery__item:first-child { aspect-ratio: 16 / 9; }
.cx .cx-gallery__item img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cx .cx-gallery__item:focus-visible { outline: 2px solid var(--leaf); outline-offset: 2px; }
.cx .cx-msg__sold { margin: 2px 0; }
.cx .cx-pill--sold { border-radius: 0; background: var(--charcoal); color: var(--card-bg); letter-spacing: 1px; text-transform: uppercase; font-size: 11px; }
.cx .cx-markform { margin: 4px 0 0; }
.cx .cx-markbtn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px;
  border: 1px solid var(--hairline); border-radius: 0; background: var(--card-bg); cursor: pointer;
  font: inherit; font-size: 13px; color: var(--charcoal);
}
.cx .cx-markbtn .ms { font-size: 18px; }
.cx .cx-markbtn:hover { background: var(--mist); }
/* The photo picker sits in the composer's bar; the list of chosen files
   takes a line of its own under it. */
.cx .cx-compose[data-cx-photos] .cx-box__bar { height: auto; min-height: 40px; flex-wrap: wrap; }
.cx .cx-photopick { display: contents; }
.cx .cx-photopick .ui-file__button { min-height: 32px; padding: 0 10px; font-size: 13px; gap: 6px; }
.cx .cx-photopick .ui-file-staged { order: 10; flex: 1 1 100%; margin: 4px 0 0; }
.cx-lightbox {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(20, 20, 20, .88); cursor: zoom-out;
}
.cx-lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.cx-lightbox__close {
  position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border: 0; border-radius: 0;
  background: var(--card-bg); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}

/* New / edit channel (connect/channel_form.html). */
.connect-channel-form-page > .of-card, .connect-channel-form-page form.of-card {
  border: 1px solid var(--hairline); border-radius: 0; box-shadow: none; padding: 20px 24px;
  display: flex; flex-direction: column; gap: 14px;
}
.connect-channel-form-page .settings-field, .connect-channel-form-page .settings-field > legend {
  display: flex; flex-direction: column; gap: 6px;
  font-family: var(--font-display); font-weight: 500; font-size: 11px;
  letter-spacing: 2px; text-transform: uppercase; color: var(--ink);
}
.connect-channel-form-page fieldset.settings-field { border: 0; border-top: 1px solid var(--hairline); padding: 14px 0 0; margin: 0; }
.connect-channel-form-page .settings-field input, .connect-channel-form-page .settings-field select,
.connect-channel-form-page .settings-field__hint, .connect-channel-form-page fieldset.settings-field label {
  font-family: var(--font-sans); font-weight: 400; font-size: 15px; letter-spacing: 0; text-transform: none;
}
.connect-channel-form-page fieldset.settings-field label { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); }
.connect-channel-form-page .settings-field__hint { font-size: 13px; color: var(--gray); }
.connect-channel-form-page .of-formbar { border: 0; padding-inline: 0; }
.connect-channel-form-page [data-channel-archive] .ui-btn { align-self: flex-start; }
.connect-channel-form-page .cx-card__title {
  margin: 0; font-family: var(--font-display); font-weight: 300; font-size: 20px;
  letter-spacing: 2px; text-transform: uppercase; color: var(--ink);
}
.connect-channel-form-page [data-channel-archive] p { margin: 0; }

/* ── 5. Messages (messages/index, detail, new) ───────────────────────── */
.write-page .of-section, .message-page .of-section, .message-page .of-facts { border-radius: 0; box-shadow: none; }
/* Decision 7: the filter fields sit on one bottom line, so a long label
   never pushes its field down. */
.write-page .aud-fields { align-items: end; }
.write-page .aud-fields > label, .write-page label.field {
  font-family: var(--font-display); font-weight: 500; font-size: 11px;
  letter-spacing: 2px; text-transform: uppercase; color: var(--ink);
}
.write-page .aud-fields > label select, .write-page .aud-fields > label input,
.write-page label.field input, .write-page label.field textarea,
.write-page label.field .field-note {
  font-family: var(--font-sans); font-weight: 400; font-size: 15px; letter-spacing: 0; text-transform: none;
}
.write-page label.field .field-note { font-size: 13px; color: var(--gray); }
.write-page .write-who { background: var(--mist); padding: 14px 16px; }
.message-page .of-facts__row dt, .message-page .of-facts dt {
  font-family: var(--font-display); font-weight: 500; font-size: 10px;
  letter-spacing: 2px; text-transform: uppercase; color: var(--charcoal);
}
.message-page .outbox-msg__body { background: var(--mist); border: 0; border-radius: 0; padding: 12px 16px; }

/* ── 6. Signatures (signatures/index, detail, sign) ──────────────────── */
.signatures-page .of-list { border-radius: 0; box-shadow: none; }
.sig-page .ui-title, .signature-page .of-head__title {
  font-family: var(--font-display); font-weight: 300; letter-spacing: 2px;
  text-transform: uppercase; color: var(--ink);
}
.sig-page .ui-card, .signature-page .of-section, .signature-page .of-card { border-radius: 0; box-shadow: none; }
.sig-page .ui-card__title, .signature-page .of-section__title {
  font-family: var(--font-display); font-weight: 300; font-size: 20px;
  letter-spacing: 2px; text-transform: uppercase; color: var(--ink);
}
.sig-page .sig-consent, .signature-page .sig-consent { background: var(--mist); border: 0; border-radius: 0; padding: 12px 16px; }
.signature-page .sig-facts dt {
  font-family: var(--font-display); font-weight: 500; font-size: 10px;
  letter-spacing: 2px; text-transform: uppercase; color: var(--charcoal);
}

@media (max-width: 759.98px) {
  .write-page .of-formbar .ui-btn--commit, .sig-page #signButton { width: 100%; justify-content: center; }
}

@media (max-width: 759.98px) {
  .ev-detail .ev-hcard__actions .ui-btn, .ev-detail .ev-hcard__actions form { width: 100%; }
  .ev-detail .ev-seg { width: 100%; }
  .ev-detail .ev-seg__btn, .ev-detail .ev-seg__on { flex: 1; text-align: center; }
}

@media (max-width: 759.98px) {
  .ev-index .of-head .ui-btn--primary { width: 100%; justify-content: center; }
  .ev-index .ev-bar__arrow { width: 44px; height: 44px; }
  /* 28 Oct click-through, S10: at 390 px the month row with "Today"
     was about 25 px too wide. The row takes the full width, the month name
     is smaller and gives way first, and "Today" sits at the right. */
  .ev-index .ev-bar__month { flex: 1 1 100%; }
  .ev-index .ev-bar__label {
    flex: 1 1 auto; min-width: 0; margin: 0 6px; font-size: 18px; letter-spacing: 1px;
    overflow: hidden; text-overflow: ellipsis;
  }
  .ev-index .ev-bar .ev-bar__today { flex: none; margin-left: auto; }
  .ev-index .ev-bar .of-seg { flex: 1 1 100%; display: flex; }
  .ev-index .ev-bar .of-seg__opt { flex: 1; justify-content: center; }
  .ev-index .of-toolbar .of-select { flex: 1 1 100%; width: 100%; max-width: none; }
  .ev-index .ev-list .of-list { border: 0; }
  .ev-index .ev-list .ev-row { border-inline: 0; }
}
