@font-face {
  font-family: "Geist";
  src: url("https://assets.codepen.io/605876/GeistVF.ttf") format("truetype");
}

* {
  box-sizing: border-box;
}

/* Ensure the layout is flush and no horizontal scrolling occurs */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

:root {
  --size: 20px;
}

body {
  display: grid;
  place-items: center;
  min-height: 100dvh; /* Use dynamic viewport height */
  background: hsl(0 0% 6%);
  margin: 0;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.el {
  background: conic-gradient(from 180deg at 50% 70%, 
    hsla(0,0%,98%,1) 0deg, 
    #eec32d 72deg, 
    #ec4b4b 144deg, 
    #709ab9 216deg, 
    #4dffbf 288deg, 
    hsla(0,0%,98%,1) 360deg
  );
  width: 100vw;
  height: 100dvh;
  -webkit-mask:
    radial-gradient(circle at 50% 50%, white 2px, transparent 2.5px) 50% 50% / var(--size) var(--size),
    url("https://assets.codepen.io/605876/noise-mask.png") 256px 50% / 256px 256px;
  -webkit-mask-composite: destination-in;
  mask-composite: intersect;
  animation: flicker 20s infinite linear;
}

h1 {
  position: fixed;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  margin: 0;
  font-size: clamp(3rem, 5vw, 8rem); /* Responsive font size */
  font-family: "Geist", sans-serif;
  font-weight: 140;
  color: hsl(0 0% 2%);
  mix-blend-mode: soft-light;
  filter: drop-shadow(0 0 2px white);
  text-shadow: 2px 2px white;
}

@keyframes flicker {
  to {
    mask-position: 50% 50%, 0 50%;
  }
}

/* Google Fonts - Retro Elegant Duo */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@700;800&family=Fraunces:ital,opsz,wght@1,9..144,700&family=Montserrat:wght@400;700&display=swap');

/* Header styles */
header {
  width: 100%;
}
.header {
  display: flex;
  flex-wrap: nowrap; /* Always keep items in one horizontal row */
  justify-content: center;
  padding: 10px; /* Adds padding for better interaction */
  transition: flex-wrap 0.3s ease-in-out;
}

/* Box styles */
.box {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45%; /* Responsive width */
  max-width: 200px; /* Limit for larger screens */
  height: auto; /* Allow height to adapt */
  padding: 14px 10px; /* Adds internal spacing */
  color: white;
  font-family: 'Geist', sans-serif;
  font-weight: 500;
  text-decoration: none;
  font-size: clamp(10px, 1.3vw, 14px); /* Responsive font size */
  letter-spacing: 0.2em;
  text-transform: uppercase;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.2), rgba(0, 0, 0, 0.2)); /* Glossy effect */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 -2px 4px rgba(255, 255, 255, 0.4) inset; /* Depth and shine */
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  mix-blend-mode: plus-lighter;
}

.box:hover {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.35), rgba(0, 0, 0, 0.35)); 
  transform: translateY(-3px); 
  letter-spacing: 0.25em;
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3), 0 -2px 6px rgba(255, 255, 255, 0.5) inset;
}

.box.white {
  background: rgba(251, 251, 251, 0.9);
  color: black;
}
.box.yellow {
  background: rgba(254, 205, 9, 0.85);
  color: black;
}
.box.cyan {
  background: rgba(4, 204, 254, 0.85);
  color: black;
}
.box.green {
  background: rgba(0, 210, 1, 0.85);
  color: black;
}
.box.magenta {
  background: rgba(211, 0, 166, 0.85);
}
.box.red {
  background: rgba(212, 2, 2, 0.85);
}
.box.blue {
  background: rgba(1, 1, 254, 0.85);
}

/* Mobile responsiveness for boxes */
@media (max-width: 768px) {
  .header {
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
  }
  .box {
    width: calc(33.33% - 4px);
    max-width: none;
    min-height: 44px;
    font-size: 12px;
    padding: 12px 6px;
    letter-spacing: 0.15em;
  }
}

@media (max-width: 480px) {
  .box {
    width: calc(33.33% - 4px);
    font-size: 11px;
    padding: 10px 4px;
    letter-spacing: 0.1em;
  }
}

/* Dynamic content overlay styles */
.hidden {
  display: none !important;
}

/* General Styling for Buttons */
.custom-button {
  display: inline-block;
  padding: 15px 30px;
  font-family: 'Geist', sans-serif;
  font-size: clamp(14px, 1.5vw, 18px); /* Responsive font size */
  text-transform: uppercase;
  text-align: center;
  border: none;
  border-radius: 50px; /* Fully rounded corners */
  background: rgba(255, 255, 255, 0.1); /* Transparent background */
  box-shadow: 
      0 4px 6px rgba(0, 0, 0, 0.3), 
      inset 0 0 15px rgba(255, 255, 255, 0.4); /* Inner glow effect */
  backdrop-filter: blur(10px); /* Glassy blur effect */
  transition: all 0.3s ease-in-out;
  cursor: pointer;
  margin: 10px;
}

.custom-button:hover {
  background: rgba(255, 255, 255, 0.2); /* Slightly more opaque on hover */
  transform: translateY(-2px) scale(1.03); /* Subtle lift on hover */
  box-shadow: 
      0 8px 16px rgba(0, 0, 0, 0.4), 
      inset 0 0 20px rgba(255, 255, 255, 0.5); /* Stronger glow */
}

.custom-button:active {
  transform: translateY(1px) scale(0.98); /* Pressed state */
  box-shadow: 
      0 4px 8px rgba(0, 0, 0, 0.4), 
      inset 0 0 10px rgba(255, 255, 255, 0.3); /* Softer glow */
}

/* Styling for File Input */
#file-input {
  display: none; /* Hide the default file input */
}

#file-chosen {
  display: block;
  font-family: 'Montserrat', sans-serif;
  color: white;
  margin-top: 10px;
  font-size: 1rem;
  text-align: center;
}

.dynamic-content {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(920px, calc(100vw - 56px));
  max-height: min(78vh, 760px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: rgba(255, 255, 255, 0.06);
  color: black;
  z-index: 1000;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px) saturate(120%);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0;
  font-family: 'Montserrat', sans-serif;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.dynamic-content:hover {
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.32);
}

.content-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 22px 20px 20px;
  text-align: left;
  font-family: 'Montserrat', sans-serif;
}

#content-title {
  margin: 0 0 10px;
  padding-right: 42px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
  font-size: clamp(1.2rem, 2.1vw, 1.7rem);
  line-height: 1.12;
  color: rgba(255, 255, 255, 0.92);
}

#content-body {
  margin: 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: clamp(0.9rem, 1.1vw, 1rem);
  line-height: 1.58;
}

.close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.82);
}

.close-btn:hover {
  color: white;
  background: rgba(255, 255, 255, 0.14);
}

@media (max-width: 768px) {
  .dynamic-content {
    width: calc(100vw - 16px);
    max-height: 86dvh;
    border-radius: 16px;
  }

  .content-wrapper {
    padding: 18px 14px 16px;
  }

  #content-title {
    font-size: clamp(1.05rem, 5.3vw, 1.3rem);
    padding-right: 36px;
  }

  #content-body {
    font-size: 0.9rem;
    line-height: 1.5;
  }
}

@media (max-width: 600px) {
  .dynamic-content {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    transform: none;
    width: 100%;
    max-height: 90dvh;
    border-radius: 20px 20px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .dynamic-content::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin: 12px auto 0;
    flex-shrink: 0;
  }
}

/* Mobile: prevent iOS auto-zoom on inputs, enlarge touch targets */
@media (max-width: 768px) {
  .form-group input[type="number"],
  .form-group input[type="text"],
  .form-group input[type="password"],
  .form-group textarea,
  .custom-input,
  .code-textarea {
    font-size: 16px;
  }
  .close-btn {
    width: 44px;
    height: 44px;
    top: 12px;
    right: 12px;
  }
  .custom-button {
    min-height: 44px;
  }
}

/* PDF container styles */
#pdf-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: auto;
}

#pdfCanvas {
  border: 1px solid #000;
  width: 100%;
  height: auto;
}

#text-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* Allows input fields to receive events */
}

#text-layer input {
  position: absolute;
  border: 1px solid lightblue;
  background-color: rgba(255, 255, 255, 0.5); /* Semi-transparent background */
  color: black;
  outline: none;
  font-size: 12px;
  padding: 2px;
  resize: none;
  overflow: hidden;
  pointer-events: auto; /* Make input fields interactive */
}

/* inside styles.css */
#pdf-list li:active { cursor: grabbing; opacity: 0.7; }

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  color: white;
  font-family: 'Montserrat', sans-serif;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 6px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

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

/* Active nav button */
.box.active {
  outline: 3px solid rgba(255, 255, 255, 0.9);
  outline-offset: 3px;
}

/* Toast notifications */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 15, 15, 0.92);
  color: white;
  padding: 12px 26px;
  border-radius: 50px;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  z-index: 3000;
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px);
  pointer-events: none;
  white-space: nowrap;
  opacity: 1;
  transition: opacity 0.4s ease;
}
.toast.error  { border-color: rgba(212, 2, 2, 0.7); color: #ff7070; }
.toast.success { border-color: rgba(0, 210, 1, 0.7); color: #70ff70; }
.toast.fade-out { opacity: 0; }

/* Drag-and-drop file zone */
.file-drop {
  border: 2px dashed rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  padding: 18px 14px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin: 8px 0;
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  font-family: 'Montserrat', sans-serif;
  user-select: none;
}
.file-drop:hover,
.file-drop.drag-over {
  border-color: rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.05);
}
.file-drop .file-name {
  color: white;
  font-weight: 600;
  margin-top: 6px;
  font-size: 13px;
  word-break: break-all;
}

.file-preview-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 10px 0 0;
}

.file-preview-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-align: left;
}

.file-preview-frame,
.file-list-preview {
  display: grid;
  place-items: center;
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.08);
  aspect-ratio: 1 / 1;
}

.file-preview-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-preview-icon {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 12px;
  color: rgba(255, 255, 255, 0.82);
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.file-preview-meta {
  display: grid;
  gap: 3px;
}

.file-preview-meta strong {
  color: white;
  font-size: 13px;
  font-family: 'Montserrat', sans-serif;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-preview-meta span {
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  font-family: 'Montserrat', sans-serif;
}

/* Result box */
.result-box {
  margin-top: 16px;
  padding: 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
}
.result-box a {
  color: #04CCFE;
  font-weight: 600;
  text-decoration: none;
}
.result-box a:hover { text-decoration: underline; }
.result-box img { max-width: 100%; border-radius: 8px; margin-top: 10px; }

.tool-interface-shell {
  margin: 0 0 24px;
  padding: 0 0 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.bg-remove-result {
  display: grid;
  gap: 14px;
}

.bg-remove-stage {
  display: grid;
  gap: 10px;
}

.bg-remove-labels {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
  font-family: 'Montserrat', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.bg-remove-compare {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  min-height: 240px;
  background:
    linear-gradient(45deg, rgba(255,255,255,0.08) 25%, transparent 25%, transparent 75%, rgba(255,255,255,0.08) 75%),
    linear-gradient(45deg, rgba(255,255,255,0.08) 25%, transparent 25%, transparent 75%, rgba(255,255,255,0.08) 75%);
  background-size: 24px 24px;
  background-position: 0 0, 12px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.bg-remove-original-layer {
  position: absolute;
  inset: 0;
  animation: bg-remove-peel 2.8s ease-in-out infinite alternate;
  transform-origin: left center;
}

.bg-remove-image {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 240px;
  object-fit: contain;
  margin: 0;
}

.bg-remove-before {
  filter: saturate(0.9) brightness(0.92);
}

.bg-remove-after-wrap {
  position: absolute;
  inset: 0;
  width: 0;
  overflow: hidden;
  animation: bg-remove-reveal 2.8s ease-in-out infinite alternate;
}

.bg-remove-after {
  width: 100%;
  height: 100%;
}

.bg-remove-fade-mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(10,15,23,0.22) 0%, rgba(10,15,23,0) 22%, rgba(10,15,23,0) 78%, rgba(10,15,23,0.18) 100%);
  mix-blend-mode: screen;
  pointer-events: none;
}

.bg-remove-scanline {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, rgba(77,255,191,0), rgba(77,255,191,0.95), rgba(4,204,254,0));
  box-shadow: 0 0 20px rgba(4, 204, 254, 0.45);
  animation: bg-remove-scan 2.8s ease-in-out infinite alternate;
}

@keyframes bg-remove-reveal {
  0% { width: 0%; }
  15% { width: 18%; }
  55% { width: 76%; }
  100% { width: 100%; }
}

@keyframes bg-remove-peel {
  0% {
    clip-path: inset(0 0 0 0);
    opacity: 1;
    transform: scale(1);
    filter: saturate(1);
  }
  55% {
    clip-path: inset(0 24% 0 0);
    opacity: 0.7;
    transform: perspective(1000px) rotateY(-8deg) scale(0.985);
    filter: saturate(0.92);
  }
  100% {
    clip-path: inset(0 100% 0 0);
    opacity: 0;
    transform: perspective(1000px) rotateY(-16deg) scale(0.96);
    filter: saturate(0.82);
  }
}

@keyframes bg-remove-scan {
  0% { left: 0%; opacity: 0.4; }
  15% { opacity: 1; }
  100% { left: calc(100% - 3px); opacity: 0.9; }
}

/* Inline form labels */
.form-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 10px;
  width: 100%;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}
.form-group label {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  margin-bottom: 4px;
  font-family: 'Montserrat', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-group input[type="number"],
.form-group input[type="text"],
.form-group input[type="password"],
.form-group textarea {
  width: 100%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  color: white;
  padding: 10px 14px;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: rgba(255,255,255,0.55);
}
.form-group input[type="color"] {
  width: 48px;
  height: 36px;
  padding: 2px;
  background: none;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  cursor: pointer;
}

/* Backdrop for closing panel on outside click */
.panel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999;
}

/* Copy button for QR */
.copy-btn {
  font-size: 12px;
  padding: 6px 16px;
  margin-top: 8px;
}

/* Sortable file list */
.file-list {
  list-style: none;
  padding: 0;
  margin: 10px auto;
  max-width: 460px;
  width: 100%;
}
.file-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin: 5px 0;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9px;
  cursor: grab;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  color: white;
  transition: background 0.15s, border-color 0.15s;
  user-select: none;
}
.file-list-item:active { cursor: grabbing; }
.file-list-item.dragging { opacity: 0.35; }
.file-list-item.drag-over {
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.14);
}
.drag-handle {
  color: rgba(255, 255, 255, 0.35);
  font-size: 18px;
  flex-shrink: 0;
  line-height: 1;
}
.file-list-num {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.file-list-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: white;
}
.file-list-size {
  display: block;
  color: rgba(255, 255, 255, 0.38);
  font-size: 11px;
  flex-shrink: 0;
}
.file-list-meta {
  flex: 1;
  min-width: 0;
}
.file-list-preview {
  width: 56px;
  flex-shrink: 0;
  border-radius: 10px;
}
.file-list-remove {
  color: rgba(255, 255, 255, 0.3);
  font-size: 13px;
  cursor: pointer;
  flex-shrink: 0;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.file-list-remove:hover {
  color: white;
  background: rgba(255, 255, 255, 0.08);
}
/* Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Tool Card */
.tool-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    text-align: left;
    transition: transform 0.2s, background 0.2s;
    display: flex;
    flex-direction: column;
}

.tool-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-4px);
}

.tool-card h3 {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    color: white;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

.tool-card p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 15px;
    flex-grow: 1;
}

.tool-card ul {
    margin: 0 0 20px 0;
    padding: 0 0 0 20px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
}

.tool-card ul li {
    margin-bottom: 5px;
}

.card-btn {
    width: 100%;
    margin: 0;
    padding: 10px;
    font-size: 14px;
}

/* Custom Select for conversions */
.custom-input {
    width: 100%;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    color: white;
    padding: 10px 14px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    outline: none;
}
.custom-input option {
    background: #1a1a1a;
    color: white;
}

.qr-studio-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 20px;
  color: white;
  text-align: left;
}

.qr-studio-panel,
.qr-preview-panel {
  display: grid;
  gap: 18px;
  padding: 20px;
  border-radius: 24px;
  background: linear-gradient(155deg, rgba(8, 12, 20, 0.82), rgba(26, 34, 54, 0.58));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.qr-studio-head h3,
.qr-preview-top h4 {
  margin: 0;
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
  font-size: clamp(1.3rem, 2vw, 2rem);
}

.qr-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.qr-type-card {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.78);
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.qr-type-card:hover,
.qr-type-card.active {
  transform: translateY(-2px);
  border-color: rgba(4, 204, 254, 0.48);
  background: linear-gradient(135deg, rgba(77, 255, 191, 0.16), rgba(4, 204, 254, 0.18));
  color: white;
}

.qr-theme-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.qr-theme-card {
  padding: 12px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.76);
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.qr-theme-card.active {
  border-color: rgba(77, 255, 191, 0.5);
  background: linear-gradient(135deg, rgba(77, 255, 191, 0.2), rgba(4, 204, 254, 0.16));
  color: white;
}

.qr-studio-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.qr-custom-sections {
  display: grid;
  gap: 16px;
}

.qr-studio-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.qr-custom-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.qr-studio-card h4 {
  margin: 0;
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
}

.qr-style-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}

.qr-style-grid .form-group,
.qr-studio-card .form-group {
  max-width: none;
  margin: 0;
}

.qr-studio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.qr-preview-top {
  display: grid;
  gap: 6px;
}

.qr-preview-stage {
  display: grid;
  place-items: center;
  min-height: 320px;
  padding: 18px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top, rgba(77, 255, 191, 0.12), transparent 40%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.qr-preview-image {
  width: min(100%, 320px);
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}

.qr-preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.qr-preview-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.qr-payload-preview {
  margin: 14px 0 0;
  padding: 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  color: rgba(255, 255, 255, 0.84);
  white-space: pre-wrap;
  word-break: break-word;
  text-align: left;
  font-size: 12px;
}

/* Background no-bg toggle */
.qr-bg-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qr-bg-row input[type="color"] {
  flex: 1;
}

.qr-transparent-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.qr-transparent-toggle input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: #04ccfe;
}

/* Eye shape selector */
.qr-eye-section,
.qr-module-section,
.qr-logo-section {
  display: grid;
  gap: 10px;
}

.qr-section-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.qr-eye-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.qr-module-grid {
  display: grid;
  gap: 10px;
}

.qr-module-tier {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 8px;
}

.qr-module-tier-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.qr-eye-card,
.qr-module-card {
  padding: 10px 6px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.72);
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  text-align: center;
}

.qr-eye-card:hover,
.qr-eye-card.active,
.qr-module-card:hover,
.qr-module-card.active {
  transform: translateY(-2px);
  border-color: rgba(4, 204, 254, 0.5);
  background: linear-gradient(135deg, rgba(77, 255, 191, 0.16), rgba(4, 204, 254, 0.18));
  color: white;
}

/* Logo upload section */
.qr-logo-upload-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qr-file-label {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.8);
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
  white-space: nowrap;
}

.qr-file-label:hover {
  background: rgba(255, 255, 255, 0.12);
}

.qr-logo-filename {
  flex: 1;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qr-logo-clear {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 60, 60, 0.12);
  color: rgba(255, 120, 120, 0.9);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease;
  flex-shrink: 0;
}

.qr-logo-clear:hover {
  background: rgba(255, 60, 60, 0.22);
}

.qr-logo-size-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.qr-logo-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.74);
  cursor: pointer;
  user-select: none;
}

.qr-logo-option input[type="checkbox"] {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: #04ccfe;
}

.qr-eye-inner-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.qr-eye-inner-card {
  padding: 8px 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.72);
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  text-align: center;
}

.qr-eye-inner-card:hover,
.qr-eye-inner-card.active {
  transform: translateY(-2px);
  border-color: rgba(4, 204, 254, 0.5);
  background: linear-gradient(135deg, rgba(77, 255, 191, 0.16), rgba(4, 204, 254, 0.18));
  color: white;
}

.qr-logo-size-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
  min-width: 80px;
}

.qr-logo-slider {
  flex: 1;
  height: 4px;
  cursor: pointer;
  accent-color: #04ccfe;
}

.qr-logo-hint {
  margin: 0;
  font-size: 11px;
  color: rgba(4, 204, 254, 0.7);
  font-style: italic;
}

.ascii-studio {
  display: grid;
  gap: 18px;
  color: white;
  text-align: left;
}

.ascii-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.ascii-mode-card {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.78);
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.ascii-mode-card.active,
.ascii-mode-card:hover {
  transform: translateY(-2px);
  border-color: rgba(249, 115, 22, 0.45);
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.18), rgba(4, 204, 254, 0.16));
  color: white;
}

.ascii-studio-head {
  padding: 20px;
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(249, 115, 22, 0.18), transparent 34%),
    radial-gradient(circle at bottom left, rgba(4, 204, 254, 0.15), transparent 30%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.ascii-studio-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
}

.ascii-studio-grid-wide {
  grid-template-columns: minmax(320px, 0.95fr) minmax(0, 1.05fr);
}

.ascii-studio-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.ascii-output-card {
  align-content: start;
}

.ascii-panel-head {
  display: grid;
  gap: 6px;
}

.ascii-panel-head h4 {
  margin: 0;
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
  font-size: 1.1rem;
}

.ascii-panel-head p {
  margin: 0;
  color: rgba(255, 255, 255, 0.66);
  line-height: 1.55;
}

.ascii-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ascii-paste-zone {
  display: grid;
  gap: 6px;
  place-items: center;
  min-height: 120px;
  padding: 18px;
  border-radius: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.28);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
}

.ascii-paste-zone strong {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  color: white;
}

.ascii-paste-zone:focus {
  outline: 2px solid rgba(4, 204, 254, 0.35);
  outline-offset: 2px;
}

.ascii-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ascii-chip {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.72);
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.ascii-chip.active {
  border-color: rgba(249, 115, 22, 0.45);
  background: rgba(249, 115, 22, 0.18);
  color: white;
}

.ascii-preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.ascii-preset-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: white;
  text-align: left;
  cursor: pointer;
}

.ascii-preset-card strong {
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
}

.ascii-preset-card pre {
  margin: 0;
  max-height: 130px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.76);
  font: 9px/1.05 'Courier New', monospace;
}

.ascii-output {
  min-height: 280px;
}

.ascii-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ascii-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.ascii-result-box {
  overflow-x: auto;
  text-align: left;
}

.ascii-result-pre {
  margin: 0;
  color: #f8fafc;
  font: 11px/1.08 'Courier New', monospace;
}

.code-studio {
  display: grid;
  gap: 18px;
  color: white;
  text-align: left;
}

.code-studio-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 20px;
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(4, 204, 254, 0.18), transparent 34%),
    radial-gradient(circle at bottom left, rgba(254, 205, 9, 0.16), transparent 28%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.code-studio-kicker,
.code-panel-label {
  margin: 0 0 8px;
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.code-studio-hero h3,
.code-panel-head h4 {
  margin: 0;
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
  font-size: clamp(1.4rem, 2vw, 2.2rem);
  color: white;
}

.code-studio-copy {
  margin: 10px 0 0;
  max-width: 620px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.55;
}

.code-studio-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.code-studio-actions .custom-button,
.render-actions .custom-button {
  margin: 0;
}

.code-studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 18px;
}

.code-panel {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(7, 10, 16, 0.78), rgba(19, 24, 36, 0.58));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.code-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.code-panel-pill,
.render-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
}

.editor-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.editor-tab {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  padding: 9px 14px;
  font-family: 'Geist', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.editor-tab.active {
  color: black;
  background: linear-gradient(135deg, rgba(77, 255, 191, 0.95), rgba(4, 204, 254, 0.95));
  border-color: transparent;
}

.editor-stack {
  min-height: 360px;
}

.editor-pane {
  display: none;
  height: 100%;
}

.editor-pane.active {
  display: block;
}

.editor-label {
  display: inline-block;
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.code-textarea {
  width: 100%;
  min-height: 320px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
    #0a0f17;
  color: #f4fbff;
  font: 13px/1.6 'Courier New', monospace;
  resize: vertical;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.code-textarea:focus {
  border-color: rgba(4, 204, 254, 0.45);
  box-shadow: 0 0 0 3px rgba(4, 204, 254, 0.12);
}

.render-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.render-actions {
  display: flex;
  justify-content: flex-start;
}

.render-output {
  min-height: 280px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: auto;
}

.render-empty {
  display: grid;
  place-items: center;
  min-height: 240px;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  line-height: 1.7;
}

.render-frame,
.preview-frame {
  width: 100%;
  min-height: 320px;
  border: 0;
  border-radius: 16px;
  background: white;
}

.render-pdf {
  min-height: 520px;
}

.render-image,
.render-media {
  display: block;
  width: 100%;
  max-width: 100%;
  border-radius: 16px;
}

.render-audio {
  width: 100%;
}

.code-render-pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: #f4fbff;
  font: 13px/1.75 'Courier New', monospace;
}

.render-markdown {
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.75;
}

.render-markdown h1,
.render-markdown h2,
.render-markdown h3,
.render-markdown h4,
.render-markdown h5,
.render-markdown h6 {
  position: static;
  translate: none;
  margin: 0 0 14px;
  color: white;
  filter: none;
  mix-blend-mode: normal;
  text-shadow: none;
  font-size: inherit;
  font-family: 'Geist', sans-serif;
}

.render-markdown h1 { font-size: 2rem; }
.render-markdown h2 { font-size: 1.6rem; }
.render-markdown h3 { font-size: 1.35rem; }
.render-markdown p { margin: 0 0 12px; }

.render-markdown-list {
  margin: 0 0 16px;
  padding-left: 20px;
}

.render-spacer {
  height: 8px;
}

.render-table-wrap {
  overflow: auto;
}

.render-table {
  width: 100%;
  border-collapse: collapse;
  color: white;
  font-size: 13px;
}

.render-table th,
.render-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
  white-space: nowrap;
}

.render-table th {
  color: rgba(255, 255, 255, 0.62);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
}

.preview-shell {
  display: grid;
  gap: 10px;
}

.preview-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

@media (max-width: 1024px) {
  .qr-studio-shell,
  .code-studio-grid {
    grid-template-columns: 1fr;
  }

  .code-studio-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .code-studio-actions {
    justify-content: flex-start;
  }

  .code-panel-head {
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .qr-studio-panel,
  .qr-preview-panel,
  .code-panel,
  .code-studio-hero {
    padding: 14px;
    border-radius: 18px;
  }

  .qr-studio-grid,
  .qr-style-grid {
    grid-template-columns: 1fr;
  }

  .qr-eye-grid,
  .qr-module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .qr-type-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .qr-theme-row,
  .ascii-mode-grid,
  .ascii-studio-grid {
    grid-template-columns: 1fr;
  }

  .qr-preview-stage {
    min-height: 240px;
  }

  .code-studio {
    gap: 14px;
  }

  .code-studio-hero h3,
  .code-panel-head h4 {
    font-size: clamp(1.1rem, 6vw, 1.5rem);
  }

  .code-studio-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .code-studio-actions .custom-button {
    width: 100%;
  }

  .editor-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .editor-tab {
    width: 100%;
    padding: 10px 8px;
    letter-spacing: 0.08em;
    text-align: center;
  }

  .code-textarea {
    min-height: 240px;
    padding: 12px 14px;
  }

  .render-frame,
  .preview-frame {
    min-height: 240px;
  }

  .preview-head {
    font-size: 11px;
    letter-spacing: 0.08em;
  }
}

/* ── Layout: allow page to scroll for tool directory + footer ── */
body {
  align-items: start;
}

main {
  width: 100%;
}

/* ── Tool Directory ──────────────────────────────────────────── */
#tool-directory {
  width: 100%;
  padding: 20px 24px;
  background: hsl(0 0% 4%);
  border-top: 1px solid rgba(255,255,255,0.06);
}
.td-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.td-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.35);
  font-family: 'Geist', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 6px 0;
  transition: color 0.15s;
}
.td-toggle:hover {
  color: rgba(255,255,255,0.6);
}
.td-chevron {
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.td-toggle[aria-expanded="true"] .td-chevron {
  transform: rotate(180deg);
}
.td-body {
  margin-top: 32px;
  padding-bottom: 52px;
}
#tool-directory h2 {
  font-family: 'Geist', sans-serif;
  font-weight: 300;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  color: rgba(255,255,255,0.9);
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.td-intro {
  color: rgba(255,255,255,0.4);
  font-family: 'Geist', sans-serif;
  font-size: 0.95rem;
  margin: 0 0 52px;
}
.td-category {
  margin-bottom: 44px;
}
.td-category h3 {
  font-family: 'Geist', sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  margin: 0 0 14px;
}
.td-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.td-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 14px 16px 15px;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  background: rgba(255,255,255,0.025);
  text-decoration: none;
  transition: border-color 0.18s, background 0.18s;
}
.td-card:hover {
  border-color: rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.055);
}
.td-name {
  font-family: 'Geist', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  color: rgba(255,255,255,0.86);
}
.td-desc {
  font-family: 'Geist', sans-serif;
  font-size: 0.76rem;
  color: rgba(255,255,255,0.38);
  line-height: 1.45;
}

/* ── Footer ──────────────────────────────────────────────────── */
footer {
  width: 100%;
  background: hsl(0 0% 3%);
  border-top: 1px solid rgba(255,255,255,0.05);
  padding: 52px 24px 36px;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.footer-nav {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 36px 24px;
  margin-bottom: 44px;
}
.footer-col h4 {
  font-family: 'Geist', sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.28);
  margin: 0 0 14px;
}
.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.footer-col a {
  font-family: 'Geist', sans-serif;
  font-size: 0.86rem;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  transition: color 0.15s;
}
.footer-col a:hover {
  color: rgba(255,255,255,0.86);
}
.footer-about p {
  font-family: 'Geist', sans-serif;
  font-size: 0.84rem;
  color: rgba(255,255,255,0.36);
  line-height: 1.65;
  margin: 0;
}
.footer-copy {
  font-family: 'Geist', sans-serif;
  font-size: 0.76rem;
  color: rgba(255,255,255,0.2);
  margin: 0;
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 24px;
}
.footer-copy a {
  color: rgba(255,255,255,0.28);
  text-decoration: none;
}
.footer-copy a:hover {
  color: rgba(255,255,255,0.5);
}
