:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-subtle: #f7f9fa;
  --surface-selected: #eff6ff;
  --text: #171b1f;
  --text-secondary: #52606a;
  --text-muted: #7a858e;
  --border: #dce2e6;
  --border-strong: #c6ced4;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-ring: rgba(37, 99, 235, .24);
  --success: #149447;
  --warning: #ee9400;
  --danger: #d93d34;
  --paused: #6e767d;
  --idle: #aab3ba;
  --shadow: 0 8px 24px rgba(20, 31, 38, 0.08);
  --radius: 6px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
}

html[data-theme="green"] { --surface-selected:#edf9f8;--accent:#008f8a;--accent-dark:#00736f;--accent-ring:rgba(0,143,138,.24); }
html[data-theme="blue"] { --surface-selected:#eff6ff;--accent:#2563eb;--accent-dark:#1d4ed8;--accent-ring:rgba(37,99,235,.24); }
html[data-theme="indigo"] { --surface-selected:#eef2ff;--accent:#4f46e5;--accent-dark:#4338ca;--accent-ring:rgba(79,70,229,.24); }
html[data-theme="graphite"] { --surface-selected:#f1f3f5;--accent:#3f4852;--accent-dark:#252b31;--accent-ring:rgba(63,72,82,.24); }
html[data-theme="rose"] { --surface-selected:#fff1f5;--accent:#c2416c;--accent-dark:#9f2d55;--accent-ring:rgba(194,65,108,.24); }

.voice-sample-list { display: grid; margin-top: 12px; border-top: 1px solid var(--border); }
.voice-sample-row { display: grid; grid-template-columns: minmax(180px,1fr) minmax(240px,420px) auto; align-items: center; gap: 14px; padding: 12px 2px; border-bottom: 1px solid var(--border); }
.voice-sample-row > div { display: grid; gap: 3px; min-width: 0; }
.voice-sample-row small { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-sample-row audio, .voice-sample-result audio { width: 100%; height: 34px; }
.voice-sample-result { display: flex; align-items: center; gap: 12px; }
.voice-sample-result[hidden] { display: none; }
.voice-policy-row { display: flex; align-items: end; gap: 10px; padding-top: 14px; }
.voice-policy-row label { display: grid; gap: 6px; min-width: min(360px, 100%); }
.voice-policy-row label > span { color: var(--text-secondary); font-size: 12px; }
.voice-policy-row small { color: var(--text-muted); align-self: center; }
.compact-select { display: flex; align-items: center; gap: 7px; }
.compact-select span { color: var(--text-muted); font-size: 12px; }
.compact-select select { min-width: 180px; }
@media (max-width: 720px) {
  .voice-sample-row { grid-template-columns: 1fr; }
  .voice-sample-result { align-items: stretch; flex-direction: column; }
  .voice-policy-row { align-items: stretch; flex-direction: column; }
  .compact-select { width: 100%; }
  .compact-select select { min-width: 0; flex: 1; }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); color: var(--text); font-family: var(--font); }
body { margin: 0; min-width: 320px; background: var(--bg); font-size: 14px; line-height: 1.45; letter-spacing: 0; }
/* Keep the legacy page frame out of the first paint while app-shell.js builds the
   shared navigation. Authentication pages do not use the application shell. */
body:not(.login-body):not(.auth-page):not(.routras-shell-ready):has(> .topbar) > .topbar,
body:not(.login-body):not(.auth-page):not(.routras-shell-ready):has(> .topbar) > main {
  visibility: hidden;
}
button, select { font: inherit; letter-spacing: 0; }
button, a, select, input { outline-offset: 2px; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--accent-ring); }
button { color: inherit; }
svg { width: 18px; height: 18px; stroke-width: 1.8; }

.topbar { height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 22px; border-bottom: 1px solid var(--border); background: #fff; position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 19px; font-weight: 700; white-space: nowrap; }
.brand svg { width: 22px; height: 22px; color: var(--accent-dark); }
.topbar-actions { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--text-secondary); }
.shell-tools { display: flex; align-items: center; gap: 5px; flex: none; }
.shell-language { width: 30px; height: 30px; padding: 0; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--text-secondary); cursor: pointer; font-size: 11px; font-weight: 700; transition: color 140ms ease,background 140ms ease,border-color 140ms ease; }
.shell-language:hover { color: var(--accent-dark); background: var(--surface-subtle); border-color: var(--border); }
.icon-button.shell-menu { display: none; }
.login-language { position: fixed; top: 18px; right: 18px; z-index: 5; }
.refresh-time { font-size: 12px; white-space: nowrap; }
.refresh-time time { color: var(--text); font-variant-numeric: tabular-nums; }
.icon-button { width: 34px; height: 34px; border: 1px solid transparent; background: transparent; display: inline-grid; place-items: center; color: var(--text-secondary); border-radius: 4px; cursor: pointer; text-decoration: none; }
.icon-button:hover { color: var(--accent-dark); background: var(--surface-subtle); border-color: var(--border); }
.icon-button.loading svg { animation: spin 0.8s linear infinite; }
.switch-label { display: flex; align-items: center; gap: 8px; white-space: nowrap; cursor: pointer; }
.switch-label input { position: absolute; opacity: 0; pointer-events: none; }
.switch { width: 36px; height: 20px; background: #c9d0d5; border-radius: 10px; position: relative; transition: background 160ms ease; }
.switch::after { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform 160ms ease; }
.switch-label input:checked + .switch { background: var(--accent); }
.switch-label input:checked + .switch::after { transform: translateX(16px); }

main { min-height: calc(100vh - 58px); }
section { border-bottom: 1px solid var(--border); }
h1, h2, p { margin: 0; }
.section-head h2, .work-section h2 { font-size: 15px; line-height: 1.25; font-weight: 700; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--idle); flex: none; }
.status-dot.healthy, .healthy .status-dot { background: var(--success); }
.status-dot.warning, .warning .status-dot, .running .status-dot { background: var(--warning); }
.status-dot.failed, .failed .status-dot { background: var(--danger); }
.status-dot.paused, .paused .status-dot { background: var(--paused); }
.pipeline-band { padding: 15px 22px 18px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 15px; }
.section-head p { margin-top: 3px; color: var(--text-muted); font-size: 12px; }
.command-button { min-height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 6px 12px; border: 1px solid var(--border-strong); border-radius: 5px; background: #fff; cursor: pointer; white-space: nowrap; font-weight: 600; font-size: 13px; text-decoration: none; }
.command-button:hover { border-color: var(--accent); color: var(--accent-dark); }
.command-button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.command-button.primary:hover { background: var(--accent-dark); }
.command-button.danger-subtle { color: var(--danger); }
.command-button:disabled { opacity: .55; cursor: wait; }
.schedule-button { min-height: 32px; }
.command-button.is-running svg { animation: spin 1.1s linear infinite; }
.pipeline-scroll { width: 100%; max-width: 100%; min-width: 0; overflow-x: auto; padding-bottom: 2px; }
.pipeline { min-width: max(100%, 1080px); display: flex; align-items: flex-start; }
.pipeline-node { flex: 1 0 120px; position: relative; text-align: center; min-width: 120px; }
.pipeline-node:not(:last-child)::after { content: ""; position: absolute; height: 1px; left: calc(50% + 29px); right: calc(-50% + 29px); top: 29px; background: var(--border-strong); }
.node-icon { width: 58px; height: 58px; margin: 0 auto 8px; border: 1px solid var(--border-strong); border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--text-secondary); position: relative; z-index: 1; }
.pipeline-node.success .node-icon { border-color: rgba(20,148,71,.45); color: var(--success); }
.pipeline-node.running .node-icon { border: 2px solid var(--warning); color: var(--warning); box-shadow: 0 0 0 5px rgba(238,148,0,.09); }
.pipeline-node.running .node-icon::after { content: ""; position: absolute; inset: -7px; border: 1px solid rgba(238,148,0,.22); border-radius: 50%; animation: pulse 1.8s ease-in-out infinite; }
.node-label { min-height: 38px; padding: 0 5px; display: flex; align-items: flex-start; justify-content: center; font-size: 13px; line-height: 1.35; font-weight: 650; overflow-wrap: anywhere; }
.node-meta { margin-top: 2px; padding: 0 4px; font-size: 12px; line-height: 1.3; color: var(--text-muted); }

.work-section { padding: 16px 22px 20px; }
.work-head { margin-bottom: 10px; }
.heading-with-summary { display: flex; align-items: center; gap: 22px; min-width: 0; }
.inline-summary { display: flex; gap: 16px; color: var(--text-secondary); font-size: 12px; }
.inline-summary b { color: var(--text); font-variant-numeric: tabular-nums; }
.operations-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: stretch; }
.table-wrap { overflow: auto; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th { height: 34px; padding: 7px 10px; background: var(--surface-subtle); border-bottom: 1px solid var(--border); text-align: left; color: var(--text-secondary); font-size: 12px; font-weight: 650; white-space: nowrap; }
td { height: 39px; padding: 7px 10px; border-bottom: 1px solid var(--border); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr[data-selectable="true"] { cursor: pointer; }
tbody tr[data-selectable="true"]:hover, tbody tr.selected { background: var(--surface-selected); }
.empty-row td { height: 92px; text-align: center; color: var(--text-muted); white-space: normal; }
.cell-status { display: inline-flex; align-items: center; gap: 6px; }
.progress-cell { display: flex; align-items: center; gap: 8px; }
.mini-progress { width: 74px; height: 5px; background: #e6ebee; overflow: hidden; border-radius: 3px; flex: none; }
.mini-progress span { display: block; height: 100%; background: var(--accent); }
.progress-number { color: var(--text-secondary); font-size: 12px; font-variant-numeric: tabular-nums; }
.type-icon { display: inline-flex; gap: 6px; align-items: center; }
.type-icon svg { width: 15px; height: 15px; color: var(--text-muted); }
.current-detail { min-height: 184px; border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 15px 16px; background: #fff; }
.detail-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.detail-title h3 { margin: 0; font-size: 14px; }
.detail-grid { display: grid; grid-template-columns: 76px 1fr; gap: 8px 10px; font-size: 13px; }
.detail-grid dt { color: var(--text-muted); }
.detail-grid dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.detail-progress { margin: 14px 0; }
.detail-progress-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; font-size: 12px; }
.detail-progress-track { height: 7px; background: #e6ebee; border-radius: 4px; overflow: hidden; }
.detail-progress-track span { display: block; height: 100%; background: var(--accent); transition: width 300ms ease; }
.detail-message { border-top: 1px solid var(--border); padding-top: 11px; color: var(--text-secondary); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-empty { min-height: 152px; display: grid; place-items: center; text-align: center; color: var(--text-muted); }
.detail-empty svg { width: 30px; height: 30px; margin-bottom: 8px; }

.history-section { border-bottom: 0; }
.history-view-head { min-height: 68px; padding: 14px 22px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--border); }
.history-view-head h2 { font-size: 15px; }
.history-view-head p { margin-top: 3px; color: var(--text-muted); font-size: 12px; }
.history-toolbar { min-height: 58px; padding: 10px 22px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--border); }
.project-area { display: flex; align-items: center; min-width: 0; gap: 8px; color: var(--text-secondary); font-size: 12px; }
.project-area select { width: clamp(220px, 30vw, 360px); height: 34px; padding: 0 30px 0 10px; border: 1px solid var(--border); border-radius: 4px; background: #fff; color: var(--text); }
.view-tab { border: 0; background: transparent; cursor: pointer; position: relative; color: var(--text-secondary); white-space: nowrap; }
.filters { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: 12px; }
.filters select { height: 34px; min-width: 112px; padding: 0 30px 0 10px; border: 1px solid var(--border); border-radius: 4px; background: #fff; color: var(--text); }
.view-tabs { height: 43px; padding: 0 22px; display: flex; align-items: stretch; gap: 20px; border-bottom: 1px solid var(--border); }
.view-tab { padding: 0 2px; font-size: 13px; }
.view-tab.active { color: var(--text); font-weight: 650; }
.view-tab.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); }
.history-table-wrap { border-top: 0; margin: 0 14px 24px; max-height: 390px; }
.history-table-wrap th { position: sticky; top: 0; z-index: 2; }
.history-table-wrap .title-column { width: 28%; }
.history-table-wrap .path-link { color: var(--accent-dark); border: 0; padding: 0; background: transparent; cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-table-wrap .path-link:hover { text-decoration: underline; }
.retry-icon { width: 30px; height: 30px; border: 0; background: transparent; color: var(--danger); cursor: pointer; display: grid; place-items: center; border-radius: 4px; }
.retry-icon:hover { background: #fff1f0; }
.retry-icon svg { width: 16px; height: 16px; }
.event-detail { color: var(--text-muted); }
.toast { position: fixed; right: 20px; bottom: 20px; min-width: 220px; max-width: 420px; padding: 11px 14px; color: #fff; background: #263238; border-radius: 5px; box-shadow: var(--shadow); transform: translateY(16px); opacity: 0; pointer-events: none; transition: opacity 160ms ease, transform 160ms ease; z-index: 50; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--danger); }
.settings-dialog { width: min(560px, calc(100vw - 28px)); padding: 0; border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: 0 18px 60px rgba(20,31,38,.22); color: var(--text); }
.settings-dialog::backdrop { background: rgba(20,31,38,.32); }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.dialog-head h2 { margin: 0; font-size: 16px; }
.dialog-head p, .setting-row p { margin: 4px 0 0; color: var(--text-muted); font-size: 12px; }
.automation-status { padding: 11px 20px; background: var(--surface-subtle); border-bottom: 1px solid var(--border); color: var(--text-secondary); font-size: 12px; }
.setting-row { min-height: 72px; padding: 14px 20px; display: flex; justify-content: space-between; align-items: center; gap: 20px; border-bottom: 1px solid var(--border); }
.setting-row label { font-weight: 650; }
.time-input { width: 116px; height: 36px; padding: 0 9px; border: 1px solid var(--border-strong); border-radius: 4px; background: #fff; color: var(--text); font: inherit; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; }

.billing-main { padding-bottom: 28px; }
body[data-billing-view="compute"] .billing-account-only,body[data-billing-view="account"] #compute { display:none; }
body[data-billing-view="compute"] .billing-main { padding-bottom:0; }
.billing-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.billing-summary > div { min-height: 104px; padding: 17px 22px; border-right: 1px solid var(--border); display: flex; flex-direction: column; justify-content: center; }
.billing-summary > div:last-child { border-right: 0; }
.billing-summary span, .billing-summary small { color: var(--text-muted); font-size: 12px; }
.billing-summary strong { margin: 3px 0; font-size: 24px; font-variant-numeric: tabular-nums; }
.billing-toolbar { min-height: 86px; padding: 16px 22px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.billing-toolbar h1 { font-size: 17px; }
.billing-toolbar p { margin-top: 4px; color: var(--text-muted); font-size: 12px; }
.billing-records { border-top: 1px solid var(--border); }
.billing-record-tabs { overflow-x: auto; }
.billing-record-panel[hidden] { display: none; }
.billing-section { padding: 18px 22px 22px; }
.billing-section .section-head { margin-bottom: 12px; }
.billing-positive { color: var(--success); font-variant-numeric: tabular-nums; }
.billing-negative { color: var(--danger); font-variant-numeric: tabular-nums; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { transform: scale(.95); opacity: .3; } 50% { transform: scale(1.08); opacity: 1; } }

/* Shared web application frame. It mirrors the native desktop hierarchy. */
.routras-app-shell { --primary-width: 174px; --secondary-width: 224px; min-height: 100vh; display: grid; grid-template-columns: var(--primary-width) var(--secondary-width) minmax(0,1fr); background: #fff; transition: grid-template-columns 220ms cubic-bezier(.2,.8,.2,1); }
.routras-app-shell.primary-collapsed { --primary-width: 68px; }
.routras-app-shell.secondary-collapsed { --secondary-width: 0px; }
.routras-primary-nav { position: sticky; top: 0; height: 100vh; min-width: 0; display: flex; flex-direction: column; overflow: hidden; background: #f8f9f9; border-right: 1px solid #e6e9e9; z-index: 20; }
.routras-shell-brand { height: 76px; padding: 22px 17px 12px; display: flex; align-items: center; white-space: nowrap; overflow: hidden; text-decoration: none; }
.routras-brand-wordmark { width: 118px; height: auto; flex: 0 0 auto; }
.routras-brand-mark { display: none; width: 30px; height: 30px; object-fit: contain; flex: 0 0 30px; }
.routras-primary-nav nav { padding: 4px 10px; display: grid; gap: 4px; }
.routras-primary-nav nav a,.routras-collapse { height: 42px; min-width: 48px; padding: 0 12px; display: flex; align-items: center; gap: 12px; border: 0; border-radius: 6px; background: transparent; color: #43504e; text-decoration: none; white-space: nowrap; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 600; transition: background 140ms ease,transform 120ms ease,color 140ms ease; }
.routras-primary-nav nav a svg,.routras-collapse svg { width: 18px; height: 18px; flex: 0 0 18px; }
.routras-primary-nav nav a:hover,.routras-collapse:hover { background: var(--surface-subtle); }
.routras-primary-nav nav a:active,.routras-collapse:active { transform: scale(.985); }
.routras-primary-nav nav a.active { color: var(--accent-dark); background: var(--surface-selected); }
.routras-collapse { margin: auto 10px 12px; }
.primary-collapsed .routras-primary-nav nav a span,.primary-collapsed .routras-collapse span { opacity: 0; pointer-events: none; }
.primary-collapsed .routras-shell-brand { padding-left: 19px; }
.primary-collapsed .routras-brand-wordmark { display: none; }
.primary-collapsed .routras-brand-mark { display: block; }
.primary-collapsed .routras-primary-nav nav a,.primary-collapsed .routras-collapse { padding-left: 15px; }
.routras-secondary-nav { position: sticky; top: 0; height: 100vh; min-width: 0; display: flex; flex-direction: column; overflow: hidden; background: #fcfcfc; border-right: 1px solid #e6e9e9; z-index: 15; transition: opacity 180ms ease,transform 220ms cubic-bezier(.2,.8,.2,1); }
.secondary-collapsed .routras-secondary-nav { opacity: 0; transform: translateX(-12px); pointer-events: none; border-right: 0; }
.routras-secondary-head { height: 62px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; }
.routras-secondary-head strong { font-size: 16px; white-space: nowrap; }
.routras-secondary-close { width: 28px; height: 28px; display: grid; place-items:center; border:0; border-radius:5px; background:transparent; color:#66716f; cursor:pointer; }
.routras-secondary-close:hover { background:var(--surface-subtle); }
.routras-secondary-close svg { width:15px;height:15px; }
.routras-secondary-links { padding: 0 10px; display:grid;gap:3px; }
.routras-secondary-links a { height:38px;padding:0 12px;display:flex;align-items:center;border-radius:6px;color:#53605d;text-decoration:none;font-size:12.5px;font-weight:550;transition:background 140ms ease,color 140ms ease; }
.routras-secondary-links a:hover { background:var(--surface-subtle); }
.routras-secondary-links a.active { color:var(--accent-dark);background:var(--surface-selected);font-weight:650; }
.routras-shell-main { min-width:0; min-height:100vh; background:#fff; }
.routras-shell-main[data-page-loading="true"] > :not(.routras-command-bar):not(.routras-page-skeleton) { display:none !important; }
.routras-page-skeleton { min-height:calc(100vh - 56px); padding:24px 28px 36px; border:0; background:#fff; overflow:hidden; }
.routras-page-skeleton-inner { width:100%; max-width:1440px; margin:0 auto; }
.routras-skeleton-block { display:block; background:#e7ebea; border-radius:4px; animation:routras-skeleton-breathe 1.15s ease-in-out infinite alternate; }
.routras-skeleton-title { width:min(260px,42%); height:22px; }
.routras-skeleton-caption { width:min(430px,68%); height:10px; margin-top:10px; }
.routras-skeleton-toolbar { height:38px; margin-top:24px; border:1px solid #e3e7e6; border-radius:6px; display:flex; align-items:center; gap:10px; padding:0 10px; }
.routras-skeleton-toolbar .routras-skeleton-block { width:108px; height:18px; }
.routras-skeleton-toolbar .routras-skeleton-block:last-child { width:76px; margin-left:auto; }
.routras-skeleton-stats { margin-top:18px; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); border:1px solid #e3e7e6; border-radius:6px; overflow:hidden; }
.routras-skeleton-stat { min-height:92px; padding:18px; border-right:1px solid #e3e7e6; display:grid; align-content:center; gap:10px; }
.routras-skeleton-stat:last-child { border-right:0; }
.routras-skeleton-stat .routras-skeleton-block:first-child { width:46%; height:9px; }
.routras-skeleton-stat .routras-skeleton-block:last-child { width:64%; height:22px; }
.routras-skeleton-table { margin-top:18px; border:1px solid #e3e7e6; border-radius:6px; overflow:hidden; }
.routras-skeleton-table-head,.routras-skeleton-table-row { display:grid; grid-template-columns:minmax(170px,1.4fr) repeat(4,minmax(90px,1fr)); align-items:center; gap:18px; padding:0 16px; }
.routras-skeleton-table-head { height:38px; background:#f5f7f7; }
.routras-skeleton-table-row { height:54px; border-top:1px solid #e8ebea; }
.routras-skeleton-table .routras-skeleton-block { width:72%; height:9px; }
.routras-skeleton-table .routras-skeleton-block:first-child { width:88%; height:12px; }
.routras-skeleton-cards { margin-top:18px; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.routras-skeleton-card { min-height:176px; padding:16px; border:1px solid #e3e7e6; border-radius:6px; display:grid; align-content:start; gap:13px; }
.routras-skeleton-card .routras-skeleton-block:nth-child(1) { width:38px; height:38px; border-radius:6px; }
.routras-skeleton-card .routras-skeleton-block:nth-child(2) { width:68%; height:13px; }
.routras-skeleton-card .routras-skeleton-block:nth-child(3) { width:92%; height:9px; }
.routras-skeleton-card .routras-skeleton-block:nth-child(4) { width:74%; height:9px; }
.routras-skeleton-workspace { margin-top:18px; min-height:430px; display:grid; grid-template-columns:minmax(320px,.85fr) minmax(420px,1.35fr); border:1px solid #e3e7e6; border-radius:6px; overflow:hidden; }
.routras-skeleton-pane { padding:18px; display:grid; align-content:start; gap:14px; }
.routras-skeleton-pane + .routras-skeleton-pane { border-left:1px solid #e3e7e6; }
.routras-skeleton-pane .routras-skeleton-block { height:11px; }
.routras-skeleton-pane .routras-skeleton-block:nth-child(1) { width:44%; height:16px; margin-bottom:6px; }
.routras-skeleton-pane .routras-skeleton-block:nth-child(2n) { width:88%; }
.routras-skeleton-pane .routras-skeleton-block:nth-child(2n + 1) { width:66%; }
.routras-skeleton-settings { margin-top:18px; border-top:1px solid #e3e7e6; }
.routras-skeleton-setting { min-height:72px; padding:14px 4px; border-bottom:1px solid #e3e7e6; display:grid; grid-template-columns:minmax(180px,1fr) minmax(210px,36%); align-items:center; gap:30px; }
.routras-skeleton-setting > div { display:grid; gap:9px; }
.routras-skeleton-setting .routras-skeleton-block:first-child { width:42%; height:12px; }
.routras-skeleton-setting .routras-skeleton-block:last-child { width:70%; height:9px; }
.routras-skeleton-setting > .routras-skeleton-block { justify-self:end; width:100%; height:34px; }
.routras-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; }
@keyframes routras-skeleton-breathe { from { opacity:.48; } to { opacity:1; } }
.routras-secondary-open { width:30px;height:30px;display:none;place-items:center;border:0;border-radius:5px;background:transparent;color:var(--text-secondary);cursor:pointer; }
.routras-secondary-open:hover { background:var(--surface-subtle);color:var(--accent-dark); }
.routras-secondary-open svg { width:16px;height:16px; }
.secondary-collapsed .routras-secondary-open { display:grid; }
.routras-command-bar { height:56px; padding:0 18px; display:flex;align-items:center;gap:12px;border-bottom:1px solid #e7e9e9;background:#fff; }
.routras-command-project { position:relative;display:flex;align-items:center;gap:8px;height:32px;padding:0 9px;color:#3e4947;background:#f7f8f8;border-radius:6px; }
.routras-command-project > svg:first-child { width:16px;height:16px;color:#71807c; }
.routras-command-project select { width:72px;min-width:58px;max-width:240px;height:30px;padding:0 22px 0 0;border:0;outline:0;appearance:none;background:transparent;color:#3e4947;font-family:inherit;font-size:12.5px;font-weight:650;white-space:nowrap;text-overflow:ellipsis;cursor:pointer;transition:width 160ms cubic-bezier(.2,.8,.2,1); }
.routras-command-project .project-chevron { position:absolute;right:8px;width:13px;height:13px;color:#71807c;pointer-events:none; }
.routras-project-automation { width:30px;height:30px;display:grid;place-items:center;border:0;border-radius:5px;background:transparent;color:#60706c;cursor:pointer;transition:background 140ms ease,color 140ms ease,opacity 140ms ease; }
.routras-project-automation:hover { background:var(--surface-subtle);color:var(--accent-dark); }
.routras-project-automation svg { width:16px;height:16px; }
.routras-command-actions { margin-left:auto;display:flex;align-items:center;gap:7px; }
.routras-mobile-menu { display:none;width:32px;height:32px;border:0;background:transparent;border-radius:5px; }
.routras-mobile-menu svg { width:18px;height:18px; }
.routras-shell-ready .production-main { min-height:calc(100vh - 56px); }
.routras-project-automation-dialog { width:min(720px,calc(100vw - 40px));max-height:min(760px,calc(100vh - 40px));padding:0;border:1px solid #e1e5e4;border-radius:8px;background:#fff;box-shadow:0 24px 80px rgba(23,34,31,.18); }
.routras-project-automation-dialog::backdrop { background:rgba(24,31,29,.22);backdrop-filter:blur(2px); }
.project-automation-head { min-height:68px;padding:14px 20px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #e8eaea; }
.project-automation-head h2 { margin:0;font-size:18px;letter-spacing:0; }
.project-automation-head p { margin:4px 0 0;color:#7a8582;font-size:11px; }
.project-automation-body { max-height:calc(100vh - 190px);overflow:auto; }
.project-automation-body section { padding:18px 20px;border-bottom:1px solid #eceeee; }
.project-automation-section-head { display:flex;align-items:center;justify-content:space-between;margin-bottom:13px; }
.project-automation-section-head label { display:flex;align-items:center;gap:8px;font-size:13px; }
.project-automation-section-head svg { width:16px;height:16px;color:var(--accent-dark); }
.project-automation-section-head input[type="checkbox"] { width:34px;height:18px;accent-color:var(--accent); }
.project-automation-grid { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;align-items:end; }
.project-automation-grid > label { min-width:0;display:grid;gap:6px;color:#6f7a77;font-size:11px; }
.project-automation-grid input:not([type="checkbox"]),.project-automation-grid select { width:100%;height:34px;padding:0 9px;border:1px solid #dde3e1;border-radius:5px;background:#fff;color:#26312f;font:inherit; }
.project-automation-grid .project-automation-check { display:flex;align-items:center;gap:7px;height:34px;color:#3f4c49; }
.project-automation-grid .project-automation-check input { width:15px;height:15px;accent-color:var(--accent); }

.shell-theme { position:relative; }
.shell-theme-menu { position:absolute;z-index:60;top:38px;right:0;padding:8px;display:flex;gap:7px;border:1px solid var(--border);border-radius:7px;background:var(--surface);box-shadow:var(--shadow); }
.shell-theme-menu[hidden] { display:none; }
.shell-theme-menu button { position:relative;width:24px;height:24px;padding:0;border:0;border-radius:5px;display:grid;place-items:center;background:var(--swatch);cursor:pointer;box-shadow:none; }
.shell-theme-menu button svg { width:14px;height:14px;color:#fff;opacity:0;stroke-width:3;pointer-events:none; }
.shell-theme-menu button.active { outline:0;box-shadow:none; }
.shell-theme-menu button.active svg { opacity:1; }
.shell-theme-menu button:focus-visible { outline:2px solid color-mix(in srgb,var(--swatch) 68%,#18211f);outline-offset:2px; }
.project-automation-grid label.disabled { opacity:.38; }
.project-automation-status { min-height:14px;margin:10px 0 0;color:#7a8582;font-size:10.5px; }
.project-automation-status.error { color:#b84646; }
.project-automation-actions { min-height:58px;padding:10px 16px;display:flex;align-items:center;justify-content:flex-end;gap:8px;border-top:1px solid #e8eaea; }
.routras-shell-ready .production-workspace { min-height:calc(100vh - 295px); }
.routras-shell-ready .detail-pane,.routras-shell-ready .queue-table { max-height:calc(100vh - 295px); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

@media (max-width: 1050px) {
  .operations-grid { grid-template-columns: minmax(0, 1fr); }
  .current-detail { min-height: 0; }
  .topbar-actions .schedule-button span { display: none; }
  .topbar-actions .schedule-button { width: 34px; padding: 6px; }
  .topbar-actions .switch-label > span:first-child { display: none; }
}

@media (max-width: 1320px) and (min-width: 901px) {
  .topbar { gap: 10px; padding-left: 16px; padding-right: 16px; }
  .brand { flex: 0 0 24px; width: 24px; }
  .brand > span, .refresh-time { display: none; }
  .topbar-actions { gap: 5px; }
  .schedule-button { padding-left: 9px; padding-right: 9px; }
}

@media (max-width: 900px) {
  .routras-app-shell { display:block; }
  .routras-primary-nav { position:fixed; left:0; top:0; width:min(280px,82vw); transform:translateX(-102%); box-shadow:0 16px 50px rgba(20,31,38,.2); transition:transform 200ms ease; }
  .routras-secondary-nav { display:none; }
  .routras-app-shell.mobile-nav-open .routras-primary-nav { transform:translateX(0); }
  .routras-command-bar { height:56px;padding:0 12px; }
  .routras-command-project { min-width:0;flex:1 1 auto; }
  .routras-command-project select { max-width:38vw; }
  .project-automation-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .routras-mobile-menu { display:grid;place-items:center; }
  .routras-command-actions { min-width:0;flex:1 1 0;overflow-x:auto;overscroll-behavior-inline:contain;scrollbar-width:none; }
  .routras-command-actions::-webkit-scrollbar { display:none; }
  .routras-command-actions > .command-button span,.routras-command-actions > .refresh-time { display:none; }
  .routras-shell-main { min-height:100vh; }
  .routras-page-skeleton { padding:18px 14px 28px; }
  .routras-skeleton-stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .routras-skeleton-stat:nth-child(2) { border-right:0; }
  .routras-skeleton-stat:nth-child(-n+2) { border-bottom:1px solid #e3e7e6; }
  .routras-skeleton-cards { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .routras-skeleton-workspace { grid-template-columns:1fr; }
  .routras-skeleton-pane + .routras-skeleton-pane { border-left:0; border-top:1px solid #e3e7e6; }
  .routras-skeleton-table-head,.routras-skeleton-table-row { grid-template-columns:minmax(170px,1.4fr) repeat(2,minmax(80px,1fr)); }
  .routras-skeleton-table-head > :nth-child(n+4),.routras-skeleton-table-row > :nth-child(n+4) { display:none; }
  .topbar { height: 56px; min-height: 56px; padding: 10px 14px; align-items: center; gap: 8px; }
  .brand { flex: 0 0 22px; width: 22px; font-size: 16px; padding-top: 4px; }
  .brand > span, .refresh-time, .switch-label { display: none; }
  .topbar > .module-nav, .topbar > .topbar-actions { display: none; }
  .topbar.menu-open { height: auto; min-height: 56px; flex-wrap: wrap; }
  .topbar.menu-open > .module-nav, .topbar.menu-open > .topbar-actions { order: 3; width: 100%; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; padding: 8px 0 3px; border-top: 1px solid var(--border); }
  .topbar.menu-open > .module-nav a, .topbar.menu-open > .topbar-actions > a, .topbar.menu-open > .topbar-actions > button { width: 100%; min-width: 0; min-height: 38px; justify-content: flex-start; padding: 7px 9px; }
  .topbar.menu-open > .topbar-actions > .icon-button { display: none; }
  .shell-tools { margin-left: auto; }
  .icon-button.shell-menu { display: inline-grid; }
  .schedule-button span { display: none; }
  .schedule-button { width: 34px; padding: 6px; }
  .topbar-actions { min-width: 0; gap: 4px; }
  .pipeline-band, .work-section { padding-left: 14px; padding-right: 14px; }
  .pipeline-scroll { overflow: visible; }
  .pipeline { min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px 8px; }
  .pipeline-node { min-width: 0; }
  .pipeline-node:not(:last-child)::after { display: none; }
  .node-icon { width: 46px; height: 46px; margin-bottom: 5px; }
  .node-label { min-height: 35px; font-size: 12px; }
  .node-meta { font-size: 11px; line-height: 1.25; }
  .heading-with-summary { align-items: flex-start; flex-direction: column; gap: 6px; }
  .inline-summary { gap: 10px; flex-wrap: wrap; }
  .current-table-wrap { max-height: 360px; overflow-y: auto; overflow-x: hidden; border-top: 0; }
  .current-table-wrap table, .current-table-wrap tbody, .current-table-wrap tr { display: block; width: 100%; }
  .current-table-wrap thead { display: none; }
  .current-table-wrap tbody { display: grid; gap: 8px; }
  .current-table-wrap tr { padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
  .current-table-wrap td { min-height: 28px; height: auto; padding: 4px 0; border: 0; display: grid; grid-template-columns: 78px minmax(0, 1fr); align-items: start; gap: 8px; white-space: normal; overflow: visible; overflow-wrap: anywhere; }
  .current-table-wrap td::before { content: attr(data-label); color: var(--text-muted); font-size: 11px; font-weight: 600; }
  .current-table-wrap .empty-row { min-height: 92px; display: grid; place-items: center; border: 0; }
  .current-table-wrap .empty-row td { display: block; text-align: center; }
  .current-table-wrap .empty-row td::before { content: none; }
  .current-table-wrap .progress-cell { min-width: 0; }
  .history-toolbar { padding: 10px 14px; align-items: stretch; flex-direction: column; gap: 8px; }
  .history-view-head { padding: 12px 14px; }
  .project-area { justify-content: space-between; }
  .project-area select { width: min(74vw, 360px); }
  .filters { justify-content: space-between; }
  .view-tabs { padding: 0 14px; }
  .history-table-wrap { margin-left: 0; margin-right: 0; }
  .history-table-wrap table { min-width: 900px; }
  .section-head { align-items: flex-start; }
  .billing-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .billing-summary > div { padding: 14px; border-bottom: 1px solid var(--border); }
  .billing-toolbar, .billing-section { padding-left: 14px; padding-right: 14px; }
  .billing-toolbar { align-items: flex-start; }
  .billing-section table { min-width: 760px; }
}

@media (max-width: 560px) {
  .routras-skeleton-cards { grid-template-columns:1fr; }
  .routras-skeleton-setting { grid-template-columns:1fr; gap:12px; }
  .routras-skeleton-setting > .routras-skeleton-block { justify-self:start; width:min(260px,100%); }
}
.team-permission-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px 14px}.team-permission-grid label{display:flex;align-items:center;gap:7px;min-width:0;font-size:12px;color:var(--text)}.team-permission-grid input{width:16px;height:16px;accent-color:var(--accent)}.team-permission-cell{min-width:360px}.team-permission-cell .team-permission-grid{grid-template-columns:repeat(3,max-content)}
@media(max-width:760px){.team-permission-grid,.team-permission-cell .team-permission-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.team-permission-cell{min-width:280px}}
