:root {
  color-scheme: light;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --surface-tint: #f6f9ff;
  --text: #111827;
  --muted: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eff6ff;
  --success: #059669;
  --ink: #0f172a;
  --highlight: #fef08a;
  --shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #ffffff 0, #f8fafc 360px, #f8fafc 100%);
  color: var(--text);
}

button,
input,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

p a,
.site-footer a {
  color: var(--primary);
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  padding: 0 36px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  background: rgba(248, 250, 252, 0.9);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--primary);
  font-size: 12px;
  letter-spacing: 0;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.top-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 7px;
  padding: 0 11px;
}

.top-nav a:hover {
  background: #eef2ff;
  color: var(--text);
}

.hero {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 36px;
}

.hero-copy {
  max-width: 760px;
  margin: 28px 0 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--success);
  font-size: 14px;
  font-weight: 700;
}

h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: 0;
}

.hero-subtitle {
  max-width: 680px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.hero-badges span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: var(--primary-soft);
  color: #1e40af;
  padding: 0 13px;
  font-size: 14px;
  font-weight: 750;
}

.app-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid #d7e2f0;
  border-radius: 10px;
  background: var(--surface);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 22px 70px rgba(15, 23, 42, 0.1);
}

.tool-head,
.toolbar,
.table-toolbar,
.meta-row,
.popover-header,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.tool-head {
  min-height: 68px;
  padding: 14px 16px 14px 18px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff 0%, var(--surface-tint) 100%);
}

.tool-head strong,
.tool-head span {
  display: block;
}

.tool-head strong {
  color: var(--ink);
  font-size: 17px;
}

.tool-head span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.tool-promises {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.tool-promises span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 0 11px;
  font-size: 13px;
  font-weight: 800;
}

.toolbar {
  min-height: 66px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: #ffffff;
}

.upload-actions,
.tool-buttons {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.upload-actions {
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
}

#fileInput {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 0 17px;
  cursor: pointer;
  font-weight: 650;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  transition:
    background 120ms ease,
    border-color 120ms ease,
    color 120ms ease,
    transform 120ms ease,
    box-shadow 120ms ease;
}

.button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.button.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.22);
}

.button.primary:hover {
  border-color: var(--primary-dark);
  background: var(--primary-dark);
}

.button.secondary {
  border-color: transparent;
  background: #ffffff;
  color: #334155;
}

.button.secondary:hover,
.button.subtle:hover {
  border-color: #93c5fd;
  background: var(--primary-soft);
  color: #1d4ed8;
}

.button.subtle {
  min-height: 34px;
  border-color: var(--border);
  color: #334155;
  font-size: 13px;
  box-shadow: none;
}

.ghost-button {
  min-height: 30px;
  border: 0;
  background: transparent;
  color: var(--primary);
  padding: 0 4px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid #a7f3d0;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  padding: 0 11px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.dropzone {
  display: grid;
  place-items: center;
  min-height: 300px;
  margin: 16px;
  border: 1.5px dashed #93c5fd;
  border-radius: 10px;
  background:
    radial-gradient(circle at center top, rgba(37, 99, 235, 0.08), transparent 46%),
    linear-gradient(180deg, #f8fbff 0%, #ffffff 72%);
  color: var(--muted);
  text-align: center;
}

.dropzone strong,
.dropzone span {
  display: block;
}

.dropzone strong {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 24px;
  letter-spacing: 0;
}

.dropzone span {
  color: #475569;
  font-size: 15px;
}

.dropzone.is-dragover {
  border-color: var(--primary);
  background: #dbeafe;
}

.viewer {
  padding: 14px;
}

.table-toolbar {
  position: relative;
  z-index: 6;
  flex-wrap: wrap;
  padding-bottom: 12px;
}

.search-wrap {
  display: flex;
  align-items: center;
  min-width: min(420px, 100%);
  height: 42px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  padding: 0 12px;
  gap: 10px;
}

.search-wrap span {
  font-size: 13px;
  font-weight: 750;
}

.search-wrap input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
}

.meta-row {
  min-height: 32px;
  color: var(--muted);
  font-size: 13px;
}

.columns-popover {
  position: absolute;
  right: 18px;
  z-index: 20;
  width: min(340px, calc(100% - 36px));
  max-height: 380px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
}

.popover-header {
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

.column-list {
  max-height: 316px;
  overflow: auto;
  padding: 6px;
}

.column-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 6px;
  color: #334155;
  font-size: 14px;
}

.column-option:hover {
  background: var(--surface-soft);
}

.table-frame {
  position: relative;
  height: min(60vh, 620px);
  min-height: 430px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.virtual-scroll {
  position: relative;
  height: calc(100% - 42px);
  overflow: auto;
  scrollbar-gutter: stable;
}

.virtual-spacer {
  width: 1px;
  opacity: 0;
}

.data-table {
  width: 100%;
  min-width: 860px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 13px;
}

.virtual-scroll::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.virtual-scroll::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.virtual-scroll::-webkit-scrollbar-thumb {
  border: 3px solid #f1f5f9;
  border-radius: 999px;
  background: #94a3b8;
}

.virtual-scroll::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

.body-table {
  position: absolute;
  top: 0;
  left: 0;
}

th,
td {
  overflow: hidden;
  height: 42px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0 10px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

td[contenteditable="true"] {
  cursor: text;
}

td[contenteditable="true"]:focus {
  position: relative;
  z-index: 3;
  outline: 2px solid #2563eb;
  outline-offset: -2px;
  background: #eff6ff;
  color: var(--text);
}

th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--surface-soft);
  color: #334155;
  font-weight: 750;
}

th button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  cursor: pointer;
  font-weight: inherit;
  text-align: left;
}

tbody tr:hover td {
  background: #f8fafc;
}

.row-number {
  width: 70px;
  min-width: 70px;
  max-width: 70px;
  background: #f8fafc;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

.empty-value {
  color: #94a3b8;
  font-style: italic;
}

mark {
  border-radius: 3px;
  background: var(--highlight);
  color: #713f12;
  padding: 0 1px;
}

.mobile-cards {
  display: none;
}

.trust-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.trust-row span {
  display: block;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.84);
  padding: 12px 14px;
  line-height: 1.55;
}

.trust-row strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 15px;
}

.feature-band {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  width: min(1180px, calc(100% - 32px));
  margin: 22px auto 0;
  padding: 16px 0 44px;
}

.feature-band article {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
  padding: 18px;
}

.feature-label {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--success);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.feature-band h2,
.faq h2 {
  margin: 0 0 10px;
  font-size: 20px;
  letter-spacing: 0;
}

.feature-band p,
.faq p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.faq {
  width: min(860px, calc(100% - 32px));
  margin: 0 auto 56px;
  border-top: 1px solid var(--border);
  padding-top: 24px;
}

details {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}

summary {
  cursor: pointer;
  font-weight: 750;
}

details p {
  margin-top: 10px;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 32px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.42);
  padding: 20px;
}

.paste-dialog {
  position: static;
  display: block;
  width: min(720px, 100%);
  margin: 0;
  border: 0;
  border-radius: 8px;
  background: var(--surface);
  padding: 20px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.26);
}

.paste-dialog h2 {
  margin: 0 0 12px;
}

.paste-dialog textarea {
  width: 100%;
  min-height: 280px;
  resize: vertical;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 12px;
  outline: 0;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
}

.dialog-actions {
  justify-content: flex-end;
  margin-top: 14px;
}

.is-hidden {
  display: none !important;
}

@media (max-width: 760px) {
  .site-header {
    padding: 0 16px;
  }

  .top-nav {
    display: none;
  }

  .hero {
    width: min(100% - 20px, 1180px);
    padding-top: 14px;
  }

  h1 {
    font-size: 42px;
  }

  .hero-subtitle {
    font-size: 16px;
  }

  .toolbar,
  .tool-head,
  .table-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .tool-promises {
    justify-content: flex-start;
  }

  .upload-actions,
  .tool-buttons,
  .search-wrap,
  .button {
    width: 100%;
  }

  .upload-actions {
    align-items: stretch;
  }

  .button {
    min-height: 42px;
  }

  .status-pill {
    justify-content: center;
    width: 100%;
  }

  .dropzone {
    min-height: 300px;
    margin: 12px;
  }

  .table-frame {
    display: none;
  }

  .mobile-cards {
    display: grid;
    gap: 10px;
    max-height: 620px;
    overflow: auto;
  }

  .mobile-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    padding: 12px;
  }

  .mobile-card strong {
    display: block;
    margin-bottom: 8px;
    color: var(--primary);
  }

  .mobile-field {
    display: grid;
    grid-template-columns: minmax(90px, 38%) 1fr;
    gap: 10px;
    padding: 6px 0;
    border-top: 1px solid var(--border);
    font-size: 13px;
  }

  .mobile-field span:first-child {
    color: var(--muted);
  }

  .feature-band {
    grid-template-columns: 1fr;
  }

  .trust-row {
    grid-template-columns: 1fr;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 22px 16px;
  }
}
