:root {
  --bg: #0b0b10;
  --panel: #14141c;
  --panel-2: #1c1c27;
  --border: #2a2a38;
  --text: #f1f1f5;
  --muted: #9a9aab;
  --accent: #c490ff;
  --accent-2: #ff7db8;
  --ok: #5fe1a0;
  --warn: #ffd36a;
  --bad: #ff7d7d;
  --p1: #ff7d7d;
  --p2: #ffd36a;
  --p3: #9adcff;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "SF Pro Text", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; min-height: 100dvh;
  font-size: 16px; line-height: 1.45;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; font-weight: 600; }
.error { color: var(--bad); }

/* Lock screen */
.lock-screen { min-height: 100dvh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 600px at 10% -10%, rgba(196,144,255,0.18), transparent),
              radial-gradient(800px 500px at 100% 100%, rgba(255,125,184,0.12), transparent),
              var(--bg);
}
.lock-card { background: var(--panel); border: 1px solid var(--border); border-radius: 22px;
  padding: 32px 26px; max-width: 400px; width: 100%; box-shadow: 0 30px 80px rgba(0,0,0,0.4);
}
.lock-card h1 { font-size: 28px; margin: 0 0 10px; }
.lock-card label { display: block; font-size: 13px; color: var(--muted); margin: 22px 0 8px; }
.lock-card input { width: 100%; padding: 16px; background: #0e0e16; border: 1px solid var(--border);
  color: var(--text); border-radius: 14px; font-size: 22px; letter-spacing: 0.12em; text-align: center;
}
.lock-card input:focus { outline: none; border-color: var(--accent); }
.lock-card button { width: 100%; margin-top: 16px; padding: 16px; font-size: 16px; }

/* Top bar */
.app { max-width: 1180px; margin: 0 auto; padding: 18px 18px 80px; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 14px; gap: 12px; }
.topbar h1 { font-size: 22px; margin: 0; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--muted); }
.dot.live { background: var(--ok); box-shadow: 0 0 0 4px rgba(95,225,160,0.15); animation: pulse 2.4s infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(95,225,160,0.15); }
  50%      { box-shadow: 0 0 0 6px rgba(95,225,160,0.05); }
}

/* Buttons */
button { font: inherit; cursor: pointer; border-radius: 12px; padding: 10px 14px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text); transition: transform .05s ease, background .15s, border-color .15s;
}
button:hover { background: var(--panel-2); }
button:active { transform: translateY(1px); }
button.primary { background: linear-gradient(180deg, var(--accent), #a370ff); border-color: transparent; color: #1a1027; font-weight: 700; padding: 14px 20px; font-size: 16px; }
button.primary:hover { filter: brightness(1.05); }
button.ghost { background: transparent; }
button.danger { color: var(--bad); border-color: rgba(255,125,125,0.4); }
button.danger:hover { background: rgba(255,125,125,0.08); }
button.warn { color: var(--warn); border-color: rgba(255,211,106,0.4); }

/* The big yes/no buttons on approval cards */
button.big-ok, button.big-no {
  flex: 1; min-width: 140px; padding: 16px 18px; font-size: 16px; font-weight: 700; border-radius: 14px;
}
button.big-ok {
  background: linear-gradient(180deg, #5fe1a0, #2bc285); color: #07261a; border: 0;
  box-shadow: 0 8px 20px rgba(95,225,160,0.2);
}
button.big-ok:hover { filter: brightness(1.05); }
button.big-no {
  background: rgba(255,125,125,0.08); color: var(--bad); border: 1px solid rgba(255,125,125,0.4);
}
button.big-no:hover { background: rgba(255,125,125,0.16); }
button.link-btn { background: transparent; color: var(--accent); border: 0; padding: 4px 0; font-size: 14px; text-decoration: underline; }
button.link-btn:hover { background: transparent; color: var(--accent-2); }

/* Hero */
.hero { margin-bottom: 14px; }
.hero-card { padding: 18px 20px; border-radius: 18px; border: 1px solid var(--border); background: var(--panel);
  display: grid; gap: 4px;
}
.hero-card.go { background: linear-gradient(135deg, rgba(255,211,106,0.12), rgba(255,125,184,0.08)); border-color: rgba(255,211,106,0.4); }
.hero-card.warm { background: linear-gradient(135deg, rgba(154,220,255,0.10), rgba(196,144,255,0.08)); border-color: rgba(154,220,255,0.35); }
.hero-card.calm { background: linear-gradient(135deg, rgba(95,225,160,0.10), rgba(154,220,255,0.06)); border-color: rgba(95,225,160,0.35); }
.hero-card.bad { background: linear-gradient(135deg, rgba(255,125,125,0.18), rgba(255,125,184,0.08)); border-color: rgba(255,125,125,0.5); }
.hero-eyebrow { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.hero-headline { font-size: 22px; font-weight: 700; line-height: 1.2; }
.hero-sub { color: var(--muted); font-size: 14px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: 10px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 14px; }
.stat strong { display: block; font-size: 26px; font-weight: 700; }
.stat span { color: var(--muted); font-size: 12px; }
.stat.warn strong { color: var(--warn); }
.stat.bad strong { color: var(--bad); }
.stat.ok strong { color: var(--ok); }

/* Tabs */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 16px; }
.tabs::-webkit-scrollbar { height: 0; }
.tab { white-space: nowrap; background: var(--panel); border: 1px solid var(--border); border-radius: 999px; padding: 10px 16px; font-size: 14px; color: var(--muted); font-weight: 600; }
.tab .tab-icon { margin-right: 4px; }
.tab.active { color: var(--text); background: linear-gradient(180deg, rgba(196,144,255,0.22), rgba(255,125,184,0.12)); border-color: rgba(196,144,255,0.6); }
.badge-pill { display: inline-block; background: var(--accent-2); color: #2a1019; border-radius: 999px; padding: 2px 8px; font-size: 11px; margin-left: 6px; font-weight: 700; }
.badge-pill[hidden] { display: none !important; }

/* Section heading */
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin: 8px 0 16px; flex-wrap: wrap; }
.section-heading h2 { font-size: 20px; margin: 0 0 4px; font-weight: 700; }
.section-heading p { margin: 0; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters input, .filters select { background: var(--panel); border: 1px solid var(--border); color: var(--text); padding: 10px 12px; border-radius: 12px; font: inherit; font-size: 14px; }
.filters input { min-width: 220px; }

/* Empty states */
.empty { padding: 36px 20px; text-align: center; color: var(--muted); background: var(--panel); border: 1px dashed var(--border); border-radius: 16px; font-size: 14px; }

/* Approvals */
.approval-list { display: grid; gap: 14px; }
.approval { background: var(--panel); border: 1px solid var(--border); border-radius: 18px; padding: 18px; }
.approval-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.approval-kind { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.approval-brand { font-size: 13px; color: var(--accent); margin-top: 8px; font-weight: 600; }
.approval h3 { margin: 6px 0 8px; font-size: 19px; line-height: 1.3; font-weight: 700; }
.approval-to { color: var(--muted); font-weight: 400; font-size: 15px; }
.approval-meta { color: var(--muted); font-size: 12px; margin-top: 12px; }
.actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

.status-pill { font-size: 11px; padding: 5px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.status-pending { background: rgba(255,211,106,0.12); color: var(--warn); border: 1px solid rgba(255,211,106,0.3); }
.status-approved { background: rgba(154,220,255,0.10); color: #9adcff; border: 1px solid rgba(154,220,255,0.3); }
.status-sent { background: rgba(95,225,160,0.12); color: var(--ok); border: 1px solid rgba(95,225,160,0.3); }
.status-rejected { background: rgba(255,125,125,0.12); color: var(--bad); border: 1px solid rgba(255,125,125,0.3); }
.status-failed { background: rgba(255,125,125,0.20); color: var(--bad); border: 1px solid rgba(255,125,125,0.5); }

/* Email preview block: looks like an email, not JSON */
.email-collapsed { max-height: 0; overflow: hidden; transition: max-height .25s ease; }
.email-collapsed.open { max-height: 1200px; margin-top: 10px; }
.email-block { background: #0d0d14; border: 1px solid var(--border); border-radius: 14px; padding: 0; overflow: hidden; }
.original-toggle { margin-left: 14px; }
.original-email-block { border-color: rgba(255, 182, 193, 0.32); }
.original-label-row { background: rgba(255, 182, 193, 0.08); }
.email-row { display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); align-items: baseline; }
.email-row .email-label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; min-width: 60px; font-weight: 700; }
.email-row .email-value { color: var(--text); font-size: 14px; word-break: break-word; }
.email-body { padding: 14px; white-space: pre-wrap; font-size: 14px; line-height: 1.55; color: var(--text); font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif; }

.exec-result { background: rgba(255,125,125,0.08); border: 1px solid rgba(255,125,125,0.3); border-radius: 10px; padding: 8px 12px; margin-top: 10px; font-size: 13px; color: var(--text); }
.reco { background: rgba(196,144,255,0.07); border: 1px solid rgba(196,144,255,0.25); border-radius: 12px; padding: 10px 14px; font-size: 14px; margin-top: 12px; color: #ead9ff; }

/* Brand (opportunity) cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 16px; cursor: pointer; transition: border-color .15s, transform .05s; }
.card:hover { border-color: rgba(196,144,255,0.5); transform: translateY(-1px); }
.card h3 { margin: 8px 0 6px; font-size: 17px; font-weight: 700; }
.card .meta { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 0; }
.badge { background: var(--panel-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; font-size: 11px; color: var(--muted); font-weight: 600; }
.badge.p1 { color: var(--p1); border-color: rgba(255,125,125,0.5); background: rgba(255,125,125,0.08); }
.badge.p2 { color: var(--p2); border-color: rgba(255,211,106,0.4); background: rgba(255,211,106,0.06); }
.badge.p3 { color: var(--p3); border-color: rgba(154,220,255,0.3); }
.badge-row { display: flex; gap: 6px; flex-wrap: wrap; }

/* Tables */
.table-card { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.table-card table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table-card th { text-align: left; font-weight: 700; padding: 14px 16px; background: #0e0e16; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; }
.table-card td { padding: 14px 16px; border-top: 1px solid var(--border); vertical-align: top; }
.table-card tr:hover td { background: var(--panel-2); cursor: pointer; }

/* History rows */
.audit-list { display: grid; gap: 6px; }
.audit-row { display: flex; gap: 12px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; align-items: center; }
.audit-icon { font-size: 18px; width: 28px; text-align: center; }
.audit-text { flex: 1; }
.audit-text .audit-ts { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.65); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal-card { background: var(--panel); border: 1px solid var(--border); border-radius: 20px; padding: 24px; max-width: 700px; width: 100%; max-height: 90dvh; overflow: auto; position: relative; }
.modal-close { position: absolute; top: 12px; right: 12px; background: transparent; border: 0; color: var(--muted); font-size: 28px; padding: 4px 10px; line-height: 1; }
.modal h2 { margin: 0 0 8px; font-size: 22px; }
.modal label { display: block; font-size: 13px; color: var(--muted); margin: 16px 0 6px; font-weight: 600; }
.modal input, .modal textarea, .modal select { width: 100%; padding: 12px 14px; background: #0d0d14; border: 1px solid var(--border); border-radius: 12px; color: var(--text); font: inherit; font-size: 15px; }
.modal textarea { min-height: 180px; font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif; line-height: 1.5; }
.modal-actions { display: flex; gap: 8px; margin-top: 20px; justify-content: flex-end; flex-wrap: wrap; }

/* Toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--panel-2); border: 1px solid var(--border); padding: 12px 20px; border-radius: 999px; color: var(--text); font-size: 14px; z-index: 60; box-shadow: 0 16px 40px rgba(0,0,0,0.5); max-width: 92%; text-align: center; }
.toast.ok { border-color: rgba(95,225,160,0.4); }
.toast.bad { border-color: rgba(255,125,125,0.5); }
.toast .toast-msg { margin-right: 10px; }
.toast .toast-action {
  background: var(--accent);
  color: #1a1027;
  border: 0;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  margin-left: 4px;
  cursor: pointer;
}
.toast .toast-action:hover { filter: brightness(1.1); }

/* Refresh button */
button.refresh {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(180deg, rgba(154,220,255,0.18), rgba(196,144,255,0.10));
  border-color: rgba(154,220,255,0.4); color: var(--text); font-weight: 600;
}
button.refresh:hover { filter: brightness(1.05); }
button.refresh .refresh-icon { display: inline-block; transition: transform .35s ease; }
button.refresh.loading .refresh-icon { animation: spin 1.1s linear infinite; }
button.refresh.ok { border-color: rgba(95,225,160,0.45); }
button.refresh.bad { border-color: rgba(255,125,125,0.5); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 640px) {
  button.refresh .refresh-label { display: none; }
}

/* Refresh banner */
.refresh-banner {
  border-radius: 12px; padding: 10px 14px; font-size: 14px; margin: 0 0 12px;
  background: var(--panel); border: 1px solid var(--border); color: var(--text);
}
.refresh-banner.checking { background: rgba(154,220,255,0.10); border-color: rgba(154,220,255,0.4); color: #d4ecff; }
.refresh-banner.good     { background: rgba(95,225,160,0.10); border-color: rgba(95,225,160,0.4); color: #c8f5dd; }
.refresh-banner.calm     { background: var(--panel-2); }
.refresh-banner.warn     { background: rgba(255,211,106,0.10); border-color: rgba(255,211,106,0.4); color: #ffe6a8; }
.refresh-banner.bad      { background: rgba(255,125,125,0.10); border-color: rgba(255,125,125,0.5); color: #ffc6c6; }

/* Inbox & Replies tabs share these styles */
.vet-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; font-size: 13px; }
.vet-row.muted { font-style: italic; }
.vet-link {
  background: rgba(154,220,255,0.08); border: 1px solid rgba(154,220,255,0.3);
  color: #d4ecff; padding: 4px 10px; border-radius: 999px; text-decoration: none;
}
.vet-link:hover { background: rgba(154,220,255,0.16); }
button.small.reply-mode {
  font-size: 12px; padding: 7px 12px; border-radius: 10px; font-weight: 700;
}
button.primary.small.reply-mode { padding: 7px 14px; }
button.small.reply-mode[disabled] { opacity: 0.5; cursor: wait; }
.replies-list { display: grid; gap: 18px; }
.reply-group h3 { font-size: 17px; margin: 4px 0 4px; }
.reply-group-sub { font-size: 13px; margin: 0 0 10px; }
.reply-group-count { color: var(--muted); font-weight: 500; font-size: 13px; margin-left: 4px; }
.reply-cards { display: grid; gap: 10px; }
.reply-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px;
  display: grid; gap: 6px;
}
.reply-card.unread { border-color: rgba(255,211,106,0.5); }
.reply-card.fading-out { opacity: 0; transform: scale(0.97); transition: opacity .25s ease, transform .25s ease; pointer-events: none; }
.reply-card:not(.unread) { opacity: 0.85; }
.reply-card-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.reply-brand { font-weight: 700; font-size: 16px; }
.reply-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.reply-meta { color: var(--muted); font-size: 12px; }
.reply-subject { font-size: 15px; margin: 4px 0 0; }
.reply-snippet { margin: 0; color: var(--text); font-size: 14px; opacity: 0.9; }
.reply-actions-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.reply-rec-action { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); font-weight: 700; }
.reply-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.reply-actions .small { padding: 6px 10px; font-size: 12px; border-radius: 10px; }
.reply-actions .primary.small { padding: 6px 10px; font-size: 12px; }
.badge.classification-new_lead { color: var(--ok); border-color: rgba(95,225,160,0.4); background: rgba(95,225,160,0.08); }
.badge.classification-brand_reply { color: #9adcff; border-color: rgba(154,220,255,0.4); background: rgba(154,220,255,0.08); }
.badge.classification-follow_up { color: var(--warn); border-color: rgba(255,211,106,0.4); background: rgba(255,211,106,0.08); }
.badge.classification-review_only { color: var(--muted); }

/* Portals */
.portal-notice {
  background: rgba(154,220,255,0.06); border: 1px solid rgba(154,220,255,0.25);
  border-radius: 12px; padding: 12px 16px; margin: 0 0 14px; color: #d4ecff; font-size: 13px;
}
.portal-url { font-size: 12px; }
.badge.session-needs_diana_login { color: var(--warn); border-color: rgba(255,211,106,0.5); background: rgba(255,211,106,0.10); }
.badge.session-connected { color: var(--ok); border-color: rgba(95,225,160,0.45); background: rgba(95,225,160,0.08); }
.badge.session-session_expired { color: var(--bad); border-color: rgba(255,125,125,0.5); background: rgba(255,125,125,0.10); }
.badge.session-password_reset_needed { color: var(--bad); border-color: rgba(255,125,125,0.5); }
.badge.session-campaign_review_needed { color: var(--warn); border-color: rgba(255,211,106,0.4); background: rgba(255,211,106,0.06); }
.badge.session-not_connected { color: var(--muted); }

/* PR Packages lifecycle */
.badge.lifecycle-content_due { color: var(--bad); border-color: rgba(255,125,125,0.5); background: rgba(255,125,125,0.10); }
.badge.lifecycle-awaiting_address_approval { color: var(--warn); border-color: rgba(255,211,106,0.4); background: rgba(255,211,106,0.06); }
.badge.lifecycle-shipped { color: #9adcff; border-color: rgba(154,220,255,0.4); }
.badge.lifecycle-received { color: var(--ok); border-color: rgba(95,225,160,0.4); background: rgba(95,225,160,0.06); }
.badge.lifecycle-completed { color: var(--muted); }
.badge.lifecycle-declined { color: var(--muted); opacity: 0.6; }

/* Brand drawer (opportunity detail modal) */
.brand-quick { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 6px 0 14px; color: var(--muted); font-size: 13px; }
.brand-quick span { display: inline-block; }
.brand-quick strong { color: var(--text); }
.brand-quick a { color: var(--accent); text-decoration: none; }
.brand-section { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.brand-section h3 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 700; margin: 0 0 10px; }
.brand-section h3 .muted { font-weight: 500; text-transform: none; letter-spacing: 0; }
.brand-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.brand-list li { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.brand-list-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.brand-snippet { margin: 6px 0 0; color: var(--text); font-size: 13px; opacity: 0.9; }
.brand-counters { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* Modal grid helper */
.modal-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; align-items: flex-end; }
@media (max-width: 520px) { .modal-grid-2 { grid-template-columns: 1fr; } }
.modal label.checkbox {
  margin: 6px 0 0; font-size: 13px; color: var(--text);
  display: flex; align-items: center; gap: 8px; cursor: pointer;
}
.modal label.checkbox input { width: auto; padding: 0; }

.last-checked {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.last-checked.fresh { color: var(--ok); }
.last-checked.stale { color: var(--warn); }

/* Inline "Quote this deal" form on a brand card */
.quote-form {
  width: 100%;
  display: grid;
  gap: 8px;
  background: var(--panel-2);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 12px 14px;
}
.quote-form-label {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}
.quote-form-input {
  width: 100%;
  resize: vertical;
  min-height: 72px;
  font: inherit;
  font-size: 14px;
  line-height: 1.45;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
}
.quote-form-input:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.quote-form-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Audit detail */
.audit-detail { color: var(--text); opacity: 0.85; font-size: 13px; margin-top: 2px; }

/* Pipeline */
.pipeline-totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}
.totals-tile {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.totals-tile.warn {
  border-color: rgba(255,211,106,0.4);
  background: linear-gradient(135deg, rgba(255,211,106,0.10), transparent);
}
.totals-label {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}
.totals-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}
.totals-value.diana {
  color: var(--ok);
}

.pipeline-lanes {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.pipeline-lane {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px 8px 14px 14px;
}
.pipeline-lane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px 12px;
}
.pipeline-lane-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.pipeline-lane-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-snap-type: x proximity;
}
.pipeline-lane-scroll::-webkit-scrollbar { height: 6px; }
.pipeline-lane-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.pipeline-col {
  min-width: 240px;
  max-width: 260px;
  flex: 0 0 auto;
  background: #0e0e16;
  border: 1px solid var(--border);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  max-height: 70vh;
  scroll-snap-align: start;
}
.pipeline-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.pipeline-col-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}
.pipeline-col-count {
  background: var(--panel-2);
  color: var(--muted);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
}
.pipeline-col-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  overflow-y: auto;
}
.pipeline-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 8px 4px;
  text-align: center;
}

.pipeline-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pipeline-card .card-top {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}
.pipeline-card .brand-link {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.pipeline-card .brand-link:hover {
  color: var(--accent);
}
.pipeline-card .card-money {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pipeline-card .money-gross {
  font-size: 18px;
  font-weight: 700;
  color: var(--ok);
}
.pipeline-card .money-split {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.02em;
}
.pipeline-card .money-split.direct {
  color: var(--accent);
}
.pipeline-card .card-money.empty button.edit-fee {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--muted);
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 8px;
}
.pipeline-card .card-money.empty button.edit-fee:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.pipeline-card .card-deliverables {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}
.pipeline-card .card-meta {
  font-size: 11px;
  color: var(--muted);
}
.pipeline-card .card-meta .overdue {
  color: var(--bad);
  font-weight: 700;
}
.pipeline-card .card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.pipeline-card .card-actions button {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 8px;
}
.pipeline-card .advance-btn {
  background: linear-gradient(180deg, rgba(196,144,255,0.18), rgba(255,125,184,0.08));
  border-color: rgba(196,144,255,0.5);
  color: var(--text);
  font-weight: 600;
}
.pipeline-card .advance-btn:hover { filter: brightness(1.1); }
.pipeline-card .toggle-kind {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
  font-size: 11px;
}
.pipeline-card .toggle-kind:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.pipeline-card .card-final {
  color: var(--muted);
  font-size: 11px;
  font-style: italic;
}

.flag-badge {
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 8px;
  letter-spacing: 0.02em;
}
.flag-badge.sev-high { background: rgba(255,125,125,0.18); color: var(--bad); border: 1px solid rgba(255,125,125,0.4); }
.flag-badge.sev-medium { background: rgba(255,211,106,0.16); color: var(--warn); border: 1px solid rgba(255,211,106,0.4); }
.flag-badge.sev-low { background: rgba(154,220,255,0.14); color: var(--p3); border: 1px solid rgba(154,220,255,0.4); }

.prio-pill {
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 7px;
  letter-spacing: 0.04em;
}
.prio-pill.prio-P1 { background: rgba(255,125,125,0.16); color: var(--p1); }
.prio-pill.prio-P2 { background: rgba(255,211,106,0.16); color: var(--p2); }
.prio-pill.prio-P3 { background: rgba(154,220,255,0.16); color: var(--p3); }

.stale {
  font-size: 10px;
  color: var(--warn);
  background: rgba(255,211,106,0.10);
  border-radius: 999px;
  padding: 2px 7px;
  letter-spacing: 0.02em;
}

/* Today feed */
.today-feed {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.today-section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.today-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.today-section-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}
.today-section-count {
  background: var(--panel-2);
  color: var(--muted);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  margin-left: 4px;
}
.today-card.mini {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.today-card.mini.sev-high { border-color: rgba(255,125,125,0.4); }
.today-card.mini.sev-medium { border-color: rgba(255,211,106,0.4); }
.today-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}
.today-reason {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
}
.today-reason.sev-high { color: var(--bad); }
.today-reason.sev-medium { color: var(--warn); }
.today-brand {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.today-brand:hover { color: var(--accent); }
.today-card-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
}

/* Rates editor */
.rate-card-editor {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin: 16px 0;
}
.rate-group-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
}
.rate-group-hint {
  margin: 0 0 8px;
  font-size: 12px;
}
.rate-table {
  width: 100%;
  border-collapse: collapse;
}
.rate-table tr {
  border-top: 1px solid var(--border);
}
.rate-table tr:first-child { border-top: 0; }
.rate-table tr.disabled td { opacity: 0.5; }
.rate-table td {
  padding: 10px 6px;
  vertical-align: middle;
}
.rate-label {
  font-size: 14px;
  font-weight: 600;
}
.rate-label .rate-sub {
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
  margin-top: 2px;
}
.rate-input-cell {
  width: 50%;
  position: relative;
}
.rate-prefix {
  display: inline-block;
  width: 16px;
  color: var(--muted);
  font-weight: 700;
  margin-right: 4px;
}
.rate-input {
  background: #0e0e16;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  width: 100%;
  max-width: 200px;
  font: inherit;
}
.rate-input:focus { outline: 2px solid var(--accent); outline-offset: -2px; border-color: var(--accent); }
.rate-input.rate-notes { max-width: 100%; }
.rate-toggle-cell {
  width: 80px;
  text-align: right;
}
.rate-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
}

/* Red-flag popover */
.flag-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 12px 0;
}
.flag-item {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.flag-item.sev-high { border-color: rgba(255,125,125,0.4); }
.flag-item.sev-medium { border-color: rgba(255,211,106,0.4); }
.flag-item.sev-low { border-color: rgba(154,220,255,0.35); }
.flag-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.flag-label {
  font-weight: 700;
  font-size: 14px;
}
.flag-sev {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 2px 8px;
}
.flag-sev.sev-high { background: rgba(255,125,125,0.18); color: var(--bad); }
.flag-sev.sev-medium { background: rgba(255,211,106,0.16); color: var(--warn); }
.flag-sev.sev-low { background: rgba(154,220,255,0.14); color: var(--p3); }
.flag-snippet {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  background: #0e0e16;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
}
.flag-counter {
  font-size: 13px;
  line-height: 1.4;
}
.flag-counter strong { color: var(--accent); }
.flag-copy {
  align-self: flex-start;
}

/* Quote preview */
.quote-preview {
  margin-top: 8px;
  background: #0e0e16;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.quote-preview-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 6px;
}
.quote-preview-subject {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}
.quote-preview-body {
  font-size: 13px;
  color: var(--text);
  white-space: pre-wrap;
  line-height: 1.45;
  max-height: 240px;
  overflow-y: auto;
}

/* Pipeline card buttons that look like text */
.pipeline-card .money-gross,
.pipeline-card .money-split {
  background: transparent;
  border: 0;
  padding: 0;
  text-align: left;
  cursor: pointer;
}
.pipeline-card .money-gross { color: var(--ok); font-size: 18px; font-weight: 700; }
.pipeline-card .money-gross:hover { background: transparent; filter: brightness(1.1); }
.pipeline-card .money-split { font-size: 11px; }
.pipeline-card .money-split:hover { color: var(--accent); background: transparent; }

/* Scheduled badge + schedule form */
.scheduled-badge {
  background: linear-gradient(135deg, rgba(154,220,255,0.14), rgba(196,144,255,0.08));
  border: 1px solid rgba(154,220,255,0.4);
  border-radius: 12px;
  padding: 8px 14px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--p3);
  display: flex;
  align-items: center;
  gap: 10px;
}
.scheduled-badge .link-btn { color: var(--muted); font-size: 12px; }
.scheduled-badge .link-btn:hover { color: var(--bad); }

.schedule-form {
  background: #0e0e16;
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.schedule-form-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
}
.schedule-form-input {
  background: #0e0e16;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
}
.schedule-form-presets {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.schedule-form-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Pipeline card payment chip */
.card-payment {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  align-self: flex-start;
  letter-spacing: 0.02em;
}
.card-payment.sev-high { background: rgba(255,125,125,0.14); color: var(--bad); border: 1px solid rgba(255,125,125,0.4); }
.card-payment.sev-medium { background: rgba(255,211,106,0.12); color: var(--warn); border: 1px solid rgba(255,211,106,0.4); }
.card-payment.sev-low { background: rgba(95,225,160,0.14); color: var(--ok); border: 1px solid rgba(95,225,160,0.4); }

/* Bulk cleanup modal */
.cleanup-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 14px 0;
  padding: 10px 14px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  flex-wrap: wrap;
}
.cleanup-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}
.cleanup-count { color: var(--muted); font-size: 12px; flex: 1; }
.cleanup-list {
  display: flex;
  flex-direction: column;
  max-height: 50vh;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.cleanup-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.cleanup-row:last-child { border-bottom: 0; }
.cleanup-row:hover { background: var(--panel-2); }
.cleanup-row-body { display: flex; flex-direction: column; gap: 2px; }
.cleanup-row-body strong { font-size: 14px; }
.cleanup-row-body .muted { font-size: 11px; }

/* Reports */
.reports-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}
.reports-section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 16px;
}
.reports-section h3 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
}
.reports-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.reports-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
}
.reports-table td {
  padding: 10px 6px;
  border-bottom: 1px solid var(--border);
}
.reports-table tr:last-child td { border-bottom: 0; }
.reports-table .diana-net { color: var(--ok); font-weight: 700; }

/* Approval card primary/secondary action layout */
.actions-primary {
  display: flex;
  margin-top: 14px;
}
.actions-primary .big-ok {
  flex: 1;
  font-size: 17px;
  padding: 16px 20px;
}
.actions-secondary {
  display: flex;
  gap: 18px;
  margin: 10px 2px 0;
  flex-wrap: wrap;
  align-items: center;
}
.actions-secondary .link-btn {
  color: var(--muted);
  font-size: 13px;
  padding: 4px 0;
  text-decoration: none;
  font-weight: 600;
}
.actions-secondary .link-btn:hover {
  color: var(--text);
}
.actions-secondary .link-btn-danger {
  color: var(--bad);
  opacity: 0.75;
}
.actions-secondary .link-btn-danger:hover {
  color: var(--bad);
  opacity: 1;
  text-decoration: underline;
}

/* Brand modal — flag banner + deal section + deliverables */
.brand-flag-banner {
  background: linear-gradient(135deg, rgba(255,125,125,0.14), rgba(255,211,106,0.06));
  border: 1px solid rgba(255,125,125,0.4);
  border-radius: 14px;
  padding: 12px 14px;
  margin: 14px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.brand-flag-banner-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.brand-flag-icon { font-size: 18px; }
.brand-flag-banner-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Brand intelligence panel — quick-read negotiation context. */
.brand-intel-panel {
  background: linear-gradient(135deg, rgba(120,170,255,0.10), rgba(110,90,200,0.06));
  border: 1px solid rgba(120,170,255,0.28);
  border-radius: 14px;
  padding: 12px 14px;
  margin: 14px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.brand-intel-head {
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.brand-intel-head strong { color: var(--text); letter-spacing: 0.04em; }
.brand-intel-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.intel-pill {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
}
.intel-pill.good {
  background: rgba(110,210,140,0.14);
  border-color: rgba(110,210,140,0.4);
  color: #b7f1c5;
}
.intel-pill.muted { color: var(--muted); }

/* Inline intel row on inbox/replies/today brand-email-cards. */
.intel-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 6px 0 2px;
}
.rate-floor {
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 9px;
  border: 1px solid var(--border);
  white-space: nowrap;
}
.rate-floor.rate-good {
  background: rgba(110,210,140,0.15);
  border-color: rgba(110,210,140,0.5);
  color: #c0f5ce;
}
.rate-floor.rate-warm {
  background: rgba(255,211,106,0.14);
  border-color: rgba(255,211,106,0.5);
  color: #ffde9d;
}
.rate-floor.rate-warn {
  background: rgba(255,160,90,0.16);
  border-color: rgba(255,160,90,0.55);
  color: #ffcfa6;
}
.rate-floor.rate-bad {
  background: rgba(255,110,110,0.18);
  border-color: rgba(255,110,110,0.55);
  color: #ffc5c5;
}
.rate-floor.rate-neutral {
  background: rgba(255,255,255,0.04);
  color: var(--muted);
}
.brand-intel-chip {
  font-size: 11px;
  border-radius: 999px;
  padding: 3px 9px;
  background: rgba(120,170,255,0.10);
  border: 1px solid rgba(120,170,255,0.3);
  color: #cfdaff;
  white-space: nowrap;
}

/* Went-quiet card extras (uses .today-card .quiet-card). */
.quiet-card .quiet-subj {
  font-size: 12px;
  margin: 4px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deal-section { padding-top: 4px; }
.deal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.deal-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.deal-field label {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.deal-field input, .deal-field select {
  background: #0e0e16;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
}
.deal-field input:focus, .deal-field select:focus {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-color: var(--accent);
}
.deal-field-sub {
  font-size: 11px;
  color: var(--muted);
}
.deal-field-sub.sev-high { color: var(--bad); font-weight: 700; }
.deal-field-sub.sev-medium { color: var(--warn); font-weight: 700; }
.deal-field-sub input {
  width: 60px;
  padding: 2px 6px;
  font-size: 12px;
  margin-left: 4px;
}
.deal-field-full {
  grid-column: 1 / -1;
}
.deal-field-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.deal-field-row input { flex: 1; }
.deal-payment-row {
  flex-wrap: wrap;
}
.deal-money-preview {
  display: flex;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 0;
}
.deal-money-preview .diana-net { color: var(--ok); }

/* Deliverables */
.deliv-row {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.deliv-row.status-posted { border-color: rgba(95,225,160,0.4); }
.deliv-row.status-cancelled { opacity: 0.55; }
.deliv-row-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.deliv-row-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.deliv-row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.deliv-row-actions button { font-size: 12px; padding: 6px 10px; }
.status-pill.status-overdue {
  background: rgba(255,125,125,0.18);
  color: var(--bad);
  border: 1px solid rgba(255,125,125,0.4);
}
.status-pill.status-promised { background: rgba(154,220,255,0.12); color: var(--p3); }
.status-pill.status-in_progress { background: rgba(255,211,106,0.12); color: var(--warn); }
.status-pill.status-submitted { background: rgba(196,144,255,0.16); color: var(--accent); }
.status-pill.status-approved { background: rgba(95,225,160,0.12); color: var(--ok); }
.status-pill.status-posted { background: rgba(95,225,160,0.22); color: var(--ok); border-color: rgba(95,225,160,0.4); }
.status-pill.status-cancelled { background: rgba(154,154,171,0.12); color: var(--muted); }

.deliv-add-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}
.deliv-add-row select, .deliv-add-row input {
  background: #0e0e16;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 8px;
  font: inherit;
  font-size: 12px;
}
.deliv-add-row input[type="number"] { width: 60px; }
.deliv-add-row #deliv_add_label { flex: 1; min-width: 120px; }

.pipeline-card .card-deliverables.structured {
  color: var(--text);
  font-weight: 600;
}
.pipeline-card .card-deliverables.structured .done {
  color: var(--ok);
}

/* Collapsible brand-modal sections — desktop default hides the summary so
   the section looks like a flat block. Mobile CSS below restores it. */
.brand-section.collapsible > summary {
  display: none;
}
.brand-section.collapsible > summary::-webkit-details-marker { display: none; }

/* Mobile pipeline view */
.pipeline-mobile {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pipeline-lane-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
}
.lane-switch-btn {
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 12px 14px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  min-height: 44px;
  cursor: pointer;
}
.lane-switch-btn.active {
  background: linear-gradient(180deg, rgba(196,144,255,0.25), rgba(255,125,184,0.10));
  color: var(--text);
}
.pipeline-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0;
  scroll-snap-type: x proximity;
}
.pipeline-chips::-webkit-scrollbar { height: 0; }
.pipeline-chip {
  flex: 0 0 auto;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  cursor: pointer;
  scroll-snap-align: start;
  white-space: nowrap;
}
.pipeline-chip.active {
  background: linear-gradient(180deg, rgba(196,144,255,0.22), rgba(255,125,184,0.10));
  border-color: rgba(196,144,255,0.6);
  color: var(--text);
}
.pipeline-chip-count {
  background: var(--panel-2);
  color: var(--muted);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
}
.pipeline-chip.active .pipeline-chip-count {
  background: rgba(255,255,255,0.12);
  color: var(--text);
}
.pipeline-stage-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pipeline-stage-cards .pipeline-card {
  max-width: 100%;
}

/* Tab helpers. Primary tabs (Today, Inbox, Pipeline, Outreach) stay visible at
   every width; everything else lives behind the "More" button so the nav reads
   as a short, calm row instead of a wall of tabs. */
.tab-mobile-only { display: inline-flex; }
.tab-mobile-hidden { display: none; }

/* Card "sent": collapse + fade so a replied card leaves the list right away
   instead of lingering with a "Sent" label. Generic class — works on inbox,
   replies, and approval cards. */
.card-leaving {
  opacity: 0 !important;
  transform: translateX(10px);
  max-height: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  overflow: hidden;
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease, max-height .22s ease,
              margin .22s ease, padding .22s ease;
}

/* More menu sheet */
.more-menu {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 14px 0;
}
.more-menu-item {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 14px;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  min-height: 80px;
}
.more-menu-item:hover { background: var(--panel); border-color: var(--accent); }
.more-menu-icon { font-size: 24px; }
.more-menu-label { font-size: 13px; }

/* Small screens (tablet + phone) */
@media (max-width: 640px) {
  .hero-headline { font-size: 19px; }
  .approval h3 { font-size: 17px; }
  .filters input { min-width: 0; flex: 1; }
  .pipeline-col { min-width: 88vw; max-width: 88vw; }
  #ratesBtn { font-size: 12px; padding: 6px 10px; }
  .rate-input { max-width: 100%; }
  .deal-grid { grid-template-columns: 1fr; }
  .deliv-add-row { flex-direction: column; align-items: stretch; }
  .deliv-add-row select, .deliv-add-row input { width: 100%; }
}

/* Phone-specific: bottom nav, sticky topbar, tap targets, density */
@media (max-width: 720px) {
  /* Hide the tabs that don't fit in a 5-tab bottom nav */
  .tab-mobile-hidden { display: none !important; }
  .tab-mobile-only { display: inline-flex !important; }

  /* Layout: sticky topbar, content padding, bottom nav space */
  html, body {
    /* Allow viewport units to behave with safe areas */
    overscroll-behavior-y: contain;
    scroll-padding-bottom: calc(148px + env(safe-area-inset-bottom));
  }
  .app {
    /* Keep the fixed mobile nav from covering the last card/actions. */
    padding: 0 12px 148px;
    padding-bottom: calc(148px + env(safe-area-inset-bottom));
    max-width: 100%;
  }

  /* Sticky topbar */
  .topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    background: var(--bg);
    padding: 12px 0 10px;
    padding-top: calc(12px + env(safe-area-inset-top));
    margin: 0 -12px 12px;
    padding-left: 12px;
    padding-right: 12px;
    border-bottom: 1px solid var(--border);
    gap: 6px;
  }
  .topbar .brand { min-width: 0; }
  .topbar .brand .eyebrow { font-size: 9px; margin: 0; }
  .topbar h1 { font-size: 17px; line-height: 1.1; }
  .topbar-actions { gap: 4px; }
  .topbar-actions button {
    padding: 10px 12px;
    font-size: 13px;
    min-height: 40px;
  }
  .last-checked, .dot { display: none; }

  /* Stats: smaller, single row scroll */
  .stats {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 6px;
    margin-bottom: 12px;
  }
  .stats::-webkit-scrollbar { height: 0; }
  .stat {
    flex: 0 0 auto;
    min-width: 120px;
    padding: 10px 12px;
  }
  .stat strong { font-size: 20px; }

  .hero { margin-bottom: 10px; }
  .hero-card { padding: 14px 16px; border-radius: 14px; }
  .hero-headline { font-size: 18px; }

  .section-heading { gap: 6px; margin: 6px 0 12px; }
  .section-heading h2 { font-size: 19px; }
  .section-heading p { font-size: 13px; }
  .filters { gap: 6px; }
  .filters select, .filters input {
    font-size: 14px;
    padding: 10px 12px;
    min-height: 40px;
  }
  .filters button { min-height: 40px; }

  /* TABS as fixed bottom nav */
  .tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    margin: 0;
    min-height: calc(76px + env(safe-area-inset-bottom));
    padding: 8px 6px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    background: rgba(20, 20, 28, 0.96);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -8px 24px rgba(0,0,0,0.3);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2px;
    overflow: hidden;
    transform: translateZ(0);
  }
  .tab {
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    padding: 6px 4px;
    font-size: 11px;
    font-weight: 600;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    display: inline-flex;
    min-height: 52px;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
  }
  .tab.active {
    background: linear-gradient(180deg, rgba(196,144,255,0.22), rgba(255,125,184,0.10));
    color: var(--text);
    border: 0;
  }
  .tab .tab-icon {
    font-size: 22px;
    margin-right: 0;
    line-height: 1;
  }
  .tab .tab-label {
    font-size: 10px;
    line-height: 1;
  }
  .tab .badge-pill {
    position: absolute;
    top: 4px;
    right: 14%;
    margin: 0;
    padding: 1px 5px;
    font-size: 9px;
  }

  /* Today / Pipeline / cards: density */
  .today-section { padding: 14px; gap: 10px; }
  .today-section-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .today-section-head h3 { font-size: 15px; }
  .today-card.mini { padding: 10px 12px; }
  .today-card.mini .today-brand { font-size: 16px; }

  .pipeline-card { padding: 10px 12px; }
  .pipeline-card .brand-link { font-size: 16px; }
  .pipeline-card .money-gross { font-size: 18px; }
  .pipeline-card .card-actions button {
    font-size: 13px;
    padding: 9px 12px;
    min-height: 40px;
  }
  .pipeline-card .card-actions .toggle-kind { font-size: 12px; }

  .pipeline-totals {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 6px;
    margin-bottom: 12px;
  }
  .pipeline-totals::-webkit-scrollbar { height: 0; }
  .pipeline-totals .totals-tile {
    flex: 0 0 auto;
    min-width: 130px;
    padding: 10px 12px;
  }
  .totals-value { font-size: 18px; }
  .totals-label { font-size: 10px; }

  /* Approval cards */
  .approval { padding: 16px; scroll-margin-bottom: calc(148px + env(safe-area-inset-bottom)); }
  .approval h3 { font-size: 17px; }
  .actions-primary .big-ok {
    font-size: 17px;
    padding: 16px 18px;
    min-height: 52px;
  }
  .actions-secondary { gap: 18px; flex-wrap: wrap; }
  .actions-secondary .link-btn {
    font-size: 14px;
    padding: 8px 0;
    min-height: 36px;
  }

  /* Reply cards */
  .reply-card { padding: 14px; }
  .reply-card h4 { font-size: 15px; }
  .reply-actions { gap: 8px; }
  .reply-actions button.small,
  .reply-actions .small {
    padding: 10px 14px;
    font-size: 13px;
    min-height: 40px;
    flex: 1 1 auto;
  }
  .vet-row .vet-link {
    padding: 4px 8px;
    font-size: 12px;
  }

  /* Modals */
  .modal { padding: 8px; }
  .modal-card {
    padding: 18px 16px;
    border-radius: 18px;
    max-height: 92dvh;
    width: 100%;
    max-width: 100%;
  }
  .modal h2 { font-size: 19px; }
  .modal label { margin: 12px 0 4px; font-size: 12px; }
  .modal input, .modal textarea, .modal select {
    font-size: 16px; /* prevents iOS auto-zoom on focus */
    padding: 12px 14px;
    min-height: 44px;
    border-radius: 10px;
  }
  .modal textarea { min-height: 140px; }
  .modal-actions { gap: 8px; }
  .modal-actions button { min-height: 44px; padding: 12px 18px; }
  .modal-close { font-size: 32px; padding: 4px 12px; min-height: 44px; min-width: 44px; }

  /* Brand modal sections */
  .brand-section { padding-top: 10px; }
  .brand-section h3 { font-size: 15px; }
  .brand-section.collapsible > summary {
    display: flex !important;
    cursor: pointer;
    list-style: none;
    padding: 14px 0;
    margin: 0;
    border-top: 1px solid var(--border);
    font-size: 15px;
    font-weight: 700;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
  }
  .brand-section.collapsible > summary::-webkit-details-marker { display: none; }
  .brand-section.collapsible > summary::after {
    content: "+";
    color: var(--muted);
    font-weight: 600;
    margin-left: 12px;
    font-size: 18px;
  }
  .brand-section.collapsible[open] > summary::after { content: "−"; }

  /* Deliverables: stack action buttons */
  .deliv-row-actions { gap: 6px; }
  .deliv-row-actions button {
    font-size: 12px;
    padding: 8px 10px;
    min-height: 36px;
  }
  .deliv-row-meta { font-size: 12px; }

  /* Rates editor: cramped on phone */
  .rate-group-title { font-size: 14px; }
  .rate-table td { padding: 10px 4px; }
  .rate-label { font-size: 14px; }
  .rate-input-cell { width: 42%; }
  .rate-toggle-cell { width: 60px; }
  .rate-input {
    max-width: 100%;
    font-size: 16px; /* prevent iOS zoom */
    padding: 10px 10px;
    min-height: 40px;
  }

  /* Red flag popover */
  .flag-item { padding: 12px 14px; }
  .flag-copy { min-height: 40px; padding: 10px 16px; }

  /* Quote form */
  .quote-form-input { font-size: 16px; padding: 10px 12px; }
  .quote-preview-body { max-height: 220px; }
  .quote-form-actions button { min-height: 40px; }

  /* Cleanup modal */
  .cleanup-row { padding: 14px 12px; }
  .cleanup-row input[type="checkbox"] { width: 20px; height: 20px; }
  .cleanup-row-body strong { font-size: 15px; }

  /* Reports tiles */
  .reports-tiles {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 6px;
  }
  .reports-tiles::-webkit-scrollbar { height: 0; }
  .reports-tiles .totals-tile {
    flex: 0 0 auto;
    min-width: 140px;
  }
  .reports-section { padding: 14px; }
  .reports-table th, .reports-table td { padding: 8px 4px; font-size: 12px; }

  /* Audit list */
  .audit-row { padding: 12px; gap: 8px; }
  .audit-text { font-size: 13px; }

  /* Lock screen */
  .lock-card { padding: 28px 20px; border-radius: 18px; }
  .lock-card h1 { font-size: 24px; }
  .lock-card input {
    font-size: 18px;
    padding: 14px;
  }

  /* Refresh banner */
  .refresh-banner { font-size: 13px; padding: 10px 12px; }

  /* Toast: anchor above bottom nav */
  .toast {
    bottom: calc(80px + env(safe-area-inset-bottom));
    font-size: 14px;
    padding: 12px 18px;
  }
  .toast .toast-action {
    padding: 8px 14px;
    min-height: 36px;
  }

  /* Schedule form */
  .schedule-form-input { font-size: 16px; padding: 10px 12px; min-height: 44px; }
  .schedule-form-actions button { min-height: 40px; }

  /* Email previews inside approvals */
  .email-collapsed.open .email-block { max-height: 50vh; overflow-y: auto; }
  .email-body { font-size: 13px; line-height: 1.45; }

  /* Outreach board on phone */
  .outreach-card-head { flex-direction: column; gap: 4px; }
}

/* ---------- outreach (outbound pitching) ---------- */
.badge.ok { color: var(--ok); border-color: rgba(95,225,160,0.4); background: rgba(95,225,160,0.08); }
.badge.warn { color: var(--warn); border-color: rgba(255,211,106,0.5); background: rgba(255,211,106,0.10); }

/* Shared pitch/quote preview block (also styles the inbound reply preview) */
.quote-preview { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.quote-preview-label { font-size: 11px; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.quote-preview-subject { font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.quote-preview-body { white-space: pre-wrap; font-size: 13px; line-height: 1.5; color: var(--text); max-height: 40vh; overflow-y: auto; }

.outreach-board { display: flex; flex-direction: column; gap: 18px; }
.outreach-group-head { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.outreach-group-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.outreach-group-count { background: var(--panel-2); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; font-size: 11px; color: var(--muted); font-weight: 700; }
.outreach-hint { color: var(--muted); font-size: 12px; margin: 2px 0 8px; }

.outreach-card { cursor: default; display: flex; flex-direction: column; gap: 6px; }
.outreach-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.outreach-card-title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.outreach-card-title strong { font-size: 15px; }
.outreach-stage-tag { font-size: 11px; color: var(--muted); white-space: nowrap; }
.outreach-fit { font-size: 13px; color: var(--text); margin: 0; }
.outreach-contact { font-size: 12px; color: var(--muted); margin: 0; word-break: break-word; }
.outreach-card .reply-actions-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; align-items: center; }
.outreach-card .reply-actions-row button.small { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn-link { text-decoration: none; display: inline-flex; align-items: center; }

.outreach-form { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.outreach-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
.outreach-form input, .outreach-form select { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; color: var(--text); font-size: 14px; }
.outreach-form input:focus, .outreach-form select:focus { outline: 2px solid var(--accent); outline-offset: -2px; }

.outreach-people { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.outreach-people-head { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.outreach-person { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.outreach-person-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.outreach-person-main strong { font-size: 13px; }
.outreach-person-email { font-size: 12px; color: var(--muted); word-break: break-all; }
.outreach-person-action { flex: 0 0 auto; }

/* Send-with-undo bar (inbox/replies inline send) */
.undo-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: rgba(196,144,255,0.10); border: 1px solid rgba(196,144,255,0.4); border-radius: 12px; padding: 12px 14px; }
.undo-text { font-size: 14px; font-weight: 600; color: var(--text); }
.reply-edit { width: 100%; min-height: 150px; resize: vertical; }

/* Gmail-like Business Hub shell */
.gmail-app {
  max-width: 1440px;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 18px;
  padding-top: 14px;
}
.app-main { min-width: 0; }
.app-rail {
  position: sticky;
  top: 14px;
  height: calc(100dvh - 28px);
  background: rgba(20, 20, 28, 0.78);
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.22);
}
.rail-logo {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  color: #1a1027;
  font-weight: 900;
  font-size: 22px;
  margin-bottom: 6px;
}
.rail-item {
  width: 100%;
  border-radius: 18px;
  padding: 10px 6px;
  text-align: center;
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}
.rail-item:hover,
.rail-item.active { background: rgba(196,144,255,0.16); color: var(--text); }
.gmail-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(180deg, rgba(11,11,16,0.98), rgba(11,11,16,0.86));
  backdrop-filter: blur(18px);
  padding: 8px 0 12px;
}
.gmail-search {
  flex: 1;
  min-width: 260px;
  max-width: 640px;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-radius: 24px;
  background: #1b1b25;
  border: 1px solid rgba(196,144,255,0.18);
}
.gmail-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
}
.gmail-category-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: var(--panel);
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 20px 20px 0 0;
  overflow: hidden;
}
.gmail-category { cursor: pointer; }
.gmail-category {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 14px 18px;
  text-align: left;
  font-weight: 800;
}
.gmail-category.active {
  color: var(--text);
  box-shadow: inset 0 -3px 0 var(--accent-2);
  background: rgba(255,125,184,0.06);
}
.gmail-category span { color: var(--accent-2); margin-left: 6px; }
.gmail-mailbox {
  display: grid;
  grid-template-columns: minmax(390px, 0.92fr) minmax(360px, 1.08fr);
  min-height: 620px;
  border: 1px solid var(--border);
  border-radius: 0 0 20px 20px;
  overflow: hidden;
  background: var(--panel);
}
.gmail-list {
  background: #101018;
  border-right: 1px solid var(--border);
  overflow: auto;
  max-height: calc(100dvh - 260px);
}
.gmail-row {
  width: 100%;
  display: grid;
  grid-template-columns: 22px minmax(110px, .65fr) minmax(0, 1.9fr) auto 72px;
  gap: 10px;
  align-items: center;
  padding: 13px 14px;
  border: 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  border-radius: 0;
  background: transparent;
  text-align: left;
  color: var(--muted);
}
.gmail-row:hover,
.gmail-row.selected { background: rgba(196,144,255,0.12); }
.gmail-row.unread { color: var(--text); font-weight: 700; background-image: linear-gradient(90deg, rgba(255,125,184,0.10), transparent 38%); }
.gmail-row-star { color: var(--accent-2); font-size: 12px; }
.gmail-row-from,
.gmail-row-time { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gmail-row-main { min-width: 0; display: flex; gap: 6px; align-items: baseline; }
.gmail-row-main strong,
.gmail-row-main span,
.gmail-row-status { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gmail-row-main span { color: var(--muted); font-weight: 500; }
.gmail-row-markers { white-space: nowrap; }
.gmail-row-status { font-size: 12px; color: #d9c4ff; }

/* Inline label on each inbox row: New / Reply / Follow-up (or Gmail category).
   Kept as the first child of .gmail-row-main so it survives every breakpoint,
   including mobile where the right-hand column is dropped. */
.mail-tag {
  flex: none;
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--panel-2);
  white-space: nowrap;
  margin-right: 2px;
}
.mail-tag.tag-new { color: var(--ok); border-color: rgba(95,225,160,0.45); background: rgba(95,225,160,0.10); }
.mail-tag.tag-reply { color: #9adcff; border-color: rgba(154,220,255,0.45); background: rgba(154,220,255,0.10); }
.mail-tag.tag-follow { color: var(--warn); border-color: rgba(255,211,106,0.45); background: rgba(255,211,106,0.10); }
.mail-tag.tag-other { color: #d9c4ff; border-color: rgba(196,144,255,0.35); background: rgba(196,144,255,0.08); }
.gmail-row.unread .mail-tag { filter: saturate(1.15); }

/* Read switch + count row that sits under the category tabs. */
.mailbox-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-top: 0;
  border-bottom: 0;
}
.mailbox-readswitch {
  display: inline-flex;
  background: #101018;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.mailbox-readswitch button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.mailbox-readswitch button.active {
  color: #2a1019;
  background: var(--accent-2);
}
.mailbox-count { color: var(--muted); font-size: 12px; font-weight: 600; }
.mailbox-count-search { color: var(--accent-2); }
.gmail-empty {
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 20px 20px;
  background: var(--panel);
}

/* "Needs you" strip above the inbox (drafts to send, deals needing a step). */
.inbox-action-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}
.inbox-action-strip[hidden] { display: none; }
.strip-label { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.strip-chip {
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.strip-chip:hover { border-color: var(--accent-2); }
.strip-chip.go { border-color: rgba(95,225,160,0.45); background: rgba(95,225,160,0.08); }
.strip-chip.bad { border-color: rgba(255,125,125,0.5); background: rgba(255,125,125,0.10); color: #ffd7d7; }
.gmail-detail {
  max-height: calc(100dvh - 260px);
  overflow: auto;
  padding: 18px;
  background: radial-gradient(700px 220px at 50% 0, rgba(196,144,255,0.10), transparent), #14141c;
}
.gmail-message-detail {
  border-radius: 18px;
  box-shadow: 0 20px 55px rgba(0,0,0,0.18);
}
.gmail-message-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: -4px 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.gmail-toolbar-left { display: flex; gap: 8px; }
.gmail-toolbar-right { color: var(--muted); font-size: 12px; font-weight: 700; }
button[disabled] { opacity: .45; cursor: not-allowed; }
@media (max-width: 980px) {
  .gmail-app { display: block; padding: 10px 10px 90px; }
  .app-rail { display: none; }
  .gmail-topbar { flex-wrap: wrap; }
  .gmail-search { order: 3; max-width: none; width: 100%; min-width: 0; }
  .gmail-mailbox { grid-template-columns: 1fr; }
  .gmail-list { max-height: none; border-right: 0; }
  .gmail-detail { max-height: none; border-top: 1px solid var(--border); }
  .gmail-row { grid-template-columns: 18px minmax(88px,.7fr) minmax(0,1.5fr) 42px 64px; }
  .gmail-row-status { display: none; }
}
@media (max-width: 640px) {
  .gmail-category-tabs { grid-template-columns: 1fr 1fr; }
  .gmail-category { padding: 12px 10px; font-size: 13px; text-align: center; }
  .gmail-row { grid-template-columns: 16px minmax(0,1fr) 56px; align-items: start; }
  .gmail-row-from { grid-column: 2; }
  .gmail-row-main { grid-column: 2 / 4; display: block; }
  .gmail-row-main strong { margin-right: 6px; }
  .gmail-row-markers { grid-column: 1; grid-row: 2; }
  .gmail-row-time { grid-column: 3; grid-row: 1; text-align: right; }
}


/* Diana HQ Calendar */
.calendar-heading h2 { font-size: clamp(24px, 4vw, 34px); }
.calendar-actions .primary { box-shadow: 0 12px 30px rgba(196,144,255,0.22); }
.calendar-shell { display: grid; gap: 14px; }
.calendar-toolbar { background: linear-gradient(135deg, rgba(255,125,184,0.10), rgba(196,144,255,0.09)); border: 1px solid rgba(196,144,255,0.28); border-radius: 20px; padding: 14px; display: grid; gap: 12px; }
.calendar-view-tabs, .calendar-category-filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.calendar-view-tabs::-webkit-scrollbar, .calendar-category-filters::-webkit-scrollbar { height: 0; }
.calendar-view, .calendar-filter { white-space: nowrap; border-radius: 999px; background: rgba(20,20,28,0.8); color: var(--muted); }
.calendar-view.active, .calendar-filter.active { color: var(--text); border-color: rgba(255,211,106,0.55); background: linear-gradient(180deg, rgba(255,211,106,0.16), rgba(255,125,184,0.10)); }
.calendar-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
.calendar-main-panel, .calendar-card { background: var(--panel); border: 1px solid var(--border); border-radius: 20px; padding: 16px; }
.calendar-side-panel { display: grid; gap: 14px; position: sticky; top: 12px; }
.calendar-card h3 { margin: 0 0 8px; }
.calendar-card ul { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.calendar-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.calendar-stat-card { border: 1px solid var(--border); background: #0e0e16; border-radius: 16px; padding: 14px; }
.calendar-stat-card strong { display: block; font-size: 24px; color: #ffe4f0; }
.calendar-stat-card span { color: var(--muted); font-size: 12px; }
.calendar-list { display: grid; gap: 10px; }
.calendar-event-card { display: grid; grid-template-columns: 48px minmax(0,1fr); gap: 12px; border: 1px solid var(--border); background: #0e0e16; border-radius: 18px; padding: 14px; }
.calendar-event-icon { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; font-size: 24px; background: rgba(255,255,255,0.06); }
.calendar-event-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.calendar-event-top strong { font-size: 16px; }
.calendar-event-top span { color: var(--muted); font-size: 13px; }
.calendar-event-card p, .calendar-task-card p { margin: 6px 0 10px; color: var(--muted); font-size: 14px; }
.calendar-card-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.calendar-card-actions .small { padding: 6px 10px; font-size: 12px; border-radius: 10px; }
.calendar-event-card.cat-event, .calendar-chip.cat-event, .calendar-dot.cat-event { border-color: rgba(242,200,109,0.48); }
.calendar-event-card.cat-shoot, .calendar-chip.cat-shoot, .calendar-dot.cat-shoot { border-color: rgba(196,144,255,0.55); }
.calendar-event-card.cat-meeting, .calendar-chip.cat-meeting, .calendar-dot.cat-meeting { border-color: rgba(154,220,255,0.48); }
.calendar-event-card.cat-invoice, .calendar-chip.cat-invoice, .calendar-dot.cat-invoice { border-color: rgba(95,225,160,0.48); }
.calendar-event-card.cat-contract, .calendar-chip.cat-contract, .calendar-dot.cat-contract { border-color: rgba(255,125,157,0.52); }
.calendar-today-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.calendar-today-layout h3 { margin: 0 0 10px; }
.calendar-mini-empty { border: 1px dashed var(--border); border-radius: 14px; padding: 18px; color: var(--muted); text-align: center; }
.calendar-week-grid { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); gap: 10px; overflow-x: auto; }
.calendar-day-card, .calendar-month-day { background: #0e0e16; border: 1px solid var(--border); border-radius: 16px; padding: 12px; min-height: 130px; }
.calendar-day-card.today, .calendar-month-day.today { border-color: rgba(255,211,106,0.65); box-shadow: inset 0 0 0 1px rgba(255,211,106,0.2); }
.calendar-day-card strong, .calendar-day-card span { display: block; }
.calendar-day-card span { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.tiny { font-size: 12px; }
.calendar-chip, .calendar-dot { border: 1px solid var(--border); background: rgba(255,255,255,0.04); border-radius: 10px; padding: 6px 8px; font-size: 12px; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-month-title { font-size: 18px; font-weight: 800; margin: 0 0 10px; }
.calendar-month-grid { display: grid; grid-template-columns: repeat(7, minmax(96px, 1fr)); gap: 8px; overflow-x: auto; }
.calendar-month-day { min-height: 110px; }
.calendar-month-day > span { font-weight: 800; }
.calendar-month-day.muted-month { opacity: 0.45; }
.calendar-task-card { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; gap: 12px; align-items: start; border: 1px solid var(--border); background: #0e0e16; border-radius: 18px; padding: 14px; }
.calendar-task-card.done { opacity: 0.58; }
.calendar-task-card.done strong { text-decoration: line-through; }
.task-check { width: 34px; height: 34px; padding: 0; border-radius: 50%; border-color: rgba(95,225,160,0.45); color: var(--ok); font-weight: 900; }
.calendar-empty strong { display: block; color: var(--text); font-size: 18px; margin-bottom: 6px; }
.calendar-empty p { margin: 0 0 14px; }
@media (max-width: 860px) {
  .calendar-grid, .calendar-today-layout { grid-template-columns: 1fr; }
  .calendar-side-panel { position: static; }
  .calendar-summary { grid-template-columns: 1fr; }
  .calendar-week-grid { grid-template-columns: repeat(7, 150px); }
  .calendar-month-grid { grid-template-columns: repeat(7, 118px); }
  .calendar-task-card { grid-template-columns: 34px minmax(0,1fr); }
  .calendar-task-card .calendar-card-actions { grid-column: 2; }
}
