/* ==========================================================================
   NyxForms — dashboard
   ========================================================================== */

:root {
  --primary: #7c5cff;
  --accent: #4d8dff;
  --success: #4ade80;
  --error: #f87171;
  --warning: #fbbf24;

  --bg: #0a0a12;
  --sidebar: #0d0d16;
  --card: #14141f;
  --card-2: #1a1a28;
  --card-3: #20202f;
  --border: #2a2a3d;
  --border-soft: #22222f;

  --text: #e8e8f0;
  --text-2: #a0a0b8;
  --text-3: #5a5a72;

  --grad: linear-gradient(135deg, var(--primary), var(--accent));
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 14px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --sb-w: 252px;

  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--accent); }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 700; letter-spacing: -0.02em; }
code {
  font-family: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--card-2);
  padding: 2px 6px;
  border-radius: 5px;
  color: #9ad;
}
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }

/* ==========================================================================
   Layout
   ========================================================================== */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sb-w);
  flex: none;
  background: var(--sidebar);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  transition: transform 0.3s var(--ease);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sb-head { padding: 20px 18px 16px; border-bottom: 1px solid var(--border-soft); }
.sb-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 16px;
  color: var(--text);
  letter-spacing: -0.02em;
}
.sb-logo:hover { color: var(--text); }
.logo-mark {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--grad);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 13px;
  flex: none;
  box-shadow: 0 3px 10px rgba(124, 92, 255, 0.35);
}

.form-switcher { padding: 14px 12px; border-bottom: 1px solid var(--border-soft); }
.form-switcher label {
  display: block;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--text-3);
  font-weight: 700;
  margin: 0 6px 8px;
}
.form-switcher select {
  width: 100%;
  padding: 9px 11px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s var(--ease);
}
.form-switcher select:hover { border-color: var(--primary); }
.form-switcher select:focus { outline: 0; border-color: var(--primary); }

.sb-nav { padding: 14px 12px; flex: 1; }
.sb-nav h5 {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--text-3);
  font-weight: 700;
  margin: 0 6px 8px;
}
.sb-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
  border: 0;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  margin-bottom: 2px;
}
.sb-link svg { flex: none; opacity: 0.85; }
.sb-link:hover { background: rgba(255, 255, 255, 0.045); color: var(--text); }
.sb-link.active { background: rgba(124, 92, 255, 0.14); color: #c4b5fd; }
.sb-link.active svg { opacity: 1; }
.sb-badge {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  min-width: 20px;
  text-align: center;
}

.sb-foot { padding: 14px 12px; border-top: 1px solid var(--border-soft); }
.plan-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 13px;
  margin-bottom: 10px;
}
.plan-box .row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.plan-box .row span { font-size: 11.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.07em; font-weight: 700; }
.pill {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.pill-free { background: var(--card-3); color: var(--text-2); }
.pill-pro { background: var(--grad); color: #fff; }
.meter { height: 5px; background: var(--card-3); border-radius: 99px; overflow: hidden; margin-bottom: 7px; }
.meter i {
  display: block;
  height: 100%;
  background: var(--grad);
  border-radius: 99px;
  width: 0;
  transition: width 0.6s var(--ease), background 0.3s var(--ease);
}
.meter.warn i { background: linear-gradient(135deg, #fbbf24, #f87171); }
.plan-box small { font-size: 11.5px; color: var(--text-3); display: block; }

.main { flex: 1; min-width: 0; margin-left: var(--sb-w); display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(10, 10, 18, 0.88);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border-soft);
  padding: 14px 26px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.topbar h1 { font-size: 19px; }
.topbar .topbar-sub { font-size: 12.5px; color: var(--text-3); margin-top: 1px; }
.topbar-actions { margin-left: auto; display: flex; gap: 9px; flex-wrap: wrap; }

.burger {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  padding: 8px 10px;
  cursor: pointer;
  line-height: 0;
}

.content { padding: 26px; flex: 1; }
.view { display: none; animation: fade 0.28s var(--ease); }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ==========================================================================
   Buttons / inputs
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.16s var(--ease), filter 0.2s var(--ease),
    background 0.2s var(--ease), border-color 0.2s var(--ease), opacity 0.2s var(--ease);
  white-space: nowrap;
  line-height: 1.35;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 3px 14px rgba(124, 92, 255, 0.3); }
.btn-primary:hover { color: #fff; filter: brightness(1.09); }
.btn-ghost { background: var(--card); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--primary); color: var(--text); background: var(--card-2); }
.btn-danger { background: rgba(248, 113, 113, 0.12); border-color: rgba(248, 113, 113, 0.35); color: #fca5a5; }
.btn-danger:hover { background: rgba(248, 113, 113, 0.2); color: #fca5a5; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-block { width: 100%; }

.input, .field input, .field textarea, .field select {
  width: 100%;
  padding: 10px 13px;
  background: #0d0d15;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.input::placeholder, .field input::placeholder, .field textarea::placeholder { color: var(--text-3); }
.input:focus, .field input:focus, .field textarea:focus, .field select:focus {
  outline: 0;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.15);
}
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--text-3); margin-top: 6px; line-height: 1.5; }
.field textarea { resize: vertical; min-height: 80px; }

/* ==========================================================================
   Cards / stats
   ========================================================================== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
  margin-bottom: 20px;
}
.card > h2 { font-size: 16px; margin-bottom: 4px; }
.card > .card-sub { font-size: 13px; color: var(--text-3); margin: 0 0 20px; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.stat:hover { border-color: rgba(124, 92, 255, 0.4); transform: translateY(-2px); }
.stat::after {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 70px; height: 70px;
  background: radial-gradient(circle at 100% 0%, rgba(124, 92, 255, 0.16), transparent 70%);
  pointer-events: none;
}
.stat .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-3);
  font-weight: 700;
  margin-bottom: 8px;
}
.stat .value { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.stat .delta { font-size: 12px; color: var(--text-3); margin-top: 7px; }
.stat.accent .value { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Chart */
.chart-card { position: relative; }
.chart-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.chart-head h2 { font-size: 16px; }
.chart-legend { margin-left: auto; font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 7px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--grad); display: block; }
#chart { width: 100%; height: 190px; display: block; }
.chart-tip {
  position: absolute;
  background: var(--card-3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 7px 11px;
  font-size: 12px;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -100%);
  transition: opacity 0.15s var(--ease);
  white-space: nowrap;
  z-index: 5;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}
.chart-tip.on { opacity: 1; }
.chart-tip b { color: #fff; }

/* ==========================================================================
   Toolbar + submissions
   ========================================================================== */
.toolbar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; align-items: center; }
.search { position: relative; flex: 1; min-width: 200px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search input { padding-left: 38px; }
.filters { display: flex; gap: 6px; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 3px; }
.filters button {
  background: none;
  border: 0;
  padding: 6px 13px;
  border-radius: 6px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
.filters button:hover { color: var(--text); }
.filters button.on { background: rgba(124, 92, 255, 0.18); color: #c4b5fd; }

.subs { display: grid; gap: 10px; }
.sub {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: border-color 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.sub:hover { border-color: rgba(124, 92, 255, 0.35); }
.sub.unread { border-left: 3px solid var(--primary); }
.sub.open { border-color: rgba(124, 92, 255, 0.5); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3); }

.sub-head {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 18px;
  cursor: pointer;
  user-select: none;
}
.sub-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--card-3);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text-2);
  flex: none;
}
.sub.unread .sub-avatar { background: var(--grad); color: #fff; }
.sub-meta { min-width: 0; flex: 1; }
.sub-name { font-weight: 600; font-size: 14.5px; display: flex; align-items: center; gap: 8px; }
.sub-name .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); flex: none; }
.sub-preview {
  font-size: 13px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}
.sub-time { font-size: 12px; color: var(--text-3); flex: none; white-space: nowrap; }
.sub-chev { color: var(--text-3); flex: none; transition: transform 0.25s var(--ease); }
.sub.open .sub-chev { transform: rotate(180deg); }

.sub-body { max-height: 0; overflow: hidden; transition: max-height 0.32s var(--ease); }
.sub-body > div { padding: 0 18px 18px; border-top: 1px solid var(--border-soft); margin-top: 0; padding-top: 16px; }
.sub-msg { white-space: pre-wrap; line-height: 1.65; color: var(--text); font-size: 14.5px; margin-bottom: 16px; word-break: break-word; }
.kv { display: grid; grid-template-columns: minmax(90px, auto) 1fr; gap: 6px 16px; font-size: 13px; margin-bottom: 16px; }
.kv dt { color: var(--text-3); font-weight: 600; }
.kv dd { margin: 0; color: var(--text-2); word-break: break-all; }
.sub-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.empty { text-align: center; padding: 64px 24px; color: var(--text-3); }
.empty svg { color: var(--border); margin: 0 auto 18px; }
.empty h3 { font-size: 17px; color: var(--text-2); margin-bottom: 8px; }
.empty p { margin: 0 auto; max-width: 380px; font-size: 14px; line-height: 1.6; }

.skeleton {
  background: linear-gradient(90deg, var(--card) 25%, var(--card-2) 50%, var(--card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--r-lg);
  height: 68px;
  margin-bottom: 10px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ==========================================================================
   Settings
   ========================================================================== */
.embed-box { position: relative; }
.embed-box pre {
  background: #0d0d15;
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px 52px 16px 16px;
  font-family: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 12.5px;
  color: #9ad;
  overflow-x: auto;
  margin: 0;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-all;
}
.copy-btn {
  position: absolute;
  top: 10px; right: 10px;
  background: var(--card-3);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text-2);
  padding: 6px 9px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  line-height: 0;
}
.copy-btn:hover { color: var(--text); border-color: var(--primary); }
.copy-btn.done { color: var(--success); border-color: var(--success); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--border-soft);
}
.switch-row:first-of-type { border-top: 0; }
.switch-row strong { display: block; font-size: 14px; font-weight: 600; }
.switch-row small { color: var(--text-3); font-size: 12.5px; }
.switch { position: relative; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i {
  position: absolute;
  inset: 0;
  background: var(--card-3);
  border-radius: 99px;
  cursor: pointer;
  transition: background 0.25s var(--ease);
}
.switch i::before {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s var(--ease);
}
.switch input:checked + i { background: var(--primary); }
.switch input:checked + i::before { transform: translateX(18px); }

.theme-picker { display: flex; gap: 10px; flex-wrap: wrap; }
.theme-opt {
  flex: 1;
  min-width: 92px;
  background: var(--card-2);
  border: 2px solid var(--border);
  border-radius: var(--r);
  padding: 12px 10px;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  font-family: inherit;
}
.theme-opt:hover { transform: translateY(-2px); }
.theme-opt.on { border-color: var(--primary); color: var(--text); }
.theme-swatch { height: 26px; border-radius: 6px; margin-bottom: 8px; border: 1px solid var(--border); }
.sw-cosmic { background: linear-gradient(135deg, #14141f, #2a2a3d); }
.sw-dark { background: linear-gradient(135deg, #18181b, #333338); }
.sw-light { background: linear-gradient(135deg, #ffffff, #e4e4e9); }
.sw-minimal { background: repeating-linear-gradient(45deg, #1a1a28, #1a1a28 5px, #22222f 5px, #22222f 10px); }

.color-row { display: flex; gap: 10px; align-items: center; }
.color-row input[type="color"] {
  width: 46px; height: 42px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--card-2);
  cursor: pointer;
  flex: none;
}

.cf-list { display: grid; gap: 10px; margin-bottom: 14px; }
.cf-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto auto;
  gap: 8px;
  align-items: center;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px;
}
.cf-row input, .cf-row select { padding: 8px 10px; font-size: 13px; }
.cf-req { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.cf-del {
  background: none;
  border: 0;
  color: var(--text-3);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  line-height: 0;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.cf-del:hover { color: var(--error); background: rgba(248, 113, 113, 0.1); }

.danger-zone { border-color: rgba(248, 113, 113, 0.3); }
.danger-zone h2 { color: #fca5a5; }

/* Account view */
.form-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 15px 17px;
  margin-bottom: 10px;
  transition: border-color 0.2s var(--ease);
}
.form-card:hover { border-color: rgba(124, 92, 255, 0.4); }
.form-card .icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: rgba(124, 92, 255, 0.14);
  display: grid;
  place-items: center;
  color: var(--primary);
  flex: none;
}
.form-card .info { flex: 1; min-width: 0; }
.form-card strong { display: block; font-size: 14.5px; }
.form-card small { color: var(--text-3); font-size: 12.5px; }

/* ==========================================================================
   Toasts / modal
   ========================================================================== */
.toasts { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: grid; gap: 10px; }
.toast {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--r);
  padding: 13px 17px;
  font-size: 13.5px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  animation: toastIn 0.3s var(--ease);
  max-width: 330px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast.out { animation: toastOut 0.25s var(--ease) forwards; }
.toast.ok { border-left-color: var(--success); }
.toast.err { border-left-color: var(--error); }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }

.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 12, 0.75);
  backdrop-filter: blur(5px);
  z-index: 150;
  display: none;
  place-items: center;
  padding: 20px;
}
.modal-back.on { display: grid; animation: fade 0.2s var(--ease); }
.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 26px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
  animation: modalIn 0.25s var(--ease);
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: none; } }
.modal h3 { font-size: 17px; margin-bottom: 10px; }
.modal p { color: var(--text-2); font-size: 14px; margin: 0 0 22px; line-height: 1.6; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

.sb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 12, 0.6);
  z-index: 55;
}
.sb-overlay.on { display: block; animation: fade 0.2s var(--ease); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); box-shadow: 20px 0 60px rgba(0, 0, 0, 0.5); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .burger { display: inline-flex; }
  .content { padding: 18px; }
  .topbar { padding: 12px 18px; }
  .grid-2 { grid-template-columns: 1fr; }
  .cf-row { grid-template-columns: 1fr 1fr; }
  .cf-row .cf-req { grid-column: 1; }
  .cf-row .cf-del { grid-column: 2; justify-self: end; }
  .toasts { left: 16px; right: 16px; bottom: 16px; }
  .toast { max-width: none; }
  /* The preview line is the whole point of an inbox — keep it on mobile. */
  .sub-preview { display: block; }
}

@media (max-width: 560px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat { padding: 14px; }
  .stat .value { font-size: 24px; }
  .topbar h1 { font-size: 16px; }
  .topbar-actions { width: 100%; }
  .topbar-actions .btn { flex: 1; }
  .sub-head { padding: 14px; gap: 12px; flex-wrap: wrap; }
  /* Time moves under the name instead of disappearing. */
  .sub-time { order: 3; width: 100%; padding-left: 50px; margin-top: -6px; }
  .sub-chev { order: 2; }
  .sub-actions { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .sub-actions .btn { width: 100%; justify-content: center; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dt { margin-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ------------------------------------------ empty state: embed helper */
.empty-embed {
  margin: 24px auto 0;
  max-width: 460px;
  background: var(--bg-2, #0e0e18);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  text-align: left;
}
.empty-embed-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 10px;
}
.empty-embed code {
  display: block;
  font-family: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  color: #9ad;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 9px;
  padding: 12px 13px;
  word-break: break-all;
  line-height: 1.6;
  user-select: all;
  margin-bottom: 12px;
}
.empty-embed .btn { width: 100%; }
.empty p { margin-bottom: 0; }

/* ==========================================================================
   Language switcher (DE / EN) — dashboard variant
   ========================================================================== */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  flex: none;
}
.lang-switch button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: none;
  cursor: pointer;
  color: var(--text-3);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1;
  padding: 5px 9px;
  border-radius: 999px;
  transition: color 0.18s, background 0.18s;
}
.lang-switch button:hover { color: var(--text-2); }
.lang-switch button.on {
  color: #fff;
  background: rgba(124, 92, 255, 0.22);
  box-shadow: inset 0 0 0 1px rgba(124, 92, 255, 0.4);
}
.lang-switch .flag { font-size: 13px; line-height: 1; }
.lang-switch .code { font-size: 11.5px; }

@media (max-width: 720px) {
  .topbar .lang-switch .code { display: none; }
}

html:not(.i18n-ready) body { visibility: hidden; }
html.i18n-ready body { visibility: visible; }
