:root {
  color-scheme: light dark;
  --bg: #f5f5f7;
  --panel: #ffffff;
  --border: #d2d2d7;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --btn: #f5f5f7;
  --btn-hover: #e8e8ed;
  --accent: #007AFF;
  --header-bg: #f0f0f5;
  --header-text: #1d1d1f;
  --hover-bg: #f0f0f5;
  --hover-border: #c7c7cc;
  --active-bg: rgba(0, 122, 255, 0.1);
  --in-cart-bg: rgba(0, 122, 255, 0.08);
  --danger: #FF3B30;
  --success: #34C759;
  --separator: #e5e5ea;
  --overlay-bg: rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.08);
  --accent-hover: #0066e6;
  --header-hover: #e5e5ea;
  --subfolder-bg: #fafafc;
  --subfolder-text: #444;
  --subfolder-hover: #f0f0f5;
  --subfolder-arrow: #888;
  --nested-bg: #fff;
  --nested-text: #555;
  --med-hover: #f7f7fc;
  --calc-dose: #1a7a2e;
  --calc-note: #666;
  --brand-color: #1a56db;
  --brand-match: #1a7a2e;
  --brand-name-color: #248a3d;
  --accent-ring: rgba(0, 122, 255, 0.15);
  --accent-ring-strong: rgba(0, 122, 255, 0.25);
  --accent-tint: rgba(0, 122, 255, 0.08);
  --highlight-bg: rgba(0, 122, 255, 0.15);
  --danger-tint: rgba(255, 59, 48, 0.08);
  --danger-tint-border: rgba(255, 59, 48, 0.15);
  --danger-tint-hover: rgba(255, 59, 48, 0.14);
  --danger-tint-border-hover: rgba(255, 59, 48, 0.25);
  --stuck-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  --ghost-bg: rgba(255, 255, 255, 0.9);
  --ghost-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  --ghost-modal-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1c1e;
    --panel: #2c2c2e;
    --border: #38383a;
    --text: #f5f5f7;
    --muted: #98989d;
    --btn: #3a3a3c;
    --btn-hover: #48484a;
    --accent: #0A84FF;
    --header-bg: #252528;
    --header-text: #f5f5f7;
    --hover-bg: #323235;
    --hover-border: #48484a;
    --active-bg: rgba(10, 132, 255, 0.15);
    --in-cart-bg: rgba(10, 132, 255, 0.12);
    --danger: #FF453A;
    --success: #30D158;
    --separator: #38383a;
    --overlay-bg: rgba(0, 0, 0, 0.6);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3);
    --accent-hover: #409CFF;
    --header-hover: #3a3a3c;
    --subfolder-bg: #323235;
    --subfolder-text: #b0b0b5;
    --subfolder-hover: #3a3a3c;
    --subfolder-arrow: #98989d;
    --nested-bg: #3a3a3c;
    --nested-text: #a0a0a5;
    --med-hover: #323235;
    --calc-dose: #30D158;
    --calc-note: #98989d;
    --brand-color: #5E9EFF;
    --brand-match: #30D158;
    --brand-name-color: #32D74B;
    --accent-ring: rgba(10, 132, 255, 0.2);
    --accent-ring-strong: rgba(10, 132, 255, 0.3);
    --accent-tint: rgba(10, 132, 255, 0.12);
    --highlight-bg: rgba(10, 132, 255, 0.2);
    --danger-tint: rgba(255, 69, 58, 0.12);
    --danger-tint-border: rgba(255, 69, 58, 0.2);
    --danger-tint-hover: rgba(255, 69, 58, 0.2);
    --danger-tint-border-hover: rgba(255, 69, 58, 0.3);
    --stuck-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    --ghost-bg: rgba(44, 44, 46, 0.9);
    --ghost-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    --ghost-modal-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; }

html {
  min-width: 0;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  min-width: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

.app-shell {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr);
  height: 100vh;
  overflow: hidden;
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--bg);
  overflow: hidden;
  position: relative;
}

/* Bottom fade effect - mirrors the top fade from search-section::after */
.main::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(to top, var(--bg) 0%, var(--bg) 18px, transparent 40px);
  pointer-events: none;
  z-index: 5;
}

/* --- Topbar --- */
.topbar {
  display: flex;
  align-items: center;
  padding: 10px clamp(16px, 5vw, 75px);
  gap: 12px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  height: 56px;
}

/* Brand, Provider & Location - Left side */
.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

/* Reset & Weight - Right side */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand {
  font-weight: 600;
  font-size: 15px;
  color: var(--brand-color);
  white-space: nowrap;
  letter-spacing: -0.02em;
}

/* Menu (Burger + Brand) Button */
.menu-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 4px 10px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.menu-btn:hover {
  background: var(--hover-bg);
}
.menu-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--muted);
  position: relative;
  top: 0.5px;
}

/* Provider Button */
.provider-wrapper {
  position: relative;
  width: 150px;
  min-width: 130px;
  flex-shrink: 0;
}

/* Provider shrinks only after location collapses to icon */
.provider-wrapper.can-shrink {
  flex-shrink: 1;
}

.provider-btn {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 12px;
  height: 36px;
  width: 100%;

  display: flex;
  align-items: center;
  justify-content: flex-start;

  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.provider-btn:hover {
  background: var(--hover-bg);
  border-color: var(--hover-border);
}

.provider-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  text-align: left;
}

.provider-edit-icon {
  flex-shrink: 0;
  color: var(--muted);
  margin-left: 8px;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
}

.provider-edit-icon svg {
  width: 13px;
  height: 13px;
}

/* Provider Edit Backdrop */
.provider-edit-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--overlay-bg);
  z-index: 199;
}
/* Keep provider wrapper above backdrop when editing */
.provider-wrapper.edit-active {
  position: relative;
  z-index: 201;
}

/* Provider Edit Dropdown */
.provider-edit-dropdown {
  position: absolute;
  top: -13px; /* Align input with button (accounting for 12px top padding + 1px border) */
  left: -57px; /* Offset so input field aligns with button left edge (35px label + 10px gap + 12px padding) */
  background: var(--panel);
  border: none;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 12px;
  z-index: 200;
  overflow: hidden;
}
/* Border animation container */
.provider-edit-dropdown::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  pointer-events: none;
  transform-origin: left center;
}

/* Animation states */
.provider-edit-dropdown.animating::before {
  animation: provider-border-stretch 400ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.provider-edit-dropdown.animating .provider-edit-content {
  animation: provider-content-fade 400ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Border stretch animation - expands from button position rightward */
@keyframes provider-border-stretch {
  0% {
    clip-path: inset(0 57px 0 57px);
  }
  100% {
    clip-path: inset(0 0 0 0);
  }
}

/* Content fade animation */
@keyframes provider-content-fade {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* Content wrapper inherits flex layout */
.provider-edit-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Provider Edit Row - horizontal layout */
.provider-edit-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.provider-edit-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  width: auto;
  flex-shrink: 0;
}

.provider-edit-input {
  width: 175px;
  padding: 8px 12px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  height: 36px;
  background: var(--bg);
  transition: all 0.2s ease;
}

.provider-edit-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
  background: var(--panel);
}

/* Provider Edit Actions */
.provider-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

/* Location Dropdown */
.location-wrapper {
  position: relative;
  width: 215px;
  min-width: 100px;
  flex-shrink: 1;
}

.location-btn {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 12px;
  height: 36px;
  width: 100%;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;

  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.location-btn:hover {
  background: var(--hover-bg);
  border-color: var(--hover-border);
}

.loc-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  text-align: left;
}

.location-btn .arrow {
  flex-shrink: 0;
  font-size: 0;
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.25s ease;
}

/* Location pin icon (hidden by default, shown when collapsed) */
.loc-icon {
  display: none;
  flex-shrink: 0;
  color: var(--text);
}

.loc-icon svg {
  width: 16px;
  height: 16px;
}

.location-list-content {
  max-height: 400px;
  overflow-y: auto;
  padding: 6px;
}
.loc-item {
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  border-bottom: none;
  border-radius: 12px;
  margin-bottom: 1px;
  transition: background 0.15s ease;
}
.loc-item:hover { background: var(--active-bg); }
.loc-item.selected { font-weight: 600; color: var(--accent); background: var(--accent-tint); }

.loc-name {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 10px;
  flex: 1;
}

.loc-delete-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 17px;
  font-weight: bold;
  cursor: pointer;
  padding: 0 6px;
  line-height: 1;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.15s ease;
}
.loc-delete-btn:hover { color: var(--danger); }

.location-menu-footer {
  padding: 8px;
  border-top: 1px solid var(--separator);
  background: var(--bg);
}
.btn-sm {
  width: 100%;
  font-size: 12px;
  padding: 7px;
}

/* Location Search Input */
.location-search-input {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 400;
  color: var(--text);
  outline: none;
  padding: 0;
}
.location-search-input::placeholder {
  color: var(--muted);
  font-weight: 400;
}

/* Highlighted location item via keyboard navigation */
.loc-search-item.is-active {
  background: var(--accent-tint);
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 12px;
}

/* Enter hint for highlighted location items */
.loc-enter-hint {
  display: none;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-left: 8px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23007AFF' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6v6a2 2 0 0 1-2 2H6'/%3E%3Cpath d='M10 10l-4 4 4 4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px 16px;
}

/* Show enter hint when location item is active/highlighted */
.loc-search-item.is-active .loc-enter-hint {
  display: block;
}

/* Location Search Backdrop */
.location-search-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--overlay-bg);
  z-index: 199;
}
/* Keep location wrapper above backdrop when in search mode */
.location-wrapper.search-active {
  position: relative;
  z-index: 201;
}

/* Override icon-only button constraints when search is active */
.location-wrapper.search-active .location-btn {
  width: 100%;
  min-width: 0;
  padding: 0 12px;
  justify-content: space-between;
}

/* Blue border on location search input when typing (not navigating) */
.location-wrapper.search-active.typing-mode .location-btn {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring-strong);
}

/* Location Search Dropdown */
.location-search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: auto;
  margin-top: 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 480px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
/* Search Results Container - fixed height for 10 rows, scrollable */
.location-search-results {
  height: 340px;
  overflow-y: auto;
  padding: 6px;
}

/* Individual search result item */
.loc-search-item {
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  border-bottom: none;
  min-height: 34px;
  border-radius: 12px;
  margin-bottom: 1px;
  transition: background 0.15s ease;
}
.loc-search-item:hover { background: var(--active-bg); }
.loc-search-item.selected { font-weight: 600; color: var(--accent); background: var(--accent-tint); }

.loc-search-name {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 10px;
  flex: 1;
}

.loc-search-no-results {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-style: italic;
}

/* Sticky footer for Add New Location button */
.location-search-footer {
  padding: 8px;
  border-top: 1px solid var(--separator);
  background: var(--bg);
  flex-shrink: 0;
}

/* Weight Section */
.weight-section {
  display: flex;
  align-items: center;
  gap: 1px;
  background: var(--panel);
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  height: 36px;
  transition: border-color 0.2s ease;
}
.weight-section label {
  font-weight: 500;
  color: var(--text);
  font-size: 12px;
}
.weight-section span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.weight-section input {
  width: 45px;
  padding: 0;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  text-align: center;
  background: transparent;
  outline: none;
  color: var(--text);
}
.weight-section input:focus {
  background: var(--active-bg);
}

/* --- Search Section (below header) --- */
/* Side padding matches folder column edges: content-scroll 15px + dashboard margin clamp(15px, 4vw, 60px) */
.search-section {
  display: flex;
  justify-content: center;
  padding: 16px clamp(30px, calc(15px + 4vw), 75px) 4px;
  background: var(--bg);
  flex-shrink: 0;
  position: relative;
  z-index: 6;
}

/* Top fade effect - extends below search section into scroll area */
.search-section::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 35px;
  background: linear-gradient(to bottom, var(--bg) 0%, var(--bg) 15px, transparent 35px);
  pointer-events: none;
}

/* --- Searchbar --- */
.searchbar {
  position: relative;
  width: 100%;
  max-width: 480px;
}
.searchbar input {
  width: 100%;
  padding: 8px 36px 8px 18px;
  border: 1px solid var(--border);
  border-radius: 22px;
  font-size: 13px;
  height: 38px;
  background: var(--panel);
  color: var(--text);
  transition: all 0.2s ease;
}
.searchbar input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.searchbar input::placeholder {
  color: var(--muted);
}

.search-clear-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 17px;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  display: none;
  transition: color 0.15s ease;
}
.search-clear-btn:hover { color: var(--text); }
.search-clear-btn.visible { display: block; }

.status {
  display: flex;
  align-items: center;
}

.reset-btn {
  font-size: 17px;
  color: var(--text);
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.reset-btn:hover {
  background: var(--hover-bg);
}

/* --- Content Area --- */
.content-scroll {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 15px;
  padding-bottom: 100px;
  display: flex;
  flex-direction: column;
  position: relative;
}


/* When search view is active, disable parent scrolling */
.content-scroll:has(#dashboardView.hidden) {
  overflow: hidden;
  padding-bottom: 15px;
}

/* --- Dashboard --- */
.dashboard-container {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-top: 15px;
  margin-left: clamp(15px, 4vw, 60px);
  margin-right: clamp(15px, 4vw, 60px);
}
.dash-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* Specialty Card */
details.specialty-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
}

summary.specialty-header {
  background: var(--header-bg);
  color: var(--header-text);
  padding: 11px 14px;
  font-weight: 700;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  letter-spacing: -0.01em;
  transition: background 0.15s ease;
}
summary.specialty-header:hover {
  background: var(--header-hover);
}
summary.specialty-header::-webkit-details-marker { display: none; }
summary.specialty-header::after {
  content: '';
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.25s ease;
  flex-shrink: 0;
  margin-left: 8px;
}
details[open] summary.specialty-header::after {
  transform: rotate(-135deg);
}
details:not([open]) summary.specialty-header {
  border-bottom: none;
}
.specialty-body { padding: 0; }

/* --- Subfolders (Level 1) --- */
.subfolder {
  border-bottom: 1px solid var(--separator);
}
.subfolder:last-child { border-bottom: none; }

.subfolder-summary {
  padding: 9px 14px;
  background: var(--subfolder-bg);
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
  color: var(--subfolder-text);
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
  transition: background 0.15s ease;
}
.subfolder-summary:hover { background: var(--subfolder-hover); }
.subfolder-arrow {
  font-size: 9px;
  transition: transform 0.25s ease;
  color: var(--subfolder-arrow);
}
details[open] > .subfolder-summary .subfolder-arrow {
  transform: rotate(90deg);
}
.subfolder-content { padding: 0; }

/* --- Nested Subfolders (Level 2) --- */
.subfolder.nested-level {
  border-bottom: none;
  border-top: 1px solid var(--separator);
}
.subfolder.nested-level .subfolder-summary {
  padding-left: 24px;
  background: var(--nested-bg);
  color: var(--nested-text);
}
.subfolder.nested-level .subfolder-content {
  padding-left: 0;
}

/* --- Medication Item --- */
.med-item {
  position: relative;
  padding: 9px 14px;
  border-bottom: 1px solid var(--separator);
  cursor: pointer;
  line-height: 1.45;
  transition: background 0.15s ease;
  scroll-margin-top: 45px;
  scroll-margin-bottom: 80px;
}

/* Flexbox layout for search results with action buttons */
.med-item.has-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.med-item-content {
  flex: 1;
  min-width: 0;
}
.med-item:last-child { border-bottom: none; }
.med-item:hover { background: var(--med-hover); }
.med-item.in-cart {
  background: var(--in-cart-bg);
  border-left: 3px solid var(--accent);
}

.med-indication {
  display: block;
  font-style: italic;
  font-weight: normal;
  color: var(--subfolder-text);
  margin-bottom: 2px;
}

.med-name-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-right: 4px;
}
.med-details-text {
  font-size: 13px;
  color: var(--text);
}

/* --- Search View --- */
.hidden { display: none !important; }
.search-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: visible;
  padding: 0;
  position: relative;
}
.search-container .med-item { border-bottom: 1px solid var(--separator); }
.search-no-results { padding: 15px; color: var(--calc-note); display: flex; align-items: center; justify-content: space-between; }
.section-title {
  font-size: 17px;
  margin-top: 0;
  margin-bottom: 15px;
  color: var(--text);
  margin-left: 60px;
}
.med-list-flat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

/* Search Results Group Headers (Adult/Pediatric/Other) */
.search-group-header {
  background: var(--header-bg);
  color: var(--header-text);
  padding: 9px 14px;
  font-weight: 700;
  font-size: 12px;
  line-height: 1.4;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  letter-spacing: -0.01em;
}

.search-group-header.is-stuck {
  box-shadow: var(--stuck-shadow);
}

.group-count {
  font-weight: 500;
  font-size: 11px;
  color: var(--muted);
  margin-left: 4px;
  letter-spacing: 0;
}

/* --- Cart Button in Header --- */
.cart-btn-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.icon-btn.cart-btn {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  color: var(--text);
  width: 36px;
  height: 36px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-btn.cart-btn:hover {
  background: var(--hover-bg);
  border-color: var(--hover-border);
  color: var(--text);
}
.icon-btn.cart-btn svg {
  width: 16px;
  height: 16px;
  transform: translate(-0.5px, 1px);
}

.cart-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  padding: 0 4px;
}
/* --- Cart Overlay --- */
.cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--overlay-bg);
  z-index: 500;
}
/* Keep cart button above overlay when dropdown is open */
.cart-btn-wrapper.dropdown-active {
  position: relative;
  z-index: 501;
}

/* --- Cart Dropdown --- */
.cart-dropdown {
  position: fixed;
  top: 56px;
  width: clamp(240px, 24vw, 320px);
  bottom: 15px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  z-index: 501;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.cart-dropdown-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--separator);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--panel);
  flex-shrink: 0;
  height: 56px;
}

.cart-header-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
}

.clear-cart-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: all 0.2s ease;
}
.clear-cart-btn:hover {
  background: var(--hover-bg);
  color: var(--danger);
}

.clear-cart-btn svg {
  display: block;
}

.cart-dropdown-list {
  flex: 1 1 0;
  overflow-y: auto;
  padding: 12px;
  min-height: 0;
}

.cart-med-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}
.cart-med-details {
  font-size: 11px;
  color: var(--text);
  line-height: 1.5;
}

.calc-dose { color: var(--calc-dose); font-weight: 600; }
.calc-note { font-style: italic; color: var(--calc-note); }

.cart-empty {
  padding: 24px; text-align: center; color: var(--muted); font-style: italic;
}

.cart-count {
  font-weight: 500;
  font-size: 13px;
  color: var(--text);
  text-align: left;
}

/* --- Buttons --- */
.btn {
  padding: 7px 14px;
  border: 1px solid var(--border);
  background: var(--btn);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text);
}
.btn:hover { background: var(--btn-hover); }
.btn.btn-secondary {
  background: var(--panel);
  color: var(--muted);
  font-weight: 500;
}
.btn.btn-secondary:hover {
  background: var(--btn);
  color: var(--text);
}
.btn.btn-green {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  font-weight: 600;
}
.btn.btn-green:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.btn.btn-green:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.icon-btn {
  grid-area: close;
  align-self: start;
  background: none;
  border: none;
  font-size: 15px;
  cursor: pointer;
  color: var(--muted);
  padding: 0;
  line-height: 1;
  text-align: right;
  width: 20px;
  transition: color 0.15s ease;
}
.icon-btn:hover { color: var(--danger); }

/* Override for reset button - match clear cart button styling */
.icon-btn.reset-btn {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  color: var(--text);
  width: 36px;
  height: 36px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-btn.reset-btn:hover {
  background: var(--hover-bg);
  color: var(--text);
}
.icon-btn.reset-btn svg {
  width: 18px;
  height: 18px;
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--overlay-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-box {
  background: var(--panel);
  padding: 24px;
  border-radius: 22px;
  width: 90%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}
.modal-box h3 { margin-top: 0; font-weight: 600; letter-spacing: -0.02em; }
.modal-description { margin-top: 0; font-size: 14px; line-height: 1.5; color: var(--text); }
.modal-title-sm { font-size: 16px; }
.modal-label { font-size: 12px; font-weight: 600; display: block; margin-bottom: 4px; }
.modal-input-group { margin: 16px 0; }
.modal-input-group input {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: 14px;
  -moz-appearance: textfield;
  background: var(--bg);
  color: var(--text);
  transition: all 0.2s ease;
}
.modal-input-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
  background: var(--panel);
}
.modal-input-group input::-webkit-outer-spin-button,
.modal-input-group input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Weight Input with Unit Suffix */
.weight-input-wrapper {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg);
  overflow: hidden;
  transition: all 0.2s ease;
}

.weight-input-wrapper input {
  flex: 1;
  border: none;
  padding: 10px 12px;
  font-size: 15px;
  outline: none;
  min-width: 0;
  background: transparent;
  color: var(--text);
}

.weight-input-wrapper input:focus {
  outline: none;
}

.weight-input-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
  background: var(--panel);
}

.weight-unit-suffix {
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border-left: 1px solid var(--border);
  user-select: none;
}

/* Weight Modal - tight fit to text */
#weightModal .modal-box {
  width: 280px;
}

/* --- Desktop-Only Overlay (shown below 720px) --- */
.desktop-only-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.desktop-only-message {
  text-align: center;
  padding: 40px;
  max-width: 400px;
}

.desktop-only-message p {
  font-size: 15px;
  color: var(--text);
  margin: 0 0 10px 0;
  line-height: 1.5;
}

.desktop-only-message p:first-child {
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.02em;
}

/* --- Responsive Breakpoints --- */

/* 3 columns to 2 columns at 1050px (~300px per column) */
@media (max-width: 1050px) {
  #col3 {
    display: none;
  }
}

/* Single column at 700px */
@media (max-width: 700px) {
  #col2,
  #col3 {
    display: none;
  }
}

/* Location collapses to icon-only when gap drops below 12px (toggled by JS) */
.location-wrapper.icon-only {
  width: 36px;
  min-width: 36px;
}

.location-wrapper.icon-only .location-btn {
  width: 36px;
  min-width: 36px;
  padding: 0;
  justify-content: center;
}

.location-wrapper.icon-only .loc-label,
.location-wrapper.icon-only .arrow {
  display: none;
}

.location-wrapper.icon-only .loc-icon {
  display: inline-flex;
}

/* On narrow screens, widen location search to match dropdown; provider hides to make room */
@media (max-width: 900px) {
  .location-wrapper.search-active,
  .location-wrapper.icon-only.search-active {
    width: 480px;
    min-width: 375px;
    flex-shrink: 1;
  }

  .location-wrapper.icon-only.search-active .location-btn {
    width: 100%;
    min-width: 0;
    padding: 0 12px;
    justify-content: space-between;
  }

  /* Hide provider field to give the search bar room */
  .topbar-left:has(.location-wrapper.search-active) .provider-wrapper {
    display: none;
  }

  /* Dropdown tracks wrapper width: 480px down to 375px */
  .location-wrapper.search-active .location-search-dropdown {
    width: 100%;
    max-width: 480px;
    min-width: 375px;
  }
}

/* Hard cutoff: overlay shown by JS when header can no longer maintain 12px gaps */
.desktop-only-overlay.active {
  display: flex;
}

/* Highlight for search terms */
.highlight {
  background-color: var(--highlight-bg);
  color: inherit;
  font-weight: inherit;
  border-radius: 4px;
  padding: 0 2px;
}

/* Brand Match Hint */
.brand-match-hint {
  font-weight: normal;
  font-size: 0.85em;
  color: var(--brand-match);
  font-style: italic;
  margin-left: 6px;
}

/* Brand Name Display (hidden by default, shown when Tab is held) */
.brand-name {
  font-weight: 600;
  color: var(--brand-name-color);
  display: none;
}

/* Show brands when body has show-brands class */
body.show-brands .brand-name {
  display: inline;
}

/* Hide brand match hint when brands are visible */
body.show-brands .brand-match-hint {
  display: none;
}

/* Show brands inside cart dropdown when Tab held with cart open */
.cart-dropdown.show-brands .brand-name {
  display: inline;
}

.modal-box.modal-wide {
  max-width: 800px;
  width: 95%;
}

.edit-grid-row {
  display: grid;
  grid-template-columns: 2fr repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.edit-field label, .edit-full-row label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.edit-field input, .edit-full-row input, .edit-full-row textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 13px;
  font-family: inherit;
  resize: none;
  background: var(--bg);
  color: var(--text);
  transition: all 0.2s ease;
}

.edit-field input:focus, .edit-full-row input:focus, .edit-full-row textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
  background: var(--panel);
}

.edit-full-row {
  margin-bottom: 16px;
}

.cart-item {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: box-shadow 0.2s ease;
}

.cart-item:hover {
  box-shadow: var(--shadow-md);
}

.cart-item-overlay-actions {
  position: absolute;
  top: 8px;
  right: 10px;
  display: flex;
  visibility: hidden;
  gap: 4px;
  align-items: center;
  padding-left: 30px;
  background: linear-gradient(to right, transparent 0%, var(--panel) 30px);
  height: 20px;
}

.cart-item:hover .cart-item-overlay-actions {
  visibility: visible;
}

#editModal .modal-actions .btn:focus {
  outline: none;
}

.med-item.is-active {
  position: relative;
  background-color: var(--accent-tint);
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 12px;
}

/* --- Search Result Action Buttons --- */
.med-item-actions {
  display: flex;
  visibility: hidden;
  flex-shrink: 0;
  gap: 6px;
  align-items: center;
}

/* Show action buttons on hover, keyboard highlight, or when in cart */
.med-item:hover .med-item-actions,
.med-item.is-active .med-item-actions,
.med-item.in-cart .med-item-actions {
  visibility: visible;
}

/* Enter hint for search results (positioned outside scrollable area) */
.search-enter-hint {
  display: none;
  position: absolute;
  right: 32px;
  width: 20px;
  height: 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23007AFF' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6v6a2 2 0 0 1-2 2H6'/%3E%3Cpath d='M10 10l-4 4 4 4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 20px 20px;
  pointer-events: none;
  z-index: 15;
}

.search-enter-hint.visible {
  display: block;
}

.med-action-btn {
  padding: 5px 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text);
  white-space: nowrap;
}

.med-action-btn:hover {
  background: var(--btn-hover);
  border-color: var(--hover-border);
}

/* Keyboard shortcut hint underlines - hidden by default, shown on keyboard highlight */
.med-action-btn .shortcut-hint {
  text-decoration: none;
}

.med-item.is-active .med-action-btn .shortcut-hint {
  text-decoration: underline;
}

.med-action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.med-action-btn-remove {
  background: var(--danger-tint);
  border-color: var(--danger-tint-border);
  color: var(--danger);
}

.med-action-btn-remove:hover {
  background: var(--danger-tint-hover);
  border-color: var(--danger-tint-border-hover);
}

/* Hide Edit button for in-cart items unless hovering or keyboard highlighted */
.med-item.in-cart .med-item-actions .med-action-btn-edit {
  visibility: hidden;
}

.med-item.in-cart:hover .med-item-actions .med-action-btn-edit,
.med-item.in-cart.is-active .med-item-actions .med-action-btn-edit {
  visibility: visible;
}

/* --- Folder View Overlay Action Buttons --- */
.med-item.has-overlay-actions {
  position: relative;
}

.med-item.has-overlay-actions .med-indication {
  margin-bottom: 6px;
}

.med-item-overlay-actions {
  position: absolute;
  top: 8px;
  right: 10px;
  display: flex;
  visibility: hidden;
  gap: 4px;
  align-items: center;
  padding-left: 30px;
  background: linear-gradient(to right, transparent 0%, var(--bg) 30px);
  height: 20px;
}

.med-item.has-overlay-actions:hover .med-item-overlay-actions,
.med-item.has-overlay-actions.in-cart .med-item-overlay-actions {
  visibility: visible;
}

/* Adjust gradient for in-cart items */
.med-item.has-overlay-actions.in-cart .med-item-overlay-actions {
  background: linear-gradient(to right, transparent 0%, var(--in-cart-bg) 30px);
}

/* Hide Edit button for in-cart items in folder view unless hovering */
.med-item.has-overlay-actions.in-cart .med-item-overlay-actions .med-action-btn-edit {
  visibility: hidden;
}

.med-item.has-overlay-actions.in-cart:hover .med-item-overlay-actions .med-action-btn-edit {
  visibility: visible;
}

/* Smaller buttons for folder/cart overlay */
.med-item-overlay-actions .med-action-btn,
.cart-item-overlay-actions .med-action-btn {
  padding: 3px 8px;
  font-size: 11px;
}

/* Create a 'lane' for the hint on the right of the search results */
#searchResults {
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: auto;
  margin-right: 60px;
  margin-left: 60px;
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
}

/* Anchor for the hint - sole match */
.med-item.is-sole-match {
  position: relative;
  border: 2px solid var(--accent) !important;
}

/* --- Add New Med Button --- */
button.add-new-med-btn {
  background: var(--header-bg);
  border: 1px dashed var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  padding: 11px 14px;
  font-weight: 700;
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  width: 100%;
  text-align: left;
  display: block;
  transition: all 0.2s ease;
}

button.add-new-med-btn:hover {
  background: var(--header-hover);
}

/* Add New Med From Search Button */
.add-new-med-from-search-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  color: var(--text);
}

.add-new-med-from-search-btn:hover {
  background: var(--hover-bg);
}

.add-new-med-from-search-btn .enter-symbol {
  display: inline-block;
  width: 18px;
  height: 18px;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6v6a2 2 0 0 1-2 2H6'/%3E%3Cpath d='M10 10l-4 4 4 4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px 16px;
  vertical-align: middle;
}

/* --- Help Button (Fixed at bottom left) --- */
.help-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 40px;
  height: 40px;
  border-radius: 22px;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  z-index: 500;
  padding: 0;
}

.help-btn:hover {
  background: var(--panel);
  box-shadow: var(--shadow-md);
  transform: scale(1.06);
}

/* Grey out help button when any modal/overlay is open */
body:has(.modal-overlay:not(.hidden)),
body:has(.cart-overlay:not(.hidden)),
body:has(.provider-edit-backdrop:not(.hidden)),
body:has(.location-search-backdrop:not(.hidden)),
body:has(.help-overlay:not(.hidden)) {
  .help-btn {
    opacity: 0.3;
    pointer-events: none;
  }
}

.help-btn svg {
  width: 22px;
  height: 22px;
  color: var(--accent);
}

/* --- Help Popup Overlay --- */
.help-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--overlay-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

/* --- Help Popup Box --- */
.help-popup-box {
  background: var(--panel);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 700px;
  max-height: 92vh;
  overflow-y: auto;
  padding: clamp(20px, 3.5vh, 36px);
  position: relative;
}

/* --- Help Close Button --- */
.help-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--bg);
  border: none;
  font-size: 20px;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  transition: all 0.2s ease;
}

.help-close-btn:hover {
  background: var(--btn-hover);
  color: var(--text);
}

/* --- Help Content Styling --- */
.help-content {
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
}

.help-content h2 {
  font-size: clamp(17px, 2.8vh, 22px);
  font-weight: 700;
  color: var(--text);
  margin-top: 0;
  margin-bottom: clamp(4px, 0.8vh, 8px);
  letter-spacing: -0.03em;
}

.help-content h3 {
  font-size: clamp(12px, 1.9vh, 15px);
  font-weight: 600;
  color: var(--text);
  margin-top: clamp(10px, 2vh, 24px);
  margin-bottom: clamp(4px, 0.8vh, 8px);
  letter-spacing: -0.02em;
}

.help-content p {
  font-size: clamp(11px, 1.6vh, 13px);
  line-height: 1.55;
  margin: 0 0 clamp(6px, 1.2vh, 16px) 0;
  color: var(--nested-text);
}

.help-content ol,
.help-content ul {
  font-size: clamp(11px, 1.6vh, 13px);
  line-height: 1.55;
  margin: 0 0 clamp(6px, 1vh, 16px) 0;
  padding-left: 25px;
  color: var(--nested-text);
}

.help-content li {
  margin-bottom: clamp(2px, 0.6vh, 8px);
}

.help-content strong {
  font-weight: 600;
  color: var(--text);
}

/* Responsive adjustments */
@media (max-width: 700px) {
  .help-popup-box {
    width: 95%;
    padding: clamp(16px, 3vh, 24px);
    max-height: 94vh;
  }

  .help-btn {
    bottom: 15px;
    left: 15px;
    width: 36px;
    height: 36px;
  }

  .help-btn svg {
    width: 20px;
    height: 20px;
  }
}

/* --- Fly-to-Cart Animation --- */
.fly-ghost {
  position: fixed;
  pointer-events: none;
  z-index: 10000;
  will-change: transform, opacity;
  transform-style: preserve-3d;
  backface-visibility: visible;
}

.fly-ghost-outline {
  border: 2px solid var(--accent-ring-strong);
  border-radius: 14px;
  background: var(--ghost-bg);
  box-shadow: var(--ghost-shadow);
}

.fly-ghost-modal {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--ghost-modal-shadow);
  overflow: hidden;
}

@keyframes cart-badge-pulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.45); }
  100% { transform: scale(1); }
}

.cart-badge-pulse {
  animation: cart-badge-pulse 350ms ease-out;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 8px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 10001;
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms ease;
  max-width: 400px;
  text-align: center;
  letter-spacing: -0.01em;
}

.toast-visible {
  opacity: 1;
}

.toast-hidden {
  opacity: 0;
}

/* Confirm Modal */
.confirm-modal-box {
  max-width: 340px;
  text-align: center;
}
.confirm-message {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  margin: 0 0 20px 0;
}
.confirm-modal-box .modal-actions {
  justify-content: center;
}

/* Dark mode overrides for inline SVG data URIs */
@media (prefers-color-scheme: dark) {
  .loc-enter-hint {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230A84FF' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6v6a2 2 0 0 1-2 2H6'/%3E%3Cpath d='M10 10l-4 4 4 4'/%3E%3C/svg%3E");
  }
  .search-enter-hint {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230A84FF' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6v6a2 2 0 0 1-2 2H6'/%3E%3Cpath d='M10 10l-4 4 4 4'/%3E%3C/svg%3E");
  }
  .add-new-med-from-search-btn .enter-symbol {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398989d' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6v6a2 2 0 0 1-2 2H6'/%3E%3Cpath d='M10 10l-4 4 4 4'/%3E%3C/svg%3E");
  }
}
