/* =========================================================================
   Supabase visual overlay ? token-only, no layout changes.
   Each batch from redesign-prompts/ APPENDS rules to this file.
   Do NOT modify rules from earlier batches. Do NOT add layout properties.
   ========================================================================= */

/* ---------- Batch 2 ? Typography ---------- */

body {
  font-family: Inter, "Helvetica Neue", Helvetica, Arial, ui-sans-serif, system-ui, sans-serif;
  color: var(--text-primary);
  background: var(--bg-page);
}

code,
pre,
kbd,
samp,
.console-log,
.console-log-line {
  font-family: "JetBrains Mono", "SF Mono", Menlo, Monaco, "Courier New", monospace;
}

h1,
h2,
h3,
h4,
.brand-heading,
.app-panel h2,
.app-panel h3,
.right-workspace h2,
.right-workspace h3 {
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

p,
.brand-description,
.drop-zone-copy,
.drop-zone-helper,
.folder-panel-subtitle {
  color: var(--text-secondary);
}

small,
.text-faint,
.drop-zone-helper {
  color: var(--text-muted);
}

/* ---------- Batch 3 ? Cards & Panels ---------- */

.app-panel,
.mode-card,
.dashboard-section,
.result-card,
.validation-summary-card,
.folder-panel,
.modal-card,
.drawer-panel,
.activity-list,
.activity-detail,
.issue-center {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: none;
  color: var(--text-primary);
}

/* Slightly elevated cards (modals, drawers) get a soft shadow */
.modal-card,
.drawer-panel {
  box-shadow: var(--shadow-md);
}

/* Inner panel-2 surfaces (e.g., quick stats grid) */
.quick-stats,
.stats-grid,
.app-panel .app-panel,
.dashboard-section .dashboard-section {
  background: var(--bg-panel-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
}

/* Folder panel header subtitle / metrics */
.folder-panel-title {
  color: var(--text-primary);
}

.folder-panel-subtitle {
  color: var(--text-muted);
}

.folder-panel-metrics {
  color: var(--text-secondary);
}

.folder-panel-metrics strong {
  color: var(--text-primary);
}

/* ---------- Batch 4 ? Buttons ---------- */

.primary-button,
.download-primary {
  background: var(--brand);
  color: #171717;
  border: 1px solid var(--brand);
  border-radius: var(--r-sm);
  font-weight: 500;
  letter-spacing: 0;
  box-shadow: none;
  transition: background 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease);
}

.primary-button:hover:not(:disabled),
.download-primary:hover:not(:disabled) {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
  color: #171717;
}

.primary-button:focus-visible,
.download-primary:focus-visible {
  outline: none;
  box-shadow: var(--ring-focus);
}

.primary-button:disabled,
.download-primary:disabled {
  background: var(--bg-card-2);
  color: var(--text-faint);
  border-color: var(--border);
  box-shadow: none;
}

.secondary-button {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-weight: 500;
  box-shadow: none;
  transition: background 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease);
}

.secondary-button:hover:not(:disabled) {
  background: var(--neutral-soft);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.secondary-button:focus-visible {
  outline: none;
  box-shadow: var(--ring-focus);
}

.secondary-button:disabled {
  color: var(--text-faint);
  border-color: var(--border);
}

.icon-button {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  box-shadow: none;
  transition: background 160ms var(--ease), color 160ms var(--ease), border-color 160ms var(--ease);
}

.icon-button:hover {
  background: var(--neutral-soft);
  color: var(--text-primary);
  border-color: var(--border);
}

.icon-button:focus-visible {
  outline: none;
  box-shadow: var(--ring-focus);
}

/* Danger / cancel button variant ? applies if the codebase uses these classes */
.danger-button,
.cancel-button,
button.danger,
button.cancel {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: var(--r-sm);
  font-weight: 500;
  box-shadow: none;
  transition: background 160ms var(--ease), color 160ms var(--ease);
}

.danger-button:hover:not(:disabled),
.cancel-button:hover:not(:disabled),
button.danger:hover:not(:disabled),
button.cancel:hover:not(:disabled) {
  background: var(--danger-soft);
  color: var(--danger);
}

/* ---------- Batch 5 ? Inputs ---------- */

.ui-input,
input[type="text"],
input[type="search"],
input[type="email"],
input[type="number"],
input[type="url"],
input[type="tel"],
input[type="password"],
textarea,
select {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-family: inherit;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease), background 160ms var(--ease);
}

.ui-input::placeholder,
input::placeholder,
textarea::placeholder {
  color: var(--text-faint);
}

.ui-input:hover:not(:disabled):not(:focus),
input:hover:not(:disabled):not(:focus),
textarea:hover:not(:disabled):not(:focus),
select:hover:not(:disabled):not(:focus) {
  border-color: var(--border-strong);
}

.ui-input:focus,
input:focus,
textarea:focus,
select:focus {
  border-color: var(--brand);
  box-shadow: var(--ring-focus);
  outline: none;
  background: var(--bg-input);
}

.ui-input:disabled,
input:disabled,
textarea:disabled,
select:disabled {
  background: var(--bg-card-2);
  color: var(--text-faint);
  border-color: var(--border);
}

/* Native search clear button keeps default in light theme */
input[type="search"]::-webkit-search-cancel-button {
  cursor: pointer;
  opacity: 0.6;
}

input[type="search"]::-webkit-search-cancel-button:hover {
  opacity: 1;
}

/* ---------- Batch 6 ? Drop Zones & Upload Summary ---------- */

.drop-zone {
  background: var(--bg-card);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
  color: var(--text-primary);
  box-shadow: none;
  transition: border-color 160ms var(--ease), background 160ms var(--ease);
}

.drop-zone:hover {
  border-color: var(--brand);
  background: var(--brand-soft-2);
}

.drop-zone.drag-active,
.drag-active.drop-zone {
  border-style: solid;
  border-color: var(--brand);
  background: var(--brand-soft);
}

.drop-zone[data-state="selected"] {
  border-style: solid;
  border-color: var(--brand);
  background: var(--brand-soft-2);
}

/* Already done in earlier work: hide long copy after selection */
.drop-zone[data-state="selected"] .drop-zone-copy,
.drop-zone[data-state="selected"] .drop-zone-helper {
  display: none;
}

.drop-zone-icon {
  background: var(--brand-soft);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--brand-strong);
}

.drop-zone-title {
  color: var(--text-primary);
  font-weight: 600;
}

.drop-zone-copy {
  color: var(--text-secondary);
}

.drop-zone-helper {
  color: var(--text-muted);
}

/* Upload summary chip shown after file is selected */
.upload-file-summary {
  background: var(--brand-soft-2);
  border: 1px solid var(--brand);
  border-radius: var(--r-md);
  color: var(--text-primary);
  box-shadow: none;
}

.upload-summary-head {
  color: var(--text-primary);
}

.upload-summary-head strong {
  color: var(--text-primary);
}

.upload-summary-action {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-weight: 500;
  box-shadow: none;
  transition: background 160ms var(--ease), border-color 160ms var(--ease);
}

.upload-summary-action:hover:not(:disabled) {
  background: var(--neutral-soft);
  border-color: var(--border-strong);
}

.upload-summary-action.danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: transparent;
}

.upload-summary-action.danger:hover:not(:disabled) {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger);
}

/* ---------- Batch 7 ? Status Pills & Result Workspace Badges ---------- */

.status-pill {
  border-radius: var(--r-pill);
  font-weight: 500;
  letter-spacing: 0;
  box-shadow: none;
  border: 1px solid transparent;
}

.status-pill[data-tone="idle"] {
  background: var(--neutral-soft);
  color: var(--text-muted);
  border-color: var(--border);
}

.status-pill[data-tone="processing"] {
  background: var(--info-soft);
  color: var(--info);
}

.status-pill[data-tone="ready"],
.status-pill[data-tone="success"] {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.status-pill[data-tone="warning"] {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-pill[data-tone="error"] {
  background: var(--danger-soft);
  color: var(--danger);
}

/* Header right-side badges (network type, scope type) */
.result-workspace-header-badges {
  color: var(--text-secondary);
}

.result-workspace-header-badge {
  background: var(--neutral-soft);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-weight: 500;
  box-shadow: none;
}

#resultNetworkTypeBadge,
#resultScopeTypeBadge {
  background: var(--brand-soft);
  color: var(--brand-strong);
  border-color: transparent;
}

#dashboardStatusPill[data-tone="idle"] {
  background: var(--neutral-soft);
  color: var(--text-muted);
  border-color: var(--border);
}

#dashboardStatusPill[data-tone="processing"] {
  background: var(--info-soft);
  color: var(--info);
}

#dashboardStatusPill[data-tone="ready"],
#dashboardStatusPill[data-tone="success"] {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

#dashboardStatusPill[data-tone="warning"] {
  background: var(--warning-soft);
  color: var(--warning);
}

#dashboardStatusPill[data-tone="error"] {
  background: var(--danger-soft);
  color: var(--danger);
}

/* ---------- Batch 8 ? Tabs ---------- */

.preview-tab,
.preview-sub-tab {
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  font-weight: 500;
  letter-spacing: 0;
  box-shadow: none;
  transition: color 160ms var(--ease), border-color 160ms var(--ease);
}

.preview-tab:hover:not(.active):not([aria-selected="true"]),
.preview-sub-tab:hover:not(.active):not([aria-selected="true"]) {
  color: var(--text-secondary);
}

.preview-tab.active,
.preview-tab[aria-selected="true"],
.preview-sub-tab.active,
.preview-sub-tab[aria-selected="true"] {
  color: var(--text-primary);
  border-bottom-color: var(--brand);
  background: transparent;
}

.preview-tab:focus-visible,
.preview-sub-tab:focus-visible {
  outline: none;
  box-shadow: var(--ring-focus);
  border-radius: var(--r-sm);
}

/* The tab strip container ? keep its layout but ensure no leftover bg */
#previewTabs,
#boqSubTabs,
#hpdbSubTabs {
  background: transparent;
}

/* Optional bottom hairline below the tab strip ? only if existing CSS already
   provides one. If it doesn't, this is a no-op. */
#previewTabs {
  border-bottom: 1px solid var(--border);
}

#boqSubTabs,
#hpdbSubTabs {
  border-bottom: 1px solid var(--border-soft);
}

/* ---------- Batch 9 ? Filter Chips & Option Cards ---------- */

.folder-filter-chip {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-weight: 500;
  letter-spacing: 0;
  box-shadow: none;
  transition: background 160ms var(--ease), color 160ms var(--ease), border-color 160ms var(--ease);
}

.folder-filter-chip:hover:not(.active) {
  background: var(--neutral-soft);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.folder-filter-chip.active,
.folder-filter-chip[aria-pressed="true"] {
  background: var(--brand-soft-2);
  color: var(--brand-strong);
  border-color: var(--brand);
}

/* Option cards (network type / scope type / output mode radios) */
.network-type-option {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-weight: 500;
  box-shadow: none;
  transition: background 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease);
  cursor: pointer;
}

.network-type-option:hover {
  border-color: var(--border-strong);
  background: var(--bg-card-2);
}

/* Selected state ? match what JS toggles. Two patterns covered:
   1. Native :has() with the checked input
   2. Class-based (some apps add .checked / .selected on the label) */
.network-type-option:has(.network-type-input:checked),
.network-type-option:has(.scope-type-input:checked),
.network-type-option:has(.output-mode-input:checked),
.network-type-option.checked,
.network-type-option.selected,
.network-type-option[aria-checked="true"] {
  background: var(--brand-soft-2);
  border-color: var(--brand);
  color: var(--text-primary);
}

.network-type-option:has(.network-type-input:checked) strong,
.network-type-option:has(.scope-type-input:checked) strong,
.network-type-option:has(.output-mode-input:checked) strong {
  color: var(--brand-strong);
}

.network-type-option:focus-within {
  border-color: var(--brand);
  box-shadow: var(--ring-focus);
}

/* Hint text shown below the option group */
#scopeTypeHint,
#networkTypeHint {
  color: var(--text-muted);
}

/* ---------- Batch 10 ? Workflow Stepper & App Header ---------- */

.app-header {
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border);
  box-shadow: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.brand-heading {
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.brand-description {
  color: var(--text-muted);
}

.workflow-stepper {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: none;
  color: var(--text-secondary);
}

.workflow-step {
  color: var(--text-muted);
  border: none;
  background: transparent;
}

/* Active step highlighted in primary ink */
.workflow-step[data-status="active"],
.workflow-step.active,
.workflow-step[aria-current="step"] {
  color: var(--text-primary);
}

/* Completed step uses emerald accent */
.workflow-step[data-status="complete"],
.workflow-step[data-status="completed"],
.workflow-step.complete,
.workflow-step.completed {
  color: var(--brand-strong);
}

/* Errored step uses danger color */
.workflow-step[data-status="error"],
.workflow-step.error {
  color: var(--danger);
}

/* Step number/dot circles ? try common selectors used by such steppers */
.workflow-step .step-number,
.workflow-step .step-dot,
.workflow-step .step-index {
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-weight: 500;
}

.workflow-step[data-status="active"] .step-number,
.workflow-step[data-status="active"] .step-dot,
.workflow-step[data-status="active"] .step-index,
.workflow-step.active .step-number,
.workflow-step.active .step-dot,
.workflow-step.active .step-index {
  background: var(--brand-soft);
  color: var(--brand-strong);
  border-color: var(--brand);
}

.workflow-step[data-status="complete"] .step-number,
.workflow-step[data-status="complete"] .step-dot,
.workflow-step[data-status="complete"] .step-index,
.workflow-step[data-status="completed"] .step-number,
.workflow-step.complete .step-number,
.workflow-step.completed .step-number {
  background: var(--brand);
  color: #171717;
  border-color: var(--brand);
}

.workflow-step[data-status="error"] .step-number,
.workflow-step.error .step-number {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger);
}

/* Step caption (Ready / Waiting / Completed) */
.workflow-step .step-caption {
  color: var(--text-muted);
}

.workflow-step[data-status="complete"] .step-caption,
.workflow-step.complete .step-caption {
  color: var(--brand-strong);
}

.workflow-step[data-status="active"] .step-caption,
.workflow-step.active .step-caption {
  color: var(--text-secondary);
}

/* ---------- Batch 11 ? Console Log, Alerts, Tooltips ---------- */

.console-log {
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-secondary);
  box-shadow: none;
}

.console-log-line {
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-soft);
}

.console-log-line:last-child {
  border-bottom: none;
}

.console-log-line.info,
.console-log-line[data-level="info"] {
  color: var(--text-secondary);
}

.console-log-line.warn,
.console-log-line.warning,
.console-log-line[data-level="warn"],
.console-log-line[data-level="warning"] {
  color: var(--warning);
}

.console-log-line.error,
.console-log-line[data-level="error"] {
  color: var(--danger);
}

.console-log-line.success,
.console-log-line[data-level="success"] {
  color: var(--brand-strong);
}

.console-log-line.debug,
.console-log-line[data-level="debug"] {
  color: var(--text-muted);
}

/* Error alert + retry bar */
.retry-bar,
#errorAlert {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  box-shadow: none;
}

.retry-bar .secondary-button,
#errorAlert .secondary-button {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}

.retry-bar .secondary-button:hover,
#errorAlert .secondary-button:hover {
  background: var(--danger);
  color: #FFFFFF;
}

/* Tooltip */
.tooltip,
[role="tooltip"] {
  background: #171717;
  color: #FFFFFF;
  border-radius: var(--r-sm);
  font-weight: 400;
  letter-spacing: 0;
  box-shadow: var(--shadow-md);
}

/* Tip icon (the small ? next to labels) */
.tip-icon {
  background: var(--neutral-soft);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-weight: 500;
  cursor: help;
  transition: background 160ms var(--ease), color 160ms var(--ease), border-color 160ms var(--ease);
}

.tip-icon:hover {
  background: var(--brand-soft-2);
  color: var(--brand-strong);
  border-color: var(--brand);
}

/* ---------- Batch 07 ? Theme color consistency ---------- */
body.text-zinc-100 {
  color: var(--text-primary);
}

.text-white {
  color: var(--text-primary);
}

.text-zinc-300 {
  color: var(--text-secondary);
}

.text-zinc-400,
.text-zinc-500 {
  color: var(--text-muted);
}

.text-emerald-300 {
  color: var(--brand-strong);
}

.text-amber-100 {
  color: var(--warning);
}

/* ---------- Batch 07 ? Typography polish ---------- */
body {
  line-height: 1.5;
}

h1,
h2,
h3,
h4,
.brand-heading {
  line-height: 1.25;
  font-weight: 600;
}

.console-log,
.console-log-line,
code,
pre,
kbd,
samp {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* ---------- Batch 07 ? Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms;
    animation-iteration-count: 1;
    transition-duration: 0.001ms;
    scroll-behavior: auto;
  }
}

/* =========================================================================
   Batch 09 ? Typography & Layout Polish (no color changes)
   Improves spacing, font consistency, and visual hierarchy across the app.
   ========================================================================= */

/* ---------- 9.1 Global type scale ---------- */

.brand-heading {
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.app-panel h2,
.right-workspace h2 {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.005em;
}

.app-panel h3,
.mode-card h3,
.fdt-coding-panel h3,
.dashboard-section h3,
.folder-panel-title {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.3;
}

.brand-description,
.upload-card p,
.mode-card > p,
.fdt-coding-panel p {
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.5;
}

/* ---------- 9.2 Header polish ---------- */

.app-header {
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
}

.header-actions {
  gap: 0.35rem;
}

.icon-button {
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.supported-files-trigger {
  font-size: 0.78rem;
  font-weight: 500;
  gap: 0.35rem;
}

/* ---------- 9.3 Workflow stepper ---------- */

.workflow-stepper {
  padding: 0.65rem 1rem;
  gap: 0.25rem;
}

.workflow-step-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.workflow-step-status {
  font-size: 0.64rem;
}

/* ---------- 9.4 Upload card & Drop zones ---------- */

.upload-card {
  padding: 1.15rem 1.25rem;
}

.drop-zone {
  min-height: 8.5rem;
  padding: 1rem;
}

.drop-zone-title {
  font-size: 0.86rem;
  font-weight: 700;
}

.drop-zone-copy {
  font-size: 0.76rem;
  line-height: 1.45;
}

.drop-zone-helper {
  font-size: 0.7rem;
  line-height: 1.4;
}

/* ---------- 9.5 Mode convert card ---------- */

.mode-card {
  padding: 1rem 1.15rem;
}

.network-type-option,
.output-mode-option {
  padding: 0.65rem 0.85rem;
  border-radius: var(--r-md);
}

/* Output-mode cards have a checkbox indicator at the left (::before at
   left:0.78rem, 1rem wide), so they need left padding to clear it.
   Restore the original left padding the base style.css uses. */
.output-mode-option {
  padding-left: 2.45rem;
}

.network-type-option strong,
.output-mode-option strong {
  font-size: 0.84rem;
  font-weight: 600;
}

.network-type-option small,
.output-mode-option small {
  font-size: 0.68rem;
}

#scopeTypeHint,
#networkTypeHint,
#outputModeHint {
  font-size: 0.72rem;
  margin-top: 0.35rem;
}

/* ---------- 9.6 FDT Coding & ManCore shortcut panels ---------- */

.fdt-coding-panel {
  padding: 0.6rem 0.75rem;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: transparent;
}

.fdt-coding-panel h3 {
  font-size: 0.82rem;
  font-weight: 700;
}

.fdt-coding-panel p {
  font-size: 0.72rem;
  line-height: 1.4;
  margin-top: 0.1rem;
}

.fdt-coding-panel-button {
  font-size: 0.78rem;
  padding: 0.5rem 1.2rem;
  white-space: nowrap;
  width: 180px;
  min-width: 180px;
  text-align: center;
  margin-top: 0;
  margin-left: auto;
  flex: 0 0 180px;
}

/* ---------- 9.7 Result workspace ---------- */

#resultDashboard {
  padding: 1.1rem 1.25rem;
}

.progress-heading-row {
  align-items: center;
}

#progressValue {
  font-size: 0.88rem;
  font-weight: 800;
}

.dashboard-empty-state strong {
  font-size: 0.92rem;
  font-weight: 700;
}

.dashboard-empty-state p {
  font-size: 0.8rem;
  line-height: 1.5;
}

.empty-step-list {
  font-size: 0.76rem;
  line-height: 1.6;
  padding-left: 1.2rem;
}

/* ---------- 9.8 Preview panel & tabs ---------- */

.preview-tab {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.55rem 0.85rem;
}

.preview-sub-tab {
  font-size: 0.74rem;
  font-weight: 500;
  padding: 0.45rem 0.7rem;
}

/* ---------- 9.9 Tables (BOQ / HPDB / NRO) ---------- */

.boq-preview-table th,
.hpdb-preview-table th {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.55rem 0.65rem;
}

.boq-preview-table td,
.hpdb-preview-table td {
  font-size: 0.78rem;
  padding: 0.5rem 0.65rem;
  line-height: 1.4;
}

.boq-empty-cell {
  font-size: 0.8rem;
  text-align: center;
  padding: 2rem 1rem;
}

/* ---------- 9.10 Modals ---------- */

.modal-card {
  border-radius: var(--r-lg);
  padding: 1.25rem;
}

.modal-header h2 {
  font-size: 0.95rem;
  font-weight: 700;
}

.modal-header p {
  font-size: 0.78rem;
  line-height: 1.45;
}

.modal-close {
  font-size: 1.6rem;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* ---------- 9.11 Folder panel ---------- */

.folder-panel {
  padding: 0.85rem 1rem;
}

.folder-panel-summary {
  gap: 0.75rem;
}

.folder-panel-subtitle {
  font-size: 0.76rem;
  line-height: 1.4;
}

.folder-panel-metrics {
  font-size: 0.72rem;
  gap: 0.75rem;
}

.folder-filter-chip {
  font-size: 0.72rem;
  padding: 0.3rem 0.65rem;
}

/* ---------- 9.12 Buttons consistency ---------- */

.primary-button,
.secondary-button {
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.6rem 1rem;
  border-radius: var(--r-sm);
}

/* ---------- 9.13 Inputs consistency ---------- */

.ui-input,
input[type="text"],
input[type="search"],
input[type="number"],
select,
textarea {
  font-size: 0.82rem;
  padding: 0.55rem 0.75rem;
  line-height: 1.4;
}

/* ---------- 9.14 Status pills & badges ---------- */

.status-pill {
  font-size: 0.68rem;
  padding: 0.22rem 0.58rem;
}

.result-workspace-header-badge {
  font-size: 0.66rem;
  padding: 0.18rem 0.52rem;
}

/* ---------- 9.15 Tip icon ---------- */

.tip-icon {
  font-size: 0.6rem;
  width: 1rem;
  height: 1rem;
}

/* ---------- 9.16 Download panel ---------- */

#downloadPanel {
  padding: 1.1rem;
  border-radius: var(--r-lg);
}

.output-file-row {
  gap: 0.5rem;
  align-items: center;
}

/* ---------- 9.17 Console / log ---------- */

.console-log {
  font-size: 0.72rem;
  line-height: 1.55;
  padding: 0.75rem;
}

.console-log-line {
  padding: 0.2rem 0;
}

/* ---------- 9.18 Spacing rhythm (global gaps) ---------- */

.left-workspace,
.right-workspace {
  gap: 1.25rem;
}

.app-layout {
  gap: 1.25rem;
}

.dashboard-sections {
  gap: 1rem;
}

.dashboard-section {
  padding: 0.9rem 1rem;
}

.dashboard-section-header {
  margin-bottom: 0.65rem;
}

/* ---------- 9.19 Validation summary ---------- */

.validation-summary-card {
  padding: 0.85rem 1rem;
  border-radius: var(--r-md);
}

/* ---------- 9.20 Geofabrik / Road source ---------- */

.road-source-details {
  padding: 0.65rem 0.85rem;
  border-radius: var(--r-md);
}

.road-source-summary {
  font-size: 0.82rem;
  font-weight: 500;
}

.road-source-summary strong {
  font-size: 0.84rem;
}

.road-source-summary small {
  font-size: 0.72rem;
}


/* ---------- Batch 09b ? Full-height modals (top to bottom) ---------- */
/* All popup/modals stretch tall with equal top/bottom margins. */

.modal-card,
.modal-card-wide {
  max-height: calc(100vh - 4rem);
  max-height: calc(100dvh - 4rem);
  height: calc(100vh - 4rem);
  height: calc(100dvh - 4rem);
}

.modal-card-fdt {
  height: calc(100vh - 4rem);
  height: calc(100dvh - 4rem);
  max-height: calc(100vh - 4rem);
  max-height: calc(100dvh - 4rem);
}

.modal-card-coreman {
  height: calc(100vh - 4rem);
  height: calc(100dvh - 4rem);
  max-height: calc(100vh - 4rem);
  max-height: calc(100dvh - 4rem);
}

@media (max-width: 640px) {
  .modal-card,
  .modal-card-wide,
  .modal-card-fdt,
  .modal-card-coreman {
    height: calc(100dvh - 1.5rem);
    max-height: calc(100dvh - 1.5rem);
  }
}

