/* ═══════════════════════════════════════════════════════════════
   Presend Dashboard — Pagerly design system
   ═══════════════════════════════════════════════════════════════ */
:root {
  --primary: hsl(216 100% 48%);
  --primary-hover: hsl(216 100% 42%);
  --primary-soft: hsl(216 100% 48% / 0.08);
  --secondary: hsl(247 28% 12%);
  --success: #21c45d;
  --success-soft: rgb(33 196 93 / 0.1);
  --destructive: hsl(0 84% 60%);
  --destructive-soft: hsl(0 84% 60% / 0.09);
  --warn: hsl(38 92% 50%);
  --warn-soft: hsl(38 92% 50% / 0.12);
  --background: #fff;
  --muted: hsl(210 40% 96.1%);
  --muted-foreground: hsl(215 16% 47%);
  --border: hsl(214 32% 91.4%);
  --accent-pink: hsl(340 72% 67%);
  --radius: 0.5rem;
  --radius-lg: 0.75rem;
  --shadow-sm: 0 1px 2px hsl(247 28% 12% / 0.05);
  --shadow: 0 1px 3px hsl(247 28% 12% / 0.05), 0 4px 16px hsl(247 28% 12% / 0.06);
  --shadow-lg: 0 12px 40px hsl(247 28% 12% / 0.14);
  --font: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --t: 300ms ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font); font-weight: 500; font-size: 14px;
  color: var(--secondary); background: var(--background);
  -webkit-font-smoothing: antialiased; line-height: 1.5;
}
button { font-family: var(--font); }
.hidden { display: none !important; }

/* ── Logo ── */
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -0.3px; color: var(--secondary); }
.logo .mark {
  width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  background: var(--accent-pink); box-shadow: 0 4px 12px hsl(340 72% 67% / 0.35); flex: 0 0 28px;
}
.logo .mark svg { width: 15px; height: 15px; }
.logo .mark path { stroke: #fff; stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.logo.lg { font-size: 22px; justify-content: center; }
.logo.lg .mark { width: 40px; height: 40px; border-radius: 11px; flex-basis: 40px; }
.logo.lg .mark svg { width: 21px; height: 21px; }

/* ═══ LOGIN ═══ */
.login {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(700px 420px at 85% -5%, hsl(216 100% 48% / 0.07), transparent 60%),
    radial-gradient(600px 380px at 0% 100%, hsl(340 72% 67% / 0.06), transparent 55%),
    var(--background);
}
.login-card {
  width: min(410px, 94vw); background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 44px 38px 36px; text-align: center;
}
.login-card .tagline { color: var(--muted-foreground); font-size: 14px; margin: 14px 0 30px; }
.code-sent { color: var(--muted-foreground); font-size: 13px; line-height: 1.5; margin: 0 0 14px; text-align: center; }
.code-sent b { color: var(--foreground); font-weight: 600; }
.code-field { text-align: center; font-size: 22px; font-weight: 700; letter-spacing: 8px; font-family: 'SF Mono', Menlo, Consolas, monospace; }
.code-actions { display: flex; justify-content: space-between; margin-top: 14px; }
.linkish { background: none; border: 0; padding: 0; color: var(--muted-foreground); font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: inherit; }
.linkish:hover { color: var(--primary, #0062f5); }
.linkish:disabled { opacity: .5; cursor: default; }
.btn-google { display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: #fff; color: var(--foreground); border: 1px solid var(--border); font-weight: 600; }
.btn-google:hover { background: var(--muted, #f6f7f9); }
.btn-google svg { width: 18px; height: 18px; flex: none; }
.btn-google:disabled { opacity: .6; cursor: default; }
.login-divider { display: flex; align-items: center; gap: 14px; margin: 22px 0; color: var(--muted-foreground); font-size: 11.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.login-note { font-size: 12px; color: var(--muted-foreground); margin-top: 22px; }
.login-err { font-size: 12.5px; color: var(--destructive); margin-top: 12px; min-height: 18px; }

/* ═══ APP SHELL ═══ */
.app { display: flex; min-height: 100vh; }

aside {
  width: 236px; flex: 0 0 236px; border-right: 1px solid var(--border); background: #fff;
  padding: 22px 14px 16px; display: flex; flex-direction: column; gap: 2px;
  position: sticky; top: 0; height: 100vh;
}
aside .logo { padding: 0 8px 24px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: var(--radius);
  font-size: 13.5px; font-weight: 500; color: var(--muted-foreground); cursor: pointer;
  transition: background var(--t), color var(--t); user-select: none;
}
.nav-item svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 1.9; fill: none; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 17px; }
.nav-item:hover { background: var(--muted); color: var(--secondary); }
.nav-item.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-space { flex: 1; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 14px 8px 4px; border-top: 1px solid var(--border); margin-top: 10px; overflow: hidden; }
.side-user .nm { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .em { font-size: 11px; color: var(--muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user > div:last-child { min-width: 0; }

.avatar {
  width: 34px; height: 34px; border-radius: 999px; flex: 0 0 34px;
  background: var(--primary); color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 12.5px; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

main { flex: 1; min-width: 0; overflow-x: hidden; }
.page-inner { max-width: 960px; margin: 0 auto; padding: 36px 40px 64px; }

/* ── Page header ── */
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head h1 { font-size: 1.5rem; font-weight: 600; color: var(--primary); letter-spacing: -0.4px; }
.page-head .sub { color: var(--muted-foreground); font-size: 13.5px; margin-top: 4px; max-width: 560px; }
.page-head .sp { flex: 1; }

.panel { display: none; }
.panel.show { display: block; animation: fadeUp 0.35s var(--t, ease); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: 600 13.5px var(--font); padding: 10px 18px; border-radius: var(--radius);
  cursor: pointer; border: 1px solid transparent; transition: all var(--t); white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 14px hsl(216 100% 48% / 0.25); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); box-shadow: 0 6px 18px hsl(216 100% 48% / 0.32); }
.btn-outline { background: #fff; border-color: var(--border); color: var(--secondary); box-shadow: var(--shadow-sm); }
.btn-outline:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: transparent; color: var(--muted-foreground); }
.btn-ghost:hover:not(:disabled) { background: var(--muted); color: var(--secondary); }
.btn-danger { background: var(--destructive-soft); color: var(--destructive); }
.btn-danger:hover:not(:disabled) { background: hsl(0 84% 60% / 0.16); }
.btn-sm { padding: 6px 13px; font-size: 12.5px; }
.btn-block { width: 100%; }
.icon-btn {
  width: 30px; height: 30px; border-radius: var(--radius); display: grid; place-items: center;
  background: transparent; border: 0; color: var(--muted-foreground); cursor: pointer; transition: all var(--t);
  font-size: 13px; flex: 0 0 30px;
}
.icon-btn:hover { background: var(--muted); color: var(--secondary); }
.icon-btn.danger:hover { background: var(--destructive-soft); color: var(--destructive); }

/* ── Cards ── */
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); margin-bottom: 20px; }
.card-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.card-head h3 { font-size: 14.5px; font-weight: 600; }
.card-head p { font-size: 12.5px; color: var(--muted-foreground); margin-top: 2px; }
.card-head .sp { flex: 1; }
.card-body { padding: 20px; }

/* ── Stat cards ── */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 18px 20px; box-shadow: var(--shadow-sm); transition: transform var(--t), box-shadow var(--t);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card .k { font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-foreground); }
.stat-card .v { font-size: 1.7rem; font-weight: 700; letter-spacing: -0.5px; margin-top: 8px; }
.stat-card .d { font-size: 11.5px; font-weight: 600; margin-top: 4px; color: var(--muted-foreground); min-height: 17px; }

/* ── Greeting ── */
.greeting { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.greeting .avatar { width: 44px; height: 44px; flex-basis: 44px; font-size: 15px; }
.greeting h1 { font-size: 1.5rem; font-weight: 600; color: var(--primary); letter-spacing: -0.4px; }
.greeting p { font-size: 13px; color: var(--muted-foreground); margin-top: 2px; }
.greeting .sp { flex: 1; }

/* ── Meter ── */
.meter { height: 8px; background: var(--muted); border-radius: 999px; overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 999px; background: var(--primary); transition: width var(--t); }
.meter span.hot { background: var(--warn); }
.meter span.full { background: var(--destructive); }
.meter-caption { display: flex; font-size: 12px; color: var(--muted-foreground); margin-top: 8px; }
.meter-caption .sp { flex: 1; }

/* ── Forms ── */
.field {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 12px; font: 500 13.5px var(--font); color: var(--secondary); background: #fff;
  transition: border-color var(--t), box-shadow var(--t);
}
.field:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.field::placeholder { color: hsl(215 16% 65%); font-weight: 500; }
textarea.field { resize: vertical; line-height: 1.55; }
select.field { appearance: auto; cursor: pointer; }
.lbl { display: block; font-size: 12.5px; font-weight: 600; margin: 16px 0 6px; }
.lbl:first-child { margin-top: 0; }
.hint { font-size: 11.5px; color: var(--muted-foreground); margin-top: 6px; }

/* ── Chips (platform filter + multi-select) ── */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); background: #fff;
  font: 600 12.5px var(--font); color: var(--muted-foreground); cursor: pointer;
  transition: all var(--t); user-select: none;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 3px 10px hsl(216 100% 48% / 0.28); }
.chips-bar { margin-bottom: 20px; }

/* ── Segmented control ── */
.seg { display: inline-flex; gap: 4px; background: var(--muted); padding: 4px; border-radius: var(--radius); }
.seg button {
  border: 0; background: transparent; color: var(--muted-foreground); font: 600 12.5px var(--font);
  padding: 7px 15px; border-radius: calc(var(--radius) - 2px); cursor: pointer;
  transition: all var(--t);
}
.seg button:hover { color: var(--secondary); }
.seg button.on { background: #fff; color: var(--primary); box-shadow: var(--shadow-sm); }
.seg.sev button.on[data-val="risk"] { color: var(--destructive); }
.seg.sev button.on[data-val="warn"] { color: hsl(30 90% 40%); }
.seg.sev button.on[data-val="info"] { color: var(--primary); }
.seg.wide { display: flex; }
.seg.wide button { flex: 1; }

/* ── Toggle switch ── */
.switch {
  width: 40px; height: 22px; border-radius: 999px; background: hsl(214 32% 84%);
  position: relative; cursor: pointer; transition: background var(--t); flex: 0 0 40px; border: 0;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  background: #fff; border-radius: 50%; transition: transform var(--t); box-shadow: 0 1px 3px rgb(0 0 0 / 0.25);
}
.switch.on { background: var(--success); }
.switch.on::after { transform: translateX(18px); }

/* ── Rule cards ── */
.rule-card {
  display: flex; align-items: flex-start; gap: 14px; background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px;
  margin-bottom: 12px; box-shadow: var(--shadow-sm); transition: box-shadow var(--t), transform var(--t);
}
.rule-card:hover { box-shadow: var(--shadow); }
.rule-card.paused { opacity: 0.62; }
.level-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex: 0 0 10px; }
.level-dot.risk { background: var(--destructive); box-shadow: 0 0 0 4px var(--destructive-soft); }
.level-dot.warn { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-soft); }
.level-dot.info { background: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.rule-main { flex: 1; min-width: 0; }
.rule-name { font-size: 13.5px; font-weight: 600; }
.rule-desc { font-size: 12.5px; color: var(--muted-foreground); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.rule-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px;
  font-size: 10.5px; font-weight: 600; background: var(--muted); color: var(--muted-foreground);
}
.badge.platform { background: var(--primary-soft); color: var(--primary); }
.badge.everywhere { background: hsl(340 72% 67% / 0.1); color: hsl(340 62% 52%); }
.badge.type { background: var(--muted); color: var(--muted-foreground); }
.rule-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }

/* ── Rows (voice samples, built-ins, findings) ── */
.row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.row:last-child { border-bottom: 0; }
.row .nm { font-size: 13.5px; font-weight: 600; }
.row .ds { font-size: 12.5px; color: var(--muted-foreground); margin-top: 1px; }
.row .sp { flex: 1; }
.row-ic {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: var(--radius); display: grid;
  place-items: center; background: var(--primary-soft); color: var(--primary); font-size: 15px;
}
.row-ic.risk { background: var(--destructive-soft); color: var(--destructive); }
.row-ic.warn { background: var(--warn-soft); color: hsl(30 90% 40%); }
.row-ic.ok { background: var(--success-soft); color: var(--success); }
.row-ic svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* ── Voice sample cards ── */
.sample-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.sample-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 14px 16px; position: relative; box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t), transform var(--t);
}
.sample-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.sample-text { font-size: 12.5px; color: var(--muted-foreground); white-space: pre-wrap; max-height: 72px; overflow: hidden; padding-right: 24px; }
.sample-meta { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 11px; color: var(--muted-foreground); font-weight: 600; }
.sample-card .icon-btn { position: absolute; top: 8px; right: 8px; }

/* ── Billing plans ── */
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.plan-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm); position: relative; transition: box-shadow var(--t); }
.plan-card:hover { box-shadow: var(--shadow); }
.plan-card.current { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.plan-card .plan-name { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.plan-card .plan-price { font-size: 1.6rem; font-weight: 700; margin: 12px 0 4px; letter-spacing: -0.5px; }
.plan-card .plan-price span { font-size: 12.5px; font-weight: 500; color: var(--muted-foreground); }
.plan-card ul { list-style: none; margin: 16px 0 20px; display: grid; gap: 9px; }
.plan-card li { font-size: 13px; color: var(--muted-foreground); display: flex; gap: 9px; align-items: flex-start; }
.plan-card li::before { content: "✓"; color: var(--success); font-weight: 700; flex: 0 0 auto; }
.tag-current { position: absolute; top: 18px; right: 18px; background: var(--primary); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }
.tag-pro { background: var(--secondary); color: #fff; font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 999px; letter-spacing: 0.05em; }
.billing-note { font-size: 12.5px; color: var(--muted-foreground); background: var(--muted); border-radius: var(--radius); padding: 10px 14px; margin-top: 12px; }

/* ── Empty state ── */
.empty { padding: 46px 20px 40px; text-align: center; color: var(--muted-foreground); }
.empty h4 { font-size: 14px; font-weight: 600; color: var(--secondary); margin-bottom: 4px; }
.empty p { font-size: 12.5px; max-width: 340px; margin: 0 auto; }
.empty .btn { margin-top: 16px; }
.empty-art { width: 116px; height: 84px; margin: 0 auto 22px; position: relative; }
.empty-art .sheet { position: absolute; inset: 0; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-sm); }
.empty-art .sheet.back { transform: rotate(-6deg) translate(-7px, -5px); background: var(--muted); box-shadow: none; }
.empty-art .line { position: absolute; height: 8px; border-radius: 4px; background: var(--muted); left: 16px; }
.empty-art .line.l1 { top: 18px; width: 60px; }
.empty-art .line.l2 { top: 34px; width: 80px; }
.empty-art .line.l3 { top: 50px; width: 44px; }
.empty-art .check-bubble {
  position: absolute; right: -12px; bottom: -12px; width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent-pink); color: #fff; display: grid; place-items: center;
  font-size: 16px; font-weight: 700; box-shadow: 0 6px 14px hsl(340 72% 67% / 0.4);
}

/* ── Slide-over drawer ── */
.overlay {
  position: fixed; inset: 0; background: hsl(247 28% 12% / 0.42); z-index: 60;
  opacity: 0; pointer-events: none; transition: opacity var(--t);
}
.overlay.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: #fff;
  z-index: 70; transform: translateX(102%); transition: transform var(--t);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
}
.drawer.show { transform: none; }
.drawer-head { padding: 18px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.drawer-head h2 { font-size: 16px; font-weight: 600; color: var(--primary); flex: 1; }
.drawer-body { flex: 1; overflow-y: auto; padding: 22px 24px 30px; }
.drawer-foot { padding: 14px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; background: #fff; }
.step-label { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; margin: 26px 0 10px; display: flex; align-items: center; gap: 8px; }
.step-label.when { color: var(--success); }
.step-label.check { color: var(--primary); }
.step-label.then { color: var(--destructive); }
.step-label::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* condition rows */
.cond-row { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.cond-row .field { padding: 7px 9px; font-size: 12.5px; }
.cond-row select.field { width: auto; flex: 0 0 auto; }
.cond-row input.field { flex: 1; min-width: 0; }
.cond-bar { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.cond-wrap { background: var(--muted); border-radius: var(--radius); padding: 14px; margin-top: 4px; }
.cond-wrap .field { background: #fff; }

/* ── Toasts ── */
.toasts { position: fixed; top: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast {
  background: var(--secondary); color: #fff; padding: 11px 18px; border-radius: var(--radius);
  font-size: 13px; font-weight: 600; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 9px;
  animation: toastIn 0.3s var(--t); max-width: 340px;
}
.toast.out { opacity: 0; transform: translateX(16px); transition: all var(--t); }
.toast.error { background: var(--destructive); }
.toast.success { background: var(--success); }
@keyframes toastIn { from { opacity: 0; transform: translateX(24px); } }

/* ── Quick test findings ── */
.finding-level { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.finding-level.risk { color: var(--destructive); }
.finding-level.warn { color: hsl(30 90% 40%); }
.finding-level.info { color: var(--primary); }
.score-pair { display: flex; gap: 12px; margin-bottom: 14px; }
.score-pair .stat-card { flex: 1; }

/* ── Skeleton ── */
.skeleton {
  background: linear-gradient(90deg, var(--muted) 25%, hsl(210 40% 98%) 50%, var(--muted) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Key-mode option cards (settings) ── */
.opt-cards { display: flex; gap: 12px; }
.opt-card {
  flex: 1; cursor: pointer; padding: 14px; border: 2px solid var(--border); border-radius: var(--radius-lg);
  text-align: center; transition: all var(--t); background: #fff;
}
.opt-card:hover { box-shadow: var(--shadow); }
.opt-card.on { border-color: var(--primary); background: var(--primary-soft); }
.opt-card .t { font-size: 13.5px; font-weight: 600; margin-bottom: 4px; }
.opt-card .d { font-size: 11.5px; color: var(--muted-foreground); }

.status-pill { font-size: 12.5px; font-weight: 600; margin-left: 12px; }
.status-pill.ok { color: var(--success); }
.status-pill.bad { color: var(--destructive); }

/* ── Info line (two-tier explainer, inline notes) ── */
.info-line {
  display: flex; gap: 10px; align-items: flex-start; background: var(--primary-soft);
  border-radius: var(--radius); padding: 11px 14px; margin-bottom: 20px;
}
.info-line p { font-size: 12.5px; color: var(--muted-foreground); line-height: 1.5; }
.info-line p strong { color: var(--secondary); font-weight: 600; }
.info-line .info-ic {
  width: 17px; height: 17px; flex: 0 0 17px; border-radius: 50%; background: var(--primary);
  color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center;
  margin-top: 1px; font-style: italic;
}
.info-line.subtle { background: var(--muted); margin-bottom: 0; }
.info-line.subtle .info-ic { background: var(--muted-foreground); }

/* ── Monospace fields / text ── */
.mono, .field.mono {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12.5px;
}

/* ── Inline link-style button ── */
.link-btn {
  background: none; border: 0; padding: 0; cursor: pointer; font: 600 11.5px var(--font);
  color: var(--muted-foreground); transition: color var(--t);
}
.link-btn:hover { color: var(--primary); }
.link-btn.on { color: var(--primary); }

/* ── Connection cards ── */
.conn-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px 18px; margin-bottom: 12px; box-shadow: var(--shadow-sm); transition: box-shadow var(--t);
}
.conn-card:hover { box-shadow: var(--shadow); }
.conn-card.paused { opacity: 0.62; }
.conn-top { display: flex; align-items: flex-start; gap: 14px; }
.conn-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex: 0 0 10px; background: hsl(214 32% 84%); }
.conn-dot.ok { background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); }
.conn-dot.bad { background: var(--destructive); box-shadow: 0 0 0 4px var(--destructive-soft); }
.conn-main { flex: 1; min-width: 0; }
.conn-name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.conn-name { font-size: 13.5px; font-weight: 600; }
.conn-url {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11.5px; color: var(--muted-foreground); margin-top: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.conn-desc { font-size: 12.5px; color: var(--muted-foreground); margin-top: 5px; }
.conn-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.conn-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }

/* connection type + credential badges */
.badge.mcp { background: hsl(340 72% 67% / 0.12); color: hsl(340 62% 48%); letter-spacing: 0.05em; }
.badge.rest { background: var(--primary-soft); color: var(--primary); letter-spacing: 0.05em; }
.badge.agentic { background: hsl(340 72% 67% / 0.12); color: hsl(340 62% 48%); }
.badge.conn { background: var(--muted); color: var(--secondary); }
.badge.cred { background: var(--success-soft); color: hsl(142 60% 32%); }

/* inline test result */
.conn-result { font-size: 12px; font-weight: 600; margin-top: 12px; display: flex; gap: 8px; align-items: flex-start; }
.conn-result.ok { color: var(--success); }
.conn-result.bad { color: var(--destructive); }
.conn-result.pending { color: var(--muted-foreground); }
.conn-result .r-body { font-weight: 500; min-width: 0; overflow-wrap: anywhere; }

/* discovered tool list */
.conn-tools { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.tool-row { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; }
.tool-row .t-name {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px; font-weight: 600; color: var(--primary); flex: 0 0 auto;
}
.tool-row .t-desc { font-size: 12px; color: var(--muted-foreground); min-width: 0; }

/* chips with a trailing type tag (connection multi-select) */
.chip .chip-tag {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.06em; margin-left: 7px;
  opacity: 0.65; text-transform: uppercase;
}
.inline-prompt {
  background: var(--muted); border-radius: var(--radius); padding: 12px 14px;
  font-size: 12.5px; color: var(--muted-foreground);
}
.inline-prompt .link-btn { font-size: 12.5px; color: var(--primary); }

/* 4-up segmented control */
.seg.wide.quad button { padding: 7px 6px; font-size: 11.5px; letter-spacing: -0.1px; }

/* ── Empty-state illustration: connections ── */
.empty-art.conn-art { width: 132px; height: 66px; }
.empty-art.conn-art .node {
  position: absolute; top: 14px; width: 42px; height: 42px; border-radius: 12px;
  background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.empty-art.conn-art .node.a { left: 0; }
.empty-art.conn-art .node.b { right: 0; background: var(--muted); }
.empty-art.conn-art .node::after {
  content: ""; position: absolute; inset: 13px; border-radius: 5px; background: var(--muted);
}
.empty-art.conn-art .node.a::after { background: var(--primary-soft); }
.empty-art.conn-art .wire {
  position: absolute; top: 34px; left: 44px; right: 44px; height: 2px; border-radius: 2px;
  background: repeating-linear-gradient(90deg, var(--border) 0 6px, transparent 6px 11px);
}
.empty-art.conn-art .check-bubble { right: 24px; bottom: -6px; width: 30px; height: 30px; font-size: 13px; }

/* ── Responsive ── */
@media (max-width: 920px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .plans { grid-template-columns: 1fr; }
  .sample-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .app { flex-direction: column; }
  aside { width: 100%; flex: none; height: auto; position: static; flex-direction: row; align-items: center; overflow-x: auto; padding: 12px 14px; border-right: 0; border-bottom: 1px solid var(--border); }
  aside .logo { padding: 0 12px 0 0; }
  .side-user { display: none; }
  .nav-item { white-space: nowrap; }
  .page-inner { padding: 24px 18px 48px; }
  /* Connection cards: let the actions wrap under the details instead of
     squeezing the name and badges into a sliver. */
  .conn-top { flex-wrap: wrap; }
  .conn-main { flex: 1 0 100%; }
  .conn-actions { width: 100%; justify-content: flex-end; margin-top: 12px; }
  .seg.wide.quad { flex-wrap: wrap; }
  .seg.wide.quad button { flex: 1 0 46%; }
}
