:root {
  --bg: #f6f5fb;
  --surface: #ffffff;
  --ink: #15142b;
  --muted: #66657d;
  --line: #e4e2f0;
  --brand: #6d28d9;
  --brand-2: #8b5cf6;
  --brand-soft: #f1ebff;
  --ok: #059669;
  --err: #b42318;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(28, 18, 74, 0.08);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #090b1f;
    --surface: #12142e;
    --ink: #eeedfb;
    --muted: #a6a4c4;
    --line: #26294a;
    --brand-soft: #231b46;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
a { color: var(--brand); }
.top {
  display: flex; align-items: center; gap: 16px; justify-content: space-between;
  padding: 14px 24px; border-bottom: 1px solid var(--line); background: var(--surface);
  position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; }
.brand img { width: 28px; height: 28px; border-radius: 8px; }
.back { text-decoration: none; font-weight: 600; font-size: 14px; }
.user { font-size: 13px; color: var(--muted); text-align: right; }
.user a { font-weight: 600; }
.wrap { max-width: 860px; margin: 0 auto; padding: 32px 20px 48px; }
.hero { text-align: center; margin-bottom: 24px; }
.badge {
  display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--brand-soft);
  color: var(--brand); font-weight: 700; font-size: 12px; letter-spacing: .02em;
}
.hero h1 { font-size: clamp(26px, 4vw, 38px); line-height: 1.15; margin: 14px 0 10px; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--brand), #d946ef); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); max-width: 640px; margin: 0 auto; }
.facts { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 0; margin: 18px 0 0; }
.facts li { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 13px; color: var(--muted); }
.facts b { color: var(--ink); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin-top: 18px; }
.tabs { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 18px; }
.tab { border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; padding: 8px 18px; border-radius: 9px; cursor: pointer; }
.tab.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.drop {
  display: block; position: relative; border: 2px dashed var(--line); border-radius: 14px; padding: 28px 16px;
  text-align: center; cursor: pointer; transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--brand-2); background: var(--brand-soft); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-icon { font-size: 26px; color: var(--brand); }
.drop-title { font-weight: 600; margin-top: 6px; word-break: break-word; }
.drop-hint { color: var(--muted); font-size: 13px; margin-top: 4px; }
.drop.has-file { border-style: solid; border-color: var(--brand-2); }
.field { display: block; margin-top: 16px; }
.field > span { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field i { font-style: normal; color: var(--muted); font-weight: 400; }
.field input[type=text], .field textarea, .field select {
  width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; outline: none;
}
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px var(--brand-soft); }
.note { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.options { display: grid; grid-template-columns: 1fr 170px; gap: 0 18px; align-items: end; margin-top: 6px; }
.options .switch { grid-column: 1 / -1; }
.themes { display: flex; gap: 8px; flex-wrap: wrap; }
.theme {
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  font: inherit; font-size: 14px; padding: 8px 12px; border-radius: 10px; cursor: pointer;
}
.theme i { width: 34px; height: 16px; border-radius: 4px; background: linear-gradient(90deg, var(--a) 0 50%, var(--b) 50% 80%, var(--c) 80%); }
.theme.active { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.switch { display: flex; align-items: center; gap: 10px; margin-top: 16px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.slider { width: 40px; height: 22px; border-radius: 999px; background: var(--line); position: relative; transition: background .15s; flex: none; }
.slider::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + .slider { background: var(--brand); }
.switch input:checked + .slider::after { transform: translateX(18px); }
.switch-text { font-size: 14px; }
.primary {
  display: inline-flex; justify-content: center; align-items: center; gap: 8px; width: 100%; margin-top: 22px;
  border: 0; border-radius: 12px; padding: 14px 18px; font: inherit; font-weight: 700; font-size: 16px; color: #fff;
  background: linear-gradient(90deg, var(--brand), #9333ea); cursor: pointer; text-decoration: none;
}
.primary:disabled { opacity: .55; cursor: not-allowed; }
.secondary {
  display: inline-flex; justify-content: center; align-items: center; border: 1px solid var(--brand); color: var(--brand);
  background: transparent; border-radius: 12px; padding: 12px 16px; font: inherit; font-weight: 600; cursor: pointer; width: 100%;
}
.limit-note { color: var(--muted); font-size: 12.5px; text-align: center; margin: 10px 0 0; }
.progress, .result, .error { text-align: center; }
.spinner { width: 44px; height: 44px; margin: 4px auto 10px; border-radius: 50%; border: 4px solid var(--brand-soft); border-top-color: var(--brand); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.steps { text-align: left; max-width: 480px; margin: 14px auto 6px; padding-left: 22px; color: var(--muted); }
.steps li { margin: 6px 0; }
.steps li.active { color: var(--ink); font-weight: 600; }
.steps li.done { color: var(--ok); }
.elapsed { color: var(--muted); font-size: 13px; }
.ok-icon { width: 54px; height: 54px; margin: 0 auto 6px; border-radius: 50%; background: #d1fae5; color: var(--ok); font-size: 28px; line-height: 54px; font-weight: 700; }
.stats { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.stats li { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px; font-size: 14px; }
.actions { display: grid; gap: 10px; margin-top: 18px; }
.actions .primary { margin-top: 0; }
.office-msg { color: var(--muted); font-size: 13px; min-height: 1em; }
.link { border: 0; background: none; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; margin-top: 10px; }
.error h2 { color: var(--err); }
.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 0 16px 28px; }
@media (max-width: 640px) {
  .top { padding: 12px 16px; }
  .wrap { padding: 20px 16px 40px; }
  .card { padding: 18px; }
  .options { grid-template-columns: 1fr; }
  .user { display: none; }
}
/* compact layout inside the Office task pane */
body.addin .hero h1 { font-size: 22px; }
body.addin .hero p, body.addin .facts { display: none; }
body.addin .wrap { padding: 14px 12px 30px; }
body.addin .card { padding: 16px; }
body.addin .options { grid-template-columns: 1fr; }
body.addin .user, body.addin .brand span { display: none; }
body.addin .foot { display: none; }
