/* Web appka (kamaradi/): barvy z /app.css. Telefon = spodní lišta záložek, PC = záložky vlevo. */
:root { --tabbar: 64px; }
body { overflow-x: hidden; }
h1 { font-size: 28px; line-height: 1.15; margin: 0; letter-spacing: -.4px; }
h2 { font-size: 18px; margin: 0 0 8px; }
.center { text-align: center; }
.top { position: sticky; top: 0; z-index: 900; padding-top: max(10px, env(safe-area-inset-top)); }
.who { display: flex; align-items: center; gap: 8px; min-width: 0; font: inherit; font-size: 15px; color: var(--text);
       background: none; border: 0; padding: 4px 6px; border-radius: 999px; cursor: pointer; }
.who:hover { background: var(--surface-2); }
.who span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40vw; }

/* ---- formuláře a tlačítka ---- */
label { display: block; font-size: 15px; font-weight: 600; margin: 14px 0 6px; }
input {
  width: 100%; font: inherit; color: var(--text); background: var(--surface-2);
  border: 1px solid transparent; border-radius: 12px; padding: 12px 14px;
}
input:focus { border-color: var(--accent); outline: none; }
button { font: inherit; cursor: pointer; }
.btn.wide { width: 100%; margin-top: 18px; }
.btn.small { min-height: 38px; padding: 6px 14px; font-size: 15px; }
.link { background: none; border: 0; color: var(--accent-text); padding: 10px 0; text-align: left; font-weight: 600; }
.link.forgot { display: block; margin: 6px auto 0; text-align: center; font-weight: 500; color: var(--muted); }
.ic { flex: none; }
.btn .ic { width: 18px; height: 18px; }
.iconbtn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--text);
           font-size: 20px; line-height: 1; display: grid; place-items: center; flex: none; }
.iconbtn:hover { background: var(--line); }
.error { color: var(--alarm); margin: 8px 0; }
.error:empty { display: none; }
.error.banner { background: var(--alarm-soft); padding: 10px 14px; border-radius: 12px; margin: 0 0 14px; }

/* ---- přihlášení ---- */
main { padding: 0 16px; }
.auth { max-width: 420px; margin: 0 auto; padding: 32px 0 40px; }
.authcard { padding: 28px 24px; text-align: center; }
.authicon { border-radius: 16px; margin-bottom: 14px; }
.authcard h1 { margin-bottom: 8px; }
.authcard > p.muted { margin: 0 0 18px; }
.providers { display: grid; gap: 10px; justify-items: stretch; }
.apple { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; border-radius: 999px; border: 0;
         background: #000; color: #fff; font-weight: 600; font-size: 16px; }
@media (prefers-color-scheme: dark) { .apple { background: #fff; color: #000; } }
.google { display: flex; justify-content: center; min-height: 44px; }
.byemail { text-align: left; margin-top: 18px; border-top: 1px solid var(--line); padding-top: 8px; }
.byemail summary { cursor: pointer; padding: 10px 0; font-weight: 600; color: var(--muted); text-align: center; list-style: none; }
.byemail summary::-webkit-details-marker { display: none; }
.byemail summary::after { content: " ▾"; }
.byemail[open] summary::after { content: " ▴"; }

/* ---- kostra appky ---- */
.app { padding: 16px 0 calc(var(--tabbar) + 24px + env(safe-area-inset-bottom)); }
.tabs { position: fixed; z-index: 950; left: 0; right: 0; bottom: 0; display: flex;
        background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs a { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
          min-height: var(--tabbar); color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 600; }
.tabs a .ti { display: grid; place-items: center; line-height: 0; }
.tabs a[aria-current="page"] { color: var(--accent-text); }
.badge { position: absolute; top: 8px; left: calc(50% + 8px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
         background: var(--alarm); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.view.narrow { max-width: 640px; }
.view > * + * { margin-top: 18px; }
.headrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }

/* ---- výlety ---- */
ul.trips, ul.people { list-style: none; margin: 0; padding: 0; }
.trips li { margin-bottom: 10px; }
.trip { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; width: 100%; text-align: left; color: var(--text);
        border: 0; border-radius: var(--radius); padding: 14px; background: var(--surface); box-shadow: var(--shadow);
        border-left: 5px solid var(--accent); }
.trip:hover { background: var(--raised); }
.trip.overdue { border-left-color: var(--warm); }
.trip.alarm { border-left-color: var(--alarm); background: var(--alarm-soft); }
.trip.finished { border-left-color: var(--muted); }
.trip[aria-current="true"] { box-shadow: 0 0 0 2px var(--accent); }
.trip .avatar { grid-row: span 3; }
.trip .t { font-size: 17px; font-weight: 700; overflow-wrap: anywhere; }
.trip .s { font-size: 15px; }
.trip.overdue .s { color: var(--warm); font-weight: 600; }
.trip.alarm .s { color: var(--alarm); font-weight: 700; }
.trip .c { font-size: 13px; color: var(--muted); }
.emptyline { color: var(--muted); font-size: 15px; padding: 18px; text-align: center; background: var(--surface); border-radius: var(--radius); }
ul.people.card .emptyline { background: none; }

/* ---- lidé ---- */
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none;
          font-weight: 700; font-size: 15px; color: #fff; background: var(--accent); }
.avatar.sm { width: 28px; height: 28px; font-size: 12px; }
.avatar.lg { width: 72px; height: 72px; font-size: 26px; margin: 0 auto 10px; }
.people li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.people.card li + li { border-top: 1px solid var(--line); }
.people .n { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.people .st { display: block; font-weight: 400; color: var(--muted); font-size: 14px; }
.people .st.go { color: var(--accent-text); }
.people .st.warm { color: var(--warm); }
.people .st.alarm { color: var(--alarm); }
.requests h2 { font-size: 15px; color: var(--warm); text-transform: uppercase; letter-spacing: .5px; }
.requests li { background: var(--warm-soft); border-radius: var(--radius); margin-bottom: 8px; }
.accept { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 999px; padding: 8px 14px; font-size: 15px; font-weight: 600; }
.remove { background: none; border: 0; color: var(--muted); width: 40px; height: 40px; font-size: 16px; border-radius: 50%; }
.remove:hover { background: var(--surface-2); color: var(--text); }
.mycode { padding: 18px; display: grid; gap: 10px; }
.mycode .btn { justify-self: start; }
.mycode h2 { margin: 0; }
.mycode p { margin: 0; }
.code { font-size: 32px; font-weight: 800; letter-spacing: 2px; font-variant-numeric: tabular-nums;
        font-family: ui-monospace, "SF Mono", Consolas, monospace; color: var(--text); }
/* Já: profil (avatar vedle jména), kód na jeden řádek, seznam nastavení. */
.profile { padding: 20px; display: flex; align-items: center; gap: 18px; }
.profile .avatar.lg { margin: 0; }
.profile .who-text { min-width: 0; }
.profile h1 { font-size: 24px; overflow-wrap: anywhere; }
.profile p { margin: 2px 0 0; overflow-wrap: anywhere; font-size: 15px; }
@media (max-width: 480px) {
  .profile { gap: 14px; padding: 16px; }
  .profile .avatar.lg { width: 56px; height: 56px; font-size: 21px; }
  .profile h1 { font-size: 21px; }
}
.profile .link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 0 0; font-size: 15px; }
.profile .link .ic { width: 16px; height: 16px; }
.nameform { flex: 1; min-width: 0; }
.nameform label { margin-top: 0; }
.nameform .sheetbtns { margin-top: 12px; }
.codeline { padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.codeline p { margin: 0; }
.codeline .code { font-size: 24px; letter-spacing: 1.5px; }
.rows { overflow: hidden; }
.row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 18px; border: 0; background: none;
       color: var(--text); text-decoration: none; font: inherit; text-align: left; }
.row + .row { border-top: 1px solid var(--line); }
.row:hover { background: var(--surface-2); }
.row .ic { color: var(--muted); }
.row .rl { flex: 1; min-width: 0; }
.row .chev { color: var(--muted); }
.row.danger, .row.danger .ic { color: var(--alarm); }
.me-view { max-width: 640px; }
.mecol > * + * { margin-top: 18px; }

/* ---- dialog ---- */
dialog.sheet { border: 0; border-radius: 20px; padding: 22px; width: min(440px, calc(100vw - 32px));
               background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog.sheet::backdrop { background: rgba(10,14,12,.45); }
dialog.sheet h2 { font-size: 21px; }
.sheetbtns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
#addCode { font: 700 22px/1.2 ui-monospace, "SF Mono", Consolas, monospace; letter-spacing: 2px; text-transform: uppercase; }

/* ---- mapa ---- */
.panel .empty { display: none; }
.panelhead { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.panelhead h2 { font-size: 21px; margin: 0; overflow-wrap: anywhere; min-width: 0; }
.panelhead h2:focus { outline: none; }
.state { margin: 0 0 8px; }
.state.bad { color: var(--alarm); font-weight: 600; }
.note { margin: 0 0 10px; background: var(--warm-soft); border-left: 4px solid var(--warm); padding: 8px 12px; border-radius: 8px; overflow-wrap: anywhere; }
.map { height: 62vh; min-height: 320px; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.legend { background: var(--surface); color: var(--text); padding: 6px 8px; border-radius: 8px; font: 13px/1.4 system-ui, sans-serif; box-shadow: var(--shadow); }
.legend i { display: inline-block; width: 18px; height: 4px; margin-right: 6px; vertical-align: middle; }
.leaflet-container { font: 14px/1.4 system-ui, sans-serif; }

/* Telefon: otevřený výlet je samostatný pohled místo seznamu. */
@media (max-width: 899px) {
  .trips-view.showing-trip .list { display: none; }
  .panel:not(.open) { display: none; }
  .map { height: calc(100vh - 330px); height: calc(100dvh - 330px); }
}

/* Široká obrazovka: záložky vlevo, u výletů seznam a mapa vedle sebe. */
@media (min-width: 900px) {
  main { padding: 0 24px; }
  .top { padding: 10px 24px; }
  .app { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 28px; padding-bottom: 32px; }
  .tabs { position: sticky; top: 76px; align-self: start; flex-direction: column; gap: 4px; border: 0; background: none; padding: 0; }
  .tabs a { flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 46px; padding: 0 14px; border-radius: 12px; font-size: 16px; }
  .tabs a:hover { background: var(--surface-2); }
  .tabs a[aria-current="page"] { background: var(--accent-soft); }
  .badge { position: static; margin-left: auto; }
  .trips-view { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 24px; align-items: start; }
  .trips-view[hidden] { display: none; }
  .panel { position: sticky; top: 76px; }
  .panel .empty { display: flex; align-items: center; justify-content: center; height: calc(100vh - 110px);
                  min-height: 360px; border: 2px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
  .map { height: calc(100vh - 230px); }
}

/* Hodně široká obrazovka: Já ve dvou sloupcích (profil a kód | nastavení). */
@media (min-width: 1100px) {
  .me-view { max-width: 980px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
  .me-view[hidden] { display: none; }
  .me-view > * + * { margin-top: 0; }
}

/* Lišta souhlasu s Google Analytics (analytics.js, inline styl) nad spodní lištou záložek. */
@media (max-width: 899px) {
  #ss-cookies { bottom: calc(var(--tabbar) + 12px + env(safe-area-inset-bottom)) !important; }
}

/* ⭐ Plus na webu (Billing/Web) */
.plus { padding: 18px 20px; }
.plus p { margin: 0 0 10px; }
.plus .btn { margin-top: 4px; }
.purchases { list-style: none; margin: 8px 0 0; padding: 0; }
.purchases:empty { display: none; }
.purchases li { padding: 12px 0; border-top: 1px solid var(--line); }
.purchases .pl { margin: 0 0 6px; }
.purchases .pa { display: flex; flex-wrap: wrap; gap: 8px; }
/* ✉️ Pozvánka odkazem */
.inlinecode { letter-spacing: 1px; font-variant-numeric: tabular-nums; color: var(--text); }
#inviteDialog .qr { display: grid; place-items: center; margin: 14px auto; padding: 12px; background: #fff; border-radius: 14px; width: max-content; }
#inviteDialog .qr img, #inviteDialog .qr canvas { display: block; }
#inviteUrl { width: 100%; }

/* ---- 🔎 hledání a 🖼️ fotka (9. 11.) ---- */
.headbtns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.avatar.photo { background-size: cover !important; background-position: center; color: transparent; }
.photobtns { display: flex; gap: 16px; flex-wrap: wrap; }
.findable { padding: 18px; }
.findable h2 { font-size: 18px; margin: 0 0 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chips button { border: 1px solid var(--accent); background: none; color: var(--accent-text); border-radius: 999px; padding: 8px 14px; font-size: 15px; font-weight: 600; min-height: 40px; }
.chips button[aria-checked="true"] { background: var(--accent); color: var(--accent-ink); }
#searchList { margin: 12px 0 0; padding: 0; list-style: none; max-height: 50vh; overflow: auto; }
#searchList li { padding: 8px 0; }
#searchList .emptyline { color: var(--muted); font-size: 15px; }
