﻿@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;

  --bg: #09090b;
  --bg-elevated: #0c0c0e;
  --surface: #18181b;
  --surface-hover: #1f1f23;
  --border: #27272a;
  --border-hover: #3f3f46;

  --text: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #52525b;

  --accent: #ffffff;
  --accent-muted: rgba(255,255,255,0.08);
  --accent-hover: rgba(255,255,255,0.12);

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.6);

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 150ms var(--ease);
  --transition-slow: 250ms var(--ease);
}

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

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: var(--bg); }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

a { color: inherit; text-decoration: none; }

/* ========== LAYOUT ========== */

.shell {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.sidebar {
  width: 260px;
  min-height: 100vh;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 20;
  transition: transform var(--transition-slow);
}

.sidebar::-webkit-scrollbar { width: 0; }

.main {
  flex: 1;
  margin-left: 260px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ========== SIDEBAR ========== */

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-text {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text);
}

.brand-text span {
  color: var(--text-muted);
  font-weight: 400;
}

.nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-sep {
  padding: 16px 12px 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: transparent;
  border: none;
  border-left: 2px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 12px;
  cursor: pointer;
  text-decoration: none;
  text-align: left;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  transition: all var(--transition);
}

.nav-item:hover {
  color: var(--text);
  background: var(--accent-muted);
}

.nav-item.active {
  color: var(--text);
  background: var(--accent-muted);
  border-left-color: var(--accent);
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.6;
}

.nav-item.active svg,
.nav-item:hover svg {
  opacity: 1;
}

.nav-count {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  color: var(--bg);
  background: var(--text);
  border-radius: 10px;
  padding: 1px 7px;
  min-width: 20px;
  text-align: center;
}

.nav-count:empty { display: none; }

.nav-tag {
  margin-left: auto;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
}

.sidebar-foot {
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.lic-chip {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lic-chip.dim { font-size: 9px; color: var(--text-muted); }

/* ========== TOPBAR ========== */

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
}

.topbar-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--text);
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.online-txt {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background: var(--text);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.burger {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.burger:hover { border-color: var(--border-hover); color: var(--text); }

.burger svg { width: 18px; height: 18px; }

/* ========== VIEWS ========== */

.view {
  display: none;
  padding: 28px;
  animation: viewIn 0.3s var(--ease) both;
}

.view.active { display: block; }

@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ========== STAT GRID ========== */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: all var(--transition);
}

.stat-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-num {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 8px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1px;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ========== CARDS ========== */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  overflow: hidden;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
}

.table-wrap {
  overflow-x: auto;
}

.card > .form-row,
.card > .table-wrap,
.card > .profile-grid,
.card > .device-grid,
.card > .builder-actions,
.card > .build-progress,
.card > .an-fixed,
.card > .an-actions,
#fields-electron,
#fields-mcmod {
  padding-left: 20px;
  padding-right: 20px;
}

.card > .table-wrap { padding-top: 0; }
.card > .profile-grid { padding-top: 20px; padding-bottom: 4px; }
.card > .device-grid { padding: 20px; }
.card > .an-actions { padding-bottom: 20px; }
.card > .builder-actions { padding-top: 4px; padding-bottom: 20px; }
.card > .build-progress { padding: 0 20px 20px; }
.card > .btn-primary { margin: 0 20px 20px; }

.counter {
  color: var(--text);
  font-weight: 600;
}

/* ========== TABLES ========== */

.ztable { width: 100%; border-collapse: collapse; font-size: 13px; }

.ztable th {
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  text-transform: uppercase;
}

.ztable td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-secondary);
}

.ztable tbody tr {
  transition: background var(--transition);
}

.ztable tbody tr:hover { background: var(--accent-muted); }

.ztable .empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 16px;
  font-size: 13px;
}

/* ========== FORMS ========== */

#fields-electron,
#fields-mcmod {
  padding-left: 20px;
  padding-right: 20px;
  margin-top: 8px;
}

.form-row { margin-bottom: 20px; }

.form-row label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
}

.form-row input,
.form-row textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 10px 12px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-row input:focus,
.form-row textarea:focus {
  border-color: var(--border-hover);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.form-row textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

.zselect {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 10px 12px;
  outline: none;
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2352525b' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.zselect:focus {
  border-color: var(--border-hover);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.zselect option { background: var(--bg); color: var(--text); }

/* ========== DURATION WIDGETS ========== */

.dur-combo { display: flex; gap: 8px; }
.dur-combo input { flex: 1; min-width: 0; }
.dur-combo .zselect { width: 140px; flex: none; }

.form-row input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.form-hint {
  margin-top: 7px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-muted);
}

.mode-toggle {
  display: flex;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
}

.mode-toggle button {
  flex: 1;
  background: transparent;
  border: 0;
  border-radius: calc(var(--radius-sm) - 1px);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.6px;
  padding: 8px 10px;
  cursor: pointer;
  transition: all var(--transition);
}

.mode-toggle button.active {
  background: var(--text);
  color: var(--bg);
}

.stepper { display: flex; gap: 8px; }

.stepper button {
  width: 44px;
  flex: none;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: border-color var(--transition);
}

.stepper button:hover:not(:disabled) { border-color: var(--border-hover); }

.stepper button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.stepper input {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
}

.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.stepper input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

/* ========== BUTTONS ========== */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--text);
  color: var(--bg);
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all var(--transition);
  text-transform: uppercase;
}

.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn-primary.sm { padding: 7px 14px; font-size: 11px; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-ghost:hover { border-color: var(--border-hover); color: var(--text); }
.btn-ghost:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-ghost.sm { padding: 5px 10px; font-size: 10px; }

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-danger:hover { border-color: var(--border-hover); color: var(--text); }
.btn-danger.sm { padding: 5px 10px; font-size: 10px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.btn:hover { border-color: var(--border-hover); color: var(--text); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ========== MODAL ========== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.modal-backdrop.show { opacity: 1; pointer-events: auto; }

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: min(480px, calc(100vw - 32px));
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-slow);
  box-shadow: var(--shadow-lg);
}

.modal.show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.modal-head {
  padding: 18px 20px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.modal-body { padding: 20px; }

.modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.modal-err {
  display: none;
  color: var(--text);
  border: 1px solid var(--border);
  background: var(--bg);
  padding: 10px 14px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.modal-err.show { display: block; }

/* ========== TOAST ========== */

.toast-stack {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--text);
  color: var(--text);
  padding: 12px 18px;
  font-size: 13px;
  border-radius: var(--radius-sm);
  min-width: 260px;
  max-width: 400px;
  box-shadow: var(--shadow-md);
  animation: toastIn 0.3s var(--ease) both;
}

.toast.out { animation: toastOut 0.2s var(--ease) both; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: none; }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateX(20px); }
}

/* ========== PROFILE CARDS ========== */

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
  padding: 20px;
}

.profile-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: all var(--transition);
}

.profile-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.profile-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.profile-user {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.profile-url {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  word-break: break-all;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 18px;
  line-height: 1.6;
  background: var(--surface);
}

.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ========== DEVICE CARDS ========== */

.device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  padding: 4px 0;
}

.device-card {
  display: block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  text-decoration: none;
  color: var(--text);
  transition: all var(--transition);
}

.device-card:hover {
  border-color: var(--border-hover);
  background: var(--surface);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.device-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
}

.device-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.device-dot.live {
  background: var(--text);
  box-shadow: 0 0 8px rgba(255,255,255,0.3);
}

.dev-live {
  margin-left: auto;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--text);
  border: 1px solid var(--text-muted);
  padding: 2px 6px;
  border-radius: 4px;
}

.device-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-secondary);
  gap: 8px;
}

.device-ip {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

/* ========== LOGIN ========== */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg);
}

.login-wrap {
  width: 100%;
  max-width: 420px;
}

.login-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  animation: fadeUp 0.4s var(--ease) both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  margin-bottom: 16px;
}

.login-logo h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--text);
}

.login-logo p {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-top: 6px;
  min-height: 18px;
}

.login-form .field { margin-bottom: 24px; }

.login-form label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.login-form input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 2px;
  padding: 12px 14px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.login-form input:focus {
  border-color: var(--border-hover);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.login-form .btn-primary { width: 100%; margin-top: 4px; }

.form-error {
  color: var(--text);
  border: 1px solid var(--border);
  background: var(--bg);
  padding: 10px 14px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.login-foot {
  margin-top: 24px;
  text-align: center;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-muted);
}

/* ========== 2FA ========== */

.key-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 24px;
  font-size: 12px;
}

.key-label {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
}

.key-value {
  color: var(--text);
  font-family: var(--font-mono);
  word-break: break-all;
}

.bot-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
  margin-top: 20px;
}

.bot-dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--text-muted);
}

.step-note {
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 2px;
  margin-top: 8px;
  text-transform: uppercase;
}

/* ========== UNPAIR ========== */

.unpair-box {
  margin-top: 20px;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: left;
}

.unpair-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  margin-bottom: 10px;
  color: var(--text);
}

.unpair-text {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.7;
  margin-bottom: 14px;
}

.unpair-cmd {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 12px;
}

.unpair-cmd code {
  font-family: var(--font-mono);
  font-size: 12px;
  flex: 1;
  word-break: break-all;
  color: var(--text);
}

.btn-copy {
  background: var(--text);
  color: var(--bg);
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  transition: opacity var(--transition);
}

.btn-copy:hover { opacity: 0.8; }

.unpair-open {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1px;
  color: var(--text);
  border-bottom: 1px solid var(--text-muted);
  padding-bottom: 2px;
  transition: border-color var(--transition);
}

.unpair-open:hover { border-color: var(--text); }

/* ========== ERROR ========== */

.error-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  padding: 20px;
}

.error-code {
  font-size: 120px;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
  letter-spacing: -4px;
}

.error-msg {
  color: var(--text-muted);
  font-size: 14px;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

/* ========== ANNOUNCER ========== */

.announcer-head { margin-bottom: 16px; }

.announcer-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.announcer-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.announcer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.announcer-left textarea {
  min-height: 180px;
}

.an-fixed {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.an-fixed-row {
  display: flex;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.an-fixed-row b { color: var(--text-secondary); min-width: 60px; }

.an-actions { display: flex; gap: 10px; margin-top: 16px; }
.an-actions .btn-danger { flex: 1; }
.an-actions .btn-ghost { flex: 1; }

.an-file-preview { margin-top: 8px; }
.an-file-preview img { max-height: 120px; border: 1px solid var(--border); }
.an-file-preview span { display: block; }

.announcer-right { display: flex; flex-direction: column; gap: 16px; }

.dc-embed {
  background: #1e2124;
  border-left: 4px solid #2b2d31;
  border-radius: 4px;
  padding: 14px 16px;
  min-height: 60px;
}

.dc-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.dc-desc { font-size: 12px; color: #dcddde; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.dc-desc code.dc-code { background: #2b2d31; border: 1px solid #1e1f22; border-radius: 3px; padding: 1px 5px; font-family: 'Consolas','Courier New',monospace; font-size: 11.5px; color: #e8e8e8; }
.dc-emoji { height: 1.25em; vertical-align: -0.2em; margin: 0 1px; }
.dc-footer { display: flex; align-items: center; gap: 7px; margin-top: 12px; font-size: 10px; color: #999; }

.an-results { display: flex; flex-direction: column; gap: 6px; }

.an-result {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.an-result.ok { border-color: var(--border-hover); }
.an-result.fail { border-color: var(--border-hover); }

.an-rstatus { margin-left: auto; font-weight: 600; font-size: 11px; }

/* ========== BUILDER ========== */

.build-type-switch {
  display: flex;
  gap: 8px;
}

.type-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all var(--transition);
  text-transform: uppercase;
}

.type-btn:hover { border-color: var(--border-hover); color: var(--text-secondary); }

.type-btn.active {
  border-color: var(--text-muted);
  color: var(--text);
  background: var(--accent-muted);
}

.builder-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.build-hint {
  color: var(--text-muted);
  font-size: 12px;
}

.build-progress { margin-top: 16px; }

.build-progress-track {
  width: 100%;
  height: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.build-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--text);
  transition: width 0.3s ease;
  border-radius: 3px;
}

.build-progress-bar.done { background: var(--text); }
.build-progress-bar.fail { background: var(--text-muted); }

.build-progress-txt {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ---- build tetris ---- */

.build-tetris {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}

.build-tetris-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.build-tetris-stat { color: var(--text-secondary); }

.build-tetris-stage {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  flex-wrap: wrap;
}

#build-tetris-canvas {
  display: block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  image-rendering: pixelated;
  outline: none;
}

#build-tetris-canvas:focus-visible { border-color: var(--border-hover); }

.build-tetris-keys {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding-top: 2px;
}

.build-tetris-over {
  color: var(--text-secondary);
}

.mono-sm { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }

.key-cell { font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); }

.admin-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
}

.flg { width: 20px; height: 14px; border-radius: 2px; object-fit: cover; vertical-align: middle; }

.role-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.5px;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 4px;
  transition: all var(--transition);
}

.role-toggle:hover { border-color: var(--border-hover); color: var(--text-secondary); }
.role-toggle.admin { border-color: var(--text-muted); color: var(--text); }

.exp-live { color: var(--text); font-weight: 500; }
.exp-bad { color: var(--text-muted); border: 1px solid var(--border); padding: 2px 6px; font-size: 10px; border-radius: 4px; }
.exp-ok { color: var(--text-muted); }

.faint { color: var(--text-muted); font-size: 11px; }

.save-msg {
  color: var(--text-muted);
  font-size: 12px;
  margin-left: 12px;
}

/* ========== CLIENT VIEWER ========== */

.c-shell {
  position: relative;
  z-index: 2;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 10px;
  gap: 8px;
  overflow: hidden;
}

.c-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.c-back {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition);
}

.c-back:hover { color: var(--text); border-color: var(--border-hover); }

.c-device { display: flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: 0.5px; }
.c-status { font-size: 11px; color: var(--text-muted); letter-spacing: 0.5px; }

.c-tabs {
  display: flex;
  gap: 2px;
  margin-left: 12px;
  background: var(--accent-muted);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.c-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.5px;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition);
  text-transform: uppercase;
  white-space: nowrap;
}

.c-tab:hover { color: var(--text-secondary); }
.c-tab.active { color: var(--text); background: var(--surface); }

.c-top-right { display: flex; gap: 6px; margin-left: auto; }

.c-btn {
  background: var(--accent-muted);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all var(--transition);
  text-transform: uppercase;
}

.c-btn:hover { color: var(--text); border-color: var(--border-hover); }
.c-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.c-btn-accent {
  background: var(--accent-muted);
  border-color: var(--border-hover);
  color: var(--text);
}

.c-btn-accent:hover { background: var(--accent-hover); }

.c-btn-danger { border-color: var(--border); color: var(--text-muted); }

.c-panel { display: none; flex: 1; min-height: 0; overflow: hidden; }
.c-panel.active { display: flex; flex-direction: column; }

.c-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #000;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.c-stage img { width: 100%; height: 100%; object-fit: fill; display: block; }

.c-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  pointer-events: none;
}

.c-offline {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.85);
}

.c-offline.show { display: flex; }

.c-offline span {
  border: 1px solid var(--border);
  padding: 16px 24px;
  letter-spacing: 2px;
  color: var(--text-muted);
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.c-info-bar { font-size: 11px; padding: 4px 8px; color: var(--text-muted); flex-shrink: 0; }

.c-cam-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  flex-shrink: 0;
}

.c-select {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 11px;
}

.c-mic-viz { flex: 1; height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; margin-left: 12px; }
.c-mic-bar { height: 100%; width: 0; background: var(--text); transition: width 0.1s; border-radius: 3px; }
.c-mic-stage { flex-direction: column; gap: 16px; }
.c-mic-icon { font-size: 48px; opacity: 0.2; }
.c-mic-icon.pulsing { animation: micPulse 1.5s ease-in-out infinite; }
@keyframes micPulse { 0%, 100% { opacity: 0.2; } 50% { opacity: 0.8; } }

.c-section { margin: 12px; flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.c-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
}

.c-section-actions { display: flex; gap: 6px; }

.c-keylog-out, .c-chat-out {
  background: var(--bg);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding: 12px;
  flex: 1;
  min-height: 200px;
  max-height: 60vh;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-all;
}

.c-chat-input { display: flex; gap: 8px; margin-top: 8px; flex-shrink: 0; }

.c-chat-input input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 12px;
  outline: none;
}

.c-chat-input input:focus { border-color: var(--border-hover); }

/* Auto-BM */
.c-bm-status { padding: 8px 12px; color: var(--text-secondary); font-size: 13px; }
.c-bm-form { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.c-bm-row { display: flex; flex-direction: column; gap: 4px; }
.c-bm-row label { color: var(--text-secondary); font-size: 12px; font-weight: 500; }
.c-bm-row input {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition);
}
.c-bm-row input:focus { border-color: var(--border-hover); }
.c-bm-wallets { display: flex; flex-direction: column; gap: 6px; }
.c-bm-wallet-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.c-bm-wallet-row select {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  outline: none;
  min-width: 70px;
}
.c-bm-wallet-row input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: var(--font-mono);
  outline: none;
}
.c-bm-wallet-row input[readonly] { flex: 0 0 140px; color: var(--text-secondary); }
.c-btn-danger { background: #dc2626 !important; color: #fff !important; }
.c-btn-danger:hover { background: #b91c1c !important; }

/* File Manager */
.c-fm-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  flex-shrink: 0;
}

.c-fm-bc { display: flex; align-items: center; flex-wrap: wrap; flex: 1; min-width: 0; }

.c-fm-crumb {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 4px;
  transition: all var(--transition);
  white-space: nowrap;
}

.c-fm-crumb:hover { color: var(--text); background: var(--accent-muted); }
.c-fm-crumb.active { color: var(--text); }
.c-fm-sep { color: var(--text-muted); font-size: 11px; padding: 0 2px; }
.c-fm-actions { display: flex; gap: 6px; flex-shrink: 0; }

.c-fm-wrap {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.c-fm-table { width: 100%; border-collapse: collapse; table-layout: fixed; }

.c-fm-ico { width: 36px; min-width: 36px; text-align: center; }
.c-fm-name { text-align: left; padding-left: 8px; }
.c-fm-size { width: 140px; min-width: 140px; text-align: right; padding-right: 12px; }
.c-fm-date { width: 160px; min-width: 160px; text-align: right; padding-right: 12px; }

.c-fm-row {
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border);
}

.c-fm-row:hover { background: var(--accent-muted); }

.c-fm-ico-cell { text-align: center; font-size: 14px; padding: 6px 4px; width: 36px; }
.c-fm-name-cell { padding: 6px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; color: var(--text-secondary); }
.c-fm-size-cell, .c-fm-date-cell { padding: 6px 12px; font-size: 11px; text-align: right; white-space: nowrap; color: var(--text-muted); }

.c-fm-status {
  padding: 6px 12px;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  flex-shrink: 0;
}

.c-fm-drop {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,0.8);
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
}

.c-fm-drop-inner {
  border: 2px dashed var(--text-muted);
  padding: 40px 60px;
  font-size: 14px;
  letter-spacing: 2px;
  color: var(--text-secondary);
  text-transform: uppercase;
}

/* Context Menu */
.c-ctx {
  position: fixed;
  z-index: 9999;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 0;
  min-width: 170px;
  box-shadow: var(--shadow-lg);
}

.c-ctx-item {
  padding: 8px 16px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition);
}

.c-ctx-item:hover { background: var(--accent-muted); color: var(--text); }
.c-ctx-danger { color: var(--text-muted); }
.c-ctx-sep { height: 1px; background: var(--border); margin: 4px 0; }

/* Client Modal */
.c-modal-bg { position: fixed; inset: 0; z-index: 9998; background: rgba(0,0,0,0.6); backdrop-filter: blur(2px); }
.c-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  min-width: 340px;
  max-width: 500px;
  box-shadow: var(--shadow-lg);
}

.c-modal-head { padding: 14px 18px; border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 600; }
.c-modal-body { padding: 16px 18px; }
.c-modal-foot { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

.c-lbl { display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 6px; }

.c-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 12px;
  outline: none;
}

.c-input:focus { border-color: var(--border-hover); }

.c-info-table { width: 100%; font-size: 12px; border-collapse: collapse; }
.c-info-table td { padding: 6px 0; border-bottom: 1px solid var(--border); }
.c-info-table td:first-child { width: 100px; color: var(--text-muted); }

/* Client Toast */
.c-toast-stack { position: fixed; bottom: 20px; right: 20px; z-index: 10000; display: flex; flex-direction: column; gap: 6px; }
.c-toast {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.2s;
}

.c-toast.show { opacity: 1; transform: translateY(0); }

/* ========== REPORTS ========== */

.rpt-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.75);
  align-items: center;
  justify-content: center;
}

.rpt-overlay.open { display: flex; }

.rpt-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 720px;
  width: 92%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.rpt-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.rpt-modal-title { font-weight: 600; font-size: 14px; color: var(--text); }
.rpt-modal-meta { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.rpt-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 2px 8px;
  line-height: 1;
  transition: color var(--transition);
}

.rpt-modal-close:hover { color: var(--text); }

.rpt-modal-body {
  padding: 22px;
  font-size: 12px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  overflow-y: auto;
  flex: 1;
}

.rpt-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.rpt-actions { white-space: nowrap; }

.rpt-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 3px 10px;
  font-size: 10px;
  font-family: var(--font-sans);
  letter-spacing: 0.5px;
  cursor: pointer;
  border-radius: 4px;
  transition: all var(--transition);
}

.rpt-btn:hover { border-color: var(--border-hover); color: var(--text); }

/* ========== PREBUILD ========== */

.prebuild-wait {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  padding: 20px 0;
}

.prebuild-wait p { color: var(--text-secondary); font-size: 13px; line-height: 1.8; }
.prebuild-hint { color: var(--text-muted); font-size: 12px; }

.soon-ring {
  width: 80px;
  height: 80px;
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: spin 4s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.soon-core { font-size: 28px; font-weight: 700; color: var(--text); }

/* ========== RESPONSIVE ========== */

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open { transform: translateX(0); }

  .main { margin-left: 0; }

  .burger { display: flex; }

  .view { padding: 20px 16px; }

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

  .announcer-grid { grid-template-columns: 1fr; }

  .profile-grid { grid-template-columns: 1fr; }

  .device-grid { grid-template-columns: 1fr; }

  .topbar { padding: 12px 16px; }

  .c-tabs { margin-left: 0; }

  .c-topbar { padding: 6px 8px; gap: 6px; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }

  .topbar-right { gap: 8px; }

  .login-box { padding: 28px 20px; }

  .c-tabs { overflow-x: auto; }
}

/* ========== UTILITIES ========== */

.empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 16px;
  font-size: 13px;
}

.dim { color: var(--text-muted); }

[data-i18n] { /* placeholder for i18n */ }

/* ========== REDUCED MOTION ========== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-delay: 0s !important;
    transition-duration: 0.001s !important;
  }
}

/* ========== FOCUS VISIBLE ========== */

:focus-visible {
  outline: 2px solid var(--text-muted);
  outline-offset: 2px;
}

/* ========== SIDEBAR OVERLAY ========== */

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 19;
}

.sidebar-overlay.show { display: block; }


/* ========== BUNDLE PAGE ========== */

.bundle-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.bundle-col { min-width: 0; }
.bundle-col .card { margin-bottom: 0; }

.bundle-kicker {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1px;
  color: var(--text-muted);
  text-transform: uppercase;
}
.bundle-kicker.mono { font-family: var(--font-mono); letter-spacing: 0.5px; }

.bundle-body { padding: 20px; }

.bundle-opts { display: flex; flex-direction: column; gap: 10px; }

.bundle-opt {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.bundle-opt:hover { border-color: var(--border-hover); background: var(--bg-elevated); }
.bundle-opt.active {
  border-color: var(--border-hover);
  background: var(--surface-hover);
  box-shadow: inset 2px 0 0 var(--accent);
}
.bundle-opt input { position: absolute; opacity: 0; pointer-events: none; }

.bundle-opt-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.bundle-opt.active .bundle-opt-icon { color: var(--text); border-color: var(--border-hover); }
.bundle-opt-icon svg { width: 17px; height: 17px; }

.bundle-opt-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bundle-opt-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: var(--text);
  text-transform: uppercase;
}
.bundle-opt-desc {
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.bundle-opt-tag {
  margin-left: auto;
  flex: 0 0 auto;
  align-self: center;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 8px;
  white-space: nowrap;
}
.bundle-opt.active .bundle-opt-tag { color: var(--text); border-color: var(--border-hover); }

.bundle-field { margin-top: 20px; }
.bundle-field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
}
.bundle-field input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 10px 12px;
  transition: border-color var(--transition), opacity var(--transition);
}
.bundle-field input:focus { outline: none; border-color: var(--border-hover); }
.bundle-field input:disabled { opacity: 0.45; cursor: not-allowed; }

.bundle-help {
  margin-top: 7px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-muted);
}

.bundle-save-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.bundle-artifact .bundle-body { display: flex; flex-direction: column; gap: 10px; }

.bundle-download {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  background: var(--accent);
  color: var(--bg);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: var(--font-sans);
  transition: opacity var(--transition), transform var(--transition);
}
.bundle-download:hover { opacity: 0.9; transform: translateY(-1px); }
.bundle-download:active { transform: translateY(0); }
.bundle-download svg { width: 20px; height: 20px; flex: 0 0 20px; }
.bundle-dl-text { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.bundle-dl-text span { font-size: 12px; font-weight: 700; letter-spacing: 0.8px; }
.bundle-dl-text small {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.5px;
  opacity: 0.65;
  font-family: var(--font-mono);
}

.bundle-rebuild {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 16px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.bundle-rebuild:hover { border-color: var(--border-hover); color: var(--text); background: var(--accent-muted); }
.bundle-rebuild:disabled { opacity: 0.55; cursor: progress; }
.bundle-rebuild svg { width: 14px; height: 14px; }
.bundle-rebuild.busy svg { display: none; }

.bundle-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid var(--border-hover);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: bundle-spin 700ms linear infinite;
}
@keyframes bundle-spin { to { transform: rotate(360deg); } }

.bundle-status {
  margin-top: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  overflow: hidden;
}

.bundle-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 13px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
}
.bundle-stat:last-child { border-bottom: 0; }
.bundle-stat span {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  text-transform: uppercase;
}
.bundle-stat b {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  color: var(--text-secondary);
  text-align: right;
  word-break: break-word;
}
.bundle-stat.wrap b { word-break: break-all; font-size: 10.5px; }
.bundle-stat.ok b { color: #4ade80; }
.bundle-stat.bad b { color: #f87171; }

@media (max-width: 980px) {
  .bundle-grid { grid-template-columns: minmax(0, 1fr); }
}
