/* Wspólne tokeny i elementy bazowe. Motyw: dziennik odkrywcy – papier, atrament, cynober. */
:root {
  --paper: #f3ecdc;
  --paper-2: #e9dfc8;
  --card: #fbf7ec;
  --ink: #1d2a2c;
  --ink-soft: #566360;
  --line: #d6c9aa;
  --accent: #c0431b;
  --accent-ink: #fff7ee;
  --teal: #1d5c58;
  --gold: #b3862a;
  --good: #2f7a46;
  --bad: #b3261e;
  --shadow: 0 1px 0 rgba(29, 42, 44, .06), 0 8px 24px -12px rgba(29, 42, 44, .25);
  --radius: 12px;
  --font-display: 'Fraunces', 'Georgia', serif;
  --font-body: 'Karla', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .3  0 0 0 0 .22  0 0 0 0 .1  0 0 0 .09 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #12181a;
    --paper-2: #1a2326;
    --card: #1e282b;
    --ink: #efe8d6;
    --ink-soft: #a3aea9;
    --line: #34423f;
    --accent: #f0814f;
    --accent-ink: #1a0f08;
    --teal: #66b8ad;
    --gold: #d9ae55;
    --good: #6fc089;
    --bad: #ff8a80;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 10px 28px -12px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #12181a;
  --paper-2: #1a2326;
  --card: #1e282b;
  --ink: #efe8d6;
  --ink-soft: #a3aea9;
  --line: #34423f;
  --accent: #f0814f;
  --accent-ink: #1a0f08;
  --teal: #66b8ad;
  --gold: #d9ae55;
  --good: #6fc089;
  --bad: #ff8a80;
  --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 10px 28px -12px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; font-size: calc(100% * var(--fs, 1)); }
body {
  margin: 0;
  background: var(--paper) var(--grain);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -.01em;
  margin: 0 0 .5em;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 .8em; }
a { color: var(--teal); }
img { max-width: 100%; display: block; }
.muted { color: var(--ink-soft); }
.hide { display: none !important; }

.btn {
  --b: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 48px; padding: .6em 1.2em;
  border: 2px solid var(--b); border-radius: 10px;
  background: transparent; color: var(--ink);
  font: 700 1rem/1.1 var(--font-body);
  cursor: pointer; text-decoration: none;
  transition: transform .08s ease, background .15s, color .15s, opacity .15s;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-primary { --b: var(--accent); background: var(--accent); color: var(--accent-ink); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ghost:hover { background: var(--paper-2); }
.btn-good { --b: var(--good); background: var(--good); color: #fff; }
.btn-bad { --b: var(--bad); color: var(--bad); }
.btn-sm { min-height: 38px; padding: .35em .8em; font-size: .9rem; border-width: 1.5px; }
.btn-block { display: flex; width: 100%; }

input, select, textarea {
  width: 100%;
  font: inherit; color: var(--ink);
  background: var(--card);
  border: 2px solid var(--line); border-radius: 10px;
  padding: .7em .85em; min-height: 48px;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 25%, transparent); }
input[type="checkbox"], input[type="radio"] { width: 1.2em; height: 1.2em; min-height: 0; accent-color: var(--accent); }
label { display: block; font-weight: 600; font-size: .92rem; }
label > input, label > select, label > textarea { margin-top: .3em; font-weight: 400; }
label.check { display: flex; align-items: center; gap: .6em; font-weight: 500; }

.alert { padding: .8em 1em; border-radius: 10px; border: 1.5px solid; margin-bottom: 1em; font-size: .95rem; }
.alert-bad { border-color: var(--bad); color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.alert-good { border-color: var(--good); color: var(--good); background: color-mix(in srgb, var(--good) 10%, transparent); }

.chip {
  display: inline-flex; align-items: center; gap: .4em;
  padding: .2em .65em; border: 1.5px solid var(--line); border-radius: 999px;
  font-size: .8rem; font-weight: 700; color: var(--ink-soft); background: transparent; white-space: nowrap;
}
.chip i { font-size: .85em; }

.leaflet-container { font-family: var(--font-body); }
