:root {
  --bg: #f4f4f2;
  --card: #ffffff;
  --text: #1a1a1a;
  --muted: #666;
  --line: #e2e2de;
  --accent: #111;
  --accent-text: #fff;
  --ok: #1d7a3e; --ok-bg: #eaf6ee;
  --warn: #8a5a00; --warn-bg: #fff6e0;
  --err: #b42318; --err-bg: #fdecea;
  --work-bg: #eef2f7;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161616; --card: #202020; --text: #eee; --muted: #a0a0a0; --line: #333;
    --accent: #f2f2f2; --accent-text: #111;
    --ok: #7fd49b; --ok-bg: #16301f; --warn: #f0c060; --warn-bg: #3a2e10; --err: #ff8a80; --err-bg: #3a1714; --work-bg: #1f2833;
    color-scheme: dark;
  }
  :root:not([data-theme="light"]) .logo { filter: invert(1); }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.top { display: flex; align-items: center; gap: 14px; padding: 16px 24px; border-bottom: 1px solid var(--line); background: var(--card); }
.logo { height: 30px; width: auto; }
.app-name { font-weight: 700; letter-spacing: -0.01em; border-left: 1px solid var(--line); padding-left: 14px; }
.tagline { color: var(--muted); font-size: 13px; margin-left: auto; }
main { max-width: 640px; margin: 28px auto; padding: 0 16px; display: grid; gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 20px 22px; }
h2 { font-size: 16px; margin: 0 0 12px; display: flex; align-items: center; gap: 10px; }
.step { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-text); font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
p { margin: 0 0 10px; }
.field { margin-bottom: 16px; }
label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; }
select, input[type=text] { width: 100%; padding: 10px 12px; font: inherit; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); }
select:focus, input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
#doc-desc { margin-top: 6px; }
.btn { font: inherit; font-weight: 600; padding: 10px 18px; border-radius: 8px; border: 1px solid var(--accent); background: var(--card); color: var(--text); cursor: pointer; }
.btn.primary { background: var(--accent); color: var(--accent-text); width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.link { font: inherit; background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; margin-left: 8px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); margin-right: 4px; }
.status { margin-top: 16px; padding: 12px 14px; border-radius: 8px; font-size: 14px; overflow-wrap: anywhere; }
.status ul { margin: 6px 0 0; padding-left: 20px; }
.status-title { font-weight: 600; }
.status.ok { background: var(--ok-bg); color: var(--ok); }
.status.warn { background: var(--warn-bg); color: var(--warn); }
.status.error { background: var(--err-bg); color: var(--err); }
.status.working { background: var(--work-bg); }
.status.working .status-title::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 8px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 480px) { .tagline { display: none; } .card { padding: 16px; } }
