/* syad_kit.ui_kit — mobile-first, quiet forms with one strong control: the plus button. */
/* ---------------------------------------------------------------- 1.7.0 fonts, kept in this module
   (static/fonts/, see fonts/VENDOR.md): Inter for text, Space Grotesk for headings. Latin and the
   rest of each font's letters, as released. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/InterVariable.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 300 700; font-display: swap; src: url("fonts/SpaceGrotesk-wght.woff2") format("woff2"); }

/* ---------------------------------------------------------------- shared theme (1.1.0; colours 1.7.0)
   Every app has the same look; only --ui-accent (and --ui-accent-text) change per app type.
   Dark by default; light when the phone is in light mode. data-theme="dark" or "light" on
   <html> forces one (the theme_switch macro sets it). */
:root {
  /* colors: dark (1.7.0) */
  --ui-bg:       #0f0f13;
  --ui-surface:  #17171e;
  --ui-surface2: #1e1e28;
  --ui-hover:    #252530;
  --ui-active:   #2c2c3a;
  --ui-border:   #2a2a38;   /* for the rare place that needs a line; nothing has one by default */
  --ui-text:     #f0f0f5;
  --ui-dim:      #9898b0;
  --ui-faint:    #9292aa;   /* labels, hints, placeholders */
  --ui-backdrop: rgba(0,0,0,0.75);

  /* status colors (same in every app) */
  --ui-ok:         #16a34a;
  --ui-warn:       #d4a017;
  --ui-danger:     #f26868;
  --ui-ok-dim:     color-mix(in srgb, var(--ui-ok) 15%, transparent);
  --ui-warn-dim:   color-mix(in srgb, var(--ui-warn) 15%, transparent);
  --ui-danger-dim: color-mix(in srgb, var(--ui-danger) 15%, transparent);

  /* text */
  --ui-font:         "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ui-font-display: "Space Grotesk", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;   /* headings */
  --ui-text-xs: 15px;
  --ui-text-sm: 17px;   /* body text */
  --ui-text-md: 20px;
  --ui-text-lg: 26px;

  /* phone edges */
  --ui-safe-top:    env(safe-area-inset-top, 0px);
  --ui-safe-bottom: env(safe-area-inset-bottom, 0px);

  /* accent: each app sets --ui-accent and --ui-accent-text; the rest follows */
  --ui-accent:       #0d9488;
  --ui-accent-text:  #111;
  --ui-accent-dim:   color-mix(in srgb, var(--ui-accent) 13%, transparent);
  --ui-accent-hover: color-mix(in srgb, var(--ui-accent) 80%, white);
  --ui-accent-link:  color-mix(in srgb, var(--ui-accent) 60%, white);   /* 1.7.0: 60% (75% before), so it reads on every layer */
  --ui-glow: 0 0 4px  color-mix(in srgb, var(--ui-accent) 75%, transparent),
             0 0 12px color-mix(in srgb, var(--ui-accent) 45%, transparent);

  /* shapes */
  --ui-radius: 10px;
  --ui-radius-sm: 6px;    /* small elements */
  --ui-radius-lg: 16px;   /* modals and sheets */
  --ui-tap: 48px;

  /* 1.0.0 names, kept so modules built on ui-kit 1.0.0 keep working. Remove in 2.0.0. */
  --ui-ink:         var(--ui-text);
  --ui-muted:       var(--ui-dim);
  --ui-line:        var(--ui-border);
  --ui-error:       var(--ui-danger);
  --ui-accent-soft: var(--ui-accent-dim);
  --ui-accent-ink:  var(--ui-accent-text);   /* its 1.0.0 meaning: text on a filled accent */
  --ui-warn-bg:     var(--ui-warn-dim);
  --ui-warn-ink:    var(--ui-text);          /* text on the warn tint */
  color-scheme: dark;
}

/* light: when the phone is in light mode (unless forced dark), or forced light */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --ui-bg:       #f4f4f7;
    --ui-surface:  #ffffff;
    --ui-surface2: #ececf1;
    --ui-hover:    #e4e4ea;
    --ui-active:   #dcdce4;
    --ui-border:   #dcdce4;
    --ui-text:     #15151c;
    --ui-dim:      #4b4b5e;
    --ui-faint:    #5f5f73;
    --ui-danger:   #be1c1c;
    --ui-backdrop: rgba(15,15,19,0.45);
    --ui-accent-link: color-mix(in srgb, var(--ui-accent) 52%, black);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --ui-bg:       #f4f4f7;
  --ui-surface:  #ffffff;
  --ui-surface2: #ececf1;
  --ui-hover:    #e4e4ea;
  --ui-active:   #dcdce4;
  --ui-border:   #dcdce4;
  --ui-text:     #15151c;
  --ui-dim:      #4b4b5e;
  --ui-faint:    #5f5f73;
  --ui-danger:   #be1c1c;
  --ui-backdrop: rgba(15,15,19,0.45);
  --ui-accent-link: color-mix(in srgb, var(--ui-accent) 52%, black);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }   /* no shift when a scrollbar appears */
body {
  margin: 0; background: var(--ui-bg); color: var(--ui-text);
  font: var(--ui-text-sm)/1.5 var(--ui-font); padding-bottom: calc(110px + var(--ui-safe-bottom));
}
html { background: var(--ui-bg); }
a { color: var(--ui-accent-link); }
/* No outline or tap flash when tapping or clicking; the outline shows only when
   moving around with the keyboard (ui-kit.js sets ui-keyboard on <html> then). */
html { -webkit-tap-highlight-color: transparent; }
:focus, :focus-visible { outline: none; }
html.ui-keyboard :focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 2px; box-shadow: var(--ui-glow); }

.ui-header {
  padding: calc(14px + env(safe-area-inset-top, 0px)) 18px 10px;
  max-width: 720px; margin: 0 auto;
}
.ui-header h1 { font-size: var(--ui-text-lg); line-height: 1.2; margin: 0; font-weight: 650; letter-spacing: -0.01em; }
.ui-header .ui-sub { margin: 4px 0 0; color: var(--ui-dim); font-size: 0.95rem; }
.ui-back { display: inline-flex; align-items: center; min-height: 40px; color: var(--ui-dim); text-decoration: none; font-size: 0.95rem; }
.ui-main { max-width: 720px; margin: 0 auto; padding: 0 18px; }
.ui-group { margin: 22px 0 0; }
.ui-group__title { font-size: 0.95rem; font-weight: 600; color: var(--ui-dim); margin: 0 0 6px; }
.ui-muted { color: var(--ui-dim); }

/* One-line items */
/* No lines anywhere: like a sheet of paper, space keeps things apart. */
.ui-list { border: 0; }
.ui-line { border: 0; }
.ui-line + .ui-line { margin-top: 2px; }
.ui-line__tap {
  display: grid; grid-template-columns: 1fr auto; gap: 0 12px; align-items: baseline;
  width: 100%; min-height: 64px; padding: 14px 2px; text-align: left;
  background: none; border: 0; color: inherit; font: inherit; cursor: pointer;
}
.ui-line__title { font-weight: 600; grid-column: 1; }
.ui-line__summary { grid-column: 1 / -1; color: var(--ui-dim); font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui-line__meta { grid-column: 2; grid-row: 1; color: var(--ui-dim); font-size: 0.85rem; }
.ui-line--open { background: var(--ui-surface); margin: 0 -18px; padding: 0 18px; }
.ui-line--open > .ui-line__tap { min-height: 52px; }
.ui-line--section .ui-line__title { font-weight: 600; }
.ui-details { padding: 0 0 16px; }
.ui-dl { margin: 0; }
.ui-dl__row { display: grid; grid-template-columns: minmax(110px, 40%) 1fr; gap: 12px; padding: 7px 0; }
.ui-dl__row:first-child { border-top: 0; }
.ui-dl dt { color: var(--ui-dim); font-size: 0.95rem; }
.ui-dl dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }

/* Buttons */
.ui-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; margin-top: 12px; }
/* Flat, quiet buttons: text in the accent colour, a soft tint only for the main action. */
.ui-btn {
  min-height: 40px; padding: 0 14px; border-radius: 8px; border: 0; background: transparent;
  color: var(--ui-accent-link); font: inherit; font-size: 0.95rem; font-weight: 600; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
.ui-btn:hover { background: var(--ui-accent-dim); }
.ui-btn--primary { background: var(--ui-accent-dim); }
.ui-btn--quiet { color: var(--ui-dim); }
.ui-btn--danger { color: var(--ui-danger); }
.ui-btn:disabled { opacity: 0.55; cursor: progress; }

/* Plus button and add menu */
.ui-add { position: fixed; right: max(18px, env(safe-area-inset-right, 0px)); bottom: calc(22px + env(safe-area-inset-bottom, 0px)); z-index: 20; }
.ui-add__button {
  list-style: none; width: 64px; height: 64px; border-radius: 50%;
  background: var(--ui-accent); color: var(--ui-accent-text);
  display: grid; place-items: center; cursor: pointer;
  font-size: 2.4rem; font-weight: 300; line-height: 1;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--ui-accent) 35%, transparent);
}
.ui-add__button::-webkit-details-marker { display: none; }
.ui-add[open] .ui-add__button span { transform: rotate(45deg); }
.ui-add__button span { display: block; transition: transform 0.15s ease; margin-top: -4px; }
.ui-add__sheet {
  position: absolute; right: 0; bottom: 76px; width: min(320px, calc(100vw / var(--ui-zoom, 1) - 36px));
  background: var(--ui-surface); border-radius: 14px;
  padding: 8px; box-shadow: 0 12px 32px color-mix(in srgb, black 35%, transparent);
  max-height: calc(70 * var(--ui-vh)); overflow-y: auto;
}
.ui-add__title { margin: 6px 10px 4px; color: var(--ui-dim); font-size: 0.9rem; }
.ui-add__group { margin: 10px 10px 2px; color: var(--ui-dim); font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.ui-add__option {
  display: block; width: 100%; min-height: 52px; padding: 0 12px; text-align: left;
  background: none; border: 0; border-radius: 8px; color: inherit; font: inherit; font-weight: 500; cursor: pointer;
}
.ui-add__option:hover, .ui-add__option:focus-visible { background: var(--ui-accent-dim); }
/* Items sit indented under their group heading */
.ui-add__group ~ .ui-add__option { margin-left: 12px; width: calc(100% - 12px); }
/* Search: stays at the top while the list scrolls (about 12 items show) */
.ui-add__sheet:has(.ui-add__search) { max-height: min(calc(70 * var(--ui-vh)), 720px); }
.ui-add__search { position: sticky; top: -8px; z-index: 1; display: block; width: 100%; min-height: 44px; margin: 0 0 6px;
                  padding: 0 12px; border: 1px solid transparent; border-radius: 8px; background: var(--ui-surface2);
                  color: var(--ui-text); font: inherit; box-shadow: 0 -8px 0 var(--ui-surface); }
.ui-add__option[hidden], .ui-add__group[hidden] { display: none; }
.ui-add__none { margin: 8px 12px; color: var(--ui-dim); font-size: 0.95rem; }
@media (prefers-reduced-motion: reduce) { .ui-add__button span { transition: none; } }

/* Forms (also styles syad_kit.dynamic_forms fields) */
.ui-form { background: var(--ui-surface); margin: 0 -18px; padding: 16px 18px 20px; border-radius: var(--ui-radius); }
.ui-form__title { margin: 0 0 12px; font-size: 1.1rem; font-weight: 650; }
.df-field, .ui-field { margin: 0 0 14px; }
.df-label, .ui-label { display: block; font-weight: 500; margin: 0 0 4px; }
.df-req { color: var(--ui-danger); }
.df-input, .ui-input {
  width: 100%; min-height: var(--ui-tap); padding: 10px 12px; border-radius: 8px;
  border: 1px solid transparent; background: var(--ui-surface2); color: var(--ui-text); font: inherit;
}
.df-textarea { min-height: 96px; resize: vertical; }
.df-input[aria-invalid="true"] { border-color: var(--ui-danger); }
.df-error, .ui-error { color: var(--ui-danger); margin: 4px 0 0; font-size: 0.95rem; }
.df-yesno { display: flex; flex-wrap: wrap; gap: 8px; }
.df-pill { position: relative; }
.df-pill input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.df-pill span {
  display: inline-flex; align-items: center; min-height: var(--ui-tap); padding: 0 18px;
  border: 1px solid transparent; border-radius: 999px; background: var(--ui-surface2);
}
.df-pill input:checked + span { background: var(--ui-accent); border-color: var(--ui-accent); color: var(--ui-accent-text); font-weight: 600; }
html.ui-keyboard .df-pill input:focus-visible + span { outline: 2px solid var(--ui-accent); outline-offset: 2px; box-shadow: var(--ui-glow); }
.df-pill--quiet span { color: var(--ui-dim); }

/* Forms laid out like the read-only details: label on the left, value on the right,
   rows spaced apart (no lines between them). Add ui-form--rows to the form. */
.ui-form--rows { margin: 0 -12px; padding: 0 12px 10px; }
.ui-form--rows input[type="checkbox"] { width: 22px; height: 22px; margin: 0; justify-self: start; accent-color: var(--ui-accent); }
.ui-form--rows .ui-value { overflow-wrap: anywhere; }
.ui-actions__start { margin-right: auto; display: flex; gap: 0; }
.ui-actions__start .ui-btn { padding: 0 8px; }
.ui-form--rows .ui-actions { flex-wrap: nowrap; gap: 0; }
.ui-form--rows .ui-actions .ui-btn { padding: 0 10px; white-space: nowrap; }
.ui-form--rows .ui-form__title { margin: 0; padding: 14px 0 8px; font-size: 1rem; font-weight: 600; }
.ui-form--rows .df-field, .ui-form--rows .ui-field {
  display: grid; grid-template-columns: minmax(110px, 40%) 1fr; gap: 0 12px; align-items: center;
  margin: 0; padding: 3px 0; min-height: 44px;
}
.ui-form--rows .df-field:has(textarea) { align-items: start; }
.ui-form--rows .df-field:has(textarea) .df-label { padding-top: 7px; }
.ui-form--rows .df-label, .ui-form--rows .ui-label { margin: 0; font-weight: 400; color: var(--ui-dim); font-size: 0.95rem; }
.ui-form--rows .df-input, .ui-form--rows .ui-input {
  /* Text lines up with where the value sits in the details view. */
  width: calc(100% + 8px); min-height: 38px; margin-left: -8px; padding: 6px 8px;
  border: 1px solid transparent; border-radius: 6px; background: var(--ui-surface2);
}
html.ui-keyboard .ui-form--rows .df-input:focus, html.ui-keyboard .ui-form--rows .ui-input:focus { border-color: var(--ui-accent); }
.ui-form--rows .df-input[aria-invalid="true"] { border-color: var(--ui-danger); }
.ui-form--rows .df-textarea { min-height: 72px; }
.ui-form--rows .df-error { grid-column: 2; margin: 2px 0 4px; font-size: 0.9rem; }
.ui-form--rows > .ui-error { margin: 0 0 8px; }

/* 1.4.0 Stacked form with the same live behaviour: add ui-form--stacked to a form to keep the
   normal layout (label above the field) and get what ui-form--rows forms get besides their
   side-by-side look: empty-row marking, and the read-only view inside fieldset.ui-editable
   (Edit switch off: values as text, empty rows hidden). Nothing else changes for the form. */
.ui-form--stacked .ui-value { overflow-wrap: anywhere; }

/* 1.5.0 Viewing a ui-form--stacked form (Edit switch off, fieldset.ui-editable disabled): each row
   reads like a .ui-dl row, the label on the left in the dim colour and the value on the right;
   empty rows stay hidden. With the Edit switch on it stays stacked (label above a full-width field). */
.ui-form--stacked fieldset.ui-editable:disabled .df-field:not([data-empty]):not(.ui-edit-only),
.ui-form--stacked fieldset.ui-editable:disabled .ui-field:not([data-empty]):not(.ui-edit-only) {
  display: grid; grid-template-columns: minmax(110px, 40%) 1fr; gap: 12px; align-items: start;
  margin: 0; padding: 7px 0; min-height: 0;
}
.ui-form--stacked fieldset.ui-editable:disabled .df-label,
.ui-form--stacked fieldset.ui-editable:disabled .ui-label {
  margin: 0; padding: 0; color: var(--ui-dim); font-size: 0.95rem; font-weight: 400;
}
.ui-form--stacked fieldset.ui-editable:disabled .df-req { display: none; }
.ui-form--stacked fieldset.ui-editable:disabled .ui-readout {
  grid-column: 2; margin: 0; padding: 0; white-space: pre-line; overflow-wrap: anywhere;
}

/* Notices and empty states */
.ui-notice { margin: 14px 0 0; padding: 12px 14px; border-radius: var(--ui-radius); font-weight: 500; }
.ui-notice--warn { background: var(--ui-warn-dim); color: var(--ui-text); }
.ui-notice--error { background: var(--ui-danger-dim); color: var(--ui-text); }
.ui-empty { color: var(--ui-dim); padding: 18px 0; margin: 0; }

/* ---------------------------------------------------------------- 1.1.0 */
/* Edit switch */
.ui-switch { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0; border: 0; background: none;
             color: var(--ui-text); font: inherit; font-size: 0.95rem; font-weight: 600; cursor: pointer; }
.ui-switch__track { position: relative; width: 44px; height: 26px; border-radius: 13px; background: var(--ui-surface2); transition: background 0.15s; }
.ui-switch__thumb { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--ui-dim);
                    box-shadow: 0 1px 3px color-mix(in srgb, black 30%, transparent); transition: transform 0.15s; }
.ui-switch[aria-checked="true"] .ui-switch__track { background: var(--ui-accent); }
.ui-switch[aria-checked="true"] .ui-switch__thumb { transform: translateX(18px); background: var(--ui-accent-text); }
@media (prefers-reduced-motion: reduce) { .ui-switch__track, .ui-switch__thumb { transition: none; } }

/* Caret that opens a section */
.ui-caret { flex: none; width: 44px; height: 44px; margin-right: -10px; border: 0; background: none; cursor: pointer;
            color: var(--ui-dim); display: inline-grid; place-items: center; border-radius: 8px; }
.ui-caret::before { content: ""; width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
                    transform: rotate(45deg) translate(-2px, -2px); transition: transform 0.15s; }
.ui-caret[aria-expanded="true"]::before { transform: rotate(-135deg) translate(-2px, -2px); }
.ui-caret:hover { background: var(--ui-accent-dim); color: var(--ui-text); }

/* Read-only: fields in a disabled fieldset look like plain text, empty rows hide */
fieldset.ui-editable { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.ui-editable:disabled .df-input, fieldset.ui-editable:disabled .ui-input {
  background: transparent; border-color: transparent; color: var(--ui-text); -webkit-text-fill-color: var(--ui-text);
  opacity: 1; appearance: none; -webkit-appearance: none; resize: none; cursor: default;
}
fieldset.ui-editable:disabled input[type="date"]::-webkit-calendar-picker-indicator { display: none; }
fieldset.ui-editable:disabled .df-req { display: none; }
fieldset.ui-editable:disabled .df-field[data-empty], fieldset.ui-editable:disabled .ui-field[data-empty] { display: none; }
fieldset.ui-editable:disabled .ui-edit-only { display: none; }
.ui-readout { display: none; }
fieldset.ui-editable:disabled .ui-readout { display: block; white-space: pre-wrap; overflow-wrap: anywhere; padding: 6px 0; }
fieldset.ui-editable:disabled .df-input, fieldset.ui-editable:disabled .ui-input { display: none; }

/* Theme switch: three choices side by side */
.ui-segmented { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--ui-surface2); }
.ui-segmented__opt { min-height: 36px; padding: 0 14px; border: 0; border-radius: 8px; background: none; cursor: pointer;
                     color: var(--ui-dim); font: inherit; font-size: 0.95rem; font-weight: 600; }
.ui-segmented__opt[aria-pressed="true"] { background: var(--ui-accent-dim); color: var(--ui-accent-link); }
.ui-theme { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 24px 0 0; }

/* ---------------------------------------------------------------- 1.2.0 text size
   The whole page scales together (text, buttons, tap targets, spacing) and reflows into the
   screen's width. Normal sets nothing. */
html[data-text-size="large"]   { --ui-zoom: 1.15; }
html[data-text-size="larger"]  { --ui-zoom: 1.3; }
html[data-text-size="largest"] { --ui-zoom: 1.5; }
html[data-text-size="large"] body   { zoom: 1.15; }
html[data-text-size="larger"] body  { zoom: 1.3; }
html[data-text-size="largest"] body { zoom: 1.5; }
/* Inside the zoomed page a viewport width (vw) is zoomed too, so anything sized from the screen's
   width divides it by --ui-zoom: calc(100vw / var(--ui-zoom, 1) - 36px). */
/* ui-kit 1.9.0, ui-kit-express 1.4.0: a viewport height (vh, dvh) is zoomed too, so anything as
   tall as the screen comes out 1.15 to 1.5 times the screen at the bigger text sizes. Use these
   instead of Nvh, 100vh or 100dvh; each is right at every text size and the same at Normal:
     --ui-vh        one hundredth of the screen's height (in place of 1vh: calc(70 * var(--ui-vh)))
     --ui-dvh       the same from the dynamic height, which allows for a phone's address bar (1dvh;
                    1vh where the browser has no dvh)
     --ui-screen-h  the whole screen's dynamic height (in place of 100dvh) */
:root {
  --ui-vh: calc(1vh / var(--ui-zoom, 1));
  --ui-dvh: calc(1vh / var(--ui-zoom, 1));
  --ui-screen-h: calc(100vh / var(--ui-zoom, 1));
}
@supports (height: 1dvh) {
  :root { --ui-dvh: calc(1dvh / var(--ui-zoom, 1)); --ui-screen-h: calc(100dvh / var(--ui-zoom, 1)); }
}
/* Rows that fit at Normal may not at bigger sizes: let them wrap instead of running off the side
   (at Normal nothing wraps that didn't before). */
.ui-theme { flex-wrap: wrap; }
.ui-segmented { flex-wrap: wrap; max-width: 100%; }
.ui-text-size { margin: 16px 0 0; display: grid; gap: 6px; }
.ui-text-size__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.ui-text-size__value { color: var(--ui-dim); font-weight: 600; }
.ui-text-size__slider { width: 100%; min-height: var(--ui-tap); margin: 0; accent-color: var(--ui-accent); }

/* ---------------------------------------------------------------- 1.3.0 search box
   The same box on every list, right under the tabs; a toggle may sit beside it. */
.ui-search { margin: 4px 0 10px; }
.ui-search__input { width: 100%; }
.ui-search--row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.ui-search--row .ui-search__input { flex: 1 1 12em; width: auto; min-width: 0; }
.ui-search__toggle { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer;
                     font-size: 0.95rem; font-weight: 600; color: var(--ui-text); }
.ui-search__toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ui-search__toggle input:checked + .ui-switch__track { background: var(--ui-accent); }
.ui-search__toggle input:checked + .ui-switch__track .ui-switch__thumb { transform: translateX(18px); background: var(--ui-accent-text); }
.ui-search__toggle input:focus-visible + .ui-switch__track { outline: 2px solid var(--ui-accent); outline-offset: 2px; }

/* ---------------------------------------------------------------- 1.7.0 the new theme
   Headings in the display font; labels and hints in the faint colour; no lines anywhere except
   one: a 1px outline in the accent-coloured text colour on the field being typed in. */
h1, h2, h3, .ui-header h1, .ui-form__title { font-family: var(--ui-font-display); letter-spacing: -0.01em; }
::placeholder { color: var(--ui-faint); opacity: 1; }
.df-input:focus, .ui-input:focus, .ui-add__search:focus, .ui-form--rows .df-input:focus, .ui-form--rows .ui-input:focus { border-color: var(--ui-accent-link); }
.df-input[aria-invalid="true"]:focus { border-color: var(--ui-danger); }

/* Header line (macro header_bar): an optional back arrow at the far left, the title, and an
   optional icon button at the far right. Both are tap-sized and have spoken labels. */
.ui-header__bar { display: flex; align-items: center; gap: 4px; min-height: var(--ui-tap); }
.ui-header__bar h1 { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.ui-header__back, .ui-header__action {
  flex: none; width: var(--ui-tap); height: var(--ui-tap); display: inline-grid; place-items: center;
  border: 0; border-radius: var(--ui-radius); background: none; color: var(--ui-text); text-decoration: none; cursor: pointer;
}
.ui-header__back { margin-left: -12px; }
.ui-header__action { margin-right: -12px; color: var(--ui-accent-link); }
.ui-header__back:hover, .ui-header__action:hover { background: var(--ui-hover); }
.ui-header__back svg, .ui-header__action svg { width: 28px; height: 28px; }

/* 1.10.0 (ui-kit-express 1.5.0) Header search (header_bar's search option): the back arrow, a search
   box filling the rest of the line (it shrinks on a narrow screen), then the action button. It is
   the list search box (ui-search) without its outer space. The title stays the page's h1 for screen
   readers, hidden with ui-visually-hidden, which hides anything from sight but not from screen readers. */
.ui-header__search { flex: 1 1 0; min-width: 0; margin: 0; }
.ui-header__search .ui-search__input { display: block; width: 100%; min-width: 0; }
/* ui-kit 1.11.0, ui-kit-express 1.5.1: a box too narrow to read moves to its own line. When the
   header line would leave the box less than room for about 12 characters (12ch of its text plus
   its padding and edges, 26px), the box takes a full-width line under the buttons: the back arrow
   and house stay at the left of the top line and the action at its right. The bar is a size
   container, so this follows the bar's own width, which is right at every text size (the zoomed
   page). Each threshold is that minimum plus what the top line holds: an arrow or a house alone
   40px (48 less the 12 it pulls left, and the 4px gap), both 92px, the action 40px. Only the order
   on screen changes; screen readers and the keyboard still go back, house, box, action. */
.ui-header__bar:has(> .ui-header__search) { container: ui-header-bar / inline-size; flex-wrap: wrap; }
@container ui-header-bar (width < calc(12ch + 66px)) {
  .ui-header__search:not(.ui-header__back ~ *):has(~ .ui-header__action),
  .ui-header__back ~ .ui-header__search:not(.ui-header__back ~ .ui-header__back ~ *, :has(~ .ui-header__action)) { order: 1; flex-basis: 100%; }
  .ui-header__search:not(.ui-header__back ~ *) ~ .ui-header__action { margin-left: auto; }
}
@container ui-header-bar (width < calc(12ch + 106px)) {
  .ui-header__back ~ .ui-header__search:not(.ui-header__back ~ .ui-header__back ~ *):has(~ .ui-header__action) { order: 1; flex-basis: 100%; }
  .ui-header__back ~ .ui-header__search:not(.ui-header__back ~ .ui-header__back ~ *) ~ .ui-header__action { margin-left: auto; }
}
@container ui-header-bar (width < calc(12ch + 118px)) {
  .ui-header__back ~ .ui-header__back ~ .ui-header__search:not(:has(~ .ui-header__action)) { order: 1; flex-basis: 100%; }
}
@container ui-header-bar (width < calc(12ch + 158px)) {
  .ui-header__back ~ .ui-header__back ~ .ui-header__search:has(~ .ui-header__action) { order: 1; flex-basis: 100%; }
  .ui-header__back ~ .ui-header__back ~ .ui-header__search ~ .ui-header__action { margin-left: auto; }
}
/* search.title "below": the title is the page's h1, seen, on its own line under the header line. It
   keeps the header title's look (.ui-header h1) and wraps the same way; only a small gap above it. */
.ui-header__bar + .ui-header__title { margin: 4px 0 0; overflow-wrap: anywhere; }
.ui-visually-hidden {
  position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important;
  padding: 0 !important; border: 0 !important; overflow: hidden !important; white-space: nowrap !important;
  clip: rect(0 0 0 0) !important; clip-path: inset(50%) !important;
}

/* 1.12.0 (ui-kit-express 1.6.0) Settings screen (macro settings_screen), the same in every app. The
   top line: the signed-in person's name at the far left, Sign out at the far right; a long name wraps
   beside the button, and only when the name would get less than 6em does the button move under it, at the
   right. Then the theme and text size controls as everywhere, the app's own settings, and the app's
   name and version at the bottom. The buttons are the kit's usual size, as everywhere else. */
.ui-settings__account { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-height: var(--ui-tap); }
.ui-settings__user { flex: 1 1 0; min-width: 6em; font-weight: 600; overflow-wrap: anywhere; }
.ui-settings__sign-out { flex: none; margin: 0 0 0 auto; }
.ui-settings__app { margin: 24px 0 0; }
.ui-settings__about { margin: 32px 0 0; color: var(--ui-dim); font-size: 0.95rem; overflow-wrap: anywhere; }

/* 1.8.0 A row that scrolls sideways when its items don't fit, for example tabs: add ui-scroll-row
   to the row (<nav class="app-tabs ui-scroll-row">). One line; the items keep their own size and
   text (they never shrink or wrap) and stay at least the tap size tall; no scrollbar; a soft fade
   on each side that has more. ui-kit.js sets data-more ("start", "end" or "both") and keeps the
   current item (aria-current or aria-selected) and the focused one in view. When everything fits,
   nothing changes: no fade, no scrolling. */
.ui-scroll-row {
  display: flex; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; min-width: 0; max-width: 100%;
  overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.ui-scroll-row::-webkit-scrollbar { display: none; }
.ui-scroll-row.ui-scroll-row > * { flex-shrink: 0; white-space: nowrap; }
.ui-scroll-row.ui-scroll-row > a, .ui-scroll-row.ui-scroll-row > button { min-height: var(--ui-tap, 48px); }
/* The fades are masks: only how opaque each stop is counts, so "black" here is never a visible colour. */
.ui-scroll-row[data-more="end"] {
  -webkit-mask-image: linear-gradient(to right, black calc(100% - 32px), transparent);
          mask-image: linear-gradient(to right, black calc(100% - 32px), transparent);
}
.ui-scroll-row[data-more="start"] {
  -webkit-mask-image: linear-gradient(to left, black calc(100% - 32px), transparent);
          mask-image: linear-gradient(to left, black calc(100% - 32px), transparent);
}
.ui-scroll-row[data-more="both"] {
  -webkit-mask-image: linear-gradient(to right, transparent, black 32px, black calc(100% - 32px), transparent);
          mask-image: linear-gradient(to right, transparent, black 32px, black calc(100% - 32px), transparent);
}

/* 1.11.0 (ui-kit-express 1.3.0) header_bar home: the house takes the back arrow's size, tap target
   and hover (it has its class too). Alone it sits at the far left like the arrow; after the arrow it
   doesn't pull left. The same rule as ui-kit-express.css, kept here after the part ui-kit-express's
   ui-kit.css shares, so that file stays exactly the start of this one. */
.ui-header__back + .ui-header__home { margin-left: 0; }
