/* Upload, Workspace, Dateichips, Tool-Tabs. */

.app-header {
  background: var(--app-surface);
  border-bottom: 1px solid var(--app-border);
  margin-bottom: 1.25rem;
}

.app-header-inner {
  min-height: var(--ui-size-header);
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  gap: 1rem;
}

.app-header-context {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.app-footer {
  background: var(--app-surface);
  margin-top: auto;
  flex-shrink: 0;
}

.app-version-note {
  white-space: nowrap;
}

.app-context-note {
  font-size: var(--ui-font-size-sm);
  color: var(--app-muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

@media (max-width: 768px) {
  .app-header-context {
    justify-content: flex-start;
  }
}

.app-footer-reset,
.macro-params-reset {
  font-size: inherit;
  line-height: inherit;
  color: var(--bs-secondary-color);
  text-decoration: none;
  vertical-align: baseline;
}

.macro-params-reset {
  /* Ensure the reset button stays clickable above neighboring collapse toggles. */
  z-index: 5;
}

.app-footer-reset:hover,
.app-footer-reset:focus-visible,
.macro-params-reset:hover,
.macro-params-reset:focus-visible {
  color: var(--bs-body-color);
  text-decoration: underline;
}

.app-title {
  font-size: var(--ui-font-size-xl);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.files-section-heading {
  font-size: var(--ui-font-size-xs);
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--app-muted);
}

.upload-section {
  display: flex;
  justify-content: center;
  background: transparent;
  padding: 4.5rem 1rem 3rem;
}

.drop-zone {
  width: 100%;
  max-width: 35rem;
  border: 1px solid var(--app-border);
  border-radius: var(--app-panel-radius);
  padding: 2.5rem 2.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--app-surface);
}

.drop-zone:hover,
.drop-zone:focus-visible,
.drop-zone.drag-over {
  border-color: var(--app-primary);
  background: var(--app-surface);
  outline: none;
}

.drop-zone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.drop-zone-icon {
  display: inline-block;
  font-size: 1.25rem;
  color: var(--app-primary);
  margin-bottom: 0.75rem;
}

.drop-zone-title {
  font-size: 1rem;
  font-weight: 600;
}

.drop-zone-hint {
  font-size: var(--ui-font-size-sm);
  max-width: 22rem;
}

.workspace-panel {
  background: transparent;
  border: none;
  padding: 0.1rem 0 0.15rem;
}

.workspace-program-label {
  font-size: var(--ui-font-size-md);
  font-weight: 600;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.workspace-panel-selection {
  margin-top: 0.15rem;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--app-muted);
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.workspace-panel-quiet-btn {
  padding: 0;
  color: var(--app-muted);
  text-decoration: none;
  font-size: inherit;
  line-height: inherit;
  vertical-align: baseline;
}

.workspace-selection-delimiter {
  color: var(--app-muted);
}

.workspace-panel-quiet-btn:hover,
.workspace-panel-quiet-btn:focus-visible {
  color: var(--app-text);
  text-decoration: underline;
}

.workspace-panel .btn-outline-secondary {
  border-color: transparent;
  background: transparent;
  color: var(--app-muted);
}

.workspace-panel .btn-outline-secondary:hover,
.workspace-panel .btn-outline-secondary:focus-visible {
  border-color: transparent;
  background: var(--app-surface-muted);
  color: var(--app-text);
}

/* Parsed filename: version primary */
.file-display {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.file-display-version {
  font-weight: 600;
  font-size: 0.8125rem;
  font-family: var(--font-mono);
  line-height: 1.2;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.file-display-valid-from {
  margin-top: 0.1rem;
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--app-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.files-list-measure {
  position: absolute;
  visibility: hidden;
  pointer-events: none;
  height: 0;
  overflow: hidden;
  white-space: nowrap;
}

.file-card-count {
  font-size: 0.72rem;
  color: var(--app-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.file-card-count-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0;
  min-height: 0;
}

.file-card-count-row .file-card-count {
  margin-top: 0;
  min-width: max-content;
}

.file-card-count-row.text-danger .file-card-count {
  color: var(--status-diff);
}

.files-strip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.files-list {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

.file-list-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--ui-radius-control);
  box-shadow: none;
  transition: border-color 0.15s, background-color 0.15s;
  flex: 0 0 auto;
  width: auto;
  min-width: auto;
  scroll-snap-align: start;
  overflow: visible;
}

.file-list-item.disabled {
  background: var(--app-surface);
}

.file-list-item.disabled .file-display-version,
.file-list-item.disabled .file-display-valid-from {
  color: var(--app-muted);
}

.file-list-item.disabled .file-list-item-content {
  opacity: 0.7;
}

.file-list-item-error {
  border-color: color-mix(in srgb, var(--status-missing) 35%, var(--app-border));
}

.file-list-item-body {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.35rem 0.3rem 0.65rem;
  min-height: 2.25rem;
}

.file-list-item-header {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 1;
  min-height: 0;
  padding: 0;
}

.file-list-item-content {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem;
  flex: 0 1 auto;
  min-width: 0;
  padding-right: 0;
}

.file-compare-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  width: auto;
  min-height: 1.35rem;
  margin-top: 0;
  flex-shrink: 0;
  padding: 0.1rem 0.5rem;
  border: none;
  border-radius: var(--ui-radius-pill);
  background: var(--app-primary-light);
  color: var(--app-primary);
  font-size: 0.68rem;
  font-weight: 650;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, transform 0.1s;
}

.file-compare-toggle:hover {
  background: color-mix(in srgb, var(--app-primary-light) 70%, var(--app-primary) 12%);
  color: var(--app-primary-hover);
}

.file-compare-toggle--on:hover {
  background: color-mix(in srgb, var(--app-primary-light) 60%, var(--app-primary) 16%);
}

.file-list-item.disabled .file-compare-toggle {
  background: var(--app-surface-muted);
  color: var(--app-muted);
  border: none;
}

.file-list-item.disabled .file-compare-toggle:hover {
  background: var(--app-surface-muted);
  color: var(--app-text);
}

.file-compare-toggle i {
  font-size: 0.62rem;
}

.file-compare-toggle:active {
  transform: scale(0.96);
}

.file-remove-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border: none;
  border-radius: 0.375rem;
  background: transparent;
  color: var(--app-muted);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, transform 0.1s, opacity 0.15s;
}

@media (hover: hover) {
  .file-remove-btn {
      opacity: 0;
    }

  .file-list-item:hover .file-remove-btn,
    .file-list-item:focus-within .file-remove-btn {
      opacity: 1;
    }
}

.file-remove-btn::before {
  content: '';
  position: absolute;
  inset: -0.625rem;
}

.file-remove-btn:hover {
  background: rgba(26, 35, 50, 0.06);
  color: var(--app-text);
}

.file-remove-btn:active {
  transform: scale(0.96);
}

/* Tool-level tabs after loaded files */
.tools-section {
  scroll-margin-top: 1rem;
  min-width: 0;
  max-width: 100%;
}

.tool-tabs-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid var(--app-border);
  position: sticky;
  top: 0;
  z-index: var(--app-z-sticky-tool-tabs);
  background: var(--app-bg);
}

.tool-tabs {
  border-bottom: none;
}

.files-strip-clear {
  color: var(--app-muted);
  text-decoration: none;
}

.files-strip-clear:hover,
.files-strip-clear:focus-visible {
  color: var(--ui-color-danger);
  text-decoration: underline;
}

.tool-tabs .nav-link i {
  display: none;
}

.tool-tabs .nav-link {
  color: var(--app-muted);
  font-weight: 500;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 0.5rem 0.15rem;
  margin-right: 1.35rem;
}

.tool-tabs .nav-link.active {
  color: var(--app-primary);
  font-weight: 600;
  background: transparent;
  border-bottom-color: var(--app-primary);
}

.tool-tabs .nav-link:hover {
  color: var(--app-primary);
  border-bottom-color: rgba(var(--bs-primary-rgb), 0.25);
}

.tool-tabs .nav-link.active {
  color: var(--app-primary);
  background: transparent;
  border-bottom-color: var(--app-primary);
}

.tool-tab-content > .tab-pane {
  outline: none;
  min-width: 0;
  max-width: 100%;
}
