:root {
  --hocmai-blue: #2a6fb5;
  --hocmai-blue-dark: #1f5a96;
  --hocmai-yellow: #e8c86a;
  --hocmai-bg: #eef4fb;
  --hocmai-text: #2c4560;
  --hocmai-muted: #6a7f96;
  --nav-active-underline: #7aa8d4;
  --footer-bg: #4a7eb5;
  --white: #ffffff;
  --danger: #c1121f;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  font-family: "Be Vietnam Pro", sans-serif;
  color: var(--hocmai-text);
  background: var(--hocmai-bg);
  line-height: 1.55;
}

main {
  flex: 1 0 auto;
}

.container {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
}

.brand-header {
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--white);
  border-bottom: 1px solid rgba(42, 111, 181, 0.1);
}

.header-inner {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 clamp(1rem, 4vw, 2.75rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  min-height: 84px;
}

.brand-mark {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  flex: 0 1 auto;
  min-width: 0;
}

.brand-logo {
  width: 50px;
  height: auto;
  display: block;
}

.brand-sub {
  font-size: 0.78rem;
  line-height: 1.25;
  color: var(--hocmai-muted);
  max-width: 180px;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem 1.5rem;
  flex: 0 0 auto;
  margin-left: auto;
}

.nav-links a {
  color: var(--hocmai-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.nav-links a[aria-current="page"] {
  color: var(--hocmai-blue-dark);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: var(--nav-active-underline);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

h1 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.2rem);
  line-height: 1.25;
}

.lookup-section {
  padding: 3rem 0 4rem;
}

.static-page-section {
  flex: 1;
  padding: 2.5rem 0 4rem;
}

.static-page-section--faq {
  background: var(--hocmai-bg);
}

.static-page-title {
  margin: 0 0 1rem;
  font-size: clamp(1.35rem, 3vw, 1.65rem);
  color: var(--hocmai-blue-dark);
  line-height: 1.3;
}

.static-page-back {
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(42, 111, 181, 0.1);
  font-size: 0.92rem;
}

.static-page-back a {
  color: var(--hocmai-blue);
  font-weight: 600;
  text-decoration: none;
}

.static-page-back a:hover {
  text-decoration: underline;
}

.info-subtitle {
  margin: 1.25rem 0 0.5rem;
  font-size: 1.05rem;
  color: var(--hocmai-text);
}

.info-list {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--hocmai-text);
  line-height: 1.6;
}

.info-list li + li {
  margin-top: 0.45rem;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.faq-item {
  padding: 1rem 1.1rem;
  background: var(--white);
  border: 1px solid rgba(42, 111, 181, 0.1);
  border-radius: 12px;
}

.faq-q {
  margin: 0 0 0.55rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--hocmai-blue-dark);
  line-height: 1.35;
}

.faq-a {
  color: var(--hocmai-muted);
  font-size: 0.94rem;
  line-height: 1.55;
}

.faq-a p {
  margin: 0;
}

.faq-a p + p {
  margin-top: 0.45rem;
}

.faq-a a {
  color: #3a6ead;
  font-weight: 600;
  text-decoration: none;
  word-break: break-word;
}

.faq-a a:hover {
  text-decoration: underline;
}

.lookup-wrapper {
  max-width: 920px;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid rgba(42, 111, 181, 0.12);
  border-radius: 16px;
  padding: 1.4rem;
  box-shadow: 0 1px 0 rgba(42, 111, 181, 0.04);
}

.section-title h1 {
  margin: 0;
  text-align: center;
}

.section-title p {
  margin-top: 0.45rem;
  text-align: center;
  color: var(--hocmai-muted);
}

.lookup-form {
  margin-top: 1.3rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
}

.lookup-form label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.lookup-form input {
  width: 100%;
  border: 1px solid rgba(42, 111, 181, 0.25);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  font: inherit;
  outline: none;
}

.lookup-form input:focus {
  border-color: var(--hocmai-blue);
  box-shadow: 0 0 0 3px rgba(12, 77, 162, 0.16);
}

.lookup-form button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 45px;
  border: none;
  border-radius: 12px;
  padding: 0 2rem;
  background: linear-gradient(120deg, var(--hocmai-blue) 0%, var(--hocmai-blue-dark) 100%);
  color: var(--white);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  width: auto;
  min-width: 11.5rem;
  max-width: 100%;
  justify-self: center;
  transition: opacity 0.2s ease;
}

.lookup-form button:disabled {
  cursor: not-allowed;
  opacity: 0.92;
}

.lookup-form .submit-spinner {
  display: none;
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: submit-spin 0.65s linear infinite;
}

.lookup-form.is-loading .submit-spinner {
  display: block;
}

.lookup-form.is-loading input {
  opacity: 0.72;
  pointer-events: none;
}

@keyframes submit-spin {
  to {
    transform: rotate(360deg);
  }
}

.form-message {
  grid-column: 1 / -1;
  margin: 0.2rem 0 0;
  min-height: 1.2rem;
  color: var(--danger);
  font-size: 0.9rem;
}

.result-card {
  margin-top: 1rem;
  background: var(--white);
  border-radius: 16px;
  border: 1px solid rgba(42, 111, 181, 0.12);
  padding: 1.1rem;
}

.hidden {
  display: none;
}

.result-title {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
  color: var(--hocmai-blue-dark);
}

.result-summary {
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  background: rgba(12, 77, 162, 0.06);
  border: 1px solid rgba(42, 111, 181, 0.12);
  border-radius: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.5rem 1.5rem;
}

.result-summary-row {
  display: contents;
}

.result-summary dt {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--hocmai-muted);
  padding-top: 0.15rem;
}

.result-summary dd {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--hocmai-text);
}

@media (max-width: 560px) {
  .result-summary {
    grid-template-columns: 1fr;
  }

  .result-summary dd {
    padding-bottom: 0.45rem;
    margin-bottom: 0.35rem;
    border-bottom: 1px solid rgba(42, 111, 181, 0.08);
  }

  .result-summary-row:last-child dd {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
  }
}

.scholarship-inline-line {
  font-size: 0.95rem;
  font-weight: 700;
  color: #b30018;
}

.result-table-caption {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
  color: var(--hocmai-muted);
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.result-table th,
.result-table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border: 1px solid rgba(42, 111, 181, 0.15);
  vertical-align: middle;
}

.result-table thead th {
  background: rgba(12, 77, 162, 0.08);
  color: var(--hocmai-blue-dark);
  font-weight: 700;
}

.result-table tbody th[scope="row"] {
  background: rgba(12, 77, 162, 0.04);
  font-weight: 600;
  color: var(--hocmai-text);
  white-space: nowrap;
}

.result-table .result-score-cell {
  font-weight: 700;
  color: #4a7ab8;
}

.result-link {
  font-weight: 600;
  color: var(--hocmai-blue);
  text-decoration: none;
}

.result-link:hover {
  text-decoration: underline;
}

.result-total-row td {
  background: rgba(255, 201, 56, 0.15);
  font-weight: 600;
}

.result-total-row .result-total-score {
  font-size: 1.05rem;
  font-weight: 800;
  color: #355a8a;
}

.result-total-scholarship-cell {
  text-align: left;
  vertical-align: middle;
}

.score-chart-wrap {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(42, 111, 181, 0.12);
}

.score-chart-wrap[hidden] {
  display: none !important;
}

.scholarship-section {
  margin-top: 1.1rem;
  margin-bottom: 1.15rem;
  padding: 1rem 1.05rem;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(42, 111, 181, 0.12);
  border-radius: 16px;
}

.scholarship-title {
  margin: 0 0 0.75rem;
  text-align: center;
  font-size: 1.1rem;
  color: #b30018;
  font-weight: 900;
}

.scholarship-promo-body {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--hocmai-text);
  text-align: left;
}

.scholarship-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.scholarship-action {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 0.85rem 0.9rem;
  border: 2px solid #c1121f;
  border-radius: 12px;
  color: #c1121f;
  font-weight: 800;
  text-decoration: none;
  background: rgba(193, 18, 31, 0.02);
  transition: transform 120ms ease, background 120ms ease;
}

.scholarship-action:hover {
  transform: translateY(-1px);
  background: rgba(193, 18, 31, 0.06);
}

.scholarship-action--accent {
  background: rgba(193, 18, 31, 0.04);
}

@media (max-width: 560px) {
  .scholarship-actions {
    grid-template-columns: 1fr;
  }
}

.score-chart-title {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--hocmai-blue-dark);
}

.score-chart-hint {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  color: var(--hocmai-muted);
}

.histogram {
  display: flex;
  gap: 0.35rem;
  align-items: flex-start;
  width: 100%;
}

.histogram-y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-shrink: 0;
  width: 2.5rem;
  height: 220px;
  box-sizing: border-box;
  font-size: 0.7rem;
  font-weight: 600;
  color: #5f6b7a;
  text-align: right;
  line-height: 1.2;
}

.histogram-y-axis span {
  display: block;
}

.histogram-plot {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.25rem;
}

.histogram-bars {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  gap: clamp(4px, 1.2vw, 10px);
  height: calc(220px + 2.85rem);
  min-width: min(100%, 560px);
  padding: 0 0.35rem 0 0.45rem;
  border-left: 1px solid #dde1e6;
  border-bottom: 1px solid #dde1e6;
  background-color: #ffffff;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent calc(25% - 1px),
    #e8eaed calc(25% - 1px),
    #e8eaed 25%
  );
  background-size: 100% 100%;
  box-sizing: border-box;
  border-radius: 0 6px 0 0;
}

.chart-col {
  flex: 1 1 0;
  min-width: 1.5rem;
  max-width: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 0;
}

.chart-col-count {
  font-size: 0.7rem;
  font-weight: 700;
  color: #5f6b7a;
  margin-bottom: 4px;
  min-height: 1.1em;
  line-height: 1;
}

.chart-col-count--zero {
  opacity: 0.35;
}

.chart-col--you .chart-col-count {
  color: #e53935;
  font-weight: 800;
  opacity: 1;
}

.chart-col-bar-wrap {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
}

.chart-col-bar {
  width: 72%;
  max-width: 1.85rem;
  min-height: 0;
  border-radius: 5px 5px 0 0;
  background: #3498db;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
  transition: height 0.25s ease-out;
}

.chart-col--you .chart-col-bar {
  background: #e53935;
  box-shadow: 0 1px 2px rgba(229, 57, 53, 0.35);
}

.chart-col-xlabel {
  margin-top: 8px;
  font-size: 0.6rem;
  line-height: 1.15;
  color: #5f6b7a;
  text-align: center;
  transform: rotate(-45deg);
  transform-origin: center top;
  white-space: nowrap;
  height: 2.85rem;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 2px;
}

@media (max-width: 540px) {
  .histogram-y-axis {
    width: 1.85rem;
    font-size: 0.62rem;
  }

  .chart-col {
    min-width: 1.15rem;
    max-width: none;
  }

  .chart-col-xlabel {
    font-size: 0.52rem;
    transform: rotate(-48deg);
  }
}

.site-footer {
  flex-shrink: 0;
  background: var(--footer-bg);
  color: #ffffff;
  padding: 1.5rem 0;
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 1.75rem 2rem;
  align-items: start;
  text-align: left;
}

.footer-brand-col {
  min-width: 0;
}

.footer-brand-row {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem 1rem;
}

.footer-logo {
  width: 48px;
  height: auto;
  display: block;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.footer-brand-text {
  min-width: 0;
  flex: 1;
}

.footer-tagline {
  margin: 0;
  font-size: clamp(0.95rem, 2.2vw, 1.05rem);
  font-weight: 700;
  line-height: 1.45;
  color: #ffffff;
}

.footer-subline {
  margin: 0.45rem 0 0;
  font-size: clamp(0.88rem, 2vw, 0.98rem);
  font-weight: 500;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.92);
}

.footer-contact-lead {
  margin: 0 0 0.5rem;
  font-size: 0.92rem;
}

.footer-contact p {
  margin: 0.35rem 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.96);
}

.site-footer a {
  color: #f5e6b8;
  text-decoration: none;
  font-weight: 600;
}

.site-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 1.35rem;
  }

  .footer-brand-row {
    flex-wrap: wrap;
  }

  .lookup-form {
    grid-template-columns: 1fr;
  }

  .nav-links {
    display: none;
  }

  .brand-sub {
    display: none;
  }
}

@media (max-width: 540px) {
  .lookup-wrapper {
    padding: 1rem;
  }

  .lookup-form button {
    width: 100%;
  }
}
