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

    :root {
      --primary: #9c9fe7;
      --primary-dark: #4f46e5;
      --secondary: #ec4899;
      --success: #10b981;
      --danger: #ef4444;
      --warning: #f59e0b;
      --dark: #0f172a;
      --light: #f8fafc;
      --border: #e2e8f0;
      --text: #334155;
      --text-light: #64748b;
      --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
      --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
      --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
      --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
      --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    html {
      scroll-behavior: smooth;
    }

    body {
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
      background: linear-gradient(135deg, #051d85b9 0%, #acbfe7 100%);
      color: var(--text);
      min-height: 100vh;
      padding: 20px;
      overflow-x: hidden;
    }

    .container {
      width: 100%;
      max-width: 1400px;
      margin: 0 auto;
      min-width: 0;
      box-sizing: border-box;
    }

    .header {
      text-align: center;
      margin-bottom: 40px;
      animation: slideDown 0.6s ease-out;
    }

    .logo {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: center;
      gap: 12px;
      margin-bottom: 20px;
    }

    .logo-icon {
      animation: spin 3s linear infinite;
      display: block;
    }

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

    h1 {
      font-size: 48px;
      font-weight: 700;
      color: white;
      margin-bottom: 10px;
      letter-spacing: -1px;
    }

    .tagline {
      font-size: 18px;
      color: rgba(255, 255, 255, 0.9);
      margin-bottom: 30px;
      font-weight: 300;
    }

    .main {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      gap: 30px;
      width: 100%;
      min-width: 0;
    }

    .card {
      background: white;
      border-radius: 16px;
      box-shadow: var(--shadow-xl);
      padding: 28px 32px;
      transition: var(--transition);
      animation: slideUp 0.6s ease-out;
      min-width: 0;
      max-width: 100%;
    }

    @keyframes slideUp {
      from {
        opacity: 0;
        transform: translateY(20px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .card:hover {
      box-shadow: var(--shadow-xl);
    }

    .files-grid {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
      gap: 24px;
      margin-bottom: 28px;
      align-items: start;
      width: 100%;
      min-width: 0;
    }

    .file-box {
      position: relative;
      align-self: start;
      width: 100%;
      max-width: 100%;
      min-width: 0;
    }

    .file-label {
      display: block;
      font-size: 14px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      color: var(--text-light);
      margin-bottom: 12px;
    }

    .file-input-zone {
      position: relative;
      border: 2px dashed var(--border);
      border-radius: 12px;
      padding: 32px 24px;
      text-align: center;
      cursor: pointer;
      transition: var(--transition);
      background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
      width: 100%;
      max-width: 100%;
      min-width: 0;
      box-sizing: border-box;
    }

    .file-input-zone:hover {
      border-color: var(--primary);
      background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
      transform: translateY(-2px);
    }

    .file-input-zone.dragover {
      border-color: var(--secondary);
      background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
    }

    .file-input-zone.active {
      border-color: var(--primary);
      background: #eef2ff;
    }

    .upload-icon {
      display: block;
      margin-bottom: 12px;
    }

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

    .upload-subtext {
      font-size: 13px;
      color: var(--text-light);
    }

    .file-info {
      margin-top: 16px;
      padding: 12px 16px;
      background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
      border-left: 3px solid var(--success);
      border-radius: 8px;
      font-size: 13px;
      color: #166534;
      word-break: break-word;
      overflow-wrap: anywhere;
      display: flex;
      align-items: flex-start;
      gap: 8px;
      min-width: 0;
      max-width: 100%;
      box-sizing: border-box;
    }

    .file-info > span:last-child {
      flex: 1 1 auto;
      min-width: 0;
    }

    .file-info.warning {
      background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
      border-left-color: var(--warning);
      color: #92400e;
    }

    .file-info-icon {
      flex-shrink: 0;
      font-size: 16px;
    }

    .action-section {
      display: block;
      width: 100%;
      clear: both;
      text-align: center;
      padding: 24px 0;
      border-top: 1px solid var(--border);
      border-bottom: 1px solid var(--border);
      margin-bottom: 24px;
      box-sizing: border-box;
    }

    .action-section .btn {
      margin-left: auto;
      margin-right: auto;
    }

    .btn {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      padding: 16px 40px;
      border: none;
      border-radius: 12px;
      font-size: 16px;
      font-weight: 600;
      cursor: pointer;
      transition: var(--transition);
      text-transform: uppercase;
      letter-spacing: 0.5px;
      position: relative;
      overflow: hidden;
    }

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

    .btn:hover::before {
      width: 300px;
      height: 300px;
    }

    .btn-primary {
      background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
      color: white;
      box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    }

    .btn-primary:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 25px rgba(99, 102, 241, 0.6);
    }

    .btn-primary:disabled {
      opacity: 0.6;
      cursor: not-allowed;
      transform: none;
    }

    .btn-icon {
      position: relative;
      z-index: 1;
      display: flex;
      align-items: center;
    }

    .btn-text {
      position: relative;
      z-index: 1;
    }

    #status {
      width: 100%;
      text-align: center;
      margin-top: 20px;
      font-size: 14px;
      color: var(--text-light);
      min-height: 20px;
      font-weight: 500;
    }

    #progress {
      display: none;
      margin-top: 20px;
    }

    .progress-bar {
      width: 100%;
      height: 8px;
      background: var(--border);
      border-radius: 4px;
      overflow: hidden;
      margin-bottom: 10px;
    }

    .progress-fill {
      height: 100%;
      background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
      animation: progress 2s ease-in-out infinite;
      border-radius: 4px;
    }

    @keyframes progress {
      0% { width: 0%; }
      50% { width: 100%; }
      100% { width: 100%; }
    }

    .progress-text {
      font-size: 12px;
      color: var(--text-light);
      text-align: center;
    }

    .results-section {
      display: none;
    }

    .results-section.active {
      display: block;
    }

    .results-header {
      display: flex;
      flex-wrap: wrap;
      align-items: flex-start;
      justify-content: space-between;
      gap: 16px 24px;
      margin-bottom: 20px;
      padding-bottom: 20px;
      border-bottom: 2px solid var(--border);
      width: 100%;
      min-width: 0;
      box-sizing: border-box;
    }

    .results-title {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 8px;
      font-size: 24px;
      font-weight: 700;
      color: var(--text);
      flex: 1 1 200px;
      min-width: 0;
      max-width: 100%;
    }

    .results-stats {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
      gap: 14px 18px;
      justify-items: center;
      flex: 1 1 280px;
      min-width: 0;
      max-width: 100%;
    }

    .stat {
      text-align: center;
      min-width: 0;
    }

    .stat-value {
      font-size: 24px;
      font-weight: 700;
      color: var(--primary);
    }

    .stat-label {
      font-size: 12px;
      color: var(--text-light);
      text-transform: none;
      letter-spacing: 0.02em;
      margin-top: 4px;
      max-width: 9rem;
      line-height: 1.3;
    }

    .plain-english-box {
      background: #fff;
      border-radius: 12px;
      padding: 18px 20px;
      margin-bottom: 16px;
      border-left: 5px solid var(--primary-dark);
      box-shadow: var(--shadow-sm);
    }

    .plain-english-lead {
      font-size: 1.25rem;
      font-weight: 700;
      color: var(--dark);
      line-height: 1.35;
      margin: 0 0 12px 0;
    }

    .plain-english-sub {
      font-size: 0.95rem;
      color: var(--text);
      line-height: 1.55;
      margin: 0;
    }

    .summary-panel {
      background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 20px 22px;
      margin-bottom: 20px;
      text-align: left;
    }

    .summary-panel[hidden] {
      display: none !important;
    }

    .summary-title {
      font-size: 17px;
      font-weight: 700;
      color: var(--text);
      margin-bottom: 12px;
    }

    .summary-sim-wrap {
      display: flex;
      align-items: baseline;
      gap: 10px;
      margin-bottom: 14px;
    }

    .summary-sim-label {
      font-size: 13px;
      color: var(--text-light);
    }

    .summary-sim-value {
      font-size: 22px;
      font-weight: 800;
      color: var(--primary-dark);
    }

    .summary-bullets {
      margin: 0;
      padding-left: 1.25rem;
      font-size: 14px;
      line-height: 1.55;
      color: var(--text);
    }

    .summary-bullets li {
      margin-bottom: 8px;
    }

    .diff-legend-intro {
      font-size: 14px;
      font-weight: 600;
      color: var(--text);
      margin: 0 0 8px 0;
    }

    .diff-legend {
      display: flex;
      flex-wrap: wrap;
      gap: 12px 20px;
      align-items: flex-start;
      font-size: 13px;
      color: var(--text);
      margin-bottom: 16px;
      padding: 14px 16px;
      background: #f1f5f9;
      border-radius: 8px;
    }

    .diff-legend .legend-line {
      display: flex;
      align-items: flex-start;
      gap: 8px;
      max-width: 100%;
      line-height: 1.4;
    }

    .diff-legend span {
      display: inline-flex;
      align-items: center;
      gap: 8px;
    }

    .legend-swatch {
      width: 14px;
      height: 14px;
      border-radius: 3px;
      display: inline-block;
    }

    .legend-swatch.add { background: #1e4620; border: 1px solid #34d399; }
    .legend-swatch.del { background: #671e1e; border: 1px solid #f87171; }
    .legend-swatch.mutual { background: #334155; border: 1px solid #94a3b8; }
    .legend-swatch.skip { background: #1e293b; border: 1px dashed #64748b; }

    .help-banner {
      font-size: 13px;
      color: var(--text-light);
      margin-bottom: 24px;
      line-height: 1.5;
      padding: 12px 16px;
      background: rgba(255, 255, 255, 0.55);
      border-radius: 10px;
      border-left: 4px solid var(--primary-dark);
    }

    .diff-viewer {
      background: #1e293b;
      border-radius: 12px;
      padding: 12px;
      position: relative;
      min-width: 0;
    }

    /* Single scroll container: avoids nested horizontal + vertical scroll fighting */
    .diff-output-container {
      width: 100%;
      min-width: 0;
      min-height: 240px;
      max-height: min(70vh, 700px);
      padding: 16px;
      background: #0f172a;
      color: #e2e8f0;
      font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
      font-size: 13px;
      line-height: 1.6;
      white-space: pre-wrap;
      word-wrap: break-word;
      overflow-wrap: break-word;
      overflow: auto;
      border-radius: 8px;
    }

.diff-added { background-color: #1e4620; color: #afffbe; display: block; border-left: 3px solid #34d399; padding-left: 8px; }
.diff-removed { background-color: #671e1e; color: #ffdce0; display: block; border-left: 3px solid #f87171; padding-left: 8px; }
.diff-error { background-color: #422006; color: #fde68a; display: block; border-left: 3px solid var(--warning); padding-left: 8px; }
.diff-mutual { background-color: #334155; color: #e2e8f0; display: block; border-left: 3px solid #94a3b8; padding-left: 8px; }
.diff-omitted { background-color: #1e293b; color: #94a3b8; display: block; font-style: italic; border-left: 3px dashed #64748b; padding-left: 8px; }

    .diff-section {
      margin-bottom: 1.75rem;
    }
    .diff-section:last-child {
      margin-bottom: 0;
    }
    .diff-section-heading {
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
      font-size: 0.9375rem;
      font-weight: 700;
      color: #f8fafc;
      margin: 0 0 8px 0;
      letter-spacing: 0.02em;
    }
    .diff-section-intro {
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
      font-size: 0.8125rem;
      color: #94a3b8;
      margin: 0 0 12px 0;
      line-height: 1.5;
      max-width: 65ch;
    }
    .diff-section-body {
      margin: 0;
    }
    .diff-section-empty {
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
      font-size: 0.8125rem;
      font-style: italic;
      color: #64748b;
      margin: 0;
    }

    #result::selection {
      background: var(--primary);
      color: white;
    }

    .toolbar {
      display: flex;
      gap: 10px;
      margin-top: 20px;
      flex-wrap: wrap;
    }

    .btn-secondary {
      background: var(--light);
      color: var(--primary);
      border: 2px solid var(--border);
      padding: 10px 20px;
      font-size: 14px;
      text-transform: none;
      letter-spacing: normal;
    }

    .btn-secondary:hover {
      background: var(--primary);
      color: white;
      border-color: var(--primary);
    }

    @media (max-width: 1024px) {
      .files-grid {
        grid-template-columns: 1fr;
      }

      .results-stats {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        width: 100%;
        justify-items: stretch;
      }

      h1 {
        font-size: 36px;
      }

      .card {
        padding: 30px;
      }
    }

    @media (max-width: 640px) {
      body {
        padding: 10px;
      }

      .card {
        padding: 20px;
        border-radius: 12px;
      }

      h1 {
        font-size: 28px;
      }

      .tagline {
        font-size: 16px;
      }

      .btn {
        padding: 12px 24px;
        font-size: 14px;
      }

      .diff-output-container {
        min-height: 220px;
        max-height: min(55vh, 480px);
        font-size: 12px;
      }
    }

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

/* Web deploy: hidden file inputs triggered by drop zones */
.file-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.web-subnote {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.92);
  text-align: center;
  margin-top: 10px;
  max-width: 40rem;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.45;
}
