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

:root {
  --primary-color: #d8a124;
  --primary-dark: #7a4a00;
  --danger-color: #dc3545;
  --success-color: #28a745;
  --warning-color: #ffc107;
  --bg-color: #0b0b0c;
  --bg-darker: #151518;
  --text-color: #f2e6c9;
  --text-light: #c9b489;
  --border-color: #2a2216;
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 6px 16px rgba(0, 0, 0, 0.45);
  --radius: 8px;
  --transition: all 0.3s ease;
  --font-body: 'Sora';
  --font-title: 'Fraunces';
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #0b0b0c;
    --bg-darker: #151518;
    --text-color: #f2e6c9;
    --text-light: #c9b489;
    --border-color: #2a2216;
  }
}

body {
  width: 380px;
  min-width: 320px;
  max-width: 420px;
  font-family: var(--font-body), -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg-color);
  background-image:
    radial-gradient(600px 200px at 10% -20%, rgba(216, 161, 36, 0.18), transparent 60%),
    radial-gradient(400px 200px at 90% 0%, rgba(122, 74, 0, 0.22), transparent 55%);
  color: var(--text-color);
  overflow-x: hidden;
  overflow-y: auto;
}

.container {
  display: flex;
  flex-direction: column;
  height: auto;
  max-height: none;
  overflow-y: visible;
  min-width: 320px;
  gap: 12px;
  padding: 12px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(42, 32, 15, 0.95) 0%, rgba(122, 74, 0, 0.9) 35%, rgba(216, 161, 36, 0.9) 70%, rgba(11, 11, 12, 0.95) 100%);
  color: white;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
  border: 1px solid rgba(216, 161, 36, 0.25);
  border-radius: 10px;
}

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

.brand-logo {
  width: 68px;
  height: 68px;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.45);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  font-family: var(--font-title), serif;
  letter-spacing: 0.6px;
}

.subtitle {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.4px;
}

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

.icon-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  padding: 6px 10px;
  cursor: pointer;
  color: white;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn i {
  font-size: 16px;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
}

.search-section {
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(15, 15, 18, 0.9) 0%, rgba(11, 11, 12, 0.9) 100%);
}

.search-input-group {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background-color: #0f0f12;
  color: var(--text-color);
  font-size: 14px;
  transition: var(--transition);
}

.search-input::placeholder {
  color: rgba(201, 180, 137, 0.8);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(216, 161, 36, 0.25);
}

.btn {
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-primary {
  background-color: var(--primary-color);
  color: #1b1306;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  color: #f9e8bc;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

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

.btn-outline {
  background-color: transparent;
  color: var(--primary-color);
  border: 1px solid rgba(216, 161, 36, 0.7);
}

.btn-outline:hover {
  background-color: rgba(216, 161, 36, 0.15);
  color: #f9e8bc;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.auto-detect-info {
  font-size: 12px;
  color: var(--text-light);
  padding: 4px 0;
  min-height: 16px;
}

.section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-light);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::after {
  content: '';
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, rgba(216, 161, 36, 0.6), transparent);
}

.services-section,
.quick-search-section,
.stats-section {
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(20, 20, 26, 0.92) 0%, rgba(11, 11, 12, 0.95) 100%);
  box-shadow: inset 0 0 0 1px rgba(216, 161, 36, 0.08);
}

.services-section summary {
  cursor: pointer;
  list-style: none;
}

.services-section summary::-webkit-details-marker {
  display: none;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: none;
  overflow-y: visible;
}

.service-card {
  padding: 10px 12px;
  background-color: #121216;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  position: relative;
  overflow: hidden;
}

.service-card:hover {
  border-color: var(--primary-color);
  background-color: rgba(216, 161, 36, 0.12);
  transform: translateY(-2px);
}

.service-card.active {
  background-color: rgba(216, 161, 36, 0.18);
  border-color: var(--primary-color);
}

.service-name {
  flex: 1;
  font-weight: 600;
}

.service-status {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  background-color: var(--border-color);
  color: var(--text-light);
}

.service-status.has-key {
  background-color: rgba(40, 167, 69, 0.2);
  color: #28a745;
}

.loading {
  text-align: center;
  padding: 20px;
  color: var(--text-light);
  font-size: 12px;
}

.quick-search-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.quick-search-btn {
  padding: 8px 12px;
  background-color: #121216;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: var(--transition);
  width: 100%;
  color: var(--text-color);
  box-shadow: inset 0 0 0 1px rgba(216, 161, 36, 0.05);
}

.quick-search-btn i {
  margin-right: 6px;
}

.quick-service-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.quick-service-select {
  flex: 1 1 200px;
  padding: 6px 10px;
  border: 1px solid rgba(216, 161, 36, 0.35);
  border-radius: 8px;
  background: #0f0f12;
  color: #f7e9c9;
  font-size: 11px;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(216, 161, 36, 0.1);
  line-height: 1.2;
  min-height: 32px;
  appearance: none;
  background-image:
    linear-gradient(180deg, rgba(25, 25, 30, 0.95), rgba(11, 11, 12, 0.95)),
    linear-gradient(45deg, transparent 50%, #d8a124 50%),
    linear-gradient(135deg, #d8a124 50%, transparent 50%);
  background-position:
    0 0,
    calc(100% - 14px) calc(50% - 1px),
    calc(100% - 9px) calc(50% - 1px);
  background-size:
    100% 100%,
    5px 5px,
    5px 5px;
  background-repeat: no-repeat;
}

.quick-service-btn {
  white-space: nowrap;
  flex: 0 0 auto;
  padding: 8px 12px;
  font-size: 12px;
}

.quick-service-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(216, 161, 36, 0.25);
}

.quick-service-select option {
  background-color: #0f0f12;
  color: #f2e6c9;
}

.quick-search-btn:hover {
  border-color: var(--primary-color);
  background-color: rgba(216, 161, 36, 0.16);
  transform: translateY(-2px);
}

.quick-search-btn.active {
  background-color: var(--primary-color);
  color: #1b1306;
  border-color: var(--primary-color);
}

.stats-info {
  font-size: 12px;
  color: var(--text-light);
}

.footer {
  padding: 8px 16px;
  text-align: center;
  color: var(--text-light);
  font-size: 11px;
  border-top: 1px solid var(--border-color);
}

.tutorial {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 12px;
}

.tutorial.show {
  display: flex;
}

.tutorial-dim {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.tutorial-dim-seg {
  position: fixed;
  background: rgba(6, 6, 8, 0.65);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.tutorial-highlight {
  position: fixed;
  z-index: 2;
  pointer-events: none;
  border: 2px solid rgba(216, 161, 36, 0.9);
  border-radius: 12px;
  box-shadow:
    0 0 0 1px rgba(216, 161, 36, 0.2),
    0 0 18px rgba(216, 161, 36, 0.35);
}

.tutorial-card {
  width: min(360px, 100%);
  background: #0f0f12;
  border: 1px solid rgba(216, 161, 36, 0.45);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  position: relative;
  z-index: 3;
}

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

.tutorial-step-count {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-light);
}

.tutorial-title {
  font-family: var(--font-title), serif;
  font-size: 16px;
  color: var(--primary-color);
  margin-bottom: 6px;
}

.tutorial-body {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.5;
}

.tutorial-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 12px;
}

/* Use single scroll on the popup body */

@media (max-width: 600px) {
  body {
    width: 100%;
    max-width: 100%;
  }

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

  .search-input-group {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

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

  .quick-service-row {
    flex-direction: column;
  }

  .quick-service-btn {
    width: 100%;
  }

  .quick-service-select {
    flex: 0 0 auto;
    width: 100%;
    min-height: 34px;
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.loading::after {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 8px;
}

/* KAIROS web-aligned visual system */
:root {
  --primary-color: #f0bf45;
  --primary-dark: #9a6b13;
  --bg-color: #030305;
  --bg-darker: #08080c;
  --text-color: #f4ead4;
  --text-light: #9a8a66;
  --border-color: rgba(240, 191, 69, 0.18);
  --radius: 8px;
  --font-body: "Arial Narrow", "Roboto Condensed", "Segoe UI", Arial, sans-serif;
  --font-title: Impact, "Arial Black", "Arial Narrow", sans-serif;
}

body {
  background:
    linear-gradient(90deg, rgba(240, 191, 69, 0.025) 1px, transparent 1px),
    linear-gradient(180deg, rgba(240, 191, 69, 0.025) 1px, transparent 1px),
    radial-gradient(700px 240px at 100% 0%, rgba(240, 191, 69, 0.08), transparent 58%),
    #030305;
  background-size: 42px 42px, 42px 42px, auto, auto;
  letter-spacing: 0;
}

.container {
  gap: 10px;
  padding: 10px;
}

.header,
.search-section,
.services-section,
.quick-search-section,
.stats-section,
.tutorial-card {
  border-radius: var(--radius);
  clip-path: none;
  background: rgba(7, 7, 11, 0.96);
  border: 1px solid var(--border-color);
  box-shadow: none;
}

.header {
  position: relative;
  padding: 10px 12px;
  background:
    linear-gradient(135deg, rgba(240, 191, 69, 0.22), rgba(8, 8, 12, 0.98) 45%),
    #07070b;
  color: var(--text-color);
}

.header::before,
.section-title::before {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--primary-color);
  display: inline-block;
  box-shadow: 0 0 10px rgba(240, 191, 69, 0.45);
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  border-color: var(--border-color);
  object-fit: contain;
  background: #050507;
}

.title {
  font-family: var(--font-title);
  font-size: 22px;
  line-height: 0.9;
  text-transform: uppercase;
  letter-spacing: 2.4px;
  color: var(--text-color);
}

.subtitle {
  font-family: "Consolas", "Courier New", monospace;
  font-size: 7px;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--primary-color);
}

.icon-btn,
.btn,
.quick-search-btn,
.service-card,
.quick-service-select {
  border-radius: var(--radius);
  box-shadow: none;
  font-family: "Consolas", "Courier New", monospace;
  text-transform: uppercase;
  letter-spacing: 0.7px;
}

.icon-btn {
  color: var(--primary-color);
  background: rgba(0, 0, 0, 0.28);
  border-color: var(--border-color);
}

.search-section,
.services-section,
.quick-search-section,
.stats-section {
  padding: 12px;
}

.search-input,
.quick-service-select {
  border-radius: var(--radius);
  background: #050507;
  border-color: var(--border-color);
  color: var(--text-color);
  font-family: "Consolas", "Courier New", monospace;
  font-size: 12px;
}

.btn {
  font-size: 10px;
  min-height: 34px;
}

.btn-primary,
.quick-search-btn.active {
  background: var(--primary-color);
  color: #080806;
  border: 1px solid var(--primary-color);
}

.btn-outline,
.quick-search-btn,
.service-card {
  background: #06060a;
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

.btn:hover,
.quick-search-btn:hover,
.service-card:hover {
  transform: none;
  border-color: rgba(240, 191, 69, 0.55);
  background: rgba(240, 191, 69, 0.12);
  color: var(--text-color);
}

.section-title {
  font-family: "Consolas", "Courier New", monospace;
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--primary-color);
}

.quick-search-buttons {
  gap: 6px;
}

.quick-search-btn {
  font-size: 10px;
  padding: 8px 7px;
}

.footer {
  font-family: "Consolas", "Courier New", monospace;
  font-size: 8px;
  letter-spacing: 1px;
  border-color: var(--border-color);
  color: var(--primary-color);
}

.fa-solid {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
}

.fa-solid::before {
  content: "+";
  color: var(--primary-color);
  font-family: "Consolas", "Courier New", monospace;
  font-weight: 700;
}

.fa-gear::before { content: "*"; }
.fa-globe::before { content: "◎"; }
.fa-sitemap::before { content: "⌘"; }
.fa-link::before { content: "↗"; }
.fa-fingerprint::before { content: "#"; }
.fa-envelope::before { content: "@"; }
.fa-user::before { content: "◉"; }
.fa-puzzle-piece::before { content: "▣"; }
.fa-bolt::before { content: "↯"; }
