* { box-sizing: border-box; margin: 0; padding: 0; }

@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('font/ibm-plex-mono-400.woff2') format('woff2');
}

@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('font/ibm-plex-mono-700.woff2') format('woff2');
}

:root {
    --space-xs: 0.25em;
    --space-sm: 0.4em;
    --space-md: 0.65em;
    --space-lg: 1em;
    --space-xl: 1.618em;

    --bar-height: calc(1.618em + var(--space-xs) * 2);

    --radius-sm: calc(var(--space-xs) / 1.618);

    --border-width: 1px;
    --border-width-focus: 2px;

    --transition-fast: 150ms;
    --transition-medium: 300ms;

    --breakpoint-small: 700px;

    --column: 4em;
    --grid-1: var(--column);
    --grid-2: calc(var(--column) * 2);
    --grid-3: calc(var(--column) * 3);
    --grid-4: calc(var(--column) * 4);
    --grid-5: calc(var(--column) * 5);
    --grid-6: calc(var(--column) * 6);
    --grid-8: calc(var(--column) * 8);
    --grid-9: calc(var(--column) * 9);
    --grid-12: calc(var(--column) * 12);

    --application-panel-left-width: var(--grid-4);

}

[data-theme="dark"] {
    --color-background: #0d1017;
    --color-surface: #131721;
    --color-border: rgba(230, 225, 207, 0.26);
    --color-row-border: rgba(230, 225, 207, 0.06);
    --color-text: #bfbdb6;
    --color-text-mute: #78716c;
    --color-text-bright: #e6e1cf;
    --color-hover: rgba(230, 225, 207, 0.03);
    --color-backdrop: rgba(13, 16, 23, 0.62);

    --color-red: #f07171;
    --color-orange: #ff8f40;
    --color-yellow: #ffb454;
    --color-green: #aad94c;
    --color-blue: #39bae6;
    --color-purple: #d2a6ff;
    --color-cyan: #95e6cb;
    --color-zinc: #6c7380;

    --color-yellow-background-highlight: #78716c;
    --color-yellow-foreground-highlight: var(--color-text-bright);

    --button-primary-background: var(--color-text-bright);
    --button-primary-color: var(--color-background);
    --button-primary-border: var(--color-text-bright);
}

[data-theme="light"] {
    --color-background: #fcfcfc;
    --color-surface: #f8f9fa;
    --color-border: rgba(26, 31, 41, 0.26);
    --color-row-border: rgba(26, 31, 41, 0.10);
    --color-text: #5c6166;
    --color-text-mute: #8a9199;
    --color-text-bright: #1a1f29;
    --color-hover: rgba(26, 31, 41, 0.03);
    --color-backdrop: rgba(26, 31, 41, 0.38);

    --color-red: #f07171;
    --color-orange: #fa8d3e;
    --color-yellow: #f2ae49;
    --color-green: #86b300;
    --color-blue: #399ee6;
    --color-purple: #a37acc;
    --color-cyan: #4cbf99;
    --color-zinc: #8a9199;

    --color-yellow-background-highlight: #fef08a;
    --color-yellow-foreground-highlight: #18181b;

    --button-primary-background: var(--color-text-bright);
    --button-primary-color: var(--color-background);
    --button-primary-border: var(--color-text-bright);
}

html {
    font-size: clamp(13px, 1.618vw, 21px);
}

body {
    font-family: 'IBM Plex Mono', ui-monospace, 'Cascadia Code', 'Segoe UI Mono', Menlo, Monaco, 'Courier New', monospace;
    font-size: 1em;
    font-weight: 400;
    background: var(--color-background);
    color: var(--color-text);
    line-height: 1.618;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    height: 100%;
    display: flex;
    flex-direction: column;
}

a { color: var(--color-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
    outline: var(--border-width-focus) solid var(--color-text-bright);
    outline-offset: var(--border-width-focus);
}

svg { vertical-align: middle; }

hr {
    width: 100%;
    border: none;
    border-top: 1px solid var(--color-border);
}

.color-red { color: var(--color-red); }
.color-orange { color: var(--color-orange); }
.color-yellow { color: var(--color-yellow); }
.color-green { color: var(--color-green); }
.color-blue { color: var(--color-blue); }
.color-purple { color: var(--color-purple); }
.color-cyan { color: var(--color-cyan); }
.color-mute { color: var(--color-text-mute); }
.color-bright { color: var(--color-text-bright); }

.application {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
        "header header"
        "left   center"
        "left   footer";
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.application-panel-header {
    grid-area: header;
    display: flex;
    flex-direction: column;
}

.application-panel-header__brand {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: var(--bar-height);
    padding: var(--space-xs) var(--space-md);
    border-bottom: 1px solid var(--color-border);
    background: var(--color-background);
    gap: var(--space-md);
}

.application-panel-header__brand-breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.application-panel-header__brand-name {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    line-height: 1;
    color: var(--color-text);
    text-decoration: none;
}

.application-panel-header__brand-name:hover {
    text-decoration: none;
}

.application-panel-header__brand-accent {
    font-weight: bold;
    color: var(--color-text-bright);
}

.application-panel-header__brand-status {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--color-text);
}

.application-panel-header__navigation {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
    align-content: flex-start;
    flex-wrap: wrap;
    min-height: var(--bar-height);
    padding: var(--space-xs) var(--space-md);
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
}

.page-navigation-slot {
    display: contents;
}

.application-panel-left {
    grid-area: left;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    position: relative;
}

.application-panel-left:not(:empty) {
    width: var(--application-panel-left-width);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    padding: var(--space-xs) 0;
}

.application-panel-left.application-panel-left--closed {
    display: none;
}

.application-panel-left__group {
    display: flex;
    flex-direction: column;
}

.application-panel-left__group-label {
    color: var(--color-text-mute);
    padding: var(--space-xs) var(--space-md);
}

.application-panel-left__group-list {
    display: flex;
    flex-direction: column;
}

.application-panel-left__link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--color-text);
    text-decoration: none;
    padding: var(--space-xs) var(--space-md);
}

.application-panel-left__group-list .application-panel-left__link {
    padding-left: calc(var(--space-md) * 2);
}

body:not(.keyboard-navigation-is-active) .application-panel-left__link:hover {
    background: var(--color-text-bright);
    color: var(--color-background);
}

.application-panel-left__link__marker {
    margin-left: auto;
    display: none;
    flex-shrink: 0;
    color: var(--color-text-bright);
}

.application-panel-left__link--active {
    background: var(--color-text-bright);
    color: var(--color-background);
}

.application-panel-left__link--active .application-panel-left__link__marker {
    display: inline-flex;
    color: inherit;
}

body:not(.keyboard-navigation-is-active) .application-panel-left__link:hover .application-panel-left__link__marker {
    color: inherit;
}

.application-panel-center {
    grid-area: center;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    min-height: 0;
    position: relative;
}

.application-panel-footer {
    grid-area: footer;
    border-top: 1px solid var(--color-border);
    min-height: var(--bar-height);
    padding: var(--space-xs) var(--space-md);
    color: var(--color-text-mute);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
}

.application-panel-footer__content {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.application-panel-footer__theme {
    display: flex;
    align-items: center;
}

.application-panel-center::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--color-background);
    pointer-events: none;
    opacity: 0;
    z-index: 5;
    transition: opacity var(--transition-fast) ease;
}

body:has(#command-palette.command-palette--open) .application-panel-center::after,
body:has(.application-panel-right-overlay.application-panel-right-overlay--open) .application-panel-center::after,
body:has(.application-panel-header-overlay.application-panel-header-overlay--open) .application-panel-center::after,
body:has(.application-panel-left-overlay.application-panel-left-overlay--open) .application-panel-center::after,
body:has(.application-panel-footer-overlay.application-panel-footer-overlay--open) .application-panel-center::after {
    opacity: 0.7;
}

.application-panel-right-overlay {
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    width: var(--grid-5);
    background: var(--color-surface);
    border-left: 1px solid var(--color-border);
    transform: translateX(100%);
    transition: transform var(--transition-fast) ease;
    z-index: 10;
    display: flex;
    flex-direction: column;
}

.application-panel-right-overlay--open {
    transform: translateX(0);
}

.application-panel-right-overlay__body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.application-panel-right-overlay__body > .button {
    align-self: flex-start;
}

.application-panel-left-overlay {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--grid-5);
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    transform: translateX(-100%);
    transition: transform var(--transition-fast) ease;
    z-index: 10;
    display: flex;
    flex-direction: column;
}

.application-panel-left-overlay--open {
    transform: translateX(0);
}

.application-panel-left-overlay__body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.application-panel-header-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    max-height: 60vh;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    transform: translateY(-100%);
    transition: transform var(--transition-fast) ease;
    z-index: 10;
    display: flex;
    flex-direction: column;
}

.application-panel-header-overlay--open {
    transform: translateY(0);
}

.application-panel-header-overlay__body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.application-panel-footer-overlay {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 60vh;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    transform: translateY(100%);
    transition: transform var(--transition-fast) ease;
    z-index: 10;
    display: flex;
    flex-direction: column;
}

.application-panel-footer-overlay--open {
    transform: translateY(0);
}

.application-panel-footer-overlay__body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.page-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.page-container__row {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
    flex: 1;
    min-height: 0;
}

.page-container__row:has(.page-panel-left) {
    grid-template-columns: 1fr 4fr;
}

.page-container__row:has(.page-panel-right) {
    grid-template-columns: 4fr 1fr;
}

.page-container__row:has(.page-panel-left):has(.page-panel-right) {
    grid-template-columns: 1fr 4fr 1fr;
}

.page-panel-left,
.page-panel-right {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}

.page-panel-header,
.page-panel-footer {
	flex-shrink: 0;
}

.page-panel-center {
    overflow-y: auto;
    min-height: 0;
    min-width: 0;
}

.page-panel-center:has(> .panel--fill) {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.panel--fill > .panel__body,
.panel--fill > .chart-uplot {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
}

.panel--fill > .panel-list {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

.panel--fill > .panel-list .table-data th {
    top: 0;
}

.page-panel-left > *,
.page-panel-center > *,
.page-panel-right > * {
    min-width: 0;
}

.application-notice {
    padding: var(--space-xs) var(--space-md);
}

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-sm);
    width: 100%;
}

.pagination__size,
.pagination__navigation {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.button--disabled {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}

.application-notice--error { color: var(--color-red); }
.application-notice--success { color: var(--color-green); }
.application-notice--notice { color: var(--color-yellow); }
.application-notice--info { color: var(--color-blue); }

.panel {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-background);
}

.panel__title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: var(--bar-height);
    color: var(--color-text-bright);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-xs) var(--space-md);
    background: var(--color-surface);
}

.panel-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: var(--space-md);
}

.kanban {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: var(--space-md);
}

.kanban__column {
    flex: 1 1 var(--grid-5);
    min-width: var(--grid-4);
    display: flex;
    flex-direction: column;
}

.kanban__cards {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    padding: var(--space-md);
}

.kanban__card {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    padding: var(--space-md);
    border: 1px solid var(--color-row-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
}

.kanban__card-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-md);
}

.panel__count {
    padding: var(--space-xs) var(--space-md);
    border-top: 1px solid var(--color-row-border);
    text-align: right;
}

.panel__search {
    flex: 0 0 var(--grid-4);
    position: relative;
    display: flex;
    align-items: center;
}

.panel__search-reset {
    display: flex;
    flex-shrink: 0;
    width: 0;
    margin-left: 0;
    overflow: hidden;
    pointer-events: none;
    color: var(--color-text-bright);
    transition: width var(--transition-fast) ease, margin-left var(--transition-fast) ease;
}

.panel__search-reset .button {
    width: var(--bar-height);
    padding: 0;
}

.panel__search-input:not(:placeholder-shown) ~ .panel__search-reset {
    width: var(--bar-height);
    margin-left: var(--space-sm);
    pointer-events: auto;
}

.searchable-select {
    position: relative;
}

.chart-uplot {
    position: relative;
    width: 100%;
    min-width: 0;
    min-height: 4em;
    overflow: hidden;
    contain: layout;
}

.chart-uplot .u-cursor-pt {
    display: none !important;
}

.chart-uplot__tooltip {
    position: absolute;
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    pointer-events: none;
    white-space: nowrap;
    z-index: 10;
    display: none;
}

.chart-uplot__tooltip strong {
    color: var(--color-text-bright);
    font-weight: 600;
}

.chart-uplot__tooltip__mute {
    color: var(--color-text-mute);
}

.command-palette {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 10;
    min-width: 100%;
    width: max-content;
    max-width: calc(100vw - var(--space-md) * 2);
    max-height: var(--grid-6);
    overflow-y: auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-top: none;
}

.command-palette--open {
    display: block;
}

#command-palette {
    position: fixed;
    top: var(--command-palette-top, 0);
    left: 0;
    right: 0;
    width: 100vw;
    max-width: none;
    min-width: 0;
    height: var(--grid-6);
    overflow: hidden;
    grid-template-columns: 3fr 2fr;
    grid-template-rows: 1fr;
}

#command-palette.command-palette--open {
    display: grid;
}

.directory-embedded {
    display: grid;
    grid-template-columns: 3fr 2fr;
    grid-template-rows: 1fr;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.command-palette__results {
    overflow-y: auto;
    overscroll-behavior: contain;
    min-height: 0;
}

.command-palette__help {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border-left: 1px solid var(--color-border);
    color: var(--color-text-mute);
}

.command-palette__help-title {
    color: var(--color-text-bright);
}

.command-palette__link:hover {
    text-decoration: none;
}

.command-palette__help-row {
    display: flex;
    align-items: baseline;
    gap: var(--space-md);
}

.command-palette__link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-md);
    border-bottom: 1px solid var(--color-row-border);
    color: var(--color-text);
    text-decoration: none;
}

.command-palette__link:last-child {
    border-bottom: none;
}

body:not(.keyboard-navigation-is-active) .command-palette__link:hover,
body:not(.keyboard-navigation-is-active) .select-list__item:hover,
[data-keyboard-navigation-active],
.select-list__item[data-keyboard-navigation-active] {
    background: var(--color-text-bright);
    color: var(--color-background);
}

body:not(.keyboard-navigation-is-active) .command-palette__link:hover .color-mute,
body:not(.keyboard-navigation-is-active) .command-palette__link:hover .color-bright,
body:not(.keyboard-navigation-is-active) .select-list__item:hover .color-mute,
body:not(.keyboard-navigation-is-active) .select-list__item:hover .color-bright,
[data-keyboard-navigation-active] .color-mute,
[data-keyboard-navigation-active] .color-bright,
.select-list__item[data-keyboard-navigation-active] .color-mute,
.select-list__item[data-keyboard-navigation-active] .color-bright {
    color: inherit;
}

.command-palette__link__marker {
    margin-left: auto;
    display: inline-flex;
    flex-shrink: 0;
    color: var(--color-text-bright);
}

body:not(.keyboard-navigation-is-active) .command-palette__link:hover .command-palette__link__marker,
body:not(.keyboard-navigation-is-active) .select-list__item:hover .select-list__item__marker,
[data-keyboard-navigation-active] .command-palette__link__marker,
[data-keyboard-navigation-active] .select-list__item__marker {
    color: inherit;
}

.command-palette__link--hidden {
    display: none;
}

.panel__search-input {
    display: block;
    flex: 1;
    min-width: 0;
    padding: var(--space-xs) var(--space-md);
    font-family: inherit;
    font-size: 1em;
    line-height: 1.618;
    color: var(--color-text-bright);
    background: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}

.panel__search-input:focus {
    outline: none;
    background: var(--color-text-bright);
    color: var(--color-background);
}

.panel__body {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    padding: var(--space-md);
}

.table-data {
    width: 100%;
    border-collapse: collapse;
}

.table-data th {
    text-align: left;
    padding: var(--space-xs) var(--space-md);
    color: var(--color-text-bright);
    box-shadow: inset 0 -1px 0 var(--color-border);
    white-space: nowrap;
    font-weight: 400;
    position: sticky;
    top: calc(-1 * var(--space-md) - 1px);
    z-index: 1;
    background: var(--color-surface);
}

.table-data td {
    padding: var(--space-xs) var(--space-md);
    border-bottom: 1px solid var(--color-row-border);
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table-data tr:last-child td {
    border-bottom: none;
}

.table-data tr.table-data__row--primary td {
    border-bottom: none;
    padding-bottom: 0;
}

.table-data tr.table-data__row--continuation td {
    padding-top: 0;
}

.table-data tr:hover td {
    background: var(--color-hover);
}

.table-data a {
    color: var(--color-blue);
}

.table-data__cell--link {
    padding-top: 0;
    padding-bottom: 0;
}

.table-data__cell--link > a {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    height: 100%;
    padding: var(--space-xs) 0;
}

.table-data-scroll {
	overflow-x: auto;
}

.table-data__cell--action {
    padding: 0;
}

.table-data .table-data__cell--right {
    text-align: right;
}

.panel--fill {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
}

.panel--narrow {
    width: 100%;
    max-width: var(--grid-6);
}

.chat-message-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.chat-message {
    display: flex;
    align-items: baseline;
    gap: var(--space-md);
    padding: var(--space-xs) var(--space-md);
    border-bottom: 1px solid var(--color-row-border);
}

.chat-message:last-child {
    border-bottom: none;
}

.chat-message__user {
    color: var(--color-text-bright);
    flex-shrink: 0;
}

.chat-message__time {
    flex-shrink: 0;
}

.chat-message__body {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.chat-message-form {
    display: flex;
    align-items: stretch;
    gap: var(--space-sm);
    width: 100%;
}

.chat-message-form__input {
    flex: 1;
}

.badge {
    display: inline-block;
    white-space: nowrap;
    font-weight: 600;
}

.badge--red { color: var(--color-red); }
.badge--orange { color: var(--color-orange); }
.badge--yellow { color: var(--color-yellow); }
.badge--green { color: var(--color-green); }
.badge--blue { color: var(--color-blue); }
.badge--purple { color: var(--color-purple); }
.badge--cyan { color: var(--color-cyan); }
.badge--zinc { color: var(--color-zinc); }
.badge--bright { color: var(--color-text-bright); }
.badge--mute { color: var(--color-text-mute); }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    min-height: var(--bar-height);
    padding: var(--space-xs) var(--space-md);
    font-family: inherit;
    font-size: 1em;
    line-height: 1;
    color: var(--color-text);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.button-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
}

.button-grid .button--double {
    min-height: calc(var(--bar-height) * 2);
}

.button:hover {
    color: var(--button-primary-color);
    background: var(--button-primary-background);
    border-color: var(--button-primary-border);
    text-decoration: none;
}

.button--primary {
    color: var(--button-primary-color);
    background: var(--button-primary-background);
    border-color: var(--button-primary-border);
}

.button--active {
    color: var(--button-primary-color);
    border-color: var(--button-primary-border);
    background: var(--button-primary-background);
}

.button--text {
    min-height: 0;
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
}

.button--text:hover {
    background: none;
    border-color: transparent;
    color: var(--color-text-bright);
}

[data-theme="dark"] .theme-toggle__icon--sun,
[data-theme="light"] .theme-toggle__icon--moon {
    display: none;
}

.empty-state {
    color: var(--color-text);
    padding: var(--space-xs) var(--space-md);
}

.select-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.select-list__item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-md);
    border-bottom: 1px solid var(--color-row-border);
    color: var(--color-text);
    text-decoration: none;
}

.select-list__item:last-child {
    border-bottom: none;
}

.select-list__item:hover {
    text-decoration: none;
}

.select-list__item__body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.select-list__item__marker {
    margin-left: auto;
    display: none;
    flex-shrink: 0;
    color: var(--color-text-bright);
}

.select-list__item--current .select-list__item__marker {
    display: inline-flex;
}

.panel__title--brand {
    text-transform: none;
    font-weight: 400;
}

.public-shell {
    max-width: var(--grid-6);
    width: 100%;
    align-self: center;
    padding: min(calc(var(--space-xl) * 6), 15vh) var(--space-md) var(--space-xl);
}

.form-field__label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--color-text);
    margin-bottom: var(--space-xs);
}

.form-field__input {
    display: block;
    width: 100%;
    padding: var(--space-xs) var(--space-md);
    font-family: inherit;
    font-size: 1em;
    line-height: 1.618;
    color: var(--color-text-bright);
    background: var(--color-surface);
    border: none;
    border-bottom: 1px solid var(--color-text-bright);
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
}

.form-field__input::placeholder {
    color: var(--color-text-mute);
}

.form-field__input--error {
    border-bottom-color: var(--color-red);
}

.form-field__error {
    color: var(--color-red);
}

.form-field__input:focus {
    outline: none;
    background: var(--color-text-bright);
    color: var(--color-background);
}

.form-field__input--view,
.form-field__input--view:focus {
    color: var(--color-text-bright);
    -webkit-text-fill-color: var(--color-text-bright);
    opacity: 1;
    border-bottom-color: var(--color-row-border);
    background: transparent;
    cursor: default;
}

.panel__body form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.form-grid {
    display: grid;
    gap: var(--space-md) var(--space-lg);
}

.form-grid--one-column {
    grid-template-columns: 1fr;
}

.form-grid--two-column {
    grid-template-columns: repeat(2, 1fr);
}

.form-action {
    display: flex;
    gap: var(--space-sm);
}

.form-action__spacer {
    flex: 1;
}

.record-count {
    color: var(--color-text-mute);
    white-space: nowrap;
}

.detail-grid {
    display: grid;
    grid-template-columns: var(--grid-3) 1fr;
    gap: 0;
}

.detail-grid__label {
    padding: var(--space-xs) var(--space-md);
    color: var(--color-text-mute);
    border-bottom: 1px solid var(--color-row-border);
}

.detail-grid__value {
    padding: var(--space-xs) var(--space-md);
    color: var(--color-text-bright);
    border-bottom: 1px solid var(--color-row-border);
}

.detail-grid__label:last-of-type,
.detail-grid__value:last-of-type {
    border-bottom: none;
}

.text-preformatted {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.search-highlight {
    background: var(--color-yellow-background-highlight);
    color: var(--color-yellow-foreground-highlight);
    padding: 0;
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--color-text) transparent;
}

::-webkit-scrollbar {
    width: var(--space-sm);
    height: var(--space-sm);
}

::-webkit-scrollbar-track {
    background: transparent;
    border-left: 1px solid var(--color-border);
}

::-webkit-scrollbar-thumb {
    background: var(--color-text);
    border-radius: 0;
}

.icon-logo-mark {
    animation: icon-logo-mark-spin 2s linear infinite paused;
}

html:has(.htmx-request) .icon-logo-mark,
.panel__title--brand .icon-logo-mark {
    animation-play-state: running;
}

@keyframes icon-logo-mark-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@media (max-width: 1024px) {
    .button-grid { grid-template-columns: repeat(2, 1fr); }
    .page-container__row:has(.page-panel-left):has(.page-panel-right) {
        grid-template-columns: 1fr 4fr;
    }
}

@media (max-width: 700px) {
    .application {
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "center"
            "footer";
    }
    .application-panel-left { display: none; }
    [data-navigation-rail-toggle] { display: none; }
    .button-grid { grid-template-columns: 1fr; }
    .form-grid--two-column { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: var(--grid-3) 1fr; }
    .hide-on-small { display: none; }
    .page-container__row {
        display: flex;
        flex-direction: column;
    }
    .page-panel-left,
    .page-panel-right {
        max-height: 35vh;
        flex: 0 0 auto;
    }
}

.page-action {
	align-items: center;
	display: flex;
	gap: var(--space-md);
	padding: var(--space-xs) 0;
}

.workflow-action {
	align-items: center;
	display: flex;
	gap: var(--space-md);
}

.workflow-history {
	display: flex;
	flex-direction: column;
	gap: var(--space-xs);
	padding: var(--space-xs) 0;
}

.workflow-history__title {
	color: var(--color-text-mute);
	font-weight: 400;
}

.workflow-history__list {
	display: flex;
	flex-direction: column;
	gap: var(--space-xs);
	list-style: none;
	margin: 0;
	padding: 0;
}

.workflow-history__entry {
	align-items: baseline;
	display: flex;
	gap: var(--space-md);
	min-height: var(--bar-height);
	padding: var(--space-xs) var(--space-md);
}

.workflow-history__status {
	align-items: center;
	display: flex;
	gap: var(--space-xs);
}

.workflow-history__meta {
	align-items: baseline;
	display: flex;
	gap: var(--space-xs);
}

.workflow-history__pipe {
	color: var(--color-text-mute);
}

.confirm-modal {
	margin: auto;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	color: var(--color-text);
	display: none;
	flex-direction: column;
	gap: var(--space-md);
	max-width: 34em;
	padding: var(--space-lg);
}

.confirm-modal[open] {
	display: flex;
}

.confirm-modal::backdrop {
	background: var(--color-backdrop);
}

.confirm-modal__message {
	margin: 0;
}

.confirm-modal__action {
	display: flex;
	gap: var(--space-sm);
	justify-content: flex-end;
}

.form-field--checkbox {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding-bottom: var(--space-xs);
}

.form-field__checkbox {
	appearance: none;
	-webkit-appearance: none;
	cursor: pointer;
	height: 1.618em;
	width: 1.618em;
	background: var(--color-surface);
	border: none;
	border-bottom: 1px solid var(--color-text-bright);
	position: relative;
}

.form-field__checkbox:focus-visible {
	outline: 1px solid var(--color-text-bright);
	outline-offset: 0.15em;
}

.form-field__checkbox:checked {
	background: var(--color-text-bright);
}

.form-field__checkbox:checked::after {
	content: "";
	position: absolute;
	left: 0.55em;
	top: 0.25em;
	width: 0.35em;
	height: 0.75em;
	border-right: 0.15em solid var(--color-background);
	border-bottom: 0.15em solid var(--color-background);
	transform: rotate(45deg);
}

.table-data__cell--empty {
	color: var(--color-text-mute);
}

.form-field-row {
	display: flex;
	gap: var(--space-md);
	padding-bottom: var(--space-sm);
}

.form-field-row > .form-field {
	flex: 1;
	min-width: 0;
}

@media (max-width: 700px) {
	.form-field-row {
		flex-direction: column;
	}
}

.page-panel-center--stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.integration-row {
    align-items: center;
    border-bottom: 1px solid var(--color-row-border);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    justify-content: space-between;
    min-height: var(--bar-height);
    padding: var(--space-xs) var(--space-md);
}

.integration-row__label {
	min-width: 0;
	overflow-wrap: anywhere;
}

.integration-row__value {
	white-space: nowrap;
}

.integration-row:last-child {
    border-bottom: none;
}

.integration-row__meta {
    align-items: center;
    display: flex;
    gap: var(--space-sm);
}

.integration-row__note {
    color: var(--color-text-mute);
}

.integration-row__error {
    color: var(--color-red);
    flex-basis: 100%;
}
