/* ───────────────────────────────────────────────────────────────────────────
   social-autopilot · design system  (mobile-first, zero-runtime)
   --------------------------------------------------------------------------
   Self-contained CSS. NO Tailwind CDN runtime, NO 1MB background photo.
   Sections:
     1. Reset (preflight-lite — replaces what Tailwind's reset used to give us)
     2. Tokens + base + atmospheric gradient background (pure CSS, no network)
     3. Utility layer (static subset of the Tailwind classes the views use)
     4. Components (cards, nav shell, bottom-nav, buttons, forms, tables…)
     5. Responsive — phone-first behaviours (bottom tab-bar, table→card, etc.)
   ─────────────────────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@400;600;700;800&display=swap');

/* ╭─ 1. RESET ────────────────────────────────────────────────────────────────╮ */
*, ::before, ::after { box-sizing: border-box; border-width: 0; border-style: solid; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, pre { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, h5, h6 { font-size: inherit; font-weight: inherit; }
a { color: inherit; text-decoration: none; }
img, svg, video, canvas { display: block; max-width: 100%; }
img, video { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; margin: 0; }
button { background: none; cursor: pointer; }
button, [role="button"] { cursor: pointer; }
table { border-collapse: collapse; }
summary { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ╭─ 2. TOKENS + BASE ────────────────────────────────────────────────────────╮ */
:root {
  color-scheme: dark;
  --accent: #8b7cff;
  --accent-2: #6a4df0;
  --accent-grad: linear-gradient(135deg, #9b8cff 0%, #6a4df0 100%);
  --accent-glow: rgba(124, 108, 240, 0.45);

  --ink:   rgba(255, 255, 255, 0.96);
  --ink-2: rgba(255, 255, 255, 0.74);
  --ink-3: rgba(255, 255, 255, 0.56);

  --line:      rgba(255, 255, 255, 0.12);
  --line-soft: rgba(255, 255, 255, 0.07);

  --surface:   rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.07);

  --bg: #0b0d14;
  --radius: 20px;
  --radius-sm: 14px;

  --appbar-h: 56px;
  --bottomnav-h: 64px;
  --sidebar-w: 240px;

  accent-color: var(--accent);
}

html { font-family: 'Hanken Grotesk', ui-sans-serif, system-ui, sans-serif; background: var(--bg); }

body {
  min-height: 100vh;
  font-family: 'Hanken Grotesk', ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* atmospheric aurora — fixed pseudo-element (no scroll repaint, no image fetch) */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1100px 720px at 78% -8%, rgba(124, 108, 240, 0.30) 0%, transparent 60%),
    radial-gradient(900px 700px at 8% 12%, rgba(80, 120, 240, 0.18) 0%, transparent 55%),
    radial-gradient(1000px 900px at 50% 115%, rgba(150, 100, 255, 0.16) 0%, transparent 60%),
    linear-gradient(180deg, #0c0f18 0%, #0a0c12 100%);
}

h1, h2, h3, .display { letter-spacing: -0.02em; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.accent { color: #b9aeff; }
code { font-family: 'SF Mono', ui-monospace, monospace; font-size: .88em; background: rgba(0, 0, 0, .32); padding: 1px 6px; border-radius: 6px; word-break: break-word; }

/* ╭─ 3. UTILITY LAYER (static subset — only the classes the views use) ────────╮ */
.flex { display: flex; }
.grid { display: grid; }
.block { display: block; }
.inline { display: inline; }
.inline-block { display: inline-block; }
.hidden { display: none; }
.relative { position: relative; }
.z-10 { z-index: 10; }

.flex-1 { flex: 1 1 0%; }
.flex-col { flex-direction: column; }
.flex-none { flex: none; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.place-items-center { place-items: center; }
.mx-auto { margin-left: auto; margin-right: auto; }
.ml-auto { margin-left: auto; }
.min-w-0 { min-width: 0; }

.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.overflow-auto { overflow: auto; }
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.w-full { width: 100%; }
.w-11 { width: 2.75rem; }
.h-11 { height: 2.75rem; }
.h-14 { height: 3.5rem; }
.h-64 { height: 16rem; }
.h-full { height: 100%; }
.h-\[70vh\] { height: 70vh; }
.min-h-screen { min-height: 100vh; }
.max-w-xs { max-width: 20rem; }
.max-w-sm { max-width: 24rem; }
.max-w-xl { max-width: 36rem; }
.max-w-3xl { max-width: 48rem; }
.object-cover { object-fit: cover; }
.aspect-\[4\/5\] { aspect-ratio: 4 / 5; }

.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whitespace-nowrap { white-space: nowrap; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.leading-relaxed { line-height: 1.625; }
.list-decimal { list-style: decimal; }
.underline { text-decoration: underline; }

.rounded-lg { border-radius: .5rem; }
.rounded-xl { border-radius: .75rem; }
.rounded-2xl { border-radius: 1rem; }

.text-\[10px\] { font-size: 10px; line-height: 1.4; }
.text-\[11px\] { font-size: 11px; line-height: 1.45; }
.text-xs { font-size: .75rem; line-height: 1rem; }
.text-sm { font-size: .875rem; line-height: 1.3rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.6rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-extrabold { font-weight: 800; }
.text-amber-300 { color: #fcd34d; }

/* padding */
.p-3 { padding: .75rem; } .p-4 { padding: 1rem; } .p-5 { padding: 1.25rem; } .p-6 { padding: 1.5rem; } .p-10 { padding: 2.5rem; }
.px-3 { padding-left: .75rem; padding-right: .75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-2 { padding-top: .5rem; padding-bottom: .5rem; }
.py-2\.5 { padding-top: .625rem; padding-bottom: .625rem; }
.py-3 { padding-top: .75rem; padding-bottom: .75rem; }
.py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.pt-4 { padding-top: 1rem; } .pt-5 { padding-top: 1.25rem; } .pb-1 { padding-bottom: .25rem; }

/* margin */
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: .25rem; } .mb-2 { margin-bottom: .5rem; }
.mb-3 { margin-bottom: .75rem; } .mb-4 { margin-bottom: 1rem; } .mb-5 { margin-bottom: 1.25rem; }
.mb-6 { margin-bottom: 1.5rem; } .mb-7 { margin-bottom: 1.75rem; } .mb-8 { margin-bottom: 2rem; }
.mt-0\.5 { margin-top: .125rem; } .mt-1 { margin-top: .25rem; } .mt-1\.5 { margin-top: .375rem; }
.mt-2 { margin-top: .5rem; } .mt-3 { margin-top: .75rem; } .mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; } .mt-6 { margin-top: 1.5rem; } .mt-10 { margin-top: 2.5rem; }
.ml-5 { margin-left: 1.25rem; }

/* gap */
.gap-1 { gap: .25rem; } .gap-1\.5 { gap: .375rem; } .gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; } .gap-4 { gap: 1rem; } .gap-5 { gap: 1.25rem; }
.gap-x-4 { column-gap: 1rem; } .gap-y-1 { row-gap: .25rem; }

/* space-between-children */
.space-y-0\.5 > * + * { margin-top: .125rem; }
.space-y-1 > * + * { margin-top: .25rem; }
.space-y-2 > * + * { margin-top: .5rem; }
.space-y-3 > * + * { margin-top: .75rem; }
.space-y-4 > * + * { margin-top: 1rem; }

/* important width/padding overrides used inline in the source-edit form */
.\!w-24 { width: 6rem !important; }
.\!w-32 { width: 8rem !important; }
.\!w-40 { width: 10rem !important; }
.\!w-auto { width: auto !important; }
.\!py-1\.5 { padding-top: .375rem !important; padding-bottom: .375rem !important; }

/* hover utilities */
.hover\:text-white:hover { color: #fff; }
.hover\:underline:hover { text-decoration: underline; }

/* responsive: sm ≥640 */
@media (min-width: 640px) {
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sm\:col-span-2 { grid-column: span 2 / span 2; }
}
/* responsive: md ≥768 */
@media (min-width: 768px) {
  .md\:block { display: block; }
}
/* responsive: lg ≥1024 */
@media (min-width: 1024px) {
  .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lg\:col-span-2 { grid-column: span 2 / span 2; }
}
/* responsive: xl ≥1280 */
@media (min-width: 1280px) {
  .xl\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ╭─ 4. COMPONENTS ───────────────────────────────────────────────────────────╮ */

/* surfaces — flat, minimal cards (blur added on desktop only, see §5) */
.glass, .tile {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 30px -18px rgba(0, 0, 0, 0.7);
}
.tile { border-radius: var(--radius-sm); }
.glass-2 { background: var(--surface-2); }
.glass.hoverable, .tile.hoverable { transition: transform .16s ease, border-color .16s ease; }
.glass.hoverable:hover, .tile.hoverable:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, 0.22); }

/* layout shell */
.shell { position: relative; min-height: 100vh; }

/* desktop sidebar (hidden on mobile by default; shown ≥1024 in §5) */
.sidebar { display: none; }
.brand { display: flex; flex-direction: column; gap: 2px; padding: 4px 12px 20px; }
.brand .name { font-weight: 800; font-size: 21px; line-height: 1; letter-spacing: -0.03em; }
.brand .brand-sub { font-size: 11px; color: var(--ink-3); font-weight: 500; }

.nav-link {
  display: flex; align-items: center; gap: 13px; padding: 11px 14px; border-radius: 13px;
  color: var(--ink-2); font-size: 14px; font-weight: 600; white-space: nowrap; transition: .15s;
}
.nav-link svg { width: 19px; height: 19px; flex: none; opacity: .9; }
.nav-link:hover { color: var(--ink); background: rgba(255, 255, 255, 0.06); }
.nav-link.active { color: #fff; background: var(--accent-grad); box-shadow: 0 10px 22px -12px var(--accent-glow); }
.nav-link.active svg { opacity: 1; }

.support-card { margin-top: auto; text-align: center; padding: 16px 14px; border-radius: 16px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line-soft); }
.support-card .q { font-size: 12.5px; color: var(--ink-2); }
.support-card a { display: block; margin-top: 3px; font-weight: 700; font-size: 13.5px; color: #b9aeff; }

/* mobile top app-bar (hidden ≥1024) */
.appbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--appbar-h); display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 0 16px;
  background: rgba(11, 13, 20, 0.72);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
}
.appbar .brand-mini { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 16px; letter-spacing: -0.02em; min-width: 0; }
.appbar .brand-mini .spark { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 16px; flex: none; background: var(--accent-grad); box-shadow: 0 8px 20px -8px var(--accent-glow); }
.appbar .brand-mini .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* content region */
.content { padding: 18px 16px 28px; }

/* topbar inside content (page title + controls) */
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.topbar .tt { min-width: 0; }
.topbar h1 { font-size: clamp(21px, 6vw, 30px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; }
.topbar .sub { color: var(--ink-2); font-size: 13.5px; font-weight: 500; margin-top: 5px; }
.topbar-controls { display: flex; align-items: center; gap: 10px; flex: none; }

.search { display: flex; align-items: center; gap: 9px; height: 42px; padding: 0 15px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); transition: .15s; width: clamp(180px, 22vw, 300px); }
.search:focus-within { border-color: rgba(255, 255, 255, 0.32); }
.search svg { width: 16px; height: 16px; color: var(--ink-3); flex: none; }
.search input { background: none; border: none; outline: none; color: var(--ink); font-size: 13.5px; width: 100%; }
.search input::placeholder { color: var(--ink-3); }

.bell { position: relative; width: 42px; height: 42px; border-radius: 999px; flex: none; display: grid; place-items: center; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); transition: .15s; }
.bell:hover { color: var(--ink); border-color: rgba(255, 255, 255, 0.3); }
.bell svg { width: 19px; height: 19px; }
.bell .nd { position: absolute; top: 10px; right: 11px; width: 8px; height: 8px; border-radius: 999px; background: #fb7185; box-shadow: 0 0 0 2px var(--bg); }

/* user menu */
.usermenu { position: relative; }
.usermenu > summary { list-style: none; cursor: pointer; }
.usermenu > summary::-webkit-details-marker { display: none; }
.avatar { width: 40px; height: 40px; border-radius: 999px; flex: none; display: grid; place-items: center; font-weight: 800; font-size: 15px; color: #fff; background: var(--accent-grad); box-shadow: 0 8px 20px -10px var(--accent-glow); }
.usermenu .menu { position: absolute; right: 0; top: 50px; min-width: 196px; padding: 10px; z-index: 60; border-radius: var(--radius-sm); }
.usermenu .menu .who { padding: 6px 10px 10px; border-bottom: 1px solid var(--line-soft); margin-bottom: 8px; }

/* bottom tab-bar (mobile nav; hidden ≥1024) */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  display: flex; align-items: stretch;
  height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(11, 13, 20, 0.82);
  border-top: 1px solid var(--line-soft);
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
}
.bottom-nav .tab {
  flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--ink-3); font-size: 10.5px; font-weight: 600; letter-spacing: .01em; padding: 6px 2px; min-width: 0;
  transition: color .15s;
}
.bottom-nav .tab svg { width: 22px; height: 22px; flex: none; }
.bottom-nav .tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bottom-nav .tab.active { color: #fff; }
.bottom-nav .tab.active svg { color: #b9aeff; }
.bottom-nav summary { list-style: none; }
.bottom-nav summary::-webkit-details-marker { display: none; }

/* "Mehr" slide-up sheet */
.more-sheet { display: contents; }
.more-sheet > summary { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--ink-3); font-size: 10.5px; font-weight: 600; padding: 6px 2px; cursor: pointer; }
.more-sheet > summary svg { width: 22px; height: 22px; }
.more-sheet > summary.active { color: #fff; }
.more-sheet > summary.active svg { color: #b9aeff; }
.more-sheet[open] > summary { color: #fff; }
.more-panel {
  position: fixed; left: 0; right: 0; bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 0px));
  z-index: 46; padding: 10px; margin: 0 10px; border-radius: 18px;
  background: rgba(16, 19, 30, 0.96); border: 1px solid var(--line);
  box-shadow: 0 -10px 40px -12px rgba(0, 0, 0, 0.7);
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px;
  animation: sheet-up .22s cubic-bezier(.2, .7, .2, 1) both;
}
.more-panel a { display: flex; align-items: center; gap: 10px; padding: 12px 13px; border-radius: 12px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.more-panel a svg { width: 19px; height: 19px; flex: none; opacity: .9; }
.more-panel a.active { color: #fff; background: var(--accent-grad); }
.more-panel a:hover { color: var(--ink); background: rgba(255, 255, 255, 0.06); }
@keyframes sheet-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* buttons */
.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-weight: 700; font-size: 13.5px; line-height: 1; cursor: pointer;
  padding: 11px 18px; border-radius: 999px; border: 1px solid transparent; color: #fff;
  background: var(--accent-grad); box-shadow: 0 10px 22px -12px var(--accent-glow); transition: .15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: rgba(255, 255, 255, 0.07); border-color: var(--line); color: var(--ink); box-shadow: none; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.13); filter: none; }
.btn-success { background: linear-gradient(135deg, #34d399, #10b981); box-shadow: 0 10px 22px -12px rgba(16, 185, 129, .5); }
.btn-danger { background: linear-gradient(135deg, #fb7185, #f43f5e); box-shadow: 0 10px 22px -12px rgba(244, 63, 94, .5); }
.btn-sm { padding: 8px 14px; font-size: 12.5px; }
.btn-xs { padding: 7px 12px; font-size: 11.5px; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--ink-3); background: transparent; border: none; cursor: pointer; transition: .15s; font-size: 15px; }
.icon-btn:hover { color: #fda4af; background: rgba(244, 63, 94, .14); }

/* form fields */
.input, .select, .textarea {
  width: 100%; font-size: 14px; color: var(--ink);
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 13px; outline: none; transition: .15s;
}
.textarea { resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); background: rgba(255, 255, 255, 0.1); }
.select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff88' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; background-size: 15px; padding-right: 34px; }
.select option { background: #16182a; color: #fff; }
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus, textarea:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.06) inset;
  caret-color: var(--ink); border-radius: 12px;
  transition: background-color 9999s ease-in-out 0s;
}
.field-label { display: block; font-size: 11.5px; color: var(--ink-2); margin-bottom: 6px; font-weight: 600; }
input[type="color"] { -webkit-appearance: none; appearance: none; border: 1px solid var(--line); border-radius: 10px; width: 44px; height: 36px; background: transparent; cursor: pointer; padding: 2px; }
input[type="file"] { font-size: 13px; }
input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--accent); }

/* badges / dots */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 4px 11px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); color: var(--ink-2); border: 1px solid var(--line-soft); white-space: nowrap; }
.b-ok   { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; border-color: rgba(16, 185, 129, .38); }
.b-fail { background: rgba(244, 63, 94, 0.2);  color: #fda4af; border-color: rgba(244, 63, 94, .38); }
.b-warn { background: rgba(245, 188, 47, 0.2); color: #fbcb3f; border-color: rgba(245, 188, 47, .4); }
.b-info { background: rgba(56, 189, 248, 0.2); color: #7dd3fc; border-color: rgba(56, 189, 248, .4); }
.b-accent { background: rgba(139, 124, 255, .22); color: #cabfff; border-color: rgba(139, 124, 255, .38); }
.dot { width: 8px; height: 8px; border-radius: 999px; display: inline-block; flex: none; }
.dot-ok { background: #34d399; box-shadow: 0 0 8px #34d39988; }
.dot-off { background: rgba(255, 255, 255, .35); }
.dot-warn { background: #fbcb3f; }
.dot-fail { background: #fb7185; }

/* stat cards */
.stat { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.stat .ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.stat .ico svg { width: 22px; height: 22px; }
.stat .meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.stat .lbl { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.stat .num { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; line-height: 1; }
.ico-green  { background: rgba(52, 211, 153, .16); color: #34d399; border: 1px solid rgba(52, 211, 153, .3); }
.ico-blue   { background: rgba(56, 189, 248, .16); color: #4cc2f8; border: 1px solid rgba(56, 189, 248, .3); }
.ico-violet { background: rgba(139, 124, 255, .2); color: #a99cff; border: 1px solid rgba(139, 124, 255, .32); }
.ico-gold   { background: rgba(245, 188, 47, .18); color: #f6c33f; border: 1px solid rgba(245, 188, 47, .32); }
.ico-rose   { background: rgba(244, 63, 94, .16);  color: #fb7185; border: 1px solid rgba(244, 63, 94, .3); }
.ico-cyan   { background: rgba(45, 212, 191, .16);  color: #2dd4bf; border: 1px solid rgba(45, 212, 191, .3); }

.card-title { font-weight: 700; font-size: 16px; letter-spacing: -0.01em; color: var(--ink); }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }

/* tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl thead th { text-align: left; font-weight: 700; font-size: 12px; color: var(--ink-2); padding: 13px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl tbody td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: rgba(255, 255, 255, 0.04); }

.divlist > * + * { border-top: 1px solid var(--line-soft); }

/* log console */
.console { font-family: 'SF Mono', ui-monospace, 'JetBrains Mono', monospace; font-size: 12px; line-height: 1.6; background: rgba(0, 0, 0, 0.34); word-break: break-word; }
.console .lv-error { color: #fb7185; } .console .lv-warn { color: #fbcb3f; } .console .lv-success { color: #34d399; } .console .lv-info { color: var(--ink-2); }

/* banners */
.banner { border-radius: 14px; padding: 12px 15px; font-size: 13.5px; display: flex; align-items: center; gap: 9px; }
.banner-live { background: rgba(244, 63, 94, 0.16); border: 1px solid rgba(244, 63, 94, 0.42); color: #fecdd3; }
.banner-dry  { background: rgba(56, 189, 248, 0.14); border: 1px solid rgba(56, 189, 248, 0.38); color: #bae6fd; }
.banner-warn { background: rgba(245, 188, 47, 0.14); border: 1px solid rgba(245, 188, 47, 0.38); color: #fde68a; }
.banner-ok   { background: rgba(16, 185, 129, 0.16); border: 1px solid rgba(16, 185, 129, 0.38); color: #a7f3d0; }
.banner-err  { background: rgba(244, 63, 94, 0.16); border: 1px solid rgba(244, 63, 94, 0.42); color: #fecdd3; }

/* login / standalone logo */
.logo { box-shadow: 0 12px 30px -8px var(--accent-glow); }

/* scrollbar */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.26); background-clip: content-box; }

/* entrance motion */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.reveal { animation: rise .5s cubic-bezier(.2, .7, .2, 1) both; }

/* ╭─ 5. RESPONSIVE BEHAVIOURS ─────────────────────────────────────────────────╮ */

/* phone: keep content clear of the fixed bottom tab-bar */
@media (max-width: 1023px) {
  .content { padding-bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 0px) + 18px); }
  /* hide desktop-only topbar controls (search + bell + desktop avatar) */
  .topbar-controls { display: none; }
  /* avatar/logout lives in the app-bar on mobile */
  .appbar .usermenu .menu { right: 0; top: 46px; }
  /* bigger inputs so iOS Safari doesn't zoom on focus (needs ≥16px) */
  .input, .select, .textarea, .search input { font-size: 16px; }
  /* comfortable touch targets */
  .btn, .btn-sm, .btn-xs { min-height: 40px; }
  .icon-btn { width: 40px; height: 40px; }
  .nav-link { padding: 13px 14px; }
}

/* desktop ≥1024: sidebar shell, hide mobile chrome, add glass blur */
@media (min-width: 1024px) {
  .appbar, .bottom-nav { display: none; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); padding: 24px 14px 18px;
    display: flex; flex-direction: column; gap: 4px; z-index: 30;
    border-right: 1px solid var(--line-soft);
    background: rgba(11, 13, 20, 0.5);
    backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
  }
  .content { margin-left: var(--sidebar-w); padding: 26px clamp(20px, 3vw, 40px) 44px; }
  .topbar h1 { font-size: clamp(26px, 2.4vw, 32px); }
  /* light frost on cards only where it's cheap (few large panels) */
  .glass { backdrop-filter: blur(12px) saturate(135%); -webkit-backdrop-filter: blur(12px) saturate(135%); }
}

/* responsive TABLE → CARD list (opt-in via `.tbl.cards`) on phones */
@media (max-width: 767px) {
  .tbl.cards thead { display: none; }
  .tbl.cards, .tbl.cards tbody { display: block; width: 100%; }
  .tbl.cards tr {
    display: block; border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03); padding: 4px 4px; margin: 0 0 12px;
  }
  .tbl.cards tr:hover { background: rgba(255, 255, 255, 0.03); }
  .tbl.cards td {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding: 9px 12px; border: 0 !important; text-align: right; min-height: 38px;
  }
  .tbl.cards td::before {
    content: attr(data-label); font-weight: 600; font-size: 12px; color: var(--ink-2);
    text-align: left; flex: none; white-space: nowrap;
  }
  .tbl.cards td[data-label=""]::before, .tbl.cards td:not([data-label])::before { display: none; }
  .tbl.cards td:empty { display: none; }
  /* media / action cells span the row */
  .tbl.cards td.cell-block { justify-content: flex-start; text-align: left; }
  .tbl.cards td.cell-actions { justify-content: flex-end; }
}

/* source-edit inline form: stack to full width on small screens */
@media (max-width: 640px) {
  .source-edit .input, .source-edit .select { width: 100% !important; }
  .source-edit { gap: .5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .more-panel { animation: none; }
  * { scroll-behavior: auto; }
}
