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

/* ── License Gate ── */
.license-gate {
  width: 480px;
  background: #1a1a2e;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 24px 20px;
  gap: 20px;
}

.license-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  color: #e8e8f0;
}

.license-logo strong { color: #4ecdc4; }

.license-body {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.license-title {
  font-size: 15px;
  font-weight: 700;
  color: #e8e8f0;
  text-align: center;
}

.license-sub {
  font-size: 12px;
  color: #8899aa;
  text-align: center;
  line-height: 1.5;
}

.license-sub strong { color: #4ecdc4; }

.license-input {
  width: 100%;
  padding: 10px 14px;
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 8px;
  color: #e8e8f0;
  font-size: 13px;
  font-family: 'Courier New', monospace;
  outline: none;
  transition: border-color 0.15s;
}

.license-input:focus { border-color: #4ecdc4; }
.license-input.error { border-color: #ff4757; }

.license-error {
  padding: 7px 12px;
  background: #2d0a0a;
  border: 1px solid #ff4757;
  border-radius: 6px;
  color: #ff6b81;
  font-size: 12px;
  text-align: center;
}

.btn-activate {
  width: 100%;
  padding: 11px;
  background: linear-gradient(135deg, #4ecdc4, #44a39a);
  border: none;
  border-radius: 8px;
  color: #1a1a2e;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-activate:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-activate:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.license-footer {
  font-size: 11px;
  color: #555;
  text-align: center;
}

.license-footer a { color: #4ecdc4; text-decoration: none; }
.license-footer a:hover { text-decoration: underline; }

/* Deactivate button in footer */
.btn-deactivate {
  background: transparent;
  border: none;
  color: #444;
  cursor: pointer;
  font-size: 11px;
  padding: 0 4px;
  margin-left: 6px;
  vertical-align: middle;
  transition: color 0.15s;
}
.btn-deactivate:hover { color: #ff4757; }

.btn-clear-history {
  background: transparent;
  border: none;
  color: #888;
  cursor: pointer;
  font-size: 11px;
  padding: 0 4px;
  margin-left: 4px;
  vertical-align: middle;
  transition: color 0.15s;
}
.btn-clear-history:hover { color: #ff8c00; }

body {
  width: 480px;
  min-height: 200px;
  background: #1a1a2e;
  color: #e8e8f0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px;
}

.app {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #16213e;
  border-bottom: 1px solid #0f3460;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: #e8e8f0;
}

.logo-olx {
  height: 26px;
  width: auto;
  display: block;
}

.logo strong {
  color: #4ecdc4;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transition: background 0.3s;
}

.status-dot.idle { background: #555; }
.status-dot.running { background: #4ecdc4; animation: pulse 1s infinite; }
.status-dot.done { background: #2ed573; }
.status-dot.error { background: #ff4757; }

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

/* Page Info */
.page-info {
  padding: 8px 16px;
  background: #0f3460;
  font-size: 11px;
  color: #8899aa;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-label {
  color: #4ecdc4;
  font-weight: 500;
}

/* Warning */
.warning {
  margin: 10px 12px 0;
  padding: 8px 12px;
  background: #3d2400;
  border: 1px solid #ff6b00;
  border-radius: 6px;
  color: #ff9f43;
  font-size: 11px;
}

/* Controls */
.controls {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.control-label {
  display: block;
  font-size: 11px;
  color: #8899aa;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.count-selector {
  display: flex;
  gap: 6px;
}

.count-btn {
  flex: 1;
  padding: 7px 0;
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 6px;
  color: #8899aa;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}

.count-btn:hover {
  border-color: #4ecdc4;
  color: #4ecdc4;
}

.count-btn.active {
  background: #4ecdc4;
  border-color: #4ecdc4;
  color: #1a1a2e;
  font-weight: 700;
}

.count-btn-all {
  background: #1e1a3e;
  border-color: #a29bfe;
  color: #a29bfe;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.count-btn-all:hover {
  border-color: #a29bfe !important;
  color: #1a1a2e !important;
  background: #a29bfe !important;
}

.count-btn-all.active {
  background: #a29bfe;
  border-color: #a29bfe;
  color: #1a1a2e;
  font-weight: 700;
}

/* Speed selector */
.speed-selector {
  display: flex;
  gap: 6px;
}

.speed-btn {
  flex: 1;
  padding: 7px 4px 6px;
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 6px;
  color: #8899aa;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transition: all 0.15s;
}

.speed-btn:hover { border-color: #4ecdc4; color: #4ecdc4; }

.speed-btn.active.safe   { background: #1a3a1a; border-color: #2ed573; color: #2ed573; }
.speed-btn.active.normal { background: #16213e; border-color: #4ecdc4; color: #4ecdc4; }
.speed-btn.active.fast   { background: #3a1a1a; border-color: #ff6b6b; color: #ff6b6b; }

.speed-icon { font-size: 14px; line-height: 1; }
.speed-name { font-size: 10px; font-weight: 700; letter-spacing: 0.3px; }

.speed-info {
  margin-top: 7px;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.6;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4px 0;
}

.speed-info.safe   { background: #0d1f0d; border: 1px solid #1a4a1a; }
.speed-info.normal { background: #0d1a2e; border: 1px solid #0f3460; }
.speed-info.fast   { background: #2a0d0d; border: 1px solid #5a1a1a; }

.si-label { color: #8899aa; font-size: 10px; text-transform: uppercase; letter-spacing: 0.4px; }
.si-val   { color: #e8e8f0; font-weight: 600; }
.si-risk-low  { color: #2ed573; font-weight: 700; }
.si-risk-mid  { color: #ffa502; font-weight: 700; }
.si-risk-high { color: #ff4757; font-weight: 700; }

.btn-start {
  width: 100%;
  padding: 10px;
  background: linear-gradient(135deg, #4ecdc4, #44a39a);
  border: none;
  border-radius: 8px;
  color: #1a1a2e;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s;
}

.btn-start:hover {
  background: linear-gradient(135deg, #5eddd4, #54b3aa);
  transform: translateY(-1px);
}

.btn-start:active {
  transform: translateY(0);
}

.btn-start.stopping {
  background: linear-gradient(135deg, #ff4757, #c0392b);
  color: #fff;
}

.btn-start:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Progress */
.progress-block {
  padding: 10px 16px;
  background: #16213e;
  border-top: 1px solid #0f3460;
  border-bottom: 1px solid #0f3460;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.progress-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.timer {
  font-size: 12px;
  color: #a29bfe;
  font-family: 'Courier New', monospace;
  font-weight: 600;
}

#progressText {
  font-size: 12px;
  color: #ccc;
}

.progress-count {
  font-size: 12px;
  color: #4ecdc4;
  font-weight: 600;
}

.progress-bar-wrap {
  height: 6px;
  background: #0f3460;
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #4ecdc4, #2ed573);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.status-msg {
  margin-top: 5px;
  font-size: 11px;
  color: #8899aa;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Export bar — always visible */
.export-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: #16213e;
  border-top: 1px solid #0f3460;
  border-bottom: 1px solid #0f3460;
}

.results-count {
  font-size: 12px;
  font-weight: 600;
  color: #4ecdc4;
}

.export-btns {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* Results */
.results-block {
  display: flex;
  flex-direction: column;
}

.btn-export {
  padding: 4px 10px;
  border: 1px solid;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-excel {
  background: #1e3a1e;
  border-color: #2ed573;
  color: #2ed573;
}

.btn-excel:hover:not(:disabled) {
  background: #2ed573;
  color: #1a1a2e;
}

.btn-txt {
  background: #1e2a3a;
  border-color: #74b9ff;
  color: #74b9ff;
}

.btn-txt:hover:not(:disabled) {
  background: #74b9ff;
  color: #1a1a2e;
}

.btn-copy {
  background: #1e2d1e;
  border-color: #a29bfe;
  color: #a29bfe;
}

.btn-copy:hover:not(:disabled) {
  background: #a29bfe;
  color: #1a1a2e;
}

.btn-copy.copied {
  background: #2ed573;
  border-color: #2ed573;
  color: #1a1a2e;
}

.btn-export:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-clear {
  background: transparent;
  border: 1px solid #444;
  border-radius: 5px;
  color: #666;
  cursor: pointer;
  font-size: 12px;
  padding: 4px 8px;
  transition: all 0.15s;
}

.btn-clear:hover:not(:disabled) {
  border-color: #ff4757;
  color: #ff4757;
}

.btn-clear:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Table */
.table-wrap {
  max-height: 260px;
  overflow-y: auto;
  overflow-x: hidden;
}

.table-wrap::-webkit-scrollbar {
  width: 5px;
}

.table-wrap::-webkit-scrollbar-track {
  background: #16213e;
}

.table-wrap::-webkit-scrollbar-thumb {
  background: #0f3460;
  border-radius: 3px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  position: sticky;
  top: 0;
  background: #1a1a2e;
  z-index: 1;
}

th {
  padding: 6px 10px;
  text-align: left;
  font-size: 11px;
  color: #8899aa;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #0f3460;
  font-weight: 600;
}

th:first-child { width: 32px; }
th:last-child { width: 70px; }

td {
  padding: 6px 10px;
  border-bottom: 1px solid #0f3460;
  font-size: 12px;
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: #16213e;
}

td:first-child {
  color: #555;
  font-size: 11px;
}

.td-phone {
  font-family: 'Courier New', monospace;
  color: #4ecdc4;
  font-weight: 600;
}

.td-name {
  color: #e8e8f0;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
}

.badge-business {
  background: #2d1b69;
  color: #a29bfe;
  border: 1px solid #6c5ce7;
}

.badge-private {
  background: #1a2d1a;
  color: #55efc4;
  border: 1px solid #00b894;
}

/* Tabs */
.tab-bar {
  display: flex;
  background: #16213e;
  border-bottom: 1px solid #0f3460;
}

.tab-btn {
  flex: 1;
  padding: 7px 10px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #8899aa;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s;
}

.tab-btn:hover { color: #e8e8f0; }

.tab-btn.active {
  color: #4ecdc4;
  border-bottom-color: #4ecdc4;
}

.btn-copy-log {
  margin-left: auto;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid #0f3460;
  border-radius: 5px;
  color: #8899aa;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-copy-log:hover { border-color: #4ecdc4; color: #4ecdc4; }
.btn-copy-log.copied { border-color: #2ed573; color: #2ed573; }

.tab-content { display: block; }
.tab-content.hidden { display: none !important; }

/* Log panel */
.log-panel {
  height: 260px;
  overflow-y: auto;
  padding: 6px 10px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  line-height: 1.55;
  background: #0d1117;
}

.log-panel::-webkit-scrollbar { width: 5px; }
.log-panel::-webkit-scrollbar-track { background: #0d1117; }
.log-panel::-webkit-scrollbar-thumb { background: #1a3060; border-radius: 3px; }

.log-entry { display: flex; gap: 6px; }
.log-time { color: #444; flex-shrink: 0; }
.log-entry.info  .log-msg { color: #8899aa; }
.log-entry.ok    .log-msg { color: #2ed573; }
.log-entry.warn  .log-msg { color: #ffa502; }
.log-entry.error .log-msg { color: #ff4757; }

.empty-state {
  padding: 30px;
  text-align: center;
  color: #444;
  font-size: 12px;
}

/* Footer */
.footer {
  padding: 8px 16px;
  background: #16213e;
  border-top: 1px solid #0f3460;
  font-size: 10px;
  color: #555;
  text-align: center;
}

.trial-badge {
  display: inline-block;
  background: #1e2d1e;
  border: 1px solid #2ed573;
  border-radius: 10px;
  color: #2ed573;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 7px;
  margin-right: 4px;
  vertical-align: middle;
}

.hidden {
  display: none !important;
}
