body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: #f5f7fa;
  color: #1f2937;
}

header {
  background: #111827;
  color: white;
  padding: 1.5rem;
}

.header-bar {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.header-bar h1,
.header-bar p {
  margin-left: 0;
  margin-right: 0;
}

.logout-form {
  margin: 0;
}

.header-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
  min-width: 280px;
}

.quick-mode-form {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
}

.quick-mode-label {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0;
  color: white;
}

.quick-mode-label input {
  width: auto;
}

.quick-mode-status {
  margin-top: 0;
  max-width: 340px;
  text-align: right;
}

.header-note {
  margin: 0;
  max-width: 340px;
  color: #cbd5e1;
  font-size: 0.95rem;
  text-align: right;
}

main {
  max-width: 1100px;
  margin: 1.5rem auto;
  padding: 0 1rem;
}

.card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card h2 {
  margin-top: 0;
}

.card-note {
  margin-top: -0.25rem;
  margin-bottom: 1rem;
  color: #475569;
}

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.grid > div {
  background: #f8fafc;
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.grid > div strong {
  display: block;
  line-height: 1.35;
}

.grid > div span {
  display: block;
  color: #0f172a;
  word-break: break-word;
}

.grid .grid-wide {
  grid-column: 1 / -1;
}

#latest_order_preview_result,
#latest_order_client_order_id,
#latest_order_coinbase_order_id,
#latest_order_submitted_at,
#latest_order_last_fill_at,
#latest_order_last_update_at,
#unresolved_live_order,
#open_live_orders,
#websocket_last_error,
#shared_state_generated_at,
#bootstrap_message,
#recovery_message,
#smoke_test_pause_reason,
#smoke_test_last_transition_at {
  display: block;
  white-space: pre-wrap;
  word-break: break-word;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

input,
select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #ffffff;
  font-size: 1rem;
}

.form-row {
  margin-bottom: 1rem;
}

.checkbox-row label {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.checkbox-row input {
  width: auto;
}

.form-actions {
  text-align: right;
}

button {
  border: none;
  background: #2563eb;
  color: white;
  padding: 0.85rem 1.25rem;
  border-radius: 10px;
  font-size: 1rem;
  cursor: pointer;
}

button:hover {
  background: #1d4ed8;
}

.secondary-button {
  background: #334155;
}

.secondary-button:hover {
  background: #1f2937;
}

.status-message {
  margin-top: 1rem;
  font-size: 0.95rem;
}

.status-message.success {
  color: #15803d;
}

.status-message.error {
  color: #b91c1c;
}

.is-hidden {
  display: none !important;
}

.summary-controls {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 1rem;
}

.summary-value {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.summary-chart {
  display: grid;
  gap: 0.75rem;
}

.chart-bar {
  height: 2.25rem;
  background: #e0f2fe;
  border-radius: 999px;
  position: relative;
  overflow: hidden;
}

.chart-label {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.95rem;
  color: #1f2937;
}

.startup-checks {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.startup-check {
  border: 1px solid #dbe4f0;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  background: #f8fafc;
}

.startup-check strong {
  display: block;
  margin-bottom: 0.35rem;
}

.startup-check.pass {
  border-color: #86efac;
  background: #f0fdf4;
}

.startup-check.fail {
  border-color: #fca5a5;
  background: #fef2f2;
}

.startup-check.skipped {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.auth-shell {
  width: min(100%, 420px);
  margin: 0;
  padding: 0;
}

.auth-card {
  margin-bottom: 0;
}

.auth-kicker {
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  color: #475569;
}

.auth-help {
  margin-top: -0.25rem;
  color: #475569;
  font-size: 0.95rem;
}

.auth-status {
  margin-bottom: 1rem;
}

@media (max-width: 700px) {
  .header-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-actions {
    align-items: stretch;
    min-width: 0;
    width: 100%;
  }

  .quick-mode-form {
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .quick-mode-status,
  .header-note {
    max-width: none;
    text-align: left;
  }

  .grid,
  .summary-controls {
    grid-template-columns: 1fr;
  }
}
