* { margin: 0; padding: 0; box-sizing: border-box; }
:root { --paper: #faf9f6; --ink: #1c1a17; --muted: #8a857c; --line: #e5e2db; --card: #fff;
        --accent: #35516b; --ok: #3d7a4f; --warn: #b8543c; --soft: #f1efe9; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--paper);
       color: var(--ink); -webkit-font-smoothing: antialiased; min-height: 100vh; font-size: 14px; }
a { color: var(--accent); }
.mark { font-family: Georgia, "Times New Roman", serif; font-size: 2rem; letter-spacing: 0.01em; }
body.landing { display: flex; align-items: center; justify-content: center; }
body.landing .box { text-align: center; padding: 2rem; max-width: 22rem; width: 100%; }
body.landing .sub { color: var(--muted); margin: 0.4rem 0 2rem; }
.signin { display: inline-flex; align-items: center; gap: 0.6rem; padding: 0.7rem 1.4rem; border: 1px solid var(--line);
          border-radius: 8px; background: var(--card); text-decoration: none; color: var(--ink); font-size: 0.95rem;
          box-shadow: 0 1px 2px rgba(28,26,23,0.05); }
.err { margin-top: 1.4rem; font-size: 0.83rem; color: var(--warn); }

.wrap { max-width: 78rem; margin: 0 auto; padding: 1.6rem 1.25rem 3rem; }
header { display: flex; align-items: baseline; gap: 0.9rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
header .mark { font-size: 1.5rem; }
header .tag { color: var(--muted); }
header .who { margin-left: auto; font-size: 0.82rem; color: var(--muted); }
header .who a { color: var(--muted); text-decoration: none; margin-left: 0.8rem; }
nav.tabs { display: flex; gap: 0.2rem; border-bottom: 1px solid var(--line); margin-bottom: 1.2rem; }
nav.tabs button { background: none; border: none; padding: 0.55rem 0.9rem; font-size: 0.9rem; color: var(--muted);
                  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
nav.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
section { display: none; } section.on { display: block; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.1rem;
        box-shadow: 0 1px 2px rgba(28,26,23,0.04); margin-bottom: 1.1rem; }
.card h2 { font-size: 0.95rem; margin-bottom: 0.6rem; }
.card p.hint { color: var(--muted); font-size: 0.82rem; line-height: 1.45; margin-bottom: 0.6rem; }
form.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0.6rem 0.9rem; align-items: end; }
label { display: block; font-size: 0.74rem; color: var(--muted); margin-bottom: 0.2rem; text-transform: uppercase; letter-spacing: 0.05em; }
input[type=text], input[type=password], input[type=number], textarea, select {
  width: 100%; padding: 0.5rem 0.6rem; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: #fff; }
textarea { min-height: 4.2rem; font-family: ui-monospace, Menlo, monospace; font-size: 0.82rem; }
button.btn { padding: 0.5rem 0.9rem; border: 1px solid var(--line); border-radius: 6px; background: var(--soft);
             font: inherit; cursor: pointer; color: var(--ink); }
button.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
button.btn.small { padding: 0.25rem 0.55rem; font-size: 0.78rem; }
button.btn.danger { color: var(--warn); }
button:disabled { opacity: 0.5; cursor: default; }
table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
th { text-align: left; font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted);
     padding: 0.5rem 0.5rem; border-bottom: 1px solid var(--line); }
td { padding: 0.55rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: none; }
td.mono, .mono { font-family: ui-monospace, Menlo, monospace; font-size: 0.8rem; }
.pill { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.72rem; background: var(--soft); color: var(--muted); }
.pill.running { background: #e3ecf5; color: var(--accent); }
.pill.done, .pill.ok { background: #e4f0e7; color: var(--ok); }
.pill.paused, .pill.needs_code, .pill.needs_captcha, .pill.queued, .pill.logging_in { background: #fbeee6; color: #9a4a2e; }
.pill.failed, .pill.locked, .pill.bad_password, .pill.error, .pill.cancelled { background: #f7e1dd; color: var(--warn); }
.muted { color: var(--muted); }
.small { font-size: 0.78rem; }
.actions { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.msg { margin-top: 0.5rem; font-size: 0.82rem; color: var(--accent); min-height: 1.1rem; }
.msg.bad { color: var(--warn); }
.codebox { display: flex; gap: 0.4rem; margin-top: 0.3rem; }
.codebox input { width: 9rem; }
.sys { font-size: 0.78rem; color: var(--muted); margin-top: 0.4rem; }
.sys b { color: var(--ink); font-weight: 600; }
ul.events { list-style: none; font-size: 0.82rem; }
ul.events li { padding: 0.35rem 0; border-bottom: 1px solid var(--line); display: flex; gap: 0.7rem; }
ul.events li .t { color: var(--muted); font-family: ui-monospace, Menlo, monospace; font-size: 0.74rem; white-space: nowrap; }
ul.events li.warn { color: #9a4a2e; }
.shot { max-width: 100%; border: 1px solid var(--line); border-radius: 6px; margin-top: 0.4rem; }
details summary { cursor: pointer; color: var(--accent); font-size: 0.8rem; }
@media (max-width: 800px) { th:nth-child(n+5), td:nth-child(n+5) { display: none; } .tbl-scroll { overflow-x: auto; } }
