/* cal-share.css: styles for cal-share.js (24 Sep 2026, calendar overhaul).
   .tcs-inv   "Your invitations" (applicant portal, client account, join page)
   .tcs-layer the document viewer and the file sheet (every page that opens a calendar attachment)
   Own tokens, light by default, dark under :root[data-theme="dark"]. Every rule is scoped to a .tcs- class so a host
   page's own button, h3, p or a rules never reach in, and host resets (apply.html's * {margin:0}) never break it. */

.tcs-inv, .tcs-layer {
  --tcs-surface: #ffffff;
  --tcs-surface-2: #f3f6fc;
  --tcs-line: rgba(13, 27, 75, 0.12);
  --tcs-line-2: rgba(13, 27, 75, 0.2);
  --tcs-ink: #0d1b4b;
  --tcs-soft: #505a80;
  --tcs-primary: #0d1b4b;
  --tcs-on-primary: #ffffff;
  --tcs-primary-hover: #1a2c6b;
  --tcs-accent: #4fc3f7;
  --tcs-focus: #1c7fb8;
  --tcs-ok: #1d7a50;     --tcs-ok-bg: #e5f5ec;
  --tcs-warn: #8a5300;   --tcs-warn-bg: #fff2d9;
  --tcs-bad: #b3261e;    --tcs-bad-bg: #fdeceb;
  --tcs-info: #11608f;   --tcs-info-bg: #e2f3fc;
  --tcs-muted-bg: #eef0f5;
  --tcs-shadow-1: 0 1px 2px rgba(8, 15, 46, 0.06), 0 4px 16px rgba(8, 15, 46, 0.05);
  --tcs-shadow-2: 0 24px 70px rgba(8, 15, 46, 0.32);
  --tcs-scrim: rgba(8, 15, 46, 0.55);
  --tcs-paper-bg: #e9edf5;
  --tcs-display: 'Playfair Display', Georgia, serif;
  --tcs-ease: cubic-bezier(0.16, 1, 0.3, 1);
}
:root[data-theme="dark"] .tcs-inv, :root[data-theme="dark"] .tcs-layer {
  --tcs-surface: #172642;
  --tcs-surface-2: #101d33;
  --tcs-line: rgba(255, 255, 255, 0.12);
  --tcs-line-2: rgba(255, 255, 255, 0.22);
  --tcs-ink: #e9eefb;
  --tcs-soft: #a9b8d3;
  --tcs-primary: #4fc3f7;
  --tcs-on-primary: #0b1526;
  --tcs-primary-hover: #7fd3fb;
  --tcs-focus: #7fd3fb;
  --tcs-ok: #7ddc9a;     --tcs-ok-bg: #133524;
  --tcs-warn: #f2b76a;   --tcs-warn-bg: #3a2c14;
  --tcs-bad: #ff9b8f;    --tcs-bad-bg: #3a1c19;
  --tcs-info: #86d4fa;   --tcs-info-bg: #10304a;
  --tcs-muted-bg: #22334f;
  --tcs-shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3);
  --tcs-shadow-2: 0 24px 70px rgba(0, 0, 0, 0.55);
  --tcs-scrim: rgba(3, 8, 20, 0.7);
  --tcs-paper-bg: #0e1829;
}

.tcs-inv *, .tcs-inv *::before, .tcs-inv *::after,
.tcs-layer *, .tcs-layer *::before, .tcs-layer *::after { box-sizing: border-box; }
.tcs-i { display: block; flex: 0 0 auto; }

/* ───────── buttons ───────── */
.tcs-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; margin: 0;
  border-radius: 999px; border: 1.5px solid transparent;
  font-family: inherit; font-weight: 700; font-size: 0.9rem; line-height: 1.2; letter-spacing: 0;
  text-decoration: none !important; cursor: pointer; white-space: nowrap;
  transition: background-color 0.18s, border-color 0.18s, color 0.18s;
  -webkit-tap-highlight-color: transparent;
}
.tcs-btn--primary { background: var(--tcs-primary); color: var(--tcs-on-primary) !important; }
.tcs-btn--primary:hover { background: var(--tcs-primary-hover); }
.tcs-btn--ghost { background: transparent; color: var(--tcs-ink) !important; border-color: var(--tcs-line-2); }
.tcs-btn--ghost:hover { border-color: var(--tcs-accent); background: var(--tcs-surface-2); }
.tcs-btn--sm { min-height: 44px; padding: 0 14px; font-size: 0.84rem; }
.tcs-btn--wide { width: 100%; }
.tcs-inv :focus-visible, .tcs-layer :focus-visible { outline: 3px solid var(--tcs-focus); outline-offset: 2px; }
.tcs-link { color: var(--tcs-info) !important; font-weight: 600; text-decoration: underline !important; text-underline-offset: 2px; white-space: nowrap; }

/* ───────── invitations card ───────── */
.tcs-inv-host { display: block; }
.tcs-inv {
  background: var(--tcs-surface); color: var(--tcs-ink);
  border: 1px solid var(--tcs-line); border-radius: 18px;
  padding: 20px 20px 8px; margin: 0 0 1.2rem;
  box-shadow: var(--tcs-shadow-1);
  font-family: inherit; text-align: left; line-height: 1.45;
}
.tcs-inv-head { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 14px; }
.tcs-inv-ic {
  width: 40px; height: 40px; border-radius: 12px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: var(--tcs-info-bg); color: var(--tcs-info);
}
.tcs-inv-title { font-family: var(--tcs-display); font-size: 1.28rem; font-weight: 700; line-height: 1.2; margin: 0 0 2px; color: var(--tcs-ink); }
.tcs-inv-sub { margin: 0; font-size: 0.86rem; color: var(--tcs-soft); line-height: 1.5; }
.tcs-inv-list { list-style: none; margin: 0; padding: 0; }

.tcs-note { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; font-size: 0.86rem; line-height: 1.45; font-weight: 600; }
.tcs-note .tcs-i { margin-top: 1px; }
.tcs-note--info { background: var(--tcs-info-bg); color: var(--tcs-info); }
.tcs-note--warn { background: var(--tcs-warn-bg); color: var(--tcs-warn); }
.tcs-note--bad { background: var(--tcs-bad-bg); color: var(--tcs-bad); margin: 10px 0 4px; }

/* one invitation */
.tcs-ic {
  position: relative; display: flex; gap: 14px;
  padding: 16px 0 14px; margin: 0;
  border-top: 1px solid var(--tcs-line);
  outline: none; border-radius: 4px;
}
.tcs-ic:first-child { border-top: 0; padding-top: 4px; }
.tcs-ic.is-flash { animation: tcs-flash 2.4s var(--tcs-ease); }
@keyframes tcs-flash { 0%, 40% { box-shadow: 0 0 0 3px var(--tcs-accent); background: var(--tcs-surface-2); } 100% { box-shadow: 0 0 0 0 transparent; background: transparent; } }
.tcs-ic-date {
  flex: 0 0 56px; width: 56px; align-self: flex-start;
  display: flex; flex-direction: column; align-items: center;
  border-radius: 12px; overflow: hidden;
  background: var(--tcs-surface-2); border: 1px solid var(--tcs-line);
  padding: 0 0 6px; text-align: center;
}
.tcs-ic-m {
  display: block; width: 100%; padding: 3px 0 2px;
  background: var(--tcs-c, #039be5); color: var(--tcs-c-ink, #0d1b4b);
  font-size: 0.66rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
}
.tcs-ic-d { display: block; font-size: 1.45rem; font-weight: 800; line-height: 1.15; margin-top: 3px; color: var(--tcs-ink); }
.tcs-ic-w { display: block; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--tcs-soft); }
.tcs-ic-main { flex: 1 1 auto; min-width: 0; }
.tcs-ic-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 4px; }
.tcs-type { display: inline-flex; align-items: center; gap: 5px; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tcs-soft); }
.tcs-pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px 3px 7px; border-radius: 999px; font-size: 0.74rem; font-weight: 700; line-height: 1.3; white-space: nowrap; }
.tcs-pill--ok { background: var(--tcs-ok-bg); color: var(--tcs-ok); }
.tcs-pill--warn { background: var(--tcs-warn-bg); color: var(--tcs-warn); }
.tcs-pill--bad { background: var(--tcs-bad-bg); color: var(--tcs-bad); }
.tcs-pill--info { background: var(--tcs-info-bg); color: var(--tcs-info); }
.tcs-pill--muted { background: var(--tcs-muted-bg); color: var(--tcs-soft); }
.tcs-rel { font-size: 0.76rem; font-weight: 700; color: var(--tcs-soft); }
.tcs-rel.is-live { color: var(--tcs-ok); display: inline-flex; align-items: center; gap: 6px; }
.tcs-rel.is-live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 currentColor; animation: tcs-pulse 1.8s infinite; }
@keyframes tcs-pulse { 0% { box-shadow: 0 0 0 0 rgba(46, 158, 107, 0.5); } 70% { box-shadow: 0 0 0 7px rgba(46, 158, 107, 0); } 100% { box-shadow: 0 0 0 0 rgba(46, 158, 107, 0); } }
.tcs-ic-title { margin: 0 0 6px; font-size: 1.05rem; font-weight: 700; line-height: 1.3; color: var(--tcs-ink); overflow-wrap: anywhere; font-family: inherit; }
.tcs-ic.is-cancelled .tcs-ic-title { text-decoration: line-through; color: var(--tcs-soft); }
.tcs-ic.is-cancelled .tcs-ic-m, .tcs-ic.is-over .tcs-ic-m { background: var(--tcs-muted-bg); color: var(--tcs-soft); }
.tcs-ic-line { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 4px; font-size: 0.9rem; color: var(--tcs-ink); line-height: 1.45; overflow-wrap: anywhere; }
.tcs-ic-line .tcs-i { margin-top: 2px; color: var(--tcs-soft); }
.tcs-ic-soft { color: var(--tcs-soft); }
.tcs-ic-how { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 10px 0 4px; }
.tcs-ic-how .tcs-ic-line { flex: 1 1 100%; margin: 0; }
.tcs-how-note { font-size: 0.82rem; color: var(--tcs-soft); flex: 1 1 180px; }
.tcs-ic-agenda {
  margin: 8px 0 2px; padding: 10px 12px; border-radius: 12px;
  background: var(--tcs-surface-2); color: var(--tcs-ink);
  font-size: 0.88rem; line-height: 1.55; overflow-wrap: anywhere;
}
.tcs-ic-agenda.is-clamped .tcs-ag-t { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden; }
.tcs-more {
  display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 4px; margin: 0;
  background: none; border: 0; cursor: pointer; font-family: inherit; font-weight: 700; font-size: 0.84rem; color: var(--tcs-info);
}
.tcs-more[aria-expanded="true"] .tcs-i { transform: rotate(180deg); }
.tcs-ic-label { display: flex; align-items: center; gap: 6px; margin: 10px 0 6px; font-size: 0.74rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--tcs-soft); }
.tcs-files { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.tcs-file {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; margin: 0;
  padding: 6px 12px 6px 6px; border-radius: 12px; border: 1px solid var(--tcs-line);
  background: var(--tcs-surface); color: var(--tcs-ink); cursor: pointer; text-align: left;
  font-family: inherit; transition: border-color 0.18s, background-color 0.18s;
}
.tcs-file:hover { border-color: var(--tcs-accent); background: var(--tcs-surface-2); }
.tcs-file-txt { display: flex; flex-direction: column; min-width: 0; }
.tcs-file-name { font-size: 0.88rem; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.tcs-file-meta { font-size: 0.76rem; color: var(--tcs-soft); }

/* file type tiles (the word under the name says the type too; colour is never the only signal) */
.tcs-ftile { width: 48px; height: 48px; border-radius: 12px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; background: var(--tcs-info-bg); color: var(--tcs-info); }
.tcs-ftile--sm { width: 38px; height: 38px; border-radius: 10px; }
.tcs-ftile--image { background: var(--tcs-ok-bg); color: var(--tcs-ok); }
.tcs-ftile--sheet { background: var(--tcs-ok-bg); color: var(--tcs-ok); }
.tcs-ftile--slides { background: var(--tcs-warn-bg); color: var(--tcs-warn); }

/* RSVP */
.tcs-rsvp { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 12px 0 0; }
.tcs-rsvp-q { font-size: 0.88rem; font-weight: 700; color: var(--tcs-ink); }
.tcs-seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.tcs-seg-b {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; min-width: 76px; padding: 0 14px; margin: 0;
  border-radius: 999px; border: 1.5px solid var(--tcs-line-2); background: var(--tcs-surface); color: var(--tcs-ink);
  font-family: inherit; font-weight: 700; font-size: 0.88rem; cursor: pointer; justify-content: center;
  transition: background-color 0.18s, border-color 0.18s, color 0.18s;
}
.tcs-seg-b:hover { border-color: var(--tcs-accent); }
.tcs-seg-b.is-on { background: var(--tcs-primary); border-color: var(--tcs-primary); color: var(--tcs-on-primary); }
.tcs-seg-b[aria-disabled="true"] { cursor: progress; }
.tcs-ic-msg { margin: 6px 0 0; min-height: 0; font-size: 0.82rem; font-weight: 600; color: var(--tcs-ok); }
.tcs-ic-msg:empty { display: none; }
.tcs-ic-msg.is-bad { color: var(--tcs-bad); }

/* the guest page (join.html) sits on a navy shell: the card keeps its own surface, a little narrower */
.tcs-inv--guest { max-width: 520px; margin: 14px auto 0; box-shadow: var(--tcs-shadow-2); }

@media (max-width: 559px) {
  .tcs-inv { padding: 16px 14px 6px; border-radius: 16px; }
  .tcs-inv-title { font-size: 1.15rem; }
  .tcs-ic { gap: 12px; }
  .tcs-ic-date { flex-basis: 48px; width: 48px; }
  .tcs-ic-d { font-size: 1.25rem; }
  .tcs-ic-how .tcs-btn { flex: 1 1 100%; }
  .tcs-rsvp { gap: 6px; }
  .tcs-rsvp-q { flex: 1 1 100%; }
  /* the three answers share the row when they fit; on a narrow phone "Cannot make it" takes its own full-width row */
  .tcs-seg { display: flex; flex-wrap: wrap; width: 100%; }
  .tcs-seg-b { flex: 1 1 auto; min-width: 72px; padding: 0 10px; white-space: normal; text-align: center; line-height: 1.2; }
  .tcs-files { grid-template-columns: 1fr; }
}

/* ───────── overlays: the document viewer and the file sheet ───────── */
/* the floating light switch (theme.js, z-index 99997) would sit on top of the sheet's words: hide it while one is open */
body:has(.tcs-layer) #tc-theme-toggle { display: none !important; }
.tcs-layer {
  position: fixed; inset: 0; z-index: 1212;
  display: flex; align-items: center; justify-content: center;
  color: var(--tcs-ink); font-family: inherit; line-height: 1.45; text-align: left;
  animation: tcs-fade 0.18s ease-out;
}
.tcs-layer.is-leaving { opacity: 0; transition: opacity 0.15s; }
.tcs-scrim { position: absolute; inset: 0; background: var(--tcs-scrim); }
.tcs-panel:focus { outline: none; }
:root[data-theme="dark"] .tcs-panel { border: 1px solid var(--tcs-line); }
@media (max-width: 719px) { :root[data-theme="dark"] .tcs-viewer { border: 0; } }
.tcs-panel { position: relative; background: var(--tcs-surface); color: var(--tcs-ink); box-shadow: var(--tcs-shadow-2); }
@keyframes tcs-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes tcs-rise { from { transform: translateY(24px); } to { transform: none; } }
.tcs-layer:not(.is-still) .tcs-panel { animation: tcs-rise 0.26s var(--tcs-ease); }
.tcs-x {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 44px; height: 44px; margin: 0; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--tcs-ink); cursor: pointer;
}
.tcs-x:hover { background: var(--tcs-surface-2); }

/* the viewer */
.tcs-viewer {
  display: flex; flex-direction: column;
  width: min(1040px, calc(100vw - 48px)); height: calc(100vh - 48px); height: calc(100dvh - 48px);
  border-radius: 20px; overflow: hidden;
}
.tcs-vbar { display: flex; align-items: center; gap: 8px; min-height: 64px; padding: 8px 12px 8px 8px; border-bottom: 1px solid var(--tcs-line); flex: 0 0 auto; }
.tcs-vic { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--tcs-info-bg); color: var(--tcs-info); flex: 0 0 auto; }
.tcs-vname { flex: 1 1 auto; min-width: 0; }
.tcs-vtitle { margin: 0; font-size: 1.02rem; font-weight: 700; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--tcs-ink); font-family: inherit; }
.tcs-vsub { margin: 0; font-size: 0.78rem; color: var(--tcs-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tcs-vacts { display: flex; gap: 8px; flex: 0 0 auto; }
.tcs-vbody { position: relative; flex: 1 1 auto; min-height: 0; background: var(--tcs-paper-bg); }
.tcs-doc-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: transparent; }
.tcs-verr { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; height: 100%; padding: 24px; text-align: center; }
.tcs-verr .tcs-err { max-width: 420px; }

/* waiting: a water drop filling up, the trade touch */
.tcs-wait { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; height: 100%; min-height: 120px; padding: 20px; font-size: 0.9rem; font-weight: 600; color: var(--tcs-soft); }
.tcs-drop { position: relative; width: 30px; height: 30px; color: var(--tcs-accent); }
.tcs-drop .tcs-i { position: relative; z-index: 1; }
.tcs-drop-fill {
  position: absolute; left: 7px; right: 7px; bottom: 3px; height: 0; border-radius: 0 0 10px 10px;
  background: var(--tcs-accent); opacity: 0.55; animation: tcs-fill 1.6s ease-in-out infinite;
}
@keyframes tcs-fill { 0% { height: 0; } 60% { height: 15px; } 100% { height: 15px; opacity: 0; } }

.tcs-err { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; background: var(--tcs-bad-bg); color: var(--tcs-bad); font-size: 0.9rem; font-weight: 600; line-height: 1.45; text-align: left; }
.tcs-err .tcs-i { margin-top: 1px; }

/* the file sheet */
.tcs-sheet { width: min(440px, calc(100vw - 32px)); border-radius: 24px; padding: 22px 20px 18px; }
.tcs-sheet .tcs-x { position: absolute; top: 10px; right: 10px; }
.tcs-handle { display: none; }
.tcs-fhead { display: flex; align-items: center; gap: 14px; padding-right: 44px; margin: 0 0 16px; }
.tcs-fname { min-width: 0; }
.tcs-ftitle { margin: 0; font-size: 1.05rem; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; color: var(--tcs-ink); font-family: inherit; }
.tcs-fmeta { margin: 2px 0 0; font-size: 0.84rem; color: var(--tcs-soft); }
.tcs-fbody .tcs-wait { min-height: 96px; height: auto; }
.tcs-hint { margin: 10px 0 0; font-size: 0.8rem; color: var(--tcs-soft); text-align: center; }

@media (max-width: 719px) {
  .tcs-viewer { width: 100%; height: 100%; border-radius: 0; }
  .tcs-vbar { padding-top: calc(8px + env(safe-area-inset-top, 0px)); }
  .tcs-vacts .tcs-btn span { display: none; }
  .tcs-vacts .tcs-btn { width: 44px; min-height: 44px; padding: 0; }
  .tcs-layer--sheet { align-items: flex-end; }
  .tcs-sheet { width: 100%; border-radius: 24px 24px 0 0; padding: 8px 18px calc(18px + env(safe-area-inset-bottom, 0px)); }
  .tcs-handle { display: block; width: 48px; height: 20px; margin: 0 auto 8px; position: relative; }
  .tcs-handle::after { content: ""; position: absolute; left: 8px; right: 8px; top: 8px; height: 4px; border-radius: 4px; background: var(--tcs-line-2); }
  .tcs-sheet .tcs-x { top: 6px; right: 6px; }
  .tcs-layer:not(.is-still) .tcs-sheet { animation: tcs-rise 0.28s var(--tcs-ease); }
}

@media (prefers-reduced-motion: reduce) {
  .tcs-layer, .tcs-layer .tcs-panel, .tcs-ic.is-flash { animation: none !important; }
  .tcs-ic.is-flash { box-shadow: 0 0 0 3px var(--tcs-accent); }
  .tcs-rel.is-live::before, .tcs-drop-fill { animation: none; }
  .tcs-drop-fill { height: 10px; }
  .tcs-btn, .tcs-file, .tcs-seg-b, .tcs-layer.is-leaving { transition: none; }
}
@media (forced-colors: active) {
  .tcs-btn, .tcs-seg-b, .tcs-file, .tcs-pill, .tcs-note { border: 1px solid CanvasText; }
  .tcs-seg-b.is-on { outline: 2px solid Highlight; }
}
