:root {
  color-scheme: light;
  --bg: #eef3f7;
  --ink: #18212b;
  --muted: #667586;
  --panel: #ffffff;
  --line: #d8e0e8;
  --driver: #2d6cdf;
  --safety: #08805f;
  --csms: #c6532f;
  --rfp: #0f6bbf;
  --shadow: 0 20px 60px rgba(28, 42, 58, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    "Segoe UI",
    "Malgun Gothic",
    system-ui,
    sans-serif;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(238, 243, 247, 0.95)),
    var(--bg);
  color: var(--ink);
  overflow-x: hidden;
}

.global-service-top {
  position: sticky;
  top: 0;
  z-index: 80;
  border-bottom: 1px solid rgba(216, 224, 232, 0.76);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
}

.auth-locked .global-service-top {
  display: none;
}

.global-service-top-inner {
  width: min(1240px, calc(100% - 32px));
  min-height: 52px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.global-service-left,
.global-home-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.global-company {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.global-divider {
  width: 1px;
  height: 16px;
  background: var(--line);
}

.global-home-link {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.global-home-link svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.global-home-link:hover,
.global-home-link:focus-visible {
  color: var(--driver);
  outline: none;
}

.global-logout-button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

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

.shell {
  min-height: 100vh;
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.auth-gate {
  min-height: 100vh;
  padding: 24px;
  display: none;
  align-items: center;
  justify-content: center;
}

.auth-locked .auth-gate {
  display: flex;
}

.auth-locked .shell {
  display: none;
}

.auth-ready .auth-gate {
  display: none;
}

.auth-box {
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.auth-eyebrow {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.auth-box h1 {
  margin-bottom: 22px;
  font-size: 34px;
}

.auth-box label {
  display: block;
  margin-bottom: 8px;
  color: #314151;
  font-size: 14px;
  font-weight: 800;
}

.auth-row {
  display: flex;
  gap: 8px;
}

.auth-row input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid #bcc8d4;
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  font-size: 18px;
}

.auth-row input:focus {
  outline: 3px solid rgba(45, 108, 223, 0.16);
  border-color: var(--driver);
}

.auth-row button {
  min-width: 88px;
  height: 46px;
  border: 0;
  border-radius: 6px;
  background: var(--driver);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.auth-error {
  min-height: 22px;
  margin: 12px 0 0;
  color: #b32626;
  font-size: 14px;
  font-weight: 700;
}

.launch-panel {
  width: min(1240px, 100%);
  min-width: 0;
}

.masthead {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.masthead-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.logout-button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(49, 65, 81, 0.18);
  border-radius: 6px;
  background: #fff;
  color: #314151;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: 0 8px 22px rgba(30, 44, 60, 0.08);
}

.logout-button:hover,
.logout-button:focus-visible {
  outline: none;
  border-color: rgba(45, 108, 223, 0.35);
  color: var(--driver);
}

.eyebrow,
.service-meta {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.05;
  letter-spacing: 0;
}

.subtitle {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 18px;
  overflow-wrap: anywhere;
}

.status-board {
  min-width: 288px;
  padding: 14px;
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 30px rgba(30, 44, 60, 0.08);
}

.status-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #314151;
  font-size: 14px;
  font-weight: 700;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #a8b3bf;
  box-shadow: 0 0 0 4px rgba(168, 179, 191, 0.16);
}

.status-dot.is-up {
  background: #0c9b71;
  box-shadow: 0 0 0 4px rgba(12, 155, 113, 0.16);
}

.status-dot.is-down {
  background: #d54444;
  box-shadow: 0 0 0 4px rgba(213, 68, 68, 0.16);
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 18px;
  justify-content: center;
  min-width: 0;
}

.service-card {
  min-width: 0;
  max-width: 100%;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-link {
  height: 100%;
  min-width: 0;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(216, 224, 232, 0.9);
  border-radius: 8px;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.card-link:hover,
.card-link:focus-visible {
  transform: translateY(-3px);
  outline: none;
  border-color: rgba(45, 108, 223, 0.35);
  box-shadow: 0 24px 64px rgba(26, 40, 58, 0.2);
}

.has-card-action .card-link {
  height: auto;
  min-height: 236px;
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}

.card-extra-actions {
  padding: 12px 14px 14px;
  border-right: 1px solid rgba(216, 224, 232, 0.9);
  border-bottom: 1px solid rgba(216, 224, 232, 0.9);
  border-left: 1px solid rgba(216, 224, 232, 0.9);
  border-bottom-right-radius: 8px;
  border-bottom-left-radius: 8px;
  background: #fff;
}

.kakao-channel-action {
  width: 100%;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #f0d600;
  border-radius: 6px;
  background: #fee500;
  color: #181600;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0;
}

.kakao-channel-action:hover,
.kakao-channel-action:focus-visible {
  outline: none;
  border-color: #d7bf00;
  background: #f7dc00;
}

.preview-frame {
  height: 184px;
  background: #dfe7ef;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.preview-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: top center;
}

.app-preview {
  --preview-color: var(--rfp);
  --preview-accent: var(--safety);
  display: grid;
  place-items: center;
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(15, 107, 191, 0.14), rgba(8, 128, 95, 0.12)),
    #edf4fa;
}

.preview-driver {
  --preview-color: var(--driver);
  --preview-accent: #d88627;
  background:
    linear-gradient(135deg, rgba(45, 108, 223, 0.14), rgba(216, 134, 39, 0.13)),
    #edf4fa;
}

.preview-safety {
  --preview-color: var(--safety);
  --preview-accent: var(--rfp);
  background:
    linear-gradient(135deg, rgba(8, 128, 95, 0.14), rgba(15, 107, 191, 0.12)),
    #edf4fa;
}

.preview-csms {
  --preview-color: var(--csms);
  --preview-accent: #e5a600;
  background:
    linear-gradient(135deg, rgba(198, 83, 47, 0.15), rgba(229, 166, 0, 0.13)),
    #fbf2ec;
}

.preview-rfp {
  --preview-color: var(--rfp);
  --preview-accent: var(--safety);
}

.app-preview-inner {
  width: min(78%, 220px);
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid rgba(15, 107, 191, 0.18);
  border: 1px solid color-mix(in srgb, var(--preview-color) 18%, transparent);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 34px rgba(15, 107, 191, 0.12);
  box-shadow: 0 14px 34px color-mix(in srgb, var(--preview-color) 14%, transparent);
}

.app-preview-inner strong {
  color: var(--preview-color);
  font-size: 30px;
  line-height: 1;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.app-preview-lines {
  display: grid;
  gap: 5px;
}

.app-preview-lines span {
  height: 6px;
  border-radius: 999px;
  background: rgba(97, 112, 128, 0.22);
}

.app-preview-lines span:nth-child(2) {
  width: 76%;
}

.app-preview-lines span:nth-child(3) {
  width: 54%;
}

.app-preview-inner small {
  color: #314151;
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.card-body {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 14px;
}

.card-body h2 {
  margin-bottom: 0;
  font-size: 20px;
  line-height: 1.18;
  letter-spacing: 0;
}

.card-body p:not(.service-meta) {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.open-action {
  width: 100%;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: #fff;
  font-weight: 800;
}

.service-driver .open-action {
  background: var(--driver);
}

.service-safety .open-action {
  background: var(--safety);
}

.service-csms .open-action {
  background: var(--csms);
}

.service-rfp .open-action {
  background: var(--rfp);
}

.site-footer {
  width: min(1240px, 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 2px 0;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 900px) {
  .shell {
    align-items: flex-start;
    padding: 24px;
  }

  .masthead {
    display: grid;
  }

  .masthead-actions {
    width: 100%;
    align-items: stretch;
  }

  .logout-button {
    justify-self: end;
  }

  .status-board {
    min-width: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .service-grid {
    grid-template-columns: repeat(2, minmax(260px, 340px));
  }

  .card-link {
    min-height: 0;
  }

  .site-footer {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .shell {
    padding: 18px;
  }

  .auth-gate {
    padding: 18px;
  }

  .auth-box {
    padding: 22px;
  }

  .auth-row {
    display: grid;
  }

  .auth-row button {
    width: 100%;
  }

  h1 {
    font-size: 34px;
  }

  .subtitle {
    font-size: 16px;
    max-width: calc(100vw - 36px);
    line-height: 1.45;
  }

  .status-board {
    width: calc(100vw - 36px);
    max-width: calc(100vw - 36px);
    grid-template-columns: 1fr;
  }

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

  .service-grid,
  .service-card,
  .card-link {
    width: calc(100vw - 36px);
    max-width: calc(100vw - 36px);
  }

  .preview-frame {
    height: 190px;
  }

  .card-body {
    padding: 18px;
  }

  .site-footer {
    width: calc(100vw - 36px);
    max-width: calc(100vw - 36px);
    flex-direction: column;
    align-items: flex-start;
  }
}
