/* Vzhled podle webu Bank iD (bankid.cz, 4. 11. 2026): Poppins 500/700, téměř černá #262626,
   šedé plochy #F6F6F6, text #575555, akcent #3560E5, tlačítka 7 px se 2px rámečkem, tmavé bloky 8 px. */
:root {
  --bg: #ffffff;
  --surface: #f6f6f6;
  --surface-2: #eeeeee;
  --card: #ffffff;
  --ink: #262626;
  --text: #575555;
  --muted: #828282;
  --line: #e6e6e6;
  --line-strong: #d5d5d5;
  --dark: #262626;
  --dark-ink: #ffffff;
  --accent: #3560e5;
  --ok: #1f7a45;
  --ok-bg: #e6f4ec;
  --warn: #8a5a00;
  --warn-bg: #fff4db;
  --danger: #b42318;
  --danger-bg: #fdecec;
  --focus: #3560e5;
  --r: 10px;
  --r-btn: 7px;
  --r-block: 8px;
  color-scheme: light;
}
/* Bank iD má jen světlý vzhled – aplikace ho drží i při tmavém režimu systému. */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 400 15px/1.5 Poppins, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}
h1, h2, h3, b, strong { color: var(--ink); }
h1, h2, h3 { font-weight: 700; letter-spacing: -.01em; }
a { color: var(--accent); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
input[type=checkbox] { accent-color: var(--dark); }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------------------------------------------------------------- hlavička */
.top { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1100px; margin: 0 auto; padding: 0 16px; height: 64px; display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; min-width: 0; }
.logo-img { height: 26px; width: auto; display: block; }
.brand .app { font-weight: 500; font-size: 15px; color: var(--ink); padding-left: 12px; border-left: 2px solid var(--line-strong); white-space: nowrap; }
.env { font-size: 11px; font-weight: 600; letter-spacing: .05em; padding: 2px 8px; border-radius: 50rem; background: var(--warn-bg); color: var(--warn); }
.top-r { margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 0; }
.who { color: var(--ink); font-weight: 500; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; display: flex; align-items: center; gap: 8px; }
.who .av { width: 34px; height: 34px; border-radius: 50%; background: var(--dark); color: var(--dark-ink); font-size: 12px; font-weight: 600; display: grid; place-items: center; flex: none; }

main { max-width: 1100px; margin: 0 auto; padding: 20px 16px; }

/* ---------------------------------------------------------------- tlačítka a pole */
.btn {
  font: inherit; font-weight: 500; border: 2px solid var(--dark); border-radius: var(--r-btn);
  padding: 8px 20px; cursor: pointer; background: transparent; color: var(--ink);
  min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { background: var(--surface); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary, .btn.brand { background: var(--dark); color: var(--dark-ink); }
.btn.primary:hover, .btn.brand:hover { background: #000; border-color: #000; }
.btn.ghost { border-color: var(--line-strong); }
.btn.ghost:hover { border-color: var(--dark); background: transparent; }
.btn.warn { border-color: var(--line-strong); }
.btn.warn:hover { border-color: var(--dark); background: transparent; }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.danger:hover { background: var(--danger-bg); }
.btn.sm { min-height: 36px; padding: 4px 14px; font-size: 14px; }
.btn.block { width: 100%; }
.btn.big { min-height: 52px; font-size: 16px; }

.fld { display: block; margin-bottom: 16px; }
.fld > span { display: block; font-size: 14px; font-weight: 500; color: var(--ink); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=search], textarea, select {
  width: 100%; font: inherit; color: var(--ink); background: var(--bg);
  border: 2px solid var(--line-strong); border-radius: var(--r-btn); padding: 10px 12px; min-height: 46px;
}
input:focus, textarea:focus, select:focus { border-color: var(--dark); outline: none; }
textarea { resize: vertical; min-height: 46px; }
select { width: auto; padding: 6px 10px; }
input.code { font-size: 26px; font-weight: 600; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.msg { padding: 12px 14px; border-radius: var(--r-btn); margin-bottom: 14px; font-size: 14px; }
.msg.err { background: var(--danger-bg); color: var(--danger); }
.msg.info { background: var(--surface); color: var(--text); }
.linkbtn { background: none; border: 0; color: var(--accent); font: inherit; font-size: 14px; font-weight: 500; padding: 2px 0; cursor: pointer; }

/* ---------------------------------------------------------------- přihlášení */
.authwrap { max-width: 980px; margin: 5vh auto 0; display: grid; grid-template-columns: 1fr 1fr; border-radius: var(--r-block); overflow: hidden; background: var(--surface); }
.authhero { background: #262626; color: #fff; padding: 48px 40px; display: flex; flex-direction: column; gap: 18px; }
.authhero .logo-img { height: 30px; filter: invert(1); align-self: flex-start; }
.authhero h1 { color: #fff; font-size: 38px; line-height: 1.2; margin: 18px 0 0; }
.authhero .lead { color: #fff; font-weight: 500; font-size: 17px; margin: 0; }
.authhero ul { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 12px; }
.authhero li { display: flex; gap: 10px; align-items: flex-start; color: #e8e8e8; font-size: 14px; }
.authhero li::before { content: ""; flex: none; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; border: 2px solid #fff; background: radial-gradient(circle, #fff 30%, transparent 34%); }
.authhero .env { align-self: flex-start; margin-top: auto; }
.auth { padding: 40px; background: var(--bg); }
.auth h2 { font-size: 26px; line-height: 1.25; margin: 0 0 6px; }
.auth .sub { color: var(--text); margin: 0 0 24px; }
.or { text-align: center; color: var(--muted); font-size: 13px; margin: 18px 0; }
.qr { display: block; margin: 8px auto 14px; width: 200px; height: 200px; border-radius: var(--r-block); background: #fff; padding: 8px; border: 2px solid var(--line); }
.secret { font-family: ui-monospace, Consolas, monospace; font-size: 13px; word-break: break-all; background: var(--surface); padding: 10px; border-radius: var(--r-btn); text-align: center; color: var(--ink); }
.steps-help { color: var(--text); font-size: 14px; padding-left: 20px; margin: 0 0 14px; }
.steps-help li { margin-bottom: 4px; }
.status { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; color: var(--muted); margin: 18px 0 0; }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status .dot.ok { background: var(--ok); }
.status .dot.down { background: var(--danger); }
.foot { margin: 26px 0 0; text-align: center; font-size: 12px; color: var(--muted); }
details summary { cursor: pointer; font-size: 14px; color: var(--ink); font-weight: 500; margin-bottom: 8px; }

/* ---------------------------------------------------------------- seznam */
.page-title { font-size: 34px; line-height: 1.2; margin: 6px 0 14px; }
.tabs { display: flex; gap: 28px; box-shadow: inset 0 -1px 0 var(--line); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 12px 0 10px; color: var(--ink); text-decoration: none; font-weight: 500; font-size: 16px; white-space: nowrap; border-bottom: 3px solid transparent; display: inline-flex; align-items: center; gap: 6px; }
.tabs a:hover { border-bottom-color: var(--line-strong); }
.tabs a.on { border-bottom-color: var(--dark); font-weight: 600; }
.tabs .sh { display: none; }
.badge { display: inline-block; min-width: 22px; padding: 0 7px; border-radius: 50rem; background: var(--accent); color: #fff; font-size: 12px; font-weight: 600; line-height: 22px; text-align: center; }
.tabs a:not(.on) .badge { background: var(--surface-2); color: var(--ink); }

.tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 18px 0 12px; }
.tools input[type=search] { flex: 1 1 220px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { border: 2px solid var(--line-strong); background: var(--bg); color: var(--ink); border-radius: 50rem; padding: 4px 14px; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
.chip:hover { border-color: var(--dark); }
.chip.on { background: var(--dark); border-color: var(--dark); color: var(--dark-ink); }
.chip.on b { color: var(--dark-ink); }
.chip b { font-weight: 700; margin-left: 2px; }
.chip.static { cursor: default; background: var(--surface); border-color: var(--surface); }

.sumrow { display: flex; align-items: center; gap: 10px; margin: 2px 0 12px; }
.sumrow .summary { margin: 0; flex: 1; }
.sumrow select { min-height: 38px; font-size: 14px; }
.sumrow:not(:has(select)):has(.summary:empty) { display: none; }
.summary { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--text); font-size: 14px; min-height: 24px; }
.summary .all input { width: 18px; height: 18px; vertical-align: -3px; margin: 0 4px 0 16px; }

.card { background: var(--surface); border-radius: var(--r); }
.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 14px; align-items: start; padding: 14px 18px 14px 4px; cursor: pointer; border: 2px solid transparent; transition: border-color .12s, background .12s; }
.item:hover { background: var(--surface-2); }
.item:focus-visible { outline: none; border-color: var(--focus); }
.item.sel { border-color: var(--dark); background: var(--bg); }
.item .cb { padding: 2px 0 0 14px; }
.item .cb input { width: 20px; height: 20px; }
.item .mid { min-width: 0; }
.item .t1 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; font-weight: 600; color: var(--ink); }
.item .t1 .num { color: var(--text); font-weight: 500; }
.item .firm { overflow: hidden; text-overflow: ellipsis; }
.item .t2 { color: var(--text); font-size: 14px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.item .t3 { color: var(--muted); font-size: 12px; margin-top: 2px; }
.item .note { font-style: italic; color: var(--text); font-size: 14px; }
.item .amt { text-align: right; font-weight: 700; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.item .amt small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 50rem; background: var(--dark); color: var(--dark-ink); vertical-align: 1px; }
.st { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 50rem; background: var(--surface-2); color: var(--ink); }
.st.s0 { background: var(--warn-bg); color: var(--warn); }
.st.s1, .st.s3 { background: var(--danger-bg); color: var(--danger); }
.st.s2 { background: var(--ok-bg); color: var(--ok); }
.due { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.due.soon { color: var(--warn); font-weight: 600; }
.due.over { color: var(--danger); font-weight: 600; }
.summary .due { display: inline; }

.empty { text-align: center; color: var(--text); padding: 56px 16px; }
.empty b { display: block; font-size: 20px; margin-bottom: 6px; }
.empty-ico { width: 56px; height: 56px; border-radius: 50%; background: var(--dark); color: var(--dark-ink); display: grid; place-items: center; margin: 0 auto 14px; font-size: 26px; }
.loading { text-align: center; color: var(--muted); padding: 40px; }
.spin { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--line-strong); border-top-color: var(--dark); border-radius: 50%; animation: sp .8s linear infinite; vertical-align: -4px; margin-right: 10px; }
@keyframes sp { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }

/* ---------------------------------------------------------------- detail */
.dhead { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.dhead .ttl { min-width: 0; }
.dhead h1 { font-size: 28px; line-height: 1.2; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dhead .sub { color: var(--text); margin-top: 2px; }
.dnav { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.dnav .pos { color: var(--muted); font-size: 13px; margin-right: 6px; font-variant-numeric: tabular-nums; }
.dnav .btn { min-width: 44px; font-size: 18px; padding: 4px 10px; }
.sec { padding: 18px 20px; margin-bottom: 12px; }
.sec h2 { font-size: 17px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.sec h2 .cnt { display: inline-block; background: var(--dark); color: var(--dark-ink); border-radius: 50rem; padding: 0 8px; font-size: 12px; line-height: 20px; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px 22px; }
.kv div span { display: block; font-size: 12px; color: var(--muted); }
.kv div b { font-weight: 600; word-break: break-word; }
.kv .big b { font-size: 24px; font-weight: 700; }
.desc { margin: 14px 0 0; color: var(--ink); }
.tblwrap { overflow-x: auto; }
table.rows { width: 100%; border-collapse: collapse; font-size: 14px; }
table.rows th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 6px 8px; border-bottom: 2px solid var(--line-strong); }
table.rows td { padding: 10px 8px; border-bottom: 1px solid var(--line-strong); vertical-align: top; color: var(--ink); }
table.rows tr:last-child td { border-bottom: 0; }
table.rows td.n, table.rows th.n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.show-m { display: none; }
.atts { display: flex; flex-direction: column; gap: 8px; }
.atts a { display: flex; gap: 10px; align-items: center; padding: 10px 12px; background: var(--bg); border: 2px solid var(--line); border-radius: var(--r-btn); text-decoration: none; color: var(--ink); font-weight: 500; }
.atts a:hover { border-color: var(--dark); }
.atts .an { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.atts .an small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.atts .open { color: var(--ink); font-size: 13px; font-weight: 600; white-space: nowrap; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 16px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-strong); }
.timeline li:last-child { border-bottom: 0; }
.timeline .dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 6px; background: var(--muted); }
.timeline .dot.s0 { background: var(--bg); border: 3px solid var(--warn); }
.timeline .dot.s2 { background: var(--ok); }
.timeline .dot.s1, .timeline .dot.s3 { background: var(--danger); }
.timeline .old { opacity: .55; }
.timeline .note { font-style: italic; color: var(--text); margin-top: 2px; }
/* spodní dlaždice s rozhodnutím: zaoblená ze všech stran, přichycená ke spodní hraně */
.decide { position: fixed; z-index: 15; left: 50%; transform: translateX(-50%); bottom: 16px; width: min(1068px, calc(100vw - 32px)); padding: 14px 18px; background: var(--bg); border: 2px solid var(--line-strong); border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .14); }
body.wide .decide { width: min(1468px, calc(100vw - 32px)); }
.decide .btns { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; margin-top: 10px; }
.decide .msg { margin-bottom: 10px; }
.decide.done { color: var(--text); background: var(--surface); border-color: var(--surface); box-shadow: 0 6px 20px rgba(0, 0, 0, .08); }
body.detail main { padding-bottom: calc(var(--decide-h, 120px) + 36px); }
.keys { color: var(--muted); font-size: 12px; margin-top: 8px; text-align: right; }

.dgrid { display: block; }
@media (min-width: 1100px) {
  body.wide main, body.wide .top-in { max-width: 1500px; }
  .dgrid.with-pv { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 16px; align-items: start; }
  .preview { position: sticky; top: 80px; height: calc(100vh - 230px); min-height: 420px; display: flex; flex-direction: column; overflow: hidden; margin-bottom: 12px; background: var(--dark); border-radius: var(--r-block); }
  .pv-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 16px; font-size: 14px; }
  .pv-bar span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dark-ink); font-weight: 500; }
  .pv-bar .btn { border-color: var(--dark-ink); color: var(--dark-ink); }
  .pv-bar .btn:hover { background: transparent; opacity: .85; }
  .preview iframe { flex: 1; width: 100%; border: 0; background: #fff; }
  .preview img { flex: 1; min-height: 0; object-fit: contain; width: 100%; background: #fff; }
}

/* ---------------------------------------------------------------- hromadné, dialog, toast, profil */
body.with-bulk { padding-bottom: 80px; }
.bulk { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: #262626; color: #fff; padding-bottom: env(safe-area-inset-bottom); }
.bulk-in { max-width: 1100px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 10px; }
.bulk-in #bulk-count { margin-right: auto; font-weight: 600; color: #fff; }
.bulk .btn.ghost { border-color: #fff; color: #fff; }
.bulk .btn.ghost:hover { background: rgba(255, 255, 255, .1); }
.bulk .btn.primary { background: #fff; border-color: #fff; color: #262626; }
.bulk .btn.primary:hover { background: #e9e9e9; border-color: #e9e9e9; }

dialog { border: 0; border-radius: var(--r-block); padding: 24px; width: min(480px, calc(100vw - 32px)); background: var(--bg); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
dialog::backdrop { background: rgba(20, 20, 20, .55); }
dialog h3 { margin: 0 0 6px; font-size: 20px; }
dialog p { color: var(--text); margin: 0 0 16px; }
.dlg-btns { display: flex; justify-content: flex-end; gap: 10px; }

.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 30; background: #262626; color: #fff; padding: 12px 18px; border-radius: var(--r-btn); max-width: calc(100vw - 32px); box-shadow: 0 8px 24px rgba(0, 0, 0, .2); font-weight: 500; }

.profile h2 { margin-top: 0; }
.profile h3 { font-size: 16px; margin: 20px 0 8px; }
.pk { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-strong); }
.pk .ico { width: 36px; height: 36px; border-radius: 50%; background: var(--dark); color: var(--dark-ink); display: grid; place-items: center; flex: none; }
.pk div { flex: 1; min-width: 0; }
.pk small { color: var(--muted); display: block; }

/* ---------------------------------------------------------------- mobil */
@media (max-width: 820px) {
  .authwrap { grid-template-columns: 1fr; margin-top: 0; border-radius: 0; background: var(--bg); }
  .authhero { padding: 28px 20px 24px; gap: 10px; }
  .authhero h1 { font-size: 26px; margin-top: 10px; }
  .authhero ul, .authhero .env { display: none; }
  .auth { padding: 24px 20px; }
}
@media (max-width: 640px) {
  main { padding: 12px; }
  main:has(.authwrap) { padding: 0; }
  .top-in { height: 56px; gap: 10px; }
  .logo-img { height: 22px; }
  .brand .app { display: none; }
  .who .nm { display: none; }
  .hide-m { display: none !important; }
  .show-m { display: block; }
  .tabs { gap: 0; }
  .page-title { font-size: 24px; margin: 2px 0 8px; }
  .tabs a { flex: 1 1 0; justify-content: center; font-size: 14px; }
  .tabs .lg { display: none; }
  .tabs .sh { display: inline; }
  .item { grid-template-columns: auto 1fr; padding-right: 14px; }
  .item .amt { grid-column: 2; text-align: left; }
  .item .amt small { display: inline; margin-left: 6px; }
  .item .cb { padding-left: 10px; }
  .item .cb input { width: 22px; height: 22px; }
  .sumrow select { max-width: 46%; }
  .summary { font-size: 13px; gap: 8px; flex-wrap: nowrap; }
  .summary .all { flex: none; }
  .summary .all input { margin-left: 4px; }
  .dhead { gap: 8px; }
  .dhead .ttl { order: 5; flex: 1 1 100%; }
  .dhead h1 { font-size: 22px; }
  .dnav { width: auto; margin-left: auto; }
  .dnav .pos { display: none; }
  .orig { margin-left: auto; }
  .orig + .dnav { margin-left: 0; }
  .kv { grid-template-columns: 1fr 1fr; }
  .sec { padding: 16px; }
  .decide textarea { display: none; }
  .decide.with-note textarea { display: block; }
  .decide .btns { grid-template-columns: 1fr 1fr; margin-top: 6px; }
  .decide .btns .primary { grid-column: 1 / -1; }
  .bulk-in .btn { padding: 4px 12px; }
}

/* ---------------------------------------------------------------- detail: záhlaví a sloupce */
body.detail .dhead { position: sticky; top: 64px; z-index: 8; background: var(--bg); margin: -20px -16px 16px; padding: 14px 16px 12px; transition: transform .2s ease, opacity .2s ease; }
body.detail.hdr-hidden .dhead { transform: translateY(calc(-100% - 2px)); opacity: 0; pointer-events: none; }
.dleft .msg.info { margin-bottom: 12px; }
@media (min-width: 1100px) {
  /* aplikační rozvržení: stránka se nehýbe, levý sloupec se posouvá sám, PDF stojí a končí nad dlaždicí */
  body.detail.wide { overflow: hidden; }
  body.detail.wide main { height: calc(100dvh - 65px); display: flex; flex-direction: column; padding-bottom: calc(var(--decide-h, 120px) + 32px); overflow: hidden; }
  body.detail.wide .dhead { position: relative; top: 0; flex: none; margin: 0 0 14px; padding: 0; max-height: 160px; transition: max-height .2s ease, opacity .2s ease, margin .2s ease; transform: none; }
  body.detail.wide.hdr-hidden .dhead { max-height: 0; margin: 0; opacity: 0; overflow: hidden; transform: none; }
  body.detail.wide .dgrid.with-pv { flex: 1; min-height: 0; grid-template-rows: minmax(0, 1fr); }
  body.detail.wide .dleft { height: 100%; overflow-y: auto; overscroll-behavior: contain; padding-right: 6px; scrollbar-gutter: stable; }
  body.detail.wide .dleft > :last-child { margin-bottom: 0; }
  body.detail.wide .preview { position: static; height: 100%; min-height: 0; margin: 0; }
}

/* ---------------------------------------------------------------- profil */
.phead { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 4px 0 20px; }
.pid { display: flex; align-items: center; gap: 16px; min-width: 0; }
.pav { width: 64px; height: 64px; border-radius: 50%; background: var(--dark); color: var(--dark-ink); display: grid; place-items: center; font-size: 22px; font-weight: 700; flex: none; }
.pid h1 { font-size: 28px; margin: 0; line-height: 1.2; }
.pgrid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
.pcard { background: var(--surface); border-radius: var(--r); padding: 22px 24px; }
.pcard h2 { font-size: 20px; margin: 0 0 4px; }
.pcard > p.muted { margin: 0 0 16px; }
.method { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; background: var(--bg); border-radius: var(--r-btn); padding: 14px 16px; margin-top: 10px; }
.mico { width: 44px; height: 44px; border-radius: 50%; background: var(--dark); color: var(--dark-ink); display: grid; place-items: center; font-size: 18px; font-weight: 700; }
.mbody b { display: block; }
.devices { list-style: none; margin: 0; padding: 4px 0 0 58px; }
.device { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-strong); }
.device > div { flex: 1; min-width: 0; }
.device:last-child { border-bottom: 0; }
.madd { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 0 6px 58px; }
.rgroup + .rgroup { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-strong); }
.rgroup h3 { font-size: 15px; margin: 12px 0 4px; display: flex; align-items: center; gap: 8px; }
.rgroup .cnt { display: inline-block; background: var(--dark); color: var(--dark-ink); border-radius: 50rem; padding: 0 8px; font-size: 12px; line-height: 20px; }
.rlist { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.rlist li { background: var(--bg); color: var(--ink); font-weight: 500; font-size: 14px; border-radius: 50rem; padding: 4px 14px; }
.pnote { color: var(--muted); font-size: 13px; margin: 18px 2px 0; }
@media (max-width: 820px) {
  .pgrid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body.detail .dhead { top: 56px; margin: -12px -12px 12px; padding: 10px 12px; }
  .decide { bottom: 8px; width: calc(100vw - 16px); padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-radius: 16px; }
  body.detail main { padding-bottom: calc(var(--decide-h, 140px) + 20px); }
  .pid h1 { font-size: 22px; }
  .pav { width: 52px; height: 52px; font-size: 18px; }
  .pcard { padding: 18px 16px; }
  .method { grid-template-columns: 40px 1fr; }
  .method > .st { grid-column: 2; justify-self: start; }
  .mico { width: 40px; height: 40px; }
  .devices, .madd { padding-left: 0; }
}
@media (max-width: 640px) { .btn .show-m { display: inline; } }

/* ukázka */
.demo-info { margin-bottom: 18px; }
.demo-reset { margin-top: 16px; }
.btn svg { flex: none; }
