/* ── Sana · Settings / Integrations ─────────────────────────────
   Tokens mirror the live product: warm canvas, indigo accent,
   DM Sans (Latin) + Tajawal (Arabic), 12px radii.
   ─────────────────────────────────────────────────────────────── */
:root {
  --bg: #FAFAF8;
  --surface: #FFFFFF;
  --surface-2: #F5F5F2;
  --surface-3: #EFEFEA;
  --border: #E7E7E2;
  --border-strong: #D8D8D1;
  --text: #0A0A0A;
  --text-2: #3A3A38;
  --muted: #6B6B67;
  --faint: #9A9A94;
  --accent: #5254D4;
  --accent-ink: #3B3DB2;
  --accent-soft: #EDEDFB;
  --success: #17795A;
  --success-soft: #E6F5EE;
  --danger: #BE3A31;
  --danger-soft: #FBECEA;
  --radius-xs: 6px;
  --radius-sm: 9px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(14, 14, 20, .05);
  --shadow: 0 10px 30px rgba(18, 18, 40, .09);
  --shadow-lg: 0 24px 60px rgba(18, 18, 40, .16);
  --font-sans: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-ar: "Tajawal", "DM Sans", ui-sans-serif, system-ui, sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

html[data-theme="dark"] {
  --bg: #0C0C0F;
  --surface: #14141A;
  --surface-2: #1B1B23;
  --surface-3: #23232C;
  --border: #2A2A34;
  --border-strong: #3A3A46;
  --text: #F4F4F2;
  --text-2: #D6D6D2;
  --muted: #A0A0A6;
  --faint: #7C7C84;
  --accent: #8B8DF5;
  --accent-ink: #A6A8FF;
  --accent-soft: #1E1E36;
  --success: #5FD3A3;
  --success-soft: #12291F;
  --danger: #F08A80;
  --danger-soft: #2C1715;
  --shadow: 0 12px 34px rgba(0, 0, 0, .5);
  --shadow-lg: 0 28px 70px rgba(0, 0, 0, .6);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}
html[dir="rtl"] body { font-family: var(--font-ar); }

img, svg { display: block; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
input { font: inherit; color: inherit; }
::selection { background: var(--accent-soft); color: var(--accent-ink); }

/* ── Ambient glow ── */
.glow {
  position: fixed; inset-inline: 0; top: 0; height: 420px; pointer-events: none; z-index: 0;
  background: radial-gradient(60% 100% at 70% 0%, rgba(82, 84, 212, .10), transparent 70%);
}
html[data-theme="dark"] .glow {
  background: radial-gradient(60% 100% at 70% 0%, rgba(139, 141, 245, .16), transparent 70%);
}

/* ── App shell ── */
.app {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100dvh;
  position: relative; z-index: 1;
}

/* ── Sidebar ── */
.sidebar {
  position: sticky; top: 0; align-self: start;
  height: 100dvh;
  display: flex; flex-direction: column;
  padding: 18px 14px 14px;
  background: var(--surface);
  border-inline-end: 1px solid var(--border);
}
.brand {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 8px 18px;
  font-weight: 700; letter-spacing: -.02em;
}
.brand img { border-radius: 50%; }
.brand-name { font-size: 1.05rem; }
.brand-tag {
  font-size: .62rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
  color: var(--faint); border: 1px solid var(--border); border-radius: 999px;
  padding: 1px 6px; margin-inline-start: auto;
}
.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-group {
  font-size: .68rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase;
  color: var(--faint); padding: 16px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  font-size: .9rem; color: var(--text-2);
  transition: background-color .16s ease, color .16s ease;
}
.nav-item svg { width: 17px; height: 17px; stroke-width: 1.75; color: var(--faint); flex: none; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.is-active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 500; }
.nav-item.is-active svg { color: var(--accent); }
.nav-count {
  margin-inline-start: auto; font-size: .72rem; font-weight: 500;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 0 7px; color: var(--muted);
}
.nav-item.is-active .nav-count { background: var(--surface); border-color: transparent; color: var(--accent-ink); }
.sidebar-foot {
  margin-top: auto; padding: 14px 10px 4px;
  display: flex; align-items: center; gap: 8px;
  font-size: .74rem; color: var(--faint);
  border-top: 1px solid var(--border);
}
.dot-live { width: 6px; height: 6px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }

/* ── Topbar ── */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  height: 60px; padding: 0 clamp(16px, 3vw, 34px);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.crumbs { display: flex; align-items: center; gap: 7px; font-size: .84rem; color: var(--faint); }
.crumbs svg { width: 14px; height: 14px; stroke-width: 1.75; }
html[dir="rtl"] .crumbs svg, html[dir="rtl"] .lang-wrap .pill-btn svg:last-child { transform: scaleX(-1); }
.crumbs strong { color: var(--text); font-weight: 500; }
.topbar-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px;
  color: var(--muted);
  transition: background-color .16s ease, color .16s ease, transform .16s var(--ease);
}
.icon-btn svg { width: 18px; height: 18px; stroke-width: 1.75; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:active { transform: scale(.94); }
.menu-btn { display: none; }

.pill-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface);
  font-size: .8rem; font-weight: 500; color: var(--text-2);
  transition: border-color .16s ease, background-color .16s ease;
}
.pill-btn svg { width: 15px; height: 15px; stroke-width: 1.75; color: var(--faint); }
.pill-btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.lang-wrap { position: relative; }
.menu {
  position: absolute; inset-inline-end: 0; top: calc(100% + 8px);
  min-width: 190px; list-style: none; padding: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  animation: pop .18s var(--ease);
  z-index: 30;
}
.menu button {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; padding: 8px 10px; border-radius: var(--radius-xs);
  font-size: .875rem; text-align: start;
  transition: background-color .14s ease;
}
.menu button:hover { background: var(--surface-2); }
.menu button[aria-selected="true"] { color: var(--accent-ink); font-weight: 500; background: var(--accent-soft); }
.menu .code { font-size: .68rem; letter-spacing: .08em; color: var(--faint); }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }

.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-ink);
  font-size: .76rem; font-weight: 700; letter-spacing: .02em;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  transition: transform .16s var(--ease), box-shadow .16s ease;
}
.avatar:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }

/* ── Content ── */
.content {
  width: 100%; max-width: 1080px;
  padding: clamp(22px, 3vw, 36px) clamp(16px, 3vw, 34px) 60px;
}
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
  animation: fadeUp .5s var(--ease) both;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .72rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 8px;
}
.eyebrow svg { width: 13px; height: 13px; stroke-width: 2; }
h1 { font-size: clamp(1.65rem, 3.2vw, 2.15rem); font-weight: 700; letter-spacing: -.035em; line-height: 1.15; }
.lede { margin-top: 10px; max-width: 62ch; color: var(--muted); font-size: .93rem; line-height: 1.65; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 15px; border-radius: 10px;
  font-size: .855rem; font-weight: 500; white-space: nowrap;
  transition: transform .16s var(--ease), box-shadow .18s ease, background-color .16s ease, border-color .16s ease, opacity .16s ease;
}
.btn svg { width: 16px; height: 16px; stroke-width: 1.9; }
.btn:active { transform: translateY(0) scale(.985); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 2px 10px rgba(82, 84, 212, .22); }
.btn-primary:hover:not(:disabled) { background: var(--accent-ink); box-shadow: 0 6px 20px rgba(82, 84, 212, .3); transform: translateY(-1px); }
html[data-theme="dark"] .btn-primary { color: #101018; }
.btn-ghost { background: var(--surface); border: 1px solid var(--border); color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { border-color: var(--border-strong); background: var(--surface-2); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 26%, transparent); }
.btn-danger:hover:not(:disabled) { background: var(--danger); color: #fff; }
.btn.is-loading { pointer-events: none; }
.btn.is-loading svg { display: none; }
.btn.is-loading::before {
  content: ""; width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ── Stats ── */
.stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px; margin: 26px 0 22px;
  animation: fadeUp .5s var(--ease) .06s both;
}
.stat {
  display: flex; flex-direction: column; gap: 1px;
  padding: 14px 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.stat-num { font-size: 1.5rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.2; }
.stat-label { font-size: .78rem; color: var(--muted); }

/* ── Toolbar ── */
.toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 18px;
  animation: fadeUp .5s var(--ease) .1s both;
}
.search {
  position: relative; display: flex; align-items: center;
  flex: 1 1 260px; max-width: 340px;
  height: 38px; padding-inline: 12px 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.search svg { width: 16px; height: 16px; stroke-width: 1.9; color: var(--faint); flex: none; }
.search input {
  flex: 1; min-width: 0; height: 100%; padding-inline: 9px;
  background: none; border: 0; outline: none; font-size: .875rem;
}
.search input::placeholder { color: var(--faint); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search kbd {
  font-family: inherit; font-size: .68rem; color: var(--faint);
  border: 1px solid var(--border); border-radius: 5px;
  padding: 0 5px; line-height: 17px; background: var(--surface-2);
}

.chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chip {
  height: 30px; padding: 0 12px; border-radius: 999px;
  font-size: .79rem; font-weight: 500; color: var(--muted);
  border: 1px solid transparent; background: var(--surface-2);
  transition: background-color .16s ease, color .16s ease, border-color .16s ease, transform .14s var(--ease);
}
.chip:hover { color: var(--text); background: var(--surface-3); }
.chip:active { transform: scale(.96); }
.chip.is-on { background: var(--text); color: var(--bg); }
html[data-theme="dark"] .chip.is-on { background: var(--accent-soft); color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.chip .n { font-size: .7rem; opacity: .6; margin-inline-start: 4px; }

/* ── Grid of integrations ── */
.grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(288px, 1fr));
}
.card {
  display: flex; flex-direction: column; gap: 12px;
  padding: 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), box-shadow .2s ease, border-color .2s ease;
  animation: fadeUp .45s var(--ease) both;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.card-top { display: flex; align-items: flex-start; gap: 11px; }
.tile {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  overflow: hidden;
}
.tile img { width: 21px; height: 21px; object-fit: contain; }
.tile.mono { font-size: .82rem; font-weight: 700; letter-spacing: -.02em; color: #fff; border: 0; }
.tile-lg { width: 46px; height: 46px; border-radius: 12px; }
.tile-lg img { width: 26px; height: 26px; }
.tile-lg.mono { font-size: 1rem; }
.card-name { font-size: .95rem; font-weight: 500; letter-spacing: -.01em; line-height: 1.35; }
.card-cat { font-size: .73rem; color: var(--faint); }
.card-desc { font-size: .845rem; color: var(--muted); line-height: 1.55; flex: 1; }

.status {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .72rem; font-weight: 500; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .8; }
.status.on { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 22%, transparent); }
.card-mid { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.card-foot { display: flex; align-items: center; gap: 8px; padding-top: 2px; }
.card-foot .btn { height: 33px; font-size: .8rem; padding: 0 12px; }
.card-account {
  font-size: .76rem; color: var(--faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1; min-width: 0;
}
.details-btn {
  margin-inline-start: auto; display: inline-flex; align-items: center; gap: 4px;
  font-size: .78rem; color: var(--muted); padding: 4px 6px; border-radius: 6px;
  transition: color .16s ease, background-color .16s ease;
}
.details-btn svg { width: 14px; height: 14px; stroke-width: 1.9; }
html[dir="rtl"] .details-btn svg { transform: scaleX(-1); }
.details-btn:hover { color: var(--accent); background: var(--accent-soft); }

/* ── Skeleton ── */
.sk { border-radius: var(--radius); height: 168px; border: 1px solid var(--border); background: var(--surface); overflow: hidden; position: relative; }
.sk::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface-2) 90%, transparent), transparent);
  transform: translateX(-100%); animation: shimmer 1.3s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

/* ── Empty ── */
.empty {
  text-align: center; padding: 46px 20px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius-lg);
  background: var(--surface);
  animation: fadeUp .3s var(--ease) both;
}
.empty-mark {
  width: 44px; height: 44px; margin: 0 auto 12px;
  display: grid; place-items: center; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent);
}
.empty-mark svg { width: 20px; height: 20px; stroke-width: 1.75; }
.empty h3 { font-size: 1rem; font-weight: 500; margin-bottom: 6px; }
.empty p { font-size: .86rem; color: var(--muted); max-width: 42ch; margin: 0 auto 16px; }

/* ── MCP panel ── */
.mcp {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-top: 22px; padding: 20px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 160% at 0% 0%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 60%),
    var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.mcp-icon {
  width: 42px; height: 42px; flex: none; display: grid; place-items: center;
  border-radius: 12px; background: var(--text); color: var(--bg);
}
html[data-theme="dark"] .mcp-icon { background: var(--accent); color: #101018; }
.mcp-icon svg { width: 20px; height: 20px; stroke-width: 1.75; }
.mcp-copy { flex: 1 1 340px; min-width: 0; }
.mcp-copy h2 { font-size: 1rem; font-weight: 600; letter-spacing: -.015em; margin-bottom: 4px; }
.mcp-copy p { font-size: .855rem; color: var(--muted); line-height: 1.6; max-width: 66ch; }
.mcp-hint { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: .78rem !important; color: var(--faint) !important; }
.mcp-hint svg { width: 13px; height: 13px; stroke-width: 1.9; flex: none; }

.foot-note {
  display: flex; align-items: flex-start; gap: 7px;
  margin-top: 26px; font-size: .78rem; color: var(--faint); line-height: 1.6;
}
.foot-note svg { width: 14px; height: 14px; stroke-width: 1.9; margin-top: 2px; flex: none; }

/* ── Toasts ── */
.toasts {
  position: fixed; inset-inline-end: 18px; bottom: 18px; z-index: 80;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
}
.toast {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 14px; border-radius: 10px;
  background: var(--text); color: var(--bg);
  font-size: .83rem; font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn .3s var(--ease) both;
}
.toast svg { width: 15px; height: 15px; stroke-width: 2.2; }
.toast.out { animation: toastOut .22s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px) scale(.98); } }

/* ── Modal ── */
.overlay {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
  background: color-mix(in srgb, #0A0A0A 45%, transparent);
  backdrop-filter: blur(3px);
  animation: fade .2s ease both;
}
.overlay[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  position: relative;
  width: 100%; max-width: 460px;
  padding: 24px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  animation: modalIn .28s var(--ease) both;
  max-height: calc(100dvh - 36px); overflow-y: auto;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-x { position: absolute; inset-inline-end: 12px; top: 12px; }
.modal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.modal-head h2 { font-size: 1.05rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.3; }
.modal-head .status { margin-top: 5px; }
.modal-desc { font-size: .875rem; color: var(--muted); line-height: 1.6; margin-bottom: 18px; }
.modal-block { padding-top: 14px; border-top: 1px solid var(--border); margin-bottom: 14px; }
.modal-label {
  font-size: .7rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
  color: var(--faint); margin-bottom: 6px;
}
.modal-value { font-size: .86rem; color: var(--text-2); }
.scopes { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; }
.scopes li {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .75rem; padding: 3px 8px; border-radius: 6px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
}
.scopes li svg { width: 12px; height: 12px; stroke-width: 2; color: var(--success); }
.modal-note { font-size: .78rem; color: var(--faint); line-height: 1.6; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* ── Focus & motion ── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ── Drawer + responsive ── */
@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 60;
    width: 272px; height: 100dvh; box-shadow: var(--shadow-lg);
    transition: transform .28s var(--ease);
  }
  [dir="ltr"] .sidebar { transform: translateX(-102%); }
  [dir="rtl"] .sidebar { transform: translateX(102%); }
  .app.drawer-open .sidebar { transform: none; }
  .app.drawer-open::after {
    content: ""; position: fixed; inset: 0; z-index: 55;
    background: color-mix(in srgb, #0A0A0A 38%, transparent);
    animation: fade .2s ease both;
  }
  .menu-btn { display: inline-flex; }
  .crumbs { display: none; }
  [dir="rtl"] .menu-btn svg { transform: scaleX(-1); }
}

@media (max-width: 760px) {
  .page-head .btn { width: 100%; }
  .search { max-width: none; }
  .mcp { align-items: flex-start; }
  .mcp .btn { width: 100%; }
}

@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:last-child { grid-column: span 2; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .lede { font-size: .885rem; }
  .modal { padding: 20px; }
  .modal-foot .btn { flex: 1; }
  .toasts { inset-inline: 12px; align-items: stretch; }
}

@media (hover: none) {
  .card:hover { transform: none; box-shadow: var(--shadow-sm); }
  .chip, .btn, .icon-btn, .avatar { min-height: 38px; }
}

/* Scrollbars — quiet, product-like */
.nav::-webkit-scrollbar, .modal::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb, .modal::-webkit-scrollbar-thumb {
  background: var(--border-strong); border-radius: 99px;
}
