:root {
  --ink: #10213d;
  --secondary: #53647e;
  --line: #dce4ef;
  --soft: #f0f4fa;
  --gain: #bd142e;
  --decline: #124cc7;
  font-family: "Noto Sans KR", "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  color: var(--ink);
  background: #fff;
  font-size: 15px;
  font-synthesis: none;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }
body { margin: 0; background: #fff; }
main { width: min(1600px, 100%); margin: 0 auto; padding: 22px 20px 28px; }
h1, h2, p { margin-top: 0; }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 54px;
  margin-bottom: 16px;
}
.page-header > div { min-width: 0; }
h1 { margin-bottom: 4px; font-size: 32px; line-height: 1.2; letter-spacing: -1.2px; font-weight: 800; }
.page-header p { margin-bottom: 0; color: var(--secondary); font-size: 14px; }
.refresh-panel {
  display: flex;
  align-items: baseline;
  gap: 20px;
  max-width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8faff;
  white-space: nowrap;
}
.refresh-panel span { color: var(--secondary); font-size: 13px; font-weight: 650; }
.refresh-panel strong { font-size: 14px; font-variant-numeric: tabular-nums; }

#notice:empty { display: none; }
#notice { margin-bottom: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 7px; background: #f7f9fc; color: var(--secondary); }
#notice.error { color: #7c2d37; background: #fff7f7; }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}
.summary-grid article {
  min-width: 0;
  min-height: 112px;
  padding: 20px;
  border-left: 1px solid var(--line);
}
.summary-grid article:first-child { border-left: 0; }
.summary-grid span, .performance-card span, .record span {
  display: block;
  margin-bottom: 10px;
  color: var(--secondary);
  font-size: 13px;
  font-weight: 650;
}
.summary-grid strong {
  display: block;
  max-width: 100%;
  font-size: 24px;
  line-height: 1.35;
  letter-spacing: -.6px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.summary-grid small { display: block; margin-top: 7px; color: var(--secondary); font-size: 12px; line-height: 1.45; }
.up { color: var(--gain); }
.down { color: var(--decline); }

.performance-card {
  display: grid;
  grid-template-columns: minmax(180px, auto) auto;
  align-items: center;
  justify-content: end;
  gap: 32px;
  margin-bottom: 14px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}
.performance-card > div:first-child { min-width: 120px; }
.performance-card span { margin-bottom: 5px; }
.performance-card > div > strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.record { min-width: 130px; padding-left: 28px; border-left: 1px solid var(--line); }
.record span { margin-bottom: 5px; }
.record strong { display: flex; gap: 12px; font-size: 18px; white-space: nowrap; }
.record b { color: var(--ink); }

.table-card { border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: #fff; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
h2 { margin-bottom: 0; font-size: 20px; line-height: 1.35; letter-spacing: -.4px; }
.section-heading p { margin-bottom: 0; color: var(--secondary); font-size: 13px; }
.table-wrap { overflow-x: auto; }
.table-wrap:focus-visible { outline: 3px solid #2671d9; outline-offset: -3px; }
table { width: 100%; min-width: 820px; border-collapse: collapse; table-layout: fixed; font-variant-numeric: tabular-nums; }
th { height: 50px; padding: 13px 14px; background: var(--soft); color: #243954; font-size: 13px; font-weight: 700; text-align: center; border-bottom: 1px solid #cbd7e7; }
td { height: 68px; padding: 14px; border-bottom: 1px solid #e1e8f1; text-align: center; line-height: 1.45; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) td { background: #fcfdff; }
tbody tr:hover td { background: #f5f8fd; }
th:nth-child(1) { width: 105px; }
th:nth-child(2) { width: 145px; }
th:nth-child(3) { width: 145px; }
th:nth-child(4) { width: 170px; }
th:nth-child(5) { width: 170px; }
th:nth-child(6) { width: 110px; }
td:first-child { font-size: 16px; font-weight: 750; }
.direction { display: inline-block; min-width: 112px; padding: 7px 10px; border: 1px solid currentColor; border-radius: 4px; background: #fff; font-weight: 750; white-space: nowrap; }
.movement { font-weight: 700; white-space: nowrap; }
.result { color: var(--secondary); font-weight: 700; }
.verdict-success { color: var(--gain); }
.verdict-failure { color: var(--decline); }
.empty { height: 150px; color: var(--secondary); }
footer { padding: 14px 2px 0; color: var(--secondary); font-size: 12px; }

@media (max-width: 900px) {
  .page-header { align-items: flex-start; }
  .refresh-panel { flex-direction: column; align-items: flex-start; gap: 4px; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-grid article:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .summary-grid article:nth-child(4) { border-top: 1px solid var(--line); }
  .performance-card { grid-template-columns: repeat(2, minmax(0, 1fr)); justify-content: stretch; gap: 15px; }
}

@media (max-width: 600px) {
  main { padding: 17px 12px 24px; }
  .page-header { display: block; }
  h1 { font-size: 28px; }
  .refresh-panel { margin-top: 14px; width: 100%; }
  .summary-grid article { min-height: 102px; padding: 16px 14px; }
  .summary-grid strong { font-size: 20px; }
  .performance-card { padding: 16px 14px; }
  .section-heading { display: block; padding: 16px 14px; }
  .section-heading p { margin-top: 6px; line-height: 1.5; }
}


.price-observation { display: block; margin-top: 5px; color: #64748b; font-size: 12px; font-weight: 400; }

.mobile-time, .mobile-start-price, .mobile-columns, .mobile-result-index { display: none; }

@media (max-width: 768px) {
  main { padding: 12px 10px 20px; }
  .page-header { display: block; min-height: 0; margin-bottom: 10px; }
  h1 { font-size: 24px; }
  .page-header p, .refresh-panel > span, .summary-grid small { display: none; }
  .refresh-panel { margin-top: 4px; padding: 0; border: 0; background: none; white-space: normal; }
  .refresh-panel strong { color: var(--secondary); font-size: 12px; font-weight: 500; }
  .summary-grid { margin-bottom: 10px; }
  .summary-grid article { min-height: 64px; padding: 10px 12px; }
  .summary-grid span { margin-bottom: 4px; font-size: 12px; }
  .summary-grid strong { font-size: 17px; letter-spacing: -.3px; }
  .performance-card { margin-bottom: 10px; padding: 10px 12px; gap: 12px; }
  .performance-card > div:first-child, .record { min-width: 0; }
  .performance-card span { margin-bottom: 3px; font-size: 12px; }
  .performance-card > div > strong { font-size: 18px; }
  .record { padding-left: 12px; }
  .record strong { gap: 8px; }
  .section-heading { display: flex; align-items: center; gap: 8px; padding: 12px 10px; }
  .section-heading h2 { font-size: 17px; }
  .section-heading p { display: none; }
  .mobile-columns { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 6px 9px; border: 1px solid #cbd7e7; border-radius: 5px; color: var(--ink); background: #f8faff; font: inherit; font-size: 12px; white-space: nowrap; cursor: pointer; }
  .mobile-columns:focus-visible { outline: 3px solid #2671d9; outline-offset: 2px; }
  .table-wrap:not(.show-all-columns) table { min-width: 0; width: 100%; }
  .table-wrap:not(.show-all-columns) .start-column,
  .table-wrap:not(.show-all-columns) .next-column,
  .table-wrap:not(.show-all-columns) .movement-column,
  .table-wrap:not(.show-all-columns) .desktop-time { display: none; }
  .table-wrap:not(.show-all-columns) .mobile-time { display: inline; }
  .table-wrap:not(.show-all-columns) .mobile-start-price { display: block; margin-top: 4px; color: var(--secondary); font-size: 14px; font-weight: 500; }
  .table-wrap:not(.show-all-columns) th { height: 44px; padding: 9px 5px; font-size: 12px; }
  .table-wrap:not(.show-all-columns) th:nth-child(1) { width: 34%; }
  .table-wrap:not(.show-all-columns) th:nth-child(4) { width: 38%; }
  .table-wrap:not(.show-all-columns) th:nth-child(6) { width: 28%; }
  .table-wrap:not(.show-all-columns) td { padding: 12px 6px; font-size: 14px; overflow-wrap: anywhere; }
  .table-wrap:not(.show-all-columns) td:first-child { font-size: 16px; }
  .table-wrap:not(.show-all-columns) .direction { min-width: 0; max-width: 100%; padding: 6px; font-size: 13px; white-space: normal; }
  .table-wrap:not(.show-all-columns) .price-observation { font-size: 11px; }
  .mobile-result-index { display: block; margin-top: 5px; color: var(--secondary); font-size: 13px; font-weight: 500; }
  .result-time { display: block; font-size: 11px; }
  .result-value { display: block; white-space: nowrap; }
}
