:root {
    color-scheme: light;
    --bg: #f5f7f8;
    --panel: #ffffff;
    --panel-soft: #eef3f1;
    --panel-strong: #f7faf9;
    --ink: #18211f;
    --text: #18211f;
    --muted: #64706d;
    --line: #dce4e1;
    --line-strong: #b8c5c1;
    --accent: #175cde;
    --accent-hover: #104bb7;
    --accent-contrast: #ffffff;
    --accent-soft: #edf4ff;
    --accent-2: #1e5f8a;
    --warn: #b86b16;
    --danger: #b33a3a;
    --warn-frame-peak: #9a6415;
    --danger-frame-peak: #b92230;
    --ok: #2f7d43;
    --shadow: 0 10px 28px rgba(24, 33, 31, .08);
    --input-bg: #ffffff;
    --topbar-bg: #ffffff;
    --sticky-bg: rgba(245, 247, 248, .96);
    --column-bg: #fbfcfc;
    --card-bg: #ffffff;
    --table-bg: #ffffff;
    --table-head-bg: #f7faf9;
    --chip-bg: #ffffff;
    --chip-warm-bg: #fff7e8;
    --chip-warm-text: #7b531d;
    --storage-bg: #edf4ff;
    --storage-text: #104bb7;
    --approval-bg: #fff7e8;
    --approval-text: #7b531d;
    --approval-approved-bg: #e8f4ec;
    --approval-approved-border: #c8dfcf;
    --approval-declined-bg: #fff4f4;
    --approval-declined-border: #edc7c7;
    --tooltip-bg: #fff8ed;
    --tooltip-border: #ead5b3;
    --tooltip-text: #6b4b19;
    --notice-danger-bg: #fff4f4;
    --notice-danger-border: #edc7c7;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #171717;
    --panel: #1f1f1f;
    --panel-soft: #292929;
    --panel-strong: #333333;
    --ink: #f3f3f3;
    --text: #f3f3f3;
    --muted: #a6a6a6;
    --line: #343434;
    --line-strong: #4a4a4a;
    --accent: #8ab4f8;
    --accent-hover: #86b7df;
    --accent-contrast: #151515;
    --accent-soft: #303030;
    --accent-2: #8ab4f8;
    --warn: #d6a45f;
    --danger: #f07178;
    --warn-frame-peak: #ffe0a0;
    --danger-frame-peak: #ff9ba3;
    --ok: #8bc795;
    --shadow: 0 18px 42px rgba(0, 0, 0, .36);
    --input-bg: #181818;
    --topbar-bg: rgba(25, 25, 25, .96);
    --sticky-bg: rgba(23, 23, 23, .94);
    --column-bg: #1b1b1b;
    --card-bg: #242424;
    --table-bg: #1f1f1f;
    --table-head-bg: #292929;
    --chip-bg: #2a2a2a;
    --chip-warm-bg: #30271d;
    --chip-warm-text: #d7a867;
    --storage-bg: #273139;
    --storage-text: #9db7c7;
    --approval-bg: #30271d;
    --approval-text: #d7a867;
    --approval-approved-bg: #203128;
    --approval-approved-border: #4b7557;
    --approval-declined-bg: #342225;
    --approval-declined-border: #87464d;
    --tooltip-bg: #2a2a2a;
    --tooltip-border: #4a4a4a;
    --tooltip-text: #eeeeee;
    --notice-danger-bg: #342225;
    --notice-danger-border: #87464d;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    overflow-x: hidden;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.45;
}

:root[data-theme="dark"] body {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .026), rgba(23, 23, 23, 0) 260px),
        #171717;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

button {
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: var(--accent-contrast);
    min-height: 40px;
    padding: 0 16px;
    cursor: pointer;
}

button:hover:where(:not(:disabled, [aria-disabled="true"], [aria-busy="true"])) {
    background: var(--accent-hover);
}

input,
select {
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--ink);
    padding: 7px 9px;
}

label {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 13px;
}

label input,
label select {
    color: var(--ink);
    font-size: 14px;
}

.topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 42px;
    padding: 5px 28px;
    min-width: 0;
    border-bottom: 1px solid var(--line);
    background: var(--topbar-bg);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(14px);
}

.topbar h1 {
    margin: 0;
    font-size: 22px;
    line-height: 1.05;
    letter-spacing: 0;
}

.brand-home {
    color: inherit;
    text-decoration: none;
}

.brand-home:hover,
.brand-home:focus-visible {
    color: var(--accent);
    outline: none;
}

.topbar p {
    margin: 0;
    color: var(--muted);
    max-width: 760px;
    overflow-wrap: anywhere;
    font-size: 13px;
}

.team-name-pill {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 10px;
    background: var(--panel-soft);
    color: var(--ink);
    font-weight: 600;
}

.webhook-health-state {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.webhook-health-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: #d29a43;
    box-shadow: 0 0 0 3px color-mix(in srgb, #d29a43 16%, transparent);
}

.top-health-button.is-active .webhook-health-dot,
.webhook-health-state.is-active .webhook-health-dot {
    background: #5f9e81;
    box-shadow: 0 0 0 3px color-mix(in srgb, #5f9e81 16%, transparent);
}

.webhook-health-dialog {
    width: min(820px, calc(100vw - 28px));
    max-height: calc(100dvh - 28px);
    padding: 0;
    overflow: auto;
}

.webhook-health-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--line);
}

.webhook-health-head h2 {
    margin: 3px 0 0;
    font-size: 20px;
}

.webhook-health-kicker {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.webhook-health-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 18px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
}

.webhook-health-state {
    color: var(--ink);
    font-weight: 700;
}

.webhook-health-queues {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 16px 20px;
}

.webhook-health-queue {
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--panel-soft);
}

.webhook-health-queue span,
.webhook-health-queue small {
    display: block;
    color: var(--muted);
    font-size: 10px;
}

.webhook-health-queue strong {
    display: block;
    margin: 3px 0;
    font-size: 20px;
}

.webhook-health-note {
    margin: 0;
    padding: 0 20px 18px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.webhook-health-checks {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 16px 20px;
}

.webhook-health-check {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--panel-soft);
    font-size: 12px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.webhook-health-check h3 {
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 12px;
}

.webhook-health-check p {
    margin: 6px 0 0;
    color: var(--muted);
}

.webhook-health-check[data-status="attention"],
.webhook-health-queue[data-status="attention"] {
    border-color: #d29a43;
}

.webhook-health-check .webhook-health-action,
.webhook-health-action {
    color: var(--ink);
    font-size: 12px;
    line-height: 1.5;
    margin: 8px 0 0;
}

.webhook-health-section-title {
    margin: 0;
    padding: 0 20px;
    color: var(--ink);
    font-size: 14px;
}

.webhook-health-message {
    margin: 14px 20px 0;
    padding: 12px;
    border: 1px solid #d29a43;
    border-radius: 7px;
    color: var(--ink);
    font-size: 13px;
    line-height: 1.5;
}

.webhook-health-summary button {
    margin-left: auto;
    min-height: 36px;
}

.webhook-health-summary button[aria-disabled="true"] {
    opacity: .65;
    cursor: wait;
}

.webhook-health-head {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--panel);
}

.webhook-health-announcement {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}

@media (max-width: 560px) {
    .webhook-health-checks { grid-template-columns: 1fr; }
    .webhook-health-head h2 { font-size: 18px; }
}

.active-summary-dialog {
    width: min(780px, calc(100vw - 28px));
    max-height: min(700px, calc(100vh - 28px));
    padding: 0;
    overflow: hidden;
}

.active-summary-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 17px 18px 13px;
    border-bottom: 1px solid var(--line);
}

.active-summary-head > div {
    min-width: 0;
}

.active-summary-head h2 {
    margin: 2px 0 0;
    font-size: 20px;
    line-height: 1.2;
}

.active-summary-head p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.active-summary-totals {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--line);
}

.active-summary-totals > div {
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--panel-soft);
}

.active-summary-totals span,
.active-summary-totals strong {
    display: block;
}

.active-summary-totals span {
    overflow: hidden;
    color: var(--muted);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.active-summary-totals strong {
    margin-top: 2px;
    font-size: 20px;
    line-height: 1.15;
}

.active-summary-totals .is-overdue {
    background: var(--approval-declined-bg);
    border-color: var(--approval-declined-border);
}

.active-summary-totals .is-today {
    background: var(--chip-warm-bg);
    border-color: color-mix(in srgb, var(--warn) 34%, var(--line));
}

.active-summary-trend {
    padding: 12px 18px 10px;
    border-bottom: 1px solid var(--line);
}

.active-summary-body {
    display: grid;
    grid-template-columns: minmax(250px, .85fr) minmax(340px, 1.15fr);
    gap: 14px;
    min-height: 0;
    max-height: min(460px, calc(100vh - 210px));
    padding: 14px 18px 18px;
}

.active-summary-section {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 8px;
    min-width: 0;
    min-height: 0;
}

.active-summary-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.active-summary-section-head h3 {
    margin: 0;
    font-size: 13px;
}

.active-summary-stage-list,
.active-summary-tech-list {
    display: grid;
    align-content: start;
    gap: 5px;
    min-height: 0;
}

.active-summary-tech-list {
    overflow-y: auto;
    padding-right: 2px;
    scrollbar-width: none;
}

.active-summary-tech-list::-webkit-scrollbar {
    display: none;
}

.active-summary-row {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 6px 8px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--input-bg);
    color: var(--ink);
}

.active-summary-tech-row::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0 auto 0 0;
    width: var(--queue-share, 0%);
    background: var(--accent-soft);
    opacity: .65;
}

.active-summary-row-title {
    min-width: 0;
    overflow: hidden;
    font-size: 12px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.active-summary-stage-row .active-summary-row-title {
    display: flex;
    align-items: center;
    gap: 7px;
}

.active-summary-stage-row .active-summary-row-title i {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: var(--stage-dot, var(--muted));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--stage-dot, var(--muted)) 14%, transparent);
}

.active-summary-stage-row--intake {
    --stage-dot: #c9a66a;
}

.active-summary-stage-row--approval {
    --stage-dot: #c98778;
}

.active-summary-stage-row--parts {
    --stage-dot: #9aa6b8;
}

.active-summary-stage-row--work {
    --stage-dot: #8ab4f8;
}

.active-summary-row-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    min-width: 0;
}

.active-summary-row-meta em {
    min-height: 20px;
    padding: 3px 6px;
    border-radius: 999px;
    background: var(--panel-soft);
    color: var(--muted);
    font-size: 9px;
    font-style: normal;
    line-height: 1.4;
    white-space: nowrap;
}

.active-summary-row-meta em.is-overdue {
    background: var(--approval-declined-bg);
    color: var(--danger);
}

.active-summary-row-meta em.is-today {
    background: var(--chip-warm-bg);
    color: var(--chip-warm-text);
}

.active-summary-row-meta b {
    display: grid;
    place-items: center;
    min-width: 25px;
    min-height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--panel-soft);
    color: var(--ink);
    font-size: 12px;
}

.active-summary-empty {
    display: grid;
    min-height: 120px;
    place-items: center;
    padding: 16px;
    border: 1px dashed var(--line);
    border-radius: 7px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.metric-detail-dialog {
    width: min(820px, calc(100vw - 28px));
    max-height: min(760px, calc(100vh - 28px));
    padding: 0;
    overflow: hidden;
}

.metric-detail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 17px 18px 13px;
    border-bottom: 1px solid var(--line);
}

.metric-detail-head > div {
    min-width: 0;
}

.metric-detail-head h2 {
    margin: 2px 0 0;
    font-size: 20px;
    line-height: 1.2;
}

.metric-detail-head p,
.metric-detail-section-head p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.metric-detail-totals {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 0 18px;
    border-bottom: 1px solid var(--line);
}

.metric-detail-totals--output {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

#output-metric-dialog[open] {
    display: flex;
    flex-direction: column;
}

#output-metric-dialog > .metric-detail-head,
#output-metric-dialog > .metric-detail-totals {
    flex-shrink: 0;
}

#output-metric-dialog > .metric-detail-body {
    min-height: 0;
}

.metric-detail-totals > div {
    min-width: 0;
    padding: 12px 10px 11px;
    border-right: 1px solid var(--line);
}

.metric-detail-totals > div:first-child {
    padding-left: 0;
}

.metric-detail-totals > div:last-child {
    padding-right: 0;
    border-right: 0;
}

.metric-detail-totals span,
.metric-detail-totals strong {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.metric-detail-totals span {
    color: var(--muted);
    font-size: 10px;
}

.metric-detail-totals strong {
    margin-top: 3px;
    font-size: 18px;
    line-height: 1.15;
}

.metric-detail-body {
    display: grid;
    gap: 15px;
    max-height: min(560px, calc(100vh - 175px));
    padding: 14px 18px 18px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.metric-detail-chart,
.metric-detail-section {
    min-width: 0;
}

.metric-detail-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.metric-detail-section-head h3,
.metric-detail-section > h3 {
    margin: 0;
    font-size: 13px;
}

.metric-detail-section-head > strong {
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
    white-space: nowrap;
}

.metric-detail-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.metric-detail-section {
    display: grid;
    align-content: start;
    gap: 8px;
}

.metric-detail-list {
    display: grid;
    gap: 1px;
    overflow: hidden;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.metric-detail-list--scroll {
    max-height: 220px;
    overflow-y: auto;
    scrollbar-width: none;
}

.metric-detail-list--scroll::-webkit-scrollbar {
    display: none;
}

.metric-detail-list > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 34px;
    padding: 6px 2px;
    border-bottom: 1px solid var(--line);
}

.metric-detail-list > div:last-child {
    border-bottom: 0;
}

.metric-detail-list span {
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.metric-detail-list span small {
    display: block;
    overflow: hidden;
    margin-top: 1px;
    color: var(--muted);
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.metric-detail-list strong {
    color: var(--ink);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.metric-detail-list a {
    color: var(--accent-2);
    text-decoration: none;
}

.metric-detail-list a:hover,
.metric-detail-list a:focus-visible {
    text-decoration: underline;
}

.metric-detail-list--table > div {
    grid-template-columns: 60px minmax(0, 1fr) auto;
}

.metric-detail-list--table > div > small {
    color: var(--muted);
    font-size: 10px;
}

.metric-bar-chart-scroll {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
}

.metric-bar-chart {
    display: grid;
    grid-template-columns: repeat(var(--chart-columns), minmax(24px, 1fr));
    align-items: end;
    gap: 3px;
    min-width: calc(var(--chart-columns) * 27px);
    height: 128px;
    padding: 14px 4px 0;
    border-bottom: 1px solid var(--line-strong);
    background-image: linear-gradient(to bottom, transparent 49%, var(--line) 50%, transparent 51%);
}

.metric-bar-column {
    display: grid;
    grid-template-rows: 14px 78px 20px;
    align-items: end;
    min-width: 0;
    height: 112px;
    text-align: center;
}

.metric-bar-column > span {
    overflow: hidden;
    color: var(--muted);
    font-size: 8px;
    text-overflow: clip;
    white-space: nowrap;
}

.metric-bar-column > i {
    width: min(12px, 70%);
    height: var(--bar-height, 4%);
    min-height: 3px;
    justify-self: center;
    border-radius: 3px 3px 1px 1px;
    background: var(--accent-2);
    opacity: .72;
}

.metric-bar-column > i.is-zero {
    min-height: 0;
    opacity: 0;
}

.metric-bar-column > small {
    align-self: center;
    color: var(--muted);
    font-size: 8px;
    white-space: nowrap;
}

.metric-line-chart-scroll {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
}

.metric-line-chart {
    min-width: max(100%, calc((var(--chart-points, 1) - 1) * 52px + 48px));
    padding: 1px 2px 2px;
}

.metric-line-chart-plot {
    overflow: hidden;
    border-top: 1px solid var(--line);
    background: linear-gradient(to bottom, transparent 49%, color-mix(in srgb, var(--line) 58%, transparent) 50%, transparent 51%);
}

.metric-line-chart svg {
    display: block;
    width: 100%;
    height: 104px;
    overflow: visible;
}

.metric-line-chart .metric-chart-guide {
    stroke: color-mix(in srgb, var(--line) 72%, transparent);
    stroke-width: .7;
    vector-effect: non-scaling-stroke;
}

.metric-line-chart .metric-chart-guide--middle {
    stroke: var(--line);
    stroke-dasharray: 3 4;
}

.metric-line-chart .metric-chart-baseline {
    stroke: var(--line-strong);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

.metric-line-chart polyline {
    fill: none;
    stroke: var(--accent-2);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.metric-line-chart circle {
    fill: var(--panel);
    stroke: var(--accent-2);
    stroke-width: 1.5;
    vector-effect: non-scaling-stroke;
}

.metric-chart-axis {
    position: relative;
    height: 27px;
    border-top: 1px solid var(--line-strong);
    color: var(--ink);
    font-size: 10px;
    font-variant-numeric: tabular-nums;
    font-weight: 650;
}

.metric-chart-axis span {
    position: absolute;
    top: 7px;
    left: var(--axis-position, 0%);
    line-height: 1;
    opacity: .78;
    transform: translateX(-50%);
    white-space: nowrap;
}

.metric-chart-axis span::before {
    position: absolute;
    top: -8px;
    left: 50%;
    width: 1px;
    height: 5px;
    background: var(--line-strong);
    content: '';
}

.metric-chart-axis span.is-first {
    transform: none;
}

.metric-chart-axis span.is-first::before {
    left: 0;
}

.metric-chart-axis span.is-last {
    transform: translateX(-100%);
}

.metric-chart-axis span.is-last::before {
    right: 0;
    left: auto;
}

.metric-detail-empty {
    display: grid;
    min-height: 96px;
    place-items: center;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.topbar > div,
.brand-line {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    min-width: 0;
    flex: 0 1 auto;
}

.eyebrow {
    color: var(--accent);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.team-switcher {
    flex: 0 1 230px;
    width: 230px;
    min-width: 190px;
}

.team-switcher select {
    min-height: 30px;
    padding: 4px 9px;
    font-size: 13px;
    font-weight: 600;
}

.create-team-button {
    min-height: 30px;
    padding: 4px 9px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--panel-soft);
    color: var(--ink);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.create-team-button:hover,
.create-team-button:focus-visible {
    border-color: var(--line-strong);
    background: var(--panel-strong);
    outline: none;
}

.top-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.top-actions a,
.top-action-button {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 8px;
    background: var(--panel-soft);
    font-size: 13px;
}

.preview-switch {
    color: var(--ink);
    font-weight: 600;
}

.top-action-button {
    min-height: 30px;
    color: var(--ink);
    font-weight: 600;
    line-height: 1;
}

.top-action-button:hover,
.top-action-button:focus-visible {
    border-color: var(--line-strong);
    background: var(--panel-strong);
    color: var(--ink);
    outline: none;
}

.top-health-button {
    display: grid;
    width: 30px;
    min-width: 30px;
    height: 30px;
    min-height: 30px;
    place-items: center;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--panel-soft);
    color: var(--muted);
}

.top-health-button:hover,
.top-health-button:focus-visible {
    border-color: var(--line-strong);
    background: var(--panel-strong);
    outline: none;
}

.top-health-button .webhook-health-dot {
    width: 9px;
    height: 9px;
    flex-basis: 9px;
}

.theme-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 30px;
    padding: 4px 8px 4px 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel-soft);
    color: var(--muted);
    font-size: 13px;
    line-height: 1;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .36);
}

.theme-toggle:hover {
    border-color: var(--line-strong);
    background: var(--panel-strong);
    color: var(--ink);
}

.theme-toggle-track {
    position: relative;
    width: 30px;
    height: 18px;
    flex: 0 0 auto;
    border-radius: 999px;
    background:
        linear-gradient(135deg, rgba(37, 109, 90, .28), rgba(30, 95, 138, .20)),
        var(--input-bg);
    border: 1px solid var(--line);
    overflow: hidden;
}

.theme-toggle-track::before {
    content: "";
    position: absolute;
    inset: 3px 5px auto auto;
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: var(--accent-2);
    opacity: .55;
}

.theme-toggle-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 2px 6px rgba(24, 33, 31, .18);
    transition: transform .18s ease, background-color .18s ease, box-shadow .18s ease;
}

:root[data-theme="dark"] .theme-toggle {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .05),
        0 0 14px rgba(255, 255, 255, .04);
}

:root[data-theme="dark"] .theme-toggle-track {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .18), rgba(138, 180, 248, .12)),
        #202020;
}

:root[data-theme="dark"] .theme-toggle-knob {
    transform: translateX(12px);
    background: #f3f3f3;
    box-shadow:
        0 0 8px rgba(255, 255, 255, .22),
        0 2px 9px rgba(0, 0, 0, .42);
}

.workspace {
    display: grid;
    gap: 12px;
    padding: 10px 28px 48px;
    min-width: 0;
}

.dashboard-notice {
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--panel);
    font-size: 13px;
    font-weight: 600;
}

.dashboard-notice.is-success {
    border-color: var(--approval-approved-border);
    background: var(--approval-approved-bg);
    color: var(--ok);
}

.dashboard-notice.is-error {
    border-color: var(--notice-danger-border);
    background: var(--notice-danger-bg);
    color: var(--danger);
}

.team-wizard-dialog {
    width: min(700px, calc(100vw - 30px));
    max-height: min(780px, calc(100vh - 30px));
    padding: 0;
}

.team-wizard-form {
    display: grid;
    gap: 14px;
    padding: 16px;
}

.team-wizard-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
}

.team-wizard-head h2 {
    margin: 2px 0 0;
    font-size: 20px;
}

.team-wizard-kicker {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.team-wizard-progress {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.team-wizard-progress span {
    display: grid;
    place-items: center;
    min-height: 5px;
    border-radius: 3px;
    background: var(--panel-soft);
    color: transparent;
    font-size: 0;
}

.team-wizard-progress span.is-active {
    background: var(--accent-2);
}

.team-wizard-step {
    display: grid;
    gap: 12px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.team-wizard-step legend {
    margin-bottom: 8px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
}

.team-wizard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.team-wizard-actions {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding-top: 2px;
}

.team-wizard-actions span {
    color: var(--muted);
    font-size: 12px;
}

.team-wizard-actions span.is-error {
    color: var(--danger);
}

.team-leader-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    max-height: 260px;
    overflow: auto;
}

.team-leader-option {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--input-bg);
    color: var(--ink);
}

.team-leader-option input {
    flex: 0 0 16px;
    width: 16px;
    min-height: 16px;
    margin: 0;
}

.toolbar,
.section-block,
.login-box {
    min-width: 0;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.toolbar {
    padding: 9px 10px;
}

.filter-grid {
    display: grid;
    grid-template-columns: minmax(130px, .9fr) minmax(150px, 1fr) minmax(150px, 1fr) minmax(190px, 1.5fr) auto;
    gap: 8px;
    align-items: end;
    min-width: 0;
}

.top-filter-grid {
    flex: 1 1 780px;
    max-width: 820px;
    grid-template-columns: minmax(180px, .95fr) minmax(230px, 1.1fr) minmax(180px, 1fr) auto;
    gap: 6px;
    align-items: center;
}

.top-filter-grid label {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1;
    white-space: nowrap;
}

.top-filter-grid input,
.top-filter-grid select {
    flex: 1 1 auto;
    min-height: 28px;
    padding: 3px 7px;
    min-width: 0;
    font-size: 12px;
}

.top-search-field {
    min-width: 0;
}

.top-search-control {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    flex: 1 1 auto;
}

.top-search-control input {
    min-width: 0;
}

.search-reset-button {
    display: inline-grid;
    place-items: center;
    flex: 0 0 28px;
    width: 28px;
    min-height: 28px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
    color: var(--muted);
    font-size: 18px;
    line-height: 1;
}

.search-reset-button:hover,
.search-reset-button:focus-visible {
    border-color: var(--line-strong);
    background: var(--panel-strong);
    color: var(--ink);
    outline: none;
}

.top-filter-grid button {
    min-height: 28px;
    padding: 0 8px;
    font-size: 12px;
}

.top-filter-period .ui-select-shell--compact button.ui-select-trigger {
    grid-template-columns: minmax(0, 1fr) 20px;
    padding: 0;
}

.top-filter-period .ui-select-trigger__value {
    padding-right: 4px;
    padding-left: 6px;
}

.sticky-workbar {
    position: sticky;
    top: var(--topbar-height, 42px);
    z-index: 9;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: end;
    gap: 7px;
    padding: 8px 0 9px;
    background: var(--sticky-bg);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(8px);
}

.sticky-workbar .toolbar,
.sticky-workbar .metric {
    box-shadow: none;
}

.sticky-workbar .metrics {
    grid-column: 1;
}

.sticky-workbar .section-tabs {
    grid-column: 2;
    align-self: center;
    justify-content: flex-end;
}

.sticky-workbar input,
.sticky-workbar select {
    min-height: 32px;
    padding: 5px 8px;
}

.sticky-workbar button {
    min-height: 34px;
    padding: 0 13px;
}

.sticky-workbar label {
    gap: 3px;
    font-size: 12px;
}

.metrics {
    display: grid;
    grid-template-columns: repeat(7, minmax(92px, 1fr));
    gap: 7px;
    min-width: 0;
}

.metric {
    position: relative;
    min-height: 58px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    grid-template-rows: 11px 20px 12px;
    align-content: center;
    column-gap: 7px;
    row-gap: 1px;
    padding: 8px 10px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.metric > span:first-child {
    grid-column: 1;
    grid-row: 1;
    color: var(--muted);
    font-size: 11px;
    line-height: 1;
}

.metric strong {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
    overflow: hidden;
    font-size: 18px;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.metric > small {
    grid-column: 1 / -1;
    grid-row: 3;
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 9px;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.metric-analytics > small {
    padding-right: 45px;
}

.metric-spark {
    position: absolute;
    right: 9px;
    bottom: 7px;
    display: flex;
    align-items: end;
    justify-content: flex-end;
    gap: 1px;
    width: 42px;
    height: 25px;
    padding-bottom: 1px;
    border-bottom: 1px solid var(--line-strong);
}

.metric-spark i {
    position: static;
    flex: 1 1 0;
    width: auto;
    min-width: 1px;
    max-width: 3px;
    height: var(--metric-height, 12%);
    min-height: 2px;
    border-radius: 2px 2px 0 0;
    background: var(--accent-2);
    opacity: .66;
}

.metric-spark i.is-negative {
    background: var(--danger);
    opacity: .78;
}

.metric-spark i.is-zero {
    min-height: 0;
    opacity: 0;
}

.sticky-workbar .metric-action {
    width: 100%;
    min-height: 58px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--ink);
    text-align: left;
}

.metric-action:hover,
.metric-action:focus-visible {
    border-color: var(--line-strong);
    background: var(--panel-strong);
    outline: none;
}

.metric-action:focus-visible {
    box-shadow: inset 0 0 0 1px var(--accent-2);
}

.metric-action > i {
    position: absolute;
    top: 6px;
    right: 8px;
    color: var(--muted);
    font-size: 13px;
    font-style: normal;
    letter-spacing: 0;
    line-height: 1;
}

.section-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.section-tabs a {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--chip-bg);
    padding: 6px 10px;
    color: var(--muted);
    font-size: 13px;
}

.section-tabs a:hover {
    color: var(--ink);
    border-color: var(--line-strong);
}

.section-block {
    padding: 18px;
    scroll-margin-top: var(--section-scroll-offset, 155px);
}

[data-schedule-error] {
    scroll-margin-top: var(--section-scroll-offset, 155px);
}

.section-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.section-head h2 {
    margin: 0;
    font-size: 21px;
    letter-spacing: 0;
}

.section-head p {
    margin: 4px 0 0;
    color: var(--muted);
}

.section-head > span,
.kanban-count {
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 7px 11px;
    background: var(--panel-soft);
}

.kanban-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
    min-width: 0;
}

.kanban-filter-stack {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 16px 32px;
    flex: 1;
    min-width: 0;
}

.kanban-filter-group {
    flex: 1 1 320px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    min-width: 0;
}

.kanban-filter-group[data-kanban-inline-filter="service"] {
    flex-basis: 400px;
    text-align: right;
}

.kanban-filter-group[data-kanban-inline-filter="service"] .master-filter {
    justify-content: flex-end;
}

.kanban-filter-label {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.4;
}

.master-filter {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    min-width: 0;
}

.kanban-actions {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: auto;
}

.type-menu {
    position: relative;
}

.type-menu summary {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 7px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--chip-bg);
    color: var(--text);
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    list-style: none;
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.type-menu summary::-webkit-details-marker {
    display: none;
}

.type-menu summary::after {
    content: "▾";
    margin-left: 7px;
    color: var(--muted);
    font-size: 11px;
}

.type-menu[open] summary {
    border-color: var(--accent);
}

.type-menu-list {
    position: absolute;
    z-index: 35;
    top: calc(100% + 6px);
    right: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    width: min(330px, 78vw);
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.type-menu-list--wide {
    width: min(460px, 82vw);
    max-height: min(420px, 64vh);
    overflow-y: auto;
    align-content: flex-start;
}

.master-chip,
.type-chip {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--chip-bg);
    color: var(--muted);
    font-size: 12px;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}

.master-chip.active,
.type-chip.active {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--accent-contrast);
}

:root[data-theme="dark"] .master-chip.active,
:root[data-theme="dark"] .type-chip.active {
    border-color: #4a4a4a;
    background: #333333;
    color: #f3f3f3;
}

.master-chip:hover,
.type-chip:hover {
    border-color: var(--accent);
}

.kanban-board {
    display: grid;
    grid-template-columns: repeat(var(--kanban-columns, 6), minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: visible;
}

.kanban-column {
    display: grid;
    grid-template-rows: auto auto 1fr;
    min-width: 0;
    min-height: 560px;
    max-height: calc(100vh - 260px);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--column-bg);
    overflow: hidden;
}

.kanban-column.constraint {
    --state-border-rest: color-mix(in srgb, var(--warn) 58%, var(--line));
    --state-border-peak: var(--warn-frame-peak);
    border-color: var(--state-border-rest);
    animation: state-border-breathe 6s ease-in-out infinite;
}

.kanban-column header {
    display: flex;
    justify-content: space-between;
    gap: 7px;
    padding: 10px;
    border-bottom: 1px solid var(--line);
}

.kanban-column h3 {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    font-size: 14px;
    letter-spacing: 0;
}

.kanban-column h3::before {
    content: "";
    display: none;
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: var(--column-dot, var(--accent));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--column-dot, var(--accent)) 18%, transparent);
}

:root[data-theme="dark"] .kanban-column h3::before {
    display: inline-block;
}

.kanban-column--available {
    --column-dot: #7dd3fc;
}

.kanban-column--diagnostic,
.kanban-column--intake {
    --column-dot: #c9a66a;
}

.kanban-column--approval {
    --column-dot: #c98778;
}

.kanban-column--parts {
    --column-dot: #9aa6b8;
}

.kanban-column--work {
    --column-dot: #8ab4f8;
}

.kanban-column--done {
    --column-dot: #8bb7b0;
}

.kanban-column--problem {
    --column-dot: #b6a4bd;
}

.kanban-column p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.25;
}

.kanban-column header strong,
.kanban-column-count-button {
    display: grid;
    place-items: center;
    min-width: 30px;
    min-height: 30px;
    height: 30px;
    padding: 0 7px;
    border: 0;
    border-radius: 999px;
    background: var(--panel-soft);
    color: var(--ink);
    font-size: 13px;
    line-height: 1;
}

.kanban-column-count-tools {
    display: flex;
    align-items: center;
    align-self: flex-start;
    gap: 4px;
    flex: 0 0 auto;
}

.kanban-column-count-button {
    cursor: pointer;
}

.kanban-column-count-button:hover,
.kanban-column-count-button[aria-expanded="true"] {
    background: var(--ink);
    color: var(--panel);
}

.kanban-column-count-button:focus-visible {
    outline: 2px solid var(--accent-2);
    outline-offset: 2px;
}

.kanban-column-count-button:disabled {
    cursor: default;
    opacity: .55;
}

.kanban-column-count-button.is-filtered {
    box-shadow: inset 0 0 0 1px var(--accent-2);
}

.kanban-column-local-reset {
    display: grid;
    place-items: center;
    width: 26px;
    min-width: 26px;
    min-height: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel-soft);
    color: var(--muted);
    font-size: 17px;
    line-height: 1;
}

.kanban-column-local-reset:hover {
    border-color: var(--line-strong);
    background: var(--panel-strong);
    color: var(--ink);
}

.kanban-column-local-reset:focus-visible {
    outline: 2px solid var(--accent-2);
    outline-offset: 2px;
}

.kanban-column-local-reset[hidden] {
    display: none;
}

.available-breakdown-popover {
    position: fixed;
    z-index: 60;
    width: min(320px, calc(100vw - 20px));
    max-height: min(460px, calc(100vh - 20px));
    padding: 10px;
    overflow: hidden;
}

.available-breakdown-head > div {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.available-breakdown-head strong {
    font-size: 14px;
}

.available-breakdown-head span {
    color: var(--muted);
    font-size: 11px;
}

.available-breakdown-head span b {
    color: var(--ink);
}

.available-breakdown-list {
    display: grid;
    gap: 4px;
    max-height: min(380px, calc(100vh - 118px));
    overflow-y: auto;
    padding: 8px 2px 1px;
    scrollbar-width: none;
}

.available-breakdown-list::-webkit-scrollbar {
    display: none;
}

.available-breakdown-row {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 34px;
    width: 100%;
    padding: 6px 9px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--input-bg);
    color: var(--ink);
    font-size: 12px;
    text-align: left;
    cursor: pointer;
}

.available-breakdown-row:hover,
.available-breakdown-row.active {
    border-color: var(--accent-2);
}

.available-breakdown-row:hover {
    background: var(--accent-hover);
    color: var(--accent-contrast);
}

.available-breakdown-row.active {
    box-shadow: inset 0 0 0 1px var(--accent-2);
}

.available-breakdown-row.active b {
    background: var(--accent-soft);
}

.available-breakdown-row:hover b {
    background: #f3f3f3;
    color: #151515;
}

:root[data-theme="dark"] .available-breakdown-row:hover b {
    background: var(--panel);
    color: var(--ink);
    box-shadow: inset 0 0 0 1px var(--line-strong);
}

.available-breakdown-row:hover::before {
    opacity: 0;
}

.available-breakdown-row::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0 auto 0 0;
    width: var(--queue-share, 0%);
    background: var(--accent-soft);
    opacity: .65;
}

.available-breakdown-row span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.available-breakdown-row b {
    display: grid;
    place-items: center;
    min-width: 24px;
    min-height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--panel-soft);
    font-size: 12px;
}

.available-breakdown-empty {
    padding: 14px 8px;
    color: var(--muted);
    text-align: center;
    font-size: 12px;
}

.column-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    padding: 7px;
    color: var(--muted);
    font-size: 11px;
    border-bottom: 1px solid var(--line);
}

.column-stats--single {
    grid-template-columns: 1fr;
}

.column-stats > span,
.column-stats button.kanban-stat-filter {
    min-height: 24px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    background: var(--chip-bg);
    overflow-wrap: anywhere;
    text-align: center;
}

.column-stats button.kanban-stat-filter {
    min-width: 0;
    margin: 0;
    padding: 0 5px;
    font: inherit;
    border-radius: 6px;
}

.column-stats button.kanban-stat-filter[aria-pressed="true"] {
    border-color: var(--ui-control-selected-border);
    background: var(--ui-control-selected);
    color: var(--ink);
}

.column-stats > .kanban-buffer-stats {
    display: flex;
    gap: 2px;
}

.kanban-buffer-stats .kanban-stat-filter {
    flex: 1;
}

.kanban-buffer-stats small {
    font: inherit;
}

.cards {
    display: grid;
    align-content: start;
    gap: 6px;
    overflow-y: auto;
    padding: 7px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.cards::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.deadline-divider {
    display: grid;
    grid-template-columns: minmax(10px, 1fr) auto minmax(10px, 1fr);
    align-items: center;
    gap: 6px;
    margin: 2px 2px 0;
    color: var(--muted);
    font-size: 10px;
    line-height: 1;
}

.deadline-divider::before,
.deadline-divider::after {
    content: "";
    height: 1px;
    background: var(--line);
}

.deadline-divider span {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 2px 6px;
    border-radius: 999px;
    background: var(--panel-soft);
    white-space: nowrap;
}

.deadline-divider--overdue span {
    color: var(--danger);
    background: var(--notice-danger-bg);
}

.deadline-divider--today span {
    color: var(--warn);
    background: var(--chip-warm-bg);
}

.deal-card {
    position: relative;
    display: grid;
    gap: 4px;
    min-height: 132px;
    padding: 8px 8px 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--card-bg);
    font-size: 12px;
    overflow: visible;
}

.deal-card:hover {
    border-color: var(--line-strong);
    z-index: 10;
}

.deal-card.is-urgent,
.deal-card.is-urgent:hover {
    --state-border-rest: color-mix(in srgb, var(--danger) 58%, var(--line));
    --state-border-peak: var(--danger-frame-peak);
    border-color: var(--state-border-rest);
    animation: state-border-breathe 6s ease-in-out infinite;
}

@keyframes state-border-breathe {
    0%,
    100% {
        border-color: var(--state-border-rest);
    }

    50% {
        border-color: var(--state-border-peak);
    }
}

@media (prefers-reduced-motion: reduce) {
    .kanban-column.constraint,
    .deal-card.is-urgent,
    .deal-card.is-urgent:hover {
        animation: none;
    }
}

.deal-card strong,
.deal-card span {
    overflow-wrap: anywhere;
}

.deal-card strong {
    font-size: 13px;
    line-height: 1.2;
}

.deal-brand-model {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.2;
}

.deal-top,
.deal-bottom {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 5px;
}

.deal-tags {
    display: flex;
    align-items: center;
    gap: 5px;
}

.deal-number {
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 4px;
    justify-self: start;
    min-width: 0;
    min-height: 22px;
    margin-left: -3px;
    padding: 2px 5px 2px 3px;
    border-radius: 6px;
    color: var(--text);
    text-decoration: none;
}

.deal-number b {
    white-space: nowrap;
}

.deal-number:hover,
.deal-number:focus-visible {
    background: var(--accent-soft);
    color: var(--accent);
    outline: none;
}

.deal-top-actions {
    display: grid;
    justify-items: end;
    min-width: 0;
}

.deal-urgency-scope-badge {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 18px;
    min-width: 18px;
    height: 18px;
    padding: 0;
    border: 1px solid var(--notice-danger-border);
    border-radius: 6px;
    background: var(--notice-danger-bg);
    color: var(--danger);
    font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
}

.deal-urgency-button {
    position: relative;
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 38px;
    min-width: 38px;
    min-height: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--card-bg);
    color: var(--muted);
    font: inherit;
    line-height: 1;
    cursor: pointer;
    transition: none;
    opacity: 1;
}

.deal-urgency-mode {
    display: block;
    min-width: 18px;
    color: currentColor;
    font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
    text-align: center;
    transform: translateY(-1px);
    filter: grayscale(1);
    opacity: .6;
}

.deal-urgency-button[aria-pressed="true"] .deal-urgency-mode {
    filter: none;
    opacity: 1;
}

.deal-urgency-button::after {
    content: attr(data-label);
    position: absolute;
    z-index: 3;
    right: -1px;
    bottom: calc(100% + 5px);
    padding: 4px 6px;
    border: 1px solid var(--notice-danger-border);
    border-radius: 6px;
    background: var(--notice-danger-bg);
    color: var(--danger);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .16);
    font-family: inherit;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translateY(2px);
    transition: opacity 100ms ease-out, transform 100ms ease-out;
}

.deal-urgency-button:hover,
.deal-urgency-button:focus-visible,
.deal-urgency-button[aria-expanded="true"] {
    background: var(--panel-soft);
    color: var(--muted);
    border-color: var(--line);
    outline: none;
}

.deal-urgency-button[aria-pressed="true"] {
    background: var(--notice-danger-bg);
    color: var(--danger);
    border-color: var(--notice-danger-border);
    outline: none;
}

.deal-urgency-button:hover::after,
.deal-urgency-button:focus-visible::after {
    opacity: 1;
    transform: translateY(0);
}

.deal-urgency-button:focus-visible {
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 56%, transparent);
}

.deal-urgency-button.is-busy {
    opacity: .65;
    cursor: wait;
}

.deal-urgency-menu {
    position: fixed;
    z-index: 10000;
    display: grid;
    gap: 1px;
    padding: 4px;
    border: 1px solid var(--ui-select-border);
    border-radius: 8px;
    background: var(--ui-select-surface);
    color: var(--text);
    box-shadow: var(--ui-popover-shadow);
}

.deal-urgency-menu[hidden] {
    display: none;
}

.deal-urgency-option {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 16px;
    align-items: center;
    gap: 7px;
    width: 100%;
    min-height: 31px;
    padding: 0 8px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.15;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
    transition: none;
}

.deal-urgency-option:hover,
.deal-urgency-option:focus-visible {
    background: var(--ui-select-option-hover);
    color: var(--text);
    outline: none;
}

.deal-urgency-option:focus-visible {
    box-shadow: inset 0 0 0 1px var(--ui-select-focus);
}

.deal-urgency-option.is-selected {
    background: var(--notice-danger-bg);
    color: var(--danger);
}

.deal-urgency-option.is-selected:hover,
.deal-urgency-option.is-selected:focus-visible {
    background: color-mix(in srgb, var(--notice-danger-bg) 82%, var(--ui-select-option-hover));
    color: var(--danger);
}

.deal-urgency-option-check {
    justify-self: center;
    color: var(--danger);
    font-size: 15px;
    opacity: 0;
}

.deal-urgency-option.is-selected .deal-urgency-option-check {
    opacity: 1;
}

.deal-bottom-actions {
    display: flex;
    align-items: center;
    justify-self: end;
    min-width: 0;
    gap: 3px;
    white-space: nowrap;
}

.deal-approval {
    display: inline-flex;
    align-items: center;
    justify-self: end;
    min-height: 20px;
    padding: 3px 5px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--approval-bg);
    color: var(--approval-text);
    font-size: 11px;
    font-style: normal;
    line-height: 1;
    white-space: nowrap;
}

.deal-approval.is-approved {
    border-color: var(--approval-approved-border);
    background: var(--approval-approved-bg);
    color: var(--ok);
}

.deal-approval.is-declined {
    border-color: var(--approval-declined-border);
    background: var(--approval-declined-bg);
    color: var(--danger);
}

.kanban-urgency-toast {
    position: fixed;
    z-index: 10020;
    right: 18px;
    bottom: 18px;
    max-width: min(380px, calc(100vw - 28px));
    padding: 10px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
    box-shadow: 0 14px 38px rgba(0, 0, 0, .26);
    font-size: 12px;
    line-height: 1.35;
}

.kanban-urgency-toast.is-error {
    border-color: var(--notice-danger-border);
    background: var(--notice-danger-bg);
    color: var(--danger);
}

.deal-storage {
    display: inline-flex;
    align-items: center;
    justify-self: end;
    max-width: 70px;
    min-height: 20px;
    padding: 3px 6px;
    border-radius: 6px;
    background: var(--storage-bg);
    color: var(--storage-text);
    font-size: 11px;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
}

.deal-storage-text {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.deal-storage.is-overflowing:hover .deal-storage-text,
.deal-master.is-overflowing:hover .deal-master-text {
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    will-change: transform;
    animation: deal-inline-marquee var(--deal-marquee-duration, 7s) ease-in-out infinite;
}

@keyframes deal-inline-marquee {
    0%,
    18% {
        transform: translateX(0);
    }

    82%,
    100% {
        transform: translateX(calc(-1 * var(--deal-marquee-shift, 0px)));
    }
}

@media (prefers-reduced-motion: reduce) {
    .deal-storage.is-overflowing:hover .deal-storage-text,
    .deal-master.is-overflowing:hover .deal-master-text {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        animation: none;
    }
}

.deal-type-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    min-width: 0;
    gap: 7px;
}

.deal-device {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.deal-device strong {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.deal-tags i {
    color: var(--muted);
    font-style: normal;
    font-size: 11px;
}

.deal-tags {
    justify-content: start;
    flex-wrap: nowrap;
    min-width: 0;
    overflow: hidden;
}

.deal-tags i {
    border-radius: 999px;
    background: var(--panel-soft);
    padding: 3px 6px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.deal-tags .deal-service-type {
    flex: 0 1 auto;
    background: var(--chip-warm-bg);
    color: var(--chip-warm-text);
}

.deal-tags.has-master .deal-service-type {
    max-width: calc(100% - 53px);
}

.deal-tags .deal-master {
    display: inline-flex;
    align-items: center;
    flex: 1 1 48px;
    min-width: 48px;
    min-height: 0;
    max-width: none;
    line-height: 1.45;
    text-overflow: clip;
}

button.deal-master-button {
    appearance: none;
    justify-content: flex-start;
    max-width: 100%;
    padding: 3px 6px;
    overflow: hidden;
    border: 0;
    border-radius: 999px;
    background: var(--panel-soft);
    color: var(--muted);
    font: inherit;
    font-size: 11px;
    font-style: normal;
    line-height: 1;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
    transition: none;
}

button.deal-master-button:hover,
button.deal-master-button[aria-expanded="true"] {
    background: var(--ui-control-hover);
    color: var(--text);
}

button.deal-master-button:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--ui-focus);
}

button.deal-master-button.is-busy {
    cursor: wait;
    opacity: .62;
}

.master-assignment-menu {
    z-index: 10010;
}

.master-assignment-menu button.ui-select-option {
    min-height: 31px;
}

dialog.master-assignment-confirm-dialog {
    width: min(420px, calc(100vw - 24px));
    max-width: none;
    padding: 0;
    overflow: hidden;
}

.master-assignment-confirm-head h2 {
    margin: 0;
    color: var(--text);
    font-size: 16px;
    line-height: 1.25;
}

.master-assignment-confirm-body {
    display: grid;
    gap: 8px;
    padding: 18px;
}

.master-assignment-confirm-body p {
    margin: 0;
    color: var(--text);
    font-size: 13px;
    line-height: 1.45;
}

.master-assignment-confirm-body .master-assignment-confirm-note {
    color: var(--muted);
    font-size: 12px;
}

.master-assignment-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 18px 16px;
    border-top: 1px solid var(--line);
    background: var(--panel-soft);
}

@media (max-width: 560px) {
    .master-assignment-confirm-actions button {
        flex: 1;
    }
}

.deal-master-text {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.deal-bottom {
    min-height: 18px;
    line-height: 1.2;
}

.deal-bottom--age-only {
    grid-template-columns: minmax(0, 1fr);
}

.deal-bottom b {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    white-space: nowrap;
}

.deal-bottom .deal-age {
    justify-self: end;
    max-width: 92px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-radius: 999px;
    background: var(--panel-soft);
    color: var(--muted);
    padding: 3px 6px;
    font-size: 11px;
    font-style: normal;
    line-height: 1.1;
}

.risk-line {
    color: var(--danger);
    font-size: 11px;
    font-weight: 700;
}

.deal-card::after {
    content: attr(data-fault);
    display: none;
    position: absolute;
    z-index: 20;
    left: 8px;
    right: 8px;
    top: calc(100% + var(--fault-tooltip-gap, 6px));
    bottom: auto;
    max-height: var(--fault-tooltip-max-height, 160px);
    padding: 7px;
    border: 1px solid var(--tooltip-border);
    border-radius: 7px;
    background: var(--tooltip-bg);
    color: var(--tooltip-text);
    font-size: 11px;
    line-height: 1.28;
    box-shadow: var(--shadow);
    pointer-events: none;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.deal-card.tooltip-up::after {
    top: auto;
    bottom: calc(100% + var(--fault-tooltip-gap, 6px));
}

.deal-card.tooltip-down::after {
    top: calc(100% + var(--fault-tooltip-gap, 6px));
    bottom: auto;
}

.deal-card.tooltip-up::after,
.deal-card.tooltip-down::after {
    display: block;
}

.toc-panel {
    border-color: color-mix(in srgb, var(--warn) 44%, var(--line));
}

.toc-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(160px, 1fr));
    gap: 10px;
}

.toc-grid div {
    min-height: 104px;
    display: grid;
    gap: 8px;
    align-content: start;
    padding: 13px;
    border-radius: 8px;
    background: var(--chip-warm-bg);
    border: 1px solid color-mix(in srgb, var(--warn) 34%, var(--line));
}

.toc-grid span {
    color: var(--chip-warm-text);
    font-size: 12px;
}

.toc-grid strong {
    font-size: 14px;
}

.table-wrap {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
    background: var(--table-bg);
}

th,
td {
    padding: 10px 11px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--table-head-bg);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

tfoot th {
    background: var(--panel-soft);
    color: var(--ink);
}

.table-form {
    display: grid;
    gap: 12px;
}

.schedule-table {
    min-width: 980px;
}

.schedule-table th,
.schedule-table td {
    min-width: 78px;
    text-align: center;
}

.schedule-table th {
    white-space: nowrap;
}

.schedule-table th:first-child,
.schedule-table td:first-child {
    min-width: 190px;
    text-align: left;
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--table-bg);
}

.schedule-table th:first-child {
    z-index: 3;
    background: var(--table-head-bg);
}

.schedule-table input {
    width: 66px;
    min-height: 34px;
    text-align: center;
    padding: 4px 5px;
    font-variant-numeric: tabular-nums;
}

.schedule-calendar-form {
    display: grid;
    gap: 10px;
    overflow-x: auto;
}

.schedule-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.schedule-week-nav {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    min-height: 34px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel-soft);
}

.schedule-week-nav button {
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.schedule-week-nav button:hover:not(:disabled) {
    background: var(--accent-soft);
    color: var(--text);
}

.schedule-week-nav button {
    width: 26px;
    padding: 0;
    font-size: 17px;
    line-height: 1;
}

.schedule-week-nav button:disabled {
    opacity: .38;
    cursor: default;
}

.schedule-week-nav span {
    min-width: 92px;
    padding: 0 4px;
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
}

.schedule-save-status {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel-soft);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.schedule-save-status[data-state="pending"],
.schedule-save-status[data-state="saving"] {
    color: var(--warn);
}

.schedule-save-status[data-state="saved"] {
    color: var(--ok);
}

.schedule-save-status[data-state="error"] {
    color: var(--danger);
}

.schedule-hidden-inputs {
    display: none;
}

.schedule-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(132px, 1fr));
    gap: 1px;
    overflow: visible;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--line);
}

.schedule-calendar[data-schedule-view="week"] {
    grid-auto-rows: auto;
}

.schedule-weekday {
    display: grid;
    place-items: center;
    min-height: 32px;
    background: var(--table-head-bg);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.schedule-day {
    position: relative;
    display: grid;
    grid-template-rows: auto minmax(76px, 1fr);
    gap: 7px;
    min-height: 148px;
    padding: 8px;
    background: var(--table-bg);
    overflow: hidden;
}

.schedule-day.is-today {
    box-shadow: inset 0 0 0 1px var(--accent);
}

.schedule-day.is-outside {
    opacity: .48;
    background: var(--panel-soft);
}

.schedule-day-top {
    display: flex;
    flex-wrap: wrap;
    align-items: start;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.schedule-day-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    min-width: 0;
    margin-left: auto;
}

.schedule-date {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.schedule-date b {
    color: var(--text);
    font-size: 13px;
    line-height: 1.1;
}

.schedule-date small {
    color: var(--muted);
    font-size: 10px;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.schedule-day-total {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    min-height: 24px;
    padding: 3px 6px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--muted);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.schedule-people {
    display: grid;
    align-content: start;
    gap: 5px;
    min-width: 0;
}

.schedule-person {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
    min-height: 27px;
    padding: 4px 4px 4px 7px;
    border-radius: 6px;
    background: color-mix(in srgb, var(--accent-2) 14%, var(--panel));
    color: var(--text);
    font-size: 12px;
    line-height: 1;
}

.schedule-person.is-short {
    background: color-mix(in srgb, var(--accent-2) 9%, var(--panel));
    color: var(--text);
}

.schedule-person.is-zero {
    background: var(--panel-soft);
    color: var(--muted);
}

.schedule-person.is-day-off,
.schedule-person.is-vacation {
    grid-template-columns: minmax(0, 1fr) 88px;
    gap: 4px;
}

.schedule-person.is-day-off {
    background: color-mix(in srgb, var(--approval-declined-bg) 28%, var(--panel));
    color: var(--text);
    box-shadow:
        inset 3px 0 0 var(--danger),
        inset 0 0 0 1px color-mix(in srgb, var(--approval-declined-border) 42%, var(--line));
}

.schedule-person.is-vacation {
    background: color-mix(in srgb, var(--accent-2) 10%, var(--panel));
    color: var(--text);
    box-shadow:
        inset 3px 0 0 var(--accent-2),
        inset 0 0 0 1px color-mix(in srgb, var(--accent-2) 32%, var(--line));
}

.schedule-person.is-day-off .schedule-person-name,
.schedule-person.is-vacation .schedule-person-name {
    color: var(--muted);
}

.schedule-person-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.schedule-shift-select {
    min-width: 0;
    max-width: 100%;
    font-variant-numeric: tabular-nums;
}

.schedule-person.is-day-off .schedule-shift-select,
.schedule-person.is-vacation .schedule-shift-select {
    width: 100%;
    padding-right: 20px;
    padding-left: 5px;
    font-size: 10px;
    font-weight: 600;
}

.schedule-person.is-day-off .schedule-shift-select {
    border-color: color-mix(in srgb, var(--approval-declined-border) 45%, var(--line));
    background: color-mix(in srgb, var(--approval-declined-bg) 22%, var(--input-bg));
    background-position:
        calc(100% - 10px) calc(50% - 1px),
        calc(100% - 7px) calc(50% - 1px),
        calc(100% - 18px) 50%;
    color: color-mix(in srgb, var(--danger) 78%, var(--text));
}

.schedule-person.is-vacation .schedule-shift-select {
    border-color: color-mix(in srgb, var(--accent-2) 38%, var(--line));
    background: color-mix(in srgb, var(--accent-2) 8%, var(--input-bg));
    color: color-mix(in srgb, var(--accent-2) 82%, var(--text));
}

.schedule-person.is-day-off .ui-select-shell--micro,
.schedule-person.is-vacation .ui-select-shell--micro {
    flex-basis: 88px;
    width: 88px;
}

.schedule-person.is-day-off button.ui-select-trigger {
    border-color: color-mix(in srgb, var(--approval-declined-border) 45%, var(--line));
    background: color-mix(in srgb, var(--approval-declined-bg) 22%, var(--input-bg));
    color: color-mix(in srgb, var(--danger) 78%, var(--text));
    font-size: 10px;
    font-weight: 600;
}

.schedule-person.is-vacation button.ui-select-trigger {
    border-color: color-mix(in srgb, var(--accent-2) 38%, var(--line));
    background: color-mix(in srgb, var(--accent-2) 8%, var(--input-bg));
    color: color-mix(in srgb, var(--accent-2) 82%, var(--text));
    font-size: 10px;
    font-weight: 600;
}

.schedule-person.is-day-off .ui-select-trigger__value,
.schedule-person.is-vacation .ui-select-trigger__value {
    padding-right: 3px;
    padding-left: 5px;
}

.payroll-bonus-share {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 500;
    line-height: 1.15;
    white-space: nowrap;
}

.schedule-person .ui-select-shell--micro button.ui-select-trigger {
    grid-template-columns: minmax(0, 1fr) 16px;
    border-radius: 5px;
}

.schedule-person .ui-select-shell--micro .ui-select-trigger__chevron {
    border-left: 0;
}

.schedule-person .ui-select-shell--micro.is-open button.ui-select-trigger,
.schedule-person .ui-select-shell--micro button.ui-select-trigger:focus-visible {
    border-color: var(--ui-select-focus);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ui-select-focus) 62%, transparent);
}

.pricing-dialog {
    width: min(1120px, calc(100vw - 28px));
    max-height: min(900px, calc(100vh - 28px));
    padding: 0;
    overflow: hidden;
}

.pricing-shell {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    max-height: inherit;
    min-height: 0;
}

.pricing-dialog-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 18px 12px;
    border-bottom: 1px solid var(--line);
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--accent-soft) 68%, transparent), transparent 55%),
        var(--panel);
}

.pricing-dialog-head h2 {
    margin: 2px 0 2px;
    font-size: 22px;
    line-height: 1.1;
    letter-spacing: 0;
}

.pricing-dialog-head p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.pricing-eyebrow {
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.pricing-panel {
    display: none;
    min-height: 0;
    overflow: auto;
    padding: 14px;
    background: var(--bg);
}

.pricing-panel.active {
    display: block;
}

.pricing-layout,
.pricing-settings-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, .9fr);
    gap: 12px;
    min-width: 0;
}

.pricing-stack {
    display: grid;
    align-content: start;
    gap: 12px;
    min-width: 0;
}

.pricing-card,
.pricing-result {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    box-shadow: 0 8px 22px rgba(24, 33, 31, .06);
}

:root[data-theme="dark"] .pricing-card,
:root[data-theme="dark"] .pricing-result {
    box-shadow: none;
}

.pricing-card {
    display: grid;
    gap: 12px;
    padding: 14px;
}

.pricing-card-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
}

.pricing-card-head h3 {
    margin: 0;
    color: var(--text);
    font-size: 16px;
    line-height: 1.2;
}

.pricing-card-head span {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.pricing-hint {
    display: grid;
    gap: 8px;
    padding: 11px 12px;
    border-radius: 8px;
    background: var(--accent-soft);
    color: var(--text);
    font-size: 12px;
}

.pricing-hint strong {
    color: var(--accent);
    font-size: 11px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.pricing-rates {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pricing-rates span {
    display: inline-flex;
    gap: 4px;
    padding: 5px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel);
    color: var(--muted);
    font-size: 12px;
}

.pricing-field {
    display: grid;
    gap: 6px;
    color: var(--text);
    font-size: 13px;
    font-weight: 650;
}

.pricing-field > span,
.pricing-field > b + span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
}

.pricing-input-wrap {
    position: relative;
    display: block;
}

.pricing-input-wrap input {
    padding-right: 58px;
}

.pricing-input-wrap i {
    position: absolute;
    right: 10px;
    top: 50%;
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
    transform: translateY(-50%);
    pointer-events: none;
}

.pricing-slider {
    width: 100%;
    accent-color: var(--accent);
}

.pricing-slider-marks {
    display: flex;
    justify-content: space-between;
    gap: 4px;
    margin-top: -2px;
    padding: 0 2px;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 600;
    line-height: 1;
    user-select: none;
}

.pricing-slider-marks span {
    display: grid;
    min-width: 0;
    gap: 3px;
    justify-items: center;
    white-space: nowrap;
}

.pricing-slider-marks span::before {
    content: "";
    width: 1px;
    height: 5px;
    border-radius: 1px;
    background: var(--line-strong);
}

.pricing-segments {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.pricing-segments button,
.pricing-presets button,
.pricing-saved-action {
    min-height: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--chip-bg);
    color: var(--text);
    text-align: left;
}

.pricing-segments button {
    display: grid;
    gap: 2px;
    padding: 8px;
    font-size: 12px;
}

.pricing-segments button small {
    color: var(--muted);
    font-size: 11px;
}

.pricing-segments button.active {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--accent-contrast);
}

.pricing-segments button.active small {
    color: color-mix(in srgb, var(--accent-contrast) 82%, transparent);
}

.pricing-presets {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.pricing-presets button {
    display: grid;
    gap: 2px;
    padding: 8px 9px;
}

.pricing-presets button:hover,
.pricing-presets button:focus-visible,
.pricing-saved-action:hover,
.pricing-saved-action:focus-visible {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
    outline: none;
}

.pricing-presets b {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
}

.pricing-presets span {
    color: var(--muted);
    font-size: 11px;
}

.pricing-result {
    display: grid;
    gap: 10px;
    padding: 16px;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, transparent), transparent 58%),
        var(--panel);
}

.pricing-result > span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.pricing-result > strong {
    color: var(--text);
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1;
    letter-spacing: 0;
}

.pricing-result > p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.pricing-result.warning {
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--warn) 14%, transparent), transparent 58%),
        var(--panel);
}

.pricing-result.danger {
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--danger) 14%, transparent), transparent 58%),
        var(--panel);
}

.pricing-t-hour {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.pricing-t-hour small {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.pricing-t-hour b {
    color: var(--ok);
    font-size: 12px;
}

.pricing-t-hour strong {
    flex: 0 0 auto;
    font-size: 18px;
}

.pricing-t-hour.warning b,
.pricing-t-hour.warning strong {
    color: var(--warn);
}

.pricing-t-hour.danger b,
.pricing-t-hour.danger strong {
    color: var(--danger);
}

.pricing-hours-list,
.pricing-breakdown,
.pricing-risk-settings {
    display: grid;
    gap: 6px;
}

.pricing-hour-item,
.pricing-breakdown > div,
.pricing-risk-row,
.pricing-saved-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 36px;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-strong);
    color: var(--text);
    font-size: 12px;
}

.pricing-hour-item {
    grid-template-columns: minmax(0, 1fr) auto auto;
}

.pricing-hour-item small,
.pricing-breakdown span,
.pricing-saved-meta {
    color: var(--muted);
    font-size: 11px;
}

.pricing-hour-item b,
.pricing-breakdown b {
    white-space: nowrap;
}

.pricing-breakdown > div:last-child {
    border-color: color-mix(in srgb, var(--accent) 32%, var(--line));
    background: var(--accent-soft);
}

.pricing-save,
.pricing-secondary {
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.pricing-save {
    background: var(--accent);
    color: var(--accent-contrast);
    font-weight: 700;
}

.pricing-secondary {
    background: var(--panel-soft);
    color: var(--text);
}

.pricing-secondary:hover,
.pricing-secondary:focus-visible {
    border-color: var(--line-strong);
    background: var(--panel-strong);
    color: var(--text);
    outline: none;
}

.pricing-saved-empty {
    min-height: 38px;
    display: grid;
    place-items: center;
    padding: 8px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--muted);
    font-size: 12px;
}

.pricing-saved-item {
    grid-template-columns: minmax(0, 1fr) auto auto;
}

.pricing-saved-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
}

.pricing-saved-action {
    display: inline-grid;
    place-items: center;
    width: 28px;
    min-height: 28px;
    padding: 0;
    text-align: center;
}

.pricing-settings-grid {
    margin-bottom: 12px;
}

.pricing-settings-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.pricing-risk-row {
    grid-template-columns: minmax(0, 1fr) 120px auto;
}

.pricing-risk-row input {
    min-height: 32px;
    font-size: 13px;
}

.pricing-settings-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 1100px) {
    .schedule-calendar {
        overflow-x: auto;
    }

    .pricing-layout,
    .pricing-settings-grid {
        grid-template-columns: 1fr;
    }

    .pricing-settings-fields {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.settings-layout {
    display: grid;
    grid-template-columns: minmax(620px, 1.08fr) minmax(500px, .92fr);
    align-items: stretch;
    gap: 10px;
}

#settings.settings-layout {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.settings-layout > .section-head {
    grid-column: 1 / -1;
    margin-bottom: 0;
}

.settings-panel {
    display: grid;
    gap: 10px;
    min-height: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.settings-layout > .status-rules-panel {
    min-width: 0;
}

.settings-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}

.settings-panel > .settings-panel-head {
    padding: 0 1px 8px;
    border-bottom: 1px solid var(--line);
}

.settings-panel-head h3,
.settings-subhead h4 {
    margin: 0;
    font-size: 14px;
    color: var(--ink);
}

.settings-panel-head button {
    flex: 0 0 auto;
}

.settings-subhead {
    display: grid;
    grid-template-columns: minmax(110px, .35fr) minmax(260px, .65fr);
    gap: 8px;
    align-items: center;
    padding: 9px 1px 0;
    border-top: 1px solid var(--line);
}

.status-settings-head {
    align-items: start;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 8px;
}

.settings-fields {
    display: grid;
    grid-template-columns: repeat(4, minmax(116px, 1fr));
    gap: 8px;
}

.team-access-grid {
    grid-template-columns: minmax(150px, 1.25fr) repeat(4, minmax(96px, 1fr));
}

.team-access-grid input[data-copy-on-focus] {
    cursor: copy;
}

.team-access-grid input[data-copied="1"] {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.settings-inline-tools {
    display: grid;
    grid-template-columns: 190px 128px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
}

.secondary-button {
    border: 1px solid var(--line);
    background: var(--chip-bg);
    color: var(--ink);
}

.secondary-button:hover:where(:not(:disabled, [aria-disabled="true"], [aria-busy="true"])) {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.tech-open-button,
.team-members-open-button {
    width: 100%;
    min-height: 30px;
    padding: 0 10px;
    text-align: left;
}

.tech-open-button {
    white-space: nowrap;
}

.tech-inline-summary {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 5px;
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.tech-mini-token {
    flex: 0 1 auto;
    max-width: 92px;
    overflow: hidden;
    padding: 3px 7px;
    border-radius: 999px;
    background: var(--chip-bg);
    color: var(--ink);
    text-overflow: ellipsis;
}

.membership-inline-summary {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.settings-checkline {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    color: var(--ink);
    font-size: 13px;
}

.settings-checkline input[type="checkbox"] {
    width: 18px;
    min-width: 18px;
    height: 18px;
}

.settings-panel input,
.settings-panel select {
    min-height: 30px;
    padding: 4px 7px;
    font-size: 13px;
}

.settings-panel button {
    min-height: 32px;
    padding: 0 13px;
}

.settings-panel th,
.settings-panel td {
    padding: 5px 6px;
    font-size: 13px;
    line-height: 1.25;
}

.settings-panel > .table-wrap {
    align-self: end;
    margin: 0 -12px -12px;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0 0 8px 8px;
}

.compact table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}

.compact input,
.compact select {
    width: 100%;
    min-width: 0;
}

.compact input[type="checkbox"] {
    min-width: 0;
    width: 18px;
    height: 18px;
}

.employees-scroll {
    max-height: 330px;
    overflow: auto;
}

.compact th:first-child,
.compact td:first-child {
    width: 58px;
}

.payroll-employees-panel th:nth-child(2),
.payroll-employees-panel td:nth-child(2) {
    width: auto;
}

.payroll-employees-panel th:nth-child(3),
.payroll-employees-panel td:nth-child(3) {
    width: 96px;
}

.payroll-employees-panel th:nth-child(4),
.payroll-employees-panel td:nth-child(4),
.payroll-employees-panel th:nth-child(5),
.payroll-employees-panel td:nth-child(5) {
    width: 168px;
}

.payroll-employees-panel th:nth-child(6),
.payroll-employees-panel td:nth-child(6) {
    width: 70px;
}

.employee-name-cell {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.employee-history-badge {
    display: inline-flex;
    margin-top: 3px;
    padding: 2px 5px;
    border-radius: 999px;
    background: var(--panel-soft);
    color: var(--muted);
    font-size: 10px;
}

.employee-remove-button {
    min-height: 28px !important;
    padding: 0 8px !important;
    border: 1px solid var(--notice-danger-border);
    background: transparent;
    color: var(--danger);
    font-size: 11px;
}

.employee-remove-button:hover:where(:not(:disabled, [aria-disabled="true"], [aria-busy="true"])) {
    background: var(--notice-danger-bg);
    color: var(--danger);
}

.empty-inline {
    color: var(--muted);
    font-size: 13px;
}

.settings-dialog {
    width: min(620px, calc(100vw - 30px));
    max-height: min(760px, calc(100vh - 34px));
    padding: 0;
}

.tech-dialog-form {
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    gap: 10px;
    max-height: min(758px, calc(100vh - 36px));
    overflow: hidden;
    padding: 14px;
}

.tech-dialog {
    width: min(1050px, calc(100vw - 30px));
}

.team-members-dialog {
    width: min(760px, calc(100vw - 30px));
    padding: 14px;
}

.team-members-dialog-form {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.team-members-dialog-toolbar {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(170px, .7fr) auto;
    gap: 8px;
    align-items: end;
}

.inline-dialog-form {
    display: inline-flex;
}

.team-master-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    max-height: min(460px, calc(100vh - 260px));
    overflow: auto;
    padding-right: 3px;
}

.team-master-option {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    min-height: 44px;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--input-bg);
    color: var(--ink);
}

.team-master-option.is-occupied {
    background: var(--panel-soft);
    color: var(--muted);
}

.team-master-option input {
    flex: 0 0 16px;
    width: 16px;
    min-width: 16px;
    min-height: 16px;
    height: 16px;
    margin: 0;
    padding: 0;
}

.team-master-option span {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.team-master-option strong,
.team-master-option small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team-master-option strong {
    color: inherit;
    font-size: 13px;
}

.team-master-option small {
    color: var(--muted);
    font-size: 11px;
}

.settings-dialog .settings-panel-head p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.dialog-actions {
    display: flex;
    gap: 8px;
}

.settings-dialog button {
    min-height: 32px;
    padding: 0 13px;
}

.tech-search-field {
    color: var(--muted);
}

.tech-search-field input {
    min-height: 34px;
}

.tech-dialog-toolbar {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto auto;
    gap: 8px;
    align-items: end;
}

.tech-metrics-table-head {
    display: grid;
    grid-template-columns: minmax(170px, .68fr) minmax(480px, 1.65fr) minmax(150px, .7fr);
    align-items: end;
    gap: 8px;
    padding: 0 8px;
    color: var(--muted);
    font-size: 10px;
}

.tech-metrics-scope {
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
    padding-bottom: 5px;
}

.tech-metrics-scope strong {
    color: var(--ink);
    font-size: 11px;
}

.tech-metrics-scope small {
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tech-metrics-teams-heading {
    padding-bottom: 5px;
    text-align: right;
}

.tech-metric-heading {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 3px;
    min-width: 0;
    min-height: 28px;
    padding: 2px 6px;
    border-left: 1px solid var(--line);
    line-height: 1.1;
}

.tech-metric-heading:first-child {
    padding-left: 0;
    border-left: 0;
}

.metric-help-trigger {
    display: inline-grid;
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
    min-height: 14px !important;
    place-items: center;
    padding: 0 !important;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    cursor: help;
}

.metric-help-trigger:hover,
.metric-help-trigger:focus-visible {
    border-color: var(--accent);
    color: var(--ink);
    outline: 0;
}

.tech-metrics-period {
    display: grid;
    gap: 4px;
    color: var(--muted);
    font-size: 11px;
}

.tech-period-segmented {
    min-width: 180px;
}

.tech-unassigned-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    white-space: nowrap;
}

.tech-unassigned-button b {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 21px;
    min-height: 21px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--panel-soft);
    color: var(--muted);
    font-size: 11px;
}

.tech-unassigned-button[aria-pressed="true"] {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--accent-contrast);
}

.tech-unassigned-button[aria-pressed="true"] b {
    background: color-mix(in srgb, var(--accent-contrast) 16%, transparent);
    color: inherit;
}

.tech-dialog-list {
    display: grid;
    grid-auto-rows: max-content;
    align-content: start;
    gap: 6px;
    min-height: 0;
    max-height: 540px;
    overflow: auto;
    padding-right: 3px;
}

.tech-dialog-row {
    display: grid;
    grid-template-columns: minmax(170px, .68fr) minmax(480px, 1.65fr) minmax(150px, .7fr);
    align-items: center;
    gap: 8px;
    min-height: 54px;
    padding: 7px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--ink);
    font-size: 13px;
}

.tech-dialog-row.has-description {
    min-height: 58px;
}

.tech-dialog-row.is-filtered-out {
    display: none !important;
}

.tech-dialog-choice {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    cursor: pointer;
}

.tech-dialog-choice input {
    flex: 0 0 16px;
    width: 16px;
    min-width: 16px;
    min-height: 16px;
    height: 16px;
    margin: 0;
    padding: 0;
}

.tech-dialog-teams {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px;
    min-width: 0;
}

.tech-dialog-metrics {
    min-width: 0;
}

.tech-metrics-set {
    display: grid;
    grid-template-columns: 52px minmax(70px, .8fr) minmax(70px, .8fr) minmax(88px, 1fr) minmax(88px, 1fr) minmax(104px, 1.15fr);
    align-items: center;
    min-width: 0;
}

.tech-flow-metric {
    display: grid;
    grid-template-rows: 13px 15px 12px;
    align-content: center;
    gap: 1px;
    min-width: 0;
    height: 44px;
    padding: 1px 6px;
    border-left: 1px solid var(--line);
}

.tech-flow-metric[hidden],
.tech-flow-empty[hidden] {
    display: none !important;
}

.tech-flow-metric:first-child {
    padding-left: 0;
    border-left: 0;
}

.tech-flow-metric small,
.tech-flow-metric em {
    width: 100%;
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 10px;
    font-style: normal;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tech-flow-metric small {
    grid-row: 1;
}

.tech-flow-metric b {
    grid-row: 2;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    font-size: 12px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tech-flow-metric em {
    grid-row: 3;
}

.tech-flow-metric.is-sample b {
    font-size: 14px;
}

.tech-metric-tooltip {
    position: fixed;
    z-index: 80;
    display: grid;
    width: max-content;
    max-width: min(290px, calc(100vw - 20px));
    gap: 4px;
    padding: 9px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    background: var(--panel-strong);
    color: var(--ink);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .22);
    font-size: 11px;
    line-height: 1.35;
    pointer-events: none;
}

.tech-metric-tooltip[hidden] {
    display: none !important;
}

.tech-metric-tooltip strong {
    font-size: 12px;
}

.tech-metric-tooltip span {
    color: var(--muted);
}

.tech-flow-empty {
    grid-column: 2 / -1;
    color: var(--muted);
    font-size: 12px;
}

.tech-team-token {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    min-height: 22px;
    padding: 2px 7px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel-soft);
    color: var(--muted);
    font-size: 11px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tech-team-token.is-current {
    border-color: var(--line-strong);
    color: var(--ink);
    font-weight: 600;
}

.tech-team-token[data-tech-team-metric] {
    cursor: help;
}

.tech-team-token[data-tech-team-metric]:hover,
.tech-team-token[data-tech-team-metric]:focus-visible {
    border-color: var(--accent);
    color: var(--ink);
    outline: 0;
}

.tech-team-token.is-unassigned {
    border-color: color-mix(in srgb, var(--warn) 42%, var(--line));
    background: var(--chip-warm-bg);
    color: var(--chip-warm-text);
}

.tech-dialog-copy {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.tech-dialog-main,
.tech-dialog-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tech-dialog-main {
    color: var(--ink);
    font-weight: 600;
    line-height: 1.25;
}

.tech-dialog-copy small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.25;
}

.tech-search-empty[hidden] {
    display: none !important;
}

.status-rules-panel th:first-child,
.status-rules-panel td:first-child {
    width: 46px;
}

.status-rules-panel th:nth-child(2),
.status-rules-panel td:nth-child(2) {
    width: 176px;
}

.status-rules-panel th:nth-child(3),
.status-rules-panel td:nth-child(3) {
    width: 104px;
}

.status-rules-panel th:nth-child(4),
.status-rules-panel td:nth-child(4),
.status-rules-panel th:nth-child(5),
.status-rules-panel td:nth-child(5) {
    width: 74px;
}

.status-scroll {
    max-height: 360px;
    overflow: auto;
}

.notice {
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--panel);
}

.notice.danger {
    color: var(--danger);
    border-color: var(--notice-danger-border);
    background: var(--notice-danger-bg);
}

.empty-state {
    min-height: 120px;
    display: grid;
    place-items: center;
    color: var(--muted);
    border: 1px dashed var(--line);
    border-radius: 8px;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
}

.login-shell {
    width: min(420px, 100%);
}

.login-box {
    display: grid;
    gap: 14px;
    padding: 24px;
}

.login-box h1 {
    margin: 0;
    font-size: 30px;
}

.login-box p {
    margin: -6px 0 4px;
    color: var(--muted);
}

@media (max-width: 1279px) {
    .sticky-workbar {
        top: var(--topbar-height, 82px);
    }

    .top-filter-grid {
        order: 3;
        flex-basis: 100%;
        max-width: none;
        grid-template-columns: minmax(180px, .85fr) minmax(230px, 1fr) minmax(140px, 1fr) auto;
    }
}

@media (min-width: 1101px) and (max-width: 1480px) {
    .topbar {
        padding: 4px 18px;
        gap: 6px;
    }

    .topbar h1 {
        font-size: 20px;
    }

    .team-switcher {
        width: 220px;
        min-width: 180px;
    }

    .top-actions a,
    .theme-toggle {
        font-size: 12px;
    }

    .workspace {
        gap: 10px;
        padding: 8px 18px 40px;
    }

    .sticky-workbar {
        padding: 6px 0 7px;
    }

    .metrics {
        grid-template-columns: repeat(7, minmax(78px, 1fr));
        gap: 5px;
    }

    .metric {
        min-height: 54px;
        padding: 6px 8px;
    }

    .sticky-workbar .metric-action {
        min-height: 54px;
        padding: 6px 8px;
    }

    .metric strong {
        font-size: 16px;
    }

    .section-tabs {
        gap: 4px;
    }

    .section-tabs a {
        padding: 5px 8px;
        font-size: 12px;
    }

    .section-block {
        padding: 14px;
    }

    .section-head {
        gap: 10px;
        margin-bottom: 10px;
    }

    .section-head h2 {
        font-size: 19px;
    }

    .master-filter {
        gap: 4px;
    }

    .master-chip,
    .type-chip {
        min-height: 24px;
        padding: 3px 7px;
        font-size: 11px;
    }

    .kanban-actions {
        gap: 6px;
    }

    .type-menu summary,
    .kanban-count {
        min-height: 28px;
        padding: 6px 9px;
        font-size: 11px;
    }

    .kanban-board {
        gap: 6px;
    }

    .kanban-column {
        min-height: 500px;
        max-height: calc(100vh - 230px);
        border-radius: 7px;
    }

    .kanban-column header {
        padding: 7px;
        gap: 5px;
    }

    .kanban-column h3 {
        gap: 5px;
        font-size: 12px;
        line-height: 1.1;
    }

    .kanban-column p {
        display: none;
    }

    .kanban-column header strong,
    .kanban-column-count-button {
        min-width: 25px;
        min-height: 25px;
        height: 25px;
        padding: 0 6px;
        font-size: 12px;
    }

    .kanban-column-local-reset {
        width: 23px;
        min-width: 23px;
        min-height: 23px;
        height: 23px;
        font-size: 15px;
    }

    .column-stats {
        gap: 3px;
        padding: 5px;
        font-size: 10px;
    }

    .column-stats > span,
    .column-stats button.kanban-stat-filter {
        min-height: 20px;
        border-radius: 5px;
    }

    .cards {
        gap: 5px;
        padding: 5px;
    }

    .deadline-divider {
        gap: 4px;
        margin: 1px 1px 0;
        font-size: 9px;
    }

    .deadline-divider span {
        min-height: 16px;
        padding: 2px 5px;
    }

    .deal-card {
        gap: 3px;
        min-height: 112px;
        padding: 6px 6px 8px;
        border-radius: 7px;
        font-size: 11px;
    }

    .deal-card strong {
        font-size: 12px;
    }

    .deal-top,
    .deal-bottom {
        gap: 4px;
    }

    .deal-number {
        min-height: 19px;
        padding: 1px 3px 1px 2px;
    }

    .deal-approval {
        min-height: 18px;
        padding: 2px 4px;
        font-size: 10px;
    }

    .deal-type-row {
        gap: 5px;
    }

    .deal-brand-model {
        font-size: 11px;
    }

    .deal-storage {
        max-width: 52px;
        min-height: 18px;
        padding: 2px 5px;
        font-size: 10px;
    }

    .deal-tags {
        gap: 3px;
    }

    .deal-tags i,
    .deal-tags .deal-master {
        padding: 2px 5px;
        font-size: 10px;
    }

    .deal-bottom .deal-age {
        max-width: 70px;
    }
}

@media (min-width: 1280px) and (max-width: 1800px) {
    .topbar {
        flex-wrap: wrap;
        gap: 5px;
        padding: 4px 10px;
    }

    .brand-line {
        gap: 6px;
    }

    .team-switcher {
        width: 180px;
        min-width: 160px;
    }

    .top-filter-grid {
        order: 3;
        flex: 1 1 100%;
        max-width: none;
        grid-template-columns: minmax(155px, 1.15fr) minmax(180px, 1fr) minmax(135px, 1fr) auto;
        gap: 5px;
    }

    .top-filter-grid label {
        gap: 0;
        font-size: 0;
    }

    .top-filter-grid input,
    .top-filter-grid select {
        font-size: 12px;
    }

    .top-actions {
        flex-wrap: nowrap;
        gap: 4px;
    }

    .top-actions a,
    .top-action-button,
    .theme-toggle {
        padding-right: 6px;
        padding-left: 6px;
        font-size: 11px;
        white-space: nowrap;
    }

    .theme-toggle-label {
        display: none;
    }

}

@media (max-width: 1180px) {
    .settings-layout {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .settings-layout > .section-head {
        grid-column: 1;
    }
}

@media (max-width: 1100px) {
    .sticky-workbar {
        grid-template-columns: 1fr;
        top: var(--topbar-height, 82px);
    }

    .sticky-workbar .metrics,
    .sticky-workbar .section-tabs {
        grid-column: 1;
    }

    .sticky-workbar .section-tabs {
        justify-content: flex-start;
    }

    .metrics,
    .toc-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-grid,
    .settings-grid,
    .settings-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .kanban-board {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .settings-panel {
        padding: 12px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: var(--panel);
    }
}

@media (max-width: 920px) {
    .kanban-filter-stack {
        flex-direction: column;
        gap: 12px;
    }

    .kanban-filter-group,
    .kanban-filter-group[data-kanban-inline-filter="service"] {
        flex-basis: auto;
        width: 100%;
        text-align: left;
    }

    .kanban-filter-group[data-kanban-inline-filter="service"] .master-filter {
        justify-content: flex-start;
    }

    .tech-dialog-toolbar {
        grid-template-columns: minmax(220px, 1fr) auto;
    }

    .tech-metrics-period {
        grid-column: 1 / -1;
        grid-template-columns: auto auto;
        align-items: center;
        justify-content: space-between;
    }

    .tech-dialog-row {
        grid-template-columns: minmax(170px, .65fr) minmax(480px, 1.35fr);
    }

    .tech-metrics-table-head {
        grid-template-columns: minmax(170px, .65fr) minmax(480px, 1.35fr);
    }

    .tech-metrics-teams-heading {
        display: none;
    }

    .tech-dialog-teams {
        grid-column: 1 / -1;
        justify-content: flex-start;
        padding-left: 24px;
    }
}

@media (max-width: 720px) {
    #kanban > .section-head {
        grid-template-columns: minmax(0, 1fr);
    }

    .kanban-filter-group {
        grid-template-columns: minmax(0, 1fr);
        gap: 5px;
    }

    .kanban-actions {
        position: relative;
        min-width: 0;
    }

    .kanban-actions .type-menu {
        position: static;
    }

    .kanban-actions .type-menu-list {
        left: auto;
        right: 0;
        width: min(280px, calc(100vw - 56px));
        max-width: calc(100vw - 56px);
    }

    .schedule-person,
    .schedule-person.is-day-off,
    .schedule-person.is-vacation {
        grid-template-columns: minmax(0, 1fr);
    }

    .schedule-person-name {
        white-space: normal;
        overflow-wrap: anywhere;
        line-height: 1.25;
    }

    .topbar,
    .section-head {
        display: grid;
    }

    .topbar {
        width: 100%;
        max-width: 100vw;
        gap: 8px;
        padding: 10px 14px;
    }

    .team-switcher {
        flex: 1 1 190px;
        min-width: 170px;
    }

    .brand-line {
        flex-wrap: wrap;
    }

    .topbar > div,
    .topbar p,
    .top-filter-grid,
    .top-actions {
        width: 100%;
        max-width: 100%;
    }

    .workspace {
        padding: 14px;
    }

    .sticky-workbar {
        position: static;
        padding: 0;
        border-bottom: 0;
        background: transparent;
        backdrop-filter: none;
    }

    .metrics,
    .toc-grid,
    .filter-grid,
    .settings-grid,
    .settings-fields,
    .settings-subhead {
        grid-template-columns: 1fr;
    }

    .webhook-health-queues {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .active-summary-dialog {
        width: calc(100vw - 12px);
        max-height: calc(100vh - 12px);
        overflow-y: auto;
    }

    .active-summary-head {
        padding: 14px 14px 11px;
    }

    .active-summary-totals {
        padding: 10px 14px;
    }

    .active-summary-trend {
        padding: 10px 14px;
    }

    .active-summary-body {
        grid-template-columns: 1fr;
        max-height: none;
        overflow-y: visible;
        padding: 12px 14px 14px;
        scrollbar-width: none;
    }

    .active-summary-body::-webkit-scrollbar {
        display: none;
    }

    .active-summary-section {
        display: grid;
    }

    .active-summary-tech-list {
        max-height: 280px;
    }

    .metric-detail-dialog {
        width: calc(100vw - 12px);
        max-height: calc(100vh - 12px);
    }

    .metric-detail-head {
        padding: 14px 14px 11px;
    }

    .metric-detail-totals {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 0 14px;
    }

    .metric-detail-totals > div:nth-child(2) {
        border-right: 0;
    }

    .metric-detail-totals > div:nth-child(n + 3) {
        border-top: 1px solid var(--line);
    }

    .metric-detail-totals > div:nth-child(3) {
        padding-left: 0;
    }

    .metric-detail-totals--output > div:nth-child(4) {
        border-right: 0;
    }

    .metric-detail-totals--output > div:last-child {
        grid-column: 1 / -1;
        padding-left: 0;
    }

    .metric-detail-body {
        max-height: calc(100vh - 205px);
        padding: 12px 14px 14px;
    }

    .metric-detail-columns {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .kanban-board {
        grid-template-columns: 1fr;
    }

    .kanban-column {
        max-height: 640px;
    }

    .settings-layout {
        grid-template-columns: 1fr;
        grid-column: auto;
    }

    .settings-inline-tools {
        grid-template-columns: 1fr;
    }

    .team-members-dialog,
    .team-wizard-dialog {
        width: calc(100vw - 12px);
        max-height: calc(100vh - 12px);
    }

    .team-members-dialog-toolbar,
    .team-master-list,
    .team-wizard-grid,
    .team-leader-list {
        grid-template-columns: 1fr;
    }

    .tech-dialog-toolbar,
    .tech-dialog-row,
    .tech-metrics-table-head {
        grid-template-columns: 1fr;
    }

    .tech-metrics-table-head {
        gap: 2px;
        padding-inline: 0;
    }

    .tech-metrics-scope {
        padding: 0 8px 2px;
    }

    .tech-dialog .settings-panel-head {
        display: grid;
        grid-template-columns: 1fr;
        align-items: start;
    }

    .tech-dialog-teams {
        justify-content: flex-start;
        padding-left: 24px;
    }

    .tech-metrics-period {
        grid-template-columns: 1fr;
    }

    .tech-period-segmented,
    .tech-dialog-metrics {
        width: 100%;
    }

    .tech-period-segmented button {
        padding-inline: 6px;
    }

    .tech-dialog-metrics {
        padding-left: 24px;
    }

    .tech-metrics-table-head .tech-dialog-metrics {
        padding-inline: 24px 8px;
    }

    .tech-metrics-set {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        row-gap: 4px;
    }

    .tech-flow-metric.starts-mobile-row {
        padding-left: 0;
        border-left: 0;
    }

    .tech-metric-heading.starts-mobile-row {
        padding-left: 0;
        border-left: 0;
    }

    .dialog-actions {
        width: 100%;
        justify-content: stretch;
    }

    .dialog-actions button {
        flex: 1;
    }

    .pricing-dialog {
        width: calc(100vw - 12px);
        max-height: calc(100vh - 12px);
        border-radius: 10px;
    }

    .pricing-dialog-head {
        padding: 14px;
    }

    .pricing-tabs {
        overflow-x: auto;
        padding: 9px 10px;
    }

    .pricing-tabs button {
        white-space: nowrap;
    }

    .pricing-panel {
        padding: 10px;
    }

    .pricing-segments,
    .pricing-presets,
    .pricing-settings-fields {
        grid-template-columns: 1fr;
    }

    .pricing-risk-row {
        grid-template-columns: minmax(0, 1fr) 86px 28px;
    }

    .pricing-hour-item {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .pricing-hour-item b:last-child {
        grid-column: 2;
    }

    .pricing-saved-item {
        grid-template-columns: minmax(0, 1fr) auto auto;
    }

    .pricing-settings-actions {
        display: grid;
    }
}

/* Compact two-row navigation leaves room for the passage metric. */
.sticky-workbar .section-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, auto);
    grid-auto-flow: column;
    width: 238px;
    gap: 4px;
}
.section-tabs a {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 4px 7px;
    border-radius: 9px;
    font-size: 11px;
    line-height: 1.2;
}
.section-tabs svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.section-tabs a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.metric[data-dashboard-metric-open="passage"] { grid-template-columns: minmax(0, 1fr); }
.passage-table { width: 100%; min-width: 0; table-layout: fixed; }
.passage-table th, .passage-table td { padding: 10px 8px; overflow-wrap: anywhere; }
.passage-note { color: var(--muted); font-size: 12px; line-height: 1.5; }
@media (max-width: 1100px) {
    .sticky-workbar .section-tabs { width: min(100%, 320px); }
}
