/* STROJSTAV PRIPOMIENKY – vzhľad */
/* Písma STROJSTAV (rovnaké ako Dochádzka) – uložené priamo v aplikácii */
@font-face { font-family: "Barlow"; src: url("fonts/Barlow-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("fonts/Barlow-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("fonts/Barlow-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("fonts/Barlow-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Michroma"; src: url("fonts/Michroma-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }

:root {
  /* paleta STROJSTAV – rovnaká ako Dochádzka a Náradie */
  --brand: #C8151F;
  --brand-strong: #A3101A;
  --brand-tint: #FBE8E9;
  --brand-2: #C8151F;
  --accent: #C8151F;
  --accent-ink: #ffffff;
  --bg: #F4F3F2;
  --card: #FFFFFF;
  --ink: #2B2A29;
  --ink-2: #66625F;
  --ink-3: #8E8985;
  --line: #DEDBD8;
  --ok: #1E7A3C;
  --ok-bg: #E6F3EA;
  --warn: #9A5800;
  --warn-bg: #FBF0DF;
  --bad: #B42318;
  --bad-bg: #FBE7E5;
  --invite: #6B3FA0;
  --invite-bg: #F1EAF8;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(43,42,41,.06), 0 1px 3px rgba(43,42,41,.08);
  --f-display: "Michroma", "Eurostile", Arial, sans-serif;
  --f-body: "Barlow", system-ui, "Segoe UI", Roboto, sans-serif;
  --logo-l: block; --logo-d: none;
  --nav-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #E0373F; --brand-strong: #F05A61; --brand-tint: #3A1A1C; --brand-2: #E0373F; --accent: #E0373F;
    --bg: #1C1B1A; --card: #262524; --ink: #F2F0EE; --ink-2: #ABA6A2; --ink-3: #85807C; --line: #3A3836;
    --ok: #4CC27A; --ok-bg: #1B2E22; --warn: #E9A23B; --warn-bg: #33281A; --bad: #F97066; --bad-bg: #3A1E1C;
    --invite: #B593E6; --invite-bg: #2A2236; --logo-l: none; --logo-d: block;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--f-body);
  background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.4;
  overscroll-behavior-y: contain;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand-2); }
.hidden { display: none !important; }
svg.i { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 16px; height: 16px; }

/* ---------- Hlavička ---------- */
.top {
  position: sticky; top: 0; z-index: 20; background: var(--card); color: var(--ink); border-bottom: 1px solid var(--line);
  padding: calc(var(--safe-t) + 10px) 12px 10px 16px; display: flex; align-items: center; gap: 12px; min-height: 58px;
}
.top .logo { height: 30px; width: auto; flex: none; }
.logo-l { display: var(--logo-l); } .logo-d { display: var(--logo-d); }
.top .sep { width: 1px; height: 24px; background: var(--line); flex: none; }
.top h1 { font-family: var(--f-display); font-size: 15px; line-height: 1.3; margin: 0; font-weight: 400; flex: 1; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .brandmark { font-family: var(--f-body); font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--brand); display: block; line-height: 1; margin-bottom: 4px; text-transform: uppercase; }
.top .icon-btn { color: var(--ink); }
.icon-btn { background: none; border: 0; padding: 8px; border-radius: 10px; display: inline-flex; color: var(--ink-2); }
.icon-btn:active { background: rgba(127,127,127,.18); }

/* ---------- Spodné menu ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex;
  background: var(--card); border-top: 1px solid var(--line); padding-bottom: var(--safe-b);
}
.nav button {
  flex: 1; background: none; border: 0; height: var(--nav-h); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px; font-size: 12px; color: var(--ink-3); position: relative; font-weight: 600; font-family: var(--f-body);
}
.nav button.on { color: var(--brand); }
.nav button.on::before { content: ""; position: absolute; top: 0; left: 25%; right: 25%; height: 3px; background: var(--brand); border-radius: 0 0 3px 3px; }
.nav .badge { position: absolute; top: 7px; left: calc(50% + 6px); }
.badge {
  background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px;
  border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px;
}

main { padding: 12px 12px calc(var(--nav-h) + var(--safe-b) + 90px); max-width: 720px; margin: 0 auto; }

/* ---------- Karty úloh ---------- */
.group-h { font-size: 12px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; margin: 18px 4px 8px; display: flex; gap: 8px; align-items: center; }
.group-h.bad { color: var(--bad); }
.group-h.warn { color: var(--warn); }
.group-h .cnt { font-weight: 600; color: var(--ink-3); }
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 8px;
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; position: relative; transition: opacity .3s, transform .3s;
}
.card.leaving { opacity: 0; transform: translateX(40px); }
.card .body { flex: 1; min-width: 0; }
.card .title { font-weight: 600; font-size: 16px; word-wrap: break-word; }
.card.done .title { text-decoration: line-through; color: var(--ink-3); }
.card.prio::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--bad); }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; font-size: 13px; color: var(--ink-2); align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--bg); border-radius: 8px; padding: 2px 8px; font-size: 13px; color: var(--ink-2); max-width: 100%; }
.chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip.bad { background: var(--bad-bg); color: var(--bad); font-weight: 600; }
.chip.warn { background: var(--warn-bg); color: var(--warn); font-weight: 600; }
.chip.ok { background: var(--ok-bg); color: var(--ok); font-weight: 600; }
.chip.inv { background: var(--invite-bg); color: var(--invite); font-weight: 600; }

.check {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--ink-3); background: none; flex: none;
  display: inline-flex; align-items: center; justify-content: center; margin-top: 1px; color: transparent; padding: 0;
}
.check svg { width: 18px; height: 18px; stroke-width: 3; }
.check:active { transform: scale(.9); }
.check.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.check:not(.ro):hover { border-color: var(--ok); }
.check.ro { opacity: .35; }

.datebox {
  width: 46px; flex: none; border-radius: 10px; background: var(--invite-bg); color: var(--invite);
  text-align: center; padding: 5px 0; line-height: 1.1;
}
.datebox b { display: block; font-family: var(--f-display); font-size: 16px; font-weight: 400; line-height: 1.3; }
.datebox small { font-size: 11px; font-weight: 700; text-transform: uppercase; }

.avatar {
  width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--card); font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; flex: none; letter-spacing: .3px;
}
.avatar.lg { width: 36px; height: 36px; font-size: 13px; }

.rsvp { display: flex; gap: 8px; margin-top: 10px; }
.rsvp button { flex: 1; border-radius: 10px; padding: 9px; border: 1.5px solid var(--line); background: var(--card); font-weight: 600; font-size: 14px; }
.rsvp button.yes.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.rsvp button.no.on { background: var(--bad); border-color: var(--bad); color: #fff; }

.empty { text-align: center; color: var(--ink-3); padding: 60px 20px; }
.empty svg { width: 54px; height: 54px; stroke-width: 1.5; margin-bottom: 8px; }
.empty b { display: block; color: var(--ink-2); font-size: 17px; margin-bottom: 4px; }

/* ---------- Tlačidlá a formuláre ---------- */
.fab {
  position: fixed; right: 18px; bottom: calc(var(--nav-h) + var(--safe-b) + 16px); z-index: 25;
  height: 56px; padding: 0 22px 0 18px; border-radius: 28px; border: 0; background: var(--accent); color: var(--accent-ink);
  font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px; box-shadow: 0 6px 16px rgba(200,21,31,.35);
}
.fab:active { transform: scale(.96); }
.btn {
  border: 0; border-radius: var(--radius); padding: 13px 16px; font-weight: 700; font-size: 16px; display: inline-flex;
  align-items: center; justify-content: center; gap: 8px; background: var(--brand-2); color: #fff; width: 100%;
}
.btn.accent { background: var(--brand); }
.btn.accent:active { background: var(--brand-strong); }
.btn.ok { background: var(--ok); }
.btn.ghost { background: var(--bg); color: var(--ink); }
.btn.danger { background: var(--bad-bg); color: var(--bad); }
.btn:disabled { opacity: .5; }
.btn-row { display: flex; gap: 8px; margin-top: 10px; }

.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 0 2px 6px; letter-spacing: .02em; }
.input, textarea.input, select.input {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); font-size: 16px; outline: none; min-height: 46px;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
textarea.input { resize: none; min-height: 48px; }
.row2 { display: flex; gap: 8px; }
.row2 > * { flex: 1; min-width: 0; }

.seg { display: flex; background: var(--bg); border-radius: var(--radius); padding: 4px; gap: 4px; margin-bottom: 16px; }
.seg button { flex: 1; border: 0; background: none; padding: 10px; border-radius: 9px; font-weight: 700; color: var(--ink-2); display: flex; align-items: center; justify-content: center; gap: 6px; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }

.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  border: 1.5px solid var(--line); background: var(--card); border-radius: 20px; padding: 6px 12px 6px 6px; font-size: 14px;
  display: inline-flex; align-items: center; gap: 6px; font-weight: 600;
}
.pill.noav { padding-left: 12px; }
.pill.on { border-color: var(--brand); background: var(--brand); color: #fff; }
.pill.on .avatar { background: #fff; color: var(--brand); }
.quick { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 8px; scrollbar-width: none; }
.quick::-webkit-scrollbar { display: none; }
.quick .pill { white-space: nowrap; }

.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 2px; }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 15px; transition: .2s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(20px); }

/* ---------- Panel (formulár / detail) ---------- */
.sheet {
  position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column;
  animation: up .22s ease-out;
}
@keyframes up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet .top { position: relative; }
.sheet .scroll { flex: 1; overflow-y: auto; padding: 16px 14px calc(var(--safe-b) + 24px); -webkit-overflow-scrolling: touch; }
.sheet .scroll > * { max-width: 680px; margin-left: auto; margin-right: auto; }
.sheet .foot { padding: 10px 14px calc(var(--safe-b) + 10px); background: var(--card); border-top: 1px solid var(--line); }
.sheet .foot > * { max-width: 680px; margin: 0 auto; }

.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin-bottom: 12px; }
.panel h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; color: var(--ink-2); margin: 0 0 10px; display: flex; align-items: center; gap: 6px; }
.d-title { font-family: var(--f-display); font-size: 18px; line-height: 1.4; font-weight: 400; margin: 0 0 8px; word-wrap: break-word; }
.kv { display: flex; gap: 10px; align-items: center; padding: 7px 0; color: var(--ink-2); font-size: 15px; }
.kv b { color: var(--ink); font-weight: 600; }
.desc { white-space: pre-wrap; word-wrap: break-word; }
.person { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.person:last-child { border-bottom: 0; }
.person .nm { flex: 1; }
.status-yes { color: var(--ok); font-weight: 600; font-size: 14px; }
.status-no { color: var(--bad); font-weight: 600; font-size: 14px; }
.status-pending { color: var(--ink-3); font-size: 14px; }

.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
.files a, .files button.add {
  aspect-ratio: 1; border-radius: 10px; overflow: hidden; display: flex; align-items: center; justify-content: center;
  background: var(--bg); border: 0; color: var(--ink-2); flex-direction: column; font-size: 12px; gap: 4px; text-decoration: none; position: relative;
}
.files img { width: 100%; height: 100%; object-fit: cover; }
.files button.add { border: 2px dashed var(--line); }

.comment { padding: 9px 0; border-bottom: 1px solid var(--line); }
.comment:last-of-type { border-bottom: 0; }
.comment .who { font-size: 13px; color: var(--ink-2); display: flex; gap: 6px; }
.comment .who b { color: var(--ink); }
.comment .txt { white-space: pre-wrap; word-wrap: break-word; margin-top: 2px; }
.comment-form { display: flex; gap: 8px; margin-top: 10px; align-items: flex-end; }
.comment-form textarea { flex: 1; }
.comment-form .btn { width: auto; padding: 12px 14px; }

/* ---------- Ostatné ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 86px); transform: translateX(-50%); z-index: 100;
  background: #222b36; color: #fff; padding: 11px 16px; border-radius: var(--radius); font-size: 15px; max-width: 90vw;
  box-shadow: 0 6px 20px rgba(0,0,0,.25); animation: up .2s; display: flex; gap: 12px; align-items: center;
}
.toast button { background: none; border: 0; color: #FF8A8F; font-weight: 700; padding: 0; }
.toast.err { background: var(--bad); }

.banner { background: var(--warn-bg); color: var(--ink); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; display: flex; gap: 12px; align-items: center; font-size: 14px; }
.banner.info { background: var(--card); border: 1px solid var(--line); }
.banner .btn { width: auto; padding: 9px 14px; font-size: 14px; flex: none; }
.banner .x { margin-left: auto; }

.search { position: relative; margin-bottom: 4px; }
.search svg { position: absolute; left: 12px; top: 13px; color: var(--ink-3); }
.search input { padding-left: 40px; }

.login { min-height: 100%; display: flex; flex-direction: column; justify-content: center; padding: 30px 20px calc(var(--safe-b) + 30px); background: var(--bg); }
.login .box { background: var(--card); border-radius: var(--radius); padding: 26px 20px; max-width: 400px; width: 100%; margin: 0 auto; box-shadow: var(--shadow); border-top: 4px solid var(--brand); }
.logo-big { text-align: center; margin-bottom: 26px; }
.logo-big img { height: 54px; width: auto; margin: 0 auto; }
.logo-big .sub { font-family: var(--f-display); font-size: 14px; letter-spacing: .12em; color: var(--ink-2); margin-top: 10px; }
.err-msg { background: var(--bad-bg); color: var(--bad); padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; font-size: 14px; }

.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row small { color: var(--ink-3); display: block; }
.muted { color: var(--ink-3); font-size: 14px; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.viewer { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; }
.viewer img { max-width: 100%; max-height: 100%; }
.viewer .icon-btn { position: absolute; top: calc(var(--safe-t) + 10px); right: 10px; color: #fff; }
.filter-bar { display: flex; gap: 8px; margin-bottom: 4px; }
.filter-bar select { flex: 0 0 42%; }

.pwtab { border-collapse: collapse; width: 100%; font-size: 14px; }
.pwtab th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.pwtab td { padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.pwtab code { font-size: 15px; letter-spacing: .5px; }
