:root {
  color-scheme: light;
  --bg: #f4f6f8; --surface: #fff; --ink: #172b36; --muted: #637681;
  --line: #e0e7eb; --input-border: #cbd6dc; --placeholder: #8998a1; --focus: #8ec9b6;
  --green: #127b62; --green-dark: #09624d; --green-light: #eaf6f0;
  --primary-bg: #127b62; --primary-hover: #09624d; --on-primary: #fff;
  --red: #b03b37; --amber: #a56808; --neutral-bg: #edf1f4;
  --button-hover: #f1f5f5; --warning-bg: #fff3dc; --error-bg: #fbece9;
  --danger-bg: #fffafa; --danger-border: #eccac4;
  --notice-border: #c1dfd4; --notice-error-bg: #fff0ec;
  --notice-error-border: #efc9c1; --notice-error-ink: #933832;
  --shadow: #182d3703; --backdrop: #13242fa6;
  --log-bg: #142731; --log-ink: #d1dfe4; --log-border: #1c333d; --log-scrollbar: #58727e;
  --log-warning: #e8c380; --log-error: #ffaaa0; --log-muted: #91abb7;
  --radius: 14px; font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink); background: var(--bg);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d151c; --surface: #16232d; --ink: #e6edf2; --muted: #9fb2bf;
  --line: #334855; --input-border: #47606e; --placeholder: #8ea3b0; --focus: #7ad4b6;
  --green: #72daba; --green-dark: #a1e6cf; --green-light: #173c32;
  --red: #ffada4; --amber: #f1c879; --neutral-bg: #263844;
  --button-hover: #233844; --warning-bg: #3c3020; --error-bg: #402723;
  --danger-bg: #302223; --danger-border: #805049;
  --notice-border: #376854; --notice-error-bg: #352323;
  --notice-error-border: #865047; --notice-error-ink: #ffb7ac;
  --shadow: #0004; --backdrop: #070e16bf;
  --log-bg: #0b141b; --log-ink: #d7e4ea; --log-border: #2a404b; --log-scrollbar: #476573;
  --log-warning: #f1ce8e; --log-error: #ffb1a7; --log-muted: #a1b8c5;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-size: 14px; line-height: 1.55; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
input, select { width: 100%; min-width: 0; color: var(--ink); border: 1px solid var(--input-border); border-radius: 7px; background: var(--surface); padding: 10px 12px; height: 43px; }
input[type="checkbox"] { width: 16px; height: 16px; flex: 0 0 16px; accent-color: var(--green); padding: 0; }
input:focus-visible, select:focus-visible, button:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
input::placeholder { color: var(--placeholder); }
label { display: block; font-weight: 600; margin-bottom: 6px; }
h1, h2, p { margin: 0; }
h1 { font-size: 32px; font-weight: 680; letter-spacing: -.9px; line-height: 1.2; }
h2 { font-size: 17px; font-weight: 650; letter-spacing: -.2px; }
small, .help, .muted { color: var(--muted); }
.help { font-size: 13px; margin-top: 9px; }
code { font-family: Consolas, "SFMono-Regular", monospace; font-size: .94em; }
.site-header { min-height: 76px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px max(24px, calc((100vw - 1240px) / 2)); }
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); font-size: 20px; font-weight: 720; text-decoration: none; letter-spacing: -.4px; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 35px; height: 35px; color: var(--on-primary); background: var(--primary-bg); border-radius: 10px; font-size: 21px; }
.brand-sub { font-weight: 400; color: var(--muted); }
.header-right { display: flex; flex-wrap: wrap; justify-content: flex-end; min-width: 0; gap: 14px; align-items: center; }
.language-label, .theme-label { margin: 0; }
#language, #theme { height: 35px; padding: 5px 9px; font-size: 12px; font-weight: 500; }
#language { width: 104px; }
#theme { width: 128px; }
.region-label { font-size: 12px; color: var(--muted); }
main { max-width: 1240px; padding: 34px 24px 22px; margin: 0 auto; }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 2px 4px var(--shadow); }
.login-panel { margin: 65px auto; max-width: 530px; padding: 38px; }
.eyebrow { display: block; font-size: 10px; font-weight: 750; letter-spacing: 1.6px; color: var(--green); margin-bottom: 10px; }
.login-panel .intro { color: var(--muted); margin: 15px 0 28px; font-size: 15px; }
.login-panel .primary { margin-top: 23px; width: 100%; justify-content: space-between; }
.page-title { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 25px; }
.page-title p { font-size: 12px; margin-top: 8px; }
.clock-block { text-align: right; }
.clock-block span { display: block; font-size: 28px; font-weight: 550; font-variant-numeric: tabular-nums; }
.clock-block small { font-size: 11px; }
.status-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.status-card { padding: 20px 24px; }
.stat-label { font-size: 10px; letter-spacing: 1.2px; font-weight: 750; color: var(--muted); }
.stat-value { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-height: 48px; }
.stat-value strong { font-size: 26px; font-weight: 650; letter-spacing: -.7px; }
.stat-unit { font-size: 13px; color: var(--muted); }
.status-card small { font-size: 12px; }
.status-dot { height: 10px; width: 10px; border-radius: 50%; background: #8a969d; flex-shrink: 0; }
.status-dot.running { background: var(--green); box-shadow: 0 0 0 4px var(--green-light); }
.status-dot.stopping { background: var(--amber); }
.badge { display: inline-flex; align-items: center; border-radius: 30px; padding: 4px 10px; font-size: 11px; font-weight: 650; background: var(--neutral-bg); color: var(--muted); white-space: nowrap; }
.badge.success { background: var(--green-light); color: var(--green); }
.badge.warning { background: var(--warning-bg); color: var(--amber); }
.badge.error { background: var(--error-bg); color: var(--red); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid var(--input-border); border-radius: 7px; padding: 9px 15px; background: var(--surface); color: var(--ink); font-weight: 600; font-size: 13px; white-space: nowrap; min-height: 39px; transition: background .12s; }
.button:hover:not(:disabled) { background: var(--button-hover); }
.button.primary { color: var(--on-primary); background: var(--primary-bg); border-color: var(--primary-bg); }
.button.primary:hover:not(:disabled) { background: var(--primary-hover); }
.button.danger { color: var(--red); background: var(--danger-bg); border-color: var(--danger-border); }
.button.subtle { background: transparent; border-color: transparent; padding: 6px; }
.button.small { min-height: 33px; padding: 5px 11px; font-size: 12px; }
.button-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.control-bar { margin-top: 18px; padding: 18px 24px; display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.control-bar p { color: var(--muted); font-size: 12px; margin-top: 3px; }
.tabs { display: flex; gap: 24px; margin: 26px 0 18px; border-bottom: 1px solid var(--line); }
.tab { border: 0; border-bottom: 2px solid transparent; background: none; font-size: 13px; font-weight: 600; padding: 9px 1px 12px; color: var(--muted); }
.tab.active { color: var(--green); border-bottom-color: var(--green); }
.panel { padding: 25px 27px 19px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 21px; }
.section-heading p { font-size: 12px; color: var(--muted); margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 21px 26px; }
.field label { font-size: 12px; }
.field small { display: block; font-size: 11px; margin-top: 5px; line-height: 1.45; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 26px; margin: 23px 0; }
.check { display: flex; gap: 9px; align-items: center; font-size: 12px; font-weight: 400; margin: 0; }
.advanced { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 22px; }
.advanced summary { cursor: pointer; font-size: 13px; font-weight: 600; }
.advanced .form-grid { margin-top: 19px; }
.advanced form > p { margin: 15px 0; }
.form-footer { border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-top: 18px; margin-top: 24px; font-size: 12px; }
.schedule-fields { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; margin-bottom: 18px; }
.schedule-fields .field { max-width: 240px; width: 100%; }
#schedule-saved { margin-top: 18px; font-size: 12px; }
.search-label { font-size: 12px; margin-top: 20px; }
.account-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; margin-top: 15px; max-height: 330px; overflow-y: auto; }
.account-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.account-name { min-width: 0; overflow-wrap: anywhere; }
.account-name small { display: block; font-size: 10px; }
.account-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; }
.account-toolbar .help { margin: 0; }
#account-list { grid-template-columns: 1fr; max-height: 430px; }
#account-list .account-name { flex: 1; }
.account-actions { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; align-items: center; }
dialog.account-dialog { width: min(720px, 94vw); height: auto; max-height: 90vh; resize: none; }
.account-dialog .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.account-enabled { margin-top: 18px; }
input[type="file"] { height: auto; padding: 8px; }
input[type="file"]::file-selector-button { border: 1px solid var(--input-border); border-radius: 4px; padding: 6px 10px; margin-right: 10px; background: var(--surface); color: var(--ink); cursor: pointer; }
input[readonly] { color: var(--muted); }
.import-example { overflow-x: auto; font-size: 11px; padding: 12px; border: 1px solid var(--line); border-radius: 7px; }
@media (max-width: 600px) { #account-list .account-row { flex-wrap: wrap; } .account-actions { width: 100%; } .account-dialog .form-grid { grid-template-columns: 1fr; } }
.log-panel { margin-top: 23px; padding: 23px 24px 13px; }
.log-panel .section-heading { margin-bottom: 15px; }
.live-label { color: var(--green); font-size: 11px; font-weight: 500; margin-left: 7px; }
.live-label.paused { color: var(--amber); }
.log-toolbar { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.log-toolbar > input { max-width: 300px; height: 35px; font-size: 12px; }
.log-output { background: var(--log-bg); color: var(--log-ink); border: 1px solid var(--log-border); border-radius: 9px; padding: 15px 18px; height: 270px; min-height: 140px; max-height: 80vh; resize: vertical; overflow: auto; font: 11px/1.7 Consolas, "SFMono-Regular", monospace; scrollbar-color: var(--log-scrollbar) var(--log-bg); }
.log-line { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.log-line.warning { color: var(--log-warning); }
.log-line.error { color: var(--log-error); }
.log-empty { color: var(--log-muted); }
.log-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 10px; padding-top: 10px; }
.page-footer { display: flex; justify-content: space-between; gap: 16px; font-size: 11px; color: var(--muted); margin-top: 22px; }
.notice { border: 1px solid var(--notice-border); border-radius: 9px; background: var(--green-light); padding: 12px 16px; margin-bottom: 20px; font-size: 13px; color: var(--green-dark); overflow-wrap: anywhere; }
.notice.error { background: var(--notice-error-bg); border-color: var(--notice-error-border); color: var(--notice-error-ink); }
dialog { width: min(1400px, 94vw); max-width: 98vw; height: 84vh; max-height: 95vh; padding: 22px 25px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); resize: both; overflow: auto; }
dialog::backdrop { background: var(--backdrop); }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 12px; }
#expanded-log-content { height: calc(100% - 52px); }
#expanded-log-content #log-content { height: 100%; display: flex; flex-direction: column; }
#expanded-log-content .log-output { flex: 1; min-height: 140px; max-height: none; resize: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
@media (max-width: 950px) { .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .control-bar { flex-wrap: wrap; } .region-label { display: none; } .stat-value strong { font-size: 23px; } }
@media (max-width: 600px) { .site-header { padding: 12px 16px; min-height: 65px; gap: 10px; } .brand { font-size: 17px; } .brand-mark { width: 31px; height: 31px; } .header-right { gap: 6px; } main { padding: 24px 15px 18px; } h1 { font-size: 27px; } .clock-block span { font-size: 22px; } .status-grid { grid-template-columns: 1fr; gap: 10px; } .status-card { padding: 14px 19px; } .stat-value { min-height: 38px; } .control-bar { padding: 17px 18px; } .control-bar .button-row { width: 100%; } .tabs { gap: 19px; margin-top: 22px; } .tab { font-size: 12px; } .panel { padding: 20px 18px; } .form-grid, .check-grid, .account-list { grid-template-columns: 1fr; } .form-grid { gap: 17px; } .section-heading { flex-wrap: wrap; } .form-footer { flex-direction: column; align-items: flex-start; } .log-panel { padding: 19px 16px 13px; } .log-toolbar > input { max-width: none; } .log-toolbar .button-row { gap: 7px; } .log-output { padding: 12px; font-size: 10px; } .page-footer { flex-direction: column; gap: 5px; } .login-panel { margin: 35px auto; padding: 27px 23px; } dialog { width: 96vw; padding: 17px 14px; } }
@media (max-width: 600px) { .site-header { flex-wrap: wrap; } .header-right { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .theme-label, #logout { justify-self: end; } #connection { justify-self: start; } }
@media (prefers-reduced-motion: reduce) { .button { transition: none; } }
