:root {
  --bg: #0D0D0C; --card: #161614; --card2: #1D1C19; --tile: #26251F;
  --line: #262521; --line2: #2E2C28; --line3: #4A4842;
  --cream: #EFE9DD; --muted: #A8A296; --dim: #8A857B; --past: #77736A;
  --late: #F08A5D; --late-bg: rgba(232,119,74,0.16); --late-line: rgba(232,119,74,0.55);
  --wait: #8FB3D9; --ok: #A9C98F;
  --serif: 'Cormorant Garamond', serif; --sans: 'IBM Plex Sans', sans-serif; --mono: 'IBM Plex Mono', monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--cream); font-family: var(--sans); font-size: 16px; line-height: 1.35; }
a { color: var(--cream); }
a:hover { color: #fff; }
button, input, select, textarea { font-family: inherit; font-size: 16px; color: var(--cream); }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.serif { font-family: var(--serif); font-weight: 600; }
.brand { font-family: var(--serif); font-weight: 600; letter-spacing: 0.14em; }
.cap { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.hidden { display: none !important; }

/* ── Telefon: kolumna ── */
.wrap { max-width: 520px; margin: 0 auto; padding-bottom: 24px; }
.wrap.has-bar { padding-bottom: 120px; }
.top { padding: 14px 16px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.back { display: flex; align-items: center; gap: 6px; text-decoration: none; font-size: 15px; color: var(--muted); min-height: 44px; }
.head { padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 6px; }
.head h1 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 34px; line-height: 1.05; }
.box { margin: 12px 16px 0; background: var(--card); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.box.tight { gap: 0; }
.row2 { margin: 12px 16px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.row2 > .box { margin: 0; padding: 14px 16px; gap: 4px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv > span:first-child { color: var(--muted); flex: none; }
.kv > span:last-child { text-align: right; overflow-wrap: anywhere; }
.big-mono { font-family: var(--mono); font-size: 22px; font-weight: 500; }

.steps { display: flex; align-items: center; gap: 4px; height: 14px; }
.steps > i { flex: 1 1 0; border-radius: 2px; height: 6px; background: var(--line2); }
.steps > i.done { background: var(--dim); }
.steps > i.cur { height: 14px; background: var(--cream); }
.steps.wait > i.cur { background: var(--wait); }
.status-label { font-family: var(--serif); font-weight: 600; font-size: 28px; line-height: 1.1; }
.status-label.wait { color: var(--wait); }

.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; background: var(--bg); border-radius: 12px; padding: 4px; }
.seg button { min-height: 44px; border-radius: 9px; border: 0; background: transparent; color: var(--muted); font-size: 15px; font-weight: 500; cursor: pointer; }
.seg button.on { background: var(--cream); color: var(--bg); font-weight: 600; }

.btn { min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line3); background: transparent; color: var(--cream); display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; font-size: 15px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn.primary { background: var(--cream); color: var(--bg); border-color: var(--cream); }
.btn.dashed { border: 1.5px dashed var(--line3); min-height: 48px; width: 100%; }
.btn.wait { border: 1.5px solid var(--wait); color: var(--wait); min-height: 48px; }
.btn.ok { border-color: var(--line2); color: var(--ok); min-height: 48px; }
.btn.danger { border-color: var(--line2); color: var(--late); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: default; }

.stone { background: var(--bg); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.stone .role { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; }
.stone .desc { font-size: 17px; line-height: 1.35; }
.stone .mini { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stone .mini > div { background: var(--card2); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.stone .mini .cap { font-size: 11px; letter-spacing: 0.12em; }
.stone .notes { font-size: 14px; line-height: 1.4; color: var(--muted); }

.thumb { width: 72px; height: 72px; border-radius: 10px; background: var(--tile); display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--dim); text-align: center; overflow: hidden; flex: none; }
.thumb img, .grid3 img { width: 100%; height: 100%; object-fit: cover; display: block; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.grid3 > * { aspect-ratio: 1; border-radius: 10px; background: var(--tile); overflow: hidden; }
.add-tile { border: 1.5px dashed var(--line3); background: transparent !important; color: var(--muted); font-size: 13px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; }
.render { min-height: 150px; border-radius: 12px; background: var(--card2); display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--dim); overflow: hidden; }
.render img { width: 100%; display: block; }

.hist { display: grid; grid-template-columns: 100px minmax(0, 1fr) 28px; gap: 10px; align-items: baseline; font-size: 14px; }
.hist > :first-child { font-family: var(--mono); color: var(--muted); }
.hist > :last-child { color: var(--muted); text-align: right; }

/* dolny pasek z „Zmień status” */
.bar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--bg); border-top: 1px solid var(--line); padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); z-index: 10; }
.bar-in { max-width: 488px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 40px); overflow-y: auto; }
.bar .main { min-height: 56px; border-radius: 14px; border: 0; background: var(--cream); color: var(--bg); font-size: 17px; font-weight: 600; cursor: pointer; width: 100%; }
.sheet { display: flex; flex-direction: column; gap: 6px; padding-bottom: 6px; }
.opt { min-height: 46px; border-radius: 12px; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; font-size: 16px; background: var(--card); border: 1.5px solid transparent; cursor: pointer; width: 100%; }
.opt.cur { background: #2A2925; border-color: var(--cream); font-weight: 600; }
.opt .no { font-family: var(--mono); font-size: 13px; color: var(--dim); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips label { cursor: pointer; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line3); font-size: 15px; }
.chips input:checked + span { border-color: var(--wait); color: var(--wait); background: rgba(143,179,217,0.1); }

/* formularze */
.form { display: flex; flex-direction: column; gap: 14px; }
.f { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.f > label, .f > .cap { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.f input, .f select, .f textarea, input.inp, textarea.inp {
  width: 100%; min-height: 46px; background: var(--bg); border: 1px solid var(--line2); border-radius: 10px; padding: 10px 12px; font-size: 16px; color: var(--cream);
}
.f textarea, textarea.inp { min-height: 0; resize: vertical; line-height: 1.4; }
.f input:focus, .f select:focus, .f textarea:focus, .inp:focus { outline: none; border-color: var(--muted); }
.f .hint { font-size: 13px; color: var(--dim); }
input[type="date"] { color-scheme: dark; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.radio-row { display: flex; flex-wrap: wrap; gap: 6px; }
.radio-row label { flex: 1 1 0; min-width: 0; cursor: pointer; }
.radio-row input { position: absolute; opacity: 0; pointer-events: none; }
.radio-row span { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 44px; padding: 0 6px; font-size: 14px; white-space: nowrap; border-radius: 10px; border: 1px solid var(--line2); color: var(--muted); }
.radio-row input:checked + span { background: var(--cream); color: var(--bg); border-color: var(--cream); font-weight: 600; }
.radio-row input:focus-visible + span { outline: 2px solid var(--muted); }
.err { margin: 12px 16px 0; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--late-line); background: var(--late-bg); color: var(--late); font-size: 15px; }
.flash { margin: 12px 16px 0; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line3); font-size: 15px; }

/* lista */
.nav { display: flex; gap: 4px; overflow-x: auto; }
.nav a { min-height: 40px; padding: 0 12px; display: flex; align-items: center; border-radius: 10px; font-size: 14px; text-decoration: none; color: var(--muted); white-space: nowrap; }
.nav a.on { background: var(--card); color: var(--cream); }
.search { margin: 12px 16px 0; display: flex; gap: 8px; }
.search input { flex: 1; min-height: 48px; background: var(--card); border: 1px solid var(--line2); border-radius: 12px; padding: 0 14px; font-size: 16px; color: var(--cream); }
.tabs { margin: 12px 16px 0; }
.olist { margin: 12px 16px 0; display: flex; flex-direction: column; gap: 8px; }
.oitem { background: var(--card); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; text-decoration: none; }
.oitem.late { background: rgba(232,119,74,0.09); }
.oitem .t { font-size: 18px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oitem .s { font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill { font-size: 14px; font-weight: 600; padding: 4px 12px; border-radius: 999px; white-space: nowrap; border: 1px solid var(--line2); color: var(--muted); }
.pill.late { background: var(--late-bg); color: var(--late); border-color: var(--late-line); }
.pill.today { background: var(--cream); color: var(--bg); border-color: var(--cream); }
.pill.soon { color: var(--cream); border-color: var(--cream); }
.pill.near { color: var(--cream); border-color: var(--line3); }
.pill.ready { color: var(--ok); border-color: rgba(169,201,143,0.5); }
.pill.closed { color: var(--dim); }
.who { width: 34px; height: 34px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; flex: none; }
.who.PW { background: var(--cream); color: var(--bg); }
.who.NW { border: 1.5px solid var(--cream); }
.who.none { border: 1.5px dashed var(--line3); color: var(--dim); }
.empty { margin: 32px 16px; text-align: center; color: var(--muted); }

/* logowanie */
.login { max-width: 380px; margin: 0 auto; padding: 72px 20px; display: flex; flex-direction: column; gap: 24px; }
.login .brand { font-size: 46px; text-align: center; }

/* strona klienta */
.client { max-width: 420px; margin: 0 auto; padding: 40px 20px; display: flex; flex-direction: column; gap: 20px; min-height: 100vh; }
.client .num { font-family: var(--mono); font-size: 40px; font-weight: 500; }
.wallet { min-height: 56px; border-radius: 14px; border: 1px solid var(--line3); display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 600; font-size: 16px; background: #000; color: #fff; }
.wallet:disabled { opacity: 0.5; }
