:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: #f4f6f5;
  color: #17201c;
  letter-spacing: 0;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: #f4f6f5; }
button, input, select { font: inherit; letter-spacing: 0; }
.hidden { display: none !important; }
.auth-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #eef2f0; }
.auth-panel { width: min(400px, 100%); background: #fff; border: 1px solid #d9dfdc; border-radius: 8px; padding: 34px; box-shadow: 0 14px 44px rgba(23,32,28,.08); }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; background: #147a54; color: #fff; font-weight: 800; border-radius: 6px; }
.brand-mark.small { width: 36px; height: 36px; font-size: 13px; }
.auth-panel h1 { font-size: 24px; margin: 20px 0 6px; }
.auth-panel p { margin: 0 0 24px; color: #66716b; }
label { display: grid; gap: 7px; color: #47534d; font-size: 13px; font-weight: 650; }
input, select { width: 100%; min-height: 42px; padding: 9px 11px; color: #17201c; background: #fff; border: 1px solid #cbd3cf; border-radius: 5px; outline: none; }
input:focus, select:focus { border-color: #147a54; box-shadow: 0 0 0 3px rgba(20,122,84,.12); }
.auth-panel .btn { width: 100%; margin-top: 16px; }
.btn { min-height: 38px; padding: 8px 14px; border: 1px solid #bbc5c0; border-radius: 5px; background: #fff; color: #26322c; cursor: pointer; font-weight: 650; }
.btn:hover { background: #f0f3f1; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: #147a54; border-color: #147a54; color: #fff; }
.btn.primary:hover { background: #0f6746; }
.btn.danger { color: #a53131; border-color: #e3bcbc; }
.btn.quiet { border-color: transparent; background: transparent; }
.icon-btn { width: 38px; height: 38px; padding: 0; border: 1px solid #cbd3cf; border-radius: 5px; background: #fff; color: #334139; font-size: 22px; line-height: 1; cursor: pointer; }
.topbar { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px clamp(18px, 4vw, 56px); background: #fff; border-bottom: 1px solid #dce2df; }
.brand-row, .top-actions { display: flex; align-items: center; gap: 12px; }
.brand-row h1 { margin: 0; font-size: 17px; }
.brand-row p { margin: 2px 0 0; color: #748078; font-size: 12px; }
.edition-tabs { display: flex; align-items: center; margin-left: 10px; border: 1px solid #cbd3cf; border-radius: 5px; overflow: hidden; }
.edition-tab { min-height: 32px; display: inline-flex; align-items: center; padding: 6px 11px; color: #536059; background: #fff; font-size: 12px; font-weight: 700; text-decoration: none; }
.edition-tab + .edition-tab { border-left: 1px solid #cbd3cf; }
.edition-tab.active { color: #fff; background: #147a54; }
.service-state { font-size: 12px; color: #147a54; padding-right: 8px; }
main { max-width: 1360px; margin: 0 auto; padding: 26px clamp(18px, 4vw, 56px) 60px; }
.summary-band { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid #d8dfdb; background: #fff; margin-bottom: 28px; }
.summary-band div { min-height: 88px; padding: 18px 22px; display: grid; align-content: center; border-right: 1px solid #e2e7e4; }
.summary-band div:last-child { border-right: 0; }
.summary-band strong { font-size: 25px; }
.summary-band span { color: #6a766f; font-size: 12px; margin-top: 3px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 15px; }
.section-head h2 { margin: 0; font-size: 19px; }
.section-head p { margin: 5px 0 0; color: #6d7872; font-size: 13px; }
.accounts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 14px; }
.account-card { min-width: 0; background: #fff; border: 1px solid #d7dedb; border-radius: 7px; overflow: hidden; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px; border-bottom: 1px solid #e5e9e7; }
.card-title { min-width: 0; }
.card-title h3 { margin: 0; font-size: 16px; overflow-wrap: anywhere; }
.card-title p { margin: 5px 0 0; color: #657169; font-size: 13px; overflow-wrap: anywhere; }
.status { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #9aa49f; }
.status.running { color: #147a54; }.status.running::before { background: #18a56e; box-shadow: 0 0 0 3px rgba(24,165,110,.12); }
.status.restarting { color: #9a6417; }.status.restarting::before { background: #d48a20; }
.card-body { padding: 16px 18px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 15px; }
.fact span { display: block; font-size: 11px; color: #7b8680; margin-bottom: 3px; }
.fact strong { display: block; min-width: 0; font-size: 13px; font-weight: 650; overflow-wrap: anywhere; }
.notice { min-height: 38px; padding: 9px 10px; margin: 0 0 14px; background: #fff8e8; border-left: 3px solid #d99524; color: #77500e; font-size: 12px; overflow-wrap: anywhere; }
.notice.ok { background: #edf8f3; border-color: #28a878; color: #176546; }
.login-row, .action-row { display: flex; flex-wrap: wrap; gap: 8px; }
.login-row { margin-bottom: 10px; }
.challenge-copy { display: flex; justify-content: space-between; gap: 8px; margin: -2px 0 9px; color: #77500e; font-size: 12px; }
.challenge-copy span, .login-ready { color: #68746d; }
.login-ready { align-self: center; font-size: 12px; }
.action-row { padding-top: 14px; border-top: 1px solid #e5e9e7; }
.action-row .btn { flex: 1 1 auto; }
.sms-code { flex: 1 1 115px; min-width: 100px; min-height: 38px; }
.log-panel { margin: 14px -18px -16px; padding: 12px 18px; background: #202923; color: #dce7e0; min-height: 82px; max-height: 135px; overflow: auto; font: 12px/1.55 Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.empty-state { min-height: 280px; display: grid; place-items: center; align-content: center; gap: 8px; border: 1px dashed #bdc7c2; background: #fff; color: #68746d; }
.empty-state strong { color: #26322c; font-size: 17px; }.empty-state .btn { margin-top: 10px; }
.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(16,24,20,.48); }
.modal-dialog { width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: #fff; border-radius: 8px; box-shadow: 0 24px 70px rgba(0,0,0,.24); padding: 22px; }
.modal-dialog.wide { width: min(760px, 100%); }.modal-dialog.qr-dialog { width: min(420px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.modal-head h2 { margin: 0; font-size: 19px; }
.modal-subtitle { margin: 5px 0 0; color: #6d7872; font-size: 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }.form-grid .full { grid-column: 1 / -1; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.form-error { min-height: 19px; margin-top: 10px; color: #a53131; font-size: 13px; }
.desktop-list { display: grid; gap: 8px; }
.desktop-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 13px; border: 1px solid #d8dfdb; border-radius: 5px; }
.desktop-item strong, .desktop-item span { display: block; overflow-wrap: anywhere; }.desktop-item span { margin-top: 4px; color: #6f7a74; font-size: 12px; }
.route-ready { color: #147a54 !important; }.route-missing { color: #a53131 !important; }
.loading { padding: 28px; text-align: center; color: #68746d; }
.qr-stage { display: grid; justify-items: center; gap: 14px; min-height: 290px; align-content: center; }.qr-stage img { width: min(260px, 80vw); height: min(260px, 80vw); object-fit: contain; }
.login-dialog { width: min(520px, 100%); }
.login-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 0; margin: 0 0 22px; list-style: none; }
.login-steps li { min-width: 0; display: flex; align-items: center; gap: 7px; color: #8a958f; font-size: 12px; }
.login-steps li::after { content: ""; height: 1px; flex: 1; background: #dce2df; }
.login-steps li:last-child::after { display: none; }
.login-steps li span { width: 24px; height: 24px; flex: none; display: grid; place-items: center; border: 1px solid #cbd3cf; border-radius: 50%; background: #fff; font-size: 11px; }
.login-steps li.done, .login-steps li.active { color: #147a54; }
.login-steps li.done span, .login-steps li.active span { color: #fff; border-color: #147a54; background: #147a54; }
.verification-target { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 52px; margin-bottom: 17px; padding: 11px 13px; border-left: 3px solid #d99524; background: #fff8e8; color: #77500e; font-size: 13px; }
.verification-target strong { color: #26322c; white-space: nowrap; }
.login-stage { display: grid; gap: 10px; padding: 15px; border: 1px solid #d8dfdb; background: #f8faf9; }
.login-stage > strong { color: #26322c; font-size: 14px; }
.login-stage > span { color: #68746d; font-size: 12px; line-height: 1.55; }
.login-stage > .btn { justify-self: start; }
.login-actions { margin-top: 8px; }
#login-verify:disabled { opacity: .45; }
.login-feedback { min-height: 19px; margin-top: 9px; color: #147a54; font-size: 13px; }
.login-success { min-height: 150px; display: grid; place-items: center; align-content: center; gap: 7px; text-align: center; }
.login-success strong { color: #147a54; font-size: 18px; }
.login-success span { color: #68746d; font-size: 13px; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 50; max-width: min(420px, calc(100vw - 44px)); padding: 12px 16px; border-radius: 5px; background: #1c2922; color: #fff; box-shadow: 0 12px 34px rgba(0,0,0,.24); }
@media (max-width: 760px) {
  .topbar { align-items: flex-start; flex-direction: column; }.brand-row { width: 100%; flex-wrap: wrap; }.edition-tabs { margin-left: auto; }.top-actions { width: 100%; flex-wrap: wrap; }.top-actions .btn.primary { margin-left: auto; }
  .summary-band div { padding: 14px; }.form-grid { grid-template-columns: 1fr; }.form-grid .full { grid-column: auto; }
  .modal-actions { flex-wrap: wrap; }.modal-actions .btn { flex: 1 1 auto; }
  .login-steps li { gap: 4px; }.login-steps li strong { font-size: 11px; }.verification-target { align-items: flex-start; flex-direction: column; }
}
