:root {
  --page: #f5f7f9;
  --surface: #ffffff;
  --ink: #151b20;
  --muted: #65717b;
  --subtle: #8a949d;
  --line: #dde4ea;
  --navy: #162433;
  --blue: #2563a9;
  --teal: #087761;
  --amber: #ad6a18;
  --red: #b84545;
  --shadow: 0 18px 48px rgba(22, 36, 51, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--ink);
  background: var(--page);
  font-family: "Pretendard", "Noto Sans KR", "Segoe UI", Arial, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.site-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 22px 0 56px;
}

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 22px;
  align-items: center;
  min-height: 58px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 220px;
}

.brand-mark {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: var(--navy);
  color: #ffffff;
  font-size: 13px;
  font-weight: 850;
}

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

.brand-text strong {
  overflow: hidden;
  font-size: 16px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-text small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.main-nav {
  display: flex;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}

.main-nav a,
.login-button,
.refresh-button,
.open-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 780;
  white-space: nowrap;
}

.main-nav a {
  padding: 0 14px;
  color: #384650;
}

.main-nav a:hover {
  background: #e8edf1;
}

.login-button {
  padding: 0 16px;
  border: 1px solid var(--navy);
  background: var(--navy);
  color: #ffffff;
}

.hero {
  max-width: 760px;
  padding: 78px 0 46px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(52px, 7vw, 88px);
  line-height: 0.98;
  font-weight: 840;
  letter-spacing: 0;
}

.lead {
  max-width: 680px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.75;
}

.workspace-section {
  margin-top: 4px;
}

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

.section-head > div {
  min-width: 0;
}

.section-head h2 {
  margin: 0;
  font-size: 27px;
  line-height: 1.2;
}

.refresh-button {
  cursor: pointer;
  padding: 0 13px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: #3c4953;
}

.refresh-button:disabled {
  cursor: default;
  color: var(--subtle);
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.service-card {
  display: flex;
  min-height: 260px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.service-accent {
  height: 5px;
  background: var(--blue);
}

.service-card[data-service-id="pt"] .service-accent {
  background: var(--teal);
}

.service-card[data-service-id="se"] .service-accent {
  background: var(--amber);
}

.service-card[data-service-id="vg"] .service-accent {
  background: var(--red);
}

.service-card[data-service-id="sr"] .service-accent {
  background: #5e6670;
}

.service-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  padding: 22px;
}

.service-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.service-code {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.service-card h3 {
  margin: 8px 0 0;
  font-size: 25px;
  line-height: 1.15;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 0 10px;
  border: 1px solid rgba(101, 113, 123, 0.24);
  border-radius: 999px;
  background: #eef2f4;
  color: #596671;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.service-card[data-state="online"] .badge {
  border-color: rgba(8, 119, 97, 0.24);
  background: #e8f5f1;
  color: var(--teal);
}

.service-card[data-state="protected"] .badge {
  border-color: rgba(37, 99, 169, 0.24);
  background: #e8f0fb;
  color: var(--blue);
}

.service-card[data-state="offline"] .badge {
  border-color: rgba(184, 69, 69, 0.26);
  background: #f8eaea;
  color: var(--red);
}

.desc {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.62;
}

.open-link {
  width: 100%;
  margin-top: auto;
  border: 1px solid #172330;
  background: #172330;
  color: #ffffff;
}

.open-link:hover,
.login-button:hover {
  background: #263848;
}

@media (max-width: 1080px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .main-nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 4px;
  }

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

@media (max-width: 680px) {
  .site-shell {
    width: min(100% - 28px, 620px);
    padding-top: 14px;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }

  .brand {
    min-width: 0;
  }

  .main-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    gap: 7px;
    overflow-x: auto;
    white-space: nowrap;
  }

  .main-nav a {
    padding: 0;
    font-size: 12px;
  }

  .login-button {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    max-width: 42vw;
    overflow: hidden;
    padding: 0 12px;
    text-overflow: ellipsis;
  }

  .hero {
    padding: 48px 0 34px;
  }

  .hero h1 {
    font-size: 50px;
  }

  .lead {
    font-size: 16px;
  }

  .section-head {
    align-items: flex-end;
    gap: 10px;
  }

  .section-head h2 {
    font-size: 24px;
  }

  .refresh-button {
    flex: 0 0 auto;
    padding: 0 11px;
  }

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

  .service-card {
    min-height: 220px;
  }
}
