:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", "Microsoft YaHei UI", sans-serif;
  font-synthesis: none;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "PingFang SC", "Microsoft YaHei UI", sans-serif;
  --mono: "SFMono-Regular", "Cascadia Code", Consolas, monospace;
  --ink: #1c1c1e;
  --muted: #74747a;
  --border: #e5e5ea;
  --blue: #007aff;
  --blue-strong: #0068df;
  --blue-tint: #edf5ff;
  --green: #248a3d;
  --surface: #fff;
  --grouped: #f2f2f7;
  --shadow: 0 2px 12px #1c1c1e04, 0 0 0 1px #1c1c1e03;
  color: var(--ink);
  background: var(--grouped);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; font-size: 14px; line-height: 1.5; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button, a, select { cursor: pointer; }
button, a { touch-action: manipulation; }
button { transition: background .18s, color .18s, transform .18s, box-shadow .18s; }
button:active:not(:disabled), .button:active { transform: scale(.98); }
button:disabled { cursor: not-allowed; opacity: .42; }
a { color: var(--blue-strong); text-decoration: none; }
button:focus-visible, a:focus-visible, summary:focus-visible, tr:focus-visible { outline: 3px solid #007aff70; outline-offset: 3px; }
input:focus, textarea:focus, select:focus { outline: 3px solid #007aff30; outline-offset: 1px; }
input[type=checkbox] { width: 18px; height: 18px; margin: 0; accent-color: var(--blue); flex: 0 0 18px; cursor: pointer; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden], .hidden { display: none !important; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1, h2, h3 { font-family: var(--display); }
h1 { font-size: 38px; font-weight: 700; line-height: 1.25; letter-spacing: -1.1px; margin: 0; }
h2 { font-size: 18px; font-weight: 650; letter-spacing: -.35px; margin: 0; }
h3 { font-size: 15px; font-weight: 600; }

/* iPad-style split view */
.sidebar { position: fixed; inset: 0 auto 0 0; width: 232px; padding: 34px 18px 24px; background: #f7f7fae8; border-right: 1px solid #ddddE5; display: flex; flex-direction: column; z-index: 20; backdrop-filter: blur(24px); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 12px; color: var(--ink); }
.brand img { width: 44px; height: 44px; border-radius: 12px; box-shadow: 0 3px 8px #007aff20; }
.brand span { font-family: var(--display); font-size: 23px; font-weight: 700; line-height: 1.2; letter-spacing: -.6px; }
.brand small { display: block; font-size: 12px; font-weight: 450; color: var(--muted); letter-spacing: 0; margin-top: 5px; }
.workspace-label { margin: 46px 14px 12px; font-size: 12px; font-weight: 600; color: var(--muted); }
.nav { width: 100%; border: 0; display: flex; align-items: center; gap: 11px; padding: 11px 12px; margin: 4px 0; background: transparent; border-radius: 12px; color: #444448; font-size: 14px; text-align: left; min-height: 48px; }
.nav:hover { background: #eaeaf0; }
.nav.active { background: #e3edfc; color: #005bc4; font-weight: 600; }
.nav-symbol { display: grid; place-items: center; width: 28px; height: 28px; flex: 0 0 28px; border-radius: 8px; }
.nav-symbol svg { width: 22px; height: 22px; }
.blue { background: #e4f0ff; color: #0075ee; }
.orange { background: #fff0db; color: #c77800; }
.green { background: #e5f5ea; color: #248a3d; }
.violet { background: #eeebff; color: #7b59d6; }
.nav b { margin-left: auto; min-width: 21px; font-size: 12px; font-weight: 600; text-align: center; color: #6e6e73; font-variant-numeric: tabular-nums; }
.nav.active b { color: #0062ce; }
.sidebar-bottom { margin-top: auto; padding: 22px 12px 0; }
.local-dot { display: flex; align-items: center; gap: 7px; color: #505057; font-size: 12px; font-weight: 550; }
.local-dot:before { content: ""; width: 6px; height: 6px; background: #34c759; border-radius: 50%; }
.sidebar-bottom p { margin: 10px 0 24px; font-size: 11px; line-height: 1.9; color: var(--muted); }
.settings-link { display: flex; align-items: center; gap: 8px; padding: 0; min-height: 40px; background: transparent; border: 0; color: #4d4d53; font-size: 12px; }
.settings-link svg { width: 18px; height: 18px; }
.sidebar-bottom>a { display: block; margin-top: 10px; font-size: 11px; color: var(--muted); }
main { margin-left: 232px; min-width: 0; }
.topbar { position: sticky; top: 0; height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 36px; background: #f2f2f7d9; backdrop-filter: blur(20px); border-bottom: 1px solid #e3e3e9a6; color: var(--muted); font-size: 12px; z-index: 10; }
.topbar strong { color: #5b5b63; font-weight: 550; }
.slash { padding: 0 12px; color: #a5a5ab; font-size: 17px; }
.topbar>div { display: flex; align-items: center; gap: 17px; }
.mode { padding: 5px 9px; border-radius: 7px; background: #e7e7ee; color: #62626a; font-size: 11px; }
.connection { white-space: nowrap; font-size: 11px; color: var(--muted); }
.connection:before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #34c759; margin-right: 7px; }
.connection.offline { color: #c1493e; }
.connection.offline:before { background: #ff453a; }
.content { max-width: 1660px; padding: 36px 36px 24px; margin: 0 auto; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.eyebrow { color: var(--muted); font-size: 13px; font-weight: 500; margin-bottom: 8px; }
.page-heading p { font-size: 14px; color: var(--muted); margin: 12px 0 0; line-height: 1.7; }
.heading-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 16px; min-height: 42px; border: 0; border-radius: 11px; background: #f0f0f5; color: #38383e; font-size: 13px; font-weight: 550; line-height: 1.4; white-space: nowrap; text-align: center; }
.button:hover { background: #e6e6ed; }
.button.primary { color: #fff; background: var(--blue-strong); box-shadow: 0 2px 5px #0068df14; }
.button.primary:hover { background: #005dcc; }
.button.subtle { background: #fff; color: #5a5a62; box-shadow: 0 0 0 1px #1c1c1e06; }
.button.small { min-height: 34px; padding: 8px 11px; border-radius: 9px; font-size: 12px; }
.button.danger { background: #fff0ee; color: #c94036; }
.button-icon { width: 18px; height: 18px; }
.heading-actions .button { min-height: 44px; }

/* Grouped overview cards */
.summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.summary>div { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 20px 22px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.summary>div>span:first-child { font-size: 13px; color: #62626a; font-weight: 500; grid-column: 1; grid-row: 1; }
.stat-symbol { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; grid-column: 2; grid-row: 1 / 3; align-self: start; }
.stat-symbol svg { width: 23px; height: 23px; }
.summary strong { grid-column: 1; grid-row: 2; font-family: var(--display); font-size: 35px; font-weight: 650; letter-spacing: -1px; font-variant-numeric: tabular-nums; line-height: 1.35; }
.summary small { grid-column: 1 / -1; font-size: 11px; color: var(--muted); margin-top: 6px; }
#statSubmitted { color: var(--green); }
.flow-card { background: #fff; border-radius: 20px; padding: 21px 24px 24px; box-shadow: var(--shadow); margin-bottom: 24px; min-width: 0; }
.flow-title { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 23px; min-width: 0; }
.flow-title>span { font-size: 14px; font-weight: 600; white-space: nowrap; }
.flow-title small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flow-card ol { display: grid; grid-template-columns: repeat(7, minmax(78px, 1fr)); list-style: none; padding: 0 0 3px; margin: 0; overflow-x: auto; }
.flow-card li { padding: 26px 4px 0; text-align: center; position: relative; color: #7f7f86; font-size: 12px; white-space: nowrap; }
.flow-card li:before { content: ""; position: absolute; top: 3px; left: calc(50% - 6px); width: 12px; height: 12px; border-radius: 50%; border: 2px solid #d5d5df; background: white; z-index: 1; }
.flow-card li:not(:last-child):after { content: ""; position: absolute; top: 8px; left: calc(50% + 6px); right: calc(-50% + 6px); height: 2px; background: #ededf2; }
.flow-card li.done { color: #4d6b57; }
.flow-card li.done:before { background: #34c759; border-color: #34c759; }
.flow-card li.done:after { background: #d8eddf; }
.flow-card li.current { color: #0068df; font-weight: 600; }
.flow-card li.current:before { background: var(--blue); border-color: var(--blue); box-shadow: 0 0 0 4px #007aff15; }
.flow-card li:last-child.current { color: var(--green); }
.flow-card li:last-child.current:before { background: #34c759; border-color: #34c759; box-shadow: 0 0 0 4px #34c75916; }
.flow-card li.skipped { color: #8c8c93; }
.flow-card li.skipped:before { border-style: dashed; background: #f7f7fa; }

/* Queue and inspector */
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.queue-card, .detail-card { min-width: 0; background: var(--surface); border-radius: 22px; box-shadow: var(--shadow); overflow: hidden; }
.queue-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; padding: 24px 24px 20px; }
.queue-toolbar h2 span { display: inline-block; font-size: 13px; color: var(--muted); background: #f2f2f7; padding: 2px 8px; border-radius: 7px; margin-left: 5px; font-weight: 500; }
.queue-toolbar small { display: block; font-size: 12px; color: var(--muted); margin-top: 6px; }
.queue-buttons { display: flex; gap: 7px; flex-wrap: wrap; }
.filterbar { display: flex; gap: 10px; padding: 0 24px 18px; }
.search { display: flex; align-items: center; gap: 8px; padding: 0 12px; min-width: 0; flex: 1; border-radius: 11px; background: #f2f2f7; }
.search span { font-family: system-ui, sans-serif; font-size: 23px; line-height: 1; color: #898991; }
.search input { width: 100%; min-width: 0; height: 40px; border: 0; padding: 0; background: transparent; color: var(--ink); font-size: 13px; }
.search input:focus { outline: none; }
.search:focus-within { box-shadow: 0 0 0 3px #007aff25; }
.filterbar select { border: 0; border-radius: 11px; padding: 8px 12px; font-size: 12px; color: #62626a; background: #f2f2f7; max-width: 150px; }
.table-wrap { min-height: 350px; max-height: 640px; overflow: auto; scrollbar-width: thin; scrollbar-color: #d6d6df transparent; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
thead { position: sticky; top: 0; z-index: 2; background: #fafafc; color: #74747c; }
th { font-size: 11px; font-weight: 550; padding: 13px 14px; border-top: 1px solid #f0f0f5; border-bottom: 1px solid #ededf2; white-space: nowrap; }
th:first-child, td:first-child { width: 45px; padding-left: 24px; }
td { padding: 18px 14px; border-bottom: 1px solid #f0f0f5; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #fafaff; }
tbody tr.active { background: #edf5ff; }
tbody tr.active td:first-child { box-shadow: inset 3px 0 var(--blue); }
.account-name { font-family: var(--mono); font-size: 13px; font-weight: 600; color: #303038; overflow-wrap: anywhere; }
.account-id { color: #74747c; font-family: var(--mono); font-size: 10px; margin-top: 5px; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 7px; background: #f0f0f5; color: #686870; font-size: 11px; font-weight: 500; line-height: 1.3; white-space: nowrap; }
.badge:before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.badge.waiting { background: #fff2de; color: #996000; }
.badge.running, .badge.queued { background: #eaf3ff; color: #0065d5; }
.badge.submitted { background: #e8f6ec; color: #248a3d; }
.badge.unknown, .badge.failed { background: #fff0ee; color: #c2433a; }
.updated { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.queue-footer { display: flex; justify-content: space-between; gap: 12px; padding: 16px 24px; border-top: 1px solid #ededf2; color: var(--muted); font-size: 11px; }
.empty { display: flex; align-items: center; flex-direction: column; text-align: center; padding: 56px 20px; }
.empty-icon { display: grid; place-items: center; width: 64px; height: 64px; font-size: 32px; line-height: 1; color: var(--blue); background: #edf5ff; border-radius: 19px; }
.empty h3 { margin: 22px 0 10px; font-size: 17px; font-weight: 600; }
.empty p { margin: 0 0 22px; font-size: 13px; color: var(--muted); line-height: 1.9; }
.detail-empty { min-height: 488px; padding: 60px 24px 28px; text-align: center; }
.detail-mark { display: inline-grid; place-items: center; height: 58px; width: 58px; border-radius: 18px; background: #f2f2f7; color: #9696a0; font-size: 35px; }
.detail-empty h2 { margin: 21px 0 10px; font-size: 17px; }
.detail-empty p, .detail-note { color: var(--muted); font-size: 13px; line-height: 1.9; }
.detail-note { margin: 28px 8px 0; padding-top: 24px; border-top: 1px solid var(--border); font-size: 12px; }
.detail-head { padding: 24px; background: #fff; border-bottom: 1px solid #ededf2; }
.detail-head small { display: block; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.detail-head h2 { font-size: 19px; margin: 9px 0 11px; overflow-wrap: anywhere; letter-spacing: -.45px; }
.detail-body { padding: 22px 24px; }
.task-message { background: #f4f4f8; border-radius: 12px; padding: 13px 14px; font-size: 12px; color: #66666f; line-height: 1.9; margin-bottom: 20px; }
.automation-card { border-radius: 14px; background: #eff8f1; padding: 16px; margin: 18px 0; }
.automation-card strong { font-size: 12px; font-weight: 600; color: var(--green); }
.automation-card p { margin: 8px 0 0; font-size: 12px; line-height: 1.85; color: #597460; }
.automation-dot { display: inline-block; background: #34c759; width: 6px; height: 6px; border-radius: 50%; margin-right: 7px; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0; }
.detail-actions .button { flex: 1; }
.copy-summary { padding-top: 21px; margin-top: 22px; border-top: 1px solid var(--border); }
.copy-source { font-size: 11px; color: var(--muted); margin-bottom: 10px; }
.copy-summary h3 { color: #37373e; font-size: 14px; margin: 0 0 10px; line-height: 1.7; font-weight: 600; }
.copy-summary p { color: #74747c; font-size: 12px; line-height: 1.95; margin: 0 0 22px; white-space: pre-wrap; max-height: 240px; overflow: auto; }
.advanced-details { padding-top: 17px; border-top: 1px solid var(--border); }
.advanced-details>summary { cursor: pointer; padding: 2px 0 18px; font-size: 12px; color: var(--muted); }
.advanced-details form { padding-top: 9px; }
.field { display: flex; flex-direction: column; gap: 9px; color: #606069; font-size: 13px; font-weight: 500; margin: 0 0 20px; }
.field input, .field textarea, .field select { width: 100%; border: 1px solid transparent; border-radius: 12px; padding: 13px 14px; background: #f2f2f7; color: var(--ink); font-size: 14px; font-weight: 400; line-height: 1.6; }
.field input::placeholder, .field textarea::placeholder, .search input::placeholder { color: #8e8e96; opacity: 1; }
.field textarea { resize: vertical; min-height: 100px; }
.field .counter { margin-top: -3px; font-size: 11px; font-weight: 400; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.check { display: flex; align-items: flex-start; gap: 10px; margin: 16px 0; font-size: 13px; color: #606069; line-height: 1.8; }
.check input { margin-top: 3px; }
.verify-panel { padding: 17px; border-radius: 14px; margin-bottom: 20px; background: #fff7e9; }
.verify-panel h3 { margin: 0 0 8px; color: #9c680e; font-size: 14px; }
.verify-panel p { margin: 8px 0 14px; font-size: 12px; color: #886e40; line-height: 1.9; }
.verify-panel .button { margin: 0 4px 6px 0; white-space: normal; }
.timeline { border-top: 1px solid var(--border); margin-top: 24px; padding-top: 20px; }
.timeline h3 { font-size: 13px; font-weight: 600; margin: 0 0 20px; }
.event { position: relative; border-left: 1px solid #e5e5ed; padding: 0 0 20px 16px; margin-left: 4px; font-size: 11px; color: #74747c; line-height: 1.9; }
.event:before { content: ""; position: absolute; left: -3.5px; top: 7px; width: 6px; height: 6px; background: #c7c7d1; border-radius: 50%; }
.event:first-child:before { background: var(--blue); }
.event time { display: block; font-size: 10px; color: #85858e; margin-top: 3px; font-variant-numeric: tabular-nums; }
.bottom-note { display: flex; gap: 8px; font-size: 11px; color: var(--muted); line-height: 1.9; margin: 24px 2px 0; }
.bottom-note>span { color: #a1a1aa; font-size: 6px; padding-top: 6px; }

/* Native-feeling sheets and forms */
dialog { border: 1px solid #ffffffc4; border-radius: 28px; padding: 30px; width: min(560px, calc(100vw - 40px)); max-height: calc(100dvh - 48px); overflow-y: auto; color: var(--ink); background: #fff; box-shadow: 0 24px 100px #1c1c1e24, 0 3px 18px #1c1c1e0a; scrollbar-width: thin; animation: sheet-in .2s ease-out; }
dialog::backdrop { background: #20202e38; backdrop-filter: blur(8px); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 26px; }
.dialog-heading small { font-family: var(--display); font-size: 11px; font-weight: 600; letter-spacing: 1.2px; color: #8e8e96; }
.dialog-heading h2 { margin: 8px 0 0; font-size: 25px; font-weight: 700; line-height: 1.4; letter-spacing: -.7px; }
.icon-button { display: grid; place-items: center; flex: 0 0 30px; width: 30px; height: 30px; padding: 0 0 2px; border: 0; border-radius: 50%; background: #f0f0f5; color: #8a8a92; font-size: 24px; font-family: system-ui, sans-serif; line-height: 1; }
.icon-button:hover { background: #e8e8ef; color: #5a5a64; }
.muted { color: #74747c; font-size: 13px; line-height: 1.9; margin-bottom: 22px; }
.helper { color: var(--muted); font-size: 12px; line-height: 1.9; font-weight: 400; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 26px; }
.dialog-actions .button { min-height: 44px; padding-inline: 19px; }
.file-picker { display: block; padding: 22px 16px; text-align: center; color: var(--blue-strong); background: #f5f8ff; border: 1px dashed #b5cff3; border-radius: 15px; font-size: 13px; margin: 20px 0; }
.file-picker input { display: block; margin: 13px auto 0; max-width: 100%; font-size: 12px; }
.import-switch { display: flex; gap: 3px; padding: 4px; background: #eeeef3; border-radius: 12px; margin: 0 0 26px; }
.import-switch button { flex: 1; min-height: 38px; border: 0; border-radius: 9px; background: transparent; color: #74747c; font-size: 13px; font-weight: 500; }
.import-switch button[aria-pressed=true] { background: #fff; color: var(--ink); box-shadow: 0 2px 5px #1c1c1e13; }
.verification-account { display: flex; align-items: center; justify-content: space-between; gap: 14px; border-radius: 13px; padding: 16px; margin-bottom: 22px; background: #f2f2f7; }
.verification-account span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.verification-account strong { font-family: var(--mono); font-size: 14px; font-weight: 550; color: #44444d; overflow-wrap: anywhere; text-align: right; }
#verificationCode { background: #f2f2f7; font-family: var(--mono); font-size: 29px; font-variant-numeric: tabular-nums; letter-spacing: 9px; text-align: center; padding: 18px 10px; }
#verificationCode::placeholder { font-family: var(--display); font-size: 14px; letter-spacing: 0; }
.verification-error { font-size: 13px; line-height: 1.8; color: #b73930; background: #fff1ef; border-radius: 12px; padding: 12px 14px; }
.verification-links { display: flex; gap: 8px; flex-wrap: wrap; }
.verification-links .button { font-size: 12px; }
#verificationDialog .dialog-actions { padding-top: 22px; border-top: 1px solid var(--border); }
.followup-summary { background: #f0f6ff; padding: 17px; border-radius: 14px; margin: 20px 0; }
.followup-summary strong { font-size: 13px; color: #346391; }
.followup-summary p { font-size: 12px; line-height: 1.9; color: #607794; margin: 9px 0 14px; font-variant-numeric: tabular-nums; }
.followup-summary .button { background: #fff; color: #0068df; }
.followup-window { padding: 21px; margin: 24px 0 18px; border-radius: 18px; background: #edf5ff; }
.followup-window span { display: block; color: #5f7a9d; font-size: 12px; margin-bottom: 12px; line-height: 1.8; }
.followup-window strong { display: block; color: #0065d4; font-family: var(--display); font-size: 20px; font-weight: 650; line-height: 1.65; letter-spacing: -.2px; font-variant-numeric: tabular-nums; }
.followup-timing { font-size: 14px; color: #526a88; line-height: 1.9; }
#followupTitle:focus { outline: none; }
#followupDialog .helper { color: #777780; }
#toast { display: none; position: fixed; z-index: 100; bottom: 28px; left: 50%; transform: translateX(-50%); max-width: min(560px, calc(100vw - 32px)); padding: 15px 22px; border-radius: 18px; background: #303038ed; color: #fff; font-size: 13px; line-height: 1.7; box-shadow: 0 8px 32px #1c1c1e22; backdrop-filter: blur(18px); }
@keyframes sheet-in { from { translate: 0 12px; } to { translate: 0 0; } }

@media (min-width: 1700px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 390px; gap: 26px; }
  .summary>div { padding: 23px 26px; }
  .summary strong { font-size: 38px; }
}
@media (max-width: 1250px) {
  .sidebar { width: 206px; padding-inline: 13px; }
  main { margin-left: 206px; }
  .content { padding: 28px 24px 22px; }
  .topbar { padding-inline: 24px; }
  .workspace { grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; }
  .summary { gap: 10px; }
  .summary>div { padding: 18px 16px; gap: 3px 7px; }
  .stat-symbol { width: 30px; height: 30px; border-radius: 10px; }
  .stat-symbol svg { width: 21px; height: 21px; }
  .summary small { font-size: 10px; }
  .page-heading { gap: 18px; }
  .page-heading p { font-size: 13px; }
  .queue-toolbar, .detail-head { padding: 21px; }
  .filterbar { padding-inline: 21px; }
  .detail-body { padding: 20px; }
}
@media (max-width: 1080px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .detail-empty { min-height: 220px; padding: 30px; }
  .detail-note { margin: 20px 8px 0; }
  .page-heading { align-items: flex-start; }
  .heading-actions { flex-direction: column-reverse; align-items: stretch; gap: 8px; }
  .summary>div { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 8px; }
  .summary .stat-symbol { order: -1; }
  .summary strong { width: 100%; font-size: 32px; }
  .summary small { display: none; }
  .flow-card { padding-inline: 18px; }
  .queue-buttons .button { min-height: 38px; }
}
@media (max-width: 760px) {
  .sidebar { position: sticky; top: 0; width: 100%; padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 13px; border-right: 0; border-bottom: 1px solid #dedee680; background: #f7f7faed; }
  .brand { gap: 10px; padding: 0 3px; }
  .brand img { width: 35px; height: 35px; border-radius: 10px; }
  .brand span { font-size: 20px; }
  .brand small { display: inline; font-size: 11px; font-weight: 450; margin-left: 11px; }
  .workspace-label, .sidebar-bottom { display: none; }
  .sidebar nav { display: flex; gap: 3px; padding: 4px; margin-top: 15px; border-radius: 12px; background: #e9e9f0; }
  .nav { justify-content: center; flex: 1; width: auto; min-height: 44px; padding: 8px 5px; margin: 0; gap: 6px; border-radius: 9px; font-size: 12px; white-space: nowrap; }
  .nav.active { background: #fff; color: var(--ink); box-shadow: 0 2px 5px #1c1c1e10; }
  .nav:hover { background: #ffffff70; }
  .nav.active:hover { background: #fff; }
  .nav-symbol { background: transparent; width: 18px; height: 18px; flex-basis: 18px; }
  .nav-symbol svg { width: 19px; height: 19px; }
  .nav b { min-width: 10px; margin-left: 0; font-size: 11px; }
  .nav.active b { color: #74747c; }
  main { margin: 0; }
  .topbar { position: static; height: 54px; padding: 0 20px; border: 0; background: transparent; font-size: 11px; }
  .topbar>span { color: #8e8e96; }
  .topbar>div { gap: 12px; }
  .topbar .mode { display: none; }
  .topbar .connection { font-size: 10px; }
  .topbar .button { min-height: 44px; background: #e8e8ef; }
  .slash { padding: 0 6px; }
  .content { padding: 12px 18px calc(28px + env(safe-area-inset-bottom, 0px)); }
  h1 { font-size: 34px; letter-spacing: -1px; }
  .eyebrow { font-size: 12px; margin-bottom: 7px; }
  .page-heading { display: block; margin-bottom: 25px; }
  .page-heading p { font-size: 13px; line-height: 1.8; margin-top: 10px; }
  .heading-actions { display: flex; flex-direction: row; gap: 10px; margin-top: 21px; }
  .heading-actions .button.primary { order: -1; }
  .button { min-height: 44px; font-size: 13px; padding: 11px 14px; }
  .button.small { min-height: 44px; padding: 10px 11px; font-size: 12px; }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
  .summary>div { display: grid; grid-template-columns: 1fr auto; padding: 17px; border-radius: 18px; gap: 3px 8px; }
  .summary>div>span:first-child { font-size: 12px; }
  .summary .stat-symbol { order: 0; width: 30px; height: 30px; }
  .summary strong { width: auto; font-size: 33px; }
  .summary small { display: block; font-size: 10px; margin-top: 4px; }
  .flow-card { border-radius: 19px; padding: 18px 17px 19px; margin-bottom: 20px; }
  .flow-title { margin-bottom: 20px; gap: 12px; }
  .flow-title>span { font-size: 13px; }
  .flow-title small { font-size: 11px; max-width: 69%; }
  .flow-card ol { grid-template-columns: repeat(7, 89px); padding-bottom: 8px; scrollbar-width: none; }
  .flow-card li { font-size: 11px; }
  .workspace { gap: 20px; }
  .queue-card, .detail-card { border-radius: 20px; }
  .queue-toolbar { padding: 20px 17px 16px; gap: 17px; }
  .queue-toolbar h2 { font-size: 17px; }
  .queue-toolbar small { font-size: 11px; }
  .queue-buttons { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; width: 100%; }
  .queue-buttons .button { padding: 10px 5px; font-size: 11px; min-height: 44px; }
  .filterbar { padding: 0 17px 16px; gap: 8px; }
  .search { padding-inline: 10px; }
  .search input { height: 44px; font-size: 13px; }
  .filterbar select { font-size: 11px; max-width: 105px; padding-inline: 8px; }
  th:first-child, td:first-child { width: 32px; padding-left: 14px; padding-right: 4px; }
  th, td { padding: 16px 7px; }
  th { font-size: 10px; }
  .account-name { font-size: 11px; }
  .account-id { font-size: 9px; max-width: 108px; overflow: hidden; text-overflow: ellipsis; }
  .badge { font-size: 10px; padding: 5px 7px; gap: 4px; }
  .updated { font-size: 10px; }
  .table-wrap { min-height: 280px; }
  .queue-footer { padding: 15px 17px; font-size: 10px; flex-wrap: wrap; gap: 5px; }
  .detail-head { padding: 22px; }
  .detail-body { padding: 20px 22px; }
  .detail-head h2 { font-size: 20px; }
  .detail-empty { padding: 32px 20px; }
  .bottom-note { font-size: 10px; margin-top: 20px; }
  dialog { position: fixed; inset: auto 0 0; margin: 0; width: 100%; max-width: 100%; max-height: calc(100dvh - 30px - env(safe-area-inset-top, 0px)); border-radius: 28px 28px 0 0; border: 0; padding: 35px 24px calc(24px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -12px 60px #1c1c1e1c; overscroll-behavior: contain; }
  dialog::before { content: ""; position: absolute; top: 11px; left: calc(50% - 18px); width: 36px; height: 5px; border-radius: 4px; background: #d6d6dd; }
  .dialog-heading { margin-bottom: 24px; }
  .dialog-heading small { font-size: 10px; letter-spacing: .8px; }
  .dialog-heading h2 { font-size: 24px; }
  .icon-button { width: 44px; height: 44px; flex-basis: 44px; margin: -5px -6px 0 0; background: #f4f4f7; font-size: 27px; }
  .field input, .field textarea, .field select { font-size: 16px; }
  .import-switch button { min-height: 44px; }
  .verification-account { padding: 15px; }
  .verification-account strong { font-size: 12px; }
  .dialog-actions { margin-top: 25px; }
  .dialog-actions .button { flex: 1; padding-inline: 12px; }
  .followup-window { padding: 18px; border-radius: 16px; }
  .followup-window strong { font-size: 19px; }
  .followup-window span { font-size: 11px; }
  .followup-timing { font-size: 13px; }
  #toast { bottom: calc(20px + env(safe-area-inset-bottom, 0px)); border-radius: 16px; font-size: 12px; }
}
@media (max-width: 370px) {
  .content { padding-inline: 14px; }
  .sidebar { padding-inline: 12px; }
  .topbar { padding-inline: 16px; }
  .topbar>span { display: none; }
  .topbar>div { width: 100%; justify-content: space-between; }
  .nav { font-size: 11px; gap: 4px; }
  .nav-symbol { display: none; }
  .summary>div { padding: 15px; }
  .summary small { font-size: 9px; }
  .summary .stat-symbol { width: 27px; height: 27px; }
  .updated { font-size: 9px; }
  .badge { font-size: 9px; }
  dialog { padding-inline: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
