.ap-panel {
  position: fixed; z-index: 1000; inset: 0; width: 100%; max-width: var(--ap-page-width); height: 100vh; height: 100dvh;
  max-height: none; margin: 0 auto; padding: var(--ap-safe-top) 0 0; border: 0; overflow: hidden;
  background: #fff; color: var(--ap-ink); box-shadow: 0 0 36px #20243712;
}
.ap-panel[open] { display: flex; flex-direction: column; }
.ap-panel:focus { outline: none; }
.ap-panel::backdrop { background: #20243735; }
.ap-panel__header { display: flex; align-items: center; flex-shrink: 0; gap: 4px; min-height: 60px; padding: 6px 8px; border-bottom: 1px solid #eef0f5; }
.ap-panel__header h2 { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 1rem; font-weight: 700; }
.ap-panel__back { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; }
.ap-panel__back svg { width: 22px; height: 22px; }
.ap-panel__back:active { background: var(--ap-surface); }
.ap-panel__close { min-height: 44px; padding: 0 10px; border: 0; background: transparent; color: var(--ap-link); font-size: .8125rem; }
.ap-panel__scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: 14px var(--ap-gutter) calc(28px + var(--ap-safe-bottom)); }

.ap-lead { margin: 14px 2px 12px; color: var(--ap-muted); font-size: .8125rem; }
.ap-count { margin: 0 2px 10px; color: var(--ap-muted); font-size: .6875rem; }
.ap-cover { overflow: hidden; border-radius: var(--ap-radius-m); aspect-ratio: 3 / 2; }
.ap-cover--wide { aspect-ratio: 1301 / 1367; margin-bottom: 14px; }
.ap-cover--brand { aspect-ratio: 16 / 9; margin-bottom: 14px; }
.ap-cover--brand img { object-position: 50% 40%; }
.ap-cover--home { position: relative; aspect-ratio: 16 / 9; }
.ap-cover--home::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, #0b2238b3); }
.ap-cover__caption { position: absolute; z-index: 1; right: 14px; bottom: 12px; display: flex; flex-direction: column;
  color: #fff; font-size: 1.125rem; font-weight: 700; line-height: 1.5; text-shadow: 0 1px 3px #0004; }
.ap-cover__caption small { font-size: .6875rem; font-weight: 400; opacity: .85; }
.ap-cover img { width: 100%; height: 100%; object-fit: cover; }

/* Search */
.ap-sticky-tools { position: sticky; z-index: 3; top: -14px; margin: -14px calc(var(--ap-gutter) * -1) 4px;
  padding: 12px var(--ap-gutter) 10px; background: #fff; }
.ap-search { position: relative; display: block; margin: 0; }
.ap-search input {
  width: 100%; height: 48px; padding: 10px 44px 10px 44px; border: 1px solid #ced2df; border-radius: 16px;
  background: var(--ap-surface); font-size: 16px; line-height: 1.5; -webkit-appearance: none; appearance: none;
}
.ap-search input::placeholder { color: var(--ap-muted); font-size: .8125rem; }
.ap-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.ap-search input:focus { border-color: var(--ap-brand-line); background: #fff; outline: none; box-shadow: 0 0 0 3px #008dfa26; }
.ap-search__icon { position: absolute; right: 14px; top: 13px; width: 22px; height: 22px; color: var(--ap-brand); pointer-events: none; }
.ap-search__clear { position: absolute; left: 2px; top: 2px; display: grid; place-items: center; width: 44px; height: 44px;
  border: 0; border-radius: 14px; background: transparent; color: var(--ap-muted); }
.ap-search__clear svg { width: 18px; height: 18px; }

.ap-search-hint { margin-top: 8px; color: var(--ap-muted); font-size: .75rem; }
.ap-suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ap-suggestion { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 4px 14px;
  border: 1px solid var(--ap-line); border-radius: 999px; background: #fff; color: var(--ap-ink); font-size: .8125rem; }
.ap-suggestion svg { width: 15px; height: 15px; color: var(--ap-muted); }
.ap-suggestion:active { background: var(--ap-brand-soft); }
.ap-search-group { margin-top: 14px; }
.ap-search-group h3 { margin: 0 2px 10px; color: var(--ap-muted); font-size: .75rem; font-weight: 700; }
.ap-list--tight { gap: 8px; }

.ap-result { display: flex; align-items: center; gap: 10px; min-height: 72px; padding: 12px;
  border: 1px solid var(--ap-line); border-radius: 16px; background: #fff; color: var(--ap-ink); text-decoration: none; }
.ap-result:active { background: var(--ap-surface); }
.ap-result__avatar { flex: 0 0 44px; width: 44px; height: 44px; overflow: hidden; border-radius: var(--ap-radius-s); background: #fff; }
.ap-result__avatar img { width: 100%; height: 100%; object-fit: contain; }
.ap-result__info { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.ap-result__name { font-size: .8125rem; font-weight: 700; line-height: 1.7; overflow-wrap: anywhere; }
.ap-result__meta { color: var(--ap-muted); font-size: .6875rem; }
.ap-result__action { flex-shrink: 0; color: var(--ap-brand-ink); font-size: .6875rem; white-space: nowrap; }

/* Scrolls sideways when there are more chips than fit (size chips on the purifier list). */
.ap-filters { display: flex; gap: 8px; margin: 0 calc(var(--ap-gutter) * -1) 10px; padding: 0 var(--ap-gutter);
  overflow-x: auto; scrollbar-width: none; }
.ap-filters::-webkit-scrollbar { display: none; }
.ap-filter {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: 1 0 auto; min-height: 40px; padding: 4px 12px;
  border: 1px solid var(--ap-line); border-radius: var(--ap-radius-s); background: #fff; font-size: .8125rem; white-space: nowrap;
}
.ap-filter small { color: var(--ap-muted); font-size: .6875rem; }
.ap-filter[aria-pressed="true"] { border-color: var(--ap-brand-line); background: var(--ap-brand-soft); color: var(--ap-brand-ink); }

/* Merchant detail page */
.ap-mdp__hero { height: 220px; margin: -14px calc(var(--ap-gutter) * -1) 0; background: linear-gradient(140deg, #dfe7ed, #abc0d0); }
.ap-mdp__hero img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 28%; }
.ap-mdp__summary { position: relative; display: grid; gap: 12px; margin: -56px 0 0; padding: 16px;
  border: 1px solid #ffffffc9; border-radius: 24px; background: #f5f5f8; box-shadow: 0 8px 28px #20243710; }
.ap-mdp__heading { display: flex; align-items: center; gap: 12px; }
.ap-mdp__heading h3 { margin-bottom: 4px; font-size: 1rem; }
.ap-mdp__logo { flex: 0 0 56px; width: 56px; height: 56px; padding: 5px; overflow: hidden; border: 1px solid var(--ap-line); border-radius: var(--ap-radius-m); background: #fff; }
.ap-mdp__logo img { width: 100%; height: 100%; object-fit: contain; }
.ap-mdp__desc { color: var(--ap-muted); font-size: .8125rem; }
.ap-mdp__block { margin-top: 24px; }
.ap-mdp__title { margin: 0 2px 12px; font-size: .9375rem; }

.ap-branch { padding: 14px; border: 1px solid var(--ap-line); border-radius: var(--ap-radius-m); background: #fff; }
.ap-branch__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.ap-branch__top h4 { font-size: .875rem; }
.ap-branch__actions { display: flex; align-items: center; gap: 8px; }
.ap-branch__action { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 44px; padding: 7px 12px;
  border-radius: 22px; background: #f5f4fc; color: var(--ap-ink); text-decoration: none; font-size: .6875rem; }
.ap-branch__action svg { width: 18px; height: 18px; }
.ap-branch__action--primary { background: var(--ap-brand-soft); color: var(--ap-brand-ink); }
.ap-branch__action--icon { width: 44px; padding: 8px; }
.ap-branch__line { display: flex; align-items: flex-start; gap: 6px; color: var(--ap-muted); font-size: .8125rem; line-height: 2; }
.ap-branch__line svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 6px; }
/* Panel open/close motion lives in motion.css. */
