:root {
  color-scheme: dark;
  --ink: #f7fbff;
  --soft: #c9d8e8;
  --muted: #7f93aa;
  --line: rgba(142, 232, 255, 0.18);
  --line-hot: rgba(119, 240, 255, 0.62);
  --glass: rgba(8, 15, 27, 0.52);
  --glass-deep: rgba(7, 12, 22, 0.68);
  --cyan: #77f0ff;
  --mint: #8fffd2;
  --gold: #fff0b5;
  --rose: #f091ff;
  --shadow: 0 24px 90px rgba(0, 0, 0, 0.42);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --ink: #0b1f33;
  --soft: #28445f;
  --muted: #607a96;
  --line: rgba(34, 126, 186, 0.2);
  --line-hot: rgba(23, 151, 210, 0.58);
  --glass: rgba(232, 246, 255, 0.68);
  --glass-deep: rgba(239, 249, 255, 0.82);
  --cyan: #138fce;
  --mint: #52c7d6;
  --gold: #0f6fb0;
  --rose: #7ba7ff;
  --shadow: 0 24px 70px rgba(36, 91, 128, 0.18);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: #02050b;
}

body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 54% 42%, rgba(52, 168, 255, 0.12), transparent 34rem),
    radial-gradient(circle at 82% 12%, rgba(143, 255, 210, 0.1), transparent 26rem),
    linear-gradient(135deg, #030713 0%, #07101c 42%, #03060d 100%);
  overflow-x: hidden;
}

:root[data-theme="light"] body {
  background:
    radial-gradient(circle at 18% 20%, rgba(84, 193, 232, 0.26), transparent 30rem),
    radial-gradient(circle at 86% 8%, rgba(121, 169, 255, 0.18), transparent 26rem),
    linear-gradient(135deg, #f2f9ff 0%, #dff1fb 46%, #f7fbff 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(119, 240, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(119, 240, 255, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at center, black, transparent 74%);
}

:root[data-theme="light"] body::before {
  background-image:
    linear-gradient(rgba(19, 143, 206, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(19, 143, 206, 0.08) 1px, transparent 1px);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

#dataField {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  pointer-events: none;
  background: #02050b;
}

:root[data-theme="light"] #dataField {
  opacity: 0.32;
  background: #eef8ff;
}

.scene-vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 54%, transparent 0 24rem, rgba(2, 5, 11, 0.25) 46rem),
    linear-gradient(180deg, rgba(2, 5, 11, 0.08), rgba(2, 5, 11, 0.66));
}

:root[data-theme="light"] .scene-vignette {
  background:
    radial-gradient(circle at 50% 54%, rgba(255, 255, 255, 0.08) 0 24rem, rgba(241, 249, 255, 0.35) 46rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(226, 242, 252, 0.72));
}

.app-shell {
  position: relative;
  z-index: 2;
  width: min(1320px, calc(100vw - 40px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 42px 0 46px;
}

.hero {
  min-height: min(55vh, 560px);
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(360px, 1.18fr);
  gap: clamp(24px, 5vw, 68px);
  align-items: center;
}

.hero-copy {
  transform-style: preserve-3d;
}

.status-pill {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 13px;
  border: 1px solid rgba(143, 255, 210, 0.23);
  border-radius: 999px;
  background: rgba(5, 13, 25, 0.48);
  color: var(--mint);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: inset 0 0 22px rgba(143, 255, 210, 0.08), 0 0 32px rgba(119, 240, 255, 0.08);
  backdrop-filter: blur(16px);
}

:root[data-theme="light"] .status-pill {
  border-color: rgba(19, 143, 206, 0.2);
  background: rgba(240, 249, 255, 0.78);
  color: #0c699e;
  box-shadow: inset 0 0 22px rgba(19, 143, 206, 0.08), 0 12px 34px rgba(40, 103, 148, 0.1);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 5px rgba(255, 240, 181, 0.12), 0 0 18px rgba(255, 240, 181, 0.72);
}

.status-pill.ready .status-dot {
  background: var(--mint);
  box-shadow: 0 0 0 5px rgba(143, 255, 210, 0.11), 0 0 18px rgba(143, 255, 210, 0.72);
}

h1 {
  max-width: 620px;
  margin: 22px 0 14px;
  font-family: "Didot", "Bodoni 72", "Times New Roman", "Microsoft YaHei", serif;
  font-size: clamp(42px, 5.4vw, 84px);
  font-weight: 700;
  line-height: 0.96;
  letter-spacing: 0;
  background: linear-gradient(112deg, #fffdf4 5%, var(--cyan) 47%, #c6f8ff 62%, var(--gold) 92%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 34px rgba(119, 240, 255, 0.18);
}

:root[data-theme="light"] h1 {
  background: linear-gradient(112deg, #0b2940 4%, #147fc0 42%, #2db7cc 65%, #2463b8 94%);
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: 0 10px 32px rgba(34, 126, 186, 0.16);
}

h1 span {
  display: block;
}

.hero-copy p {
  max-width: 440px;
  margin: 0;
  color: var(--soft);
  font-size: 17px;
  line-height: 1.7;
}

.drop-zone,
.panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025)),
    rgba(12, 24, 42, 0.72);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 46px rgba(119, 240, 255, 0.07);
  backdrop-filter: blur(16px);
}

:root[data-theme="light"] .drop-zone,
:root[data-theme="light"] .panel {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(227, 244, 255, 0.48)),
    var(--glass);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 0 42px rgba(19, 143, 206, 0.08);
}

.drop-zone {
  min-height: clamp(340px, 42vw, 500px);
  display: grid;
  place-items: center;
  align-content: center;
  padding: clamp(28px, 4vw, 58px);
  text-align: center;
  overflow: hidden;
  isolation: isolate;
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease, background 220ms ease;
}

.drop-zone > * {
  position: relative;
  z-index: 1;
}

.drop-zone::before,
.drop-zone::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.drop-zone::before {
  inset: 14px;
  z-index: -1;
  border: 1px dashed rgba(119, 240, 255, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 49.6%, rgba(119, 240, 255, 0.16) 50%, transparent 50.4%),
    linear-gradient(0deg, transparent 49.6%, rgba(143, 255, 210, 0.12) 50%, transparent 50.4%);
  background-size: 44px 44px;
  opacity: 0.88;
}

:root[data-theme="light"] .drop-zone::before {
  border-color: rgba(19, 143, 206, 0.26);
  background: transparent;
}

.drop-zone::after {
  inset: -42%;
  z-index: -2;
  background: conic-gradient(from 120deg, transparent, rgba(119, 240, 255, 0.24), transparent 32%, rgba(255, 240, 181, 0.12), transparent 62%);
  opacity: 0.45;
  animation: slowSpin 15s linear infinite;
}

:root[data-theme="light"] .drop-zone::after {
  background: conic-gradient(from 120deg, transparent, rgba(19, 143, 206, 0.16), transparent 32%, rgba(82, 199, 214, 0.12), transparent 62%);
}

.drop-zone:hover,
.drop-zone.drag-over,
.drop-zone:focus-visible {
  transform: translateY(-8px) scale(1.012);
  border-color: var(--line-hot);
  box-shadow: 0 30px 110px rgba(0, 0, 0, 0.52), 0 0 70px rgba(119, 240, 255, 0.24), inset 0 0 42px rgba(119, 240, 255, 0.09);
  outline: none;
}

.drop-zone:hover .drop-copy strong,
.drop-zone.drag-over .drop-copy strong,
.drop-zone:focus-visible .drop-copy strong {
  color: #ffffff;
  text-shadow: 0 0 24px rgba(119, 240, 255, 0.34);
}

.drop-zone.drag-over .drop-orbit {
  transform: scale(1.16);
  border-color: rgba(143, 255, 210, 0.58);
  box-shadow: 0 0 80px rgba(119, 240, 255, 0.38), inset 0 0 32px rgba(143, 255, 210, 0.14);
}

.drop-orbit {
  position: absolute;
  width: min(52%, 260px);
  aspect-ratio: 1;
  border: 1px solid rgba(119, 240, 255, 0.2);
  border-radius: 50%;
  transition: transform 240ms ease, border-color 240ms ease, box-shadow 240ms ease;
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  margin-bottom: 22px;
  border: 1px solid rgba(119, 240, 255, 0.28);
  border-radius: 50%;
  color: var(--cyan);
  background: rgba(119, 240, 255, 0.08);
  box-shadow: 0 0 38px rgba(119, 240, 255, 0.16), inset 0 0 24px rgba(255, 255, 255, 0.06);
}

.drop-icon svg {
  width: 45px;
  height: 45px;
}

.drop-copy strong {
  display: block;
  margin-bottom: 9px;
  color: #f8fbff;
  font-size: clamp(25px, 3vw, 38px);
  font-weight: 850;
  text-shadow: 0 0 22px rgba(0, 0, 0, 0.44);
}

:root[data-theme="light"] .drop-copy strong {
  color: #0b1f33;
  text-shadow: none;
}

.drop-copy span {
  color: #a7bbcf;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

:root[data-theme="light"] .drop-copy span {
  color: #607a96;
}

.ghost-button,
.primary-button,
.download-button,
.icon-button {
  border: 0;
  border-radius: 8px;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, color 160ms ease;
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 114px;
  margin-top: 28px;
  padding: 11px 16px;
  color: #07101c;
  background: linear-gradient(135deg, var(--cyan), var(--mint));
  font-weight: 900;
  box-shadow: 0 14px 36px rgba(119, 240, 255, 0.22);
}

:root[data-theme="light"] .ghost-button,
:root[data-theme="light"] .primary-button {
  color: #ffffff;
  background: linear-gradient(135deg, #138fce, #39bfd1);
  box-shadow: 0 14px 34px rgba(19, 143, 206, 0.22);
}

:root[data-theme="light"] .download-button {
  color: #08314c;
  background: linear-gradient(135deg, #dff6ff, #9fe7f0);
  box-shadow: 0 14px 34px rgba(19, 143, 206, 0.14);
}

.ghost-button svg {
  width: 18px;
  height: 18px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(340px, 380px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-top: 18px;
}

.panel {
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.095), rgba(255, 255, 255, 0.035)),
    var(--glass-deep);
}

:root[data-theme="light"] .panel {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(222, 242, 255, 0.54)),
    var(--glass-deep);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.12), transparent 24%, transparent 70%, rgba(119, 240, 255, 0.08));
  opacity: 0.7;
}

:root[data-theme="light"] .panel::before {
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.6), transparent 26%, transparent 70%, rgba(19, 143, 206, 0.1));
}

.panel.is-converting::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 0 38%, rgba(119, 240, 255, 0.34) 48%, rgba(255, 240, 181, 0.28) 51%, transparent 62% 100%);
  transform: translateX(-115%);
  animation: beamSweep 860ms cubic-bezier(0.22, 1, 0.36, 1);
}

.controls-panel,
.result-panel {
  padding: 20px;
}

.controls-panel {
  --panel-lift: 0px;
  transform: translateY(var(--panel-lift));
}

.result-panel {
  min-height: 0;
}

.section-heading {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 17px;
  color: var(--soft);
  font-size: 13px;
  font-weight: 900;
}

.section-heading.compact {
  margin: 22px 0 12px;
}

.section-heading.compact span:last-child {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--soft);
  background: rgba(255, 255, 255, 0.07);
}

:root[data-theme="light"] .icon-button {
  color: #28445f;
  background: rgba(19, 143, 206, 0.08);
}

.icon-button svg {
  width: 19px;
  height: 19px;
}

.field {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.field input {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border: 1px solid rgba(119, 240, 255, 0.18);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(1, 7, 15, 0.55);
  outline: none;
}

:root[data-theme="light"] .field input,
:root[data-theme="light"] .table-picker select {
  color: #0b1f33;
  background: rgba(255, 255, 255, 0.74);
  border-color: rgba(19, 143, 206, 0.22);
}

.field input:focus {
  border-color: rgba(119, 240, 255, 0.72);
  box-shadow: 0 0 0 4px rgba(119, 240, 255, 0.09), 0 0 28px rgba(119, 240, 255, 0.11);
}

.toggle-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid rgba(119, 240, 255, 0.12);
}

.toggle-row input {
  width: 38px;
  height: 21px;
  flex: 0 0 auto;
  margin-top: 1px;
  accent-color: var(--cyan);
}

.toggle-row strong,
.toggle-row small {
  display: block;
}

.toggle-row strong {
  color: var(--ink);
  font-size: 14px;
}

.toggle-row small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.45;
}

.actions {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 20px;
}

.primary-button,
.download-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 47px;
  padding: 12px 16px;
  color: #04111b;
  font-weight: 950;
  overflow: hidden;
}

.primary-button {
  background: linear-gradient(135deg, var(--cyan), #d9fbff);
  box-shadow: 0 16px 36px rgba(119, 240, 255, 0.18);
}

.download-button {
  color: #07101c;
  background: linear-gradient(135deg, var(--gold), var(--mint));
  box-shadow: 0 16px 36px rgba(255, 240, 181, 0.14);
}

.download-button svg {
  width: 20px;
  height: 20px;
}

.primary-button:disabled,
.download-button:disabled {
  cursor: not-allowed;
  color: rgba(201, 216, 232, 0.56);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: none;
}

:root[data-theme="light"] .primary-button:disabled,
:root[data-theme="light"] .download-button:disabled {
  color: rgba(96, 122, 150, 0.68);
  background: rgba(184, 215, 235, 0.35);
}

.ghost-button:hover,
.primary-button:not(:disabled):hover,
.download-button:not(:disabled):hover,
.icon-button:hover {
  transform: translateY(-2px);
}

.file-chip {
  max-width: 52%;
  overflow: hidden;
  padding: 7px 10px;
  border: 1px solid rgba(119, 240, 255, 0.13);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.055);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:root[data-theme="light"] .file-chip,
:root[data-theme="light"] .metric-card {
  color: #607a96;
  background: rgba(255, 255, 255, 0.56);
  border-color: rgba(19, 143, 206, 0.15);
}

.progress-line {
  position: relative;
  z-index: 1;
  height: 5px;
  margin-bottom: 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.075);
  overflow: hidden;
}

:root[data-theme="light"] .progress-line {
  background: rgba(19, 143, 206, 0.12);
}

.progress-line span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--mint), var(--gold));
  box-shadow: 0 0 18px rgba(119, 240, 255, 0.55);
  transition: width 280ms ease;
}

.empty-state {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 240px;
  place-items: center;
  align-content: center;
  gap: 15px;
  color: var(--muted);
  text-align: center;
}

.empty-state p {
  margin: 0;
}

.empty-mark {
  width: 84px;
  height: 84px;
  border: 1px solid rgba(119, 240, 255, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 49%, rgba(119, 240, 255, 0.32) 50%, transparent 51%),
    linear-gradient(0deg, transparent 49%, rgba(143, 255, 210, 0.2) 50%, transparent 51%),
    rgba(119, 240, 255, 0.055);
  box-shadow: inset 0 0 30px rgba(119, 240, 255, 0.08), 0 0 38px rgba(119, 240, 255, 0.09);
}

:root[data-theme="light"] .empty-mark {
  background:
    linear-gradient(90deg, transparent 49%, rgba(19, 143, 206, 0.25) 50%, transparent 51%),
    linear-gradient(0deg, transparent 49%, rgba(82, 199, 214, 0.22) 50%, transparent 51%),
    rgba(255, 255, 255, 0.48);
}

.side-summary {
  position: relative;
  z-index: 1;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(119, 240, 255, 0.12);
}

.side-summary .section-heading.compact {
  margin: 0 0 12px;
}

.summary-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.metric-card {
  min-height: 86px;
  padding: 12px;
  border: 1px solid rgba(119, 240, 255, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.metric-card strong {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 18px;
  word-break: break-word;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.preview-wrap {
  position: relative;
  z-index: 1;
  animation: fadeUp 260ms ease both;
}

.preview-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 22px 0 12px;
}

.preview-toolbar > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.table-picker {
  display: grid;
  gap: 7px;
  min-width: min(320px, 48%);
}

.row-picker {
  min-width: 128px;
}

.table-picker span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.table-picker select {
  width: 100%;
  min-height: 40px;
  padding: 0 38px 0 12px;
  border: 1px solid rgba(119, 240, 255, 0.2);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(1, 7, 15, 0.72);
  outline: none;
}

.table-picker select:focus {
  border-color: rgba(119, 240, 255, 0.72);
  box-shadow: 0 0 0 4px rgba(119, 240, 255, 0.09);
}

.table-scroll {
  overflow: auto;
  max-height: min(56vh, 520px);
  border: 1px solid rgba(119, 240, 255, 0.13);
  border-radius: 8px;
  background: rgba(2, 8, 18, 0.58);
}

:root[data-theme="light"] .table-scroll {
  background: rgba(255, 255, 255, 0.64);
  border-color: rgba(19, 143, 206, 0.16);
}

table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(119, 240, 255, 0.09);
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #dffaff;
  background: rgba(6, 18, 32, 0.94);
  font-weight: 950;
  backdrop-filter: blur(12px);
}

:root[data-theme="light"] th {
  color: #0b3552;
  background: rgba(225, 244, 255, 0.96);
}

th small {
  color: var(--cyan);
  font-size: 10px;
  font-weight: 800;
}

:root[data-theme="light"] th small {
  color: #138fce;
}

td {
  color: var(--soft);
}

:root[data-theme="light"] td {
  color: #173852;
}

:root[data-theme="light"] th,
:root[data-theme="light"] td {
  border-bottom-color: rgba(19, 143, 206, 0.13);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 5;
  max-width: min(430px, calc(100vw - 44px));
  padding: 13px 15px;
  border: 1px solid rgba(119, 240, 255, 0.18);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(5, 13, 25, 0.82);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.36), 0 0 30px rgba(119, 240, 255, 0.1);
  backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

:root[data-theme="light"] .toast {
  color: #0b1f33;
  background: rgba(242, 249, 255, 0.9);
  border-color: rgba(19, 143, 206, 0.18);
}

.theme-toggle {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(8, 15, 27, 0.58);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  font-weight: 900;
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

:root[data-theme="light"] .theme-toggle {
  background: rgba(255, 255, 255, 0.78);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slowSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes beamSweep {
  to {
    transform: translateX(115%);
  }
}

@media (max-width: 1000px) {
  .app-shell {
    width: min(100% - 28px, 760px);
    padding-top: 28px;
  }

  .hero,
  .workspace {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    gap: 22px;
  }

  .hero-copy {
    text-align: center;
  }

  .hero-copy p,
  .status-pill {
    margin-inline: auto;
  }

  .drop-zone {
    min-height: 340px;
  }

  .workspace {
    margin-top: 20px;
  }

  .controls-panel {
    transform: none;
  }

  .summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 20px, 520px);
    padding: 22px 0 28px;
  }

  h1 {
    font-size: 40px;
  }

  .hero-copy p {
    font-size: 15px;
  }

  .drop-zone {
    min-height: 288px;
    padding: 24px 18px;
  }

  .drop-icon {
    width: 74px;
    height: 74px;
  }

  .drop-icon svg {
    width: 36px;
    height: 36px;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .preview-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .table-picker {
    min-width: 100%;
  }

  .section-heading {
    align-items: flex-start;
  }

  .file-chip {
    max-width: 52%;
  }
}
