:root { color-scheme: light; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; color: #273449; background: #f3f5f9; }
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
.routing-shell { max-width: 1280px; margin: 0 auto; padding: 32px; }
.page-heading, .editor-heading, .table-heading, .save-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
h1 { margin: 4px 0 0; font-size: 30px; }
h2 { margin: 0; font-size: 18px; }
p { line-height: 1.65; }
.eyebrow { color: #60718a; font-size: 12px; letter-spacing: .05em; margin: 0 0 8px; }
a { color: #345cc5; }
.card { background: white; border: 1px solid #e0e5ee; border-radius: 12px; box-shadow: 0 3px 12px #27344906; }
.status { min-height: 24px; margin: 18px 0; padding: 0; overflow-wrap: anywhere; }
.status[data-kind="error"] { color: #af283b; }
.status[data-kind="success"] { color: #147348; }
.login-card { max-width: 430px; margin: 50px auto; padding: 28px; }
.login-card form { display: grid; gap: 12px; }
button, input { font: inherit; }
button { border: 1px solid #ced7e6; background: white; color: #344660; border-radius: 6px; padding: 9px 14px; cursor: pointer; }
button:hover { background: #edf2fc; }
button:disabled { opacity: .5; cursor: default; }
button.primary { border-color: #345cc5; background: #345cc5; color: white; }
button.quiet { color: #af283b; white-space: nowrap; }
button:focus-visible, input:focus-visible, a:focus-visible, [tabindex="-1"]:focus-visible { outline: 3px solid #7d9eeb; outline-offset: 3px; }
input[type="text"], input[type="password"] { width: 100%; padding: 10px; min-width: 0; border: 1px solid #ced7e6; border-radius: 6px; }
input[aria-invalid="true"] { border-color: #bf3a4b; }
.editor-heading { margin-bottom: 18px; align-items: start; }
.editor-heading p { margin: 0; }
.routing-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.routes-card { overflow: hidden; }
.channel-tabs { display: flex; background: #f8f9fc; border-bottom: 1px solid #e0e5ee; padding: 8px 18px 0; gap: 8px; }
.channel-tabs button { border: 0; border-bottom: 3px solid transparent; border-radius: 0; padding: 12px 10px; background: transparent; }
.channel-tabs button[aria-selected="true"] { color: #345cc5; border-bottom-color: #345cc5; font-weight: 600; }
.error-count { background: #fde5e8; color: #af283b; border-radius: 10px; font-size: 12px; padding: 2px 6px; margin-left: 5px; }
#routePanel { padding: 22px; }
.table-heading { margin-bottom: 22px; }
.route-columns, .route-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 50px 60px; gap: 12px; align-items: center; }
.route-columns { color: #60718a; font-size: 12px; margin-bottom: 8px; }
.route-row { border-top: 1px solid #edf0f5; padding: 16px 0; }
.route-row.has-errors { border-left: 3px solid #bf3a4b; padding-left: 10px; }
.field-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.toggle { display: flex; gap: 6px; align-items: center; justify-content: center; }
.toggle input { width: 18px; height: 18px; accent-color: #345cc5; }
.delete-route { border: 0; padding: 8px; color: #af283b; }
.row-number { font-size: 11px; color: #60718a; display: block; margin-bottom: 7px; }
.row-errors { margin: 10px 0 0; color: #af283b; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.row-errors p { margin: 4px 0; }
.validation-summary { background: #fff1f3; border-radius: 6px; padding: 12px; margin-bottom: 18px; color: #af283b; font-size: 13px; }
.empty-state { color: #60718a; padding: 28px 0; text-align: center; }
.save-bar { border-top: 1px solid #e0e5ee; padding: 18px 22px; background: #fbfcfe; }
.save-actions { display: flex; gap: 10px; }
#draftState { font-size: 13px; white-space: nowrap; color: #60718a; }
#draftState[data-dirty="true"] { color: #916413; }
.repair-button { margin: 0 22px 18px; }
.example-card { padding: 24px; }
.example-card p { font-size: 13px; }
pre { font-family: ui-monospace, Consolas, monospace; font-size: 12px; line-height: 1.8; background: #f3f5f9; padding: 16px; border-radius: 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
code { font-family: ui-monospace, Consolas, monospace; }
.muted { color: #60718a; }
dialog { max-width: 460px; width: calc(100% - 32px); border: 1px solid #e0e5ee; border-radius: 12px; padding: 24px; color: #273449; }
dialog::backdrop { background: #17253a66; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
@media (max-width: 960px) { .routing-layout { grid-template-columns: minmax(0, 1fr); } .example-card .muted { display: none; } .example-card pre { margin-bottom: 8px; } }
@media (max-width: 600px) {
    .routing-shell { padding: 20px 14px; }
    h1 { font-size: 26px; }
    .page-heading { align-items: end; }
    .page-heading a { font-size: 13px; white-space: nowrap; }
    .editor-heading { font-size: 13px; }
    .channel-tabs { padding-left: 10px; }
    .channel-tabs button { padding: 12px 8px; }
    #routePanel { padding: 18px 16px; }
    .table-heading { gap: 8px; }
    .table-heading h2 { font-size: 16px; }
    .table-heading button { font-size: 13px; padding: 8px; }
    .route-columns { display: none; }
    .route-fields { grid-template-columns: minmax(0, 1fr) 70px; gap: 12px; }
    .route-fields > .name-field { grid-column: 1 / -1; }
    .field-label { position: static; width: auto; height: auto; clip: auto; display: block; font-size: 12px; margin-bottom: 6px; color: #60718a; }
    .toggle { justify-content: start; font-size: 13px; }
    .toggle .field-label { margin: 0; }
    .save-bar { padding: 16px; flex-wrap: wrap; }
    .save-actions { width: 100%; }
    .save-actions button { flex: 1; padding: 10px 8px; }
    .login-card { margin: 30px auto; padding: 22px; }
}
