/* Vstar Excel Converter */
:root {
  --paper: #F6F7F9;
  --surface: #FFFFFF;
  --ink: #141A26;
  --slate: #5F6B7A;
  --faint: #98A2B3;
  --line: #E3E6EB;
  --tile: #E9ECF1;
  --accent: #3346D3;
  --accent-ink: #FFFFFF;
  --accent-soft: #EEF0FD;
  --done: #18794E;
  --done-soft: #E7F4EC;
  --error: #C4321C;
  --error-soft: #FCEDEA;
  --radius-lg: 14px;
  --radius-sm: 8px;
  --font: "Instrument Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0F131B; --surface: #161B25; --ink: #E8ECF2; --slate: #9AA5B4; --faint: #657083;
    --line: #262D3A; --tile: #222937; --accent: #6E7FF3; --accent-soft: #1E2547;
    --done: #3DBE7E; --done-soft: #15291F; --error: #F0705B; --error-soft: #331A16;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 15px/1.55 var(--font); font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.hidden { display: none !important; }

/* ---------- mark ---------- */
.mark {
  width: 30px; height: 30px; border-radius: 8px; background: var(--ink); color: var(--paper);
  display: grid; place-items: center; font-weight: 700; font-size: 15px; letter-spacing: -.02em;
  position: relative; overflow: hidden; flex: none;
}
.mark::after { /* a single green cell: PDF in, sheet out */
  content: ""; position: absolute; right: 4px; bottom: 4px; width: 6px; height: 6px;
  border-radius: 1.5px; background: #3DBE7E;
}

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 28px; border-bottom: 1px solid var(--line); background: var(--surface);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; }
.who { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--slate); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-size: 12px; font-weight: 600;
}
.who .name { color: var(--ink); font-weight: 500; }
.link { color: var(--slate); text-decoration: none; font-size: 14px; }
.link:hover { color: var(--ink); }

/* ---------- layout ---------- */
main { max-width: 760px; margin: 0 auto; padding: 48px 28px 80px; }
h1 { font-size: 30px; line-height: 1.2; letter-spacing: -.025em; font-weight: 600; margin: 0 0 8px; }
.lede { color: var(--slate); margin: 0 0 32px; max-width: 60ch; }
h2 { font-size: 15px; font-weight: 600; margin: 48px 0 12px; }

/* ---------- panel ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }

.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 220px; padding: 32px; text-align: center; cursor: pointer;
  border: 1.5px dashed var(--line); border-radius: var(--radius-lg); background: var(--surface);
  transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop .big { font-size: 17px; font-weight: 600; }
.drop .small { color: var(--slate); font-size: 14px; }
.drop svg { color: var(--accent); margin-bottom: 8px; }

/* chosen file + actions */
.filebar { display: flex; align-items: center; gap: 14px; padding: 18px 20px; }
.doc {
  width: 38px; height: 46px; border-radius: 6px; border: 1px solid var(--line); flex: none;
  display: grid; place-items: end center; padding-bottom: 6px;
  font-size: 9px; font-weight: 700; color: var(--error); background: var(--paper);
}
.fileinfo { flex: 1; min-width: 0; }
.fileinfo .fname { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fileinfo .fmeta { color: var(--slate); font-size: 13px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  font: inherit; font-size: 14px; font-weight: 600; border-radius: var(--radius-sm);
  padding: 9px 16px; border: 1px solid transparent; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-done { background: var(--done); color: #fff; }
.btn-done:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--slate); border-color: var(--line); }
.btn-ghost:hover { color: var(--ink); border-color: var(--faint); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }

/* ---------- progress: page strip ---------- */
.run { border-top: 1px solid var(--line); padding: 20px; }
.runhead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.state { font-weight: 600; }
.state.err { color: var(--error); }
.pct { font-size: 28px; font-weight: 600; letter-spacing: -.03em; }

.strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(9px, 1fr)); gap: 3px; }
.strip i { aspect-ratio: 1; border-radius: 2px; background: var(--tile); transition: background .2s; }
.strip i.ok { background: var(--done); }
.strip i.bad { background: var(--error); }
.strip i.now { background: var(--accent); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .strip i.now { animation: none; } .strip i { transition: none; } }

.uploadbar { height: 4px; border-radius: 2px; background: var(--tile); overflow: hidden; }
.uploadbar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

.legend { display: flex; gap: 16px; margin-top: 12px; font-size: 13px; color: var(--slate); flex-wrap: wrap; }
.legend b { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.stat { padding: 16px 20px; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat .v { white-space: nowrap; font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.stat .k { color: var(--slate); font-size: 13px; }
.stat.has-errors .v { color: var(--error); }

.result { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 20px; border-top: 1px solid var(--line); background: var(--done-soft);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.result p { margin: 0; color: var(--done); font-weight: 500; }

/* totals check */
.totals { border-top: 1px solid var(--line); padding: 14px 20px; font-size: 14px; }
.totals .t-head { margin: 0 0 4px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.totals.ok .t-head { color: var(--done); }
.totals.ok .t-head::before { content: ""; width: 14px; height: 8px; border: solid currentColor;
  border-width: 0 0 2px 2px; transform: rotate(-45deg) translateY(-2px); }
.totals.bad .t-head { color: var(--error); }
.totals ul { margin: 0; padding: 0; list-style: none; color: var(--slate); }
.totals li.miss { color: var(--error); }

/* errors */
.errs { border-top: 1px solid var(--line); }
.errs summary { padding: 14px 20px; cursor: pointer; color: var(--error); font-weight: 500; font-size: 14px; }
.errs table { width: 100%; border-collapse: collapse; font-size: 13px; }
.errs td { padding: 8px 20px; border-top: 1px solid var(--line); vertical-align: top; }
.errs td:first-child { width: 72px; color: var(--slate); white-space: nowrap; }
.errs td:last-child { word-break: break-word; }
.errs .scroll { max-height: 320px; overflow: auto; }

/* notice */
.notice { overflow-wrap: anywhere; margin-top: 16px; padding: 12px 16px; border-radius: var(--radius-sm);
  background: var(--error-soft); color: var(--error); font-size: 14px; }

/* ---------- recent ---------- */
.recent { list-style: none; margin: 0; padding: 0; }
.recent li { display: flex; align-items: center; gap: 14px; padding: 14px 20px; }
.recent li + li { border-top: 1px solid var(--line); }
.recent .r-main { flex: 1; min-width: 0; }
.recent .r-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent .r-meta { font-size: 13px; color: var(--slate); overflow-wrap: anywhere; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--faint); }
.dot.done { background: var(--done); } .dot.failed { background: var(--error); }
.dot.running, .dot.queued { background: var(--accent); }
.empty { padding: 22px 20px; color: var(--slate); font-size: 14px; }
.footnote { margin-top: 12px; color: var(--faint); font-size: 13px; }

/* ---------- login ---------- */
.devform { display: grid; gap: 6px; }
.devform label { font-size: 14px; font-weight: 500; margin-top: 8px; }
.devform input {
  font: inherit; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink);
}
.devform input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.devform .btn { margin-top: 16px; justify-content: center; padding: 11px 16px; font-size: 15px; }
.testnote { margin: 14px 0 0; font-size: 13px; color: var(--slate); }
.badge { font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-soft);
  padding: 2px 8px; border-radius: 999px; }
.h2row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 48px 0 12px; }
.h2row h2 { margin: 0; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { font: inherit; font-size: 13px; padding: 5px 12px; border: 0; background: var(--surface);
  color: var(--slate); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login { width: 100%; max-width: 380px; }
.login .brand { margin-bottom: 40px; }
.login h1 { font-size: 26px; }
.login .lede { margin-bottom: 28px; }
.ms-btn {
  width: 100%; justify-content: center; padding: 12px 16px; font-size: 15px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
}
.ms-btn:hover { border-color: var(--faint); }
.login .footnote { margin-top: 20px; }

@media (max-width: 560px) {
  .topbar { padding: 12px 16px; }
  .who .name { display: none; }
  main { padding: 32px 16px 60px; }
  h1 { font-size: 25px; }
  .filebar { flex-wrap: wrap; }
  .actions { width: 100%; }
  .actions .btn { flex: 1; justify-content: center; }
  .stat { padding: 14px; }
  .stat .v { font-size: 17px; }
  .result { flex-direction: column; align-items: stretch; }
}
