@import url('https://fonts.googleapis.com/css2?family=Noto+Serif:ital,wght@0,100..900;1,100..900&display=swap');
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-alt: #fafbfc;
  --border: #d7dce2;
  --border-strong: #c2c9d2;
  --text: #1f2933;
  --text-muted: #52606d;
  --accent: #1f5fa7;
  --accent-soft: #e8f0fb;
  --error: #b33a3a;
  --error-soft: #fbecec;
  --success: #2f6f44;
  --success-soft: #edf7f0;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  --font-body: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
  --font-heading: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 15px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.45;
}

button,
input {
  font: inherit;
}

.page {
  max-width: 920px;
  margin: 0 auto;
  padding: 18px;
}

.lookup-section,
.data-section {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.lookup-section {
  padding: 12px;
}

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

.section-header {
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
}

.section-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  font-family: var(--font-heading);
  letter-spacing: 0;
}

.lookup-form {
  display: grid;
  gap: 6px;
}

.field-label {
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-muted);
}

.lookup-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

input[type="text"] {
  min-width: 0;
  height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}

input[type="text"]:focus {
  outline: 2px solid transparent;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 95, 167, 0.12);
}

button {
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

button:hover {
  background: #184e89;
  border-color: #184e89;
}

button:disabled {
  cursor: default;
  opacity: 0.7;
}

.status-message {
  margin: 8px 0 0;
  padding: 7px 9px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  font-size: 0.86rem;
  color: var(--text-muted);
}

.status-message[data-state="loading"] {
  border-color: var(--border-strong);
  background: var(--surface-alt);
  color: var(--text);
}

.status-message[data-state="error"] {
  border-color: #e2b2b2;
  background: var(--error-soft);
  color: var(--error);
}

.status-message[data-state="success"] {
  border-color: #bdd8c5;
  background: var(--success-soft);
  color: var(--success);
}

.results {
  margin-top: 10px;
}

.hidden {
  display: none;
}

.info-grid {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  margin: 0;
}

.info-grid div {
  display: contents;
}

.info-grid dt,
.info-grid dd {
  margin: 0;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

.info-grid dt {
  background: var(--surface-alt);
  font-weight: 600;
  color: var(--text-muted);
}

.info-grid dd {
  color: var(--text);
}

.info-grid div:last-child dt,
.info-grid div:last-child dd {
  border-bottom: 0;
}

.table-wrap {
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.data-table th,
.data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.data-table th {
  background: var(--surface-alt);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  font-family: var(--font-heading);
}

.data-table td {
  font-size: 0.9rem;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.schedule-table th:nth-child(1),
.schedule-table td:nth-child(1) {
  width: 132px;
}

.schedule-table th:nth-child(2),
.schedule-table td:nth-child(2) {
  width: 116px;
}

.schedule-table th:nth-child(4),
.schedule-table td:nth-child(4) {
  width: 180px;
}

.schedule-table td {
  overflow-wrap: anywhere;
}

.empty-row td {
  color: var(--text-muted);
}

@media (max-width: 919px) {
  .page {
    padding: 16px;
  }

  .lookup-section {
    padding: 14px;
  }

  .section-header {
    padding: 11px 14px 9px;
  }

  .lookup-form {
    gap: 8px;
  }

  .lookup-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  input[type="text"],
  button {
    width: 100%;
    min-height: 42px;
  }

  .status-message {
    padding: 8px 10px;
  }

  .data-table {
    table-layout: auto;
  }

  .schedule-table th:nth-child(1),
  .schedule-table td:nth-child(1),
  .schedule-table th:nth-child(2),
  .schedule-table td:nth-child(2),
  .schedule-table th:nth-child(4),
  .schedule-table td:nth-child(4) {
    width: auto;
  }
}

@media (max-width: 720px) {
  .page {
    padding: 12px;
  }

  .lookup-section {
    padding: 12px;
  }

  .section-header {
    padding: 10px 12px 8px;
  }

  .section-title {
    font-size: 0.96rem;
  }

  .info-grid {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
  }

  .info-grid div {
    display: block;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-alt);
    overflow: hidden;
  }

  .info-grid dt {
    padding: 8px 10px 3px;
    border-bottom: 0;
    background: transparent;
    font-size: 0.76rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
  }

  .info-grid dd {
    padding: 0 10px 9px;
    border-bottom: 0;
    font-size: 0.94rem;
  }

  .schedule-table {
    table-layout: auto;
  }

  .schedule-table thead {
    display: none;
  }

  .schedule-table,
  .schedule-table tbody,
  .schedule-table tr,
  .schedule-table td {
    display: block;
    width: 100%;
  }

  .schedule-table tbody {
    display: grid;
    gap: 12px;
    padding: 12px;
  }

  .schedule-table tr {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-alt);
    overflow: hidden;
  }

  .schedule-table td {
    display: grid;
    grid-template-columns: minmax(76px, 92px) minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
  }

  .schedule-table td::before {
    content: attr(data-label);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    line-height: 1.4;
  }

  .schedule-table tr:last-child td:last-child,
  .schedule-table td:last-child {
    border-bottom: 0;
  }

  .schedule-table .empty-row {
    border: 0;
    background: transparent;
  }

  .schedule-table .empty-row td {
    display: block;
    padding: 0;
  }

  .schedule-table .empty-row td::before {
    content: none;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 14px;
  }

  .page {
    padding: 10px;
  }

  .lookup-section {
    padding: 10px;
  }

  .section-header {
    padding: 9px 10px 7px;
  }

  .data-table th,
  .data-table td {
    padding: 8px 9px;
  }

  .schedule-table tbody {
    padding: 10px;
    gap: 10px;
  }

  .schedule-table td {
    grid-template-columns: minmax(68px, 82px) minmax(0, 1fr);
    gap: 10px;
    padding: 9px 10px;
  }
}
