/* Sprayed? — phone filters drawer (drawer.js). Everything is scoped to .fdrawer-*;
   the bar is un-hidden and the drawer populated only while the phone layout is active. */

/* ---------- Compact bar inside the filters card ---------- */

.controls.fdrawer-on {
  padding: 12px;
  gap: 12px;
}

.fdrawer-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.fdrawer-btn {
  flex: none;
  gap: 8px;
  padding: 8px 14px;
}

.fdrawer-btn[aria-expanded='true'] {
  background: var(--ink);
  color: var(--surface);
}

.fdrawer-badge {
  display: inline-block;
  min-width: 22px;
  padding: 1px 6px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--now);
  color: var(--on-color);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
}

.fdrawer-summary {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  /* At most two lines; never pushes the card wider than the screen. */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}

/* Search stays in the card; its visible label is redundant next to the placeholder + icon. */
.controls.fdrawer-on label[for='search'] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Bottom sheet ---------- */

body.fdrawer-open {
  overflow: hidden;
}

.fdrawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 52;
  background: rgba(20, 28, 24, 0.45);
}

.fdrawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 53;
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  max-height: 85dvh;
  background: var(--surface);
  color: var(--ink);
  border-top: var(--border);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: 0 -4px 0 var(--shadow-c);
  overflow: hidden;
}

.fdrawer:focus {
  outline: none;
}

.fdrawer.fdrawer-anim {
  animation: fdrawer-up 0.22s ease-out;
}

@keyframes fdrawer-up {
  from { transform: translateY(40px); opacity: 0.4; }
  to { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .fdrawer.fdrawer-anim {
    animation: none;
  }
}

.fdrawer-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 12px 6px 18px;
  padding-left: max(18px, env(safe-area-inset-left));
  padding-right: max(12px, env(safe-area-inset-right));
  border-bottom: 2px solid var(--hairline);
  position: relative;
}

/* Drag-handle look */
.fdrawer-head::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  width: 44px;
  height: 5px;
  margin-left: -22px;
  border-radius: 999px;
  background: var(--hairline);
}

.fdrawer-title {
  margin: 10px 0 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  line-height: 1.2;
}

.fdrawer-close {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-top: 8px;
  padding: 0;
  border: var(--border-thin);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  color: var(--ink);
}

.fdrawer-close .i {
  width: 20px;
  height: 20px;
}

.fdrawer-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: grid;
  align-content: start;
  gap: 20px;
  padding: 16px 18px 20px;
  padding-left: max(18px, env(safe-area-inset-left));
  padding-right: max(18px, env(safe-area-inset-right));
}

/* Show chips: two per row in the drawer. */
.fdrawer-body #status-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.fdrawer-body #status-chips .chip {
  min-width: 0;
  padding: 6px 10px;
  line-height: 1.2;
  text-align: left;
}

.fdrawer-body #status-chips .chip .count {
  margin-left: auto;
  flex: none;
}

.fdrawer-body #status-chips .chip .dot {
  flex: none;
}

.fdrawer-foot {
  flex: none;
  display: flex;
  gap: 10px;
  padding: 12px 18px;
  padding-left: max(18px, env(safe-area-inset-left));
  padding-right: max(18px, env(safe-area-inset-right));
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  border-top: 2px solid var(--hairline);
  background: var(--surface);
}

.fdrawer-foot .btn {
  min-height: 48px;
}

.fdrawer-reset {
  flex: none;
}

.fdrawer-reset:disabled {
  cursor: default;
  opacity: 0.5;
  box-shadow: none;
}

.fdrawer-show {
  flex: 1 1 auto;
}

/* Desktop never shows the drawer, even mid-resize. */
@media (min-width: 900px) {
  .fdrawer,
  .fdrawer-scrim,
  .fdrawer-bar {
    display: none !important;
  }
}
