:root {
  --bg: #0a0c10;
  --panel: #151922;
  --panel-2: #1d2330;
  --text: #eef2f7;
  --muted: #9aa6b8;
  --accent: #e53935;
  --accent-2: #ff7043;
  --line: rgba(255, 255, 255, 0.08);
  --ok: #2e7d32;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top, rgba(229, 57, 53, 0.22), transparent 30%),
    linear-gradient(180deg, #0b0e13 0%, #07090d 100%);
  color: var(--text);
  font: 16px/1.5 "SF Pro Display", "Segoe UI", sans-serif;
}

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

.app-shell {
  width: min(100%, 720px);
  margin: 0 auto;
  min-height: 100vh;
  padding: env(safe-area-inset-top) 16px calc(86px + env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0 12px;
}

.brand {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.badge {
  background: rgba(229, 57, 53, 0.16);
  border: 1px solid rgba(229, 57, 53, 0.3);
  color: #ffd7d1;
  padding: 8px 12px;
  border-radius: 999px;
}

.badge-link {
  display: inline-flex;
  align-items: center;
}

.page {
  display: grid;
  gap: 16px;
}

.hero h1,
.section-head h1 {
  margin: 0 0 8px;
  font-size: 1.8rem;
}

.hero p,
.card p,
.list {
  color: var(--muted);
}

.grid,
.stack {
  display: grid;
  gap: 14px;
}

.card {
  background: linear-gradient(180deg, rgba(29, 35, 48, 0.95), rgba(19, 24, 33, 0.98));
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}

.card.accent {
  background: linear-gradient(180deg, rgba(229, 57, 53, 0.24), rgba(29, 35, 48, 0.98));
}

.notice {
  border-radius: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
}

.notice p {
  margin: 6px 0 0;
}

.notice-success {
  background: rgba(46, 125, 50, 0.14);
  border-color: rgba(46, 125, 50, 0.28);
}

.notice-error {
  background: rgba(183, 28, 28, 0.14);
  border-color: rgba(183, 28, 28, 0.28);
}

.notice-info {
  background: rgba(255, 112, 67, 0.14);
  border-color: rgba(255, 112, 67, 0.28);
}

.metric {
  font-size: 2rem;
  font-weight: 800;
  color: white;
}

.button,
button,
input,
select,
textarea {
  min-height: 44px;
  border-radius: 14px;
}

.button,
button {
  border: 0;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: white;
  font-weight: 700;
  padding: 12px 16px;
  cursor: pointer;
}

.button.ghost {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
}

.button.danger {
  background: linear-gradient(180deg, #b71c1c, #d84315);
}

.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

label {
  display: grid;
  gap: 8px;
}

input,
select,
textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  padding: 12px 14px;
  color: var(--text);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stack.tight {
  gap: 10px;
}

.subcard {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.muted-text {
  color: var(--muted);
  font-size: 0.95rem;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.status-tile {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
}

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

.list {
  padding-left: 18px;
  margin: 0;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 720px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(7, 9, 13, 0.92);
  backdrop-filter: blur(14px);
}

.bottom-nav a {
  text-align: center;
  padding: 12px 8px;
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.bottom-nav a.active {
  color: white;
  background: rgba(229, 57, 53, 0.18);
}

.codeblock {
  display: block;
  padding: 12px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.28);
  overflow-wrap: anywhere;
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto;
    transition: none !important;
    animation: none !important;
  }
}

@media (min-width: 720px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
