/* Tela on the web: the Paintings screen (16 Nov), the iPad app's (PaintingsScreen.swift and the parts it's made of in
   Generated/Runtime/UIRuntime.swift: UIMasthead, UIPageHead, UICard, UISheetHead, UIMenuChoice, the toasts), in the
   same colours (editor/editor.css's, which are the app's Theme) and type: DM Serif Display and DM Sans, as the canvas
   page's (canvas/canvas.css). Sizes are the iPad's points; the phone's (its compact width) below 700 px. */
@font-face { font-family: 'DM Serif Display'; src: url('/apps/web/tela/fonts/dm-serif-display-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url('/apps/web/tela/fonts/dm-sans-latin-opsz-normal.woff2') format('woff2'); font-weight: 100 1000; font-display: swap; }

/* The brand's fonts (16 Nov, evening; lib/ui/brand, copied into /fonts): Work Sans for everything read or pressed,
   Archivo for headings, and the name TELA in Cinzel with a Cinzel Decorative first letter, as on the home page. */
@font-face { font-family: 'Work Sans'; src: url('/apps/web/tela/fonts/work-sans-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Work Sans'; src: url('/apps/web/tela/fonts/work-sans-latin-400-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Work Sans'; src: url('/apps/web/tela/fonts/work-sans-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Work Sans'; src: url('/apps/web/tela/fonts/work-sans-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Archivo'; src: url('/apps/web/tela/fonts/archivo-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Archivo'; src: url('/apps/web/tela/fonts/archivo-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Archivo'; src: url('/apps/web/tela/fonts/archivo-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Cinzel'; src: url('/apps/web/tela/fonts/cinzel-latin-900-normal.woff2') format('woff2'); font-weight: 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Cinzel Decorative'; src: url('/apps/web/tela/fonts/cinzel-decorative-latin-900-normal.woff2') format('woff2'); font-weight: 900; font-style: normal; font-display: swap; }

.lb {
  --sans: 'Work Sans', 'Helvetica Neue', Arial, system-ui, sans-serif;
  --serif: 'Archivo', 'Helvetica Neue', Arial, sans-serif;   /* the headings' face (the name is from when it was a serif) */
  --display: var(--serif);
  --pad: 56px;
  height: auto; min-height: 100%;
  font: 15px/1.4 var(--sans);
  font-optical-sizing: auto;
}
@media (max-width: 699px) { .lb { --pad: 18px; } }
.lb svg { width: 1em; height: 1em; flex: none; fill: currentColor; }
.lb .lb-stroke { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.lb button { cursor: pointer; }
.lb-skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--primary); color: var(--primary-ink); padding: 8px 14px; border-radius: var(--r); text-decoration: none; }
.lb-skip:focus { top: 12px; }

/* ---------------------------------------------------------------- the masthead (UIMasthead) */
.lb-mast {
  display: flex; align-items: center; gap: 44px;
  height: 76px; padding: 0 var(--pad);
  padding-left: max(var(--pad), env(safe-area-inset-left)); padding-right: max(var(--pad), env(safe-area-inset-right));
  border-bottom: 1px solid var(--line-2); background: var(--bg);
}
.lb-name { font: italic 400 28px/1 var(--serif); letter-spacing: -0.3px; }
.lb-tabs { display: flex; gap: 30px; }
.lb-tabs a { font: 500 15px/1 var(--sans); color: var(--muted); text-decoration: none; padding: 6px 0; border-bottom: 1.5px solid transparent; }
.lb-tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
@media (max-width: 699px) {
  .lb-mast { height: 64px; gap: 22px; }
  .lb-name { font-size: 24px; }
}

/* Tela's mark in a hexagon, before its name (16 Nov; index.html). The hexagon is the home page's: point up (--h tall,
   √3/2 of that wide) on a screen taller than wide; on one wider than tall (html.turned, orient.js) its frame turns 90°
   to lie flat on top, as the home page's honeycomb does, and the mark inside stays upright. Its edge and inlaid line
   are Tela's card's border on the home page: Tela's colour (brand.css, 16 Nov: the colour wheel's hue 59, its
   --accent-strong), 72% of it with the paper. Its tile is the icons' cream, dimmed at night as the home page's are. */
.lb {
  --tela: oklch(.42 .11 59);
  --tela-edge: color-mix(in oklch, var(--tela) 72%, var(--panel));
  --tile: #EDE7DC;
  --mark-dim: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .lb { --tela: oklch(.80 .11 59); --tile: #C7C2B9; --mark-dim: brightness(.84); }
}
:root[data-theme="dark"] .lb { --tela: oklch(.80 .11 59); --tile: #C7C2B9; --mark-dim: brightness(.84); }
.lb-brand { display: inline-flex; align-items: center; gap: 14px; }
.lb-logo { --h: 58px; position: relative; flex: none; display: grid; place-items: center;
           width: calc(var(--h) * .8660254); height: var(--h); }
.lb .lb-logo svg { position: absolute; left: 50%; top: 50%; translate: -50% -50%; }
.lb .lb-logo .lb-hex { width: calc(var(--h) * .8660254); height: var(--h); overflow: visible; }
.lb-hex-edge { fill: var(--tela-edge); }
.lb-hex-tile { fill: var(--tile); }
.lb-hex-inlay { fill: none; stroke: var(--tela-edge); stroke-width: 1px; vector-effect: non-scaling-stroke; }
html.turned .lb-logo { width: var(--h); height: calc(var(--h) * .8660254); }
html.turned .lb .lb-logo .lb-hex { rotate: 90deg; }
/* the mark: the home page's Tela icon (site.css, "App icons", and its colours there) */
.lb .lb-logo .lb-mark { width: calc(var(--h) * .5); height: calc(var(--h) * .5); filter: var(--mark-dim); }
.lb-mark .wood { fill: #C5A289; }
.lb-mark .c { fill: #EDE7DC; }
.lb-mark .g { fill: #EBBA3B; }
.lb-mark .p-red { fill: #B23A2A; }
.lb-mark .p-blue { fill: #406981; }
.lb-mark .p-green { fill: #35705D; }
/* The way home (17 Nov): the masthead's hexagon holds Studiolo's S, in the brand's red, and is a link to the site's
   home page; Tela's mark stands beside its name, off its tile (its thumb-hole the page's own colour). */
.lb-home { text-decoration: none; border-radius: 6px; transition: scale .2s cubic-bezier(.2,.7,.2,1); }
.lb-home:hover { scale: 1.08; }
.lb-home:focus-visible { outline: 2px solid #B23A2A; outline-offset: 4px; }
.lb-s { position: relative; font: 900 calc(var(--h) * .5)/1 'Cinzel Decorative', 'Cinzel', 'Trajan Pro', Georgia, serif; color: #B23A2A;
        filter: var(--mark-dim); }
.lb .lb-brand .lb-mark-plain { flex: none; width: 34px; height: 34px; margin-right: -4px; filter: var(--mark-dim); }
.lb-mark-plain ellipse.c { fill: var(--bg); }
/* (17 Nov) the mark and the name together are a link to the app's first screen (Projects) */
.lb-app { display: inline-flex; align-items: center; gap: inherit; color: inherit; text-decoration: none; border-radius: 6px; }
.lb-app:focus-visible { outline: 2px solid #B23A2A; outline-offset: 4px; }
@media (prefers-reduced-motion: reduce) { .lb-home { transition: none; } .lb-home:hover { scale: none; } }
@media (max-width: 699px) {
  .lb-logo { --h: 50px; }
  .lb-brand { gap: 11px; }
  .lb .lb-brand .lb-mark-plain { width: 30px; height: 30px; }
}

/* ---------------------------------------------------------------- the page and its head (UIPageHead) */
.lb-page { padding: 0 var(--pad) 96px; padding-left: max(var(--pad), env(safe-area-inset-left)); padding-right: max(var(--pad), env(safe-area-inset-right)); }
.lb-head { display: flex; align-items: flex-end; gap: 24px; padding: 40px 0 22px; border-bottom: 1px solid var(--ink); }
.lb-head h1 { flex: 1; min-width: 0; margin: 0 0 -6px; font: 400 84px/1.02 var(--display); letter-spacing: -2.5px; overflow-wrap: anywhere; }
.lb-head-tools { display: flex; align-items: center; gap: 6px; padding-bottom: 2px; }
@media (max-width: 699px) {
  .lb-head { padding-top: 28px; gap: 12px; }
  .lb-head h1 { font-size: 52px; letter-spacing: -1.5px; }
}
/* a phone: the title made smaller to keep its buttons beside it, as the app's does (to 0.6 of its size); on the
   narrowest, the buttons go under it */
@media (max-width: 460px) {
  .lb-head h1 { font-size: max(31px, min(52px, calc((100vw - 252px) / 3.9))); letter-spacing: -1px; }
}
@media (max-width: 359px) {
  .lb-head { flex-wrap: wrap; }
  .lb-head h1 { flex-basis: 100%; }
  .lb-head-tools { margin-left: auto; }
}

/* ---------------------------------------------------------------- buttons (UIButtonLook, UIIconButtonStyle) */
.lb-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: 4px;
  font: 500 15px/1 var(--sans); white-space: nowrap;
  color: var(--ink); background: transparent; border: 1px solid var(--line-2);
}
.lb-btn:hover { border-color: var(--ink); }
.lb-btn:active { opacity: 0.7; }
.lb-btn:disabled { opacity: 0.4; cursor: default; }
.lb-btn svg { font-size: 19px; }
.lb-btn.lb-primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.lb-btn.lb-primary:hover { background: color-mix(in srgb, var(--primary) 86%, var(--bg)); }
.lb-btn.lb-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.lb-btn.lb-danger:hover { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, transparent); }
.lb-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--ink); font-size: 23px; }
.lb-icon:hover, .lb-icon[aria-expanded="true"] { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.lb-plain { display: inline-flex; align-items: center; gap: 6px; padding: 11px 0; border: 0; background: none; color: var(--accent); font: 500 15px/1 var(--sans); }
.lb-plain:hover { text-decoration: underline; text-underline-offset: 3px; }
.lb-plain svg { font-size: 18px; }

/* ---------------------------------------------------------------- the content: a stack open, search and sort */
.lb-content { display: flex; flex-direction: column; gap: 24px; padding-top: 30px; }
.lb-stackbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; }
.lb-stack-name { margin: 0; font: 400 34px/1.1 var(--serif); letter-spacing: -0.4px; overflow-wrap: anywhere; }
.lb-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 28px; }
.lb-search { flex: 1 1 240px; display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--line-2); color: var(--muted); font-size: 19px; max-width: 520px; }
.lb-search:focus-within { border-bottom-color: var(--ink); }
.lb-search input { flex: 1; min-width: 0; border: 0; background: none; padding: 2px 0; font: 16px/1.3 var(--sans); color: var(--ink); outline: none; box-shadow: none !important; }
.lb-search input::placeholder { color: var(--faint); }
.lb-search input::-webkit-search-cancel-button { cursor: pointer; }
/* a choice from a menu (UIMenuChoice): its label in grey, the one chosen underlined, a chevron. The <select> lies over
   the words, unseen, so it's as wide as the one chosen (a select is as wide as its longest option) and still the
   browser's own menu, keys and all. */
.lb-choice { display: inline-flex; align-items: center; gap: 8px; }
.lb-choice-label { font: 14px/1 var(--sans); color: var(--muted); }
.lb-choice-box { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; border-radius: 3px; }
.lb-shown { font: 500 15px/1.2 var(--sans); color: var(--ink); white-space: nowrap; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 4px; text-decoration-thickness: 1px; }
.lb-choice-box:hover .lb-shown { text-decoration-color: var(--ink); }
.lb-choice-box svg { font-size: 15px; pointer-events: none; }
.lb-choice select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; appearance: none; -webkit-appearance: none; border: 0; margin: 0; padding: 0; font: 500 16px var(--sans); }
.lb-choice-box:has(select:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.lb-choice select:focus { box-shadow: none; }
.lb-choice option { color: var(--ink); background: var(--panel); }

/* ---------------------------------------------------------------- the grid and its cards (UICard) */
.lb-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 36px 34px; outline: none; }
.lb-grid:empty { display: none; }
.lb-card { min-width: 0; display: flex; flex-direction: column; }
.lb-mat {
  display: block; padding: 14px; background: var(--panel); border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08); color: inherit; text-decoration: none;
  transition: box-shadow 0.18s, transform 0.18s;
}
.lb-mat:hover { box-shadow: 0 12px 30px rgba(0, 0, 0, 0.13); }
.lb-mat:active { transform: scale(0.99); }
.lb-pic { position: relative; display: block; aspect-ratio: 16 / 9; background: var(--panel-2); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06); }
.lb-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.lb-pic img + .lb-edge { position: absolute; inset: 0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06); pointer-events: none; }
/* a stack's picture (StackPicture): its newest painting, nine tenths the size, with up to two sheets behind it */
.lb-pic.lb-pile { box-shadow: none; }
.lb-pile > span { position: absolute; left: 5%; top: 5%; width: 90%; height: 90%; border-radius: 3px; background: var(--panel); border: 1px solid var(--line-2); overflow: hidden; }
.lb-pile > .lb-behind { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
.lb-pile > .lb-behind-1 { transform: translate(6px, -5px) rotate(2.5deg); }
.lb-pile > .lb-behind-2 { transform: translate(12px, -10px) rotate(5deg); }
.lb-pile > .lb-top { box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12); }
.lb-pile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lb-under { display: flex; align-items: flex-start; gap: 6px; margin-top: 14px; }
.lb-words { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.lb-title { margin: 0; font: 400 22px/1.15 var(--serif); letter-spacing: -0.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-detail { margin: 0; font: 13px/1.3 var(--sans); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-more { width: 36px; height: 30px; margin: -7px -4px -7px 0; padding: 7px 4px; box-sizing: content-box; display: grid; place-items: center; border: 0; background: none; color: var(--muted); font-size: 20px; border-radius: 4px; }
.lb-more:hover, .lb-more[aria-expanded="true"] { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.lb-card.lb-new .lb-mat { animation: lb-in 0.35s ease-out; }
@keyframes lb-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .lb-card.lb-new .lb-mat, .lb-mat { animation: none; transition: none; } }

.lb-empty { margin: 0; padding: 48px 0; text-align: center; font: italic 400 20px/1.35 var(--serif); color: var(--muted); }
.lb-where { margin: 28px 0 0; font: 13px/1.4 var(--sans); color: var(--faint); }

/* ---------------------------------------------------------------- menus (More, and a card's) */
.lb-menu-wrap { position: relative; }
.lb-menu {
  position: absolute; z-index: 30; min-width: 220px; padding: 6px;
  background: var(--menu); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-2);
}
.lb-menu-end { right: 0; top: calc(100% + 6px); }
#card-menu { position: absolute; }
.lb-menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.lb-menu-head { margin: 4px 10px 6px; font: 500 12px/1 var(--sans); letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }
.lb-item {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 40px; padding: 0 12px;
  border: 0; border-radius: 5px; background: none; color: var(--ink); font: 15px/1.2 var(--sans); text-align: left; text-decoration: none;
}
.lb-item svg { font-size: 18px; color: var(--muted); }
.lb-item:hover, .lb-item:focus-visible { background: var(--panel-2); outline: none; }
.lb-item.lb-bad, .lb-item.lb-bad svg { color: var(--danger); }
.lb-seg { display: flex; gap: 2px; margin: 0 4px 4px; padding: 2px; border: 1px solid var(--line-2); border-radius: 5px; }
.lb-seg button { flex: 1; min-height: 34px; border: 0; border-radius: 3px; background: none; color: var(--muted); font: 14px/1 var(--sans); }
.lb-seg button[aria-pressed="true"] { background: var(--primary); color: var(--primary-ink); font-weight: 500; }
.lb-seg button:not([aria-pressed="true"]):hover { color: var(--ink); background: var(--panel-2); }

/* ---------------------------------------------------------------- toasts */
.lb-toasts { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; width: max-content; max-width: calc(100vw - 32px); pointer-events: none; }
.lb-toast {
  display: flex; align-items: center; gap: 16px; padding: 12px 20px; border-radius: 4px;
  background: var(--primary); color: var(--primary-ink); font: 15px/1.35 var(--sans);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.16); pointer-events: auto;
  animation: lb-toast 0.25s ease-out;
}
.lb-toast.lb-bad { background: var(--danger); color: #fff; }
.lb-toast button { border: 0; background: none; padding: 4px 0; color: inherit; font: 600 15px/1 var(--sans); text-decoration: underline; text-underline-offset: 3px; }
.lb-toast.lb-going { opacity: 0; transform: translateY(8px); transition: opacity 0.2s, transform 0.2s; }
@keyframes lb-toast { from { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) { .lb-toast { animation: none; } }

/* ---------------------------------------------------------------- sheets (UISheetHead and a form) and the alert */
.lb-sheet, .lb-alert { border: 0; padding: 0; color: var(--ink); background: var(--bg); box-shadow: var(--shadow-2); }
.lb-sheet { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 64px); border-radius: 12px; }
.lb-sheet::backdrop, .lb-alert::backdrop { background: var(--scrim); }
.lb-sheet[open] { animation: lb-sheet 0.22s ease-out; }
@keyframes lb-sheet { from { opacity: 0; transform: translateY(24px); } }
@media (prefers-reduced-motion: reduce) { .lb-sheet[open] { animation: none; } }
.lb-sheet-head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 64px; padding: 0 16px; border-bottom: 1px solid var(--line-2); }
.lb-sheet-head h2 { position: absolute; left: 130px; right: 130px; margin: 0; text-align: center; font: 400 23px/1.2 var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.lb-sheet-body { display: flex; flex-direction: column; gap: 18px; padding: 28px; }
@media (max-width: 699px) {
  .lb-sheet { width: 100vw; max-width: 100vw; max-height: calc(100dvh - 24px); margin: auto 0 0; border-radius: 12px 12px 0 0; }
  .lb-sheet-head h2 { left: 104px; right: 104px; font-size: 20px; }
  .lb-sheet-body { padding: 22px 18px calc(28px + env(safe-area-inset-bottom)); }
}
.lb-field { display: flex; flex-direction: column; gap: 6px; }
.lb-field-label { font: 500 12px/1 var(--sans); letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }
.lb-field input {
  min-height: 44px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 4px;
  background: var(--field); color: var(--ink); font: 16px/1.3 var(--sans);
}
.lb-field input:focus { border-color: var(--ink); outline: none; }
.lb-field input::placeholder { color: var(--faint); }
.lb-pair { display: flex; gap: 14px; }
.lb-pair .lb-field { flex: 1; min-width: 0; }
.lb-note { margin: 8px 0 0; font: 13px/1.4 var(--sans); color: var(--muted); }
.lb-custom { display: flex; flex-direction: column; }

.lb-alert { width: min(380px, calc(100vw - 48px)); border-radius: 12px; padding: 24px 24px 18px; text-align: center; }
.lb-alert h2 { margin: 0 0 8px; font: 400 23px/1.2 var(--serif); overflow-wrap: anywhere; }
.lb-alert p { margin: 0 0 20px; font: 15px/1.45 var(--sans); color: var(--muted); }
.lb-alert-buttons { display: flex; gap: 10px; }
.lb-alert-buttons .lb-btn { flex: 1; }

/* ---------------------------------------------------------------- projects (16 Nov, evening) */
/* a project's own ID (the painter's: a job or client number), as a small label */
.lb-code { display: inline-block; padding: 3px 8px; border: 1px solid var(--line-2); border-radius: 3px; font: 500 12px/1.2 var(--sans); letter-spacing: 0.4px; color: var(--muted); white-space: nowrap; }
.lb-plain.lb-bad { color: var(--danger); }
/* under a painting, in the Paintings tab: the projects it's in */
.lb-in { display: flex; align-items: center; gap: 5px; }
.lb-in svg { font-size: 14px; }
/* Projects…: each project with a box to tick */
.lb-checks { display: flex; flex-direction: column; max-height: 42vh; overflow-y: auto; border: 1px solid var(--line-2); border-radius: 4px; }
.lb-check { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; cursor: pointer; }
.lb-check + .lb-check { border-top: 1px solid var(--line); }
.lb-check:hover { background: var(--panel-2); }
.lb-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--primary); flex: none; }
.lb-check-name { flex: 1; min-width: 0; font: 15px/1.3 var(--sans); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-alert-stacked { flex-direction: column; }
.lb-alert-stacked .lb-btn { white-space: normal; padding: 10px 16px; line-height: 1.25; }
.lb-tabs a:hover { color: var(--ink); }

/* ---------------------------------------------------------------- the brand's type (16 Nov, evening) */
/* Headings in Archivo, semibold, a little tighter; the app's name as the home page sets it (brand.css .app-name);
   what was the serif's italic (the empty page's line) in Work Sans italic. */
.lb-head h1, .lb-stack-name, .lb-title, .lb-sheet-head h2, .lb-alert h2 { font-weight: 600; }
.lb-head h1 { letter-spacing: -0.035em; }
.lb-stack-name, .lb-sheet-head h2, .lb-alert h2 { letter-spacing: -0.015em; }
.lb-title { font-size: 19px; letter-spacing: -0.01em; }
.lb-name { font: 900 25px/1 'Cinzel', 'Trajan Pro', Georgia, serif; letter-spacing: 0.08em; text-transform: uppercase; }
.lb-name::first-letter { font-family: 'Cinzel Decorative', 'Cinzel', Georgia, serif; }
@media (max-width: 699px) { .lb-name { font-size: 21px; } }
.lb-empty { font: italic 400 18px/1.4 var(--sans); }

/* ================================================================ the Studiolo look (16 Nov, late)
   The first screen dressed as the home page is (lib/ui/brand/brand.css): its paper, ink and red, by day and at night;
   pills for buttons and soft corners for sheets and menus; a smaller title, so the paintings are on the first screen;
   a little motion. The rules above are the app's own shapes; these come after them and win. */
.lb {
  --bg: #F6F1E8; --panel: #FAF7F1; --panel-2: #EDE6D9; --line: #DCD4C8; --line-2: #CFC5B6;
  --ink: #221E1B; --muted: #6E645A; --faint: #85796C;
  --accent: #B23A2A; --accent-ink: #FFFFFF; --danger: #B23A2A;
  --primary: #221E1B; --primary-ink: #F6F1E8;
  --field: #FAF7F1; --menu: #FAF7F1; --scrim: rgb(34 30 27 / .42);
  --shadow-2: 0 30px 80px -30px rgb(34 30 27 / .45), 0 1px 2px rgb(34 30 27 / .06);
  --lift: 0 18px 36px -18px rgb(34 30 27 / .35);
  background: var(--bg); color: var(--ink);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .lb {
    --bg: #16120F; --panel: #201B17; --panel-2: #2A231E; --line: #3B322B; --line-2: #4A4037;
    --ink: #F2E6D0; --muted: #AB9C8A; --faint: #8A7C6B;
    --accent: #E0654D; --accent-ink: #16120F; --danger: #E0654D;
    --primary: #F2E6D0; --primary-ink: #16120F;
    --field: #1B1612; --menu: #201B17; --scrim: rgb(6 4 3 / .62);
    --shadow-2: 0 30px 80px -30px rgb(0 0 0 / .8), 0 0 0 1px rgb(242 230 208 / .05);
    --lift: 0 18px 36px -18px rgb(0 0 0 / .8);
  }
}
:root[data-theme="dark"] .lb {
  --bg: #16120F; --panel: #201B17; --panel-2: #2A231E; --line: #3B322B; --line-2: #4A4037;
  --ink: #F2E6D0; --muted: #AB9C8A; --faint: #8A7C6B;
  --accent: #E0654D; --accent-ink: #16120F; --danger: #E0654D;
  --primary: #F2E6D0; --primary-ink: #16120F;
  --field: #1B1612; --menu: #201B17; --scrim: rgb(6 4 3 / .62);
  --shadow-2: 0 30px 80px -30px rgb(0 0 0 / .8), 0 0 0 1px rgb(242 230 208 / .05);
  --lift: 0 18px 36px -18px rgb(0 0 0 / .8);
}
.lb :focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.lb ::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }

/* the masthead stays at the top, the page passing under it */
.lb-mast { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 86%, transparent);
           -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); border-bottom-color: var(--line); }
.lb-tabs { gap: 6px; }
.lb-tabs a { padding: 9px 14px; border: 0; border-radius: 999px; transition: background .15s, color .15s; }
.lb-tabs a:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.lb-tabs a[aria-current="page"] { background: var(--ink); color: var(--bg); }

/* the title: smaller, so what's kept is on the first screen; its rule a hairline */
.lb-head { padding: 30px 0 18px; border-bottom-color: var(--line); align-items: center; }
.lb-head h1 { font-size: 52px; letter-spacing: -0.03em; margin: 0; line-height: 1.05; }
@media (max-width: 699px) { .lb-head { padding-top: 22px; } .lb-head h1 { font-size: 38px; } }
@media (max-width: 460px) { .lb-head h1 { font-size: max(28px, min(38px, calc((100vw - 252px) / 3.4))); letter-spacing: -0.02em; } }
.lb-content { padding-top: 22px; gap: 22px; }

/* buttons: pills, the main one in the brand's red */
.lb-btn { border-radius: 999px; padding: 0 20px; transition: background .15s, border-color .15s, transform .15s, filter .15s; }
.lb-btn:active { opacity: 1; transform: scale(.97); }
.lb-btn.lb-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.lb-btn.lb-primary:hover { background: var(--accent); filter: brightness(1.08); }
.lb-icon, .lb-more { border-radius: 999px; }
.lb-plain { border-radius: 999px; padding: 9px 12px; margin: 0 -6px; transition: background .15s; }
.lb-plain:hover { text-decoration: none; background: color-mix(in srgb, var(--accent) 9%, transparent); }
.lb-code { border-radius: 999px; padding: 4px 10px; background: var(--panel); }

/* search: a soft field, not a rule */
.lb-search { border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px; background: var(--panel); transition: border-color .15s, box-shadow .15s; }
.lb-search:focus-within { border-color: var(--ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink) 8%, transparent); }
.lb .lb-search input:focus-visible { outline: none; }

/* the cards: a mat with soft corners that lifts under the pointer; a painting is shown whole, never cropped */
.lb-grid { gap: 34px 30px; }
.lb-mat { border-radius: 10px; padding: 12px; box-shadow: 0 1px 2px rgb(34 30 27 / .05), 0 10px 24px -14px rgb(34 30 27 / .25);
          transition: box-shadow .25s cubic-bezier(.2,.7,.2,1), transform .25s cubic-bezier(.2,.7,.2,1), border-color .2s; }
.lb-mat:hover { transform: translateY(-4px); box-shadow: 0 1px 2px rgb(34 30 27 / .05), var(--lift); border-color: var(--line-2); }
.lb-mat:active { transform: translateY(-1px) scale(.995); }
.lb-pic { border-radius: 4px; }
.lb-pic img { object-fit: contain; }
.lb-pile img { object-fit: contain; background: var(--panel-2); }
.lb-pile > span { border-radius: 5px; }
.lb-under { margin-top: 12px; }
.lb-title { font-size: 18px; }
@media (prefers-reduced-motion: no-preference) {
  .lb-grid.lb-arriving .lb-card { animation: lb-arrive .5s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i, 0) * 45ms); }
}
@keyframes lb-arrive { from { opacity: 0; transform: translateY(14px); } }
@media (prefers-reduced-motion: reduce) { .lb-mat, .lb-btn, .lb-tabs a { transition: none; } .lb-mat:hover { transform: none; } }

/* menus, sheets, the alert, toasts: the home page's corners */
.lb-menu { border-radius: 14px; padding: 7px; }
.lb-item { border-radius: 9px; min-height: 42px; }
.lb-seg { border-radius: 999px; padding: 3px; }
.lb-seg button { border-radius: 999px; }
.lb-sheet { border-radius: 18px; border: 1px solid var(--line); }
.lb-alert { border-radius: 18px; border: 1px solid var(--line); padding: 26px 24px 20px; }
.lb-sheet::backdrop, .lb-alert::backdrop { -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.lb-sheet-head { border-bottom-color: var(--line); }
.lb-field input { border-radius: 10px; border-color: var(--line); transition: border-color .15s, box-shadow .15s; }
.lb-field input:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink) 8%, transparent); }
.lb-checks { border-radius: 12px; border-color: var(--line); }
.lb-check input { accent-color: var(--accent); }
.lb-toast { border-radius: 999px; padding: 12px 22px; }
@media (max-width: 699px) { .lb-sheet { border-radius: 18px 18px 0 0; } }

/* the first look, with nothing kept yet: what Tela is, and one thing to press */
.lb-welcome { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding: clamp(28px, 7vh, 72px) 0 24px; }
.lb-welcome .lb-logo { --h: 120px; }
.lb-welcome h2 { margin: 10px 0 0; font: 600 clamp(26px, 3vw + 12px, 38px)/1.1 var(--serif); letter-spacing: -0.025em; text-wrap: balance; }
.lb-welcome p { margin: 0; max-width: 34em; font: 17px/1.55 var(--sans); color: var(--muted); text-wrap: pretty; }
.lb-welcome-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 8px; }
.lb-welcome .lb-btn { min-height: 48px; padding: 0 24px; font-size: 16px; }
.lb-welcome-facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.lb-welcome-facts li { border: 1px solid var(--line); border-radius: 999px; padding: 5px 13px; font: 13px/1.3 var(--sans); color: var(--muted); }
@media (prefers-reduced-motion: no-preference) { .lb-welcome > * { animation: lb-arrive .6s cubic-bezier(.2,.7,.2,1) both; } .lb-welcome > :nth-child(2) { animation-delay: .06s; } .lb-welcome > :nth-child(3) { animation-delay: .12s; } .lb-welcome > :nth-child(4) { animation-delay: .18s; } .lb-welcome > :nth-child(5) { animation-delay: .24s; } }
.lb-empty { font: 400 17px/1.5 var(--sans); padding: 56px 0; }
.lb-where { text-align: center; margin-top: 40px; }
/* a phone: the title on one line beside its buttons */
.lb-head h1 { overflow-wrap: normal; white-space: nowrap; }
@media (max-width: 460px) { .lb-head h1 { font-size: 30px; } .lb-head .lb-btn { padding: 0 16px; } }
/* the narrowest phones: the mark alone before the tabs (the name is in the mark's hexagon's place on the home page) */
@media (max-width: 380px) { .lb-name { display: none; } .lb-mast { gap: 14px; } }
