:root {
  --bg: #0a0c12;
  --bg-2: #11141c;
  --panel: #161a24;
  --panel-2: #1d2230;
  --border: #242a3a;
  --border-soft: #1c2230;
  --text: #ecf0f7;
  --text-2: #b8bfd0;
  --muted: #7c849a;
  --muted-2: #4b5365;

  --accent: #8b5cf6;
  --accent-2: #a78bfa;
  --accent-glow: rgba(139,92,246,.20);

  --amber: #f59e0b;
  --amber-2: #fbbf24;
  --amber-glow: rgba(245,158,11,.20);

  --ok: #10b981;
  --ok-2: #34d399;
  --warn: #f59e0b;
  --danger: #f43f5e;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 20px 60px -20px rgba(0,0,0,.6);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.25);
  --transition: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background:
    radial-gradient(1000px 700px at 85% -200px, rgba(139,92,246,.10), transparent 60%),
    radial-gradient(800px 600px at -100px 110%, rgba(16,185,129,.05), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Inter", -apple-system, "SF Pro Display", system-ui, sans-serif;
  font-size: 14.5px;
  line-height: 1.55;
  letter-spacing: -0.005em;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent-2); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--text); text-decoration: none; }

h1 {
  font-size: 28px; margin: 0 0 4px;
  font-weight: 700; letter-spacing: -0.02em;
  line-height: 1.2;
}
h2 {
  font-size: 16px; margin: 36px 0 14px;
  font-weight: 600; letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 8px;
  color: var(--text-2);
}
h2 i { width: 18px; height: 18px; color: var(--muted); }
h3 { font-size: 15px; margin: 0 0 2px; font-weight: 600; letter-spacing: -0.005em; }

p { margin: 0 0 8px; }

/* lucide icon defaults */
[data-lucide] {
  width: 16px; height: 16px;
  stroke-width: 2;
  flex-shrink: 0;
  vertical-align: -3px;
}
.inline-icon { width: 14px; height: 14px; vertical-align: -2px; opacity: .8; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.big-icon { width: 32px; height: 32px; stroke-width: 1.5; }

.muted    { color: var(--muted); }
.small    { font-size: 12.5px; }
.mono     { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; }
.center   { text-align: center; }
.ok       { color: var(--ok-2); }
.danger   { color: var(--danger); }
.pad-2    { padding: 28px !important; }

/* ─── nav ─── */
.topnav {
  display: flex; align-items: center; gap: 36px;
  padding: 16px 32px;
  padding-top: max(16px, env(safe-area-inset-top));
  background: rgba(11,13,18,.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-soft);
  position: sticky; top: 0; z-index: 30;
}
.topnav .brand {
  display: flex; align-items: center; gap: 11px;
  font-weight: 800; font-size: 19px;
  letter-spacing: -0.02em;
  color: var(--text);
}
.topnav .brand i {
  width: 22px; height: 22px;
  color: var(--accent-2);
  filter: drop-shadow(0 0 8px var(--accent-glow));
}
.brand-logo {
  width: 48px; height: 48px;
  object-fit: contain;
  border-radius: 10px;
  display: block;
}
.brand-logo.large {
  width: 64px; height: 64px;
  border-radius: 12px;
}
@media (max-width: 720px) {
  .brand-logo { width: 38px; height: 38px; }
  .topnav .brand { font-size: 17px; }
}
.topnav .brand:hover { color: var(--text); }

.topnav .links {
  display: flex; gap: 4px; flex: 1;
}
.topnav .links a {
  color: var(--muted);
  padding: 10px 16px; border-radius: 10px;
  font-size: 15px; font-weight: 500;
  display: flex; align-items: center; gap: 9px;
  transition: all var(--transition);
}
.topnav .links a i { width: 17px; height: 17px; }
.topnav .links a:hover {
  background: var(--panel);
  color: var(--text);
}

.topnav-right { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}
.icon-btn:hover { background: var(--panel); color: var(--text); }

/* status pill */
.status-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px 5px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600;
  background: var(--panel-2);
  border: 1px solid var(--border);
  letter-spacing: -0.005em;
  transition: all var(--transition);
}
.status-pill .status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--muted-2);
}
.status-pill.idle    { color: var(--muted); }
.status-pill.idle    .status-dot { background: var(--muted-2); }
.status-pill.running {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #6d28d9);
  border-color: transparent;
  box-shadow: 0 0 20px var(--accent-glow);
}
.status-pill.running .status-dot {
  background: #fff;
  box-shadow: 0 0 0 0 rgba(255,255,255,.6);
  animation: pulse 1.5s infinite;
}
.status-pill.paused  { color: #1a1a1a; background: var(--warn); border-color: transparent; }
.status-pill.paused  .status-dot { background: rgba(0,0,0,.4); }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,255,255,.6); }
  70%  { box-shadow: 0 0 0 6px rgba(255,255,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}

/* ─── layout ─── */
.container { max-width: 1180px; margin: 32px auto 80px; padding: 0 28px; }

.hero {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; margin-bottom: 28px;
}
.hero p { margin: 0; }
.hero .actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ─── range selector ─── */
.range-bar {
  display: flex; align-items: center;
  margin: 0 0 18px;
  position: relative;
}
.range-group {
  display: inline-flex; gap: 2px;
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: 11px;
  padding: 4px;
}
.range-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 13px; font-weight: 500;
  padding: 6px 14px; border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  letter-spacing: -0.005em;
  display: inline-flex; align-items: center; gap: 5px;
}
.range-btn i { width: 13px; height: 13px; }
.range-btn:hover { color: var(--text); background: var(--panel-2); }
.range-btn.active {
  background: linear-gradient(135deg, var(--accent), #6d28d9);
  color: #fff;
  box-shadow: 0 2px 8px -2px var(--accent-glow);
}

/* custom date popover */
.custom-popover {
  position: absolute;
  top: calc(100% + 6px); left: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
  min-width: 320px;
  opacity: 0; pointer-events: none;
  transform: translateY(-4px);
  transition: all var(--transition);
  z-index: 50;
}
.custom-popover.open {
  opacity: 1; pointer-events: auto; transform: translateY(0);
}
.custom-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.custom-row .field { margin: 0; }
.custom-row input[type=date] {
  width: 100%;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; font-size: 13px;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
}
.custom-row input[type=date]:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.custom-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ─── avatars ─── */
.avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  flex-shrink: 0;
  display: block;
}
.avatar.medium { width: 56px; height: 56px; }
.avatar.large { width: 80px; height: 80px; }
.avatar.medium.fallback { font-size: 22px; }
.avatar.fallback {
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--accent-2);
  font-size: 16px;
  background: linear-gradient(135deg, rgba(139,92,246,.20), rgba(139,92,246,.05));
  border-color: rgba(139,92,246,.3);
  letter-spacing: 0;
}
.avatar.large.fallback { font-size: 32px; }

.account-identity {
  display: flex; align-items: center; gap: 12px;
  min-width: 0;
}
.account-identity h3 { margin-bottom: 0; }

.table-identity {
  display: flex; align-items: center; gap: 12px;
  min-width: 0;
}

.identity-row {
  display: flex; gap: 24px; align-items: flex-start;
}
.avatar-block {
  display: flex; flex-direction: column; align-items: center;
  flex-shrink: 0;
}
.avatar-block .btn { cursor: pointer; }
.identity-fields { flex: 1; min-width: 0; }

/* ─── cards ─── */
.card {
  background: linear-gradient(180deg, rgba(255,255,255,.02), transparent), var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 22px;
  transition: border-color var(--transition), transform var(--transition);
}
.card.no-pad { padding: 0; overflow: hidden; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px; margin-bottom: 8px;
}
.card.stat {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 20px;
}
.card.stat .stat-icon {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  border-radius: 11px;
  color: var(--muted);
}
.card.stat .stat-icon i { width: 18px; height: 18px; }
.card.stat .stat-icon.purple {
  background: linear-gradient(135deg, rgba(139,92,246,.18), rgba(139,92,246,.04));
  border-color: rgba(139,92,246,.3);
  color: var(--accent-2);
}
.card.stat .stat-icon.amber {
  background: linear-gradient(135deg, rgba(245,158,11,.18), rgba(245,158,11,.04));
  border-color: rgba(245,158,11,.3);
  color: var(--amber-2);
}
.card.stat .stat-icon.red {
  background: linear-gradient(135deg, rgba(244,63,94,.18), rgba(244,63,94,.04));
  border-color: rgba(244,63,94,.3);
  color: var(--danger);
}
.card.stat .big { font-size: 26px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
.card.stat .lbl { color: var(--muted); font-size: 12.5px; margin-top: 6px; font-weight: 500; }

/* ─── accounts grid ─── */
.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.account { display: flex; flex-direction: column; }
.account:hover {
  border-color: var(--border);
  transform: translateY(-1px);
}
.account-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.account-actions { display: flex; gap: 6px; }

.pill-group { margin: 16px 0 12px; }
.pill-label {
  font-size: 11.5px; color: var(--muted);
  margin-top: 10px; margin-bottom: 6px;
  display: flex; align-items: center; gap: 5px;
  text-transform: uppercase; letter-spacing: 0.06em;
  font-weight: 600;
}
.pill-label:first-child { margin-top: 0; }
.pill-label i { width: 12px; height: 12px; }

.schedule-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.pill i { width: 11px; height: 11px; opacity: .7; }
.pill.time {
  color: var(--accent-2);
  border-color: rgba(139,92,246,.3);
  background: rgba(139,92,246,.06);
}
.pill.time.story {
  color: var(--amber-2);
  border-color: rgba(245,158,11,.3);
  background: rgba(245,158,11,.06);
}

.account-meta {
  display: grid; gap: 6px;
  font-size: 12.5px;
  padding: 14px 0;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}
.account-meta > div {
  display: flex; justify-content: space-between; align-items: center;
  color: var(--muted);
}
.account-meta b { color: var(--text-2); font-weight: 500; }
.account-meta span { font-variant-numeric: tabular-nums; }

.last-run {
  font-size: 13px; padding: 12px 0;
  display: flex; align-items: center; gap: 8px;
  color: var(--text-2);
}
.last-run.muted { color: var(--muted); }
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted-2);
  flex-shrink: 0;
}
.dot.ok     { background: var(--ok); box-shadow: 0 0 12px rgba(16,185,129,.6); }
.dot.danger { background: var(--danger); box-shadow: 0 0 12px rgba(244,63,94,.6); }
.dot.muted  { background: var(--muted-2); }

.account .link {
  font-size: 13px; color: var(--accent-2);
  margin-top: auto; padding-top: 6px;
  display: inline-flex; align-items: center; gap: 4px;
}
.account .link i { width: 14px; height: 14px; transition: transform var(--transition); }
.account .link:hover i { transform: translateX(2px); }

.account.add {
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 8px;
  border: 1.5px dashed var(--border);
  background: transparent;
  color: var(--muted);
  min-height: 220px;
  transition: all var(--transition);
}
.account.add:hover {
  border-color: var(--accent);
  color: var(--accent-2);
  background: rgba(139,92,246,.04);
  transform: translateY(-1px);
}
.account.add i { color: currentColor; }

/* ─── buttons ─── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 9px;
  padding: 8px 14px; font-size: 13.5px; font-weight: 500;
  cursor: pointer; transition: all var(--transition);
  font-family: inherit;
  white-space: nowrap;
  letter-spacing: -0.005em;
}
.btn:hover { border-color: var(--muted-2); background: var(--border-soft); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), #6d28d9);
  border-color: transparent; color: #fff;
  box-shadow: 0 4px 18px -4px var(--accent-glow);
}
.btn.primary:hover { filter: brightness(1.1); box-shadow: 0 6px 22px -4px var(--accent-glow); }
.btn.amber {
  background: linear-gradient(135deg, var(--amber), #d97706);
  border-color: transparent; color: #fff;
  box-shadow: 0 4px 18px -4px var(--amber-glow);
}
.btn.amber:hover { filter: brightness(1.08); }
.btn.warn { background: var(--warn); border-color: var(--warn); color: #1a1a1a; }
.btn.warn:hover { filter: brightness(1.05); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; border-color: var(--border); }
.btn.ghost:hover { background: var(--panel-2); }
.btn.small { padding: 6px 11px; font-size: 12.5px; border-radius: 7px; }
.btn.small i { width: 14px; height: 14px; }
.btn.big { padding: 11px 22px; font-size: 14px; }
.btn.icon-only { padding: 7px; }
.btn.icon-only i { width: 15px; height: 15px; }
.btn:disabled { opacity: 0.5; cursor: wait; }

/* ─── tables ─── */
table.runs, table.accounts-table {
  width: 100%; border-collapse: collapse;
}
table th, table td {
  padding: 12px 18px; text-align: left;
  border-bottom: 1px solid var(--border-soft);
}
table th {
  background: var(--bg-2);
  font-weight: 600; color: var(--muted); font-size: 11.5px;
  text-transform: uppercase; letter-spacing: 0.06em;
}
table tr:last-child td { border-bottom: none; }
table tr:hover td { background: rgba(139,92,246,.025); }
table .actions-cell {
  display: flex; gap: 6px; justify-content: flex-end;
}

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px 3px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600;
  letter-spacing: -0.005em;
}
.badge i { width: 12px; height: 12px; }
.badge.ok     { background: rgba(16,185,129,.13);  color: var(--ok-2); }
.badge.danger { background: rgba(244,63,94,.13); color: var(--danger); }
.badge.muted  { background: var(--panel-2); color: var(--muted); }

/* ─── form sections ─── */
.card.section { margin-bottom: 16px; }
.section-title {
  margin: 0 0 18px;
  font-size: 14px; font-weight: 600;
  color: var(--text); letter-spacing: -0.005em;
  display: flex; align-items: center; gap: 8px;
}
.section-title i {
  width: 16px; height: 16px;
  color: var(--accent-2);
}

/* ─── forms ─── */
.edit-form, .acc-form { display: flex; flex-direction: column; gap: 0; }
.edit-form .field, .acc-form .field { margin-bottom: 16px; }
.edit-form .field:last-child, .acc-form .field:last-child { margin-bottom: 0; }
.edit-form label, .acc-form label {
  display: block; margin-bottom: 6px;
  font-weight: 500; font-size: 13px;
  color: var(--text-2);
  letter-spacing: -0.005em;
}
.edit-form input[type=text], .edit-form input[type=number],
.edit-form input[type=time], .edit-form input[type=password],
.edit-form textarea,
.acc-form select.folder-select,
.edit-form select.folder-select,
select.folder-select {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 36px 10px 13px;
  font-size: 13.5px;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238884a3' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
  transition: border-color var(--transition);
}
.acc-form select.folder-select:focus,
.edit-form select.folder-select:focus,
select.folder-select:focus {
  outline: none;
  border-color: var(--accent);
}
select.folder-select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.acc-form input[type=text], .acc-form input[type=number],
.acc-form input[type=time], .acc-form input[type=password],
.acc-form textarea {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 13px; font-size: 13.5px;
  font-family: inherit;
  transition: all var(--transition);
}
/* Safari/Chrome native time input dark theme */
.acc-form input[type=time], .edit-form input[type=time] {
  color-scheme: dark;
  font-variant-numeric: tabular-nums;
}
.edit-form input:focus, .edit-form textarea:focus,
.acc-form input:focus, .acc-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.edit-form input[disabled], .edit-form input[readonly],
.acc-form input[disabled], .acc-form input[readonly] {
  opacity: .55; cursor: not-allowed;
}
.edit-form textarea, .acc-form textarea {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  line-height: 1.6; font-size: 13px;
  resize: vertical;
  min-height: 90px;
}
.edit-form .grid-2, .acc-form .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.edit-form code, .acc-form code {
  background: var(--panel-2);
  padding: 1px 6px; border-radius: 4px;
  font-size: 12px;
}

/* ─── time list ─── */
.time-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.time-row {
  display: flex; gap: 8px; align-items: center;
}
.time-row input[type=time] { flex: 0 0 160px; font-variant-numeric: tabular-nums; }

/* ─── sticky save ─── */
.sticky-save {
  position: sticky; bottom: 0;
  background: linear-gradient(180deg, transparent, var(--bg) 60%);
  padding: 20px 0 0; margin-top: 4px;
  display: flex; justify-content: flex-end;
  z-index: 5;
}

/* ─── login ─── */
.login-card {
  max-width: 380px; margin: 100px auto;
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: var(--shadow);
}
.login-brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 22px;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.login-brand i { width: 24px; height: 24px; color: var(--accent-2); filter: drop-shadow(0 0 12px var(--accent-glow)); }
.login-card p { margin-top: 0; color: var(--muted); }
.login-card form { display: flex; gap: 8px; margin-top: 22px; }
.login-card input {
  flex: 1;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px;
  font-family: inherit; font-size: 14px;
}
.login-card input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.login-card button {
  background: linear-gradient(135deg, var(--accent), #6d28d9);
  border: none; color: #fff;
  border-radius: 8px;
  padding: 10px 18px; cursor: pointer;
  font-weight: 600; font-family: inherit;
}

/* ─── flash ─── */
.flash {
  padding: 12px 18px; margin: 16px 28px 0;
  border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 500;
  border: 1px solid transparent;
  display: flex; align-items: center; gap: 10px;
}
.flash i { width: 16px; height: 16px; flex-shrink: 0; }
.flash-success {
  background: rgba(16,185,129,.08);
  color: var(--ok-2);
  border-color: rgba(16,185,129,.25);
}
.flash-error {
  background: rgba(244,63,94,.08);
  color: var(--danger);
  border-color: rgba(244,63,94,.25);
}

/* ─── calendar ─── */
.cal-nav {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel); border: 1px solid var(--border-soft);
  border-radius: 11px; padding: 4px 4px 4px 8px;
}
.cal-month {
  padding: 0 8px;
  font-weight: 600; font-size: 14px;
  letter-spacing: -0.01em;
  min-width: 140px; text-align: center;
}
.cal-grid { background: var(--panel); }
.cal-header {
  display: grid; grid-template-columns: repeat(7, 1fr);
  background: var(--bg-2);
  border-bottom: 1px solid var(--border-soft);
}
.cal-header > div {
  padding: 10px 12px;
  font-size: 11.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted);
}
.cal-days {
  display: grid; grid-template-columns: repeat(7, 1fr);
}
.cal-day {
  min-height: 110px;
  padding: 8px 10px;
  border-right: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  display: flex; flex-direction: column; gap: 6px;
  position: relative;
}
.cal-day:nth-child(7n) { border-right: none; }
.cal-day.empty { background: var(--bg-2); }
.cal-day.past { opacity: .55; }
.cal-day.today {
  background: rgba(139,92,246,.04);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.cal-day.today .cal-day-num { color: var(--accent-2); font-weight: 700; }
.cal-day-num {
  font-size: 13px; font-weight: 500;
  color: var(--text-2);
}
.cal-runs { display: flex; flex-wrap: wrap; gap: 4px; }
.cal-pill {
  font-size: 10.5px; font-weight: 600;
  padding: 2px 6px; border-radius: 4px;
}
.cal-pill.ok     { background: rgba(16,185,129,.15); color: var(--ok-2); }
.cal-pill.danger { background: rgba(244,63,94,.15); color: var(--danger); }
.cal-schedule {
  display: flex; flex-direction: column; gap: 3px;
  margin-top: 2px;
}
.cal-event {
  font-size: 11px; font-weight: 500;
  padding: 2px 6px; border-radius: 4px;
  display: inline-flex; align-items: center; gap: 4px;
  font-variant-numeric: tabular-nums;
}
.cal-event i { width: 10px; height: 10px; }
.cal-event.post  { background: rgba(139,92,246,.10); color: var(--accent-2); }
.cal-event.story { background: rgba(245,158,11,.10); color: var(--amber-2); }
.cal-event-count {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(255,255,255,.10);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.cal-event-more {
  display: inline-flex; align-items: center;
  margin-top: 2px;
  padding: 3px 8px;
  font-size: 11px; font-weight: 600;
  color: var(--accent-2);
  background: rgba(139,92,246,.08);
  border: 1px dashed rgba(139,92,246,.25);
  border-radius: 6px;
  cursor: pointer;
  letter-spacing: -0.005em;
}
.cal-event-more:hover {
  background: rgba(139,92,246,.16);
  border-color: rgba(139,92,246,.4);
}
.cal-day.clickable { cursor: pointer; }
.cal-day.clickable:hover { background: rgba(255,255,255,.02); }

/* Day-detail modal */
.day-detail-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(6px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 60px 20px 20px;
  overflow-y: auto;
  animation: fadeIn .15s;
}
@keyframes fadeIn { from {opacity:0;} to {opacity:1;} }
.day-detail-modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
  width: 100%; max-width: 600px;
  box-shadow: 0 20px 50px rgba(0,0,0,.5);
}
.day-detail-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; padding-bottom: 14px;
  border-bottom: 1px solid var(--border-soft);
}
.day-detail-head h2 {
  margin: 0; font-size: 17px; font-weight: 700;
  letter-spacing: -0.01em;
}
.day-detail-section { margin-bottom: 20px; }
.day-detail-section:last-child { margin-bottom: 0; }
.day-detail-section h3 {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 10px; font-size: 13px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted);
}
.day-detail-section h3 i { width: 15px; height: 15px; color: var(--accent-2); }
.day-detail-section h3 .muted {
  margin-left: auto; font-size: 11.5px;
  font-weight: 500; text-transform: none; letter-spacing: 0;
}
.day-detail-row {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
}
.day-detail-row:last-child { border-bottom: none; }
.day-detail-time {
  flex-shrink: 0;
  background: var(--panel-2); color: var(--text);
  padding: 4px 9px; border-radius: 7px;
  font-size: 12.5px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--border-soft);
}
.day-detail-accounts {
  display: flex; flex-wrap: wrap; gap: 5px;
}
.day-detail-account {
  background: rgba(139,92,246,.10);
  color: var(--accent-2);
  border: 1px solid rgba(139,92,246,.20);
  padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 500;
}

/* ─── thumbnails (recent runs) ─── */
.thumb-mini {
  width: 44px; height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  display: block;
}
.thumb-mini.placeholder {
  display: flex; align-items: center; justify-content: center;
  color: var(--muted-2);
}
.thumb-mini.placeholder i { width: 18px; height: 18px; }

/* ─── calendar filters ─── */
.cal-filters {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.cal-filter-group { display: flex; align-items: center; gap: 8px; }
.cal-filter-label {
  font-size: 12.5px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600;
}
.cal-select {
  background: var(--panel); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 10px; font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}
.cal-select:focus { outline:none; border-color: var(--accent); }
.cal-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; user-select: none;
}
.cal-toggle input { accent-color: var(--accent); }
.cal-toggle input:not(:checked) + .pill { opacity: 0.4; }

/* ─── modal ─── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
  z-index: 100;
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  width: 90%; max-width: 440px;
  box-shadow: var(--shadow);
  transform: scale(.96);
  transition: transform var(--transition);
}
.modal-backdrop.open .modal { transform: scale(1); }
.modal input[type=text] {
  width: 100%;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 12px; font-size: 14px;
  font-family: inherit;
}
.modal input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.modal .field { margin-bottom: 14px; }
.modal .field label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; }

/* ─── account edit redesign ─── */

.acc-header {
  display: flex; align-items: center; gap: 18px;
  margin-bottom: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border-soft);
}
.acc-header-identity {
  display: flex; align-items: center; gap: 16px;
  flex: 1; min-width: 0;
}
.acc-header-identity h1 { margin: 0; font-size: 26px; line-height: 1.15; }
.acc-header-identity p   { margin: 2px 0 0; }

.avatar-block-mini {
  position: relative; flex-shrink: 0;
}
.avatar-upload-btn {
  position: absolute; bottom: 0; right: 0;
  width: 26px; height: 26px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  border: 2px solid var(--bg);
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
  transition: all var(--transition);
}
.avatar-upload-btn:hover { filter: brightness(1.1); transform: scale(1.05); }
.avatar-upload-btn i { width: 12px; height: 12px; }

/* tabs */
.acc-tabs {
  display: flex; gap: 4px;
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 5px;
  margin-bottom: 18px;
}
.acc-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 13.5px; font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: all var(--transition);
  letter-spacing: -0.005em;
}
.acc-tab i { width: 15px; height: 15px; }
.acc-tab:hover { color: var(--text); background: var(--panel-2); }
.acc-tab.active {
  background: linear-gradient(135deg, var(--accent), #6d28d9);
  color: #fff;
  box-shadow: 0 2px 10px -2px var(--accent-glow);
}

.acc-form { display: flex; flex-direction: column; gap: 0; }
.acc-panel { display: none; }
.acc-panel.active { display: block; }

/* section title with optional badge */
.section-title-mini {
  margin: 0 0 14px;
  font-size: 14px; font-weight: 600;
  color: var(--text);
  display: flex; align-items: center; gap: 8px;
  letter-spacing: -0.005em;
}
.section-title-mini i {
  width: 16px; height: 16px;
  color: var(--accent-2);
}
.pool-counter {
  margin-left: auto;
  font-size: 11.5px; font-weight: 500;
  color: var(--muted);
  background: var(--panel-2);
  padding: 3px 8px; border-radius: 999px;
  border: 1px solid var(--border-soft);
}

/* secret (password) field with reveal button */
.secret-field {
  position: relative;
  display: flex;
}
.secret-field input {
  flex: 1;
  padding-right: 42px !important;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px !important;
  letter-spacing: 0.5px;
}
.reveal-btn {
  position: absolute; right: 4px; top: 50%;
  transform: translateY(-50%);
  width: 30px; height: 30px;
  background: transparent;
  border: none;
  color: var(--muted);
  border-radius: 6px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.reveal-btn:hover { background: var(--panel-2); color: var(--text); }
.reveal-btn i { width: 16px; height: 16px; }

/* field label row with action button */
.field-label-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px;
  gap: 10px;
}
.field-label-row label { margin: 0; }

/* ─── settings rows (Stripe-style two-column layout) ─── */
.settings-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 22px 0 10px;
  padding: 0 2px;
  display: flex; align-items: center; gap: 8px;
}
.settings-section-title:first-child { margin-top: 4px; }
.settings-section-title .pool-counter { margin-left: auto; }

.settings-block {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  overflow: hidden;
}
.settings-block + .settings-section-title { margin-top: 26px; }

.settings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 24px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-soft);
  align-items: center;
}
.settings-row:last-child { border-bottom: none; }
.settings-row.stacked {
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: stretch;
}

.settings-label { min-width: 0; }
.settings-label-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
  margin-bottom: 3px;
}
.settings-label-help {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.settings-control { min-width: 0; }
.settings-control > input,
.settings-control > textarea,
.settings-control > select,
.settings-control > .secret-field { width: 100%; }
.settings-control.narrow { max-width: 140px; justify-self: end; width: 100%; }
.settings-control.wide { width: 100%; }
.settings-row.stacked .settings-control.narrow {
  max-width: none; justify-self: stretch;
}

.field-actions-row {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 8px; flex-wrap: wrap;
  margin-bottom: 2px;
}
.field-actions-row .spacer { flex: 1; }

@media (max-width: 720px) {
  .settings-row {
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: stretch;
  }
  .settings-control.narrow { max-width: none; justify-self: stretch; }
}

/* evolve details (collapsible) */
.evolve-details {
  background: linear-gradient(180deg, rgba(139,92,246,.06), rgba(139,92,246,.02));
  border: 1px solid rgba(139,92,246,.20);
  border-radius: 9px;
  margin-bottom: 14px;
  overflow: hidden;
}
.evolve-details > summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 14px;
  font-size: 12.5px; font-weight: 500;
  color: var(--text-2);
  display: flex; align-items: center; gap: 8px;
}
.evolve-details > summary::-webkit-details-marker { display: none; }
.evolve-details > summary > i { width: 14px; height: 14px; color: var(--accent-2); }
.evolve-details > summary > .muted { margin-left: auto; }
.evolve-details > summary::after {
  content: "›";
  margin-left: 4px;
  color: var(--muted);
  transition: transform var(--transition);
  font-size: 18px; line-height: 1;
}
.evolve-details[open] > summary::after { transform: rotate(90deg); }
.evolve-content {
  padding: 0 14px 12px;
  border-top: 1px solid rgba(139,92,246,.15);
  padding-top: 10px;
}

/* ─── recent changes panel (after auto-evolve) ─── */
.recent-changes {
  background: linear-gradient(180deg, rgba(139,92,246,.06), rgba(139,92,246,.02));
  border: 1px solid rgba(139,92,246,.25);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.recent-changes-header {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600;
  color: var(--accent-2);
  margin-bottom: 10px;
}
.recent-changes-header i { width: 14px; height: 14px; }
.recent-row {
  display: flex; gap: 10px; align-items: flex-start;
  margin-bottom: 8px;
}
.recent-row:last-child { margin-bottom: 0; }
.recent-label {
  font-size: 11.5px; font-weight: 600;
  padding: 3px 8px; border-radius: 999px;
  flex-shrink: 0; line-height: 1.4;
  letter-spacing: -0.005em;
}
.recent-label.new {
  background: rgba(16,185,129,.12);
  color: var(--ok-2);
  border: 1px solid rgba(16,185,129,.25);
}
.recent-label.removed {
  background: rgba(244,63,94,.10);
  color: var(--danger);
  border: 1px solid rgba(244,63,94,.25);
}
.recent-pills {
  display: flex; flex-wrap: wrap; gap: 5px;
  flex: 1;
}

/* ─── tooltips ─── */
[data-tooltip] { position: relative; }
[data-tooltip]::before,
[data-tooltip]::after {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
  z-index: 100;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  background: var(--panel-2);
  color: var(--text);
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  letter-spacing: -0.005em;
}
[data-tooltip]::before {
  content: "";
  bottom: calc(100% + 3px);
  border: 5px solid transparent;
  border-top-color: var(--border);
  width: 0; height: 0;
  padding: 0;
}
[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── mobile hamburger + helpers ─── */
.mobile-only { display: none; }
.desktop-only { display: inline-flex; }
.nav-toggle {
  display: none !important;
  background: var(--panel-2);
  border: 1px solid var(--border);
  width: 38px; height: 38px;
  border-radius: 9px;
  color: var(--text);
  cursor: pointer;
  align-items: center; justify-content: center;
  font-family: inherit;
  flex-shrink: 0;
  padding: 0;
}
.nav-toggle i { width: 20px; height: 20px; }
.nav-toggle:hover { background: var(--border-soft); }
.nav-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(2px);
  z-index: 25;
  opacity: 0;
  transition: opacity 0.2s;
}

/* ─── mobile ─── */
@media (max-width: 720px) {
  .mobile-only { display: flex; }
  .desktop-only { display: none !important; }
  .nav-toggle { display: inline-flex !important; }

  /* nav becomes hamburger drawer */
  .topnav {
    position: relative;
    padding: 14px 14px;
    padding-top: calc(14px + env(safe-area-inset-top));
    gap: 8px;
    min-height: 58px;
    align-items: center;
    background: var(--bg-2);
  }
  .topnav .brand {
    font-size: 15px;
    flex-shrink: 0;
  }
  .topnav .brand i { width: 16px; height: 16px; }
  .topnav-right {
    margin-left: auto;
    gap: 8px;
  }
  .topnav .links {
    position: fixed;
    top: calc(58px + env(safe-area-inset-top)); left: 0; right: 0;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 8px;
    gap: 2px;
    transform: translateY(-120%);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 28;
    box-shadow: var(--shadow);
  }
  .topnav .links a {
    padding: 12px 16px;
    font-size: 15px;
    border-radius: 8px;
  }
  .topnav .links a i { width: 16px; height: 16px; }

  body.nav-open .topnav .links { transform: translateY(0); }
  body.nav-open .nav-overlay {
    display: block;
    opacity: 1;
  }

  /* status pill smaller on mobile */
  .status-pill {
    padding: 4px 10px 4px 8px;
    font-size: 11.5px;
  }
  .status-pill .status-text {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* layout */
  .container { padding: 0 14px; margin-top: 18px; margin-bottom: 60px; }
  .hero { flex-direction: column; align-items: stretch; gap: 14px; }
  .hero h1 { font-size: 24px; }
  .hero .actions { display: flex; flex-wrap: wrap; }
  .hero .actions .btn { flex: 1; justify-content: center; }
  h2 { font-size: 15px; margin-top: 24px; }
  .grid-2 { grid-template-columns: 1fr !important; }

  /* stat cards: 2x2 grid */
  .cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .card.stat { padding: 14px; gap: 12px; }
  .card.stat .stat-icon { width: 36px; height: 36px; }
  .card.stat .stat-icon i { width: 16px; height: 16px; }
  .card.stat .big { font-size: 20px; }
  .card.stat .lbl { font-size: 11.5px; margin-top: 3px; }

  /* range bar wraps + scrolls if needed */
  .range-bar { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .range-group { flex-shrink: 0; }
  .range-btn { padding: 6px 10px; font-size: 12.5px; }
  .custom-popover {
    position: fixed;
    left: 14px; right: 14px;
    top: auto; bottom: 20px;
    min-width: 0;
  }
  .custom-row { grid-template-columns: 1fr 1fr; }

  /* account cards */
  .account-grid { grid-template-columns: 1fr; }
  .account .account-head { flex-wrap: wrap; }
  .account-actions { display: flex; gap: 8px; }
  .account-actions .btn.small { padding: 8px 12px; }
  .account-actions .btn.small i { width: 16px; height: 16px; }
  .account.add { min-height: 120px; }

  .avatar.medium { width: 48px; height: 48px; }
  .avatar.medium.fallback { font-size: 18px; }

  /* tables: horizontal scroll */
  .card.no-pad { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.runs, table.accounts-table { min-width: 580px; }
  table th, table td { padding: 10px 12px; font-size: 12.5px; }
  .thumb-mini { width: 40px; height: 40px; }

  /* form */
  .edit-form .card.section { padding: 16px; }
  .identity-row { flex-direction: column; align-items: center; gap: 16px; }
  .identity-row .identity-fields { width: 100%; }
  .sticky-save .btn { width: 100%; justify-content: center; }

  /* time picker rows */
  .time-row { gap: 6px; }
  .time-row input[type=time] { flex: 1; }

  /* calendar — compact */
  .cal-header > div { padding: 8px 4px; font-size: 10.5px; }
  .cal-day { min-height: 76px; padding: 4px 5px; }
  .cal-day-num { font-size: 11px; }
  .cal-event {
    font-size: 9.5px; padding: 1px 4px;
    overflow: hidden; white-space: nowrap;
  }
  .cal-event i { width: 8px; height: 8px; }
  .cal-pill { font-size: 9.5px; padding: 1px 4px; }
  .cal-filters { gap: 10px; }
  .cal-select { font-size: 13px; padding: 8px 10px; }

  /* tooltips off on mobile (hover doesn't exist) */
  [data-tooltip]:hover::before,
  [data-tooltip]:hover::after { display: none; }

  /* modal full-width */
  .modal { width: calc(100% - 28px); padding: 20px; }

  /* flash full-width */
  .flash { margin: 14px 14px 0; }

  /* hide thumbnail column on very small screens? — keep it for now, table scrolls */
}

/* ─── spenders page ─── */
.page-header {
  margin: 4px 0 18px;
}
.page-header h1 {
  font-size: 22px; font-weight: 700;
  margin: 0; letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 10px;
}
.page-header h1 i { width: 22px; height: 22px; color: var(--accent-2); }
.page-sub {
  margin: 6px 0 0; color: var(--muted);
  font-size: 13px;
}

.spenders-controls {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.spenders-filter {
  display: flex; align-items: center; gap: 8px;
}
.spenders-filter label {
  font-size: 12.5px; font-weight: 500; color: var(--muted);
}
.spenders-filter select {
  background: var(--panel); color: var(--text);
  border: 1px solid var(--border); border-radius: 9px;
  padding: 8px 12px; font-size: 13.5px; font-weight: 500;
  cursor: pointer; min-width: 180px;
}
.spenders-meta {
  font-size: 12.5px; color: var(--muted);
}

.spenders-card { padding: 0; overflow: hidden; }
.spenders-table {
  width: 100%; border-collapse: collapse;
}
.spenders-table thead th {
  text-align: left; padding: 12px 16px;
  font-size: 11.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom: 1px solid var(--border-soft);
  background: var(--panel-2);
}
.spenders-table thead th.num { text-align: right; }
.spenders-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13.5px;
}
.spenders-table tbody tr:last-child td { border-bottom: none; }
.spenders-table tbody tr:hover { background: rgba(255,255,255,0.02); }
.spenders-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.spenders-table .handle-cell { font-weight: 600; }
.spenders-table .col-status { width: 24px; padding-right: 0; }

.dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
}
.dot-online { background: var(--ok-2, #10b981); box-shadow: 0 0 0 3px rgba(16,185,129,0.15); }
.dot-offline { background: var(--muted-2, #555); }

.gem-cell, .money-cell {
  white-space: nowrap;
}
.gem-amount {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.gem-icon {
  width: 13px; height: 13px;
  color: var(--accent-2);
  vertical-align: -2px;
  opacity: 0.85;
  margin-left: 5px;
}

.money-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
}
.money-pill i {
  width: 13px; height: 13px;
  opacity: 0.9;
}
.money-lifetime {
  background: rgba(16, 185, 129, 0.10);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.22);
}
.money-balance {
  background: rgba(139, 92, 246, 0.10);
  color: #c4b5fd;
  border-color: rgba(139, 92, 246, 0.22);
}
.online-now {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600;
  color: var(--ok-2, #10b981);
}
.online-now::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok-2, #10b981);
  box-shadow: 0 0 6px rgba(16,185,129,0.6);
}
.rel-time {
  font-size: 12.5px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--muted);
}
.empty-state i { width: 40px; height: 40px; color: var(--accent-2); opacity: 0.5; }
.empty-state h3 { margin: 12px 0 6px; color: var(--text); font-weight: 600; }
.empty-state p { font-size: 13.5px; max-width: 460px; margin: 0 auto; }
.empty-state code {
  background: var(--panel-2); padding: 2px 6px; border-radius: 5px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12.5px; color: var(--text);
}

/* ─── per-account pause ─── */
.card.account.is-paused {
  opacity: 0.7;
  background: linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.005)), var(--panel);
}
.card.account.is-paused .schedule-pills,
.card.account.is-paused .pill-label { opacity: 0.6; }
.paused-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--panel-2);
  color: var(--muted);
  border: 1px solid var(--border-soft);
  padding: 2px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-left: 8px;
  vertical-align: middle;
}
.paused-badge i { width: 11px; height: 11px; }
.btn.small.ghost {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.3);
}
.btn.small.ghost:hover {
  background: rgba(148, 163, 184, 0.25);
  color: #fff;
  border-color: rgba(148, 163, 184, 0.45);
}
/* When the account is paused, the toggle becomes a green "resume" */
.card.account.is-paused .btn.small.ghost {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.35);
}
.card.account.is-paused .btn.small.ghost:hover {
  background: rgba(16, 185, 129, 0.28);
  color: #fff;
}

/* ─── master spenders page ─── */
.master-add-card {
  padding: 20px;
  margin-bottom: 16px;
}
.master-add-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr auto;
  gap: 10px;
  align-items: stretch;
}
.master-add-grid input {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 13px;
  font-size: 13.5px;
  font-family: inherit;
}
.master-add-grid input:focus {
  outline: none;
  border-color: var(--accent);
}
.master-add-grid .btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 16px;
}
.master-add-grid .btn i { width: 16px; height: 16px; }

.master-sync-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}

.pill-row {
  display: flex; flex-wrap: wrap; gap: 5px;
}
.pill-account {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 500;
  background: var(--panel-2);
  color: var(--muted);
  border: 1px solid var(--border-soft);
}
.pill-account.ok {
  background: rgba(16,185,129,0.10);
  color: var(--ok-2, #10b981);
  border-color: rgba(16,185,129,0.22);
}
.pill-account i { width: 11px; height: 11px; }

@media (max-width: 720px) {
  .master-add-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── notifications page ─── */
.notif-intro {
  padding: 20px;
  margin-bottom: 18px;
}
.notif-intro-step {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 0;
  font-size: 13.5px;
}
.notif-intro-step:not(:last-child) {
  border-bottom: 1px solid var(--border-soft);
}
.notif-step-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}
.notif-intro code {
  background: var(--panel-2); padding: 2px 7px; border-radius: 5px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12.5px;
}

.notif-discover-bar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px; flex-wrap: wrap;
}

.discover-card {
  padding: 16px; margin-bottom: 22px;
}
.discover-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 12px 0;
  border-bottom: 1px solid var(--border-soft);
  flex-wrap: wrap;
}
.discover-row:last-child { border-bottom: none; }
.discover-info { flex: 1; min-width: 180px; }
.discover-name { font-weight: 600; font-size: 13.5px; }
.discover-add {
  display: flex; gap: 8px; align-items: center;
}
.discover-add input {
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 12px; font-size: 13px;
  min-width: 160px;
}

.section-h2 {
  margin: 26px 0 12px;
  font-size: 13px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted);
}

.recipients-list {
  display: flex; flex-direction: column; gap: 14px;
}
.recipient-card {
  padding: 18px 20px;
  transition: opacity var(--transition);
}
.recipient-card.is-disabled { opacity: 0.55; }
.recipient-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-soft);
}
.recipient-name {
  font-size: 15px; font-weight: 700;
  letter-spacing: -0.005em;
  margin-bottom: 2px;
}
.recipient-card .mono {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.recipient-actions {
  display: flex; gap: 6px; flex-wrap: wrap;
}

.alert-toggles-label {
  font-size: 11.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 10px;
}
.alert-toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}
.alert-toggle {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 12px;
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  cursor: pointer;
  font-size: 13px; font-weight: 500;
  transition: all var(--transition);
  user-select: none;
}
.alert-toggle:hover {
  border-color: var(--border);
  background: var(--panel);
}
.alert-toggle input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  margin: 0;
}
.alert-toggle input[type="checkbox"]:checked + span {
  color: var(--text);
}
.alert-toggle span {
  color: var(--muted);
  flex: 1;
}

.alert-save-row {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 12px; margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
}
.save-status {
  font-size: 12.5px; font-weight: 500;
  color: var(--muted);
  transition: color var(--transition);
}
.save-status.dirty  { color: #fbbf24; }
.save-status.saving { color: var(--muted); }
.save-status.saved  { color: var(--ok-2, #10b981); }
.save-status.error  { color: var(--danger); }

.btn-sm {
  padding: 7px 14px;
  font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-sm i { width: 14px; height: 14px; }
.btn-sm:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.row-actions {
  display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end;
}
.btn-mini {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border-soft); border-radius: 7px;
  padding: 6px 10px; font-size: 12px; font-weight: 500;
  cursor: pointer; transition: background var(--transition);
}
.btn-mini:hover { background: var(--panel); }
.btn-mini i { width: 13px; height: 13px; }
.btn-mini.btn-danger { color: var(--danger); }
.btn-mini.btn-danger:hover { background: rgba(244,63,94,0.1); }

.badge.ok {
  background: rgba(16,185,129,0.12);
  color: var(--ok-2, #10b981);
  border: 1px solid rgba(16,185,129,0.25);
}

/* ─── Custom confirm dialog ─── */
.dh-confirm-wrap {
  position: fixed; inset: 0; z-index: 250;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.18s;
  pointer-events: none;
}
.dh-confirm-wrap.show { opacity: 1; pointer-events: auto; }
.dh-confirm-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
}
.dh-confirm-modal {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0,0,0,.55);
  transform: scale(0.95) translateY(8px);
  transition: transform 0.22s cubic-bezier(0.34, 1.3, 0.64, 1);
}
.dh-confirm-wrap.show .dh-confirm-modal {
  transform: scale(1) translateY(0);
}
.dh-confirm-title {
  font-size: 16px; font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}
.dh-confirm-message {
  font-size: 13.5px;
  color: var(--text-2, var(--muted));
  line-height: 1.5;
  margin-bottom: 20px;
}
.dh-confirm-actions {
  display: flex; gap: 8px; justify-content: flex-end;
}
.dh-confirm-actions .btn {
  padding: 9px 16px;
  font-size: 13.5px;
}
.dh-confirm-actions .dh-cancel {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.dh-confirm-actions .dh-cancel:hover {
  background: var(--panel);
}
.btn.btn-danger {
  background: linear-gradient(135deg, var(--danger, #f43f5e), #be123c);
  color: #fff;
  border: none;
}
.btn.btn-danger:hover { filter: brightness(1.1); }

/* ─── Toast notifications ─── */
.dh-toasts {
  position: fixed;
  top: 20px; right: 20px;
  z-index: 200;
  display: flex; flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: calc(100vw - 40px);
}
.dh-toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px 12px 16px;
  border-radius: 11px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent-2);
  color: var(--text);
  font-size: 13.5px; font-weight: 500;
  letter-spacing: -0.005em;
  box-shadow: 0 12px 32px -6px rgba(0,0,0,.5),
              0 6px 14px rgba(0,0,0,.25);
  min-width: 240px;
  max-width: 420px;
  opacity: 0;
  transform: translateX(20px) scale(0.97);
  transition: all 0.22s cubic-bezier(0.34, 1.3, 0.64, 1);
}
.dh-toast.show {
  opacity: 1;
  transform: translateX(0) scale(1);
}
.dh-toast-msg {
  flex: 1;
  line-height: 1.4;
  word-break: break-word;
}
.dh-toast-close {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  margin-left: 4px;
  transition: color var(--transition);
}
.dh-toast-close:hover { color: var(--text); }

.dh-toast-success { border-left-color: var(--ok-2, #10b981); }
.dh-toast-error   { border-left-color: var(--danger, #f43f5e); }
.dh-toast-warning { border-left-color: #fbbf24; }
.dh-toast-info    { border-left-color: var(--accent-2); }

@media (max-width: 720px) {
  .dh-toasts {
    top: 10px; right: 10px; left: 10px;
  }
  .dh-toast { min-width: 0; max-width: none; }
}

/* ─── DazeHelper floating assistant ─── */
.dh-help {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 90;
}
.dh-help-btn {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #6d28d9);
  color: #fff;
  border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 30px -6px rgba(139, 92, 246, 0.55),
              0 5px 14px rgba(0,0,0,0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}
.dh-help-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 14px 36px -6px rgba(139, 92, 246, 0.65),
              0 7px 18px rgba(0,0,0,0.4);
}
.dh-help-btn.hidden { display: none; }
.dh-help-btn i { width: 32px; height: 32px; }

.dh-help-panel {
  position: absolute;
  right: 0; bottom: 0;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 100px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0,0,0,.5);
  display: flex; flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.dh-help-panel.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

/* Drag-over highlight when dropping a screenshot */
.dh-help-panel.dh-drag-over {
  outline: 2px dashed var(--accent-2);
  outline-offset: -8px;
}
.dh-help-panel.dh-drag-over::before {
  content: "Drop screenshot to attach";
  position: absolute;
  inset: 0;
  z-index: 5;
  background: rgba(139, 92, 246, 0.18);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700;
  color: #fff;
  letter-spacing: -0.005em;
  pointer-events: none;
  border-radius: 14px;
}
.dh-help-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
  background: linear-gradient(180deg, rgba(139,92,246,0.10), transparent);
}
.dh-help-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 700;
  letter-spacing: -0.005em;
}
.dh-help-title i {
  width: 17px; height: 17px;
  color: var(--accent-2);
}
.dh-help-close {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  width: 28px; height: 28px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
}
.dh-help-close i { width: 16px; height: 16px; }
.dh-help-close:hover { background: var(--panel-2); color: var(--text); }

.dh-help-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.dh-help-body::-webkit-scrollbar {
  width: 8px;
}
.dh-help-body::-webkit-scrollbar-track {
  background: transparent;
}
.dh-help-body::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
.dh-help-body::-webkit-scrollbar-thumb:hover {
  background: var(--border-soft);
}
.dh-help-msg {
  padding: 10px 13px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.5;
  max-width: 88%;
  letter-spacing: -0.005em;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.dh-help-msg.from-bot {
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.dh-help-msg.from-user {
  background: linear-gradient(135deg, var(--accent), #6d28d9);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.dh-help-msg.dh-typing {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 14px 14px;
  min-height: 0;
}

/* New message slides up + fades in */
.dh-msg-enter {
  animation: dh-msg-in 0.28s cubic-bezier(0.34, 1.3, 0.64, 1) both;
}
@keyframes dh-msg-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* When the AI response replaces the typing dots, a subtle pop */
.dh-msg-pop {
  animation: dh-msg-pop 0.32s ease-out;
}
@keyframes dh-msg-pop {
  0%   { transform: scale(0.92); opacity: 0.4; }
  60%  { transform: scale(1.015); opacity: 1; }
  100% { transform: scale(1); }
}

.dh-help-head-actions {
  display: flex; gap: 4px;
}

/* Flip tooltips to show BELOW for chat header buttons (panel edge clips top) */
.dh-help-head [data-tooltip]::before,
.dh-help-head [data-tooltip]::after {
  bottom: auto !important;
  top: calc(100% + 8px);
  transform: translateX(-50%) translateY(-4px);
}
.dh-help-head [data-tooltip]::before {
  top: calc(100% + 3px);
  border-top-color: transparent !important;
  border-bottom-color: var(--border);
}
.dh-help-head [data-tooltip]:hover::before,
.dh-help-head [data-tooltip]:hover::after {
  transform: translateX(-50%) translateY(0);
}
.dh-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--muted);
  animation: dh-bounce 1.2s infinite ease-in-out;
}
.dh-dot:nth-child(2) { animation-delay: 0.18s; }
.dh-dot:nth-child(3) { animation-delay: 0.36s; }

@keyframes dh-bounce {
  0%, 70%, 100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  35% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

.dh-help-form {
  display: flex; gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border-soft);
  background: var(--panel-2);
  align-items: center;
}
.dh-help-form input[type="text"] {
  flex: 1;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 12px;
  font-size: 13.5px;
  font-family: inherit;
}
.dh-help-form input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
}
.dh-help-send {
  background: linear-gradient(135deg, var(--accent), #6d28d9);
  border: none;
  color: #fff;
  border-radius: 9px;
  width: 38px;
  height: 36px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.dh-help-send i { width: 16px; height: 16px; }
.dh-help-send:hover { filter: brightness(1.1); }

.dh-help-attach-btn {
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 9px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}
.dh-help-attach-btn:hover {
  background: var(--panel);
  color: var(--text);
  border-color: var(--accent);
}
.dh-help-attach-btn i { width: 16px; height: 16px; }

.dh-help-attach-preview {
  position: relative;
  margin: 10px 14px 0;
  padding: 8px;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: 9px;
  display: flex; align-items: center; gap: 10px;
}
.dh-help-attach-preview[hidden] { display: none !important; }
.dh-help-attach-preview img {
  max-height: 60px;
  max-width: 90px;
  border-radius: 6px;
  object-fit: cover;
}
.dh-help-attach-preview::after {
  content: "Will be sent with your next message";
  font-size: 11.5px;
  color: var(--muted);
  flex: 1;
}
.dh-help-attach-remove {
  position: absolute;
  top: -6px; right: -6px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--panel);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.dh-help-attach-remove i { width: 12px; height: 12px; }

/* Image inside a user's message bubble */
.dh-msg-image {
  display: block;
  max-width: 100%;
  max-height: 240px;
  border-radius: 11px;
  object-fit: contain;
}
/* When the bubble has an image, drop the purple gradient — the image is the visual */
.dh-help-msg.from-user:has(.dh-msg-image) {
  background: transparent;
  padding: 0;
  border-radius: 12px;
  overflow: hidden;
  max-width: 78%;
}
/* If there's also a text caption with the image, give it a subtle backdrop below */
.dh-help-msg.from-user:has(.dh-msg-image) > div:not(.dh-msg-image) {
  background: linear-gradient(135deg, var(--accent), #6d28d9);
  color: #fff;
  padding: 8px 12px;
  border-radius: 0 0 11px 11px;
  margin-top: -1px;   /* seamless join */
  font-size: 13.5px;
}
.dh-help-msg.from-user:has(.dh-msg-image) .dh-msg-image:only-child,
.dh-help-msg.from-user:has(.dh-msg-image) .dh-msg-image:last-child:not(:only-child) {
  /* image at top: keep rounded top corners; flatten bottom if there's a caption */
}
.dh-help-msg.from-user:has(.dh-msg-image) .dh-msg-image:not(:last-child) {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

@media (max-width: 720px) {
  .dh-help { right: 16px; bottom: 16px; }
  .dh-help-btn { width: 60px; height: 60px; }
  .dh-help-btn i { width: 28px; height: 28px; }
  .dh-help-panel {
    width: calc(100vw - 32px);
    height: 70vh;
  }
}

/* ─── extra small screens (under 380px) ─── */
@media (max-width: 380px) {
  .cards { grid-template-columns: 1fr; }
  .card.stat .big { font-size: 22px; }
  .topnav .brand span { display: none; }   /* show only lightning bolt on tiny screens */
}

/* ─── DEMO MODE banner ─────────────────────────────────────── */
.demo-banner {
  position: relative;
  z-index: 10000;
  background: linear-gradient(90deg, #8b5cf6 0%, #6366f1 100%);
  color: #fff;
  padding: 8px 16px;
  font-size: 13px;
  text-align: center;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
  border-bottom: 1px solid rgba(255,255,255,.12);
}
@media (max-width: 720px) {
  .demo-banner {
    font-size: 11.5px;
    padding: 6px 12px;
    line-height: 1.35;
  }
}
.demo-banner strong {
  letter-spacing: 0.08em;
  margin-right: 4px;
}
.demo-banner .demo-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  margin-right: 8px;
  vertical-align: middle;
  box-shadow: 0 0 8px rgba(255,255,255,.8);
  animation: demo-pulse 2s ease-in-out infinite;
}
@keyframes demo-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

/* ─── Demo login form: stack fields vertically ─── */
.login-card form.demo-login {
  flex-direction: column;
  gap: 10px;
}
.login-card form.demo-login input,
.login-card form.demo-login button {
  width: 100%;
}
