:root, [data-theme="dark"] {
  --md-sys-color-background: #0b1120;
  --md-sys-color-surface: #141b2d;
  --md-sys-color-surface-container: #1a2340;
  --md-sys-color-primary: #8ab4f8;
  --md-sys-color-on-primary: #062e6f;
  --md-sys-color-secondary: #a8c7fa;
  --md-sys-color-on-surface: #e3e3e8;
  --md-sys-color-on-surface-variant: #c4c6d0;
  --md-sys-color-outline: #8e9099;
  --md-sys-color-outline-variant: #44464f;
  --md-sys-color-error: #f2b8b5;
  --md-elevation: 0 2px 6px rgba(0,0,0,.3);
  --md-shape: 16px;
}

[data-theme="light"] {
  --md-sys-color-background: #fafafa;
  --md-sys-color-surface: #ffffff;
  --md-sys-color-surface-container: #f0f4f9;
  --md-sys-color-primary: #1a73e8;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-secondary: #5f6368;
  --md-sys-color-on-surface: #1f1f1f;
  --md-sys-color-on-surface-variant: #444746;
  --md-sys-color-outline: #747775;
  --md-sys-color-outline-variant: #c4c7c5;
  --md-sys-color-error: #d93025;
  --md-elevation: 0 1px 3px rgba(0,0,0,.12);
}

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

body {
  background: var(--md-sys-color-background);
  color: var(--md-sys-color-on-surface);
  font-family: 'Google Sans', 'Roboto', sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.container {
  width: 100%;
  max-width: 520px;
  position: relative;
}

header { text-align: center; margin-bottom: 20px; }
header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -.3px;
  color: var(--md-sys-color-on-surface);
  margin-bottom: 2px;
}
.sub { color: var(--md-sys-color-on-surface-variant); font-size: .8rem; }

.card {
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-shape);
  padding: 24px;
  box-shadow: var(--md-elevation);
}

.row { display: flex; gap: 12px; margin-bottom: 16px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label {
  font-size: .68rem;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
  padding-left: 4px;
}
.field select, .field input {
  background: transparent;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--md-sys-color-on-surface);
  font-size: .95rem;
  font-family: inherit;
  width: 100%;
  transition: border .2s, box-shadow .2s;
}
.field select:focus, .field input:focus {
  outline: none;
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 3px rgba(138,180,248,.15);
}
.field select option { background: var(--md-sys-color-surface-container); color: var(--md-sys-color-on-surface); }

button {
  font-family: inherit;
  cursor: pointer;
}

.btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 28px;
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  font-size: .95rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: box-shadow .2s;
}
.btn:hover { box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.btn:disabled { opacity: .5; }

.hidden { display: none !important; }

/* Loading */
.loading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
  padding: 16px;
  background: rgba(138,180,248,.06);
  border: 1px solid rgba(138,180,248,.1);
  border-radius: 12px;
}
.loading-title { font-size: .85rem; font-weight: 500; }
.loading-desc { font-size: .75rem; color: var(--md-sys-color-on-surface-variant); margin-top: 2px; }

/* Results */
.divider { height: 1px; background: var(--md-sys-color-outline-variant); margin: 20px 0; }
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  animation: fadeIn .3s ease-out;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.box {
  background: var(--md-sys-color-surface);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 10px;
  padding: 10px 12px;
}
.box.full { grid-column: 1 / -1; }
.lbl {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: .62rem;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 3px;
}
.lbl .material-symbols-outlined { font-size: .85rem; }
.val { font-size: .85rem; font-weight: 500; color: var(--md-sys-color-on-surface); word-break: break-word; }
.val.muted { color: var(--md-sys-color-on-surface-variant); font-size: .75rem; }

.pill {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 500;
}
.pill.ok { background: rgba(52,168,83,.12); color: #34a853; }
.pill.warn { background: rgba(234,67,53,.12); color: #ea4335; }

footer { text-align: center; margin-top: 16px; }
footer a { font-size: .7rem; color: var(--md-sys-color-on-surface-variant); text-decoration: none; }

.theme-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--md-sys-color-surface-container);
  box-shadow: var(--md-elevation);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--md-sys-color-on-surface-variant);
}
.theme-btn .material-symbols-outlined { font-size: 1.2rem; }

@keyframes spin { to { transform: rotate(360deg); } }
