.pdf-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.rotation-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.rotation-controls .btn.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.2s ease;
}

.rotation-controls .btn.btn-icon:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  transform: scale(1.05);
}

.rotation-controls #rotate-mode {
  margin-left: 8px;
  padding: 4px 8px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text);
  border-radius: 4px;
}

.page-info {
  white-space: nowrap;
}

@media (max-width: 768px) {
  .pdf-controls {
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 12px;
    align-items: center;
    padding: 16px;
    background: var(--bg-elev);
    border-radius: 8px;
    margin: 12px 0;
  }

  .pdf-controls>* {
    flex: 0 0 auto;
  }

  .rotation-controls,
  .page-nav {
    width: auto;
    justify-content: center;
    display: flex;
    align-items: center;
  }

  .rotation-controls {
    border: none;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
  }

  .rotation-controls #rotate-mode {
    margin-left: 12px;
  }

  .page-nav {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 8px 12px;
  }
}

.compression-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.compression-panel-simple {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.compression-analysis {
  background: linear-gradient(135deg, rgba(23, 135, 255, 0.08) 0%, rgba(23, 135, 255, 0.04) 100%);
  border: 1px solid rgba(23, 135, 255, 0.2);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 8px;
}

.compression-analysis.analyzing {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
}

.analysis-loading {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 8px 0;
}

.analysis-header {
  font-size: 15px;
  margin-bottom: 8px;
  color: var(--text);
}

.analysis-details {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 8px;
}

.analysis-recommendation {
  font-size: 13px;
  color: var(--text);
  background: rgba(23, 135, 255, 0.12);
  border-left: 3px solid var(--brand);
  padding: 10px 12px;
  border-radius: 6px;
  margin-top: 12px;
}

.size-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
}

.size-current,
.size-estimate {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.size-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.size-value {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.size-arrow {
  font-size: 20px;
  color: var(--muted);
  margin: 0 8px;
}

.preset-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.preset-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}

.preset-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.preset-card.active {
  background: rgba(var(--brand), 0.15);
  border-color: var(--brand);
  color: var(--text);
}

.preset-label {
  font-weight: 600;
  font-size: 14px;
}

.preset-delta {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}

.preset-card.active .preset-delta {
  color: rgba(255, 255, 255, 0.8);
}

.compression-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.compression-stat {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.compression-stat .label {
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.compression-stat .value {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

.compression-stat .note {
  font-size: 13px;
  color: var(--text-secondary);
}

.compression-stat.custom .input-group {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.compression-stat.custom input,
.compression-stat.custom select {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: var(--text);
  padding: 8px 10px;
  font-size: 14px;
}

.compression-stat.custom input:focus,
.compression-stat.custom select:focus {
  outline: 2px solid rgba(var(--primary-rgb), 0.4);
}

.compression-stat.custom .note {
  margin-top: 6px;
}

.compression-stat.custom .note.warning {
  color: var(--danger, #ff6b6b);
}

.compression-presets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.compression-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 18px 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.compression-card:hover {
  transform: translateY(-2px);
  border-color: rgba(var(--primary-rgb), 0.4);
}

.compression-card.is-active {
  border-color: var(--primary);
  background: rgba(var(--primary-rgb), 0.18);
  color: var(--text);
}

.compression-card .card-title {
  font-size: 15px;
  font-weight: 600;
}

.compression-card .card-delta {
  font-size: 13px;
  color: var(--text-secondary);
}

.compression-card .card-note {
  font-size: 12px;
  color: var(--text-secondary);
}

.compression-presets.manual-override .compression-card.is-active {
  border-style: dashed;
}

.compression-insight {
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text-secondary);
}

.compression-advanced summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.compression-advanced summary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.compression-advanced summary::before {
  content: "⚙️";
  font-size: 14px;
}

.compression-advanced summary::after {
  content: "▶";
  font-size: 10px;
  margin-left: auto;
  transition: transform 0.2s ease;
}

.compression-advanced summary::-webkit-details-marker {
  display: none;
}

.compression-advanced[open] summary {
  background: rgba(var(--primary-rgb), 0.15);
  border-color: rgba(var(--primary-rgb), 0.35);
}

.compression-advanced[open] summary::after {
  transform: rotate(90deg);
}

.advanced-content {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  margin-top: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.advanced-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.advanced-control {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.advanced-control select,
.advanced-control input[type="number"] {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: var(--text);
  padding: 8px 10px;
}

.advanced-control.checkbox {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.advanced-control.checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

/* Responsive Two-Column Layout for Compress Tool */
@media (min-width: 769px) {
  .compress-layout {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 2rem;
    max-height: 90vh;
  }

  .pdf-preview-side {
    overflow: hidden;
  }

  .pdf-preview-wrapper {
    max-height: 85vh;
    overflow: hidden;
    position: sticky;
    top: 1rem;
    border-radius: 12px;
    border: 1px solid var(--border);
  }

  .pdf-preview-wrapper .canvas-container {
    max-height: 60vh;
    overflow: visible;
    /* Remove duplicate scrollbar - parent handles scrolling */
  }

  .controls-side {
    max-height: 85vh;
    overflow-y: auto;
    padding-right: 8px;
  }

  .controls-side::-webkit-scrollbar {
    width: 6px;
  }

  .controls-side::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
  }

  .controls-side::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
  }

  .controls-side::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
  }

  /* Horizontal compression cards for desktop */
  .compression-presets {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  .compression-card {
    padding: 14px 16px;
  }

  .compression-card .card-title {
    font-size: 14px;
  }

  .compression-card .card-delta {
    font-size: 12px;
  }

  .compression-card .card-note {
    font-size: 11px;
    line-height: 1.3;
  }

  /* Compact stats row for desktop */
  .compression-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
  }

  .compression-stat {
    padding: 12px 14px;
  }

  .compression-stat .value {
    font-size: 18px;
  }

  /* Advanced options in two columns */
  .advanced-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .advanced-content {
    padding: 16px;
  }
}

@media (min-width: 1200px) {
  .compress-layout {
    grid-template-columns: 1fr 450px;
    gap: 2.5rem;
  }

  .controls-side {
    padding-right: 12px;
  }
}

@media (max-width: 768px) {
  .compression-stats {
    grid-template-columns: 1fr;
  }

  .compression-card {
    padding: 16px;
  }

  .advanced-content {
    padding: 14px;
  }

  .advanced-grid {
    grid-template-columns: 1fr;
  }

  /* Ensure single column on mobile */
  .compress-layout {
    display: block;
  }

  .pdf-preview-wrapper {
    max-height: 50vh;
    margin-bottom: 1rem;
  }

  /* Mobile styles for new minimalist design */
  .size-info {
    padding: 16px;
    gap: 16px;
  }

  .size-value {
    font-size: 16px;
  }

  .preset-selector {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .preset-card {
    padding: 14px;
    flex-direction: row;
    justify-content: space-between;
  }
}

.rotation-buttons {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.rotation-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 100px;
}

.rotation-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.rotation-btn.selected {
  background: rgba(var(--primary-rgb), 0.2);
  border-color: var(--primary);
  color: var(--primary);
}

.rotation-icon {
  font-size: 24px;
  margin-bottom: 4px;
  font-weight: bold;
}

.rotation-btn span:last-child {
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.control-group {
  margin-bottom: 20px;
}

.control-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text);
}

.control-group select,
.control-group input[type="text"] {
  width: 100%;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: var(--text);
  font-size: 14px;
}

.control-group small {
  display: block;
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 12px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.nav-tool {
  background: none;
  border: none;
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-tool:hover {
  background: var(--bg-elev);
  color: var(--brand);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  background: none;
  border: none;
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-dropdown-toggle:hover {
  background: var(--bg-elev);
  color: var(--brand);
}

.dropdown-arrow {
  font-size: 10px;
  transition: transform 0.2s ease;
}

.nav-dropdown.open .dropdown-arrow {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 100;
}

.nav-dropdown.open .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  border-radius: 0;
  text-transform: none;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dropdown-item:first-child {
  border-radius: 8px 8px 0 0;
}

.dropdown-item:last-child {
  border-radius: 0 0 8px 8px;
}

.dropdown-item .icon {
  font-size: 16px;
}

.nav-secondary {
  display: flex;
  gap: 16px;
  margin-left: auto;
}

.tools-layout {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.main-tools {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.tool-group {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 16px;
  transition: all 0.2s ease;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-group:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.main-tool {
  width: 100%;
  background: none;
  border: none;
  text-align: center;
  cursor: pointer;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.main-tool .icon {
  font-size: 28px;
  display: block;
}

.main-tool .title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.main-tool .desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.3;
}

.convert-group {
  grid-column: 1 / -1;
}

.convert-group h3 {
  margin: 0 0 16px 0;
  font-size: 17px;
  text-align: center;
  color: var(--text);
  font-weight: 700;
}

.convert-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.convert-section h4 {
  margin: 0 0 12px 0;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.convert-tool {
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.convert-tool:hover {
  background: var(--card);
  border-color: var(--brand);
  transform: translateY(-1px);
}

.convert-tool .icon {
  font-size: 22px;
  display: block;
}

.convert-tool .title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.additional-tools {
  background: var(--bg-elev);
  padding: 24px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.additional-tools h3 {
  margin: 0 0 16px 0;
  font-size: 16px;
  color: var(--text);
}

.additional-tools .tool {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
}

.additional-tools .tool:hover {
  border-color: var(--brand);
  transform: translateX(4px);
}

.additional-tools .tool .icon {
  font-size: 24px;
  flex-shrink: 0;
}

.additional-tools .tool .title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.additional-tools .tool .desc {
  font-size: 14px;
  color: var(--muted);
}

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.mobile-menu-toggle span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:first-child {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:last-child {
  transform: rotate(-45deg) translate(7px, -6px);
}

.mobile-menu {
  position: fixed;
  top: 65px;
  left: 0;
  right: 0;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  transform: translateY(-100%);
  transition: transform 0.3s ease;
  z-index: 999;
  max-height: calc(100vh - 65px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-menu.open {
  transform: translateY(0);
}

/* Never show mobile menu on desktop */
@media (min-width: 769px) {
  .mobile-menu {
    display: none !important;
  }
}

/* On mobile, ensure menu is fully hidden until opened */
@media (max-width: 768px) {
  .mobile-menu {
    display: none;
    transform: none;
    /* prevent partial visibility due to small height */
  }

  .mobile-menu.open {
    display: block;
  }
}

.mobile-menu-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mobile-nav-tool {
  width: 100%;
  padding: 16px;
  text-align: left;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  line-height: 1.2;
}

.mobile-nav-tool:hover {
  background: var(--card);
  border-color: var(--brand);
}

.mobile-nav-tool .icon {
  font-size: 20px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mobile-convert-section {
  margin: 12px 0;
}

.mobile-convert-section h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

/* Mobile Layout */
@media (max-width: 768px) {
  .main-nav {
    display: none;
  }

  .mobile-menu-toggle {
    display: flex;
    transition: opacity 0.2s ease;
  }

  .mobile-menu-toggle:active {
    opacity: 0.7;
  }

  .mobile-menu-toggle.active span:first-child {
    transform: rotate(45deg) translate(6px, 6px);
  }

  .mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .mobile-menu-toggle.active span:last-child {
    transform: rotate(-45deg) translate(6px, -6px);
  }

  .nav-secondary {
    display: flex;
    margin-left: 0;
  }

  .main-tools {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .convert-tools {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .tool-group {
    padding: 16px 12px;
    min-height: 100px;
  }

  .convert-group {
    grid-column: 1;
  }

  .convert-tool {
    padding: 12px;
    min-height: 70px;
  }

  .tools-layout {
    gap: 20px;
  }

  .additional-tools {
    padding: 16px;
  }
}

/* Tools categories: two-column layout tuning */
.tools-categories.two-cols {
  display: grid;
  grid-template-columns: 1fr;
  /* Stack: Convert on its own line */
  gap: 24px;
}

.tools-categories.two-cols .tool-category h3 {
  margin-bottom: 12px;
}

.tools-categories.two-cols .category-tools {
  display: grid;
  gap: 12px;
}

/* Edit group: flexible grid of cards */
.edit-category .category-tools {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

/* Convert group: match Edit sizing for consistent card size */
.convert-category .category-tools {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

/* Ensure cards stretch uniformly within rows */
.tools-categories .category-tools {
  align-items: stretch;
}

.tools-categories .category-tools .tool {
  height: 100%;
}

/* Force consistent multi-column grids on desktop, overriding legacy nth-child rules */
.tools-categories.two-cols .tool-category.edit-category .category-tools,
.tools-categories.two-cols .tool-category.convert-category .category-tools {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

/* Keep single-column across breakpoints for clarity */

@media (max-width: 768px) {
  .tools-categories.two-cols {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* On small screens, 2-up is already defined globally; keep defaults */
}

/* Mid-sized hero title */
.hero h1.mid {
  font-size: clamp(24px, 3.2vw, 34px);
  font-weight: 800;
}

.source-ref a {
  font-size: 0.6em;
  text-decoration: none;
  color: var(--muted);
  margin-left: 4px;
}

/* High-contrast Choose files button in the hero dropzone */
.btn.choose-files {
  background: var(--bg);
  border: 2px solid color-mix(in srgb, var(--brand) 45%, var(--border));
  box-shadow: 0 2px 12px rgba(23, 135, 255, 0.12);
  margin-top: 16px;
}

.btn.choose-files:hover {
  background: color-mix(in srgb, var(--brand) 6%, var(--bg));
  border-color: color-mix(in srgb, var(--brand) 65%, var(--border));
}

@media (prefers-color-scheme: dark) {
  .btn.choose-files {
    background: color-mix(in srgb, var(--bg) 85%, #fff 15%);
    border-color: color-mix(in srgb, #fff 20%, var(--brand));
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 6px 20px rgba(0, 0, 0, 0.35);
  }

  .btn.choose-files:hover {
    background: color-mix(in srgb, var(--bg) 80%, #fff 20%);
  }
}

/* Better drag-drop visual feedback */
.dropzone {
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.dropzone::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--brand) 0%, transparent 40%, transparent 60%, var(--brand) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}

.dropzone.dragover {
  border-color: var(--brand);
  background-color: color-mix(in srgb, var(--brand) 5%, var(--bg-elev));
  transform: scale(1.02);
}

.dropzone.dragover::before {
  opacity: 0.1;
}

.dropzone:hover {
  border-color: var(--brand-600);
  cursor: pointer;
}

/* File processing animation */
@keyframes processing {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

.progress {
  position: relative;
  overflow: hidden;
  background: var(--bg-elev);
}

.progress::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: processing 1.5s infinite;
}

/* Better button states */
.btn {
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.4s, height 0.4s;
}

.btn:active::after {
  width: 300px;
  height: 300px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* File list improvements */
.file-item {
  animation: slideIn 0.3s ease;
  transition: all 0.2s ease;
}

.file-item:hover {
  background: var(--bg-elev);
  transform: translateX(4px);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Success/Error notifications */
.notification {
  position: fixed;
  top: 80px;
  right: 20px;
  padding: 16px 24px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  animation: slideInRight 0.3s ease;
  z-index: 100;
  max-width: 400px;
}

.notification.success {
  background: #10b981;
  color: white;
}

.notification.error {
  background: #ef4444;
  color: white;
}

.notification.info {
  background: var(--brand);
  color: white;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Accessibility improvements */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Mobile breadcrumb for tool pages */
.mobile-breadcrumb {
  display: none;
  font-size: 0.9rem;
  color: var(--muted);
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
}

.mobile-breadcrumb a {
  color: var(--text);
  text-decoration: none;
}

@media (max-width: 768px) {
  .mobile-breadcrumb {
    display: block;
  }
}

/* Focus indicators */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Skip to main content link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--brand);
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  z-index: 100;
  border-radius: 0 0 8px 0;
}

.skip-link:focus {
  top: 0;
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Tooltip */
.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 12px;
  background: var(--text);
  color: var(--bg);
  border-radius: 6px;
  font-size: 14px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  margin-bottom: 8px;
}

.tooltip:hover::after {
  opacity: 1;
}

/* Mobile improvements */
@media (max-width: 768px) {
  .tools-grid .grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .notification {
    left: 20px;
    right: 20px;
  }

  .site-header {
    padding: 8px 16px;
  }

  .nav {
    font-size: 14px;
    gap: 12px;
  }

  /* Hide privacy section on mobile - it has its own page */
  .privacy {
    display: none;
  }

  /* Center tool cards vertically and balance content */
  .tools-categories .tool {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 100px;
    padding: 14px;
    gap: 6px;
  }

  .tools-categories .tool .icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
  }

  .tools-categories .tool .title {
    font-size: 0.95rem;
    font-weight: 700;
  }

  .tools-categories .tool .desc {
    font-size: 0.85rem;
    line-height: 1.3;
  }
}

/* Mobile-only button restyle for clearer edges and better touch targets */
@media (max-width: 768px) {

  /* Base button */
  .btn {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border-width: 2px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1.25;
    min-height: 44px;
  }

  /* Primary button: higher contrast, flatter look */
  .btn.primary {
    background: var(--brand);
    color: #fff;
    border-color: color-mix(in srgb, var(--brand-700) 55%, #ffffff);
    box-shadow: 0 4px 14px rgba(23, 135, 255, 0.25);
  }

  .btn.primary:hover {
    filter: brightness(1.02);
  }

  .btn.primary:active {
    transform: translateY(0);
  }

  /* Secondary button: clear edge and neutral bg */
  .btn.secondary {
    background: var(--card);
    color: var(--text);
    border-color: color-mix(in srgb, var(--brand) 30%, var(--border));
  }

  /* Mobile nav items styled like buttons */
  .mobile-nav-tool {
    display: flex;
    align-items: center;
    border-width: 2px;
    border-radius: 12px;
    background: var(--card);
    border-color: color-mix(in srgb, var(--brand) 30%, var(--border));
    padding: 14px;
    font-weight: 700;
    min-height: 48px;
    line-height: 1.2;
  }

  .mobile-nav-tool:hover {
    background: color-mix(in srgb, var(--brand) 6%, var(--card));
    border-color: color-mix(in srgb, var(--brand) 45%, var(--border));
  }
}

@media (prefers-color-scheme: dark) and (max-width: 768px) {
  .btn {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 8px 20px rgba(0, 0, 0, 0.35);
  }

  .btn.secondary,
  .mobile-nav-tool {
    background: color-mix(in srgb, var(--bg) 85%, #ffffff 15%);
    border-color: color-mix(in srgb, #ffffff 18%, var(--brand));
  }
}

/* Print styles */
@media print {

  .site-header,
  .site-footer,
  .btn,
  .dropzone {
    display: none;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  :root {
    --brand: #0066cc;
    --text: #000000;
    --bg: #ffffff;
    --border: #000000;
  }

  @media (prefers-color-scheme: dark) {
    :root {
      --brand: #66b3ff;
      --text: #ffffff;
      --bg: #000000;
      --border: #ffffff;
    }
  }
}

/* Immediate Preview System Styles */
.immediate-preview-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 0;
}

.files-preview-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-elev);
  border-radius: 8px;
  padding: 12px;
  border: 1px solid var(--border);
}

.file-preview-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--card);
  border-radius: 8px;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.file-preview-item:hover {
  transform: translateX(2px);
  box-shadow: var(--shadow);
}

.file-preview-item .file-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.file-preview-item .file-name {
  flex: 1;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-preview-item .file-size {
  font-size: 14px;
  color: var(--muted);
  font-weight: 400;
}

.tool-selection-title {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
}

.immediate-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.tool-selection-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 80px;
  justify-content: center;
  text-align: center;
}

.tool-selection-btn:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.tool-selection-btn.primary {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 8%, var(--card));
}

.tool-selection-btn.primary:hover {
  background: color-mix(in srgb, var(--brand) 15%, var(--card));
}

.tool-selection-btn .note {
  margin: 0;
  color: var(--muted);
  font-weight: 400;
  font-size: 13px;
  line-height: 1.3;
}

/* Preview with Tools Section */
.preview-tools-section {
  margin-top: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.preview-tools-title {
  margin: 0 0 12px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
}

.preview-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

/* Smooth transitions for dropzone hiding */
.home-drop {
  transition: all 0.4s ease;
}

.dropzone {
  transition: all 0.3s ease;
}

/* Mobile responsiveness for immediate preview */
@media (max-width: 768px) {
  .immediate-preview-container {
    gap: 16px;
    padding: 12px 0;
  }

  .files-preview-list {
    padding: 12px;
  }

  .file-preview-item {
    padding: 12px;
  }

  .tool-selection-title {
    font-size: 18px;
  }

  .immediate-tools-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .tool-selection-btn {
    padding: 14px;
    min-height: 70px;
  }

  .preview-tools-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .preview-tools-section {
    padding: 16px 0;
  }

  .preview-tools-title {
    font-size: 16px;
    margin-bottom: 16px;
  }
}

/* Tool Transition Message */
.tool-transition-message {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 100;
  animation: slideInDown 0.4s ease;
}

.tool-transition-message.fade-out {
  animation: fadeOut 0.3s ease forwards;
}

.transition-content {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.tool-icon {
  font-size: 16px;
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
  }
}

/* Tool-focused dropzone styling */
.dropzone.tool-focused {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 3%, var(--bg-elev));
}

.dropzone.tool-focused::before {
  opacity: 0.05;
}

/* Enhanced Multi-File Support */
.files-preview-section {
  margin-bottom: 24px;
}

.files-header {
  margin-bottom: 16px;
  text-align: center;
}

.files-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.files-preview-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.file-preview-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--card);
  border-radius: 8px;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
  position: relative;
}

.file-preview-item:hover {
  transform: translateX(2px);
  box-shadow: var(--shadow);
  border-color: var(--brand);
}

.file-thumbnail {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-elev);
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-icon {
  font-size: 24px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elev);
  border-radius: 6px;
  flex-shrink: 0;
}

.file-info {
  flex: 1;
  min-width: 0;
}

.file-name {
  display: block;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.file-size {
  display: block;
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
}

.file-order {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--brand);
  color: white;
  font-size: 12px;
  font-weight: 600;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Multi-PDF Preview Section */
.multi-pdf-preview-section {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.pdf-selector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 12px;
}

.preview-section-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}

.pdf-selector {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 200px;
  max-width: 300px;
}

.pdf-selector:hover {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(23, 135, 255, 0.1);
}

.pdf-selector:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(23, 135, 255, 0.2);
}

.pdf-selector option {
  padding: 8px;
  background: var(--card);
  color: var(--text);
}

/* Tool Selection Only Section */
.tool-selection-only {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.pdf-preview-wrapper.compact {
  /* max-height: 400px; - Removed to prevent overlap */
}

.pdf-preview-wrapper.compact .canvas-container {
  max-height: 300px;
}

/* Hide original action buttons when PDF preview is active */
.tool-interface:has(.pdf-preview) .tool-header {
  display: none;
}

/* Reduce hero section padding when PDF preview is visible */
.hero-inner:has(.pdf-preview) {
  padding-top: 20px;
  padding-bottom: 16px;
}

/* Remove extra spacing from PDF preview container */
.pdf-preview-container {
  margin: 0;
  padding: 0;
}

/* Make PDF preview header blend with main interface */
.tool-interface .pdf-preview-wrapper {
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: hidden;
}

.tool-interface .pdf-preview {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  padding: 16px;
  overflow: visible;
}

.tool-interface .pdf-preview .pdf-preview-header {
  border-bottom: 1px solid var(--border);
  padding: 0 0 12px;
  margin: 0 0 16px 0;
}

.tool-interface .pdf-preview .pdf-viewer {
  background: transparent;
  padding: 0;
}

.tool-interface .pdf-preview .canvas-container {
  padding: 20px;
}

/* Bring tool interface with PDF preview closer to nav bar */
.tool-interface:has(.pdf-preview) {
  margin-top: 4px;
}

/* Mobile-specific compact layout for PDF preview */
@media (max-width: 768px) {
  .hero-inner:has(.pdf-preview) {
    padding-top: 12px;
    padding-bottom: 8px;
  }

  .tool-interface:has(.pdf-preview) {
    margin-top: 2px;
  }

  .tool-interface .pdf-preview .pdf-preview-header {
    padding: 0 0 8px;
    margin: 0 0 12px 0;
    flex-direction: column;
    gap: 12px;
  }

  .tool-interface .pdf-preview {
    padding: 12px !important;
    background: color-mix(in srgb, var(--bg) 92%, rgba(0, 0, 0, 0.02)) !important;
    display: block !important;
    visibility: visible !important;
    min-height: 60vh !important;
  }

  .tool-interface .pdf-preview .pdf-viewer {
    padding: 8px !important;
    min-height: 50vh !important;
    max-height: 60vh !important;
    overflow: auto !important;
    overflow-x: hidden !important;
    margin-top: 16px !important;
    margin-bottom: 32px !important;
    background: #f8f9fa !important;
    border-radius: 8px !important;
    display: block !important;
    visibility: visible !important;
  }

  .tool-interface .pdf-preview .canvas-container {
    padding: 12px 0 !important;
    min-height: 40vh !important;
    max-height: none !important;
    display: flex !important;
    justify-content: center !important;
    align-items: flex-start !important;
    height: 100% !important;
    visibility: visible !important;
  }

  .tool-interface .pdf-preview canvas.pdf-canvas {
    max-width: calc(100vw - 40px) !important;
    width: auto !important;
    height: auto !important;
    border-radius: 6px !important;
    flex-shrink: 1 !important;
    display: block !important;
    visibility: visible !important;
    min-height: 200px !important;
  }

  .tool-interface .pdf-preview .pdf-controls {
    position: relative;
    z-index: 1;
    margin-bottom: 16px;
  }
}

/* Mobile PDF preview with flexible layout */
@media (max-width: 768px) {

  /* Make tool interface a flex container */
  .tool-interface:has(.pdf-preview) {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-bottom: 20px;
  }

  /* PDF preview becomes flex container */
  .tool-interface .pdf-preview {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 16px;
  }

  /* PDF viewer gets flexible height */
  .pdf-viewer,
  .tool-interface .pdf-preview .pdf-viewer {
    flex: 1;
    min-height: 300px;
    max-height: 60vh;
    background: #f8f9fa;
    padding: 12px;
    overflow: auto;
    border-radius: 8px;
  }

  /* Canvas container fills the viewer height */
  .canvas-container,
  .tool-interface .pdf-preview .canvas-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    padding: 0;
  }

  /* Canvas responsive sizing */
  .pdf-canvas,
  .tool-interface .pdf-preview .pdf-canvas,
  .tool-interface .pdf-preview canvas.pdf-canvas {
    max-width: calc(100vw - 60px);
    max-height: calc(60vh - 80px);
    width: auto;
    height: auto;
    object-fit: contain;
  }

  /* Tool actions with flexible behavior */
  .pdf-actions {
    flex-shrink: 0;
    padding: 20px 16px;
    background: var(--card);
    border-radius: 12px;
    border: 1px solid var(--border);
  }
}

@media (prefers-color-scheme: dark) and (max-width: 768px) {

  .pdf-viewer,
  .tool-interface .pdf-preview .pdf-viewer {
    background: #1a1a1a !important;
  }
}

.preview-error {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-style: italic;
}

/* Mobile enhancements for multi-file */
@media (max-width: 768px) {
  .files-preview-list {
    max-height: 250px;
  }

  .file-preview-item {
    padding: 10px;
    gap: 10px;
  }

  .file-thumbnail,
  .file-icon {
    width: 40px;
    height: 40px;
  }

  .file-name {
    font-size: 14px;
  }

  .file-size {
    font-size: 12px;
  }

  .file-order {
    width: 20px;
    height: 20px;
    font-size: 11px;
    top: -4px;
    right: -4px;
  }

  .multi-pdf-preview-section {
    margin-top: 16px;
    padding-top: 16px;
  }

  .pdf-selector-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .preview-section-title {
    font-size: 15px;
    margin: 0;
    text-align: center;
  }

  .pdf-selector {
    min-width: auto;
    max-width: none;
    width: 100%;
  }

  .pdf-preview-wrapper.compact {
    max-height: 300px;
  }

  .pdf-preview-wrapper.compact .canvas-container {
    max-height: 220px;
  }

  .tool-transition-message {
    left: 20px;
    right: 20px;
    transform: none;
    top: 70px;
  }

  @keyframes slideInDown {
    from {
      opacity: 0;
      transform: translateY(-20px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* Tool Showcase Pages */
.tool-showcase {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  padding: 20px 0;
}

.showcase-action {
  text-align: center;
}

.showcase-btn {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 20px 32px;
  font-size: 18px;
  font-weight: 600;
  border-radius: 16px;
  text-decoration: none;
  transition: all 0.3s ease;
  background: var(--brand);
  color: white;
  border: 2px solid var(--brand);
  box-shadow: 0 8px 25px rgba(23, 135, 255, 0.25);
  min-width: 280px;
  justify-content: center;
}

.showcase-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(23, 135, 255, 0.35);
  background: var(--brand-600);
  border-color: var(--brand-600);
  color: white;
}

.showcase-btn:active {
  transform: translateY(-1px);
}

.btn-icon {
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.btn-text span {
  font-size: 18px;
  font-weight: 700;
}

.btn-text small {
  font-size: 14px;
  font-weight: 400;
  opacity: 0.9;
  white-space: nowrap;
}

.showcase-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 600px;
  width: 100%;
}

.feature {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
}

.feature-icon {
  font-size: 20px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elev);
  border-radius: 10px;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.feature-content {
  flex: 1;
}

.feature-content strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.feature-content p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.4;
}

/* Mobile showcase styles */
@media (max-width: 768px) {
  .tool-showcase {
    gap: 32px;
    padding: 16px 0;
  }

  .showcase-btn {
    flex-direction: column;
    gap: 10px;
    padding: 20px 28px;
    font-size: 17px;
    min-width: 260px;
    width: 90%;
    max-width: 400px;
  }

  .btn-text {
    align-items: center;
    text-align: center;
  }

  .btn-text span {
    font-size: 17px;
  }

  .btn-text small {
    font-size: 14px;
  }

  .showcase-features {
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: none;
  }

  .feature {
    align-items: center;
    text-align: center;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    background: var(--bg-elev);
    border-radius: 12px;
    border: 1px solid var(--border);
  }

  .feature-icon {
    font-size: 24px;
    width: 48px;
    height: 48px;
  }

  .feature-content {
    text-align: center;
  }

  .feature-content strong {
    font-size: 15px;
  }

  .feature-content p {
    font-size: 13px;
    line-height: 1.4;
  }
}

/* Minimize vertical spacing when tool interface is active */
.hero:has(.tool-interface:not(.hidden)) {
  padding: 8px 0 0 0;
}

.hero:has(.tool-interface:not(.hidden)) .hero-inner {
  padding-top: 0;
  padding-bottom: 0;
}

.hero:has(.tool-interface:not(.hidden)) .hero-content {
  display: none;
}

.tool-interface:not(.hidden) {
  margin-top: 0;
  padding-top: 0;
}

.tool-interface:not(.hidden) .tool-content {
  margin-top: 0;
}

/* Ensure proper spacing on mobile when tool is active */
@media (max-width: 768px) {
  .hero:has(.tool-interface:not(.hidden)) {
    padding: 4px 0 0 0;
  }

  .hero:has(.tool-interface:not(.hidden)) .hero-inner {
    padding-top: 0;
    padding-bottom: 0;
  }

  .tool-interface:not(.hidden) {
    padding-top: 0;
  }
}