:root {
  color-scheme: light;
  --bg: #f8fafc;
  --card: #ffffff;
  --ink: #111827;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #059395;
  --brand-dark: #046f71;
  --brand-soft: rgba(5, 147, 149, 0.12);
  --red: #b91c1c;
  --red-dark: #7f1d1d;
  --blue: #0f172a;
  --shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(5, 147, 149, 0.16), transparent 35rem),
    var(--bg);
  color: var(--ink);
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(960px, 100%);
  margin: 0 auto;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(2rem, env(safe-area-inset-bottom));
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding: 1.25rem 0 1rem;
}

.brand {
  display: inline-flex;
  width: min(260px, 74vw);
  margin-bottom: 1rem;
}

.brand img {
  display: block;
  width: 100%;
  height: auto;
}

.hero h1,
.panel h2,
.emergency-card h2 {
  margin: 0;
  line-height: 1.05;
}

.hero h1 {
  font-size: clamp(2.1rem, 8vw, 4rem);
  letter-spacing: -0.06em;
}

.hero p,
.section-heading p,
footer p,
.emergency-card p {
  color: var(--muted);
  margin: 0.5rem 0 0;
}

.eyebrow {
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin: 0 0 0.4rem;
  text-transform: uppercase;
}

.eyebrow.light {
  color: rgba(255, 255, 255, 0.82);
}

.language-picker,
.search-form label {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.header-actions {
  display: grid;
  gap: 0.55rem;
  align-items: end;
}

.install-button[hidden] {
  display: none;
}

.install-progress[hidden] {
  display: none;
}

.install-progress {
  display: grid;
  gap: 0.35rem;
  min-width: min(100%, 18rem);
}

.install-progress__bar {
  overflow: hidden;
  height: 0.55rem;
  border-radius: 999px;
  background: #dbe4e6;
}

.install-progress__bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
  transition: width 240ms linear;
}

.install-progress p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.flag-language-picker {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  overflow-x: auto;
  white-space: nowrap;
}

.flag-language-picker button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  font-size: 1.45rem;
  line-height: 1;
  padding: 0;
}

.flag-language-picker button.is-active {
  box-shadow: 0 2px 0 var(--brand);
}

.language-picker select,
.search-form input,
.search-form select {
  width: 100%;
  min-height: 3rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--card);
  color: var(--ink);
  padding: 0.75rem 0.9rem;
}

.language-picker select:focus,
.search-form input:focus,
.search-form select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
  outline: none;
}

main {
  display: grid;
  gap: 1rem;
}

.emergency-card,
.panel {
  border-radius: 1.35rem;
  box-shadow: var(--shadow);
}

.emergency-card {
  display: grid;
  gap: 1.2rem;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: white;
  padding: 1.3rem;
}

.emergency-copy {
  display: grid;
  gap: 0.65rem;
}

.emergency-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 5rem;
  height: 5rem;
}

.emergency-icon-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.emergency-card p {
  color: rgba(255, 255, 255, 0.85);
}

.primary-call {
  display: grid;
  gap: 0.2rem;
  align-content: center;
  min-height: 5rem;
  border-radius: 1.1rem;
  background: white;
  color: var(--red-dark);
  padding: 1rem;
  text-align: center;
  text-decoration: none;
  font-size: 1.35rem;
  font-weight: 900;
}

.primary-call small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(226, 232, 240, 0.9);
  padding: 1.1rem;
}

.section-heading {
  margin-bottom: 1rem;
}

.number-grid,
.guide-list,
.results-list {
  display: grid;
  gap: 0.75rem;
}

.number-card,
.guide-card,
.result-card {
  display: grid;
  gap: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--card);
  padding: 1rem;
  text-decoration: none;
}

.number-card strong,
.result-card strong,
.guide-card strong {
  font-size: 1rem;
}

.number-card span,
.result-card span,
.guide-card span {
  color: var(--muted);
  font-size: 0.9rem;
}

.result-card {
  gap: 0.55rem;
}

.result-card span b {
  color: var(--ink);
}

.number-card b {
  color: var(--red);
  font-size: 1.35rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  border: 0;
  border-radius: 999px;
  background: #e2e8f0;
  color: var(--ink);
  padding: 0.75rem 1rem;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.button.danger {
  background: var(--red);
  color: white;
}

.button.dark {
  background: var(--brand);
  color: white;
}

.button.dark:hover {
  background: var(--brand-dark);
}

.search-form {
  display: grid;
  gap: 0.85rem;
}

.status {
  color: var(--muted);
  margin-top: 0.8rem;
}

.location-result {
  margin-top: 1rem;
}

.location-result dl {
  display: grid;
  gap: 0.7rem;
  margin: 0;
}

.location-result dl > div {
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: #f8fafc;
  padding: 0.85rem;
}

.location-result dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.location-result dd {
  margin: 0.2rem 0 0;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.action-row {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.85rem;
}

.result-actions {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.35rem;
}

.result-card mark {
  width: max-content;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  padding: 0.2rem 0.55rem;
  font-size: 0.76rem;
  font-weight: 900;
}

.info-banner {
  display: grid;
  gap: 1rem;
}

.info-banner[hidden] {
  display: none;
}

.banner-image {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 1rem;
  margin-bottom: 0.85rem;
}

.banner-html {
  color: var(--muted);
}

.banner-html p:first-child {
  margin-top: 0;
}

.banner-html p:last-child {
  margin-bottom: 0;
}

.banner-actions {
  margin-top: 0.85rem;
}

.banner-posts {
  display: grid;
  gap: 0.75rem;
}

.banner-post {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: 0.8rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--card);
  padding: 0.7rem;
  text-decoration: none;
}

.banner-post--no-image {
  grid-template-columns: 1fr;
}

.banner-post img {
  width: 5rem;
  height: 4.2rem;
  border-radius: 0.8rem;
  object-fit: cover;
  background: #e2e8f0;
}

.banner-post span {
  display: grid;
  gap: 0.25rem;
}

.banner-post small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.82rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.banner-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
}

footer {
  padding: 1.5rem 0 0.5rem;
  text-align: center;
}

.exit-app-button {
  margin-top: 1rem;
  background: #050505;
  color: #fff;
}

@media (min-width: 700px) {
  .hero {
    grid-template-columns: 1fr 18rem auto;
    align-items: end;
  }

  .emergency-card {
    grid-template-columns: 1fr 18rem;
    align-items: end;
  }

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

  .search-form {
    grid-template-columns: 12rem 1fr auto;
    align-items: end;
  }

  .action-row {
    grid-template-columns: repeat(3, 1fr);
  }

  .result-actions {
    grid-template-columns: repeat(3, max-content);
  }
}
