/*
  Modal 07 — Responsive Filter Sheet — standalone HTML/CSS/JS.
  No build step, no framework, no external dependency: copy index.html,
  this file, and script.js into any project as-is.
*/

:root {
  --sheet-fg: oklch(0.18 0 0);
  --sheet-muted: oklch(0.5 0 0);
  --sheet-line: oklch(0.92 0 0);
  --sheet-soft: oklch(0.97 0 0);
  --sheet-accent: #39ff14;
}

.modal07 {
  position: fixed;
  inset: 0;
  z-index: 50;
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji";
}

.modal07[hidden] {
  display: none;
}

.modal07 p,
.modal07 h2 {
  margin: 0;
}

.modal07 svg {
  display: block;
}

/* A plain, even dim: the list behind stays legible, because the whole point
   is to see what the filters will change. */
.modal07__backdrop {
  position: fixed;
  inset: 0;
  background-color: oklch(0.2 0 0 / 0.36);
  animation: modal07-fade-in 240ms ease-out both;
}

.modal07[data-state="closing"] .modal07__backdrop {
  animation: modal07-fade-out 200ms ease-in both;
}

/* A bottom sheet rises from the bottom edge on phones… */
.modal07__panel {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  max-height: 88%;
  flex-direction: column;
  border-radius: 1.5rem 1.5rem 0 0;
  background-color: #ffffff;
  box-shadow: 0 -18px 50px -20px rgba(0, 0, 0, 0.3);
  animation: modal07-rise 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.modal07[data-state="closing"] .modal07__panel {
  animation: modal07-sink 220ms cubic-bezier(0.4, 0, 1, 1) both;
}

.modal07__handle {
  width: 2.5rem;
  height: 0.25rem;
  flex-shrink: 0;
  margin: 0.625rem auto 0;
  border-radius: 9999px;
  background-color: var(--sheet-line);
}

.modal07__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 1px solid var(--sheet-line);
  padding: 0.75rem 1.25rem 1rem;
}

.modal07__heading {
  min-width: 0;
}

.modal07__title {
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--sheet-fg);
  outline: none;
}

.modal07__count {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.125rem !important;
  font-size: 13px;
  line-height: 1.25rem;
  font-variant-numeric: tabular-nums;
  color: var(--sheet-muted);
}

.modal07__count::before {
  content: "";
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 9999px;
  background-color: var(--sheet-accent);
}

.modal07__close,
.modal07__clear,
.modal07__apply {
  border: 0;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition:
    background-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
    color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal07__close {
  display: flex;
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  margin-right: -0.5rem;
  border-radius: 0.5rem;
  padding: 0;
  background: transparent;
  color: var(--sheet-muted);
}

.modal07__close svg {
  width: 1rem;
  height: 1rem;
}

.modal07__close:hover,
.modal07__clear:hover {
  background-color: var(--sheet-soft);
  color: var(--sheet-fg);
}

.modal07__body {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 1.25rem;
}

.modal07__group {
  min-width: 0;
  margin: 0;
  border: 0;
  border-bottom: 1px solid var(--sheet-line);
  padding: 1.25rem 0;
}

.modal07__group:last-child {
  border-bottom: 0;
}

.modal07__legend {
  float: left;
  width: 100%;
  margin-bottom: 0.75rem;
  padding: 0;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sheet-muted);
}

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

.modal07__pills {
  clear: left;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.modal07__pill {
  position: relative;
}

.modal07__pill span {
  display: flex;
  height: 2.25rem;
  align-items: center;
  border: 1px solid var(--sheet-line);
  border-radius: 9999px;
  padding: 0 0.875rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--sheet-fg);
  cursor: pointer;
  transition:
    background-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
    border-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
    color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal07__pill span:hover {
  background-color: var(--sheet-soft);
}

.modal07__pill input:checked + span {
  border-color: var(--sheet-fg);
  background-color: var(--sheet-fg);
  color: #ffffff;
}

.modal07__checks {
  clear: left;
  margin: 0 -0.5rem;
}

.modal07__check {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-radius: 0.5rem;
  padding: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--sheet-fg);
  cursor: pointer;
  transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal07__check + .modal07__check {
  margin-top: 0.125rem;
}

.modal07__check:hover {
  background-color: var(--sheet-soft);
}

.modal07__box {
  display: flex;
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid oklch(0.8 0 0);
  border-radius: 5px;
  color: transparent;
  transition:
    background-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
    border-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
    color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal07__box svg {
  width: 0.75rem;
  height: 0.75rem;
}

.modal07__check input:checked + .modal07__box {
  border-color: var(--sheet-fg);
  background-color: var(--sheet-fg);
  color: #ffffff;
}

.modal07__label {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal07__hint {
  font-size: 0.75rem;
  line-height: 1rem;
  font-variant-numeric: tabular-nums;
  color: var(--sheet-muted);
}

.modal07__footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-top: 1px solid var(--sheet-line);
  padding: 1rem 1.25rem;
}

.modal07__clear {
  height: 2.5rem;
  border-radius: 0.5rem;
  padding: 0 0.75rem;
  background: transparent;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: var(--sheet-muted);
}

.modal07__apply {
  height: 2.5rem;
  flex: 1;
  border-radius: 0.5rem;
  padding: 0 1rem;
  background-color: var(--sheet-fg);
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
}

.modal07__apply:hover {
  background-color: oklch(0.3 0 0);
}

.modal07__close:focus-visible,
.modal07__clear:focus-visible,
.modal07__apply:focus-visible,
.modal07__pill input:focus-visible + span,
.modal07__check input:focus-visible + .modal07__box {
  outline: 2px solid var(--sheet-fg);
  outline-offset: 2px;
}

@keyframes modal07-fade-in {
  from {
    opacity: 0;
  }
}

@keyframes modal07-fade-out {
  to {
    opacity: 0;
  }
}

@keyframes modal07-rise {
  from {
    transform: translateY(100%);
  }
  to {
    transform: none;
  }
}

@keyframes modal07-sink {
  to {
    transform: translateY(100%);
  }
}

@keyframes modal07-slide-in {
  from {
    transform: translateX(calc(100% + 1rem));
  }
  to {
    transform: none;
  }
}

@keyframes modal07-slide-out {
  to {
    transform: translateX(calc(100% + 1rem));
  }
}

/* …and a side sheet slides in from the right on wider screens. */
@media (min-width: 40rem) {
  .modal07__panel {
    top: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    left: auto;
    width: 24rem;
    max-height: none;
    border-radius: 1rem;
    box-shadow: 0 24px 70px -24px rgba(0, 0, 0, 0.35);
    animation-name: modal07-slide-in;
  }
  .modal07[data-state="closing"] .modal07__panel {
    animation-name: modal07-slide-out;
  }
  .modal07__handle {
    display: none;
  }
  .modal07__header {
    padding: 1.25rem 1.5rem 1rem;
  }
  .modal07__body {
    padding: 0 1.5rem;
  }
  .modal07__footer {
    padding: 1rem 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .modal07__panel {
    animation-name: modal07-fade-in;
    animation-duration: 120ms;
  }
  .modal07[data-state="closing"] .modal07__panel {
    animation-name: modal07-fade-out;
  }
}

/*
  Page layout — the canvas this resource is presented on. Adjust or drop it
  when placing the resource inside your own layout.
*/

*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  margin: 0;
  line-height: 1.5;
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(to bottom, #fafafa, #f4f4f5);
}
p {
  margin: 0;
}
.modal07-layout {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.5rem;
}
.modal07-layout__app {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: 60rem;
  height: 40rem;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 1rem;
  background: #ffffff;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 18px 44px -20px rgba(0, 0, 0, 0.18);
  transform: translateZ(0);
}
.modal07-layout__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 1px solid oklch(0.97 0 0);
  padding: 0.875rem 1.5rem;
}
.modal07-layout__heading {
  min-width: 0;
}
.modal07-layout__name {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  color: oklch(0.205 0 0);
}
.modal07-layout__small {
  font-size: 0.75rem;
  line-height: 1rem;
  font-variant-numeric: tabular-nums;
  color: oklch(0.556 0 0);
}
.modal07-layout__filters {
  display: flex;
  height: 2.25rem;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid oklch(0.922 0 0);
  border-radius: 0.5rem;
  background: #ffffff;
  padding: 0 0.75rem;
  font-family: inherit;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: oklch(0.371 0 0);
  cursor: pointer;
  outline: none;
  transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
.modal07-layout__filters:hover {
  background: oklch(0.985 0 0);
}
.modal07-layout__filters:focus-visible {
  outline: 2px solid oklch(0.205 0 0);
  outline-offset: 2px;
}
.modal07-layout__filters svg {
  display: block;
  width: 1rem;
  height: 1rem;
}
.modal07-layout__badge {
  border-radius: 9999px;
  background: oklch(0.205 0 0);
  padding: 0 0.375rem;
  font-size: 11px;
  line-height: 1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
}
.modal07-layout__badge[hidden] {
  display: none;
}
.modal07-layout__list {
  margin: 0;
  padding: 0 1.5rem;
  list-style: none;
}
.modal07-layout__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0;
}
.modal07-layout__row + .modal07-layout__row {
  border-top: 1px solid oklch(0.97 0 0);
}
.modal07-layout__project {
  min-width: 0;
}
.modal07-layout__project p:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: oklch(0.205 0 0);
}
.modal07-layout__status {
  flex-shrink: 0;
  border-radius: 9999px;
  background: oklch(0.97 0 0);
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  line-height: 1rem;
  color: oklch(0.439 0 0);
}
@media (min-width: 40rem) {
  .modal07-layout__app {
    height: 30rem;
  }
}
