:root {
  --bg: #0a0a0b;
  --surface: #161618;
  --surface-2: #1f1f22;
  --surface-3: #2a2a2e;
  --line: #2e2e33;
  --text: #f5f5f7;
  --text-2: #a8a8b0;
  --text-3: #74747c;
  --gold: #f4c542;
  --gold-ink: #1a1405;
  --red: #e5483b;
  --bronze: #c9a27a;
  --good: #3ecf8e;
  --warn: #f5a524;
  --bad: #ff5a52;
  --radius: 18px;
  --radius-sm: 12px;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Inter, system-ui, sans-serif;
  font-size: 16px; line-height: 1.35;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
.num { font-variant-numeric: tabular-nums; }

/* ---- Header ---- */
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand img {
  width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex: none;
  background: #fff; box-shadow: 0 0 0 2px rgba(244,197,66,.35), 0 6px 24px rgba(229,72,59,.25);
}
.brand > div { min-width: 0; }
.brand h1 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand p { margin: 1px 0 0; font-size: 13px; color: var(--text-2); }

.chip-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex: 1 0 auto; min-width: 72px; padding: 11px 12px; border-radius: 999px;
  border: 1.5px solid var(--surface-3); color: var(--text); font-weight: 600; font-size: 15px;
  background: transparent; transition: background .15s, color .15s, border-color .15s;
}
.chip.active { background: var(--text); color: #0a0a0b; border-color: var(--text); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border-radius: 999px; font-weight: 650;
  background: var(--surface-3); color: var(--text);
}
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.primary { background: var(--gold); color: var(--gold-ink); }
.btn.danger { background: rgba(255,90,82,.14); color: var(--bad); }
.btn.ghost { background: transparent; border: 1.5px solid var(--surface-3); }
.btn.small { padding: 7px 12px; font-size: 14px; }

.muted { color: var(--text-2); }
.faint { color: var(--text-3); }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 140%);
  background: var(--surface-3); color: var(--text); padding: 12px 18px; border-radius: 999px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,.5); transition: transform .25s ease; z-index: 100; max-width: calc(100vw - 32px);
}
.toast.show { transform: translate(-50%, 0); }
.toast.error { background: var(--bad); color: #fff; }

/* ---- Dijalog za potvrda (namesto browser confirm, koj nekade e blokiran) ---- */
.ask { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px; background: rgba(0,0,0,.65); }
.ask .box { width: 100%; max-width: 360px; background: var(--surface-2); border-radius: 22px; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.ask p { margin: 0 0 18px; font-size: 16px; line-height: 1.45; white-space: pre-line; max-height: 60vh; overflow-y: auto; }
.ask .row { display: flex; gap: 10px; }
.ask .row .btn { flex: 1; padding: 14px; }

input[type=text], input[type=number], input[type=password], input[type=date], select {
  background: var(--surface-2); border: 1.5px solid var(--surface-3); border-radius: var(--radius-sm);
  padding: 10px 12px; outline: none; min-width: 0;
}
input:focus, select:focus { border-color: var(--gold); }
