:root {
  --bg: #0b1020;
  --card: #121a33;
  --text: #eef2ff;
  --muted: #b7c1ff;
  --border: rgba(255,255,255,0.12);
  --good: #22c55e;
  --warn: #f59e0b;
  --bad: #ef4444;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: radial-gradient(1000px 600px at 30% 10%, #1b2a66 0%, var(--bg) 60%);
  color: var(--text);
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.card {
  width: min(680px, 100%);
  background: rgba(18, 26, 51, 0.92);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.35);
}

h1 { margin: 0 0 6px; font-size: 22px; text-align: center; }
.sub { margin: 0 0 18px; color: var(--muted); line-height: 1.4; }

.label { display: block; margin-bottom: 6px; color: var(--muted); }

.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-bottom: 14px;
}

input {
  width: 100%;
  padding: 12px 12px;
  font-size: 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.22);
  color: var(--text);
  outline: none;
}

input:focus {
  border-color: rgba(183,193,255,0.55);
}

.btn {
  padding: 12px 14px;
  font-size: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.18);
  color: var(--text);
  cursor: pointer;
}

.btn:hover { background: rgba(0,0,0,0.26); }

.btn-generate {
  background: rgba(34,197,94,0.12);
  border-color: rgba(34,197,94,0.35);
  color: #bff7d1;
  font-size: 13px;
  white-space: nowrap;
}

.btn-generate:hover { background: rgba(34,197,94,0.22); }

.btn-copy {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(34,197,94,0.35);
  background: rgba(34,197,94,0.08);
  cursor: pointer;
  font-size: 16px;
  transition: background 200ms ease;
}

.btn-copy:hover { background: rgba(34,197,94,0.16); }

.meter {
  height: 10px;
  background: rgba(255,255,255,0.09);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.bar {
  height: 100%;
  width: 0%;
  background: var(--bad);
  transition: width 120ms ease;
}

.status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 10px;
}

.badge {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: 12px;
}

.checks {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: grid;
  gap: 6px;
}

.checks li {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.16);
  color: var(--muted);
}

.checks li.ok {
  border-color: rgba(34,197,94,0.35);
  color: #bff7d1;
}

.tips {
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  color: var(--muted);
}

.tips summary {
  cursor: pointer;
  font-weight: 600;
  color: rgba(183,193,255,0.9);
  margin-bottom: 10px;
  transition: color 200ms ease;
}

.tips summary:hover {
  color: #b7c1ff;
}

.tips ul {
  margin: 8px 0 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}

.tips li {
  font-size: 13px;
  line-height: 1.5;
  color: rgba(238,242,255,0.82);
}

.tips strong {
  color: #bff7d1;
}

.example-box {
  margin-top: 24px;
  padding: 16px;
  background: rgba(34,197,94,0.08);
  border: 1px solid rgba(34,197,94,0.25);
  border-radius: 12px;
}

.example-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.example-header h3 {
  margin: 0;
  font-size: 14px;
  color: #bff7d1;
}

.example-display {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0,0,0,0.24);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(34,197,94,0.15);
}

.example-display code {
  flex: 1;
  font-family: "Courier New", monospace;
  font-size: 13px;
  color: #bff7d1;
  letter-spacing: 0.5px;
  word-break: break-all;
}

.footer {
  margin-top: 16px;
  color: rgba(238,242,255,0.65);
}

/* Weather Widget */
.weather-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 280px;
  background: rgba(18, 26, 51, 0.96);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  z-index: 1000;
}

.weather-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.weather-header h3 {
  margin: 0;
  font-size: 14px;
  color: var(--text);
}

.btn-geo {
  padding: 4px 6px;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  transition: background 200ms ease;
}

.btn-geo:hover {
  background: rgba(34, 197, 94, 0.25);
}

.weather-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px;
  margin-bottom: 8px;
}

.weather-search input {
  padding: 6px 8px;
  font-size: 11px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  outline: none;
}

.weather-search input:focus {
  border-color: rgba(183, 193, 255, 0.55);
}

.btn-search {
  padding: 6px 8px;
  font-size: 11px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.18);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}

.btn-search:hover {
  background: rgba(0, 0, 0, 0.26);
}

.weather-content {
  min-height: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-size: 12px;
}

.weather-main {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.weather-icon {
  font-size: 28px;
}

.weather-info {
  flex: 1;
}

.weather-location {
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 2px;
}

.weather-temp {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.weather-desc {
  font-size: 10px;
  color: rgba(238, 242, 255, 0.8);
  margin-top: 2px;
}

.weather-wind {
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.16);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
}

.weather-loading {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  padding: 12px 0;
}

.weather-error {
  display: none;
  padding: 6px 8px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 6px;
  font-size: 10px;
  color: #fca5a5;
}

.weather-error.show {
  display: block;
}

/* Mobile responsiveness */
@media (max-width: 640px) {
  .weather-widget {
    position: static;
    width: 100%;
    margin-bottom: 16px;
    background: rgba(18, 26, 51, 0.8);
  }
}

/* Tab Switcher */
.tab-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
  margin-top: 20px;
}

.tab-btn {
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.18);
  color: var(--text);
  cursor: pointer;
  transition: all 200ms ease;
}

.tab-btn:hover {
  background: rgba(0, 0, 0, 0.26);
}

.tab-btn.active {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.5);
  color: #bff7d1;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Checklist styling for Tab B */
.checklist {
  margin: 20px 0;
  padding: 16px;
  background: rgba(0, 0, 0, 0.16);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.checklist h3 {
  margin: 0 0 12px;
  font-size: 14px;
  color: #bff7d1;
  font-weight: 600;
}

.checklist ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.checklist li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.12);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
  transition: all 200ms ease;
}

.checklist li.met {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.08);
  color: #bff7d1;
}

.checklist li input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--good);
}

.checklist-label {
  flex: 1;
  cursor: pointer;
}

.checklist-threshold {
  font-size: 11px;
  color: rgba(238, 242, 255, 0.6);
  white-space: nowrap;
}

/* Leak Status */
.leak-status {
  margin: 14px 0;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.16);
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.leak-message {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

.leak-message.loading {
  color: var(--text);
  font-weight: 500;
}

.leak-message.found {
  color: #fca5a5;
  font-weight: 500;
}

.leak-message.not-found {
  color: #bff7d1;
  font-weight: 500;
}

.leak-message.error {
  color: #fca5a5;
  font-weight: 500;
}

.btn-check {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.35);
  color: #bff7d1;
}

.btn-check:hover:not(:disabled) {
  background: rgba(34, 197, 94, 0.22);
}

.btn-check:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.privacy-note {
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.privacy-note summary {
  cursor: pointer;
  font-weight: 600;
  color: rgba(183, 193, 255, 0.9);
  margin-bottom: 10px;
  transition: color 200ms ease;
}

.privacy-note summary:hover {
  color: #b7c1ff;
}

.privacy-note p {
  margin: 8px 0 0;
  line-height: 1.5;
  color: rgba(238, 242, 255, 0.82);
}
