/* Layout and components of ui.md §5–§9, using only the tokens of tokens.css.
   Measures that belong to one component are written here as the spec gives them. */

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-display: swap;
  font-weight: 400 700;
  src: url(/web/fonts/roboto-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-display: swap;
  font-weight: 400 700;
  src: url(/web/fonts/roboto-latin-ext-wght-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Roboto';
  font-style: italic;
  font-display: swap;
  font-weight: 400 700;
  src: url(/web/fonts/roboto-latin-wght-italic.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Roboto';
  font-style: italic;
  font-display: swap;
  font-weight: 400 700;
  src: url(/web/fonts/roboto-latin-ext-wght-italic.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --- the type scale as classes ------------------------------------------- */

:root {
  --font: 'Roboto', 'Segoe UI', system-ui, sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', 'Roboto Mono', Consolas, monospace;
  color-scheme: light dark;
  interpolate-size: allow-keywords;
}

.t-headline-small, .dialog-title, .connect-title, .md-h1 { font: var(--talea-type-headline-small-weight) var(--talea-type-headline-small) var(--font); letter-spacing: var(--talea-type-headline-small-tracking); }
.t-title-large, .top-title, .md-h2 { font: var(--talea-type-title-large-weight) var(--talea-type-title-large) var(--font); letter-spacing: var(--talea-type-title-large-tracking); }
.t-title-medium, .top-title.small, .search-counter, .gap, .older-loading { font: var(--talea-type-title-medium-weight) var(--talea-type-title-medium) var(--font); letter-spacing: var(--talea-type-title-medium-tracking); }
.t-title-small, .ticket-title, .md-h3 { font: var(--talea-type-title-small-weight) var(--talea-type-title-small) var(--font); letter-spacing: var(--talea-type-title-small-tracking); }
.t-body-large, body, .hers, .his .chat-text, .dock-field, .outlined-field input, .empty-state { font: var(--talea-type-body-large-weight) var(--talea-type-body-large) var(--font); letter-spacing: var(--talea-type-body-large-tracking); }
.t-body-medium, .notice .chat-text, .toast, .connect-text, .file-name, .dialog-text { font: var(--talea-type-body-medium-weight) var(--talea-type-body-medium) var(--font); letter-spacing: var(--talea-type-body-medium-tracking); }
.t-body-small, .writing, .empty, .chat-notice, .his-quote, .answering span, .ticket-line, .md-code, .md-table, .tooltip { font: var(--talea-type-body-small-weight) var(--talea-type-body-small) var(--font); letter-spacing: var(--talea-type-body-small-tracking); }
.t-label-large, .button, .menu-item, .notice-title, .newest, .md-h4, .md-h5, .md-h6, .lightbox-name { font: var(--talea-type-label-large-weight) var(--talea-type-label-large) var(--font); letter-spacing: var(--talea-type-label-large-tracking); }
.t-label-medium, .nav-label, .day, .ticket-meta, .notice-ideas-head, .menu-caption { font: var(--talea-type-label-medium-weight) var(--talea-type-label-medium) var(--font); letter-spacing: var(--talea-type-label-medium-tracking); }
.t-label-small, .foot, .notice-time, .badge, .file-size { font: var(--talea-type-label-small-weight) var(--talea-type-label-small) var(--font); letter-spacing: var(--talea-type-label-small-tracking); }

/* --- the page -------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--md-sys-color-background);
  color: var(--md-sys-color-on-background);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
#root { height: 100dvh; }
::selection { background: var(--talea-mark); }
button, input, textarea { font: inherit; color: inherit; }
button { user-select: none; -webkit-user-select: none; }
a { color: var(--md-sys-color-primary); }
h1, h2, h3, h4, h5, h6, p { margin: 0; }
.icon { display: block; flex: none; fill: currentColor; }
.file-input { display: none; }

:focus-visible {
  outline: 3px solid var(--md-sys-color-secondary);
  outline-offset: 2px;
}
:focus:not(:focus-visible) { outline: none; }

/* --- states (§4.6): a layer of the content colour over the ground -------- */

.icon-button, .button, .nav-item, .menu-item, .ticket-preview, .file-row, .picture, .newest, .unheard {
  cursor: pointer;
  transition: box-shadow var(--talea-duration-short) var(--talea-ease-standard);
}
@media (hover: hover) and (pointer: fine) {
  .icon-button:hover:not(:disabled), .button:hover:not(:disabled), .menu-item:hover, .ticket-preview:hover,
  .file-row:hover, .newest:hover, .nav-item:hover .nav-indicator {
    box-shadow: inset 0 0 0 100vmax color-mix(in srgb, currentColor 8%, transparent);
  }
}
.icon-button:focus-visible, .button:focus-visible, .menu-item:focus-visible, .ticket-preview:focus-visible,
.icon-button:active:not(:disabled), .button:active:not(:disabled), .menu-item:active, .ticket-preview:active, .file-row:active {
  box-shadow: inset 0 0 0 100vmax color-mix(in srgb, currentColor 10%, transparent);
}
:disabled { cursor: default; }

/* --- the frame (§5, §6) ---------------------------------------------------- */

/* The glow while they talk (§9.1.16, `EdgeGlow`): his turn `primary` along
   the bottom, hers `tertiary` round the edges, breathing; on every tab. */
.glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  box-shadow: inset 0 -40px 64px -24px color-mix(in srgb, var(--md-sys-color-primary) 55%, transparent);
  transition: opacity 350ms var(--talea-ease-standard), box-shadow 600ms var(--talea-ease-standard);
}
.glow-his, .glow-hers { opacity: 1; }
.glow-hers {
  box-shadow: none;
  background:
    linear-gradient(to right, color-mix(in srgb, var(--md-sys-color-tertiary) 50%, transparent), transparent) left bottom / 64px calc(var(--talea-dock) + 80px) no-repeat,
    linear-gradient(to left, color-mix(in srgb, var(--md-sys-color-tertiary) 50%, transparent), transparent) right bottom / 64px calc(var(--talea-dock) + 80px) no-repeat,
    linear-gradient(to top, color-mix(in srgb, var(--md-sys-color-tertiary) 28%, transparent), transparent) bottom / 100% 28px no-repeat;
  mask-image: linear-gradient(to top, #000 calc((var(--talea-dock) + 80px) * 0.35), transparent calc(var(--talea-dock) + 80px));
  animation: glow-breath 2.4s ease-in-out infinite alternate;
}
@keyframes glow-breath { from { opacity: 0.7; } to { opacity: 1; } }
.frame.talking .nav-bar { background: var(--talea-dock-ground); }
@media (prefers-reduced-motion: reduce) {
  .glow, .sign { transition: none; }
  .glow.hers { animation: none; }
}

.frame { display: grid; height: 100%; }
.frame.with-bar { grid-template-rows: minmax(0, 1fr) auto; }
.frame.with-bar .nav-bar { grid-row: 2; }
.frame.with-bar .panes { grid-row: 1; }
.frame.with-rail { grid-template-columns: var(--talea-rail) minmax(0, 1fr); }
.panes { display: flex; min-width: 0; min-height: 0; height: 100%; }
.pane { display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0; height: 100%; }
.pane + .pane { border-left: 1px solid var(--md-sys-color-outline-variant); }

.nav-bar {
  height: calc(var(--talea-navbar) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--md-sys-color-surface-container);
}
.nav-bar .nav-items { display: flex; gap: 8px; height: 100%; }
.nav-bar .nav-item { flex: 1; min-width: 0; padding-top: 12px; }
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--md-sys-color-on-surface-variant);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.nav-item:focus-visible { outline: none; }
.nav-item:focus-visible .nav-indicator { outline: 3px solid var(--md-sys-color-secondary); outline-offset: 2px; }
.nav-indicator {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 32px;
  border-radius: 16px;
}
.nav-item.current .nav-indicator { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.nav-item.current .nav-label { color: var(--md-sys-color-secondary); }
.nav-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

.rail {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: var(--talea-rail);
  height: 100%;
  background: var(--md-sys-color-surface-container);
}
.rail .nav-items { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; }
.rail .nav-foot { display: flex; flex-direction: column; gap: 12px; padding-bottom: 24px; }

.badge {
  position: absolute;
  left: 50%;
  top: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--talea-shape-full);
  background: var(--md-sys-color-error);
  color: var(--md-sys-color-on-error);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- the top bar (§6.1) ------------------------------------------------------ */

.top-bar {
  display: flex;
  align-items: center;
  flex: none;
  height: var(--talea-bar);
  padding: 0 4px;
  background: transparent;
}
.top-title {
  flex: 1;
  min-width: 0;
  color: var(--md-sys-color-on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top-title { padding-left: 4px; }
.top-title.first { padding-left: 16px; }
.top-title.small {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.top-title:focus { outline: none; }
.top-actions { display: flex; align-items: center; color: var(--md-sys-color-on-surface-variant); }
.search-counter { color: var(--md-sys-color-on-surface-variant); }
@media (max-height: 479px) {
  .pane { overflow-y: auto; }
}

/* --- buttons (§7.1) ------------------------------------------------------------ */

.icon-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: var(--talea-shape-full);
  background: transparent;
  background-clip: content-box;
  color: inherit;
  text-decoration: none;
  flex: none;
}
.icon-button { padding: 4px; }
.icon-button:disabled { color: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent); }
.icon-button.turn-up .icon { transform: rotate(90deg); }
.icon-button.turn-down .icon { transform: rotate(-90deg); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 24px;
  border: 0;
  border-radius: var(--talea-shape-full);
  background: transparent;
  white-space: nowrap;
}
.button.filled { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }
.button.tonal { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.button.outlined { border: 1px solid var(--md-sys-color-outline); color: var(--md-sys-color-primary); }
.button.text { padding: 0 12px; color: var(--md-sys-color-primary); }
.button.small { height: auto; min-height: 32px; padding: 4px 12px; white-space: normal; }
.button.bare { padding: 0; height: auto; min-height: 32px; align-self: flex-start; }
.button:disabled { color: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent); }
.button.filled:disabled, .button.tonal:disabled { background: color-mix(in srgb, var(--md-sys-color-on-surface) 12%, transparent); }
.button.outlined:disabled { border-color: color-mix(in srgb, var(--md-sys-color-on-surface) 12%, transparent); }

/* --- tooltips (§7.17): hover after 500 ms, keyboard focus at once, never touch */

@media (hover: hover) and (pointer: fine) {
  [data-tip] { position: relative; }
  [data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 30;
    padding: 4px 8px;
    border-radius: var(--talea-shape-extra-small);
    background: var(--md-sys-color-inverse-surface);
    color: var(--md-sys-color-inverse-on-surface);
    font: var(--talea-type-body-small-weight) var(--talea-type-body-small) var(--font);
    letter-spacing: var(--talea-type-body-small-tracking);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--talea-duration-short) var(--talea-ease-standard) 0s, visibility 0s linear var(--talea-duration-short);
  }
  [data-tip].tip-above::after { top: auto; bottom: calc(100% + 4px); }
  .top-actions [data-tip]:last-child::after { left: auto; right: 4px; transform: none; }
  [data-tip]:hover:not(:disabled)::after {
    opacity: 1;
    visibility: visible;
    transition: opacity var(--talea-duration-short) var(--talea-ease-standard) 500ms, visibility 0s linear 500ms;
  }
  [data-tip]:focus-visible::after { opacity: 1; visibility: visible; transition: none; }
}

/* --- the conversation (§9.1) --------------------------------------------------- */

.list-frame { position: relative; flex: 1; min-height: 0; }
.list {
  position: relative;
  height: 100%;
  overflow-y: auto;
  overflow-anchor: none;
  padding: 12px 16px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%);
}
.rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: var(--talea-chat-column);
  margin: 0 auto;
}
.row { display: flex; flex-direction: column; min-width: 0; }
.day { align-self: center; color: var(--md-sys-color-outline); margin: 8px 0 0; padding-bottom: 10px; }
.gap, .older-loading { align-self: center; color: var(--md-sys-color-outline); padding: 8px 0; }
.older-loading { position: absolute; top: 0; left: 50%; transform: translateX(-50%); z-index: 2; }
.away { font: italic var(--talea-type-body-medium-weight) var(--talea-type-body-medium) var(--font); color: var(--md-sys-color-on-surface-variant); padding: 0 4px; }
.writing { font-style: italic; color: var(--md-sys-color-on-surface); padding: 0 4px; }
.empty { color: var(--md-sys-color-on-surface); padding: 0 4px; }

.line { position: relative; display: flex; flex-direction: column; border-radius: 18px; }
.line.is-hers { margin-right: var(--talea-space-8); }
.line.is-his { align-self: flex-end; max-width: calc(100% - var(--talea-space-8)); }
.line:focus-visible { outline-offset: 2px; }
.line p, .line .md-doc { user-select: text; -webkit-user-select: text; }

.hers {
  padding: 10px 14px;
  border-radius: var(--talea-shape-bubble) var(--talea-shape-bubble) var(--talea-shape-bubble) 4px;
  background: var(--talea-bubble-hers);
  color: var(--md-sys-color-on-surface);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-wrap: anywhere;
}
.his {
  padding: 9px 14px;
  border-radius: var(--talea-shape-bubble) var(--talea-shape-bubble) 4px var(--talea-shape-bubble);
  background: var(--talea-bubble-his);
  color: var(--talea-bubble-his-ink);
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-wrap: anywhere;
}
.chat-text { white-space: pre-wrap; }
.his .foot { color: color-mix(in srgb, var(--talea-bubble-his-ink) 70%, transparent); margin-top: -4px; }
.foot { align-self: flex-end; margin-top: 2px; color: var(--md-sys-color-on-surface-variant); text-align: end; }
.his-name { font: var(--talea-type-label-small-weight) var(--talea-type-label-small) var(--font); color: var(--md-sys-color-on-surface-variant); margin-bottom: 2px; }
.his-quote {
  border-left: 3px solid var(--md-sys-color-primary);
  padding-left: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notice {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--talea-shape-medium);
  background: var(--talea-bubble-hers);
  color: var(--md-sys-color-on-surface);
  display: flex;
  flex-direction: column;
  overflow-wrap: anywhere;
}
.machine { width: 100%; padding: 0 4px; color: var(--md-sys-color-outline); font: var(--talea-type-label-medium-weight) var(--talea-type-label-medium) var(--font); letter-spacing: var(--talea-type-label-medium-tracking); }
.machine-row { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-align: start; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.machine-row { cursor: pointer; }
.machine-rest { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.notice-head { display: flex; align-items: baseline; gap: 8px; }
.notice-title { flex: 1; color: var(--md-sys-color-primary); }
.notice-time { color: var(--md-sys-color-on-surface-variant); }
.notice-ideas { display: flex; flex-direction: column; gap: 4px; }
.notice-ideas-head { color: var(--md-sys-color-primary); padding-left: 4px; }

.card-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.line-files { display: flex; flex-direction: column; gap: 6px; }
.hers .line-files, .hers .ticket-preview { margin-top: 8px; }
.preview-card {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--talea-shape-medium);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.preview-card:focus-visible { outline: 2px solid var(--md-sys-color-primary); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .preview-card:hover { box-shadow: inset 0 0 0 100vmax color-mix(in srgb, currentColor 8%, transparent); }
}
.preview-card-head { display: flex; align-items: center; gap: 4px; color: var(--md-sys-color-on-surface); }
.preview-card-head .icon { flex: none; color: var(--md-sys-color-on-surface-variant); }
.preview-card-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font: var(--talea-type-label-large-weight) var(--talea-type-label-large) var(--font);
  letter-spacing: var(--talea-type-label-large-tracking);
}
.preview-card-body {
  display: block;
  max-height: calc(3 * 1.25rem);
  overflow: hidden;
  font: var(--talea-type-body-medium-weight) var(--talea-type-body-medium) var(--font);
  letter-spacing: var(--talea-type-body-medium-tracking);
  -webkit-mask-image: linear-gradient(to bottom, #000 50%, transparent);
  mask-image: linear-gradient(to bottom, #000 50%, transparent);
}
/* Q440: a note she touched, one line under her words (§9.1.4). */
.note-links { display: flex; flex-direction: column; }
.preview-card.note-link {
  width: 100%;
  background: none;
  color: inherit;
  text-align: start;
  font: inherit;
}
.note-link .preview-card-head .icon:first-child { color: var(--md-sys-color-primary); }
.dialog.read-sheet { width: min(640px, calc(100vw - 32px)); max-height: calc(100dvh - 64px); }
.dialog.read-sheet .dialog-body { padding: 0; gap: 0; max-height: calc(100dvh - 64px); overflow: hidden; }
.read-sheet-head { display: flex; align-items: center; gap: 8px; padding: 16px 12px 12px 24px; }
.read-sheet-title {
  flex: 1;
  margin: 0;
  font: var(--talea-type-title-large-weight) var(--talea-type-title-large) var(--font);
  letter-spacing: var(--talea-type-title-large-tracking);
}
.read-sheet-body {
  overflow-y: auto;
  padding: 0 24px 32px;
  user-select: text;
  font: var(--talea-type-body-large-weight) var(--talea-type-body-large) var(--font);
  letter-spacing: var(--talea-type-body-large-tracking);
}
.hers > .line-files:first-child { margin-top: 0; margin-bottom: 8px; }
.pictures { display: flex; flex-wrap: wrap; gap: 6px; }
.picture {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: var(--talea-shape-medium);
  overflow: hidden;
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface-variant);
}
.picture img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-row {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--talea-shape-file);
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
  text-align: start;
}
.file-row .icon { color: var(--md-sys-color-primary); }
.file-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-size { color: var(--md-sys-color-on-surface-variant); }

.unheard { overflow: hidden; border-radius: 4px; }
.veil { color: var(--talea-veil); }
mark { background: var(--talea-mark); color: inherit; font-weight: 700; border-radius: 2px; }
mark.lit { animation: lit 2000ms var(--talea-ease-standard); }
@keyframes lit {
  0%, 40% { background: color-mix(in srgb, var(--talea-flash) 55%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--talea-flash) 55%, transparent); }
  100% { background: var(--talea-mark); box-shadow: 0 0 0 0 transparent; }
}

.line.flash > .hers, .line.flash > .his, .line.flash > .notice { animation: flash 2500ms var(--talea-ease-standard); }
@keyframes flash {
  0%, 36% { background-color: color-mix(in srgb, var(--talea-flash) 45%, var(--talea-bubble-hers)); }
  100% { background-color: var(--talea-bubble-hers); }
}
.line.flash > .his { animation-name: flash-his; }
@keyframes flash-his {
  0%, 36% { background-color: color-mix(in srgb, var(--talea-flash) 45%, var(--talea-bubble-his)); }
  100% { background-color: var(--talea-bubble-his); }
}

/* Being read (§9.1.4): `ic_volume` 16 px in primary at the top end, 4 px in. */
.hers.reading { position: relative; padding-right: 24px; cursor: pointer; }
.hers.voiced { cursor: pointer; }
.read-mark { position: absolute; top: 4px; right: 4px; display: flex; color: var(--md-sys-color-primary); }

.hover-bar {
  position: absolute;
  top: -16px;
  z-index: 3;
  display: none;
  padding: 2px;
  border-radius: var(--talea-shape-small);
  background: var(--md-sys-color-surface-container);
  box-shadow: var(--talea-elevation-1);
  color: var(--md-sys-color-on-surface-variant);
}
.hover-bar.end { right: 12px; }
.hover-bar.start { left: 12px; }
.hover-bar .icon-button { width: 32px; height: 32px; padding: 0; }
@media (hover: hover) and (pointer: fine) {
  .line:hover > .hover-bar, .line:focus-within > .hover-bar { display: flex; }
}

.chat-notice {
  position: absolute;
  top: 4px;
  left: 12px;
  right: 12px;
  z-index: 4;
  padding: 6px 12px;
  border-radius: var(--talea-shape-small);
  background: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
}
.snackbar {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  min-width: 288px;
  max-width: min(560px, calc(100vw - 24px));
  min-height: 48px;
  padding: 4px 8px 4px 16px;
  border-radius: var(--talea-shape-extra-small);
  background: var(--md-sys-color-inverse-surface);
  color: var(--md-sys-color-inverse-on-surface);
  box-shadow: var(--talea-elevation-2);
  transform: translateX(-50%);
  animation: snack-in var(--talea-duration-medium) var(--talea-ease-emphasized-decelerate);
  font: var(--talea-type-body-medium-weight) var(--talea-type-body-medium) var(--font);
}
.snackbar-text { flex: 1; padding: 6px 0; }
.snackbar-action.button { color: var(--md-sys-color-inverse-primary); }
@keyframes snack-in { from { opacity: 0; transform: translate(-50%, 8px); } }
.frame.with-bar .snackbar { bottom: calc(var(--talea-navbar) + env(safe-area-inset-bottom) + 16px); }
@media (max-width: 599px) { .snackbar { min-width: 0; width: calc(100vw - 24px); } }
.newest {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 0;
  border-radius: var(--talea-shape-full);
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  box-shadow: var(--talea-elevation-2);
}
.drop {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--md-sys-color-primary) 8%, var(--md-sys-color-background));
  padding: 12px;
}
.drop-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 2px dashed var(--md-sys-color-primary);
  border-radius: 16px;
  color: var(--md-sys-color-primary);
  font: var(--talea-type-title-medium-weight) var(--talea-type-title-medium) var(--font);
}

.answering {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 0 0 12px;
  width: 100%;
  max-width: var(--talea-chat-column);
  margin: 0 auto;
}
.answering span {
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--md-sys-color-on-surface-variant);
}
.tray {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 12px 0;
  width: 100%;
  max-width: var(--talea-chat-column);
  margin: 0 auto;
}
.staged { position: relative; flex: none; padding: 2px 2px 0 0; }
.staged .file-row { max-width: 220px; }
.unstage {
  position: absolute;
  top: 0;
  right: 0;
  width: 20px;
  height: 20px;
  padding: 3px;
  border: 0;
  border-radius: var(--talea-shape-full);
  background: var(--md-sys-color-inverse-surface);
  color: var(--md-sys-color-inverse-on-surface);
  cursor: pointer;
}

/* --- the dock (§6.5) ------------------------------------------------------------- */

.dock {
  flex: none;
  min-height: var(--talea-dock);
  padding: 8px 12px;
  background: var(--talea-dock-ground);
  border-top: 1px solid var(--talea-dock-edge);
}
.dock-row { display: flex; align-items: center; max-width: var(--talea-chat-column); margin: 0 auto; min-height: 56px; }
.dock-field-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  min-height: var(--talea-field);
  border-radius: 24px;
  background: var(--md-sys-color-surface-container-highest);
}
.dock-field {
  flex: 1;
  min-width: 0;
  min-height: var(--talea-field);
  max-height: calc(6 * 1.5rem + 32px);
  padding: 16px;
  border: 0;
  border-radius: 24px;
  background: var(--md-sys-color-surface-container-highest);
  color: var(--md-sys-color-on-surface);
  resize: none;
  outline: none;
  overflow-y: auto;
}
.dock-field.single { border-radius: 24px; height: var(--talea-field); }
.dock-field::placeholder { color: var(--md-sys-color-on-surface-variant); }
.dock-field-wrap:focus-within { outline: 3px solid transparent; }
.dock-field:focus-visible { outline: none; }
.dock-field-wrap:has(.dock-field:focus-visible) { outline: 3px solid var(--md-sys-color-secondary); outline-offset: 2px; }
.dock-field-wrap .attach { color: var(--md-sys-color-on-surface-variant); margin-right: 4px; }
.slot { width: var(--talea-slot); flex: none; display: flex; justify-content: center; }
.send { color: var(--md-sys-color-primary); }
/* The sign (§6.5, Q488): 56 × 40, its icon half its height. */
.sign {
  width: 56px;
  height: 40px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: var(--md-sys-color-surface-container-highest);
  color: var(--md-sys-color-on-surface-variant);
  transition: background-color 250ms var(--talea-ease-standard), color 250ms var(--talea-ease-standard);
}
.sign.on { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }
.sign:disabled { opacity: 0.38; }

/* --- menus, dialogs (§7.7, §7.10) ---------------------------------------------- */

.menu {
  position: fixed;
  z-index: 40;
  min-width: 112px;
  max-width: 280px;
  padding: 8px 0;
  border-radius: var(--talea-shape-extra-small);
  background: var(--md-sys-color-surface-container);
  box-shadow: var(--talea-elevation-2);
  animation: come-in var(--talea-duration-long) var(--talea-ease-emphasized-decelerate);
}
.menu-caption { padding: 6px 16px; color: var(--md-sys-color-on-surface-variant); }
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 48px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--md-sys-color-on-surface);
  text-align: start;
}
.menu-item.danger { color: var(--md-sys-color-error); }
.menu-item .icon { color: var(--md-sys-color-on-surface-variant); }
@keyframes come-in { from { opacity: 0; transform: scale(0.95); } }

.dialog {
  min-width: 280px;
  max-width: min(560px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: var(--talea-shape-extra-large);
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
}
.dialog[open] { animation: come-in var(--talea-duration-long) var(--talea-ease-emphasized-decelerate); }
.dialog::backdrop { background: var(--talea-scrim); }
.dialog-body { display: flex; flex-direction: column; gap: 16px; padding: var(--talea-space-6); }
.dialog-text { color: var(--md-sys-color-on-surface-variant); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

.lightbox {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.lightbox::backdrop { background: color-mix(in srgb, var(--md-sys-color-scrim) 80%, transparent); }
.lightbox .dialog-body { padding: 0; height: 100%; }
.lightbox-inner { position: relative; height: 100%; display: flex; align-items: center; justify-content: center; }
.lightbox-bar { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 4px; padding: 4px 4px 4px 16px; color: #fff; }
.lightbox-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lightbox-picture { max-width: 92vw; max-height: 88dvh; object-fit: contain; }

/* --- progress (§7.14) -------------------------------------------------------------- */

.progress {
  position: relative;
  height: 4px;
  width: 100%;
  overflow: hidden;
  background: var(--md-sys-color-secondary-container);
  flex: none;
}
.progress.inline { display: block; margin: 4px 0; border-radius: 2px; }
.progress > span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 40%;
  background: var(--md-sys-color-primary);
  border-radius: 2px;
  animation: indeterminate 1.6s var(--talea-ease-standard) infinite;
}
@keyframes indeterminate { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.spinner {
  display: inline-block;
  border: 2px solid var(--md-sys-color-primary);
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- the idea's preview (§9.4.2) ----------------------------------------------- */

.ticket-preview {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 10px 14px;
  border: 0;
  border-radius: var(--talea-shape-medium);
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
  text-align: start;
}
.ticket-preview.parked, .ticket-preview.settled { opacity: 0.7; }
.ticket-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ticket-meta { color: var(--md-sys-color-on-surface-variant); }
.ticket-meta.waiting { color: var(--md-sys-color-primary); }
.ticket-line { color: var(--md-sys-color-on-surface-variant); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* --- the document (§8.1) ------------------------------------------------------------ */

.md-doc { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.md-p { white-space: pre-wrap; }
.md-h1 { color: var(--md-sys-color-on-surface); margin-top: 12px; }
.md-h2 { color: var(--md-sys-color-on-surface); margin-top: 14px; }
.md-h3 { color: var(--md-sys-color-primary); margin-top: 6px; letter-spacing: 0.6px; }
.md-h4, .md-h5, .md-h6 { color: var(--md-sys-color-primary); margin-top: 4px; }
.md-h5, .md-h6 { color: var(--md-sys-color-on-surface-variant); }
.md-doc > :first-child { margin-top: 0; }
.md-heading { font-weight: 700; font-size: 1.15em; }
.md-ul, .md-ol { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.md-ul > li, .md-ol > li { display: flex; }
.md-marker { flex: none; width: 18px; color: var(--md-sys-color-on-surface-variant); }
.md-ol > li > .md-marker { width: 30px; text-align: right; padding-right: 6px; }
.md-ul > li > .md-doc, .md-ol > li > .md-doc { flex: 1; min-width: 0; }
.md-quote {
  margin: 0;
  padding-left: 10px;
  border-left: 3px solid var(--md-sys-color-outline-variant);
  font-style: italic;
  color: var(--md-sys-color-on-surface-variant);
}
.md-code {
  margin: 0;
  padding: 10px;
  border-radius: var(--talea-shape-small);
  background: var(--md-sys-color-surface-container);
  overflow-x: auto;
  white-space: pre;
  font-family: var(--mono);
}
code { font-family: var(--mono); }
.md-doc code:not(.md-code code) { font-size: 0.9em; background: var(--md-sys-color-surface-container-highest); border-radius: 4px; padding: 0 2px; }
.md-code code { background: none; font-size: inherit; padding: 0; }
.md-table { overflow-x: auto; width: fit-content; max-width: 100%; border-radius: var(--talea-shape-small); background: var(--md-sys-color-surface-container-low); }
/* His wish (Q447): on a phone a table takes the screen's width, and scrolls only past it. */
@media (max-width: 599px) {
  .md-table { width: auto; }
  .md-table table { width: 100% !important; }
}
.md-table table { border-collapse: collapse; table-layout: fixed; }
.md-table th { background: var(--md-sys-color-surface-container-high); font-weight: 700; text-align: start; }
.md-table .md-num { white-space: nowrap; text-align: end; }
.md-table th, .md-table td { padding: 8px; vertical-align: top; overflow-wrap: anywhere; }
.md-table tr + tr td, .md-table tbody tr:first-child td { border-top: 1px solid var(--md-sys-color-outline-variant); }
/* Q447: what GitHub's Markdown adds (§8.1). */
.md-ul > li.md-task, .md-ol > li.md-task { align-items: flex-start; }
.md-box { flex: none; width: 16px; height: 16px; margin: 3px 8px 0 0; accent-color: var(--md-sys-color-primary); opacity: 1; }
.md-task.done > .md-doc > .md-p:first-child { color: var(--md-sys-color-on-surface-variant); text-decoration: line-through; }
.md-footnotes { list-style: none; margin: 4px 0 0; padding: 8px 0 0; border-top: 1px solid var(--md-sys-color-outline-variant); display: flex; flex-direction: column; gap: 4px; font: var(--talea-type-body-small-weight) var(--talea-type-body-small) var(--font); color: var(--md-sys-color-on-surface-variant); }
.md-footnotes > li { display: flex; }
.md-footnotes > li > .md-doc { flex: 1; min-width: 0; }
.md-fn-ref { line-height: 0; }
.md-fn-ref button { border: 0; background: none; padding: 0 1px; color: var(--md-sys-color-primary); font: inherit; font-size: 0.75em; cursor: pointer; }
.md-details > summary { cursor: pointer; color: var(--md-sys-color-on-surface); font-weight: 500; }
.md-details > .md-doc { margin-top: 8px; padding-left: 18px; }
.md-math-block { overflow-x: auto; overflow-y: hidden; text-align: center; }
.md-doc kbd { font-family: ui-monospace, monospace; font-size: 0.85em; padding: 0 4px; border: 1px solid var(--md-sys-color-outline-variant); border-bottom-width: 2px; border-radius: 4px; }
.md-doc mark { border-radius: 2px; background: var(--md-sys-color-tertiary-container); color: var(--md-sys-color-on-tertiary-container); }
.md-picture { display: block; padding: 0; border: 0; background: none; cursor: zoom-in; max-width: 100%; border-radius: var(--talea-shape-medium); overflow: hidden; }
.md-picture img { display: block; max-width: 100%; max-height: min(60vh, 520px); width: auto; height: auto; }
.md-picture.loading { width: 160px; height: 120px; display: flex; align-items: center; justify-content: center; background: var(--md-sys-color-surface-container-high); color: var(--md-sys-color-on-surface-variant); }
.md-picture-link { display: inline-flex; align-items: center; gap: 4px; }
.note-tile-picture { margin: -12px -16px 8px; height: 140px; background: var(--md-sys-color-surface-container-high); border-radius: var(--talea-shape-medium) var(--talea-shape-medium) 0 0; overflow: hidden; }
.note-tile-picture img { display: block; width: 100%; height: 100%; object-fit: cover; }
.md-picture-alt { color: var(--md-sys-color-on-surface-variant); font-style: italic; }
/* Q466: a sized picture fills the width he chose, up to the same height cap; a menu over its corner sets it. */
.md-picture.sized img { width: 100%; max-height: min(60vh, 520px); object-fit: contain; }
.note-picture { position: relative; display: block; width: fit-content; max-width: 100%; }
.note-picture-size { position: absolute; top: 4px; right: 4px; width: 40px; height: 40px; border-radius: 50%; background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); opacity: 0; }
.note-picture:hover .note-picture-size, .note-picture:focus-within .note-picture-size { opacity: 1; }
.note-picture .menu-item:not(:has(.icon)) { padding-inline-start: 48px; }
@media (pointer: coarse) { .note-picture-size { display: none; } }
.md-rule { border: 0; border-top: 1px solid var(--md-sys-color-outline-variant); margin: 4px 0; width: 100%; }
.md-doc a, .chat-text a { color: var(--md-sys-color-primary); text-decoration: underline; }

/* --- fields (§7.9) ------------------------------------------------------------------- */

.outlined-field { position: relative; display: block; }
.outlined-field input, .outlined-field textarea {
  width: 100%;
  padding: 16px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--talea-shape-extra-small);
  background: transparent;
  color: var(--md-sys-color-on-surface);
  outline: none;
}
.outlined-field input:focus, .outlined-field textarea:focus { border: 2px solid var(--md-sys-color-primary); padding: 15px; }
.outlined-label {
  position: absolute;
  left: 12px;
  top: 16px;
  padding: 0 4px;
  color: var(--md-sys-color-on-surface-variant);
  background: var(--md-sys-color-background);
  pointer-events: none;
  transition: all var(--talea-duration-short) var(--talea-ease-standard);
  font: var(--talea-type-body-large-weight) var(--talea-type-body-large) var(--font);
}
.outlined-field input:focus + .outlined-label,
.outlined-field input:not(:placeholder-shown) + .outlined-label {
  top: -8px;
  font: var(--talea-type-body-small-weight) var(--talea-type-body-small) var(--font);
}
.outlined-field input:focus + .outlined-label { color: var(--md-sys-color-primary); }

/* --- not connected (§9.6) ----------------------------------------------------------- */

.connect { height: 100%; overflow-y: auto; }
/* Q316: one column, centred, its parts centred too; on a window of 600 px and
   more a card of its own on the page, as Google's and most sign-ins are. */
.connect-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 400px;
  margin: 12dvh auto 24px;
  padding: 24px;
  text-align: center;
}
@media (min-width: 600px) {
  .connect-column {
    padding: 40px 32px 32px;
    border-radius: 28px;
    background: var(--md-sys-color-surface-container-low);
  }
}
.brand { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 8px; }
.brand-name {
  color: var(--md-sys-color-on-surface);
  font: var(--talea-type-title-large-weight) var(--talea-type-title-large) var(--font);
  letter-spacing: var(--talea-type-title-large-tracking);
}
.mark { display: block; flex: none; }
.mark-ground { fill: var(--md-sys-color-primary-container); }
.mark-glyph { fill: var(--md-sys-color-on-primary-container); }
.connect-title { color: var(--md-sys-color-on-surface); }
.connect-text { color: var(--md-sys-color-on-surface-variant); }
.connect-text.refused { color: var(--md-sys-color-error); }
.connect-actions { display: flex; justify-content: center; }
.connect-column .outlined-field { text-align: left; }

/* --- the login (§9.6, §9.11, Q304) --------------------------------------------------- */

.login-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.login-actions.column { flex-direction: column; align-items: stretch; }
.login-panel { display: flex; flex-direction: column; gap: 16px; }
/* Under the line only while the door offers Google (Q314). */
.login-or {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--md-sys-color-on-surface-variant);
  font: var(--talea-type-body-small-weight) var(--talea-type-body-small) var(--font);
}
.login-or::before,
.login-or::after { content: ''; flex: 1; border-top: 1px solid var(--md-sys-color-outline-variant); }
/* Google's own button (its branding, "Sign in with Google"): a pill of 40 px,
   the G at 20 px, Roboto Medium 14, light or dark as the computer is, never
   Talea's colours. */
.google-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--talea-google-outline);
  border-radius: 20px;
  background: var(--talea-google-container);
  color: var(--talea-google-on-container);
  font: 500 14px/20px Roboto, var(--font);
  letter-spacing: 0.25px;
  cursor: pointer;
}
.google-button:hover { background: var(--talea-google-hover); }
.google-button:disabled { opacity: 0.38; cursor: default; }
.google-button:focus-visible { outline: 2px solid var(--md-sys-color-primary); outline-offset: 2px; }
.login-code {
  margin: 0;
  color: var(--md-sys-color-primary);
  font: 400 3.5625rem/4rem var(--font);
  letter-spacing: -0.25px;
  text-align: center;
}
.login-waiting { color: var(--md-sys-color-on-surface-variant); font: var(--talea-type-body-small-weight) var(--talea-type-body-small) var(--font); }
.idle-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  overflow-y: auto;
  background: var(--md-sys-color-surface);
}
/* Over the panes under the top bar, as the update's line: a flex item of
   `.panes` it would stand beside the pane as a column of its own. */
.banner.approve {
  position: absolute;
  top: var(--talea-bar);
  left: 0;
  right: 0;
  z-index: 7;
  flex-wrap: wrap;
  column-gap: 16px;
  row-gap: 8px;
  background: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-on-tertiary-container);
  box-shadow: var(--talea-elevation-1);
}
.banner.approve .button { color: var(--md-sys-color-on-tertiary-container); }
.banner.approve .button.outlined { border-color: var(--md-sys-color-on-tertiary-container); min-width: 56px; }
.approve-text { display: flex; flex: 1 1 240px; flex-direction: column; gap: 2px; }
.approve-title { font: var(--talea-type-title-small-weight) var(--talea-type-title-small) var(--font); }
.approve-text .refused { color: var(--md-sys-color-error); }
.approve-choices { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.qr-code { display: block; width: 216px; height: 216px; margin: 0 auto; image-rendering: pixelated; }
.invite-link { overflow-wrap: anywhere; color: var(--md-sys-color-on-surface-variant); font: var(--talea-type-body-small-weight) var(--talea-type-body-small) var(--mono); }
.codes-list { margin: 0; padding-left: 24px; columns: 2; font: var(--talea-type-body-medium-weight) var(--talea-type-body-medium) var(--mono); }
.problem-ink { color: var(--md-sys-color-error); }

/* --- pages (§7.16, §7.18, §9.2, §9.3, §9.5) -------------------------------------------- */

.t-body-medium { font: var(--talea-type-body-medium-weight) var(--talea-type-body-medium) var(--font); letter-spacing: var(--talea-type-body-medium-tracking); }
.muted { color: var(--md-sys-color-on-surface-variant); }
.page-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.problem-line {
  margin: 0;
  padding: 4px 16px;
  color: var(--md-sys-color-error);
  font: var(--talea-type-body-medium-weight) var(--talea-type-body-medium) var(--font);
}
.problem-line.bare { padding: 4px 0; }
.waiting-state { padding: 104px 32px 32px; text-align: center; }
.waiting-title { color: var(--md-sys-color-on-surface); font: var(--talea-type-title-medium-weight) var(--talea-type-title-medium) var(--font); }
.waiting-text { margin-top: 8px; color: var(--md-sys-color-on-surface-variant); font: var(--talea-type-body-medium-weight) var(--talea-type-body-medium) var(--font); }
.icon-button.spinning .icon { animation: spin 800ms linear infinite; }
.banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font: var(--talea-type-body-medium-weight) var(--talea-type-body-medium) var(--font);
}
.banner > span { flex: 1; }
.banner.offer { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.banner.offer .button { color: var(--md-sys-color-on-secondary-container); }
.banner.update {
  position: absolute;
  top: var(--talea-bar);
  left: 0;
  right: 0;
  z-index: 6;
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
}
.panes { position: relative; }

.today-grid {
  display: grid;
  gap: 12px;
  padding: 0 16px 12px;
}
@media (min-width: 600px) {
  .today-grid {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
    max-width: var(--talea-grid-max);
    margin: 0 auto;
  }
  .today-grid > .waiting-card { grid-column: 1 / -1; }
}
.page-card {
  padding: 14px;
  border-radius: var(--talea-shape-large);
  background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  overflow-wrap: anywhere;
  font: var(--talea-type-body-medium-weight) var(--talea-type-body-medium) var(--font);
}
.card-title { color: var(--md-sys-color-primary); font: var(--talea-type-title-small-weight) var(--talea-type-title-small) var(--font); letter-spacing: var(--talea-type-title-small-tracking); }
.waiting-card {
  padding: 14px;
  border-radius: var(--talea-shape-large);
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.waiting-card .card-title { color: var(--md-sys-color-on-secondary-container); }
.question {
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--md-sys-color-on-secondary-container);
  text-align: start;
  cursor: pointer;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font: var(--talea-type-body-medium-weight) var(--talea-type-body-medium) var(--font);
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0 16px 16px;
}
@media (min-width: 600px) {
  .home-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); max-width: var(--talea-grid-max); margin: 0 auto; }
}
.scenes, .room { grid-column: 1 / -1; }
.scenes { display: flex; gap: 8px; overflow-x: auto; }
.room { margin: 8px 0 0; color: var(--md-sys-color-primary); font: var(--talea-type-title-small-weight) var(--talea-type-title-small) var(--font); }
.tile {
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--talea-tile);
  padding: 0 14px;
  border: 0;
  border-radius: var(--talea-shape-device);
  background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface);
  text-align: start;
  cursor: pointer;
  min-width: 0;
}
.tile.on { background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); }
.tile.gone { opacity: 0.5; cursor: default; }
.tile-text { display: flex; flex-direction: column; min-width: 0; }
.tile-name {
  font: var(--talea-type-title-small-weight) var(--talea-type-title-small) var(--font);
  hyphens: auto;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tile-state { font: var(--talea-type-body-small-weight) var(--talea-type-body-small) var(--font); }
.tile:not(.on) .tile-state { color: var(--md-sys-color-on-surface-variant); }
@media (hover: hover) and (pointer: fine) {
  .tile:hover:not(:disabled), .list-row:not(.still):hover, .question:hover, .ceiling:hover {
    box-shadow: inset 0 0 0 100vmax color-mix(in srgb, currentColor 8%, transparent);
  }
}
.tile:focus-visible, .list-row:focus-visible { box-shadow: inset 0 0 0 100vmax color-mix(in srgb, currentColor 10%, transparent); }

.dialog.narrow { width: min(400px, calc(100vw - 32px)); }
.dialog.sheet {
  width: 100vw;
  max-width: 640px;
  margin: auto auto 0;
  border-radius: var(--talea-shape-extra-large) var(--talea-shape-extra-large) 0 0;
  background: var(--md-sys-color-surface-container-low);
}
.dialog.sheet[open] { animation: slide-in var(--talea-duration-long) var(--talea-ease-fast-out-slow-in); }
@keyframes slide-in { from { transform: translateY(100%); } }
.sheet-handle { width: 32px; height: 4px; margin: -2px auto 6px; border-radius: 2px; background: var(--md-sys-color-on-surface-variant); }
.dialog.level .dialog-body { gap: 12px; padding: 16px; }
.level-name { font: var(--talea-type-title-medium-weight) var(--talea-type-title-medium) var(--font); }
.level-value { font: var(--talea-type-headline-small-weight) var(--talea-type-headline-small) var(--font); }
.level-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

/* The slider (§7.5): a 16 px track, a 4 × 44 px handle in primary. */
.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 44px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
.slider::-webkit-slider-runnable-track {
  height: 16px;
  border-radius: 8px;
  background: linear-gradient(to right, var(--md-sys-color-primary) calc(var(--at, 0%) - 6px), transparent calc(var(--at, 0%) - 6px) calc(var(--at, 0%) + 6px), var(--md-sys-color-secondary-container) calc(var(--at, 0%) + 6px));
}
.slider::-moz-range-track { height: 16px; border-radius: 8px; background: var(--md-sys-color-secondary-container); }
.slider::-moz-range-progress { height: 16px; border-radius: 8px; background: var(--md-sys-color-primary); }
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 4px;
  height: 44px;
  margin-top: -14px;
  border-radius: 2px;
  background: var(--md-sys-color-primary);
}
.slider::-moz-range-thumb { width: 4px; height: 44px; border: 0; border-radius: 2px; background: var(--md-sys-color-primary); }

.frame .panes.einstellungen { background: var(--md-sys-color-background); }
.pane.list-pane { flex: 0 0 var(--talea-list-pane); max-width: var(--talea-list-pane); }
.page-column { max-width: var(--talea-page-max); margin: 0 auto; width: 100%; }
.settings-list, .page-list { display: flex; flex-direction: column; padding-bottom: 12px; }
.group-head {
  margin: 20px 0 4px;
  padding-left: 56px;
  color: var(--md-sys-color-primary);
  font: var(--talea-type-label-large-weight) var(--talea-type-label-large) var(--font);
}
.group-head.flush { padding-left: 16px; }
.list-row {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 56px;
  padding: 8px 16px;
  border: 0;
  background: transparent;
  color: var(--md-sys-color-on-surface);
  text-align: start;
  width: 100%;
  cursor: pointer;
}
.list-row.still { cursor: default; }
.list-row.current {
  width: calc(100% - 24px);
  margin: 0 12px;
  padding-left: 4px;
  border-radius: var(--talea-shape-full);
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}
.list-row.danger { color: var(--md-sys-color-error); }
.row-lead { width: 24px; flex: none; color: var(--md-sys-color-on-surface-variant); }
.list-row.danger .row-lead { color: var(--md-sys-color-error); }
.row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-title { font: var(--talea-type-body-large-weight) var(--talea-type-body-large) var(--font); letter-spacing: var(--talea-type-body-large-tracking); overflow-wrap: anywhere; }
.row-second {
  color: var(--md-sys-color-on-surface-variant);
  font: var(--talea-type-body-medium-weight) var(--talea-type-body-medium) var(--font);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.list-row.current .row-second { color: inherit; }
.row-trailing { font: var(--talea-type-label-large-weight) var(--talea-type-label-large) var(--font); color: var(--md-sys-color-on-surface-variant); text-align: end; }
.row-trailing .working { color: var(--md-sys-color-primary); }
.row-problem { margin: 0; padding: 0 16px 8px 56px; color: var(--md-sys-color-error); font: var(--talea-type-body-small-weight) var(--talea-type-body-small) var(--font); }
.list-divider { border: 0; border-top: 1px solid var(--md-sys-color-outline-variant); margin: 8px 0; width: 100%; }

.switch {
  position: relative;
  flex: none;
  display: inline-block;
  width: 52px;
  height: 32px;
  border: 2px solid var(--md-sys-color-outline);
  border-radius: 16px;
  background: var(--md-sys-color-surface-container-highest);
  transition: background var(--talea-duration-short) var(--talea-ease-standard);
}
.switch > span {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--md-sys-color-outline);
  transition: all var(--talea-duration-short) var(--talea-ease-standard);
}
.switch.on { border-color: var(--md-sys-color-primary); background: var(--md-sys-color-primary); }
.switch.on > span { top: 2px; left: 22px; width: 24px; height: 24px; background: var(--md-sys-color-on-primary); }

.page-body { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.page-text { padding: 16px; color: var(--md-sys-color-on-surface); font: var(--talea-type-body-large-weight) var(--talea-type-body-large) var(--font); }
.page-label { color: var(--md-sys-color-on-surface); font: var(--talea-type-label-large-weight) var(--talea-type-label-large) var(--font); }
.page-small { font: var(--talea-type-body-small-weight) var(--talea-type-body-small) var(--font); }
/* Stimme und Sprechen (§9.5.3): the voice as an outlined field over a native menu, grouped. */
.page-body > .group-head.first { margin: 0; padding-left: 0; }
.voice-field { position: relative; display: flex; flex-direction: column; gap: 4px; }
.voice-label { color: var(--md-sys-color-on-surface-variant); font: var(--talea-type-body-small-weight) var(--talea-type-body-small) var(--font); }
.voice-select {
  width: 100%;
  height: 56px;
  padding: 0 16px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--talea-shape-extra-small);
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  font: var(--talea-type-body-large-weight) var(--talea-type-body-large) var(--font);
}
.voice-select:focus-visible { outline: 2px solid var(--md-sys-color-primary); outline-offset: -1px; }
.page-note { color: var(--md-sys-color-on-surface-variant); font: var(--talea-type-body-small-weight) var(--talea-type-body-small) var(--font); }
.segmented { display: flex; width: 100%; border: 1px solid var(--md-sys-color-outline); border-radius: var(--talea-shape-full); overflow: hidden; }
.segmented > button {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 4px;
  border: 0;
  border-left: 1px solid var(--md-sys-color-outline);
  background: transparent;
  color: var(--md-sys-color-on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  font: var(--talea-type-label-large-weight) var(--talea-type-label-large) var(--font);
}
.segmented.small > button { font: var(--talea-type-label-small-weight) var(--talea-type-label-small) var(--font); }
.segmented > button:first-child { border-left: 0; }
.segmented > button.chosen { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.segmented > button:focus-visible { outline-offset: -3px; }

/* Kosten (§9.5.3, Q561): the `Monat` card replaces the bare number line. */
.month-card { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: var(--talea-shape-large); background: var(--md-sys-color-surface-container); }
.costs .month { display: flex; align-items: baseline; flex-wrap: wrap; }
.costs-of { white-space: pre; color: var(--md-sys-color-on-surface-variant); font: var(--talea-type-body-medium-weight) var(--talea-type-body-medium) var(--font); }
.month-line { color: var(--md-sys-color-on-surface); }
.month-line .error { color: var(--md-sys-color-error); }
.ceiling {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 4px;
  border: 0;
  border-radius: var(--talea-shape-extra-small);
  background: none;
  color: var(--md-sys-color-primary);
  cursor: pointer;
  font: var(--talea-type-title-medium-weight) var(--talea-type-title-medium) var(--font);
}
/* Hintergrund-Aufgaben ceiling (§9.5.3, Q561): a quiet line under the `Monat` card, not a card of its own. */
.per-run { display: flex; align-items: baseline; flex-wrap: wrap; white-space: pre; color: var(--md-sys-color-on-surface-variant); font: var(--talea-type-body-small-weight) var(--talea-type-body-small) var(--font); }
.per-run .ceiling { color: var(--md-sys-color-primary); font: var(--talea-type-body-small-weight) var(--talea-type-body-small) var(--font); }
.share { height: 10px; border-radius: 5px; background: var(--md-sys-color-secondary-container); overflow: hidden; }
.share > span { display: block; height: 100%; border-radius: 5px; background: var(--md-sys-color-primary); }
.share.high > span { background: var(--md-sys-color-error); }
/* Kontingent (§9.5.3): a window's name, its share, its bar, when it is free. */
.window-use { display: flex; flex-direction: column; gap: 4px; }
.days { display: flex; flex-direction: column; gap: 8px; }
.days-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.chart-wrap { position: relative; }
.chart { touch-action: pan-y; user-select: none; -webkit-user-select: none; display: flex; align-items: flex-end; height: 140px; border-bottom: 1px solid var(--md-sys-color-outline-variant); }
/* The chart's axis (§9.5.3, Q561): two gridlines, their EUR value at the trailing edge. */
.chart-grid { z-index: 1; position: absolute; left: 0; right: 0; border-top: 1px solid var(--md-sys-color-outline-variant); pointer-events: none; }
.chart-grid > span { position: absolute; right: 0; top: 2px; padding-left: 4px; background: var(--md-sys-color-background); color: var(--md-sys-color-on-surface-variant); font: var(--talea-type-label-small-weight) var(--talea-type-label-small) var(--font); }
.bar-slot { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; cursor: pointer; }
.bar-slot:focus-visible { outline: 2px solid var(--md-sys-color-primary); outline-offset: 2px; }
.bar { width: 70%; display: flex; flex-direction: column-reverse; min-height: 0; border-radius: 2px 2px 0 0; overflow: hidden; }
.bar > span { display: block; min-height: 1px; }
/* A day answers a touch or a pointer alike (§9.5.3, Q561): the callout over its bar. */
.day-callout {
  position: absolute;
  left: 0;
  bottom: 100%;
  z-index: 3;
  min-width: 140px;
  margin-bottom: 4px;
  padding: 8px;
  border-radius: var(--talea-shape-small);
  background: var(--md-sys-color-surface-container-high);
  box-shadow: var(--talea-elevation-2);
  white-space: nowrap;
}
.day-callout-head { margin: 0 0 4px; color: var(--md-sys-color-on-surface); }
.day-callout-row { display: flex; align-items: center; gap: 6px; margin: 2px 0; color: var(--md-sys-color-on-surface-variant); }
.chart-dates { display: flex; justify-content: space-between; color: var(--md-sys-color-on-surface-variant); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; font: var(--talea-type-label-medium-weight) var(--talea-type-label-medium) var(--font); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.consumers { display: flex; flex-direction: column; gap: 8px; }
.consumer { display: flex; flex-direction: column; gap: 2px; }
.consumer-head { display: flex; align-items: baseline; gap: 8px; }
.consumer-sum { margin-left: auto; }
.consumer-row { display: flex; align-items: center; gap: 8px; }
.consumer-bar { flex: 1; height: 4px; border-radius: 2px; background: var(--md-sys-color-surface-container-high); overflow: hidden; }
.consumer-bar > span { display: block; height: 100%; }
.consumer-runs { flex: 0 0 76px; width: 76px; text-align: right; }
.consumer.plain { padding: 4px 0; }
/* The long tail (§9.5.3, Q561): folded under one row, no bar past the eighth. */
.costs-more {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 56px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--md-sys-color-on-surface);
  cursor: pointer;
  text-align: left;
}
/* The two-column layout from 840 px (§9.5.3, Q561): the left column sticky, the right scrolling. */
.costs.two-col { display: grid; grid-template-columns: 360px 1fr; gap: 16px; align-items: start; }
.costs-left { position: sticky; top: 0; display: flex; flex-direction: column; gap: 12px; }
.costs-right { min-width: 0; }
/* The scroll area keeps its last row clear of the navigation bar (§6.2, §9.5.3, Q561). */
.frame.with-bar .costs { padding-bottom: calc(var(--talea-navbar) + env(safe-area-inset-bottom)); }

.prose-card { padding: 12px; border-radius: var(--talea-shape-medium); background: var(--md-sys-color-surface-container); font: var(--talea-type-body-medium-weight) var(--talea-type-body-medium) var(--font); }
.items { display: flex; flex-direction: column; gap: 6px; }
.item { display: flex; gap: 10px; font: var(--talea-type-body-medium-weight) var(--talea-type-body-medium) var(--font); }
.item-day { flex: none; width: 72px; padding-right: 10px; border-right: 2px solid var(--md-sys-color-outline-variant); color: var(--md-sys-color-primary); font: var(--talea-type-label-medium-weight) var(--talea-type-label-medium) var(--font); }
.item-dot { flex: none; width: 6px; height: 6px; margin-top: 7px; border-radius: 50%; background: var(--md-sys-color-primary); }
.item-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }

.keys { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; }
.key-row { display: contents; }
.keys dt, .keys dd { margin: 0; font: var(--talea-type-body-medium-weight) var(--talea-type-body-medium) var(--font); }
.keys kbd { font-family: var(--mono); padding: 1px 6px; border-radius: 4px; background: var(--md-sys-color-surface-container-highest); white-space: nowrap; }

/* --- the workshop (§9.4) ------------------------------------------------------------------ */

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.pane.list-pane.wide { flex: 0 0 var(--talea-workshop-pane); max-width: var(--talea-workshop-pane); }
.ws-column { display: flex; flex-direction: column; gap: 8px; padding: 12px; max-width: var(--talea-detail-max); margin: 0 auto; }
.ws-list.list-pane .ws-column { max-width: none; }
.ws-group { display: flex; flex-direction: column; gap: 8px; }
.ws-head { margin: 8px 0 0; padding: 8px 10px; color: var(--md-sys-color-primary); font: var(--talea-type-title-small-weight) var(--talea-type-title-small) var(--font); }
.ws-fold {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--talea-shape-small);
  background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-primary);
  cursor: pointer;
  font: var(--talea-type-title-small-weight) var(--talea-type-title-small) var(--font);
}
.ws-notice {
  display: block;
  width: 100%;
  padding: 4px 16px;
  border: 0;
  background: none;
  color: var(--md-sys-color-primary);
  text-align: start;
  cursor: pointer;
  font: var(--talea-type-body-small-weight) var(--talea-type-body-small) var(--font);
}
.ws-empty { color: var(--md-sys-color-on-surface-variant); padding: 4px 8px; font: var(--talea-type-body-large-weight) var(--talea-type-body-large) var(--font); }
.ws-calm { color: var(--md-sys-color-on-surface-variant); padding: 4px 8px; font: var(--talea-type-body-large-weight) var(--talea-type-body-large) var(--font); }
.ticket-preview.current { box-shadow: inset 3px 0 0 var(--md-sys-color-primary); }

.ws-detail { display: flex; flex-direction: column; gap: 12px; padding: 0 16px 16px; max-width: var(--talea-detail-max); margin: 0 auto; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-block;
  padding: 4px 8px;
  border-radius: var(--talea-shape-small);
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface-variant);
  font: var(--talea-type-label-medium-weight) var(--talea-type-label-medium) var(--font);
}
.chip.waiting { background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); }
.chip.ok { background: var(--md-sys-color-tertiary-container); color: var(--md-sys-color-on-tertiary-container); }
.chip.doubt { background: var(--talea-amber); color: var(--talea-on-amber); }
.chip.no { background: var(--md-sys-color-error-container); color: var(--md-sys-color-on-error-container); }
.ws-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border-radius: var(--talea-shape-medium);
  background: var(--md-sys-color-surface-container-low);
  color: var(--md-sys-color-on-surface);
  overflow-wrap: anywhere;
  font: var(--talea-type-body-large-weight) var(--talea-type-body-large) var(--font);
}
.ws-section-head { display: flex; align-items: center; gap: 8px; }
.ws-head-facts { display: flex; flex-direction: column; gap: 8px; }
.ws-about { padding: 0 4px; color: var(--md-sys-color-on-surface); overflow-wrap: anywhere; font: var(--talea-type-body-large-weight) var(--talea-type-body-large) var(--font); }
.ws-held { margin: 0; padding: 0 4px; color: var(--md-sys-color-on-surface-variant); font: var(--talea-type-body-medium-weight) var(--talea-type-body-medium) var(--font); letter-spacing: var(--talea-type-body-medium-tracking); }
.ws-section-head h3 { flex: 1; margin: 0; color: var(--md-sys-color-primary); font: 600 var(--talea-type-title-medium) var(--font); letter-spacing: var(--talea-type-title-medium-tracking); }
.ws-section-head .ws-kind { margin-left: 8px; color: var(--md-sys-color-on-surface-variant); font-weight: 400; }
.ws-section-head .ws-kind::before { content: '·'; margin-right: 8px; }
/* The leads under a role's heading read as the paragraphs' heads, not as more headings. */
.ws-section .md-h3 { margin-top: 10px; color: var(--md-sys-color-on-surface); letter-spacing: 0; }
.ws-section-head h3.danger { color: var(--md-sys-color-error); }
.fold-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--md-sys-color-on-surface);
  cursor: pointer;
  font: var(--talea-type-title-small-weight) var(--talea-type-title-small) var(--font);
}
.ws-raw { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: var(--talea-type-body-small-weight) var(--talea-type-body-small) var(--mono); }
/* The roles (Q374): a name tag, and the ticket's way through them. */
.role-tag {
  align-self: flex-start;
  display: inline-block;
  padding: 1px 0;
  border-radius: var(--talea-shape-small);
  color: var(--md-sys-color-primary);
  font: 600 var(--talea-type-label-small) var(--font);
  letter-spacing: var(--talea-type-label-small-tracking);
  vertical-align: middle;
}
.role-tag.foreign { padding: 1px 6px; color: var(--md-sys-color-error); box-shadow: inset 0 0 0 1px var(--md-sys-color-error); }
.ws-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 0; padding: 0; list-style: none; font: var(--talea-type-label-medium-weight) var(--talea-type-label-medium) var(--font); }
.ws-chain.one-line {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
}
.ws-chain.one-line.more-before { mask-image: linear-gradient(to right, transparent, #000 24px); }
.ws-chain.one-line.more-after { mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent); }
.ws-chain.one-line.more-before.more-after { mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 24px), transparent); }
.ws-chain.one-line > .chain-step { flex: none; }
.chain-step { display: inline-flex; align-items: center; gap: 4px; color: var(--md-sys-color-on-surface-variant); opacity: 0.55; }
.chain-step.done { opacity: 0.8; }
.chain-step.now { opacity: 1; color: var(--md-sys-color-primary); font-weight: 600; }
.chain-step.waiting { opacity: 1; color: var(--md-sys-color-primary); font-weight: 600; }
.chain-step.waiting > span:last-child { padding: 1px 6px; border-radius: var(--talea-shape-small); background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); }
.chain-step.failed { opacity: 1; color: var(--md-sys-color-error); font-weight: 600; }
.chain-arrow { color: var(--md-sys-color-outline); font-weight: 400; }
.chain-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: chain-pulse 1.4s ease-in-out infinite; }
@keyframes chain-pulse { 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { .chain-dot { animation: none; } }
.ws-words { margin: 0; padding-left: 10px; border-left: 3px solid var(--md-sys-color-primary); font-style: italic; white-space: pre-wrap; }
.ws-words.folded { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.ws-words-foot { display: flex; align-items: center; justify-content: space-between; }
.ws-reply { padding-left: 10px; border-left: 3px solid var(--md-sys-color-outline-variant); }
.ws-reply > p { margin: 4px 0 0; white-space: pre-wrap; }
.ws-reply.asking { border-left-color: var(--md-sys-color-primary); }
.ws-to { display: block; font-style: normal; }
.ws-answer { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.ws-answer > .outlined-field { align-self: stretch; }
.t-label-small { font: var(--talea-type-label-small-weight) var(--talea-type-label-small) var(--font); }
.t-label-medium { font: var(--talea-type-label-medium-weight) var(--talea-type-label-medium) var(--font); }
.findings { display: flex; flex-direction: column; gap: 10px; }
.finding-where { display: block; color: var(--md-sys-color-on-surface-variant); font: var(--talea-type-label-small-weight) var(--talea-type-label-small) var(--mono); overflow-wrap: anywhere; }

.step-bar {
  flex: none;
  padding: 8px 12px;
  border-top: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container);
}
.step-row { display: flex; align-items: center; gap: 4px; max-width: var(--talea-detail-max); margin: 0 auto; }
.step-bar.pressing .step-row { gap: 8px; padding: 6px 0; font: var(--talea-type-body-medium-weight) var(--talea-type-body-medium) var(--font); }
.dropdown {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 4px 0 8px;
  border: 0;
  border-radius: var(--talea-shape-full);
  background: none;
  color: var(--md-sys-color-primary);
  cursor: pointer;
  min-width: 0;
  font: var(--talea-type-label-large-weight) var(--talea-type-label-large) var(--font);
}
.dropdown > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.split { flex: 1; display: flex; gap: 4px; min-width: 0; justify-content: flex-end; }
.split-main {
  flex: 1;
  min-width: 0;
  padding: 0 12px;
  border-radius: 20px 4px 4px 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  font: var(--talea-type-title-medium-weight) var(--talea-type-title-medium) var(--font);
}
.split-main.whole { border-radius: var(--talea-shape-full); }
.split-more { padding: 0 12px; border-radius: 4px 20px 20px 4px; }
.split-only { padding: 0 20px; }
.sheet-title {
  margin: 0;
  padding: 0 20px 8px;
  color: var(--md-sys-color-on-surface-variant);
  font: var(--talea-type-label-large-weight) var(--talea-type-label-large) var(--font);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dialog.sheet.actions .dialog-body { padding: 16px 0; gap: 0; }
.dialog.wide { width: min(560px, calc(100vw - 32px)); }
.dialog.ask .dialog-title { font: var(--talea-type-title-medium-weight) var(--talea-type-title-medium) var(--font); }
.outlined-field textarea { resize: vertical; min-height: calc(3 * 1.5rem + 32px); max-height: calc(10 * 1.5rem + 32px); font: var(--talea-type-body-large-weight) var(--talea-type-body-large) var(--font); }

.contents {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  border-radius: var(--talea-shape-medium);
  background: var(--md-sys-color-surface-container-low);
}
.contents button {
  padding: 4px 14px;
  border: 0;
  background: none;
  color: var(--md-sys-color-primary);
  text-align: start;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.contents-part { padding-left: 26px !important; font: var(--talea-type-body-medium-weight) var(--talea-type-body-medium) var(--font); }
.plan-report { font: var(--talea-type-body-large-weight) var(--talea-type-body-large) var(--font); }
.plan-body { font: var(--talea-type-body-medium-weight) var(--talea-type-body-medium) var(--font); }

/* --- the Doku (§9.10) ------------------------------------------------------------------- */

.frame .panes.doku { background: var(--md-sys-color-background); }
.docs-list { display: flex; flex-direction: column; padding-bottom: 12px; }
.docs-head { margin-left: 6px; margin-right: 6px; }
a.list-row.docs-row { color: var(--md-sys-color-on-surface); text-decoration: none; min-height: 56px; }
.list-row.docs-row.current {
  width: 100%;
  margin: 0;
  padding-left: 16px;
  border-radius: 0;
  background: transparent;
  color: var(--md-sys-color-on-surface);
  box-shadow: inset 3px 0 0 var(--md-sys-color-primary);
}
.list-row.docs-row.current .row-second { color: var(--md-sys-color-on-surface-variant); }
.row-second.one { -webkit-line-clamp: 1; }
.docs-name { font: var(--talea-type-label-medium-weight) var(--talea-type-label-medium) var(--mono); }
.docs-search { gap: 4px; }
.docs-search-field {
  flex: 1;
  min-width: 0;
  height: 48px;
  border: 0;
  background: transparent;
  color: var(--md-sys-color-on-surface);
  font: var(--talea-type-body-large-weight) var(--talea-type-body-large) var(--font);
  letter-spacing: var(--talea-type-body-large-tracking);
}
.docs-search-field:focus { outline: none; }
.docs-search .search-counter { padding-right: 12px; white-space: nowrap; }
.docs-detail { display: flex; flex-direction: column; gap: 12px; padding: 0 16px 16px; max-width: var(--talea-doc-max); margin: 0 auto; }
.docs-meta { margin: 0; color: var(--md-sys-color-on-surface-variant); font: var(--talea-type-label-medium-weight) var(--talea-type-label-medium) var(--font); overflow-wrap: anywhere; }
.docs-detail .contents { margin-top: 4px; }
.docs-body { font: var(--talea-type-body-medium-weight) var(--talea-type-body-medium) var(--font); letter-spacing: var(--talea-type-body-medium-tracking); }
/* The decision ledger is thousands of blocks: a part is drawn near the screen
   only, and inside it what is off screen is not laid out. */
.docs-body { display: flex; flex-direction: column; gap: 10px; }
.docs-part > .md-doc > * { content-visibility: auto; contain-intrinsic-size: auto 80px; }
.docs-body [id^="doc-"], .docs-body [data-ids] { scroll-margin-top: 8px; }
.docs-body [id^="doc-"]:focus { outline: none; }
.md-doc s { color: var(--md-sys-color-on-surface-variant); }
.md-doc span.ref { text-decoration: underline dotted; text-underline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .md-doc .ref[data-tip]::after { white-space: normal; width: max-content; max-width: 320px; text-align: start; }
  /* A table scrolls sideways; a hidden tip in it would still be overflow and
     give it a scroll up and down. Shown, it stays inside: above in the last
     row, from the start in the first column. */
  .md-table [data-tip]:not(:hover, :focus-visible)::after { display: none; }
  .md-table tr:last-child [data-tip]::after { top: auto; bottom: calc(100% + 4px); }
  .md-table td:first-child [data-tip]::after { left: 0; transform: none; }
  @starting-style { .md-table [data-tip]:hover::after { opacity: 0; visibility: hidden; } }
}
.docs-history { display: flex; flex-direction: column; gap: 6px; padding: 4px 0 8px; }
.docs-change { display: flex; gap: 12px; font: var(--talea-type-body-medium-weight) var(--talea-type-body-medium) var(--font); }
.docs-change-day { flex: none; color: var(--md-sys-color-on-surface-variant); font-variant-numeric: tabular-nums; }
.docs-change-subject { min-width: 0; overflow-wrap: anywhere; }

/* --- motion (§4.7) -------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0s !important; transition-duration: 0s !important; }
  .line.flash > .hers, .line.flash > .notice { animation: none; background-color: color-mix(in srgb, var(--talea-flash) 45%, var(--talea-bubble-hers)); }
  .line.flash > .his { animation: none; background-color: color-mix(in srgb, var(--talea-flash) 45%, var(--talea-bubble-his)); }
  .progress > span { animation-duration: 1.6s !important; }
}

/* His and her notes (ui.md §9.13, Q425, Q435). */
.badged { position: relative; display: inline-flex; }
.badged > .badge { left: 24px; top: 6px; pointer-events: none; }

.notes { position: relative; }
.notes-board { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 4px 12px 16px; max-width: var(--talea-grid-max); margin: 0 auto; box-sizing: border-box; width: 100%; }
@media (min-width: 600px) { .notes-board { padding: 4px 16px 16px; } }
.notes-search {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 720px;
  height: 56px;
  padding: 0 4px 0 16px;
  box-sizing: border-box;
  border-radius: var(--talea-shape-full);
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface-variant);
}
.notes-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: none;
  color: var(--md-sys-color-on-surface);
  outline: none;
  font: var(--talea-type-body-large-weight) var(--talea-type-body-large) var(--font);
}
.notes-search input::-webkit-search-cancel-button { display: none; }
.notes-search input::placeholder { color: var(--md-sys-color-on-surface-variant); }
.notes-search:focus-within { box-shadow: inset 0 0 0 2px var(--md-sys-color-primary); }
.notes-tools { display: flex; align-items: center; gap: 8px; width: 100%; max-width: var(--talea-detail-max); }
.notes.compact .notes-tools { gap: 0; }
.notes-tools > .notes-search { flex: 1; min-width: 0; max-width: none; }
.notes.compact .notes-tools > .notes-search { margin-right: 4px; }
.icon-button.notes-new { background-color: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.button.notes-new { flex: none; height: 56px; }
.notes-grid-frame { width: 100%; }
.notes-grid { display: grid; gap: 8px; align-items: start; }
@media (min-width: 600px) { .notes-grid { gap: 16px; } }
.notes-column { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
@media (min-width: 600px) { .notes-column { gap: 16px; } }
.notes-heading { align-self: flex-start; margin: 16px 0 8px; color: var(--md-sys-color-on-surface-variant); font: var(--talea-type-label-large-weight) var(--talea-type-label-large) var(--font); letter-spacing: var(--talea-type-label-large-tracking); }
.notes-empty { padding: 32px 16px; text-align: center; }
.notes-empty .empty-state { color: var(--md-sys-color-on-surface); }
.notes-empty-more { margin-top: 8px; color: var(--md-sys-color-on-surface-variant); font: var(--talea-type-body-medium-weight) var(--talea-type-body-medium) var(--font); }
.notes-grid-frame > .empty-state { padding: 32px 16px; text-align: center; color: var(--md-sys-color-on-surface-variant); }

.note-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--talea-shape-medium);
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  cursor: pointer;
  min-width: 0;
  overflow-wrap: anywhere;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: box-shadow var(--talea-duration-short) var(--talea-ease-standard), border-color var(--talea-duration-short) var(--talea-ease-standard);
  font: var(--talea-type-body-medium-weight) var(--talea-type-body-medium) var(--font);
}
.note-tile:focus-visible { outline: 3px solid var(--md-sys-color-secondary); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .note-tile:hover { border-color: var(--md-sys-color-outline); box-shadow: var(--talea-elevation-1); }
}
.note-tile-title {
  margin: 0;
  padding-right: 28px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font: var(--talea-type-title-medium-weight) var(--talea-type-title-medium) var(--font);
  letter-spacing: var(--talea-type-title-medium-tracking);
}
.note-tile-untitled { color: var(--md-sys-color-on-surface-variant); }
.note-tile-text {
  margin: 0;
  white-space: pre-wrap;
  display: -webkit-box;
  -webkit-line-clamp: 10;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.note-tile-line { display: block; }
.note-tile-item { display: flex; align-items: flex-start; gap: 8px; }
.note-tile-item input[type='checkbox'] { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--md-sys-color-primary); cursor: pointer; }
.note-tile-words { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.note-box { flex: none; width: 18px; height: 18px; margin-top: 1px; box-sizing: border-box; border: 2px solid var(--md-sys-color-on-surface-variant); border-radius: 2px; }
.note-tile-count { margin-top: 2px; color: var(--md-sys-color-on-surface-variant); font: var(--talea-type-label-medium-weight) var(--talea-type-label-medium) var(--font); }
.note-tile.done { color: var(--md-sys-color-on-surface-variant); }
.note-dot { position: absolute; top: 12px; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--md-sys-color-tertiary); }
.note-tile-her { margin-top: 2px; color: var(--md-sys-color-tertiary); font: var(--talea-type-label-small-weight) var(--talea-type-label-small) var(--font); }
.notes-hit { border-radius: 4px; background: var(--md-sys-color-tertiary-container); color: var(--md-sys-color-on-tertiary-container); }

.dialog.note-dialog { width: min(640px, calc(100vw - 48px)); height: min(880px, calc(100dvh - 48px)); max-width: none; max-height: none; overflow: hidden; }
.dialog.note-dialog .dialog-body { height: 100%; padding: 0; gap: 0; box-sizing: border-box; }
.note-open { display: flex; flex-direction: column; min-height: 0; }
.dialog .note-open { height: 100%; }
/* §9.13.8: the Verlauf, a column of 280 px beside the note, or a page. */
.note-split { display: flex; height: 100%; min-height: 0; }
.note-split > .note-open { flex: 1; min-width: 0; }
.dialog.note-dialog.with-history { width: min(920px, calc(100vw - 48px)); }
.note-history { display: flex; flex-direction: column; flex: none; width: 280px; min-height: 0; border-inline-start: 1px solid var(--md-sys-color-outline-variant); }
.note-history-title { margin: 0; padding: 20px 16px 8px; font: var(--talea-type-title-medium-weight) var(--talea-type-title-medium) var(--font); color: var(--md-sys-color-on-surface); }
.note-history-list { display: flex; flex-direction: column; overflow-y: auto; min-height: 0; padding-bottom: 8px; outline: none; }
.note-history-row { display: flex; align-items: center; gap: 4px; min-height: 56px; padding: 0 16px; box-sizing: border-box; cursor: pointer; }
.note-history-row.chosen { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.note-history-list:focus-visible .note-history-row.chosen { outline: 2px solid var(--md-sys-color-primary); outline-offset: -2px; }
@media (hover: hover) and (pointer: fine) {
  .note-history-row:not(.chosen):hover { background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent); }
}
.note-history-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.note-history-restore { margin-inline-end: -8px; color: var(--md-sys-color-on-secondary-container); }
.note-stand-title { margin: 0; padding-top: 6px; }
.note-foot-gap { flex: 1; }
.note-foot .note-edited { margin: 0 8px; }
.note-edited-line { display: flex; justify-content: flex-end; margin: 16px 0 0; }
.note-history-when { font: var(--talea-type-body-medium-weight) var(--talea-type-body-medium) var(--font); }
.note-history-who { font: var(--talea-type-label-medium-weight) var(--talea-type-label-medium) var(--font); color: var(--md-sys-color-on-surface-variant); }
.note-history-row.chosen .note-history-who { color: inherit; }
/* §9.13.11: Teilen */
.share-dialog .dialog-body { gap: 12px; }
.share-url { padding: 12px; border-radius: 8px; background: var(--md-sys-color-surface-container-highest); overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; font: var(--talea-type-body-medium-weight) var(--talea-type-body-medium) var(--font); }
.share-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.share-list { list-style: none; margin: 8px 0 0; padding: 8px 0 0; border-top: 1px solid var(--md-sys-color-outline-variant); display: flex; flex-direction: column; gap: 4px; }
.share-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.note-stand { display: flex; flex-direction: column; gap: 8px; }
.note-head { display: flex; align-items: flex-start; gap: 4px; flex: none; }
.dialog .note-head { padding: 16px 12px 4px 24px; }
.note-head .note-title-field { flex: 1; padding-top: 6px; }
.note-scroll { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: var(--md-sys-color-outline-variant) transparent; }
.dialog .note-scroll .note-body { padding: 8px 24px 16px; max-width: none; }
.note-scroll .note-body { flex: 1 0 auto; }
.note-foot { display: flex; align-items: center; flex: none; padding: 8px 12px; color: var(--md-sys-color-on-surface-variant); }
.note-page > .note-foot { height: 56px; padding: 0 4px; background: var(--md-sys-color-surface-container); }
.note-page > .note-foot .icon-button { height: 56px; }
.note-page .note-head { padding: 0 16px; max-width: var(--talea-page-max); margin: 0 auto; width: 100%; box-sizing: border-box; }
.note-pin { color: var(--md-sys-color-on-surface-variant); }
.note-pin.pinned { color: var(--md-sys-color-on-surface); }
.note-tile-pin { position: absolute; top: 2px; right: 2px; width: 40px; height: 40px; }
.note-tile:not(.pinned) .note-tile-pin { opacity: 0; }
.note-tile:hover .note-tile-pin, .note-tile:focus-within .note-tile-pin { opacity: 1; }
.note-tile .note-dot { right: 44px; top: 18px; }
.note-tile:hover .note-dot, .note-tile:focus-within .note-dot { opacity: 1; }
.note-page .top-actions .icon-button[aria-pressed='true'], .note-foot .icon-button[aria-pressed='true'] { color: var(--md-sys-color-primary); }
.note-body { display: flex; flex-direction: column; gap: 8px; padding: 8px 16px 24px; max-width: var(--talea-page-max); margin: 0 auto; width: 100%; box-sizing: border-box; }
.note-title-field, .note-item, .note-text {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--md-sys-color-on-surface);
  outline: none;
  resize: none;
  overflow: hidden;
  min-width: 0;
  box-sizing: border-box;
}
.note-title-field { padding: 4px 0; font: var(--talea-type-title-large-weight) var(--talea-type-title-large) var(--font); letter-spacing: var(--talea-type-title-large-tracking); }
.note-title-field::placeholder, .note-text::placeholder { color: var(--md-sys-color-on-surface-variant); }
.note-text { flex: 1 0 auto; min-height: 160px; font: var(--talea-type-body-large-weight) var(--talea-type-body-large) var(--font); }
.note-edited { white-space: nowrap; color: var(--md-sys-color-on-surface-variant); font: var(--talea-type-label-medium-weight) var(--talea-type-label-medium) var(--font); }
.note-list { display: flex; flex-direction: column; margin: 0 -8px; }
.note-row { position: relative; display: flex; align-items: flex-start; min-height: 48px; border-radius: var(--talea-shape-small); background: var(--md-sys-color-surface-container-high); }
.note-page .note-row { background: var(--md-sys-color-surface); }
.note-handle, .note-handle-space { flex: none; display: flex; align-items: center; justify-content: center; width: 24px; height: 48px; color: var(--md-sys-color-on-surface-variant); touch-action: none; }
.note-handle { cursor: grab; }
@media (hover: hover) and (pointer: fine) {
  .note-handle { opacity: 0; }
  .note-row:hover .note-handle, .note-row.lifted .note-handle { opacity: 1; }
  .note-remove { opacity: 0; }
  .note-row:hover .note-remove { opacity: 1; }
}
.note-row:not(:focus-within) .note-remove { visibility: hidden; }
@media (hover: hover) and (pointer: fine) { .note-row:hover .note-remove { visibility: visible; } }
.note-check, .note-check-space { flex: none; display: flex; align-items: center; justify-content: center; width: 40px; height: 48px; cursor: pointer; }
.note-check-space { width: 8px; }
.note-check-space.note-bullet { width: 40px; color: var(--md-sys-color-on-surface-variant); }
.note-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--md-sys-color-primary); cursor: pointer; }
.note-item { flex: 1; padding: 12px 0; font: var(--talea-type-body-large-weight) var(--talea-type-body-large) var(--font); }
.note-remove { width: 40px; height: 48px; color: var(--md-sys-color-on-surface-variant); }
.note-row.ticked .note-item { color: var(--md-sys-color-on-surface-variant); text-decoration: line-through; }
.note-row.fresh { animation: note-fresh 2500ms var(--talea-ease-standard); }
@keyframes note-fresh { 0%, 36% { background-color: color-mix(in srgb, var(--md-sys-color-tertiary-container) 100%, transparent); } }
.note-row.lifted { z-index: 2; background: var(--md-sys-color-surface-container-highest); box-shadow: var(--talea-elevation-2); cursor: grabbing; }
.note-row.drop-here { box-shadow: inset 0 2px 0 var(--md-sys-color-primary); }
.note-add { display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 8px 0 32px; border: 0; border-radius: var(--talea-shape-small); background: none; color: var(--md-sys-color-on-surface-variant); text-align: start; cursor: pointer; font: var(--talea-type-body-large-weight) var(--talea-type-body-large) var(--font); }
.note-add:focus-visible { outline: 3px solid var(--md-sys-color-secondary); outline-offset: -3px; }
.note-sunk { display: flex; flex-direction: column; margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--md-sys-color-outline-variant); }
.note-fold { gap: 8px; padding: 8px 8px 8px 30px; color: var(--md-sys-color-on-surface-variant); font: var(--talea-type-label-large-weight) var(--talea-type-label-large) var(--font); }
.note-mine { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: var(--talea-shape-small); background: var(--md-sys-color-surface-container-highest); }
.note-mine pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: var(--talea-type-body-medium-weight) var(--talea-type-body-medium) var(--font); user-select: text; }
.note-tile-line.heading { font: var(--talea-type-title-small-weight) var(--talea-type-title-small) var(--font); letter-spacing: var(--talea-type-title-small-tracking); }
.note-tile-line.quote { color: var(--md-sys-color-on-surface-variant); font-style: italic; }
.note-tile-line, .note-tile-words { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.note-tile-marker { flex: none; min-width: 18px; color: var(--md-sys-color-on-surface-variant); text-align: center; }
.note-tile-item.ticked .note-tile-words { color: var(--md-sys-color-on-surface-variant); text-decoration: line-through; }
.note-box.done { display: flex; align-items: center; justify-content: center; border-color: var(--md-sys-color-on-surface-variant); }
.note-doc { flex: 1 0 auto; display: flex; flex-direction: column; gap: 10px; cursor: text; color: var(--md-sys-color-on-surface); font: var(--talea-type-body-large-weight) var(--talea-type-body-large) var(--font); }
.note-doc-run { cursor: text; overflow-wrap: anywhere; }
/* ui.md 8.1 "In a note": a note uses the phone's space. */
.note-doc { gap: 5px; font: var(--talea-type-body-medium-weight) var(--talea-type-body-medium) var(--font); }
.note-doc .md-doc { gap: 5px; }
.note-doc .md-h1 { margin-top: 6px; }
.note-doc .md-h2 { margin-top: 7px; }
.note-doc .md-h3 { margin-top: 3px; font: var(--talea-type-title-medium-weight) var(--talea-type-title-medium) var(--font); letter-spacing: var(--talea-type-title-medium-tracking); }
.note-doc .md-h4, .note-doc .md-h5, .note-doc .md-h6 { margin-top: 2px; }
.note-doc .md-ul, .note-doc .md-ol { gap: 2px; }
.note-doc .md-marker { width: 12px; }
.note-doc .md-ol > li > .md-marker { width: 22px; }
.note-doc .md-table { width: 100%; max-width: none; overflow-x: auto; }
.note-doc .md-table table { width: 100% !important; min-width: 0 !important; max-width: none !important; table-layout: auto; }
/* Edge to edge on a phone only; from 600 px a table, code block and rule keep the text's side inset. */
@media (max-width: 599px) {
  .note-doc .md-table { width: calc(100% + 32px); margin: 0 -16px; border-radius: 0; }
  .note-doc > .md-code, .note-doc > .md-rule { margin-left: -16px; margin-right: -16px; width: calc(100% + 32px); border-radius: 0; box-sizing: border-box; }
}
/* The dialog is from 600 px only. Like Keep, a note that starts with a picture shows it above the title (notes.js
   leaves it out of the text then), edge to edge, the dialog's own top corners rounding it, whole unless taller than the cap. */
.note-lead { flex: none; }
.note-lead .note-picture { display: block; width: 100%; max-width: none; }
.note-lead .note-picture .md-picture { width: 100%; border-radius: 0; cursor: zoom-in; }
.note-lead .note-picture .md-picture img { width: 100%; max-height: min(60vh, 520px); object-fit: cover; }
.dialog.note-dialog.with-lead .note-head { padding-top: 12px; }
.note-doc .md-table col { width: auto !important; }
.note-doc .md-table th, .note-doc .md-table td { padding: 6px 8px; overflow-wrap: break-word; }
.note-doc-task { display: flex; align-items: flex-start; gap: 12px; min-height: 32px; padding: 4px 0; cursor: pointer; border-radius: var(--talea-shape-small); }
.note-doc-task input { flex: none; width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--md-sys-color-primary); cursor: pointer; }
.note-doc-task.ticked > span { color: var(--md-sys-color-on-surface-variant); text-decoration: line-through; }
.note-doc-task.fresh { animation: note-fresh 2500ms var(--talea-ease-standard); }
/* Was ist neu (§9.5.3, Q571): one tonal card per release. */
.whatsnew-card { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 16px; background: var(--md-sys-color-surface-container); }
.whatsnew-card > * { margin: 0; }

/* Opener (§9.5.3, Q593): a card per turn, a table per number; 44 px and up for what is tapped. */
.segmented.tall > button { height: 48px; }
.opener-turns, .opener-rounds { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.opener-turn { display: flex; flex-direction: column; gap: 6px; padding: 12px 16px; border-radius: var(--talea-shape-large); background: var(--md-sys-color-surface-container); color: var(--md-sys-color-on-surface); }
.opener-head, .opener-line, .opener-said, .opener-answer { margin: 0; overflow-wrap: anywhere; }
.opener-line, .opener-said, .opener-answer { user-select: text; -webkit-user-select: text; font: var(--talea-type-body-medium-weight) var(--talea-type-body-medium) var(--font); }
.opener-said { font-weight: 600; }
.opener-rounds { gap: 4px; }
.opener-rounds > li { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-height: 28px; }
.opener-text { min-width: 0; overflow-wrap: anywhere; font: var(--talea-type-body-medium-weight) var(--talea-type-body-medium) var(--font); }
.opener-rounds .chip { flex: none; }
.opener-sum { width: 100%; border-collapse: collapse; color: var(--md-sys-color-on-surface); font: var(--talea-type-body-medium-weight) var(--talea-type-body-medium) var(--font); }
.opener-sum th, .opener-sum td { padding: 8px 4px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--md-sys-color-outline-variant); }
.opener-sum thead th { color: var(--md-sys-color-on-surface-variant); font: var(--talea-type-label-medium-weight) var(--talea-type-label-medium) var(--font); }
.opener-why { display: block; }

/* --- Anrufe (§9.5.6) ------------------------------------------------------------------- */

.call-row { min-height: 88px; }
.call-row .row-text { gap: 2px; }
.row-second.one-line { -webkit-line-clamp: 1; }
.row-second .bad { color: var(--md-sys-color-error); }
.call-cost { font: var(--talea-type-body-small-weight) var(--talea-type-body-small) var(--font); }
.row-lead.trail { width: 24px; }
.live-dot {
  flex: none;
  width: 8px;
  height: 8px;
  margin: 0 8px;
  border-radius: var(--talea-shape-full);
  background: var(--md-sys-color-primary);
  animation: call-pulse 1.4s ease-in-out infinite;
}
@keyframes call-pulse { 50% { opacity: 0.35; } }
.call-column { display: flex; flex-direction: column; gap: 12px; padding: 12px 16px 24px; }
.call-part { display: flex; flex-direction: column; gap: 8px; }
.part-head { margin: 0; color: var(--md-sys-color-on-surface); font: var(--talea-type-title-small-weight) var(--talea-type-title-small) var(--font); }
.call-column p { margin: 0; }
.call-note { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: var(--talea-shape-medium); background: var(--md-sys-color-surface-container); }
.call-summary { color: var(--md-sys-color-on-surface-variant); }
.call-rec { display: flex; align-items: center; gap: 12px; }
.call-rec .button { gap: 8px; }
.rec-progress { height: 4px; border-radius: 2px; background: var(--md-sys-color-surface-container-highest); overflow: hidden; }
.rec-progress span { display: block; height: 100%; background: var(--md-sys-color-primary); }
.dialogue { list-style: none; margin: 0; padding: 0; }
.dlg { display: flex; gap: 8px; margin-top: 16px; }
.dlg.same { margin-top: 8px; }
.dlg:first-child { margin-top: 0; }
.dlg-time {
  flex: none;
  width: 48px;
  color: var(--md-sys-color-on-surface-variant);
  font: var(--talea-type-label-small-weight) var(--talea-type-label-small) var(--font);
  font-variant-numeric: tabular-nums;
  padding-top: 3px;
}
.dlg-body { display: flex; flex-direction: column; min-width: 0; }
.dlg-name { color: var(--md-sys-color-on-surface); font: var(--talea-type-label-large-weight) var(--talea-type-label-large) var(--font); }
.dlg-name.talea { color: var(--md-sys-color-primary); }
.dlg-text { font: var(--talea-type-body-large-weight) var(--talea-type-body-large) var(--font); user-select: text; overflow-wrap: anywhere; }
.call-switch { margin-top: 12px; }
.button.danger { color: var(--md-sys-color-error); }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
