:root {
  --accent: #c2410c;
  --accent-ink: #ffffff;
  --bg: #f7f6f3;
  --surface: #ffffff;
  --text: #1c1917;
  --muted: #6b6560;
  --border: #e7e3de;
  --danger: #b91c1c;
  --ok: #15803d;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 6px 20px -8px rgba(0,0,0,.12);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --surface-2: #f3f1ee;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.45; color: var(--text); background: var(--bg); min-height: 100dvh; }
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
[hidden] { display: none !important; }
.ico { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex: none; }
.ico--lg { width: 28px; height: 28px; }

.container { max-width: 760px; margin: 0 auto; padding: 0 16px; }

.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: .02em; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand__mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 900; }

/* Przyciski */
.btn { -webkit-appearance: none; appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2; transition: background .15s, transform .05s; white-space: nowrap; }
.btn:hover { text-decoration: none; background: var(--surface-2, #f3f1ee); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: color-mix(in srgb, var(--accent) 88%, black); }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--ghost:hover { background: rgba(0,0,0,.05); }
.btn--danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, white); }
.btn--danger:hover { background: color-mix(in srgb, var(--danger) 8%, white); }
.btn--small { padding: 6px 10px; font-size: 14px; border-radius: 8px; }
.btn--big { padding: 14px 22px; font-size: 17px; border-radius: 12px; }
.btn--icon { padding: 6px 8px; min-width: 34px; }
.btn--block { width: 100%; }

/* Formularze */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field__label { font-size: 13.5px; font-weight: 600; color: var(--muted); }
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=number], .field input[type=tel], .field input[type=url], .field select, .field textarea, .input {
  width: 100%; font: inherit; font-size: 16px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.field textarea { min-height: 72px; resize: vertical; }
.field--big input { font-size: 19px; padding: 14px 14px; }
.grid2 { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.hint { font-size: 13px; color: var(--muted); margin: 4px 0 0; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track { width: 44px; height: 26px; border-radius: 13px; background: #d6d3d1; position: relative; transition: background .2s; flex: none; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.switch input:checked + .switch__track { background: var(--ok); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.alert { padding: 12px 14px; border-radius: 10px; font-size: 14.5px; }
.alert--error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert--ok { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--danger); color: #fff; font-size: 12px; font-weight: 700; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #f3f1ee; color: var(--muted); }
.tag--ok { background: #dcfce7; color: #166534; }
.tag--busy { background: #fee2e2; color: #991b1b; }
.tag--new { background: var(--danger); color: #fff; }

.langswitch { display: inline-flex; gap: 2px; background: rgba(0,0,0,.05); border-radius: 999px; padding: 3px; }
.langswitch__item { padding: 4px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.langswitch__item:hover { text-decoration: none; color: var(--text); }
.langswitch__item.is-active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.12); }

/* Modal (panel) i sheet (menu) */
.modal, .sheet { position: fixed; inset: 0; z-index: 100; }
.modal__backdrop, .sheet__backdrop { position: absolute; inset: 0; background: rgba(28,25,23,.45); backdrop-filter: blur(2px); }
.modal__box { position: relative; margin: 6vh auto; width: min(560px, calc(100% - 24px)); max-height: 88vh; overflow: auto; background: var(--surface); border-radius: 16px; padding: 22px; box-shadow: 0 20px 60px -10px rgba(0,0,0,.35); }
.modal__title { font-size: 20px; margin-bottom: 14px; }
.modal__actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.sheet__panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 88dvh; overflow: auto; background: var(--surface); border-radius: 18px 18px 0 0; padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px -10px rgba(0,0,0,.35); animation: sheetIn .22s ease-out; }
.sheet__handle { width: 40px; height: 5px; border-radius: 3px; background: var(--border); margin: 4px auto 12px; }
@keyframes sheetIn { from { transform: translateY(30px); opacity: .6; } to { transform: none; opacity: 1; } }

.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 200; background: #1c1917; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14.5px; font-weight: 600; box-shadow: 0 8px 30px -8px rgba(0,0,0,.5); max-width: calc(100% - 32px); text-align: center; }
.toast--error { background: var(--danger); }
.toast--ok { background: var(--ok); }

.copyrow { display: flex; gap: 8px; align-items: center; }
.copyrow__text { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 14px; padding: 9px 12px; background: var(--surface-2, #f3f1ee); border-radius: 8px; }
.empty { color: var(--muted); text-align: center; padding: 40px 16px; }
.loading { color: var(--muted); text-align: center; padding: 40px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.mt { margin-top: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
