:root {
      --primary: #f05f40;
      --primary-hover: #df4b2a;
      --primary-dim: rgba(240, 95, 64, 0.15);
      --primary-line: rgba(240, 95, 64, 0.35);

      --bg: #111317;
      --bg-alt: #171a21;
      --surface: #1e222a;
      --surface-2: #262b35;
      --surface-3: #2f3542;

      --border: #383e4a;
      --border-soft: #2a2f39;

      --text: #f8f9fa;
      --text-2: #a5acb9;
      --text-3: #6c757d;

      --success: #28a745;
      --success-dim: rgba(40, 167, 69, 0.15);
      --error: #dc3545;
      --error-dim: rgba(220, 53, 69, 0.15);

      --font-sans: 'Open Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
      --font-serif: 'Merriweather', Georgia, serif;
      --font-mono: 'Fira Code', monospace;

      --radius-window: 20px;
      --radius-card: 16px;
      --radius-control: 10px;
      --radius-pill: 50px;
      --shadow-window: 0 30px 60px -12px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    html {
      scroll-behavior: smooth;
    }

    body {
      font-family: var(--font-sans);
      background-color: var(--bg);
      color: var(--text);
      line-height: 1.6;
      -webkit-font-smoothing: antialiased;
    }

    .app-loading-shell {
      position: fixed;
      inset: 0;
      z-index: 2000;
      display: grid;
      place-items: center;
      background: var(--bg);
      opacity: 1;
      transition: opacity 0.28s ease, visibility 0.28s ease;
    }

    .app-loading-shell.is-ready {
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
    }

    .app-loading-card {
      display: grid;
      gap: 10px;
      width: min(260px, 62vw);
    }

    .app-loading-card span {
      display: block;
      height: 10px;
      border-radius: var(--radius-pill);
      background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2));
      background-size: 220% 100%;
      animation: skeletonShimmer 1.25s ease-in-out infinite;
    }

    .app-loading-card span:nth-child(2) { width: 78%; }
    .app-loading-card span:nth-child(3) { width: 56%; }

    @keyframes skeletonShimmer {
      0% { background-position: 100% 0; }
      100% { background-position: -100% 0; }
    }

    ::selection {
      background: var(--primary-dim);
      color: var(--primary);
    }

    a {
      color: var(--primary);
      text-decoration: none;
      transition: color 0.2s;
    }

    a:hover {
      color: var(--primary-hover);
    }

    /* Navbar */
    .navbar {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      z-index: 1000;
      background: rgba(17, 19, 23, 0.85);
      backdrop-filter: blur(12px);
      border-bottom: 1px solid var(--border-soft);
      padding: 16px 0;
    }

    .container {
      max-width: 1140px;
      margin: 0 auto;
      padding: 0 24px;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .nav-brand {
      display: flex;
      align-items: center;
      gap: 10px;
      font-family: var(--font-serif);
      font-size: 20px;
      font-weight: 700;
      color: #fff;
    }

    .nav-brand-icon {
      width: 32px;
      height: 32px;
      border-radius: 8px;
      background: var(--primary);
      color: #fff;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 4px 12px rgba(240, 95, 64, 0.4);
    }

    .nav-links {
      display: flex;
      gap: 28px;
      list-style: none;
      align-items: center;
    }

    .nav-links a {
      font-size: 14px;
      font-weight: 600;
      color: var(--text-2);
    }

    .nav-links a:hover {
      color: #fff;
    }

    .btn-nav {
      background: var(--primary);
      color: #fff !important;
      padding: 8px 18px;
      border-radius: var(--radius-pill);
      font-size: 13px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      transition: all 0.2s ease;
      overflow: hidden;
    }

    .btn-nav:hover {
      background: var(--primary-hover);
      transform: translateY(-1px);
    }

    .btn-nav .protect-icon {
      width: 15px;
      height: 15px;
      transform-origin: 50% 58%;
      animation: protectIconFloat 2.6s ease-in-out infinite;
      transition: transform .2s ease, filter .2s ease;
    }

    .btn-nav:hover .protect-icon,
    .btn-nav:focus-visible .protect-icon {
      animation-play-state: paused;
      transform: translateY(2px) scale(1.12);
      filter: drop-shadow(0 2px 4px rgba(255, 255, 255, .35));
    }

    .btn-nav:active .protect-icon {
      transform: translateY(4px) scale(.92);
    }

    @keyframes protectIconFloat {
      0%, 100% {
        transform: translateY(0) rotate(0deg);
      }
      35% {
        transform: translateY(-2px) rotate(-3deg);
      }
      65% {
        transform: translateY(1px) rotate(2deg);
      }
    }

    /* Hero / Masthead Section */
    .masthead {
      position: relative;
      padding: 150px 0 80px;
      text-align: center;
      background:
        radial-gradient(900px 600px at 50% 20%, rgba(240, 95, 64, 0.12), transparent 70%),
        radial-gradient(1000px 800px at 80% 90%, rgba(30, 42, 60, 0.35), transparent 70%),
        var(--bg);
      overflow: hidden;
      isolation: isolate;
    }

    .masthead > .container {
      position: relative;
      z-index: 1;
    }

    .hero-network {
      position: absolute;
      inset: 0;
      z-index: 0;
      pointer-events: none;
      overflow: hidden;
      opacity: 0.13;
      color: #6366f1;
    }

    .hero-network svg {
      display: block;
      width: 100%;
      min-width: 760px;
      height: 100%;
      animation: heroNetworkFloat 16s ease-in-out infinite alternate;
    }

    .hero-network-lines {
      fill: none;
      stroke: currentColor;
      stroke-width: 1;
      stroke-linecap: round;
      stroke-linejoin: round;
      vector-effect: non-scaling-stroke;
    }

    .hero-network-nodes {
      fill: currentColor;
    }

    .hero-network-nodes circle {
      transform-box: fill-box;
      transform-origin: center;
      animation: heroNodePulse 4.8s ease-in-out infinite;
    }

    .hero-network-nodes circle:nth-child(2n) { animation-delay: -1.2s; }
    .hero-network-nodes circle:nth-child(3n) { animation-delay: -2.6s; }
    .hero-network-nodes circle:nth-child(5n) { animation-delay: -4s; }

    @keyframes heroNetworkFloat {
      from { transform: translate3d(-28px, 8px, 0) scale(1); }
      to { transform: translate3d(28px, -10px, 0) scale(1.04); }
    }

    @keyframes heroNodePulse {
      0%, 100% { opacity: .4; transform: scale(.78); }
      50% { opacity: 1; transform: scale(1.5); }
    }

    .masthead::before,
    .masthead::after {
      content: "";
      position: absolute;
      border-radius: 50%;
      filter: blur(80px);
      pointer-events: none;
      opacity: 0.9;
      animation: ambientGlowDrift 8s ease-in-out infinite alternate;
    }

    .masthead::before {
      width: 620px;
      height: 620px;
      left: 12%;
      top: -18%;
      background: radial-gradient(circle, rgba(240, 95, 64, 0.3), rgba(240, 95, 64, 0.08) 35%, transparent 70%);
    }

    .masthead::after {
      width: 760px;
      height: 760px;
      right: 8%;
      bottom: -28%;
      background: radial-gradient(circle, rgba(255, 120, 80, 0.18), rgba(255, 120, 80, 0.06) 30%, transparent 70%);
      animation-delay: 1.1s;
    }

    @keyframes ambientGlowDrift {
      0% {
        transform: translate3d(-26px, 0, 0) scale(0.94);
      }
      35% {
        transform: translate3d(18px, 14px, 0) scale(1.08);
      }
      70% {
        transform: translate3d(-8px, -18px, 0) scale(1.14);
      }
      100% {
        transform: translate3d(22px, 8px, 0) scale(1.02);
      }
    }

    .masthead-title {
      font-family: var(--font-serif);
      font-size: 42px;
      font-weight: 900;
      color: #fff;
      margin-bottom: 20px;
      line-height: 1.25;
    }

    .masthead-subtitle {
      font-size: 18px;
      color: var(--text-2);
      max-width: 680px;
      margin: 0 auto 36px;
    }

    .hero-cta {
      position: relative;
      display: inline-flex;
      align-items: center;
      gap: 10px;
      background: linear-gradient(135deg, var(--primary) 0%, #ff7d5d 100%);
      color: #fff;
      padding: 14px 32px;
      border-radius: var(--radius-pill);
      font-size: 14px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 1px;
      box-shadow: 0 14px 28px -10px rgba(240, 95, 64, 0.7), inset 0 1px 0 rgba(255,255,255,0.2);
      transition: all 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
      overflow: hidden;
      isolation: isolate;
    }

    .hero-cta::before {
      content: "";
      position: absolute;
      inset: 0;
      background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,0.22) 40%, transparent 75%);
      transform: translateX(-120%);
      transition: transform 0.75s ease;
      z-index: 0;
    }

    .hero-cta:hover::before {
      transform: translateX(120%);
    }

    .hero-cta > svg {
      position: relative;
      z-index: 1;
      width: 18px;
      height: 18px;
      display: block;
      filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.22));
      animation: lockFloat 2.8s ease-in-out infinite;
      transform-origin: center;
      transition: transform 0.28s ease, filter 0.28s ease;
    }

    .hero-cta:hover {
      color: #fff;
      background: linear-gradient(135deg, var(--primary-hover) 0%, #d9471e 100%);
      transform: translateY(-2px) scale(1.01);
      box-shadow: 0 18px 32px -12px rgba(240, 95, 64, 0.8), inset 0 1px 0 rgba(255,255,255,0.25);
    }

    .hero-cta:hover > svg {
      animation-duration: 1.4s;
      transform: rotate(-8deg) scale(1.12);
      filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.35));
    }

    @keyframes lockFloat {
      0%, 100% {
        transform: translateY(0px) rotate(0deg);
      }
      25% {
        transform: translateY(-2px) rotate(1deg);
      }
      50% {
        transform: translateY(1px) rotate(-2deg);
      }
      75% {
        transform: translateY(-3px) rotate(2deg);
      }
    }

    /* Section Styling */
    .section {
      padding: 90px 0;
      border-bottom: 1px solid var(--border-soft);
    }

    .section-alt {
      background-color: var(--bg-alt);
    }

    .section-header {
      text-align: center;
      margin-bottom: 60px;
    }

    .section-title {
      font-family: var(--font-serif);
      font-size: 32px;
      font-weight: 700;
      color: #fff;
      margin-bottom: 12px;
    }

    .section-divider {
      width: clamp(48px, 10vw, 88px);
      height: clamp(2px, 0.35vw, 4px);
      position: relative;
      overflow: hidden;
      background: var(--primary);
      margin: 0 auto 16px;
      border-radius: var(--radius-pill);
      box-shadow: 0 0 0 1px var(--primary-dim), 0 4px 14px -8px var(--primary);
      transform-origin: center;
      animation: sectionDividerPulse 4.5s ease-in-out infinite;
    }

    .section-divider::after {
      content: "";
      position: absolute;
      inset: 0;
      width: 42%;
      background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
      transform: translateX(-140%);
      animation: sectionDividerSweep 5.5s ease-in-out infinite;
    }

    .section-header:hover .section-divider,
    .section-header:focus-within .section-divider {
      animation-duration: 2.4s;
      box-shadow: 0 0 0 1px var(--primary-dim), 0 6px 18px -7px var(--primary);
    }

    @keyframes sectionDividerPulse {
      0%, 100% {
        transform: scaleX(0.92);
        opacity: 0.82;
      }
      50% {
        transform: scaleX(1);
        opacity: 1;
      }
    }

    @keyframes sectionDividerSweep {
      0%, 55%, 100% {
        transform: translateX(-140%);
      }
      75% {
        transform: translateX(340%);
      }
    }

    .section-sub {
      font-size: 16px;
      color: var(--text-2);
      max-width: 600px;
      margin: 0 auto;
    }

    /* Encryptor Tool Container Section */
    .tool-section {
      padding: 60px 0 100px;
      display: flex;
      flex-direction: column;
      align-items: center;
    }

    .window {
      width: 480px;
      max-width: 100%;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-window);
      box-shadow: var(--shadow-window);
      overflow: hidden;
      position: relative;
      margin: 0 auto;
    }

    .window::before {
      content: "";
      position: absolute;
      inset: 0 0 auto 0;
      height: 1px;
      background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    }

    /* Window Header */
    .window-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 24px 28px 0;
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .brand-mark {
      width: 32px;
      height: 32px;
      border-radius: 10px;
      background: #fff;
      display: flex;
      align-items: center;
      justify-content: center;
      overflow: hidden;
      box-shadow: 0 4px 15px -3px rgba(0, 0, 0, 0.45);
    }

    .brand-mark img {
      width: 100%;
      height: 100%;
      display: block;
      object-fit: cover;
    }

    .brand-name {
      font-family: var(--font-serif);
      font-size: 18px;
      font-weight: 700;
      color: #fff;
    }

    .local-pill {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 11px;
      font-weight: 600;
      color: var(--text-3);
      background: var(--surface-2);
      padding: 4px 10px;
      border-radius: var(--radius-pill);
      border: 1px solid var(--border-soft);
    }

    .local-pill .dot {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: var(--success);
      box-shadow: 0 0 0 3px var(--success-dim);
    }

    .window-status-actions {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .local-pill.offline .dot {
      background: var(--primary);
      box-shadow: 0 0 0 3px var(--primary-dim);
    }

    .install-btn {
      border: 1px solid var(--primary-line);
      border-radius: var(--radius-pill);
      padding: 5px 10px;
      background: var(--primary-dim);
      color: var(--primary);
      cursor: pointer;
      font-size: 11px;
      font-weight: 700;
    }

    .install-btn:hover {
      background: var(--primary);
      color: #fff;
    }

    /* Segmented Control Mode */
    .segmented {
      margin: 22px 28px 0;
      display: flex;
      background: var(--surface-2);
      border: 1px solid var(--border-soft);
      border-radius: var(--radius-pill);
      padding: 4px;
      position: relative;
    }

    .segmented button {
      flex: 1;
      position: relative;
      z-index: 2;
      background: transparent;
      border: none;
      color: var(--text-2);
      font-size: 13px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      padding: 10px 0;
      border-radius: var(--radius-pill);
      cursor: pointer;
      transition: color 0.2s ease;
    }

    .segmented button.active {
      color: #fff;
    }

    .segmented .thumb {
      position: absolute;
      top: 4px;
      bottom: 4px;
      left: 4px;
      width: calc(50% - 4px);
      background: var(--primary);
      border-radius: var(--radius-pill);
      transition: transform 0.28s cubic-bezier(.65, .05, .36, 1);
      z-index: 1;
      box-shadow: 0 4px 12px rgba(240, 95, 64, 0.3);
    }

    .segmented[data-mode="decrypt"] .thumb {
      transform: translateX(100%);
    }

    .body-copy {
      padding: 18px 28px 28px;
    }

    .headline {
      font-size: 14px;
      color: var(--text-2);
      line-height: 1.5;
      margin-top: 2px;
    }

    /* Dropzone */
    .dropzone {
      margin-top: 18px;
      border-radius: 16px;
      border: 2px dashed var(--border);
      background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.008) 0 12px, transparent 12px 24px), var(--surface-2);
      padding: 42px 20px;
      text-align: center;
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .dropzone:hover {
      border-color: var(--primary);
      background: var(--surface-3);
    }

    .dropzone:focus-visible {
      outline: 2px solid var(--primary);
      outline-offset: 3px;
      border-color: var(--primary);
    }

    .dropzone.drag {
      border-color: var(--primary);
      background: var(--primary-dim);
      transform: scale(1.01);
    }

    .dz-icon {
      width: 50px;
      height: 50px;
      margin: 0 auto 14px;
      border-radius: 50%;
      background: var(--surface-3);
      border: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s ease;
      color: var(--primary);
    }

    .dropzone:hover .dz-icon {
      transform: translateY(-3px);
      background: var(--primary);
      color: #fff;
    }

    .dz-icon svg {
      width: 22px;
      height: 22px;
      stroke: currentColor;
    }

    .dz-title {
      width: 100%;
      min-width: 0;
      font-family: var(--font-serif);
      font-size: 16px;
      font-weight: 700;
      margin-bottom: 6px;
      color: #fff;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .dz-sub {
      font-size: 13px;
      color: var(--text-3);
    }

    .dz-sub b {
      color: var(--primary);
      font-weight: 600;
      text-decoration: underline;
      text-underline-offset: 3px;
    }

    #fileInput {
      display: none;
    }

    /* File Card */
    .file-card {
      margin-top: 18px;
      display: flex;
      align-items: center;
      gap: 14px;
      background: var(--surface-2);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 14px 16px;
      transition: all 0.2s ease;
    }

    .file-card:hover {
      border-color: var(--border-soft);
    }

    .file-icon {
      width: 42px;
      height: 42px;
      border-radius: 10px;
      background: var(--surface-3);
      border: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      position: relative;
      color: var(--primary);
    }

    .file-icon svg {
      width: 20px;
      height: 20px;
      stroke: currentColor;
    }

    .file-ext {
      position: absolute;
      bottom: -5px;
      right: -6px;
      font-family: var(--font-mono);
      font-size: 8.5px;
      font-weight: 600;
      text-transform: uppercase;
      background: var(--primary);
      color: #fff;
      padding: 1px 5px;
      border-radius: 4px;
      letter-spacing: .02em;
    }

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

    .file-name {
      min-width: 0;
      max-width: 100%;
      font-size: 14px;
      font-weight: 600;
      color: var(--text);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .file-size {
      min-width: 0;
      font-family: var(--font-mono);
      font-size: 11.5px;
      color: var(--text-3);
      margin-top: 3px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .file-actions {
      display: flex;
      align-items: center;
      gap: 4px;
      flex-shrink: 0;
    }

    .icon-btn {
      width: 30px;
      height: 30px;
      border-radius: 8px;
      border: none;
      background: transparent;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      color: var(--text-3);
      transition: all 0.15s ease;
    }

    .icon-btn:hover {
      background: var(--error-dim);
      color: var(--error);
    }

    .icon-btn svg {
      width: 16px;
      height: 16px;
    }

    .file-card.mini {
      padding: 12px 14px;
    }

    .file-card.mini .file-icon {
      width: 34px;
      height: 34px;
    }

    .file-card.mini .file-actions {
      display: none;
    }

    .file-card.dim {
      opacity: .65;
    }

    .queue-panel {
      margin-top: 12px;
      padding: 12px;
      border: 1px solid var(--border-soft);
      border-radius: 12px;
      background: rgba(17, 19, 23, .3);
    }

    .queue-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      color: var(--text-2);
      font-family: var(--font-mono);
      font-size: 10px;
      letter-spacing: .04em;
      text-transform: uppercase;
    }

    .text-btn {
      border: 0;
      padding: 0;
      background: transparent;
      color: var(--primary);
      cursor: pointer;
      font: inherit;
      text-transform: inherit;
    }

    .text-btn:hover {
      color: var(--primary-hover);
      text-decoration: underline;
    }

    .queue-list {
      display: grid;
      gap: 6px;
      margin-top: 10px;
      max-height: 150px;
      overflow: auto;
    }

    .queue-item {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(0, min(35vw, 180px)) auto;
      align-items: center;
      gap: 8px;
      min-width: 0;
      padding: 7px 8px;
      border-radius: 8px;
      background: var(--surface-2);
    }

    .queue-item-name {
      min-width: 0;
      overflow: hidden;
      color: var(--text);
      font-size: 12px;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .queue-item-meta {
      min-width: 0;
      max-width: min(35vw, 180px);
      color: var(--text-3);
      font-family: var(--font-mono);
      font-size: 10px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .queue-remove {
      width: 24px;
      height: 24px;
    }

    .queue-remove svg {
      width: 14px;
      height: 14px;
    }

    .spin-ring {
      width: 18px;
      height: 18px;
      border-radius: 50%;
      border: 2px solid var(--border);
      border-top-color: var(--primary);
      animation: spin .8s linear infinite;
    }

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

    /* Password Section */
    .pw-section {
      margin-top: 18px;
      display: flex;
      flex-direction: column;
      gap: 14px;
    }

    .field-label {
      font-size: 12px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      color: var(--text-2);
      margin-bottom: 7px;
      display: block;
    }

    .field-wrap {
      position: relative;
    }

    .field-wrap input {
      width: 100%;
      background: var(--surface-2);
      border: 1px solid var(--border);
      color: var(--text);
      font-size: 16px;
      font-family: var(--font-mono);
      padding: 12px 42px 12px 14px;
      border-radius: var(--radius-control);
      transition: all 0.15s ease;
    }

    #confirmField .field-wrap input {
      padding-right: 78px;
    }

    .field-wrap input::placeholder {
      color: var(--text-3);
      font-family: var(--font-sans);
    }

    .field-wrap input:focus {
      border-color: var(--primary);
      background: var(--surface-3);
      outline: none;
    }

    .field-wrap.error input {
      border-color: var(--error);
      background: rgba(220, 53, 69, 0.06);
    }

    .field-toggle {
      position: absolute;
      right: 8px;
      top: 50%;
      transform: translateY(-50%);
      width: 34px;
      height: 34px;
      border: 1px solid transparent;
      border-radius: 8px;
      background: rgba(255, 255, 255, .025);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--text-3);
      transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease;
    }

    .field-toggle:hover {
      color: var(--text);
      background: var(--surface-3);
      border-color: var(--border);
      transform: translateY(-50%) scale(1.04);
    }

    .field-toggle:focus-visible {
      outline: 2px solid var(--primary);
      outline-offset: 2px;
      color: var(--primary);
    }

    .field-toggle[aria-pressed="true"] {
      color: var(--primary);
      background: var(--primary-dim);
      border-color: var(--primary-line);
    }

    .confirm-toggle {
      right: 8px;
    }

    .field-toggle svg {
      width: 17px;
      height: 17px;
      stroke: currentColor;
      transition: opacity .15s ease, transform .15s ease;
    }

    .field-toggle .eye-off-icon {
      display: none;
    }

    .field-toggle[aria-pressed="true"] .eye-icon {
      display: none;
    }

    .field-toggle[aria-pressed="true"] .eye-off-icon {
      display: block;
    }

    .match-check {
      position: absolute;
      right: 50px;
      top: 50%;
      transform: translateY(-50%);
      color: var(--success);
      display: none;
      align-items: center;
    }

    .match-check.show {
      display: flex;
    }

    .match-check svg {
      width: 16px;
      height: 16px;
    }

    .strength {
      display: flex;
      gap: 4px;
      margin-top: 8px;
    }

    .strength i {
      flex: 1;
      height: 4px;
      border-radius: 2px;
      background: var(--border);
      transition: background 0.25s ease;
    }

    .strength-label {
      display: flex;
      justify-content: space-between;
      margin-top: 6px;
      font-size: 11.5px;
      color: var(--text-3);
    }

    .strength-label span.val {
      color: var(--primary);
      font-weight: 700;
    }

    .hint-row {
      display: flex;
      align-items: flex-start;
      gap: 8px;
      margin-top: 4px;
      font-size: 12px;
      color: var(--text-3);
      line-height: 1.5;
    }

    .hint-row svg {
      width: 15px;
      height: 15px;
      flex-shrink: 0;
      margin-top: 2px;
      stroke: var(--primary);
    }

    .error-msg {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 12.5px;
      color: var(--error);
      margin-top: 6px;
    }

    .error-msg svg {
      width: 15px;
      height: 15px;
      flex-shrink: 0;
    }

    /* Buttons */
    .btn-primary {
      width: 100%;
      margin-top: 10px;
      background: var(--primary);
      color: #fff;
      border: none;
      font-size: 13px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 1px;
      padding: 14px 20px;
      border-radius: var(--radius-pill);
      cursor: pointer;
      box-shadow: 0 8px 20px -6px rgba(240, 95, 64, 0.5);
      transition: all 0.2s ease;
    }

    .cf-turnstile {
      display: flex;
      justify-content: center;
      margin-bottom: 15px;
    }

    .btn-primary:hover {
      background: var(--primary-hover);
      transform: translateY(-1px);
      box-shadow: 0 12px 24px -6px rgba(240, 95, 64, 0.65);
    }

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

    .btn-primary:disabled {
      background: var(--surface-3);
      color: var(--text-3);
      box-shadow: none;
      cursor: not-allowed;
      transform: none;
    }

    .btn-ghost {
      width: 100%;
      margin-top: 10px;
      background: transparent;
      border: 1px solid var(--border);
      color: var(--text-2);
      font-size: 13px;
      font-weight: 600;
      padding: 12px 0;
      border-radius: var(--radius-pill);
      cursor: pointer;
      transition: all 0.15s ease;
    }

    .btn-ghost:hover {
      background: var(--surface-3);
      border-color: var(--text-3);
      color: var(--text);
    }

    .cancel-link {
      display: block;
      text-align: center;
      margin-top: 14px;
      width: 100%;
      font-size: 12.5px;
      color: var(--text-3);
      background: none;
      border: none;
      cursor: pointer;
      transition: color 0.15s ease;
    }

    .cancel-link:hover {
      color: var(--error);
    }

    /* Progress State */
    .progress-block {
      margin-top: 22px;
    }

    .progress-status {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 10px;
    }

    .progress-status .label {
      font-size: 13.5px;
      font-weight: 600;
      color: var(--text);
    }

    .progress-status .pct {
      font-family: var(--font-mono);
      font-size: 13px;
      font-weight: 600;
      color: var(--primary);
    }

    .progress-track {
      height: 8px;
      border-radius: 4px;
      background: var(--surface-2);
      border: 1px solid var(--border-soft);
      overflow: hidden;
      position: relative;
    }

    .progress-fill {
      height: 100%;
      width: 0%;
      border-radius: 4px;
      background: var(--primary);
      position: relative;
      transition: width 0.2s ease;
    }

    .progress-fill::after {
      content: "";
      position: absolute;
      inset: 0;
      background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
      width: 60px;
      animation: sheen 1.3s ease-in-out infinite;
    }

    @keyframes sheen {
      0% {
        transform: translateX(-80px);
      }

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

    .progress-caption {
      font-size: 12px;
      color: var(--text-3);
      margin-top: 12px;
      text-align: center;
    }

    /* Success / Error Result */
    .result {
      margin-top: 8px;
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
      padding: 10px 4px 4px;
    }

    .result-badge {
      width: 64px;
      height: 64px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 18px;
      position: relative;
    }

    .result-badge.success {
      background: var(--success-dim);
      border: 2px solid var(--success);
    }

    .result-badge.error {
      background: var(--error-dim);
      border: 2px solid var(--error);
    }

    .result-badge svg {
      width: 28px;
      height: 28px;
    }

    .result-badge.success svg {
      stroke: var(--success);
    }

    .result-badge.error svg {
      stroke: var(--error);
    }

    .result-badge svg path,
    .result-badge svg polyline {
      stroke-dasharray: 40;
      stroke-dashoffset: 40;
      animation: draw 0.5s ease forwards 0.1s;
    }

    @keyframes draw {
      to {
        stroke-dashoffset: 0;
      }
    }

    .result-title {
      font-family: var(--font-serif);
      font-size: 18px;
      font-weight: 700;
      color: #fff;
    }

    .result-sub {
      min-width: 0;
      font-size: 13.5px;
      color: var(--text-2);
      margin-top: 6px;
      line-height: 1.55;
      max-width: 100%;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .result-sub b {
      color: var(--primary);
      font-weight: 600;
    }

    .meta-row {
      display: flex;
      gap: 8px;
      margin-top: 18px;
      flex-wrap: wrap;
      justify-content: center;
    }

    .meta-pill {
      font-family: var(--font-mono);
      font-size: 11px;
      color: var(--text-2);
      background: var(--surface-2);
      border: 1px solid var(--border);
      padding: 5px 10px;
      border-radius: 6px;
      letter-spacing: .02em;
    }

    .result-actions {
      width: 100%;
      margin-top: 22px;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .batch-download-btn[hidden],
    .queue-panel[hidden] {
      display: none;
    }

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

    /* Window Footer */
    .window-footer {
      border-top: 1px solid var(--border-soft);
      padding: 14px 28px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: var(--surface-2);
    }

    .footer-badge {
      display: flex;
      align-items: center;
      gap: 6px;
      font-family: var(--font-mono);
      font-size: 11px;
      color: var(--text-3);
    }

    .footer-badge svg {
      width: 12px;
      height: 12px;
      stroke: var(--text-3);
    }

    .footer-link {
      font-size: 12px;
      color: var(--text-3);
      text-decoration: none;
      transition: color 0.15s ease;
    }

    .footer-link:hover {
      color: var(--primary);
    }

    /* Features Grid */
    .grid-3 {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
      gap: 30px;
    }

    .feature-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-card);
      padding: 32px 24px;
      transition: transform 0.2s ease, border-color 0.2s ease;
    }

    .tool-online-status {
      display: inline-flex;
      align-items: center;
      align-self: flex-start;
      gap: 7px;
      margin-bottom: 18px;
      padding: 5px 10px;
      border: 1px solid var(--border-soft);
      border-radius: var(--radius-pill);
      background: var(--surface-2);
      color: var(--text-2);
      font-family: var(--font-mono);
      font-size: 10px;
      font-weight: 600;
      letter-spacing: 0.04em;
      text-transform: uppercase;
    }

    .tool-online-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: var(--success);
      box-shadow: 0 0 0 3px var(--success-dim);
      animation: onlineDotPulse 2.4s ease-in-out infinite;
    }

    .tool-online-status.offline,
    .local-pill.offline {
      color: var(--text-3);
    }

    .tool-online-status.offline .tool-online-dot,
    .local-pill.offline .dot {
      background: var(--error);
      box-shadow: 0 0 0 3px var(--error-dim);
      animation: none;
    }

    .tool-online-status.checking .tool-online-dot,
    .local-pill.checking .dot {
      background: var(--text-3);
      box-shadow: 0 0 0 3px rgba(108, 117, 125, 0.15);
    }

    @keyframes onlineDotPulse {
      0%, 100% { opacity: 0.72; transform: scale(0.9); }
      50% { opacity: 1; transform: scale(1.08); }
    }

    .feature-card:hover {
      transform: translateY(-4px);
      border-color: var(--primary-line);
    }

    .feature-icon {
      width: 48px;
      height: 48px;
      border-radius: 12px;
      background: var(--primary-dim);
      color: var(--primary);
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 20px;
    }

    .feature-icon svg {
      width: 24px;
      height: 24px;
      stroke-width: 2;
    }

    .feature-title {
      font-family: var(--font-serif);
      font-size: 18px;
      font-weight: 700;
      color: #fff;
      margin-bottom: 10px;
    }

    .feature-desc {
      font-size: 14px;
      color: var(--text-2);
      line-height: 1.6;
    }

    /* Specs Grid */
    .spec-box {
      background: var(--surface-2);
      border: 1px solid var(--border);
      border-radius: var(--radius-card);
      padding: 24px;
      margin-bottom: 16px;
      transition: transform 0.2s ease, border-color 0.2s ease;
      cursor: default;
    }

    .spec-box:hover {
      transform: translateY(-4px);
      border-color: var(--primary-line);
    }

    .spec-label {
      font-family: var(--font-mono);
      font-size: 12px;
      color: var(--primary);
      font-weight: 600;
      margin-bottom: 6px;
    }

    .spec-value {
      font-size: 15px;
      color: #fff;
      font-weight: 600;
      margin-bottom: 4px;
    }

    .spec-detail {
      font-size: 13px;
      color: var(--text-2);
    }

    /* Modal Overlay */
    .modal-overlay {
      position: fixed;
      inset: 0;
      z-index: 2000;
      background: rgba(0, 0, 0, 0.75);
      backdrop-filter: blur(4px);
      display: none;
      align-items: center;
      justify-content: center;
      padding: 20px;
    }

    .modal-overlay.active {
      display: flex;
    }

    .modal-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-window);
      width: 480px;
      max-width: 100%;
      padding: 28px;
      box-shadow: var(--shadow-window);
    }

    .modal-card h3 {
      font-family: var(--font-serif);
      font-size: 18px;
      color: #fff;
      margin-bottom: 12px;
    }

    .modal-card p {
      font-size: 13px;
      color: var(--text-2);
      line-height: 1.6;
      margin-bottom: 12px;
    }

    .modal-card ul {
      font-size: 12.5px;
      color: var(--text-2);
      margin-left: 18px;
      margin-bottom: 20px;
      line-height: 1.6;
    }

    /* Footer */
    footer {
      padding: 40px 0;
      border-top: 1px solid var(--border-soft);
      text-align: center;
      font-size: 13px;
      color: var(--text-3);
      background: var(--bg);
    }

    [data-panel] {
      display: none;
    }

    [data-panel].on {
      display: block;
    }

    @media (max-width: 768px) {
      .masthead-title {
        font-size: 32px;
      }

      .nav-links {
        display: none;
      }

      .window {
        width: 100%;
        border-radius: 16px;
      }

      .body-copy {
        padding: 18px 20px 24px;
      }
    }

    /* Responsive refinements */
    :root {
      --content-width: 1140px;
      --gutter: clamp(16px, 4vw, 32px);
    }

    html,
    body {
      min-width: 320px;
      overflow-x: hidden;
    }

    .container {
      width: min(100%, var(--content-width));
      padding-inline: var(--gutter);
    }

    .nav-brand-media {
      width: 32px;
      height: 32px;
      overflow: hidden;
      border-radius: 9px;
      background: #fff;
      box-shadow: 0 4px 12px rgba(240, 95, 64, 0.35);
      flex: 0 0 32px;
    }

    .nav-brand-media video {
      width: 100%;
      height: 100%;
      display: block;
      object-fit: cover;
    }

    .masthead .container,
    .tool-section .container {
      flex-direction: column;
    }

    .tool-section .container,
    .section .container,
    footer .container {
      display: block;
    }

    .masthead-title {
      max-width: 900px;
      text-wrap: balance;
    }

    .masthead-subtitle,
    .section-sub {
      text-wrap: pretty;
    }

    .window {
      width: min(100%, 520px);
    }

    .section-header {
      max-width: 760px;
      margin-inline: auto;
    }

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

    .spec-list {
      width: min(100%, 800px);
      margin-inline: auto;
    }

    .spec-value,
    .spec-detail,
    .feature-desc {
      overflow-wrap: anywhere;
    }

    .modal-card {
      max-height: min(700px, calc(100dvh - 32px));
      overflow-y: auto;
    }

    @media (max-width: 900px) {
      .navbar {
        padding-block: 12px;
      }

      .nav-links {
        gap: 14px;
      }

      .nav-links a {
        font-size: 12px;
      }

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

    @media (max-width: 700px) {
      .nav-links li:not(:last-child) {
        display: none;
      }

      .btn-nav {
        padding: 8px 12px;
      }

      .masthead {
        padding: 126px 0 56px;
      }

      .masthead-title {
        font-size: clamp(28px, 8vw, 36px);
        line-height: 1.18;
      }

      .masthead-title br {
        display: none;
      }

      .masthead-subtitle {
        font-size: 15px;
        margin-bottom: 28px;
      }

      .section,
      .tool-section {
        padding-block: 56px;
      }

      .section-header {
        margin-bottom: 32px;
      }

      .section-title {
        font-size: clamp(25px, 7vw, 32px);
        line-height: 1.2;
      }

      .grid-3 {
        grid-template-columns: 1fr;
        gap: 16px;
      }

      .feature-card,
      .spec-box {
        padding: 22px 18px;
      }

      .window-header {
        padding: 20px 18px 0;
      }

      .local-pill {
        max-width: 148px;
        text-align: right;
      }

      .segmented {
        margin-inline: 18px;
      }

      .window-footer {
        padding-inline: 18px;
        gap: 12px;
      }

      .footer-badge {
        min-width: 0;
      }

      .footer-link {
        white-space: nowrap;
      }
    }

    @media (max-width: 420px) {
      .nav-brand {
        font-size: 18px;
      }

      .hero-cta {
        width: auto;
        max-width: 100%;
        justify-content: center;
        padding: 12px 18px;
        font-size: 12px;
        letter-spacing: 0.8px;
      }

      .hero-cta > svg {
        width: 16px;
        height: 16px;
      }

      .window {
        border-radius: 14px;
      }

      .body-copy {
        padding-inline: 16px;
      }

      .dropzone {
        padding: 32px 12px;
      }

      .file-card {
        gap: 10px;
        padding-inline: 12px;
      }

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

      .window-footer {
        align-items: flex-start;
        flex-direction: column;
      }

      .modal-overlay {
        padding: 12px;
      }

      .modal-card {
        padding: 22px 18px;
        border-radius: 14px;
      }
    }

    /* Brand, navigation, motion, and FAQ */
    .nav-brand-media {
      width: 122px;
      height: 36px;
      flex: 0 0 122px;
      border-radius: 9px;
      background: #fff;
      box-shadow: 0 4px 14px rgba(240, 95, 64, 0.28);
    }

    .nav-brand-media img {
      width: 100%;
      height: 100%;
      display: block;
      object-fit: cover;
      object-position: center;
    }

    .menu-toggle {
      display: none;
      align-items: center;
      justify-content: center;
      border: 1px solid var(--border);
      border-radius: var(--radius-pill);
      width: 42px;
      height: 42px;
      padding: 0;
      background: var(--surface-2);
      color: var(--text);
      cursor: pointer;
      transition: background .2s ease, border-color .2s ease, transform .2s ease;
    }

    .menu-toggle:hover {
      background: var(--surface-3);
      border-color: var(--primary-line);
      transform: translateY(-1px);
    }

    .menu-toggle svg {
      width: 18px;
      height: 18px;
      transition: transform .25s ease;
    }

    .menu-toggle[aria-expanded="true"] svg {
      transform: rotate(90deg);
    }

    .menu-toggle-label {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }

    .nav-links a {
      display: inline-flex;
      align-items: center;
      gap: 7px;
    }

    .btn-nav svg {
      width: 15px;
      height: 15px;
    }

    .feature-icon {
      animation: featureFloat 3.8s ease-in-out infinite;
      transform-origin: 50% 60%;
    }

    .feature-card-key .feature-icon {
      animation-delay: -1.25s;
    }

    .feature-card-monitor .feature-icon {
      animation-delay: -2.5s;
    }

    .feature-card:hover .feature-icon,
    .feature-card:focus-within .feature-icon {
      animation-play-state: paused;
      transform: translateY(-5px) rotate(-4deg) scale(1.06);
    }

    @keyframes featureFloat {
      0%, 100% {
        transform: translateY(0) rotate(0deg);
      }
      50% {
        transform: translateY(-7px) rotate(3deg);
      }
    }

    .section-kicker {
      margin-bottom: 10px;
      color: var(--primary);
      font-family: var(--font-mono);
      font-size: 11px;
      font-weight: 600;
      letter-spacing: .12em;
      text-transform: uppercase;
    }

    .faq-section {
      background:
        linear-gradient(180deg, rgba(240, 95, 64, 0.04), transparent 32%),
        var(--bg-alt);
    }

    .faq-list {
      width: min(100%, 820px);
      margin: 0 auto;
      display: grid;
      gap: 12px;
    }

    .faq-item {
      border: 1px solid var(--border);
      border-radius: var(--radius-card);
      background: rgba(30, 34, 42, .82);
      overflow: hidden;
      transition: border-color .28s ease, background .28s ease, transform .28s ease;
    }

    .faq-item[open] {
      border-color: var(--primary-line);
      background: var(--surface);
    }

    .faq-item summary {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 20px;
      padding: 20px 22px;
      color: #fff;
      cursor: pointer;
      font-family: var(--font-serif);
      font-size: 15px;
      font-weight: 700;
      list-style: none;
    }

    .faq-item summary::-webkit-details-marker {
      display: none;
    }

    .faq-item summary::after {
      content: '+';
      flex: 0 0 auto;
      color: var(--primary);
      font-family: var(--font-sans);
      font-size: 24px;
      font-weight: 300;
      line-height: 1;
      transition: transform .28s cubic-bezier(.22, 1, .36, 1), color .2s ease;
    }

    .faq-item[open] summary::after {
      transform: rotate(45deg);
    }

    .faq-item summary:focus-visible,
    .menu-toggle:focus-visible,
    .nav-links a:focus-visible {
      outline: 2px solid var(--primary);
      outline-offset: 3px;
    }

    .faq-answer {
      max-height: 0;
      overflow: hidden;
      opacity: 0;
      transform: translateY(-5px);
      transition: max-height .28s cubic-bezier(.22, 1, .36, 1), opacity .2s ease, transform .28s ease;
    }

    .faq-item[open] .faq-answer {
      max-height: 320px;
      opacity: 1;
      transform: translateY(0);
    }

    .faq-item.is-closing .faq-answer {
      max-height: 0;
      opacity: 0;
      transform: translateY(-5px);
    }

    .faq-item p {
      max-width: 700px;
      padding: 0 22px 21px;
      color: var(--text-2);
      font-size: 14px;
      line-height: 1.7;
    }

    @media (prefers-reduced-motion: reduce) {
      .faq-item,
      .faq-item summary::after,
      .faq-answer {
        transition: none;
      }
    }

    @media (max-width: 900px) {
      .navbar .container {
        position: relative;
      }

      .menu-toggle {
        display: inline-flex;
      }

      .nav-links {
        position: absolute;
        top: calc(100% + 12px);
        right: var(--gutter);
        left: var(--gutter);
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 10px;
        border: 1px solid var(--border);
        border-radius: 14px;
        background: var(--surface);
        color: var(--text);
        box-shadow: var(--shadow-window);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(-10px) scale(.98);
        transform-origin: top right;
        transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
      }

      .nav-links.open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0) scale(1);
      }

      .nav-links li:not(:last-child) {
        display: block;
      }

      .nav-links a {
        width: 100%;
        padding: 12px 13px;
        border-radius: 9px;
        font-size: 13px;
      }

      .nav-links a:hover {
        background: var(--surface-2);
      }

      [data-bs-theme="light"] .nav-links,
      html:not(.dark) .nav-links {
        background: #ffffff;
        color: #212529;
      }

      [data-bs-theme="light"] .nav-links a,
      html:not(.dark) .nav-links a {
        color: #212529;
      }

      [data-bs-theme="dark"] .nav-links,
      html.dark .nav-links {
        background: var(--surface);
        color: var(--text);
      }

      [data-bs-theme="dark"] .nav-links a,
      html.dark .nav-links a {
        color: var(--text-2);
      }

      .nav-links .btn-nav {
        justify-content: space-between;
        margin-top: 4px;
      }

      .nav-links .nav-bottom-controls::before {
        content: "";
        display: block;
        width: 80%;
        margin: 12px auto;
        border-top: 1px solid #FF6B35;
      }

      .nav-links .theme-toggle-btn {
        margin-left: 13px;
      }

      .navbar .container > .menu-toggle {
        margin-left: 8px;
      }
    }

    @media (prefers-reduced-motion: reduce) {
      html {
        scroll-behavior: auto;
      }

      .feature-icon,
      .feature-card-key .feature-icon,
      .feature-card-monitor .feature-icon,
      .btn-nav .protect-icon,
      .section-divider,
      .section-divider::after,
      .app-loading-card span,
      .tool-online-dot {
        animation: none;
      }

      .hero-network svg,
      .hero-network-nodes circle {
        animation: none;
      }

      .app-loading-shell {
        transition: none;
      }
    }

/* Light Theme Overrides when data-bs-theme="light" */
[data-bs-theme="light"] {
  --bg: #f8f9fa;
  --bg-alt: #ffffff;
  --surface: #ffffff;
  --surface-2: #f1f3f5;
  --surface-3: #e9ecef;
  --border: #ced4da;
  --border-soft: #e9ecef;
  --text: #212529;
  --text-2: #495057;
  --text-3: #6c757d;
  --shadow-window: 0 10px 30px -5px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.05);
}

[data-bs-theme="light"] .navbar {
  background: rgba(248, 249, 250, 0.9);
}

[data-bs-theme="light"] .nav-brand {
  color: #111317;
}

[data-bs-theme="light"] .nav-links a {
  color: var(--text-2);
}

[data-bs-theme="light"] .nav-links a:hover {
  color: var(--text);
}

[data-bs-theme="light"] .section-title,
[data-bs-theme="light"] .masthead-title,
[data-bs-theme="light"] .feature-title,
[data-bs-theme="light"] .result-title,
[data-bs-theme="light"] .spec-value,
[data-bs-theme="light"] .dz-title,
[data-bs-theme="light"] .faq-item summary {
  color: #111317;
}

[data-bs-theme="light"] .faq-item {
  background: #ffffff;
}

.theme-toggle-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  color: var(--text);
  border-color: var(--primary);
  background: var(--surface-2);
}

/* Shared responsive controls and content typography */
.qr-type-tabs,
.base64-mode-tabs,
.input-mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.base64-mode-tabs,
.input-mode-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.qr-tab-btn,
.base64-mode-btn,
.input-mode-btn {
  min-width: 0;
  min-height: 46px;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
}

.qr-tab-btn span,
.base64-mode-btn span,
.input-mode-btn span {
  min-width: 0;
}

.btn-primary,
.btn-ghost,
.btn-nav,
.copy-btn,
.download-btn,
.merge-btn,
.clear-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary svg,
.btn-ghost svg,
.btn-nav svg,
.copy-btn svg,
.download-btn svg,
.merge-btn svg,
.clear-btn svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.legal-content {
  padding: 36px;
  color: var(--text-2);
  line-height: 1.8;
}

.legal-content h2 {
  margin: 28px 0 12px;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 20px;
  line-height: 1.35;
}

.legal-content h2:first-child {
  margin-top: 0;
}

.legal-content p {
  margin: 0 0 16px;
  max-width: 70ch;
}

.legal-content ul,
.legal-content ol {
  display: grid;
  gap: 9px;
  margin: 0 0 18px 1.25rem;
  padding-left: 1rem;
}

.legal-content li {
  padding-left: 5px;
}

.legal-content strong {
  color: var(--text);
}

@media (max-width: 520px) {
  .qr-type-tabs,
  .base64-mode-tabs,
  .input-mode-tabs {
    gap: 8px;
  }

  .qr-tab-btn,
  .base64-mode-btn,
  .input-mode-btn {
    min-height: 54px;
    padding: 8px 6px;
    font-size: 11px;
    gap: 5px;
  }

  .qr-tab-btn svg,
  .base64-mode-btn svg,
  .input-mode-btn svg {
    width: 15px;
    height: 15px;
  }

  .legal-content {
    padding: 24px 18px;
    line-height: 1.7;
  }
}
