/* TSB Admin. Plain CSS with native nesting; light mode only. */

:root {
    --color-primary: #292929;
    --color-accent: #00c434;
    --color-accent-strong: #005937;
    --color-accent-weak: #c5edc6;
    --color-text: #333433;
    --color-text-muted: #646564;
    --color-text-disabled: #acadac;
    --color-border: #e9e9e9;
    --color-outline: #eeefee;
    --color-surface: #ffffff;
    --color-surface-muted: #f7f7f7;
    --color-error: #e54c0b;
    --color-warning: #e1b60e;
    --color-warning-weak: #fbf3d3;
    --color-info: #009fed;

    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-size: 16px;
    --font-size-dense: 14px;

    --space-1: 12px;
    --space-2: 24px;
    --space-3: 36px;

    --radius-button: 8px;
    --radius-panel: 8px;
    --radius-search: 10px;
    --radius-card: 5px;

    --shadow-top-bar: 0 4px 4px #00000005;
    --shadow-side-panel: 0 0 32px #0002;
    --backdrop: #00000050;

    --top-bar-height: 70px;
    --drawer-width: 260px;
    --transition-panel: 0.3s ease;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: var(--font-size);
}

body {
    margin: 0;
    font-family: var(--font-family);
    font-size: var(--font-size);
    line-height: 1.5;
    color: var(--color-text);
    background: var(--color-surface-muted);
}

a {
    color: var(--color-primary);
}

:focus-visible {
    outline: 2px solid var(--color-info);
    outline-offset: 2px;
}

.page-title {
    margin: 0 0 var(--space-2);
    font-size: 24px;
    font-weight: 700;
    color: var(--color-primary);
}

.loading {
    padding: var(--space-3);
    color: var(--color-text-muted);
    text-align: center;
}

/* Shell */

.shell {
    min-height: 100vh;
}

.shell__content {
    padding: calc(var(--top-bar-height) + var(--space-3)) var(--space-3) var(--space-3);
}

.top-bar {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: var(--space-1);
    height: var(--top-bar-height);
    padding: 0 var(--space-2);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-top-bar);
}

.top-bar__menu {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-button);
    background: transparent;
    cursor: pointer;

    &:hover {
        background: var(--color-surface-muted);
    }
}

/* Three bars drawn from one element and its two pseudo-elements. */
.top-bar__menu-icon,
.top-bar__menu-icon::before,
.top-bar__menu-icon::after {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--color-primary);
    border-radius: 1px;
}

.top-bar__menu-icon {
    position: relative;

    &::before,
    &::after {
        content: "";
        position: absolute;
        left: 0;
    }

    &::before {
        top: -6px;
    }

    &::after {
        top: 6px;
    }
}

.top-bar__brand {
    display: flex;
    align-items: baseline;
    gap: 6px;
    text-decoration: none;
}

.top-bar__logo {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--color-primary);
}

.top-bar__wordmark {
    font-size: 18px;
    font-weight: 400;
    color: var(--color-text-muted);
}

.top-bar__search {
    flex: 0 1 280px;
    margin-left: auto;
}

.top-bar__search + .top-bar__account {
    margin-left: 0;
}

.top-bar__search-input {
    width: 100%;
    padding: 8px var(--space-1);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-search);
    background: var(--color-surface-muted);
    font: inherit;
    font-size: var(--font-size-dense);
    color: var(--color-text);
}

/* Shows the address; on hover or focus it offers "Sign out" instead. Both
   labels share one grid cell so the button keeps its width when they swap. */
.top-bar__account {
    display: grid;
    margin-left: auto;
    padding: 8px var(--space-1);
    border: 0;
    border-radius: var(--radius-button);
    background: transparent;
    font: inherit;
    font-size: var(--font-size-dense);
    color: var(--color-text-muted);
    cursor: pointer;

    .top-bar__account-email,
    .top-bar__account-sign-out {
        grid-area: 1 / 1;
    }

    .top-bar__account-sign-out {
        visibility: hidden;
        justify-self: end;
        color: var(--color-primary);
        font-weight: 600;
    }

    &:hover,
    &:focus-visible {
        background: var(--color-surface-muted);

        .top-bar__account-email {
            visibility: hidden;
        }

        .top-bar__account-sign-out {
            visibility: visible;
        }
    }
}

/* Drawer */

.drawer {
    position: fixed;
    inset: var(--top-bar-height) 0 0 0;
    z-index: 10;
    visibility: hidden;
    transition: visibility 0s linear 0.3s;

    &.drawer--open {
        visibility: visible;
        transition: visibility 0s;
    }
}

.drawer__backdrop {
    position: absolute;
    inset: 0;
    background: var(--backdrop);
    opacity: 0;
    transition: opacity var(--transition-panel);

    .drawer--open & {
        opacity: 1;
    }
}

.drawer__panel {
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--drawer-width);
    padding: var(--space-2) var(--space-1);
    background: var(--color-surface);
    box-shadow: var(--shadow-side-panel);
    transform: translateX(-100%);
    transition: transform var(--transition-panel);

    .drawer--open & {
        transform: translateX(0);
    }
}

.drawer__links {
    margin: 0;
    padding: 0;
    list-style: none;
}

.drawer__link {
    display: block;
    padding: var(--space-1);
    border-radius: var(--radius-button);
    color: var(--color-text);
    text-decoration: none;

    &:hover {
        background: var(--color-surface-muted);
    }

    &.drawer__link--current {
        font-weight: 700;
        color: var(--color-primary);
        background: var(--color-surface-muted);
    }
}

.drawer__count {
    margin-left: 8px;
    padding: 0 8px;
    border-radius: 999px;
    color: var(--color-surface);
    background: var(--color-primary);
    font-size: 12px;
    font-weight: 600;
}

/* Home */

.module-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--space-2);
    margin: 0;
    padding: 0;
    list-style: none;
}

.module-list__link {
    display: block;
    padding: var(--space-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    background: var(--color-surface);
    font-weight: 600;
    text-decoration: none;

    &:hover {
        border-color: var(--color-primary);
    }
}

.no-access {
    color: var(--color-text-muted);
}

/* Buttons */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-1) var(--space-2);
    border: 1px solid transparent;
    border-radius: var(--radius-button);
    font: inherit;
    font-weight: 600;
    line-height: 1.25;
    cursor: pointer;

    &:disabled {
        opacity: 0.5;
        cursor: default;
    }
}

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

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

.button--link {
    padding: 0;
    background: transparent;
    font-weight: 400;
    font-size: var(--font-size-dense);
    color: var(--color-primary);
    text-decoration: underline;
}

/* Text fields */

.text-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.text-field__label {
    font-size: var(--font-size-dense);
    font-weight: 600;
    color: var(--color-text);
}

.text-field__input {
    padding: 10px var(--space-1);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-button);
    background: var(--color-surface);
    font: inherit;
    color: var(--color-text);

    &:focus {
        border-color: var(--color-primary);
        outline: none;
    }

    .text-field--invalid & {
        border-color: var(--color-error);
    }
}

.date-field {
    position: relative;
    display: flex;

    .text-field__input {
        flex: 1;
        min-width: 0;
        padding-right: 44px;
    }
}

date-picker-button {
    display: contents;
}

.date-field__button {
    position: absolute;
    top: 50%;
    right: 6px;
    width: 32px;
    height: 32px;
    transform: translateY(-50%);
    border: 0;
    border-radius: var(--radius-button);
    background: transparent;
    cursor: pointer;

    &::before {
        content: "";
        display: block;
        width: 18px;
        height: 18px;
        margin: auto;
        background-color: var(--color-text);
        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E") center / contain no-repeat;
    }

    &:disabled {
        cursor: default;
        opacity: 0.4;
    }
}

/* Kept rendered, but out of sight, so the browser can open its picker under the button. */
.date-field__picker {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 1px;
    height: 1px;
    padding: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.text-field__error {
    margin: 0;
    font-size: var(--font-size-dense);
    color: var(--color-error);
}

/* Banner and notices */

.banner {
    position: fixed;
    inset: auto var(--space-2) var(--space-2) var(--space-2);
    z-index: 30;
    display: flex;
    align-items: center;
    gap: var(--space-1);
    max-width: 720px;
    margin: 0 auto;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-panel);
    background: var(--color-error);
    color: var(--color-surface);
    box-shadow: var(--shadow-side-panel);
}

.banner__message {
    flex: 1;
    margin: 0;
}

.banner__dismiss {
    border: 0;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    color: inherit;
    cursor: pointer;
}

.notice {
    margin: 0;
    padding: var(--space-1);
    border-radius: var(--radius-card);
    background: var(--color-accent-weak);
    color: var(--color-accent-strong);
    font-size: var(--font-size-dense);
}

/* Sign-in */

.sign-in {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: var(--space-2);
}

.sign-in__card {
    width: 100%;
    max-width: 400px;
    padding: var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-panel);
    background: var(--color-surface);
}

.sign-in__brand {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin: 0 0 var(--space-2);
}

.sign-in__title {
    margin: 0 0 var(--space-1);
    font-size: 24px;
    font-weight: 700;
    color: var(--color-primary);
}

.sign-in__form {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.sign-in__text {
    margin: 0;
    color: var(--color-text-muted);
}

.sign-in__links {
    display: flex;
    justify-content: space-between;
    gap: var(--space-1);
}

/* Page header and filter */

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-1);
    margin-bottom: var(--space-2);

    .page-title {
        margin: 0;
    }
}

.page-header__actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.filter {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--font-size-dense);
}

.filter__select {
    padding: 8px var(--space-1);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-button);
    background: var(--color-surface);
    font: inherit;
    color: var(--color-text);
}

.muted {
    color: var(--color-text-muted);
    font-size: var(--font-size-dense);
}

/* Tables */

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface);
    font-size: var(--font-size-dense);
}

.table__header {
    padding: var(--space-1);
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    font-weight: 600;
    color: var(--color-text-muted);
}

.table__row {
    cursor: pointer;

    &:hover,
    &:focus-visible {
        background: var(--color-surface-muted);
    }
}

.table__cell {
    padding: var(--space-1);
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

/* Stats */

.period-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1);
    margin-bottom: var(--space-2);
}

.period-bar__switch {
    display: flex;
    gap: var(--space-1);
    margin-right: var(--space-2);
}

.period-bar__name {
    min-width: 12em;
    text-align: center;
    font-weight: 600;
}

.stats-table__number {
    text-align: right;
}

/* Row labels are header cells, which browsers centre by default. */
.stats-table th[scope="row"] {
    text-align: left;
}

.stats-table__total {
    font-weight: 600;
}

.stats-table__group {
    text-align: center;
}

.stats-note {
    margin-top: var(--space-2);
}

/* Customer history */

.history__cell {
    vertical-align: top;
}

.history__heading {
    font-weight: 600;
}

.history__lines {
    margin: 4px 0 0;
    padding-left: var(--space-2);
    color: var(--color-text-muted);
    white-space: pre-line;
    overflow-wrap: anywhere;
}

/* Chips and status */

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

.chip {
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--color-accent-weak);
    color: var(--color-accent-strong);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.status {
    font-weight: 600;

    &.status--active {
        color: var(--color-accent-strong);
    }

    &.status--inactive {
        color: var(--color-text-muted);
    }

    &.status--warning {
        color: var(--color-error);
    }
}

/* Side panel */

.side-panel {
    position: fixed;
    inset: 0;
    z-index: 40;
}

.side-panel__backdrop {
    position: absolute;
    inset: 0;
    background: var(--backdrop);
    animation: fade-in var(--transition-panel);
}

.side-panel__panel {
    position: absolute;
    inset: 0 0 0 auto;
    display: flex;
    flex-direction: column;
    width: 450px;
    max-width: 100%;
    padding: 64px 48px 32px;
    background: var(--color-surface);
    box-shadow: var(--shadow-side-panel);
    animation: slide-in var(--transition-panel);

    /* Focus lands on the panel itself when it opens; the controls inside keep their rings. */
    &:focus {
        outline: none;
    }
}

.side-panel__close {
    position: absolute;
    top: var(--space-1);
    right: var(--space-1);
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: var(--radius-button);
    background: transparent;
    font-size: 28px;
    line-height: 1;
    color: var(--color-text-muted);
    cursor: pointer;

    &:hover {
        background: var(--color-surface-muted);
    }
}

.side-panel__title {
    margin: 0 0 var(--space-1);
    font-size: 24px;
    font-weight: 700;
    color: var(--color-primary);
}

.side-panel__subtitle {
    margin: 0;
    color: var(--color-text-muted);
}

.side-panel__heading {
    margin: var(--space-2) 0 var(--space-1);
    font-size: var(--font-size);
    font-weight: 700;
}

.side-panel__content {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
}

.side-panel__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: var(--space-1);
    overflow-y: auto;
}

.side-panel__fields {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.side-panel__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    padding-top: var(--space-2);
}

@keyframes slide-in {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Scope checklist */

.scope-checklist__group {
    margin: 0;
    padding: 0;
    border: 0;
}

.scope-checklist__legend {
    padding: 0;
    margin-bottom: 6px;
    font-size: var(--font-size-dense);
    font-weight: 600;
    color: var(--color-text-muted);
}

.scope-checklist__option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
}

.scope-checklist__code {
    margin-left: auto;
    font-size: 12px;
    color: var(--color-text-muted);
}

/* Confirm dialog */

.confirm {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
}

.confirm__backdrop {
    position: absolute;
    inset: 0;
    background: var(--backdrop);
}

.confirm__dialog {
    position: relative;
    width: 100%;
    max-width: 440px;
    padding: var(--space-3);
    border-radius: var(--radius-panel);
    background: var(--color-surface);
    box-shadow: var(--shadow-side-panel);

    &:focus {
        outline: none;
    }
}

.confirm__title {
    margin: 0 0 var(--space-1);
    font-size: 20px;
    font-weight: 700;
}

.confirm__message {
    margin: 0 0 var(--space-2);
    color: var(--color-text-muted);
}

.confirm__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--space-1);
}

.confirm__actions > * {
    white-space: nowrap;
}

/* Audit log */

.audit-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--space-1);
    margin-bottom: var(--space-2);

    .text-field {
        width: 160px;
    }
}

.audit-filter__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 160px;
}

.audit-filter__actions {
    display: flex;
    gap: var(--space-1);
}

.audit-more {
    display: flex;
    justify-content: center;
    padding: var(--space-2) 0;
}

.audit-details {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 8px var(--space-2);
    margin: 0;

    dt {
        color: var(--color-text-muted);
    }

    dd {
        margin: 0;
        overflow-wrap: anywhere;
    }
}

.audit-json {
    margin: 0;
    padding: var(--space-1);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    background: var(--color-surface-muted);
    font-size: var(--font-size-dense);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* Customer search */

.quick-lists {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-1);
    font-size: var(--font-size-dense);
}

.quick-lists__link[aria-current="true"] {
    font-weight: 600;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1);
    margin-bottom: var(--space-2);
}

.filters__search {
    flex: 1 1 260px;
    padding: 8px var(--space-1);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-search);
    background: var(--color-surface);
    font: inherit;
    color: var(--color-text);
}

.chip--muted {
    background: var(--color-surface-muted);
    color: var(--color-text-muted);
}

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

.marker {
    padding: 2px 10px;
    border: 1px solid var(--color-error);
    border-radius: 999px;
    color: var(--color-error);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.marker--due {
    border-color: var(--color-warning);
    color: var(--color-text);
    background: var(--color-warning-weak);
}

.duplicates {
    padding-left: var(--space-2);
}

/* Customer page */

.customer-header {
    display: grid;
    gap: var(--space-1);
    margin-bottom: var(--space-2);

    .page-header {
        margin-bottom: 0;
    }
}

.customer-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1);
    margin: 0;
    padding: var(--space-1);
    border-radius: var(--radius-card);
    font-size: var(--font-size-dense);
    font-weight: 600;

    &.customer-banner--danger {
        background: var(--color-error);
        color: var(--color-surface);
    }

    &.customer-banner--archived {
        background: var(--color-border);
        color: var(--color-text);
    }

    &.customer-banner--warning {
        background: var(--color-warning-weak);
        color: var(--color-text);
        border: 1px solid var(--color-warning);
    }
}

.customer-banner__detail {
    font-weight: 400;
}

.customer-section {
    margin-bottom: var(--space-2);
    padding: var(--space-2);
    border-radius: var(--radius-panel);
    background: var(--color-surface);
}

.customer-section__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-1);
    margin-bottom: var(--space-1);

    .customer-section__title {
        margin: 0;
    }
}

.customer-section__title {
    margin: 0 0 var(--space-1);
    font-size: 18px;
}

.details {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 4px var(--space-1);
    margin: 0;
    font-size: var(--font-size-dense);

    dt {
        color: var(--color-text-muted);
    }

    dd {
        margin: 0;
    }
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--space-1);
    margin: 0;
    padding: 0;
    list-style: none;
}

.card {
    display: grid;
    gap: 8px;
    align-content: start;
    padding: var(--space-1);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
}

.card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.card__title {
    margin: 0;
    font-size: var(--font-size);
}

.product-cards {
    display: grid;
    gap: var(--space-1);
    margin: 0;
    padding: 0;
    list-style: none;
}

.product-card__name {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.product-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.product-card__support {
    margin: 0;
    color: var(--color-error);
    font-size: var(--font-size-dense);
    font-weight: 600;
}

.product-card__heading {
    margin: 8px 0 4px;
    font-size: var(--font-size-dense);
    color: var(--color-text-muted);
}

.product-card__accounts {
    margin: 0;
    padding-left: var(--space-2);
    font-size: var(--font-size-dense);
}

.incidents {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--color-border);
}

.incidents__list {
    display: grid;
    gap: var(--space-1);
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}

.incident {
    padding-bottom: var(--space-1);
    border-bottom: 1px solid var(--color-border);
}

.incident__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.incident__summary {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.incident__text {
    margin: 4px 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: var(--font-size-dense);
}

.incident-form {
    margin-top: 8px;
}

.incident-form__minutes {
    max-width: 8rem;
}

.incident-compare {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-1);
}

.address-block {
    margin: 0;
    white-space: pre-line;
}

.customer-edit {
    display: grid;
    gap: 0;
}

.customer-edit__actions {
    display: flex;
    gap: var(--space-1);
    margin-bottom: var(--space-2);
}

.edit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--space-1);
    margin-bottom: var(--space-1);
}

.edit-rows {
    display: grid;
    gap: var(--space-1);
    margin: 0 0 var(--space-1);
    padding: 0;
    list-style: none;
}

.edit-row {
    padding: var(--space-1);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
}

.edit-row__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.edit-row__title {
    margin: 0;
    font-size: var(--font-size);
}

.edit-row__actions {
    display: flex;
    gap: 8px;
}

.edit-roles {
    display: flex;
    flex-wrap: wrap;
    gap: 8px var(--space-1);
}

.edit-field--conflict {
    padding: 8px;
    border-radius: var(--radius-card);
    background: var(--color-warning-weak);
    outline: 1px solid var(--color-warning);
}

.conflict {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    font-size: var(--font-size-dense);
}

.conflict__theirs {
    color: var(--color-text-muted);
    white-space: pre-wrap;
}

.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: var(--font-size-dense);
}

.checkbox--not-offered {
    color: var(--color-text-muted);
}

.interest-boxes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px var(--space-1);
    margin: 0 0 var(--space-1);
    padding: 0;
    border: 0;
}

.interest-boxes__legend {
    width: 100%;
    padding: 0;
    margin-bottom: 6px;
    font-size: var(--font-size-dense);
    font-weight: 600;
    color: var(--color-text-muted);
}

.notes {
    display: grid;
    gap: var(--space-1);
    margin: 0 0 var(--space-1);
    padding: 0;
    list-style: none;
}

.note {
    padding-bottom: var(--space-1);
    border-bottom: 1px solid var(--color-border);
}

.note__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: var(--font-size-dense);
}

.note__body {
    margin: 4px 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.note__actions,
.note-form__actions {
    display: flex;
    gap: 8px;
}

.note-form {
    display: grid;
    gap: 8px;
    margin-bottom: var(--space-1);
}

.note-form__body {
    min-height: 96px;
    resize: vertical;
}

.order-json {
    margin: 0;
    padding: var(--space-1);
    overflow-x: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    font-size: var(--font-size-dense);
}

.service-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: var(--space-1);
    margin-bottom: var(--space-1);
}

.service-row--retired {
    align-items: center;
    color: var(--color-text-muted);
}

.service-row__actions {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    padding-top: 1.5rem;
}

.service-row--retired .service-row__actions {
    padding-top: 0;
}

.row-actions {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.markdown-field__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.markdown-field__tabs {
    display: flex;
    gap: 8px;
}

.markdown-field__tab--active {
    font-weight: 700;
    text-decoration: underline;
}

.markdown-field__input {
    min-height: 240px;
    resize: vertical;
}

.markdown-field__preview {
    min-height: 240px;
    padding: 0 var(--space-1);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    overflow-wrap: anywhere;
}

.email-window__from {
    margin: 0;
}
