/* Independent surface preferences. Load after theme and map styles.
   Server and client share defaults: glass search, solid request, rounded buttons, filled fields. */
.aviary-app {
  --av-glass-bg: color-mix(in srgb, var(--av-bg) 38%, transparent);
  --av-glass-blur: 8px;
  --av-input-rule: var(--av-muted);
  --av-input-error: #a3262e;
}
html[data-av-theme=dark] .aviary-app { --av-input-error: #ffb1ba; }

/* Solid first: unsupported blur/color mixing never produces an unreadable pane.
   A pseudo-layer leaves autocomplete menus outside the panel's blur context. */
:is(html[data-search-style=glass] body.aviary-app .av-filters, html[data-request-style=glass] body.aviary-app .av-request-panel) {
  isolation: isolate;
  background: var(--av-surface);
  color: var(--av-ink);
}
/* Keep the request panel's desktop sticky behavior and mobile flow intact. */
html[data-search-style=glass] body.aviary-app .av-filters { position: relative; }
@media (max-width: 760px) {
  html[data-request-style=glass] body.aviary-app .av-request-panel { position: relative; }
}
:is(html[data-search-style=glass] body.aviary-app .av-filters, html[data-request-style=glass] body.aviary-app .av-request-panel)::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background: var(--av-surface);
}
@supports ((backdrop-filter: blur(8px)) or (-webkit-backdrop-filter: blur(8px))) and (background: color-mix(in srgb, white 38%, transparent)) {
  :is(html[data-search-style=glass] body.aviary-app .av-filters, html[data-request-style=glass] body.aviary-app .av-request-panel) { background: transparent; }
  :is(html[data-search-style=glass] body.aviary-app .av-filters, html[data-request-style=glass] body.aviary-app .av-request-panel)::before {
    background: var(--av-glass-bg);
    backdrop-filter: blur(var(--av-glass-blur));
    -webkit-backdrop-filter: blur(var(--av-glass-blur));
  }
}
/* Menus must remain opaque over both geography and the form underneath. */
html[data-search-style=glass] body.aviary-app :is(.av-place-options, .av-airport-options) {
  background: var(--av-surface);
  color: var(--av-ink);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
@media (prefers-reduced-transparency: reduce) {
  :is(html[data-search-style=glass] body.aviary-app .av-filters, html[data-request-style=glass] body.aviary-app .av-request-panel)::before {
    background: var(--av-surface);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* Content actions and actual form actions have independent shape choices. */
:is(html[data-button-style=rounded] body.aviary-app, body.aviary-app[data-button-style=rounded]) :is(.av-button, .av-header-action) {
  border-radius: 999px;
}
:is(html[data-form-button-style=standard] body.aviary-app, body.aviary-app[data-form-button-style=standard]) :is(form .av-button, [role=form] .av-button, .av-button[form]) {
  border-radius: 10px;
}
:is(html[data-form-button-style=rounded] body.aviary-app, body.aviary-app[data-form-button-style=rounded]) :is(form .av-button, [role=form] .av-button, .av-button[form]) {
  border-radius: 999px;
}

/* Preserve native select/date affordances and checkbox/radio/file controls.
   The transparent value surface is independent of the panel preference. */
:is(html[data-input-style=underline] body.aviary-app, body.aviary-app[data-input-style=underline]) .av-field :is(input:not([type=checkbox],[type=radio],[type=hidden],[type=file],[type=range],[type=color],[type=button],[type=submit],[type=reset]), select, textarea) {
  background: transparent;
  color: var(--av-ink);
  border: 0;
  border-bottom: 1px solid var(--av-input-rule);
  border-radius: 0;
  padding-inline: 2px;
  box-shadow: none;
}
:is(html[data-input-style=underline] body.aviary-app, body.aviary-app[data-input-style=underline]) .av-field select {
  padding-right: 24px;
}
:is(html[data-input-style=underline] body.aviary-app, body.aviary-app[data-input-style=underline]) .av-field select option {
  background: var(--av-surface);
  color: var(--av-ink);
}
:is(html[data-input-style=underline] body.aviary-app, body.aviary-app[data-input-style=underline]) .av-field :is(input, textarea)::placeholder {
  color: var(--av-muted);
  opacity: 1;
}
:is(html[data-input-style=underline] body.aviary-app, body.aviary-app[data-input-style=underline]) .av-field :is(input:not([type=checkbox],[type=radio],[type=hidden]), select, textarea):focus {
  border-bottom-color: var(--av-blue);
  outline: 2px solid var(--av-blue);
  outline-offset: 3px;
  box-shadow: none;
}
:is(html[data-input-style=underline] body.aviary-app, body.aviary-app[data-input-style=underline]) .av-field :is(input:not([type=checkbox],[type=radio],[type=hidden]), select, textarea)[aria-invalid=true] {
  background: transparent;
  border-bottom: 2px solid var(--av-input-error);
}
:is(html[data-input-style=underline] body.aviary-app, body.aviary-app[data-input-style=underline]) .av-field :is(input:not([type=checkbox],[type=radio],[type=hidden]), select, textarea)[aria-invalid=true]:focus {
  outline-color: var(--av-input-error);
}
:is(html[data-input-style=underline] body.aviary-app, body.aviary-app[data-input-style=underline]) .av-field :is(input:not([type=checkbox],[type=radio],[type=hidden]), select, textarea):disabled {
  color: var(--av-muted);
  border-bottom-style: dashed;
  cursor: not-allowed;
  opacity: 1;
}
/* Browser autofill gets a readable solid surface rather than an invisible value. */
:is(html[data-input-style=underline] body.aviary-app, body.aviary-app[data-input-style=underline]) .av-field input:-webkit-autofill {
  -webkit-text-fill-color: var(--av-ink);
  -webkit-box-shadow: 0 0 0 100px var(--av-surface) inset;
  caret-color: var(--av-ink);
}
@media (forced-colors: active) {
  :is(html[data-search-style=glass] body.aviary-app .av-filters, html[data-request-style=glass] body.aviary-app .av-request-panel)::before {
    background: Canvas;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  :is(html[data-input-style=underline] body.aviary-app, body.aviary-app[data-input-style=underline]) .av-field :is(input, select, textarea) {
    border-bottom-color: CanvasText;
  }
  :is(html[data-input-style=underline] body.aviary-app, body.aviary-app[data-input-style=underline]) .av-field :is(input, select, textarea):focus { outline-color: Highlight; }
}

/* Rounded is a filled field variant; native date/select/checkbox affordances remain. */
html[data-input-style=rounded] body.aviary-app .av-field :is(input:not([type=checkbox],[type=radio],[type=hidden],[type=file],[type=range],[type=color],[type=button],[type=submit],[type=reset]), select) { border-radius:999px; padding-inline:16px; }
html[data-input-style=rounded] body.aviary-app .av-field textarea { border-radius:16px; }

.av-owner-settings-link{margin-left:auto;white-space:nowrap;font-size:14px;min-height:44px;display:inline-flex;align-items:center}
/* Keep the header's glass paint bounded when an absolutely positioned menu opens.
   Discovery already supplies a full-width, header-height ::before in aviary-map.css. */
.aviary-app .av-header{background:transparent;backdrop-filter:none;-webkit-backdrop-filter:none}
.aviary-app:not(.av-discovery-page) .av-header::before{content:"";position:absolute;z-index:-1;inset:0;pointer-events:none}
html[data-hero-nav=solid] .aviary-app .av-header::before,
html[data-hero-nav=glass] .aviary-app .av-header::before{background:var(--av-bg);backdrop-filter:none;-webkit-backdrop-filter:none}
@supports ((backdrop-filter:blur(8px)) or (-webkit-backdrop-filter:blur(8px))) and (background:color-mix(in srgb,white 38%,transparent)){
  html[data-hero-nav=glass] .aviary-app .av-header::before{background:var(--av-glass-bg);backdrop-filter:blur(var(--av-glass-blur));-webkit-backdrop-filter:blur(var(--av-glass-blur))}
}
@media(prefers-reduced-transparency:reduce){html[data-hero-nav=glass] .aviary-app .av-header::before{background:var(--av-bg);backdrop-filter:none;-webkit-backdrop-filter:none}}
@media(forced-colors:active){html[data-hero-nav=glass] .aviary-app .av-header::before{background:Canvas;backdrop-filter:none;-webkit-backdrop-filter:none}}
