:root {
  color-scheme: dark;
  --canvas: #0d100e;
  --surface: #171b18;
  --surface-soft: #202621;
  --surface-inset: #111512;
  --ink: #f0f2ee;
  --muted: #969f97;
  --line: #313832;
  --yellow: #caa54a;
  --yellow-soft: #332b19;
  --green: #68af82;
  --green-soft: #193024;
  --coral: #d7776d;
  --coral-soft: #35211f;
  --sky: #86a8ad;
  --sky-soft: #1d2c2e;
  --charcoal: #080a09;
  --shadow: 0 18px 38px rgba(0, 0, 0, 0.3);
  --shadow-tight: 0 10px 24px rgba(0, 0, 0, 0.24);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--canvas); font-size: 14px; letter-spacing: 0; }
button, input, textarea, select { font: inherit; letter-spacing: 0; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid rgba(202, 165, 74, 0.42); outline-offset: 2px; }
svg { width: 18px; height: 18px; stroke-width: 2; flex: 0 0 auto; }
[hidden] { display: none !important; }

.login-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--charcoal); }
.login-shell { width: min(420px, 100%); padding: 36px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42); }
.brand-mark { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; background: var(--yellow); color: #11130f; font-size: 26px; font-weight: 850; }
.brand-mark.small { width: 38px; height: 38px; font-size: 19px; }
.eyebrow { margin: 20px 0 6px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
h1, h2, h3, p { letter-spacing: 0; }
h1 { margin: 0 0 30px; font-size: 34px; line-height: 1.15; }
h2 { margin: 0; font-size: 25px; line-height: 1.2; }
h3 { margin: 0; font-size: 17px; line-height: 1.3; }
.login-form, .modal-form, .schedule-form { display: grid; gap: 18px; }
label { display: grid; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
label small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
input, textarea, select { width: 100%; min-height: 44px; padding: 10px 13px; color: var(--ink); background: var(--surface-inset); border: 1px solid var(--line); border-radius: 12px; box-shadow: inset 0 2px 7px rgba(0, 0, 0, 0.3); }
textarea { resize: vertical; min-height: 104px; }
.password-field { position: relative; }
.password-field input { padding-right: 48px; }
.password-field .icon-button { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); }
.form-error { min-height: 18px; margin: -8px 0 0; color: var(--coral); font-size: 12px; }

.primary-button, .secondary-button, .danger-button, .text-button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; padding: 9px 18px; font-weight: 750; cursor: pointer; white-space: nowrap; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.primary-button:hover, .secondary-button:hover, .danger-button:hover, .text-button:hover { transform: translateY(-1px); }
.primary-button { color: #11130f; background: var(--yellow); }
.primary-button:hover { background: #d7b55d; }
.primary-button.compact { min-height: 38px; padding: 8px 14px; }
.secondary-button { background: var(--surface-soft); box-shadow: var(--shadow-tight); }
.danger-button { color: #fff; background: var(--coral); }
.text-button { min-height: 32px; padding: 5px 10px; color: var(--yellow); background: transparent; }
.icon-button { width: 36px; height: 36px; display: inline-grid; place-items: center; padding: 0; background: transparent; border: 0; border-radius: 50%; cursor: pointer; }
.icon-button:hover { background: var(--surface-soft); }
.icon-button.bordered { border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-tight); }
.icon-button.danger { color: var(--coral); border: 1px solid var(--coral-soft); }
.button-pair { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.button-pair.end { justify-content: flex-end; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 16px auto 16px 16px; z-index: 20; width: 232px; display: flex; flex-direction: column; padding: 22px 16px; color: #f8faf7; background: var(--charcoal); border: 1px solid #252a26; border-radius: 24px; box-shadow: 14px 16px 32px rgba(0, 0, 0, 0.34); }
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 24px; }
.sidebar-brand div:last-child { display: grid; gap: 1px; }
.sidebar-brand strong { font-size: 16px; }
.sidebar-brand span { color: #9ca49a; font-size: 12px; }
.main-nav { display: grid; gap: 7px; }
.nav-pill { width: 100%; min-height: 44px; display: flex; align-items: center; gap: 11px; padding: 9px 13px; color: #abb2a9; background: transparent; border: 0; border-radius: 999px; font-weight: 700; cursor: pointer; }
.nav-pill:hover { color: #fff; background: #1c211d; }
.nav-pill.active { color: #11130f; background: var(--yellow); }
.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 12px 8px 0; color: #b9c0b7; font-size: 12px; border-top: 1px solid #3a3f39; }
.sidebar-foot .icon-button { margin-left: auto; color: #dbe0d9; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #49ba78; box-shadow: 0 0 0 4px rgba(73, 186, 120, 0.14); }
.workspace { min-height: 100vh; margin-left: 264px; }
.topbar { min-height: 96px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 34px; background: rgba(13, 16, 14, 0.9); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(18px); }
.topbar .eyebrow { margin: 0 0 5px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.date-pill, .soft-pill, .status-badge { display: inline-flex; align-items: center; min-height: 30px; padding: 5px 11px; border-radius: 999px; background: var(--surface-soft); color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; box-shadow: inset 0 1px 2px rgba(255,255,255,.025); }
.content { max-width: 1600px; margin: 0 auto; padding: 24px 34px 78px; }
.page { display: none; }
.page.active { display: block; }
.mobile-nav { display: none; }

.metric-grid { display: grid; grid-template-columns: minmax(260px, 1.35fr) repeat(3, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.metric-card { min-height: 88px; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 13px; padding: 12px 18px 12px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-tight); }
.metric-card.highlight { background: #1c201c; border-color: #68572d; }
.metric-card.success { background: #18201b; border-color: #294936; }
.metric-card.calm { background: #181f20; border-color: #33474a; }
.metric-card.alert { background: #211918; border-color: #55302c; }
.metric-card.quiet { background: var(--surface-soft); }
.metric-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--yellow); background: var(--surface-soft); box-shadow: inset 0 1px 2px rgba(255,255,255,.035); }
.metric-card.success .metric-icon { color: var(--green); }
.metric-card.calm .metric-icon { color: var(--sky); }
.metric-card.alert .metric-icon { color: var(--coral); }
.metric-copy { min-width: 0; display: grid; gap: 2px; }
.metric-value { font-size: 27px; line-height: 1; font-weight: 850; }
.metric-label { color: var(--muted); font-size: 11px; font-weight: 750; }
.metric-note { color: var(--muted); font-size: 11px; white-space: nowrap; }
.dashboard-flow { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .75fr); gap: 18px; align-items: start; }
.panel { padding: 22px; background: rgba(23, 27, 24, .94); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); backdrop-filter: blur(16px); }
.panel-heading, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.panel-heading .eyebrow, .section-heading .eyebrow { margin: 0 0 4px; }
.panel-subtitle { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.recent-panel { grid-column: 1 / -1; }
.task-chart { display: grid; gap: 10px; }
.chart-item { min-width: 0; }
.task-flow-item { min-height: 54px; display: grid; grid-template-columns: 36px minmax(130px, .72fr) minmax(120px, 1.4fr); align-items: center; gap: 12px; padding: 7px 10px 7px 7px; border: 1px solid #2a312b; border-radius: 999px; background: var(--surface-soft); box-shadow: inset 0 1px 2px rgba(255,255,255,.02); }
.task-flow-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: var(--yellow); background: var(--yellow-soft); }
.task-flow-item:nth-child(2) .task-flow-icon { color: var(--green); background: var(--green-soft); }
.task-flow-item:nth-child(3) .task-flow-icon { color: var(--coral); background: var(--coral-soft); }
.task-flow-item:nth-child(4) .task-flow-icon { color: var(--sky); background: var(--sky-soft); }
.task-flow-copy { min-width: 0; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.task-flow-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; font-weight: 700; }
.task-flow-copy strong { white-space: nowrap; font-size: 12px; }
.bar-track { height: 9px; overflow: hidden; border-radius: 999px; background: #111512; }
.bar-fill { height: 100%; min-width: 0; border-radius: 999px; background: var(--yellow); transition: width .35s ease; }
.task-flow-item:nth-child(2) .bar-fill { background: var(--green); }
.task-flow-item:nth-child(3) .bar-fill { background: var(--coral); }
.task-flow-item:nth-child(4) .bar-fill { background: var(--sky); }
.task-flow-item:nth-child(5) .bar-fill { background: #727b73; }
.health-visual { display: grid; gap: 14px; }
.health-score { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; padding: 18px; border: 1px solid #294936; border-radius: 18px; background: var(--green-soft); box-shadow: inset 0 1px 2px rgba(255,255,255,.02); }
.health-score > span { color: var(--green); font-size: 12px; font-weight: 750; }
.health-score > strong { font-size: 36px; line-height: 1; }
.health-track { grid-column: 1 / -1; height: 12px; overflow: hidden; border-radius: 999px; background: #101812; }
.health-track span { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.health-legend { display: grid; gap: 8px; }
.health-chip { min-height: 46px; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 7px 12px 7px 8px; border-radius: 999px; background: var(--surface-soft); }
.health-chip svg { width: 15px; height: 15px; }
.health-chip > i, .health-chip > svg { width: 28px; height: 28px; padding: 6px; border-radius: 50%; }
.health-chip.active > svg { color: var(--green); background: var(--green-soft); }
.health-chip.invalid > svg { color: var(--coral); background: var(--coral-soft); }
.health-chip.pending > svg { color: var(--sky); background: var(--sky-soft); }
.health-chip span { color: var(--muted); font-size: 12px; }
.health-chip strong { font-size: 15px; }
.recent-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.recent-list > .empty-state, .management-list > .empty-state { grid-column: 1 / -1; }
.recent-item { min-width: 0; display: grid; grid-template-columns: 38px minmax(100px, 1fr) auto auto; align-items: center; gap: 10px; min-height: 58px; padding: 8px 10px 8px 8px; border-radius: 999px; background: var(--surface-soft); }
.recent-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); }
.recent-icon.succeeded { color: var(--green); background: var(--green-soft); }
.recent-icon.failed { color: var(--coral); background: var(--coral-soft); }
.recent-copy, .recent-item time { min-width: 0; }
.recent-item strong, .recent-item span, .recent-item time { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-item small { display: block; margin-top: 3px; color: var(--muted); }
.recent-item time { color: var(--muted); font-size: 11px; }

.action-row { min-height: 58px; display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 16px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 999px; background: rgba(23,27,24,.9); box-shadow: var(--shadow-tight); }
.segmented-control { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-soft); box-shadow: inset 0 2px 5px rgba(0,0,0,.22); }
.segmented-control.full { width: 100%; }
.segmented-control button { min-height: 32px; padding: 5px 13px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-weight: 700; cursor: pointer; }
.segmented-control.full button { flex: 1; }
.segmented-control button.active { color: #11130f; background: var(--yellow); }
.account-list { display: grid; gap: 12px; }
.management-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.management-card { min-height: 116px; display: grid; grid-template-columns: minmax(210px, 1fr) auto; align-items: center; gap: 14px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-tight); }
.management-card.disabled, .management-card.revoked { opacity: .65; }
.management-main { min-width: 0; display: flex; align-items: center; gap: 11px; }
.management-main h3, .management-main p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.management-main p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.management-avatar { width: 40px; height: 40px; display: grid; place-items: center; flex: 0 0 auto; color: var(--green); background: var(--green-soft); border-radius: 50%; }
.management-avatar.code-avatar { color: var(--yellow); background: var(--yellow-soft); }
.management-stats { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.management-stats > span { min-height: 30px; display: inline-flex; align-items: center; padding: 5px 10px; border-radius: 999px; background: var(--surface-soft); }
.management-stats strong { margin-right: 4px; color: var(--ink); font-size: 17px; }
.management-actions { display: flex; justify-content: flex-end; gap: 5px; }
.generated-codes { display: grid; gap: 10px; margin-top: 20px; padding: 16px; border-radius: 22px; background: var(--surface-soft); }
.generated-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.code-output-list { display: grid; gap: 7px; }
.code-output-list code { display: block; padding: 11px 14px; color: #e8d8a8; background: var(--yellow-soft); border: 1px solid #5d4e28; border-radius: 999px; font: 700 14px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 1px; }
.form-grid.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.account-card { position: relative; display: grid; grid-template-columns: minmax(230px, .9fr) minmax(260px, 1.2fr) auto auto; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-tight); }
.account-card::before { content: ""; width: 7px; height: 38px; position: absolute; left: -3px; top: 50%; transform: translateY(-50%); border-radius: 999px; background: var(--line); }
.account-card.invalid::before { background: var(--coral); }
.account-card.valid::before { background: var(--green); }
.account-profile { min-width: 0; display: flex; align-items: center; gap: 11px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: var(--surface-soft); flex: 0 0 auto; }
.avatar-fallback { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: var(--yellow-soft); font-size: 17px; font-weight: 850; flex: 0 0 auto; }
.account-profile h3 { overflow-wrap: anywhere; }
.account-profile p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.account-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.status-badge.valid { color: var(--green); background: var(--green-soft); }
.status-badge.invalid { color: var(--coral); background: var(--coral-soft); }
.toggle { width: 46px; height: 26px; position: relative; border: 0; border-radius: 999px; background: #444c45; cursor: pointer; flex: 0 0 auto; }
.toggle::after { content: ""; width: 20px; height: 20px; position: absolute; top: 3px; left: 3px; border-radius: 50%; background: #e7ebe7; box-shadow: 0 1px 4px rgba(0,0,0,.35); transition: transform .18s ease; }
.toggle.on { background: var(--green); }
.toggle.on::after { transform: translateX(20px); }
.inline-options { display: flex; align-items: center; gap: 12px; }
.inline-toggle { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.inline-toggle .toggle { width: 38px; height: 22px; }
.inline-toggle .toggle::after { width: 16px; height: 16px; }
.inline-toggle .toggle.on::after { transform: translateX(16px); }
.account-actions { display: flex; justify-content: flex-end; gap: 5px; }
.row-actions { flex-wrap: nowrap; }
.empty-state { min-height: 180px; display: grid; place-items: center; align-content: center; gap: 12px; color: var(--muted); text-align: center; border: 1px dashed var(--line); border-radius: 20px; background: rgba(23,27,24,.55); }
.empty-state svg { width: 32px; height: 32px; }

fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { margin-bottom: 9px; color: var(--muted); font-size: 12px; font-weight: 700; }
.task-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.task-choice { min-height: 58px; display: flex; align-items: center; gap: 9px; padding: 10px 13px; text-align: left; color: var(--muted); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.task-choice.selected { color: var(--green); border-color: #315b40; background: var(--green-soft); }
.task-choice[hidden] { display: none; }
.task-modal { width: min(700px, calc(100% - 28px)); }
.task-status-row { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-soft); }
.task-status-row span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.task-choice-dense { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.task-choice-dense .task-choice { min-height: 48px; }
.task-dialog-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.task-dialog-actions .icon-button { margin-right: auto; }

.compact-select { width: auto; min-width: 180px; min-height: 38px; padding-block: 7px; border-radius: 999px; }
.job-log-list { display: grid; gap: 11px; }
.job-log-item { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-tight); }
.job-log-head { min-height: 66px; display: grid; grid-template-columns: 38px minmax(160px, 1fr) minmax(110px, auto) auto 20px; align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer; list-style: none; }
.job-log-head::-webkit-details-marker { display: none; }
.job-log-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-soft); }
.job-log-icon.succeeded { color: var(--green); background: var(--green-soft); }
.job-log-icon.failed { color: var(--coral); background: var(--coral-soft); }
.job-log-primary, .job-log-time { min-width: 0; display: grid; gap: 3px; }
.job-log-primary strong, .job-log-primary small, .job-log-time strong, .job-log-time small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-log-primary small, .job-log-time small { color: var(--muted); font-size: 11px; }
.job-log-time { text-align: right; font-size: 12px; }
.job-log-chevron { color: var(--muted); transition: transform .18s ease; }
.job-log-item[open] .job-log-chevron { transform: rotate(180deg); }
.job-log-body { display: grid; gap: 10px; margin: 0 12px 12px; padding: 4px 12px 12px 52px; border-radius: 16px; background: var(--surface-soft); }
.job-error { display: grid; gap: 4px; margin-top: 12px; padding: 10px 12px; color: #e4aaa4; background: var(--coral-soft); border-radius: 18px; }
.job-error span { overflow-wrap: anywhere; }
.job-step-list { display: grid; gap: 8px; margin-top: 12px; }
.job-step { padding: 11px 12px; border: 1px solid var(--line); border-left: 4px solid var(--coral); border-radius: 16px; background: var(--surface); }
.job-step.success { border-left-color: var(--green); }
.job-step-head { display: grid; grid-template-columns: 24px minmax(120px, 1fr) auto auto; align-items: center; gap: 8px; }
.job-step-head time { color: var(--muted); font-size: 11px; }
.step-index { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); background: var(--surface-soft); font-size: 11px; font-weight: 800; }
.step-meta { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px; margin: 10px 0 0; }
.step-meta div { display: grid; gap: 3px; }
.step-meta dt { color: var(--muted); font-size: 10px; font-weight: 750; }
.step-meta dd { margin: 0; overflow-wrap: anywhere; }
.step-response, .job-result { display: grid; gap: 6px; margin-top: 10px; }
.step-response > strong, .job-result > strong { font-size: 11px; }
.step-description { display: grid; gap: 5px; margin-top: 10px; padding: 10px 12px; color: var(--ink); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 8px; }
.step-description strong { color: var(--muted); font-size: 10px; font-weight: 750; }
.step-description p { margin: 0; line-height: 1.6; overflow-wrap: anywhere; }
.response-block { max-height: 280px; margin: 0; padding: 12px 14px; overflow: auto; color: #dfe8dc; background: var(--charcoal); border-radius: 18px; font: 11px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.empty-step { padding: 13px; color: var(--muted); text-align: center; background: var(--surface); border-radius: 999px; }

.settings-flow { columns: 2 380px; column-gap: 18px; }
.settings-panel { break-inside: avoid; display: inline-block; width: 100%; margin-bottom: 18px; }
.policy-choice-grid { margin-top: 12px; }
.task-policy-panel .button-pair { margin-top: 14px; }
.settings-list { margin: 0; }
.settings-list div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; margin-top: 8px; padding: 12px 14px; border-radius: 14px; background: var(--surface-soft); }
.settings-list dt { color: var(--muted); }
.settings-list dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.settings-account-list { display: grid; }
.settings-account-row { display: grid; grid-template-columns: minmax(120px, 1fr) auto auto; align-items: center; gap: 14px; margin-top: 8px; padding: 10px 14px; border-radius: 999px; background: var(--surface-soft); }
.settings-account-row span { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.mini-setting { display: grid; justify-items: center; gap: 4px; color: var(--muted); font-size: 10px; }

.modal { width: min(520px, calc(100% - 28px)); max-height: calc(100vh - 28px); padding: 22px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 24px 80px rgba(0,0,0,.52); overflow-y: auto; }
.modal::backdrop { background: rgba(0, 0, 0, .78); backdrop-filter: blur(6px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.modal-head .eyebrow { margin: 0 0 4px; }
.modal-form { margin-top: 18px; }
.qr-stage { min-height: 230px; display: grid; place-items: center; gap: 10px; padding: 16px; background: var(--surface-soft); border-radius: 24px; }
.qr-stage img { width: min(210px, 100%); aspect-ratio: 1; object-fit: contain; background: #fff; }
.qr-placeholder { width: 170px; aspect-ratio: 1; display: grid; place-items: center; color: var(--muted); background: #fff; border: 1px dashed var(--line); }
.qr-placeholder svg { width: 56px; height: 56px; }
.confirm-modal { width: min(410px, calc(100% - 28px)); }
.confirm-modal > p { margin: 0 0 22px; color: var(--muted); line-height: 1.7; }
.toast-region { position: fixed; z-index: 100; right: 18px; bottom: 18px; width: min(360px, calc(100% - 36px)); display: grid; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 11px 16px; color: #fff; background: var(--charcoal); border: 1px solid #424840; border-radius: 999px; box-shadow: var(--shadow); animation: toast-in .2s ease; }
.toast.error { background: #542723; border-color: #8b423a; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

@media (max-width: 1080px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-flow { grid-template-columns: 1fr; }
  .recent-panel { grid-column: auto; }
  .management-list { grid-template-columns: 1fr; }
  .account-card { grid-template-columns: minmax(240px, 1fr) auto auto; }
  .account-actions { grid-column: 1 / -1; padding-top: 8px; border-top: 1px solid var(--line); }
}

@media (max-width: 760px) {
  body { font-size: 13px; }
  .sidebar { display: none; }
  .workspace { margin-left: 0; padding-bottom: 74px; }
  .topbar { min-height: 80px; padding: 14px 16px; }
  .topbar h2 { font-size: 21px; }
  .date-pill { display: none; }
  .content { padding: 16px 14px 34px; }
  .mobile-nav { position: fixed; inset: auto 10px max(10px, env(safe-area-inset-bottom)) 10px; z-index: 30; height: 62px; display: flex; overflow-x: auto; padding: 5px; background: rgba(39, 43, 38, .96); border: 1px solid #424840; border-radius: 999px; box-shadow: 0 14px 40px rgba(0,0,0,.22); backdrop-filter: blur(16px); }
  .mobile-nav button { min-width: 64px; flex: 1 0 64px; display: grid; place-items: center; align-content: center; gap: 2px; color: #aeb5ac; background: transparent; border: 0; border-radius: 999px; font-size: 10px; }
  .mobile-nav button.active { color: #11130f; background: var(--yellow); }
  .mobile-nav svg { width: 18px; height: 18px; }
  .metric-grid { gap: 9px; }
  .metric-card { min-height: 96px; padding: 10px; }
  .metric-value { font-size: 28px; }
  .panel { padding: 16px; }
  .dashboard-flow { gap: 11px; }
  .recent-list { grid-template-columns: 1fr; }
  .recent-item { grid-template-columns: 38px minmax(100px, 1fr) auto; }
  .recent-item > :nth-child(3) { display: none; }
  .action-row { align-items: stretch; }
  .action-row .segmented-control { min-width: 0; }
  .action-row .segmented-control button { padding-inline: 10px; }
  .primary-button.compact span { display: none; }
  .primary-button.compact { width: 40px; padding: 0; }
  .account-card { grid-template-columns: 1fr; gap: 10px; }
  .account-meta, .inline-options { padding-left: 53px; }
  .account-actions { grid-column: auto; justify-content: flex-start; padding: 9px 0 0 53px; overflow-x: auto; }
  .row-actions .primary-button.compact { width: auto; padding: 8px 14px; }
  .row-actions .primary-button.compact span { display: inline; }
  .job-log-head { grid-template-columns: 34px minmax(120px, 1fr) auto 18px; gap: 9px; padding-inline: 11px; }
  .job-log-time { display: none; }
  .job-log-body { padding: 0 11px 11px; }
  .task-choice-dense { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-flow { columns: 1; }
  .management-card { grid-template-columns: 1fr; gap: 10px; }
  .management-stats { grid-column: auto; }
  .management-actions { justify-content: flex-start; padding-left: 51px; }
  .form-grid.two { grid-template-columns: 1fr; }
  .login-shell { padding: 26px 22px; }
  h1 { font-size: 29px; }
  .task-flow-item { grid-template-columns: 36px minmax(0, 1fr); border-radius: 22px; }
  .task-flow-item .bar-track { grid-column: 2 / -1; }
  .toast-region { bottom: 86px; }
}

@media (max-width: 420px) {
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { min-width: 0; }
  .metric-card { grid-template-columns: 34px minmax(0, 1fr); padding-right: 12px; }
  .metric-icon { width: 34px; height: 34px; }
  .metric-note { display: none; }
  .task-choice-grid { grid-template-columns: 1fr; }
  .task-choice-dense { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .job-log-head { grid-template-columns: 32px minmax(90px, 1fr) auto 16px; }
  .job-log-head .status-badge { min-height: 26px; padding-inline: 8px; }
  .job-step-head { grid-template-columns: 24px minmax(80px, 1fr) auto; }
  .job-step-head time { display: none; }
  .step-meta { grid-template-columns: 72px minmax(0, 1fr); }
  .settings-account-row { grid-template-columns: minmax(100px, 1fr) auto auto; gap: 8px; }
  .segmented-control button { padding-inline: 9px; }
}

/* Flat business dashboard: keep hierarchy in spacing and borders instead of heavy capsules. */
.login-shell, .sidebar, .panel, .action-row, .management-card, .account-card, .job-log-item, .modal { border-radius: 10px; box-shadow: none; }
.primary-button, .secondary-button, .danger-button, .text-button { border-radius: 8px; box-shadow: none; }
.icon-button, .icon-button.bordered { border-radius: 8px; box-shadow: none; }
.nav-pill { border-radius: 8px; }
.metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.metric-card { min-height: 82px; border-radius: 10px; box-shadow: none; }
.metric-icon { border-radius: 8px; box-shadow: none; }
.dashboard-flow { grid-template-columns: minmax(0, 1.65fr) minmax(280px, .75fr); gap: 12px; }
.account-card { grid-template-columns: minmax(170px, .85fr) minmax(170px, 1fr) minmax(145px, auto) minmax(260px, auto); gap: 10px; }
.user-log-panel { grid-column: span 1; }
.account-health-panel { grid-column: span 1; }
.panel { padding: 18px; backdrop-filter: none; }
.panel-heading-actions { display: flex; align-items: center; gap: 8px; }
.dashboard-log-list { display: grid; gap: 1px; border-top: 1px solid var(--line); }
.dashboard-log-item { min-width: 0; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; min-height: 58px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.dashboard-log-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 7px; background: var(--surface-soft); }
.dashboard-log-icon.succeeded { color: var(--green); background: var(--green-soft); }
.dashboard-log-icon.failed { color: var(--coral); background: var(--coral-soft); }
.dashboard-log-copy { min-width: 0; display: grid; gap: 4px; }
.dashboard-log-copy strong, .dashboard-log-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-log-copy span, .dashboard-log-item time { color: var(--muted); font-size: 11px; }
.dashboard-log-item time { white-space: nowrap; }
.health-score { border-radius: 8px; box-shadow: none; }
.health-chip { border-radius: 8px; }
.settings-panel, .settings-account-row, .generated-codes, .task-status-row, .job-log-body, .job-step, .empty-state { border-radius: 8px; }
.management-stats > span, .code-output-list code { border-radius: 7px; }
.account-card::before { border-radius: 0; }
.vip-countdown { display: inline-flex; align-items: center; min-height: 30px; padding: 5px 0; color: var(--coral); font-size: 12px; font-weight: 800; white-space: nowrap; }
#notifySettingsForm .button-pair { margin-top: 12px; }

@media (max-width: 1080px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .user-log-panel, .account-health-panel { grid-column: auto; }
}

@media (max-width: 760px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-flow { grid-template-columns: 1fr; }
  .mobile-nav { overflow-x: hidden; }
  .mobile-nav button { min-width: 0; flex: 1 1 0; }
  .dashboard-log-item { grid-template-columns: 30px minmax(0, 1fr) auto; }
  .dashboard-log-item .status-badge { grid-column: 2 / -1; justify-self: start; }
  .dashboard-log-item time { display: none; }
}
