@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css');

:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --ink: #111827;
  --muted: #64748b;
  --line: #dbe3ef;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #0f766e;
  --success: #059669;
  --danger: #dc2626;
  --warning: #d97706;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Pretendard Variable", Pretendard, system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

button { font: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.topbar h1,
.section-heading h2 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 { font-size: 1.2rem; }

.eyebrow {
  margin: 0 0 0.25rem;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.session {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.ghost-button {
  min-height: 2.25rem;
  padding: 0 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--danger);
  cursor: pointer;
}

.shell {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.9fr);
  gap: 1.25rem;
  width: min(1180px, calc(100% - 2rem));
  margin: 1.5rem auto;
}

.control-surface,
.activity-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.control-surface { padding: clamp(1rem, 3vw, 1.75rem); }
.activity-panel { padding: 1rem; }

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.section-heading h2 { font-size: 1.35rem; }
.section-heading.compact h2 { font-size: 1.05rem; }

.connection-pill {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  white-space: nowrap;
}

.dot {
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.45rem;
  border-radius: 999px;
  background: var(--warning);
}

.dot.online { background: var(--success); }
.dot.offline { background: var(--danger); }
.dot.warning { background: var(--warning); }

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.metric {
  min-height: 6.5rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.metric-label {
  display: block;
  margin-bottom: 0.55rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.metric strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 1.08rem;
  letter-spacing: 0;
}

.click-button {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 12rem;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  cursor: pointer;
  box-shadow: 0 16px 28px rgba(37, 99, 235, 0.24);
}

.click-button span {
  font-size: clamp(2.4rem, 8vw, 4.25rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
}

.click-button small {
  margin-top: 0.7rem;
  font-size: 0.95rem;
  font-weight: 700;
  opacity: 0.86;
}

.click-button:hover { filter: brightness(1.04); }
.click-button:active { transform: translateY(1px); }
.click-button:disabled {
  background: #94a3b8;
  box-shadow: none;
  cursor: wait;
}

.log-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 28rem;
  max-height: 38rem;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.log-item {
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.log-item strong {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
}

.log-item span,
.empty-log {
  color: var(--muted);
  font-size: 0.78rem;
}

.empty-log {
  display: grid;
  min-height: 10rem;
  place-items: center;
  text-align: center;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  max-width: min(24rem, calc(100vw - 2rem));
  padding: 0.9rem 1rem;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: var(--shadow);
  transform: translateY(140%);
  transition: transform 180ms ease;
}

.toast.show { transform: translateY(0); }
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .status-grid { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; }
  .session { flex-wrap: wrap; justify-content: flex-end; }
}

@media (max-width: 520px) {
  .topbar { padding: 0.9rem 1rem; }
  .shell { width: min(100% - 1rem, 1180px); margin-top: 0.5rem; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .click-button { min-height: 9rem; }
}
