:root {
  --toefl-import-ink: #17352b;
  --toefl-import-muted: #64736b;
  --toefl-import-green: #2d5f4d;
  --toefl-import-green-dark: #1f493a;
  --toefl-import-mint: #e7f3eb;
  --toefl-import-cream: #f7f5ef;
  --toefl-import-line: #dfe5df;
  --toefl-import-white: #fff;
  --toefl-import-danger: #9b302f;
  --toefl-import-warn: #9a6618;
}

.toefl-flash-import,
.toefl-flash-import * { box-sizing: border-box; }

.toefl-flash-import {
  width: min(1060px, calc(100% - 40px));
  min-width: 0;
  margin: 0 auto;
  padding: 40px 0 88px;
  color: var(--toefl-import-ink);
}

.toefl-flash-import .hidden,
.toefl-flash-import [hidden] { display: none !important; }

.toefl-flash-import button,
.toefl-flash-import input,
.toefl-flash-import textarea,
.toefl-flash-import select { font: inherit; }

.toefl-flash-import-header { max-width: 800px; margin-bottom: 30px; }
.toefl-flash-import-header > a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 22px;
  color: var(--toefl-import-green);
  font-weight: 780;
  text-decoration: none;
}
.toefl-flash-import-header svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.toefl-flash-import-header p,
.toefl-flash-import-section-heading p,
.toefl-flash-import-complete > p {
  margin: 0 0 7px;
  color: var(--toefl-import-green);
  font-size: .74rem;
  font-weight: 850;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.toefl-flash-import-header h1 { margin: 0; font-size: clamp(2.2rem, 5vw, 4rem); letter-spacing: -.05em; line-height: 1; }
.toefl-flash-import-header > span { display: block; margin-top: 14px; color: var(--toefl-import-muted); line-height: 1.65; }

.toefl-flash-import-form,
.toefl-flash-import-complete {
  overflow: hidden;
  border: 1px solid var(--toefl-import-line);
  border-radius: 22px;
  background: var(--toefl-import-white);
  box-shadow: 0 18px 45px rgba(31, 73, 58, .08);
}
.toefl-flash-import-form > section { padding: 28px; }
.toefl-flash-import-form > section + section { border-top: 1px solid var(--toefl-import-line); }
.toefl-flash-import-section-heading { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 22px; }
.toefl-flash-import-section-heading > span {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: var(--toefl-import-green-dark);
  font-weight: 850;
  background: var(--toefl-import-mint);
}
.toefl-flash-import h2 { margin: 0; font-size: 1.35rem; }

.toefl-flash-import-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 22px; }
.toefl-flash-import label { display: block; color: var(--toefl-import-ink); font-size: .9rem; font-weight: 760; }
.toefl-flash-import label > span,
.toefl-flash-import small { color: var(--toefl-import-muted); font-weight: 500; }
.toefl-flash-import input[type="text"],
.toefl-flash-import input[type="file"],
.toefl-flash-import textarea,
.toefl-flash-import select {
  width: 100%;
  min-width: 0;
  margin-top: 8px;
  border: 1px solid #cfd9d2;
  border-radius: 11px;
  color: var(--toefl-import-ink);
  background: var(--toefl-import-white);
}
.toefl-flash-import input[type="text"],
.toefl-flash-import input[type="file"],
.toefl-flash-import select { min-height: 46px; padding: 10px 12px; }
.toefl-flash-import textarea { padding: 12px 13px; line-height: 1.5; resize: vertical; }

.toefl-flash-import-source-grid { display: grid; grid-template-columns: 1fr 44px 1fr; gap: 16px; align-items: center; }
.toefl-flash-import-upload { min-width: 0; padding: 20px; border: 1px dashed #b7c8bd; border-radius: 14px; background: var(--toefl-import-cream); }
.toefl-flash-import-upload small { display: block; margin-top: 9px; }
.toefl-flash-import-divider { color: var(--toefl-import-muted); text-align: center; }
.toefl-flash-import-options { display: flex; align-items: end; gap: 24px; margin-top: 20px; }
.toefl-flash-import-options > label:first-child { width: 220px; }
.toefl-flash-import-checkbox { display: flex !important; align-items: center; gap: 9px; min-height: 46px; }
.toefl-flash-import-checkbox input { width: 18px; height: 18px; }

.toefl-flash-import-mapping { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.toefl-flash-import-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.toefl-flash-import-summary span { padding: 14px; border-radius: 12px; color: var(--toefl-import-muted); text-align: center; background: var(--toefl-import-cream); }
.toefl-flash-import-summary strong { display: block; color: var(--toefl-import-ink); font-size: 1.45rem; }
.toefl-flash-import-table-wrap { max-height: 420px; overflow: auto; border: 1px solid var(--toefl-import-line); border-radius: 12px; }
.toefl-flash-import table { width: 100%; min-width: 650px; border-collapse: collapse; }
.toefl-flash-import th,
.toefl-flash-import td { padding: 12px; border-bottom: 1px solid var(--toefl-import-line); text-align: left; vertical-align: top; }
.toefl-flash-import th { position: sticky; top: 0; z-index: 1; background: var(--toefl-import-cream); }
.toefl-flash-import tr.has-error td:last-child { color: var(--toefl-import-danger); }
.toefl-flash-import tr.has-duplicate td:last-child { color: var(--toefl-import-warn); }

.toefl-flash-import-duplicates { display: grid; gap: 10px; margin: 22px 0 0; padding: 0; border: 0; }
.toefl-flash-import-duplicates legend { margin-bottom: 9px; font-weight: 820; }
.toefl-flash-import-duplicates label { display: flex; gap: 11px; padding: 13px; border: 1px solid var(--toefl-import-line); border-radius: 12px; cursor: pointer; }
.toefl-flash-import-duplicates input { flex: 0 0 auto; margin-top: 3px; }
.toefl-flash-import-duplicates strong { display: block; margin-bottom: 3px; }

.toefl-flash-import-auth:empty,
.toefl-flash-import-state:empty { display: none; }
.toefl-flash-import-auth,
.toefl-flash-import-state { margin: 14px 0; padding: 13px 15px; border-radius: 12px; color: var(--toefl-import-muted); background: var(--toefl-import-cream); }
.toefl-flash-import-state { margin: 0 28px 20px; }
.toefl-flash-import-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; padding: 22px 28px; border-top: 1px solid var(--toefl-import-line); }
.toefl-flash-import-actions a { margin-right: auto; color: var(--toefl-import-muted); font-weight: 700; }
.toefl-flash-import-actions button,
.toefl-flash-import-complete a,
.toefl-flash-import-auth button {
  padding: 12px 18px;
  border: 1px solid var(--toefl-import-green);
  border-radius: 10px;
  color: var(--toefl-import-white);
  font-weight: 800;
  text-decoration: none;
  background: var(--toefl-import-green);
  cursor: pointer;
}
.toefl-flash-import-actions button:hover,
.toefl-flash-import-complete a:hover { background: var(--toefl-import-green-dark); }
.toefl-flash-import-actions button:disabled { cursor: wait; opacity: .6; }
.toefl-flash-import-complete { padding: clamp(28px, 6vw, 52px); text-align: center; }
.toefl-flash-import-complete h2 { font-size: clamp(1.8rem, 4vw, 3rem); }
.toefl-flash-import-complete #toefl-flash-import-result-summary { margin: 18px 0 26px; color: var(--toefl-import-muted); }
.toefl-flash-import-complete > div:last-child { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

.toefl-flash-import input:focus,
.toefl-flash-import textarea:focus,
.toefl-flash-import select:focus,
.toefl-flash-import button:focus,
.toefl-flash-import a:focus,
.toefl-flash-import input:focus-visible,
.toefl-flash-import textarea:focus-visible,
.toefl-flash-import select:focus-visible,
.toefl-flash-import button:focus-visible,
.toefl-flash-import a:focus-visible {
  outline: 2px solid var(--toefl-import-green);
  outline-offset: 2px;
}

@media (max-width: 760px) {
  .toefl-flash-import-fields,
  .toefl-flash-import-source-grid,
  .toefl-flash-import-mapping { grid-template-columns: 1fr; }
  .toefl-flash-import-divider { padding: 2px 0; }
  .toefl-flash-import-options { align-items: stretch; flex-direction: column; gap: 8px; }
  .toefl-flash-import-options > label:first-child { width: 100%; }
}

@media (max-width: 480px) {
  .toefl-flash-import { width: min(100% - 24px, 1060px); padding-top: 26px; }
  .toefl-flash-import-form > section { padding: 20px; }
  .toefl-flash-import-summary { grid-template-columns: repeat(2, 1fr); }
  .toefl-flash-import-state { margin-inline: 20px; }
  .toefl-flash-import-actions { align-items: stretch; flex-direction: column; padding: 20px; }
  .toefl-flash-import-actions a { margin: 0; text-align: center; }
  .toefl-flash-import-actions button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .toefl-flash-import * { scroll-behavior: auto !important; transition: none !important; }
}
