:root {
  --bg: #0f2430;
  --panel: #173444;
  --panel-2: #1d3f52;
  --text: #eef6fa;
  --muted: #9db4c0;
  --accent: #7ec8e3;
  --accent-strong: #9ad7ef;
  --mobile: #ffb070;
  --desktop: #9ec4d8;
  --ok: #7dcea0;
  --danger: #e8a0a0;
  --radius: 16px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(1200px 600px at 10% -10%, #1a4558 0%, var(--bg) 55%);
  color: var(--text);
  font: 400 16px/1.45 var(--font);
  -webkit-tap-highlight-color: transparent;
}
body { padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: 18px 16px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.brand strong { font-size: 1.15rem; letter-spacing: -0.02em; }
.brand span { color: var(--muted); font-size: 0.82rem; }

.ghost, .primary, .row-btn {
  border: 0;
  border-radius: 999px;
  font: 700 14px/1 var(--font);
  cursor: pointer;
}
.ghost {
  background: transparent;
  color: var(--muted);
  padding: 10px 12px;
}
.primary {
  background: var(--accent-strong);
  color: #12384a;
  padding: 12px 16px;
  width: 100%;
}
.primary:disabled { opacity: 0.55; cursor: default; }

.card {
  background: color-mix(in srgb, var(--panel) 92%, white 8%);
  border: 1px solid color-mix(in srgb, #fff 10%, transparent);
  border-radius: var(--radius);
  padding: 14px;
}
.card h2 {
  margin: 0 0 10px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

label {
  display: block;
  margin: 10px 0 6px;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
input, textarea {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--panel-2);
  color: var(--text);
  font: 400 16px/1.4 var(--font);
}
textarea { min-height: 120px; resize: vertical; }

.status {
  display: none;
  border-radius: 12px;
  padding: 10px 12px;
  background: #3a2a18;
  color: #ffd7b0;
  font-size: 0.92rem;
}
.status.show { display: block; }
.status.ok { background: #1d3a2a; color: #c8f0d8; }
.status.err { background: #3a1d1d; color: #ffd0d0; }

.list { display: flex; flex-direction: column; gap: 8px; }
.row-btn {
  width: 100%;
  text-align: left;
  background: var(--panel-2);
  color: var(--text);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}
.row-btn:active { filter: brightness(1.08); }
.row-meta { min-width: 0; flex: 1; }
.row-title { font-weight: 700; font-size: 0.95rem; }
.row-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tags { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  background: #2a4a5c;
}
.tag.mobile { background: #4a3018; color: var(--mobile); }
.tag.desktop { background: #243848; color: var(--desktop); }
.tag.matter { background: #1d3a2a; color: var(--ok); }

.hidden { display: none !important; }
.toolbar { display: flex; gap: 8px; }
.toolbar .primary, .toolbar .ghost {
  flex: 1;
}

.detail-title { margin: 0 0 4px; font-size: 1.2rem; }
.detail-sub { margin: 0 0 12px; color: var(--muted); font-size: 0.85rem; }
.mono {
  white-space: pre-wrap;
  background: var(--panel-2);
  border-radius: 12px;
  padding: 12px;
  font-size: 0.92rem;
  max-height: 45vh;
  overflow: auto;
}

.empty {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 8px 2px;
}
