/* @adrifact/ui: the look of the shared parts. A site loads it before its own styles.css, which may go over it. */
:root {
  --background: #ffffff;
  --surface: #ffffff;
  --foreground: #171717;
  --muted: #5f6368;
  --border: #d9dbdf;
  --accent: #171717;
  --accent-text: #ffffff;
  --danger: #c5221f;
  --danger-text: #ffffff;
  --danger-soft: rgba(197, 34, 31, 0.1);
  --amber: #b06000;
  --amber-soft: rgba(245, 158, 11, 0.14);
  --success-soft: rgba(30, 142, 62, 0.12);
  --success: #1e8e3e;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --background: #0a0a0a;
    --surface: #111214;
    --foreground: #ededed;
    --muted: #a1a5ab;
    --border: #2c2e33;
    --accent: #ededed;
    --accent-text: #0a0a0a;
    --danger: #ea4335;
    --danger-text: #ffffff;
    --amber: #fbbc04;
    --success: #5bb974;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --background: #0a0a0a;
  --surface: #111214;
  --foreground: #ededed;
  --muted: #a1a5ab;
  --border: #2c2e33;
  --accent: #ededed;
  --accent-text: #0a0a0a;
  --danger: #ea4335;
  --danger-text: #ffffff;
  --amber: #fbbc04;
  --success: #5bb974;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { font-size: clamp(1rem, calc(0.40625rem + min(1.3vh, 0.8vw)), 1.5rem); }
body { margin: 0; background: var(--background); color: var(--foreground); font-family: Arial, Helvetica, sans-serif; line-height: 1.45; }
a { color: inherit; text-underline-offset: 4px; }
h1 { font-size: 1.6rem; margin: 0; font-weight: 600; }
h2 { font-size: 1.05rem; margin: 0; font-weight: 600; }
p { margin: 0; }

.muted { color: var(--muted); font-size: 0.9rem; }
.row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.9rem; }
.field input, .field select { font: inherit; font-size: 1rem; padding: 0.6rem 0.75rem; border: 1px solid var(--border); border-radius: 0.5rem; background: var(--surface); color: var(--foreground); width: 100%; }
.field input:focus, .field select:focus { outline: 2px solid var(--foreground); outline-offset: 1px; }
.button { font: inherit; font-size: 0.95rem; padding: 0.6rem 1rem; border-radius: 0.5rem; border: 1px solid var(--border); background: transparent; color: var(--foreground); cursor: pointer; }
.button:disabled { opacity: 0.55; cursor: default; }
.button-primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.button-danger { background: var(--danger); color: var(--danger-text); border-color: var(--danger); }
.button-wide { width: 100%; }
.alert { border-radius: 0.5rem; padding: 0.7rem 0.9rem; font-size: 0.92rem; border: 1px solid; }
.alert-error { background: var(--danger-soft); border-color: var(--danger); }
.alert-success { background: var(--success-soft); border-color: var(--success); }
.alert-amber { background: var(--amber-soft); border-color: var(--amber); }
.alert-info { border-color: var(--border); }
.card { border: 1px solid var(--border); border-radius: 0.75rem; background: var(--surface); padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; }
.confirm-panel { border: 1px solid var(--danger); border-radius: 0.5rem; padding: 0.9rem; display: flex; flex-direction: column; gap: 0.75rem; }
.language-choice { display: flex; gap: 0.5rem; }
.link-button { font: inherit; background: none; border: 0; padding: 0; color: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.link-button[aria-current='true'] { font-weight: 700; text-decoration: none; }

@media (pointer: coarse) {
  .button, .field input, .field select { min-height: 2.75rem; }
}
.field-small { width: auto; font-size: 0.85rem; padding: 0.3rem 0.5rem; }
.field-label { font-size: 0.85rem; color: var(--muted); }
.code, textarea.code { font-family: ui-monospace, Consolas, monospace; font-size: 0.85rem; }
.check { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; }
.danger-text { color: var(--danger); }
.payload-builder { display: flex; flex-direction: column; gap: 0.5rem; }
.payload-name { font-family: ui-monospace, Consolas, monospace; font-size: 0.85rem; overflow-wrap: anywhere; }
.payload-add { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }
.payload-add input.field { flex: 1; min-width: 7rem; width: auto; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 20; }
.modal { position: fixed; z-index: 21; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(46rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); overflow-y: auto; }
input.field, select.field, textarea.field { font: inherit; font-size: 0.95rem; padding: 0.5rem 0.7rem; border: 1px solid var(--border); border-radius: 0.5rem; background: var(--surface); color: var(--foreground); width: 100%; }
input.field:focus, select.field:focus, textarea.field:focus { outline: 2px solid var(--foreground); outline-offset: 1px; }
.mapping-line, .payload-line { display: grid; grid-template-columns: minmax(6rem, 1fr) minmax(0, 1.6fr) auto; gap: 0.4rem; align-items: center; font-size: 0.85rem; }
.field textarea { font: inherit; font-size: 0.95rem; padding: 0.6rem 0.75rem; border: 1px solid var(--border); border-radius: 0.5rem; background: var(--surface); color: var(--foreground); width: 100%; }

/* The conversation screen (approved by the PO, 6 November 2026). */
.icon { display: block; flex: none; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 2.2rem; height: 2.2rem; border: 0; border-radius: 0.5rem; background: transparent; color: var(--foreground); cursor: pointer; flex-shrink: 0; }
.icon-button:hover { background: rgba(0, 0, 0, 0.06); }
/* Round 3, decision 1 (WhatsApp style): the head and the foot stay, only the messages scroll. */
.conversation { position: relative; gap: 1.1rem; height: var(--conversation-height, auto); min-height: 0; overflow: hidden; }
.conversation-head { position: relative; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.messages { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 1.1rem; padding-right: 0.25rem; }
.conversation-foot { position: relative; flex: none; display: flex; flex-direction: column; }
.new-below { position: absolute; bottom: calc(100% + 0.6rem); left: 50%; transform: translateX(-50%); z-index: 5; border: 1px solid var(--border); border-radius: 1rem; background: var(--surface); color: var(--foreground); padding: 0.35rem 0.9rem; font: inherit; font-size: 0.85rem; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14); cursor: pointer; white-space: nowrap; }
/* It runs to the bottom of what is visible on every screen; on a phone it fills it, above the keyboard (PO, 11 November). */
.message { display: flex; flex-direction: column; gap: 0.35rem; }
.message-meta { display: flex; align-items: baseline; gap: 0.5rem; }
.message-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.new-line { display: flex; align-items: center; gap: 0.75rem; color: var(--danger); font-size: 0.82rem; margin: 0.2rem 0 0.6rem; }
.new-line::before, .new-line::after { content: ''; flex: 1; border-top: 1px solid var(--foreground); }
.event-line { margin: 0.1rem 0; text-align: center; color: var(--muted); font-size: 0.82rem; font-style: italic; }
.working-line { display: flex; align-items: center; gap: 0.4rem; margin: 0 0 0.4rem; color: var(--muted); font-size: 0.85rem; }
.working-dots { display: inline-flex; gap: 0.2rem; }
.working-dots span { width: 0.3rem; height: 0.3rem; border-radius: 50%; background: currentColor; animation: working-dot 1.2s infinite ease-in-out; }
.working-dots span:nth-child(2) { animation-delay: 0.2s; }
.working-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes working-dot { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
.attachments { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.attachment { position: relative; display: inline-flex; }
.attachment-thumb img { display: block; width: 4.5rem; height: 4.5rem; object-fit: cover; border-radius: 0.5rem; background: rgba(127, 127, 127, 0.14); }
.attachment-chip { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.7rem 0.9rem; border-radius: 0.6rem; background: rgba(127, 127, 127, 0.14); text-decoration: none; font-size: 0.85rem; max-width: 16rem; }
.attachment-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-remove { position: absolute; top: -0.45rem; right: -0.45rem; width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 0; background: #5f6368; color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.attachment-remove .icon { width: 0.8rem; height: 0.8rem; }
.steps-fold { display: inline-flex; align-items: center; gap: 0.3rem; border: 0; background: transparent; padding: 0; color: var(--muted); font: inherit; font-size: 0.9rem; cursor: pointer; align-self: flex-start; }
.steps-fold .icon { width: 0.9rem; height: 0.9rem; }
/* The steps box, as in the Command Center: done with a tick, the step now with a pulsing dot, later ones with a ring. */
.steps-box { list-style: none; width: fit-content; max-width: min(100%, 30rem); margin: 0.6rem 0; padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: 0.75rem; background: var(--surface); display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.92rem; }
.steps-item { display: flex; align-items: flex-start; gap: 0.5rem; min-width: 0; }
.steps-title { min-width: 0; overflow-wrap: anywhere; }
.steps-item-done .steps-title { color: var(--muted); }
.steps-item-doing .steps-title { font-weight: 600; }
.steps-item-todo .steps-title { color: var(--muted); opacity: 0.7; }
.steps-mark { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 1.1em; height: 1.35em; color: var(--muted); }
.steps-mark .icon { width: 1em; height: 1em; }
.steps-now { width: 0.6em; height: 0.6em; border-radius: 50%; background: var(--foreground); animation: steps-now 1.4s ease-in-out infinite; }
.steps-item-stopped .steps-title { color: var(--muted); }
.steps-stopped { width: 0.55em; height: 0.55em; border-radius: 0.1em; background: var(--muted); }
.steps-next { width: 0.55em; height: 0.55em; border-radius: 50%; border: 1.5px solid var(--muted); opacity: 0.6; }
@keyframes steps-now { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .steps-now { animation: none; } }
.message-box { position: relative; display: flex; flex-direction: column; gap: 0.5rem; }
.message-row { display: flex; align-items: center; gap: 0.5rem; }
.message-input { flex: 1; display: flex; align-items: center; gap: 0.4rem; border: 1px solid var(--border); border-radius: 1.6rem; padding: 0.3rem 0.9rem 0.3rem 0.4rem; }
.message-input textarea { flex: 1; border: 0; outline: none; resize: none; font: inherit; line-height: 1.4; background: transparent; color: inherit; padding: 0.45rem 0; overflow-y: hidden; }
.message-input { align-items: flex-end; }
.message-input .icon-button { margin-bottom: 0.05rem; }
/* The prompt box of a form: the same box, a little squarer because it holds more lines. */
.prompt-box { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.9rem; }
.prompt-input { border-radius: 0.9rem; padding: 0.3rem 0.7rem 0.3rem 0.4rem; }
.prompt-box .prompt-input textarea, .prompt-box .prompt-input textarea:focus { flex: 1; min-height: 2.6rem; border: 0; outline: none; box-shadow: none; border-radius: 0; resize: none; font: inherit; font-size: 1rem; line-height: 1.4; background: transparent; color: inherit; padding: 0.45rem 0; width: auto; }
.send-button { width: 3rem; height: 3rem; flex: none; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.send-button:disabled { opacity: 0.4; cursor: default; }
.menu-backdrop { position: fixed; inset: 0; z-index: 30; }
.menu { position: absolute; z-index: 31; min-width: 13rem; background: var(--surface); border: 1px solid var(--border); border-radius: 0.75rem; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.16); padding: 0.4rem; display: flex; flex-direction: column; }
.menu-top-right { top: 0; right: 0; }
.menu-bottom-left { bottom: 3.5rem; left: 0; }
.menu-head { display: flex; justify-content: flex-end; }
.menu-foot { display: flex; justify-content: flex-start; padding-top: 0.2rem; }
.menu-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.75rem; border: 0; background: transparent; border-radius: 0.5rem; font: inherit; color: var(--foreground); text-align: left; cursor: pointer; }
.menu-item:hover { background: rgba(0, 0, 0, 0.06); }
.menu-item-danger { color: var(--danger); }

/* Step 3 of plan v2-next: search bar, Ctrl+K, sharing, recycle bin, history, saved lists, the bell, tagging. */
.search-bar, .tag-input, .bell { position: relative; }
.search-input { min-width: 14rem; }
.search-results { position: absolute; z-index: 15; left: 0; right: 0; top: calc(100% + 0.25rem); max-height: 24rem; overflow-y: auto; display: flex; flex-direction: column; gap: 0.15rem; padding: 0.4rem; }
.search-item, .palette-item, .bell-item { display: flex; justify-content: space-between; gap: 0.75rem; width: 100%; text-align: left; font: inherit; background: none; border: 0; border-radius: 0.4rem; padding: 0.5rem 0.6rem; color: inherit; cursor: pointer; }
.search-item:hover, .palette-item:hover, .bell-item:hover, .search-item-active, .palette-item-active { background: rgba(0, 0, 0, 0.06); }
.search-app { font-size: 0.85rem; white-space: nowrap; }
.palette { top: 18%; transform: translate(-50%, 0); display: flex; flex-direction: column; gap: 0.6rem; }
.palette-list { display: flex; flex-direction: column; gap: 0.1rem; max-height: 22rem; overflow-y: auto; }
.palette-foot { font-size: 0.8rem; }
.recent-list { display: flex; flex-direction: column; gap: 0.25rem; }
.recent-item { display: flex; justify-content: space-between; gap: 0.75rem; padding: 0.4rem 0; color: inherit; text-decoration: none; border-bottom: 1px solid var(--border); }
.share-panel, .recycle-bin, .history, .saved-lists { display: flex; flex-direction: column; gap: 0.75rem; }
.share-row { display: flex; flex-direction: column; gap: 0.5rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); }
.share-add { display: grid; grid-template-columns: 1fr auto auto; gap: 0.5rem; align-items: end; }
.bin-row { display: grid; grid-template-columns: auto 1fr auto; gap: 0.6rem; padding: 0.35rem 0; border-bottom: 1px solid var(--border); font-size: 0.95rem; }
.history-line { border-left: 2px solid var(--border); padding: 0.1rem 0 0.1rem 0.75rem; }
.history-line p { margin: 0.1rem 0; }
.history-old { text-decoration: line-through; color: var(--muted); }
.bell-button { position: relative; }
.bell-count { position: absolute; top: 0.1rem; right: 0.05rem; min-width: 1.1rem; height: 1.1rem; border-radius: 0.6rem; background: var(--danger); color: var(--danger-text); font-size: 0.7rem; display: flex; align-items: center; justify-content: center; padding: 0 0.25rem; }
.bell-list { position: absolute; z-index: 31; right: 0; top: calc(100% + 0.25rem); width: min(24rem, calc(100vw - 2rem)); max-height: 28rem; overflow-y: auto; display: flex; flex-direction: column; gap: 0.25rem; padding: 0.6rem; }
.bell-item { flex-direction: column; gap: 0.15rem; }
.bell-item-unread .bell-subject { font-weight: 700; }
/* The App Switcher (ADRIFACT-3): a grid button at the top left of the top bar, a grid of the person's apps. */
.app-switcher { position: relative; }
.app-switcher-panel { position: absolute; z-index: 31; left: 0; top: calc(100% + 0.25rem); width: min(20rem, calc(100vw - 2rem)); max-height: 28rem; overflow-y: auto; display: flex; flex-direction: column; gap: 0.5rem; padding: 0.75rem; }
.app-switcher-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.25rem; }
.app-switcher-tile { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; padding: 0.6rem 0.25rem; border-radius: 0.5rem; color: inherit; text-decoration: none; text-align: center; }
.app-switcher-tile:hover, .app-switcher-tile:focus-visible { background: rgba(0, 0, 0, 0.06); }
.app-switcher-tile-current { font-weight: 700; }
.app-switcher-initial { width: 2.5rem; height: 2.5rem; border-radius: 0.6rem; display: flex; align-items: center; justify-content: center; background: var(--accent); color: var(--accent-text); font-weight: 700; font-size: 1.1rem; }
.app-switcher-name { font-size: 0.8rem; overflow-wrap: anywhere; }
.tag-chip { display: inline-block; padding: 0 0.4rem; border-radius: 0.8rem; background: rgba(0, 0, 0, 0.07); color: inherit; text-decoration: none; font-size: 0.92em; }
.tag-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0.5rem; margin-top: 0.5rem; }
.record-card { position: relative; padding: 0.6rem 0.75rem; }
.record-card p { margin: 0.15rem 0 0; font-size: 0.85rem; }
.record-card-name { color: inherit; font-weight: 600; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .search-item:hover, html:not([data-theme="light"]) .palette-item:hover, html:not([data-theme="light"]) .bell-item:hover, html:not([data-theme="light"]) .app-switcher-tile:hover, html:not([data-theme="light"]) .search-item-active, html:not([data-theme="light"]) .palette-item-active, html:not([data-theme="light"]) .tag-chip { background: rgba(255, 255, 255, 0.1); }
}
html[data-theme="dark"] .search-item:hover, html[data-theme="dark"] .palette-item:hover, html[data-theme="dark"] .bell-item:hover, html[data-theme="dark"] .app-switcher-tile:hover, html[data-theme="dark"] .search-item-active, html[data-theme="dark"] .palette-item-active, html[data-theme="dark"] .tag-chip { background: rgba(255, 255, 255, 0.1); }
.app-tools { gap: 0.25rem; align-items: center; }
.record-panel { display: flex; flex-direction: column; gap: 0.75rem; }
.record-panel h3 { margin: 0; }
.record-tabs { gap: 1rem; border-bottom: 1px solid var(--border); padding-bottom: 0.4rem; }
.message-box { position: relative; }
.message-tags { position: absolute; bottom: 100%; left: 0; right: 0; z-index: 20; }
.notification-settings { display: flex; flex-direction: column; gap: 0.75rem; min-width: min(36rem, 90vw); }
.settings-app h4 { margin: 0 0 0.4rem; }
.settings-kind { padding: 0.35rem 0; border-bottom: 1px solid var(--border); gap: 1rem; }
.data-download, .data-import { min-width: min(30rem, 80vw); }
.import-problems { margin: 0; padding-left: 1.2rem; max-height: 16rem; overflow-y: auto; font-size: 0.92rem; }
.stack-tight { display: flex; flex-direction: column; gap: 0.25rem; }
/* Record pages and list views (after the Command Center's record page and List view): one look for every table. */
.tone-blue { --tone: #1a73e8; --tone-soft: rgba(26, 115, 232, 0.12); }
.tone-green { --tone: var(--success); --tone-soft: var(--success-soft); }
.tone-amber { --tone: var(--amber); --tone-soft: var(--amber-soft); }
.tone-red { --tone: var(--danger); --tone-soft: var(--danger-soft); }
.tone-purple { --tone: #8e44ad; --tone-soft: rgba(142, 68, 173, 0.13); }
.tone-grey { --tone: var(--muted); --tone-soft: rgba(127, 127, 127, 0.14); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.button-small { padding: 0.3rem 0.7rem; font-size: 0.88rem; }
.card-title { margin: 0 0 0.6rem; font-size: 1rem; }
.page-header { display: flex; flex-direction: column; gap: 0.6rem; }
.page-crumbs { display: flex; flex-wrap: wrap; gap: 0.3rem; font-size: 0.85rem; }
.page-crumb { display: inline-flex; gap: 0.3rem; }
.page-crumb a { color: var(--muted); }
.page-head-row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.page-icon { width: 2.6rem; height: 2.6rem; border-radius: 0.6rem; display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; background: var(--tone, var(--accent)); color: var(--accent-text); font-size: 1.05rem; }
.page-icon[class*="tone-"] { color: #ffffff; }
.page-head-titles { flex: 1; min-width: 10rem; }
.page-kicker { margin: 0; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); display: block; }
.page-title { margin: 0; font-size: 1.35rem; display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; overflow-wrap: anywhere; }
.page-count { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.page-actions { display: flex; gap: 0.35rem; flex-wrap: wrap; align-items: center; }
.page-highlights { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.6rem 1rem; margin: 0; padding-top: 0.6rem; border-top: 1px solid var(--border); }
.page-highlight dt, .details-field dt { font-size: 0.78rem; color: var(--muted); }
.page-highlight dd, .details-field dd { margin: 0.1rem 0 0; overflow-wrap: anywhere; }
.state-badge { display: inline-block; padding: 0.05rem 0.55rem; border-radius: 1rem; font-size: 0.78rem; font-weight: 600; background: var(--tone-soft, rgba(127, 127, 127, 0.14)); color: var(--tone, var(--foreground)); white-space: nowrap; }
.path-bar { display: flex; list-style: none; margin: 0; padding: 0; gap: 0.2rem; overflow-x: auto; }
.path-step { flex: 1; min-width: 6rem; text-align: center; padding: 0.4rem 0.9rem; font-size: 0.85rem; background: rgba(127, 127, 127, 0.12); clip-path: polygon(0 0, calc(100% - 0.6rem) 0, 100% 50%, calc(100% - 0.6rem) 100%, 0 100%, 0.6rem 50%); white-space: nowrap; }
.path-step:first-child { clip-path: polygon(0 0, calc(100% - 0.6rem) 0, 100% 50%, calc(100% - 0.6rem) 100%, 0 100%); border-radius: 0.4rem 0 0 0.4rem; }
.path-step-done { background: var(--success-soft); color: var(--success); }
.path-step-current { background: var(--accent); color: var(--accent-text); font-weight: 700; }
.path-step-ended { background: var(--danger-soft); color: var(--danger); font-weight: 700; }
.record-page, .list-view { display: flex; flex-direction: column; gap: 0.75rem; }
.record-columns { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.75rem; }
@media (min-width: 60rem) { .record-columns { grid-template-columns: minmax(0, 2fr) minmax(16rem, 1fr); } }
.record-main, .record-side { display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; }
.record-side:empty { display: none; }
.details-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0.6rem 1.25rem; margin: 0; }
.details-field { border-bottom: 1px solid var(--border); padding-bottom: 0.4rem; }
.details-wide { grid-column: 1 / -1; }
.details-value { display: flex; align-items: flex-start; gap: 0.4rem; }
.details-value-text { flex: 1; min-width: 0; }
.details-tagged { display: block; white-space: pre-wrap; }
.details-pencil { background: none; border: 0; padding: 0.1rem; color: var(--muted); cursor: pointer; opacity: 0; border-radius: 0.3rem; line-height: 0; }
.details-field:hover .details-pencil, .details-pencil:focus-visible { opacity: 1; }
@media (hover: none) { .details-pencil { opacity: 0.7; } }
.details-pencil:hover { color: var(--foreground); background: rgba(127, 127, 127, 0.14); }
.details-editor { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.25rem; }
.details-editor-buttons, .record-form-buttons { display: flex; justify-content: flex-end; gap: 0.4rem; }
.record-form { display: flex; flex-direction: column; gap: 0.8rem; min-width: min(34rem, 80vw); }
.details-pre { margin: 0.2rem 0 0; white-space: pre-wrap; font-family: ui-monospace, monospace; font-size: 0.85rem; max-height: 20rem; overflow: auto; }
.related-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.related-row { display: flex; flex-direction: column; padding: 0.35rem 0; border-bottom: 1px solid var(--border); }
.related-row:last-child { border-bottom: 0; }
.list-view-body { display: flex; flex-direction: column; gap: 0.6rem; }
.list-view-bar { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.list-view-search { flex: 1; min-width: 12rem; max-width: 24rem; }
.list-view-picker { font-weight: 600; }
.list-view-scroll { overflow-x: auto; }
.list-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.list-table th { text-align: left; font-weight: 600; border-bottom: 1px solid var(--border); padding: 0; white-space: nowrap; }
.list-table td { padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.list-table tbody tr:hover { background: rgba(127, 127, 127, 0.06); }
.list-sort { all: unset; cursor: pointer; display: flex; gap: 0.25rem; padding: 0.45rem 0.6rem; width: 100%; box-sizing: border-box; color: var(--muted); font-size: 0.82rem; }
.list-sort:focus-visible { outline: 2px solid var(--accent); }
.list-link { color: inherit; font-weight: 600; }
.list-menu-col { width: 2.5rem; position: relative; text-align: right; }
@media (max-width: 40rem) {
  .list-table thead { display: none; }
  .list-table, .list-table tbody, .list-table tr, .list-table td { display: block; }
  .list-table tr { border-bottom: 1px solid var(--border); padding: 0.4rem 0; position: relative; }
  .list-table td { border: 0; padding: 0.1rem 0.25rem; }
  .list-table td[data-label]:not(:first-child)::before { content: attr(data-label) ": "; color: var(--muted); font-size: 0.8rem; }
  .list-menu-col { position: absolute; top: 0.3rem; right: 0; }
  .list-table td.list-blank { display: none; }
  .list-table tr:has(.list-menu-col) td:first-child { padding-right: 2.5rem; }
}
.record-chip-wrap { position: relative; display: inline-block; max-width: 100%; }
.record-chip { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.1rem 0.55rem 0.1rem 0.15rem; border-radius: 1rem; background: rgba(127, 127, 127, 0.12); color: inherit; text-decoration: none; font-size: 0.88rem; max-width: 100%; }
.record-chip:hover, .record-chip:focus-visible { background: rgba(127, 127, 127, 0.22); }
.record-chip-icon { width: 1.3rem; height: 1.3rem; border-radius: 0.7rem; display: inline-flex; align-items: center; justify-content: center; font-size: 0.62rem; font-weight: 700; background: var(--tone, var(--accent)); color: var(--accent-text); flex: none; }
.tone-blue .record-chip-icon, .tone-green .record-chip-icon, .tone-amber .record-chip-icon, .tone-red .record-chip-icon, .tone-purple .record-chip-icon, .tone-grey .record-chip-icon { color: #ffffff; }
.record-chip-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
ui-record-chip { display: inline-block; max-width: 100%; min-width: 0; vertical-align: middle; }
.record-chip-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--tone, var(--muted)); flex: none; }
.record-chip-wrap .record-chip-card { display: none; position: absolute; z-index: 40; left: 0; top: calc(100% + 0.3rem); width: max-content; max-width: min(20rem, 85vw); flex-direction: column; gap: 0.3rem; padding: 0.6rem 0.75rem; font-size: 0.85rem; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15); }
.record-chip-wrap:hover .record-chip-card, .record-chip-wrap:focus-within .record-chip-card { display: flex; }
.record-chip-card-head { display: flex; gap: 0.5rem; align-items: center; }
.record-chip-card-line { display: flex; justify-content: space-between; gap: 1rem; }
.page-actions .field { width: auto; max-width: 16rem; }
/* The table pages of every app (#/records): a page of its own under the top bar. */
.tables-layer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; overflow-y: auto; background: var(--background); border-top: 1px solid var(--border); }
.tables-layer-inner { max-width: 80rem; margin: 0 auto; padding: 0.75rem 1rem 2rem; display: flex; flex-direction: column; gap: 0.5rem; align-items: stretch; }
.tables-layer-inner > .link-button { align-self: flex-start; }
.table-pages { display: flex; flex-direction: column; gap: 0.75rem; }
/* An escalated conversation is red, as in the Command Center (PO, 15 November 2026). */
.conversation-escalated { border-color: var(--danger); box-shadow: 0 0 0 2px var(--danger); }
.conversation-escalated .conversation-head h2 { color: var(--danger); }
.escalated-badge { margin-left: 0.5rem; vertical-align: middle; font-size: 0.75rem; }
.record-escalated { border-left: 4px solid var(--danger); }

/* Icon buttons (PO, 16 November 2026: icons, not text, on every button, as in the Command Center): boxed in a page's
   header and forms, red when they destroy, filled when they are the page's main action. Two classes, so a site's
   own .icon-button (Matrix: borderless) cannot take the frame away. */
.icon-button.icon-button-boxed { border: 1px solid var(--border); background: var(--surface); }
.icon-button.icon-button-boxed:hover { background: var(--background); }
.icon-button.icon-button-primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.icon-button.icon-button-primary:hover { background: var(--accent); opacity: 0.88; }
.icon-button.icon-button-danger { color: var(--danger); border-color: var(--danger); }
.icon-button.icon-button-danger:hover { background: var(--danger); color: var(--danger-text); }
.icon-button.icon-button-boxed:disabled, .icon-button:disabled { opacity: 0.5; cursor: default; }

/* Setup > Buttons */
.button-settings-table { width: 100%; border-collapse: collapse; }
.button-settings-table td, .button-settings-table th { padding: 0.35rem 0.4rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.button-settings-icon { display: flex; gap: 0.4rem; align-items: center; }
.button-settings .field-input { font: inherit; padding: 0.35rem 0.5rem; border: 1px solid var(--border); border-radius: 0.4rem; background: var(--surface); color: var(--foreground); width: 100%; }
