:root {
  color-scheme: light;
  --ink: #17201d;
  --ink-soft: #3f4b46;
  --muted: #75807b;
  --line: #dde3df;
  --line-strong: #cbd4cf;
  --canvas: #f5f7f5;
  --surface: #ffffff;
  --surface-soft: #f9fbf9;
  --brand: #08745d;
  --brand-dark: #075846;
  --brand-soft: #e8f5f0;
  --sidebar: #18231f;
  --success: #137a50;
  --warning: #a86106;
  --danger: #bd342b;
  --shadow: 0 12px 32px rgba(28, 48, 40, .07);
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; color: var(--ink); background: var(--canvas); font: 14px/1.55 "Microsoft YaHei", "Noto Sans SC", Arial, sans-serif; }
button, input, select { font: inherit; }
button, summary, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 7px; font-size: 27px; line-height: 1.25; letter-spacing: 0; }
h2 { margin-bottom: 4px; font-size: 18px; line-height: 1.35; letter-spacing: 0; }
h3 { margin: 24px 0 10px; font-size: 15px; }
small { font-size: 12px; }
[hidden] { display: none !important; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 224px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 24px 14px; background: var(--sidebar); color: #fff; z-index: 30; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px 26px; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 38px; border-radius: 7px; background: #16a17f; color: #fff; font: 800 13px/1 Arial, sans-serif; }
.brand-logo { width: 40px; height: 40px; display: block; flex: 0 0 40px; border-radius: 9px; box-shadow: 0 8px 18px rgba(0,0,0,.18); }
.brand > span:last-child, .login-wordmark > span:last-child { display: grid; }
.brand strong { font-size: 16px; }
.brand small { color: #91a69d; margin-top: 2px; }
.primary-nav { display: grid; gap: 5px; padding-top: 22px; }
.nav-item { display: flex; align-items: center; gap: 11px; min-height: 44px; padding: 0 11px; border-radius: 6px; color: #b8c8c1; font-weight: 600; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: #f4fbf8; color: #075d4b; }
.nav-symbol { width: 25px; color: #6f8a7f; font: 700 10px/1 Arial, sans-serif; }
.nav-item.active .nav-symbol { color: var(--brand); }
.sidebar-status { margin-top: auto; display: flex; align-items: center; gap: 9px; padding: 14px 10px 2px; border-top: 1px solid rgba(255,255,255,.1); }
.sidebar-status > span { width: 8px; height: 8px; border-radius: 50%; background: #38c694; box-shadow: 0 0 0 4px rgba(56,198,148,.12); }
.sidebar-status div { display: grid; }
.sidebar-status strong { color: #dce8e3; font-size: 12px; }
.sidebar-status small { color: #7f968c; }

.app-main { min-width: 0; }
.app-header { position: sticky; top: 0; z-index: 20; height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 30px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); }
.header-left { display: flex; align-items: center; gap: 12px; }
.header-left > div { display: grid; }
.header-left strong { font-size: 15px; }
.header-kicker, .role-label { color: var(--brand); font: 800 10px/1.4 Arial, sans-serif; letter-spacing: 0; }
.mobile-menu { display: none; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--ink); cursor: pointer; }
.user-menu { position: relative; }
.user-menu > summary { list-style: none; display: flex; align-items: center; gap: 9px; padding: 5px 7px; border-radius: 6px; cursor: pointer; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary:hover { background: var(--surface-soft); }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); font: 800 13px/1 Arial, sans-serif; }
.avatar.large { width: 42px; height: 42px; }
.avatar.xl { width: 68px; height: 68px; font-size: 22px; }
.avatar.small { width: 31px; height: 31px; font-size: 11px; }
.user-copy { display: grid; min-width: 82px; }
.user-copy strong { font-size: 13px; }
.user-copy small { color: var(--muted); }
.chevron { color: var(--muted); }
.user-dropdown { position: absolute; top: calc(100% + 10px); right: 0; width: 238px; padding: 8px; border: 1px solid var(--line); border-radius: 7px; background: #fff; box-shadow: var(--shadow); }
.dropdown-account { display: flex; align-items: center; gap: 10px; padding: 10px; margin-bottom: 5px; border-bottom: 1px solid var(--line); }
.dropdown-account > div { min-width: 0; display: grid; }
.dropdown-account small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-dropdown > a { display: block; padding: 9px 10px; border-radius: 5px; }
.user-dropdown > a:hover { background: var(--surface-soft); color: var(--brand-dark); }

.content { width: min(1320px, calc(100% - 52px)); margin: 0 auto; padding: 30px 0 54px; }
.page-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-intro p { margin-bottom: 0; color: var(--muted); }
.date-chip, .security-badge, .queue-state { display: inline-flex; align-items: center; gap: 7px; min-height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--ink-soft); font-size: 12px; font-weight: 700; white-space: nowrap; }
.security-badge i, .queue-state i { width: 7px; height: 7px; border-radius: 50%; background: #19a877; }

.notice { margin-bottom: 16px; padding: 11px 13px; border: 1px solid #b9ded0; border-left: 3px solid var(--brand); border-radius: 5px; background: #eef8f4; }
.notice.error { border-color: #efc3bf; border-left-color: var(--danger); background: #fff3f2; }
.notice.success { border-color: #b9dec9; border-left-color: var(--success); background: #eff9f3; }
.notice.warning { border-color: #ecd4aa; border-left-color: var(--warning); background: #fff8eb; }

.metric-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 18px; border: 1px solid var(--line); border-radius: 7px; background: #fff; box-shadow: 0 5px 18px rgba(31,54,44,.04); }
.metric { position: relative; min-height: 104px; padding: 17px 19px; border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric > span { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.metric > strong { display: block; margin: 4px 0 0; font: 800 27px/1.25 Arial, sans-serif; }
.metric > small { color: #9aa39f; }
.metric.success > strong { color: var(--success); }
.metric.danger > strong { color: var(--danger); }

.daily-outcome { min-height: 92px; display: grid; grid-template-columns: minmax(260px, 1.15fr) minmax(440px, 1.5fr) auto; align-items: center; gap: 20px; margin-bottom: 18px; padding: 15px 20px; border: 1px solid var(--line); border-radius: 7px; background: #fff; box-shadow: 0 5px 18px rgba(31,54,44,.035); }
.daily-outcome-title { display: flex; align-items: center; gap: 12px; }
.daily-outcome-title h2, .daily-outcome-title p { margin: 0; }
.daily-outcome-title h2 { font-size: 16px; }
.daily-outcome-title p { margin-top: 3px; color: var(--muted); font-size: 11px; }
.daily-outcome-metrics { display: grid; grid-template-columns: repeat(4, minmax(82px, 1fr)); }
.daily-outcome-metrics > div { padding: 2px 14px; border-left: 1px solid var(--line); }
.daily-outcome-metrics span { display: block; color: var(--muted); font-size: 11px; }
.daily-outcome-metrics strong { display: block; margin-top: 3px; font: 800 20px/1.2 Arial, sans-serif; }
.daily-outcome-metrics .success strong { color: var(--success); }
.daily-outcome-metrics .danger strong { color: var(--danger); }
.daily-outcome-empty { color: var(--muted); font-size: 11px; white-space: nowrap; }

.surface { margin-bottom: 18px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); box-shadow: 0 5px 18px rgba(31,54,44,.035); }
.surface-heading { min-height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.surface-heading > div { display: flex; align-items: center; gap: 12px; }
.surface-heading h2, .surface-heading p { margin-bottom: 0; }
.surface-heading p { color: var(--muted); font-size: 12px; }
.section-index { min-width: 32px; color: var(--brand); font: 800 10px/1 Arial, sans-serif; }

.module-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0 20px; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.module-tab { position: relative; min-height: 68px; display: grid; place-content: center start; gap: 2px; padding: 10px 20px; border: 0; border-right: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--ink-soft); text-align: left; cursor: pointer; }
.module-tab:first-child { border-left: 1px solid var(--line); }
.module-tab strong { font-size: 14px; }
.module-tab small { color: var(--muted); }
.module-tab:hover { background: #f1f7f4; }
.module-tab.active { background: #fff; color: var(--brand-dark); }
.module-tab.active::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 3px; background: var(--brand); content: ""; }

.task-form { padding: 22px 20px 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
label { display: grid; gap: 7px; margin-bottom: 15px; color: var(--ink-soft); font-weight: 700; }
label > small { color: var(--muted); font-weight: 400; }
input, select { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 5px; background: #fff; color: var(--ink); }
input:focus, select:focus { outline: 2px solid rgba(8,116,93,.18); border-color: var(--brand); }
input[type="file"] { padding: 7px 8px; color: var(--muted); }
input[type="file"]::file-selector-button { margin-right: 10px; padding: 6px 10px; border: 0; border-radius: 4px; background: #edf2ef; color: var(--ink-soft); font-weight: 700; cursor: pointer; }
.file-field { min-height: 100px; padding: 13px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft); }
.file-field input { background: #fff; }
.file-field.wide { margin-top: 1px; }
.module-options { padding-top: 1px; }
.option-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 2px 0 16px; }
.toggle-row { min-height: 58px; display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; }
.toggle-row.single { max-width: 430px; }
.toggle-row input { width: 18px; min-height: 18px; height: 18px; accent-color: var(--brand); }
.toggle-row span { display: grid; }
.toggle-row small { color: var(--muted); font-weight: 400; }
.merge-mode-field { display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: center; gap: 14px; margin: 16px 0 4px; padding-top: 16px; border-top: 1px solid var(--line); }
.merge-mode-field > span { color: var(--ink-soft); }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 3px; }
.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 0 16px; border: 1px solid transparent; border-radius: 5px; font-weight: 700; cursor: pointer; }
.button:disabled { opacity: .55; cursor: wait; }
.button.primary { background: var(--brand); color: #fff; }
.button.primary:hover { background: var(--brand-dark); }
.button.ghost { border-color: var(--line-strong); background: #fff; color: var(--ink-soft); }
.button.ghost:hover { background: var(--surface-soft); }
.button.danger { border-color: #d85b52; background: #fff; color: var(--danger); }
.button.danger:hover { background: #fff3f2; }
.task-live { margin-top: 16px; border: 1px solid #bcd9ce; border-radius: 6px; background: #f4faf7; }
.live-head { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-bottom: 1px solid #d5e7e0; }
.spinner { width: 14px; height: 14px; border: 2px solid #a6cfc0; border-top-color: var(--brand); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.live-log, .detail-log { max-height: 220px; overflow: auto; padding: 10px 12px; background: #1c2824; color: #d8e7e1; font: 12px/1.65 Consolas, monospace; }
.live-log div, .detail-log div { display: grid; grid-template-columns: 145px minmax(0, 1fr); gap: 10px; }
.live-log time, .detail-log time { color: #82a99a; }

.output-content { padding: 16px 20px 20px; }
.output-state { color: var(--muted); font-size: 13px; }
.output-state.running, .output-state.queued, .output-state.uploading { color: var(--warning); }
.output-state.completed { color: var(--success); }
.output-state.failed { color: var(--danger); }
.output-summary { min-height: 72px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft); color: var(--ink-soft); line-height: 1.7; white-space: pre-line; }
.output-metrics { margin-top: 12px; }
.output-toolbar { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; }
.output-toolbar .button { min-height: 34px; }
.output-actions { display: flex; align-items: center; gap: 8px; }
.output-table-wrap { border: 1px solid var(--line); border-radius: 6px; }
.output-table { min-width: 920px; }
.output-table th:nth-child(1) { width: 90px; }
.output-table th:nth-child(2) { width: 90px; }
.output-table th:nth-child(3) { width: 180px; }
.output-table th:nth-child(4) { width: 110px; }
.output-table th:nth-child(5) { width: 180px; }
.output-table .empty-state { height: 74px; }
.issue-level { font-weight: 700; }
.issue-level.error { color: var(--danger); }
.issue-level.warning { color: var(--warning); }

.table-wrap { overflow: auto; }
.data-table { width: 100%; min-width: 800px; border-collapse: collapse; }
.data-table th, .data-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.data-table th { background: #fbfcfb; color: var(--muted); font-size: 11px; font-weight: 800; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbfdfc; }
.nowrap { white-space: nowrap; }
.result-cell { max-width: 430px; color: var(--ink-soft); }
.result-cell .error-text { display: block; color: var(--danger); }
.status { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 4px; background: #edf1ef; color: var(--ink-soft); font-size: 12px; font-weight: 700; white-space: nowrap; }
.status.completed { background: #e9f7ef; color: var(--success); }
.status.failed { background: #fff0ef; color: var(--danger); }
.status.running, .status.queued { background: #fff6e7; color: var(--warning); }
.status.cancelling { background: #fff6e7; color: var(--warning); }
.status.cancelled { background: #f1f3f2; color: var(--muted); }
.task-actions { white-space: nowrap; }
.task-actions > * { margin-right: 10px; }
.text-button { display: inline; padding: 0; border: 0; background: transparent; color: var(--brand-dark); font-weight: 700; cursor: pointer; }
.text-button:hover { text-decoration: underline; }
.danger-text { color: var(--danger); }
.inline { display: inline; }
.empty-state { height: 100px; color: var(--muted); text-align: center !important; }

.account-overview { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(420px, .85fr); gap: 0; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 7px; background: #fff; box-shadow: 0 5px 18px rgba(31,54,44,.035); }
.profile-block { display: flex; align-items: center; gap: 18px; min-height: 190px; padding: 28px; border-right: 1px solid var(--line); }
.profile-block h2 { margin: 5px 0; font-size: 24px; }
.profile-block p { margin-bottom: 0; color: var(--muted); }
.password-form { display: grid; grid-template-columns: 1fr 1fr; align-content: center; gap: 0 12px; padding: 24px; }
.password-form label { margin-bottom: 10px; }
.password-form .button { grid-column: 2; justify-self: end; }
.email-settings-form { display: grid; grid-template-columns: minmax(260px, 1fr) 180px auto auto; align-items: end; gap: 12px; padding: 18px 20px; }
.email-settings-form label { margin: 0; }
.email-settings-form .email-auto-option { min-height: 42px; display: flex; align-items: center; gap: 8px; padding: 0 4px; color: var(--text); font-weight: 700; white-space: nowrap; }
.email-auto-option input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); }
.create-user-form { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) minmax(220px, 1fr) auto; align-items: end; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.account-inline { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.create-user-form label { margin-bottom: 0; }
.create-user-form .button { margin-bottom: 0; }
.user-cell { display: flex; align-items: center; gap: 9px; }
.user-cell > div { display: grid; }
.user-cell small { color: var(--muted); }
.success-breakdown { min-width: 210px; display: grid; gap: 5px; }
.success-breakdown > span { display: grid; grid-template-columns: 7px 66px auto; align-items: center; gap: 6px; color: var(--ink-soft); font-size: 11px; white-space: nowrap; }
.success-breakdown i { width: 7px; height: 7px; border-radius: 50%; background: #79968b; }
.success-breakdown i.meter { background: var(--brand); }
.success-breakdown i.plan { background: #3176a9; }
.success-breakdown i.merge { background: #a06c2d; }
.success-breakdown strong { color: var(--ink); font-size: 11px; }
.account-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; }
.account-status i { width: 7px; height: 7px; border-radius: 50%; }
.account-status.enabled { color: var(--success); }
.account-status.enabled i { background: var(--success); }
.account-status.disabled { color: var(--muted); }
.account-status.disabled i { background: #aab3af; }
.permission-switches { display: flex; align-items: center; gap: 6px; min-width: 270px; }
.permission-switches form { margin: 0; }
.permission-toggle { min-height: 28px; display: inline-flex; align-items: center; gap: 6px; padding: 0 8px; border: 1px solid var(--line); border-radius: 5px; background: #f3f5f4; color: var(--muted); font: inherit; font-size: 11px; font-weight: 700; white-space: nowrap; }
button.permission-toggle { cursor: pointer; }
.permission-toggle i { width: 7px; height: 7px; border-radius: 50%; background: #aab3af; }
.permission-toggle.enabled { border-color: #b9dfd1; background: #ecf8f3; color: var(--success); }
.permission-toggle.enabled i { background: var(--success); }
.permission-toggle.disabled { color: var(--muted); }
button.permission-toggle:hover { border-color: var(--brand); }
.mono { font-family: Consolas, monospace; }
.agent-cell { max-width: 450px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }


.app-dialog { width: min(980px, calc(100% - 28px)); max-height: 88vh; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.app-dialog::backdrop { background: rgba(18,31,26,.55); }
.compact-dialog { width: min(520px, calc(100% - 28px)); }
.dialog-head { position: sticky; top: 0; z-index: 1; min-height: 66px; display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-bottom: 1px solid var(--line); background: #fff; }
.dialog-head > div { display: flex; align-items: center; gap: 8px; }
.dialog-head h2 { margin: 0; }
.close-button { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 5px; background: #eef2ef; color: var(--ink); font-size: 23px; cursor: pointer; }
.close-button:hover { background: #e2e8e4; }
.dialog-content { padding: 20px; }
.detail-status { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.report-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.report-grid > div { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 5px; }
.report-grid span { display: block; color: var(--muted); font-size: 11px; }
.report-grid strong { display: block; margin-top: 4px; overflow-wrap: anywhere; }

.login-page { min-height: 100vh; background: #fff; }
.login-shell { width: 100%; min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.08fr) minmax(420px, .92fr); overflow: hidden; background: #fff; }
.login-brand { display: flex; flex-direction: column; padding: 38px 42px; background: #1b2924; color: #fff; }
.login-wordmark { display: flex; align-items: center; gap: 12px; }
.login-wordmark strong { font-size: 17px; }
.login-wordmark small { color: #829b91; font: 700 9px/1.5 Arial, sans-serif; }
.login-statement { margin: auto 0; max-width: 430px; }
.login-statement .role-label { color: #53c6a5; }
.login-statement h1 { margin: 10px 0 16px; color: #fff; font-size: 38px; line-height: 1.32; }
.login-statement p { color: #a7bab2; font-size: 15px; }
.login-modules { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid rgba(255,255,255,.1); }
.login-modules div { display: grid; gap: 6px; padding-top: 17px; }
.login-modules span { color: #5bc4a6; font: 800 10px/1 Arial, sans-serif; }
.login-modules strong { color: #cad8d2; font-size: 12px; }
.login-panel { display: grid; place-items: center; padding: 48px; }
.email-bind-shell .login-form-wrap { max-width: 520px; }
.login-form-wrap { width: min(340px, 100%); }
.login-form-wrap h2 { margin: 7px 0 4px; font-size: 26px; }
.login-form-wrap > p { margin-bottom: 25px; }
.login-form label { margin-bottom: 15px; }
.login-button { width: 100%; margin-top: 5px; }
.login-security { display: flex; align-items: center; gap: 10px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.login-security > span { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 5px var(--brand-soft); }
.login-security p { display: grid; margin: 0; }
.login-security small { color: var(--muted); }

@media (max-width: 1060px) {
  .content { width: calc(100% - 34px); }
  .metric-strip { grid-template-columns: repeat(3, 1fr); }
  .daily-outcome { grid-template-columns: 1fr; }
  .daily-outcome-metrics > div:first-child { border-left: 0; }
  .metric:nth-child(3) { border-right: 0; }
  .metric:nth-child(n+4) { border-top: 1px solid var(--line); }
  .account-overview { grid-template-columns: 1fr; }
  .profile-block { border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 820px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -240px; width: 224px; transition: left .2s ease; box-shadow: 12px 0 30px rgba(11,26,20,.18); }
  .sidebar.open { left: 0; }
  .mobile-menu { display: grid; place-items: center; }
  .app-header { height: 62px; padding: 0 15px; }
  .content { width: calc(100% - 24px); padding-top: 22px; }
  .user-copy, .chevron { display: none; }
  .metric-strip { grid-template-columns: repeat(2, 1fr); }
  .daily-outcome-metrics { grid-template-columns: repeat(2, 1fr); row-gap: 12px; }
  .daily-outcome-metrics > div:nth-child(3) { border-left: 0; }
  .metric:nth-child(2n) { border-right: 0; }
  .metric:nth-child(3) { border-right: 1px solid var(--line); }
  .metric:nth-child(n+3) { border-top: 1px solid var(--line); }
  .metric:last-child { grid-column: span 2; }
  .module-tabs { padding: 0; }
  .module-tab { min-height: 72px; padding: 9px; }
  .module-tab small { display: none; }
  .form-grid, .option-row, .password-form, .merge-mode-field, .email-settings-form { grid-template-columns: 1fr; }
  .password-form .button { grid-column: 1; }
  .create-user-form { grid-template-columns: 1fr; align-items: stretch; }
  .report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login-shell { grid-template-columns: 1fr; min-height: 100vh; }
  .login-brand { padding: 25px 28px; }
  .login-statement { margin: 50px 0 36px; }
  .login-statement h1 { font-size: 31px; }
  .login-panel { padding: 38px 28px; }
}

@media (max-width: 520px) {
  .page-intro { align-items: center; }
  .page-intro h1 { font-size: 23px; }
  .date-chip { display: none; }
  .metric { min-height: 88px; padding: 13px; }
  .metric > strong { font-size: 24px; }
  .surface-heading { min-height: 64px; padding: 12px 14px; }
  .output-content { padding: 12px 14px 14px; }
  .module-tab { font-size: 12px; text-align: center; place-content: center; }
  .task-form { padding: 16px 14px; }
  .form-actions { justify-content: stretch; }
  .form-actions .button { flex: 1; }
  .profile-block { align-items: flex-start; padding: 22px 18px; }
  .avatar.xl { width: 54px; height: 54px; }
  .password-form { padding: 20px 18px; }
  .security-badge { font-size: 11px; }
  .login-brand { min-height: 310px; }
  .login-statement { margin: 40px 0 25px; }
  .login-statement h1 { font-size: 28px; }
  .login-modules strong { font-size: 11px; }
  .live-log div, .detail-log div { grid-template-columns: 1fr; gap: 0; margin-bottom: 7px; }
}
