:root {
  --bg: #f3f2ee; --card: #ffffff; --ink: #14161a; --muted: #5d6169; --line: #e2e0d9;
  --brand: #ffc400; --brand-ink: #14161a; --ok: #1f8a4c; --ok-bg: #e5f4ea; --warn: #b42318; --warn-bg: #fdecea;
  --say-bg: #fff6d6; --chip: #efeee8; --focus: #2457d6;
  --r: 14px; --tabs: 64px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101113; --card: #1b1d21; --ink: #f1f0ec; --muted: #a3a6ad; --line: #2c2f35;
    --ok-bg: #12301f; --warn-bg: #3a1513; --say-bg: #2f2a14; --chip: #26292e; --warn: #ff8a7a; --ok: #5fd08e;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-size: 17px; line-height: 1.45; padding-bottom: calc(var(--tabs) + env(safe-area-inset-bottom) + 16px); }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
.loading { padding: 40vh 16px; text-align: center; color: var(--muted); }

header.top { position: sticky; top: 0; z-index: 5; background: #14161a; color: #fff; padding: calc(env(safe-area-inset-top) + 10px) 16px 12px; display: flex; align-items: center; gap: 10px; }
header.top h1 { font-size: 19px; margin: 0; flex: 1; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
header.top .back { text-decoration: none; font-size: 26px; padding: 0 8px 0 0; line-height: 1; }
header.top .sub { font-size: 13px; opacity: .75; font-weight: 400; display: block; }
header.top .hbtn { background: rgba(255,255,255,.12); border: 0; color: #fff; border-radius: 10px; padding: 8px 12px; font-size: 15px; text-decoration: none; }

main { padding: 12px 16px; max-width: 720px; margin: 0 auto; }
h2 { font-size: 18px; margin: 22px 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin: 10px 0; }
.card h3 { margin: 0 0 8px; font-size: 18px; line-height: 1.25; }
.card p { margin: 8px 0; }
.card ul, .card ol { margin: 8px 0; padding-left: 22px; }
.card li { margin: 4px 0; }

.job { display: block; text-decoration: none; position: relative; }
.job .when { font-weight: 700; }
.job .who { font-size: 19px; font-weight: 700; margin: 2px 0; }
.job .pkg { color: var(--muted); font-size: 15px; }
.badge { display: inline-block; font-size: 13px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--chip); }
.badge.nova { background: var(--brand); color: var(--brand-ink); }
.badge.probiha { background: #2457d6; color: #fff; }
.badge.hotovo { background: var(--ok-bg); color: var(--ok); }
.job .badge { position: absolute; top: 14px; right: 14px; }
.day { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 20px 0 4px; font-weight: 700; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 12px 18px; border-radius: 12px; border: 0; background: var(--chip); font-weight: 650; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--brand); color: var(--brand-ink); }
.btn.dark { background: var(--ink); color: var(--bg); }
.btn.ok { background: var(--ok); color: #fff; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .45; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > .btn { flex: 1 1 0; min-width: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip { font-size: 14px; background: var(--chip); border-radius: 999px; padding: 5px 11px; }
.chip.on { background: var(--brand); color: var(--brand-ink); font-weight: 600; }
.chip.off { text-decoration: line-through; opacity: .6; }
.meta { display: grid; gap: 6px; margin: 4px 0 10px; }
.meta div { font-size: 15px; background: var(--chip); border-radius: 10px; padding: 7px 10px; }
.meta b { font-weight: 650; }

.alert { border-radius: 12px; padding: 12px 14px; margin: 10px 0; font-size: 16px; }
.alert.warn, .warnbox { background: var(--warn-bg); color: var(--warn); }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.warnbox { border-radius: 10px; padding: 10px 12px; margin: 10px 0; font-weight: 550; }
.warnbox::before { content: "⚠️ "; }
.say { background: var(--say-bg); border-radius: 12px 12px 12px 4px; padding: 10px 12px; margin: 10px 0; font-style: italic; }
.say::before { content: "Řekni: "; font-style: normal; font-weight: 700; display: block; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; opacity: .7; }

.check { display: flex; gap: 12px; align-items: flex-start; padding: 12px 4px; border-top: 1px solid var(--line); cursor: pointer; user-select: none; }
.check:first-child { border-top: 0; }
.check .box { flex: 0 0 30px; height: 30px; border-radius: 9px; border: 2.5px solid var(--muted); display: grid; place-items: center; font-weight: 800; color: #fff; }
.check.done .box { background: var(--ok); border-color: var(--ok); }
.check.done .box::after { content: "✓"; }
.check.done .t { color: var(--muted); text-decoration: line-through; }
.checks { margin: 6px 0; }

.q { margin: 14px 0; }
.q .label { font-weight: 650; margin-bottom: 8px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { min-height: 46px; padding: 10px 14px; border-radius: 11px; border: 2px solid var(--line); background: var(--card); font-weight: 600; cursor: pointer; }
.opt.sel { border-color: var(--ink); background: var(--ink); color: var(--bg); }
textarea, input[type=text], input[type=tel], input[type=date], input[type=time], input[type=search], select, input[type=number], input[type=password] {
  width: 100%; border: 2px solid var(--line); border-radius: 11px; padding: 12px; background: var(--card); min-height: 50px;
}
textarea { min-height: 90px; resize: vertical; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
label.f { display: block; margin: 12px 0 6px; font-weight: 600; }

.steps { counter-reset: s; }
.step { display: flex; align-items: center; gap: 12px; text-decoration: none; padding: 14px 16px; }
.step .n { flex: 0 0 38px; height: 38px; border-radius: 50%; background: var(--chip); display: grid; place-items: center; font-weight: 800; }
.step.done .n { background: var(--ok); color: #fff; }
.step.active .n { background: var(--brand); color: var(--brand-ink); }
.step.locked { opacity: .5; }
.step .st { flex: 1; min-width: 0; }
.step .st b { display: block; font-size: 17px; }
.step .st span { font-size: 14px; color: var(--muted); }
.step .arrow { font-size: 22px; color: var(--muted); }

.timer { position: sticky; top: 58px; z-index: 4; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; display: flex; align-items: center; gap: 10px; margin: 8px 0; box-shadow: 0 4px 14px rgba(0,0,0,.06); }
.timer .clock { font-variant-numeric: tabular-nums; font-size: 24px; font-weight: 800; flex: 1; }
.timer .btn { min-height: 44px; padding: 8px 14px; }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; margin: 10px 0; }
.slot { position: relative; aspect-ratio: 1; border-radius: 12px; border: 2px dashed var(--muted); display: grid; place-items: center; text-align: center; font-size: 13px; padding: 6px; cursor: pointer; overflow: hidden; background: var(--chip); }
.slot.req::after { content: "povinné"; position: absolute; top: 4px; right: 6px; font-size: 10px; color: var(--warn); font-weight: 700; }
.slot.has { border: 0; padding: 0; }
.slot.has img { width: 100%; height: 100%; object-fit: cover; }
.slot.has .lbl { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; padding: 3px 4px; }
.slot.busy { opacity: .5; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; margin: 8px 0; }
.thumbs img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; }

.chat { display: flex; flex-direction: column; gap: 10px; margin-bottom: 140px; }
.msg { max-width: 88%; padding: 10px 13px; border-radius: 14px; white-space: normal; }
.msg.user { align-self: flex-end; background: var(--ink); color: var(--bg); border-bottom-right-radius: 4px; }
.msg.assistant { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg img { max-width: 100%; border-radius: 10px; display: block; margin-bottom: 6px; }
.msg ol, .msg ul { padding-left: 20px; margin: 6px 0; }
.composer { position: fixed; left: 0; right: 0; bottom: calc(var(--tabs) + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); padding: 10px 12px; display: flex; gap: 8px; align-items: flex-end; z-index: 6; }
.composer textarea { min-height: 50px; max-height: 140px; flex: 1; }
.composer .btn { min-height: 50px; padding: 0 14px; }
.composer .prev { position: absolute; bottom: 100%; left: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.composer .prev img { height: 70px; border-radius: 6px; display: block; }

nav#tabs[hidden] { display: none; }
nav#tabs { position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--tabs) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); display: flex; background: var(--card); border-top: 1px solid var(--line); z-index: 7; }
nav#tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-decoration: none; font-size: 12px; font-weight: 600; color: var(--muted); }
nav#tabs a span { font-size: 22px; line-height: 1.1; }
nav#tabs a.on { color: var(--ink); }

#toast { position: fixed; left: 16px; right: 16px; bottom: calc(var(--tabs) + 20px + env(safe-area-inset-bottom)); background: var(--ink); color: var(--bg); padding: 12px 14px; border-radius: 12px; z-index: 20; text-align: center; font-weight: 600; }

.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; gap: 18px; }
.login h1 { margin: 0; font-size: 24px; }
.dots { display: flex; gap: 12px; height: 22px; }
.dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ink); }
.dots i.f { background: var(--ink); }
.pad { display: grid; grid-template-columns: repeat(3, 84px); gap: 12px; }
.pad button { height: 70px; border-radius: 18px; border: 0; background: var(--card); font-size: 28px; font-weight: 700; box-shadow: 0 1px 0 var(--line); cursor: pointer; }
.err { color: var(--warn); font-weight: 600; min-height: 24px; }

.search { margin: 8px 0 4px; }
.lib a.card { display: block; text-decoration: none; }
.kdy { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
mark { background: var(--brand); color: var(--brand-ink); border-radius: 3px; }
.hidden { display: none !important; }

.use { display: flex; gap: 8px; overflow-x: auto; margin: 6px -4px 10px; padding: 0 4px 4px; scrollbar-width: none; }
.use .prod { flex: 0 0 82px; text-decoration: none; text-align: center; font-size: 12px; line-height: 1.2; font-weight: 600; }
.use .prod img { width: 82px; height: 82px; object-fit: contain; background: #fff; border-radius: 12px; border: 1px solid var(--line); display: block; margin-bottom: 4px; }
.pimg { float: right; width: 96px; height: 96px; object-fit: contain; background: #fff; border-radius: 12px; margin: 0 0 8px 12px; border: 1px solid var(--line); }
section.card::after { content: ""; display: block; clear: both; }

.btn.rec { background: #d92d20; color: #fff; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .6; } }
@media (prefers-reduced-motion: reduce) { .btn.rec { animation: none; } }
.composer .btn { padding: 0 12px; }
