@import url('../_content/Flare.Components.IDE/css/flare-ide.css');

/*
  Draftline's own chrome. Everything a theme can express stays a Flare token - colours, type, spacing
  and motion all come from the design system this file does not restate. What lives here is only what
  a component library has no opinion about: the frame the editor sits in, the splash before .NET
  starts, and the plane a wireframe is drawn on.
*/

html,
body {
    height: 100%;
    margin: 0;
}

#app {
    height: 100%;
}

/* Blazor sets display:block only when startup or an event fails. */
#blazor-error-ui {
    display: none;
}

/* --------------------------------------------------------------------- the first frame */

/* FlareThemeProvider removes #flare-splash once the app has booted; until then this is what the
   visitor sees instead of a white page. */
#flare-splash {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: var(--flare-color-surface, #f6f7fb);
    color: var(--flare-color-on-surface, #14161b);
    font-family: 'Inter', system-ui, sans-serif;
    transition: opacity 240ms ease-out;
}

#flare-splash strong {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

#flare-splash small {
    font-weight: 400;
    opacity: 0.6;
}

.draftline-splash-mark {
    display: inline-flex;
    gap: 0.35rem;
}

.draftline-splash-mark i {
    width: 0.6rem;
    height: 0.6rem;
    background: var(--flare-color-primary, #0f6cbd);
    animation: draftline-splash-pulse 900ms ease-in-out infinite alternate;
}

.draftline-splash-mark i:nth-child(2) {
    animation-delay: 150ms;
}

.draftline-splash-mark i:nth-child(3) {
    animation-delay: 300ms;
}

@keyframes draftline-splash-pulse {
    from {
        opacity: 0.25;
    }

    to {
        opacity: 1;
    }
}

/* --------------------------------------------------------------------- the ribbon brand */

.df-ribbon-shell {
    position: relative;
}

.df-ribbon-brand {
    position: absolute;
    inset-block-start: 0;
    inset-inline-start: 0.75rem;
    height: 2rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    font-size: 0.8125rem;
    white-space: nowrap;
}

.df-ribbon > .flare-ribbon__tabs {
    padding-inline-start: 8rem;
    min-height: 2rem;
}

.df-ribbon > .flare-ribbon__commands {
    overflow-x: auto;
}

.df-ribbon .flare-ribbon__tabpanel {
    flex: 0 0 auto;
    min-width: 100%;
}

.df-ribbon .flare-ribbon__group-content {
    display: grid;
    grid-template-rows: repeat(2, auto);
    grid-auto-flow: column;
    align-content: center;
}

/* --------------------------------------------------------------------- the editor's stage */

/* What the IDE shell leaves for the sheet: the middle of the window between the two panel regions. It
   carries no padding of its own - Fluent UI 2's page padding is switched off in the theme
   (DraftlineTheme) and the shell's regions sit flush against the window - and its height is the shell's,
   handed down from FlareLayoutContent FillHeight. min-height: 0 is the other half of that: without it
   the column refuses to shrink and the page scrolls instead of the sheet. What scrolls is the sheet's
   area and the panels, never the page. */
.df-stage {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    height: 100%;
    min-height: 0;
}

/* A quiet line of guidance inside a panel: what to do where nothing is selected yet. */
.df-hint {
    margin: 0;
    font-size: 0.8rem;
    opacity: 0.6;
}

/* --------------------------------------------------------------------- the status line */

/* The shell's status line: what is open, how big it is, and the last word from a file. Reference rather
   than a place to look at, so it stays one quiet row. */
.df-status {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    font-size: 0.78rem;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
}

.df-status__name {
    font-weight: 600;
}

.df-status__note {
    margin-left: auto;
    opacity: 0.75;
}

/* The area the sheet sits in. It scrolls on its own, so a sheet taller than the window is reached by
   scrolling the sheet and not by scrolling the whole page away from the palette. */
.df-canvas-host {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 0.75rem;
    border: 1px dashed var(--flare-color-outline-variant, #c9ccd4);
    background: var(--flare-color-surface-container-low, #f0f1f5);
    overflow: auto;
    flex: 1 1 auto;
}

/* The sheet itself: exactly the document's size, a ruled border, no shadow and no rounding. What the
   person sees here is the geometry the document means, not a picture of it. */
.df-sheet {
    position: relative;
    flex: 0 0 auto;
    background: var(--df-paper, #fff);
    border: 1px solid var(--flare-color-outline, #6f7480);
    box-shadow: none;
    outline: none;
    touch-action: none;
}

.df-canvas-hint {
    margin: 0.6rem 0 0;
    font-size: 0.8rem;
    opacity: 0.6;
}

/* The selection: a ruled frame and eight handles. The handles are what the pointer is measured
   against, so their size here and HandleRadius in C# are two numbers that have to agree. */
.df-selection {
    position: absolute;
    border: 1px solid var(--flare-color-primary, #7c3aed);
    pointer-events: none;
    z-index: 100000;
}

.df-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    background: var(--df-paper, #fff);
    border: 1px solid var(--flare-color-primary, #7c3aed);
}

.df-handle--nw {
    cursor: nwse-resize;
}

.df-handle--n {
    cursor: ns-resize;
}

.df-handle--ne {
    cursor: nesw-resize;
}

.df-handle--e {
    cursor: ew-resize;
}

.df-handle--se {
    cursor: nwse-resize;
}

.df-handle--s {
    cursor: ns-resize;
}

.df-handle--sw {
    cursor: nesw-resize;
}

.df-handle--w {
    cursor: ew-resize;
}

/* The frame drawn while a selection is being pulled over the sheet. */
.df-marquee {
    position: absolute;
    border: 1px dashed var(--flare-color-primary, #7c3aed);
    background: color-mix(in srgb, var(--flare-color-primary, #7c3aed) 8%, transparent);
    pointer-events: none;
    z-index: 100001;
}

/* --------------------------------------------------------------------- the shelf of blocks */

.df-palette {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.df-palette__row {
    display: flex;
    align-items: stretch;
    gap: 0.2rem;
}

.df-palette__button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1 1 auto;
    padding: 0.3rem 0.45rem;
    border: 1px solid transparent;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.df-palette__button:hover {
    border-color: var(--flare-color-outline-variant, #c9ccd4);
    background: var(--flare-color-surface-container-high, #f5f6fa);
}

.df-palette__glyph {
    width: 1.3rem;
    text-align: center;
    opacity: 0.85;
}

.df-palette__name {
    font-size: 0.85rem;
}

.df-palette__grip {
    display: flex;
    align-items: center;
    padding: 0 0.35rem;
    cursor: grab;
    opacity: 0.35;
    user-select: none;
}

.df-palette__grip:hover {
    opacity: 0.85;
}

/* --------------------------------------------------------------------- the blocks on the sheet */

/* One idea behind every block: a rectangle with a ruled border, straight corners, and a word or a
   line inside. No gradients, no shadows, no rounding - a wireframe says what a screen is made of,
   and anyone who wants a corner radius is in another tool on purpose.

   The sheet stays white in both light and dark mode, and the blocks stay dark on it: the canvas is
   the document's own paper, not a part of the app's chrome. Its colour is the one thing a wireframe
   is not allowed to be about. */
.df-el {
    position: absolute;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    overflow: hidden;
    font-family: inherit;
    font-size: 12px;
    line-height: 1.35;
    color: var(--df-ink, #1b1e24);
    background: var(--df-paper, #fff);
    border: 1px solid var(--df-ink, #1b1e24);
    user-select: none;
}

.df-el--bold {
    font-weight: 700;
}

/* A panel is a region, so it is drawn as a box with nothing in it but its name. */
.df-el--panel {
    align-items: flex-start;
    padding: 2px 6px;
    background: transparent;
}

.df-panel__label {
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.7;
}

.df-el--heading,
.df-el--text {
    align-items: flex-start;
    border: none;
    background: none;
}

.df-el--heading {
    font-size: 20px;
    font-weight: 700;
}

.df-el--text {
    padding: 0 2px;
}

.df-text {
    white-space: pre-wrap;
}

.df-el--button {
    justify-content: center;
}

.df-button {
    padding: 0 0.6rem;
    text-align: center;
    white-space: nowrap;
}

.df-el--textfield,
.df-el--select {
    justify-content: space-between;
    gap: 0.4rem;
    padding: 0 6px;
}

.df-field__label {
    flex: 1 1 auto;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* The field's caret: one vertical rule, which is all a wireframe needs to say "you type here". */
.df-field__line {
    flex: 0 0 auto;
    width: 1px;
    height: 60%;
    background: var(--df-ink, #1b1e24);
}

.df-el--textarea {
    align-items: flex-start;
    padding: 4px 6px;
}

/* Ruled lines, drawn with a repeating pattern rather than with a gradient ramp: the lines are the
   only thing that pattern makes. */
.df-area__rules {
    position: absolute;
    inset: 22px 6px 6px 6px;
    background-image: repeating-linear-gradient(
        to bottom,
        transparent 0 15px,
        rgb(27 30 36 / 35%) 15px 16px);
}

.df-el--checkbox,
.df-el--radio {
    gap: 6px;
    border: none;
    background: none;
}

.df-check {
    position: relative;
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    border: 1px solid var(--df-ink, #1b1e24);
}

.df-check--mixed::after { content: ""; position: absolute; left: 3px; right: 3px; top: 6px; height: 2px; background: var(--df-ink, #1b1e24); }
.df-el--focused, .df-el:focus-within { outline: 2px solid var(--df-ink, #1b1e24); outline-offset: -3px; }
.df-el--error { outline: 2px dashed var(--df-ink, #1b1e24); outline-offset: -3px; }
.df-el--selected { background: var(--df-selected, #e5e7eb); }
.df-control-feedback { position: absolute; left: 6px; right: 6px; bottom: 1px; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.df-preview-input { min-width: 0; width: 55%; border: none; background: transparent; font: inherit; color: inherit; outline: none; }
.df-preview-area { position: absolute; inset: 22px 6px 16px; width: calc(100% - 12px); border: none; background: transparent; font: inherit; resize: none; z-index: 1; }
.df-area__rules { pointer-events: none; }

.df-check--on::after {
    content: "×";
    position: absolute;
    inset: -3px 0 0 2px;
    font-size: 14px;
    line-height: 1;
}

.df-radio {
    position: relative;
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    border: 1px solid var(--df-ink, #1b1e24);
    border-radius: 50%;
}

.df-radio--on::after {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: var(--df-ink, #1b1e24);
}

.df-check__label {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.df-select__arrow {
    flex: 0 0 auto;
    opacity: 0.7;
}

.df-el--list {
    display: block;
    padding: 0;
}

.df-list__row {
    display: block;
    padding: 5px 8px;
    border-bottom: 1px solid var(--df-ink, #1b1e24);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.df-list__row:last-child {
    border-bottom: none;
}

/* A picture is not drawn, it is crossed out: the two diagonals are what everyone has drawn in a box
   since wireframes were made with a pen. They are painted rather than rotated, so they stay correct
   at any size the block is dragged to. */
.df-image__cross {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to top right,
            transparent calc(50% - 0.5px), var(--df-ink, #1b1e24) calc(50% - 0.5px),
            var(--df-ink, #1b1e24) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
        linear-gradient(to top left,
            transparent calc(50% - 0.5px), var(--df-ink, #1b1e24) calc(50% - 0.5px),
            var(--df-ink, #1b1e24) calc(50% + 0.5px), transparent calc(50% + 0.5px));
}

.df-image__caption {
    position: relative;
    padding: 0 6px;
    background: var(--df-paper, #fff);
    font-size: 11px;
}

.df-el--divider {
    border: none;
    background: none;
}

.df-el--divider::after {
    content: "";
    display: block;
    width: 100%;
    border-top: 1px solid var(--df-ink, #1b1e24);
}

/* --------------------------------------------------------------------- the project strip */

/* The bar above the sheet lives on: what is open, what this browser holds, and what happened to the
   last change. The autosave's own word is the only status the editor needs to show. */
.df-projects {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.df-projects__name {
    min-width: 12rem;
}

.df-projects__list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 16rem;
}

.df-projects__notice {
    margin: 0;
    font-size: 0.78rem;
    opacity: 0.75;
}

.df-projects__row {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    border-top: 1px solid var(--flare-color-outline-variant, #c9ccd4);
}

.df-projects__open {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    flex: 1 1 auto;
    padding: 0.3rem 0.2rem;
    border: none;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.df-projects__row-name {
    font-size: 0.85rem;
}

.df-projects__row-meta {
    font-size: 0.72rem;
    opacity: 0.6;
}

.df-projects__save {
    font-size: 0.78rem;
    opacity: 0.65;
}

/* A refused write is the one status that has to be impossible to miss: it is the difference between
   work that survives the tab closing and work that does not. */
.df-projects__save--failed {
    opacity: 1;
    font-weight: 600;
    color: var(--flare-color-error, #b3261e);
}

.df-projects__warning {
    font-size: 0.78rem;
    color: var(--flare-color-error, #b3261e);
}

/* --------------------------------------------------------------------- the inspector */

.df-inspector {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    --flare-accordion-body-padding-block: 8px;
    --flare-accordion-body-padding-inline: 8px;
}

.df-inspector__kind {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Geometry comes in pairs, because x and y are one thought when you are placing a block. */
.df-inspector__pair {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.4rem;
    align-items: end;
}

.df-inspector .flare-input { min-width: 0; max-width: 100%; }
.df-inspector .df-inspector__number { width: 9rem; }
.df-inspector__pair > .df-inspector__number { width: 100%; }
.df-inspector .flare-input__label { white-space: normal; }
.df-inspector .flare-input__field { min-height: 32px; }
.df-inspector .flare-checkbox { min-height: 32px; }
.df-inspector textarea { width: 100%; min-height: 5rem; box-sizing: border-box; }

/* A notice that came from a file: it belongs beside the buttons that produced it. */
.df-toolbar__notice {
    font-size: 0.78rem;
    color: var(--flare-color-error, #b3261e);
}

/* --------------------------------------------------------------------- the data in a block */

/* A value someone typed is ink; a hint is a lighter suggestion. Drawing both the same would make a
   screen that says "Логин: admin" look identical to one that says "Логин: введите имя". */
.df-field__value {
    flex: 0 1 auto;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.df-field__value--hint {
    opacity: 0.5;
    font-style: italic;
}

.df-inline-editor {
    position: absolute;
    z-index: 20000;
    min-width: 220px;
    height: auto !important;
    padding: 6px;
    background: var(--flare-color-surface, var(--df-paper, #fff));
    border: 1px solid var(--flare-color-outline, #555);
}

.df-el--select .df-field__value { margin-right: auto; }

.df-area__value {
    position: absolute;
    left: 6px;
    right: 6px;
    top: 20px;
    white-space: pre-wrap;
    pointer-events: none;
}

/* Rows of a list: the label on the left, the value on the right edge, where a column of numbers
   belongs. */
.df-list__row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.df-list__label {
    flex: 1 1 auto;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.df-list__value {
    flex: 0 0 auto;
    opacity: 0.7;
}

.df-text-block {
    display: flex;
    flex-direction: column;
}

.df-text__secondary,
.df-panel__description {
    font-size: 0.9em;
    opacity: 0.7;
}

.df-panel__description {
    position: absolute;
    left: 6px;
    right: 6px;
}

/* --------------------------------------------------------------------- the wider set of blocks */

/* The blocks added in v0.2 draw by the same rules as the first twelve: ruled boxes, straight corners,
   and a line wherever a real control would have a shadow. None of them is a picture of the Flare
   component it stands for - they are what a person draws on paper to say "a table goes here". */

.df-palette__section {
    margin: 0.5rem 0 0.15rem;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    opacity: 0.55;
}

/* A table: a bold header row and ruled cells, one line per row. */
.df-el--datagrid {
    display: block;
    padding: 0;
}

.df-table {
    display: block;
    width: 100%;
}

.df-table__row {
    display: flex;
    border-top: 1px solid var(--df-ink, #1b1e24);
}

.df-table__head {
    border-top: none;
    background: #f2f3f6;
    font-weight: 700;
}

.df-table__cell {
    flex: 1 1 0;
    padding: 5px 6px;
    border-left: 1px solid var(--df-ink, #1b1e24);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.df-table__cell:first-child {
    border-left: none;
}

/* Tabs: the first one is the screen you are on, so it is the one that is marked. */
.df-el--tabs {
    gap: 0;
    padding: 0;
    flex-direction: column;
    align-items: stretch;
}

.df-tabs__headers {
    display: flex;
    flex: 0 0 32px;
    min-height: 0;
    max-height: 100%;
    border-bottom: 1px solid var(--df-ink, #1b1e24);
}

.df-tabs__panel {
    flex: 1;
    min-height: 0;
    padding: 8px;
    overflow: hidden;
    white-space: pre-wrap;
}

.df-tabs__tab {
    flex: 1 1 0;
    padding: 6px 8px;
    text-align: center;
    border-right: 1px solid var(--df-ink, #1b1e24);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.df-tabs__tab.df-item--selected {
    font-weight: 700;
    box-shadow: inset 0 -2px 0 var(--df-ink, #1b1e24);
}

.df-tabs__tab:last-child {
    border-right: none;
}

.df-el--menubar {
    gap: 1.1rem;
    padding: 0 8px;
}

.df-el--accordion {
    flex-direction: column;
    align-items: stretch;
    padding: 0;
}

.df-accordion__section {
    flex: 0 0 28px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 6px 8px;
    border-top: 1px solid var(--df-ink, #1b1e24);
}

.df-accordion__section:first-child {
    border-top: none;
}

.df-tree { width: 100%; height: 100%; overflow: auto; }
.df-tree__row { display: block; box-sizing: border-box; width: 100%; min-height: 24px; text-align: left; white-space: nowrap; }

.df-accordion__mark {
    opacity: 0.7;
}

.df-el--tree {
    flex-direction: column;
    align-items: stretch;
    padding: 4px 0;
}

.df-tree__item {
    padding: 2px 6px;
}

.df-tree__item:first-child {
    font-weight: 700;
}

.df-tree__item:not(:first-child) {
    padding-left: 22px;
}

.df-el--progress {
    padding: 0;
}

.df-progress__fill {
    height: 100%;
    background: var(--df-ink, #1b1e24);
}

.df-el--slider {
    border: none;
    background: none;
}

.df-slider__track {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    border-top: 1px solid var(--df-ink, #1b1e24);
}

.df-slider__handle {
    position: absolute;
    top: 50%;
    width: 10px;
    height: 16px;
    margin: -8px 0 0 -5px;
    background: var(--df-paper, #fff);
    border: 1px solid var(--df-ink, #1b1e24);
}

.df-el--badge {
    justify-content: center;
}

.df-badge {
    padding: 0 8px;
}

/* An avatar is round because an avatar is round: that is the shape a person draws for "someone's
   picture", not a corner radius sneaking into the design system. */
.df-el--avatar {
    justify-content: center;
    border: none;
    background: none;
}

.df-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: var(--df-paper, #fff);
    border: 1px solid var(--df-ink, #1b1e24);
    border-radius: 50%;
    font-weight: 700;
}

.df-el--calendar {
    flex-direction: column;
    align-items: stretch;
    padding: 0;
}

.df-calendar__title {
    padding: 3px 6px;
    border-bottom: 1px solid var(--df-ink, #1b1e24);
    font-weight: 700;
}

.df-calendar__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    flex: 1 1 auto;
}

.df-calendar__day {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    opacity: 0.8;
    border-right: 1px solid rgb(27 30 36 / 30%);
}

.df-el--map {
    padding: 0;
}

.df-map__road {
    position: absolute;
    background: var(--df-ink, #1b1e24);
}

.df-map__road--one {
    left: -10%;
    top: 66%;
    width: 120%;
    height: 1px;
    transform: rotate(-18deg);
}

.df-map__road--two {
    left: 40%;
    top: -10%;
    width: 1px;
    height: 120%;
    transform: rotate(12deg);
}

.df-map__pin {
    position: absolute;
    left: 50%;
    top: 45%;
    width: 10px;
    height: 10px;
    margin: -5px 0 0 -5px;
    background: var(--df-ink, #1b1e24);
    border-radius: 50%;
}

.df-el--video {
    justify-content: center;
}

.df-video__play {
    font-size: 1.5em;
    opacity: 0.85;
}

.df-el--breadcrumbs {
    gap: 0.5rem;
    padding: 0 6px;
}

.df-crumbs__item:not(:last-child)::after {
    content: " ›";
    opacity: 0.5;
}

.df-el--statusbar {
    padding: 0;
}

.df-status__item {
    flex: 1 1 0;
    padding: 4px 8px;
    border-left: 1px solid var(--df-ink, #1b1e24);
    font-size: 0.92em;
    opacity: 0.85;
}

.df-status__item:first-child {
    border-left: none;
}

/* --------------------------------------------------------------------- the shelf of screens */

/* The screens of one wireframe. The open one is marked with a bar and ink; the rest stay quiet, because
   the shelf is not the drawing - it is where the drawing is taken from. */
.df-layers {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.df-layers__head {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.35rem;
}

.df-layers__row {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.25rem;
    border-left: 3px solid transparent;
}

.df-layers__row--current {
    border-left-color: var(--flare-color-primary);
    background: var(--flare-color-surface-container);
}

.df-layers__name {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0;
    overflow: hidden;
    border: none;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    white-space: nowrap;
    text-overflow: ellipsis;
    cursor: pointer;
    min-height: 24px;
}

.df-layers__name:hover {
    text-decoration: underline;
}

.df-layers__row--current .df-layers__name {
    font-weight: 700;
}

.df-layers__count,
.df-layers__mark {
    flex: 0 0 auto;
    font-size: 0.75rem;
    color: var(--flare-color-on-surface-variant);
}

.df-layers__mark {
    padding: 0 0.2rem;
    border: 1px solid currentcolor;
    border-radius: 0;
}

.df-layers__action {
    flex: 0 0 auto;
    padding: 0 0.2rem;
    border: none;
    background: none;
    color: inherit;
    font: inherit;
    font-size: 0.8rem;
    min-width: 24px;
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.df-layers__action:hover {
    background: var(--flare-color-surface-container);
}

.df-layers button:focus-visible,
.df-projects__open:focus-visible {
    outline: 2px solid var(--flare-color-primary);
    outline-offset: 2px;
}

/* --------------------------------------------------------------------- the preview */

/* Showing the wireframe rather than drawing it: the sheet on a plain ground, the screen's own shadow
   when it is a dialog, and a button over every block that leads somewhere. */
.df-preview {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    outline: none;
}

.df-preview__bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.df-preview__name {
    font-weight: 700;
}

.df-preview__spacer {
    flex: 1 1 auto;
}

.df-preview__stage {
    display: grid;
    justify-items: center;
    align-items: start;
    padding: 1rem;
    overflow: auto;
}

/* The dialog stands in the same cell as the screen under it, so the two overlap instead of sitting
   side by side. */
.df-preview__stage > * {
    grid-area: 1 / 1;
}

.df-preview__sheet {
    position: relative;
    background: var(--df-paper, #fff);
    border: 1px solid var(--df-ink, #1b1e24);
}

.df-preview__sheet--behind {
    opacity: 0.4;
}

.df-preview__sheet--dialog {
    z-index: 2;
    border-width: 2px;
    box-shadow: 0 12px 32px rgb(0 0 0 / 25%);
}

.df-preview__scrim {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgb(27 30 36 / 45%);
}

.df-preview__hotspot {
    position: absolute;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
}

.df-preview__hotspot:hover {
    background: rgb(27 30 36 / 8%);
}

.df-preview__hotspot:focus-visible {
    outline: 2px solid var(--df-ink, #1b1e24);
    outline-offset: 1px;
}

@media (max-width: 900px) {
    #df-editor .flare-ide-layout__panel:not(.flare-ide-layout__panel--collapsed) {
        max-width: calc(100vw - 6rem);
    }

    .df-projects {
        min-width: 16rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .draftline-splash-mark i { animation: none; }
    #flare-splash { transition: none; }
}

/* Authored control state: monochrome marks belong to the wireframe, independent of the app theme. */
.df-el--disabled { opacity: 0.45; }
.df-el--select.df-el--open { overflow: visible; }
.df-select__head { display: flex; align-items: center; gap: 0.4rem; width: 100%; height: 100%; }
.df-select__head > span:first-child { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.df-select__head > span[aria-hidden="true"] { flex: 0 0 auto; margin-left: auto; }
.df-select__options {
    position: absolute; top: 100%; left: -1px; width: calc(100% + 2px);
    box-sizing: border-box; display: flex; flex-direction: column;
    background: var(--df-paper, #fff); border: 1px solid var(--df-ink, #1b1e24); color: var(--df-ink, #1b1e24);
}
.df-select__option { display: block; box-sizing: border-box; height: 24px; padding: 3px 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.df-item--selected { background: var(--df-selected, #e5e7eb); font-weight: 700; }
.df-accordion__body { flex: none; box-sizing: border-box; padding: 8px; border-top: 1px solid var(--df-ink, #1b1e24); white-space: pre-wrap; overflow: hidden; }

.df-state-button { font: inherit; color: inherit; border: 0; border-radius: 0; background: transparent; text-align: inherit; cursor: pointer; }
.df-state-button.df-item--selected { background: var(--df-selected, #e5e7eb); }
.df-state-button:focus-visible { outline: 2px solid var(--df-ink, #1b1e24); outline-offset: -2px; }
.df-state-button:disabled { cursor: default; }
.df-check-control { display: flex; align-items: center; gap: 6px; width: 100%; height: 100%; padding: 0; }
.df-select__head.df-state-button { padding: 0; }
.df-tabs__tab.df-state-button { border-right: 1px solid var(--df-ink, #1b1e24); }
.df-accordion__section.df-state-button { border-top: 1px solid var(--df-ink, #1b1e24); }
.df-el--menubar.df-el--open { overflow: visible; }
.df-choice-bar { display:flex; width:100%; height:100%; }
.df-choice-bar > .df-choice-row { flex:1; min-width:0; height:100%; }
.df-choice-bar > .df-choice-separator { border-left:1px solid var(--df-ink, #1b1e24); margin:4px; }
.df-choice-list { width:100%; height:100%; overflow:auto; }
.df-choice-popup { position:absolute; top:100%; box-sizing:border-box; background:var(--df-paper, #fff); border:1px solid var(--df-ink, #1b1e24); overflow:auto; z-index:1; }
.df-choice-row { display:flex; align-items:center; justify-content:space-between; gap:8px; width:100%; min-height:24px; height:24px; padding:0 8px; box-sizing:border-box; color:inherit; text-decoration:none; white-space:nowrap; overflow:hidden; font:inherit; }
.df-choice-row > span { opacity:.7; margin-left:auto; }
.df-choice-row:disabled,.df-choice-disabled { opacity:.45; }
.df-choice-separator { display:block; height:24px; position:relative; }
.df-choice-separator::after { content:""; position:absolute; top:50%; left:6px; right:6px; border-top:1px solid var(--df-ink, #1b1e24); }
.df-el--list { padding:0; }
.df-el--menubar,.df-el--breadcrumbs,.df-el--statusbar { padding:0; gap:0; }
.df-el--datagrid { padding:0; }
.df-data-table { width:100%; height:100%; table-layout:fixed; border-collapse:collapse; font:inherit; }
.df-data-table th,.df-data-table td { padding:2px 6px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; font-weight:400; text-align:left; }
.df-data-table thead { height:28px; border-bottom:1px solid var(--df-ink, #1b1e24); }
.df-data-table th { font-weight:700; }
.df-data-table th button { display:block; width:100%; height:100%; padding:0; }
.df-data-table--grid td,.df-data-table--grid th { border-right:1px solid var(--df-ink, #1b1e24); }
.df-data-table--grid tbody tr + tr,.df-data-table--rows tbody tr + tr { border-top:1px solid var(--df-ink, #1b1e24); }
.df-data-table--columns td,.df-data-table--columns th { border-right:1px solid var(--df-ink, #1b1e24); }
.df-data-table--zebra tbody tr:nth-child(even) { background:var(--df-surface, #f3f4f6); }
.df-data-table tbody tr.df-item--selected { background:var(--df-selected, #e5e7eb); }
.df-data-table tbody tr:focus-visible { outline:2px solid var(--df-ink, #1b1e24); outline-offset:-2px; }
.df-progress__fill--indeterminate { position:absolute; background:repeating-linear-gradient(45deg,var(--df-ink, #1b1e24) 0,var(--df-ink, #1b1e24) 1px,var(--df-paper, #fff) 1px,var(--df-paper, #fff) 5px); }
.df-el--slider.df-el--vertical .df-slider__track { top:0; bottom:0; left:50%; width:1px; height:100%; }
.df-el--slider.df-el--vertical .df-slider__handle { top:auto; left:50%; width:16px; height:10px; transform:translate(-50%,50%); }
.df-el--divider.df-el--vertical::after { top:0; bottom:0; left:50%; right:auto; width:0; border-top:0; border-left:1px solid var(--df-ink, #1b1e24); }
.df-preview-slider { width:100%; height:100%; margin:0; padding:0; accent-color:var(--df-ink, #1b1e24); }
.df-el--vertical .df-preview-slider { writing-mode:vertical-lr; direction:rtl; }
.df-el--calendar { padding:0; }
.df-date-calendar { width:100%; height:100%; display:flex; flex-direction:column; }
.df-date-calendar__title { display:flex; align-items:center; justify-content:space-between; height:28px; min-height:28px; padding:0 6px; border-bottom:1px solid var(--df-ink, #1b1e24); box-sizing:border-box; font-weight:700; }
.df-date-calendar__title span { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.df-date-calendar__grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); flex:1; min-height:0; }
.df-date-calendar__grid > * { display:flex; align-items:center; justify-content:center; min-width:0; min-height:0; padding:0; font-size:10px; }
.df-date-calendar__weekday { font-weight:700; opacity:.7; }
.df-el--slider.df-el--vertical .df-slider__track { border-top:0; border-left:1px solid var(--df-ink, #1b1e24); right:auto; } .df-el--slider.df-el--vertical .df-slider__handle { margin:0; }
.df-el--divider.df-el--vertical::after { position:absolute; height:100%; }
.df-extra-art { width:100%; height:100%; pointer-events:none; }
.df-extra-art svg { display:block; }
.df-extra-overlay { position:absolute; inset:0; border:0; padding:0; background:transparent; color:transparent; cursor:pointer; }
.df-extra-overlay:focus-visible { outline:2px solid var(--df-ink, #1b1e24); outline-offset:-2px; }
.df-extra-overlay:disabled { cursor:default; }
.df-extra-step { width:30px; }
.df-extra-step--plus { left:auto; }
.df-extra-disclosure { height:28px; bottom:auto; }
.df-extra-input { position:absolute; inset:0; width:100%; height:100%; box-sizing:border-box; border:1px solid var(--df-ink, #1b1e24); border-radius:0; color:var(--df-ink, #1b1e24); background:var(--df-paper, #fff); font:inherit; }
.df-el--link,.df-el--icon,.df-el--switch,.df-el--stepper,.df-el--tooltip,.df-el--popover,.df-el--datepicker,.df-el--timepicker,.df-el--colorpicker { border:0; background:none; padding:0; }
.df-el--note,.df-el--arrow,.df-el--callout,.df-el--rectangle,.df-el--ellipse,.df-el--diamond,.df-el--sitemap,.df-el--barchart,.df-el--linechart,.df-el--piechart { border:0; background:none; padding:0; }
.df-el--device,.df-el--browser,.df-el--fieldset,.df-el--scrollbar,.df-el--splitter,.df-el--audioplayer,.df-el--richtexteditor,.df-el--appbar,.df-el--alert,.df-el--coverflow,.df-el--ioskeyboard,.df-el--camera { border:0; background:none; padding:0; }
.df-extra-rich { position:absolute; top:28px; left:0; width:100%; height:calc(100% - 28px); box-sizing:border-box; padding:6px; font:inherit; color:var(--df-ink, #1b1e24); background:white; border:1px solid var(--df-ink, #1b1e24); border-radius:0; resize:none; }
.df-extra-choice { right:auto; }
.df-selection--group { border-color:#7c3aed; } .df-group-breadcrumb { display:flex; gap:12px; align-items:center; padding:4px 8px; }
.df-block-list__row { display: flex; gap: .25rem; margin-block: .25rem; }
.df-block-list__row button { border: 1px solid var(--flare-border-color, #cbd0d8); border-radius: .2rem; background: transparent; color: inherit; cursor: pointer; min-height: 1.75rem; }
.df-block-list__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.df-smart-guide { position:absolute; background:#c241b6; pointer-events:none; z-index:20002; }
.df-local-image { display:block; width:100%; height:100%; overflow:hidden; }
.df-local-image svg { display:block; }
.df-image-import { display:grid; gap:.35rem; font-size:.8rem; margin-block:.5rem; }
.df-image-import input { max-width:100%; font-size:.75rem; }
.df-wire-icon { width:1.25em; height:1.25em; flex-shrink:0; vertical-align:middle; margin-inline-end:.3em; }
.df-icon-catalog { display:flex; flex-wrap:wrap; gap:.25rem; max-height:8rem; overflow:auto; margin-block:.35rem; }
.df-icon-catalog button { width:2rem; height:2rem; display:grid; place-items:center; background:transparent; color:inherit; border:1px solid #757b86; border-radius:.2rem; cursor:pointer; }
.df-icon-catalog button[aria-pressed="True"], .df-icon-catalog button[aria-pressed="true"] { border-color:#3b82f6; background:#3b82f633; }
.df-icon-catalog .df-wire-icon { margin:0; width:1.2rem; height:1.2rem; }
.df-component-library { display:grid; gap:.35rem; padding:.4rem; }
.df-component-library button { color:inherit; background:transparent; border:1px solid #757b86; border-radius:.2rem; padding:.35rem; cursor:pointer; }
.df-component-library button:disabled { opacity:.4; cursor:default; }
.df-component-library__item { display:flex; justify-content:space-between; align-items:center; gap:.3rem; border-top:1px solid #757b8655; padding-block:.3rem; }
.df-alternate { display:flex; gap:.25rem; }
.df-alternate button:first-child { flex:1; text-align:left; }
.df-alternate button[aria-pressed="true"], .df-alternate button[aria-pressed="True"] { border-color:#3b82f6; }
.df-stage { position:relative; }
.df-document-search { position:absolute; top:.75rem; right:1rem; width:min(28rem,90%); padding:.75rem; z-index:30000; background:var(--flare-surface, #202226); color:var(--flare-text, #eee); border:1px solid #757b86; border-radius:.35rem; box-shadow:0 4px 18px #0005; }
.df-document-search__header { display:flex; justify-content:space-between; align-items:center; margin-bottom:.5rem; }
.df-document-search input { width:100%; box-sizing:border-box; color:inherit; background:transparent; border:1px solid #757b86; border-radius:.2rem; padding:.4rem; }
.df-document-search button { color:inherit; background:transparent; border:1px solid #757b86; border-radius:.2rem; cursor:pointer; padding:.35rem; }
.df-document-search__results { max-height:18rem; overflow:auto; display:grid; gap:.35rem; margin-top:.5rem; }
.df-document-search__results button { display:grid; gap:.3rem; text-align:left; }
.df-document-search__results span { overflow-wrap:anywhere; font-size:.8rem; }
.df-element-hotspot { position:absolute; inset:0; border:0; padding:0; background:transparent; cursor:pointer; }
.df-element-hotspot:focus-visible { outline:2px solid var(--df-ink, #1b1e24); outline-offset:-2px; }
.df-preview__actions { display:flex; flex-wrap:wrap; gap:.4rem; font-size:.8rem; }
.df-preview__actions button { color:inherit; border:1px solid currentColor; border-radius:.2rem; padding:.3rem .5rem; background:transparent; cursor:pointer; }
.df-button.df-state-button { width:100%; height:100%; justify-content:center; }
.df-mockup-scope { display:flex; flex-direction:column; min-height:0; height:100%; }
.df-theme-fields { display:flex; flex-wrap:wrap; gap:.5rem; padding:.3rem; }
.df-theme-fields > * { width:11rem; }
.df-themed .df-el { font-family:var(--df-font); border-color:var(--df-outline); }
.df-themed .df-el--button { border-radius:var(--df-button-radius); background:var(--df-primary); border-color:var(--df-primary); color:var(--df-on-primary); }
.df-themed .df-el--textfield, .df-themed .df-el--textarea, .df-themed .df-el--select { border-radius:var(--df-field-radius); background:var(--df-surface); }
.df-themed .df-el--panel, .df-themed .df-el--tabs, .df-themed .df-el--accordion { border-radius:var(--df-panel-radius); }
.df-themed .df-choice-popup { border-radius:var(--df-field-radius); border-color:var(--df-outline); }
.df-themed .df-check--on, .df-themed .df-check--mixed { background:var(--df-primary); border-color:var(--df-primary); color:var(--df-on-primary); }
.df-themed .df-check--mixed::after { background:var(--df-on-primary); }
.df-themed .df-radio--on::after, .df-themed .df-progress__fill, .df-themed .df-slider__handle { background:var(--df-primary); }
.df-themed .df-preview-slider { accent-color:var(--df-primary); }
.df-themed .df-state-button:focus-visible, .df-themed .df-element-hotspot:focus-visible { outline-color:var(--df-primary); }
.df-themed .df-preview-input, .df-themed .df-preview-area { color:var(--df-ink); background:transparent; }
.df-themed .df-preview-input:focus-visible, .df-themed .df-preview-area:focus-visible { outline:2px solid var(--df-primary); outline-offset:1px; }
.df-themed .df-button.df-state-button:focus-visible { outline-color:var(--df-on-primary); }

.df-visually-hidden { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.df-skip-links { position:fixed; top:0; left:0; z-index:10000; }
.df-skip-links a { position:absolute; transform:translateY(-150%); white-space:nowrap; padding:12px; background:var(--flare-color-surface,#fff); color:var(--flare-color-on-surface,#111); }
.df-skip-links a:focus { position:relative; display:inline-block; transform:none; outline:3px solid var(--flare-color-primary,#0f6cbd); }
.df-sheet:focus-visible, #df-properties:focus-visible { outline:3px solid var(--flare-color-primary,#0f6cbd); outline-offset:3px; }

.df-canvas-toolbar { position:sticky; top:0; left:0; z-index:100001; display:flex; flex-wrap:wrap; align-items:center; gap:6px; padding:6px; margin-bottom:8px; background:var(--flare-color-surface,#fff); color:var(--flare-color-on-surface,#111); border:1px solid var(--flare-color-outline,#888); }
.df-canvas-toolbar button { min-height:32px; min-width:32px; font:inherit; }
.df-sheet--hand { touch-action:pan-x pan-y pinch-zoom; cursor:grab !important; }
@media (pointer:coarse) {
    .df-handle { width:calc(44px / var(--df-zoom,1)); height:calc(44px / var(--df-zoom,1)); margin:calc(-22px / var(--df-zoom,1)) 0 0 calc(-22px / var(--df-zoom,1)); }
    .df-canvas-toolbar button { min-height:44px; min-width:44px; }
}

/* Application command composition: every group remains reachable on a narrow viewport. */
.df-ribbon > .flare-ribbon__commands { overflow-x:hidden; overflow-y:auto; max-height:min(35vh,18rem); }
.df-ribbon .flare-ribbon__tabpanel { flex:1 1 auto; min-width:0; width:100%; flex-wrap:wrap; align-items:flex-start; }
.df-ribbon .flare-ribbon__group { flex:0 1 auto; min-width:0; max-width:100%; }
.df-ribbon .flare-ribbon__group-content { display:flex; flex-wrap:wrap; align-items:center; gap:4px; min-width:0; }
.df-ribbon .df-projects { flex-wrap:wrap; min-width:0; max-width:100%; }
.df-ribbon .df-projects__name { min-width:0; max-width:100%; }
.df-ribbon .df-theme-fields { flex-wrap:wrap; }
@media(max-width:600px) {
    .df-ribbon-brand { inset-inline-start:8px; font-size:12px; }
    .df-ribbon > .flare-ribbon__tabs { padding-inline-start:108px; flex-wrap:wrap; }
    .df-ribbon .flare-ribbon__group { width:100%; }
}

.df-alternate-panel { display:flex; flex-direction:column; gap:8px; }
.df-alternate { display:flex; flex-wrap:wrap; align-items:center; gap:4px; }
.df-inspector > .flare-accordion { width:100%; }

.df-palette__glyph .df-wire-icon, .df-layers__mark .df-wire-icon { width:18px; height:18px; margin:0; }
.df-palette__grip { display:grid; place-items:center; }
.df-block-list__row button:not(.df-block-list__name), .df-layers__action, .df-document-search__header button { min-width:32px; min-height:32px; display:inline-grid; place-items:center; }
.df-palette__section, .df-ribbon .flare-ribbon__group-label { font-size:12px; }
.df-status { font-size:max(12px,.78rem); }

.df-preview-brand { display:flex; align-items:center; gap:8px; padding:6px 12px; font-weight:600; }
.df-editor--preview .flare-ide-layout__panel--left, .df-editor--preview .flare-ide-layout__panel--right,
.df-editor--preview .flare-ide-layout__rail, .df-editor--preview .flare-ide-layout__resizer { display:none !important; }
.df-layer-notice { display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
.df-editor-host { display:contents; }

.df-ribbon-command { min-width: 32px; min-height: 32px; padding: 6px; gap: 5px; }
.df-ribbon-command svg { flex: 0 0 20px; }
.df-ribbon-command > .flare-button__label { display: inline-flex; align-items: center; gap: 5px; }
.df-ribbon-command__caption { font-size: 12px; white-space: nowrap; }
@media (pointer: coarse) {
    .df-ribbon-command { min-width: 44px; min-height: 44px; }
    .df-inspector .flare-input__field { min-height: 44px; }
    .df-inspector .flare-checkbox { min-height: 44px; }
}
/* Import is modal so edits and a second import cannot race the storage transaction. */
.df-import-backdrop { position:fixed; inset:0; z-index:10000; display:grid; place-items:center; background:rgb(0 0 0 / .35); }
.df-import-progress { width:min(26rem,calc(100vw - 2rem)); box-sizing:border-box; padding:1.5rem; border-radius:var(--flare-radius-lg,8px); color:var(--flare-color-on-surface,#242424); background:var(--flare-color-surface,#fff); box-shadow:0 8px 32px rgb(0 0 0 / .25); outline:none; }
.df-import-progress h2 { margin:0 0 1rem; font-size:1.125rem; }
.df-import-progress progress { width:100%; height:1rem; accent-color:var(--flare-color-primary,#0f6cbd); }
.df-import-progress__hint { margin-bottom:0; font-size:.8125rem; opacity:.75; }

/* Flare owns the themed metric/header; the document owns their bounded geometry. */
.df-el--stat, .df-el--pageheader { border: none; padding: 0; display: block; overflow: hidden; }
.df-summary-native { width: 100%; height: 100%; overflow: hidden; }
.df-summary-native > .flare-stat, .df-summary-native > .flare-page-header { width: 100%; box-sizing: border-box; }
.df-summary-native > .flare-stat { padding: 12px; }
.df-summary-action { position: absolute; left: 12px; top: 104px; width: calc(100% - 24px); height: 32px; border: 0; background: transparent; cursor: pointer; }
.df-summary-action:focus-visible { outline: 2px solid var(--df-ink); }
