/* Base styles of the fortui browser backend. Pages include this in <head>, so
   a page rendered by the server is laid out before any script runs. Colours
   and fonts belong to the page, except the attention tone and the themes an
   application asks for (below). */
.fui-box { display: flex; box-sizing: border-box; min-width: 0; }
.fui-col { flex-direction: column; align-items: flex-start; }
.fui-row { flex-direction: row; align-items: flex-start; }
.fui-row.fui-centred { align-items: center; }
.fui-wrap { flex-wrap: wrap; }
/* Canvases get every finger and pen stroke; the page does not scroll or zoom there. */
canvas[data-id] { touch-action: none; -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none; }
/* The hidden field that opens a phone's keyboard for a canvas (fortui_web.js).
   16px keeps iOS from zooming into it. */
.fui-keys { position: fixed; left: 0; top: 0; width: 1px; height: 1px; opacity: 0;
  border: 0; padding: 0; margin: 0; resize: none; font-size: 16px; caret-color: transparent;
  pointer-events: none; z-index: -1; }
/* A page that is the application: it fills what the on-screen keyboard leaves
   visible, inside the notch and home indicator, and neither bounces nor zooms. */
body.fui-app { margin: 0; height: var(--fui-visible-height, 100dvh); overflow: hidden;
  overscroll-behavior: none; touch-action: manipulation;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom)
    env(safe-area-inset-left); box-sizing: border-box; }
/* A tab bar whose labels do not fit scrolls sideways instead of cutting them. */
.fui-box[data-look="fui-tabs"] { overflow-x: auto; max-width: 100%; scrollbar-width: thin; }
.fui-box[data-look="fui-tabs"] > * { flex-shrink: 0; }
/* Containers span the width available to them, as in fortui's own layout. */
.fui-col > .fui-box { align-self: stretch; }
.fui-root { width: 100%; }
.fui { box-sizing: border-box; margin: 0; font: inherit; line-height: 1.25; min-width: 0; }
.fui-k1 { overflow-wrap: anywhere; }
.fui-k9 { color: inherit; text-decoration: none; }
.fui-k9:hover { text-decoration: underline; }
.fui-k1.fui-ellipsis, .fui-k9.fui-ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fui[data-style="3"], .fui[data-style="4"] { font-weight: 600; }
/* Code keeps its spaces and wraps at the container's edge instead of widening the page. */
.fui[data-style="5"] {
  font-family: ui-monospace, "SF Mono", "DejaVu Sans Mono", Menlo, Consolas, monospace;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.fui-k2, .fui-k5 { white-space: nowrap; }
.fui-k4 { display: inline-flex; align-items: center; gap: 6px; }
.fui-k7 { overflow: auto; white-space: pre-wrap; }
.fui-k8 { min-height: 32px; }
.fui-k10 { resize: none; font: inherit; }
/* Attention (UI_TONE_ATTENTION): a person's turn, amber for the colour scheme
   the page declares (color-scheme), light where it declares none. */
.fui[data-tone="17"], .fui [data-t="17"] { color: #9a6700; color: light-dark(#9a6700, #d29922); }

/* Themes an application asks for (ui_init theme=): data-theme on the root.
   Without one the page keeps its own look. Fonts come from the visitor's system. */
.fui-root[data-theme] { padding: var(--fui-margin); }
.fui-root[data-theme="classic"] {
  --fui-margin: 8px;
  background: #c0c0c0; color: #000;
  font-family: "MS Sans Serif", "Microsoft Sans Serif", Tahoma, Helvetica, Arial, sans-serif;
  font-size: 11px; -webkit-font-smoothing: none; font-smooth: never;
}
.fui-root[data-theme="classic"] .fui-k2,
.fui-root[data-theme="classic"] .fui-k5 {
  background: #c0c0c0; color: #000; border: 0; border-radius: 0; min-height: 23px;
  min-width: 75px; padding: 0 10px; font: inherit;
  box-shadow: inset -1px -1px #000, inset 1px 1px #fff, inset -2px -2px #808080,
    inset 2px 2px #dfdfdf;
}
.fui-root[data-theme="classic"] .fui-k2[data-emphasis="1"],
.fui-root[data-theme="classic"] .fui-k2:focus {
  outline: 1px solid #000; outline-offset: -1px;
  box-shadow: inset -2px -2px #000, inset 2px 2px #fff, inset -3px -3px #808080,
    inset 3px 3px #dfdfdf;
}
.fui-root[data-theme="classic"] .fui-k2:active:not(:disabled) {
  box-shadow: inset 1px 1px #000, inset -1px -1px #000, inset 2px 2px #808080,
    inset -2px -2px #808080;
  padding: 1px 9px 0 11px;
}
.fui-root[data-theme="classic"] .fui-k2[aria-pressed="true"] {
  background: #dfdfdf; padding: 1px 9px 0 11px;
  box-shadow: inset 1px 1px #808080, inset -1px -1px #fff;
}
.fui-root[data-theme="classic"] .fui-k2:disabled { color: #808080; text-shadow: 1px 1px #fff; }
.fui-root[data-theme="classic"] .fui-k5[aria-selected="true"] { margin-top: -2px; min-height: 25px; }
.fui-root[data-theme="classic"] .fui-k8,
.fui-root[data-theme="classic"] .fui-k10,
.fui-root[data-theme="classic"] .fui-k7 {
  background: #fff; color: #000; border: 0; border-radius: 0; padding: 3px 4px; font: inherit;
  box-shadow: inset -1px -1px #fff, inset 1px 1px #808080, inset -2px -2px #dfdfdf,
    inset 2px 2px #000;
}
.fui-root[data-theme="classic"] .fui-k9 { color: #00f; text-decoration: underline; }
.fui-root[data-theme="classic"] .fui-k4 input { accent-color: #000; }
.fui-root[data-theme="classic"] .fui[data-style="5"] {
  font-family: "More Perfect DOS VGA", "Courier New", Courier, monospace; font-size: 16px;
}

.fui-root[data-theme="fluent"], .fui-root[data-theme="fluent-dark"] {
  --fui-margin: 16px;
  --fui-brand: #0f6cbd; --fui-brand-hover: #115ea3; --fui-brand-pressed: #0c3b5e;
  --fui-bg: #f5f5f5; --fui-bg1: #fff; --fui-bg1-hover: #f5f5f5; --fui-bg1-pressed: #e0e0e0;
  --fui-fg1: #242424; --fui-fg3: #616161; --fui-fg-disabled: #bdbdbd;
  --fui-stroke1: #d1d1d1; --fui-stroke1-hover: #c7c7c7; --fui-stroke-accessible: #616161;
  --fui-focus: #000; --fui-link: #115ea3;
  background: var(--fui-bg); color: var(--fui-fg1);
  font-family: "Segoe UI Variable Text", "Segoe UI", Selawik, -apple-system,
    BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;
  font-size: 14px;
}
.fui-root[data-theme="fluent-dark"] {
  --fui-brand: #115ea3; --fui-brand-hover: #0f6cbd; --fui-brand-pressed: #0c3b5e;
  --fui-bg: #1f1f1f; --fui-bg1: #292929; --fui-bg1-hover: #3d3d3d; --fui-bg1-pressed: #1f1f1f;
  --fui-fg1: #fff; --fui-fg3: #adadad; --fui-fg-disabled: #5c5c5c;
  --fui-stroke1: #666; --fui-stroke1-hover: #757575; --fui-stroke-accessible: #adadad;
  --fui-focus: #fff; --fui-link: #479ef5; color-scheme: dark;
}
.fui-root[data-theme^="fluent"] .fui-k2 {
  min-height: 32px; min-width: 96px; padding: 0 12px; border-radius: 4px; font: inherit;
  font-weight: 600; background: var(--fui-bg1); color: var(--fui-fg1);
  border: 1px solid var(--fui-stroke1); cursor: pointer;
}
.fui-root[data-theme^="fluent"] .fui-k2:hover:not(:disabled) {
  background: var(--fui-bg1-hover); border-color: var(--fui-stroke1-hover);
}
.fui-root[data-theme^="fluent"] .fui-k2:active:not(:disabled) { background: var(--fui-bg1-pressed); }
.fui-root[data-theme^="fluent"] .fui-k2[aria-pressed="true"] {
  background: var(--fui-bg1-pressed); border-color: var(--fui-stroke-accessible);
}
.fui-root[data-theme^="fluent"] .fui-k2[data-emphasis="1"] {
  background: var(--fui-brand); color: #fff; border-color: transparent;
}
.fui-root[data-theme^="fluent"] .fui-k2[data-emphasis="1"]:hover:not(:disabled) {
  background: var(--fui-brand-hover);
}
.fui-root[data-theme^="fluent"] .fui-k2[data-emphasis="1"]:active:not(:disabled) {
  background: var(--fui-brand-pressed);
}
.fui-root[data-theme^="fluent"] .fui-k2[data-emphasis="2"] {
  background: transparent; border-color: transparent;
}
.fui-root[data-theme^="fluent"] .fui-k2:disabled {
  color: var(--fui-fg-disabled); background: var(--fui-bg1-hover); border-color: var(--fui-bg1-pressed);
}
.fui-root[data-theme^="fluent"] .fui-k2:focus-visible,
.fui-root[data-theme^="fluent"] .fui-k5:focus-visible {
  outline: 2px solid var(--fui-focus); outline-offset: -2px;
}
.fui-root[data-theme^="fluent"] .fui-k5 {
  min-height: 44px; border: 0; background: transparent; color: var(--fui-fg3); font: inherit;
}
.fui-root[data-theme^="fluent"] .fui-k5[aria-selected="true"] {
  color: var(--fui-fg1); font-weight: 600; box-shadow: inset 0 -3px var(--fui-brand);
}
.fui-root[data-theme^="fluent"] .fui-k8,
.fui-root[data-theme^="fluent"] .fui-k10 {
  min-height: 32px; padding: 0 10px; border: 1px solid var(--fui-stroke1);
  border-bottom-color: var(--fui-stroke-accessible); border-radius: 4px;
  background: var(--fui-bg1); color: inherit; font: inherit;
}
.fui-root[data-theme^="fluent"] .fui-k10 { padding: 6px 10px; }
.fui-root[data-theme^="fluent"] .fui-k8:focus,
.fui-root[data-theme^="fluent"] .fui-k10:focus {
  outline: 0; box-shadow: inset 0 -2px var(--fui-brand);
}
.fui-root[data-theme^="fluent"] .fui-k7 {
  background: var(--fui-bg1); border: 1px solid var(--fui-stroke1); border-radius: 4px;
  padding: 10px;
}
.fui-root[data-theme^="fluent"] .fui-k3,
.fui-root[data-theme^="fluent"] .fui-k4 input { accent-color: var(--fui-brand); }
.fui-root[data-theme^="fluent"] .fui-k9 { color: var(--fui-link); text-decoration: underline; }
.fui-root[data-theme^="fluent"] .fui[data-style="2"] { color: var(--fui-fg3); }
.fui-root[data-theme^="fluent"] .fui[data-style="3"],
.fui-root[data-theme^="fluent"] .fui[data-style="4"] { font-weight: 600; }
.fui-root[data-theme^="fluent"] .fui[data-style="5"] {
  font-family: "Cascadia Mono", Consolas, ui-monospace, Menlo, monospace;
}
/* Semantic tones (UI_TONE_*) in Fluent's status colours, for light and dark. */
.fui-root[data-theme="fluent"] {
  --fui-positive: #107c10; --fui-negative: #c50f1f; --fui-attention: #9a6700;
  --fui-accent: #0f6cbd; --fui-added: #0e700e; --fui-removed: #b10e1c; --fui-hunk: #5c2e91;
  --fui-keyword: #0f6cbd; --fui-string: #a4262c; --fui-comment: #616161; --fui-number: #8a3707;
  --fui-type: #0e7a8b; --fui-preproc: #5c2e91;
}
.fui-root[data-theme="fluent-dark"] {
  --fui-positive: #54b054; --fui-negative: #ee6c76; --fui-attention: #f1c40f;
  --fui-accent: #479ef5; --fui-added: #54b054; --fui-removed: #ee6c76; --fui-hunk: #c5a2f1;
  --fui-keyword: #479ef5; --fui-string: #f1a4a4; --fui-comment: #adadad; --fui-number: #f4b183;
  --fui-type: #5fd3e3; --fui-preproc: #c5a2f1;
}
.fui-root[data-theme^="fluent"] .fui[data-tone="1"], .fui-root[data-theme^="fluent"] .fui [data-t="1"] { color: var(--fui-positive); }
.fui-root[data-theme^="fluent"] .fui[data-tone="2"], .fui-root[data-theme^="fluent"] .fui [data-t="2"] { color: var(--fui-negative); }
.fui-root[data-theme^="fluent"] .fui[data-tone="3"], .fui-root[data-theme^="fluent"] .fui [data-t="3"] { color: var(--fui-fg3); }
.fui-root[data-theme^="fluent"] .fui[data-tone="4"], .fui-root[data-theme^="fluent"] .fui [data-t="4"] { color: var(--fui-accent); }
.fui-root[data-theme^="fluent"] .fui [data-t="5"] { color: var(--fui-keyword); }
.fui-root[data-theme^="fluent"] .fui [data-t="6"] { color: var(--fui-string); }
.fui-root[data-theme^="fluent"] .fui [data-t="7"] { color: var(--fui-comment); }
.fui-root[data-theme^="fluent"] .fui [data-t="8"] { color: var(--fui-number); }
.fui-root[data-theme^="fluent"] .fui [data-t="9"] { color: var(--fui-type); }
.fui-root[data-theme^="fluent"] .fui [data-t="10"] { color: var(--fui-preproc); }
.fui-root[data-theme^="fluent"] .fui[data-tone="11"], .fui-root[data-theme^="fluent"] .fui [data-t="11"] { color: var(--fui-added); }
.fui-root[data-theme^="fluent"] .fui[data-tone="12"], .fui-root[data-theme^="fluent"] .fui [data-t="12"] { color: var(--fui-removed); }
.fui-root[data-theme^="fluent"] .fui[data-tone="13"], .fui-root[data-theme^="fluent"] .fui [data-t="13"] { color: var(--fui-hunk); }
.fui-root[data-theme^="fluent"] .fui[data-tone="17"], .fui-root[data-theme^="fluent"] .fui [data-t="17"] { color: var(--fui-attention); }
/* The whole page takes the theme's background, also around and below the root. */
html:has(.fui-root[data-theme="fluent"]) { background: #f5f5f5; color-scheme: light; }
html:has(.fui-root[data-theme="fluent-dark"]) { background: #1f1f1f; color-scheme: dark; }
.fui-root[data-theme^="fluent"] canvas[data-id] { border-radius: 4px; }

.fui-k11 { min-height: 96px; overflow: auto; background: var(--fui-field, Canvas); color: var(--fui-text, CanvasText); border: 1px solid GrayText; padding: 4px; }
.fui-k11 option { padding: 4px 8px; }

.fui-box[role="dialog"] { width: min(880px, 100%); align-self: center; padding: 16px; box-sizing: border-box; border: 1px solid GrayText; border-radius: 8px; box-shadow: 0 8px 32px #0003; }
/* A modal dialog of the application floats over the dimmed page. */
.fui-box[role="dialog"][aria-label]:not([aria-label="Open file"]) {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 30;
  max-height: calc(100vh - 32px); overflow: auto; background: var(--fui-bg1, Canvas);
  box-shadow: 0 0 0 100vmax #0006, 0 8px 32px #0005; gap: 12px;
}

/* Symbols: strokes in the text colour. */
.fui-icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor;
  stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.fui-k13 { display: inline-flex; flex: none; }
.fui-k13 .fui-icon { width: 100%; height: 100%; }
.fui-k2:has(.fui-icon), .fui-k12 { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.fui-root .fui-k2:has(.fui-icon):not(:has(span)) { min-width: 0; padding: 0; aspect-ratio: 1; }
/* Chips and badges: short labels in a pill. */
.fui-k12 { border-radius: 999px; padding: 0 0.85em; min-height: 1.6em; white-space: nowrap; font: inherit;
  background: color-mix(in srgb, currentColor 12%, transparent); border: 0; }
button.fui-k12 { min-height: 28px; padding: 0 12px; background: transparent; color: inherit;
  border: 1px solid var(--fui-stroke1, GrayText); cursor: pointer; font-weight: 600; }
button.fui-k12:hover { background: var(--fui-bg1-hover, #8881); }
button.fui-k12[aria-pressed="true"] { background: color-mix(in srgb, var(--fui-brand, Highlight) 18%, transparent);
  border-color: var(--fui-brand, Highlight); }
.fui-k12[data-style="2"] { font-size: 12px; }
.fui-k12[data-look="fui-avatar"] { padding: 0; width: 26px; height: 26px; min-height: 0; border-radius: 50%;
  justify-content: center; color: #fff; font-weight: 600; letter-spacing: 0.02em; }
/* A drop-down: the platform's own picker. */
.fui-k14 { font: inherit; padding: 0 8px; border-radius: 4px; border: 1px solid var(--fui-stroke1, GrayText);
  border-bottom-color: var(--fui-stroke-accessible, GrayText); background: var(--fui-bg1, Field); color: inherit; }
/* Segmented choices: joined buttons. */
.fui-box[data-look="fui-segmented"] > .fui-k2 { border-radius: 0; min-width: 0; margin-left: -1px; }
.fui-box[data-look="fui-segmented"] > .fui-k2:first-child { border-radius: 4px 0 0 4px; margin-left: 0; }
.fui-box[data-look="fui-segmented"] > .fui-k2:last-child { border-radius: 0 4px 4px 0; }
/* Scroll containers keep the page still and scroll themselves. */
.fui-scroll { overflow-y: auto; overscroll-behavior: contain; box-sizing: border-box; scrollbar-width: thin;
  align-self: stretch; flex: none; }
.fui-scroll > * { flex: none; }
/* Space of the rows a virtual list does not compose, before and after them. */
.fui-scroll::before, .fui-scroll::after { content: ""; display: block; flex: none; }
.fui-scroll::before { height: var(--fui-before, 0); }
.fui-scroll::after { height: var(--fui-after, 0); }
/* Popups float below what opened them; notifications at the bottom of the window. */
.fui-box[data-look="fui-anchor"] { position: relative; align-self: auto; }
.fui-popup { position: absolute; top: calc(100% + 2px); left: 0; z-index: 20; min-width: 100%;
  padding: 4px; background: var(--fui-bg1, Canvas); border: 1px solid var(--fui-stroke1, GrayText);
  border-radius: 6px; box-shadow: 0 8px 24px #0003; }
.fui-root .fui-popup > .fui-k2 { justify-content: flex-start; text-align: left; min-width: 0; }
.fui-toasts { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 40;
  width: min(440px, calc(100vw - 32px)); gap: 8px; }
.fui-box[data-look="fui-toast"] { align-items: center; padding: 6px 6px 6px 12px; border-radius: 8px;
  background: var(--fui-fg1, CanvasText); color: var(--fui-bg1, Canvas); box-shadow: 0 8px 24px #0004; }
.fui-root .fui-box[data-look="fui-toast"] > .fui-k2 { color: inherit; background: transparent; border-color: transparent; }
/* The data grid: headings and cells start at the same edge; the selected row is tinted. */
.fui-box[data-look="fui-grid"] { overflow-x: auto; max-width: 100%; scrollbar-width: thin; }
.fui-box[data-look="fui-grid"] > * { min-width: max-content; }
.fui-box[data-look="fui-grid-head"] { border-bottom: 1px solid var(--fui-stroke1, GrayText); }
.fui-root .fui-k2[data-look="fui-grid-head"], .fui-root .fui-k2[data-look="fui-grid-cell"] { justify-content: flex-start;
  text-align: left; min-width: 0; padding: 0 8px; overflow: hidden; text-overflow: ellipsis; }
.fui-root .fui-k2[data-look="fui-grid-cell"] { font-weight: 400; }
.fui-k1[data-look="fui-grid-cell"] { padding: 0 8px; align-self: center; }
.fui-box[data-look="fui-grid-row"], .fui-box[data-look="fui-grid-row-selected"] { align-items: center;
  border-bottom: 1px solid color-mix(in srgb, currentColor 8%, transparent); }
.fui-box[data-look="fui-grid-row-selected"] { background: color-mix(in srgb, var(--fui-brand, Highlight) 14%, transparent); }
