:root {
  --red: #c92329;
  --red-dark: #9f151b;
  --ink: #121820;
  --muted: #657080;
  --line: #dfe4ea;
  --surface: #ffffff;
  --canvas: #f3f5f7;
  --green: #20a35a;
  font-family: "Noto Sans KR", "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--canvas); }
button, a { font: inherit; }

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 18px max(24px, calc((100vw - 1180px) / 2));
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand img { width: 54px; height: 54px; border-radius: 14px; }
.brand div { display: flex; flex-direction: column; gap: 2px; }
.brand strong { font-size: 21px; letter-spacing: -.02em; }
.brand span { color: var(--muted); font-size: 14px; }

main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 56px 0 36px; }
.hero { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 32px; }
.eyebrow { margin: 0 0 10px; color: var(--red); font-weight: 800; }
h1 { margin: 0; font-size: clamp(38px, 5vw, 64px); line-height: 1.16; letter-spacing: -.045em; }
.lead { margin: 18px 0 0; color: var(--muted); font-size: 18px; line-height: 1.6; }
.primary {
  flex: 0 0 auto; border: 0; border-radius: 12px; padding: 15px 22px;
  color: white; background: var(--red); font-weight: 800; cursor: pointer;
  box-shadow: 0 8px 22px rgba(201,35,41,.2);
}
.primary:hover { background: var(--red-dark); }
.primary:disabled { opacity: .65; cursor: wait; }
.refresh-icon { display: inline-block; margin-right: 5px; font-size: 20px; }
.primary.loading .refresh-icon { animation: spin .8s linear infinite; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 28px; box-shadow: 0 12px 38px rgba(19,31,48,.06); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0 0 5px; font-size: 25px; }
.panel-head p { margin: 0; color: var(--muted); }
.badge { padding: 8px 12px; border-radius: 999px; background: #eef1f4; color: #596270; font-size: 14px; font-weight: 800; }
.badge.online { background: #e7f7ee; color: #148548; }
.badge.error { background: #fff0f0; color: var(--red-dark); }

.state { min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; text-align: center; }
.state strong { font-size: 20px; }
.state span { color: var(--muted); line-height: 1.55; }
.state-icon { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: #eef1f4; color: #596270; font-size: 30px; font-weight: 900; }
.state-icon.error { background: #fff0f0; color: var(--red); }
.spinner { width: 40px; height: 40px; border: 4px solid #eceff2; border-top-color: var(--red); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }

.device-list { display: grid; gap: 12px; padding-top: 20px; }
.device {
  display: grid; grid-template-columns: minmax(220px, 1.5fr) minmax(180px, .8fr) minmax(100px, .45fr) auto;
  gap: 20px; align-items: center; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfd;
}
.device-name { display: flex; align-items: center; min-width: 0; gap: 12px; }
.status-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(32,163,90,.1); flex: 0 0 auto; }
.device-name div { min-width: 0; }
.device-name strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 18px; }
.device-name span, .device-meta span { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.device-meta strong { font-size: 16px; }
.open-link { text-decoration: none; border-radius: 10px; padding: 12px 16px; color: white; background: var(--red); font-weight: 800; text-align: center; white-space: nowrap; }
.open-link:hover { background: var(--red-dark); }

.help-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-top: 22px; }
.help-grid article { padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.72); }
.step { color: var(--red); font-size: 13px; font-weight: 900; }
.help-grid h3 { margin: 9px 0 7px; font-size: 17px; }
.help-grid p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.privacy { text-align: center; margin: 26px 0 0; color: var(--muted); font-size: 13px; }
footer { display: flex; justify-content: space-between; width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 20px 0 36px; color: #7b8490; font-size: 12px; }

@media (max-width: 780px) {
  main { width: min(100% - 28px, 680px); padding-top: 34px; }
  .topbar { padding: 14px 18px; }
  .brand img { width: 46px; height: 46px; border-radius: 12px; }
  .brand strong { font-size: 18px; }
  .hero { display: block; }
  h1 { font-size: 38px; }
  .lead { font-size: 16px; }
  .primary { width: 100%; margin-top: 24px; }
  .panel { padding: 20px 16px; border-radius: 16px; }
  .device { grid-template-columns: 1fr auto; gap: 13px 12px; }
  .device-name { grid-column: 1 / -1; }
  .device-meta { min-width: 0; }
  .open-link { grid-row: 2 / 4; grid-column: 2; align-self: stretch; display: grid; place-items: center; }
  .help-grid { grid-template-columns: 1fr; }
  footer { width: calc(100% - 28px); }
}
