:root {
  color-scheme: light;
  --bg: #f2f6fa;
  --surface: #ffffff;
  --surface-2: #eef3f7;
  --text: #17211d;
  --muted: #64706a;
  --line: #d8ded9;
  --accent: #0b5ea8;
  --accent-strong: #08467e;
  --brand-red: #d71920;
  --warn-bg: #fff7ed;
  --warn: #9a3412;
  --ok-bg: #ecfdf5;
  --ok: #047857;
  --shadow: 0 12px 34px rgba(13, 48, 83, 0.1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(rgba(248, 251, 255, 0.34), rgba(248, 251, 255, 0.48)),
    url("../public/assets/hospital-background.png") center top / cover no-repeat fixed,
    #eef6ff;
  background-attachment: fixed;
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

body::before {
  content: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

#app {
  min-height: 100vh;
  padding: 0 22px 22px;
}

.system-bar {
  min-height: 64px;
  margin: 0 -22px 24px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, #173f68, #285f8f);
  color: #fff;
  box-shadow: 0 14px 34px rgba(13, 48, 83, 0.2);
}

.system-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 18px;
  font-weight: 900;
}

.system-brand img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
}

.system-pill {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  padding: 0 22px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 8px 22px rgba(0, 0, 0, 0.16);
  font-size: 18px;
  font-weight: 900;
}

.system-pill:hover {
  background: rgba(255, 255, 255, 0.24);
}

.function-panel {
  position: absolute;
  top: 78px;
  right: 22px;
  z-index: 30;
  width: min(430px, calc(100vw - 44px));
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 14px;
  border-radius: 8px;
  background: rgba(23, 63, 104, 0.96);
  box-shadow: 0 22px 48px rgba(13, 48, 83, 0.28);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.function-card {
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.function-head {
  display: none;
}

.function-head span {
  font-size: 20px;
  font-weight: 900;
}

.function-head small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.welcome-brand {
  max-width: 1500px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
}

.welcome-brand img {
  width: min(880px, 82vw);
  height: 190px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

h2 {
  margin-bottom: 4px;
  font-size: 18px;
}

h3 {
  margin-bottom: 10px;
  font-size: 15px;
}

.top-actions,
.purchase-actions,
.external-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.top-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-content: center;
  align-items: stretch;
  gap: 12px;
  width: 100%;
}

.primary-btn,
.ghost-btn,
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 14px;
  font-weight: 700;
  line-height: 1.15;
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent), #087e8f);
  color: #fff;
}

.top-actions .primary-btn,
.top-actions .ghost-btn {
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  color: #fff;
  background: rgba(11, 78, 130, 0.82);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  font-size: 16px;
}

.top-actions .ghost-btn {
  background: rgba(11, 78, 130, 0.82);
}

.top-actions .primary-btn {
  background: rgba(11, 78, 130, 0.82);
}

.top-actions .primary-btn:hover,
.top-actions .ghost-btn:hover {
  border-color: rgba(255, 255, 255, 0.58);
  background: #0d5f9f;
  color: #fff;
}

.primary-btn:hover {
  background: var(--accent-strong);
}

.ghost-btn,
.icon-btn {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}

.ghost-btn:hover,
.icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.icon-btn {
  min-width: 38px;
  padding: 0;
  font-size: 20px;
}

.full-width {
  width: 100%;
}

.summary-strip {
  max-width: none;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.summary-strip div,
.summary-card {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  padding: 11px 12px;
  box-shadow: none;
  text-align: left;
}

.summary-card {
  color: #fff;
}

.summary-card:hover,
.summary-card.active {
  border-color: rgba(255, 255, 255, 0.55);
}

.summary-strip span,
.summary-card span {
  display: block;
  color: #fff;
  font-size: 22px;
  font-weight: 800;
}

.summary-strip small,
.summary-card small {
  color: rgba(255, 255, 255, 0.86);
}

.purchase-panel {
  max-width: 1500px;
  margin: 0 auto 18px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.panel-heading p,
.results-head p,
.drug-card p,
.detail-title p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

textarea {
  width: 100%;
  margin: 12px 0;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.file-import {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.file-import span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.file-import input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px 12px;
}

.workspace {
  max-width: 1500px;
  margin: 0 auto;
  display: block;
}

.filters,
.results,
.detail {
  min-height: 260px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.filters {
  padding: 16px;
}

.filter-strip {
  max-width: 1500px;
  min-height: auto;
  margin: 0 auto 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
  padding: 16px;
}

.filter-strip label,
.filter-strip .search-box {
  margin-bottom: 0;
}

.filter-strip input[type="search"],
.filter-strip select {
  height: 52px;
  min-height: 52px;
}

.filters label,
.detail-section label,
.search-box {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.filters span,
.detail-section span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.filter-note,
.save-hint,
.basis-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

input[type="search"],
input[type="text"],
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0 12px;
}

.search-box input {
  min-height: 48px;
  font-size: 16px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(15, 118, 110, 0.24);
  border-color: var(--accent);
}

.check-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 16px;
}

.check-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--text);
}

.results {
  padding: 16px;
}

.results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.bulk-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.bulk-actions .ghost-btn {
  min-height: 44px;
  padding: 0 16px;
  white-space: nowrap;
}

.drug-list {
  display: grid;
  gap: 14px;
}

.drug-card {
  display: grid;
  grid-template-columns: clamp(190px, 20vw, 260px) minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.drug-card:hover,
.drug-card.active {
  border-color: var(--accent);
}

.drug-card:hover {
  transform: translateY(-1px);
}

.mini-pack {
  position: relative;
  min-height: 210px;
  border-radius: 7px;
  background: var(--pack-bg);
  color: var(--pack-fg);
  border: 1px solid color-mix(in srgb, var(--pack-fg) 24%, transparent);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 34px 12px 16px;
  text-align: center;
}

.mini-pack span {
  position: absolute;
  top: 10px;
  left: 12px;
  width: calc(100% - 24px);
  font-size: 12px;
  font-weight: 800;
  text-align: left;
}

.mini-pack strong {
  max-height: 96px;
  overflow: hidden;
  font-size: 27px;
  line-height: 1.2;
  word-break: break-word;
}

.mini-pack small {
  max-width: 100%;
  color: color-mix(in srgb, var(--pack-fg) 72%, white);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  word-break: break-word;
}

.mini-pack-mobile-meta {
  display: none;
}

.mini-pack-actions {
  display: none;
}

.card-title-row,
.detail-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.drug-card h3 {
  margin-bottom: 8px;
  padding-right: 8px;
  font-size: 24px;
  line-height: 1.25;
  word-break: break-word;
}

.detail-link-btn {
  min-height: 32px;
  margin-left: 8px;
  border: 1px solid rgba(11, 94, 168, 0.22);
  border-radius: 999px;
  padding: 0 12px;
  background: #eef6ff;
  color: var(--accent);
  vertical-align: middle;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 900;
}

.detail-link-btn:hover {
  border-color: var(--accent);
  background: #fff;
}

.drug-card-main {
  min-width: 0;
}

.select-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 110px;
  height: 56px;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 17px;
  font-weight: 800;
  flex-shrink: 0;
}

.select-pill input {
  margin: 0;
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
}

.card-actions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-shrink: 0;
}

.card-disable-btn {
  height: 56px;
  min-width: 64px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--warn);
  font-size: 13px;
  font-weight: 800;
}

.card-disable-btn:hover,
.danger-btn:hover {
  border-color: var(--warn);
  color: var(--warn);
}

.price-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.price-line strong {
  color: var(--accent-strong);
  font-size: 20px;
}

.price-line span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.distributor-line {
  margin-top: 8px;
  line-height: 1.45;
  word-break: break-word;
}

.card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: var(--surface-2);
  color: #34423b;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
}

.tag.purchase {
  background: #e0f2fe;
  color: #075985;
}

.tag.talk {
  background: #fef3c7;
  color: #92400e;
}

.tag.tcm {
  background: #dcfce7;
  color: #166534;
}

.tag.bio {
  background: #ede9fe;
  color: #6d28d9;
}

.tag.warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.tag.ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.tag.update {
  background: #e0f2fe;
  color: #075985;
}

.tag.essential-medicine {
  background: #ecfdf5;
  color: #047857;
}

.supply-status {
  gap: 6px;
}

.signal-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 16%, transparent);
  flex: 0 0 auto;
}

.supply-ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.supply-warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.supply-danger {
  background: #fef2f2;
  color: #b91c1c;
}

.supply-muted {
  background: #f1f5f9;
  color: #64748b;
}

.supply-text-ok {
  color: var(--ok);
}

.supply-text-warn {
  color: var(--warn);
}

.supply-text-danger {
  color: #b91c1c;
}

.supply-text-muted {
  color: #64748b;
}

.card-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  flex-wrap: wrap;
}

.price-diff {
  color: var(--warn);
  font-weight: 800;
}

.detail {
  display: none;
}

.detail.mobile-open {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  max-height: none;
  overflow: hidden;
  margin: 0;
  padding: 20px;
  border: 0;
  border-radius: 0;
  background: rgba(13, 48, 83, 0.34);
  box-shadow: none;
  backdrop-filter: blur(4px);
}

.detail.mobile-open #drugDetail {
  position: relative;
  isolation: isolate;
  width: min(720px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(13, 48, 83, 0.22);
}

.detail.mobile-open .detail-title {
  position: sticky;
  top: -18px;
  z-index: 30;
  margin: -18px -18px 0;
  padding: 18px 18px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 10px 18px rgba(13, 48, 83, 0.08);
  isolation: isolate;
}

.detail.mobile-open .visual-actions {
  position: static;
  z-index: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  background: color-mix(in srgb, var(--pack-bg) 82%, white);
  border-top: 1px solid color-mix(in srgb, var(--pack-fg) 12%, transparent);
}

.detail.mobile-open .visual-actions a {
  min-height: 38px;
  justify-content: center;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: none;
  font-size: 13px;
}

.detail.mobile-open .detail-title::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--surface);
}

.empty-detail {
  min-height: 420px;
  display: grid;
  place-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
}

.empty-detail strong {
  color: var(--text);
  font-size: 20px;
}

.detail-title h2 {
  margin: 8px 0 4px;
  font-size: 22px;
  line-height: 1.2;
}

.detail-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.detail.mobile-open .basket-toggle,
.detail.mobile-open .danger-btn {
  display: none;
}

.danger-btn {
  color: var(--warn);
}

.detail-close {
  display: inline-flex;
}

.basket-toggle {
  min-width: 50px;
  min-height: 50px;
}

.visual-card {
  position: relative;
  z-index: 0;
  isolation: isolate;
  margin: 16px 0;
  min-height: 210px;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--pack-bg);
}

.visual-card img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
}

.visual-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.visual-actions a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(11, 94, 168, 0.22);
  border-radius: 8px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--accent);
  box-shadow: 0 8px 22px rgba(13, 48, 83, 0.1);
  backdrop-filter: blur(8px);
  text-decoration: none;
  font-size: 13px;
  font-weight: 900;
}

.visual-actions a:hover {
  border-color: var(--accent);
  background: #fff;
}

.generated-pack {
  min-height: 220px;
  color: var(--pack-fg);
  display: grid;
  grid-template-columns: 78px 1fr;
  grid-template-rows: 1fr auto;
  background: var(--pack-bg);
}

.pack-band {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.56);
  font-size: 14px;
  font-weight: 900;
  writing-mode: vertical-rl;
  letter-spacing: 0;
}

.pack-body {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 24px 20px 14px;
  text-align: center;
}

.pack-body span,
.generated-pack em {
  font-style: normal;
  font-size: 13px;
  font-weight: 800;
}

.pack-body strong {
  width: 100%;
  max-width: 320px;
  font-size: 29px;
  line-height: 1.18;
  word-break: break-word;
}

.pack-body small {
  max-width: 100%;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  word-break: break-word;
}

.generated-pack em {
  display: block;
  padding: 0 18px 16px;
  color: color-mix(in srgb, var(--pack-fg) 76%, white);
  text-align: right;
}

.detail-section {
  border-top: 1px solid var(--line);
  padding-top: 15px;
  margin-top: 15px;
}

dl {
  display: grid;
  grid-template-columns: 94px 1fr;
  gap: 8px 12px;
  margin: 0;
}

dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

dd {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}

.detail-section .ghost-btn + label {
  margin-top: 14px;
}

.group-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: -4px 0 14px;
}

.group-actions .ghost-btn {
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
}

.similar-list {
  display: grid;
  gap: 8px;
}

.similar-list button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  text-align: left;
}

.similar-list button:hover {
  border-color: var(--accent);
}

.similar-list strong,
.similar-list span {
  display: block;
}

.similar-list em {
  display: block;
  margin-top: 5px;
  color: var(--warn);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.similar-list span,
.muted {
  color: var(--muted);
  font-size: 12px;
}

.empty-list {
  padding: 30px;
  text-align: center;
  color: var(--muted);
}

.maintenance-panel {
  max-width: 1680px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 20px;
}

.maintenance-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.maintenance-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.maintenance-header,
.maintenance-row {
  display: grid;
  grid-template-columns: minmax(320px, 1.45fr) minmax(260px, 1fr) 170px 250px 96px;
  gap: 18px;
  align-items: center;
}

.disabled-header,
.disabled-row {
  grid-template-columns: minmax(360px, 1.45fr) minmax(280px, 1fr) 210px 140px;
}

.selected-header,
.selected-row {
  grid-template-columns: minmax(360px, 1.45fr) minmax(280px, 1fr) 210px 220px;
}

.selected-row-actions {
  display: grid;
  grid-template-columns: 1fr 0.8fr;
  gap: 8px;
}

.maintenance-header {
  padding: 0 12px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.maintenance-list {
  display: grid;
  gap: 12px;
}

.maintenance-row {
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fff;
}

.maintenance-row strong,
.maintenance-row span,
.maintenance-row small {
  display: block;
}

.maintenance-row strong {
  font-size: 21px;
  line-height: 1.3;
  word-break: break-word;
}

.maintenance-row span,
.maintenance-row small {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
}

.maintenance-price strong {
  color: var(--accent-strong);
  font-size: 22px;
}

.maintenance-row input[type="text"] {
  min-height: 50px;
  font-size: 17px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1180px) {
  #app {
    padding: 0 14px 14px;
  }

  .system-bar {
    margin: 0 -14px 18px;
  }

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

  .maintenance-header,
  .maintenance-row {
    grid-template-columns: minmax(260px, 1.4fr) minmax(220px, 1fr);
  }

  .disabled-header,
  .disabled-row {
    grid-template-columns: minmax(260px, 1.4fr) minmax(220px, 1fr);
  }
}

@media (max-width: 760px) {
  .function-panel {
    position: static;
    width: auto;
    margin: 0 auto 18px;
    grid-template-columns: 1fr;
  }

  .function-card {
    padding: 0;
  }

  .results-head,
  .panel-heading {
    display: grid;
  }

  .system-bar {
    min-height: 56px;
    padding: 0 14px;
  }

  .system-brand {
    font-size: 15px;
  }

  .system-brand img {
    width: 30px;
    height: 30px;
  }

  .system-pill {
    min-height: 40px;
    padding: 0 18px;
  }

  .top-actions,
  .purchase-actions {
    width: 100%;
  }

  .top-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(100%, 390px);
    max-width: 390px;
    margin: 0 auto;
    gap: 12px;
  }

  .top-actions button,
  .purchase-actions button {
    flex: 1;
  }

  .top-actions button {
    width: 100%;
    min-height: 52px;
    padding: 0 10px;
    white-space: nowrap;
    font-size: 17px;
  }

  .summary-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .filter-strip {
    grid-template-columns: 1fr;
  }

  .workspace {
    display: block;
  }

  .filters,
  .results {
    margin-bottom: 14px;
    position: static;
  }

  .detail.mobile-open {
    display: block;
    padding: 12px;
  }

  .detail.mobile-open #drugDetail {
    width: auto;
    max-height: calc(100vh - 24px);
    padding: 14px;
    border-radius: 8px;
  }

  .detail.mobile-open .detail-title {
    top: -14px;
    z-index: 30;
    margin: -14px -14px 0;
    padding: 14px 14px 10px;
  }

  .detail.mobile-open .visual-card {
    z-index: 0;
  }

  .detail.mobile-open .visual-actions {
    position: static;
    z-index: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
    background: color-mix(in srgb, var(--pack-bg) 82%, white);
    border-top: 1px solid color-mix(in srgb, var(--pack-fg) 12%, transparent);
  }

  .detail.mobile-open .visual-actions a {
    min-height: 38px;
    justify-content: center;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: none;
    font-size: 13px;
  }

  .drug-card {
    display: block;
    padding: 12px;
  }

  .mini-pack {
    min-height: 340px;
    display: flex;
    gap: 10px;
    padding: 12px 12px 14px;
  }

  .drug-card-main {
    display: none;
  }

  .card-title-row {
    display: contents;
  }

  .drug-card h3 {
    display: flex;
    justify-content: flex-end;
    margin: 10px 0 0;
    padding-right: 0;
    font-size: 0;
    line-height: 1;
  }

  .detail-link-btn {
    min-height: 30px;
    margin-left: 0;
    margin-top: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
  }

  .drug-card p {
    display: none;
  }

  .price-line {
    display: none;
  }

  .mini-pack span {
    position: static;
    width: 100%;
    font-size: 13px;
  }

  .mini-pack strong {
    max-height: 116px;
    font-size: 26px;
  }

  .mini-pack small {
    font-size: 13px;
    line-height: 1.35;
    white-space: normal;
  }

  .mini-pack-mobile-meta {
    width: 100%;
    display: grid;
    gap: 5px;
    border-top: 1px solid color-mix(in srgb, var(--pack-fg) 18%, transparent);
    padding-top: 9px;
    text-align: left;
  }

  .mini-pack-mobile-meta div {
    min-width: 0;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 8px;
    align-items: baseline;
    font-size: 12px;
    line-height: 1.25;
  }

  .mini-pack-mobile-meta b {
    color: color-mix(in srgb, var(--pack-fg) 70%, #1c2a33);
    font-weight: 900;
  }

  .mini-pack-mobile-meta em {
    min-width: 0;
    overflow: hidden;
    color: color-mix(in srgb, var(--pack-fg) 82%, #10243a);
    font-style: normal;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mini-pack-mobile-meta div:first-child em {
    color: #0b4e82;
    font-size: 18px;
    font-weight: 900;
  }

  .mini-pack-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding-top: 4px;
  }

  .mini-pack-actions .detail-link-btn,
  .mini-pack-actions .select-pill,
  .mini-pack-actions .card-disable-btn {
    width: 100%;
    min-width: 0;
    height: 44px;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-color: color-mix(in srgb, var(--pack-fg) 22%, white);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    font-family: inherit;
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
  }

  .mini-pack-actions .detail-link-btn {
    color: var(--pack-fg);
  }

  .mini-pack-actions .select-pill {
    position: relative;
    justify-content: center;
    gap: 0;
    color: #234155;
    padding: 0;
    text-align: center;
  }

  .mini-pack-actions .select-pill input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
  }

  .mini-pack-actions .select-pill span {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    text-align: center;
  }

  .mini-pack-actions .select-pill.is-selected {
    border-color: #1d8f78;
    background: linear-gradient(135deg, #1f9d8b, #38b7a5);
    color: #fff;
    box-shadow: 0 8px 18px rgba(31, 157, 139, 0.18);
  }

  .mini-pack-actions .card-disable-btn {
    color: var(--warn);
  }

  .distributor-line,
  .card-tags,
  .card-foot {
    display: none;
  }

  .select-pill {
    width: 100%;
    min-width: 0;
    height: 48px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
  }

  .card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    order: 10;
    margin: 12px 0 0;
  }

  .card-disable-btn {
    width: 100%;
    min-width: 0;
    height: 48px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
  }

  .generated-pack {
    grid-template-columns: 58px 1fr;
  }

  .pack-body strong {
    max-width: 100%;
    font-size: 24px;
  }

dl,
  .maintenance-header,
  .maintenance-row,
  .disabled-header,
  .disabled-row,
  .selected-header,
  .selected-row {
    grid-template-columns: 1fr;
  }

  .maintenance-header {
    display: none;
  }

  .maintenance-panel {
    padding: 12px;
  }

  .maintenance-head {
    display: grid;
  }

  .maintenance-row {
    gap: 12px;
    padding: 14px;
  }

  .maintenance-row strong {
    font-size: 19px;
  }

  .group-actions {
    grid-template-columns: 1fr;
  }
}

/* 2026 split workspace redesign */
body {
  background: #edf3f7;
}

body.detail-open {
  overflow: hidden;
}

#app {
  min-height: 100dvh;
  padding: 0 16px 16px;
}

.system-bar {
  min-height: 72px;
  margin: 0 -16px;
  padding: 0 24px;
  background: #073b66;
  box-shadow: 0 4px 14px rgba(16, 45, 70, 0.16);
}

.system-brand {
  gap: 12px;
}

.system-brand img {
  width: 42px;
  height: 42px;
}

.system-brand > span {
  display: grid;
  gap: 2px;
}

.system-brand small,
.system-brand strong {
  display: block;
  letter-spacing: 0;
}

.system-brand small {
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  font-weight: 700;
}

.system-brand strong {
  font-size: 18px;
  font-weight: 800;
}

.system-pill {
  min-height: 38px;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  padding: 0 14px;
  background: transparent;
  box-shadow: none;
  font-size: 14px;
}

.system-pill svg,
.filter-reset svg,
.icon-btn svg,
.pagination svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.welcome-brand {
  display: none;
}

.function-panel {
  top: 80px;
  right: 16px;
}

.filters,
.results,
.detail {
  border-color: #d8e1e8;
  background: #fff;
  box-shadow: 0 3px 12px rgba(31, 65, 93, 0.06);
}

.filter-strip {
  position: sticky;
  top: 0;
  z-index: 20;
  max-width: none;
  min-height: 84px;
  margin: 0 -16px 12px;
  display: grid;
  grid-template-columns: minmax(340px, 1.8fr) auto minmax(150px, 0.65fr) minmax(150px, 0.65fr) minmax(190px, 0.85fr) auto;
  gap: 12px;
  align-items: center;
  border-width: 0 0 1px;
  border-radius: 0;
  padding: 14px 24px;
}

.filter-strip > label:not(.essential-switch) {
  position: relative;
}

.filter-strip > label:not(.essential-switch) > span:not(.sr-only) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.filter-strip input[type="search"],
.filter-strip select,
.filter-reset {
  height: 44px;
  min-height: 44px;
  border: 1px solid #ccd8e0;
  border-radius: 6px;
  background: #fff;
}

.search-box {
  position: relative;
  display: block;
}

.search-box > svg {
  position: absolute;
  top: 13px;
  left: 13px;
  z-index: 1;
  width: 18px;
  height: 18px;
  color: #647785;
  pointer-events: none;
}

.search-box input[type="search"] {
  width: 100%;
  padding: 0 46px 0 40px;
}

.search-box kbd {
  position: absolute;
  top: 9px;
  right: 10px;
  min-width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid #d7e0e6;
  border-radius: 5px;
  background: #f6f8fa;
  color: #657682;
  font-family: inherit;
  font-size: 12px;
}

.essential-switch {
  min-height: 44px;
  display: flex !important;
  align-items: center;
  gap: 8px !important;
  margin: 0 !important;
  color: #263744;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.essential-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #bdc9d1;
  transition: background 0.15s ease;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(20, 48, 69, 0.28);
  transition: transform 0.15s ease;
}

.essential-switch input:checked + .switch-track {
  background: #0768c8;
}

.essential-switch input:checked + .switch-track::after {
  transform: translateX(18px);
}

.essential-switch > svg {
  width: 16px;
  height: 16px;
  color: #6b7b86;
}

.filter-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  color: #334652;
  font-weight: 700;
}

.filter-reset:hover {
  border-color: #0b5ea8;
  color: #0b5ea8;
}

.workspace {
  max-width: none;
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(370px, 0.95fr);
  gap: 12px;
  align-items: stretch;
}

.results,
.detail {
  height: calc(100dvh - 180px);
  min-height: 560px;
  border-radius: 7px;
}

.results {
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.results-head {
  min-height: 62px;
  margin: 0;
  padding: 13px 16px;
  border-bottom: 1px solid #dde5eb;
}

.results-head h2 {
  margin-bottom: 2px;
  font-size: 17px;
}

.results-head p {
  font-size: 12px;
}

.bulk-actions .ghost-btn {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.drug-table-head {
  min-height: 40px;
  display: grid;
  grid-template-columns: minmax(286px, 1.35fr) minmax(132px, 0.75fr) 104px minmax(160px, 0.95fr) 116px;
  gap: 14px;
  align-items: center;
  padding: 0 52px 0 14px;
  border-bottom: 1px solid #e1e8ed;
  color: #52636f;
  font-size: 12px;
  font-weight: 700;
}

.drug-list {
  min-height: 0;
  display: block;
  overflow: auto;
}

.drug-card {
  min-height: 96px;
  display: grid;
  grid-template-columns: 92px minmax(180px, 1.35fr) minmax(132px, 0.75fr) 104px minmax(160px, 0.95fr) 116px 28px;
  gap: 14px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid #e3e9ee;
  border-radius: 0;
  padding: 10px 12px;
  background: #fff;
  transition: background 0.12s ease, box-shadow 0.12s ease;
}

.drug-card:hover {
  transform: none;
  background: #f7fbff;
}

.drug-card.active {
  position: relative;
  border-color: #e3e9ee;
  background: #f2f8ff;
  box-shadow: inset 3px 0 #0872d1;
}

.drug-thumb {
  position: relative;
  width: 88px;
  height: 68px;
  margin: 0;
  overflow: hidden;
  border: 1px solid #dce4e9;
  border-radius: 5px;
  background: #fff;
}

.drug-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  padding: 4px;
}

.drug-thumb.is-fallback img {
  padding: 14px;
  opacity: 0.34;
}

.drug-thumb-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 5px;
  align-items: center;
  padding: 8px 7px 20px;
  background: #f7fafc;
  color: #587083;
}

.drug-thumb-fallback svg {
  width: 22px;
  height: 22px;
  color: #2f7fb7;
}

.drug-thumb-fallback strong {
  overflow: hidden;
  color: #304b5d;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  letter-spacing: 0;
}

.drug-thumb figcaption {
  position: absolute;
  inset: auto 0 0;
  overflow: hidden;
  padding: 3px 4px;
  background: rgba(255, 255, 255, 0.92);
  color: #687984;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 9px;
  font-weight: 700;
}

.drug-thumb figcaption.reference-label {
  background: rgba(255, 248, 225, 0.94);
  color: #8a5a09;
}

.drug-identity,
.drug-spec-cell,
.drug-price-cell,
.drug-tags-cell,
.drug-supply-cell {
  min-width: 0;
}

.drug-identity h3 {
  display: block;
  justify-content: initial;
  margin: 0 0 5px;
  padding: 0;
  overflow: hidden;
  color: #172631;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
  line-height: 1.25;
}

.drug-identity p,
.drug-identity small,
.drug-spec-cell span {
  display: block;
  overflow: hidden;
  color: #6a7a85;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  line-height: 1.5;
}

.drug-identity p {
  margin: 0;
}

.drug-spec-cell {
  display: grid;
  gap: 3px;
}

.drug-spec-cell strong {
  overflow: hidden;
  color: #344652;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.drug-price-cell strong {
  color: #0765b8;
  font-size: 16px;
}

.drug-price-cell {
  display: flex;
  align-items: center;
  gap: 4px;
}

.price-trend {
  width: 17px;
  height: 17px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
}

.price-trend svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.8;
}

.price-trend.up {
  color: #c52d2d;
  background: #fff0f0;
}

.price-trend.down {
  color: #16834c;
  background: #edf9f1;
}

.drug-tags-cell {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.drug-tags-cell .tag,
.drug-supply-cell .tag {
  min-height: 23px;
  padding: 0 8px;
  font-size: 10px;
}

.drug-tags-cell .indication-tag {
  color: #106d63;
  background: #e7f7f2;
  border-color: #bce9dc;
}

.row-select {
  position: relative;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid #c9d5dd;
  border-radius: 5px;
  background: #fff;
  color: transparent;
  cursor: pointer;
}

.row-select input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.row-select.is-selected {
  border-color: #07886c;
  background: #07886c;
  color: #fff;
}

.pagination {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  border-top: 1px solid #dde5eb;
  color: #657580;
  font-size: 12px;
}

.pagination-pages {
  display: flex;
  align-items: center;
  gap: 5px;
}

.pagination button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid #d5dfe6;
  border-radius: 5px;
  background: #fff;
  color: #425561;
  font-weight: 700;
}

.pagination button.active {
  border-color: #0872d1;
  background: #0872d1;
  color: #fff;
}

.pagination button:disabled {
  opacity: 0.42;
  cursor: default;
}

.pagination b {
  padding: 0 3px;
  font-weight: 400;
}

.detail {
  position: sticky;
  top: 96px;
  display: block;
  overflow: auto;
  padding: 20px;
}

.detail-title {
  align-items: flex-start;
}

.detail-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.detail-badges p {
  margin: 0;
}

.selected-badge {
  background: #eaf3ff;
  color: #096ac2;
}

.detail-title h2 {
  margin: 12px 0 4px;
  font-size: 23px;
}

.detail-actions {
  position: relative;
  gap: 6px;
}

.detail-actions .icon-btn {
  width: 38px;
  min-width: 38px;
  min-height: 38px;
  border-radius: 6px;
}

.detail-more-menu {
  position: absolute;
  top: 44px;
  right: 0;
  z-index: 12;
  min-width: 150px;
  padding: 5px;
  border: 1px solid #d7e0e6;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(23, 53, 76, 0.14);
}

.detail-more-menu button {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 4px;
  padding: 0 10px;
  background: transparent;
  color: #9a3412;
  font-size: 13px;
  font-weight: 700;
}

.detail-more-menu button:hover {
  background: #fff7ed;
}

.detail-more-menu svg {
  width: 17px;
  height: 17px;
}

.basket-toggle.is-selected {
  border-color: #07886c;
  background: #eafaf5;
  color: #07886c;
}

.detail-close {
  display: none;
}

.visual-card {
  min-height: 250px;
  margin: 18px 0;
  display: grid;
  place-items: center;
  border: 0;
  background: #fff;
}

.visual-card > img {
  width: 100%;
  height: 260px;
  object-fit: contain;
  padding: 8px;
}

.visual-fallback {
  width: 100%;
  min-height: 230px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  border: 1px dashed #d5e0e7;
  border-radius: 6px;
  background: #f8fafb;
}

.visual-fallback img {
  width: min(280px, 70%);
  height: 100px;
  object-fit: contain;
  opacity: 0.38;
  mix-blend-mode: multiply;
}

.visual-fallback p {
  margin: 0;
  color: #7a8993;
  font-size: 12px;
}

.visual-actions {
  top: auto;
  right: 8px;
  bottom: 8px;
}

.detail-section {
  margin-top: 18px;
  padding-top: 18px;
}

.detail-section h3 {
  font-size: 14px;
}

.save-status {
  min-height: 18px;
  margin: -8px 0 0;
  color: #6b7b86;
  font-size: 11px;
}

.save-status.saved {
  color: #047857;
}

.save-status.local {
  color: #9a6112;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
label:has(input:focus-visible) {
  outline: 3px solid rgba(8, 114, 209, 0.22);
  outline-offset: 2px;
}

@media (max-width: 1280px) {
  .filter-strip {
    grid-template-columns: minmax(280px, 1.5fr) auto minmax(132px, 0.7fr) minmax(132px, 0.7fr) minmax(170px, 0.9fr) auto;
    gap: 9px;
    padding-inline: 16px;
  }

  .drug-table-head {
    display: none;
  }

  .drug-card {
    grid-template-columns: 86px minmax(170px, 1fr) minmax(130px, 0.75fr) 90px minmax(145px, 0.85fr) 108px 28px;
  }
}

@media (max-width: 1024px) {
  #app {
    padding: 0 10px 14px;
  }

  .system-bar {
    min-height: 62px;
    margin: 0 -10px;
    padding: 0 12px;
  }

  .system-brand img {
    width: 36px;
    height: 36px;
  }

  .system-brand small {
    display: none;
  }

  .system-brand strong {
    max-width: 230px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
  }

  .system-pill {
    min-height: 36px;
    padding: 0 10px;
  }

  .function-panel {
    position: absolute;
    top: 70px;
    right: 10px;
    width: min(430px, calc(100vw - 20px));
  }

  .filter-strip {
    position: static;
    min-height: auto;
    margin: 0 -10px 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
  }

  .search-box {
    grid-column: 1 / -1;
  }

  .essential-switch {
    padding: 0 4px;
  }

  .filter-reset {
    grid-column: 2;
  }

  .workspace {
    display: block;
  }

  .results {
    height: auto;
    min-height: 0;
  }

  .drug-list {
    overflow: visible;
  }

  .results-head {
    min-height: 56px;
    padding: 11px 12px;
  }

  .bulk-actions {
    display: none;
  }

  .drug-card {
    min-height: 138px;
    position: relative;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    grid-template-areas:
      "thumb identity select"
      "thumb spec price"
      "thumb tags tags"
      "thumb supply supply";
    gap: 5px 10px;
    align-items: center;
    padding: 10px;
  }

  .drug-thumb {
    grid-area: thumb;
    align-self: start;
    width: 72px;
    height: 72px;
  }

  .drug-identity {
    grid-area: identity;
  }

  .drug-identity h3 {
    margin-bottom: 3px;
    font-size: 15px;
  }

  .drug-identity p,
  .drug-identity small {
    font-size: 10px;
  }

  .drug-spec-cell {
    grid-area: spec;
  }

  .drug-spec-cell strong {
    font-size: 12px;
  }

  .drug-spec-cell span {
    display: none;
  }

  .drug-price-cell {
    grid-area: price;
    text-align: right;
    justify-content: flex-end;
  }

  .drug-price-cell strong {
    font-size: 14px;
  }

  .drug-tags-cell {
    grid-area: tags;
    flex-wrap: nowrap;
    overflow: hidden;
  }

  .drug-tags-cell .tag {
    flex: 0 0 auto;
  }

  .drug-supply-cell {
    grid-area: supply;
  }

  .row-select {
    grid-area: select;
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
  }

  .pagination {
    padding: 9px 10px;
  }

  .pagination > span {
    display: none;
  }

  .pagination-pages {
    width: 100%;
    justify-content: center;
  }

  .detail {
    display: none;
  }

  .detail.mobile-open {
    position: fixed;
    inset: 0;
    z-index: 60;
    width: 100%;
    height: 100dvh;
    min-height: 0;
    display: block;
    overflow: hidden;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #fff;
    backdrop-filter: none;
  }

  .detail.mobile-open #drugDetail {
    width: 100%;
    height: 100dvh;
    max-height: none;
    overflow: auto;
    padding: 16px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .detail.mobile-open .detail-title {
    top: -16px;
    margin: -16px -16px 0;
    padding: 12px 16px;
  }

  .detail-title h2 {
    margin-top: 9px;
    font-size: 20px;
  }

  .detail.mobile-open .detail-actions .basket-toggle,
  .detail.mobile-open .detail-actions .danger-btn {
    display: inline-flex;
  }

  .detail-close {
    display: inline-flex;
  }

  .visual-card,
  .visual-card > img {
    min-height: 210px;
    height: 220px;
  }

  .visual-fallback {
    min-height: 210px;
  }

  .detail.mobile-open .visual-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    background: #f8fafb;
  }
}

@media (max-width: 430px) {
  .system-pill span {
    display: none;
  }

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

  .filter-strip select,
  .filter-reset {
    width: 100%;
    padding-inline: 9px;
    font-size: 12px;
  }

  .essential-switch {
    font-size: 12px;
  }

  .switch-track {
    width: 38px;
    height: 22px;
  }

  .switch-track::after {
    width: 16px;
    height: 16px;
  }

  .essential-switch input:checked + .switch-track::after {
    transform: translateX(16px);
  }

  .drug-card {
    grid-template-columns: 66px minmax(0, 1fr) auto;
    gap: 5px 8px;
  }

  .drug-thumb {
    width: 66px;
    height: 66px;
  }

  .drug-thumb-fallback {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 2px;
    padding: 7px 4px 18px;
  }

  .drug-thumb-fallback svg {
    width: 20px;
    height: 20px;
  }

  .drug-thumb-fallback strong {
    max-width: 100%;
    font-size: 11px;
  }

  .drug-tags-cell .tag:nth-last-child(1):not(.essential-medicine) {
    display: none;
  }

  .detail.mobile-open #drugDetail {
    padding: 14px;
  }
}

/* Generated pharmacy imagery and stronger operational hierarchy */
body {
  background: #e6edf2;
}

.system-bar {
  min-height: 108px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  padding-inline: 28px;
  background-color: #072f53;
  background-image: url("../public/assets/pharmacy-header-desktop.webp");
  background-position: center;
  background-size: cover;
  box-shadow: 0 7px 22px rgba(19, 48, 70, 0.24);
}

.system-brand {
  gap: 14px;
}

.system-brand img {
  width: 48px;
  height: 48px;
  border: 2px solid rgba(255, 255, 255, 0.84);
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(0, 23, 43, 0.32);
}

.system-brand small {
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
}

.system-brand strong {
  color: #fff;
  font-size: 21px;
  text-shadow: 0 2px 8px rgba(0, 19, 37, 0.32);
}

.system-pill {
  border-color: rgba(255, 255, 255, 0.44);
  background: rgba(4, 35, 60, 0.78);
  color: #fff;
  box-shadow: 0 5px 15px rgba(0, 22, 39, 0.24);
}

.function-panel {
  top: 116px;
}

.filter-strip {
  min-height: 76px;
  grid-template-columns: minmax(360px, 2fr) minmax(170px, 0.65fr) minmax(230px, 0.9fr) auto;
  border-color: #cbd8e1;
  padding: 12px 24px;
  background: #f4f8fa;
  box-shadow: 0 3px 12px rgba(26, 58, 80, 0.08);
}

.filter-strip input[type="search"],
.filter-strip select,
.filter-reset {
  border-color: #bdccd7;
  background: #fff;
  box-shadow: 0 1px 2px rgba(31, 60, 82, 0.04);
}

.filter-strip input[type="search"]:focus,
.filter-strip select:focus {
  border-color: #1475b8;
  box-shadow: 0 0 0 3px rgba(20, 117, 184, 0.12);
}

.workspace {
  gap: 14px;
}

.results,
.detail {
  height: calc(100dvh - 210px);
  min-height: 540px;
  border-color: #cbd7df;
  box-shadow: 0 7px 22px rgba(29, 57, 78, 0.1);
}

.results-head,
.detail-title {
  background: #f6fafc;
}

.results-head {
  border-bottom-color: #cfdbe3;
}

.results-head h2,
.detail-title h2 {
  color: #123b59;
}

.drug-table-head {
  border-bottom-color: #cbd8e1;
  background: #e9f0f4;
  color: #304f63;
}

.drug-card:nth-child(even) {
  background: #fbfcfd;
}

.drug-card:hover {
  background: #edf6fb;
}

.drug-card.active,
.drug-card.active:nth-child(even) {
  background: #e5f1f9;
  box-shadow: inset 4px 0 #0872d1;
}

.drug-thumb {
  border-color: #cedbe4;
  box-shadow: 0 2px 7px rgba(29, 61, 83, 0.08);
}

.tag.essential-medicine {
  border: 1px solid #b7e8d7;
  background: #e0f7ee;
  color: #04745e;
}

.pagination {
  border-top-color: #cfdbe3;
  background: #f6fafc;
}

@media (max-width: 1024px) {
  .system-bar {
    min-height: 88px;
    background-image: url("../public/assets/pharmacy-header-mobile.webp");
    background-position: center 28%;
    background-size: cover;
  }

  .system-brand img {
    width: 40px;
    height: 40px;
  }

  .system-brand strong {
    max-width: 245px;
    font-size: 16px;
  }

  .function-panel {
    top: 96px;
  }

  .filter-strip {
    min-height: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 10px;
  }

  .filter-reset {
    grid-column: 1 / -1;
    width: 100%;
  }

  .results {
    height: auto;
    min-height: 0;
  }
}

@media (max-width: 430px) {
  .system-bar {
    min-height: 82px;
    padding-inline: 10px;
    background-position: 58% 31%;
  }

  .system-brand {
    gap: 9px;
  }

  .system-brand strong {
    max-width: 220px;
    font-size: 15px;
  }

  .system-pill {
    background: rgba(4, 35, 60, 0.86);
  }

  .filter-strip {
    background: #edf4f7;
  }
}

/* Full-page pharmacy background and mobile compatibility refinements */
body {
  background-color: #dce6ec;
  background-image: url("../public/assets/pharmacy-page-background.jpg");
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
}

#app {
  background: rgba(226, 235, 241, 0.78);
}

.system-bar {
  min-height: 72px;
  padding-inline: 24px;
  background-color: rgba(6, 51, 86, 0.96);
  background-image: none;
  box-shadow: 0 4px 14px rgba(16, 45, 70, 0.2);
}

.system-brand img {
  width: 42px;
  height: 42px;
}

.system-brand strong {
  font-size: 18px;
}

.function-panel {
  top: 80px;
}

.filter-strip {
  background: rgba(244, 248, 250, 0.94);
}

.results,
.detail {
  height: calc(100dvh - 180px);
  background: rgba(255, 255, 255, 0.98);
}

.drug-thumb picture,
.visual-card picture {
  width: 100%;
  height: 100%;
  display: block;
}

.drug-thumb picture img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  padding: 4px;
}

.visual-card picture {
  min-height: 250px;
}

.visual-card picture img {
  width: 100%;
  height: 260px;
  display: block;
  object-fit: contain;
  padding: 8px;
}

.mobile-essential-badge {
  display: none;
}

@media (max-width: 1024px) {
  body {
    background-position: 42% center;
  }

  #app {
    background: rgba(226, 235, 241, 0.84);
  }

  .system-bar {
    min-height: 62px;
    padding-inline: 12px;
    background-image: none;
  }

  .system-brand img {
    width: 36px;
    height: 36px;
  }

  .system-brand strong {
    font-size: 15px;
  }

  .function-panel {
    top: 70px;
  }

  .results {
    height: auto;
  }

  .drug-identity-title {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .drug-identity-title h3 {
    min-width: 0;
    flex: 1;
  }

  .mobile-essential-badge {
    min-height: 20px;
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    border: 1px solid #9fdcc8;
    border-radius: 999px;
    padding: 0 6px;
    background: #dff7ee;
    color: #04745e;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
  }

  .drug-tags-cell .essential-medicine {
    display: none;
  }

  .visual-card picture,
  .visual-card picture img {
    min-height: 210px;
    height: 220px;
  }
}

@media (max-width: 430px) {
  .system-bar {
    min-height: 62px;
    padding-inline: 10px;
  }

  .filter-strip {
    background: rgba(237, 244, 247, 0.95);
  }
}
