/* Dark mobile-first shell; system fonts only, no external assets. */
:root { color-scheme: dark; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: #111827;
  color: #f3f4f6;
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 12px 12px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100dvh;
}

.loading { text-align: center; color: #9ca3af; margin-top: 40vh; }
h1 { font-size: 1.4rem; margin: 0 0 8px; }
h2 { font-size: 1.05rem; margin: 0 0 10px; }
p { margin: 6px 0; }

.card { background: #1f2937; border-radius: 14px; padding: 14px; }
.card.warn { border: 1px solid #b45309; }
.card.accent { border: 1px solid #059669; }

.muted { color: #9ca3af; }
.ok { color: #34d399; }
.error { color: #f87171; }
.big { font-size: 1.7rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.progress { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }

.btn {
  appearance: none;
  border: 1px solid #374151;
  background: #111827;
  color: #f3f4f6;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 1rem;
  min-height: 44px;
  cursor: pointer;
}
.btn:active { transform: scale(0.98); }
.btn.primary { background: #059669; border-color: #059669; color: #fff; font-weight: 600; }
.btn.ghost { background: transparent; }

.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; font-size: 0.9rem; color: #9ca3af; }
.field input, input.num {
  background: #111827;
  border: 1px solid #374151;
  color: #f3f4f6;
  border-radius: 10px;
  padding: 10px;
  font-size: 1rem;
  min-height: 44px;
  width: 100%;
}
input.num { width: 96px; }
.field.grow { flex: 1; }

.item { padding: 10px 0; border-top: 1px solid #374151; }
.item:first-of-type { border-top: none; }
.item-name { display: block; margin-bottom: 8px; }

.hrow { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 1px solid #273244; }
.hrow:first-of-type { border-top: none; }
.num-cell { font-variant-numeric: tabular-nums; }

details summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }

#toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(80px);
  background: #374151;
  color: #f9fafb;
  padding: 10px 16px;
  border-radius: 10px;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
  max-width: 90vw;
  z-index: 10;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
