:root {
  --bg: #F4F5F7;
  --surface: #FFFFFF;
  --hover: #F7F8FA;
  --line: #E6E8EC;
  --line-soft: #EFF1F4;
  --text: #14140F;
  --muted: #646A73;
  --faint: #A0A6AE;
  --accent: #D35325;
  --accent-hover: #BC461C;
  --accent-soft: #FBEDE6;
  --danger: #D93F3F;
  --shadow: 0 1px 2px rgba(20, 20, 15, .05);
  --shadow-lg: 0 20px 60px rgba(20, 20, 15, .2);
  --r: 10px;

  --s-novy: #A0A6AE;
  --s-osloveno: #2F7FE0;
  --s-nabidka: #E08A1E;
  --s-jednani: #8B4FD1;
  --s-klient: #2E9E5B;
  --s-nezajem: #7A8088;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.45 Geist, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; }
svg.lucide { width: 16px; height: 16px; stroke-width: 1.75; flex: none; }

/* ── Přihlášení ───────────────────────── */
#login {
  min-height: 100vh; display: flex; align-items: center;
  background: #5E8C8A url(assets/login.jpg) center right / cover no-repeat;
  padding: 24px clamp(16px, 8vw, 120px);
}
.login-card {
  width: 100%; max-width: 380px; background: var(--surface); border-radius: 14px;
  padding: 36px 32px 32px; box-shadow: var(--shadow-lg);
}
.logo { font-family: Michroma, "Arial Black", sans-serif; font-size: 18px; letter-spacing: .04em; display: flex; align-items: center; gap: 10px; }
.logo small { font-family: Geist, sans-serif; font-size: 12px; letter-spacing: 0; color: var(--muted); font-weight: 500;
  border-left: 1px solid var(--line); padding-left: 10px; }
.login-card h1 { font-size: 22px; font-weight: 600; margin: 28px 0 4px; letter-spacing: -.01em; }
.login-card p { color: var(--muted); margin: 0 0 22px; }
.login-card label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 6px; }
.login-card .field { width: 100%; margin-bottom: 14px; padding: 11px 12px; }
.login-card .btn { width: 100%; justify-content: center; padding: 11px; margin-top: 6px; }
.login-err { color: var(--danger); font-size: 13px; min-height: 18px; margin-top: 10px; }

/* ── Kostra ───────────────────────────── */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.top {
  height: 56px; background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 28px; padding: 0 20px; position: sticky; top: 0; z-index: 10;
}
.nav { display: flex; gap: 2px; height: 100%; }
.nav button {
  padding: 0 12px; height: 100%; color: var(--muted); font-weight: 500; position: relative;
  display: flex; align-items: center; gap: 7px; white-space: nowrap;
}
.nav button:hover { color: var(--text); }
.nav button.on { color: var(--text); }
.nav button.on::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: var(--accent); }
.nav .count { font-size: 12px; color: var(--faint); font-weight: 400; }
.nav .count.late { color: var(--danger); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.search {
  display: flex; align-items: center; gap: 8px; width: 300px;
  border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; height: 34px; background: var(--surface);
}
.search:focus-within { border-color: var(--accent); }
.search svg { color: var(--faint); }
.search input { flex: 1; border: 0; outline: 0; background: none; min-width: 0; }
.user { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; padding: 4px 8px 4px 4px; border-radius: 8px; }
.user:hover { background: var(--line-soft); color: var(--text); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-size: 12px; font-weight: 600; color: #fff; background: #8FB0B2;
}

.body { flex: 1; display: grid; grid-template-columns: 220px 1fr; }
.side { padding: 18px 12px; border-right: 1px solid var(--line); }
.side-label {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--faint); font-weight: 500; padding: 0 10px 8px;
}
.side-label button { color: var(--faint); display: flex; padding: 2px; border-radius: 5px; }
.side-label button:hover { color: var(--text); background: var(--line-soft); }
.side-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 7px 10px; border-radius: 7px; text-align: left; color: var(--muted);
}
.side-item:hover { background: var(--line-soft); color: var(--text); }
.side-item.on { background: var(--surface); color: var(--text); font-weight: 500; box-shadow: 0 0 0 1px var(--line); }
.side-item .count { margin-left: auto; color: var(--faint); font-size: 12.5px; font-weight: 400; }
.side-item .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-input { width: 100%; border: 1px solid var(--accent); outline: 0; border-radius: 7px; padding: 6px 10px; margin-top: 4px; }
.side-select { display: none; }

.main { min-width: 0; padding: 22px 28px 48px; }

/* ── Ovládací prvky ───────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px; border-radius: 8px; padding: 7px 13px;
  font-weight: 500; background: var(--surface); border: 1px solid var(--line); white-space: nowrap;
}
.btn:hover { border-color: #D3D7DD; background: var(--hover); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--danger); }
.btn[disabled] { opacity: .4; pointer-events: none; }
.field {
  border: 1px solid var(--line); outline: 0; background: var(--surface); border-radius: 8px; padding: 7px 10px; min-width: 0;
}
.field:focus { border-color: var(--accent); }
.select {
  appearance: none; border: 1px solid var(--line); outline: 0; background-color: var(--surface); border-radius: 8px;
  padding: 6px 28px 6px 10px; font-size: 13px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23646A73' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}

.tag {
  display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 500; white-space: nowrap; line-height: 1.5;
}
.tag.s-novy { background: #EDEFF2; color: #646A73; }
.tag.s-osloveno { background: #E4EFFC; color: #1F68C2; }
.tag.s-nabidka { background: #FDF0DD; color: #A9620B; }
.tag.s-jednani { background: #F1E8FB; color: #7438B8; }
.tag.s-klient { background: #E1F4E8; color: #1F8247; }
.tag.s-nezajem { background: #EDEFF2; color: #A0A6AE; text-decoration: line-through; }

/* ── Seznam ───────────────────────────── */
.page-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.page-head .sub { color: var(--faint); font-size: 15px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 13px;
}
.chip:hover { color: var(--text); border-color: #D3D7DD; }
.chip.on { border-color: var(--text); color: var(--text); }
.chip .n { color: var(--faint); font-size: 12px; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }

.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-weight: 500; font-size: 12.5px; color: var(--muted); padding: 10px 14px;
  border-bottom: 1px solid var(--line); background: #FAFBFC; white-space: nowrap; user-select: none;
}
th[data-sort] { cursor: pointer; }
th[data-sort]:hover { color: var(--text); }
th .arr { color: var(--accent); margin-left: 3px; }
td { padding: 10px 14px; vertical-align: middle; }
tbody tr { cursor: pointer; }
tbody tr + tr td { border-top: 1px solid var(--line-soft); }
tbody tr:hover td { background: var(--hover); }
.t-name { font-weight: 500; }
.t-dom { color: var(--muted); font-size: 12.5px; }
.t-muted { color: var(--muted); white-space: nowrap; }
.t-none { color: #C5CAD0; }
.late { color: var(--danger); }
.t-next { max-width: 280px; }
.t-next div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.more-row { text-align: center; padding: 12px; border-top: 1px solid var(--line-soft); }
.empty { color: var(--faint); text-align: center; padding: 48px 16px; }

/* ── Pipeline ─────────────────────────── */
.board { display: grid; grid-template-columns: repeat(6, minmax(190px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.col { background: #ECEEF1; border-radius: var(--r); display: flex; flex-direction: column; min-height: 200px; transition: box-shadow .15s; }
.col.over { box-shadow: inset 0 0 0 2px var(--accent); }
.col-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
.col-head .count { margin-left: auto; color: var(--muted); font-size: 12.5px; }
.col-cards { padding: 0 8px 10px; display: flex; flex-direction: column; gap: 6px; max-height: calc(100vh - 230px); overflow-y: auto; }
.card-mini {
  display: block; width: 100%; text-align: left; background: var(--surface); border-radius: 8px;
  padding: 9px 11px; border: 1px solid var(--line); cursor: grab;
}
.card-mini:hover { border-color: #CFD4DA; }
.card-mini.dragging { opacity: .4; }
.card-mini .t-name, .card-mini .t-dom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.more { color: var(--accent); font-size: 12.5px; padding: 6px; border-radius: 7px; }
.more:hover { background: var(--surface); }

/* ── Detail ───────────────────────────── */
.crumb { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); margin-bottom: 14px; }
.crumb:hover { color: var(--text); }
.d-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.d-logo {
  width: 46px; height: 46px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line);
  display: grid; place-items: center; overflow: hidden; flex: none;
}
.d-logo img { width: 24px; height: 24px; }
.d-logo span { font-weight: 600; color: var(--muted); }
.d-title { flex: 1; min-width: 0; }
.d-name {
  font-size: 24px; font-weight: 600; letter-spacing: -.015em; line-height: 1.25; display: block;
  border: 0; outline: 0; background: none; width: 100%; padding: 0; margin: 0; resize: none; overflow: hidden; font-family: inherit;
}
.d-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--muted); font-size: 13px; margin-top: 2px; }
.d-meta a { text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.d-meta a:hover { color: var(--accent); }
.d-meta svg { width: 13px; height: 13px; }

.phases {
  display: flex; align-items: center; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 6px; margin-bottom: 16px;
}
.phase {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 8px;
  border-radius: 7px; color: var(--faint); font-weight: 500; white-space: nowrap; position: relative;
}
.phase:hover { background: var(--hover); color: var(--text); }
.phase .num {
  width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid currentColor; display: grid; place-items: center;
  font-size: 11px; flex: none;
}
.phase .num svg { width: 12px; height: 12px; stroke-width: 2.5; }
.phase.done { color: var(--muted); }
.phase.done .num { background: var(--muted); border-color: var(--muted); color: #fff; }
.phase.now, .phase.now:hover { background: var(--ph); color: #fff; }
.phase.now .num { border-color: #fff; background: #fff; color: var(--ph); }
.phase.s-novy { --ph: #7A8088; }
.phase.s-osloveno { --ph: var(--s-osloveno); }
.phase.s-nabidka { --ph: var(--s-nabidka); }
.phase.s-jednani { --ph: var(--s-jednani); }
.phase.s-klient { --ph: var(--s-klient); }
.phase-lost {
  display: inline-flex; align-items: center; gap: 5px; padding: 9px 12px; margin-left: 6px;
  color: var(--faint); border-radius: 7px; white-space: nowrap; font-weight: 500;
}
.phase-lost:hover { color: var(--text); background: var(--hover); }
.phase-lost.on { color: var(--text); background: #EDEFF2; }
.phase-lost svg { width: 14px; height: 14px; }

.d-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); }
.panel-head h2 { font-size: 14px; font-weight: 600; margin: 0; }
.panel-body { padding: 12px 16px 14px; }
.link-btn { display: inline-flex; align-items: center; gap: 5px; color: var(--accent); font-size: 13px; font-weight: 500; }
.link-btn:hover { color: var(--accent-hover); }
.link-btn svg { width: 14px; height: 14px; }

.facts { display: grid; grid-template-columns: repeat(3, 1fr); }
.fact { padding: 12px 16px; min-width: 0; }
.fact + .fact { border-left: 1px solid var(--line-soft); }
.fact-label { font-size: 12px; color: var(--muted); }
.fact-value { font-size: 15px; font-weight: 500; margin-top: 1px; }
.fact-value.none { color: var(--faint); font-weight: 400; }
.fact-value.late { color: var(--danger); }
.fact-note { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.next { display: flex; gap: 8px; align-items: center; }
.next input[type=date] { width: 150px; flex: none; }
.next .grow { flex: 1; }

.composer textarea { width: 100%; resize: vertical; min-height: 64px; display: block; }
.types { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.types button {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 7px;
  font-size: 13px; color: var(--muted); border: 1px solid transparent;
}
.types button:hover { color: var(--text); background: var(--hover); }
.types button.on { border-color: var(--line); color: var(--text); background: var(--surface); box-shadow: var(--shadow); }
.types svg { width: 14px; height: 14px; }
.composer-foot { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.composer-foot .btn.primary { margin-left: auto; }

.timeline { margin-top: 6px; }
.event { display: flex; gap: 12px; padding: 12px 0 4px; position: relative; }
.event:not(:last-child)::after { content: ""; position: absolute; left: 14px; top: 42px; bottom: -8px; width: 1px; background: var(--line); }
.ev-icon { width: 29px; height: 29px; border-radius: 50%; display: grid; place-items: center; background: #EDEFF2; color: var(--muted); flex: none; }
.ev-icon svg { width: 14px; height: 14px; }
.ev-icon.nabidka { background: #FDF0DD; color: #A9620B; }
.ev-icon.schuzka { background: #F1E8FB; color: #7438B8; }
.ev-icon.hovor, .ev-icon.email { background: #E4EFFC; color: #1F68C2; }
.ev-body { flex: 1; min-width: 0; }
.ev-top { display: flex; gap: 10px; align-items: baseline; }
.ev-type { font-weight: 500; }
.ev-who { color: var(--muted); font-size: 12.5px; }
.ev-date { margin-left: auto; color: var(--faint); font-size: 12.5px; flex: none; }
.ev-text { white-space: pre-wrap; color: #3B3F45; margin-top: 2px; }
.ev-del { opacity: 0; color: var(--faint); padding: 2px; border-radius: 5px; display: flex; }
.event:hover .ev-del { opacity: 1; }
.ev-del:hover { color: var(--danger); }

.contact { display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px; padding: 9px 0; }
.c-reach { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 2px 16px; margin-top: 3px; font-size: 13px; }
.c-reach a { color: var(--text); text-decoration: none; }
.c-reach a:hover { color: var(--accent); }
.contact + .contact, .contact + .contact-edit, .contact-edit + .contact { border-top: 1px solid var(--line-soft); }
.c-main { flex: 1; min-width: 0; cursor: pointer; }
.c-name { font-weight: 500; }
.c-title { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-actions { display: flex; gap: 2px; }
.c-act { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; color: var(--accent); }
.c-act:hover { background: var(--accent-soft); }
.c-act.off { color: #D3D7DD; pointer-events: none; }
.contact-edit { padding: 10px 0; }
.contact-edit .form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.contact-edit .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }
.form-actions .btn.danger { margin-right: auto; }

.info-row { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 10px; }
.info-row + .info-row { border-top: 1px solid var(--line-soft); }
.info-row label { color: var(--muted); font-size: 13px; }
.info-row input, .info-row textarea, .info-row select {
  border: 1px solid transparent; outline: 0; background: none; padding: 8px; margin: 2px -8px; border-radius: 7px; width: calc(100% + 16px);
}
.info-row input:hover, .info-row textarea:hover, .info-row select:hover { background: var(--hover); }
.info-row input:focus, .info-row textarea:focus { background: var(--surface); border-color: var(--accent); }
.info-row input::placeholder, .info-row textarea::placeholder { color: #C5CAD0; }
.info-row textarea { resize: vertical; min-height: 60px; }
.info-row.al-top { align-items: start; }
.info-row.al-top label { padding-top: 10px; }
.d-foot { display: flex; justify-content: flex-end; }

/* ── Modal, toast ─────────────────────── */
.modal { position: fixed; inset: 0; background: rgba(20, 20, 15, .35); display: grid; place-items: center; z-index: 50; padding: 16px; }
.sheet { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lg); width: 100%; max-width: 540px; max-height: calc(100vh - 32px); overflow-y: auto; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 4px; }
.sheet-head h2 { margin: 0; font-size: 17px; font-weight: 600; }
.sheet-body { padding: 8px 20px; }
.sheet-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px 18px; }
.icon-btn { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; color: var(--muted); }
.icon-btn:hover { background: var(--line-soft); color: var(--text); }
.muted { color: var(--muted); }
.drop { border: 1.5px dashed #CFD4DA; border-radius: 10px; padding: 30px 16px; text-align: center; color: var(--muted); cursor: pointer; display: block; margin: 10px 0; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop svg { width: 26px; height: 26px; stroke-width: 1.5; margin-bottom: 6px; }
.drop strong { display: block; color: var(--text); font-weight: 500; }
.summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0 14px; }
.sum { background: var(--bg); border-radius: 8px; padding: 12px 14px; }
.sum b { font-size: 22px; font-weight: 600; display: block; }
.sum span { color: var(--muted); font-size: 12.5px; }
.form-row { display: grid; grid-template-columns: 130px 1fr; gap: 12px; align-items: center; margin: 10px 0; }
.form-row label { color: var(--muted); }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--text); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 60; font-size: 13.5px; }

/* ── Menší obrazovky ──────────────────── */
@media (max-width: 1200px) {
  .col-hide-lg { display: none; }
  .search { width: 220px; }
}
/* Rychlé akce jen na mobilu */
.quick { display: none; }
.nav .late-num, .nav-lbl + .count .late-num { display: none; }
.nav svg { display: none; }
a.btn { text-decoration: none; }
span.btn[disabled] { opacity: .4; }

@media (max-width: 900px) {
  body { font-size: 14px; padding-bottom: calc(60px + env(safe-area-inset-bottom)); }

  /* Horní lišta: jeden tenký řádek */
  .top { height: 52px; gap: 10px; padding: 0 12px; }
  .top .logo { font-size: 14px; }
  .top .logo small { display: none; }
  .top-right { flex: 1; gap: 8px; }
  .search { width: auto; flex: 1; min-width: 0; height: 34px; }
  .user { padding: 0; }
  .user span:not(.avatar) { display: none; }
  .avatar { width: 30px; height: 30px; }

  /* Záložky dole */
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; height: calc(58px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom); background: rgba(255,255,255,.96); border-top: 1px solid var(--line);
    backdrop-filter: blur(10px); z-index: 30; gap: 0;
  }
  .nav button { flex: 1; flex-direction: column; justify-content: center; gap: 3px; padding: 0; font-size: 11px; position: relative; }
  .nav svg { display: block; width: 21px; height: 21px; }
  .nav button.on { color: var(--accent); }
  .nav button.on::after { display: none; }
  .nav .count { position: absolute; top: 6px; left: calc(50% + 6px); }
  .nav .late-txt { display: none; }
  .nav .late-num { display: inline-grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
    background: var(--faint); color: #fff; font-size: 10.5px; font-weight: 600; }
  .nav .count.late .late-num { background: var(--danger); }

  .body { grid-template-columns: 1fr; }
  .side { display: none; }
  .main { padding: 12px 12px 24px; }

  /* Hlavička stránky: kategorie jako výběr, akce jen ikonou */
  .page-head { gap: 8px; margin-bottom: 10px; flex-wrap: nowrap; }
  .page-head h1 { display: none; }
  .page-head .sub { font-size: 13px; flex: none; }
  .side-select { display: block; flex: 1; min-width: 0; font-size: 14px; font-weight: 600; padding: 7px 28px 7px 10px; }
  .page-head .actions { gap: 6px; }
  .page-head .actions .btn { padding: 7px 9px; }
  .page-head .actions .btn span, .page-head .actions .muted { display: none; }

  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -12px 10px; padding: 0 12px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; font-size: 12.5px; padding: 3px 10px; }

  /* Tabulka jako jednoduchý seznam */
  .table-wrap { border-radius: 10px; }
  table, tbody { display: block; }
  thead, .col-hide-md, .col-hide-lg { display: none; }
  tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 10px; padding: 9px 12px; }
  tbody tr + tr { border-top: 1px solid var(--line-soft); }
  tbody tr + tr td { border-top: 0; }
  td { padding: 0; }
  tbody tr:hover td { background: none; }
  td:first-child .t-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  td:first-child .t-dom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .t-next { grid-column: 1 / -1; max-width: none; display: flex; gap: 6px; margin-top: 4px; font-size: 12.5px; }
  .t-next .t-dom { margin: 0; }
  .t-next.is-empty { display: none; }
  .tag { font-size: 11.5px; padding: 1px 8px; }

  /* Pipeline: sloupce vedle sebe, posun prstem */
  /* Pipeline: fáze pod sebou, rozjednané nahoře, Nový a Nezájem dole */
  .board { display: flex; flex-direction: column; gap: 10px; overflow: visible; padding: 0; }
  .col { min-height: 0; }
  .col[data-col="novy"] { order: 8; }
  .col[data-col="nezajem"] { order: 9; }
  .col-cards { max-height: none; overflow: visible; }
  .col-cards:empty { display: none; }
  .card-mini { cursor: pointer; }

  /* Detail */
  .crumb { margin-bottom: 8px; }
  .d-head { margin-bottom: 10px; }
  .d-name { font-size: 20px; }
  .phases { padding: 4px; margin-bottom: 10px; overflow-x: auto; }
  .phase { flex: none; padding: 7px 8px; font-size: 13px; }
  .phase .lbl { display: none; }
  .phase.now { flex: 1; }
  .phase.now .lbl { display: inline; }
  .phase-lost { padding: 7px 8px; font-size: 0; gap: 0; }
  .phase-lost svg { width: 16px; height: 16px; }
  .quick { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; margin-bottom: 12px; }
  .quick .btn { justify-content: center; padding: 10px 6px; }
  .d-grid { display: flex; flex-direction: column; gap: 0; }
  .d-grid > div { display: contents; }
  .p-facts { order: 1; } .p-contacts { order: 2; } .p-next { order: 3; } .p-hist { order: 4; } .p-info { order: 5; } .d-foot { order: 6; }
  .panel, .d-foot { width: 100%; min-width: 0; margin-bottom: 10px; }
  .composer-foot .field[type=date] { flex: 1; }
  .panel-head { padding: 10px 12px; }
  .panel-body { padding: 10px 12px 12px; }
  .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fact { padding: 10px 10px; }
  .fact-value { font-size: 14px; }
  .fact-note { font-size: 11.5px; }
  .next { flex-wrap: wrap; }
  .next input[type=date] { flex: 1; width: auto; }
  .next .grow { flex-basis: 100%; order: 3; }
  .types { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .types button { flex: none; }
  .composer-foot { flex-wrap: wrap; }
  .composer-foot .select { flex: 1; min-width: 0; }
  .info-row { grid-template-columns: 96px 1fr; }
  .contact-edit .form { grid-template-columns: 1fr; }
  .d-foot { justify-content: center; margin: 6px 0 10px; }

  .sheet { align-self: end; border-radius: 14px 14px 0 0; max-height: 90vh; }
  .modal { padding: 0; }
  .summary { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; gap: 6px; }

  #login { background-position: 72% center; align-items: flex-end; padding: 16px; }
  .login-card { padding: 28px 22px 24px; }
}
