:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #17212b;
  --muted: #68707a;
  --border: #d8dee5;
  --primary: #1769ff;
  --danger: #d93636;
  --success: #1f9d55;
  --warning: #d48a00;
  --shadow: 0 10px 30px rgba(0,0,0,0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body { min-height: 100vh; }

.app {
  max-width: 760px;
  margin: 0 auto;
  padding: 18px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
}

.login-card { margin-top: 10vh; }

.login-form {
  display: grid;
  gap: 12px;
}

label { font-weight: 600; }

input[type="password"] {
  width: 100%;
  padding: 16px;
  font-size: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}

.hero-card { padding: 18px; }

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

h1 {
  margin: 0 0 4px;
  font-size: 28px;
}

.muted {
  color: var(--muted);
  margin: 0;
}

.status-banner {
  font-size: 17px;
  font-weight: 700;
  padding: 12px 14px;
  border-radius: 14px;
  background: #eef3ff;
  color: #123b8b;
  margin-bottom: 16px;
}

.status-banner.ok {
  background: #e8f7ee;
  color: #17613b;
}

.status-banner.error {
  background: #ffe8e8;
  color: #9d2323;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.status-item {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
}

.status-item .label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.status-item strong {
  font-size: 18px;
}

.grid-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 14px 18px;
  border: 0;
  border-radius: 16px;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.05s ease, opacity 0.2s ease;
}

.btn:active { transform: scale(0.98); }

.btn-full { width: 100%; }

.btn-small {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 14px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-secondary {
  background: #eef2f7;
  color: var(--text);
}

.btn-up {
  background: var(--success);
  color: #fff;
}

.btn-stop {
  background: var(--danger);
  color: #fff;
}

.btn-down {
  background: var(--warning);
  color: #fff;
}

.alert {
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 14px;
}

.alert-error {
  background: #ffe6e6;
  color: #9f1f1f;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.log-card.hidden { display: none; }

.log-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

pre {
  background: #0f1720;
  color: #9ef7b5;
  border-radius: 14px;
  padding: 14px;
  min-height: 180px;
  max-height: 42vh;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

@media (max-width: 640px) {
  .app { padding: 14px; }
  .grid-buttons, .status-grid { grid-template-columns: 1fr; }
  h1 { font-size: 24px; }
  .btn {
    min-height: 62px;
    font-size: 20px;
  }
  .hero-top {
    flex-direction: column;
    align-items: stretch;
  }
}
