:root {
  color-scheme: dark;
  --bg: #10120f;
  --surface: #191c18;
  --surface-raised: #20241e;
  --line: #30362d;
  --ink: #f1f3eb;
  --muted: #92998d;
  --lime: #d8ff62;
  --lime-ink: #15180e;
  --lime-dim: #8eaa41;
  --blue: #9ab7ff;
  --red: #ff8b7c;
  --green: #a9e28a;
  --amber: #f3c86b;
  --mono: 'Cascadia Code', 'SFMono-Regular', Consolas, monospace;
  --sans: 'Segoe UI', 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background-color: var(--bg);
  background-image: radial-gradient(#ffffff09 .7px, transparent .7px), radial-gradient(ellipse at 77% 2%, #d8ff620b, transparent 39%);
  background-size: 6px 6px, auto;
  font-family: var(--sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  padding: 10px 15px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
  transition: background .16s, color .16s, border-color .16s, transform .16s;
}
button:hover, .button:hover { transform: translateY(-1px); }
button:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.primary { color: var(--lime-ink); background: var(--lime); }
.primary:hover { background: #e4ff91; }
.secondary { color: var(--ink); border-color: #444a40; background: #292d27; }
.secondary:hover { border-color: var(--lime-dim); background: #30372a; }
.quiet { color: #a8afa2; border-color: transparent; background: transparent; }
.quiet:hover { color: var(--ink); background: #ffffff0a; }
.danger-text { color: var(--red); }
input[type=text], input[type=url], input[type=password], input[type=file] {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  color: var(--ink);
  background: #111410;
}
input:focus { border-color: var(--lime-dim); box-shadow: 0 0 0 3px #d8ff621b; }
input::placeholder { color: #697164; }
.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(28px, calc((100% - 1120px) / 2));
  border-bottom: 1px solid #ffffff10;
  background: #10120fe8;
  backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand-mark { position: relative; display: grid; place-items: center; width: 35px; height: 35px; overflow: hidden; border-radius: 10px; color: var(--lime-ink); background: var(--lime); font-size: 21px; font-weight: 800; line-height: 1; }
.brand-mark span { position: relative; z-index: 1; transform: skew(-8deg); }
.brand-mark i { position: absolute; right: 4px; bottom: 4px; width: 8px; height: 8px; border: 2px solid var(--lime-ink); border-radius: 50%; }
.brand-name { font-size: 14px; font-weight: 800; letter-spacing: -.04em; }
.brand-name span { margin-left: 4px; color: #939b8e; font-weight: 500; }
.topbar-right { display: flex; align-items: center; gap: 24px; }
.topbar form { margin: 0; }
.topbar form button { min-height: 36px; padding: 6px 8px; font-size: 12px; }
.instance-badge, .live-indicator { display: inline-flex; align-items: center; gap: 8px; color: #8c9487; font: 10px var(--mono); letter-spacing: .04em; }
.instance-badge i, .live-indicator i { width: 6px; height: 6px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px #d8ff6280; }
.layout { width: min(100% - 48px, 1000px); margin: 0 auto; padding: 65px 0 38px; }
.hero { display: flex; align-items: center; justify-content: space-between; min-height: 250px; margin-bottom: 32px; }
.eyebrow, .panel-kicker { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; color: #929b86; font: 10px var(--mono); letter-spacing: .12em; }
.eyebrow-line { display: inline-block; width: 20px; height: 1px; background: var(--lime); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 14px; font-size: clamp(44px, 6vw, 67px); line-height: 1.09; letter-spacing: -.075em; font-weight: 800; }
h1 span { color: var(--lime); }
.hero-subtitle { margin: 0; color: #92998d; font-size: 14px; }
.hero-stamp { position: relative; display: grid; place-items: center; width: 178px; height: 178px; margin-right: 24px; border: 1px solid #d8ff6233; border-radius: 50%; color: var(--lime); transform: rotate(-11deg); }
.hero-stamp::before, .hero-stamp::after { position: absolute; content: ''; border: 1px solid #d8ff621c; border-radius: 50%; }
.hero-stamp::before { inset: 10px; }
.hero-stamp::after { inset: 22px; }
.hero-stamp > span { margin-top: -20px; font: 800 43px var(--sans); letter-spacing: -.1em; }
.hero-stamp i { position: absolute; z-index: 1; top: 39px; right: 42px; width: 10px; height: 10px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 16px #d8ff62a8; }
.hero-stamp small { position: absolute; bottom: 41px; color: #8a9674; font: 8px/1.5 var(--mono); letter-spacing: .08em; text-align: center; }
.panel { border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(135deg, #1c201a, #171a16); box-shadow: 0 14px 45px #0002; }
.add-panel { position: relative; margin-bottom: 56px; padding: 23px 25px 17px; overflow: hidden; }
.add-panel::before { position: absolute; top: 0; right: 0; width: 130px; height: 1px; content: ''; background: var(--lime); box-shadow: 0 0 14px var(--lime); }
.panel-kicker { margin-bottom: 17px; }
.step-index { display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid #5b654b; border-radius: 6px; color: var(--lime); font: 10px var(--mono); letter-spacing: 0; }
.download-form { display: flex; align-items: center; gap: 12px; }
.url-glyph { color: var(--lime); font: 25px var(--mono); transform: rotate(-45deg); }
.download-form input { flex: 1; height: 51px; padding: 0 15px; border-color: #353b31; background: #111410; font-size: 14px; }
.download-form .primary { height: 51px; padding: 0 18px; }
.download-form .primary b { font-size: 18px; }
.form-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 13px 0 0 40px; }
.form-foot p { margin: 0; color: #777f73; font-size: 11px; }
.privacy-note { display: flex; align-items: center; gap: 7px; color: #9caa8b; font-size: 10px; }
.privacy-note i { width: 6px; height: 6px; border-radius: 50%; background: #97c763; }
.form-message { min-height: 0; margin-top: 7px; color: var(--red); font-size: 12px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 0 2px 17px; }
.section-title .eyebrow { margin-bottom: 7px; }
h2 { margin-bottom: 0; font-size: 23px; font-weight: 700; letter-spacing: -.055em; }
.section-title h2 span { color: var(--lime-dim); font-weight: 400; }
.heading-actions { display: flex; align-items: center; gap: 6px; }
.live-indicator { margin-right: 12px; font-size: 9px; }
.small-button { min-height: 34px; padding: 7px 10px; border-radius: 7px; font-size: 11px; }
.jobs-list { display: grid; gap: 8px; }
.job-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 18px; border: 1px solid #2d322b; border-radius: 10px; background: #171a16ed; transition: border-color .2s, background .2s; }
.job-card:hover { border-color: #515c42; background: #1c201a; }
.job-main { flex: 1; min-width: 0; }
.job-topline { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; }
.status { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #41463d; border-radius: 5px; padding: 3px 7px; color: #bac0b3; background: #252922; font-size: 10px; font-weight: 700; }
.status::before { width: 5px; height: 5px; border-radius: 50%; content: ''; background: currentColor; }
.status-running, .status-queued { color: var(--blue); border-color: #506184; background: #202735; }
.status-succeeded { color: var(--green); border-color: #496341; background: #20271d; }
.status-needs_auth { color: var(--amber); border-color: #67552f; background: #2a2519; }
.status-failed, .status-cancelled { color: var(--red); border-color: #6a3933; background: #2a1f1d; }
.job-date { color: #71786e; font: 10px var(--mono); }
.job-url { max-width: 690px; overflow: hidden; color: #c3c8bc; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.progress { height: 3px; margin-top: 12px; overflow: hidden; border-radius: 9px; background: #343a30; }
.progress span { display: block; height: 100%; border-radius: inherit; background: var(--lime); box-shadow: 0 0 9px #d8ff62a0; transition: width .3s; }
.progress-label { margin-top: 5px; color: #8e987e; font: 9px var(--mono); text-align: right; }
.job-error { margin-top: 8px; color: #e49488; font-size: 11px; line-height: 1.5; white-space: pre-wrap; }
.job-actions { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.empty-state { padding: 49px 20px; border: 1px dashed #3a4035; border-radius: 10px; color: var(--muted); background: #171a167a; text-align: center; }
.empty-state h3 { margin: 13px 0 5px; color: var(--ink); font-size: 14px; }
.empty-state p { margin: 0; font-size: 12px; }
.empty-icon { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto; border: 1px solid #606e45; border-radius: 12px; color: var(--lime); background: #242b1c; font: 22px var(--mono); }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 48px; }
.updater-panel { grid-column: 1 / -1; }
.engine-version { color: var(--muted); font-size: 12px; }
.engine-version strong { margin-left: 10px; color: var(--ink); font-family: var(--mono); overflow-wrap: anywhere; }
.updater-form > label { display: block; margin-bottom: 7px; color: #b4baac; font-size: 10px; font-weight: 700; }
.updater-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.updater-actions select { max-width: 100%; min-height: 42px; padding: 8px 12px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.updater-actions select:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.settings-panel { min-width: 0; padding: 21px; }
.settings-panel .panel-kicker { min-height: 22px; margin-bottom: 17px; }
.settings-panel h2 { margin-bottom: 8px; font-size: 18px; }
.settings-copy { min-height: 39px; margin-bottom: 17px; color: #8f9789; font-size: 11px; line-height: 1.7; }
.path-form > label { display: block; margin-bottom: 7px; color: #b4baac; font-size: 10px; font-weight: 700; }
.path-input-row { display: flex; align-items: center; gap: 0; }
.path-prefix { display: grid; align-items: center; align-self: stretch; padding: 0 10px; border: 1px solid #343a30; border-right: 0; border-radius: 7px 0 0 7px; color: var(--lime-dim); background: #111410; font: 10px var(--mono); }
.path-input-row input { flex: 1; height: 40px; padding: 0 10px; border-radius: 0; font: 11px var(--mono); }
.path-input-row button { min-height: 40px; padding: 7px 10px; border-radius: 0 7px 7px 0; font-size: 10px; white-space: nowrap; }
.path-result { overflow-wrap: anywhere; margin: 11px 0 0; color: #778071; font-size: 9px; line-height: 1.7; }
.path-result code { color: #b5c19f; font: 9px var(--mono); }
.status-pill { margin-left: auto; padding: 4px 8px; border: 1px solid #40463b; border-radius: 99px; color: #899184; background: #242820; font: 9px var(--mono); letter-spacing: 0; }
.status-pill.configured { border-color: #52653e; color: var(--green); background: #222b1b; }
.cookie-panel .panel-kicker { gap: 9px; }
.cookie-form { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.file-picker { display: flex; flex: 1 1 100%; align-items: center; gap: 10px; min-width: 0; color: #a4ac9b; font-size: 10px; }
.file-picker input { flex: 1; width: 100%; padding: 5px; color: #7c8577; font-size: 9px; }
.file-picker input::file-selector-button { margin-right: 8px; padding: 5px 8px; border: 0; border-radius: 5px; color: #cbd1c1; background: #30352d; cursor: pointer; font-size: 9px; }
.cookie-form button { min-height: 34px; padding: 7px 10px; font-size: 10px; }
.footer-note { display: flex; justify-content: space-between; gap: 12px; padding: 22px 3px 0; color: #656d61; font: 9px var(--mono); letter-spacing: .02em; }
.footer-note b { color: var(--lime-dim); }
.login-page { display: grid; place-items: center; min-height: 100vh; padding: 24px; background: radial-gradient(ellipse at 50% 15%, #d8ff6210, transparent 45%), var(--bg); }
.login-card { width: min(100%, 390px); padding: 34px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: 0 30px 90px #0006; }
.login-card .brand-mark { margin-bottom: 24px; }
.login-card h1 { margin-bottom: 10px; font-size: 27px; letter-spacing: -.06em; }
.login-card .muted { margin-bottom: 23px; color: var(--muted); font-size: 12px; }
.stack { display: grid; gap: 10px; }
.stack label { color: #b3baac; font-size: 11px; font-weight: 700; }
.stack input { width: 100%; height: 44px; padding: 0 12px; }
.stack button { margin-top: 6px; }
.alert { padding: 10px 12px; border-radius: 8px; font-size: 12px; }
.alert.error { margin-bottom: 14px; color: var(--red); background: #39231f; }
.modal[hidden] { display: none; }
.modal { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: #080a08d9; backdrop-filter: blur(5px); }
.modal-card { position: relative; display: flex; flex-direction: column; width: min(100%, 1060px); height: min(92vh, 810px); overflow: hidden; border: 1px solid #3a4133; border-radius: 13px; background: var(--surface); box-shadow: 0 28px 90px #0009; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 19px 22px 0; }
.modal-header .eyebrow { margin-bottom: 7px; }
.modal-header h2 { font-size: 20px; }
.icon-button { width: 36px; min-height: 36px; padding: 0; color: #b7beaf; border-color: #3b4137; background: #252a23; font-size: 22px; }
.modal-copy { margin: 10px 22px 12px; color: var(--muted); font-size: 11px; }
#browser-frame { flex: 1; width: calc(100% - 28px); min-height: 220px; margin: 0 14px; border: 1px solid #3a4036; border-radius: 8px; background: #171a16; }
.modal-card .form-message { margin: 5px 22px 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 22px 17px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; clip-path: inset(50%); }
@media (max-width: 760px) {
  .topbar { height: 62px; padding: 0 18px; }
  .instance-badge { display: none; }
  .layout { width: min(100% - 34px, 560px); padding-top: 45px; }
  .hero { min-height: 205px; margin-bottom: 24px; }
  .hero-stamp { width: 116px; height: 116px; margin-right: 0; }
  .hero-stamp > span { margin-top: -14px; font-size: 31px; }
  .hero-stamp small { bottom: 25px; font-size: 6px; }
  .hero-stamp i { top: 26px; right: 28px; width: 7px; height: 7px; }
  .add-panel { margin-bottom: 43px; padding: 19px 16px 14px; }
  .form-foot { align-items: flex-start; flex-direction: column; margin-left: 0; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .heading-actions { width: 100%; flex-wrap: wrap; }
  .live-indicator { margin-right: auto; }
  .job-card { align-items: flex-start; flex-direction: column; }
  .job-actions { width: 100%; justify-content: flex-end; }
  .settings-grid { grid-template-columns: 1fr; margin-top: 38px; }
  .settings-copy { min-height: auto; }
  .footer-note { flex-direction: column; }
  .modal { padding: 8px; }
  .modal-card { height: 96vh; }
}
@media (max-width: 430px) {
  .layout { width: calc(100% - 28px); padding-top: 34px; }
  .hero { min-height: 180px; }
  .hero-stamp { width: 84px; height: 84px; }
  .hero-stamp > span { margin-top: -8px; font-size: 24px; }
  .hero-stamp small { bottom: 16px; font-size: 5px; }
  .hero-stamp i { top: 18px; right: 20px; width: 6px; height: 6px; }
  .eyebrow { font-size: 8px; }
  h1 { font-size: 42px; }
  .download-form { display: grid; grid-template-columns: 20px minmax(0,1fr); gap: 8px; }
  .download-form input { width: 100%; height: 46px; }
  .download-form .primary { grid-column: 1 / -1; height: 43px; }
  .url-glyph { grid-column: 1; grid-row: 1; }
  .path-input-row { flex-wrap: wrap; }
  .path-prefix { height: 39px; }
  .path-input-row input { width: 0; flex: 1; }
  .path-input-row button { flex: 1 0 100%; margin-top: 7px; border-radius: 7px; }
  .file-picker { align-items: flex-start; flex-direction: column; }
}
