:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #172238;
  background: #f5f7fa;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --page: #f5f7fa;
  --surface: #fff;
  --line: #e3e8f0;
  --ink: #172238;
  --muted: #6b778d;
  --blue: #5267e8;
  --blue-soft: #edf0ff;
  --green: #16845b;
  --green-soft: #e9f7f0;
  --amber: #a96d16;
  --amber-soft: #fff5e5;
  --red: #c34b4b;
  --red-soft: #fff0ef;
}

* { box-sizing: border-box; }
html,body {
  height: 100%;
}
body { display: flex; flex-direction: column; margin: 0; min-width: 320px; min-height: 100dvh; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.app-shell { flex: 1; min-height: 0; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; display: flex; height: calc(100dvh - 38px); flex-direction: column; padding: 22px 14px 18px; border-right: 1px solid var(--line); background: #fbfcfe; }
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 9px 26px; text-decoration: none; }
.brand-mark { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 12px; background: var(--blue-soft); color: var(--blue); font-size: 24px; font-weight: 700; }
.brand-title { font-size: 17px; font-weight: 720; line-height: 1.1; }
.brand-subtitle { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; font-weight: 450; }
.nav-list { display: grid; gap: 5px; }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 8px; color: #46536b; font-size: 14px; font-weight: 550; text-decoration: none; transition: background .16s, color .16s; }
.nav-link:hover { background: #f0f3fa; }
.nav-link.active { background: var(--blue-soft); color: var(--blue); font-weight: 650; }
.nav-icon { width: 20px; text-align: center; font-size: 18px; line-height: 1; }
.sidebar-foot { margin-top: auto; padding: 13px 12px 3px; border-top: 1px solid var(--line); }
.runtime-line { display: flex; align-items: center; gap: 8px; color: var(--green); font-size: 12px; font-weight: 620; }
.runtime-dot { width: 8px; height: 8px; border-radius: 50%; background: #27ad75; box-shadow: 0 0 0 3px #e1f5ea; }
.sidebar-meta { margin-top: 12px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.logout-form { margin: 16px 12px; }

.login-shell { display: grid; flex: 1; place-items: center; padding: 24px; }
.login-card { width: min(100%, 400px); padding: clamp(22px, 5vw, 34px); border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.login-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 24px; }
.login-form { display: grid; gap: 16px; margin-top: 22px; }
.login-form > .button { margin-top: 4px; }
.login-error { margin: 14px 0 0; color: var(--red); font-size: 13px; }

.main { min-width: 0; padding: 30px clamp(20px, 3.2vw, 48px) 52px; overflow-y: auto; }
.content { width: min(100%, 1400px); margin: 0 auto; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.page-title-wrap { display: flex; align-items: center; gap: 14px; min-width: 0; }
.page-icon { display: grid; flex: 0 0 48px; width: 48px; height: 48px; place-items: center; border: 1px solid #e5e9ff; border-radius: 13px; background: #eef0ff; color: var(--blue); font-size: 24px; }
h1 { margin: 0; color: var(--ink); font-size: 24px; font-weight: 700; line-height: 1.2; }
h2 { margin: 0; color: var(--ink); font-size: 16px; font-weight: 650; }
.page-subtitle { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.head-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 9px; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 13px; border: 1px solid #d9dfeb; border-radius: 7px; background: var(--surface); color: #35425a; font-size: 13px; font-weight: 600; line-height: 1; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, color .15s, transform .1s; }
.button:hover { border-color: #b8c3dc; background: #f9faff; }
.button:active { transform: translateY(1px); }
.button-primary { border-color: var(--blue); background: var(--blue); color: #fff; }
.button-primary:hover { border-color: #4057d9; background: #4057d9; }
.button-danger { color: var(--red); }
.button-small { min-height: 32px; padding: 0 10px; font-size: 12px; }
.icon-button { width: 36px; min-width: 36px; padding: 0; }

.notice { display: flex; align-items: flex-start; gap: 11px; margin: 0 0 18px; padding: 12px 15px; border: 1px solid #d6e2ff; border-radius: 9px; background: #edf3ff; color: #3d568c; font-size: 13px; line-height: 1.5; }
.notice-icon { flex: 0 0 auto; color: var(--blue); font-size: 16px; font-weight: 700; }
.notice-body { min-width: 0; flex: 1; }
.notice-title { color: #294777; font-weight: 680; }
.notice-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 7px; }

.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 19px; }
.metric-card { display: flex; min-height: 102px; align-items: center; gap: 14px; padding: 17px 19px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 2px 8px rgb(26 45 80 / 3%); }
.metric-icon { display: grid; flex: 0 0 40px; width: 40px; height: 40px; place-items: center; border-radius: 50%; background: var(--blue-soft); color: var(--blue); font-size: 18px; }
.metric-icon.green { background: var(--green-soft); color: var(--green); }
.metric-icon.neutral { background: #eff2f6; color: #68758d; }
.metric-label { color: #5e6c82; font-size: 13px; font-weight: 560; }
.metric-value { margin-top: 5px; color: var(--ink); font-size: 25px; font-weight: 730; line-height: 1; font-variant-numeric: tabular-nums; }

.toolbar { display: flex; align-items: center; gap: 10px; margin: 20px 0 12px; }
.search-wrap { position: relative; flex: 1 1 300px; max-width: 420px; }
.search-wrap .search-icon { position: absolute; top: 50%; left: 12px; color: #8490a3; font-size: 15px; transform: translateY(-50%); pointer-events: none; }
.control, .search-input, .field input, .field select { height: 38px; border: 1px solid #d9dfeb; border-radius: 7px; background-color: #fff; color: var(--ink); font-size: 13px; line-height: 20px; }
.field textarea { border: 1px solid #d9dfeb; border-radius: 7px; background: #fff; color: var(--ink); font-size: 13px; }
.search-input { width: 100%; padding: 0 12px 0 36px; }
.control { min-width: 145px; padding: 0 30px 0 11px; }
/* Safari collapses a native select's height to its content box; strip the native
   chrome and draw our own arrow so every form control lands on the same 38px row. */
select.control, .field select { padding-right: 32px; -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%236b778d' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M2.5 4.5 6 8l3.5-3.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.toolbar-spacer { flex: 1; }
.search-input::placeholder, .field input::placeholder, .field textarea::placeholder { color: #97a1b1; }

.table-card { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 2px 8px rgb(26 45 80 / 3%); }
.table-scroll { overflow-x: auto; }
table { width: 100%; min-width: 930px; border-collapse: collapse; text-align: left; }
th { height: 48px; padding: 0 15px; border-bottom: 1px solid var(--line); background: #fafbfe; color: #647188; font-size: 12px; font-weight: 650; white-space: nowrap; }
td { min-height: 72px; padding: 12px 15px; border-bottom: 1px solid #edf0f5; color: #344158; font-size: 13px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfcff; }
.task-name { color: var(--ink); font-weight: 650; }
.task-sub { margin-top: 4px; color: var(--muted); font-size: 12px; }
.time-value { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.action-list { display: flex; flex-wrap: wrap; gap: 6px; }
.action-tag { display: inline-flex; align-items: center; min-height: 23px; padding: 0 8px; border-radius: 5px; background: #eaf1ff; color: #3c5cae; font-size: 11px; font-weight: 620; white-space: nowrap; }
.action-tag.purple { background: #f0edff; color: #6550bb; }
.action-tag.green { background: #e8f7ef; color: #208257; }
.status-stack { display: grid; gap: 5px; min-width: 104px; }
.status-line { display: flex; align-items: center; gap: 6px; color: #59677d; font-size: 12px; white-space: nowrap; }
.status-line.enabled { color: var(--green); }
.status-line.disabled { color: #778398; }
.status-line.error { color: var(--red); }
.status-line.pending { color: var(--amber); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.run-time { color: #37445a; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.run-result { display: flex; align-items: center; gap: 5px; margin-top: 5px; font-size: 11px; }
.run-result.success { color: var(--green); }
.run-result.failed { color: var(--red); }
.run-result.running { color: var(--amber); }
.run-result.empty { color: #8a95a5; }
.run-link { display: block; text-decoration: none; }
.run-link:hover .run-time { color: var(--blue); }
.row-actions { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.row-actions form { margin: 0; }
.table-footer { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 0 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.empty-state { padding: 32px 16px; color: var(--muted); text-align: center; font-size: 13px; }

.section { margin-top: 20px; padding: 18px 0; border-top: 1px solid var(--line); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-description { margin: -5px 0 14px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.script-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.script-card { display: grid; grid-template-columns: 1fr auto; gap: 12px; min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); text-decoration: none; transition: border-color .16s, box-shadow .16s, transform .12s; }
.script-card:hover { border-color: #bfcaf7; box-shadow: 0 5px 16px rgb(44 63 130 / 8%); transform: translateY(-1px); }
.script-card-title { color: var(--ink); font-size: 15px; font-weight: 680; }
.script-card-meta { margin-top: 5px; color: var(--muted); font-size: 12px; }
.script-card-extra { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; color: #5d6a80; font-size: 12px; }
.script-type { color: var(--blue); font-size: 11px; font-weight: 650; }
.status-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 620; white-space: nowrap; }
.status-label.success { color: var(--green); }
.status-label.stopped { color: #758197; }
.status-label.warning { color: var(--amber); }
.status-label.failure { color: var(--red); }
.detail-back { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 16px; color: var(--muted); font-size: 13px; text-decoration: none; }
.detail-back:hover { color: var(--blue); }
.detail-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.detail-title { display: flex; align-items: center; gap: 13px; }
.detail-mark { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 11px; background: var(--blue-soft); color: var(--blue); font-size: 22px; }
.detail-meta { margin-top: 5px; color: var(--muted); font-size: 12px; }
.tab-list { display: flex; gap: 19px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.tab-link { position: relative; display: inline-flex; align-items: center; min-height: 44px; color: #65728a; font-size: 13px; font-weight: 560; text-decoration: none; white-space: nowrap; }
.tab-link.active { color: var(--blue); font-weight: 680; }
.tab-link.active::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: var(--blue); content: ""; }
.info-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.info-item { min-width: 0; padding: 15px 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.info-item:nth-child(3n) { border-right: 0; }
.info-item:nth-last-child(-n+3) { border-bottom: 0; }
.info-label { color: var(--muted); font-size: 11px; }
.info-value { margin-top: 6px; color: var(--ink); font-size: 13px; font-weight: 620; overflow-wrap: anywhere; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 820px; }
.config-card { display: grid; gap: 22px; max-width: 820px; padding: 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.config-group { display: grid; gap: 14px; }
.config-group + .config-group { padding-top: 20px; border-top: 1px solid #eef1f5; }
.config-group-title { color: #3d4a61; font-size: 13px; font-weight: 680; }
.config-field { display: grid; gap: 7px; }
.config-field input { width: 100%; min-width: 0; padding: 0 10px; }
.config-label { display: flex; align-items: center; gap: 9px; color: #4c5970; font-size: 12px; font-weight: 570; }
.secret-row { display: flex; align-items: center; gap: 12px; }
.secret-row input { flex: 1 1 auto; min-width: 0; }
.secret-row .checkbox-line { flex: 0 0 auto; font-weight: 500; white-space: nowrap; }
.field { display: grid; gap: 6px; color: #4c5970; font-size: 12px; font-weight: 570; }
.field.span-full { grid-column: 1 / -1; }
.field input, .field select { width: 100%; min-width: 0; padding: 0 10px; }
.field select { padding-right: 32px; }
.field textarea { width: 100%; min-width: 0; min-height: 110px; padding: 8px 10px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.field-help { color: var(--muted); font-size: 11px; font-weight: 450; line-height: 1.45; }
.config-state { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 12px; }
.config-state.complete { color: var(--green); }
.config-state.incomplete { color: var(--amber); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 18px; }
.actions a { font-size: 13px; font-weight: 560; text-decoration: none; }
.actions a:hover { text-decoration: underline; }
.muted { color: var(--muted); font-size: 12px; }
.test-result { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 7px; font-size: 13px; font-weight: 560; line-height: 1.4; }
.test-result.success { border: 1px solid #cfe7d9; background: #edf8f0; color: #256944; }
.test-result.failure { border: 1px solid #f1d5d2; background: var(--red-soft); color: #9d4141; }
.test-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.test-action { display: grid; align-content: start; gap: 9px; padding: 16px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.test-action-title { color: var(--ink); font-size: 14px; font-weight: 650; }
.test-action-description { min-height: 35px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.test-action-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.danger-note { color: var(--amber); font-size: 11px; }
.checkbox-line { display: flex; align-items: flex-start; gap: 8px; color: #4b5870; font-size: 12px; line-height: 1.45; }
.checkbox-line input { margin: 2px 0 0; accent-color: var(--blue); }
.diagnostic { margin-top: 16px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.diagnostic summary { padding: 12px 14px; color: #48566e; font-size: 12px; font-weight: 630; cursor: pointer; }
.diagnostic-body { padding: 0 14px 14px; }
.diagnostic pre, pre.code { max-height: 58vh; overflow: auto; margin: 0; padding: 12px; border-radius: 6px; background: #f3f5f9; color: #33415a; font: 11px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.table-wrap { overflow-x: auto; }
.log-table { min-width: 760px; }
.form-note { margin-top: 11px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.settings-panel { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.settings-panel .section-description { margin: 4px 0 14px; }
.settings-list { display: grid; gap: 0; }
.settings-row { display: flex; justify-content: space-between; gap: 18px; padding: 10px 0; border-top: 1px solid #eef1f5; font-size: 12px; }
.settings-row span:first-child { color: var(--muted); }
.settings-row span:last-child { color: #3e4b62; text-align: right; overflow-wrap: anywhere; }
.env-name-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; }
.env-name { padding: 4px 7px; border: 1px solid #e1e6f0; border-radius: 5px; background: #f8f9fc; color: #5a6780; font: 11px ui-monospace, monospace; }
.notice-message { margin-bottom: 16px; padding: 10px 13px; border: 1px solid #d3e5d9; border-radius: 7px; background: #edf8f0; color: #256944; font-size: 13px; }
.notice-message.error { border-color: #f1d5d2; background: var(--red-soft); color: #9d4141; }
.status-bar { display: flex; align-items: center; min-height: 38px; padding: 0 clamp(16px, 3vw, 32px); border-top: 1px solid var(--line); background: #fbfcfe; color: #3d4a61; font-size: 12px; }
.status-bar-idle { color: var(--muted); }
.status-bar-msg { font-weight: 560; }
.source-panel { max-height: 60vh; overflow: auto; }
.drawer { position: fixed; inset: 0 0 0 auto; width: min(520px, 100%); height: 100%;
  max-width: none; max-height: none; margin: 0; padding: 0; border: 0; color: var(--ink);
  background: var(--surface); box-shadow: -10px 0 34px rgb(20 34 63 / 12%); }
.drawer[open] { display: flex; flex-direction: column; animation: drawer-in .18s ease-out; }
.drawer::backdrop { background: rgb(18 29 51 / 34%); }
body:has(.drawer[open]) { overflow: hidden; }
#log-drawer { width: min(680px, 100%); }
.drawer pre.log-output { max-height: none; }
.log-output-meta { color: var(--muted); overflow-wrap: anywhere; }
.log-output-meta + p { margin: 8px 0 16px; overflow-wrap: anywhere; }
.log-cell-detail, .account-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.account-editor { margin-top: 16px; }
.account-table { min-width: 620px; }
.test-action-foot { flex-wrap: wrap; }
.test-action-foot form { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 8px; }
@media (prefers-reduced-motion: reduce) { .drawer[open] { animation: none; } }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 21px 23px 17px; border-bottom: 1px solid var(--line); }
.drawer-body { flex: 1; overflow-y: auto; padding: 19px 23px; }
.drawer-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 23px; border-top: 1px solid var(--line); background: #fbfcfe; }
.drawer-section { padding: 2px 0 18px; margin-bottom: 16px; border-bottom: 1px solid #edf0f5; }
.drawer-section:last-child { border-bottom: 0; }
.drawer-section h2 { margin-bottom: 14px; font-size: 13px; }
.drawer .field-grid { grid-template-columns: 1fr; gap: 13px; }
.drawer .two-col { grid-template-columns: 1fr 1fr; }
.drawer-form { display: flex; flex: 1 1 auto; min-height: 0; flex-direction: column; }
.drawer .checkbox-line { margin: 10px 0; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.mono { font-variant-numeric: tabular-nums; }
@keyframes drawer-in { from { transform: translateX(18px); opacity: .7; } to { transform: translateX(0); opacity: 1; } }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
button:disabled { opacity: .48; cursor: not-allowed; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 204px minmax(0,1fr); }
  .main { padding: 24px 20px 42px; }
  .metrics { gap: 10px; }
  .metric-card { padding: 14px; }
  .metric-icon { width: 35px; height: 35px; flex-basis: 35px; }
}
@media (max-width: 700px) {
  .app-shell { display: block; }
  .sidebar { position: sticky; z-index: 5; display: block; width: 100%; height: auto; padding: 10px 12px 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 1px 3px 9px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 9px; font-size: 19px; }
  .brand-title { font-size: 15px; }
  .brand-subtitle { display: none; }
  .nav-list { display: flex; gap: 3px; overflow-x: auto; }
  .nav-link { min-height: 37px; padding: 0 10px; white-space: nowrap; font-size: 12px; }
  .nav-icon { width: auto; font-size: 15px; }
  .sidebar-foot { display: none; }
  .main { padding: 20px 14px 38px; }
  .page-head { align-items: flex-start; margin-bottom: 17px; }
  .page-icon { width: 40px; height: 40px; flex-basis: 40px; font-size: 20px; }
  h1 { font-size: 21px; }
  .page-subtitle { max-width: 42ch; font-size: 12px; }
  .metrics { grid-template-columns: 1fr; gap: 8px; }
  .metric-card { min-height: 70px; padding: 11px 13px; }
  .metric-value { font-size: 21px; }
  .toolbar { flex-wrap: wrap; }
  .search-wrap { flex-basis: 100%; max-width: none; }
  .control { flex: 1; min-width: 0; }
  .script-grid, .settings-grid, .test-actions { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .info-item:nth-child(3n) { border-right: 1px solid var(--line); }
  .info-item:nth-child(2n) { border-right: 0; }
  .info-item:nth-last-child(-n+3) { border-bottom: 1px solid var(--line); }
  .info-item:nth-last-child(-n+2) { border-bottom: 0; }
  .field-grid { grid-template-columns: 1fr; }
  .notice { align-items: flex-start; }
  .notice-actions { align-items: flex-end; }
  .drawer { width: 100%; }
  .drawer-head, .drawer-body, .drawer-foot { padding-right: 17px; padding-left: 17px; }
  .page-head .button { min-height: 36px; padding: 0 10px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.drawer.dialog-centered {
  inset: 0;
  width: min(480px, calc(100% - 32px));
  height: auto;
  max-height: calc(100% - 32px);
  margin: auto;
  border-radius: 12px;
}
.drawer.dialog-centered[open] { animation: none; }
.dialog-centered .drawer-body { align-content: start; }
.verification-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; }
.account-login-status:empty { display: none; }
.account-login-status[data-status="failed"] { color: #a01d1d; }
.account-login-status[data-status="success"] { color: #136949; }
.account-token-result { margin: 0; padding: 12px; background: #f3f5f9; border-radius: 6px; }
.account-token-result dd { margin: 2px 0 8px; font-family: ui-monospace, monospace; }
.account-token-result dd:last-child { margin-bottom: 0; }

#navigation-progress {
  position: fixed;
  inset: 0 0 auto;
  height: 3px;
  z-index: 20;
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}

#navigation-progress:is(.htmx-request, .is-submitting) {
  animation: navigation-progress 1.2s ease-out forwards;
}

@keyframes navigation-progress {
  from { transform: scaleX(.12); }
  to { transform: scaleX(.9); }
}

#navigation-status:not(.sr-only) {
  position: fixed;
  right: 16px;
  bottom: 44px;
  z-index: 20;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--red-soft);
}

.page-loading {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted);
}

.skeleton-lines {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.skeleton-lines[hidden] {
  display: none;
}

.skeleton-lines span {
  height: 22px;
  border-radius: 4px;
  background: var(--line);
}

@media (prefers-reduced-motion: reduce) {
  #navigation-progress:is(.htmx-request, .is-submitting) {
    animation: none;
    transform: scaleX(1);
  }
}
