:root {
  color-scheme: light;
  --hp-bg: #f5f6f2;
  --hp-surface: #ffffff;
  --hp-surface-soft: #eef3ee;
  --hp-line: #d9dfd7;
  --hp-text: #17201b;
  --hp-text-soft: #5a665f;
  --hp-text-faint: #7a857e;
  --hp-primary: #1f6f54;
  --hp-primary-dark: #174f3e;
  --hp-blue: #365c8f;
  --hp-red: #9f422b;
  --hp-amber: #94630c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--hp-bg);
  color: var(--hp-text);
  font-family:
    Pretendard,
    'Noto Sans KR',
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.hp-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 28px 18px 40px;
}

.hp-header {
  position: relative;
  min-height: 94px;
  padding-right: 142px;
  margin-bottom: 22px;
}

.hp-title-group {
  display: grid;
  gap: 0;
  min-width: 0;
}

.hp-notification-layer {
  position: absolute;
  top: 14px;
  right: 0;
  display: flex;
  width: 124px;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.hp-brand {
  margin: 0;
  color: var(--hp-primary);
  font-size: 14px;
  font-weight: 700;
}

.hp-title {
  margin: 6px 0 0;
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: 0;
}

.hp-meta {
  margin: 8px 0 0;
  color: var(--hp-text-soft);
  font-size: 14px;
  line-height: 1.6;
}

.hp-notification-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--hp-line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--hp-text);
  cursor: pointer;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.hp-notification-button:hover {
  border-color: var(--hp-primary);
  color: var(--hp-primary-dark);
}

.hp-notification-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.hp-notification-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--hp-text-faint);
}

.hp-notification-button[data-state='enabled'] .hp-notification-dot {
  background: var(--hp-primary);
}

.hp-notification-button[data-state='blocked'] .hp-notification-dot,
.hp-notification-button[data-state='unsupported'] .hp-notification-dot {
  background: var(--hp-red);
}

.hp-notification-button[data-state='pending'] .hp-notification-dot {
  background: var(--hp-amber);
}

.hp-notification-status {
  margin: 0;
  color: var(--hp-text-faint);
  font-size: 12px;
  line-height: 1.3;
  font-weight: 700;
  text-align: right;
}

.hp-panel {
  border: 1px solid var(--hp-line);
  border-radius: 8px;
  background: var(--hp-surface);
  box-shadow: 0 16px 36px rgba(23, 32, 27, 0.06);
}

.hp-filter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
  padding: 16px;
}

.hp-filter-label {
  display: block;
  margin: 0 0 8px;
  color: var(--hp-text-soft);
  font-size: 13px;
  font-weight: 700;
}

.hp-region-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.hp-region-option {
  min-width: 0;
}

.hp-region-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.hp-region-option span {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--hp-line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--hp-text-soft);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.hp-region-option input:checked + span {
  border-color: var(--hp-primary);
  background: var(--hp-primary);
  color: #ffffff;
}

.hp-filter-actions {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.hp-closed-toggle {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--hp-line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--hp-text-soft);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.hp-closed-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--hp-primary);
}

.hp-submit {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--hp-text);
  color: #ffffff;
  cursor: pointer;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 800;
}

.hp-submit:hover {
  background: var(--hp-primary-dark);
}

.hp-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.hp-summary-item {
  min-height: 76px;
  border: 1px solid var(--hp-line);
  border-radius: 8px;
  background: var(--hp-surface);
  padding: 12px;
}

.hp-summary-name {
  margin: 0;
  color: var(--hp-text-soft);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.hp-summary-count {
  margin: 8px 0 0;
  font-size: 22px;
  line-height: 1;
  font-weight: 800;
}

.hp-error {
  margin-top: 12px;
  border: 1px solid #e8c8bd;
  border-radius: 8px;
  background: #fff7f3;
  color: var(--hp-red);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.65;
}

.hp-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 28px 0 12px;
}

.hp-section-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
}

.hp-count {
  color: var(--hp-text-faint);
  font-size: 14px;
  font-weight: 700;
}

.hp-list {
  display: grid;
  gap: 10px;
}

.hp-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  border: 1px solid var(--hp-line);
  border-radius: 8px;
  background: var(--hp-surface);
  padding: 16px;
}

.hp-card-main {
  min-width: 0;
}

.hp-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.hp-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  background: var(--hp-surface-soft);
  color: var(--hp-text-soft);
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
}

.hp-status-open {
  background: #e9f7ef;
  color: var(--hp-primary-dark);
}

.hp-status-upcoming {
  background: #eef3ff;
  color: var(--hp-blue);
}

.hp-status-closed {
  background: #fff3df;
  color: var(--hp-amber);
}

.hp-card-title {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 800;
}

.hp-address {
  margin: 8px 0 0;
  color: var(--hp-text-soft);
  font-size: 14px;
  line-height: 1.55;
}

.hp-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.hp-fact-label {
  margin: 0;
  color: var(--hp-text-faint);
  font-size: 12px;
  line-height: 1.3;
  font-weight: 700;
}

.hp-fact-value {
  margin: 4px 0 0;
  color: var(--hp-text);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.hp-card-side {
  display: flex;
  min-width: 124px;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.hp-households {
  margin: 0;
  color: var(--hp-text);
  font-size: 18px;
  font-weight: 800;
}

.hp-card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

.hp-link {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--hp-primary);
  color: #ffffff;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

button.hp-link {
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

.hp-link-secondary {
  border: 1px solid var(--hp-line);
  background: #ffffff;
  color: var(--hp-text);
}

.hp-detail-modal-backdrop {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 19, 0.42);
  padding: 18px;
}

.hp-detail-modal-backdrop[hidden] {
  display: none;
}

.hp-modal-open {
  overflow: hidden;
}

.hp-detail-modal {
  width: min(720px, 100%);
  max-height: min(780px, calc(100vh - 36px));
  overflow: hidden;
  border: 1px solid var(--hp-line);
  border-radius: 8px;
  background: var(--hp-bg);
  box-shadow: 0 22px 60px rgba(15, 23, 19, 0.28);
}

.hp-detail-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--hp-line);
  background: #ffffff;
  padding: 16px;
}

.hp-detail-modal-kicker {
  margin: 0;
  color: var(--hp-primary-dark);
  font-size: 12px;
  font-weight: 800;
}

.hp-detail-modal-title {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  font-size: 19px;
  line-height: 1.35;
  font-weight: 800;
}

.hp-detail-modal-close {
  display: inline-flex;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--hp-line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--hp-text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.hp-detail-modal-body {
  max-height: calc(min(780px, 100vh - 36px) - 80px);
  overflow: auto;
  padding: 14px 16px 18px;
}

.hp-detail-modal-status {
  margin: 0;
  border: 1px dashed var(--hp-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 22px 14px;
  color: var(--hp-text-soft);
  font-size: 14px;
  line-height: 1.7;
  text-align: center;
}

.hp-detail-section {
  border: 1px solid var(--hp-line);
  border-radius: 8px;
  background: var(--hp-surface);
  padding: 13px;
}

.hp-detail-section + .hp-detail-section {
  margin-top: 10px;
}

.hp-detail-section h3 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 800;
}

.hp-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.hp-detail-grid > div {
  min-width: 0;
}

.hp-detail-grid dt {
  margin: 0;
  color: var(--hp-text-faint);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.hp-detail-grid dd {
  margin: 4px 0 0;
  color: var(--hp-text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.hp-detail-grid a {
  color: var(--hp-primary-dark);
}

.hp-detail-content {
  max-height: 220px;
  overflow: auto;
  margin: 0;
  color: var(--hp-text-soft);
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-line;
}

.hp-empty {
  border: 1px dashed var(--hp-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 30px 18px;
  color: var(--hp-text-soft);
  font-size: 14px;
  line-height: 1.7;
  text-align: center;
}

@media (max-width: 780px) {
  .hp-filter,
  .hp-card {
    grid-template-columns: 1fr;
  }

  .hp-header {
    min-height: 94px;
    padding-right: 116px;
    margin-bottom: 14px;
  }

  .hp-notification-layer {
    top: 12px;
    width: 104px;
  }

  .hp-notification-status {
    text-align: right;
  }

  .hp-filter-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 76px;
    align-items: stretch;
    gap: 8px;
  }

  .hp-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hp-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hp-card-side {
    min-width: 0;
    align-items: stretch;
  }

  .hp-card-actions {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    justify-content: flex-end;
  }

  .hp-households {
    font-size: 16px;
  }

  .hp-submit,
  .hp-closed-toggle,
  .hp-link {
    justify-content: center;
  }

  .hp-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .hp-shell {
    padding: 18px 12px 28px;
  }

  .hp-brand {
    font-size: 13px;
  }

  .hp-title {
    max-width: 238px;
    margin-top: 4px;
    font-size: 27px;
    line-height: 1.12;
  }

  .hp-meta {
    margin-top: 7px;
    font-size: 13px;
    line-height: 1.5;
  }

  .hp-notification-button {
    min-height: 34px;
    padding: 0 10px;
    font-size: 12px;
  }

  .hp-notification-status {
    font-size: 11px;
  }

  .hp-panel {
    box-shadow: 0 10px 22px rgba(23, 32, 27, 0.05);
  }

  .hp-filter {
    gap: 10px;
    padding: 12px;
  }

  .hp-filter-label {
    margin-bottom: 6px;
    font-size: 12px;
  }

  .hp-region-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .hp-region-option span {
    min-height: 38px;
    padding: 0 4px;
    font-size: 13px;
  }

  .hp-closed-toggle,
  .hp-submit {
    min-height: 38px;
  }

  .hp-closed-toggle {
    padding: 0 10px;
    font-size: 12px;
  }

  .hp-closed-toggle input {
    width: 15px;
    height: 15px;
  }

  .hp-submit {
    padding: 0 12px;
    font-size: 13px;
  }

  .hp-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 10px;
  }

  .hp-summary-item {
    min-height: 58px;
    padding: 9px 8px;
  }

  .hp-summary-name {
    font-size: 11px;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .hp-summary-count {
    margin-top: 5px;
    font-size: 20px;
  }

  .hp-list-header {
    margin: 20px 0 9px;
  }

  .hp-section-title {
    font-size: 18px;
  }

  .hp-card {
    gap: 12px;
    padding: 12px;
  }

  .hp-detail-modal-backdrop {
    align-items: flex-end;
    padding: 10px;
  }

  .hp-detail-modal {
    max-height: calc(100vh - 20px);
  }

  .hp-detail-modal-header {
    padding: 13px;
  }

  .hp-detail-modal-title {
    font-size: 17px;
  }

  .hp-detail-modal-body {
    max-height: calc(100vh - 98px);
    padding: 12px;
  }

  .hp-badges {
    gap: 5px;
    margin-bottom: 8px;
  }

  .hp-badge {
    min-height: 22px;
    padding: 0 8px;
    font-size: 11px;
  }

  .hp-card-title {
    font-size: 16px;
    line-height: 1.35;
  }

  .hp-address {
    display: -webkit-box;
    overflow: hidden;
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .hp-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
  }

  .hp-fact-label {
    font-size: 11px;
  }

  .hp-fact-value {
    font-size: 12px;
    line-height: 1.35;
  }

  .hp-card-side {
    flex-direction: row;
    align-items: center;
  }

  .hp-card-actions:has(.hp-link-secondary) {
    flex-direction: row;
  }

  .hp-households {
    font-size: 15px;
  }

  .hp-link {
    min-height: 34px;
    padding: 0 11px;
    font-size: 12px;
  }

  .hp-card-actions {
    gap: 6px;
  }

  .hp-empty {
    padding: 22px 14px;
    font-size: 13px;
  }
}
