:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-soft: #faf8f3;
  --text: #1c1917;
  --text-soft: #4b453d;
  --muted: #6b6257;
  --border: #ece5d8;
  --border-strong: #d8cdb8;
  --accent: #ca8a04;
  --accent-deep: #a16207;
  --accent-soft: #fdf6e3;
  --yellow: #eab308;
  --yellow-soft: #fef9c3;
  --yellow-deep: #854d0e;
  --success: #15803d;
  --success-soft: #e8f7ee;
  --danger: #b42318;
  --danger-soft: #fff1f0;
  --danger-border: #fecdca;
  --warning: #854d0e;
  --warning-soft: #fff9e6;
  --warning-border: #f2d98a;
  --shadow-card: 0 24px 60px -34px rgba(28, 25, 23, 0.22);
  --shadow-soft: 0 14px 32px -20px rgba(28, 25, 23, 0.16);
  --radius-card: 18px;
  --radius-input: 12px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.page-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(920px 560px at 8% -12%, rgba(202, 138, 4, 0.16), transparent 62%),
    radial-gradient(820px 520px at 102% -4%, rgba(234, 179, 8, 0.14), transparent 58%),
    radial-gradient(760px 520px at 52% 112%, rgba(202, 138, 4, 0.09), transparent 62%),
    linear-gradient(180deg, #ffffff 0%, #faf8f3 52%, #fdfbf6 100%);
}

h1,
h2,
p {
  margin: 0;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
}

.icon-sm {
  width: 18px;
  height: 18px;
}

.icon-xs {
  width: 15px;
  height: 15px;
}

.topbar {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 26px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  border-radius: 14px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(140deg, #ca8a04 0%, #d99a06 52%, #854d0e 100%);
  box-shadow: 0 12px 24px -12px rgba(202, 138, 4, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.brand-mark svg {
  width: 26px;
  height: 26px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-sub {
  font-size: 12px;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 33px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid rgba(120, 124, 134, 0.28);
  background: rgba(255, 255, 255, 0.65);
  color: #6b6257;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  backdrop-filter: blur(10px);
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #eab308;
  box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.24);
}

.shell {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding-bottom: 12px;
}

.hero {
  padding: 46px 0 30px;
  max-width: 860px;
  animation: rise 0.55s ease both;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(253, 246, 227, 0.9);
  border: 1px solid rgba(202, 138, 4, 0.16);
  color: #a16207;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.hero h1 {
  margin-top: 18px;
  font-size: clamp(2rem, 4.2vw, 3.05rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 760;
  max-width: 820px;
}

.accent-text {
  white-space: nowrap;
  background: linear-gradient(115deg, #ca8a04 10%, #d99a06 55%, #854d0e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  margin-top: 16px;
  max-width: 640px;
  color: var(--text-soft);
  font-size: 15.5px;
  line-height: 1.65;
}

.hero-points {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.point {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #6b6257;
  font-size: 12.5px;
}

.point::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #eab308;
  box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.2);
}

.card {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(120, 124, 134, 0.2);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(18px) saturate(1.08);
  animation: rise 0.55s ease both;
}

.upload-card {
  padding: 22px 26px 26px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 11px;
}

.card-title h2,
.card-head h2 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.step {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--yellow-soft);
  border: 1px solid rgba(234, 179, 8, 0.55);
  color: #5d4300;
  font-size: 11.5px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.card-meta {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}

.dropzone {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 24px;
  border: 1.5px dashed #d8cbff;
  border-radius: 18px;
  background:
    radial-gradient(420px 180px at 0% 0%, rgba(202, 138, 4, 0.07), transparent 70%),
    linear-gradient(135deg, #fffdf9 0%, #fdf6e3 100%);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.dropzone:hover {
  border-color: #a78bfa;
  background:
    radial-gradient(420px 180px at 0% 0%, rgba(202, 138, 4, 0.11), transparent 70%),
    linear-gradient(135deg, #ffffff 0%, #fdf6e3 100%);
}

.dropzone:focus-visible {
  outline: none;
  border-color: #8b6cff;
  box-shadow: 0 0 0 4px rgba(202, 138, 4, 0.14);
}

.dropzone.is-dragover {
  border-color: #ca8a04;
  background: #fdf6e3;
  transform: scale(0.997);
}

.dropzone-icon {
  width: 56px;
  height: 56px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 17px;
  background: linear-gradient(160deg, #ffffff, #fdf6e3);
  border: 1px solid rgba(202, 138, 4, 0.2);
  color: #ca8a04;
  box-shadow: 0 10px 22px -14px rgba(202, 138, 4, 0.55);
}

.dropzone-icon svg {
  width: 28px;
  height: 28px;
}

.dropzone-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.dropzone-copy strong {
  font-size: 15.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.dropzone-copy > span {
  color: var(--muted);
  font-size: 13px;
}

.text-link {
  color: #a16207;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

.dropzone-note {
  margin-left: auto;
  max-width: 210px;
  text-align: right;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.file-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 17px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(135deg, #fffdf9, #fdfbf6);
}

.file-badge {
  width: 48px;
  height: 48px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: #fef9c3;
  border: 1px solid #f2d98a;
  color: #6b4e00;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.file-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.file-name {
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 560px;
}

.file-meta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--muted);
}

.file-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: #6f7480;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

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

.icon-btn:hover {
  background: #fff1f0;
  border-color: #fecdca;
  color: #b42318;
}

.icon-btn:disabled,
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.03fr) minmax(0, 0.97fr);
  gap: 22px;
  align-items: start;
  margin-top: 22px;
}

.settings-card,
.preview-card {
  padding: 24px 26px 26px;
}

.preview-card {
  position: sticky;
  top: 20px;
  min-height: 560px;
  display: flex;
  flex-direction: column;
}

.field {
  margin-top: 18px;
  border: 0;
  padding: 0;
  min-width: 0;
}

.field:first-of-type {
  margin-top: 0;
}

.field > label,
.field > legend {
  display: block;
  margin-bottom: 7px;
  padding: 0;
  font-size: 13px;
  font-weight: 650;
  color: #34373f;
}

.mode-field {
  margin-top: 0;
}

.mode-field > legend {
  float: left;
  width: 100%;
}

.mode-switch {
  clear: both;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 5px;
  border-radius: 15px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.mode-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: #6b6257;
  font-size: 13.5px;
  font-weight: 600;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.mode-btn:hover {
  color: #34373f;
}

.mode-btn.is-active {
  background: #ffffff;
  border-color: rgba(120, 124, 134, 0.18);
  color: #a16207;
  box-shadow: 0 8px 18px -12px rgba(23, 25, 30, 0.35);
}

.mode-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(202, 138, 4, 0.18);
}

.mode-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.hint {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.input-wrap {
  position: relative;
}

input[type="text"],
input[type="password"],
input[type="file"] {
  width: 100%;
}

#password,
#columns,
#rows {
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-input);
  background: #faf8f3;
  color: var(--text);
  font-size: 14.5px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

#password {
  padding-right: 48px;
}

#password::-ms-reveal,
#password::-ms-clear {
  display: none;
}

#password::placeholder,
#columns::placeholder,
#rows::placeholder {
  color: var(--muted);
}

#password:focus,
#columns:focus,
#rows:focus {
  outline: none;
  border-color: #8b6cff;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(202, 138, 4, 0.13);
}

#password.is-invalid,
#columns.is-invalid,
#rows.is-invalid {
  border-color: #d92d20;
  box-shadow: 0 0 0 4px rgba(217, 45, 32, 0.1);
  background: #fffbfa;
}

.reveal-btn {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #6f7480;
  transition: background 0.15s ease, color 0.15s ease;
}

.reveal-btn:hover {
  background: #efeff3;
  color: #4b4f58;
}

.reveal-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(202, 138, 4, 0.18);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field-row .field {
  margin-top: 18px;
}

.selection-summary {
  margin-top: 20px;
  padding: 12px 14px;
  border: 1px dashed #e2d9ff;
  border-radius: 13px;
  background: linear-gradient(135deg, #ffffff, #fdfbf6);
  color: #4b4f58;
  font-size: 13px;
  line-height: 1.5;
}

.selection-summary strong {
  color: #3f2d99;
  font-weight: 700;
}

.selection-summary.is-warning {
  border-color: #f2d98a;
  background: #fffdf6;
  color: #7a5200;
}

.selection-summary.is-error {
  border-color: var(--danger-border);
  background: var(--danger-soft);
  color: var(--danger);
}

.alert {
  margin-top: 14px;
  padding: 11px 14px;
  border: 1px solid var(--danger-border);
  border-radius: 12px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 46px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(202, 138, 4, 0.18);
}

.btn-sm {
  height: 38px;
  padding: 0 13px;
  font-size: 12.5px;
  border-radius: 10px;
}

.btn-primary {
  color: #ffffff;
  background: linear-gradient(135deg, #d99a06 0%, #a16207 100%);
  box-shadow: 0 16px 30px -14px rgba(202, 138, 4, 0.62), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 34px -14px rgba(202, 138, 4, 0.68), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

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

.btn-primary:disabled {
  opacity: 0.62;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-ghost {
  border-color: var(--border);
  background: #ffffff;
  color: #4b4f58;
}

.btn-ghost:hover {
  border-color: #d8cbff;
  background: #ffffff;
  color: #a16207;
}

.btn-ghost:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-run {
  width: 100%;
  height: 52px;
  margin-top: 20px;
  font-size: 15px;
}

.btn-spinner {
  width: 17px;
  height: 17px;
  border-width: 2px;
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
}

.spinner {
  display: inline-block;
  width: 19px;
  height: 19px;
  border: 2px solid rgba(202, 138, 4, 0.18);
  border-top-color: #ca8a04;
  border-radius: 50%;
  animation: spin 0.72s linear infinite;
  flex: none;
}

.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 13px;
  padding: 0 2px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.privacy-note .icon {
  margin-top: 2px;
  color: #ca8a04;
}

.sheet-select {
  max-width: 210px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #ffffff;
  color: #4b4f58;
  font-size: 12.5px;
  cursor: pointer;
}

.sheet-select:focus-visible {
  outline: none;
  border-color: #8b6cff;
  box-shadow: 0 0 0 3px rgba(202, 138, 4, 0.14);
}

.preview-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  padding: 46px 28px;
  margin-top: 4px;
  border: 1px dashed #e8e8ee;
  border-radius: 18px;
  background:
    radial-gradient(340px 200px at 50% 0%, rgba(202, 138, 4, 0.055), transparent 70%),
    linear-gradient(180deg, #faf8f3, #ffffff);
}

.preview-illustration {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  color: #a78bfa;
  background: #ffffff;
  border: 1px solid rgba(202, 138, 4, 0.14);
  box-shadow: var(--shadow-soft);
  margin-bottom: 10px;
}

.preview-illustration svg {
  width: 40px;
  height: 40px;
}

.preview-empty strong {
  font-size: 15px;
  font-weight: 650;
}

.preview-empty p {
  max-width: 330px;
  color: var(--muted);
  font-size: 12.8px;
  line-height: 1.6;
}

.preview-loading {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 380px;
  color: var(--muted);
  font-size: 13px;
}

.preview-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.preview-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 12px;
  color: var(--muted);
  font-size: 12.5px;
  flex-wrap: wrap;
}

.preview-tip {
  color: #a16207;
  font-weight: 550;
}

.table-scroll {
  overflow: auto;
  max-height: 430px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #ffffff;
  scrollbar-width: thin;
  scrollbar-color: #d9d9e0 transparent;
}

.table-scroll::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.table-scroll::-webkit-scrollbar-thumb {
  background: #dedee5;
  border: 3px solid #ffffff;
  border-radius: 999px;
}

.table-scroll:focus-visible {
  outline: none;
  border-color: #c4b5fd;
  box-shadow: 0 0 0 3px rgba(202, 138, 4, 0.16);
}

.preview-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
}

.preview-table th,
.preview-table td {
  padding: 9px 12px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid #f1f1f4;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8f8fa;
  border-bottom: 1px solid #e7e7ec;
  color: #6b6257;
  font-size: 11.5px;
  font-weight: 650;
  user-select: none;
}

.preview-table thead th.column-head {
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}

.preview-table thead th.column-head:hover {
  background: #fdf6e3;
  color: #a16207;
}

.preview-table thead th.column-head:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px #8b6cff;
}

.preview-table thead th.column-head.is-selected {
  background: #fdf6e3;
  color: #4a35b8;
  box-shadow: inset 0 -2px 0 #8b6cff;
}

.col-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 190px;
}

.col-label > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.col-num {
  flex: none;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  display: inline-grid;
  place-items: center;
  border-radius: 7px;
  background: #efeff3;
  color: #6b6257;
  font-size: 10.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.column-head.is-selected .col-num {
  background: #eab308;
  color: #17191e;
}

.preview-table tbody tr:hover td {
  background: #faf8f3;
}

.preview-table .row-num {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fafafa;
  color: var(--muted);
  font-size: 11px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  min-width: 46px;
}

.preview-table thead .row-num {
  z-index: 3;
  background: #f5f5f8;
}

.preview-table tbody tr:last-child td,
.preview-table tbody tr:last-child .row-num {
  border-bottom: 0;
}

.preview-table td.is-empty {
  color: #cfcfd8;
}

.preview-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.preview-note {
  margin-top: 9px;
}

.result-card {
  margin-top: 22px;
  padding: 26px;
  border-color: rgba(202, 138, 4, 0.26);
  background:
    radial-gradient(540px 300px at 0% 0%, rgba(202, 138, 4, 0.09), transparent 65%),
    linear-gradient(135deg, rgba(246, 241, 255, 0.86), rgba(255, 255, 255, 0.94));
  box-shadow: 0 26px 60px -38px rgba(63, 45, 153, 0.35);
}

.result-card.is-warning {
  border-color: rgba(234, 179, 8, 0.32);
  background:
    radial-gradient(540px 300px at 0% 0%, rgba(234, 179, 8, 0.1), transparent 65%),
    linear-gradient(135deg, rgba(255, 251, 235, 0.86), rgba(255, 255, 255, 0.95));
  box-shadow: 0 26px 60px -38px rgba(122, 82, 0, 0.28);
}

.result-card.is-warning .result-icon {
  color: #17191e;
  background: linear-gradient(140deg, #ffe27a, #eab308 60%, #e0a800);
  box-shadow: 0 14px 26px -14px rgba(122, 82, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.result-card.is-warning .stat-value {
  color: #7a5200;
}

.result-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.result-icon {
  width: 52px;
  height: 52px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #ffffff;
  background: linear-gradient(140deg, #ca8a04, #d99a06 55%, #4f2fd6);
  box-shadow: 0 14px 26px -14px rgba(202, 138, 4, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

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

.result-copy {
  min-width: 0;
}

.result-copy h2 {
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.result-copy p {
  margin-top: 3px;
  color: var(--text-soft);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0 0;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 13px 16px;
  border: 1px solid #e7e2f7;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
}

.stat-value {
  font-size: 23px;
  font-weight: 750;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: #3f2d99;
}

.stat-label {
  font-size: 11.5px;
  color: var(--muted);
}

.result-warning {
  margin-top: 14px;
  padding: 11px 14px;
  border: 1px solid var(--warning-border);
  border-radius: 12px;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 12.5px;
  line-height: 1.5;
}

.result-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.result-note {
  margin-top: 13px;
  color: var(--muted);
  font-size: 12px;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 10px 24px;
  flex-wrap: wrap;
  padding: 30px 4px 40px;
  color: var(--muted);
  font-size: 12px;
}

.noscript {
  position: fixed;
  inset: auto 16px 16px;
  padding: 14px 18px;
  border-radius: 12px;
  background: #fff1f0;
  border: 1px solid #fecdca;
  color: #b42318;
  text-align: center;
  font-size: 13px;
}

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

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

@media (max-width: 1040px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .preview-card {
    position: static;
    min-height: 0;
  }

  .preview-empty {
    min-height: 300px;
  }
}

@media (max-width: 720px) {
  .topbar,
  .shell {
    width: calc(100% - 32px);
  }

  .topbar {
    padding-top: 18px;
  }

  .brand-sub {
    display: none;
  }

  .hero {
    padding: 32px 0 24px;
  }

  .hero-sub {
    font-size: 14.5px;
  }

  .upload-card,
  .settings-card,
  .preview-card {
    padding: 20px 18px 22px;
    border-radius: 22px;
  }

  .dropzone {
    padding: 18px;
    gap: 14px;
  }

  .dropzone-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }

  .dropzone-icon svg {
    width: 24px;
    height: 24px;
  }

  .dropzone-note {
    display: none;
  }

  .file-card {
    flex-wrap: wrap;
  }

  .file-name {
    max-width: 45vw;
  }

  .file-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .field-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .card-head {
    flex-wrap: wrap;
  }

  .sheet-select {
    max-width: 100%;
  }

  .preview-table th,
  .preview-table td {
    max-width: 170px;
  }

  .result-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .stat {
    padding: 11px 12px;
  }

  .stat-value {
    font-size: 19px;
  }

  .result-card {
    padding: 20px 18px;
    border-radius: 22px;
  }

  .result-actions .btn {
    flex: 1;
  }

  .footer {
    flex-direction: column;
    padding-bottom: 28px;
  }
}

@media (max-width: 480px) {
  .topbar-badge {
    display: none;
  }

  .hero h1 {
    font-size: 1.9rem;
  }

  .hero-points {
    gap: 6px 14px;
  }

  .mode-btn {
    font-size: 12.5px;
    padding: 0 8px;
  }

  .mode-btn .icon {
    display: none;
  }

  .file-actions {
    justify-content: flex-end;
  }

  .result-head {
    align-items: flex-start;
  }

  .result-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .preview-tip {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== Corporate branding ===== */
.brand-mark {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.brand-gold {
  color: var(--accent);
}
.topbar-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.badge-free {
  background: var(--success-soft);
  border-color: #bbf7d0;
  color: var(--success);
}
.footer a {
  color: var(--accent-deep);
  text-decoration: none;
}
.footer a:hover {
  text-decoration: underline;
}

