:root{color-scheme:light;--bg:#f5f6f8;--surface:#fff;--border:#e5e7eb;--text:#111827;--muted:#6b7280;--soft:#f9fafb;--primary:#111827;--success:#15803d;--success-bg:#f0fdf4;--info:#2563eb;--info-bg:#eff6ff;--warning:#c2410c;--warning-bg:#fff7ed;--danger:#dc2626;--danger-bg:#fef2f2}
*{box-sizing:border-box}[hidden]{display:none!important}body{margin:0;background:var(--bg);color:var(--text);font:14px/1.55 Inter,"PingFang SC","Microsoft YaHei",sans-serif}.topbar{height:62px;background:var(--surface);border-bottom:1px solid var(--border);display:flex;align-items:center}.topbar-inner{width:min(1100px,calc(100% - 48px));margin:auto;display:flex;align-items:center;justify-content:space-between;gap:16px}.brand{display:flex;align-items:center;gap:10px;font-weight:600}.brand-mark{width:28px;height:28px;border-radius:8px;background:var(--primary);color:#fff;display:grid;place-items:center;font-size:15px;font-weight:700;line-height:1}.topbar-context{color:var(--muted);font-size:13px}.page-shell{width:min(1100px,calc(100% - 48px));margin:0 auto;padding:30px 0 56px}.page-heading{margin:0 0 6px;font-size:28px;line-height:32px;font-weight:600;letter-spacing:-.02em}.lead{margin:0;color:var(--muted);font-size:14px}.stack{display:grid;gap:16px;margin-top:20px}.card{background:var(--surface);border:1px solid var(--border);border-radius:12px;box-shadow:0 1px 2px rgba(0,0,0,.02),0 6px 18px rgba(0,0,0,.035);padding:24px}.card-title{margin:0;font-size:18px;font-weight:600}.card-subtitle{margin:4px 0 20px;color:var(--muted);font-size:13px}.field{display:grid;gap:7px;margin:12px 0}.token-field{margin-bottom:14px}.field-label{font-weight:500}.field-help{font-size:13px;color:var(--muted)}input,textarea,select{width:100%;min-height:44px;padding:10px 12px;background:#fff;border:1px solid #d1d5db;border-radius:8px;color:var(--text);font:inherit;outline:none;transition:border-color .15s,box-shadow .15s}textarea{min-height:108px;resize:vertical}input:focus,textarea:focus,select:focus{border-color:var(--primary);box-shadow:0 0 0 3px rgba(17,24,39,.06)}button{min-height:44px;padding:10px 16px;border:1px solid transparent;border-radius:8px;background:var(--primary);color:#fff;font:500 14px/1 Inter,"PingFang SC","Microsoft YaHei",sans-serif;cursor:pointer;transition:background .15s,opacity .15s,transform .15s}button:hover{background:#1f2937}button:focus-visible{outline:3px solid rgba(17,24,39,.18);outline-offset:2px}button:active{transform:translateY(1px)}button.secondary{background:#fff;border-color:#d1d5db;color:var(--text)}button.secondary:hover{background:var(--soft)}button.danger{background:var(--danger)}button.danger:hover{background:#b91c1c}button.text-button{min-height:auto;padding:0;background:transparent;color:var(--info);border:0}button[disabled]{cursor:not-allowed;background:#e5e7eb;color:#9ca3af;border-color:#e5e7eb;opacity:.9;transform:none}.button-row{display:flex;gap:10px;flex-wrap:wrap}.button-row .primary-fill{width:100%;min-height:48px}.token-input{position:relative;display:block}.token-input input{padding-right:46px}.icon-button{position:absolute;right:5px;top:5px;min-height:34px;width:34px;padding:0;display:grid;place-items:center;background:transparent;color:var(--muted);border:0}.icon-button:hover{background:#f3f4f6;color:var(--text)}.icon-button svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8}.notice{display:flex;gap:10px;align-items:flex-start;padding:12px 16px;border:1px solid;border-radius:8px;font-size:13px}.notice::before{content:"i";width:18px;height:18px;flex:none;border:1px solid currentColor;border-radius:50%;display:grid;place-items:center;font-weight:600;font-size:12px}.notice.info{background:var(--info-bg);border-color:#bfdbfe;color:#1d4ed8}.notice.success{background:var(--success-bg);border-color:#bbf7d0;color:#166534}.notice.warning{background:var(--warning-bg);border-color:#fed7aa;color:#9a3412}.notice.error{background:var(--danger-bg);border-color:#fecaca;color:#b91c1c}.status-badge{display:inline-flex;align-items:center;gap:5px;padding:4px 10px;border-radius:999px;font-size:12px;font-weight:600;line-height:1.2;background:#f3f4f6;color:#4b5563}.status-badge.ready,.status-badge.completed,.status-badge.success{background:var(--success-bg);color:var(--success)}.status-badge.processing,.status-badge.activating,.status-badge.info,.status-badge.checking{background:var(--info-bg);color:var(--info)}.status-badge.failed,.status-badge.error,.status-badge.unhealthy{background:var(--danger-bg);color:var(--danger)}.status-badge.warning,.status-badge.manual_required{background:var(--warning-bg);color:var(--warning)}.status-badge.stopped{background:#f3f4f6;color:#4b5563}.status-badge.checking::before{content:"";width:10px;height:10px;border:1.5px solid currentColor;border-right-color:transparent;border-radius:50%;animation:status-spin .7s linear infinite}@keyframes status-spin{to{transform:rotate(1turn)}}
.stepper{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:24px;margin-top:16px}.step{position:relative;display:grid;grid-template-rows:32px auto auto;min-width:0;text-align:center}.step:not(:last-child)::after{content:"";position:absolute;z-index:0;top:15px;left:calc(50% + 16px);width:calc(100% - 8px);height:2px;background:#e5e7eb}.step-index{position:relative;z-index:1;justify-self:center;width:32px;height:32px;border-radius:50%;display:grid;place-items:center;background:#e5e7eb;color:#6b7280;font-weight:600}.step.active .step-index{background:var(--primary);color:#fff}.step.active:not(:last-child)::after,.step.done:not(:last-child)::after{background:var(--primary)}.step.done .step-index{background:var(--success);color:#fff}.step.done .step-index::before{content:"✓"}.step.done .step-index{font-size:0}.step.done .step-index::before{font-size:14px}.step-title{margin-top:8px;color:#4b5563;font-weight:500}.step.active .step-title,.step.done .step-title{color:var(--text);font-weight:600}.step-copy{margin:2px 0 0;color:var(--muted);font-size:13px;line-height:1.55;padding:0 8px}.result-list{display:grid;gap:10px;margin-top:14px}.result-item{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px;border:1px solid var(--border);border-radius:8px;background:var(--soft);overflow-wrap:anywhere}.metric-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px}.metric-card{min-height:112px;padding:16px;border:1px solid var(--border);border-radius:10px;background:var(--surface);display:flex;flex-direction:column;align-items:flex-start;justify-content:space-between}.metric-heading{display:flex;align-items:center;gap:8px}.metric-icon{width:20px;height:20px;display:grid;place-items:center;border-radius:6px;background:#f3f4f6;color:#4b5563;font-size:12px;font-weight:700;line-height:1}.metric-label{display:block;color:var(--muted);font-size:13px}.metric-meta{display:block;color:var(--muted);font-size:12px;margin-top:8px}.description-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 22px}.description-grid div{padding:10px 0;border-bottom:1px solid var(--border);min-width:0}.description-grid dt{font-size:12px;color:var(--muted)}.description-grid dd{margin:3px 0 0;overflow-wrap:anywhere;font-weight:500}.section-heading-row{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.section-heading-row .card-subtitle{margin-bottom:0}.task-summary{margin-top:12px}.task-status-meta,.safe-error-code{font-size:12px;color:var(--muted)}.safe-error-code{margin-top:8px}.progress{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin:18px 0}.progress-step{padding:9px 7px;text-align:center;border-radius:8px;background:#f3f4f6;color:#6b7280;font-size:12px;font-weight:600}.progress-step.active{background:var(--info-bg);color:var(--info)}.progress-step.done{background:var(--success-bg);color:var(--success)}.progress-step.failed{background:var(--danger-bg);color:var(--danger)}.timeline{list-style:none;margin:14px 0 0;padding:0;display:grid;gap:0}.timeline li{position:relative;padding:0 0 16px 26px;border-left:1px solid #d1d5db;margin-left:7px}.timeline li::before{content:"";position:absolute;left:-5px;top:5px;width:9px;height:9px;border-radius:50%;background:#9ca3af}.timeline time{display:block;color:var(--muted);font-size:12px}.timeline-title{font-weight:600}.timeline-meta{color:var(--muted);font-size:13px}.empty-state{padding:26px 16px;text-align:center;color:var(--muted)}.empty-state::before{content:"⌁";display:block;font-size:26px;color:#9ca3af}.empty-state.compact{min-height:96px;padding:18px 16px;display:grid;place-items:center}.code-display{margin:12px 0;padding:18px;border:1px solid #bbf7d0;border-radius:10px;background:var(--success-bg);font-size:30px;letter-spacing:4px;font-weight:600;text-align:center;color:#166534}.table-wrap{overflow:auto;border:1px solid var(--border);border-radius:10px}table{width:100%;border-collapse:collapse;min-width:720px;background:#fff}th,td{height:50px;padding:10px 14px;border-bottom:1px solid var(--border);text-align:left;white-space:nowrap}th{background:#f9fafb;color:#4b5563;font-size:12px;font-weight:600}tbody tr:hover{background:#f9fafb}details{margin-top:14px;border:1px solid var(--border);border-radius:8px;padding:10px 12px;color:var(--muted)}summary{cursor:pointer;color:var(--text);font-weight:500}pre.safe-data{margin:10px 0 0;white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px;color:#4b5563}.split{display:grid;grid-template-columns:1fr 1fr;gap:18px}.execution-layout{grid-template-columns:minmax(0,7fr) minmax(0,3fr);align-items:end}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:800px){.topbar-inner,.page-shell{width:min(100% - 32px,1100px)}.page-shell{padding-top:24px}.stepper{grid-template-columns:1fr;gap:12px}.step{grid-template-columns:32px 1fr;grid-template-rows:auto auto;text-align:left;column-gap:10px}.step-index{grid-row:1 / span 2;justify-self:start}.step-title{margin:0;align-self:end}.step-copy{margin:2px 0 0;padding:0;line-height:1.6}.step:not(:last-child)::after{top:32px;left:15px;bottom:-12px;right:auto;width:2px;height:auto}.metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.split,.execution-layout,.description-grid{grid-template-columns:1fr}.progress{grid-template-columns:1fr 1fr}.topbar-context{display:none}}@media(max-width:420px){.topbar-inner,.page-shell{width:calc(100% - 32px)}.page-shell{padding-top:20px}.card{padding:18px}.metric-grid{grid-template-columns:1fr}.button-row button{width:100%}.page-heading{font-size:25px}.result-item{align-items:flex-start;flex-direction:column}}

/* Phone Portal: page-specific layout built on shared primitives. */
.phone-shell{max-width:760px;margin:0 auto}.card-heading-row,.section-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.eyebrow{margin:0 0 4px;color:var(--muted);font-size:12px;font-weight:600;letter-spacing:.02em}.binding-phone{margin:0;font-size:28px;line-height:1.25;font-weight:600;letter-spacing:-.02em}.phone-region{margin:5px 0 0;color:var(--muted);font-size:13px}.phone-state{margin:18px 0;color:var(--muted)}.phone-status{margin-left:4px;color:var(--success);font-weight:600}.phone-status.inactive{color:var(--warning)}.phone-binding-card .button-row{margin-top:18px}.phone-bound .phone-resolve-card{padding:18px}.phone-bound .phone-resolve-card .card-subtitle{display:none}.phone-code-history-card{display:grid;gap:24px}.code-panel{padding:2px 0}.code-panel .code-display{margin:10px 0 8px}.code-empty{display:grid;gap:3px;margin-top:10px;color:var(--muted)}.code-empty strong{color:var(--text);font-size:16px}.history-section{padding-top:20px;border-top:1px solid var(--border)}.history-section .card-subtitle{margin-bottom:0}.history-list{list-style:none;margin:12px 0 0;padding:0}.history-list li{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:10px 0;border-bottom:1px solid var(--border)}.history-list li:last-child{border-bottom:0}.history-list strong{font-weight:600;letter-spacing:.04em}.history-list time{color:var(--muted);font-size:13px}.history-list .history-empty{display:block;padding:2px 0;color:var(--muted);border:0}.notice-code{margin-left:auto;color:inherit;opacity:.7;font-size:11px;font-weight:500}.status-badge.available_for_more_sms{background:var(--success-bg);color:var(--success)}.status-badge.inactive{background:var(--warning-bg);color:var(--warning)}.admin-generate-fields{margin-bottom:4px}.generated-result,.detail-panel{margin-top:18px;padding:18px;border:1px solid var(--border);border-radius:10px;background:var(--soft)}.admin-filters{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(0,1fr) minmax(0,.9fr);gap:14px}.filter-actions{margin-top:2px}.danger-link{color:var(--danger)!important}
@media(max-width:800px){.admin-filters{grid-template-columns:1fr}.card-heading-row,.section-heading{align-items:flex-start}}@media(max-width:420px){.phone-shell{width:100%}.card-heading-row,.section-heading{flex-direction:column}.phone-binding-card .status-badge{align-self:flex-start}.code-card{padding:16px}.phone-code-history-card .button-row button{width:100%}.binding-phone{font-size:24px;white-space:nowrap}}
.stack,.card,.table-wrap{min-width:0}
