:root {
  --bg: #0f172a;
  --card: #111827;
  --card2: #1f2937;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --line: #374151;
  --primary: #38bdf8;
  --ok: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, Segoe UI, sans-serif; background: var(--bg); color: var(--text); }
input, select, button { font: inherit; }
input, select { width: 100%; padding: 12px 13px; border-radius: 14px; border: 1px solid var(--line); background: #0b1220; color: var(--text); }
textarea { width: 100%; padding: 12px 13px; border-radius: 14px; border: 1px solid var(--line); background: #0b1220; color: var(--text); font: inherit; resize: vertical; }
label { display:block; margin: 12px 0 6px; color: var(--muted); font-size: 14px; }
h1,h2 { margin: 0; }
h1 { font-size: 20px; }
h2 { font-size: 18px; }
.small { font-size: 12px; }
.muted { color: var(--muted); }
.link { color: var(--primary); text-decoration: none; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.btn { border: 0; border-radius: 14px; padding: 12px 14px; cursor: pointer; color: white; background: var(--card2); }
.btn.primary { background: var(--primary); color: #00111a; font-weight: 700; }
.btn.secondary { background: #334155; }
.btn.ok { background: var(--ok); color: #03120a; font-weight: 700; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn.danger { background: var(--danger); }
.btn.full { width: 100%; margin-top: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-between { display:flex; justify-content:space-between; align-items:center; gap: 12px; }
.message { min-height: 24px; margin-top: 10px; color: var(--muted); }
.mobile-body { padding-bottom: 80px; }
.app-shell { max-width: 720px; margin: 0 auto; padding: 14px; }
.mobile-header { display:flex; justify-content:space-between; align-items:center; margin: 8px 0 14px; }
.form-card { margin-bottom: 12px; }
.scan-row { display:grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; }
.toolbar { display:grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.items { display: grid; gap: 10px; }
.mobile-object-list { display:grid; gap: 10px; margin-top: 14px; }
.mobile-object-row { width:100%; text-align:left; border:1px solid var(--line); background:#0b1220; color:var(--text); border-radius:18px; padding:14px; display:grid; gap:4px; }
.mobile-object-row strong { font-size:17px; }
.mobile-object-row span, .mobile-object-row small { color:var(--muted); }
.object-toolbar { margin: 0 0 12px; }
.object-toolbar .btn { width:100%; }
.item { border: 1px solid var(--line); border-left-width: 8px; background: #0b1220; border-radius: 18px; padding: 12px; }
.item.added, .item.creating { border-left-color: #64748b; }
.item.ok, .item.ready, .item.created { border-left-color: var(--ok); }
.item.no_packets, .item.exists { border-left-color: var(--warn); }
.item.api_error, .item.not_found, .item.duplicate, .item.missing { border-left-color: var(--danger); }
.item-title { display:flex; justify-content:space-between; gap: 8px; font-weight: 700; }
.badge { border-radius: 999px; padding: 3px 9px; font-size: 12px; background: #334155; }
.badge.ok { background: var(--ok); color: #03120a; }
.badge.error { background: var(--danger); }
.badge.no_packets, .badge.warn { background: var(--warn); color: #1c1200; }
.item-meta { color: var(--muted); font-size: 13px; margin-top: 6px; line-height: 1.45; }
.bottom-nav { position: fixed; left:0; right:0; bottom:0; display:grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: rgba(15,23,42,.94); backdrop-filter: blur(10px); border-top:1px solid var(--line); padding: 8px max(8px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); }
.nav-btn { background: transparent; color: var(--muted); border:0; padding:12px; border-radius: 14px; }
.nav-btn.active { background: var(--card2); color: var(--text); }
.screen { display:none; }
.screen.active { display:block; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.75); display:grid; place-items:center; padding: 16px; z-index: 10; }
.modal.hidden { display:none; }
.modal-card { background: var(--card); border:1px solid var(--line); border-radius: 22px; padding: 14px; width:min(720px, 100%); }
.modal-top { display:flex; justify-content:space-between; align-items:center; margin-bottom: 10px; }
#scannerVideo { width: 100%; border-radius: 16px; background: black; max-height: 60vh; }
.file-input { margin-top: 10px; }
.login-body { min-height:100vh; display:grid; place-items:center; padding:20px; }
.login-card { width:min(420px,100%); background:var(--card); border:1px solid var(--line); border-radius:24px; padding:22px; }
.desktop-shell { max-width: 1200px; margin: 0 auto; padding: 20px; }
.desktop-header { margin-bottom: 16px; border: 1px solid var(--line); border-radius: 18px; background: rgba(17,24,39,.92); overflow: hidden; }
.desktop-topbar { display:flex; justify-content:space-between; align-items:center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid rgba(55,65,81,.75); }
.desktop-brand { color: var(--text); text-decoration:none; font-weight:800; font-size: 18px; }
.desktop-main-nav { display:flex; gap: 4px; overflow-x:auto; padding: 8px; }
.desktop-main-nav a { color: var(--muted); text-decoration:none; padding: 10px 13px; border-radius: 12px; white-space:nowrap; }
.desktop-main-nav a:hover, .desktop-main-nav a.active { background:#0b1220; color:var(--text); }
.desktop-main { display:grid; gap: 16px; }
.desktop-section { display:none; }
.desktop-section.active { display:block; }
.dashboard-section { display:none; }
.dashboard-section.active { display:grid; gap: 16px; }
.dashboard-head { display:flex; justify-content:space-between; align-items:flex-start; gap: 12px; }
.dashboard-head p { margin: 6px 0 0; }
.dashboard-grid { display:grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items:start; }
.dashboard-stats { display:grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.dashboard-stat { display:grid; gap: 6px; min-height: 84px; align-content:center; border:1px solid var(--line); background:#111827; border-radius: 8px; padding: 12px; color:var(--text); text-decoration:none; }
.dashboard-stat span { color:var(--muted); font-size:12px; }
.dashboard-stat strong { font-size:24px; }
.dashboard-stat.ok { border-color: rgba(34,197,94,.45); }
.dashboard-stat.warn { border-color: rgba(245,158,11,.55); }
.dashboard-stat.error { border-color: rgba(239,68,68,.55); }
.quick-actions { display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.quick-actions .btn { text-align:center; text-decoration:none; }
.section-tabs { display:flex; gap: 6px; margin-bottom: 12px; overflow-x:auto; }
.section-tabs a { color: var(--muted); text-decoration:none; border:1px solid var(--line); background:#111827; border-radius: 12px; padding: 9px 12px; white-space:nowrap; }
.section-tabs a.active, .section-tabs a:hover { color:var(--text); background:#0b1220; border-color:rgba(56,189,248,.45); }
.logs-grid { display:grid; gap: 18px; margin-top: 12px; }
.log-switcher { display:flex; gap:6px; flex-wrap:wrap; margin: 14px 0 6px; padding: 5px; border:1px solid var(--line); background:#0b1220; border-radius:14px; width:max-content; max-width:100%; }
.log-switch { border:0; background:transparent; color:var(--muted); border-radius:10px; padding:9px 13px; cursor:pointer; }
.log-switch.active { background:#111827; color:var(--text); box-shadow: inset 0 0 0 1px rgba(56,189,248,.45); }
.log-panel { display:none; }
.log-panel.active { display:block; }
.tester-key-status { display:flex; gap:8px; flex-wrap:wrap; align-items:center; justify-content:flex-end; }
.key-state { display:inline-flex; align-items:center; gap:7px; min-height:38px; border:1px solid var(--line); background:#0b1220; color:var(--muted); border-radius:999px; padding:7px 11px; font-size:13px; }
.key-state.ok { border-color:rgba(34,197,94,.45); color:#bbf7d0; }
.key-state.missing { border-color:rgba(245,158,11,.45); color:#fde68a; }
.key-check { display:inline-grid; place-items:center; width:18px; height:18px; border-radius:999px; background:var(--ok); color:#03120a; font-weight:900; line-height:1; }
.tester-run-form { display:grid; grid-template-columns:minmax(0, 1fr) auto; gap:10px; align-items:center; margin-top:18px; }
.tester-key-form { margin-top:10px; }
.tester-log-head { margin-top:18px; padding-top:14px; border-top:1px solid rgba(55,65,81,.7); }
.desktop-grid { margin-top: 16px; align-items:start; }
.import-form { display:flex; gap:10px; align-items:center; }
.pre { white-space: pre-wrap; background:#0b1220; padding:12px; border-radius:14px; color:#cbd5e1; max-height:240px; overflow:auto; }
.table-list { display:grid; gap: 8px; margin-top: 12px; }
.table-row { display:grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 8px; border-bottom:1px solid var(--line); padding:8px 0; font-size: 13px; }
.table-row.compact { grid-template-columns: 1fr auto; align-items:center; }
@media (max-width: 980px) { .dashboard-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } .dashboard-grid { grid-template-columns: 1fr; } }
@media (max-width: 680px) { .grid2, .toolbar { grid-template-columns: 1fr; } .desktop-topbar, .dashboard-head { flex-direction:column; align-items:flex-start; gap:8px; } .desktop-links { flex-wrap:wrap; } .import-form, .tester-run-form { grid-template-columns:1fr; flex-direction:column; align-items:stretch; } .tester-key-status { justify-content:flex-start; } .dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .quick-actions { grid-template-columns:1fr; } }

.logout-link { background:none; border:0; padding:0; cursor:pointer; color:var(--primary); font:inherit; }
#scannerStatus { margin-top: 10px; line-height: 1.4; }
.desktop-links { display:flex; gap:8px; align-items:center; }

.scanner-reader { width: 100%; min-height: 280px; background: #050505; border-radius: 16px; overflow: hidden; }
.scanner-reader video { width: 100% !important; border-radius: 16px; }
.scanner-reader__dashboard_section_csr button,
.scanner-reader button { font: inherit; }

/* Scanner laboratory */
.scanner-lab-card { max-height: 92vh; overflow: auto; }
.lab-grid { display:grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.lab-grid .btn { min-height: 48px; text-align: left; }
.scanner-video { width: 100%; max-height: 58vh; border-radius: 16px; background: #000; }
.hidden { display: none !important; }
.photo-preview-wrap { background:#050505; border:1px solid var(--line); border-radius:16px; overflow:hidden; margin: 10px 0; }
.photo-preview-wrap img { display:block; width:100%; max-height: 52vh; object-fit: contain; }
.lab-log { max-height: 220px; margin-top: 10px; font-size: 12px; }
.error-text { color: #fecaca; }
@media (max-width: 680px) { .lab-grid { grid-template-columns: 1fr; } .scanner-lab-card { width: 100%; } }


/* Mobile scanner modal fit fixes */
.scanner-modal {
  place-items: stretch;
  align-items: stretch;
  justify-items: stretch;
  padding: max(6px, env(safe-area-inset-top)) max(6px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
}
.scanner-lab-card {
  width: min(760px, 100%);
  height: calc(100dvh - 12px);
  max-height: calc(100dvh - 12px);
  margin: 0 auto;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 10px;
}
@supports not (height: 100dvh) {
  .scanner-lab-card {
    height: calc(100vh - 12px);
    max-height: calc(100vh - 12px);
  }
}
.scanner-modal-top {
  position: sticky;
  top: -10px;
  z-index: 5;
  background: var(--card);
  padding: 4px 0 8px;
  border-bottom: 1px solid rgba(55, 65, 81, .75);
}
.scanner-modal-top strong { font-size: 15px; }
.scanner-modal-top .btn { padding: 8px 10px; border-radius: 12px; }
.scanner-lab-card .lab-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}
.scanner-lab-card .lab-grid .btn {
  min-height: 38px;
  padding: 8px 9px;
  font-size: 12px;
  line-height: 1.15;
  text-align: center;
}
.scanner-reader,
#scannerReader {
  width: 100%;
  min-height: 0;
  height: min(38dvh, 330px);
  max-height: min(38dvh, 330px);
  background: #050505;
  border-radius: 14px;
  overflow: hidden;
  margin: 6px 0;
}
@supports not (height: 100dvh) {
  .scanner-reader,
  #scannerReader {
    height: min(38vh, 330px);
    max-height: min(38vh, 330px);
  }
}
#scannerReader video,
#scannerReader canvas,
#scannerReader img,
.scanner-reader video,
.scanner-reader canvas,
.scanner-reader img {
  max-width: 100% !important;
  max-height: 100% !important;
}
#scannerReader video,
.scanner-reader video,
.scanner-video {
  width: 100% !important;
  height: min(38dvh, 330px) !important;
  max-height: min(38dvh, 330px) !important;
  object-fit: cover;
  border-radius: 14px;
  background: #000;
}
@supports not (height: 100dvh) {
  #scannerReader video,
  .scanner-reader video,
  .scanner-video {
    height: min(38vh, 330px) !important;
    max-height: min(38vh, 330px) !important;
  }
}
#scannerReader__dashboard_section,
#scannerReader__dashboard,
#scannerReader__dashboard_section_csr,
#scannerReader__dashboard_section_swaplink {
  display: none !important;
}
.photo-preview-wrap { margin: 6px 0; }
.photo-preview-wrap img {
  max-height: min(34dvh, 300px);
}
.lab-log {
  max-height: min(18dvh, 140px);
  margin-top: 6px;
  font-size: 11px;
  padding: 8px;
}
#scannerStatus { margin-top: 6px; font-size: 11px; }
.scanner-lab-card > p.muted.small { margin: 6px 0 0; font-size: 11px; }

@media (max-width: 420px) {
  .scanner-modal { padding: 4px; }
  .scanner-lab-card {
    border-radius: 14px;
    height: calc(100dvh - 8px);
    max-height: calc(100dvh - 8px);
    padding: 8px;
  }
  @supports not (height: 100dvh) {
    .scanner-lab-card {
      height: calc(100vh - 8px);
      max-height: calc(100vh - 8px);
    }
  }
  .scanner-lab-card .lab-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scanner-lab-card .lab-grid .btn { font-size: 11px; padding: 7px 6px; min-height: 36px; }
  .scanner-modal-top strong { font-size: 14px; }
}

@media (max-height: 720px) {
  .scanner-lab-card .lab-grid .btn { min-height: 32px; padding-top: 6px; padding-bottom: 6px; }
  #scannerReader, .scanner-reader, #scannerReader video, .scanner-reader video, .scanner-video {
    height: min(32dvh, 250px) !important;
    max-height: min(32dvh, 250px) !important;
  }
  .lab-log { max-height: 90px; }
}

/* OpenAI candidate chooser */
.ai-candidate-panel {
  margin: 8px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #0b1220;
}
.ai-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.ai-warning {
  border: 1px solid rgba(245,158,11,.55);
  background: rgba(245,158,11,.12);
  color: #fde68a;
  border-radius: 12px;
  padding: 8px;
  font-size: 12px;
  margin-bottom: 8px;
}
.ai-candidates { display: grid; gap: 7px; }
.candidate-row {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: #111827;
  color: var(--text);
  border-radius: 14px;
  padding: 9px;
  cursor: pointer;
}
.candidate-row.not-in-db {
  opacity: .68;
  cursor: not-allowed;
}
.candidate-row.selected {
  outline: 2px solid var(--primary);
  border-color: var(--primary);
}
.candidate-main {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}
.candidate-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .4px;
  font-size: 14px;
  word-break: break-all;
}
.candidate-meta {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.confidence-pill {
  border-radius: 999px;
  padding: 2px 7px;
  border: 1px solid var(--line);
}
.confidence-pill.high { background: rgba(34,197,94,.18); color: #86efac; border-color: rgba(34,197,94,.45); }
.confidence-pill.medium { background: rgba(245,158,11,.18); color: #fde68a; border-color: rgba(245,158,11,.45); }
.confidence-pill.low { background: rgba(239,68,68,.18); color: #fecaca; border-color: rgba(239,68,68,.45); }
.confidence-pill.unknown { background: rgba(148,163,184,.12); color: #cbd5e1; }
.candidate-warning {
  margin-top: 6px;
  color: #fed7aa;
  font-size: 12px;
}
.candidate-reason {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}
.ai-help { margin-top: 8px; }
@media (max-width: 420px) {
  .candidate-code { font-size: 13px; }
  .ai-panel-head { align-items: flex-start; flex-direction: column; }
}

/* OpenAI-only OCR production-style flow */
.camera-btn { font-size: 22px; padding: 10px 12px; }
.meter-hint {
  margin-top: 8px;
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(34,197,94,.12);
  border: 1px solid rgba(34,197,94,.45);
  color: #dcfce7;
  line-height: 1.35;
  font-size: 13px;
}
.meter-hint.low { background: rgba(245,158,11,.14); border-color: rgba(245,158,11,.55); color: #fef3c7; }
.meter-hint.medium { background: rgba(56,189,248,.12); border-color: rgba(56,189,248,.45); color: #e0f2fe; }
.meter-hint span { color: var(--muted); }
.ocr-card {
  width: min(720px, 100%);
  height: auto;
  max-height: calc(100dvh - 12px);
  overflow: auto;
  padding: 10px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.ocr-status {
  margin: 8px 0;
  background: #0b1220;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  color: var(--muted);
  line-height: 1.35;
  font-size: 13px;
}
.ocr-status.ok { border-color: rgba(34,197,94,.5); color: #dcfce7; }
.ocr-status.warn { border-color: rgba(245,158,11,.55); color: #fef3c7; }
.ocr-status.error { border-color: rgba(239,68,68,.55); color: #fecaca; }
.modal-actions { display:grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.ocr-card .photo-preview-wrap { margin: 8px 0; }
.ocr-card .photo-preview-wrap img { max-height: 34vh; }
.ocr-card .ai-candidate-panel { margin-top: 8px; }
@media (max-width: 680px) {
  .ocr-card { max-height: calc(100dvh - 8px); padding: 8px; border-radius: 18px; }
  .ocr-card .photo-preview-wrap img { max-height: 30vh; }
  .modal-actions { grid-template-columns: 1fr; }
  .ai-panel-head { align-items:flex-start; flex-direction:column; gap: 3px; }
}

/* Desktop admin panel improvements */
.grid3 { display:grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid5 { display:grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.installer-form { margin-top: 10px; display:grid; gap: 10px; }
.form-section-title { margin: 2px 0 0; font-size: 14px; color: var(--text); }
.installer-list { display:grid; gap: 12px; margin-top: 14px; }
.installer-card { border:1px solid var(--line); border-radius:18px; background:#0b1220; padding: 13px; }
.installer-card h3 { margin:0 0 4px; font-size: 16px; }
.object-list { display:grid; gap: 12px; margin-top: 14px; }
.object-card { border:1px solid var(--line); border-radius:18px; background:#0b1220; padding: 13px; }
.object-card h3 { margin:0 0 4px; font-size: 16px; }
.apt-preview { display:flex; flex-wrap:wrap; gap: 6px; margin-top: 10px; }
.apt-pill { border:1px solid var(--line); background:#111827; color:#cbd5e1; border-radius:999px; padding: 3px 8px; font-size:12px; }
.generate-row { display:grid; grid-template-columns: 90px 90px auto; gap: 10px; align-items:end; }
.stat-row { display:flex; flex-wrap:wrap; gap: 7px; margin: 10px 0; }
.stat-chip { border:1px solid var(--line); background:#111827; color:#cbd5e1; border-radius:999px; padding: 4px 9px; font-size:12px; }
.stat-chip.ok { background: rgba(34,197,94,.16); border-color: rgba(34,197,94,.45); color:#bbf7d0; }
.stat-chip.added, .stat-chip.visible { background: rgba(56,189,248,.13); border-color: rgba(56,189,248,.35); color:#bae6fd; }
.stat-chip.hidden { background: rgba(148,163,184,.12); color:#cbd5e1; }
.stat-chip.warn { background: rgba(245,158,11,.16); border-color: rgba(245,158,11,.45); color:#fde68a; }
.stat-chip.error { background: rgba(239,68,68,.16); border-color: rgba(239,68,68,.45); color:#fecaca; }
.activation-row.ok { border-left: 5px solid var(--ok); padding-left: 8px; }
.activation-row.added, .activation-row.creating { border-left: 5px solid #64748b; padding-left: 8px; }
.activation-row.api_error, .activation-row.not_found, .activation-row.duplicate { border-left: 5px solid var(--danger); padding-left: 8px; }
.ocr-status.loading { border-color: rgba(56,189,248,.55); color:#bae6fd; position:relative; padding-left:36px; }
.ocr-status.loading::before { content:""; position:absolute; left:12px; top:50%; width:14px; height:14px; margin-top:-7px; border-radius:999px; border:2px solid rgba(186,230,253,.4); border-top-color:#38bdf8; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 900px) { .grid3, .grid5 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 680px) { .grid3, .grid5, .generate-row { grid-template-columns: 1fr; } .installer-card .row-between, .object-card .row-between { flex-direction:column; align-items:flex-start; } }

/* Element API debug popup */
.debug-btn { margin-top: 6px; padding: 6px 9px; font-size: 12px; border-radius: 10px; }
.debug-modal-card { width: min(980px, 100%); max-height: 92vh; overflow: auto; }
.debug-pre { max-height: 70vh; font-size: 12px; line-height: 1.35; }
.report-modal-card { width:min(1100px, calc(100vw - 18px)); max-height:calc(100dvh - 18px); overflow:auto; }
.object-report-list { display:grid; gap:10px; margin-top:10px; }
.report-apartment { border:1px solid var(--line); background:#0b1220; border-radius:14px; padding:10px; }
.report-apartment.empty { background:#0f172a; }
.report-apartment.inactive { opacity:.72; }
.report-apt-head { display:flex; justify-content:space-between; align-items:flex-start; gap:10px; border-bottom:1px solid rgba(148,163,184,.18); padding-bottom:8px; margin-bottom:8px; }
.report-apt-head strong { font-size:15px; }
.report-meters { display:grid; gap:7px; }
.report-meter { border-left:3px solid rgba(148,163,184,.7); padding:7px 8px; background:rgba(15,23,42,.72); border-radius:8px; font-size:13px; }
.report-meter.ok { border-left-color:rgba(34,197,94,.85); }
.report-meter.duplicate, .report-meter.api_error, .report-meter.not_found { border-left-color:rgba(239,68,68,.85); }
.report-meter .dev-line { margin-left:7px; }
@media (max-width:680px){ .report-apt-head { flex-direction:column; } .report-meter .dev-line { display:block; margin-left:0; margin-top:2px; } }
.tool-panel { border:1px solid var(--line); border-radius:14px; padding:12px; background:#0b1220; margin:12px 0; display:grid; gap:10px; }
.bulk-tool-row.ready { border-left:3px solid rgba(34,197,94,.75); padding-left:8px; }
.bulk-tool-row.created { border-left:3px solid rgba(34,197,94,.95); padding-left:8px; background:rgba(34,197,94,.06); }
.bulk-tool-row.exists { border-left:3px solid rgba(245,158,11,.75); padding-left:8px; }
.bulk-tool-row.missing, .bulk-tool-row.invalid, .bulk-tool-row.api_error { border-left:3px solid rgba(239,68,68,.75); padding-left:8px; }
.bulk-mode-panel { display:grid; gap:10px; }

/* Field-test polish 2026-05-27 */
.row-actions { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.settings-modal-card { width:min(960px, calc(100vw - 18px)); max-height:calc(100dvh - 18px); overflow:auto; }
.modal-form { display:grid; gap:12px; }
.row-mini { margin-top:6px; display:flex; gap:6px; flex-wrap:wrap; }
.row-mini .btn { padding:5px 8px; border-radius:10px; font-size:12px; }
.toolbar { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width:480px) { .toolbar { grid-template-columns:1fr; } }
.apt-chip { font-size:18px; font-weight:900; color:#fff; }
.item.ok .apt-chip, .item.ready .apt-chip, .item.created .apt-chip { color:#bbf7d0; }
.item.added .apt-chip { color:#e5e7eb; }
.item.no_packets .apt-chip, .item.exists .apt-chip { color:#fde68a; }
.item.api_error .apt-chip, .item.duplicate .apt-chip, .item.not_found .apt-chip, .item.missing .apt-chip { color:#fecaca; }
.dev-line { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; word-break:break-all; }
.meter-line { margin-top:2px; }
.inline-debug-btn { margin-top:7px; border:1px solid rgba(239,68,68,.45); background:rgba(239,68,68,.12); color:#fecaca; padding:6px 9px; border-radius:999px; font-size:12px; font-weight:700; }
.inline-debug-btn:hover { background:rgba(239,68,68,.2); }
.badge.duplicate, .badge.not_found, .badge.api_error, .badge.missing { background:rgba(239,68,68,.18); color:#fecaca; }
.badge.no_packets, .badge.exists { background:rgba(245,158,11,.18); color:#fde68a; }
.badge.added { background:rgba(148,163,184,.14); color:#e5e7eb; }
.badge.ok { background:rgba(34,197,94,.18); color:#bbf7d0; }
.activation-row.duplicate, .activation-row.api_error, .activation-row.not_found, .activation-row.missing { border-left:3px solid rgba(239,68,68,.7); }
.activation-row.no_packets, .tool-log-row.no_packets { border-left:3px solid rgba(245,158,11,.75); padding-left:8px; }
.tool-log-row.not_found, .tool-log-row.api_error, .tool-log-row.missing { border-left:3px solid rgba(239,68,68,.75); padding-left:8px; }
.activation-row.added { border-left:3px solid rgba(148,163,184,.7); }
.activation-row.ok { border-left:3px solid rgba(34,197,94,.7); }
@media (max-width:760px){ .settings-modal-card .grid3, .settings-modal-card .grid5 { grid-template-columns:1fr; } }
