:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #eef5ff;
  --text: #172033;
  --muted: #667085;
  --primary: #1167d8;
  --primary-dark: #0b4ea6;
  --border: #d9e2ef;
  --shadow: 0 18px 45px rgba(24, 39, 75, 0.12);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(17, 103, 216, 0.18), transparent 34rem),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 64px;
}

.hero {
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  margin: 0 0 12px;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--primary-dark);
  background: var(--surface-soft);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.35rem, 7vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.07em;
}

.subtitle {
  width: min(720px, 100%);
  margin: 18px auto 28px;
  color: var(--muted);
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  line-height: 1.65;
}

.search-card {
  width: min(860px, 100%);
  margin: 0 auto;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  text-align: left;
}

label {
  display: block;
  margin: 0 0 10px 4px;
  color: #344054;
  font-weight: 800;
}

.search-row {
  display: flex;
  gap: 12px;
}

input[type="search"] {
  width: 100%;
  min-height: 58px;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0 18px;
  color: var(--text);
  background: #fff;
  font-size: 1.05rem;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input[type="search"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(17, 103, 216, 0.14);
}

button {
  border: 0;
  border-radius: 16px;
  padding: 0 20px;
  color: white;
  background: var(--primary);
  font-weight: 800;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

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

button:active {
  transform: translateY(1px);
}

.status {
  min-height: 22px;
  margin: 12px 4px 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 26px 0;
}

.summary > div {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.78);
}

.summary span {
  display: block;
  color: var(--primary-dark);
  font-size: 1.9rem;
  font-weight: 900;
}

.summary small {
  color: var(--muted);
  font-weight: 700;
}

.empty-state {
  border: 1px dashed #b8c7dc;
  border-radius: var(--radius);
  padding: 36px 20px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
  text-align: center;
}

.empty-state h2 {
  margin: 0 0 8px;
  color: var(--text);
}

.empty-state p {
  margin: 0;
}

.results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
}

.medicine-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(24, 39, 75, 0.08);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.medicine-card h2 {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.25;
}

.dci {
  margin: 5px 0 0;
  color: var(--primary-dark);
  font-weight: 800;
}

.badge {
  flex: 0 0 auto;
  min-width: 34px;
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--primary-dark);
  background: var(--surface-soft);
  text-align: center;
  font-size: 0.82rem;
  font-weight: 900;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.details-grid div {
  padding: 10px;
  border-radius: 14px;
  background: #f8fafc;
}

.details-grid div:nth-child(1),
.details-grid div:nth-child(2),
.details-grid div:nth-child(7),
.details-grid div:nth-child(8) {
  grid-column: 1 / -1;
}

dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
  line-height: 1.35;
}

.hidden {
  display: none !important;
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 22px, 1120px);
    padding-top: 26px;
  }

  .search-row,
  .summary {
    grid-template-columns: 1fr;
  }

  .search-row {
    display: grid;
  }

  button {
    min-height: 50px;
  }

  .results {
    grid-template-columns: 1fr;
  }
}