/* Biblioteca Técnica — manuais PDF */
.tl-wrap { display: flex; flex-direction: column; gap: 14px; }

.tl-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(15, 23, 42, 0.6));
  border: 1px solid rgba(96, 165, 250, 0.25);
}

.tl-hero-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--text);
}

.tl-hero-sub {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.875rem;
  line-height: 1.5;
  max-width: 52rem;
}

.tl-hero-count {
  margin: 10px 0 0;
  font-size: 0.8125rem;
  color: var(--accent-bright);
  font-weight: 600;
}

.tl-hero-folder {
  margin: 4px 0 0;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.tl-hero-folder code {
  font-size: 0.7rem;
  color: var(--accent-bright);
}

.tl-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tl-toolbar { padding: 12px 16px; }

.tl-search {
  width: 100%;
  max-width: 480px;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text);
}

.tl-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 2px;
}

.tl-tab {
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-dim);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.tl-tab:hover { border-color: var(--accent); color: var(--text); }
.tl-tab.active {
  background: var(--accent-muted);
  border-color: var(--accent);
  color: var(--accent-bright);
}

.tl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.tl-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all var(--transition);
}

.tl-card:hover,
.tl-card.selected {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.tl-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.tl-card-icon { font-size: 1.5rem; }

.tl-badge {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.tl-badge-pdf {
  background: var(--danger-muted);
  color: var(--danger);
}

.tl-badge-nopdf {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-dim);
}

.tl-badge-offline {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}

.tl-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}

.tl-card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 0 0 6px;
  line-height: 1.35;
}

.tl-card-meta {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin: 0 0 10px;
}

.tl-card-pwds {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.tl-pwd {
  font-size: 0.6875rem;
  font-weight: 600;
  font-family: var(--font-mono, monospace);
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #86efac;
  cursor: pointer;
}

.tl-pwd-empty {
  font-size: 0.6875rem;
  color: var(--text-dim);
}

.tl-card-note {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin: 0;
  line-height: 1.4;
}

.tl-empty {
  grid-column: 1 / -1;
  color: var(--text-dim);
  padding: 24px;
  text-align: center;
}

.tl-detail {
  margin-top: 4px;
  padding: 18px 20px;
}

.tl-detail-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.tl-detail-type {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-bright);
  margin-bottom: 6px;
}

.tl-detail-head h2 {
  margin: 0 0 4px;
  font-size: 1.125rem;
}

.tl-detail-sub {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.875rem;
}

.tl-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.tl-detail-body {
  display: grid;
  gap: 14px;
}

.tl-detail-block h4 {
  margin: 0 0 8px;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.tl-pwd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.tl-pwd-grid span {
  display: block;
  font-size: 0.6875rem;
  color: var(--text-dim);
  margin-bottom: 2px;
}

.tl-pwd-grid strong {
  font-family: var(--font-mono, monospace);
  font-size: 1rem;
  color: #86efac;
}

.tl-notes, .tl-tags {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text);
}

.tl-meta-line {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.tl-form-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.tl-form-dialog {
  width: min(560px, 96vw);
  max-height: 92vh;
  overflow: auto;
}

.tl-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 16px 16px;
}

.tl-span-2 { grid-column: 1 / -1; }

.tl-form-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--border-subtle);
}

.tl-pdf-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 8px;
}

.tl-pdf-overlay.hidden { display: none; }

body.tl-pdf-open { overflow: hidden; }

.tl-pdf-panel {
  background: #0f172a;
  border-radius: 10px;
  width: min(1100px, 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tl-pdf-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tl-pdf-title {
  color: #e2e8f0;
  font-weight: 600;
  font-size: 0.9rem;
}

.tl-pdf-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.tl-pdf-frame {
  flex: 1;
  width: 100%;
  min-height: 0;
  border: 0;
  background: #1e293b;
}

@media (max-width: 640px) {
  .tl-form-grid { grid-template-columns: 1fr; }
  .tl-span-2 { grid-column: auto; }
  .tl-pdf-panel { border-radius: 0; }
  .tl-pdf-frame { min-height: 70vh; }
}

html.android-webview .tl-pdf-overlay,
html.mobile-shell .tl-pdf-overlay {
  padding: 0;
}

html.android-webview .tl-pdf-panel,
html.mobile-shell .tl-pdf-panel {
  border-radius: 0;
  width: 100%;
  height: 100%;
}
