/* Telefon (do 768 px): kompaktnější záhlaví a seznam dokladů. Na počítači se nic z toho neuplatní.
 * Načítá se po chrome.css. */

@media (max-width: 768px) {
  .tab-item.tab-desktop { display: none; }

  /* zaoblené záhlaví (hranatý okraj na telefonu působil neladně) */
  .header {
    border-radius: 0 0 22px 22px;
    border-bottom: none;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  }

  .header.header-root {
    min-height: 56px;
    padding: 10px 16px 8px 20px;
    align-items: center;
  }
  .header.header-root h1 { font-size: 30px; letter-spacing: -0.5px; }
  .header-actions { gap: 8px; }

  /* detail zakázky a dokladu: v záhlaví jen číslo, název je jednou v zaoblené kartě */
  .header-center .header-subtitle { font-size: 17px; font-weight: 700; letter-spacing: -0.2px; color: var(--text-primary); }
  .header-center .header-subtitle + h1 { display: none; }
  .detail-header {
    margin: 12px 16px;
    padding: 16px;
    border: none;
    border-radius: var(--radius-lg);
  }
  .detail-header .job-number { display: none; }
  .detail-header .job-title { font-size: 24px; line-height: 1.2; margin: 0 0 6px; overflow-wrap: anywhere; }

  /* detail: dlouhý název (např. zákazníka) se zalomí místo oříznutí */
  .header.header-sub { padding-top: 6px; padding-bottom: 8px; }
  .header-center h1 {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
    line-height: 1.2;
  }
  .header.header-root .header-round,
  .header.header-root .header-fab { width: 40px; height: 40px; }
  .header-round svg, .header-fab svg { width: 20px; height: 20px; }
}

/* ===== Chipy stavu (jedna řada, v případě potřeby se posouvá do strany) ===== */
.ph-chips { display: flex; gap: 8px; padding: 0 16px; }
.ph-chips.scroll { margin-top: 16px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px; }
.ph-chips.scroll::-webkit-scrollbar { display: none; }
.ph-chips.wrap { flex-wrap: wrap; padding: 0; }
.ph-chip {
  flex-shrink: 0;
  height: 36px;
  padding: 0 14px;
  border: none;
  border-radius: 18px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 15px;
  white-space: nowrap;
  cursor: pointer;
}
.ph-chip.late { color: var(--red); }
.ph-chip.on { background: var(--blue); color: #fff; font-weight: 600; }

/* ===== Řádek nástrojů ===== */
.bulk-toolbar.ph-tools { display: flex; align-items: center; gap: 12px; padding: 10px 16px 6px; }
.ph-tool {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 14px;
  border: none; border-radius: 18px;
  background: var(--bg-secondary); color: var(--text-primary);
  font-size: 14px; cursor: pointer;
}
.ph-badge {
  font-style: normal; font-size: 11px; font-weight: 700;
  min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box;
  border-radius: 9px; background: var(--blue); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
}
.ph-count { margin-left: auto; font-size: 13px; color: var(--text-tertiary); }

/* ===== Měsíční skupiny ===== */
.ph-month {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 14px 20px 6px;
  font-size: 13px; font-weight: 600; letter-spacing: 0.4px;
  text-transform: uppercase; color: var(--text-tertiary);
}

/* ===== Řádek dokladu ===== */
.ph-inv { gap: 12px; }
.ph-inv .list-item-content { min-width: 0; flex: 1; }
.ph-inv-title { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-inv-sub { font-size: 13px; color: var(--text-tertiary); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-inv-right { text-align: right; flex-shrink: 0; }
.ph-inv-amt { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ph-pill {
  display: inline-block; margin-top: 4px; padding: 2px 8px;
  border-radius: 10px; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.ph-ok { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--green); }
.ph-wait { background: color-mix(in srgb, var(--orange) 20%, transparent); color: var(--orange); }
.ph-late { background: color-mix(in srgb, var(--red) 18%, transparent); color: var(--red); }
.ph-muted { background: var(--bg-tertiary); color: var(--text-tertiary); }

/* ===== Panel Filtry a řazení ===== */
.ph-sheet-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); z-index: 200; }
.ph-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 201;
  max-height: 86vh; display: flex; flex-direction: column;
  background: var(--bg-secondary); border-radius: 22px 22px 0 0;
  padding-bottom: var(--safe-bottom);
}
.ph-sheet-grip, .ph-sheet-head { touch-action: none; }
.ph-sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--text-quaternary); margin: 10px auto 6px; flex-shrink: 0; position: relative; }
.ph-sheet-grip::after { content: ''; position: absolute; left: -30px; right: -30px; top: -10px; bottom: -8px; } /* větší oblast pro chycení prstem */
.ph-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 20px 0; flex-shrink: 0; }
.ph-sheet-head h2 { font-size: 20px; font-weight: 700; }
.ph-link { background: none; border: none; color: var(--blue); font-size: 16px; cursor: pointer; padding: 8px 0; }
.ph-sheet-body { overscroll-behavior: contain; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 20px 8px; }
.ph-label { font-size: 12px; font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase; color: var(--text-tertiary); margin: 16px 0 8px; }
.ph-sheet .ph-chip { background: var(--bg-tertiary); }
.ph-sheet .ph-chip.on { background: var(--blue); }
.ph-dates { display: flex; align-items: center; gap: 8px; }
.ph-dates .form-input { flex: 1; min-width: 0; }
.ph-radio {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border: none; border-bottom: 0.5px solid var(--separator);
  background: none; color: inherit; font: inherit; font-size: 16px; text-align: left; cursor: pointer;
}
.ph-radio.on { font-weight: 700; }
.ph-radio b { color: var(--blue); }
.ph-sheet-foot { padding: 10px 20px 14px; flex-shrink: 0; }
.ph-sheet-foot .btn { width: 100%; }

/* ===== Kolečko s iniciály zákazníka ===== */
.ph-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: var(--bg-tertiary); color: var(--text-secondary);
  font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.ph-blue { background: color-mix(in srgb, var(--blue) 20%, transparent); color: var(--blue); }
.ph-purple { background: color-mix(in srgb, var(--purple) 20%, transparent); color: var(--purple); }

/* mezera pod záhlavím, když je nahoře hledací pole */
#content > .search-bar:first-child { padding-top: 16px; }

/* ===== Detail dokladu: sbalený seznam zakázek ===== */
.ph-jobs summary {
  list-style: none; display: flex; align-items: center; justify-content: space-between;
  min-height: 48px; padding: 0 16px; cursor: pointer; font-size: 16px; font-weight: 600;
}
.ph-jobs summary::-webkit-details-marker { display: none; }
.ph-jobs summary::after { content: '›'; margin-left: 10px; color: var(--text-tertiary); font-size: 22px; transition: transform 0.15s; }
.ph-jobs[open] summary::after { transform: rotate(90deg); }
.ph-jobs summary > span:first-child { flex: 1; }
.ph-jobs-count { font-size: 13px; font-weight: 600; color: var(--text-tertiary); background: var(--bg-tertiary); border-radius: 10px; padding: 1px 9px; }
.ph-jobs .inv-job-link { color: inherit; text-decoration: none; border-top: 0.5px solid var(--separator); }
