/* ═══════════════════════════════════════════════════════════════════
   BrianAI-OS · Dashboard v2
   Soft light + sage-tinted dark theme. Minimalist flat cards.
   ═══════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════
   ACCESSIBILITY — Tier 1
   Focus rings, motion preferences, skip link, touch targets
   ═══════════════════════════════════════════════════════════════════ */

/* Visible focus indicator on all interactive elements (keyboard only) */
*:focus { outline: none; }
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[role="button"]:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
  border-radius: 6px;
}
/* Inputs already have a border — use a softer focus ring inside */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline-offset: 0;
  box-shadow: 0 0 0 3px var(--cyan-18, rgba(74,125,94,0.16));
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Skip-to-main-content link — visible only on focus */
.skip-link {
  position: absolute;
  top: -100px;
  left: 12px;
  z-index: 10000;
  background: var(--cyan);
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-family: var(--ff-ui);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  transition: top 0.18s ease;
}
.skip-link:focus {
  top: 12px;
  outline: 2px solid var(--surface);
  outline-offset: 2px;
}

/* ── Sageful Loading Screen ───────────────────────────────────── */
.sageful-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg, #E4EDE6);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease, visibility 0.4s;
}
.sageful-loader.done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.sageful-loader-leaf {
  width: 36px;
  height: 36px;
  animation: leafPulse 1.6s ease-in-out infinite;
  filter: drop-shadow(0 0 12px rgba(74,125,94,0.2));
}
@keyframes leafPulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50%      { transform: scale(1.15); opacity: 1; }
}

/* ── Light Theme Variables — visible sage-green hue ───────────── */
:root,
[data-theme="light"] {
  --bg:       #E4EDE6;
  --bg-warm:  #DAE6DD;
  --surface:  #FDFFFE;
  --surf-2:   #EDF4EE;
  --surf-3:   #DCE9DF;

  --bdr:    rgba(74,125,94,0.18);
  --bdr-h:  rgba(74,125,94,0.25);

  --t1:  #182820;
  --t2:  #3A5244;
  --t3:  #637A6C;
  --t4:  #8FA898;

  --cyan:       #3A6A50;
  --cyan-deep:  #2E5D42;
  --cyan-bright:#4A8A64;
  --cyan-10:    rgba(74,125,94,0.08);
  --cyan-18:    rgba(74,125,94,0.16);
  --cyan-35:    rgba(74,125,94,0.30);

  --amber:      #8B6914;
  --amber-10:   rgba(139,105,20,0.08);
  --amber-18:   rgba(139,105,20,0.16);
  --amber-35:   rgba(139,105,20,0.30);

  --emerald:    #5A9470;
  --emerald-10: rgba(90,148,112,0.08);
  --emerald-18: rgba(90,148,112,0.16);
  --emerald-35: rgba(90,148,112,0.30);

  --danger:     #C0392B;
  --danger-10:  rgba(192,57,43,0.08);

  --li-blue:    #0A66C2;
  --li-blue-10: rgba(10,102,194,0.10);

  --ff-disp: 'Cormorant Garamond', Georgia, serif;
  --ff-ui:   'DM Sans',            system-ui, sans-serif;
  --ff-mono: 'IBM Plex Mono',      monospace;

  --r:    16px;
  --r-sm:  8px;
  --r-xs:  4px;

  --sh:   0 2px 4px rgba(30,60,40,0.06), 0 4px 16px rgba(30,60,40,0.08);
  --sh-h: 0 2px 8px rgba(30,60,40,0.08), 0 8px 24px rgba(30,60,40,0.10);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --hdr-h: 56px;
}

/* ── Dark Theme Variables — warm sage-white hue, high visibility ── */
[data-theme="dark"] {
  --bg:       #0F1612;
  --bg-warm:  #141E18;
  --surface:  #1E2A22;
  --surf-2:   #263430;
  --surf-3:   #2E3E36;

  --bdr:    rgba(196,217,203,0.14);
  --bdr-h:  rgba(196,217,203,0.22);

  --t1:  #F2F8F4;
  --t2:  #C4D9CB;
  --t3:  #8BB89A;
  --t4:  #637A6C;

  --cyan:       #7CC896;
  --cyan-deep:  #5AAE74;
  --cyan-bright:#96E0AE;
  --cyan-10:    rgba(124,200,150,0.12);
  --cyan-18:    rgba(124,200,150,0.20);
  --cyan-35:    rgba(124,200,150,0.35);

  --amber:      #E0C44A;
  --amber-10:   rgba(224,196,74,0.12);
  --amber-18:   rgba(224,196,74,0.20);
  --amber-35:   rgba(224,196,74,0.35);

  --emerald:    #96E0AE;
  --emerald-10: rgba(150,224,174,0.12);
  --emerald-18: rgba(150,224,174,0.20);
  --emerald-35: rgba(150,224,174,0.35);

  --danger:     #F08070;
  --danger-10:  rgba(240,128,112,0.12);

  --li-blue:    #60B8F0;
  --li-blue-10: rgba(96,184,240,0.14);

  --sh:   0 2px 4px rgba(0,0,0,0.20), 0 4px 16px rgba(0,0,0,0.16);
  --sh-h: 0 2px 8px rgba(0,0,0,0.24), 0 8px 24px rgba(0,0,0,0.20);
}

/* ── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--ff-ui);
  background: var(--bg);
  color: var(--t1);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ────────────────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--hdr-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--bdr);
  transition: border-color 0.3s ease, background 0.3s ease;
}

.header-brand,
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-hi { color: var(--cyan); }

.brand-mark {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  animation: markPulse 2.8s ease-in-out infinite;
  border-radius: 50%;
}

@keyframes markPulse {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(90,148,112,0.4)); transform: scale(1); }
  50%      { filter: drop-shadow(0 0 14px rgba(90,200,130,0.7)) drop-shadow(0 0 4px rgba(124,200,150,0.5)); transform: scale(1.12); }
}

.brand-name {
  font-family: var(--ff-disp);
  font-size: 22px;
  font-weight: 600;
  color: var(--cyan-deep);
  letter-spacing: 0.03em;
}

.brand-sub {
  font-family: var(--ff-mono);
  font-size: 9px;
  color: var(--t3);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.header-center {
  display: flex;
  align-items: center;
  gap: 20px;
  font-family: var(--ff-mono);
  font-size: 12px;
  color: var(--t2);
  letter-spacing: 0.05em;
}

.header-right,
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hdr-clock,
.clock {
  font-family: var(--ff-mono);
  font-size: 12px;
  color: var(--t2);
  letter-spacing: 0.05em;
}

.hdr-live,
.live-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--cyan);
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald);
  animation: livePulse 2.4s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 0   rgba(90,138,110,0.7); }
  50%       { box-shadow: 0 0 0 5px rgba(90,138,110,0);   }
}

/* Desktop: hide mobile-only, show desktop-only */
.hdr-mobile-only { display: none !important; }

/* Mini weather in header (mobile) */
.hdr-wx-mini {
  display: none; /* hidden on desktop */
}

/* Chat overlay — only visible on mobile via media query */
.chat-overlay { display: none; }

/* ── Buttons ───────────────────────────────────────────────────── */
.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  border: 1px solid var(--bdr);
  background: transparent;
  color: var(--t3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-icon:hover {
  background: var(--surf-2);
  color: var(--t1);
  border-color: var(--bdr-h);
}

/* ── Header Menu Dropdown ─────────────────────────────────────── */
.hdr-menu-wrap {
  position: relative;
}

.hdr-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--bdr);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  min-width: 160px;
  padding: 6px;
  z-index: 200;
  animation: dropIn 0.12s ease-out;
}

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.hdr-dropdown.hidden { display: none; }

.hdr-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: none;
  color: var(--t2);
  font-family: var(--ff-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.12s, color 0.12s;
}

.hdr-dropdown-item:hover {
  background: var(--cyan-10);
  color: var(--cyan);
}

.hdr-dropdown-item svg {
  flex-shrink: 0;
  opacity: 0.6;
}

.hdr-dropdown-item:hover svg {
  opacity: 1;
}

.btn-primary {
  height: 36px;
  padding: 0 20px;
  border-radius: 100px;
  border: none;
  background: var(--cyan);
  color: #FDFFFE;
  font-family: var(--ff-ui);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease;
}

.btn-primary:hover { background: var(--cyan-deep); }

.btn-ghost {
  height: 36px;
  padding: 0 20px;
  border-radius: 100px;
  border: 1px solid var(--bdr);
  background: transparent;
  color: var(--t2);
  font-family: var(--ff-ui);
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.btn-ghost:hover { background: var(--surf-2); color: var(--t1); }

/* ── Main Layout ───────────────────────────────────────────────── */
.main {
  position: relative;
  z-index: 1;
  padding: 24px 24px 60px;
  max-width: 1380px;
  margin: 0 auto;
}

.grid-section { margin-bottom: 28px; }

/* ── Card Grid ─────────────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: start;
  grid-auto-flow: dense;
  position: relative;
}

/* Card sizes */
.card-sm  { grid-column: span 1; }
.card-md  { grid-column: span 2; }
.card-lg  { grid-column: 1 / -1; }
.card-wide { grid-column: span 2; }

/* Cards reflow content at wider sizes */
.card-md .li-hero,
.card-lg .li-hero {
  gap: 24px;
}

.card-md .li-engagement,
.card-lg .li-engagement {
  gap: 24px;
}

.card-md .idea-list,
.card-lg .idea-list {
  columns: 2;
  column-gap: 20px;
}

.card-md .idea-list .idea-row,
.card-lg .idea-list .idea-row {
  break-inside: avoid;
}

.card-md .li-posts,
.card-lg .li-posts {
  columns: 2;
  column-gap: 20px;
}

.card-md .li-post-detail,
.card-lg .li-post-detail {
  break-inside: avoid;
}

.card-md .task-row,
.card-lg .task-row {
  padding: 9px 0;
}

.card-md .claude-convo {
  max-height: 400px;
}
.card-md.card-custom-h .claude-convo {
  max-height: none;
}

.card-lg .claude-convo {
  max-height: 500px;
}
.card-lg.card-custom-h .claude-convo {
  max-height: none;
}

/* ── Cards — minimalist flat ───────────────────────────────────── */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--bdr);
  border-top: 2px solid var(--cyan);
  border-radius: var(--r);
  padding: 22px 24px 20px;
  overflow: hidden;
  overflow-x: hidden;
  box-shadow: var(--sh);
  box-sizing: border-box;
  transition: box-shadow 0.25s var(--ease);
}

.card:hover { box-shadow: var(--sh-h); }

/* Card content — never overflow horizontally, stretch to fill card */
.card-content {
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
  overflow-wrap: break-word;
  word-wrap: break-word;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}
.card-content * {
  max-width: 100%;
  box-sizing: border-box;
}
.card-content img,
.card-content iframe,
.card-content table {
  max-width: 100%;
  height: auto;
}

/* ── Card Header ───────────────────────────────────────────────── */
.card-hdr,
.c-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 8px;
  padding-right: 32px;
}

.card-title,
.c-title {
  font-family: var(--ff-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--t3);
}

.card-badge {
  font-family: var(--ff-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: var(--r-xs);
  border: 1px solid var(--bdr);
  color: var(--t3);
  background: var(--surf-2);
}

.card-badge.on-track  { background: var(--emerald-10); border-color: var(--emerald-18); color: var(--emerald); }
.card-badge.warning   { background: var(--amber-10);   border-color: var(--amber-18);   color: var(--amber);   }
.card-badge.behind    { background: var(--danger-10);  border-color: rgba(192,57,43,0.18); color: var(--danger); }

/* ── Chips ─────────────────────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--ff-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 50px;
  border: 1px solid var(--bdr);
  color: var(--t3);
}

.chip.sage       { background: var(--cyan-10);    border-color: var(--cyan-18);    color: var(--cyan); }
.chip.amber      { background: var(--amber-10);   border-color: var(--amber-18);   color: var(--amber); }
.chip.emerald    { background: var(--emerald-10); border-color: var(--emerald-18); color: var(--emerald); }
.chip.danger     { background: var(--danger-10);  border-color: rgba(192,57,43,0.18); color: var(--danger); }
.chip-ok         { background: var(--emerald-10); border-color: var(--emerald-18); color: var(--emerald); }
.chip-info       { background: var(--cyan-10);    border-color: var(--cyan-18);    color: var(--cyan); }
.chip-warn       { background: var(--amber-10);   border-color: var(--amber-18);   color: var(--amber); }
.chip-neutral    { background: var(--surf-2);     border-color: var(--bdr);        color: var(--t3); }

/* Track chips */
.track-chip {
  flex-shrink: 0;
  font-family: var(--ff-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 2px 5px;
  border-radius: var(--r-xs);
  margin-top: 2px;
}
.track-chip.career   { background: var(--cyan-10);    color: var(--cyan);    border: 1px solid var(--cyan-18); }
.track-chip.platform { background: var(--emerald-10); color: var(--emerald); border: 1px solid var(--emerald-18); }
.track-chip.life     { background: var(--amber-10);   color: var(--amber);   border: 1px solid var(--amber-18); }

/* ── Alert Banner ──────────────────────────────────────────────── */
.alert-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: var(--r-sm);
  background: var(--cyan-10);
  border: 1px solid var(--cyan-18);
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--t2);
  line-height: 1.5;
}

.alert-icon { font-size: 14px; flex-shrink: 0; }

/* ── Carry Section ─────────────────────────────────────────────── */
.carry-section {
  background: var(--amber-10);
  border: 1px solid var(--amber-18);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  margin-top: 10px;
}

.carry-label {
  font-family: var(--ff-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 6px;
}

.carry-item {
  font-size: 12px;
  color: var(--t2);
  padding: 3px 0;
}

/* ── Metrics Grid ──────────────────────────────────────────────── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 4px;
}

.metric-cell {
  position: relative;
  background: var(--surf-2);
  border: 1px solid var(--bdr);
  border-radius: var(--r-sm);
  padding: 12px 14px 10px;
  transition: background 0.2s ease;
  overflow: hidden;
}

.metric-cell > * { position: relative; z-index: 1; }
.metric-cell:hover { background: var(--surf-3); }

.metric-num {
  font-family: var(--ff-disp);
  font-size: 36px;
  font-weight: 600;
  color: var(--t1);
  letter-spacing: -0.02em;
  line-height: 1;
  display: block;
  margin-bottom: 3px;
  transition: color 0.2s;
}

.metric-cell:hover .metric-num { color: var(--cyan); }

.metric-label {
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--t3);
}

.metric-target {
  font-family: var(--ff-mono);
  font-size: 9px;
  color: var(--t3);
  letter-spacing: 0.07em;
}

/* ── Tasks ─────────────────────────────────────────────────────── */
.task-list { display: flex; flex-direction: column; }

.task-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 6px;
  border-top: 1px solid var(--bdr);
  border-radius: var(--r-sm);
  transition: background 0.15s;
  cursor: pointer;
}

.task-row:first-of-type { border-top: none; }
.task-row:hover { background: var(--surf-2); }

.task-check {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--bdr-h);
  background: transparent;
  flex-shrink: 0;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
}

.task-row.checked .task-check {
  background: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-10);
}

.task-row.checked .task-check::after {
  content: '';
  width: 6px;
  height: 4px;
  border-left: 1.5px solid #fff;
  border-bottom: 1.5px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
  display: block;
}

.task-text {
  flex: 1;
  font-size: 12.5px;
  color: var(--t1);
  line-height: 1.5;
}

.task-row.checked .task-text {
  color: var(--t3);
  text-decoration: line-through;
}

.task-meta {
  font-family: var(--ff-mono);
  font-size: 10px;
  color: var(--t3);
  flex-shrink: 0;
  padding-top: 2px;
}

/* Urgent tasks */
.task-row.urgent:not(.checked) {
  padding-left: 10px;
  border-left: 2px solid var(--amber);
  box-shadow: inset 2px 0 8px rgba(154,122,36,0.06);
  border-radius: var(--r-sm);
  animation: urgentFlicker 3s ease-in-out infinite;
}

@keyframes urgentFlicker {
  0%, 100% { border-left-color: var(--amber); }
  50%       { border-left-color: var(--amber-35); }
}

/* ── Progress Bars (thin, no shimmer) ──────────────────────────── */
.prog-track {
  height: 4px;
  background: var(--surf-3);
  border-radius: 2px;
  overflow: hidden;
  margin: 8px 0 4px;
  position: relative;
}

.prog-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--cyan);
  transition: width 0.8s var(--ease);
}

.prog-fill.on-track { background: var(--emerald); }
.prog-fill.warning  { background: var(--amber);   }

/* ── Gmail Card ────────────────────────────────────────────────── */
.gmail-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.gmail-refresh-btn {
  background: transparent;
  border: 1px solid var(--bdr);
  color: var(--t3);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.gmail-refresh-btn:hover {
  background: var(--surf-2);
  color: var(--cyan);
  border-color: var(--cyan);
}
.gmail-refresh-btn.spinning svg {
  animation: gmailSpin 0.8s linear;
}
@keyframes gmailSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.gmail-mark-all-btn {
  background: transparent;
  border: 1px solid var(--bdr);
  color: var(--t3);
  height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.gmail-mark-all-btn:hover:not(:disabled) {
  background: var(--surf-2);
  color: var(--cyan);
  border-color: var(--cyan);
}
.gmail-mark-all-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}
/* Gmail empty-state trust signals */
.gmail-trust {
  margin: 14px 0 16px;
  padding: 12px 14px;
  background: rgba(127, 168, 138, 0.06);
  border: 1px solid rgba(127, 168, 138, 0.2);
  border-left: 3px solid var(--cyan);
  border-radius: 10px;
  text-align: left;
  width: 100%;
  box-sizing: border-box;
}
.gmail-trust-row + .gmail-trust-row { margin-top: 10px; }
.gmail-trust-label {
  font-family: var(--ff-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 5px;
}
.gmail-trust-yes { color: var(--cyan); }
.gmail-trust-no  { color: var(--t3); }
.gmail-trust-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.gmail-trust-list li {
  font-size: 11.5px;
  color: var(--t2);
  line-height: 1.5;
  padding-left: 16px;
  position: relative;
  margin-bottom: 2px;
}
.gmail-trust-row:first-child .gmail-trust-list li::before {
  content: '\2713';
  position: absolute;
  left: 0;
  color: var(--cyan);
  font-weight: 700;
}
.gmail-trust-row:last-child .gmail-trust-list li::before {
  content: '\00d7';
  position: absolute;
  left: 0;
  color: var(--t4);
  font-weight: 700;
}
.gmail-trust-scope {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(127, 168, 138, 0.25);
  font-size: 10px;
  color: var(--t4);
  font-family: var(--ff-mono);
}
.gmail-trust-scope code {
  color: var(--t3);
  background: transparent;
  padding: 0;
}

/* Filter toggle */
.gmail-filter-toggle {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  padding: 3px;
  background: var(--surf-2);
  border-radius: 8px;
  border: 1px solid var(--bdr);
}
.gmail-filter-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--t3);
  font-family: var(--ff-ui);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 5px 8px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.gmail-filter-btn:hover {
  color: var(--t1);
}
.gmail-filter-btn.active {
  background: var(--surface);
  color: var(--cyan);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.gmail-list {
  display: flex;
  flex-direction: column;
  max-height: 360px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  margin: 0 -4px;
  padding: 0 4px;
}
.gmail-list::-webkit-scrollbar { width: 4px; }
.gmail-list::-webkit-scrollbar-track { background: transparent; }
.gmail-list::-webkit-scrollbar-thumb {
  background: var(--bdr-h, var(--bdr));
  border-radius: 2px;
}
/* When card has a custom height, list grows to fill */
.card-custom-h .gmail-list {
  max-height: none;
  flex: 1 1 auto;
}
.gmail-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--bdr);
}
.gmail-row:first-child { border-top: none; padding-top: 4px; }
.gmail-row-main {
  flex: 1;
  min-width: 0;
}
.gmail-row-from {
  font-family: var(--ff-ui);
  font-size: 12px;
  font-weight: 600;
  color: var(--t1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gmail-row-subject {
  font-family: var(--ff-ui);
  font-size: 12px;
  color: var(--t2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.gmail-row-snippet {
  font-family: var(--ff-ui);
  font-size: 11px;
  color: var(--t3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.gmail-row-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.gmail-row-time {
  font-family: var(--ff-mono);
  font-size: 9px;
  color: var(--t4, var(--t3));
}
.gmail-mark-read {
  background: transparent;
  border: 1px solid var(--bdr);
  color: var(--t3);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.gmail-mark-read:hover {
  background: var(--cyan-10, rgba(74,125,94,0.08));
  border-color: var(--cyan);
  color: var(--cyan);
}
.gmail-footer {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--bdr);
  text-align: center;
}
.gmail-open-link {
  font-family: var(--ff-mono);
  font-size: 9px;
  color: var(--t3);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 0.15s;
}
.gmail-open-link:hover { color: var(--cyan); }
.gmail-connect-btn {
  background: var(--cyan);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 8px;
  font-family: var(--ff-ui);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
  transition: background 0.15s;
}
.gmail-connect-btn:hover { background: var(--cyan-deep); }

/* Make rows clickable */
.gmail-row { cursor: pointer; transition: background 0.12s; }
.gmail-row:hover { background: var(--surf-2); margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: 6px; }

/* ── Gmail Message Modal — elegant, modern, on-brand ──────────── */
.gmail-msg-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(24,40,32,0.32);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  animation: gmailModalFadeIn 0.22s ease;
}
@keyframes gmailModalFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.gmail-msg-panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--bdr);
  border-radius: 20px;
  width: 620px;
  max-width: 100%;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 24px 80px rgba(24,40,32,0.18),
    0 4px 16px rgba(24,40,32,0.06),
    0 1px 3px rgba(24,40,32,0.04);
  animation: gmailModalSlideIn 0.28s cubic-bezier(0.22,1,0.36,1);
  overflow: hidden;
}
@keyframes gmailModalSlideIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Floating close button — top-right corner */
.gmail-msg-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 5;
  background: var(--surface);
  border: 1px solid var(--bdr);
  color: var(--t3);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px rgba(24,40,32,0.06);
}
.gmail-msg-close:hover {
  background: var(--surf-2);
  color: var(--t1);
  transform: scale(1.05);
  border-color: var(--bdr-h, var(--bdr));
}

/* Header section: eyebrow + subject */
.gmail-msg-hdr {
  padding: 32px 36px 20px;
}
.gmail-msg-eyebrow {
  font-family: var(--ff-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan);
  opacity: 0.7;
  margin-bottom: 10px;
}
.gmail-msg-subject {
  font-family: var(--ff-disp);
  font-size: 26px;
  font-weight: 500;
  color: var(--t1);
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 0;
  padding-right: 48px; /* clear the close button */
}

/* Sender row with avatar */
.gmail-msg-sender-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 36px 20px;
}
.gmail-msg-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan) 0%, var(--cyan-deep) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ff-disp);
  font-size: 18px;
  font-weight: 600;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(74,125,94,0.18);
  letter-spacing: 0;
}
.gmail-msg-sender-info {
  flex: 1;
  min-width: 0;
}
.gmail-msg-from-name {
  font-family: var(--ff-ui);
  font-size: 14px;
  font-weight: 600;
  color: var(--t1);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gmail-msg-from-email {
  font-family: var(--ff-mono);
  font-size: 10px;
  color: var(--t3);
  opacity: 0.7;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gmail-msg-date {
  font-family: var(--ff-mono);
  font-size: 10px;
  color: var(--t3);
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Subtle divider between header and body */
.gmail-msg-divider {
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--bdr) 20%,
    var(--bdr) 80%,
    transparent 100%);
  margin: 0 36px;
}

.gmail-msg-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 36px 28px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.gmail-msg-body::-webkit-scrollbar { width: 6px; }
.gmail-msg-body::-webkit-scrollbar-track { background: transparent; }
.gmail-msg-body::-webkit-scrollbar-thumb {
  background: var(--bdr-h, var(--bdr));
  border-radius: 3px;
}
/* Email body — force Sageful typography on top of arbitrary email HTML */
.gmail-msg-body-html {
  font-family: var(--ff-ui);
  font-size: 14px;
  line-height: 1.65;
  color: var(--t1);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Universal reset: every element inherits Sageful styling */
.gmail-msg-body-html *,
.gmail-msg-body-html *::before,
.gmail-msg-body-html *::after {
  font-family: inherit !important;
  color: inherit !important;
  background-color: transparent !important;
  background-image: none !important;
  border-color: var(--bdr) !important;
  box-shadow: none !important;
  text-shadow: none !important;
  max-width: 100% !important;
  letter-spacing: normal !important;
  font-weight: inherit !important;
}

/* Re-establish hierarchy with our scale */
.gmail-msg-body-html p {
  margin: 0 0 12px 0;
  font-size: 14px;
  line-height: 1.65;
}
.gmail-msg-body-html p:last-child { margin-bottom: 0; }
.gmail-msg-body-html br { line-height: 1.65; }

.gmail-msg-body-html h1,
.gmail-msg-body-html h2,
.gmail-msg-body-html h3,
.gmail-msg-body-html h4 {
  font-family: var(--ff-disp) !important;
  font-weight: 600 !important;
  color: var(--t1) !important;
  margin: 18px 0 8px;
  line-height: 1.3;
  letter-spacing: -0.01em !important;
}
.gmail-msg-body-html h1 { font-size: 19px; }
.gmail-msg-body-html h2 { font-size: 17px; }
.gmail-msg-body-html h3, .gmail-msg-body-html h4 { font-size: 15px; }

.gmail-msg-body-html strong, .gmail-msg-body-html b {
  font-weight: 600 !important;
  color: var(--t1) !important;
}
.gmail-msg-body-html em, .gmail-msg-body-html i {
  font-style: italic;
}

/* Lists */
.gmail-msg-body-html ul,
.gmail-msg-body-html ol {
  margin: 8px 0 14px;
  padding-left: 22px;
}
.gmail-msg-body-html li {
  margin: 4px 0;
  font-size: 14px;
  line-height: 1.6;
}
.gmail-msg-body-html ul li::marker { color: var(--t4, var(--t3)); }

/* Links — sage on-brand */
.gmail-msg-body-html a {
  color: var(--cyan) !important;
  text-decoration: none !important;
  border-bottom: 1px solid var(--cyan-18) !important;
  transition: border-color 0.15s;
  word-break: break-word;
}
.gmail-msg-body-html a:hover { border-bottom-color: var(--cyan) !important; }

/* Images */
.gmail-msg-body-html img {
  max-width: 100% !important;
  height: auto !important;
  width: auto !important;
  border-radius: 8px;
  margin: 8px 0;
  display: block;
}

/* Blockquote — original message quote */
.gmail-msg-body-html blockquote {
  border-left: 2px solid var(--bdr-h, var(--bdr)) !important;
  margin: 14px 0;
  padding: 6px 0 6px 16px;
  color: var(--t3) !important;
  font-style: italic;
  font-size: 13px;
}

/* Tables — make them fluid, not the email's fixed pixel widths */
.gmail-msg-body-html table {
  width: 100% !important;
  border-collapse: collapse !important;
  margin: 10px 0;
  font-size: 13px;
}
.gmail-msg-body-html td,
.gmail-msg-body-html th {
  padding: 6px 8px !important;
  border: none !important;
  vertical-align: top;
  text-align: left;
}
/* Strip the visual chrome that promo emails put around layout tables */
.gmail-msg-body-html table table {
  width: 100% !important;
  margin: 0;
}

/* Horizontal rule */
.gmail-msg-body-html hr {
  border: none !important;
  border-top: 1px solid var(--bdr) !important;
  margin: 18px 0;
}

/* Code */
.gmail-msg-body-html code {
  font-family: var(--ff-mono) !important;
  font-size: 12px;
  background: var(--surf-2) !important;
  padding: 2px 6px;
  border-radius: 4px;
}
.gmail-msg-body-html pre {
  font-family: var(--ff-mono) !important;
  font-size: 12px;
  background: var(--surf-2) !important;
  padding: 12px 14px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 10px 0;
}

/* Quoted reply collapser */
.gmail-msg-quote {
  margin-top: 18px;
  border-top: 1px solid var(--bdr);
  padding-top: 12px;
}
.gmail-msg-quote summary {
  font-family: var(--ff-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t3);
  cursor: pointer;
  padding: 4px 0;
  list-style: none;
  user-select: none;
  transition: color 0.15s;
}
.gmail-msg-quote summary::-webkit-details-marker { display: none; }
.gmail-msg-quote summary:hover { color: var(--cyan); }
.gmail-msg-quote summary::before {
  content: '▸ ';
  display: inline-block;
  transition: transform 0.15s;
}
.gmail-msg-quote[open] summary::before {
  transform: rotate(90deg);
}
.gmail-msg-quote[open] summary { margin-bottom: 8px; }

.gmail-msg-body-text {
  font-family: var(--ff-ui);
  font-size: 14px;
  line-height: 1.65;
  color: var(--t1);
  white-space: pre-wrap;
  word-wrap: break-word;
  margin: 0;
}

.gmail-msg-loading {
  padding: 32px 36px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gmail-msg-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 18px 36px;
  border-top: 1px solid var(--bdr);
  background: var(--surf-2);
}
.gmail-msg-reply-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--cyan);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  font-family: var(--ff-ui);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(74,125,94,0.18);
}
.gmail-msg-reply-btn:hover {
  background: var(--cyan-deep);
  box-shadow: 0 4px 14px rgba(74,125,94,0.28);
  transform: translateY(-1px);
}
.gmail-msg-reply-btn svg {
  opacity: 0.85;
}

@media (max-width: 640px) {
  .gmail-msg-overlay { padding: 0; align-items: flex-end; }
  .gmail-msg-panel {
    width: 100%;
    max-width: 100%;
    max-height: 90vh;
    border-radius: 20px 20px 0 0;
    border-bottom: none;
  }
  /* Subtle drag handle bar at top of mobile sheet */
  .gmail-msg-panel::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--bdr-h, var(--bdr));
    z-index: 6;
  }
  .gmail-msg-close { top: 14px; right: 14px; width: 28px; height: 28px; }
  .gmail-msg-hdr { padding: 28px 22px 16px; }
  .gmail-msg-subject { font-size: 20px; padding-right: 36px; }
  .gmail-msg-eyebrow { font-size: 8px; margin-bottom: 8px; }
  .gmail-msg-sender-row { padding: 0 22px 16px; gap: 12px; }
  .gmail-msg-avatar { width: 36px; height: 36px; font-size: 16px; }
  .gmail-msg-from-name { font-size: 13px; }
  .gmail-msg-from-email { font-size: 9px; }
  .gmail-msg-divider { margin: 0 22px; }
  .gmail-msg-body { padding: 20px 22px 24px; }
  .gmail-msg-body-html, .gmail-msg-body-text { font-size: 13.5px; line-height: 1.6; }
  .gmail-msg-footer { padding: 14px 22px; }
  .gmail-msg-reply-btn { padding: 9px 18px; font-size: 11px; }
  .gmail-msg-loading { padding: 24px 22px; }
}

/* ── LinkedIn Activity ─────────────────────────────────────────── */
.li-hero {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--bdr);
}

.li-stat { flex: 1; text-align: center; }

.li-stat-num {
  font-family: var(--ff-disp);
  font-size: 30px;
  font-weight: 600;
  color: var(--t1);
  line-height: 1;
  letter-spacing: -0.02em;
  display: block;
  margin-bottom: 4px;
  transition: color 0.2s;
}

.li-stat:hover .li-stat-num { color: var(--cyan); }

.li-stat-label {
  font-family: var(--ff-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--t3);
}

.li-post {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--bdr);
}

.li-post:first-of-type { border-top: none; }

a.li-post {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  padding: 9px 8px;
  margin: 0 -8px;
  border-radius: 8px;
  transition: background 0.15s;
}
a.li-post:hover { background: var(--surf-2); }

/* ── LinkedIn Engagement & Top Post ───────────────────────────── */
.li-engagement {
  display: flex;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--bdr);
  border-bottom: 1px solid var(--bdr);
  margin-bottom: 12px;
}

.li-eng-stat { flex: 1; text-align: center; }

.li-eng-num {
  font-family: var(--ff-mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--cyan);
  display: block;
  margin-bottom: 2px;
}

.li-eng-label {
  font-family: var(--ff-mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t3);
}

.li-top-post {
  margin-bottom: 12px;
}

.li-top-label,
.li-posts-label {
  font-family: var(--ff-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t3);
  margin-bottom: 8px;
}

.li-top-content {
  background: var(--cyan-10);
  border: 1px solid var(--cyan-18);
  border-radius: 8px;
  padding: 10px 12px;
  display: block;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}

a.li-top-content:hover { background: var(--cyan-18); }

/* ── LinkedIn Post Detail View ────────────────────────────────── */
.li-post-detail {
  padding: 12px 0;
  border-top: 1px solid var(--bdr);
}

.li-post-detail:first-child { border-top: none; }

.li-post-text-full {
  font-size: 13px;
  color: var(--t1);
  line-height: 1.5;
  margin-bottom: 8px;
}

.li-post-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 6px;
}

.li-metric {
  font-family: var(--ff-mono);
  font-size: 10px;
  color: var(--t3);
  letter-spacing: 0.02em;
}

.li-metric-num {
  font-weight: 600;
  color: var(--t2);
}

.li-metric-total .li-metric-num {
  color: var(--cyan);
}

.li-post-link {
  font-family: var(--ff-mono);
  font-size: 10px;
  color: var(--cyan);
  text-decoration: none;
  letter-spacing: 0.04em;
  opacity: 0.8;
  transition: opacity 0.15s;
}

.li-post-link:hover { opacity: 1; text-decoration: underline; }

.li-post-text {
  flex: 1;
  font-size: 12px;
  color: var(--t2);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.li-post-stats {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  font-family: var(--ff-mono);
  font-size: 10px;
  color: var(--t3);
}

.li-post-stats span { white-space: nowrap; }
.li-post-stats .hi { color: var(--cyan); font-weight: 600; }

.li-setup { padding: 20px 0; text-align: center; }
.li-setup-icon { font-size: 28px; margin-bottom: 10px; display: block; opacity: 0.4; }
.li-setup-msg { font-size: 12px; color: var(--t3); line-height: 1.6; margin-bottom: 10px; }

/* Info tooltips */
.li-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  font-family: var(--ff-ui);
  font-size: 7px;
  font-weight: 600;
  font-style: italic;
  color: var(--t4, var(--t3));
  background: transparent;
  border: 1px solid var(--bdr);
  cursor: help;
  position: relative;
  vertical-align: middle;
  margin-left: 2px;
  opacity: 0.5;
  transition: opacity 0.15s;
}
.li-info:hover { opacity: 1; }
.li-info::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  color: var(--t2);
  border: 1px solid var(--bdr);
  font-family: var(--ff-ui);
  font-size: 10px;
  font-style: normal;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.01em;
  padding: 8px 12px;
  border-radius: 10px;
  width: max-content;
  max-width: 220px;
  white-space: normal;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 50;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
/* Right-side stats: anchor tooltip to right so it doesn't clip */
.li-stat:last-child .li-info::after,
.li-eng-stat:last-child .li-info::after {
  left: auto;
  right: -4px;
  transform: none;
}
/* Left-side stats: anchor tooltip to left */
.li-stat:first-child .li-info::after,
.li-eng-stat:first-child .li-info::after {
  left: -4px;
  transform: none;
}
.li-info:hover::after { opacity: 1; }

@media (max-width: 640px) {
  .li-info { width: 10px; height: 10px; font-size: 6px; }
  .li-info::after {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    max-width: 180px;
    font-size: 9px;
  }
  /* On mobile all tooltips center — card is full width so no clipping */
  .li-stat:last-child .li-info::after,
  .li-eng-stat:last-child .li-info::after,
  .li-stat:first-child .li-info::after,
  .li-eng-stat:first-child .li-info::after {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
}

.li-analytics-link {
  display: block;
  text-align: center;
  font-family: var(--ff-mono);
  font-size: 9px;
  font-weight: 500;
  color: var(--t3);
  text-decoration: none;
  letter-spacing: 0.04em;
  padding: 8px 0 0;
  margin-top: 8px;
  border-top: 1px solid var(--bdr);
  transition: color 0.15s;
}
.li-analytics-link:hover { color: var(--cyan); }

.li-setup-link {
  font-family: var(--ff-mono);
  font-size: 10px;
  color: var(--cyan);
  letter-spacing: 0.04em;
  text-decoration: none;
  border-bottom: 1px solid var(--cyan-18);
  padding-bottom: 1px;
}

/* (li-footer, sync-now, profile-link removed — card slimmed down) */

@keyframes pulse-sync {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.btn-li-edit {
  background: var(--surf-2);
  border: 1px solid var(--bdr);
  color: var(--t2);
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-li-edit:hover { background: var(--cyan-10); color: var(--cyan); border-color: var(--cyan-18); }

/* LinkedIn modal specific */
.li-modal-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.li-modal-group { display: flex; flex-direction: column; gap: 4px; }

.li-bookmarklet-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 10px;
  background: var(--surf-2);
  border: 1px solid var(--bdr);
  border-radius: 8px;
  flex-wrap: wrap;
}

.li-bookmarklet {
  display: inline-block;
  background: var(--cyan-10);
  color: var(--cyan);
  border: 1px solid var(--cyan-18);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: grab;
  transition: background 0.15s;
  white-space: nowrap;
}
.li-bookmarklet:hover { background: var(--cyan-18); }

/* ── Pipeline ──────────────────────────────────────────────────── */
.pipe-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--bdr);
}

.pipe-row:first-of-type { border-top: none; }

.pipe-stage {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--t1);
  flex: 1;
}

.pipe-counts {
  font-family: var(--ff-mono);
  font-size: 12px;
  color: var(--t2);
  white-space: nowrap;
}

.pipe-counts strong { color: var(--t1); font-weight: 700; }
.pipe-status { font-size: 14px; flex-shrink: 0; width: 20px; text-align: center; }

/* ── Calendar ──────────────────────────────────────────────────── */
.cal-row {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 10px 0;
  border-top: 1px solid var(--bdr);
}

.cal-row:first-of-type { border-top: none; }

.cal-time {
  font-family: var(--ff-mono);
  font-size: 11px;
  color: var(--cyan);
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 1px;
  min-width: 70px;
}

.cal-event {
  font-size: 12.5px;
  color: var(--t1);
  line-height: 1.4;
}

/* ── Calendar Interactions ────────────────────────────────────── */
.c-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cal-add-btn {
  background: var(--cyan-10);
  border: 1px solid var(--cyan-18);
  color: var(--cyan);
  font-family: var(--ff-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.cal-add-btn:hover { background: var(--cyan-18); }

.cal-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s;
  flex-shrink: 0;
}

.cal-row:hover .cal-actions { opacity: 1; }

.cal-edit-btn,
.cal-del-btn {
  background: none;
  border: 1px solid var(--bdr);
  color: var(--t3);
  width: 22px;
  height: 22px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, border-color 0.15s;
}

.cal-edit-btn:hover { color: var(--cyan); border-color: var(--cyan-18); }
.cal-del-btn:hover { color: var(--danger); border-color: rgba(192,57,43,0.18); }

.cal-form {
  padding: 12px 0;
  border-top: 1px solid var(--bdr);
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cal-form-times {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cal-form-times .field-input {
  flex: 1;
  cursor: pointer;
}

select.field-input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23637A6C' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.cal-form-sep {
  font-family: var(--ff-mono);
  font-size: 10px;
  color: var(--t3);
}

.cal-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ── This Week ─────────────────────────────────────────────────── */
.week-section {
  font-family: var(--ff-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--t3);
  padding: 11px 0 4px;
  margin-top: 4px;
  border-top: 1px solid var(--bdr);
}

.week-section:first-of-type { border-top: none; margin-top: 0; padding-top: 0; }

.done-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 5px 0;
  font-size: 12px;
  color: var(--t2);
  border-top: 1px solid var(--bdr);
}

.done-row:first-of-type { border-top: none; }

.done-when {
  font-family: var(--ff-mono);
  font-size: 10px;
  color: var(--emerald);
  flex-shrink: 0;
}

/* ── Idea Queue ────────────────────────────────────────────────── */
.idea-list {
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 12px;
  flex: 1 1 auto;
}

.idea-list::-webkit-scrollbar       { width: 3px; }
.idea-list::-webkit-scrollbar-track { background: transparent; }
.idea-list::-webkit-scrollbar-thumb { background: var(--bdr-h); border-radius: 2px; }

.idea-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 8px 0;
  border-top: 1px solid var(--bdr);
  font-size: 12.5px;
  color: var(--t1);
  line-height: 1.45;
}

.idea-row:first-of-type { border-top: none; }

.idea-tag {
  flex-shrink: 0;
  font-family: var(--ff-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 2px 5px;
  border-radius: var(--r-xs);
  margin-top: 2px;
}

.idea-tag.ready { background: var(--emerald-10); color: var(--emerald); border: 1px solid var(--emerald-18); }
.idea-tag.raw   { background: var(--amber-10);   color: var(--amber);   border: 1px solid var(--amber-18);   }

.idea-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--bdr);
}

.idea-input {
  flex: 1;
  height: 36px;
  padding: 0 16px;
  border-radius: 100px;
  border: 1.5px solid var(--bdr);
  background: var(--surface);
  font-family: var(--ff-ui);
  font-size: 12.5px;
  color: var(--t1);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.idea-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px var(--cyan-10);
}

.idea-input::placeholder { color: var(--t3); }

/* ── Claude Prompts ────────────────────────────────────────────── */
.prompts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.prompt-row {
  padding: 14px 14px 12px;
  border-radius: 10px;
  border: 1px solid var(--bdr);
  background: var(--surface);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}

.prompt-row:hover {
  border-color: var(--cyan-18);
  background: var(--surf-2);
}

.prompt-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--t1);
  letter-spacing: -0.01em;
  margin-bottom: 5px;
}

.prompt-text {
  font-size: 10.5px;
  color: var(--t2);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.prompt-copy {
  position: absolute;
  top: 8px; right: 8px;
  font-family: var(--ff-mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--cyan);
  background: var(--cyan-10);
  border: 1px solid var(--cyan-18);
  border-radius: var(--r-xs);
  padding: 2px 6px;
  opacity: 0;
  transition: opacity 0.18s;
}

.prompt-row:hover .prompt-copy { opacity: 1; }

/* ── Deals Card ────────────────────────────────────────────────── */
.deals-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--bdr);
}

.deals-tab {
  font-family: var(--ff-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: var(--r-xs);
  border: 1px solid var(--bdr);
  background: transparent;
  color: var(--t2);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.deals-tab:hover { background: var(--surf-2); color: var(--t1); border-color: var(--bdr-h); }

.deals-tab.active {
  background: var(--amber-10);
  border-color: var(--amber-18);
  color: var(--amber);
  box-shadow: 0 2px 0 var(--amber);
}

.deals-list { display: flex; flex-direction: column; }

.deal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 6px;
  border-top: 1px solid var(--bdr);
  border-radius: var(--r-sm);
  transition: background 0.15s;
}

.deal-row:first-child { border-top: none; }
.deal-row:hover { background: var(--surf-2); }

.deal-info { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }

.deal-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--t1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deal-expires {
  font-family: var(--ff-mono);
  font-size: 9px;
  color: var(--t3);
  letter-spacing: 0.04em;
}

.deal-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.store-badge {
  font-family: var(--ff-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: var(--r-xs);
  background: var(--amber-10);
  border: 1px solid var(--amber-18);
  color: var(--amber);
  white-space: nowrap;
}

.deal-price {
  font-family: var(--ff-disp);
  font-size: 16px;
  font-weight: 600;
  color: var(--t1);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.deal-savings {
  font-family: var(--ff-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--emerald);
  white-space: nowrap;
}

.deals-category { margin-bottom: 18px; }
.deals-category:last-child { margin-bottom: 0; }

.deals-category-label {
  font-family: var(--ff-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--t3);
  padding: 8px 0 6px;
  border-bottom: 1px solid var(--bdr);
  margin-bottom: 2px;
}

/* Compare table */
.compare-table-wrap { overflow-x: auto; }

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.compare-table th {
  font-family: var(--ff-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t3);
  padding: 6px 10px;
  text-align: left;
  border-bottom: 1px solid var(--bdr);
  white-space: nowrap;
}

.compare-table td {
  padding: 8px 10px;
  border-top: 1px solid var(--bdr);
  color: var(--t2);
  font-family: var(--ff-mono);
  font-size: 11px;
  white-space: nowrap;
}

.compare-table tr:hover td { background: var(--surf-2); }

.compare-item {
  font-family: var(--ff-ui) !important;
  font-size: 13px !important;
  font-weight: 500;
  color: var(--t1) !important;
  white-space: normal !important;
}

.compare-best { color: var(--emerald) !important; font-weight: 700; }
.compare-na { color: var(--t3); }
.compare-winner { font-family: var(--ff-ui) !important; font-weight: 700; color: var(--emerald) !important; }

.deals-skipped {
  font-size: 11.5px;
  color: var(--t3);
  font-style: italic;
  padding: 16px 0 8px;
  text-align: center;
}

/* ── Modal ─────────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal.hidden { display: none; }

.modal-panel {
  background: var(--surface);
  border: 1px solid var(--bdr);
  border-radius: var(--r);
  padding: 26px;
  width: 90%;
  max-width: 420px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  animation: modalIn 0.30s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.92) translateY(12px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}

.modal-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.modal-title {
  font-family: var(--ff-disp);
  font-size: 20px;
  font-weight: 600;
  color: var(--t1);
  letter-spacing: -0.01em;
}

.modal-desc {
  font-size: 12.5px;
  color: var(--t3);
  margin-bottom: 20px;
  line-height: 1.65;
}

.field-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--t2);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.field-input {
  width: 100%;
  height: 42px;
  padding: 0 16px;
  border-radius: 100px;
  border: 1.5px solid var(--bdr);
  background: var(--surface);
  font-family: var(--ff-mono);
  font-size: 13px;
  font-weight: 400;
  color: var(--t1);
  outline: none;
  margin-bottom: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px var(--cyan-10);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 6px;
}

/* ── Toast ─────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 26px;
  right: 26px;
  z-index: 300;
  padding: 12px 20px;
  border-radius: 100px;
  background: var(--surface);
  border: 1px solid var(--cyan-18);
  color: var(--t1);
  font-family: var(--ff-ui);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  pointer-events: none;
  max-width: 300px;
}

.toast.show { opacity: 1; transform: translateY(0) scale(1); }

/* ── Skeleton & Empty ──────────────────────────────────────────── */
.skel {
  height: 14px;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--surf-2) 25%, var(--surf-3) 50%, var(--surf-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.9s infinite;
  margin-bottom: 9px;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

.empty {
  font-size: 12px;
  color: var(--t3);
  font-style: italic;
}
.empty-cta {
  text-align: center;
  padding: 20px 12px;
}
.empty-cta-icon {
  font-size: 28px;
  margin-bottom: 8px;
  opacity: 0.5;
  line-height: 1;
}
.empty-cta-msg {
  font-family: var(--ff-ui);
  font-size: 12px;
  color: var(--t3);
  margin-bottom: 6px;
}
.empty-cta-hint {
  font-family: var(--ff-mono);
  font-size: 10px;
  color: var(--t4, var(--t3));
  opacity: 0.7;
  letter-spacing: 0.02em;
  text-align: center;
  padding: 18px 0;
}

/* ── Last Updated ──────────────────────────────────────────────── */
.last-updated {
  font-family: var(--ff-mono);
  font-size: 10px;
  color: var(--t4);
  letter-spacing: 0.06em;
  text-align: center;
  padding: 20px 0 0;
  margin-top: 24px;
  border-top: 1px solid var(--bdr);
}

/* ── Drag Handle & SortableJS ──────────────────────────────────── */
.drag-handle {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 14px;
  color: var(--t4);
  cursor: grab;
  opacity: 0;
  transition: opacity 0.2s;
}

.card:hover .drag-handle { opacity: 1; }
.card-ghost { opacity: 0.4; }
.card-chosen { transform: scale(1.02); box-shadow: 0 8px 24px rgba(0,0,0,0.12); }

/* ── Card Menu Button ─────────────────────────────────────────── */
.card-menu-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--t4);
  font-size: 18px;
  letter-spacing: 2px;
  cursor: pointer;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s, background 0.15s, color 0.15s;
  z-index: 2;
}

.card:hover .card-menu-btn { opacity: 1; }
.card-menu-btn:hover { background: var(--surf-2); color: var(--t1); }

/* ── Card Menu Dropdown ───────────────────────────────────────── */
.card-menu-dropdown {
  z-index: 200;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--bdr-h);
  border-radius: var(--r);
  padding: 6px 0;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12), 0 1px 4px rgba(0,0,0,0.06);
  animation: menuIn 0.15s var(--ease);
}

@keyframes menuIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.card-menu-item {
  display: block;
  width: 100%;
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--t2);
  font-family: var(--ff-ui);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.card-menu-item:hover { background: var(--surf-2); color: var(--t1); }
.card-menu-item.active { color: var(--cyan); font-weight: 600; }
.card-menu-danger { color: var(--danger); }
.card-menu-danger:hover { background: var(--danger-10); color: var(--danger); }

.card-menu-divider {
  height: 1px;
  background: var(--bdr);
  margin: 4px 0;
}

.card-menu-section {
  border-bottom: 1px solid var(--bdr);
  padding-bottom: 4px;
  margin-bottom: 4px;
}

/* ── Card Manager Panel ────────────────────────────────────────── */
/* ── Card Manager Panel ────────────────────────────────────────── */
.card-manager-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 340px;
  background: var(--surface);
  border-left: 1px solid var(--bdr);
  z-index: 150;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.22,1,0.36,1);
  overflow-y: auto;
  padding: 0;
  box-shadow: -8px 0 32px rgba(0,0,0,0.08);
}

.card-manager-panel.open { transform: translateX(0); }

.card-manager-overlay {
  position: fixed;
  inset: 0;
  background: rgba(24,40,32,0.25);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 149;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.card-manager-overlay.open { opacity: 1; pointer-events: auto; }

.cm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--bdr);
}

.cm-title {
  font-family: var(--ff-disp);
  font-size: 20px;
  font-weight: 600;
  color: var(--t1);
  letter-spacing: -0.01em;
}

.cm-close-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--bdr);
  background: transparent;
  color: var(--t3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.cm-close-btn:hover { background: var(--surf-2); color: var(--t1); border-color: var(--bdr-h); }

.cm-body {
  padding: 8px 0;
}

.cm-section {
  padding: 16px 24px;
}

.cm-section + .cm-section {
  border-top: 1px solid var(--bdr);
}

.cm-section-title {
  font-family: var(--ff-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--t3);
  margin-bottom: 12px;
}

.cm-toggle-list,
.cm-widget-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.cm-toggle-item {
  padding: 8px 0;
  border-top: 1px solid var(--bdr);
}

.cm-toggle-item:first-child { border-top: none; }

.cm-toggle-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.cm-card-toggle {
  position: relative;
  width: 36px;
  height: 20px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--surf-3);
  border: 1px solid var(--bdr);
  border-radius: 10px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}

.cm-card-toggle:checked {
  background: var(--cyan);
  border-color: var(--cyan);
}

.cm-card-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: transform 0.2s;
}

.cm-card-toggle:checked::after { transform: translateX(16px); }

.cm-card-name {
  font-family: var(--ff-ui);
  font-size: 13px;
  color: var(--t1);
}

.cm-widget-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-top: 1px solid var(--bdr);
}

.cm-widget-item:first-child { border-top: none; }

.cm-widget-name {
  font-family: var(--ff-ui);
  font-size: 13px;
  font-weight: 500;
  color: var(--t1);
}

.cm-remove-widget-btn {
  background: transparent;
  border: 1px solid var(--bdr);
  color: var(--t3);
  font-family: var(--ff-ui);
  font-size: 10px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cm-remove-widget-btn:hover {
  background: var(--danger-10, rgba(192,57,43,0.08));
  border-color: var(--danger, #c0392b);
  color: var(--danger, #c0392b);
}

.cm-widget-types {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.cm-add-widget-type-btn {
  background: transparent;
  border: 1px solid var(--bdr);
  color: var(--t2);
  font-family: var(--ff-ui);
  font-size: 12px;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.cm-add-widget-type-btn:hover {
  background: var(--cyan-10, rgba(0,210,211,0.07));
  border-color: var(--cyan);
  color: var(--cyan);
}

.cm-add-widget-type-btn:hover { background: var(--cyan-18); }

.cm-widget-form {
  background: var(--surf-2);
  border: 1px solid var(--bdr);
  border-radius: 10px;
  padding: 16px;
  margin-top: 8px;
}

.cm-form-title {
  font-family: var(--ff-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--t2);
  margin-bottom: 12px;
}

.cm-field {
  margin-bottom: 10px;
}

.cm-field-label {
  font-family: var(--ff-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t3);
  display: block;
  margin-bottom: 4px;
}

.cm-field-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--bdr);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: var(--ff-ui);
  font-size: 13px;
  color: var(--t1);
  outline: none;
  transition: border-color 0.15s;
}

.cm-field-input:focus { border-color: var(--cyan); }

.cm-form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}

.cm-add-confirm-btn {
  background: var(--cyan);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 7px 16px;
  font-family: var(--ff-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s;
}

.cm-add-confirm-btn:hover { background: var(--cyan-deep); }

.cm-add-cancel-btn {
  background: transparent;
  color: var(--t3);
  border: 1px solid var(--bdr);
  border-radius: 6px;
  padding: 7px 16px;
  font-family: var(--ff-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.cm-add-cancel-btn:hover { background: var(--surf-2); color: var(--t1); }

/* ── Widget: Notes ─────────────────────────────────────────────── */
.notes-textarea {
  width: 100%;
  min-height: 120px;
  border: 1px solid var(--bdr);
  border-radius: 8px;
  padding: 12px;
  background: var(--bg);
  color: var(--t1);
  font-family: var(--ff-ui);
  font-size: 13px;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}

.notes-textarea:focus { border-color: var(--cyan); }

/* ── Widget: Weather ───────────────────────────────────────────── */
/* ── Weather Widget ────────────────────────────────────────────── */
.wx-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-right: 30px; /* clear three-dot menu */
}
.wx-loc-btn {
  background: none;
  border: none;
  font-family: var(--ff-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--t1);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  transition: color 0.15s;
}
.wx-loc-btn:hover { color: var(--cyan); }
.wx-detect-btn {
  background: none;
  border: 1px solid var(--bdr);
  color: var(--t3);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.wx-detect-btn:hover { background: var(--surf-2); color: var(--t1); border-color: var(--bdr-h, var(--bdr)); }

/* Current conditions */
.wx-now {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.wx-now-icon {
  flex-shrink: 0;
  line-height: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wx-now-text {
  flex: 1;
  min-width: 0;
}
.wx-now-top {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.wx-now-temp {
  font-family: var(--ff-disp);
  font-size: 36px;
  font-weight: 600;
  color: var(--t1);
  line-height: 1;
}
.wx-now-desc {
  font-family: var(--ff-ui);
  font-size: 14px;
  font-weight: 500;
  color: var(--t2);
}
.wx-now-feels {
  font-family: var(--ff-mono);
  font-size: 10px;
  color: var(--t3);
  margin-top: 6px;
  letter-spacing: 0.02em;
}

/* 2-hour breakdown */
.wx-hourly {
  display: flex;
  gap: 2px;
  padding: 10px 0;
  border-top: 1px solid var(--bdr);
  border-bottom: 1px solid var(--bdr);
  margin-bottom: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.wx-hourly::-webkit-scrollbar { display: none; }
.wx-h-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 44px;
  flex: 1;
  padding: 4px 0;
}
.wx-h-time {
  font-family: var(--ff-mono);
  font-size: 9px;
  color: var(--t3);
  letter-spacing: 0.02em;
}
.wx-h-temp {
  font-family: var(--ff-ui);
  font-size: 11px;
  font-weight: 600;
  color: var(--t1);
}

/* 3-day forecast */
.wx-forecast {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.wx-f-day {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}
.wx-f-day + .wx-f-day { border-top: 1px solid var(--bdr); }
.wx-f-label {
  font-family: var(--ff-ui);
  font-size: 12px;
  font-weight: 500;
  color: var(--t2);
  width: 42px;
}
.wx-f-day svg { flex-shrink: 0; }
.wx-f-desc {
  font-family: var(--ff-ui);
  font-size: 11px;
  color: var(--t3);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wx-f-hi {
  font-family: var(--ff-ui);
  font-size: 12px;
  font-weight: 600;
  color: var(--t1);
}
.wx-f-lo {
  font-family: var(--ff-ui);
  font-size: 12px;
  color: var(--t3);
  width: 32px;
  text-align: right;
}

/* Location modal items */
.wx-loc-list { padding: 8px 24px; }
.wx-loc-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--bdr);
  border-radius: 10px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.wx-loc-item:hover { border-color: var(--bdr-h, var(--bdr)); background: var(--surf-2); }
.wx-loc-item.active {
  border-color: var(--cyan);
  background: var(--cyan-10, rgba(0,210,211,0.07));
}
.wx-loc-name {
  font-family: var(--ff-ui);
  font-size: 13px;
  font-weight: 500;
  color: var(--t1);
  flex: 1;
}
.wx-loc-coord {
  font-family: var(--ff-mono);
  font-size: 9px;
  color: var(--t4, var(--t3));
  opacity: 0.6;
}
.wx-loc-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.wx-loc-set-main {
  background: none;
  border: 1px solid var(--bdr);
  color: var(--t3);
  font-family: var(--ff-mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s;
}
.wx-loc-set-main:hover {
  background: var(--cyan-10, rgba(74,125,94,0.08));
  border-color: var(--cyan);
  color: var(--cyan);
}
.wx-loc-main {
  font-family: var(--ff-mono);
  font-size: 8px;
  font-weight: 600;
  color: var(--cyan);
  background: var(--cyan-10, rgba(74,125,94,0.08));
  padding: 1px 5px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  vertical-align: middle;
  margin-left: 4px;
}
.wx-loc-del {
  background: none;
  border: none;
  color: var(--t4, var(--t3));
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  border-radius: 4px;
  transition: color 0.15s;
}
.wx-loc-del:hover { color: var(--danger, #c0392b); }

/* Search */
.wx-search-wrap { padding: 0 24px 8px; }
.wx-search-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--bdr);
  border-radius: 8px;
  background: var(--surf-2);
  color: var(--t1);
  font-family: var(--ff-ui);
  font-size: 12px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.wx-search-input:focus { border-color: var(--cyan); }
.wx-search-results { margin-top: 6px; }
.wx-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s;
}
.wx-result:hover { background: var(--surf-2); }
.wx-result-city {
  font-family: var(--ff-ui);
  font-size: 12px;
  font-weight: 500;
  color: var(--t1);
}
.wx-result-region {
  font-family: var(--ff-ui);
  font-size: 10px;
  color: var(--t3);
}
.wx-no-result {
  font-size: 11px;
  color: var(--t3);
  padding: 8px 4px;
  text-align: center;
}

/* ── Weather icon animations ─────────────────────────────────── */
@keyframes wxSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes wxDrift {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(3px); }
}
@keyframes wxGlow {
  0%, 100% { opacity: 0.85; }
  50%      { opacity: 1; }
}
@keyframes wxTwinkle {
  0%, 100% { opacity: 0.3; }
  50%      { opacity: 1; }
}
@keyframes wxRain {
  0%   { transform: translateY(0); opacity: 0.65; }
  100% { transform: translateY(6px); opacity: 0; }
}
@keyframes wxRainLight {
  0%   { transform: translateY(0); opacity: 0.55; }
  100% { transform: translateY(4px); opacity: 0; }
}
@keyframes wxSnow {
  0%   { transform: translateY(0); opacity: 0.75; }
  50%  { transform: translateX(2px) translateY(4px); opacity: 0.5; }
  100% { transform: translateX(-1px) translateY(8px); opacity: 0; }
}
@keyframes wxFlash {
  0%, 90%, 100% { opacity: 0.9; }
  92%           { opacity: 0.2; }
  95%           { opacity: 0.9; }
  97%           { opacity: 0.3; }
}
.wx-anim-spin   { animation: wxSpin 20s linear infinite; }
.wx-anim-drift  { animation: wxDrift 4s ease-in-out infinite; }
.wx-anim-glow   { animation: wxGlow 3s ease-in-out infinite; }
.wx-anim-twinkle { animation: wxTwinkle 2s ease-in-out infinite; }
.wx-anim-rain > line      { animation: wxRain 1.2s linear infinite; }
.wx-anim-rain > line:nth-child(2) { animation-delay: 0.3s; }
.wx-anim-rain > line:nth-child(3) { animation-delay: 0.6s; }
.wx-anim-rain > line:nth-child(4) { animation-delay: 0.9s; }
.wx-anim-rain-light > line { animation: wxRainLight 1.5s linear infinite; }
.wx-anim-rain-light > line:nth-child(2) { animation-delay: 0.4s; }
.wx-anim-rain-light > line:nth-child(3) { animation-delay: 0.8s; }
.wx-anim-snow > circle    { animation: wxSnow 2.5s ease-in-out infinite; }
.wx-anim-snow > circle:nth-child(2) { animation-delay: 0.5s; }
.wx-anim-snow > circle:nth-child(3) { animation-delay: 1s; }
.wx-anim-snow > circle:nth-child(4) { animation-delay: 1.5s; }
.wx-anim-snow > circle:nth-child(5) { animation-delay: 2s; }
.wx-anim-flash  { animation: wxFlash 4s ease-in-out infinite; }

/* Location dots carousel */
.wx-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  padding-top: 8px;
}
.wx-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--bdr);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.wx-dot:hover { background: var(--t3); }
.wx-dot.active {
  background: var(--cyan);
  transform: scale(1.3);
}
.wx-dot-prev,
.wx-dot-next {
  background: none;
  border: none;
  color: var(--t4, var(--t3));
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.wx-dot-prev { margin-right: 4px; }
.wx-dot-next { margin-left: 4px; }
.wx-dot-prev:hover,
.wx-dot-next:hover {
  color: var(--cyan);
  background: var(--surf-2);
}

/* Responsive: card size */
.card-md .wx-now-temp { font-size: 46px; }
.card-lg .wx-now-temp { font-size: 52px; }
.card-md .wx-hourly, .card-lg .wx-hourly { gap: 4px; }
.card-md .wx-h-slot, .card-lg .wx-h-slot { min-width: 52px; }

/* ── Widget: Quote ─────────────────────────────────────────────── */
.quote-refresh-btn {
  position: absolute;
  top: 10px;
  right: 44px; /* sits just left of the card-menu (3-dot) button */
  background: transparent;
  border: 1px solid var(--bdr);
  color: var(--t3);
  width: 26px;
  height: 26px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  z-index: 5;
}
.quote-refresh-btn:hover {
  background: var(--surf-2);
  color: var(--cyan);
  border-color: var(--cyan);
}
.quote-refresh-btn.spinning svg {
  animation: gmailSpin 0.6s linear;
}
.quote-body {
  text-align: center;
  padding: 8px 0;
}

.quote-text {
  font-family: var(--ff-disp);
  font-size: 18px;
  font-weight: 300;
  font-style: italic;
  color: var(--t2);
  line-height: 1.6;
  margin: 0 0 12px 0;
  border: none;
  padding: 0;
}

.quote-author {
  font-family: var(--ff-mono);
  font-size: 11px;
  color: var(--t3);
  font-style: normal;
}

.quote-category-tag {
  display: inline-block;
  margin-top: 8px;
  font-family: var(--ff-mono);
  font-size: 9px;
  color: var(--t4, var(--t3));
  background: var(--surf-2);
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ── Quote Category Modal ─────────────────────────────────────── */
.quote-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modalFadeIn 0.18s ease;
}
@keyframes modalFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.quote-modal {
  background: var(--surface);
  border: 1px solid var(--bdr);
  border-radius: 16px;
  width: 480px;
  max-width: 94vw;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 16px 64px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.08);
  animation: modalSlideIn 0.22s ease;
}
@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.quote-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 0;
}
.quote-modal-header h3 {
  margin: 0;
  font-family: var(--ff-ui);
  font-size: 14px;
  font-weight: 600;
  color: var(--t1);
  letter-spacing: 0.02em;
}
.quote-modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--t4, var(--t3));
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.quote-modal-close:hover {
  color: var(--t1);
  background: var(--surf-2);
}

.quote-modal-actions {
  display: flex;
  gap: 8px;
  padding: 12px 24px 0;
}
.quote-modal-all,
.quote-modal-none {
  background: transparent;
  border: 1px solid var(--bdr);
  color: var(--t3);
  font-family: var(--ff-ui);
  font-size: 10px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
  cursor: pointer;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.quote-modal-all:hover,
.quote-modal-none:hover {
  background: var(--surf-2);
  color: var(--t1);
  border-color: var(--bdr-h, var(--bdr));
}

.quote-modal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 14px 24px;
}

/* Each category is a clean pill — no native checkbox */
.quote-modal-item {
  display: flex;
  align-items: center;
  gap: 0;
  font-size: 12px;
  color: var(--t3);
  cursor: pointer;
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid var(--bdr);
  background: transparent;
  transition: all 0.15s ease;
  user-select: none;
}
.quote-modal-item:hover {
  border-color: var(--bdr-h, var(--bdr));
  background: var(--surf-2);
}
.quote-modal-item.checked {
  background: var(--cyan-10, rgba(0,210,211,0.07));
  border-color: var(--cyan);
  color: var(--t1);
}

/* Hide the native checkbox */
.quote-modal-item input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.quote-modal-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--ff-ui);
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: 0.01em;
}
.quote-modal-count {
  font-family: var(--ff-mono);
  font-size: 9px;
  color: var(--t4, var(--t3));
  opacity: 0.45;
  flex-shrink: 0;
  margin-left: 6px;
}
.quote-modal-item.checked .quote-modal-count {
  opacity: 0.65;
  color: var(--cyan);
}

.quote-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px 18px;
  border-top: 1px solid var(--bdr);
  margin-top: 2px;
}
.quote-modal-total {
  font-size: 10px;
  color: var(--t4, var(--t3));
  font-family: var(--ff-mono);
  letter-spacing: 0.02em;
}
.quote-modal-btns {
  display: flex;
  gap: 8px;
}
.quote-modal-shuffle {
  background: transparent;
  border: 1px solid var(--bdr);
  color: var(--t3);
  padding: 6px 16px;
  border-radius: 8px;
  font-family: var(--ff-ui);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.quote-modal-shuffle:hover {
  background: var(--surf-2);
  color: var(--t1);
  border-color: var(--bdr-h, var(--bdr));
}
.quote-modal-save {
  background: var(--cyan);
  color: #fff;
  border: none;
  padding: 6px 22px;
  border-radius: 8px;
  font-family: var(--ff-ui);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.15s, box-shadow 0.15s;
}
.quote-modal-save:hover {
  background: var(--cyan-deep);
  box-shadow: 0 2px 8px rgba(0,210,211,0.25);
}

@media (max-width: 480px) {
  .quote-modal-grid { grid-template-columns: repeat(2, 1fr); }
  .quote-modal { width: 96vw !important; max-width: 96vw !important; border-radius: 14px; }
  .quote-modal-header { padding: 16px 18px 0; }
  .quote-modal-actions { padding: 10px 18px 0; }
  .quote-modal-grid { padding: 12px 18px; }
  .quote-modal-footer { padding: 10px 18px 14px; }
}

/* ── Card Resize Handles (desktop) ───────────────────────────── */

/* Shared handle base */
.card-resize-r,
.card-resize-b {
  position: absolute;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.2s;
}
.card:hover .card-resize-r,
.card:hover .card-resize-b { opacity: 1; }

/* Right edge — horizontal */
.card-resize-r {
  top: 0;
  right: -5px;
  width: 10px;
  height: 100%;
  cursor: col-resize;
}
.card-resize-r::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 3px;
  height: 28px;
  border-radius: 2px;
  background: var(--cyan);
  opacity: 0.4;
  transition: opacity 0.15s, height 0.15s;
}
.card-resize-r:hover::after {
  opacity: 0.8;
  height: 44px;
}

/* Bottom edge — vertical */
.card-resize-b {
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 10px;
  cursor: row-resize;
}
.card-resize-b::after {
  content: '';
  position: absolute;
  bottom: 50%;
  left: 50%;
  transform: translate(-50%, 50%);
  width: 28px;
  height: 3px;
  border-radius: 2px;
  background: var(--cyan);
  opacity: 0.4;
  transition: opacity 0.15s, width 0.15s;
}
.card-resize-b:hover::after {
  opacity: 0.8;
  width: 44px;
}

/* ── Role Modal ───────────────────────────────────────────────── */
.role-modal-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 24px;
}
.role-modal-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px;
  border: 1px solid var(--bdr);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.role-modal-item:hover {
  border-color: var(--bdr-h, var(--bdr));
  background: var(--surf-2);
}
.role-modal-item.selected {
  background: var(--cyan-10, rgba(0,210,211,0.07));
  border-color: var(--cyan);
}
.role-modal-name {
  font-family: var(--ff-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--t1);
}
.role-modal-item.selected .role-modal-name {
  color: var(--cyan);
}
.role-modal-desc {
  font-family: var(--ff-ui);
  font-size: 11px;
  color: var(--t3);
  letter-spacing: 0.01em;
}

/* ── Custom-height cards — content grows to fill ──────────���──── */
.card-custom-h {
  display: flex;
  flex-direction: column;
}
.card-custom-h .card-content {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
}
/* Remove max-height caps so scrollable areas fill the card */
.card-custom-h .claude-convo {
  max-height: none;
  flex: 1 1 auto;
}
.card-custom-h .idea-list {
  max-height: none;
  flex: 1 1 auto;
}
.card-custom-h .week-section:last-child {
  flex: 1 1 auto;
}

/* Active resize state */
.card-resizing {
  user-select: none;
  opacity: 0.9;
  z-index: 10;
  box-shadow: 0 0 0 1px var(--cyan), var(--sh-h);
}

/* ── Task Add Row ─────────────────────────────────────────────── */
.task-add-row {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--bdr);
}

.task-add-input {
  flex: 1;
  font-size: 13px;
  padding: 8px 12px;
}

.task-add-btn {
  background: var(--cyan);
  color: #fff;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}

.task-add-btn:hover { background: var(--cyan-deep); }

/* This Week — per-track add row sits tighter under each section */
.task-add-row-week {
  margin-top: 6px;
  padding-top: 6px;
  border-top: none;
  margin-bottom: 12px;
}
.task-add-row-week .task-add-input {
  font-size: 12px;
  padding: 6px 10px;
}
.task-add-row-week .task-add-btn {
  width: 28px;
  height: 28px;
  font-size: 16px;
}

/* Active Projects — actions, add row, edit form */
.proj-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--bdr);
}
.proj-row:last-of-type { border-bottom: none; }
.proj-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.proj-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 150ms ease;
}
.proj-row:hover .proj-actions { opacity: 1; }
.proj-edit-btn,
.proj-del-btn {
  background: none;
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  color: var(--t3);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background 150ms ease, color 150ms ease;
}
.proj-edit-btn:hover { background: rgba(127,168,138,0.10); color: var(--cyan); }
.proj-del-btn:hover  { background: rgba(193,74,74,0.10);  color: var(--danger, #c14a4a); }

.proj-add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--bdr);
}
.proj-add-row .proj-add-name { flex: 1 1 100%; }
.proj-add-row .proj-add-meta { flex: 1 1 calc(50% - 3px); }
.proj-add-row .proj-add-btn {
  flex: 0 0 auto;
  padding: 8px 16px;
}

.proj-edit-form {
  margin-top: 10px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--bdr);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.proj-edit-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

@media (max-width: 640px) {
  /* Stack add-row inputs full-width and reveal edit/delete buttons (no hover on touch) */
  .proj-add-row .proj-add-name,
  .proj-add-row .proj-add-meta { flex: 1 1 100%; }
  .proj-add-row .proj-add-btn { width: 100%; padding: 10px 16px; font-size: 12px; }
  .proj-actions { opacity: 1; }
  .proj-edit-btn,
  .proj-del-btn { width: 32px; height: 32px; font-size: 16px; }
  .proj-edit-form { padding: 14px; gap: 10px; }
  .proj-edit-form .field-input { font-size: 14px; padding: 10px 12px; }
  .proj-edit-actions { gap: 10px; }
  .proj-edit-actions button { flex: 1; padding: 10px; font-size: 12px; }
}

@media (max-width: 640px) {
  /* This Week per-track add inputs — bigger tap targets */
  .task-add-row-week { margin-bottom: 14px; }
  .task-add-row-week .task-add-input {
    font-size: 13px;
    padding: 8px 12px;
    min-height: 36px;
  }
  .task-add-row-week .task-add-btn {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }
}

/* Quote scales with card size — desktop only */
@media (min-width: 1025px) {
  .card-md .quote-body { padding: 16px 24px; }
  .card-md .quote-text { font-size: 24px; line-height: 1.5; margin-bottom: 16px; }
  .card-md .quote-author { font-size: 12px; }

  .card-lg .quote-body { padding: 24px 48px; }
  .card-lg .quote-text { font-size: 28px; line-height: 1.5; margin-bottom: 18px; }
  .card-lg .quote-author { font-size: 13px; letter-spacing: 0.06em; }
}

/* ── Mobile Weather Panel ─────────────────────────────────────── */
.wx-mobile-modal {
  width: 360px;
  max-width: 94vw;
}
.wx-mobile-body {
  padding: 16px 24px;
}
.wx-mobile-locs {
  padding: 0 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wx-mobile-loc-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.wx-mobile-loc-pill {
  background: transparent;
  border: 1px solid var(--bdr);
  color: var(--t2);
  font-family: var(--ff-ui);
  font-size: 11px;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s;
}
.wx-mobile-loc-pill:hover {
  border-color: var(--bdr-h, var(--bdr));
  background: var(--surf-2);
}
.wx-mobile-loc-pill.active {
  background: var(--cyan-10, rgba(74,125,94,0.07));
  border-color: var(--cyan);
  color: var(--cyan);
  font-weight: 600;
}
.wx-mobile-manage {
  background: transparent;
  border: 1px solid var(--bdr);
  color: var(--t3);
  font-family: var(--ff-ui);
  font-size: 11px;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}
.wx-mobile-manage:hover {
  background: var(--surf-2);
  color: var(--t1);
  border-color: var(--bdr-h, var(--bdr));
}

/* ── Floating Chat Bubble ─────────────────────────────────────── */
.chat-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 500;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--cyan);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15), 0 1px 4px rgba(0,0,0,0.08);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.chat-bubble:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 28px rgba(0,0,0,0.2);
  background: var(--cyan-deep);
}
.chat-bubble.open {
  transform: scale(0.9);
  opacity: 0.6;
}
.chat-bubble-icon { display: block; }
.chat-bubble-label {
  position: absolute;
  bottom: -2px;
  right: -2px;
  background: var(--surface);
  color: var(--cyan);
  font-family: var(--ff-mono);
  font-size: 7px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Chat Panel */
.chat-panel {
  position: fixed;
  bottom: 88px;
  right: 24px;
  z-index: 499;
  width: 380px;
  max-height: 520px;
  background: var(--surface);
  border: 1px solid var(--bdr);
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  overflow: hidden;
}
.chat-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.chat-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--bdr);
}
.chat-hdr-info { display: flex; flex-direction: column; gap: 1px; }
.chat-hdr-title {
  font-family: var(--ff-disp);
  font-size: 16px;
  font-weight: 600;
  color: var(--t1);
}
.chat-hdr-sub {
  font-family: var(--ff-mono);
  font-size: 9px;
  color: var(--t3);
  letter-spacing: 0.03em;
}
.chat-close {
  background: none;
  border: 1px solid var(--bdr);
  color: var(--t3);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.chat-close:hover { background: var(--surf-2); color: var(--t1); }

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  min-height: 200px;
  max-height: 340px;
}

/* Welcome state */
.chat-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 0;
  gap: 12px;
}
.chat-welcome-icon { opacity: 0.3; }
.chat-welcome-msg {
  font-family: var(--ff-ui);
  font-size: 14px;
  font-weight: 500;
  color: var(--t2);
}
.chat-quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 4px;
}
.chat-quick-btn {
  background: transparent;
  border: 1px solid var(--bdr);
  color: var(--t2);
  font-family: var(--ff-ui);
  font-size: 11px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s;
}
.chat-quick-btn:hover {
  background: var(--cyan-10, rgba(74,125,94,0.07));
  border-color: var(--cyan);
  color: var(--cyan);
}

/* Messages */
.chat-msg { margin-bottom: 10px; }
.chat-msg-user { text-align: right; }
.chat-msg-assistant { text-align: left; }
.chat-msg-bubble {
  display: inline-block;
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-family: var(--ff-ui);
  font-size: 13px;
  line-height: 1.5;
  text-align: left;
}
.chat-msg-user .chat-msg-bubble {
  background: var(--cyan);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg-assistant .chat-msg-bubble {
  background: var(--surf-2);
  color: var(--t1);
  border-bottom-left-radius: 4px;
}
.chat-msg-bubble p { margin: 0 0 6px; }
.chat-msg-bubble p:last-child { margin: 0; }
.chat-msg-bubble ul { margin: 4px 0; padding-left: 16px; }
.chat-msg-bubble li { margin: 2px 0; }
.chat-msg-bubble strong { font-weight: 600; }
.chat-msg-bubble code {
  background: rgba(0,0,0,0.06);
  padding: 1px 4px;
  border-radius: 3px;
  font-family: var(--ff-mono);
  font-size: 12px;
}
.chat-typing {
  opacity: 0.6;
  font-style: italic;
}

/* Input footer */
.chat-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--bdr);
}
.chat-input {
  flex: 1;
  border: 1px solid var(--bdr);
  border-radius: 10px;
  padding: 9px 14px;
  font-family: var(--ff-ui);
  font-size: 13px;
  color: var(--t1);
  background: var(--surf-2);
  outline: none;
  transition: border-color 0.15s;
}
.chat-input:focus { border-color: var(--cyan); }
.chat-send {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: var(--cyan);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.chat-send:hover { background: var(--cyan-deep); }

/* Mobile chat */
@media (max-width: 640px) {
  .chat-bubble {
    bottom: 16px;
    right: 16px;
    width: 46px;
    height: 46px;
    z-index: 600;
  }
  .chat-bubble.open {
    /* Hide bubble when panel is open on mobile */
    opacity: 0;
    pointer-events: none;
    transform: scale(0);
  }
  .chat-bubble-icon { width: 20px; height: 20px; }

  /* Full-screen overlay behind panel */
  .chat-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
  }
  .chat-overlay.open {
    opacity: 1;
    pointer-events: auto;
  }

  .chat-panel {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    top: auto;
    width: 100%;
    max-height: 80vh;
    border-radius: 16px 16px 0 0;
    border-bottom: none;
    z-index: 601;
    box-shadow: 0 -4px 32px rgba(0,0,0,0.15);
  }
  .chat-body {
    min-height: 120px;
    max-height: calc(80vh - 130px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  .chat-footer {
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  }
  .chat-quick-prompts { gap: 4px; }
  .chat-quick-btn { font-size: 10px; padding: 5px 10px; }
  .chat-msg-bubble { font-size: 12px; max-width: 90%; }
}

/* ── Claude Bot ───────────────────────────────────────────────── */
.claude-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.claude-action-btn {
  background: var(--surf-2);
  border: 1px solid var(--bdr);
  color: var(--t2);
  font-family: var(--ff-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.claude-action-btn:hover {
  background: var(--cyan-10);
  border-color: var(--cyan-18);
  color: var(--cyan);
}

.claude-convo {
  min-height: 80px;
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 10px;
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
}

.claude-welcome {
  font-size: 12px;
  color: var(--t3);
  text-align: center;
  padding: 24px 12px;
}

.claude-msg {
  padding: 8px 12px;
  border-radius: 10px;
}

.claude-msg-user {
  background: var(--cyan-10);
  align-self: flex-end;
  max-width: 85%;
}

.claude-msg-assistant {
  background: var(--surf-2);
  align-self: flex-start;
  max-width: 90%;
}

.claude-msg-role {
  font-family: var(--ff-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t3);
  display: block;
  margin-bottom: 4px;
}

.claude-msg-body {
  font-size: 13px;
  color: var(--t1);
  line-height: 1.5;
}

.claude-msg-body p { margin: 0 0 8px 0; }
.claude-msg-body p:last-child { margin-bottom: 0; }
.claude-msg-body ul { margin: 4px 0; padding-left: 18px; }
.claude-msg-body li { margin-bottom: 2px; }
.claude-msg-body code {
  background: var(--surf-3);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: var(--ff-mono);
  font-size: 11px;
}

.claude-typing {
  color: var(--t3);
  font-style: italic;
  animation: pulse-sync 1.5s ease-in-out infinite;
}

.claude-input-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.claude-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--bdr);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: var(--ff-ui);
  font-size: 13px;
  color: var(--t1);
  outline: none;
  transition: border-color 0.15s;
}

.claude-input:focus {
  border-color: var(--cyan);
}

.claude-input:disabled {
  opacity: 0.5;
}

.claude-send {
  background: var(--cyan);
  border: none;
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}

.claude-send:hover {
  background: var(--cyan-deep);
}

.claude-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Global Scrollbars ─────────────────────────────────────────── */
::-webkit-scrollbar       { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--surf-2); }
::-webkit-scrollbar-thumb { background: var(--bdr-h); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--cyan-18); }

/* ── Responsive ────────────────────────────────────────────────── */
/* ── Tablet ────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .card-grid     { grid-template-columns: repeat(2, 1fr); }
  .card-lg       { grid-column: 1 / -1; }
  .prompts-grid  { grid-template-columns: 1fr 1fr; }
  .main          { padding: 20px 16px 52px; }
}

/* ── Mobile ────────────────────────────────────────────────── */
@media (max-width: 640px) {
  /* Grid: single column */
  .card-grid     { grid-template-columns: 1fr; gap: 14px; }
  .card-sm, .card-md, .card-lg, .card-wide { grid-column: span 1; }

  /* Header — compact mobile layout */
  .header        { padding: 0 12px; height: 48px; }
  .brand-name    { font-size: 16px; }
  .brand-sub     { display: none; }
  .brand-mark    { width: 16px; height: 16px; }

  /* Center: weather only */
  .header-center { display: flex; flex: 1; justify-content: center; align-items: center; gap: 6px; }
  .header-center #live-date { display: none; }

  /* Right: time + live + hamburger */
  .header-right  { gap: 8px; }
  .hdr-clock     { font-size: 10px; }
  .hdr-live      { font-size: 7px; }
  .hdr-desktop-only { display: none !important; }
  .hdr-mobile-only { display: flex !important; }
  .btn-icon      { width: 28px; height: 28px; }

  /* Mini weather in header center */
  .hdr-wx-mini {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    font-family: var(--ff-ui);
    font-size: 12px;
    font-weight: 500;
    color: var(--t2);
  }
  .hdr-wx-mini .hdr-wx-temp {
    font-family: var(--ff-disp);
    font-size: 14px;
    font-weight: 600;
    color: var(--t1);
  }
  .hdr-wx-mini .hdr-wx-sep {
    opacity: 0.3;
    font-size: 10px;
  }

  /* Main */
  .main          { padding: 12px 10px 80px; }

  /* Cards */
  .card          { padding: 16px 16px 16px; border-radius: 14px; }
  .c-header      { padding-right: 32px; margin-bottom: 12px; }
  .c-title       { font-size: 9px; letter-spacing: 0.10em; }
  .card-menu-btn { opacity: 1; top: 10px; right: 10px; width: 26px; height: 26px; }
  .drag-handle   { display: none; }
  .card-resize-r, .card-resize-b { display: none; }
  .card-hdr      { padding-right: 32px; margin-bottom: 10px; }
  .card-title    { font-size: 9px; letter-spacing: 0.10em; }

  /* Metrics */
  .metrics-grid  { grid-template-columns: 1fr 1fr; }
  .metric-num    { font-size: 28px; }

  /* Tasks */
  .task-row      { padding: 8px 0; }
  .task-text     { font-size: 12px; }
  .track-chip    { font-size: 8px; padding: 2px 6px; }
  .task-add-input { font-size: 12px; padding: 6px 10px; }
  .task-add-btn  { width: 30px; height: 30px; font-size: 16px; }

  /* Calendar */
  .cal-row       { padding: 8px 0; }
  .cal-time      { font-size: 11px; min-width: 50px; }
  .cal-event     { font-size: 12px; }
  .cal-add-btn   { font-size: 8px; padding: 2px 8px; }
  .cal-form-times { flex-direction: column; gap: 6px; }
  .cal-form-sep  { display: none; }

  /* Claude Assistant */
  .claude-actions { gap: 4px; }
  .claude-action-btn { font-size: 9px; padding: 4px 8px; }
  .claude-convo  { max-height: 200px; min-height: 60px; }
  .claude-input  { font-size: 12px; padding: 6px 10px; }
  .claude-send   { width: 30px; height: 30px; }
  .claude-msg-body { font-size: 12px; }

  /* Idea Queue — mobile */
  .idea-row { padding: 7px 0; font-size: 12px; }
  .idea-tag { font-size: 8px; padding: 2px 6px; }
  .idea-input { font-size: 12px !important; padding: 7px 10px; }

  /* This Week — mobile */
  .week-section { margin-bottom: 12px; }
  .week-section-title { font-size: 9px; letter-spacing: 0.08em; }
  .week-section .task-row { padding: 7px 0; }

  /* Active Projects — mobile */
  .proj-row { padding: 8px 0; }
  .proj-name { font-size: 12px; }

  /* Gmail — compact on mobile */
  .gmail-filter-toggle { gap: 3px; padding: 2px; margin-bottom: 10px; }
  .gmail-filter-btn { font-size: 10px; padding: 6px 6px; }
  .gmail-list { max-height: 320px; }
  .gmail-row { padding: 11px 0; gap: 10px; }
  /* No hover-margin trick on mobile (no hover state) */
  .gmail-row:hover { margin: 0; padding-left: 0; padding-right: 0; background: transparent; border-radius: 0; }
  .gmail-row:active { background: var(--surf-2); }
  .gmail-row-from { font-size: 12px; }
  .gmail-row-subject { font-size: 11px; }
  .gmail-row-snippet { font-size: 10px; }
  .gmail-row-time { font-size: 9px; }
  /* Touch targets — WCAG 2.5.5 minimum 44x44 for critical actions */
  .gmail-mark-read { width: 32px; height: 32px; font-size: 14px; }
  .gmail-refresh-btn { width: 32px; height: 32px; }
  .card-menu-btn { width: 36px !important; height: 36px !important; font-size: 20px !important; }
  .gmail-footer { margin-top: 8px; padding-top: 8px; }
  .gmail-open-link { font-size: 9px; }
  .gmail-header-actions { gap: 6px; }
  .gmail-connect-btn { padding: 10px 22px; font-size: 13px; }

  /* Gmail message modal — body content overrides on mobile */
  .gmail-msg-body-html { font-size: 13.5px; line-height: 1.6; }
  .gmail-msg-body-html p { font-size: 13.5px; line-height: 1.6; }
  .gmail-msg-body-html li { font-size: 13.5px; line-height: 1.55; }
  .gmail-msg-body-html h1 { font-size: 17px; }
  .gmail-msg-body-html h2 { font-size: 15px; }
  .gmail-msg-body-html h3, .gmail-msg-body-html h4 { font-size: 14px; }
  .gmail-msg-body-html table { font-size: 12px; }
  .gmail-msg-body-html td, .gmail-msg-body-html th { padding: 5px 6px !important; }
  .gmail-msg-body-html blockquote { font-size: 12px; padding-left: 12px; margin: 12px 0; }
  .gmail-msg-body-html code { font-size: 11px; }
  .gmail-msg-body-html pre { font-size: 11px; padding: 10px 12px; }
  .gmail-msg-quote summary { font-size: 8px; }

  /* LinkedIn — compact on mobile */
  .li-hero       { gap: 8px; padding: 4px 0 10px; flex-wrap: wrap; }
  .li-stat-num   { font-size: 20px; }
  .li-stat-label { font-size: 7px; letter-spacing: 0.08em; }
  .li-engagement { gap: 8px; padding: 8px 0; }
  .li-eng-num    { font-size: 13px; }
  .li-eng-label  { font-size: 7px; letter-spacing: 0.08em; }
  .li-top-post   { margin-bottom: 8px; margin-top: 6px; }
  .li-top-label  { font-size: 8px; margin-bottom: 6px; }
  .li-top-content { padding: 10px 12px; }
  .li-post-text  { font-size: 11px; line-height: 1.4; }
  .li-post-stats { font-size: 10px; gap: 8px; margin-top: 6px; }
  .li-analytics-link { font-size: 9px; padding-top: 8px; margin-top: 8px; }

  /* Weather card hidden on mobile — data shown in header instead */
  [data-card-id^="weather"] { display: none !important; }

  /* Weather — simplified for mobile (fallback if no header) */
  .wx-header { padding-right: 32px; }
  .wx-now { gap: 10px; margin-bottom: 10px; }
  .wx-now-icon { width: 40px; height: 40px; }
  .wx-now-icon svg { width: 40px; height: 40px; }
  .wx-now-temp { font-size: 28px; }
  .wx-now-desc { font-size: 12px; }
  .wx-now-feels { font-size: 9px; }
  .wx-hourly { display: none; }
  .wx-forecast { gap: 0; }
  .wx-f-day { padding: 5px 0; gap: 8px; }
  .wx-f-label { font-size: 11px; width: 38px; }
  .wx-f-desc { font-size: 10px; }
  .wx-f-hi { font-size: 11px; }
  .wx-f-lo { font-size: 11px; }
  .wx-dots { margin-top: 8px; padding-top: 6px; }
  .wx-loc-btn { font-size: 12px; }

  /* Prompts */
  .prompts-grid  { grid-template-columns: 1fr; }

  /* Card Manager */
  .card-manager-panel { width: 100%; }
  .cm-header     { padding: 16px 18px; }
  .cm-section    { padding: 14px 18px; }

  /* Onboarding */
  .onboarding-card { margin: 12px; padding: 28px 20px; }
  .ob-roles      { grid-template-columns: 1fr; }
  .ob-cards-grid { grid-template-columns: 1fr; }
  .ob-title      { font-size: 22px; }

  /* Multi-column disabled on mobile */
  .card-md .li-posts,
  .card-lg .li-posts,
  .card-md .idea-list,
  .card-lg .idea-list { columns: 1; }

  /* Dropdown */
  .hdr-dropdown  { min-width: 140px; }
  .hdr-dropdown-item { padding: 8px 12px; font-size: 10px; }

  /* Prevent iOS auto-zoom on input focus — all inputs must be >= 16px */
  input[type="text"],
  input[type="search"],
  input[type="password"],
  input[type="email"],
  input[type="number"],
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* ── Focus Now card — unified scrollable task hub ─────────────────
   The single source of truth for tasks/events/projects/ideas.
   Scrollable so it can hold a complex environment without growing
   the card. Sage-themed scrollbar for visual continuity. */
.fn-scroll {
  max-height: 420px;
  overflow-y: auto;
  margin: 0 -4px;
  padding: 0 4px;
  /* Smooth scroll on touch */
  -webkit-overflow-scrolling: touch;
}
/* Sage scrollbar — blends with the brand instead of system gray */
.fn-scroll::-webkit-scrollbar {
  width: 6px;
}
.fn-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.fn-scroll::-webkit-scrollbar-thumb {
  background: rgba(127, 168, 138, 0.25);
  border-radius: 3px;
}
.fn-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(127, 168, 138, 0.45);
}
.fn-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgba(127, 168, 138, 0.25) transparent;
}

.fn-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 4px;
  border-top: 1px solid var(--bdr);
  transition: background 0.15s, opacity 0.2s;
}
.fn-row:first-of-type { border-top: none; }
.fn-row.fn-clickable { cursor: pointer; }
.fn-row.fn-clickable:hover { background: rgba(127, 168, 138, 0.06); }

/* The check element — doubles as priority indicator + checkbox */
.fn-check {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1.5px solid var(--bdr-h, var(--bdr));
  background: transparent;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s, transform 0.15s;
}

/* Non-checkable items (calendar / project / idea) get a small dot instead */
.fn-row.fn-no-check .fn-check {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: var(--t4);
}

/* Priority color drives the unchecked check border + the dot fill */
.fn-row.fn-tier-high.fn-can-check .fn-check { border-color: var(--danger, #c14a4a); }
.fn-row.fn-tier-med.fn-can-check  .fn-check { border-color: var(--cyan); }
.fn-row.fn-tier-low.fn-can-check  .fn-check { border-color: var(--bdr-h, var(--bdr)); }

.fn-row.fn-tier-high.fn-no-check  .fn-check { background: var(--danger, #c14a4a); }
.fn-row.fn-tier-med.fn-no-check   .fn-check { background: var(--cyan); }
.fn-row.fn-tier-low.fn-no-check   .fn-check { background: var(--t4); opacity: 0.6; }

/* Checked state — sage filled square with white checkmark */
.fn-row.fn-checked .fn-check {
  background: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(127, 168, 138, 0.18);
}
.fn-row.fn-clickable:hover .fn-check { transform: scale(1.08); }

.fn-text {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: var(--t1);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.fn-row.fn-tier-low .fn-text { color: var(--t3); }

/* Completed rows — strikethrough + dimmed text + reduced opacity */
.fn-row.fn-checked {
  opacity: 0.6;
}
.fn-row.fn-checked .fn-text {
  text-decoration: line-through;
  color: var(--t3);
}
.fn-row.fn-checked:hover {
  opacity: 0.85;
}

.fn-hint {
  font-family: var(--ff-mono);
  font-size: 9px;
  color: var(--t4);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
  padding: 3px 7px;
  background: var(--surf-2);
  border-radius: 999px;
}
.fn-row.fn-tier-high .fn-hint {
  background: rgba(193, 74, 74, 0.10);
  color: var(--danger, #c14a4a);
}
.fn-row.fn-checked .fn-hint {
  background: var(--surf-2);
  color: var(--t4);
}

/* Section divider between active + completed */
.fn-section-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 4px 6px;
  margin-top: 4px;
}
.fn-section-divider::before,
.fn-section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--bdr);
}
.fn-section-label {
  font-family: var(--ff-mono);
  font-size: 9px;
  color: var(--t4);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  white-space: nowrap;
}
.fn-section-empty {
  padding: 18px 4px;
  text-align: center;
  font-family: var(--ff-disp, Georgia, serif);
  font-style: italic;
  font-size: 13px;
  color: var(--t3);
}

/* Tidy footer — appears only when redundant source cards are still visible */
.fn-tidy {
  padding: 10px 4px 2px;
  border-top: 1px solid var(--bdr);
  margin-top: 6px;
  text-align: center;
}
.fn-tidy-btn {
  background: none;
  border: none;
  padding: 6px 10px;
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--t3);
  cursor: pointer;
  border-radius: 4px;
  transition: color 150ms ease, background 150ms ease;
}
.fn-tidy-btn:hover {
  color: var(--cyan);
  background: rgba(127, 168, 138, 0.06);
}

@media (max-width: 640px) {
  .fn-scroll { max-height: 360px; }
  .fn-text { font-size: 12.5px; }
  .fn-hint { font-size: 8.5px; padding: 2px 6px; }
  .fn-row { padding: 12px 4px; min-height: 44px; }
  .fn-check { width: 22px; height: 22px; }
  .fn-row.fn-no-check .fn-check { width: 10px; height: 10px; }
}

/* ──────────────────────────────────────────────────────────────────
   LANE B — Mobile responsiveness polish (Apr 7, 2026)
   Audit fixes: tap targets to WCAG 2.5.5 (44x44px), narrow phone
   layout breaks, modal padding on landscape phones
   ────────────────────────────────────────────────────────────────── */

/* ── Tap targets — WCAG 2.5.5 minimum 44x44px for critical actions ── */
@media (max-width: 640px) {
  /* Gmail mark-as-read button on every message row */
  .gmail-mark-read {
    width: 44px !important;
    height: 44px !important;
    font-size: 16px !important;
  }

  /* Calendar edit + delete buttons on every event row */
  .cal-edit-btn,
  .cal-del-btn {
    width: 44px !important;
    height: 44px !important;
    font-size: 14px !important;
  }
  /* Always show calendar actions on mobile (no hover state to reveal them) */
  .cal-actions {
    opacity: 1 !important;
  }

  /* Task checkbox — bigger tap zone via padding-based hit area */
  .task-check {
    width: 22px;
    height: 22px;
    margin-top: 0;
    /* Expand effective tap area to 44px via outline trick */
    outline: 11px solid transparent;
    outline-offset: 0;
  }
  .task-row {
    /* Ensure the whole row is at least 44px tall for tap purposes */
    min-height: 44px;
    align-items: center;
  }

  /* Header dropdown menu — let it shrink on narrow phones */
  .hdr-dropdown {
    min-width: 140px;
  }
}

/* ── Gmail message modal — landscape phone padding fix ── */
@media (max-width: 896px) and (orientation: landscape),
       (max-width: 480px) {
  .gmail-msg-panel {
    padding: 20px 22px !important;
    max-height: 92vh !important;
  }
  .gmail-msg-hdr {
    margin-bottom: 14px !important;
  }
  .gmail-msg-subject {
    font-size: 16px !important;
    line-height: 1.35 !important;
  }
  .gmail-msg-sender-row {
    gap: 10px !important;
  }
  .gmail-msg-avatar {
    width: 36px !important;
    height: 36px !important;
    font-size: 14px !important;
  }
}

/* ── Ultra-narrow phones (sub-360px: small Android, iPhone SE landscape) ── */
@media (max-width: 360px) {
  /* Platform metrics — collapse 2-col to 1-col when even 2 is too cramped */
  .metrics-grid {
    grid-template-columns: 1fr !important;
  }
  /* Gmail filter pills — smaller text + padding so all 3 fit */
  .gmail-filter-btn {
    font-size: 9px !important;
    padding: 6px 8px !important;
    letter-spacing: 0.02em !important;
  }
  /* Weather modal — tighten padding so the card breathes on tiny screens */
  .wx-mobile-modal {
    width: 92vw !important;
    padding: 16px 14px !important;
  }
  /* Card padding — give content more horizontal room on tiny screens */
  .c-body, .card {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
}

/* ── LinkedIn info tooltips — tap-to-reveal on touch devices ── */
/* hover:none picks up devices without a hovering pointer (i.e., touch) */
@media (hover: none) and (pointer: coarse) {
  .li-info {
    /* Make focusable via JS (tabindex='0' on these elements would help)
       but at minimum, increase tap target so users can hit them */
    width: 18px !important;
    height: 18px !important;
    font-size: 10px !important;
    cursor: pointer;
  }
  /* Show tooltip on :focus (which fires on tap when element has tabindex) */
  .li-info:focus::after,
  .li-info:active::after {
    opacity: 1 !important;
  }
}

/* ──────────────────────────────────────────────────────────────────
   Calendar — Day / Week / Month view tabs
   ────────────────────────────────────────────────────────────────── */
.cal-view-tabs {
  display: flex;
  gap: 2px;
  margin: 4px 0 14px;
  background: rgba(127, 168, 138, 0.06);
  padding: 3px;
  border-radius: 8px;
  width: fit-content;
}
.cal-view-tab {
  background: transparent;
  border: none;
  padding: 5px 14px;
  font-family: var(--ff-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--t3);
  cursor: pointer;
  border-radius: 6px;
  transition: background 150ms ease, color 150ms ease;
}
.cal-view-tab:hover { color: var(--t1); }
.cal-view-tab.active {
  background: var(--bg);
  color: var(--cyan);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* Scrollable container — keeps card height bounded for week/month
   views. Sticky day headers so labels stay visible while scrolling. */
.cal-scroll {
  overflow-y: auto;
  overflow-x: hidden;
  /* Sage-tinted scrollbar to match Focus Now */
  scrollbar-width: thin;
  scrollbar-color: rgba(127, 168, 138, 0.30) transparent;
  /* Negative margin reclaims card padding so scroll fills edge-to-edge */
  margin: 0 -2px;
  padding: 0 2px;
}
.cal-scroll-week  { max-height: 420px; }
.cal-scroll-month { max-height: 480px; }
.cal-scroll::-webkit-scrollbar { width: 6px; }
.cal-scroll::-webkit-scrollbar-track { background: transparent; }
.cal-scroll::-webkit-scrollbar-thumb {
  background: rgba(127, 168, 138, 0.25);
  border-radius: 3px;
}
.cal-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(127, 168, 138, 0.50);
}

.cal-day-group {
  margin-bottom: 8px;
}
.cal-day-group:last-child { margin-bottom: 0; }
.cal-day-header {
  font-family: var(--ff-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--t3);
  padding: 8px 4px 4px;
  border-bottom: 1px solid var(--bdr);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Sticky inside .cal-scroll so date labels stay visible */
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 1;
}
.cal-day-count {
  font-size: 9px;
  color: var(--t4);
  letter-spacing: 0.06em;
  background: rgba(127, 168, 138, 0.10);
  padding: 1px 6px;
  border-radius: 8px;
}

/* Tighter event rows when grouped (week) so more fit in view */
.cal-scroll .cal-row {
  padding: 6px 4px;
  font-size: 12.5px;
}
.cal-scroll .cal-time {
  min-width: 56px;
  font-size: 11px;
}

/* ──────────────────────────────────────────────────────────────────
   Calendar — Month grid view
   ────────────────────────────────────────────────────────────────── */
.cal-month {
  margin-top: 4px;
}
.cal-month-title {
  font-family: var(--ff-disp, Georgia, serif);
  font-size: 16px;
  color: var(--t1);
  text-align: center;
  margin-bottom: 10px;
  font-weight: 500;
}
.cal-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.cal-month-dow {
  font-family: var(--ff-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--t4);
  text-align: center;
  padding: 4px 0 6px;
}
.cal-month-cell {
  position: relative;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: inherit;
  color: var(--t2);
  padding: 0;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.cal-month-cell:hover:not(.cal-month-blank) {
  background: rgba(127, 168, 138, 0.08);
  color: var(--t1);
}
.cal-month-blank {
  cursor: default;
  pointer-events: none;
}
.cal-month-cell.is-today {
  border-color: var(--cyan);
  color: var(--cyan);
  font-weight: 600;
}
.cal-month-cell.is-selected {
  background: var(--cyan);
  color: #fff;
  border-color: var(--cyan);
}
.cal-month-cell.is-selected.is-today {
  /* Selected today still highlighted, but selected wins */
  background: var(--cyan);
  color: #fff;
}
.cal-month-day {
  font-size: 12px;
  line-height: 1;
}
.cal-month-dot {
  position: absolute;
  bottom: 4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--cyan);
}
.cal-month-cell.is-selected .cal-month-dot {
  background: #fff;
}

/* Selected-day events panel below grid */
.cal-month-panel {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--bdr);
  max-height: 200px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(127,168,138,0.30) transparent;
}
.cal-month-panel::-webkit-scrollbar { width: 6px; }
.cal-month-panel::-webkit-scrollbar-track { background: transparent; }
.cal-month-panel::-webkit-scrollbar-thumb { background: rgba(127,168,138,0.25); border-radius: 3px; }
.cal-month-panel-header {
  font-family: var(--ff-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--t3);
  margin-bottom: 6px;
}
.cal-month-panel-today {
  background: rgba(127, 168, 138, 0.14);
  color: var(--cyan);
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: 6px;
}
.cal-month-panel-empty {
  font-style: italic;
  font-size: 12.5px;
  color: var(--t4);
  padding: 6px 0;
}
.cal-month-panel-list .cal-row {
  padding: 6px 4px;
  font-size: 12.5px;
}
.cal-month-panel-list .cal-time {
  min-width: 56px;
  font-size: 11px;
}

@media (max-width: 640px) {
  .cal-month-title { font-size: 15px; margin-bottom: 8px; }
  .cal-month-grid { gap: 1px; }
  .cal-month-day { font-size: 12px; font-weight: 500; }
  .cal-month-dow { font-size: 9px; padding: 3px 0 4px; }
  .cal-month-cell { border-radius: 5px; min-height: 38px; }
  /* Bigger tap target wins over square aspect on phones */
  .cal-month-dot { bottom: 3px; width: 5px; height: 5px; }
  .cal-month-panel { max-height: 180px; }
  .cal-month-panel-list .cal-row { padding: 8px 4px; min-height: 36px; }
  .cal-view-tabs { width: 100%; justify-content: space-between; }
  .cal-view-tab { flex: 1; padding: 7px 8px; font-size: 11px; }
  .cal-scroll-week  { max-height: 360px; }
  .cal-scroll-month { max-height: 420px; }
  .cal-scroll .cal-row { padding: 8px 4px; min-height: 36px; font-size: 13px; }
  .cal-day-header { padding: 10px 4px 5px; font-size: 9.5px; }
}

@media (max-width: 360px) {
  /* Very narrow phones — drop month cell labels to ensure dots show */
  .cal-month-cell { min-height: 34px; }
  .cal-month-day { font-size: 11px; }
}

/* ──────────────────────────────────────────────────────────────────
   Quick Capture Modal
   ────────────────────────────────────────────────────────────────── */
.cap-overlay {
  position: fixed; inset: 0;
  background: rgba(20, 28, 22, 0.55);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 9000; padding: 24px;
  animation: fb-fade-in 150ms ease-out;
}
.cap-panel {
  position: relative;
  background: var(--bg, #fff);
  border-radius: 12px;
  border: 1px solid var(--bdr);
  border-left: 3px solid var(--cyan);
  width: 100%; max-width: 640px;
  max-height: 90vh; overflow-y: auto;
  padding: 32px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.18);
  animation: fb-slide-in 200ms ease-out;
}
.cap-close {
  position: absolute; top: 14px; right: 14px;
  width: 28px; height: 28px;
  border: none; background: transparent; color: var(--t3);
  cursor: pointer; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  transition: background 150ms ease, color 150ms ease;
}
.cap-close:hover { background: rgba(127,168,138,0.10); color: var(--t1); }
.cap-eyebrow {
  font-family: var(--ff-mono);
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--cyan); margin-bottom: 8px;
}
.cap-title {
  font-family: var(--ff-disp, 'Cormorant Garamond', Georgia, serif);
  font-size: 26px; font-weight: 500;
  color: var(--t1);
  margin: 0 0 14px;
  line-height: 1.2;
}
.cap-tabs {
  display: flex; gap: 4px;
  margin-bottom: 14px;
  background: rgba(127,168,138,0.06);
  padding: 3px;
  border-radius: 8px;
  width: fit-content;
}
.cap-tab {
  background: transparent;
  border: none;
  padding: 6px 12px;
  font-family: var(--ff-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--t3);
  cursor: pointer;
  border-radius: 6px;
  transition: background 150ms ease, color 150ms ease;
}
.cap-tab.active {
  background: var(--bg);
  color: var(--cyan);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.cap-sub {
  font-size: 13px; line-height: 1.5;
  color: var(--t3); margin: 0 0 14px;
}
.cap-textarea {
  width: 100%; box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid var(--bdr);
  border-radius: 8px;
  background: var(--bg);
  color: var(--t1);
  font-family: inherit; font-size: 14px; line-height: 1.55;
  resize: vertical; min-height: 160px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.cap-textarea:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(127, 168, 138, 0.16);
}
.cap-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 14px; gap: 12px;
}
.cap-hint {
  font-family: var(--ff-mono);
  font-size: 10px; letter-spacing: 0.06em;
  color: var(--t4); text-transform: uppercase;
}
.cap-submit {
  background: var(--cyan); color: #fff;
  border: none; padding: 10px 22px;
  border-radius: 8px;
  font-family: var(--ff-mono);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  cursor: pointer;
  transition: background 150ms ease, transform 100ms ease;
}
.cap-submit:hover:not(:disabled) { background: var(--cyan-h, #6a9075); }
.cap-submit:active:not(:disabled) { transform: scale(0.97); }
.cap-submit:disabled { opacity: 0.6; cursor: not-allowed; }

/* Confirmation step */
.cap-result { margin-top: 20px; }
.cap-result-empty {
  font-style: italic; color: var(--t3);
  padding: 14px; text-align: center;
}
.cap-result-head {
  font-family: var(--ff-mono);
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--t3);
  margin-bottom: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--bdr);
}
.cap-items {
  display: flex; flex-direction: column;
  gap: 6px; margin-bottom: 14px;
}
.cap-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--bdr);
  border-radius: 8px;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}
.cap-item:hover {
  background: rgba(127,168,138,0.04);
  border-color: var(--cyan);
}
.cap-item-check {
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--cyan);
}
.cap-item-icon {
  font-size: 14px;
  margin-top: 1px;
  flex-shrink: 0;
}
.cap-item-body {
  display: flex; flex-direction: column; gap: 2px;
  flex: 1; min-width: 0;
}
.cap-item-kind {
  font-family: var(--ff-mono);
  font-size: 9px; font-weight: 600;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--cyan);
}
.cap-item-text {
  font-size: 13.5px;
  color: var(--t1);
  line-height: 1.4;
  word-wrap: break-word;
}
.cap-item-meta {
  font-family: var(--ff-mono);
  font-size: 10px;
  color: var(--t4);
  letter-spacing: 0.04em;
}
.cap-notes {
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(127,168,138,0.05);
  border-radius: 8px;
}
.cap-notes-label {
  font-family: var(--ff-mono);
  font-size: 9px; font-weight: 600;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--t3); margin-bottom: 4px;
}
.cap-notes-body {
  font-size: 12.5px; color: var(--t2);
  line-height: 1.5; white-space: pre-wrap;
}
.cap-confirm-actions {
  display: flex; gap: 8px;
  justify-content: flex-end;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--bdr);
}

@media (max-width: 640px) {
  .cap-overlay { padding: 12px; align-items: flex-end; }
  .cap-panel { padding: 24px 20px; max-width: none; max-height: 95vh; }
  .cap-title { font-size: 22px; }
  .cap-textarea { min-height: 140px; }
}

/* Gmail trouble hint — appears under Connect button when reauth keeps failing */
.gmail-trouble-hint {
  margin-top: 14px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--t4);
  text-align: center;
}
.gmail-trouble-hint a {
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.gmail-trouble-hint a:hover {
  color: var(--cyan-h, #6a9075);
}

/* ──────────────────────────────────────────────────────────────────
   Morning Briefing card
   ────────────────────────────────────────────────────────────────── */
.mb-body {
  padding: 8px 4px 4px;
  font-family: var(--ff-body, var(--ff-disp, Georgia, serif));
  font-size: 14px;
  line-height: 1.65;
  color: var(--t1);
  transition: opacity 200ms ease;
}
.mb-body.mb-fading {
  opacity: 0.45;
}
.mb-body p {
  margin: 0 0 12px;
  color: var(--t2, var(--t1));
}
.mb-body p:last-child { margin-bottom: 0; }
.mb-list {
  margin: 8px 0 12px;
  padding-left: 22px;
  counter-reset: mb;
  list-style: none;
}
.mb-list li {
  position: relative;
  margin: 0 0 10px;
  padding-left: 4px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--t1);
  counter-increment: mb;
}
.mb-list li::before {
  content: counter(mb);
  position: absolute;
  left: -22px;
  top: 1px;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ff-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--cyan);
  background: rgba(127, 168, 138, 0.10);
  border-radius: 50%;
}
.mb-body strong {
  color: var(--t1);
  font-weight: 600;
}
/* End-of-day: a subdued mono heading before "Tomorrow's top 3" */
.mb-body .eod-heading {
  font-family: var(--ff-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--t3);
  margin: 14px 0 6px;
}
.mb-meta {
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--t4);
  margin-right: 8px;
}
.mb-refresh {
  background: none;
  border: none;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: var(--t3);
  cursor: pointer;
  transition: color 150ms ease, background 150ms ease, transform 300ms ease;
}
.mb-refresh:hover {
  color: var(--cyan);
  background: rgba(127, 168, 138, 0.08);
}
.mb-refresh:active {
  transform: rotate(180deg);
}

@media (max-width: 640px) {
  .mb-body { font-size: 13.5px; line-height: 1.6; }
  .mb-body p { margin-bottom: 10px; }
  .mb-list { padding-left: 20px; }
  .mb-list li { font-size: 13px; padding-left: 2px; }
  .mb-list li::before { left: -20px; width: 16px; height: 16px; font-size: 9px; }
  .mb-body .eod-heading { margin: 12px 0 4px; }
  .mb-meta { font-size: 8.5px; margin-right: 4px; }
}

/* ──────────────────────────────────────────────────────────────────
   Beta Feedback Modal
   ────────────────────────────────────────────────────────────────── */
.fb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 28, 22, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  padding: 24px;
  animation: fb-fade-in 150ms ease-out;
}
@keyframes fb-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.fb-panel {
  position: relative;
  background: var(--bg, #fff);
  border-radius: 12px;
  border: 1px solid var(--bdr);
  border-left: 3px solid var(--cyan);
  width: 100%;
  max-width: 520px;
  padding: 32px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.18);
  animation: fb-slide-in 200ms ease-out;
}
@keyframes fb-slide-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.fb-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--t3);
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms ease, color 150ms ease;
}
.fb-close:hover {
  background: rgba(127, 168, 138, 0.10);
  color: var(--t1);
}
.fb-eyebrow {
  font-family: var(--ff-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 8px;
}
.fb-title {
  font-family: var(--ff-disp, 'Cormorant Garamond', Georgia, serif);
  font-size: 26px;
  font-weight: 500;
  color: var(--t1);
  margin: 0 0 8px;
  line-height: 1.2;
}
.fb-sub {
  font-size: 13px;
  line-height: 1.5;
  color: var(--t3);
  margin: 0 0 18px;
}
.fb-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid var(--bdr);
  border-radius: 8px;
  background: var(--bg);
  color: var(--t1);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  min-height: 120px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.fb-textarea:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(127, 168, 138, 0.16);
}
.fb-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  gap: 12px;
}
.fb-hint {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--t4);
  text-transform: uppercase;
}
.fb-submit {
  background: var(--cyan);
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: 8px;
  font-family: var(--ff-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 150ms ease, transform 100ms ease;
}
.fb-submit:hover:not(:disabled) {
  background: var(--cyan-h, #6a9075);
}
.fb-submit:active:not(:disabled) {
  transform: scale(0.97);
}
.fb-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
@media (max-width: 640px) {
  .fb-overlay { padding: 12px; align-items: flex-end; }
  .fb-panel { padding: 24px 20px; max-width: none; }
  .fb-title { font-size: 22px; }
}
