/* Hello Obras — mobile-first (tablet) + desktop */

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Touch targets — tablet em campo */
@media (max-width: 1279px) {
  .ho-touch {
    min-height: 48px;
    min-width: 48px;
  }
  input, textarea, select, button.ho-touch {
    font-size: 16px; /* evita zoom iOS */
  }
}

/* Workspace: steps horizontais no mobile/tablet */
.ho-steps {
  display: flex;
  gap: 0.375rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  padding-bottom: 0.25rem;
}
.ho-steps button {
  scroll-snap-align: start;
  flex-shrink: 0;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  font-size: 0.8125rem;
}

/* Workspace mobile: scroll na página, conteúdo sem “quadrado preto” vazio */
@media (max-width: 1279px) {
  .ho-inspection-page {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
  }
  .ho-inspection-page.ho-tabs-visible {
    padding-bottom: calc(4.25rem + env(safe-area-inset-bottom, 0px));
  }
  .ho-inspection-grid {
    flex: 0 0 auto !important;
    min-height: auto !important;
    overflow: visible !important;
  }
  .ho-inspection-grid > section,
  .ho-inspection-grid > aside {
    flex: none !important;
    overflow: visible !important;
    min-height: auto;
  }
}

/* Abas inferiores — Nova NC / Registradas */
.ho-mobile-tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  padding-bottom: max(0.5rem, env(safe-area-inset-bottom, 0px));
  background: rgba(10, 10, 11, 0.96);
  border-top: 1px solid #18181B;
  backdrop-filter: blur(8px);
}
.ho-mobile-tabs button {
  flex: 1;
  min-height: 48px;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
}

/* Biblioteca — lista no mobile (espelha tabela desktop) */
.ho-library-list {
  background: #18181B;
}

.ho-library-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.625rem;
  width: 100%;
  padding: 0.75rem 0.875rem;
  border: none;
  border-bottom: 1px solid #27272A;
  background: transparent;
  color: #FAFAFA;
  text-align: left;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.ho-library-row:last-child {
  border-bottom: none;
}

.ho-library-row:active {
  background: rgba(20, 184, 166, 0.1);
}

.ho-library-id {
  flex-shrink: 0;
  width: 2rem;
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
  font-weight: 600;
  color: #14B8A6;
  line-height: 1.4;
  padding-top: 0.125rem;
}

.ho-library-body {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.ho-library-system {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #F87171;
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.ho-library-problem {
  display: block;
  font-size: 0.875rem;
  line-height: 1.45;
  color: #FAFAFA;
  text-align: left;
}

.ho-library-action {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: #14B8A6;
  padding-top: 0.125rem;
  white-space: nowrap;
}

/* Chips de sistema */
.ho-chip {
  @apply px-4 py-2.5 rounded-xl text-sm font-medium border border-ho-gray-700 transition;
}
.ho-chip-active {
  @apply bg-ho-teal text-ho-black border-ho-teal;
}

/* Safe area tablet */
@supports (padding: max(0px)) {
  body {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
    padding-bottom: max(0px, env(safe-area-inset-bottom));
  }
}

/* Desktop: painel de inspeção em 3 colunas */
@media (min-width: 1280px) {
  .ho-inspection-grid {
    display: grid;
    grid-template-columns: 11rem 1fr 20rem;
    min-height: 0;
  }
}

.htmx-request .htmx-indicator { opacity: 1; }
.htmx-indicator { opacity: 0; transition: opacity 200ms; }

/* Biblioteca — tabela estilo planilha */
.ho-library-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}
.ho-library-table th,
.ho-library-table td {
  vertical-align: top;
}
@media (max-width: 767px) {
  .ho-library-table {
    font-size: 0.8125rem;
  }
  .ho-library-table th,
  .ho-library-table td {
    padding: 0.625rem 0.5rem;
  }
}
