.mobile-header-selects {
  display: none;
  align-items: center;
  gap: 6px;
}

.mobile-header-selects .currency-select {
  padding: 6px 6px;
  font-size: 0.7rem;
  max-width: 100px;
}

/* ── Mobile action bar ── */
.mobile-action-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  z-index: 40;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
  flex-direction: column;
}

.mobile-action-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
}

.mobile-progress-label {
  flex: 1;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  text-align: center;
}


.btn-download-mobile {
  background: #0f172a;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: opacity 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-download-mobile:active { opacity: 0.85; }

.btn-new-mobile {
  background: transparent;
  color: #475569;
  border: 1px solid #e5e7eb;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-new-mobile:active { background: #f1f5f9; }

/* ── Mobile field sheet ── */
.mobile-field-sheet {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.mobile-field-sheet.hidden {
  display: none;
}

.mobile-field-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.2s;
}

.mobile-field-sheet.is-open .mobile-field-sheet-backdrop {
  opacity: 1;
}

.mobile-field-sheet-content {
  position: relative;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
}

.mobile-field-sheet.is-open .mobile-field-sheet-content {
  transform: translateY(0);
}

.mobile-field-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid #f1f5f9;
}

.mobile-field-sheet-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.mobile-field-sheet-actions {
  display: flex;
  gap: 8px;
}

.mobile-field-sheet-btn {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: #f1f5f9;
  color: #475569;
  transition: background 0.15s;
}

.mobile-field-sheet-btn:active { background: #e2e8f0; }

.mobile-field-sheet-btn-primary {
  background: #0f172a;
  color: #fff;
}

.mobile-field-sheet-btn-primary:active { opacity: 0.85; }

.mobile-field-sheet-body {
  padding: 16px 20px 24px;
  overflow-y: auto;
}

.mobile-item-sheet-body {
  display: grid;
  gap: 14px;
}

.mobile-sheet-field {
  display: grid;
  gap: 8px;
}

.mobile-sheet-field-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
  letter-spacing: 0.01em;
}

.mobile-item-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mobile-item-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.mobile-item-summary-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
}

.mobile-item-summary-value {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
}

.mobile-item-delete-btn {
  width: 100%;
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: #be123c;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.9rem;
  font-weight: 700;
}

.mobile-field-input {
  width: 100%;
  font-size: 1rem;
  font-weight: 500;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  outline: none;
  background: #f8fafc;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.mobile-field-input:focus {
  border-color: #0f172a;
  box-shadow: 0 0 0 1px #0f172a;
}

textarea.mobile-field-input {
  resize: vertical;
  min-height: 100px;
}

/* ── Mobile responsive overrides ── */
@media (max-width: 1023px) {
  .live-header-center {
    display: none;
  }

  /* Hide desktop action buttons on mobile */
  .live-header-right #btn-download,
  .live-header-right #btn-new-invoice {
    display: none;
  }

  .mobile-action-bar {
    display: flex;
  }

  .mobile-header-selects {
    display: flex;
  }

  /* Layout goes vertical on mobile */
  .live-doc-layout {
    flex-direction: column;
  }

  /* Guide becomes horizontal card above invoice */
  .guide-sidebar {
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
    overflow: visible;
  }

  .guide-sidebar.is-collapsed {
    margin-left: 0;
    margin-top: -200px;
    opacity: 0;
    pointer-events: none;
    position: absolute;
  }

  .guide-sidebar-inner {
    padding: 12px 16px;
    gap: 10px;
    height: auto;
  }

  .guide-header {
    display: none;
  }

  .guide-nudge {
    font-size: 11px;
    padding: 8px 10px;
  }

  .guide-sections {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
    flex: none;
  }

  .guide-section {
    flex: 0 0 auto;
    width: auto;
    padding: 6px 10px;
    gap: 6px;
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    border-radius: 20px;
  }

  .guide-section:hover {
    background: #f3f4f6;
  }

  .guide-section-status {
    width: 16px;
    height: 16px;
    margin-top: 0;
  }

  .guide-section-status.is-done::after {
    width: 5px;
    height: 8px;
  }

  .guide-section-label {
    font-size: 12px;
  }

  .guide-section-hint {
    display: none;
  }

  .guide-section-content {
    gap: 0;
  }

  .guide-progress-wrap {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding-top: 6px;
    border-top: none;
  }

  .guide-progress-bar {
    flex: 1;
  }

  .guide-progress-text {
    white-space: nowrap;
  }

  .guide-expand-btn {
    display: none !important;
  }

  .live-doc-surface {
    padding: 16px 8px 100px;
  }

  .floating-total {
    bottom: 70px;
    right: 12px;
    padding: 8px 14px;
    font-size: 0.8rem;
  }

  .floating-total-amount {
    font-size: 1rem;
  }

  .dialog-modal {
    top: auto;
    right: 1rem;
    left: 1rem;
    bottom: calc(5.75rem + env(safe-area-inset-bottom, 0px));
    width: auto;
  }

  .live-item-delete {
    right: -4px;
    top: -8px;
    width: 22px;
    height: 22px;
  }
}
