:root {
  color-scheme: light;
  --background: #f7f7f8;
  --surface: #fff;
  --raised: #f4f4f5;
  --ink: #24262b;
  --secondary: #52565e;
  --muted: #6b7078;
  --blue: #275bd6;
  --alarm: #b13e30;
  --line: #e5e5e8;
  --sans: "Avenir Next", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "SFMono-Regular", Consolas, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--background); font: 14px/1.6 var(--sans); }
button, input { font: inherit; }
button, a, input, summary { -webkit-tap-highlight-color: transparent; }
button, a, input, summary { transition: color 140ms ease-out, background-color 140ms ease-out, border-color 140ms ease-out; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.topbar { height: 64px; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 0 max(32px, calc((100vw - 1376px) / 2)); background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-size: 18px; font-weight: 600; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; color: white; background: var(--ink); border-radius: 8px; font-size: 18px; font-weight: 500; }
.brand-context { margin-left: 4px; padding-left: 16px; border-left: 1px solid var(--line); font-size: 13px; font-weight: 400; color: var(--muted); }
.docs-link { color: var(--secondary); font-size: 12px; text-decoration: none; white-space: nowrap; }
.docs-link:hover { color: var(--blue); }
main { max-width: 1440px; margin: 0 auto; padding: 32px 32px 48px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.eyebrow { margin: 0 0 8px; color: var(--muted); font-weight: 400; font-size: 12px; }
h1 { margin: 0; font-size: 32px; line-height: 1.25; font-weight: 500; }
.intro { margin: 12px 0 0; color: var(--secondary); font-size: 14px; }
.poll-state { color: var(--muted); font-size: 12px; white-space: nowrap; }
.outcome-notice { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 24px; padding: 20px 24px; border: 1px solid #ecd3cf; border-left: 4px solid var(--alarm); border-radius: 12px; background: #fcf3f1; color: #963023; scroll-margin-top: 24px; }
.outcome-notice[data-kind="completed"] { border-color: #c8dfd2; border-left-color: #268263; background: #f0f7f3; color: #1a664a; }
.outcome-notice[data-kind="uncertain"] { border-color: #e6d8bb; border-left-color: #94651b; background: #fcf7ed; color: #82550d; }
.outcome-icon { display: grid; place-items: center; flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; color: #fff; background: var(--alarm); font-size: 18px; font-weight: 500; }
.outcome-notice[data-kind="completed"] .outcome-icon { background: #268263; }
.outcome-notice[data-kind="uncertain"] .outcome-icon { background: #94651b; }
.outcome-notice > div { min-width: 0; }
.outcome-notice h2 { font-size: 18px; }
.outcome-notice p { margin: 4px 0 0; font-size: 13px; overflow-wrap: anywhere; white-space: pre-wrap; }
.workspace { display: grid; grid-template-columns: 336px minmax(0, 1fr); gap: 24px; align-items: start; }
.panel { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.setup { padding: 24px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 24px; }
h2 { margin: 0; font-size: 16px; font-weight: 500; }
.section-note { color: var(--muted); font-size: 12px; white-space: nowrap; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 500; }
input:not([type="checkbox"]) { width: 100%; min-height: 44px; padding: 8px 12px; color: var(--ink); border: 1px solid #c9cbd0; border-radius: 8px; background: var(--surface); font: 13px/1.6 var(--mono); font-variant-numeric: tabular-nums; }
input::placeholder { color: var(--muted); opacity: 1; }
input:not([type="checkbox"]):hover:not(:disabled) { border-color: #969ba4; }
input:not([type="checkbox"]):focus { border-color: var(--blue); }
fieldset:disabled input { color: var(--muted); background: var(--raised); }
.field-help { margin: 8px 0 24px; font-size: 12px; color: var(--muted); line-height: 1.6; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 40px; padding: 8px 16px; border: 1px solid transparent; border-radius: 8px; font-weight: 500; font-size: 13px; }
.primary { color: #fff; background: var(--blue); }
.primary:hover:not(:disabled) { background: #1a49b8; }
.submit { width: 100%; justify-content: space-between; min-height: 44px; font-size: 14px; }
.submit span { font-size: 18px; line-height: 1; }
.secondary { color: var(--ink); background: var(--surface); border-color: #c9cbd0; }
.secondary:hover:not(:disabled) { background: var(--raised); }
.text-button { color: var(--blue); background: none; border: 0; padding: 4px 0; font-size: 12px; white-space: nowrap; }
.text-button:hover:not(:disabled) { text-decoration: underline; text-underline-offset: 4px; }
.alert-settings { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 20px; }
.check { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 4px; font-size: 12px; font-weight: 400; color: var(--secondary); }
.check input { flex-shrink: 0; width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--blue); }
.alert-settings .field-help { margin: 4px 0 0; }
.restore { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; }
.restore summary { color: var(--secondary); cursor: pointer; }
.restore summary:hover { color: var(--ink); }
.restore form { margin-top: 16px; }
.restore .button { margin-top: 12px; width: 100%; }
.setup-note { margin: 20px 0 0; font-size: 12px; line-height: 1.8; color: var(--muted); }
.form-error, .connection-error { padding: 12px; border-radius: 8px; background: #fcf3f1; color: #a72e20; overflow-wrap: anywhere; font-size: 13px; }
.form-error { margin-bottom: 16px; }
.monitor { padding: 24px; min-width: 0; overflow: hidden; }
.monitor-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.status-group { display: flex; gap: 12px; align-items: center; }
.status-dot { height: 8px; width: 8px; border-radius: 50%; flex: 0 0 auto; background: #8a9099; }
.status-dot[data-state="running"], .status-dot[data-state="queued"] { background: var(--blue); }
.status-dot[data-state="needs_manual_captcha"], .status-dot[data-state="failed"] { background: var(--alarm); }
.status-dot[data-state="completed"] { background: #268263; }
.elapsed { color: var(--secondary); font: 14px var(--mono); font-variant-numeric: tabular-nums; }
.task-meta { display: flex; align-items: center; gap: 12px; margin-top: 16px; font-size: 12px; color: var(--muted); }
.task-meta code { min-width: 0; overflow-wrap: anywhere; color: var(--secondary); font: 12px var(--mono); }
.task-meta button { margin-left: auto; }
.status-description { color: var(--secondary); font-size: 13px; margin: 8px 0 24px; }
.connection-error { margin-bottom: 16px; }
.captcha-alert { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; padding: 16px; border: 1px solid #ecd3cf; border-left: 4px solid var(--alarm); border-radius: 8px; background: #fcf3f1; color: #963023; }
.alarm-symbol { display: grid; place-items: center; flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; color: white; background: var(--alarm); font: 500 18px var(--mono); }
.captcha-alert strong { font-size: 14px; font-weight: 500; }
.captcha-alert p { margin: 4px 0 0; font-size: 12px; }
.acknowledge { margin-left: auto; flex-shrink: 0; color: #963023; border-color: #dcbeb8; background: #fff; }
.acknowledge:hover:not(:disabled) { background: #fcf3f1; }
.device-area { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; }
.device-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.device-title { font-size: 13px; font-weight: 500; }
.device-toolbar code { color: var(--muted); font: 12px var(--mono); overflow-wrap: anywhere; }
.device-toolbar button { margin-left: auto; }
.screen-placeholder { display: flex; align-items: center; justify-content: center; flex-direction: column; min-height: 320px; padding: 32px; text-align: center; background: #fafafa; }
.screen-placeholder strong { font-size: 15px; font-weight: 500; }
.screen-placeholder p { max-width: 320px; color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.device-outline { width: 48px; height: 72px; margin-bottom: 24px; display: flex; justify-content: center; align-items: center; gap: 4px; border: 1.5px solid #9da2ab; border-radius: 10px; position: relative; }
.device-outline span { position: absolute; top: 8px; width: 16px; height: 2px; border-radius: 2px; background: #9da2ab; }
.device-outline i { width: 4px; height: 4px; background: #9da2ab; border-radius: 50%; }
iframe { display: block; width: 100%; height: 680px; min-height: 480px; border: 0; background: #fafafa; }
.scrcpy-status { min-height: 36px; padding: 8px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.result { margin-top: 24px; padding: 16px; border-radius: 8px; background: #f0f7f3; }
h3 { margin: 0; font-size: 13px; font-weight: 500; }
.result[data-state="failed"] { background: #fcf3f1; color: #a72e20; }
.result pre { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.8 var(--mono); }
.activity { margin-top: 24px; }
.activity h3 { display: flex; justify-content: space-between; gap: 12px; }
.activity h3 span { font-size: 12px; color: var(--muted); font-weight: 400; }
.activity ol { margin: 16px 0 0; padding: 0; list-style: none; max-height: 216px; overflow: auto; }
.activity li { display: flex; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 13px; overflow-wrap: anywhere; }
.activity li > span { min-width: 0; }
.activity time { flex-shrink: 0; color: var(--muted); font: 12px/1.8 var(--mono); font-variant-numeric: tabular-nums; }
.activity-empty { color: var(--muted); }
body[data-manual="true"] .monitor { border-color: #d8aca5; }
@media (max-width: 1000px) {
  .workspace { grid-template-columns: 304px minmax(0, 1fr); gap: 16px; }
  .setup, .monitor { padding: 20px; }
  .captcha-alert { flex-wrap: wrap; }
  .acknowledge { margin-left: 40px; }
}
@media (max-width: 760px) {
  .topbar { height: 64px; padding: 0 16px; }
  .brand { gap: 8px; }
  .brand-context { margin-left: 0; padding-left: 8px; font-size: 12px; }
  main { padding: 24px 16px 32px; }
  .page-heading { align-items: start; flex-direction: column; gap: 16px; margin-bottom: 24px; }
  h1 { font-size: 28px; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .setup, .monitor { padding: 20px; }
  .section-heading { margin-bottom: 24px; }
  .field-help { margin-bottom: 20px; }
  input:not([type="checkbox"]) { font-size: 16px; }
  iframe { height: 672px; }
  .screen-placeholder { min-height: 256px; padding: 24px 16px; }
  .intro { line-height: 1.8; }
  .captcha-alert { padding: 12px; }
  .captcha-alert > div { min-width: 0; flex: 1; }
  .task-meta { flex-wrap: wrap; }
}
@media (max-width: 600px) {
  .captcha-alert { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: start; }
  .captcha-alert .acknowledge { grid-column: 2; justify-self: start; margin-left: 0; }
}
@media (max-width: 360px) {
  .brand-context { display: none; }
  .activity h3 { flex-wrap: wrap; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
