/* The Calendar (docs/calendar.md, app/views/app/calendar/) and a meeting invite in the inbox: app.css tokens, square
   corners. Day and Week are a timeline (hours down the side, a column a day) that scrolls inside its card. */
.cal-head { flex-wrap: wrap; }
.cal-head h1 { margin-right: auto; }
.cal-head .seg { margin: 0; }
.cal-h { display: flex; align-items: center; gap: 6px; margin: 0 0 12px; }
.cal-h h2 { flex: 1; min-width: 0; margin: 0 0 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-h .btn-secondary { padding: 7px 10px; font-size: 15px; }
.cal-sub { position: relative; flex: none; }
.cal-sub summary { list-style: none; }
.cal-sub summary::-webkit-details-marker { display: none; }
.cal-sub-box { position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; width: min(420px, calc(100vw - 32px)); padding: 12px; display: flex; flex-wrap: wrap; gap: 8px; background: var(--card); border: 1px solid var(--rule); box-shadow: 0 10px 30px rgba(0,0,0,.12); }
.cal-sub-box input { flex: 1 1 100%; min-width: 0; height: 38px; font-size: 13px; }
.cal-sub-box .btn, .cal-sub-box .btn-secondary { padding: 8px 14px; font-size: 15px; }
.cal h3 { margin: 18px 0 6px; font: 600 15px var(--f-head); color: var(--n700); }
.cal h3.on { color: var(--p700); }
.cal-day { padding: 0; }
.cal-ev { display: flex; align-items: center; gap: 10px; padding-right: 14px; }
.cal-ev + .cal-ev { border-top: 1px solid var(--rule); }
.cal-ev-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 12px 0 12px 16px; color: inherit; text-decoration: none; }
a.cal-ev-main[href]:hover .cal-what b { color: var(--p700); }
.cal-time { flex: none; width: 46px; display: flex; flex-direction: column; font-size: 14px; font-variant-numeric: tabular-nums; }
.cal-time b { font-weight: 600; }
.cal-time span { color: var(--n700); font-size: 12px; }
.cal-what { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; padding-left: 12px; border-left: 3px solid var(--p700); }
.cal-what b, .cal-what .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-what b { font-weight: 600; }
.cal-what .sub { font-size: 13px; }
.cal-mark { flex: none; display: grid; place-items: center; width: 24px; height: 24px; background: var(--p900); color: #fff; font: 600 13px var(--f-head); }
.cal-join { flex: none; padding: 6px 12px; font-size: 15px; }
.cal-past { margin: 18px 0 24px; }
.cal-past > summary { cursor: pointer; color: var(--n700); font-size: 14px; padding: 4px 0; }

.cal-grid { --min: .9px; max-height: calc(100vh - 220px); max-height: calc(100dvh - 220px); overflow-y: auto; scrollbar-width: none; background: var(--card); border: 1px solid var(--rule); }
.cal-grid::-webkit-scrollbar { display: none; }
.cal-days { position: sticky; top: 0; z-index: 3; display: grid; grid-template-columns: 52px repeat(var(--days), minmax(0, 1fr)); background: var(--card); border-bottom: 1px solid var(--rule); }
.cal-days a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 6px; color: var(--ink); text-decoration: none; }
.cal-days small { font-size: 11px; color: var(--n700); text-transform: uppercase; letter-spacing: .05em; }
.cal-days b { display: grid; place-items: center; width: 28px; height: 28px; font: 600 16px var(--f-head); }
.cal-days a.today b { background: var(--err); color: #fff; }
.cal-days a.today small { color: var(--err); }
.cal-body { position: relative; display: grid; grid-template-columns: 52px repeat(var(--days), minmax(0, 1fr)); height: calc(var(--hours) * 60 * var(--min)); }
.cal-hours span { display: block; height: calc(60 * var(--min)); padding-right: 8px; text-align: right; font-size: 11px; color: var(--n700); font-variant-numeric: tabular-nums; transform: translateY(-7px); }
.cal-hours span:first-child { visibility: hidden; }
.cal-col { position: relative; border-left: 1px solid var(--rule); background-image: repeating-linear-gradient(to bottom, var(--rule) 0 1px, transparent 1px calc(60 * var(--min))); }
.cal-col.today { background-color: var(--p100); }
.cal-blk { position: absolute; z-index: 1; display: flex; flex-direction: column; gap: 1px; overflow: hidden; padding: 4px 6px; border-left: 3px solid var(--p700); background: var(--p200); color: var(--ink); text-decoration: none; font-size: 12px; line-height: 1.25; }
.cal-blk b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-blk span { color: var(--n700); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-blk.short { flex-direction: row; gap: 6px; align-items: center; padding-top: 1px; padding-bottom: 1px; }
.cal-blk:hover { background: var(--p300); }
.cal-now { position: absolute; z-index: 2; height: 2px; margin-top: -1px; background: var(--err); pointer-events: none; }
.cal-now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--err); }
.cal-now[hidden] { display: none; }
@media (min-width: 900px) { .cal-grid { --min: 1.1px; } }
@media (max-width: 640px) {
  .cal-h h2 { font-size: 18px; }
  .cal-days, .cal-body { grid-template-columns: 40px repeat(var(--days), minmax(0, 1fr)); }
  .cal-hours span { padding-right: 5px; font-size: 10px; }
  .cal-v-week .cal-blk { padding: 2px 3px; font-size: 10.5px; border-left-width: 2px; }
  .cal-v-week .cal-blk span { display: none; }
  .cal-v-week .cal-blk b { white-space: normal; }
  .cal-ev { flex-wrap: wrap; }
}

/* a meeting invite on its message, and the reply box's invite button and chip */
.msg-invite { display: flex; align-items: center; gap: 10px; margin: 8px 0 4px; padding: 10px 12px; border: 1px solid var(--rule); background: var(--card); color: var(--ink); }
.msg-invite-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.msg-invite-main b, .msg-invite-main .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-invite .btn-secondary { padding: 6px 12px; font-size: 15px; }
.ib-invite { flex: none; padding: 9px 10px; }
.ib-invite-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.ib-invite-chip[hidden] { display: none; }
.ib-invite-chip .link { background: none; border: 0; padding: 0; cursor: pointer; color: inherit; display: inline-flex; }
dialog.ib-invite-dlg { max-width: 460px; }
dialog.ib-invite-dlg .row > * { flex-basis: 120px; }
dialog.ib-invite-dlg input[type=time] { width: 100%; height: 44px; padding: 0 8px; border: 1px solid var(--n300); border-radius: 0; background: #fff; color: var(--ink); font: inherit; }
dialog.ib-invite-dlg input[type=date] { width: 100%; height: 44px; }
