:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #14141f;
  --bg-tertiary: #1e1e2e;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  --accent: #00d4ff;
  --accent-secondary: #00ff88;
  --danger: #ff4466;
  --warn: #ffb020;
  --focus-ring: #00d4ff;
  --focus-glow: rgba(0, 212, 255, 0.4);
  --radius-md: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: 600px; height: 600px; overflow: hidden;
  background: #000;
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
#app { width: 100%; height: 100%; position: relative; }
.screen { width: 100%; height: 100%; position: absolute; top: 0; left: 0; display: flex; flex-direction: column; }
.screen.hidden { display: none; }
.focusable { transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease; border: 2px solid transparent; cursor: pointer; outline: none; }
.focusable:focus { border-color: var(--focus-ring); box-shadow: 0 0 20px var(--focus-glow); }
.hidden { display: none !important; }

/* Top bar */
.topbar {
  flex: 0 0 auto;
  padding: 18px 22px 14px;
  background: var(--bg-primary);
  border-bottom: 1px solid #26263a;
}
.topbar-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.2px;
  line-height: 1.1;
}
.topbar-sub {
  margin-top: 4px;
  font-size: 15px;
  color: var(--text-secondary);
}

/* Scrolling list area */
.list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: none;
}
.list::-webkit-scrollbar { display: none; }

/* Generic row (regions, tools, country lists) */
.row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 76px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  text-align: left;
  color: var(--text-primary);
  font: inherit;
}
.row:focus { background: var(--bg-tertiary); }
.row-emoji {
  font-size: 30px;
  flex: 0 0 auto;
  width: 40px;
  text-align: center;
}
.row-main { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; gap: 2px; }
.row-title { font-size: 21px; font-weight: 600; }
.row-sub { font-size: 14px; color: var(--text-secondary); }
.row-chevron { font-size: 26px; color: var(--text-muted); flex: 0 0 auto; }

/* Plug letter badges inside country rows */
.plug-badges { display: flex; gap: 6px; flex-wrap: wrap; flex: 0 0 auto; }
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 8px;
  background: #2a2a40;
  color: var(--accent);
  font-size: 15px;
  font-weight: 700;
}
.badge.match { background: rgba(0,255,136,0.16); color: var(--accent-secondary); }

/* Detail screen */
.stat-grid { display: flex; gap: 12px; }
.stat-card {
  flex: 1 1 0;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.stat-label { font-size: 13px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 26px; font-weight: 700; margin-top: 4px; }
.stat-value small { font-size: 15px; font-weight: 500; color: var(--text-secondary); }

.section-label {
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin: 4px 2px -2px;
}

/* Plug info card (detail + guide) */
.plug-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.plug-letter {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: #2a2a40;
  color: var(--accent);
  font-size: 24px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.plug-letter.match { background: rgba(0,255,136,0.16); color: var(--accent-secondary); }
.plug-text { flex: 1 1 auto; min-width: 0; }
.plug-name { font-size: 18px; font-weight: 600; }
.plug-desc { font-size: 14px; color: var(--text-secondary); margin-top: 3px; line-height: 1.35; }

/* Compatibility note */
.note {
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 16px;
  line-height: 1.4;
  background: var(--bg-secondary);
  border-left: 4px solid var(--text-muted);
}
.note strong { display: block; font-size: 14px; margin-bottom: 4px; letter-spacing: 0.3px; text-transform: uppercase; }
.note.ok { border-left-color: var(--accent-secondary); }
.note.ok strong { color: var(--accent-secondary); }
.note.warn { border-left-color: var(--warn); }
.note.warn strong { color: var(--warn); }
.note.info { border-left-color: var(--accent); }
.note.info strong { color: var(--accent); }

/* Action buttons */
.btn {
  width: 100%;
  min-height: 60px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font: inherit;
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.btn:focus { background: #2a2a44; }
.btn.primary { background: rgba(0,212,255,0.14); color: var(--accent); }
.btn.fav-on { background: rgba(255,176,32,0.16); color: var(--warn); }

/* Empty state */
.empty {
  margin: auto;
  text-align: center;
  color: var(--text-secondary);
  font-size: 18px;
  padding: 30px;
  line-height: 1.5;
}
.empty .big { font-size: 46px; display: block; margin-bottom: 10px; }

/* Hint bar */
.hintbar {
  flex: 0 0 auto;
  padding: 10px 22px;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg-primary);
  border-top: 1px solid #26263a;
  text-align: center;
}
