/* ======================= Calendar, To Do, reminders, invites ======================= */
.cal-layout { display: flex; height: 100%; }
.cal-side { gap: 12px; }
.quick-wrap { padding: 0 4px; }
.quick-add { height: 38px; font-size: 13px; background: var(--panel); }
.side-scroll { flex: 1; overflow-y: auto; min-height: 0; }
.mini-cal { padding: 4px 6px; }
.mini-head { display: flex; align-items: center; gap: 2px; margin-bottom: 4px; }
.mini-head b { flex: 1; font-size: 13px; padding-left: 4px; }
.mini-head .icon-btn { width: 26px; height: 26px; }
.mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; text-align: center; }
.mini-wd { font-size: 10.5px; color: var(--muted); font-weight: 600; padding: 2px 0; }
.mini-day { border: 0; background: none; height: 27px; border-radius: 8px; font-size: 12px; color: var(--ink-2); }
.mini-day:hover { background: var(--hover); }
.mini-day.other { color: var(--muted); opacity: .6; }
.mini-day.inrange { background: var(--accent-soft); border-radius: 0; }
.mini-day.sel { background: var(--active); font-weight: 700; color: var(--ink); }
.mini-day.today { background: var(--accent); color: #fff; font-weight: 700; border-radius: 50%; }

.cal-main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--panel); margin-top: 8px; border-radius: 18px 0 0 0; border-left: 1px solid var(--line); position: relative; overflow: hidden; }
.cal-bar { display: flex; align-items: center; gap: 6px; padding: 12px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cal-title { margin: 0 0 0 6px; font-size: 19px; letter-spacing: -.01em; white-space: nowrap; }
.cal-views button { padding: 6px 11px; }
.cal-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }

/* Time grid */
.grid { display: flex; flex-direction: column; height: 100%; }
.grid-head, .allday, .grid-inner { display: grid; }
.grid-head { border-bottom: 1px solid var(--line); padding-right: 10px; }
.gh-corner { display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; }
.tz { font-size: 10px; color: var(--muted); }
.gh-day { border: 0; background: none; display: flex; flex-direction: column; align-items: center; padding: 8px 0 6px; gap: 2px; border-radius: 10px; }
.gh-day:hover { background: var(--hover); }
.gh-wd { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.gh-num { font-size: 21px; font-weight: 600; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: var(--ink-2); }
.gh-day.today .gh-wd { color: var(--accent-ink); }
.gh-day.today .gh-num { background: var(--accent); color: #fff; }
.allday { border-bottom: 1px solid var(--line); padding: 3px 10px 3px 0; gap: 2px 0; min-height: 30px; }
.ad-label { grid-column: 1; font-size: 10.5px; color: var(--muted); text-align: right; padding: 5px 8px 0 0; }
.ad-ev { margin: 0 3px; border: 0; border-radius: 6px; background: color-mix(in srgb, var(--c) 18%, var(--panel)); color: var(--ink); border-left: 3px solid var(--c); font-size: 12px; font-weight: 600; text-align: left; padding: 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid-body { flex: 1; overflow-y: scroll; position: relative; }
.grid-inner { position: relative; }
.hours { grid-column: 1; }
.hour-label { font-size: 10.5px; color: var(--muted); text-align: right; padding-right: 8px; transform: translateY(-7px); }
.day-col { position: relative; border-left: 1px solid var(--line); cursor: cell; }
.day-col.today { background: color-mix(in srgb, var(--accent) 3%, transparent); }
.slot { border-top: 1px solid var(--line); position: relative; }
.slot::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px dashed color-mix(in srgb, var(--line) 60%, transparent); }
.now-line { position: absolute; height: 2px; background: var(--red); z-index: 3; pointer-events: none; display: none; }
.now-line::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }
.ev { position: absolute; z-index: 2; border-radius: 8px; padding: 4px 7px; background: color-mix(in srgb, var(--c) 24%, var(--panel)); border-left: 4px solid var(--c); color: var(--ink); cursor: pointer; overflow: hidden; font-size: 12px; line-height: 1.3; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); transition: box-shadow .12s; user-select: none; touch-action: none; }
.ev:hover { box-shadow: var(--shadow); z-index: 4; }
.ev.short { padding: 1px 7px; }
.ev-title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; gap: 4px; align-items: center; }
.ev-title .ic { width: 12px; height: 12px; opacity: .7; }
.ev-time, .ev-loc { color: var(--ink-2); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-resize { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; cursor: ns-resize; }
.ev.dragging { opacity: .85; box-shadow: var(--shadow-lg); z-index: 10; cursor: grabbing; }
.ev.past, .ad-ev.past, .m-ev.past, .ag-ev.past { opacity: .6; }
.ev.tentative, .ad-ev.tentative, .m-ev.tentative { background-image: repeating-linear-gradient(45deg, transparent 0 6px, color-mix(in srgb, var(--c) 14%, transparent) 6px 12px); }
.ev.pending, .ad-ev.pending { border-style: dashed; border-width: 1px 1px 1px 3px; border-color: var(--c); background: var(--panel); }

/* Month */
.month { display: flex; flex-direction: column; height: 100%; }
.m-head { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--line); }
.m-head div { font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 8px 10px; text-transform: uppercase; letter-spacing: .04em; }
.m-grid { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); grid-template-rows: repeat(6, 1fr); min-height: 0; }
.m-cell { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px; display: flex; flex-direction: column; gap: 2px; min-height: 0; overflow: hidden; cursor: cell; }
.m-cell.other { background: var(--panel-2); }
.m-cell.other .m-num { color: var(--muted); }
.m-num { align-self: flex-start; border: 0; background: none; font-size: 12.5px; font-weight: 600; color: var(--ink-2); padding: 2px 6px; border-radius: 99px; }
.m-num:hover { background: var(--hover); }
.m-cell.today .m-num { background: var(--accent); color: #fff; }
.m-ev { display: flex; align-items: center; gap: 5px; border: 0; background: none; border-radius: 5px; padding: 1px 5px; font-size: 11.5px; text-align: left; min-width: 0; color: var(--ink); }
.m-ev:hover { background: var(--hover); }
.m-ev.block { background: color-mix(in srgb, var(--c) 18%, var(--panel)); font-weight: 600; }
.m-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex-shrink: 0; }
.m-time { color: var(--muted); flex-shrink: 0; }
.m-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-more { border: 0; background: none; font-size: 11px; font-weight: 600; color: var(--muted); text-align: left; padding: 0 5px; }

/* Agenda */
.agenda { overflow-y: auto; padding: 10px 22px 40px; }
.ag-day { display: flex; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.ag-date { width: 150px; display: flex; gap: 10px; align-items: center; flex-shrink: 0; font-size: 12.5px; color: var(--muted); }
.ag-date b { color: var(--ink-2); }
.ag-num { font-size: 28px; font-weight: 700; color: var(--ink-2); width: 44px; text-align: center; }
.ag-date.today .ag-num { color: var(--accent); }
.ag-list { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ag-ev { display: flex; align-items: center; gap: 12px; border: 0; background: none; padding: 8px 10px; border-radius: 10px; text-align: left; }
.ag-ev:hover { background: var(--hover); }
.ag-time { width: 130px; font-size: 12.5px; color: var(--ink-2); flex-shrink: 0; }
.ag-bar { width: 4px; align-self: stretch; border-radius: 4px; background: var(--c); }
.ag-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* Event card (popover) */
.ev-pop { position: fixed; z-index: 150; width: 360px; max-width: calc(100vw - 20px); max-height: calc(100vh - 20px); overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 10px 16px 16px; animation: pop .15s ease; }
.pop-head { display: flex; align-items: center; justify-content: space-between; }
.pop-color { width: 14px; height: 14px; border-radius: 4px; background: var(--c); }
.pop-tools { display: flex; }
.pop-tools .icon-btn { width: 30px; height: 30px; }
.pop-title { margin: 6px 0 12px; font-size: 18px; line-height: 1.3; }
.pop-row { display: flex; gap: 12px; align-items: flex-start; margin: 10px 0; font-size: 13.5px; }
.pop-row > .ic { color: var(--muted); margin-top: 1px; }
.pop-people { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.person { display: flex; align-items: center; gap: 8px; }
.person > span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-desc { white-space: pre-wrap; color: var(--ink-2); max-height: 160px; overflow-y: auto; }
.pop-rsvp { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.pop-rsvp > span { flex: 1; }
.btn.join { background: var(--green); color: #fff; border-color: transparent; }

/* Editor */
.modal.wide.editor-modal { width: min(720px, 100%); }
.editor { display: flex; flex-direction: column; gap: 4px; }
.ed-top { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.ed-title { font-size: 18px; font-weight: 600; height: 46px; }
.colors { display: flex; gap: 5px; flex-shrink: 0; }
.color-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid transparent; padding: 0; box-shadow: inset 0 0 0 2px var(--panel); }
.color-dot.on { border-color: var(--ink-2); }
.ed-row { display: flex; gap: 14px; align-items: flex-start; padding: 6px 0; }
.ed-row > .ic { margin-top: 11px; color: var(--muted); }
.ed-row > .input, .ed-row > div { flex: 1; min-width: 0; }
.ed-when { display: flex; flex-direction: column; gap: 8px; }
.ed-dates { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ed-dates .input[type=date] { width: 150px; }
.ed-dates .input[type=time] { width: 112px; }
.ed-flags { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ed-flags select { width: auto; flex: 1; max-width: 300px; }
.ed-ends { display: flex; gap: 6px; flex-wrap: wrap; }
.ed-ends .input { width: auto; }
.ed-pair { display: flex; gap: 8px; }
.ed-online { display: flex; gap: 8px; }
.ed-desc { height: 90px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.ed-guests { display: flex; flex-direction: column; gap: 6px; }
.recip-wrap { position: relative; }
.guests { display: flex; flex-direction: column; gap: 4px; }
.guest { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 8px; font-size: 13px; }
.guest:hover { background: var(--hover); }
.icon-btn.sm { width: 26px; height: 26px; font-size: 16px; }
.quick-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }

/* To Do */
.todo { display: flex; flex-direction: column; gap: 2px; padding: 0 2px; }
.todo .f-group { padding-top: 8px; }
.todo-add { height: 34px; font-size: 13px; margin-bottom: 4px; background: transparent; border-style: dashed; }
.task { display: flex; align-items: flex-start; gap: 8px; padding: 6px; border-radius: 9px; }
.task:hover { background: var(--hover); }
.task input { margin-top: 3px; accent-color: var(--accent); width: 15px; height: 15px; flex-shrink: 0; }
.task-main { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: left; border: 0; background: none; padding: 0; }
.task-title { font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.task.done .task-title { text-decoration: line-through; color: var(--muted); }
.task-meta { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 3px; }
.task-meta.overdue { color: var(--red); font-weight: 600; }
.task-mail { display: flex; align-items: center; gap: 6px; margin: -4px 0 12px; font-size: 13px; }
.task-mail .ic { width: 15px; height: 15px; color: var(--muted); }
.side-link.small { height: 30px; font-size: 12px; }

/* Reminders window */
.reminders { position: fixed; left: 86px; bottom: 18px; z-index: 90; width: 360px; max-width: calc(100vw - 24px); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; animation: up .25s ease; }
.rem-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--grad); color: #1a1205; }
.rem-head .link { color: #1a1205; }
.rem-list { max-height: 50vh; overflow-y: auto; }
.rem-item { display: flex; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); }
.rem-item:first-child { border-top: 0; }
.rem-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); flex-shrink: 0; }
.rem-ic.task { background: var(--ai-soft); color: var(--ai); }
.rem-main { flex: 1; min-width: 0; }
.rem-title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rem-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.rem-snooze { height: 30px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--panel); font-size: 12.5px; padding: 0 6px; }

/* Invite card in an email */
.invite-card { display: flex; gap: 14px; margin: 16px 0 4px; padding: 14px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); border-left: 4px solid var(--blue); }
.invite-card.cancelled { border-left-color: var(--red); }
.invite-card.cancelled .inv-title { text-decoration: line-through; }
.invite-card.busy { opacity: .6; pointer-events: none; }
.inv-date { width: 54px; height: 58px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; overflow: hidden; flex-shrink: 0; }
.inv-mon { width: 100%; text-align: center; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; text-transform: uppercase; padding: 2px 0; }
.inv-day { font-size: 22px; font-weight: 700; line-height: 34px; }
.inv-main { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.inv-kind { font-size: 11.5px; font-weight: 700; color: var(--blue); text-transform: uppercase; letter-spacing: .04em; display: flex; gap: 5px; align-items: center; }
.inv-title { font-size: 15.5px; }
.inv-main .join { align-self: flex-start; margin-top: 6px; }
.inv-actions { display: flex; align-items: center; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.inv-actions > span:first-child { margin-right: 6px; }
.inv-note { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; color: var(--ink-2); }
.inv-note .ic { color: var(--green); width: 16px; height: 16px; }

/* Today card in the empty reader */
.today-card { width: min(360px, 90%); margin-top: 22px; text-align: left; background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.tc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; color: var(--ink); }
.tc-head .ic { color: var(--accent); }
.tc-head .muted { margin-left: auto; }
.tc-ev { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 7px 6px; border-radius: 9px; text-align: left; font-size: 13px; color: var(--ink); }
.tc-ev:hover { background: var(--hover); }
.tc-time { width: 66px; color: var(--muted); font-size: 12px; flex-shrink: 0; }
.tc-bar { width: 3px; height: 18px; border-radius: 3px; background: var(--c, var(--line-2)); }

@media (max-width: 980px) {
  .cal-side { display: none; }
  .cal-main { margin: 0; border-radius: 0; border: 0; }
  .cal-views button { padding: 6px 8px; font-size: 12px; }
  .cal-views button[data-v="workweek"] { display: none; }
  .ag-day { flex-direction: column; gap: 6px; }
  .reminders { left: 12px; bottom: 74px; }
}
@media (max-width: 640px) {
  .cal-bar { padding: 10px 12px; }
  .cal-title { font-size: 15px; order: 5; width: 100%; margin: 4px 0 0; }
  .gh-num { width: 30px; height: 30px; font-size: 16px; }
  .ev-pop { left: 10px !important; right: 10px; width: auto; }
  .ed-dates .input[type=date] { width: 140px; }
}

/* ======================= Focused Inbox + Schedule send ======================= */
.focus-tabs { display: none; gap: 18px; border-bottom: 1px solid var(--line); margin: 0 -14px; padding: 0 16px; }
.focus-tabs.show { display: flex; }
.ftab { position: relative; border: 0; background: none; padding: 6px 2px 9px; font-weight: 600; font-size: 13.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.ftab:hover { color: var(--ink-2); }
.ftab.on { color: var(--ink); }
.ftab.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); }
.ftab-n { font-size: 11px; font-weight: 700; color: var(--accent-ink); background: var(--accent-soft); border-radius: 99px; padding: 1px 7px; }
.send-split { display: inline-flex; margin-right: 6px; }
.send-split .btn.send { margin-right: 0; border-radius: 10px 0 0 10px; }
.send-split .btn.send-more { border-radius: 0 10px 10px 0; padding: 0 9px; border-left: 1px solid rgba(26, 18, 5, .2); box-shadow: none; }
.sched-row { cursor: pointer; }
.sched-ic { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.sched-ic.failed { background: rgba(229, 72, 77, .12); color: var(--red); }
.sched-when { color: var(--accent-ink) !important; font-weight: 600; }

/* ======================= Rules + Automatic replies ======================= */
.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex-shrink: 0; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line-2); transition: .2s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: .2s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); }
.rules-list { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 12px; }
.rule { display: flex; align-items: center; gap: 12px; padding: 10px 8px 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.rule.off { opacity: .6; }
.rule-main { flex: 1; min-width: 0; }
.rule-main .small { overflow: hidden; text-overflow: ellipsis; }
.rule-tools { display: flex; }
.rule-tools .icon-btn { width: 30px; height: 30px; }
.small-empty { padding: 26px 10px; }
.rule-editor .field > span { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.input.inline { width: auto; height: 30px; padding: 0 6px; }
.rule-rows { display: flex; flex-direction: column; gap: 6px; }
.rule-row { display: flex; gap: 6px; align-items: center; }
.rule-row .input { flex: 1; min-width: 0; }
.rule-row select.input { flex: 0 1 200px; }
.link.small { font-size: 12.5px; align-self: flex-start; padding: 4px 0; }
.set-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.autoreply .big-check { align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.autoreply .big-check .switch { margin-top: 2px; }
.ar-fields { display: flex; flex-direction: column; gap: 10px; transition: opacity .2s; }
.autoreply.ar-off .ar-fields { opacity: .45; pointer-events: none; }
.ar-text { height: 150px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.ar-slot:empty { display: none; }
.ar-banner { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 10px 0; padding: 9px 12px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); font-size: 13px; font-weight: 600; }
.ar-banner > span { flex: 1; }
.img-banner.err { color: var(--red); }

/* ======================= Auto labels ======================= */
.cat-tag { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 700; padding: 1px 6px 1px 4px; border-radius: 6px; margin-right: 6px; vertical-align: 1px; letter-spacing: .01em; }
.cat-tag .ic { width: 11px; height: 11px; }
.c-blue { background: rgba(58, 116, 201, .12); color: #2f62ad; }
.c-gray { background: rgba(120, 115, 105, .14); color: var(--ink-2); }
.c-purple { background: rgba(124, 92, 214, .12); color: #6a4bc4; }
.c-teal { background: rgba(14, 165, 164, .12); color: #0b8584; }
.c-green { background: rgba(46, 138, 85, .12); color: #277548; }
.c-red { background: rgba(201, 71, 75, .13); color: #b23a3e; }
:root[data-theme="dark"] .c-blue, :root[data-theme="dark"] .c-purple, :root[data-theme="dark"] .c-teal, :root[data-theme="dark"] .c-green, :root[data-theme="dark"] .c-red { filter: brightness(1.6); }
.chips { flex-wrap: wrap; row-gap: 6px; }
.chip-sep { width: 1px; height: 18px; background: var(--line-2); align-self: center; margin: 0 2px; }
.cat-chip { height: 26px; font-size: 12px; border-color: transparent; }
.cat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 16px; }
.spam-banner { display: flex; align-items: center; gap: 12px; margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; background: rgba(201, 71, 75, .09); border: 1px solid rgba(201, 71, 75, .3); color: var(--ink); }
.spam-banner > .ic { color: var(--red); width: 22px; height: 22px; }
.spam-banner b { color: var(--red); }
.spam-slot:empty { display: none; }

/* ======================= Auto-sort ======================= */
.autosort .big-check { align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.autosort .big-check .switch { margin-top: 2px; }
.autosort.ar-off .ar-fields { opacity: .45; pointer-events: none; }
.sort-row { display: grid; grid-template-columns: 1fr auto 170px; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.sort-row .check { align-items: flex-start; }
.sort-row .check .ic { width: 17px; height: 17px; color: var(--muted); margin-top: 1px; }
.sort-name { height: 34px; }
.sort-result { display: flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 13px; color: var(--ink-2); }
.sort-result:empty { display: none; }
.sort-result .ic { color: var(--green); }
.sort-tip { display: flex; align-items: center; gap: 12px; margin: 10px 10px 0; padding: 12px 12px 12px 14px; border-radius: 14px; border: 1.5px solid transparent; background: linear-gradient(var(--panel), var(--panel)) padding-box, var(--grad) border-box; }
.sort-tip > .ic { color: var(--accent); }
@media (max-width: 640px) { .sort-row { grid-template-columns: 1fr; } }

/* ======================= AI reply approvals ======================= */
.ai-approve { position: fixed; top: 14px; right: 18px; z-index: 95; width: 430px; max-width: calc(100vw - 24px); max-height: calc(100vh - 28px); overflow-y: auto; background: var(--panel); border-radius: 18px; box-shadow: var(--shadow-lg); border: 1.5px solid transparent; background: linear-gradient(var(--panel), var(--panel)) padding-box, var(--ai-grad) border-box; animation: pop .25s ease; }
.approve-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 4px 16px; }
.approve-head > .ic { color: var(--ai); }
.approve-head .icon-btn { width: 28px; height: 28px; }
.draft-card { display: flex; flex-direction: column; gap: 8px; padding: 8px 16px 14px; transition: opacity .15s; }
.draft-card.busy { opacity: .55; pointer-events: none; }
.draft-head { display: flex; align-items: center; gap: 10px; }
.draft-head .tag { margin-left: 6px; }
.draft-subj { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.draft-why { display: flex; gap: 6px; align-items: flex-start; font-size: 12.5px; color: var(--ai); background: var(--ai-soft); border-radius: 9px; padding: 6px 9px; }
.draft-why .ic { margin-top: 2px; }
.draft-text { min-height: 120px; padding: 10px 12px; line-height: 1.55; resize: vertical; font-size: 13.5px; }
.redo-input { height: 34px; font-size: 13px; }
.draft-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.btn.send-approve { background: var(--grad); color: #1a1205; border: 0; box-shadow: 0 4px 14px rgba(255, 138, 61, .3); }
.reader-draft { margin: 16px 0 4px; border-radius: 14px; padding: 12px 0 0; border: 1.5px solid transparent; background: linear-gradient(var(--panel-2), var(--panel-2)) padding-box, var(--ai-grad) border-box; }
.reader-draft > .ai-card-head { padding: 0 16px; }
.reader-draft .draft-subj { max-width: 420px; }
@media (max-width: 640px) { .ai-approve { top: auto; bottom: 70px; right: 8px; left: 8px; width: auto; max-height: 70vh; } }

/* ======================= Admin ======================= */
.admin-layout { display: flex; height: 100%; }
.admin-brand { display: flex; align-items: center; gap: 10px; padding: 8px 14px 14px; font-size: 16px; }
.admin-brand .ic { color: var(--accent); width: 22px; height: 22px; }
.admin-main { flex: 1; min-width: 0; overflow-y: auto; background: var(--panel); margin-top: 8px; border-radius: 18px 0 0 0; border-left: 1px solid var(--line); }
.admin-page { max-width: 920px; padding: 26px 32px 60px; }
.admin-title { margin: 0 0 4px; font-size: 24px; letter-spacing: -.01em; }
.admin-card { margin-top: 18px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel-2); }
.admin-card h3 { margin: 0 0 14px; font-size: 15px; }
.admin-card h4 { margin: 18px 0 8px; font-size: 13px; color: var(--ink-2); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-top: 18px; }
.stat { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel-2); }
.stat > .ic { width: 22px; height: 22px; color: var(--accent); }
.stat-v { font-size: 20px; font-weight: 700; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 10px 16px; font-size: 13.5px; }
.kv > span:nth-child(odd) { color: var(--muted); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th { text-align: left; font-size: 11.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.admin-table td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: 0; }
.people-table .person { align-items: center; }
.people-table .tag { margin-left: 6px; }
.search-people { max-width: 340px; margin: 16px 0 6px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.btn-row .input { max-width: 320px; }
.grid2 { display: grid; grid-template-columns: 2fr 1fr; gap: 0 14px; }
.hint { margin-top: -2px; }
.test-result { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; font-size: 13px; }
.test-result:empty { display: none; }
.test-result .tag { margin-left: 4px; text-transform: none; }
.admin-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.admin-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); font-size: 13.5px; }
.admin-row .ic { color: var(--accent); width: 17px; height: 17px; }
.ai-status-line { display: flex; align-items: center; gap: 6px; }
@media (max-width: 980px) { .admin-side { display: none; } .admin-main { margin: 0; border-radius: 0; border: 0; } .admin-page { padding: 18px 16px 50px; } .kv { grid-template-columns: 1fr; } .people-table th:nth-child(3), .people-table td:nth-child(3), .people-table th:nth-child(5), .people-table td:nth-child(5) { display: none; } }
.admin-page .tag { text-transform: none; }

/* ======================= Event editor: AI + Find a time ======================= */
.ai-describe-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 8px 8px 12px; margin-bottom: 12px; border-radius: 14px; border: 1.5px solid transparent; background: linear-gradient(var(--panel-2), var(--panel-2)) padding-box, var(--ai-grad) border-box; }
.ai-describe-bar > .ic { color: var(--ai); }
.ai-describe { flex: 1; min-width: 220px; border: 0; background: transparent; height: 36px; padding: 0 4px; }
.ai-describe:focus { box-shadow: none; }
.ai-describe-state { flex-basis: 100%; padding-left: 26px; display: flex; align-items: center; gap: 4px; }
.ai-describe-state:empty { display: none; }
.slots:empty { display: none; }
.slots { display: flex; flex-direction: column; gap: 6px; }
.slot-chip { height: 30px; }
.ed-desc-wrap { position: relative; }
.ed-desc-wrap .ed-desc { width: 100%; padding-bottom: 40px; }
.agenda-btn { position: absolute; right: 8px; bottom: 10px; }
/* time fields were cut off ("05:30 p") */
.ed-dates .input[type=date] { width: 160px; }
.ed-dates .input[type=time] { width: 136px; }

/* ======================= Batch 1: cleaner header, For you, automations, external ======================= */
.filter-chip, .cat-on { display: inline-flex; align-items: center; gap: 5px; }
.filter-chip .ic, .cat-on .ic { width: 13px; height: 13px; }
.cat-on .x { margin-left: 2px; font-size: 14px; line-height: 1; opacity: .7; }
.chips { flex-wrap: nowrap; }
.folder.suggested .ic { color: var(--ai); }
.ai-count { background: var(--ai); color: #fff; border-radius: 99px; padding: 0 7px; font-size: 11px; line-height: 18px; }
.for-you { width: 100%; max-width: 760px; margin: 0 auto; padding: 34px 32px 40px; overflow-y: auto; height: 100%; }
.fy-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.fy-head h2 { margin: 0; font-size: 22px; letter-spacing: -.01em; }
.fy-head p { margin: 2px 0 0; }
.fy-logo { width: 46px; height: 46px; object-fit: contain; }
.fy-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.fy-slot:empty { display: none; }
.fy-slot:has(.today-card) { grid-column: 1 / -1; }
.fy-card, .fy-slot .today-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 16px; padding: 14px; width: 100%; margin: 0; }
.fy-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.fy-card-head .ic { color: var(--accent); width: 18px; height: 18px; }
.fy-card-head b { flex: 1; }
.fy-item { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 7px 6px; border-radius: 10px; text-align: left; }
.fy-item:hover { background: var(--hover); }
.fy-line { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fy-tip { text-align: center; margin-top: 22px; }
.mail-reader .reader-empty { display: none; }
.auto-list { display: flex; flex-direction: column; gap: 8px; }
.auto-card { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-2); }
.auto-card:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.auto-card .tag { margin-left: 8px; }
.auto-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--hover); color: var(--muted); flex-shrink: 0; }
.auto-ic.on { background: var(--accent-soft); color: var(--accent-ink); }
.ext-tag { margin-left: 8px; background: #fff4e0; color: #9a5b00; border: 1px solid #f1d39b; text-transform: none; vertical-align: 1px; }


/* ======================= Reply: AI draft in the composer ======================= */
.ai-drafting { margin-bottom: 10px; padding: 10px 12px; border-radius: 12px; border: 1.5px solid transparent; background: linear-gradient(var(--panel-2), var(--panel-2)) padding-box, var(--ai-grad) border-box; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.ai-drafting-head { display: flex; align-items: center; gap: 6px; }
.ai-drafting-head > .ic { color: var(--ai); width: 16px; height: 16px; }
.ai-shimmer { display: grid; gap: 7px; }
.ai-shimmer div { height: 10px; border-radius: 6px; background: linear-gradient(90deg, var(--ai-soft), color-mix(in srgb, var(--ai) 22%, transparent), var(--ai-soft)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.ai-shimmer div:nth-child(1) { width: 85%; } .ai-shimmer div:nth-child(2) { width: 95%; } .ai-shimmer div:nth-child(3) { width: 60%; }
.ai-drafting .quick-chips { margin: 0; align-items: center; }
.ai-drafting .chip { height: 26px; font-size: 12px; }
.kind-tag { white-space: nowrap; align-self: flex-start; margin-top: 1px; }

/* ======================= Admin tracker ======================= */
.budget-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.budget-track { height: 10px; border-radius: 10px; background: var(--line); overflow: hidden; }
.budget-track div { height: 100%; border-radius: 10px; background: var(--grad); }
.budget-track div.warn { background: #e0a800; }
.budget-track div.full { background: var(--red); }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.chart-bars { display: flex; align-items: flex-end; gap: 4px; height: 120px; border-bottom: 1px solid var(--line); }
.bar-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; position: relative; }
.bar { width: 100%; min-height: 2px; border-radius: 5px 5px 0 0; opacity: .85; transition: opacity .15s; }
.bar-col:hover .bar { opacity: 1; }
.bar-x { position: absolute; bottom: -18px; font-size: 10px; color: var(--muted); }
.chart { padding-bottom: 18px; }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-row .input { width: auto; flex: 1; min-width: 160px; }
.activity-table td { vertical-align: top; }
.warn-row td { background: #fdf3f2; }
.ev-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); margin-right: 8px; }
.ev-dot.signin { background: var(--green); } .ev-dot.signin_failed, .ev-dot.signin_blocked, .ev-dot.ip_locked { background: var(--red); }
.ev-dot.mail_sent, .ev-dot.reply_sent { background: var(--accent); } .ev-dot.admin_change, .ev-dot.admin_signout, .ev-dot.session_revoked { background: var(--ai); }
.announce { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 85; display: flex; align-items: center; gap: 10px; max-width: min(760px, calc(100vw - 24px)); padding: 8px 8px 8px 16px; border-radius: 14px; box-shadow: var(--shadow-lg); font-size: 13.5px; font-weight: 600; animation: pop .25s ease; }
.announce.info { background: #eaf1fb; color: #23508f; border: 1px solid #c6d8f2; }
.announce.warning { background: #fff4e0; color: #8a5200; border: 1px solid #f1d39b; }
.announce.success { background: #e9f6ee; color: #23683f; border: 1px solid #bfe2cc; }
.announce .icon-btn { width: 28px; height: 28px; color: inherit; }
.budget-line .btn.small { margin-left: auto; }

/* ---- Calendar: search, office hours, holidays, subscribe ---- */
.cal-search { width: 100%; height: 34px; padding-left: 36px; border-radius: 10px; font-size: 13px; }
.day-col .slot.off { background: color-mix(in srgb, var(--ink) 3.5%, transparent); }
.day-col.weekend .slot { background: color-mix(in srgb, var(--ink) 3%, transparent); }
.day-col.weekend .slot.off { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.side-foot .check { display: flex; align-items: center; gap: 8px; padding: 6px 12px; color: var(--ink-2); cursor: pointer; }
.side-foot .side-link { height: auto; min-height: 34px; padding: 6px 12px; font-size: 12.5px; text-align: left; line-height: 1.3; }
.search-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 10px; }
.agenda > .ag-ev { width: 100%; margin-bottom: 4px; }
.ag-ev.past { opacity: .6; }
.sub-steps { margin: 12px 0 8px; padding-left: 18px; font-size: 13px; line-height: 1.6; color: var(--ink-2); }

/* ---- Drive: selection, bulk bar, sharing ---- */
.d-card { position: relative; }
.d-sel { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; flex: none; }
.d-card .d-sel { position: absolute; top: 10px; left: 10px; z-index: 2; opacity: 0; transition: opacity .12s; }
.d-card:hover .d-sel, .d-card.selected .d-sel, .selecting .d-card .d-sel { opacity: 1; }
.d-tr .d-sel { margin-right: 4px; opacity: 0; }
.d-tr:hover .d-sel, .d-tr.selected .d-sel, .selecting .d-tr .d-sel { opacity: 1; }
.d-card.selected { outline: 2px solid var(--accent); outline-offset: -2px; background: color-mix(in srgb, var(--accent) 7%, var(--panel, #fff)); }
.d-tr.selected { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.bulk-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 36px; }
.bulk-bar .tb-sep { width: 1px; height: 20px; background: var(--line); margin: 0 2px; }
.btn.ghost.danger { color: #c4373b; background: none; }
.field-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0 4px; font-size: 13px; color: var(--ink-2); }
.field-row .input { width: auto; min-width: 150px; }
.people-add { display: flex; gap: 8px; margin: 12px 0 10px; }
.people-add .input { flex: 1; }
.people-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 30px; }
.chip.person { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 999px; background: var(--hover); font-size: 12.5px; }
.chip-x { border: 0; background: none; color: var(--muted); font-size: 16px; line-height: 1; padding: 0 4px; cursor: pointer; border-radius: 50%; }
.chip-x:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 8%, transparent); }

/* ---- UX review fixes ---- */
.empty-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.cal-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.side-label { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 4px 12px 6px; }
.cal-row { display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-radius: 10px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.cal-row:hover { background: var(--hover); }
.cal-row .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-row input { appearance: none; -webkit-appearance: none; width: 16px; height: 16px; flex: none; border-radius: 4px; border: 2px solid var(--c); background: transparent; display: grid; place-items: center; cursor: pointer; margin: 0; }
.cal-row input:checked { background: var(--c); }
.cal-row input:checked::after { content: ''; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.cal-row input:disabled { cursor: default; }
.cal-list .side-link.small { margin-top: 4px; color: var(--muted); }
/* Announcement: a top bar that pushes the app down (never covers headers), like Gmail / Outlook */
.announce { position: relative; top: auto; left: auto; transform: none; max-width: none; width: 100%; height: 40px; justify-content: center; border-radius: 0; box-shadow: none; border-width: 0 0 1px; animation: none; padding: 0 8px 0 16px; }
.announce > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body:has(> .announce) .shell { height: calc(100vh - 40px); }
