:root {
  --ink: #152038;
  --muted: #677189;
  --line: #dfe5ee;
  --surface: #ffffff;
  --background: #f3f6fa;
  --navy: #142647;
  --teal: #0b8f83;
  --teal-dark: #08766d;
  --green: #16835b;
  --blue: #2c67d7;
  --amber: #b96c10;
  --red: #bd3f4b;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--ink); font-family: Inter, "Segoe UI", system-ui, sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }
.topbar { height: 74px; padding: 0 clamp(24px, 5vw, 72px); display: flex; align-items: center; justify-content: space-between; background: var(--surface); border-bottom: 1px solid var(--line); }
.top-actions { display: flex; align-items: center; gap: 10px; }.top-actions form { margin: 0; }.logout, .text-button { padding: 8px 10px; border: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; }.logout:hover, .text-button:hover { color: var(--teal-dark); }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: white; font-weight: 800; background: linear-gradient(145deg, var(--teal), var(--navy)); }
.brand strong, .brand small { display: block; }
.brand small { margin-top: 1px; color: var(--muted); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.system-state { padding: 8px 12px; border: 1px solid #cfe7df; border-radius: 999px; color: #176b52; background: #eef9f5; font-size: 13px; font-weight: 650; }
.pulse { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: #25a46f; box-shadow: 0 0 0 4px #25a46f1c; }
.system-state.offline { color: #9b303c; border-color: #efc5ca; background: #fff1f2; }.system-state.offline .pulse { background: #bd3f4b; box-shadow: 0 0 0 4px #bd3f4b1c; }
main { max-width: 1500px; margin: auto; padding: 0 clamp(24px, 5vw, 72px) 64px; }
.hero { min-height: 320px; display: flex; align-items: center; justify-content: space-between; gap: 48px; }
.eyebrow { margin: 0 0 12px; color: var(--teal-dark); font-size: 11px; font-weight: 800; letter-spacing: .16em; }
h1 { margin: 0; color: var(--navy); font-family: Georgia, "Times New Roman", serif; font-size: clamp(38px, 5vw, 66px); line-height: 1.03; letter-spacing: -.035em; }
h1 span { color: var(--teal); }
.hero-copy { max-width: 650px; margin: 20px 0 0; color: var(--muted); font-size: 17px; line-height: 1.65; }
.hero-actions { min-width: 220px; display: grid; gap: 10px; }
.browser-mode-control { display: grid; gap: 6px; margin-bottom: 2px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.browser-mode-control select { width: 100%; height: 43px; padding: 0 34px 0 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--navy); background: white; font: 700 12px/1 inherit; text-transform: none; letter-spacing: 0; cursor: pointer; }
.browser-mode-control select:focus { outline: 3px solid #0b8f8317; border-color: var(--teal); }
.browser-mode-control input[type="date"] { width: 100%; height: 43px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--navy); background: white; font: 700 12px/1 inherit; cursor: pointer; }
.browser-mode-control input[type="date"]:focus { outline: 3px solid #0b8f8317; border-color: var(--teal); }
.button { min-height: 48px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent; font-weight: 700; }
.button span { float: right; }
.button.primary { background: var(--teal); color: white; }
.button.primary:hover { background: var(--teal-dark); }
.button.primary:disabled { opacity: .45; cursor: not-allowed; }
.button.secondary { background: white; border-color: var(--line); color: var(--ink); }
.summary-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--line); box-shadow: 0 8px 30px #1720330a; }
.summary-card { min-height: 132px; padding: 22px; background: white; }
.summary-card span, .summary-card small { display: block; color: var(--muted); font-size: 12px; }
.summary-card strong { display: block; margin: 7px 0 6px; color: var(--navy); font-size: 30px; }
.summary-card .blue { color: var(--blue); } .summary-card .amber { color: var(--amber); } .summary-card .green { color: var(--green); } .summary-card .red { color: var(--red); }
.workspace { margin-top: 54px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 30px; }
.search { width: min(320px, 42vw); height: 42px; display: flex; align-items: center; gap: 8px; padding: 0 12px; background: white; border: 1px solid var(--line); border-radius: 10px; }
.search span { color: var(--muted); font-size: 20px; }.search input { width: 100%; border: 0; outline: 0; background: transparent; }
.filter-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 22px 0; padding-bottom: 2px; }.filter-options { display: flex; gap: 8px; overflow-x: auto; }
.filter { white-space: nowrap; padding: 8px 12px; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 8px; font-size: 13px; font-weight: 650; }
.filter span { margin-left: 5px; }.filter.active { color: var(--teal-dark); background: #e7f5f2; border-color: #c5e7df; }
.select-no-input { flex: 0 0 auto; padding: 9px 12px; border: 1px solid #bcded7; border-radius: 8px; color: var(--teal-dark); background: white; font-size: 12px; font-weight: 750; }.select-no-input span { margin-right: 5px; }.select-no-input:hover { background: #eef9f6; }.select-no-input.selected { color: white; background: var(--teal); border-color: var(--teal); }
.psp-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.psp-group-heading { grid-column: 1 / -1; display: flex; align-items: end; justify-content: space-between; margin-top: 14px; padding: 0 2px 2px; }.psp-group-heading:first-child { margin-top: 0; }.psp-group-heading h3 { margin: 0 0 4px; color: var(--navy); font: 700 19px Georgia, "Times New Roman", serif; }.psp-group-heading p { margin: 0; color: var(--muted); font-size: 11px; }.psp-group-count { padding: 5px 9px; border-radius: 999px; color: var(--muted); background: #e8edf3; font-size: 10px; font-weight: 800; }
.psp-card { padding: 18px; background: white; border: 1px solid var(--line); border-radius: 13px; transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.psp-card:hover { transform: translateY(-2px); border-color: #bac8d8; box-shadow: 0 10px 24px #1720330d; }
.psp-card.has-history { cursor: pointer; }
.psp-card.has-history:focus-visible { outline: 3px solid #0b8f8333; outline-offset: 3px; border-color: var(--teal); }
.psp-card.has-history .card-actions, .psp-card.has-history .select-box { cursor: default; }
.card-top { min-height: 27px; display: flex; justify-content: space-between; align-items: start; }
.select-box input { position: absolute; opacity: 0; }.select-box span { width: 18px; height: 18px; display: block; border: 1.5px solid #b8c2d0; border-radius: 5px; }.select-box input:checked + span { background: var(--teal); border-color: var(--teal); box-shadow: inset 0 0 0 4px white; }
.status { padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }.status.ready { color: #187052; background: #e7f7f0; }
.status.idle, .status.completed { color: #187052; background: #e7f7f0; }.status.queued, .status.running, .status.cancelling { color: #265cae; background: #e9f0ff; }.status.awaiting_input { color: #985807; background: #fff2d9; }.status.failed, .status.partial, .status.interrupted { color: #a12f3b; background: #fdebed; }.status.cancelled { color: #626b7a; background: #edf0f4; }
.psp-identity { display: flex; align-items: center; gap: 12px; margin: 18px 0 20px; }.psp-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; color: white; background: var(--navy); font-weight: 800; }.psp-identity h3 { margin: 0 0 4px; font-size: 16px; }.psp-identity p { margin: 0; color: var(--muted); font-size: 12px; }
.challenge-tags { min-height: 21px; display: flex; gap: 5px; margin: -9px 0 8px; }.challenge-tags span { padding: 3px 6px; border: 1px solid #e4d7be; border-radius: 5px; color: #8a611e; background: #fffaf0; font-size: 9px; font-weight: 800; letter-spacing: .05em; }
.card-stats { display: grid; grid-template-columns: 1.35fr .8fr .9fr; gap: 8px; padding: 12px 0; border-top: 1px solid #edf0f4; }.card-stats span, .card-stats strong { display: block; }.card-stats span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }.card-stats strong { margin-top: 5px; font-size: 12px; }
.card-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; margin-top: 10px; }.run-button { width: 100%; height: 39px; padding: 0 12px; text-align: left; background: white; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); font-size: 12px; font-weight: 750; }.run-button span { float: right; color: var(--teal); }.run-button:hover { border-color: var(--teal); color: var(--teal-dark); }.clear-session-button { min-width: 108px; padding: 0 9px; border: 1px solid #ecd4d7; border-radius: 8px; color: #9b4650; background: #fffafa; font-size: 10px; font-weight: 750; }.clear-session-button:hover { border-color: #cf8f96; background: #fff3f4; }.clear-session-button.no-session { color: var(--muted); border-color: var(--line); background: #f7f8fa; }
.loading { grid-column: 1 / -1; padding: 64px; text-align: center; color: var(--muted); }
.history-section { margin-top: 58px; }
.history-list { margin-top: 20px; overflow: auto; background: white; border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 8px 30px #1720330a; }
.activity-grid { min-width: 980px; }
.activity-row { display: grid; grid-template-columns: minmax(180px, 1.35fr) repeat(var(--activity-days), minmax(44px, 1fr)); align-items: stretch; border-bottom: 1px solid #edf0f4; }
.activity-row:last-child { border-bottom: 0; }
.activity-head { position: sticky; top: 0; z-index: 2; background: #f8fafc; }
.activity-psp, .activity-day { display: flex; align-items: center; min-height: 45px; padding: 9px 12px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.activity-psp { position: sticky; left: 0; z-index: 1; gap: 9px; background: white; border-right: 1px solid #edf0f4; color: var(--ink); text-transform: none; letter-spacing: 0; }
.activity-head .activity-psp { z-index: 3; background: #f8fafc; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.activity-day { justify-content: center; border-right: 1px solid #edf0f4; white-space: nowrap; }
.activity-day:last-child { border-right: 0; }
.history-icon { flex: 0 0 34px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: white; background: var(--navy); font-size: 11px; font-weight: 800; }
.activity-psp strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.activity-cell { display: grid; place-items: center; min-height: 45px; padding: 0; border: 0; border-right: 1px solid #edf0f4; background: white; }
.activity-cell:last-child { border-right: 0; }
button.activity-cell:hover { background: #f8fafc; }
button.activity-cell:focus-visible { outline: 3px solid #0b8f8333; outline-offset: -3px; }
.activity-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px #bd3f4b1a; }
.activity-cell.ok .activity-dot { background: var(--green); box-shadow: 0 0 0 4px #16835b1a; }
.empty-history { padding: 38px; color: var(--muted); text-align: center; }
.toast { position: fixed; z-index: 9999; right: 22px; top: 22px; bottom: auto; max-width: 420px; padding: 13px 16px; border-radius: 10px; color: white; background: var(--navy); box-shadow: 0 12px 34px #15203866; opacity: 0; transform: translateY(-14px); pointer-events: none; transition: .18s ease; }.toast.show { opacity: 1; transform: translateY(0); }.toast.error { background: #9b303c; }
dialog { width: min(860px, calc(100vw - 28px)); max-height: calc(100vh - 28px); padding: 0; border: 0; border-radius: 16px; color: var(--ink); box-shadow: 0 30px 90px #0f1e3b55; }dialog::backdrop { background: #111c2f99; backdrop-filter: blur(3px); }.dialog-shell { padding: 26px; }.dialog-head { display: flex; align-items: start; justify-content: space-between; }.close-button { width: 36px; height: 36px; border: 0; border-radius: 9px; color: var(--muted); background: #f0f3f7; font-size: 24px; line-height: 1; }.job-banner { display: flex; align-items: center; gap: 10px; margin: 20px 0 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; }.job-banner p { margin: 0; color: var(--muted); font-size: 13px; }.result-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; overflow: hidden; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--line); }.result-strip div { padding: 12px 14px; background: white; }.result-strip span, .result-strip strong { display: block; }.result-strip span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .07em; }.result-strip strong { margin-top: 5px; font-size: 13px; }.input-panel { margin: 14px 0; padding: 15px; border: 1px solid #e4c886; border-radius: 10px; background: #fff8e8; }.input-panel > div p { margin: 4px 0 12px; color: #795c25; font-size: 12px; }.input-panel form { display: flex; gap: 8px; }.input-panel input { min-width: 0; flex: 1; padding: 0 12px; border: 1px solid #d7bd7d; border-radius: 8px; outline: 0; }.files-panel { margin: 14px 0; padding: 14px; border: 1px solid #cfe6df; border-radius: 10px; background: #f2faf7; }.files-panel h3, .log-head h3 { margin: 0; font-size: 13px; }.files-panel ul { margin: 10px 0 0; padding: 0; list-style: none; }.files-panel li { margin-top: 7px; }.files-panel li strong, .files-panel li small { display: block; }.files-panel li small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }.log-head { display: flex; justify-content: space-between; align-items: center; margin: 16px 0 7px; }.log-head span { color: var(--muted); font-size: 10px; }.job-log { height: 260px; margin: 0; overflow: auto; padding: 15px; border-radius: 10px; color: #d7e3f4; background: #111c2f; font: 11px/1.55 Consolas, monospace; white-space: pre-wrap; word-break: break-word; }.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }.button.danger { margin-right: auto; color: #a12f3b; border-color: #efc5ca; background: #fff5f6; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 20%, #d9f1ed 0, transparent 35%), var(--background); }.login-card { width: min(480px, 100%); padding: 40px; border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: 0 24px 70px #1520381a; }.login-card .brand-mark { margin-bottom: 28px; }.login-card h1 { font-size: 45px; }.login-card > p:not(.eyebrow) { margin: 18px 0 26px; color: var(--muted); line-height: 1.55; }.login-card label { display: grid; gap: 7px; color: var(--ink); font-size: 12px; font-weight: 700; }.login-card input { height: 46px; padding: 0 12px; border: 1px solid #bdc7d5; border-radius: 9px; outline: 0; }.login-card input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px #0b8f8317; }.login-card form .button { width: 100%; margin-top: 10px; text-align: left; }.login-card > small { display: block; margin-top: 22px; color: var(--muted); line-height: 1.5; }.login-error { margin-bottom: 14px; padding: 10px; border-radius: 8px; color: #9b303c; background: #fdebed; font-size: 12px; }
.result-strip { grid-template-columns: repeat(5, 1fr); }
.skipped-panel { margin: 14px 0; padding: 14px; border: 1px solid #ead9ad; border-radius: 10px; background: #fff9ea; }
.skipped-panel h3 { margin: 0; font-size: 13px; }.skipped-panel ul { margin: 9px 0 0; padding-left: 18px; color: #75591c; font-size: 12px; }.skipped-panel li + li { margin-top: 5px; }
.captcha-image { display: block; width: auto; max-width: min(100%, 520px); max-height: 180px; margin: 0 0 12px; padding: 8px; border: 1px solid #d7bd7d; border-radius: 8px; background: white; image-rendering: auto; }.captcha-image[hidden] { display: none; }
.remote-browser-panel { margin: 14px 0; padding: 15px; border: 1px solid #9bd8cf; border-radius: 10px; background: #f0fbf9; }.remote-browser-panel[hidden] { display: none; }.remote-browser-panel.collapsed { padding-bottom: 11px; }.remote-browser-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }.remote-browser-panel.collapsed .remote-browser-head { margin-bottom: 0; }.remote-browser-head p { margin: 3px 0 0; color: #396b65; font-size: 12px; }.remote-browser-actions { display: flex; gap: 8px; }.remote-browser-stage[hidden] { display: none; }.remote-browser-stage { overflow: hidden; border: 1px solid #9bb7b2; border-radius: 9px; background: #0c1724; }.remote-browser-stage img { display: block; width: 100%; height: auto; cursor: default; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }.remote-browser-stage img.interactive { cursor: crosshair; }.remote-browser-stage img.drag { cursor: grab; touch-action: none; }.remote-browser-stage img.dragging { cursor: grabbing; }.remote-drag-active, .remote-drag-active * { user-select: none !important; -webkit-user-select: none !important; }
.remote-browser-stage { position: relative; }.remote-browser-stage img.drag { cursor: crosshair; }.remote-browser-drag-marker, #remote-browser-drag-marker { position: absolute; z-index: 2; width: 18px; height: 18px; border: 3px solid #ff3b30; border-radius: 50%; background: #fff8; box-shadow: 0 0 0 2px #ffffff, 0 2px 8px #0008; transform: translate(-50%, -50%); pointer-events: none; }
@media (max-width: 1050px) { .summary-grid { grid-template-columns: repeat(3, 1fr); }.psp-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .hero { min-height: auto; padding: 56px 0 40px; align-items: stretch; flex-direction: column; gap: 28px; }.hero-actions { min-width: 0; }.summary-grid { grid-template-columns: repeat(2, 1fr); }.psp-grid { grid-template-columns: repeat(2, 1fr); }.section-heading { align-items: stretch; flex-direction: column; }.search { width: 100%; }.system-state { font-size: 0; }.system-state .pulse { margin: 0; }.filter-row { align-items: stretch; flex-direction: column; }.select-no-input { align-self: flex-start; }.activity-grid { min-width: 860px; }.activity-row { grid-template-columns: 160px repeat(var(--activity-days), 44px); }.input-panel form { flex-direction: column; }.input-panel input { min-height: 44px; }.remote-browser-head { align-items: stretch; flex-direction: column; }.remote-browser-head .button { width: 100%; } }
@media (max-width: 760px) { .result-strip { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { main, .topbar { padding-left: 16px; padding-right: 16px; }.summary-grid, .psp-grid { grid-template-columns: 1fr; }.summary-card { min-height: 105px; }.psp-grid { gap: 10px; } }
