/* mark-glass */
.mark-glass {
    --mark-glass--blur: 8px;
    background: linear-gradient(
            217deg,
            rgba(245, 245, 255, 0.3),
            rgba(255, 0, 0, 0) 70.71%
    ),
    linear-gradient(
            127deg,
            rgba(250, 250, 255, 0.2),
            rgba(0, 255, 0, 0) 70.71%
    ),
    linear-gradient(
            336deg,
            rgba(255, 255, 255, 0.1),
            rgba(0, 0, 255, 0) 70.71%
    ) !important;
    backdrop-filter: blur(var(--mark-glass--blur));
    -webkit-backdrop-filter: blur(var(--mark-glass--blur));
}

/* mark-backdrop */

.mark-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--fill-color);
    z-index: 999999;
}

/* mark-status-code */

.mark-status-code {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--fill-color);
}

/* mark-badge */

.mark-badge {
    --badge-fill-somevalue: red;
    --badge-color-somevalue: white;
    --badge-fill-highlight: #ffd800;
    --badge-color-highlight: #000;
    --badge-fill-lowlight: #000;
    --badge-color-lowlight: #fff;
    --badge-ellipsis-max-width: 200px;

    display: flex;
    width: auto;
    min-width: 50px;
    width: auto;
    height: 100%;
    max-height: 26px;
    border-radius: 1000px;

    overflow: hidden;
    align-items: center;
    user-select: none;
    white-space: nowrap;

    position: relative;
    font-family: var(--body-font);
    font-size: var(--type-ramp-base-font-size);
    line-height: var(--type-ramp-base-line-height);
    font-weight: initial;
    font-variation-settings: var(--type-ramp-base-font-variations);
    background: var(--neutral-fill-stealth-rest);
    box-sizing: border-box;
    color: var(--neutral-foreground-rest);
}

.mark-badge span {
    padding: 3px 14px;
}

.mark-badge svg {
    width: 14px;
    min-width: 14px;
    fill: var(--accent-fill-rest);
    cursor: pointer;
}
.mark-badge > *:nth-child(1):is(svg) {
    margin-left: 5px;
    margin-right: 3px;
}
.mark-badge > *:nth-child(1):is(svg) + span {
    padding-left: 0px;
}
.mark-badge > span:has(+ svg) {
    padding-right: 0px;
}
.mark-badge > span:has(+ svg) + svg {
    margin-right: 5px;
    margin-left: 3px;
}

.mark-badge[size="small"] {
    max-height: 20px;
    font-size: var(--type-ramp-minus-1-font-size);
    line-height: var(--type-ramp-minus-1-line-height);
    font-variation-settings: var(--type-ramp-minus-1-font-variations);
}

.mark-badge[size="small"] svg {
    width: 12px;
    min-width: 12px;
}

.mark-badge[size="small"] span {
    padding: 2px 10px;
}

.mark-badge[size="large"] {
    max-height: 30px;
    font-size: var(--type-ramp-plus-1-font-size);
    line-height: var(--type-ramp-plus-1-line-height);
    font-variation-settings: var(--type-ramp-plus-1-font-variations);
}

.mark-badge[size="large"] svg {
    width: 16px;
    min-width: 16px;
}

.mark-badge[size="large"] span {
    padding: 5px 16px;
}
.mark-badge[size="large"] > *:nth-child(1):is(svg) {
    margin-left: 7px;
    margin-right: 3px;
}
.mark-badge[size="large"] > span:has(+ svg) + svg {
    margin-right: 7px;
    margin-left: 3px;
}

.mark-badge[ellipsis],
.mark-badge.mark-badge--ellipsis {
    white-space: normal;
    max-width: var(--badge-ellipsis-max-width);
}
.mark-badge[ellipsis] span,
.mark-badge.mark-badge--ellipsis span {
    text-overflow: ellipsis;
    overflow: hidden;
    display: box;
    -webkit-line-clamp: 1;
    /* stylelint-disable-next-line property-no-unknown */
    box-orient: vertical;
    /* stylelint-disable-next-line property-no-vendor-prefix */
    -webkit-box-orient: vertical;
    /* stylelint-disable-next-line value-no-vendor-prefix */
    display: -webkit-box;
}

.mark-badge[appearance="lightweight"] {
    background: transparent;
    color: var(--neutral-foreground-rest);
    font-weight: 600;
}
.mark-badge[appearance="accent"] {
    background: var(--accent-fill-rest);
    color: var(--foreground-on-accent-rest);
}
.mark-badge[appearance="accent"] svg {
    fill: var(--foreground-on-accent-rest);
}
.mark-badge[appearance="neutral"] {
    background: var(--neutral-fill-secondary-rest);
    color: var(--neutral-foreground-rest);
}
.mark-badge[appearance="red"] {
    color: var(--badge-color-somevalue);
    background-color: var(--badge-fill-somevalue);
}
.mark-badge[appearance="red"] svg {
    fill: var(--badge-color-somevalue);
}
.mark-badge[appearance="highlight"] {
    color: var(--badge-color-highlight);
    background-color: var(--badge-fill-highlight);
}
.mark-badge[appearance="highlight"] svg {
    fill: var(--badge-color-highlight);
}
.mark-badge[appearance="lowlight"] {
    color: var(--badge-color-lowlight);
    background-color: var(--badge-fill-lowlight);
}

.mark-badge.mark-badge--outline {
    background-color: transparent;
    color: var(--neutral-foreground-rest);
    border: 1px solid var(--neutral-foreground-rest);
}

.mark-badge.mark-badge--outline[appearance="lightweight"] {
    background-color: transparent;
    border: transparent;
}
.mark-badge.mark-badge--outline[appearance="accent"] {
    border-color: var(--accent-fill-rest);
    color: var(--accent-fill-rest);
}
.mark-badge.mark-badge--outline[appearance="accent"] svg {
    fill: var(--accent-fill-rest);
}
.mark-badge.mark-badge--outline[appearance="red"] {
    border-color: var(--badge-fill-somevalue);
    color: var(--badge-fill-somevalue);
}
.mark-badge.mark-badge--outline[appearance="red"] svg {
    fill: var(--badge-fill-somevalue);
}
.mark-badge.mark-badge--outline[appearance="highlight"] {
    color: var(--badge-fill-highlight);
    border-color: var(--badge-fill-highlight);
}
.mark-badge.mark-badge--outline[appearance="highlight"] svg {
    fill: var(--badge-fill-highlight);
}
.mark-badge.mark-badge--outline[appearance="lowlight"] {
    color: var(--badge-fill-lowlight);
    border-color: var(--badge-fill-lowlight);
}

/* mark-grid */

.mark-grid {
    --mark-grid--gap: 8px;
    --mark-grid--gap: 8px;
    --mark-grid--card-min-width: 300px;
    --mark-grid--card-max-width: 500px;

    display: flex;
    gap: var(--mark-grid--gap);
}

.mark-grid.mark-grid--bordered .mark-grid__card {
    border: calc(var(--stroke-width) * 1px) solid
    var(--neutral-stroke-layer-rest);
}

.mark-grid .mark-grid__column {
    display: flex;
    flex-direction: column;
    gap: var(--mark-grid--gap);
}

.mark-grid__card {
    display: flex;
    flex-direction: column;
    contain: content;
    height: auto;
    width: auto;
    min-width: var(--mark-grid--card-min-width, none);
    max-width: var(--mark-grid--card-max-width, none);

    box-sizing: border-box;
    background: var(--fill-color);
    color: var(--neutral-foreground-rest);
    border-radius: calc(var(--layer-corner-radius) * 1px);
    box-shadow: var(--elevation-shadow-card-rest);
    padding: calc(var(--design-unit) * 5px);
}

.mark-grid__card .mark-grid__card__title {
    font-size: var(--type-ramp-plus-3-font-size);
    line-height: var(--type-ramp-plus-3-line-height);
    font-weight: 500;
    font-family: var(--body-font);
    margin-bottom: 1rem;
}

.mark-grid__card .mark-grid__card__text {
    font-size: var(--type-ramp-base-font-size);
    line-height: var(--type-ramp-base-line-height);
    font-weight: 400;
    font-family: var(--body-font);
    margin-bottom: 1rem;
}

.mark-grid__card svg {
    fill: var(--neutral-foreground-rest);
    width: var(--type-ramp-plus-3-font-size);
    height: var(--type-ramp-plus-3-font-size);
}


.mark-grid__composite-card {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mark-grid__composite-card .mark-grid__card {
    border-radius: 0;
}

.mark-grid__composite-card .mark-grid__card:first-child {
    border-top-left-radius: calc(var(--layer-corner-radius) * 1px);
    border-top-right-radius: calc(var(--layer-corner-radius) * 1px);
}

.mark-grid__composite-card .mark-grid__card:last-child {
    border-bottom-left-radius: calc(var(--layer-corner-radius) * 1px);
    border-bottom-right-radius: calc(var(--layer-corner-radius) * 1px);
}

.mark-grid__composite-card
.mark-grid__card.mark-grid__card--row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: calc(var(--design-unit) * 5px);
}

.mark-grid__composite-card
.mark-grid__card.mark-grid__card--button {
    will-change: background;
    transition: background 0.4s;
    cursor: pointer;
}

.mark-grid__composite-card
.mark-grid__card.mark-grid__card--button:hover {
    background: padding-box
    linear-gradient(
            var(--neutral-fill-hover),
            var(--neutral-fill-hover)
    ),
    border-box var(--neutral-stroke-control-hover);
}


.mark-grid__composite-card
.mark-grid__card.mark-grid__card--row
.mark-grid__card--row__left-icon {
    fill: var(--neutral-foreground-rest);
    width: var(--type-ramp-plus-3-font-size);
    height: var(--type-ramp-plus-3-font-size);
}


.mark-grid__composite-card
.mark-grid__card.mark-grid__card--row
.mark-grid__card--row__text {
    font-size: var(--type-ramp-base-font-size);
    line-height: var(--type-ramp-base-line-height);
    font-weight: 500;
    font-family: var(--body-font);
}


.mark-grid__composite-card
.mark-grid__card.mark-grid__card--row
.mark-grid__card--row__right-icon {
    margin-left: auto;
}

/* ai editor */

.ai-editor-wrapper {
    position: relative;
}

.ai-editor-prediction-tooltip {
    position: absolute;
    left: 0;
    max-width: 100%;
    padding: 8px 12px;
    background-color: var(--neutral-layer-2);
    border: 1px solid var(--neutral-stroke-rest);
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-in-out;
    z-index: 100;
    pointer-events: none;
}

.ai-editor-prediction-tooltip.visible {
    opacity: 1;
    visibility: visible;
}

/* ai editor */

/* table */
th > .keycapture {
    width: 100% !important;
}

/* DecisionTree editor — make the body wrapper full-height so the editor's height:100% resolves
   (the shared .content wrapper has only horizontal margin and no height of its own). */
fluent-body-content:has(.dt-editor-root) {
    height: 100%;
}

.content:has(> .dt-editor-root) {
    height: 100%;
    margin: 0;
}

/* DecisionTree editor — loading spinner (no component lib, so a CSS spinner) */
@keyframes dt-spin {
    to { transform: rotate(360deg); }
}

.dt-spinner {
    display: inline-block;
    width: 13px;
    height: 13px;
    border: 2px solid var(--neutral-stroke-rest, #d0d0d0);
    border-top-color: var(--accent-fill-rest, #3a5bd9);
    border-radius: 50%;
    animation: dt-spin .7s linear infinite;
    flex: 0 0 auto;
    vertical-align: middle;
}

/* ============ DecisionTree Content Library — two-pane list + detail ============ */
.dtc-topbar {
    height: 52px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    background: var(--fill-color, #fff);
    border-bottom: 1px solid var(--neutral-stroke-rest, #e0e0e0);
}

.dtc-workspace {
    flex: 1 1 auto;
    display: flex;
    min-height: 0;
}

.dtc-list {
    width: 344px;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--fill-color, #fff);
    border-right: 1px solid var(--neutral-stroke-rest, #e0e0e0);
}

.dtc-detail {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--neutral-layer-1, #f5f6f8);
}

.dtc-scroll {
    overflow: auto;
    min-height: 0;
}

.dtc-statcard {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 0 13px;
    border-left: 1px solid var(--neutral-stroke-rest, #e0e0e0);
}

.dtc-input {
    width: 100%;
    box-sizing: border-box;
    height: 30px;
    padding: 0 9px;
    border-radius: 6px;
    border: 1px solid var(--neutral-stroke-rest, #e0e0e0);
    background: var(--fill-color, #fff);
    color: var(--neutral-foreground-rest, #222);
    font-size: 12.5px;
    outline: none;
}

.dtc-input:focus {
    border-color: var(--accent-fill-rest, #3a5bd9);
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent-fill-rest, #3a5bd9) 18%, transparent);
}

textarea.dtc-input {
    height: auto;
    padding: 7px 9px;
    line-height: 1.45;
    resize: vertical;
}

.dtc-input.mono {
    font-family: monospace;
    font-size: 11.5px;
}

.dtc-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 11px;
    border-radius: 8px;
    border: 1px solid var(--neutral-stroke-rest, #e0e0e0);
    background: var(--fill-color, #fff);
    color: var(--neutral-foreground-rest, #222);
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

.dtc-btn:hover {
    background: color-mix(in oklab, var(--neutral-foreground-rest, #222) 7%, transparent);
}

.dtc-btn.sm {
    height: 26px;
    padding: 0 8px;
    font-size: 12px;
}

.dtc-btn.icon {
    width: 30px;
    padding: 0;
    justify-content: center;
}

.dtc-btn.icon.sm {
    width: 26px;
}

.dtc-btn.primary {
    background: var(--accent-fill-rest, #3a5bd9);
    color: #fff;
    border-color: transparent;
}

.dtc-btn.primary:hover {
    filter: brightness(1.06);
    background: var(--accent-fill-rest, #3a5bd9);
}

.dtc-btn.ghost {
    border-color: transparent;
    background: transparent;
}

.dtc-btn.ghost:hover {
    background: color-mix(in oklab, var(--neutral-foreground-rest, #222) 7%, transparent);
}

.dtc-btn.danger {
    color: #d6453d;
    border-color: color-mix(in oklab, #d6453d 30%, var(--neutral-stroke-rest, #e0e0e0));
}

.dtc-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.dtc-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 21px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
}

.dtc-chip.btn {
    cursor: pointer;
}

.dtc-dot {
    width: 8px;
    height: 8px;
    border-radius: 3px;
    flex: 0 0 auto;
}

.dtc-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    border-left: 2px solid transparent;
}

.dtc-row:hover {
    background: color-mix(in oklab, var(--neutral-foreground-rest, #222) 5%, transparent);
}

.dtc-row.on {
    background: var(--neutral-fill-rest, #eef);
    border-left-color: var(--accent-fill-rest, #3a5bd9);
}

.dtc-block {
    background: var(--fill-color, #fff);
    border: 1px solid var(--neutral-stroke-rest, #e0e0e0);
    border-radius: 12px;
    margin-bottom: 14px;
    overflow: hidden;
}

.dtc-block-h {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 11px 14px;
    border-bottom: 1px solid color-mix(in oklab, var(--neutral-stroke-rest, #e0e0e0) 60%, transparent);
}

.dtc-block-t {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--neutral-foreground-hint, #888);
    text-transform: uppercase;
    letter-spacing: .05em;
}

.dtc-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--neutral-foreground-hint, #888);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.dtc-seg {
    display: inline-flex;
    padding: 2px;
    background: var(--neutral-fill-rest, #eef);
    border-radius: 8px;
    border: 1px solid var(--neutral-stroke-rest, #e0e0e0);
    gap: 2px;
}

.dtc-seg button {
    border: none;
    background: transparent;
    color: var(--neutral-foreground-hint, #888);
    height: 24px;
    padding: 0 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.dtc-seg button.on {
    background: var(--fill-color, #fff);
    color: var(--neutral-foreground-rest, #222);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
}

.dtc-tog {
    width: 34px;
    height: 20px;
    border-radius: 999px;
    border: none;
    background: var(--neutral-foreground-hint, #888);
    position: relative;
    cursor: pointer;
    flex: 0 0 auto;
    opacity: .5;
}

.dtc-tog.on {
    background: var(--accent-fill-rest, #3a5bd9);
    opacity: 1;
}

.dtc-tog::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    transition: left .15s;
}

.dtc-tog.on::after {
    left: 16px;
}

.dtc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .42);
    z-index: 60;
    display: grid;
    place-items: center;
}

.dtc-modal {
    background: var(--fill-color, #fff);
    border: 1px solid var(--neutral-stroke-rest, #e0e0e0);
    border-radius: 14px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, .25);
}