:root {
  color-scheme: light;
  --navy-950: #0b252b;
  --navy-900: #102f36;
  --navy-800: #17434b;
  --teal-700: #08756f;
  --teal-600: #0b8f85;
  --teal-100: #d9f2ef;
  --orange-700: #b94d15;
  --orange-600: #dc6425;
  --orange-100: #fff0e6;
  --red-700: #b42318;
  --red-100: #fee4e2;
  --green-700: #067647;
  --green-100: #dcfae6;
  --blue-100: #e7f0ff;
  --ink: #17282d;
  --muted: #607278;
  --line: #d9e2e4;
  --surface: #ffffff;
  --background: #f1f5f4;
  --shadow: 0 14px 38px rgb(19 52 58 / 8%);
  font-family: Pretendard, "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 0%, rgb(17 145 133 / 10%), transparent 32rem),
    var(--background);
}

button,
select {
  font: inherit;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: white;
  background: var(--navy-950);
  border-radius: 8px;
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar {
  position: sticky;
  z-index: 50;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 14px max(24px, calc((100% - 1240px) / 2));
  color: white;
  background: var(--navy-950);
  border-bottom: 1px solid rgb(255 255 255 / 10%);
  box-shadow: 0 8px 28px rgb(6 29 34 / 18%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--navy-950);
  background: #a7e4dd;
  border-radius: 12px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.brand strong,
.brand small {
  display: block;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  margin-right: 22px;
}

.topnav a {
  padding: 8px 10px;
  color: #b9d1d4;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.topnav a:hover,
.topnav a:focus-visible {
  color: white;
  background: rgb(255 255 255 / 8%);
}

.brand strong {
  font-size: 13px;
  letter-spacing: 0.08em;
}

.brand small {
  margin-top: 3px;
  color: #b9d1d4;
  font-size: 12px;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  color: #d6efec;
  background: rgb(255 255 255 / 7%);
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #48d5a6;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgb(72 213 166 / 15%);
}

.page-shell {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 30px 0 64px;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 16px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 8px;
  color: var(--teal-700);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  color: var(--navy-950);
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.hero-copy {
  max-width: 720px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.timestamp-card {
  min-width: 210px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.timestamp-card span,
.timestamp-card small,
.timestamp-card strong {
  display: block;
}

.timestamp-card span,
.timestamp-card small {
  color: var(--muted);
  font-size: 12px;
}

.timestamp-card strong {
  margin: 5px 0 3px;
  font-size: 15px;
}

.education-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 12px;
  padding: 10px 14px;
  color: #793814;
  background: var(--orange-100);
  border: 1px solid #f3c9ad;
  border-radius: 14px;
}

.education-notice > span {
  display: grid;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  place-items: center;
  color: white;
  background: var(--orange-600);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 900;
}

.education-notice p {
  margin: 0;
  line-height: 1.5;
}

.control-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.9fr);
  gap: 32px;
  align-items: end;
  padding: 22px;
  color: white;
  background: linear-gradient(125deg, var(--navy-900), var(--navy-800));
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.control-panel .section-kicker {
  color: #81d9d0;
}

.control-panel h2,
.control-panel p {
  margin-top: 0;
}

.control-panel h2 {
  margin-bottom: 8px;
  font-size: clamp(22px, 3vw, 30px);
  letter-spacing: -0.03em;
}

.control-panel p:last-child {
  margin-bottom: 0;
  color: #c4d9dc;
  line-height: 1.6;
}

.controls {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 12px;
}

.controls label span {
  display: block;
  margin-bottom: 7px;
  color: #c4d9dc;
  font-size: 12px;
  font-weight: 700;
}

.controls select {
  width: 100%;
  min-height: 46px;
  padding: 0 38px 0 13px;
  color: var(--navy-950);
  background: white;
  border: 1px solid transparent;
  border-radius: 10px;
}

.controls select:focus-visible,
.table-wrap:focus-visible,
.sync-bar button:focus-visible,
.auto-refresh input:focus-visible {
  outline: 3px solid #81d9d0;
  outline-offset: 2px;
}

.sync-bar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(150px, auto) auto auto;
  gap: 18px;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid rgb(255 255 255 / 13%);
}

.sync-source,
.sync-time,
.auto-refresh {
  display: flex;
  align-items: center;
}

.sync-source {
  gap: 10px;
}

.sync-source > span:last-child,
.sync-time {
  flex-direction: column;
  align-items: flex-start;
}

.sync-source small,
.sync-time small {
  color: #9fbfc2;
  font-size: 11px;
}

.sync-source strong,
.sync-time strong {
  margin-top: 2px;
  color: white;
  font-size: 13px;
}

.live-mark {
  padding: 5px 7px;
  color: #bdf2dc;
  background: rgb(24 159 115 / 18%);
  border: 1px solid rgb(93 224 179 / 30%);
  border-radius: 7px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.auto-refresh {
  gap: 8px;
  color: #d6e6e8;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.auto-refresh input {
  width: 17px;
  height: 17px;
  accent-color: #5dd8c9;
}

.sync-bar button {
  min-height: 38px;
  padding: 0 14px;
  color: var(--navy-950);
  background: #a7e4dd;
  border: 0;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.sync-bar button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 18px 0;
}

.kpi-card,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.kpi-card {
  position: relative;
  min-height: 150px;
  padding: 22px;
  overflow: hidden;
}

.kpi-card::after {
  position: absolute;
  right: -18px;
  bottom: -26px;
  width: 92px;
  height: 92px;
  background: var(--teal-100);
  border-radius: 50%;
  content: "";
  opacity: 0.7;
}

.accent-card::after {
  background: var(--orange-100);
}

.kpi-label,
.kpi-card small,
.kpi-card strong {
  position: relative;
  z-index: 1;
  display: block;
}

.kpi-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.kpi-card strong {
  margin: 14px 0 8px;
  color: var(--navy-950);
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.kpi-card small {
  color: var(--muted);
  font-size: 12px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.8fr);
  gap: 16px;
  margin-bottom: 16px;
}

.panel {
  padding: 24px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.panel-heading h2,
.ops-content h2 {
  margin: 0;
  color: var(--navy-950);
  font-size: 20px;
  letter-spacing: -0.025em;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend i {
  width: 16px;
  height: 3px;
  border-radius: 2px;
}

.legend-temperature {
  background: var(--teal-600);
}

.legend-probability {
  background: var(--orange-600);
}

.chart-wrap {
  width: 100%;
  min-height: 270px;
  overflow: hidden;
}

.chart-wrap svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 250px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.badge.normal {
  color: var(--green-700);
  background: var(--green-100);
}

.badge.warning {
  color: #93430f;
  background: var(--orange-100);
}

.badge.danger {
  color: var(--red-700);
  background: var(--red-100);
}

.badge.neutral {
  color: #3e5860;
  background: #e9eff0;
}

.gauge {
  height: 14px;
  margin: 34px 0 16px;
  background: #e7eded;
  border-radius: 999px;
  overflow: hidden;
}

.gauge-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--teal-600), var(--orange-600));
  border-radius: inherit;
  transition: width 360ms ease;
}

.decision-value {
  margin-bottom: 24px;
}

.decision-value strong,
.decision-value span {
  display: block;
}

.decision-value strong {
  color: var(--navy-950);
  font-size: 52px;
  line-height: 1;
  letter-spacing: -0.05em;
}

.decision-value span {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.compact-list {
  margin: 0;
}

.compact-list div {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.compact-list div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.compact-list dt {
  color: var(--muted);
  font-size: 13px;
}

.compact-list dd {
  max-width: 62%;
  margin: 0;
  text-align: right;
  font-size: 13px;
  font-weight: 800;
}

.machine-panel {
  margin-bottom: 16px;
}

.meta-text {
  color: var(--muted);
  font-size: 13px;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  font-size: 13px;
}

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

th {
  color: #50646a;
  background: #f5f8f8;
  font-size: 12px;
  letter-spacing: 0.02em;
}

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

tbody tr:hover {
  background: #f7fbfa;
}

.machine-name {
  color: var(--navy-950);
  font-weight: 800;
}

.missing-value {
  color: var(--red-700);
  font-weight: 800;
}

.ops-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.ops-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 16px;
}

.icon-box {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 13px;
  font-size: 12px;
  font-weight: 900;
}

.model-icon {
  color: #075b55;
  background: var(--teal-100);
}

.server-icon {
  color: #285eb5;
  background: var(--blue-100);
}

.deploy-icon {
  color: #97430f;
  background: var(--orange-100);
}

.ops-content .compact-list {
  margin-top: 14px;
}

.alert-list {
  display: grid;
  gap: 10px;
}

.alert-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  background: #f7f9f9;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.alert-level {
  width: 9px;
  height: 9px;
  background: var(--orange-600);
  border-radius: 50%;
}

.alert-item.danger .alert-level {
  background: var(--red-700);
}

.alert-item.normal .alert-level {
  background: var(--green-700);
}

.alert-copy strong,
.alert-copy span {
  display: block;
}

.alert-copy strong {
  margin-bottom: 3px;
  font-size: 14px;
}

.alert-copy span,
.alert-time {
  color: var(--muted);
  font-size: 12px;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 24px max(24px, calc((100% - 1240px) / 2));
  color: #b9d1d4;
  background: var(--navy-950);
  font-size: 12px;
}

footer p {
  margin: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 980px) {
  .control-panel,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ops-grid {
    grid-template-columns: 1fr;
  }

  .sync-bar {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 680px) {
  .topbar,
  .hero,
  footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-status {
    align-self: stretch;
    justify-content: center;
  }

  .topnav {
    display: none;
  }

  .page-shell {
    width: min(100% - 24px, 1240px);
    padding-top: 30px;
  }

  .hero {
    gap: 20px;
  }

  .timestamp-card {
    width: 100%;
  }

  .control-panel {
    gap: 22px;
    padding: 20px;
  }

  .sync-bar {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .sync-time {
    padding-left: 48px;
  }

  .auto-refresh {
    min-height: 38px;
    padding: 0 12px;
    background: rgb(255 255 255 / 6%);
    border-radius: 9px;
  }

  .controls,
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .kpi-card {
    min-height: 130px;
  }

  .panel {
    padding: 20px;
  }

  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .ops-card {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 12px;
  }

  .icon-box {
    width: 40px;
    height: 40px;
  }

  .alert-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .alert-time {
    grid-column: 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
