html {
  font-size: 15px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  background: #f5f7f9;
  color: #17212b;
}

.container {
  max-width: 980px;
}

.course-page {
  max-width: 760px;
  margin: 0 auto;
}

.top-panel {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 0.9rem 0.25rem 0.8rem;
  background: rgba(245, 247, 249, 0.96);
  backdrop-filter: blur(10px);
}

#status-message,
#results-section {
  scroll-margin-top: 116px;
}

.app-title {
  margin-bottom: 0.8rem;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0;
}

.confirm-strip {
  display: grid;
  grid-template-columns: minmax(88px, 0.8fr) minmax(0, 1.4fr);
  gap: 0.6rem;
  align-items: stretch;
}

.round-input,
.confirm-button,
.btn-lg,
.form-select-lg,
.form-control-lg {
  min-height: 52px;
  border-radius: 8px;
}

.action-card,
.result-card {
  border: 1px solid #dde4ea;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(21, 33, 43, 0.04);
}

.section-heading {
  margin-bottom: 0.85rem;
  font-size: 1.05rem;
  font-weight: 800;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}

.stat-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem;
  background: #eef3f6;
  border-radius: 8px;
}

.stat-box span {
  color: #5b6b79;
  font-size: 0.92rem;
}

.stat-box strong {
  min-width: 0;
  text-align: right;
  word-break: break-word;
}

.form-label {
  margin-bottom: 0.35rem;
  color: #3b4a57;
  font-weight: 700;
}

.recent-check {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 52px;
  padding: 0.75rem 0.9rem;
  background: #f0f4f6;
  border-radius: 8px;
}

.recent-check .form-check-input {
  flex: 0 0 auto;
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
}

.recent-check .form-check-label {
  font-weight: 700;
}

.empty-box {
  padding: 1.25rem;
  color: #637382;
  text-align: center;
  background: #ffffff;
  border: 1px dashed #c8d2db;
  border-radius: 8px;
}

.result-cards {
  display: grid;
  gap: 0.8rem;
}

.result-head {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 0.65rem;
  align-items: start;
  margin-bottom: 0.8rem;
}

.result-no {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #ffffff;
  font-weight: 800;
  background: #1f7a5a;
  border-radius: 50%;
}

.result-head h2 {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.35;
  font-weight: 800;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.result-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.result-meta div {
  min-width: 0;
  padding: 0.65rem;
  background: #f4f7f9;
  border-radius: 8px;
}

.result-meta .history-row {
  grid-column: 1 / -1;
}

.result-meta dt {
  color: #657586;
  font-size: 0.82rem;
  font-weight: 700;
}

.result-meta dd {
  margin: 0.1rem 0 0;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.result-table-wrap {
  display: none;
}

.update-help {
  color: #667786;
  font-size: 0.9rem;
}

.past-history-panel {
  display: none;
}

.past-history-panel.is-open {
  display: block;
}

.course-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  gap: 0.5rem;
}

.course-search-list {
  display: grid;
  gap: 0.45rem;
}

.course-search-item {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.85rem;
  color: #17212b;
  text-align: left;
  background: #ffffff;
  border: 1px solid #d7e0e7;
  border-radius: 8px;
}

.course-search-item.is-selected {
  color: #ffffff;
  background: #1f7a5a;
  border-color: #1f7a5a;
}

.direct-course-box {
  padding: 0.85rem;
  background: #f4f7f9;
  border: 1px solid #dbe4eb;
  border-radius: 8px;
}

.round-history-list {
  display: grid;
  gap: 0.75rem;
}

.round-history-card {
  padding: 0.85rem;
  background: #f4f7f9;
  border: 1px solid #dbe4eb;
  border-radius: 8px;
}

.round-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.round-history-head strong {
  font-size: 1rem;
}

.round-history-head span {
  color: #657586;
  font-size: 0.86rem;
}

.round-history-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 auto;
}

.round-history-actions .btn {
  min-height: 34px;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  font-weight: 700;
}

.round-history-courses {
  display: grid;
  gap: 0.45rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.round-history-courses li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto auto;
  gap: 0.5rem;
  align-items: start;
}

.round-history-courses span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: #ffffff;
  font-weight: 800;
  background: #607487;
  border-radius: 50%;
}

.round-history-courses strong {
  min-width: 0;
  padding-top: 0.2rem;
  overflow-wrap: anywhere;
}

.round-history-courses em {
  min-width: 34px;
  padding-top: 0.2rem;
  color: #17212b;
  font-style: normal;
  font-weight: 800;
  text-align: right;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(10, 17, 24, 0.72);
}

.loading-overlay.is-active {
  display: flex;
}

.loading-box {
  display: grid;
  justify-items: center;
  gap: 0.8rem;
  max-width: 330px;
  padding: 1.4rem;
  color: #ffffff;
  text-align: center;
  background: rgba(22, 32, 42, 0.94);
  border-radius: 8px;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.28);
}

.loading-box strong {
  font-size: 1.05rem;
}

.loading-box span {
  color: #d8e1e8;
  line-height: 1.45;
}

.safe-bottom {
  height: 28px;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.1rem #ffffff, 0 0 0 0.25rem rgba(31, 122, 90, 0.35);
}

@media (min-width: 768px) {
  .stats-grid {
    grid-template-columns: 1.4fr 0.8fr;
  }

  .result-cards {
    display: none;
  }

  .result-table-wrap {
    display: block;
    background: #ffffff;
    border: 1px solid #dde4ea;
    border-radius: 8px;
  }

  .result-table {
    margin-bottom: 0;
  }
}
