:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --text: #1c1917;
  --muted: #78716c;
  --line: #e7e5e4;
  --brand: #059669;
  --brand-dark: #047857;
  --space-1: 6px;
  --space-2: 10px;
  --space-3: 14px;
  --space-4: 18px;
  --space-5: 24px;
  --radius-pill: 999px;
  --radius-card: 20px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: 'Poppins', system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.45;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: #fff;
  color: #1c1917;
  padding: 8px 10px;
  border-radius: 8px;
}

.skip-link:focus {
  left: 10px;
  top: 10px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, #fff 82%, transparent);
  backdrop-filter: blur(14px);
  padding-bottom: var(--space-5);
}

.topbar-inner,
.content {
  max-width: 1180px;
  margin: 0 auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

.topbar-inner {
  padding-top: var(--space-5);
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-icon {
  width: 20px;
  height: 20px;
}

.brand-text {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-align: center;
}

.filter-toggle-btn {
  display: none;
}

.search-shell {
  margin: var(--space-4) auto 0;
  max-width: 820px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: var(--space-1);
  display: flex;
  align-items: center;
  gap: var(--space-1);
  box-shadow: 0 1px 3px rgba(28, 25, 23, 0.08);
  transition: box-shadow 0.3s ease-out;
}

.search-shell:hover {
  box-shadow: 0 8px 18px rgba(28, 25, 23, 0.12);
}

.search-field {
  flex: 1;
  min-width: 0;
  padding: var(--space-1) var(--space-2);
}

.search-field + .search-field {
  border-left: 1px solid #f0edeb;
}

.search-label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 400;
  color: #a8a29e;
}

#search-input,
#date-filter {
  border: 0;
  background: transparent;
  padding: 2px 0;
  width: 100%;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 400;
  color: #292524;
}

#category-filter {
  width: 100%;
}

#district-filter {
  width: 100%;
}

#search-input:focus-visible,
#date-filter:focus-visible {
  outline: none;
}

#category-filter:focus-visible {
  outline: none;
}

#district-filter:focus-visible {
  outline: none;
}

.custom-select {
  position: relative;
  width: 100%;
}

.custom-trigger {
  width: 100%;
  border: 0;
  background: #fff;
  color: #292524;
  border-radius: 10px;
  min-height: 30px;
  padding: 2px 10px 2px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 400;
  cursor: pointer;
}

.custom-trigger-inner {
  display: inline-flex;
  align-items: center;
  gap: 0;
  min-width: 0;
}

.custom-chevron {
  color: #9c948a;
  font-size: 12px;
  line-height: 1;
}

.custom-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 115%;
  z-index: 80;
  background: #fff;
  border: 1px solid #e7e5e4;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(28, 25, 23, 0.12);
  max-height: 260px;
  overflow: auto;
  padding: 6px;
}

.custom-option {
  width: 100%;
  border: 0;
  background: transparent;
  color: #292524;
  border-radius: 8px;
  padding: 8px 10px;
  text-align: left;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}

.custom-option:hover {
  background: #f7f6f4;
}

.custom-option.is-selected {
  background: #ecfdf5;
  color: #065f46;
}

.search-btn {
  border: 0;
  border-radius: var(--radius-pill);
  width: 40px;
  height: 40px;
  margin-left: var(--space-1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease-out;
}

.search-btn:hover {
  background: var(--brand-dark);
  transform: scale(1.05);
}

.search-btn-icon {
  width: 18px;
  height: 18px;
}

.clear-btn {
  border: 1px solid #e7e5e4;
  background: #fff;
  color: #57534e;
  border-radius: var(--radius-pill);
  height: 40px;
  margin-left: var(--space-1);
  padding: 0 var(--space-3);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.25s ease-out;
}

.clear-btn:hover {
  border-color: #d6d3d1;
  background: #fafaf9;
}

.content {
  padding-top: var(--space-4);
  padding-bottom: 44px;
}

.site-footer {
  background: #fff;
  border-top: 1px solid #e7e5e4;
  margin-top: var(--space-5);
  padding: calc(var(--space-4) * 2) 0;
}

.site-footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

.site-footer p {
  margin: 0;
  font-size: 0.7rem;
  color: #78716c;
  text-align: center;
}

.site-footer a {
  color: inherit;
  text-decoration: underline;
}

.noscript-note {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--space-4) var(--space-4);
  color: #57534e;
  font-size: 0.78rem;
  text-align: center;
}

.filter-breadcrumbs {
  margin: 0 0 var(--space-3);
  padding: var(--space-2) 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #1c1917;
  font-weight: 600;
}

.filter-breadcrumbs::after {
  content: '';
  flex: 1;
  border-top: 4px solid #000;
  transform: translateY(1px);
}

.featured-section {
  margin-bottom: var(--space-3);
  padding: var(--space-2) 0;
}

.featured-title {
  margin: 0 0 var(--space-3);
  padding: var(--space-2) 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 600;
  color: #1c1917;
}

.featured-title::after {
  content: '';
  flex: 1;
  border-top: 4px solid #000;
  transform: translateY(1px);
}

.cups-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.cup-card {
  display: flex;
  flex-direction: row;
  gap: var(--space-4);
  background: #ecfdf5;
  border: 0;
  border-radius: var(--radius-card);
  padding: var(--space-4);
  box-shadow: 0 1px 3px rgba(28, 25, 23, 0.09);
  transition: all 0.3s ease-out;
}

.cup-card.accent-green {
  background: rgba(16, 185, 129, 0.08);
}

.cup-card.accent-blue {
  background: rgba(59, 130, 246, 0.08);
}

.cup-card.accent-amber {
  background: rgba(245, 158, 11, 0.1);
}

.cup-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(28, 25, 23, 0.12);
}

.cup-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.cup-title {
  margin: 0;
  font-size: clamp(1.1rem, 1rem + 0.6vw, 1.35rem);
  line-height: 1.28;
  letter-spacing: -0.01em;
}

.cup-subtitle {
  margin: var(--space-1) 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 400;
}

.cup-description {
  margin: var(--space-2) 0 var(--space-2);
  color: #57534e;
  font-size: 0.82rem;
  line-height: 1.5;
  max-width: 72ch;
}

.meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: color-mix(in srgb, #fff 84%, transparent);
  border: 1px solid #e7e5e4;
  border-radius: var(--radius-pill);
  padding: 7px 10px;
  font-size: 0.75rem;
  font-weight: 400;
  color: #44403c;
}

.meta-pill-plain {
  background: transparent;
  border: 0;
  padding: 0;
}

.icon {
  width: 14px;
  height: 14px;
  color: var(--brand);
  flex-shrink: 0;
}

.cup-action {
  min-width: 190px;
  border-left: 1px solid #e7e5e4;
  padding-left: var(--space-3);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-3);
}

.action-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.action-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.deadline-label {
  margin: 0;
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #a8a29e;
  font-weight: 400;
}

.deadline-value {
  margin: 0;
  font-size: 0.95rem;
  color: #292524;
  font-weight: 600;
}

.action-value {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: #57534e;
  font-weight: 400;
}

.action-categories {
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.35;
  color: #292524;
  font-weight: 600;
}

.register-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--brand);
  color: #fff;
  border-radius: var(--radius-pill);
  padding: 9px 14px;
  font-size: 0.78rem;
  font-weight: 400;
  transition: all 0.3s ease-out;
}

.register-link .icon {
  color: #fff;
}

.register-link:hover {
  background: var(--brand-dark);
  transform: scale(1.05);
}

.state {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: var(--space-5);
  text-align: center;
}

.state-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 50vh;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #b7e4d3;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 900px) {
  .cups-grid {
    grid-template-columns: 1fr;
  }
  .cup-card {
    flex-direction: column;
  }
  .cup-action {
    min-width: 0;
    border-left: 0;
    border-top: 1px solid #e7e5e4;
    padding-left: 0;
    padding-top: var(--space-2);
  }
}

@media (max-width: 720px) {
  .filter-toggle-btn {
    display: inline-flex;
    width: 100%;
    justify-content: center;
    align-items: center;
    height: 40px;
    margin-top: var(--space-3);
    border: 1px solid #e7e5e4;
    border-radius: 14px;
    background: #fff;
    color: #57534e;
    font: inherit;
    font-size: 0.8rem;
    cursor: pointer;
  }
  .search-shell.is-collapsed {
    display: none;
  }
  .search-shell {
    border-radius: 24px;
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
  }
  .search-field + .search-field {
    border-left: 0;
    border-top: 1px solid #f0edeb;
    padding-top: 10px;
  }
  .search-btn {
    width: 100%;
    border-radius: 14px;
  }
  .clear-btn {
    width: 100%;
    border-radius: 14px;
    height: 42px;
  }
}
