:root {
  --ink: #364348;
  --muted: #718087;
  --green: #527b72;
  --green-dark: #3e645c;
  --mint: #e9f2ed;
  --cream: #fffaf1;
  --paper: #ffffff;
  --line: #e8e1d5;
  --gold: #d09b3f;
  --gold-soft: #fff1c6;
  --peach: #ffe8d8;
  --shadow: 0 12px 32px rgba(77, 61, 47, 0.08);
}

* { box-sizing: border-box; }

html { background: var(--cream); }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 92% 4%, rgba(255, 225, 190, 0.32), transparent 24rem),
    var(--cream);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  line-height: 1.6;
}

button, input, select { font: inherit; }
button { cursor: pointer; }

.page-shell { width: min(100% - 32px, 960px); margin: 0 auto; }

.hero {
  border-bottom: 1px solid #dce9df;
  background: linear-gradient(135deg, #eef7f0, #e8f1ed 62%, #fff4e4);
  padding: 34px 0 30px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 5px; font-size: clamp(27px, 6vw, 40px); letter-spacing: -0.03em; }
h2 { margin-bottom: 0; font-size: clamp(20px, 4vw, 27px); letter-spacing: -0.02em; }
h3 { font-size: 18px; line-height: 1.35; }

.hero-copy { margin: 0; color: var(--green-dark); font-size: 16px; font-weight: 700; }
.hero-note { margin: 7px 0 0; color: #74867f; font-size: 12px; }

.intro {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 22px 0 16px;
  padding: 16px 18px;
  border: 1px solid #efdfc7;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  color: #5e6a69;
  font-size: 13px;
}
.intro p { margin: 0; }
.intro-bird { display: inline-block; color: var(--gold); font-size: 32px; line-height: 0.8; transform: rotate(-35deg); }

.search-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.section-heading, .results-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; }
.quick-filters { display: flex; gap: 8px; overflow-x: auto; margin: 17px 0 14px; padding-bottom: 2px; }
.quick-filter, .button { border: 1px solid transparent; border-radius: 999px; padding: 9px 14px; font-weight: 700; }
.quick-filter { flex: 0 0 auto; border-color: #efdca7; background: #fff8df; color: #765e27; font-size: 13px; }
.quick-filter[aria-pressed="true"] { border-color: var(--gold); background: var(--gold); color: white; }
.button { background: var(--green); color: white; }
.button:hover, .button:focus-visible { background: var(--green-dark); }
.button--quiet { border-color: #d9e5de; background: #f4f8f5; color: var(--green-dark); font-size: 12px; }

.keyword-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 11px; align-items: end; margin-bottom: 11px; }
.search-button { min-height: 42px; padding-inline: 22px; }
.search-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; }
.field { display: grid; gap: 4px; min-width: 0; }
.field--wide { grid-column: span 2; }
.field span { color: var(--muted); font-size: 11px; font-weight: 700; }
.field input, .field select {
  width: 100%; min-height: 42px; padding: 8px 10px;
  border: 1px solid #d9d2c5; border-radius: 11px; background: #fff; color: var(--ink); font-size: 13px;
}
.field input:focus, .field select:focus { outline: 3px solid rgba(82, 123, 114, 0.16); border-color: var(--green); }
.search-hint { margin: 12px 0 0; color: var(--muted); font-size: 11px; }

.results { padding: 30px 0 48px; }
.result-summary { margin: 0; color: var(--muted); font-size: 12px; }
.event-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; margin-top: 15px; }
.event-card {
  display: flex; flex-direction: column; min-width: 0; padding: 17px;
  border: 1px solid var(--line); border-radius: 18px; background: var(--paper); box-shadow: 0 5px 20px rgba(77, 61, 47, 0.05);
}
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.event-date { color: var(--green); font-size: 14px; font-weight: 800; }
.event-card h3 { margin: 9px 0 8px; }
.event-title { display: inline; padding: 0; border: 0; background: transparent; color: var(--ink); text-align: left; font-weight: 800; }
.event-title:hover, .event-title:focus-visible { color: var(--green-dark); text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 3px; text-underline-offset: 3px; }
.location { min-height: 2.9em; margin-bottom: 9px; color: #5f6c6c; font-size: 12px; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 13px; }
.tag, .status-badge { display: inline-flex; align-items: center; min-height: 23px; padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; }
.tag { background: #edf4ef; color: var(--green-dark); }
.status-badge { background: var(--green); color: white; }
.status-badge--provisional { background: var(--gold-soft); color: #755c22; }
.status-badge--ongoing { background: var(--peach); color: #9b5d37; }
.status-badge--ended { background: #eff0ef; color: #737978; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: auto 0 13px; font-size: 12px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px solid #f0ebe2; }
.checked { color: var(--muted); font-size: 10px; }
.detail-button { padding: 5px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--green-dark); font-size: 12px; font-weight: 800; }
.detail-button:hover, .detail-button:focus-visible { background: var(--mint); }

.state-message { grid-column: 1 / -1; margin: 0; padding: 30px 18px; border: 1px dashed #cfc5b6; border-radius: 16px; background: rgba(255,255,255,.65); color: var(--muted); text-align: center; font-size: 13px; }
.footer { padding: 0 0 30px; color: var(--muted); font-size: 10px; text-align: center; }

.detail-dialog { width: min(680px, calc(100% - 24px)); max-height: min(88vh, 760px); padding: 20px; border: 0; border-radius: 22px; color: var(--ink); box-shadow: 0 24px 80px rgba(43, 38, 30, .25); }
.detail-dialog::backdrop { background: rgba(46, 55, 52, .35); backdrop-filter: blur(2px); }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.icon-button { width: 34px; height: 34px; border: 0; border-radius: 50%; background: #f2f4f1; color: var(--ink); font-size: 24px; line-height: 1; }
.detail-dialog h2 { margin: 0 0 8px; font-size: 24px; }
.detail-date { color: var(--green); font-weight: 800; }
.detail-section { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.detail-section h3 { margin-bottom: 8px; font-size: 13px; color: var(--green-dark); }
.detail-list { display: grid; grid-template-columns: 8em 1fr; gap: 6px 10px; margin: 0; font-size: 13px; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; overflow-wrap: anywhere; }
.detail-note { margin: 0; padding: 10px 12px; border-radius: 12px; background: #fff7df; color: #6e592c; font-size: 12px; }
.source-links { display: grid; gap: 7px; }
.source-links a { color: var(--green-dark); font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.no-script { margin: 20px; padding: 14px; border-radius: 10px; background: var(--gold-soft); }

@media (max-width: 720px) {
  .page-shell { width: min(100% - 24px, 600px); }
  .hero { padding: 27px 0 24px; }
  .search-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field--wide { grid-column: span 2; }
  .event-list { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
  .page-shell { width: min(100% - 20px, 600px); }
  .search-panel { padding: 14px; border-radius: 18px; }
  .section-heading { align-items: center; }
  .keyword-search { grid-template-columns: 1fr; }
  .search-button { width: 100%; }
  .search-grid { gap: 9px; }
  .field input, .field select { min-height: 40px; padding-inline: 8px; font-size: 12px; }
  .event-card { padding: 14px; }
  .detail-list { grid-template-columns: 6.5em 1fr; }
}
