:root {
  --ink: #202330;
  --muted: #8b91a3;
  --line: #e9eaf0;
  --surface: #fff;
  --primary: #6754e8;
  --primary-dark: #5140cf;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: #f6f7fb; font-family: -apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.eyebrow { color: #7a69e7; font-size: 9px; font-weight: 800; letter-spacing: .2em; }
.eyebrow.light { color: rgba(255,255,255,.72); }
.auth-shell { min-height: 100vh; display: grid; place-items: center; overflow: hidden; position: relative; padding: 24px; background: linear-gradient(145deg,#f6f5fb,#fff 54%,#f2f4fb); }
.auth-glow { position: absolute; width: 340px; height: 340px; border-radius: 50%; filter: blur(14px); opacity: .52; }
.glow-one { top: -150px; left: -90px; background: radial-gradient(circle,#d9d0ff,transparent 68%); }
.glow-two { right: -80px; bottom: -160px; background: radial-gradient(circle,#ffd8bd,transparent 68%); }
.auth-card { width: min(410px,100%); z-index: 1; padding: 36px; border: 1px solid #e8e8ef; border-radius: 22px; background: #fff; box-shadow: 0 24px 70px rgba(38,42,59,.1); }
.logo { width: 49px; height: 49px; display: grid; place-items: center; margin-bottom: 20px; border-radius: 15px; color: #fff; background: linear-gradient(145deg,#7d68f4,#5943da); box-shadow: 0 13px 28px rgba(91,69,218,.26); font-weight: 900; }
.logo.small { width: 38px; height: 38px; margin: 0; border-radius: 12px; }
.auth-card h1 { margin: 0 0 25px; font-size: 26px; letter-spacing: -.035em; text-align: center; }
.auth-card > p { margin: 0 0 24px; color: var(--muted); font-size: 12px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 18px; padding: 4px; border-radius: 11px; background: #f1f1f6; }
.auth-tabs button { padding: 9px; border: 0; border-radius: 8px; color: #8b91a3; background: transparent; font-size: 11px; font-weight: 700; }
.auth-tabs button.active { color: #5140cf; background: #fff; box-shadow: 0 4px 12px rgba(45,48,65,.08); }
form { display: grid; gap: 14px; }
label { display: grid; gap: 7px; color: #5b6274; font-size: 11px; font-weight: 700; }
input, select, textarea { width: 100%; padding: 11px 12px; border: 1px solid #dfe1e9; border-radius: 10px; outline: none; color: var(--ink); background: #fff; }
input:focus, select:focus, textarea:focus { border-color: #8d7bf3; box-shadow: 0 0 0 3px rgba(103,84,232,.1); }
.primary, .outline, .ghost, .icon-button { border-radius: 10px; }
.primary { padding: 11px 15px; border: 0; color: #fff; background: linear-gradient(135deg,#725ff0,#5945d8); box-shadow: 0 9px 18px rgba(88,67,211,.2); }
.primary.small { padding: 8px 11px; font-size: 10px; }
.wide { width: 100%; margin-top: 2px; }
.outline { padding: 9px 13px; border: 1px solid #dcdde5; color: #6154c9; background: #fff; }
.ghost { padding: 8px 12px; border: 0; color: #7b8192; background: #f1f2f6; }
.form-message { min-height: 18px; color: #c94e5c; font-size: 11px; line-height: 1.6; }
.form-message.success { color: #1d9870; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 232px minmax(0,1fr); }
.sidebar { position: relative; min-height: 100vh; display: flex; flex-direction: column; padding: 23px 16px; color: #fff; background: linear-gradient(180deg,#202435,#181b29); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 7px 29px; }
.brand strong, .brand span { display: block; }
.brand strong { font-size: 14px; }
.brand span { margin-top: 4px; color: #858da6; font-size: 9px; letter-spacing: .08em; }
.sidebar nav { display: grid; gap: 6px; padding-bottom: 18px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 0; border-radius: 11px; color: #969db1; background: transparent; text-align: left; }
.nav-item i { width: 20px; color: #7f879d; font-style: normal; font-size: 17px; text-align: center; }
.nav-item.active { color: #fff; background: linear-gradient(135deg,#7562ee,#5542ce); box-shadow: 0 13px 26px rgba(43,31,129,.3); }
.nav-item.active i { color: #fff; }
.sidebar-foot { display: flex; gap: 10px; margin-top: auto; padding: 13px; border: 1px solid rgba(255,255,255,.07); border-radius: 12px; background: rgba(255,255,255,.035); }
.sidebar-foot strong, .sidebar-foot small { display: block; }
.sidebar-foot strong { font-size: 11px; }
.sidebar-foot small { margin-top: 3px; color: #7e879d; font-size: 9px; }
.live-dot { width: 8px; height: 8px; margin-top: 3px; border-radius: 50%; background: #38c799; box-shadow: 0 0 0 4px rgba(56,199,153,.12); }
main { min-width: 0; }
header { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 31px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.88); backdrop-filter: blur(14px); }
header h2 { margin: 4px 0 0; font-size: 19px; }
.mobile-menu { display: none; border: 0; background: transparent; font-size: 20px; }
.page { padding: 26px 31px 42px; }
.hero { min-height: 166px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 31px 37px; border-radius: 22px; color: #fff; background: radial-gradient(circle at 80% 10%,rgba(255,255,255,.18),transparent 25%),linear-gradient(120deg,#5141cf,#765ff0 58%,#8a6ff6); box-shadow: 0 22px 45px rgba(70,52,190,.2); }
.hero h3 { margin: 9px 0; font-size: 27px; }
.hero p { margin: 0; color: rgba(255,255,255,.75); font-size: 12px; }
.plan-badge { padding: 10px 14px; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; background: rgba(255,255,255,.13); font-size: 11px; font-weight: 800; }
.metrics { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin: 18px 0; }
.metrics article, .panel, .device-card { border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: 0 8px 24px rgba(35,42,66,.04); }
.metrics article { padding: 19px 21px; }
.metrics span, .metrics small { display: block; color: var(--muted); font-size: 11px; }
.metrics strong { display: block; margin: 7px 0 4px; font-size: 28px; }
.panel { padding: 20px; }
.panel-head, .page-head, .modal-head, .modal-actions, .device-card-head, .plan-title { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.panel-head, .page-head { margin-bottom: 15px; }
.page-actions { display: flex; align-items: center; gap: 8px; }
.panel-head h3, .page-head h3, .modal-head h3 { margin: 0; }
.panel-head p, .page-head p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.summary-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; }
.summary-grid > div { padding: 14px; border-radius: 12px; background: #f8f8fb; }
.summary-grid span, .summary-grid strong { display: block; }
.summary-grid span { color: var(--muted); font-size: 10px; }
.summary-grid strong { margin-top: 6px; font-size: 12px; }
.device-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 15px; }
.list-toolbar { display: grid; grid-template-columns: minmax(220px,1fr) 150px auto; align-items: center; gap: 10px; margin-bottom: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.list-toolbar input, .list-toolbar select { padding: 9px 11px; font-size: 10px; }
.list-toolbar span { color: var(--muted); font-size: 9px; white-space: nowrap; }
.device-card { padding: 19px; }
.device-icon { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 12px; color: #fff; background: linear-gradient(145deg,#7c69f3,#5a44d8); }
.online-pill { padding: 5px 8px; border-radius: 999px; color: #16825f; background: #e8f8f2; font-size: 9px; font-weight: 800; }
.online-pill.offline { color: #8c92a1; background: #f0f1f4; }
.device-card h3 { margin: 16px 0 5px; font-size: 15px; }
.device-card > p { margin: 0 0 15px; color: #9aa0ae; font-size: 9px; word-break: break-all; }
.device-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.device-facts span, .device-facts b { display: block; }
.device-facts span { color: var(--muted); font-size: 9px; }
.device-facts b { margin-top: 4px; color: #51586a; font-size: 10px; }
.robot-manager { padding: 0; overflow: hidden; }
.robot-manager > .panel-head { margin: 0; padding: 20px 20px 14px; }
.device-group-tabs { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 20px 14px; border-bottom: 1px solid var(--line); }
.device-group-tabs button { padding: 7px 11px; border: 1px solid #e1e1e9; border-radius: 9px; color: #747b8e; background: #fff; font-size: 10px; font-weight: 700; }
.device-group-tabs button.active { border-color: #6754e8; color: #fff; background: linear-gradient(135deg,#725ff0,#5945d8); box-shadow: 0 7px 15px rgba(88,67,211,.15); }
.device-group-tabs button.danger { margin-left: auto; border-color: #ffdfe3; color: #c84e5a; background: #fff4f5; }
.robot-filter-bar { display: grid; grid-template-columns: minmax(220px,1fr) 130px auto; align-items: center; gap: 9px; padding: 13px 20px; background: #fafafd; }
.robot-filter-bar input, .robot-filter-bar select { padding: 9px 10px; font-size: 10px; }
.robot-filter-bar span { color: var(--muted); font-size: 9px; white-space: nowrap; }
.robot-table-wrap { width: 100%; overflow-x: auto; }
.robot-table { width: 100%; min-width: 1030px; border-collapse: collapse; color: #535a6c; font-size: 10px; }
.robot-table th, .robot-table td { padding: 13px 10px; border-bottom: 1px solid #eeeeF3; text-align: left; vertical-align: middle; }
.robot-table th { color: #9298a8; background: #fff; font-size: 9px; font-weight: 700; white-space: nowrap; }
.robot-table tbody tr:hover { background: #fcfbff; }
.robot-table tbody tr:last-child td { border-bottom: 0; }
.robot-table input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--primary); }
.robot-name { display: grid; gap: 4px; min-width: 165px; }
.robot-name strong { color: #303646; font-size: 11px; }
.robot-name small { color: #9aa0ae; font-size: 8px; }
.pending-link { width: fit-content; padding: 0; border: 0; color: #d14f61; background: transparent; font-size: 8px; }
.group-badge, .role-badge, .status-badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 7px; border-radius: 7px; font-size: 8px; font-weight: 800; white-space: nowrap; }
.group-badge { color: #665bc0; background: #f0effd; }
.role-badge.collector { color: #2874af; background: #eaf5ff; }
.role-badge.sender { color: #8e621f; background: #fff4df; }
.status-badge.online { color: #16825f; background: #e8f8f2; }
.status-badge.offline { color: #8c92a1; background: #f0f1f4; }
.status-badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.muted-value { color: #a1a6b2; font-size: 9px; }
.robot-actions { display: flex; flex-wrap: wrap; gap: 5px; min-width: 190px; }
.robot-actions button { padding: 6px 8px; border: 0; border-radius: 7px; color: #6559c8; background: #f0effc; font-size: 8px; white-space: nowrap; }
.robot-actions button.primary-action { color: #fff; background: #6754e8; }
.robot-actions button.danger-action { color: #c84e5a; background: #fff1f2; }
.robot-manager button:disabled { cursor: not-allowed; opacity: .45; }
.workspace-tabs { display: flex; gap: 6px; margin: -3px -3px 20px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.workspace-tabs button { padding: 9px 14px; border: 0; border-radius: 9px; color: #858b9d; background: #f4f4f8; font-size: 10px; font-weight: 800; }
.workspace-tabs button.active { color: #fff; background: linear-gradient(135deg,#725ff0,#5945d8); box-shadow: 0 8px 17px rgba(88,67,211,.17); }
.plan-section { margin: 0; }
.workspace-search { margin-bottom: 12px; font-size: 10px; }
.plan-list { display: grid; gap: 10px; }
.plan-card { padding: 15px; border: 1px solid #ececf2; border-radius: 13px; background: #fcfcfe; }
.plan-title > div:first-child { display: flex; align-items: center; gap: 8px; }
.plan-title strong { font-size: 12px; }
.state-dot { padding: 4px 7px; border-radius: 999px; color: #16825f; background: #e8f8f2; font-size: 8px; font-weight: 800; }
.state-dot.off { color: #8d92a0; background: #eff0f3; }
.row-actions { display: flex; gap: 5px; }
.row-actions button { padding: 6px 8px; border: 0; border-radius: 7px; color: #6559c8; background: #f0effc; font-size: 9px; }
.row-actions button.danger { color: #c84e5a; background: #fff1f2; }
.plan-card p, .plan-card small { display: block; margin: 9px 0 0; color: var(--muted); font-size: 10px; }
.group-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.group-tags span { padding: 5px 7px; border-radius: 7px; color: #665bc0; background: #f0effd; font-size: 9px; }
.group-tags em { color: #a0a5b1; font-size: 9px; font-style: normal; }
.managed-badge { margin-top: 10px; color: #946829; font-size: 9px; }
.managed-badge.active { color: #207d62; }
.task-flow { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.task-flow span { padding: 6px 9px; border-radius: 8px; color: #5c52b9; background: #f0effc; font-size: 10px; }
.task-flow b { color: #a6a9b3; }
.notice { padding: 18px; border: 1px solid #ffe1ac; border-radius: 13px; color: #8c641e; background: #fff8e9; font-size: 12px; }
.feature-state { min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.feature-state-icon { width: 64px; height: 64px; display: grid; place-items: center; margin-bottom: 16px; border-radius: 20px; color: #9ba0ad; background: #f0f1f5; font-size: 30px; }
.feature-state-icon.active { color: #fff; background: linear-gradient(145deg,#7c69f3,#5a44d8); box-shadow: 0 13px 28px rgba(91,69,218,.22); }
.feature-state h3 { margin: 0; font-size: 18px; }
.feature-state p { max-width: 520px; margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.feature-link { display: inline-block; margin-top: 20px; text-decoration: none; }
.page-list-toolbar { display: grid; grid-template-columns: minmax(220px,1fr) 130px minmax(260px,1fr); align-items: center; gap: 9px; margin-bottom: 13px; }
.page-list-toolbar input, .page-list-toolbar select { padding: 9px 10px; font-size: 10px; }
.page-list-toolbar span { color: var(--muted); font-size: 9px; line-height: 1.6; }
.customer-page-list { width: 100%; overflow-x: auto; color: var(--muted); font-size: 10px; }
.customer-page-list table { width: 100%; min-width: 900px; border-collapse: collapse; }
.customer-page-list th, .customer-page-list td { padding: 12px 9px; border-bottom: 1px solid var(--line); color: #555d70; text-align: left; }
.customer-page-list th { color: var(--muted); font-size: 9px; }
.customer-page-list .badge { display: inline-flex; padding: 5px 7px; border-radius: 7px; font-size: 8px; white-space: nowrap; }
.customer-page-list .b-online { color: #16825f; background: #e8f8f2; }
.customer-page-list .b-offline { color: #8c92a1; background: #f0f1f4; }
.btn { padding: 7px 10px; border: 1px solid #dfe1e9; border-radius: 8px; color: #6559c8; background: #fff; font-size: 9px; }
.btn-p { border-color: transparent; color: #fff; background: #6754e8; }
.btn-success { border-color: transparent; color: #fff; background: #30a879; }
.btn-s { padding: 5px 7px; font-size: 8px; }
.btn-w { color: #6559c8; background: #f0effc; }
.btn-d { border-color: transparent; color: #c84e5a; background: #fff1f2; }
.customer-page-editor { position: fixed; z-index: 300; inset: 0; overflow: auto; background: #f5f6fa; }
.customer-page-editor-head { position: sticky; z-index: 10; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 12px 20px; border-bottom: 1px solid #e7e8ee; background: rgba(255,255,255,.96); backdrop-filter: blur(12px); }
.customer-page-editor-title, .customer-page-editor-actions { display: flex; align-items: center; gap: 9px; }
.customer-page-editor-title input { width: 230px; padding: 7px 9px; border: 0; font-size: 15px; font-weight: 800; }
.customer-page-editor-actions label { display: flex; align-items: center; grid-auto-flow: column; gap: 5px; color: #676e80; font-size: 9px; }
.customer-page-editor-actions input[type="color"] { width: 30px; height: 30px; padding: 2px; }
.customer-page-editor-actions input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--primary); }
.customer-page-editor-body { max-width: 1400px; min-height: calc(100vh - 58px); display: grid; grid-template-columns: 375px minmax(340px,1fr) 280px; align-items: start; gap: 16px; margin: 0 auto; padding: 16px; }
.customer-editor-card { padding: 16px; border: 1px solid #e8e9ef; border-radius: 15px; background: #fff; box-shadow: 0 8px 24px rgba(35,42,66,.05); }
.customer-editor-card.sticky { position: sticky; top: 74px; }
.customer-editor-card > h3 { margin: 0 0 12px; color: #343a49; font-size: 12px; }
.customer-editor-card > h3 span { color: var(--muted); font-weight: 500; }
#pePreview { min-height: 500px; max-height: 70vh; overflow-y: auto; border-radius: 9px; background: #fff; }
.editor-empty { padding: 40px 0; color: #bbb; text-align: center; }
.customer-module-buttons { display: grid; gap: 6px; }
.customer-module-buttons small { margin-top: 4px; color: #999; font-size: 8px; }
.customer-module-buttons .btn { text-align: left; background: #f8f8fa; }
.security-card { width: min(560px,100%); display: grid; gap: 15px; }
.empty { padding: 25px; color: var(--muted); font-size: 11px; text-align: center; }
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 22px; background: rgba(19,23,36,.55); backdrop-filter: blur(5px); }
.modal-card { width: min(650px,100%); max-height: calc(100vh - 44px); overflow: auto; padding: 24px; border-radius: 20px; background: #fff; box-shadow: 0 35px 90px rgba(18,21,34,.25); }
.modal-card.plan-modal-card { width: min(820px,100%); }
.modal-head { margin-bottom: 20px; }
.icon-button { width: 34px; height: 34px; border: 0; color: #777e8f; background: #f1f2f5; font-size: 18px; }
fieldset { padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
legend { padding: 0 6px; color: #666d7e; font-size: 11px; font-weight: 800; }
.group-picker-toolbar { display: grid; grid-template-columns: minmax(180px,1fr) auto auto; align-items: center; gap: 10px; margin-bottom: 12px; }
.group-picker-toolbar span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.group-picker-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; }
.group-picker-grid > div { min-width: 0; padding: 12px; border: 1px solid #e9e8f1; border-radius: 12px; background: #fbfbfd; }
.group-picker-grid > div > strong { display: block; margin-bottom: 9px; color: #4e5567; font-size: 13px; }
.group-options { max-height: 235px; display: grid; grid-template-columns: 1fr; gap: 7px; overflow: auto; }
.group-options label { display: flex; align-items: center; gap: 7px; padding: 8px; border-radius: 8px; background: #f7f7fa; }
.group-options label:has(input:checked) { color: #5145b0; background: #efedff; }
.group-options label span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selected-group-options { max-height: 235px; display: flex; align-content: flex-start; flex-wrap: wrap; gap: 7px; overflow: auto; }
.selected-group-options button { max-width: 100%; display: flex; align-items: center; gap: 7px; padding: 7px 9px; border: 1px solid #ded9ff; border-radius: 8px; color: #5145b0; background: #f2f0ff; font-size: 12px; }
.selected-group-options button span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-options input, .enabled-check input { width: 15px; height: 15px; accent-color: var(--primary); }
.enabled-check { display: flex; align-items: center; gap: 8px; }
.enabled-check.affiliate-switch { justify-content: space-between; padding: 13px; border-radius: 12px; background: #f6f4ff; }
.affiliate-switch span, .affiliate-switch small { display: block; }
.affiliate-switch small { margin-top: 4px; color: var(--muted); font-size: 9px; font-weight: 500; }
.affiliate-plan-fields { display: grid; gap: 10px; padding: 13px; border: 1px solid #ebe8ff; border-radius: 12px; }
.affiliate-token-format-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; padding: 13px; border: 1px solid #ebe8ff; border-radius: 12px; background: #faf9ff; }
.affiliate-token-format-grid small { grid-column: 1 / -1; color: var(--muted); }
.affiliate-plan-row { display: grid; grid-template-columns: 70px 105px minmax(0,1fr) minmax(150px,.7fr); align-items: center; gap: 9px; padding: 5px 0; }
.affiliate-plan-row strong { font-size: 10px; }
.affiliate-plan-row.excluded { opacity: .7; }
.affiliate-exclude-check { display: flex; grid-auto-flow: column; grid-template-columns: 16px auto; align-items: center; justify-content: start; gap: 6px; color: #6d647e; font-size: 12px; white-space: nowrap; }
.affiliate-exclude-check input { width: 16px; height: 16px; accent-color: var(--primary); }
.affiliate-tabs { display: flex; gap: 6px; margin: -2px -2px 20px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.affiliate-tabs button { padding: 9px 14px; border: 0; border-radius: 9px; color: #858b9d; background: #f4f4f8; font-size: 10px; font-weight: 800; }
.affiliate-tabs button.active { color: #fff; background: linear-gradient(135deg,#725ff0,#5945d8); }
.affiliate-account-table { width: 100%; border-collapse: collapse; font-size: 10px; }
.affiliate-account-table th, .affiliate-account-table td { padding: 12px 9px; border-bottom: 1px solid var(--line); text-align: left; }
.affiliate-account-table th { color: var(--muted); font-size: 9px; }
.affiliate-account-table td { color: #52596b; }
.affiliate-account-table .row-actions { justify-content: flex-end; }
.affiliate-test-panel { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--line); }
.affiliate-test-form { display: grid; grid-template-columns: minmax(220px,.7fr) minmax(360px,1.3fr) auto; align-items: end; gap: 14px; }
.affiliate-test-form label { display: grid; gap: 8px; color: #596074; font-size: 13px; font-weight: 700; }
.affiliate-test-form select, .affiliate-test-form textarea, .affiliate-test-form input {
  width: 100%; padding: 12px 13px; color: #343a4c; background: #fbfbfe;
  border: 1px solid #dedfea; border-radius: 11px; font: 13px/1.6 inherit; outline: none;
}
.affiliate-test-form select:focus, .affiliate-test-form textarea:focus, .affiliate-test-form input:focus { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(101,91,243,.1); }
.affiliate-test-form textarea { min-height: 112px; resize: vertical; }
.affiliate-test-account { grid-column: 1; grid-row: 1; }
.affiliate-test-input { grid-column: 2; grid-row: 1 / span 2; }
.affiliate-test-format { grid-column: 1; grid-row: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.affiliate-test-format small { grid-column: 1 / -1; color: var(--muted); font-size: 12px; font-weight: 500; }
.affiliate-test-form .primary { min-width: 112px; margin-bottom: 2px; }
.affiliate-test-message { min-height: 24px; margin-top: 12px; color: var(--muted); font-size: 13px; font-weight: 650; }
.affiliate-test-message.testing { color: #6257e8; }
.affiliate-test-message.success { color: #16805e; }
.affiliate-test-message.failed { color: #c44f56; }
.affiliate-test-result { margin-top: 12px; padding: 14px; background: #f7f8fc; border: 1px solid #e4e6ef; border-radius: 12px; }
.affiliate-test-result > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; font-size: 13px; }
.affiliate-test-result textarea { width: 100%; min-height: 86px; padding: 11px 12px; color: #303648; background: #fff; border: 1px solid #dfe2eb; border-radius: 10px; font: 13px/1.65 inherit; resize: vertical; }
.empty.soft { border-radius: 12px; background: #f8f8fb; }
.modal-card.compact { width: min(480px,100%); }
.modal-actions { margin-top: 5px; justify-content: flex-end; }
.moment-workspace { display: grid; grid-template-columns: minmax(360px,.9fr) minmax(420px,1.1fr); gap: 16px; align-items: start; }
.moment-composer { display: grid; gap: 14px; }
.moment-field { display: grid; gap: 9px; }
.field-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #5b6274; }
.field-title strong { font-size: 11px; }
.field-title span { color: var(--muted); font-size: 9px; font-weight: 500; text-align: right; }
.moment-pick-button { width: fit-content; }
.moment-comment-editor { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 9px; align-items: stretch; }
.moment-comment-editor button { min-width: 92px; }
.moment-comment-list { display: grid; gap: 7px; }
.moment-comment-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 10px 11px; border: 1px solid #ebeaf5; border-radius: 10px; background: #f8f7fd; }
.moment-comment-item span { min-width: 0; display: flex; align-items: flex-start; gap: 9px; }
.moment-comment-item b { width: 20px; height: 20px; flex: 0 0 20px; display: grid; place-items: center; border-radius: 6px; color: #fff; background: var(--primary); font-size: 9px; }
.moment-comment-item em { color: #555d70; font-size: 10px; font-style: normal; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.moment-comment-item button, .moment-image-preview button { width: 22px; height: 22px; flex: 0 0 22px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; color: #c84e5a; background: #fff0f2; font-size: 15px; }
.moment-device-toolbar { display: grid; grid-template-columns: minmax(180px,.85fr) minmax(0,1.15fr); gap: 10px; align-items: center; margin: -2px 0 9px; }
.moment-device-toolbar input { padding: 8px 10px; font-size: 10px; }
.moment-device-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.moment-device-actions span { margin-left: auto; color: var(--muted); font-size: 9px; }
.text-button { padding: 0; border: 0; color: var(--primary); background: transparent; font-size: 10px; font-weight: 800; }
.moment-device-options { max-height: 300px; display: grid; grid-template-columns: 1fr; gap: 8px; overflow: auto; }
.moment-device-group { overflow: hidden; border: 1px solid #ebe9f5; border-radius: 11px; background: #faf9fd; }
.moment-device-group-head { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 8px; }
.moment-device-group-toggle { min-width: 0; display: grid; grid-template-columns: 22px minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 2px 3px; border: 0; color: #454b5d; background: transparent; text-align: left; }
.moment-device-group-toggle > span { min-width: 0; display: block; }
.moment-device-group-toggle strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.moment-device-group-toggle small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.moment-device-group-toggle em { color: #7568d1; font-size: 10px; font-style: normal; font-weight: 800; white-space: nowrap; }
.moment-device-chevron { display: grid; place-items: center; color: #776bd0; font-size: 21px; font-style: normal; transition: transform .18s ease; }
.moment-device-group.open .moment-device-chevron { transform: rotate(90deg); }
.moment-group-select { padding: 6px 9px; border: 1px solid #dcd7fb; border-radius: 8px; color: #6958db; background: #f3f0ff; font-size: 10px; font-weight: 800; white-space: nowrap; }
.moment-device-group-body { display: none; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; padding: 0 8px 8px; }
.moment-device-group.open .moment-device-group-body { display: grid; }
.moment-device-option { display: flex; align-items: center; gap: 8px; padding: 9px; border: 1px solid transparent; border-radius: 9px; background: #f4f4f8; }
.moment-device-option:has(input:checked) { border-color: #ddd7ff; background: #f2efff; }
.moment-device-options input { width: 15px; height: 15px; accent-color: var(--primary); }
.moment-device-options span, .moment-device-options strong, .moment-device-options small { display: block; min-width: 0; }
.moment-device-options strong { overflow: hidden; color: #51586a; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.moment-device-options small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.moment-device-options small i { width: 6px; height: 6px; display: inline-block; margin-right: 5px; border-radius: 50%; background: #b9bec9; }
.moment-device-options small i.online { background: #38c799; box-shadow: 0 0 0 3px rgba(56,199,153,.12); }
.moment-setting-grid { display: grid; grid-template-columns: 1.5fr .7fr .7fr; gap: 9px; }
.moment-estimate { margin-top: -6px; padding: 9px 11px; border-radius: 9px; color: #6b629e; background: #f4f2ff; font-size: 9px; }
.moment-image-preview { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 7px; }
.moment-image-preview span { min-width: 0; position: relative; }
.moment-image-preview img { width: 100%; aspect-ratio: 1; display: block; object-fit: cover; border-radius: 9px; background: #f1f2f5; }
.moment-image-preview small { display: block; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.moment-image-preview button { position: absolute; top: -7px; right: -7px; color: #fff; background: #d95865; box-shadow: 0 3px 9px rgba(164,47,60,.2); }
.moment-task-toolbar { display: grid; grid-template-columns: minmax(0,1fr) 130px; gap: 9px; margin-bottom: 12px; }
.moment-task-toolbar input, .moment-task-toolbar select { padding: 9px 10px; font-size: 10px; }
.moment-task-list { display: grid; gap: 10px; max-height: 720px; overflow: auto; }
.moment-task-card { padding: 15px; border: 1px solid #ececf2; border-radius: 13px; background: #fcfcfe; }
.moment-task-card p, .moment-task-card small { display: block; margin: 9px 0 0; color: var(--muted); font-size: 10px; }
.moment-task-card .plan-title > div:first-child { min-width: 0; }
.moment-task-card .plan-title strong { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.state-dot.success { color: #16825f; background: #e8f8f2; }
.state-dot.running { color: #6659c9; background: #f0effd; }
.state-dot.danger { color: #c84e5a; background: #fff1f2; }
.moment-task-content { max-height: 72px; overflow: hidden; color: #555d70 !important; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.moment-task-images { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.moment-task-images img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; border: 1px solid #e8e9ef; }
.moment-task-images span { color: var(--muted); font-size: 9px; }
.moment-task-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.moment-task-meta span { padding: 5px 7px; border-radius: 7px; color: #707789; background: #f1f2f6; font-size: 9px; }
.moment-progress { height: 5px; margin-top: 11px; overflow: hidden; border-radius: 999px; background: #ececf3; }
.moment-progress i { height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg,#725ff0,#38c799); }
.message-list { display: grid; gap: 9px; max-height: 720px; overflow: auto; }
.message-card { padding: 14px; border: 1px solid #e9eaf0; border-radius: 12px; background: #fcfcfe; }
.message-card.revoked { opacity: .62; background: #f5f5f7; }
.message-meta { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.message-meta > div { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.message-meta span { padding: 4px 7px; border-radius: 6px; color: #6559c8; background: #f0effc; font-size: 8px; }
.message-meta button { padding: 5px 8px; border: 0; border-radius: 7px; color: #c84e5a; background: #fff0f2; font-size: 9px; }
.message-meta b { color: #c84e5a; font-size: 9px; }
.message-meta time { color: var(--muted); font-size: 8px; white-space: nowrap; }
.message-card p { margin: 10px 0 0; overflow: hidden; color: #555d70; font-size: 10px; line-height: 1.65; text-overflow: ellipsis; white-space: pre-wrap; word-break: break-word; }
.update-release { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 15px; background: radial-gradient(circle at 85% 15%,rgba(117,98,238,.11),transparent 32%),#fff; }
.update-release h3 { margin: 7px 0 4px; font-size: 19px; }
.update-release p { margin: 0; color: var(--muted); font-size: 10px; }
.download-link { display: inline-block; color: #fff; font-size: 10px; text-decoration: none; white-space: nowrap; }
.update-actions { justify-content: flex-start; margin-bottom: 10px; }
.update-device-list { display: grid; grid-template-columns: 1fr; gap: 8px; max-height: 390px; overflow: auto; }
.update-device-group { overflow: hidden; border: 1px solid #ebe9f5; border-radius: 11px; background: #faf9fd; }
.update-device-group-head { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 8px; }
.update-device-group-toggle { min-width: 0; display: grid; grid-template-columns: 22px minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 2px 3px; border: 0; color: #454b5d; background: transparent; text-align: left; }
.update-device-group-toggle > i { display: grid; place-items: center; color: #776bd0; font-size: 21px; font-style: normal; transition: transform .18s ease; }
.update-device-group.open .update-device-group-toggle > i { transform: rotate(90deg); }
.update-device-group-toggle > span { min-width: 0; }
.update-device-group-toggle strong { font-size: 14px; }
.update-device-group-toggle small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.update-device-group-toggle em { color: #7568d1; font-size: 12px; font-style: normal; font-weight: 800; white-space: nowrap; }
.update-group-select { padding: 6px 9px; border: 1px solid #dcd7fb; border-radius: 8px; color: #6958db; background: #f3f0ff; font-size: 12px; font-weight: 800; white-space: nowrap; }
.update-group-select:disabled { color: #a9adba; border-color: #e7e8ed; background: #f3f4f6; }
.update-device-group-grid { display: none; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; padding: 0 8px 8px; }
.update-device-group.open .update-device-group-grid { display: grid; }
.update-device-list label { display: flex; align-items: center; gap: 9px; padding: 11px; border: 1px solid #ececf2; border-radius: 10px; background: #fff; }
.update-device-list label.latest { background: #f5fbf8; }
.update-device-list input { width: 15px; height: 15px; flex: 0 0 15px; accent-color: var(--primary); }
.update-device-list i { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #b9bec9; }
.update-device-list i.online { background: #38c799; box-shadow: 0 0 0 3px rgba(56,199,153,.12); }
.update-device-list span, .update-device-list strong, .update-device-list small { display: block; min-width: 0; }
.update-device-list strong { overflow: hidden; color: #51586a; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.update-device-list small { margin-top: 3px; color: var(--muted); font-size: 9px; }

/* 统一可读性：管理后台以 14px 正文、12px 辅助文字为下限。 */
:root { --muted: #737b8e; --line: #e4e6ed; }
body { font-size: 14px; line-height: 1.55; }
.eyebrow { font-size: 11px; letter-spacing: .16em; }
.auth-card > p { font-size: 14px; }
.auth-tabs button { padding: 11px; font-size: 14px; }
label { gap: 8px; font-size: 13px; }
input, select, textarea { padding: 12px 13px; font-size: 14px; }
.primary, .outline, .ghost { min-height: 40px; font-size: 13px; font-weight: 700; }
.primary.small { padding: 9px 13px; font-size: 13px; }
.form-message { font-size: 13px; }
.app-shell { grid-template-columns: 252px minmax(0,1fr); }
.brand strong { font-size: 16px; }
.brand span { font-size: 11px; }
.nav-item { gap: 13px; padding: 13px 15px; font-size: 14px; font-weight: 700; }
.nav-item i { font-size: 18px; }
.sidebar-foot strong { font-size: 13px; }
.sidebar-foot small { font-size: 11px; }
header h2 { font-size: 22px; }
.page { padding: 30px 34px 48px; }
.hero h3 { font-size: 30px; }
.hero p { font-size: 14px; }
.plan-badge { font-size: 13px; }
.metrics span, .metrics small { font-size: 13px; }
.metrics strong { font-size: 31px; }
.panel { padding: 23px; }
.panel-head h3, .page-head h3, .modal-head h3 { font-size: 19px; }
.page-head h3 { font-size: 22px; }
.panel-head p, .page-head p { font-size: 13px; }
.summary-grid span { font-size: 12px; }
.summary-grid strong { font-size: 14px; }
.list-toolbar input, .list-toolbar select,
.robot-filter-bar input, .robot-filter-bar select,
.page-list-toolbar input, .page-list-toolbar select,
.moment-device-toolbar input,
.moment-task-toolbar input, .moment-task-toolbar select { font-size: 13px; }
.list-toolbar span, .robot-filter-bar span { font-size: 12px; }
.device-group-tabs button, .workspace-tabs button, .affiliate-tabs button { font-size: 13px; }
.robot-table { min-width: 1280px; font-size: 13px; }
.robot-table th, .robot-table td { padding: 15px 12px; }
.robot-table th { font-size: 12px; }
.robot-name { min-width: 190px; gap: 5px; }
.robot-name strong { font-size: 14px; }
.robot-name small, .pending-link { font-size: 11px; }
.group-badge, .role-badge, .status-badge { padding: 6px 9px; font-size: 11px; }
.muted-value { font-size: 12px; }
.robot-actions { min-width: 230px; gap: 7px; }
.robot-actions button { padding: 7px 10px; font-size: 12px; }
.robot-remark-button {
  max-width: 170px;
  padding: 7px 10px;
  overflow: hidden;
  border: 1px dashed #cfd2dd;
  border-radius: 8px;
  color: #858c9d;
  background: #fff;
  font-size: 12px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.robot-remark-button.has-remark {
  border-style: solid;
  border-color: #ded9ff;
  color: #594db3;
  background: #f4f2ff;
}
.workspace-search { font-size: 13px; }
.plan-title strong { font-size: 15px; }
.state-dot { font-size: 11px; }
.row-actions button { padding: 7px 10px; font-size: 12px; }
.plan-card p, .plan-card small { font-size: 13px; }
.group-tags span, .group-tags em, .managed-badge { font-size: 12px; }
.task-flow span { font-size: 13px; }
.notice { font-size: 14px; }
.feature-state p { font-size: 14px; }
.page-list-toolbar span { color: #696f80; font-size: 12px; }
.page-list-toolbar span.enabled { color: #16825f; font-weight: 700; }
.customer-page-list { font-size: 13px; }
.customer-page-list th { font-size: 12px; }
.customer-page-list .badge { font-size: 11px; }
.btn { padding: 8px 11px; font-size: 12px; }
.btn-s { padding: 6px 8px; font-size: 11px; }
.customer-page-editor-actions label { font-size: 12px; }
.customer-editor-card > h3 { font-size: 15px; }
.customer-module-buttons small { font-size: 11px; }
.customer-module-buttons .btn { font-size: 13px; }
.empty { font-size: 13px; }
legend { font-size: 13px; }
.affiliate-switch small { font-size: 12px; }
.affiliate-plan-row strong { font-size: 13px; }
.affiliate-account-table { font-size: 13px; }
.affiliate-account-table th { font-size: 12px; }
.field-title strong { font-size: 14px; }
.field-title span { font-size: 12px; }
.moment-comment-item b { font-size: 11px; }
.moment-comment-item em { font-size: 13px; }
.moment-device-actions span, .text-button { font-size: 12px; }
.moment-device-group-toggle strong { font-size: 14px; }
.moment-device-group-toggle small, .moment-device-group-toggle em, .moment-group-select { font-size: 12px; }
.moment-device-options strong { font-size: 13px; }
.moment-device-options small { font-size: 11px; }
.moment-estimate { font-size: 12px; }
.moment-image-preview small { font-size: 11px; }
.moment-task-card p, .moment-task-card small { font-size: 13px; }
.moment-task-images span, .moment-task-meta span { font-size: 11px; }
.message-meta span, .message-meta button, .message-meta b { font-size: 11px; }
.message-meta time { font-size: 11px; }
.message-card p { font-size: 13px; }
.update-release p, .download-link { font-size: 13px; }
.update-device-list strong { font-size: 13px; }
.update-device-list small { font-size: 11px; }
.settings-grid { display: grid; grid-template-columns: minmax(420px,1.15fr) minmax(340px,.85fr); gap: 18px; align-items: start; }
.feature-settings-card { display: grid; gap: 12px; }
.feature-settings-card > .panel-head { margin-bottom: 2px; }
.feature-setting-block { display: grid; gap: 8px; }
.feature-toggle-row {
  display: grid;
  grid-template-columns: 46px minmax(0,1fr) 50px;
  align-items: center;
  gap: 14px;
  padding: 17px;
  border: 1px solid #e8e8f0;
  border-radius: 14px;
  background: #fbfbfe;
  cursor: pointer;
}
.feature-toggle-row > span:nth-child(2) { min-width: 0; }
.feature-toggle-row strong, .feature-toggle-row small { display: block; }
.feature-toggle-row strong { color: #343a49; font-size: 15px; }
.feature-toggle-row small { margin-top: 4px; color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1.55; }
.feature-toggle-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 13px; color: #fff; font-size: 20px; }
.feature-toggle-icon.moments { background: linear-gradient(145deg,#ffb44b,#f27458); box-shadow: 0 8px 18px rgba(240,119,80,.18); }
.feature-toggle-icon.pages { background: linear-gradient(145deg,#7c69f3,#5943da); box-shadow: 0 8px 18px rgba(91,69,218,.18); }
.feature-toggle-row input {
  width: 48px;
  height: 27px;
  position: relative;
  appearance: none;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #cfd3dc;
  cursor: pointer;
  transition: background .18s ease;
}
.feature-toggle-row input::after {
  content: "";
  width: 21px;
  height: 21px;
  position: absolute;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 7px rgba(28,32,46,.2);
  transition: transform .18s ease;
}
.feature-toggle-row input:checked { background: var(--primary); }
.feature-toggle-row input:checked::after { transform: translateX(21px); }
.feature-toggle-row input:disabled { cursor: wait; opacity: .65; }
.feature-device-scope { display: grid; gap: 9px; margin: -2px 4px 6px; padding: 13px; border: 1px solid #e6e4f3; border-radius: 12px; background: #f9f8fe; }
.feature-device-scope > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.feature-device-scope > div:first-child strong { color: #484f60; font-size: 13px; }
.feature-device-scope > div:first-child span { color: var(--muted); font-size: 11px; text-align: right; }
.feature-device-scope > input { padding: 9px 10px; font-size: 12px; }
.feature-device-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.feature-device-toolbar span { color: #665bc0; font-size: 12px; font-weight: 700; }
.feature-device-toolbar > div { display: flex; align-items: center; gap: 5px; }
.feature-device-options { max-height: 260px; display: grid; gap: 10px; overflow: auto; }
.feature-device-group { overflow: hidden; border: 1px solid #ebe9f5; border-radius: 11px; background: #f4f2fb; }
.feature-device-group-title { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 8px; }
.feature-device-group-toggle { min-width: 0; display: grid; grid-template-columns: 22px minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 2px 3px; border: 0; color: #393f51; background: transparent; text-align: left; }
.feature-device-group-toggle > i { display: grid; place-items: center; color: #776bd0; font-size: 21px; font-style: normal; transition: transform .18s ease; }
.feature-device-group.open .feature-device-group-toggle > i { transform: rotate(90deg); }
.feature-device-group-toggle > span { min-width: 0; }
.feature-device-group-toggle strong { font-size: 13px; }
.feature-device-group-toggle small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.feature-device-group-toggle em { color: #7568d1; font-size: 11px; font-style: normal; font-weight: 800; white-space: nowrap; }
.feature-group-select { padding: 6px 9px; border: 1px solid #dcd7fb; border-radius: 8px; color: #6958db; background: #fff; font-size: 11px; font-weight: 800; white-space: nowrap; }
.feature-device-group-grid { display: none; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; padding: 0 8px 8px; }
.feature-device-group.open .feature-device-group-grid { display: grid; }
.feature-device-options label { display: flex; grid-template-columns: none; align-items: center; gap: 8px; padding: 9px; border-radius: 9px; background: #fff; }
.feature-device-options input { width: 16px; height: 16px; flex: 0 0 16px; accent-color: var(--primary); }
.feature-device-options span, .feature-device-options strong, .feature-device-options small { display: block; min-width: 0; }
.feature-device-options strong { overflow: hidden; color: #51586a; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.feature-device-options small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.activation-note { padding: 12px 14px; border-radius: 11px; color: #746b9d; background: #f4f2ff; font-size: 12px; line-height: 1.65; }
.security-card { width: 100%; }
@media (max-width: 980px) {
  .metrics { grid-template-columns: repeat(2,1fr); }
  .device-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .summary-grid { grid-template-columns: repeat(2,1fr); }
  .moment-workspace { grid-template-columns: 1fr; }
  .customer-page-editor-body { grid-template-columns: 310px minmax(320px,1fr); }
  .customer-page-palette { grid-column: 1 / -1; }
  .customer-page-palette .sticky { position: static; }
  .customer-module-buttons { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .customer-module-buttons small { grid-column: 1 / -1; }
  .settings-grid { grid-template-columns: 1fr; }
  .affiliate-test-form { grid-template-columns: 1fr; align-items: stretch; }
  .affiliate-test-account, .affiliate-test-input, .affiliate-test-format { grid-column: auto; grid-row: auto; }
  .affiliate-test-form .primary { justify-self: start; }
}
@media (max-width: 720px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 50; inset: 0 auto 0 0; width: 252px; transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu { display: block; }
  header { padding: 14px 16px; }
  header .eyebrow { display: none; }
  .page { padding: 18px 14px 32px; }
  .hero { min-height: 150px; padding: 25px 22px; }
  .hero h3 { font-size: 22px; }
  .metrics, .device-grid, .summary-grid { grid-template-columns: 1fr; }
  .panel-head, .page-head { align-items: flex-start; }
  .page-head, .page-actions { flex-wrap: wrap; }
  .plan-title { align-items: flex-start; }
  .row-actions { flex-wrap: wrap; justify-content: flex-end; }
  .device-facts { grid-template-columns: 1fr 1fr; }
  .group-options { grid-template-columns: 1fr; }
  .group-picker-toolbar, .group-picker-grid { grid-template-columns: 1fr; }
  .affiliate-plan-row { grid-template-columns: 1fr; }
  .affiliate-token-format-grid { grid-template-columns: 1fr; }
  .affiliate-account-table { display: block; overflow-x: auto; white-space: nowrap; }
  .list-toolbar { grid-template-columns: 1fr; }
  .robot-filter-bar, .page-list-toolbar { grid-template-columns: 1fr; }
  .robot-filter-bar span { white-space: normal; }
  .device-group-tabs { overflow-x: auto; flex-wrap: nowrap; }
  .device-group-tabs button { flex: 0 0 auto; }
  .customer-page-editor-head { align-items: flex-start; flex-direction: column; padding: 10px 12px; }
  .customer-page-editor-title { width: 100%; }
  .customer-page-editor-title input { min-width: 0; width: 100%; }
  .customer-page-editor-actions { width: 100%; overflow-x: auto; padding-bottom: 3px; }
  .customer-page-editor-actions > * { flex: 0 0 auto; }
  .customer-page-editor-body { display: flex; flex-direction: column; padding: 10px; }
  .customer-page-preview, .customer-page-modules, .customer-page-palette { width: 100%; }
  .customer-editor-card.sticky { position: static; }
  .customer-module-buttons { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .list-toolbar span { white-space: normal; }
  .workspace-tabs { overflow-x: auto; }
  .workspace-tabs button { flex: 0 0 auto; }
  .moment-device-group-body { grid-template-columns: 1fr; }
  .moment-device-group-toggle { grid-template-columns: 20px minmax(0,1fr); }
  .moment-device-group-toggle em { grid-column: 2; }
  .moment-setting-grid { grid-template-columns: 1fr; }
  .moment-comment-editor, .moment-device-toolbar, .moment-task-toolbar { grid-template-columns: 1fr; }
  .moment-comment-editor button { min-height: 42px; }
  .moment-device-actions { justify-content: flex-start; flex-wrap: wrap; }
  .moment-device-actions span { width: 100%; margin: 2px 0 0; }
  .message-meta { display: grid; }
  .update-release { align-items: flex-start; flex-direction: column; }
  .update-device-group-grid { grid-template-columns: 1fr; }
  .update-device-group-toggle { grid-template-columns: 20px minmax(0,1fr); }
  .update-device-group-toggle em { grid-column: 2; }
  .feature-toggle-row { grid-template-columns: 42px minmax(0,1fr) 48px; gap: 10px; padding: 14px 12px; }
  .feature-toggle-icon { width: 42px; height: 42px; }
  .feature-device-group-grid { grid-template-columns: 1fr; }
  .feature-device-group-toggle { grid-template-columns: 20px minmax(0,1fr); }
  .feature-device-group-toggle em { grid-column: 2; }
  .feature-device-scope > div:first-child { align-items: flex-start; flex-direction: column; }
  .feature-device-scope > div:first-child span { text-align: left; }
}
