:root {
  color: var(--brand-ink);
  background: var(--canvas);
  font-family: Pretendard, system-ui, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding-bottom: 144px;
  background:
    radial-gradient(
      circle at 92% 4%,
      var(--brand-lime) 0 92px,
      transparent 93px
    ),
    var(--canvas);
}

a {
  color: inherit;
}

a[href],
button:not(:disabled),
select:not(:disabled),
input[type='submit']:not(:disabled),
input[type='button']:not(:disabled),
input[type='radio']:not(:disabled),
input[type='checkbox']:not(:disabled) {
  cursor: pointer;
}

button:disabled,
select:disabled,
input:disabled,
.calendar-day.is-unavailable {
  cursor: not-allowed;
}

.shell {
  width: min(100% - 32px, 1080px);
  margin: 0 auto;
  padding: 24px 0 48px;
}

.hero {
  padding: 64px 0 36px;
}

.eyebrow {
  color: var(--brand-teal);
  font-size: var(--text-xs);
  font-weight: 900;
  letter-spacing: 0.18em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 20px;
  font-size: var(--text-display);
  line-height: 1.04;
  letter-spacing: var(--tracking-tight);
}

h2 {
  margin-top: 32px;
}

.airport-grid,
.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.metric-grid article {
  display: flex;
  min-height: 120px;
  padding: 22px;
  border: 2px solid var(--brand-ink);
  border-radius: var(--r-organic);
  background: var(--surface);
  box-shadow: var(--shadow-hard-md);
  text-decoration: none;
  flex-direction: column;
  justify-content: space-between;
}

.airport-card {
  min-height: 120px;
  flex-direction: column;
  justify-content: space-between;
}

.airport-card strong {
  font-size: var(--text-xl);
}

.airport-card span,
.metric-grid span {
  color: var(--sub);
}

main[aria-labelledby] {
  margin-top: 48px;
  padding: 28px;
  border: 2px solid var(--brand-ink);
  border-radius: var(--r-organic-lg);
  background: var(--surface);
  box-shadow: var(--shadow-hard-md);
}

main[aria-labelledby] h1 {
  font-size: clamp(34px, 6vw, 56px);
}

form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 28px 0;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 12px 14px;
  font: inherit;
}

select {
  appearance: auto;
}

.arrival-calendar {
  min-width: 0;
  margin: 0;
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--r-organic);
  grid-column: 1 / -1;
}

.arrival-calendar legend {
  padding: 0 var(--space-2);
  font-weight: 900;
}

.calendar-help {
  margin-bottom: var(--space-4);
  color: var(--sub);
  font-size: var(--text-sm);
}

.calendar-months {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: var(--space-5);
}

.calendar-month {
  min-width: 0;
}

.calendar-month h2 {
  margin: 0 0 var(--space-3);
  font-size: var(--text-lg);
}

.calendar-weekdays,
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.calendar-weekdays {
  margin-bottom: 4px;
  color: var(--sub);
  font-size: var(--text-xs);
  font-weight: 800;
  text-align: center;
}

.calendar-day-input {
  position: absolute;
  width: 1px;
  min-height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.calendar-day {
  display: grid;
  min-width: 0;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  place-items: center;
  font-size: var(--text-sm);
  font-weight: 800;
}

.calendar-day.is-available {
  cursor: pointer;
}

.calendar-day.is-available:hover {
  border-color: var(--brand-teal);
  background: var(--neutral-100);
}

.calendar-day.is-unavailable {
  border-color: transparent;
  color: var(--muted);
  text-decoration: line-through;
}

.calendar-day-input:checked + .calendar-day {
  border-color: var(--brand-ink);
  background: var(--brand-lime);
  box-shadow: var(--shadow-hard-sm);
}

.calendar-day-input:focus-visible + .calendar-day {
  outline: 3px solid var(--brand-teal);
  outline-offset: 2px;
}

label span,
.query-note,
.query-notice {
  color: var(--sub);
}

.query-notice {
  font-weight: 800;
}

section[aria-live] {
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

.arrival-overview {
  min-width: 0;
  margin-top: var(--space-6);
}

.grade-basis,
.selected-arrival-range,
.busiest-hour {
  padding: var(--space-3) var(--space-4);
  border-left: 4px solid var(--brand-teal);
  background: var(--neutral-100);
  color: var(--sub);
}

.seat-window,
.delay-scenarios,
.arrival-list {
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--line);
}

.seat-window-value {
  font-size: var(--text-xl);
  font-weight: 900;
}

.seat-window ul,
.delay-scenarios ul,
.arrival-list ul {
  padding-left: var(--space-5);
}

.delay-scenarios article {
  margin-top: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--r-organic);
}

.delay-scenarios h3 {
  margin-top: 0;
}

.arrival-hour-filter {
  max-width: 280px;
  margin-bottom: var(--space-4);
}

.arrival-table-wrap {
  width: 100%;
  min-width: 0;
}

.arrival-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: var(--text-sm);
}

.arrival-table th,
.arrival-table td {
  padding: var(--space-3) var(--space-2);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: normal;
  overflow-wrap: anywhere;
}

.arrival-table th {
  color: var(--sub);
  font-size: var(--text-xs);
}

.arrival-table .pill {
  margin: 0;
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  white-space: nowrap;
}

.arrival-table .selected-flight td {
  background: var(--neutral-100);
}

.arrival-table .selected-flight td:first-child {
  border-left: 4px solid var(--brand-teal);
}

.my-flight-label {
  display: block;
  margin-top: var(--space-1);
  color: var(--brand-teal);
  font-size: var(--text-xs);
  font-weight: 900;
}

.seat-exclusion-note {
  margin-top: var(--space-3);
  color: var(--sub);
  font-size: var(--text-sm);
}

.fixed-fasttrack-cta {
  position: fixed;
  z-index: 10;
  right: var(--space-4);
  bottom: var(--space-4);
  left: var(--space-4);
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.fixed-fasttrack-cta-link {
  width: min(100%, 680px);
  padding: var(--space-4) var(--space-6);
  border: 2px solid var(--brand-ink);
  border-radius: var(--r-round);
  background: var(--accent-cta);
  box-shadow: var(--shadow-hard-lg);
  color: var(--ink);
  font-size: var(--text-lg);
  font-weight: 900;
  text-align: center;
  text-decoration: none;
  pointer-events: auto;
}

.fixed-fasttrack-cta-link:focus-visible {
  outline: 3px solid var(--brand-teal);
  outline-offset: 4px;
}

.document,
.admin {
  margin-top: 48px;
  padding: clamp(24px, 6vw, 56px);
  border-radius: 28px;
  background: var(--surface);
}

.document h1,
.admin h1 {
  font-size: clamp(36px, 7vw, 64px);
}

.metric-grid {
  grid-template-columns: repeat(3, 1fr);
}

.metric-grid article {
  min-height: 100px;
  box-shadow: none;
}

.metric-grid strong {
  font-size: 28px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

@media (min-width: 681px) {
  .arrival-table .flight-aircraft {
    overflow-wrap: normal;
  }

  .flight-aircraft .aircraft-name,
  .flight-aircraft .aircraft-seats {
    display: inline-block;
    white-space: nowrap;
  }
}

@media (max-width: 680px) {
  body {
    background:
      radial-gradient(
        circle at 105% 0,
        var(--brand-lime) 0 70px,
        transparent 71px
      ),
      var(--canvas);
  }

  .shell {
    width: min(100% - 24px, 1080px);
    padding-top: 18px;
  }

  .hero {
    padding-top: 48px;
  }

  .airport-grid,
  .metric-grid,
  form {
    grid-template-columns: 1fr;
  }

  .airport-card {
    min-height: 104px;
  }

  main[aria-labelledby] {
    margin-top: 34px;
    padding: 20px;
  }

  main[aria-labelledby] h1 {
    overflow-wrap: anywhere;
    font-size: clamp(30px, 10vw, 40px);
  }

  form > * {
    min-width: 0;
  }

  .arrival-calendar {
    width: 100%;
    padding: var(--space-3);
  }

  .calendar-months {
    grid-template-columns: minmax(0, 1fr);
  }

  .calendar-day {
    min-height: 32px;
    aspect-ratio: auto;
  }

  .seat-window ul,
  .delay-scenarios ul {
    padding-left: var(--space-4);
  }

  .arrival-table,
  .arrival-table tbody,
  .arrival-table tr,
  .arrival-table td {
    display: block;
  }

  .arrival-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
  }

  .arrival-table tr {
    display: flex;
    flex-wrap: wrap;
    min-width: 0;
    margin-bottom: var(--space-3);
    padding: var(--space-2);
    border: 1px solid var(--line);
    border-radius: var(--r-organic);
    align-items: center;
    column-gap: var(--space-1);
    word-break: keep-all;
    overflow-wrap: normal;
  }

  .arrival-table tr::before,
  .arrival-table tr::after {
    content: '';
    flex-basis: 100%;
  }

  .arrival-table tr::before {
    order: 4;
  }

  .arrival-table tr::after {
    order: 8;
  }

  .arrival-table td {
    min-width: 0;
    padding: var(--space-1) 0;
    border-bottom: 0;
    overflow-wrap: normal;
    word-break: keep-all;
  }

  .arrival-table td::before {
    content: none;
  }

  .flight-number {
    order: 1;
  }

  .flight-grade {
    order: 3;
    margin-left: auto;
  }

  .flight-origin {
    order: 6;
  }

  .flight-arrival {
    order: 2;
  }

  .flight-cumulative {
    order: 7;
    margin-left: auto;
  }

  .flight-airline {
    order: 5;
  }

  .flight-aircraft {
    order: 9;
  }

  .flight-aircraft[data-missing],
  .flight-origin[data-missing] {
    display: none;
  }

  .arrival-table .flight-number,
  .arrival-table .flight-arrival,
  .arrival-table .flight-grade,
  .arrival-table .flight-aircraft,
  .arrival-table .flight-cumulative {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .arrival-table .flight-arrival::before,
  .arrival-table .flight-origin::before {
    content: '· ';
  }

  .arrival-table .flight-origin::after {
    content: ' 출발';
  }

  .arrival-table .flight-cumulative::before {
    content: '누적 ';
  }

  .flight-airline,
  .flight-aircraft,
  .flight-origin,
  .flight-cumulative {
    color: var(--sub);
    font-size: var(--text-xs);
  }

  .arrival-table .selected-flight td:first-child {
    border-left: 0;
  }

  .arrival-table .selected-flight {
    border-left: 4px solid var(--brand-teal);
  }

  .fixed-fasttrack-cta-link {
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-md);
  }
}
