:root {
  color-scheme: light;
  --canvas: #f5f5f7;
  --surface: #fff;
  --surface-muted: #f5f5f7;
  --table-head: #fbfbfd;
  --sidebar-glass: rgba(246, 246, 248, .86);
  --toolbar-glass: rgba(255, 255, 255, .8);
  --footer-fill: rgba(255, 255, 255, .45);
  --control-fill: #ebebed;
  --control-hover: #e0e0e5;
  --hover: rgba(0, 0, 0, .045);
  --line: rgba(0, 0, 0, .075);
  --line-soft: rgba(0, 0, 0, .05);
  --text: #1d1d1f;
  --title: #1d1d1f;
  --muted: #6e6e73;
  --hint: #86868b;
  --accent: #007aff;
  --accent-hover: #0062cc;
  --accent-text: #0062cc;
  --accent-light: #e8f2ff;
  --indigo: #5856d6;
  --green: #248a3d;
  --green-light: #eaf7ed;
  --red: #c91e48;
  --red-light: #ffebf0;
  --amber: #935400;
  --amber-light: #fff3e2;
  --orange: #b96a00;
  --activity-green: #34c759;
  --activity-red: #fa2d55;
  --activity-gray: #aeaeb2;
  --ink: #1d1d1f;
  --ink-hover: #000;
  --ink-text: #fff;
  --brand-shadow: 0 2px 10px rgba(52, 199, 89, .24);
  --shadow: 0 1px 2px rgba(0, 0, 0, .02), 0 6px 20px rgba(0, 0, 0, .025);
  --dialog-shadow: 0 20px 50px rgba(0, 0, 0, .18);
  --backdrop: rgba(0, 0, 0, .30);
  --sidebar-width: 244px;
  --toolbar-height: 56px;
  --spring: cubic-bezier(.16, 1, .3, 1);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #1c1c1e;
  --surface: #2c2c2e;
  --surface-muted: #1e1e20;
  --table-head: #242426;
  --sidebar-glass: rgba(28, 28, 30, .86);
  --toolbar-glass: rgba(28, 28, 30, .85);
  --footer-fill: rgba(255, 255, 255, .02);
  --control-fill: #2c2c2e;
  --control-hover: #3a3a3c;
  --hover: rgba(255, 255, 255, .07);
  --line: rgba(255, 255, 255, .09);
  --line-soft: rgba(255, 255, 255, .065);
  --text: #e5e5ea;
  --title: #fff;
  --muted: #aeaeb2;
  --hint: #98989d;
  --accent-text: #409cff;
  --accent-light: rgba(0, 122, 255, .16);
  --indigo: #a8a7ff;
  --green: #56d474;
  --green-light: rgba(52, 199, 89, .15);
  --red: #ff6a85;
  --red-light: rgba(250, 45, 85, .15);
  --amber: #ffb64c;
  --amber-light: rgba(255, 149, 0, .15);
  --orange: #ff9f0a;
  --activity-gray: #636366;
  --ink: #fff;
  --ink-hover: #e5e5ea;
  --ink-text: #1d1d1f;
  --brand-shadow: 0 2px 10px rgba(0, 0, 0, .32);
  --shadow: 0 2px 6px rgba(0, 0, 0, .24), 0 8px 24px rgba(0, 0, 0, .28);
  --dialog-shadow: 0 20px 55px rgba(0, 0, 0, .46);
  --backdrop: rgba(0, 0, 0, .45);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--text); font-size: 14px; }
button, input, select { font: inherit; letter-spacing: inherit; }
button, select { cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1, h2, h3 { color: var(--title); }
code, kbd, .mono { font-family: "SFMono-Regular", ui-monospace, Menlo, monospace; }
code, .mono { font-size: .91em; }
[hidden] { display: none !important; }

.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.icon {
  width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.icon.small { width: 15px; height: 15px; }

.workspace-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--sidebar-glass);
  border-right: 1px solid var(--line);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  backdrop-filter: blur(28px) saturate(190%);
  z-index: 10;
}

.sidebar-header {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  flex: 0 0 var(--toolbar-height);
  padding: 0 20px;
  border-bottom: 1px solid var(--line-soft);
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; border-radius: 8px; }
.brand img { flex: 0 0 auto; border-radius: 12px; box-shadow: var(--brand-shadow); }
.brand > span { min-width: 0; }
.brand strong, .brand small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand strong { color: var(--title); font-size: 14px; font-weight: 700; line-height: 1.2; }
.brand small { color: var(--muted); font-size: 11px; font-weight: 500; margin-top: 2px; }

.sidebar-scroll { flex: 1; min-height: 0; overflow: auto; padding: 14px 12px; }
.navigation, .nav-group { display: grid; gap: 2px; }
.navigation { gap: 20px; }
.nav-heading {
  padding: 0 12px 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.nav-link {
  display: flex; align-items: center; gap: 10px; min-height: 32px; padding: 6px 12px;
  border-radius: 8px; font-size: 13px; line-height: 18px; font-weight: 500;
  transition: background .15s ease, color .15s ease;
}
.nav-link > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-link:hover { background: var(--hover); }
.nav-link .icon { width: 16px; height: 16px; color: var(--accent-text); }
.nav-link .icon use[href="#i-folder"] { color: var(--green); }
.nav-link .icon use[href="#i-pipeline"] { color: var(--orange); }
.nav-link .icon use[href="#i-server"] { color: var(--indigo); }
.nav-link[aria-current] { color: white; background: var(--accent); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.nav-link[aria-current] .icon, .nav-link[aria-current] .icon use { color: inherit; }
.sidebar-projects { margin-top: 20px; }
.sidebar-projects:empty { display: none; }
.sidebar-section { display: flex; align-items: center; justify-content: space-between; padding-right: 4px; }
.sidebar-section .nav-heading { padding-bottom: 0; }
.sidebar-section .icon-button { width: 24px; min-height: 24px; }

.sidebar-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 5px;
  padding: 14px;
  border-top: 1px solid var(--line-soft);
  background: var(--footer-fill);
}
.account-identity { display: flex; align-items: center; gap: 9px; min-width: 0; }
.account-avatar {
  display: inline-grid; place-items: center; flex: 0 0 32px; height: 32px;
  border-radius: 50%; background: var(--ink); color: var(--ink-text); font-size: 12px; font-weight: 600;
}
.account-name { min-width: 0; }
.account-name strong, .account-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-name strong { color: var(--title); font-size: 12px; font-weight: 600; }
.account-name small { color: var(--muted); font-size: 11px; margin-top: 2px; }
.account-actions { display: flex; align-items: center; gap: 1px; flex: 0 0 auto; }
#theme-toggle { color: var(--indigo); }
[data-theme="dark"] #theme-toggle { color: var(--orange); }
.account-actions [data-action="logout"]:hover { background: var(--red-light); color: var(--red); }

.workspace { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.topbar {
  flex: 0 0 var(--toolbar-height);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 28px;
  background: var(--toolbar-glass);
  border-bottom: 1px solid var(--line-soft);
  -webkit-backdrop-filter: blur(28px);
  backdrop-filter: blur(28px);
}
.topbar-leading, .topbar-actions { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-actions { flex: 0 0 auto; }
.breadcrumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12px; color: var(--muted); white-space: nowrap; }
.breadcrumbs a:hover { color: var(--accent-text); }
.breadcrumbs span:last-child {
  overflow: hidden; text-overflow: ellipsis; color: var(--title); font-size: 14px; font-weight: 600;
}
.breadcrumbs .icon { width: 12px; height: 12px; color: var(--hint); }

.workspace-search {
  display: flex; align-items: center; gap: 8px; width: clamp(150px, 16vw, 208px); min-height: 32px;
  padding: 0 8px 0 12px;
  border: 0; border-radius: 8px; background: var(--control-fill); color: var(--muted);
  font-size: 12px;
}
.workspace-search:hover { background: var(--control-hover); }
.workspace-search .icon { width: 14px; height: 14px; }
.workspace-search span { min-width: 0; flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-search kbd { border-radius: 4px; background: var(--canvas); padding: 2px 5px; font-size: 10px; }
.sync-status {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid transparent; border-radius: 999px; padding: 4px 10px;
  background: var(--hover); color: var(--muted); font-size: 11px; font-weight: 600; white-space: nowrap;
}
.sync-status.online { background: var(--green-light); color: var(--green); }
.language-select {
  min-height: 32px; max-width: 105px; padding: 4px 7px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--text); font-size: 12px;
}
.mobile-menu, .sidebar-backdrop { display: none !important; }

.workspace-scroll { flex: 1; min-height: 0; overflow: auto; }
#main { width: 100%; max-width: 1496px; margin: 0 auto; padding: 28px 28px 44px; outline: none; }
.page-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.page-header > :first-child { min-width: 0; }
.page-title { font-size: 20px; line-height: 28px; font-weight: 700; letter-spacing: -.025em; overflow-wrap: anywhere; }
.page-subtitle { margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.button, .icon-button, .text-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 0 13px; min-height: 33px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text);
  font-size: 12px; font-weight: 600; white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.button:hover, .icon-button:hover { background: var(--surface-muted); }
.button .icon, .icon-button .icon { width: 16px; height: 16px; }
.button.primary { background: var(--accent); border-color: transparent; color: white; }
.button.primary:hover { background: var(--accent-hover); }
.button.danger { color: var(--red); }
.button.danger:hover { background: var(--red-light); }
.icon-button { width: 32px; min-height: 32px; padding: 0; border-radius: 8px; color: var(--muted); }
.icon-button.compact { width: 27px; min-height: 27px; border-color: transparent; background: transparent; }
.icon-button.compact:hover { background: var(--hover); color: var(--title); }
.text-button { min-height: 29px; padding: 0 4px; background: transparent; border-color: transparent; color: var(--accent-text); }
.text-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.text-button .icon { width: 14px; height: 14px; }

.panel, .metric, .project-card, .runner-card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.metric { min-width: 0; padding: 19px; }
.metric-heading { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.metric-heading h2 { color: var(--muted); font-size: 12px; font-weight: 600; line-height: 16px; }
.metric-heading .icon { width: 16px; height: 16px; color: var(--accent-text); }
.metric.green .icon, .metric.green .metric-value { color: var(--green); }
.metric.amber .icon { color: var(--orange); }
.metric.blue .icon { color: var(--indigo); }
.metric-value { margin-top: 8px; color: var(--title); font-size: 30px; font-weight: 700; line-height: 1.2; }
.metric-detail { margin-top: 7px; color: var(--muted); font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.tile-icon, .project-mark {
  display: inline-grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px;
  border-radius: 9px; background: var(--accent-light); color: var(--accent-text);
}

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 20px; margin-bottom: 24px; }
.dashboard-side { display: grid; gap: 16px; grid-template-rows: 1fr 1fr; min-width: 0; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; }
.panel-header h2 { font-size: 16px; font-weight: 700; }
.panel-subtitle { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.period {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px;
  border-radius: 8px; background: var(--control-fill); color: var(--muted); font-size: 11px; font-weight: 600; white-space: nowrap;
}
.period .icon { width: 13px; height: 13px; }
.activity { display: flex; flex-direction: column; min-width: 0; min-height: 282px; }
.activity .panel-header { align-items: flex-start; padding: 22px 23px 12px; }
.chart-wrap { display: flex; flex: 1; align-items: flex-end; padding: 0 18px 8px; }
.chart { display: block; width: 100%; max-height: 190px; }
.chart text { fill: var(--muted); font-family: inherit; font-size: 12px; font-weight: 500; }
.chart .chart-count { fill: var(--title); font-weight: 700; }
.chart .today { fill: var(--accent-text); font-weight: 600; }
.chart .chart-track { fill: var(--surface-muted); }
.chart .guide { fill: var(--accent); opacity: .2; }
.chart .completed { fill: var(--accent); }
.chart .failed { fill: var(--activity-red); }
.chart .other { fill: var(--activity-gray); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; padding: 0 23px 18px; color: var(--muted); font-size: 11px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.legend .red-key { background: var(--activity-red); }
.legend .gray-key { background: var(--activity-gray); }
.compact-panel { min-width: 0; }
.compact-panel .panel-header { padding-bottom: 4px; }
.compact-panel .panel-header > a { min-height: 25px; }
.mini-list { padding: 3px 14px 12px; }
.mini-item { display: flex; align-items: center; min-width: 0; gap: 9px; min-height: 39px; padding: 5px 6px; border-radius: 8px; }
a.mini-item:hover { background: var(--hover); }
.mini-main { min-width: 0; flex: 1; }
.mini-main strong, .mini-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-main strong { font-size: 13px; font-weight: 600; }
.mini-main small { color: var(--muted); font-size: 11px; margin-top: 2px; }
.small-text { color: var(--muted); font-size: 12px; line-height: 1.35; }
.mini-item .tile-icon { width: 27px; height: 27px; border-radius: 8px; }
.mini-item .tile-icon .icon { width: 15px; height: 15px; }
.project-mark { width: 27px; height: 27px; border-radius: 8px; font-size: 13px; font-weight: 700; }
.project-mark.mint { background: var(--green-light); color: var(--green); }
.project-mark.rose { background: var(--red-light); color: var(--red); }
.project-mark.large { width: 40px; height: 40px; border-radius: 12px; font-size: 19px; }
.sidebar .project-mark { width: 21px; height: 21px; border-radius: 6px; font-size: 11px; }
.sidebar .nav-link[aria-current] .project-mark { background: rgba(255, 255, 255, .22); color: white; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; min-height: 22px; padding: 2px 7px;
  border-radius: 999px; background: var(--hover); color: var(--muted); font-size: 11px; font-weight: 600; white-space: nowrap;
}
.badge .icon { width: 13px; height: 13px; }
.badge.succeeded, .badge.online { background: var(--green-light); color: var(--green); }
.badge.failed, .badge.interrupted { background: var(--red-light); color: var(--red); }
.badge.running { background: var(--accent-light); color: var(--accent-text); }
.badge.queued { background: var(--amber-light); color: var(--amber); }
.dot { display: inline-block; width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: var(--hint); }
.dot.online { background: var(--activity-green); }

.loading, .empty-state { padding: 32px 18px; color: var(--muted); text-align: center; }
.loading { display: flex; align-items: center; justify-content: center; gap: 9px; }
.empty-state .tile-icon { margin-bottom: 10px; }
.empty-state h3 { margin-bottom: 5px; font-size: 14px; }
.empty-state p { font-size: 12px; line-height: 1.45; }
.empty-state .button { margin-top: 12px; }
.spinner {
  display: inline-block; width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid var(--accent-light); border-top-color: var(--accent); animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.table-wrap { overflow: auto; border-radius: inherit; }
.runs-table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; }
.runs-table th {
  padding: 10px 10px; border-block: 1px solid var(--line-soft); background: var(--table-head);
  color: var(--muted); font-size: 12px; font-weight: 600;
}
.runs-table td { height: 55px; padding: 10px 10px; border-bottom: 1px solid var(--line-soft); font-size: 12px; }
.runs-table th:first-child, .runs-table td:first-child { padding-left: 18px; }
.runs-table th:last-child, .runs-table td:last-child { padding-right: 16px; }
.runs-table tr:last-child td { border-bottom: 0; }
.runs-table tbody tr:hover { background: var(--hover); }
.run-col { width: 32%; min-width: 180px; }
.run-link { display: flex; align-items: center; gap: 9px; min-width: 0; }
a.run-link:hover .run-name { color: var(--accent-text); }
.run-link .tile-icon { width: 32px; height: 32px; }
.run-link .tile-icon .icon { width: 16px; height: 16px; }
.run-text { display: block; min-width: 0; max-width: clamp(140px, 20vw, 320px); }
.run-name { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.run-meta { display: flex; align-items: center; gap: 6px; color: var(--muted); margin-top: 3px; font-size: 11px; }
.run-meta-desktop { display: inline-flex; align-items: center; gap: 6px; }
.run-meta-mobile { display: none; }
.run-meta .icon { width: 12px; height: 12px; }
.inline-separator { display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: var(--hint); }
.table-project { display: inline-flex; align-items: center; gap: 7px; color: var(--text); }
.table-project .project-mark { width: 22px; height: 22px; border-radius: 6px; font-size: 10px; }
.table-project:hover { color: var(--accent-text); }
.dim { color: var(--muted); }
.align-right { text-align: right; }
.row-link { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; color: var(--muted); }
.row-link:hover { background: var(--accent-light); color: var(--accent-text); }
.row-link .icon { width: 14px; height: 14px; }
.users-table .badge { margin-right: 4px; }
.users-table .user-actions { text-align: right; }
.users-table .user-actions .button { margin-left: 6px; min-height: 31px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 15px 20px; }
.search-field { position: relative; flex: 1; min-width: 190px; max-width: 360px; }
.search-field .icon { position: absolute; top: 10px; left: 10px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.search-field input, .field input, .field select, .filters select, .log-header select {
  width: 100%; min-height: 36px; padding: 7px 10px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--surface-muted); color: var(--text);
}
.search-field input { padding-left: 33px; }
input::placeholder { color: var(--hint); opacity: 1; }
.filters select { width: auto; min-width: 124px; }
.list-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 20px; border-top: 1px solid var(--line-soft); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr)); gap: 16px; }
.card-grid.single { grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 480px)); }
.project-card, .runner-card { min-width: 0; padding: 20px; }
.card-heading { display: flex; align-items: center; gap: 11px; min-width: 0; }
.card-heading > div:nth-child(2) { flex: 1; min-width: 0; }
.card-heading h2 { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.card-heading p { margin-top: 3px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.project-card a:hover h2 { color: var(--accent-text); }
.card-facts {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px;
  margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line-soft);
}
.card-facts span { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag {
  padding: 3px 6px; border: 1px solid var(--line-soft); border-radius: 6px;
  background: var(--surface-muted); color: var(--muted); font-size: 11px; overflow-wrap: anywhere;
}
.fact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 16px; padding: 20px; }
.fact-grid dt { margin-bottom: 5px; color: var(--muted); font-size: 12px; }
.fact-grid dd { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.fact-grid dd a { color: var(--accent-text); }
.fact-grid dd a:hover, .back-link:hover { text-decoration: underline; }
.project-header-icon { display: flex; align-items: center; gap: 12px; min-width: 0; }
.project-facts, .run-facts { margin-bottom: 20px; }
.project-facts > .sync-error { margin: 0 20px 16px; }
.sync-error, .form-error {
  padding: 9px 11px; border-radius: 10px; background: var(--red-light); color: var(--red);
  font-size: 12px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere;
}
.back-link { display: inline-flex; align-items: center; gap: 5px; margin-bottom: 14px; color: var(--accent-text); font-size: 12px; font-weight: 600; }
.back-link .icon { width: 14px; height: 14px; }

.deployment-panel { margin-bottom: 20px; }
.environment-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 12px; padding: 0 16px 16px;
}
.environment-card { padding: 14px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--surface-muted); }
.environment-title { display: flex; align-items: center; gap: 9px; }
.environment-title > div { flex: 1; min-width: 0; }
.environment-title h3 { margin-bottom: 2px; font-size: 14px; overflow-wrap: anywhere; }
.environment-title p { font-size: 11px; }
.environment-card dl { display: grid; gap: 6px; margin-top: 12px; font-size: 12px; }
.environment-card dl > div { display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.environment-card dt { color: var(--muted); }
.environment-card dd { display: flex; align-items: center; gap: 5px; }
.environment-card dd a { color: var(--accent-text); }

.run-layout { display: grid; grid-template-columns: minmax(236px, .78fr) minmax(0, 2.6fr); align-items: start; gap: 16px; }
.jobs-panel { min-width: 0; overflow: hidden; }
.jobs-panel .panel-header { border-bottom: 1px solid var(--line-soft); }
.jobs-list { display: grid; gap: 4px; padding: 8px; min-width: 0; }
.jobs-section-label {
  padding: 6px 8px 2px; color: var(--hint); font-size: 10px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
}
.jobs-section-label:not(:first-child) { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.job-item-group { display: grid; gap: 2px; min-width: 0; }
.job-button {
  display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; min-height: 52px; padding: 9px 10px;
  border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--text); text-align: left;
  transition: background .15s ease, border-color .15s ease;
}
.job-button:hover { background: var(--hover); }
.job-button[aria-pressed="true"] { border-color: var(--accent-light); background: var(--accent-light); }
.job-name { flex: 1; min-width: 0; }
.job-name strong { display: block; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.job-name small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.35; overflow-wrap: anywhere; }
.job-progress-bar {
  display: block; width: 100%; height: 4px; margin-top: 6px;
  border: 0; border-radius: 999px; overflow: hidden; background: var(--hover); appearance: none;
}
.job-progress-bar::-webkit-progress-bar { background: var(--hover); border-radius: 999px; }
.job-progress-bar::-webkit-progress-value { background: var(--accent); border-radius: 999px; transition: width .25s ease; }
.job-progress-bar.is-succeeded::-webkit-progress-value { background: var(--green); }
.job-progress-bar.is-failed::-webkit-progress-value,
.job-progress-bar.is-interrupted::-webkit-progress-value { background: var(--red); }
.job-progress-bar::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.job-progress-bar.is-succeeded::-moz-progress-bar { background: var(--green); }
.job-progress-bar.is-failed::-moz-progress-bar,
.job-progress-bar.is-interrupted::-moz-progress-bar { background: var(--red); }
.job-step-tree {
  display: grid; gap: 2px; min-width: 0; margin: 2px 0 6px 12px; padding-left: 8px;
  border-left: 1.5px solid var(--line);
}
.job-step-link {
  display: flex; align-items: center; gap: 6px; width: 100%; min-width: 0; min-height: 30px; padding: 4px 8px;
  border: 0; border-radius: 7px; background: transparent; color: var(--text); font-size: 12px; text-align: left;
  transition: background .15s ease, color .15s ease;
}
.job-step-link:hover { background: var(--hover); }
.job-step-link.is-focused { background: var(--accent-light); color: var(--accent-text); font-weight: 600; }
.job-step-link-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-step-link-time { color: var(--muted); font-size: 11px; flex: 0 0 auto; }

/* Visual Pipeline Canvas & Nodes */
.pipeline-panel { margin-bottom: 18px; overflow: hidden; }
.blueprint-panel { margin-bottom: 20px; }
.pipeline-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
  padding: 14px 20px; border-bottom: 1px solid var(--line-soft);
}
.pipeline-header-main { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-width: 0; }
.pipeline-header h2 { display: inline-flex; align-items: center; gap: 7px; font-size: 15px; font-weight: 700; }
.pipeline-header h2 .icon { color: var(--accent-text); }
.pipeline-counter { color: var(--muted); font-size: 12px; font-weight: 600; }
.pipeline-hint { color: var(--hint); font-size: 11px; }
.pipeline-progress {
  width: 112px; height: 6px; border: 0; border-radius: 999px; overflow: hidden;
  background: var(--control-fill); appearance: none;
}
.pipeline-progress::-webkit-progress-bar { background: var(--control-fill); border-radius: 999px; }
.pipeline-progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; transition: width .25s ease; }
.pipeline-progress.is-succeeded::-webkit-progress-value { background: var(--green); }
.pipeline-progress.is-failed::-webkit-progress-value,
.pipeline-progress.is-interrupted::-webkit-progress-value { background: var(--red); }
.pipeline-progress.is-queued::-webkit-progress-value { background: var(--orange); }
.pipeline-progress::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.pipeline-progress.is-succeeded::-moz-progress-bar { background: var(--green); }
.pipeline-progress.is-failed::-moz-progress-bar,
.pipeline-progress.is-interrupted::-moz-progress-bar { background: var(--red); }
.pipeline-progress.is-queued::-moz-progress-bar { background: var(--orange); }

.pipeline-scroll {
  overflow-x: auto; padding: 16px 18px 18px;
  background: radial-gradient(circle, var(--line-soft) 1px, transparent 1px) 0 0 / 18px 18px;
}
.pipeline-flow {
  display: flex; align-items: center; gap: 0; min-width: 100%;
}
.pipeline-stage { display: flex; flex-direction: column; gap: 8px; flex: 0 0 auto; }
.stage-jobs { flex: 1 1 auto; min-width: 0; }
.stage-label {
  font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--hint); padding-left: 4px;
}
.stage-card {
  display: flex; flex-direction: column; gap: 4px; min-width: 132px; max-width: 168px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); box-shadow: 0 2px 8px rgba(0, 0, 0, .04); text-align: left;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.stage-card-head { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--title); }
.stage-card-head strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-card-sub { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-card-meta { color: var(--hint); font-size: 11px; }
.source-card.is-running { border-color: rgba(0, 122, 255, .45); }
.source-card.is-succeeded { border-color: rgba(36, 138, 61, .35); }
.source-card.is-failed { border-color: rgba(201, 30, 72, .35); }
.outcome-card.is-succeeded { border-color: rgba(36, 138, 61, .45); background: var(--green-light); }
.outcome-card.is-failed { border-color: rgba(201, 30, 72, .45); background: var(--red-light); }
.outcome-card.is-running { border-color: rgba(0, 122, 255, .45); background: var(--accent-light); }
.outcome-card.is-queued { border-color: rgba(185, 106, 0, .35); background: var(--amber-light); }
.outcome-stack { display: flex; flex-direction: column; gap: 8px; }
.deploy-node { cursor: default; }
.deploy-node.is-ready {
  cursor: pointer; border-color: rgba(0, 122, 255, .45); background: var(--accent-light);
}
.deploy-node.is-ready:hover {
  border-color: var(--accent); transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 122, 255, .14);
}
.deploy-node.is-locked { opacity: .72; border-style: dashed; }
.deploy-node.has-run { padding: 0; overflow: hidden; min-width: 158px; max-width: 196px; }
.deploy-node.has-run.is-succeeded { border-color: rgba(36, 138, 61, .42); background: var(--green-light); }
.deploy-node.has-run.is-failed,
.deploy-node.has-run.is-interrupted { border-color: rgba(201, 30, 72, .45); background: var(--red-light); }
.deploy-node.has-run.is-running { border-color: rgba(0, 122, 255, .52); background: var(--accent-light); }
.deploy-node.has-run.is-queued { border-color: rgba(185, 106, 0, .42); background: var(--amber-light); }
.deploy-node.has-run.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light), 0 4px 14px rgba(0, 0, 0, .06);
}
.deploy-node-select {
  display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 10px 12px;
  border: 0; background: transparent; color: inherit; text-align: left;
}
.deploy-node-select:hover { background: var(--hover); }
.deploy-count {
  padding: 0 5px; border-radius: 999px; background: var(--hover); color: var(--muted);
  font-size: 10px; font-weight: 700; flex: 0 0 auto;
}
.deploy-node-footer {
  display: flex; align-items: center; justify-content: flex-end;
  padding: 5px 10px; border-top: 1px solid var(--line-soft); background: var(--surface);
}
.deploy-card-action {
  padding: 2px 6px; border: 0; border-radius: 6px; background: transparent;
  color: var(--accent-text); font-size: 11px; font-weight: 600;
}
.deploy-card-action:hover { background: var(--accent-light); }
.deploy-card-action.danger { color: var(--red); }
.deploy-card-action.danger:hover { background: var(--red-light); }

.pipeline-bridge {
  position: relative; width: 22px; height: 2px; flex: 0 0 22px; margin-top: 18px;
  background: var(--line);
}
.pipeline-bridge::after {
  content: ""; position: absolute; right: -1px; top: 50%; width: 5px; height: 5px;
  border-top: 2px solid var(--hint); border-right: 2px solid var(--hint);
  transform: translateY(-50%) rotate(45deg);
}
.pipeline-bridge.is-succeeded { background: var(--green); }
.pipeline-bridge.is-succeeded::after { border-color: var(--green); }
.pipeline-bridge.is-failed { background: var(--red); }
.pipeline-bridge.is-failed::after { border-color: var(--red); }
.pipeline-bridge.is-running {
  background: linear-gradient(90deg, var(--accent-light), var(--accent), var(--accent-light));
  background-size: 200% 100%; animation: flow-pulse 1.4s linear infinite;
}
.pipeline-bridge.is-running::after { border-color: var(--accent); }

.job-lanes { display: flex; flex-direction: column; gap: 10px; position: relative; }
.job-lanes.is-multi { padding-inline: 14px; }
.job-lane-row { position: relative; display: flex; align-items: center; min-width: 0; }
.job-lane-row.is-parallel::before,
.job-lane-row.is-parallel::after {
  content: ""; position: absolute; top: 50%; width: 14px; height: 2px; background: var(--line);
}
.job-lane-row.is-parallel::before { left: -14px; }
.job-lane-row.is-parallel::after { right: -14px; }
.job-lanes.is-multi::before,
.job-lanes.is-multi::after {
  content: ""; position: absolute; top: 38px; bottom: 38px; width: 2px; background: var(--line);
}
.job-lanes.is-multi::before { left: 0; }
.job-lanes.is-multi::after { right: 0; }

.job-lane {
  flex: 1 1 auto; min-width: 0; padding: 10px 12px 11px;
  border: 1.5px solid var(--line); border-radius: 13px; background: var(--surface);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .035);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.job-lane.is-running { border-color: rgba(0, 122, 255, .42); }
.job-lane.is-failed, .job-lane.is-interrupted { border-color: rgba(201, 30, 72, .38); }
.job-lane.is-succeeded { border-color: rgba(36, 138, 61, .32); }
.job-lane.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light), 0 4px 14px rgba(0, 0, 0, .06);
}
.job-lane-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px;
  width: 100%; padding: 0 0 9px; margin-bottom: 9px;
  border: 0; border-bottom: 1px solid var(--line-soft); background: transparent;
  color: var(--text); text-align: left;
}
.job-lane-head.static { cursor: default; }
.job-lane-title { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 7px; min-width: 0; }
.job-lane-title strong { font-size: 13px; font-weight: 700; color: var(--title); white-space: nowrap; }
.lane-chip {
  padding: 2px 7px; border-radius: 999px; background: var(--surface-muted); border: 1px solid var(--line-soft);
  color: var(--muted); font-size: 11px; font-weight: 500; white-space: nowrap;
}
.job-lane-stats { display: inline-flex; align-items: center; gap: 10px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.lane-duration { font-weight: 600; color: var(--text); }

.step-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 0; }
.step-item { display: inline-flex; align-items: center; max-width: 100%; }
.step-edge {
  position: relative; width: 16px; height: 2px; flex: 0 0 16px; background: var(--line);
}
.step-edge::after {
  content: ""; position: absolute; right: 0; top: 50%; width: 4.5px; height: 4.5px;
  border-top: 1.8px solid var(--hint); border-right: 1.8px solid var(--hint);
  transform: translateY(-50%) rotate(45deg);
}
.step-edge.is-succeeded, .step-edge.is-ready { background: var(--green); }
.step-edge.is-succeeded::after, .step-edge.is-ready::after { border-color: var(--green); }
.step-edge.is-failed { background: var(--red); }
.step-edge.is-failed::after { border-color: var(--red); }
.step-edge.is-running {
  background: linear-gradient(90deg, var(--accent-light), var(--accent), var(--accent-light));
  background-size: 200% 100%; animation: flow-pulse 1.2s linear infinite;
}
.step-edge.is-running::after { border-color: var(--accent); }
.step-edge.is-pending { background: transparent; border-top: 1.5px dashed var(--line); height: 0; }

.step-node {
  display: flex; flex-direction: column; gap: 3px; min-width: 112px; max-width: 172px;
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-muted); color: var(--text); text-align: left;
  transition: border-color .15s ease, background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.step-node:hover { border-color: var(--accent); background: var(--surface); transform: translateY(-1px); }
.step-node.is-running {
  border-color: rgba(0, 122, 255, .55); background: var(--accent-light);
  box-shadow: 0 0 0 2px rgba(0, 122, 255, .12);
}
.step-node.is-succeeded { border-color: rgba(36, 138, 61, .35); background: var(--green-light); }
.step-node.is-failed, .step-node.is-interrupted { border-color: rgba(201, 30, 72, .5); background: var(--red-light); }
.step-node.is-skipped, .step-node.is-canceled { opacity: .66; border-style: dashed; }
.step-node.is-focused {
  border-color: var(--accent); box-shadow: 0 0 0 2.5px var(--accent-light);
}
.step-node-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.step-node-title {
  font-size: 12px; font-weight: 600; color: var(--title);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.step-node-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 11px; color: var(--muted); }
.step-dir {
  padding: 1px 5px; border-radius: 5px; background: var(--hover); color: var(--muted);
  font-size: 10px; max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.step-time { margin-left: auto; font-size: 11px; color: var(--muted); white-space: nowrap; }
.step-state-text { color: var(--hint); }

.blueprint-step {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--surface-muted);
  font-size: 12px; font-weight: 500; color: var(--text); white-space: nowrap;
}
.blueprint-step-index {
  display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%;
  background: var(--control-fill); color: var(--muted); font-size: 10px; font-weight: 700;
}

.step-glyph, .lane-glyph { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; color: var(--hint); }
.step-node.is-succeeded .step-glyph, .step-glyph.is-succeeded, .lane-glyph.is-succeeded { color: var(--green); }
.step-node.is-failed .step-glyph, .step-node.is-interrupted .step-glyph,
.step-glyph.is-failed, .step-glyph.is-interrupted, .lane-glyph.is-failed, .lane-glyph.is-interrupted { color: var(--red); }
.step-node.is-running .step-glyph, .step-glyph.is-running, .lane-glyph.is-running { color: var(--accent-text); }
.step-node.is-queued .step-glyph, .step-glyph.is-queued, .lane-glyph.is-queued { color: var(--amber); }

.node-spinner {
  display: inline-block; width: 14px; height: 14px; flex: 0 0 auto; border-radius: 50%;
  border: 2px solid var(--accent-light); border-top-color: var(--accent); animation: spin .75s linear infinite;
}
@keyframes flow-pulse {
  from { background-position: 200% 0; }
  to { background-position: 0 0; }
}

/* Inline Mini-Pipeline in Runs Table */
.mini-pipeline { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 0; max-width: 230px; }
.mini-stage { display: inline-flex; align-items: center; }
.mini-edge { width: 6px; height: 1.5px; background: var(--line); flex: 0 0 6px; }
.mini-edge.is-deploy-bridge { width: 8px; flex-basis: 8px; background: var(--hint); opacity: .45; }
.mini-node {
  display: inline-flex; align-items: center; gap: 4px; max-width: 96px; min-height: 23px; padding: 2px 7px;
  border: 1px solid var(--line-soft); border-radius: 999px; background: var(--surface-muted);
  color: var(--text); font-size: 11px; font-weight: 600; white-space: nowrap;
  transition: border-color .15s ease, background .15s ease;
}
.mini-node:hover { border-color: var(--accent); background: var(--surface); }
.mini-node .icon { width: 12px; height: 12px; }
.mini-node .node-spinner { width: 11px; height: 11px; border-width: 1.8px; }
.mini-node-name { overflow: hidden; text-overflow: ellipsis; }
.mini-node-count { color: var(--muted); font-size: 10px; }
.mini-node.is-succeeded { background: var(--green-light); color: var(--green); border-color: transparent; }
.mini-node.is-failed, .mini-node.is-interrupted { background: var(--red-light); color: var(--red); border-color: transparent; }
.mini-node.is-running { background: var(--accent-light); color: var(--accent-text); border-color: rgba(0, 122, 255, .3); }
.mini-node.is-queued { background: var(--amber-light); color: var(--amber); border-color: transparent; }
.mini-node.is-more { color: var(--muted); padding-inline: 6px; }
.env-pill {
  display: inline-flex; align-items: center; padding: 1px 6px; border-radius: 999px;
  background: var(--accent-light); color: var(--accent-text); font-size: 10px; font-weight: 600;
}

/* Enhanced Log Panel & Step Accordions */
.log-panel { overflow: hidden; }
.log-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--line-soft);
}
.log-header-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.log-deploy-meta { color: var(--muted); font-size: 11px; font-weight: 500; white-space: nowrap; }
.button.compact-btn { min-height: 28px; padding: 0 10px; font-size: 11px; }
.log-header h2 { font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.log-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.log-header select { width: auto; min-height: 30px; padding: 3px 6px; font-size: 12px; }
.log-header .icon-button { width: 30px; min-height: 30px; }
.log-header .icon-button[aria-pressed="true"] {
  background: var(--accent-light); color: var(--accent-text); border-color: rgba(0, 122, 255, .3);
}
.segmented {
  display: inline-flex; padding: 2px; border-radius: 9px; background: var(--control-fill);
}
.segmented button {
  display: inline-flex; align-items: center; gap: 5px; min-height: 26px; padding: 0 9px;
  border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 600;
}
.segmented button .icon { width: 13px; height: 13px; }
.segmented button[aria-pressed="true"] {
  background: var(--surface); color: var(--title); box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}
.log-search-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 14px; border-bottom: 1px solid var(--line-soft); background: var(--table-head);
}
.log-search-field { position: relative; flex: 1; max-width: 300px; }
.log-search-field .icon { position: absolute; left: 9px; top: 8px; width: 14px; height: 14px; color: var(--muted); pointer-events: none; }
.log-search-field input {
  width: 100%; min-height: 30px; padding: 4px 10px 4px 29px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 12px;
}
.log-search-actions { display: flex; align-items: center; gap: 6px; }
.log-filter-banner {
  padding: 7px 14px; background: var(--accent-light); color: var(--accent-text);
  font-size: 12px; font-weight: 600; border-bottom: 1px solid var(--line-soft);
}
.step-logs-body { max-height: 64vh; overflow: auto; background: var(--surface-muted); }
.step-logs-list { display: grid; gap: 8px; padding: 12px; }
.step-logs-empty { padding: 32px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.step-log-card {
  border: 1px solid var(--line-soft); border-radius: 12px; background: var(--surface); overflow: hidden;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.step-log-card.is-running { border-color: rgba(0, 122, 255, .4); }
.step-log-card.is-failed, .step-log-card.is-interrupted { border-color: rgba(201, 30, 72, .45); }
.step-log-card.is-focused { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-light); }
.step-log-head { display: flex; align-items: center; gap: 4px; padding-right: 6px; }
.step-log-toggle {
  display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; min-height: 42px; padding: 8px 12px;
  border: 0; background: transparent; color: var(--text); text-align: left;
}
.step-log-toggle:hover { background: var(--hover); }
.step-log-chevron { display: inline-flex; color: var(--hint); transition: transform .16s ease; }
.step-log-card.is-open .step-log-chevron { transform: rotate(90deg); }
.step-log-index {
  display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; flex: 0 0 auto;
  background: var(--control-fill); color: var(--muted); font-size: 10px; font-weight: 700;
}
.step-log-name { font-size: 13px; font-weight: 600; color: var(--title); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step-log-right { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; flex: 0 0 auto; font-size: 11px; color: var(--muted); }
.step-line-count { padding: 2px 6px; border-radius: 999px; background: var(--surface-muted); color: var(--muted); font-size: 10px; }
.step-log-duration { min-width: 44px; text-align: right; font-weight: 600; color: var(--text); }
.step-copy-btn { flex: 0 0 auto; }
.step-log-pre {
  margin: 0; padding: 12px 14px; border-top: 1px solid #2f2f33;
  background: #17171a; color: #e5e5ea; white-space: pre-wrap; overflow-wrap: anywhere;
  font-family: "SFMono-Regular", ui-monospace, Menlo, monospace; font-size: 12px; line-height: 1.62;
  max-height: 46vh; overflow: auto;
}
.step-log-pre.is-empty { color: #8e8e93; font-style: italic; }
.log-output {
  min-height: 320px; max-height: 62vh; overflow: auto; margin: 0; padding: 14px 16px;
  background: #17171a; color: #e5e5ea; white-space: pre-wrap; overflow-wrap: anywhere;
  font-family: "SFMono-Regular", ui-monospace, Menlo, monospace; font-size: 12px; line-height: 1.6;
}
.log-output:focus-visible, .step-log-pre:focus-visible { outline-offset: -3px; }
.notice {
  padding: 9px 11px; border-radius: 10px; background: var(--accent-light); color: var(--accent-text);
  font-size: 12px; line-height: 1.45; overflow-wrap: anywhere;
}

.dialog {
  width: min(460px, calc(100% - 32px)); max-height: calc(100% - 32px); margin: auto; padding: 0; overflow: auto;
  border: 1px solid var(--line); border-radius: 24px; background: var(--surface); color: var(--text); box-shadow: var(--dialog-shadow);
}
.dialog[open] { animation: surface-in .2s var(--spring); }
.dialog::backdrop { background: var(--backdrop); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.dialog-body { padding: 24px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.dialog-heading h2 { font-size: 16px; line-height: 1.35; font-weight: 700; }
.dialog-heading p { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.dialog-heading .icon-button { margin: -4px -3px 0 0; }
.field { display: grid; gap: 6px; min-width: 0; margin-bottom: 13px; color: var(--muted); font-size: 12px; font-weight: 600; }
.field input, .field select { font-size: 13px; font-weight: 500; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.check-field { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; }
.check-field input { accent-color: var(--accent); }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.dialog-actions .button:not(.primary) { border-color: transparent; background: var(--hover); }
.form-error { margin-top: 11px; }
.toasts {
  position: fixed; z-index: 20; right: 24px; bottom: 24px; display: grid; justify-items: end; gap: 7px;
  width: min(400px, calc(100% - 48px)); pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 8px; max-width: 100%; padding: 12px 16px;
  border-radius: 16px; background: var(--ink); color: var(--ink-text); box-shadow: var(--dialog-shadow);
  font-size: 12px; font-weight: 600; overflow-wrap: anywhere; animation: surface-in .2s var(--spring);
}
.toast > .icon { width: 16px; height: 16px; color: var(--activity-green); }
.toast.error > .icon { color: var(--activity-red); }

.auth-screen { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: 24px; }
.auth-card {
  width: min(100%, 384px); padding: 31px 32px;
  border: 1px solid var(--line-soft); border-radius: 26px; background: var(--surface); box-shadow: var(--shadow);
  animation: surface-in .2s var(--spring);
}
.auth-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 24px; }
.auth-brand { display: flex; flex: 1; align-items: center; gap: 14px; min-width: min(100%, 175px); }
.auth-brand img { flex: 0 0 auto; border-radius: 16px; box-shadow: var(--brand-shadow); }
.auth-brand h1 { font-size: 20px; line-height: 1.2; font-weight: 700; letter-spacing: -.025em; }
.auth-description { margin-top: 2px; color: var(--hint); font-size: 12px; line-height: 1.4; }
.auth-card .language-select { min-height: 29px; background: var(--surface-muted); }
.auth-card .field { margin-bottom: 16px; }
.auth-card .field input { min-height: 42px; padding: 9px 14px; border-radius: 12px; font-size: 14px; }
.auth-card .field input:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.auth-submit.button.primary { width: 100%; min-height: 44px; border-radius: 999px; background: var(--ink); color: var(--ink-text); font-size: 14px; }
.auth-submit.button.primary:hover { background: var(--ink-hover); }
.auth-error, .auth-message { margin: 0 0 13px; }
.auth-card .text-button { margin-top: 8px; }
@keyframes surface-in {
  from { opacity: 0; transform: translateY(2px) scale(.996); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (width < 1024px) {
  .workspace-shell { grid-template-columns: minmax(0, 1fr); }
  .topbar { padding-inline: 16px; gap: 10px; }
  #main { padding: 20px 20px 36px; }
  .mobile-menu { display: inline-flex !important; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(260px, 82vw);
    transform: translateX(-100%); visibility: hidden; box-shadow: var(--dialog-shadow);
    transition: transform .24s var(--spring);
  }
  .sidebar.open { transform: none; visibility: visible; }
  .sidebar-backdrop:not([hidden]) {
    display: block !important; position: fixed; z-index: 9; inset: 0;
    background: var(--backdrop); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .dashboard-side { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto; }
  .run-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (width < 640px) {
  .topbar { padding-inline: 12px; }
  .topbar-leading, .topbar-actions { gap: 6px; }
  .breadcrumb-root, .breadcrumb-parent { display: none; }
  .workspace-search { width: 31px; padding: 0; justify-content: center; }
  .workspace-search span, .workspace-search kbd { display: none; }
  .sync-status { width: 22px; height: 22px; justify-content: center; padding: 0; }
  .sync-status > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .language-select { max-width: 88px; padding-inline: 5px; }
  .metrics { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .dashboard-side { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .panel-header, .activity .panel-header { padding-inline: 14px; }
  .chart text { font-size: 16px; }
  .activity { min-height: 228px; }
  .chart-wrap { padding-inline: 9px; }
  .legend { padding-inline: 14px; }
  .run-col { min-width: 0; }
  .run-text { max-width: min(36ch, 43vw); }
  .runs-table:not(.users-table) th:nth-child(2), .runs-table:not(.users-table) td:nth-child(2),
  .runs-table:not(.users-table) th:nth-child(n+4), .runs-table:not(.users-table) td:nth-child(n+4) { display: none; }
  .runs-table:not(.users-table) th:nth-child(3), .runs-table:not(.users-table) td:nth-child(3) { text-align: right; padding-right: 13px; }
  .run-meta-desktop { display: none; }
  .run-meta-mobile { display: inline; max-width: 27vw; overflow: hidden; text-overflow: ellipsis; }
  .users-table .user-actions .button { display: flex; margin: 3px 0; }
  .pipeline-header { padding: 12px 14px; }
  .pipeline-scroll { padding: 14px; }
  .pipeline-hint, .step-line-count { display: none; }
  .log-header { flex-wrap: wrap; }
  .log-search-bar { flex-wrap: wrap; }
  .log-search-field { max-width: none; }
  .log-output { min-height: 230px; }
}

@media (width < 411px) {
  #main { padding-inline: 16px; }
  .search-field { min-width: 100%; }
  .filters select { min-width: 0; flex: 1 1 auto; }
  .auth-card { padding: 26px 24px; }
}

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