/* Ollie app frame: sidebar, pages, lists, deals board, record pages, settings, sign-in.
   Colours and sizes come from the tokens in oli.css. */

.shell { display: flex; height: 100vh; overflow: hidden; background: var(--bg-2); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); border-left: 1px solid var(--border); }
.page { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.page-body { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; }
.small { font-size: 0.92rem; }
.num { font-variant-numeric: tabular-nums; }
.tags { display: inline-flex; gap: 4px; flex-wrap: wrap; }

/* Sidebar */
.sidebar { width: 220px; flex-shrink: 0; display: flex; flex-direction: column; gap: 4px; padding: 12px 8px; }
.brand { display: flex; align-items: center; gap: 8px; padding: 4px 8px 12px; color: var(--font); font-weight: 600; font-size: 1.08rem; }
.brand img { width: 22px; height: 22px; border-radius: 5px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px; border-radius: 4px; color: var(--font-2); font-weight: 500; }
.nav-item:hover { background: var(--hover); }
.nav-item.active { background: var(--accent-bg); color: var(--accent); }
.nav-item .icon { color: var(--font-3); }
.nav-item.active .icon { color: var(--accent); }
.nav-user { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px; margin-top: 4px; border: 0; border-radius: 4px; background: transparent; cursor: pointer; text-align: left; font-weight: 500; }
.nav-user:hover { background: var(--hover); }
.nav-user .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Top bar search */
.search { height: 26px; width: 220px; padding: 0 8px; border: 1px solid var(--border); border-radius: 4px; background: var(--bg); outline: none; }
.search:focus { border-color: var(--accent-border); box-shadow: 0 0 0 3px var(--accent-bg); }

/* Tables */
.table-page { display: flex; flex-direction: column; min-height: 0; }
.table-tools { display: flex; align-items: center; gap: 12px; padding: 8px 24px; }
.toggle { display: inline-flex; align-items: center; gap: 6px; color: var(--font-2); cursor: pointer; user-select: none; }
.page-body .t-table-wrap { border-top: 1px solid var(--border); }
.t-table th.sortable { cursor: pointer; user-select: none; }
.t-table th.sortable:hover { background: var(--hover); }
.t-table th.first, .t-table td.first { padding-left: 24px; }
.t-table td .t-cell { min-height: 32px; }
.t-table td.num { padding: 0 8px; text-align: left; font-weight: 600; }
.name-cell { display: flex; align-items: center; min-height: 32px; overflow: hidden; }
.group-label { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.t-table tr.stage-group td { font-weight: 500; }
.t-table tr.stage-group td.first { overflow: visible; position: relative; z-index: 1; }
.t-table tr.stage-group:hover td { background: var(--bg-3); }
.t-table tr.totals.grand td { background: var(--bg-2); height: 36px; border-top: 1px solid var(--border); }
.t-table.plain td { height: 40px; padding: 0 8px; }
.t-table.plain td.first, .t-table.plain th.first { padding-left: 16px; }
.notice { padding: 12px 24px; color: var(--font-3); }
.money-edit { display: flex; align-items: center; }
.money-edit .t-cell { flex: 1; }
.money-edit .currency { border: 0; background: transparent; color: var(--font-3); font-size: 0.85rem; cursor: pointer; padding: 0 6px; height: 24px; border-radius: 4px; }
.money-edit .currency:hover { background: var(--hover); color: var(--font-2); }

/* Deals board */
.board-page { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.board-summary { display: flex; align-items: center; gap: 24px; padding: 10px 24px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.board-summary strong { font-size: 1.08rem; }
.board { flex: 1; min-height: 0; display: flex; gap: 8px; padding: 12px 16px 16px; overflow-x: auto; background: var(--bg-2); }
.board-col { width: 272px; flex-shrink: 0; display: flex; flex-direction: column; border-radius: 8px; background: var(--bg-3); border: 1px solid transparent; transition: border-color 0.1s ease, background 0.1s ease; }
.board-col.drop { border-color: var(--accent-border); background: var(--accent-bg); }
.board-head { padding: 8px 10px 6px; }
.board-title { display: flex; align-items: center; gap: 6px; }
.board-title .prob { font-weight: 600; color: var(--font-2); background: var(--bg); border-radius: 4px; padding: 1px 6px; font-size: 0.92rem; }
.board-sums { display: flex; gap: 8px; margin-top: 6px; font-weight: 600; font-variant-numeric: tabular-nums; flex-wrap: wrap; }
.board-sums .muted { font-weight: 500; }
.board-cards { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 2px 8px 10px; }
.board-empty { color: var(--font-light); text-align: center; padding: 16px 0; }
.deal-card { background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03); }
.deal-card:hover { border-color: var(--border-strong); }
.deal-card[draggable='true'] { cursor: grab; }
.deal-card.dragging { opacity: 0.4; }
.deal-name { font-weight: 600; line-height: 1.35; }
.deal-meta { display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.deal-owner { display: flex; align-items: center; gap: 4px; font-size: 0.92rem; }

/* Record page */
.record-head .crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--font-3); font-weight: 500; }
.record-head .crumb:hover { color: var(--font); }
.record-layout { flex: 1; min-height: 0; display: flex; }
.record-panel { width: 380px; flex-shrink: 0; overflow-y: auto; border-right: 1px solid var(--border); padding: 16px 12px 32px; display: flex; flex-direction: column; gap: 2px; }
.record-name { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px; }
.record-title { font-size: 1.38rem; font-weight: 600; line-height: 1.3; word-break: break-word; }
.big-avatar { width: 36px; height: 36px; flex-shrink: 0; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: var(--accent-bg); color: var(--accent); }
.big-avatar.company { background: var(--orange-bg); color: var(--orange); }
.big-avatar.deal { background: var(--purple-bg); color: var(--purple); }
.record-title.editable { flex: 1; min-width: 0; }
.record-title.editable .t-cell { min-height: 36px; }
.record-panel .t-field { padding: 0 4px; }
.panel-meta { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border-light); opacity: 0.8; }
.record-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.record-tab { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; }
.record-full { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.embed-wrap { flex: 1; min-height: 0; display: flex; }
.embed { flex: 1; width: 100%; min-height: 480px; border: 0; background: var(--bg); }
.embed.full { height: 100%; }
.related { display: flex; flex-direction: column; }
.related-head { display: flex; align-items: center; gap: 8px; padding: 12px 24px; }

/* Notes */
.notes { display: flex; flex-direction: column; gap: 12px; padding: 16px 24px 32px; max-width: 820px; }
.note-composer { border: 1px solid var(--border); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.note-composer textarea { border: 0; outline: none; resize: vertical; min-height: 60px; background: transparent; }
.note-actions { display: flex; justify-content: flex-end; }
.note { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.note-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.note-body { white-space: pre-wrap; line-height: 1.5; color: var(--font-2); }

/* Settings */
.settings-body { flex: 1; overflow-y: auto; padding: 20px 24px 40px; display: flex; flex-direction: column; gap: 12px; max-width: 1100px; }
.settings-body > * { flex-shrink: 0; }
.settings-card { border: 1px solid var(--border); border-radius: 8px; padding: 16px; }
.settings-card.flush { padding: 0; overflow: hidden; }
.settings-card.flush .t-table { table-layout: auto; }
.settings-h { margin: 12px 0 0; font-size: 1rem; font-weight: 600; }
.settings-form { display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.settings-form label { display: flex; flex-direction: column; gap: 4px; color: var(--font-2); font-weight: 500; }
.settings-form input, .link-input { height: 32px; padding: 0 8px; border: 1px solid var(--border); border-radius: 4px; background: var(--bg); outline: none; }
.settings-form input:focus { border-color: var(--accent-border); box-shadow: 0 0 0 3px var(--accent-bg); }
.profile { display: flex; align-items: center; gap: 12px; }
.profile .t-avatar { width: 40px; height: 40px; font-size: 1rem; }
.profile-name { font-weight: 600; font-size: 1.08rem; }
.who { display: inline-flex; align-items: center; gap: 8px; }
.intro { margin: 0; }
.link-card { border: 1px solid var(--accent-border); background: var(--accent-bg); border-radius: 8px; padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.link-row { display: flex; gap: 6px; align-items: center; }
.link-input { flex: 1; font-family: ui-monospace, Menlo, monospace; font-size: 0.92rem; }

/* Sign-in */
.auth, .auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px 16px; background: var(--bg-2); }
.auth-card { width: 360px; max-width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 32px 28px 24px; display: flex; flex-direction: column; gap: 4px; }
.auth-logo { width: 44px; height: 44px; border-radius: 10px; margin-bottom: 12px; }
.auth-card h1 { margin: 0; font-size: 1.54rem; font-weight: 600; }
.auth-card > p { margin: 0 0 16px; }
.auth-card form { display: flex; flex-direction: column; gap: 12px; }
.auth-field { display: flex; flex-direction: column; gap: 4px; font-weight: 500; color: var(--font-2); }
.auth-field input { height: 36px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--bg); outline: none; font-size: 1rem; }
.auth-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.auth-field input[readonly] { background: var(--bg-3); color: var(--font-2); }
.t-btn.big { height: 36px; justify-content: center; font-size: 1rem; }
.auth-error { color: var(--danger); min-height: 1em; }
.auth-error:empty { display: none; }
.auth-hint { margin: 0; font-size: 0.92rem; }
.auth-foot { font-size: 0.92rem; }
.auth-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Second sign-in step and connecting assistants */
.code-input { font-size: 1.38rem !important; letter-spacing: 0.15em; text-align: center; font-variant-numeric: tabular-nums; }
.auth-steps { display: flex; flex-direction: column; gap: 12px; }
.auth-other { font-size: 0.92rem; text-align: center; }
.auth-card.wide { width: 460px; }
.auth-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.auth-actions .t-btn { flex: 1; }
.connect-logos { display: flex; align-items: center; gap: 10px; color: var(--font-3); margin-bottom: 12px; }
.connect-logos .auth-logo { margin: 0; }
.client-badge { width: 44px; height: 44px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--orange-bg); color: var(--orange); font-weight: 600; font-size: 1.38rem; }
.access-options { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 4px; }
.access-option { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.access-option:has(input:checked) { border-color: var(--accent); background: var(--accent-bg); }
.access-option.disabled { opacity: 0.5; cursor: not-allowed; }
.access-option input { margin-top: 3px; }
.access-option > span { display: flex; flex-direction: column; gap: 2px; }
.limits { margin: 8px 0; padding-left: 18px; line-height: 1.5; }

/* Settings: two-step sign-in, Claude */
.two-step { display: flex; flex-direction: column; gap: 0; padding: 0; overflow: hidden; }
.two-step-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border-light); }
.method { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border-light); }
.method:last-child { border-bottom: 0; }
.method > .icon { color: var(--font-3); flex-shrink: 0; }
.method.sub { padding-left: 44px; background: var(--bg-2); }
.setup { display: flex; gap: 20px; padding: 16px; border-bottom: 1px solid var(--border-light); background: var(--bg-2); flex-wrap: wrap; }
.qr { background: #fff; padding: 8px; border-radius: 8px; border: 1px solid var(--border); width: 200px; height: 200px; }
.qr svg { width: 100%; height: 100%; display: block; }
.setup-steps { display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 220px; }
.setup-steps ol { margin: 0; padding-left: 18px; line-height: 1.6; }
.secret { font-family: ui-monospace, Menlo, monospace; background: var(--bg-3); padding: 6px 8px; border-radius: 4px; word-break: break-all; }
.setup .code-input, .settings-card .code-input { width: 140px; height: 34px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--bg); font-size: 1.15rem !important; }
.codes-card { margin-bottom: 12px; }
.codes { margin: 0; padding: 10px 12px; background: var(--bg); border-radius: 6px; font-family: ui-monospace, Menlo, monospace; columns: 2; line-height: 1.7; }
.two-step-box { display: flex; flex-direction: column; }
td.actions { white-space: nowrap; }
td.actions .t-btn + .t-btn { margin-left: 4px; }
.steps { margin: 0; padding-left: 18px; line-height: 1.7; }
.steps code, .settings-card code { font-family: ui-monospace, Menlo, monospace; background: var(--bg-3); padding: 1px 5px; border-radius: 4px; font-size: 0.9em; }
.meters { display: flex; flex-direction: column; gap: 12px; }
.meter-label { display: flex; justify-content: space-between; margin-bottom: 4px; }
.meter-bar { height: 6px; border-radius: 3px; background: var(--bg-3); overflow: hidden; }
.meter-fill { height: 100%; background: var(--accent); border-radius: 3px; }
.meter-fill.high { background: var(--orange); }
.meter-fill.full { background: var(--red); }

/* Settings: access */
.pick { display: inline-flex; align-items: center; gap: 4px; border: 0; background: transparent; padding: 2px 4px; border-radius: 4px; cursor: pointer; color: var(--font-3); }
.pick:hover { background: var(--hover); }
.section-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.section-row .settings-h { margin: 0; }
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.group-card { display: flex; flex-direction: column; gap: 8px; }
.group-head { display: flex; align-items: center; gap: 8px; }
.group-row { display: flex; flex-direction: column; gap: 4px; }
.group-edit { display: flex; flex-direction: column; gap: 10px; border-color: var(--accent-border); }
.person-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 2px; border-radius: 12px; background: var(--bg-3); font-size: 0.92rem; }
.person-chip .t-avatar { width: 18px; height: 18px; font-size: 0.6rem; }
.person-chip.removable { cursor: pointer; }
.person-chip.removable:hover { background: var(--red-bg); color: var(--red); }
.field-label { display: flex; flex-direction: column; gap: 4px; color: var(--font-2); font-weight: 500; }
.text-input { height: 32px; padding: 0 8px; border: 1px solid var(--border); border-radius: 4px; background: var(--bg); outline: none; }
.text-input:focus { border-color: var(--accent-border); box-shadow: 0 0 0 3px var(--accent-bg); }
.sets-layout { display: flex; gap: 16px; align-items: flex-start; }
.set-list { width: 220px; flex-shrink: 0; display: flex; flex-direction: column; gap: 2px; }
.set-item { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; cursor: pointer; text-align: left; font-weight: 500; color: var(--font-2); }
.set-item:hover { background: var(--hover); }
.set-item.active { background: var(--hover-strong); color: var(--font); }
.set-list .t-btn { margin-top: 8px; align-self: flex-start; }
.set-editor { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.set-head { display: flex; gap: 12px; flex-wrap: wrap; }
.perm-table td.center, .perm-table th.center { text-align: center; width: 72px; }
.perm-table td { height: 36px; }

/* Tasks, mentions, notifications */
.brand-row { display: flex; align-items: center; padding-right: 4px; }
.brand-row .brand { padding-bottom: 4px; }
.bell { position: relative; border: 0; background: transparent; width: 30px; height: 30px; border-radius: 6px; color: var(--font-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.bell:hover { background: var(--hover); }
.bell-count { position: absolute; top: 2px; right: 1px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 8px; background: var(--red); color: #fff; font-size: 10px; font-weight: 600; line-height: 15px; text-align: center; }
.nav-item { position: relative; }
.nav-badge { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bg-4); color: var(--font-2); font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; }
.nav-badge.overdue { background: var(--red-bg); color: var(--red); }
.notif-panel { display: flex; flex-direction: column; max-height: 70vh; overflow-y: auto; }
.notif-head { display: flex; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--border-light); }
.link-btn { border: 0; background: transparent; color: var(--accent); cursor: pointer; padding: 0; }
.notif { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border: 0; border-bottom: 1px solid var(--border-light); background: transparent; text-align: left; cursor: pointer; width: 100%; }
.notif:hover { background: var(--hover); }
.notif.unread { background: var(--accent-bg); }
.notif-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notif-body { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tasks-page { padding: 8px 0 32px; }
.task-list { display: flex; flex-direction: column; }
.task-group { display: flex; align-items: center; gap: 8px; padding: 14px 24px 6px; font-weight: 600; color: var(--font-2); }
.task-group.overdue { color: var(--red); }
.task-row { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 24px; border-bottom: 1px solid var(--border-light); cursor: pointer; }
.task-row:hover { background: var(--bg-2); }
.task-row.done .task-title { text-decoration: line-through; color: var(--font-3); }
.task-check { width: 18px; height: 18px; flex-shrink: 0; border-radius: 50%; border: 1.5px solid var(--border-strong); background: var(--bg); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.task-check:hover { border-color: var(--green); }
.task-check.done { background: var(--green); border-color: var(--green); }
.task-main { flex: 1; min-width: 0; }
.task-title { font-weight: 500; }
.task-notes { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-target { flex-shrink: 0; max-width: 240px; overflow: hidden; }
.due { display: inline-flex; align-items: center; gap: 4px; color: var(--font-3); font-size: 0.92rem; white-space: nowrap; }
.due.overdue { color: var(--red); font-weight: 500; }
.task-assignee { flex-shrink: 0; }
.task-dialog { width: 520px; }
.task-fields { display: grid; grid-template-columns: 1.6fr 1fr 0.8fr; gap: 8px; }
.pick-person { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px; border: 1px solid var(--border); border-radius: 4px; background: var(--bg); cursor: pointer; text-align: left; }
.pick-person span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mention-box { position: relative; }
.mention-box textarea { width: 100%; box-sizing: border-box; min-height: 64px; border: 1px solid var(--border); border-radius: 6px; padding: 8px; background: var(--bg); outline: none; resize: vertical; }
.note-composer .mention-box textarea { border: 0; padding: 0; }
.mention-list { position: absolute; left: 8px; top: 100%; z-index: 50; min-width: 240px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-strong); padding: 4px; display: flex; flex-direction: column; }
.mention-list[hidden] { display: none; }
.mention-item { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px; border: 0; border-radius: 4px; background: transparent; cursor: pointer; text-align: left; }
.mention-item.active, .mention-item:hover { background: var(--hover-strong); }
.mention { color: var(--accent); background: var(--accent-bg); border-radius: 4px; padding: 0 3px; font-weight: 500; }
.note-head .t-avatar { width: 20px; height: 20px; }
.note-tools { display: inline-flex; }
.note-actions { align-items: center; gap: 8px; }
.record-tasks .task-row { padding-left: 24px; }

/* Campaign tab, integrations */
.deal-number { color: var(--font-3); font-variant-numeric: tabular-nums; font-weight: 500; }
.campaign { display: flex; flex-direction: column; gap: 12px; padding: 16px 24px 32px; max-width: 980px; }
.campaign-head { display: flex; align-items: center; gap: 12px; }
.campaign-number { font-size: 1.54rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.on-master { display: inline-flex; align-items: center; gap: 6px; color: var(--green); background: var(--green-bg); border-radius: 6px; padding: 6px 10px; font-weight: 500; }
.campaign .notice { padding: 10px 12px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--border-light); }
.campaign-card { border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.campaign-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 1.08rem; }
.cstats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 16px; }
.cstat-label { color: var(--font-3); font-size: 0.92rem; }
.cstat-value { font-weight: 500; margin-top: 2px; }
.cprogress { display: flex; gap: 16px; flex-wrap: wrap; color: var(--font-2); }
.integ { display: flex; flex-direction: column; gap: 10px; }
.integ-head { display: flex; align-items: center; gap: 8px; font-size: 1.08rem; }
.integ p { margin: 0; }
.mapping { display: flex; flex-direction: column; gap: 10px; }
.mapping-table select { width: 100%; }
.text-input.tall { height: auto; padding: 8px; font-family: ui-monospace, Menlo, monospace; resize: vertical; }
select.text-input { padding: 0 6px; }

/* Emails */
.emails { display: flex; flex-direction: column; padding: 8px 0 32px; }
.thread { border-bottom: 1px solid var(--border-light); }
.thread-head { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 6px 24px; border: 0; background: transparent; cursor: pointer; text-align: left; }
.thread-head:hover { background: var(--bg-2); }
.thread-head .icon { color: var(--font-3); flex-shrink: 0; }
.thread-subject { font-weight: 500; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-people { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.thread-body { padding: 4px 24px 16px 46px; display: flex; flex-direction: column; gap: 8px; }
.thread-body[hidden] { display: none; }
.mail { border: 1px solid var(--border-light); border-radius: 8px; padding: 10px 12px; }
.mail.out { background: var(--bg-2); }
.mail-head { display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; }
.mail-text { white-space: pre-wrap; margin-top: 8px; line-height: 1.5; color: var(--font-2); max-height: 420px; overflow: auto; }
.mail-tools { display: flex; gap: 12px; align-items: center; margin-top: 8px; }
.suggested .pad { padding: 12px 24px 0; }
.suggest-row { display: flex; align-items: center; gap: 12px; padding: 12px 24px; border-bottom: 1px solid var(--border-light); }
.suggest-title { display: flex; align-items: center; gap: 6px; }
.suggest-snippet { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 720px; }

/* Calls */
.calls { display: flex; flex-direction: column; padding-bottom: 32px; }
.call-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 24px; border-bottom: 1px solid var(--border-light); color: var(--font); }
.call-row:hover { background: var(--bg-2); }
.call-icon { width: 28px; height: 28px; border-radius: 50%; background: var(--sky-bg); color: var(--sky); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.call-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.call-title { display: flex; align-items: center; gap: 8px; }
.call-overview { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.call-links { display: flex; gap: 6px; flex-wrap: wrap; }
.call-detail { flex: 1; overflow-y: auto; padding: 20px 24px 40px; max-width: 900px; display: flex; flex-direction: column; gap: 12px; }
.call-detail h2 { margin: 0; font-size: 1.38rem; }
.call-detail h3 { margin: 8px 0 6px; font-size: 1rem; }
.call-detail .notes { padding: 12px 0 0; }
.call-people { display: flex; gap: 6px; flex-wrap: wrap; }
.person-chip.guest { background: var(--orange-bg); }
.call-text { white-space: pre-wrap; line-height: 1.55; color: var(--font-2); }
.call-detail .notice { padding: 10px 12px; border-radius: 6px; background: var(--orange-bg); color: var(--orange); }

/* Google sign-in */
.google-box { display: flex; flex-direction: column; gap: 12px; }
.google-box:empty { display: none; }
.auth-or { display: flex; align-items: center; gap: 10px; color: var(--font-3); font-size: 0.92rem; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.google-btn { gap: 10px; color: var(--font); font-weight: 500; }

@media (max-width: 760px) {
  .sidebar { width: 56px; padding: 12px 6px; }
  .sidebar .brand span, .nav-item span, .nav-user .grow, .nav-user .icon { display: none; }
  .record-layout { flex-direction: column; overflow-y: auto; }
  .record-panel { width: auto; border-right: 0; border-bottom: 1px solid var(--border); overflow: visible; }
  .search { width: 140px; }
}

/* Settings → Import */
.import-bar { height: 6px; border-radius: 3px; background: var(--t-background-tertiary, #eee); overflow: hidden; margin: 8px 0 12px; }
.import-bar > div { height: 100%; background: var(--t-color-blue, #3b82f6); transition: width 0.4s ease; }
.settings-card details { margin-top: 10px; }
.settings-card details ul { max-height: 240px; overflow: auto; }

/* List views and filters */
.view-picker { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px; margin-left: -4px; border: 0; border-radius: 4px; background: transparent; cursor: pointer; color: var(--font); font: inherit; }
.view-picker:hover { background: var(--hover); }
.view-picker .title { font-weight: 600; }
.view-picker .edited { font-size: 0.78rem; color: var(--font-3); background: var(--bg-3); border-radius: 4px; padding: 1px 5px; }
.list-controls { display: inline-flex; align-items: center; gap: 8px; }
.filter-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 40px; padding: 6px 24px; border-bottom: 1px solid var(--border); }
.filter-bar .grow { flex: 1; }
.filter-sep { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }
.filter-chip { display: inline-flex; align-items: center; height: 26px; border: 1px solid var(--accent-border); background: var(--accent-bg); border-radius: 13px; overflow: hidden; }
.filter-chip button { border: 0; background: transparent; cursor: pointer; font: inherit; color: var(--font); height: 100%; }
.filter-chip-label { padding: 0 4px 0 10px; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-chip-x { padding: 0 8px 0 4px; color: var(--font-3) !important; display: inline-flex; align-items: center; }
.filter-chip-x:hover { color: var(--font) !important; }
.group-select { height: 26px; border: 1px solid var(--border); border-radius: 4px; background: var(--bg); color: var(--font-2); padding: 0 6px; font: inherit; cursor: pointer; }
.filter-editor { display: flex; flex-direction: column; gap: 8px; padding: 10px; }
.filter-field { font-weight: 600; }
.filter-options { display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow: auto; }
.filter-option { display: flex; align-items: center; gap: 8px; padding: 3px 4px; border-radius: 4px; cursor: pointer; }
.filter-option:hover { background: var(--hover); }
.t-btn.small { height: 26px; padding: 0 8px; gap: 4px; }

/* Grouped tables: clear, collapsible sections */
.t-table thead th { position: sticky; top: 0; z-index: 2; background: var(--bg); }
.t-table.grouped tr.stage-group { cursor: pointer; }
.t-table.grouped tr.stage-group td { height: 40px; background: var(--bg-2); border-top: 12px solid var(--bg); border-bottom: 1px solid var(--border-strong, var(--border)); }
.t-table.grouped tr.stage-group:first-child td { border-top-width: 0; }
.t-table.grouped tr.stage-group .group-label .icon { color: var(--font-3); }
.t-table.grouped tr.stage-group.closed td { border-bottom-color: var(--border); }

/* Tasks: filter buttons and calendar */
.filter-pick { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 8px; border: 1px solid var(--border); border-radius: 13px; background: var(--bg); cursor: pointer; font: inherit; color: var(--font); white-space: nowrap; }
.filter-pick:hover { background: var(--hover); }
.filter-pick.on { border-color: var(--accent-border); background: var(--accent-bg); }
.filter-bar .search { width: 180px; }
.date-range { display: flex; align-items: center; gap: 6px; }
.date-range input { flex: 1; min-width: 0; }
.t-menu-item.selected { font-weight: 600; }
.cal { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 0 24px 16px; }
.cal-head { display: flex; align-items: center; gap: 8px; padding: 10px 0; }
.cal-head strong { font-size: 1.1rem; min-width: 150px; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: 28px; grid-auto-rows: minmax(110px, auto); border-left: 1px solid var(--border); border-top: 1px solid var(--border); }
.cal-dow { padding: 6px 8px; font-size: 0.85rem; color: var(--font-3); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); min-height: 0; background: var(--bg-2); }
.cal-day { display: flex; flex-direction: column; gap: 3px; padding: 4px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); cursor: pointer; min-width: 0; }
.cal-day:hover { background: var(--bg-2); }
.cal-day.other { background: var(--bg-2); color: var(--font-3); }
.cal-date { font-size: 0.85rem; padding: 2px 4px; color: var(--font-2); }
.cal-day.today .cal-date { align-self: flex-start; background: var(--accent); color: #fff; border-radius: 10px; padding: 1px 7px; font-weight: 600; }
.cal-task { display: flex; align-items: center; gap: 4px; width: 100%; padding: 2px 6px; border: 0; border-radius: 4px; background: var(--accent-bg); color: var(--font); font: inherit; font-size: 0.88rem; text-align: left; cursor: pointer; overflow: hidden; }
.cal-task span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-task .t-avatar { flex-shrink: 0; width: 16px; height: 16px; font-size: 0.6rem; }
.cal-task.overdue { background: var(--red-bg); color: var(--red); }
.cal-task.done { background: var(--bg-3); color: var(--font-3); text-decoration: line-through; }

/* Record pages: org chart band and the Activities feed */
.org-band { border-bottom: 1px solid var(--border); }
.org-band-head { display: flex; align-items: center; gap: 8px; width: 100%; height: 40px; padding: 0 16px; border: 0; background: var(--bg-2); cursor: pointer; font: inherit; color: var(--font); text-align: left; }
.org-band-head:hover { background: var(--bg-3); }
.org-band-head .muted { margin-left: auto; }
.org-band-body .embed { height: 380px; min-height: 380px; display: block; }
.activities { display: flex; flex-direction: column; }
.activity-filters { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--border-light); }
.activity-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg); color: var(--font-2); cursor: pointer; font: inherit; }
.activity-chip:hover { background: var(--hover); }
.activity-chip.on { border-color: var(--accent); background: var(--accent-bg); color: var(--accent); font-weight: 500; }
.activity-chip .t-count { font-size: 0.8rem; }
.activity-section { padding: 14px 16px 4px; font-weight: 600; color: var(--font-2); }
.activity-month { padding: 12px 16px 4px; font-size: 0.85rem; color: var(--font-3); text-transform: uppercase; letter-spacing: 0.04em; }
.activity-item { display: flex; gap: 10px; padding: 4px 16px; }
.activity-icon { flex-shrink: 0; width: 26px; height: 26px; margin-top: 8px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--bg-3); color: var(--font-2); }
.activity-item.email .activity-icon { background: var(--sky-bg); color: var(--sky); }
.activity-item.meeting .activity-icon { background: var(--purple-bg); color: var(--purple); }
.activity-item.note .activity-icon { background: var(--yellow-bg); color: var(--yellow); }
.activity-item.task .activity-icon { background: var(--green-bg); color: var(--green); }
.activity-body { flex: 1; min-width: 0; border: 1px solid var(--border-light); border-radius: 8px; overflow: hidden; background: var(--bg); }
.activity-body .note { border: 0; margin: 0; }
.activity-body .task-row { border-bottom: 0; padding-left: 12px; }
.activity-body .thread { border: 0; }
.activities .note-composer { margin: 12px 16px 0; }
.panel-group { display: flex; align-items: center; gap: 6px; margin: 16px 0 4px; padding-top: 12px; border-top: 1px solid var(--border-light); font-weight: 600; color: var(--font-2); }
.note-on { flex-shrink: 0; }
