/* 3.2 (ux): note colours, formatted message boxes, images in messages, drop zones, statuses, page help.
   Tokens from app.css only (light and dark). Markup: templates/partials/ux.html; behaviour: v32_ux.js. */

/* ------------------------------------------------------------------ note colours (a ribbon fading into the card) */
.nt-c-violet { --nc: #7C3AED; } .nt-c-blue { --nc: #2563EB; } .nt-c-teal { --nc: #0F8A8A; } .nt-c-green { --nc: #15803D; }
.nt-c-amber { --nc: #C27803; } .nt-c-coral { --nc: #E0573B; } .nt-c-rose { --nc: #D0347A; } .nt-c-slate { --nc: #5B6478; }
:root[data-theme="dark"] .nt-c-violet { --nc: #A78BFA; } :root[data-theme="dark"] .nt-c-blue { --nc: #60A5FA; }
:root[data-theme="dark"] .nt-c-teal { --nc: #2DD4BF; } :root[data-theme="dark"] .nt-c-green { --nc: #4ADE80; }
:root[data-theme="dark"] .nt-c-amber { --nc: #FBBF24; } :root[data-theme="dark"] .nt-c-coral { --nc: #FB8A6E; }
:root[data-theme="dark"] .nt-c-rose { --nc: #F472B6; } :root[data-theme="dark"] .nt-c-slate { --nc: #A3ACC0; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] .nt-c-violet { --nc: #A78BFA; } :root[data-theme="system"] .nt-c-blue { --nc: #60A5FA; }
  :root[data-theme="system"] .nt-c-teal { --nc: #2DD4BF; } :root[data-theme="system"] .nt-c-green { --nc: #4ADE80; }
  :root[data-theme="system"] .nt-c-amber { --nc: #FBBF24; } :root[data-theme="system"] .nt-c-coral { --nc: #FB8A6E; }
  :root[data-theme="system"] .nt-c-rose { --nc: #F472B6; } :root[data-theme="system"] .nt-c-slate { --nc: #A3ACC0; }
}
.nt-item.nt-c { position: relative; padding-left: calc(var(--s3) + 4px); border-color: color-mix(in srgb, var(--nc) 22%, var(--border));
  background: linear-gradient(90deg, color-mix(in srgb, var(--nc) 15%, var(--surface)) 0%, color-mix(in srgb, var(--nc) 5%, var(--surface)) 45%, var(--surface) 85%); }
.nt-item.nt-c::before { content: ""; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 4px; border-radius: var(--r-sm) 0 0 var(--r-sm); background: var(--nc); }
.nt-item.nt-c:hover { border-color: color-mix(in srgb, var(--nc) 40%, var(--border)); }
.nt-item.nt-c.current { border-color: color-mix(in srgb, var(--nc) 55%, var(--border-strong)); }
/* the note editor gets more of the screen: a slimmer list and less padding around the text */
.nt-shell { grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); gap: var(--s4); }
.nt-note { padding-left: var(--s6); padding-right: var(--s6); }
@media (max-width: 1200px) { .nt-note { padding-left: var(--s4); padding-right: var(--s4); } }
@media (max-width: 900px) { .nt-shell { grid-template-columns: minmax(0, 1fr); } }
.nt-note.nt-c { border-top: 4px solid var(--nc); background: linear-gradient(180deg, color-mix(in srgb, var(--nc) 7%, var(--surface)) 0, var(--surface) 140px); }
.ux-swatch { display: inline-block; width: 16px; height: 16px; border-radius: 50%; background: var(--nc); flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.ux-swatch-none { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--control-border); position: relative; overflow: hidden; }
.ux-swatch-none::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1.5px; background: var(--control-border); transform: rotate(45deg); }
.ux-colour > summary { gap: 6px; }
.ux-swatches { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ux-swatches legend { font: 600 13px/1.3 var(--font); color: var(--text-2); margin-bottom: var(--s2); padding: 0; }
.ux-swatch-pick { position: relative; width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 50%; cursor: pointer; }
.ux-swatch-pick input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.ux-swatch-pick .ux-swatch { width: 22px; height: 22px; }
.ux-swatch-pick:has(input:checked) { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.ux-swatch-pick:has(input:focus-visible) { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* ------------------------------------------------------------------ formatting toolbar and message boxes */
.ux-tb { display: flex; flex-wrap: wrap; align-items: center; gap: 1px; padding: 4px 6px 0; }
.ux-tb[hidden] { display: none; }
.ux-tb-b { width: 30px; height: 30px; display: inline-grid; place-items: center; border: 0; border-radius: 7px; background: transparent;
  color: var(--muted); cursor: pointer; padding: 0; }
.ux-tb-b:hover { background: var(--surface-3); color: var(--text); }
.ux-tb-b[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-text); }
.ux-tb-b:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.ux-tb-sep { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }
.nt-tb .icon, .rt-tb .icon { width: 16px; height: 16px; }

.ux-editor { display: block; width: 100%; min-height: 46px; max-height: 260px; overflow-y: auto; padding: 8px var(--s4) 4px; outline: none;
  color: var(--text); font: 400 14.5px/1.55 var(--font); overflow-wrap: anywhere; cursor: text; }
.ux-editor.is-empty::before { content: attr(data-placeholder); color: var(--faint); pointer-events: none; display: block; height: 0; }
.ux-editor.is-over { background: var(--accent-soft); }
.msg-edit .ux-editor { border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); min-height: 64px; }
.msg-edit .ux-editor:focus { border-color: var(--focus-ring); box-shadow: var(--focus); }
.msg-edit .ux-tb { padding: 0 0 2px; }
.ux-editor .msg-mention { cursor: default; }
.msg-attach { width: auto; padding: 0 8px; gap: 4px; grid-auto-flow: column; font-size: 12.5px; font-weight: 500; }
.msg-attach-text { color: var(--text-2); }
.ux-hint-rich kbd, .ux-hint-plain kbd { font: 600 10.5px/1 var(--font); padding: 2px 4px; border-radius: 4px; border: 1px solid var(--border-strong); background: var(--surface-2); }

/* what people see in a message: lists, quotes, code blocks, underline, images (the editor shows the same) */
.msg-body ul, .msg-body ol { margin: .2em 0; padding-left: 1.4em; }
.msg-body li { margin: .05em 0; }
.msg-body blockquote { margin: .25em 0; padding: .05em 0 .05em .8em; border-left: 3px solid var(--lavender); color: var(--text-2); }
.msg-body pre { margin: .3em 0; padding: var(--s2) var(--s3); border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border);
  font: 13px/1.5 var(--font-mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-body pre code { background: none; padding: 0; border: 0; }
.msg-body p { margin: 0; }
.msg-body s { color: var(--muted); }
.msg-img-link { display: inline-block; max-width: 100%; margin: 4px 6px 2px 0; border-radius: 10px; line-height: 0; vertical-align: top; }
.msg-img-link:focus-visible { box-shadow: var(--focus); }
.msg-img { display: inline-block; max-width: min(420px, 100%); max-height: 320px; width: auto; height: auto; object-fit: contain; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface-2); cursor: zoom-in; }
.ux-editor .msg-img { max-width: 220px; max-height: 160px; margin: 4px 4px 2px 0; vertical-align: bottom; cursor: default; }
.ux-lightbox { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 96vh; overflow: visible; }
.ux-lightbox::backdrop { background: rgba(10, 8, 20, .82); }
.ux-lightbox img { display: block; max-width: 94vw; max-height: 84vh; width: auto; height: auto; border-radius: 10px; background: #fff; }
.ux-lightbox-bar { display: flex; gap: var(--s2); justify-content: flex-end; margin-top: var(--s2); }

/* chosen files: under the composer and in drop zones */
.ux-attach-list, .ux-drop-list { list-style: none; margin: 0; padding: 0 var(--s3) 2px; display: flex; flex-wrap: wrap; gap: 6px; }
.ux-attach-list[hidden], .ux-drop-list[hidden] { display: none; }
.ux-attach, .ux-drop-list li { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 30px; padding: 2px 4px 2px 10px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); font-size: 12.5px; }
.ux-attach-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; max-width: 260px; font-weight: 500; }
.ux-attach-size { color: var(--muted); white-space: nowrap; }
.ux-attach-x { width: 24px; height: 24px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; }
.ux-attach-x:hover { background: var(--surface-3); color: var(--text); }
.ux-attach-x:focus-visible { outline: 2px solid var(--focus-ring); }

/* ------------------------------------------------------------------ the drop zone (every file input in CORE) */
.ux-drop { position: relative; display: grid; gap: var(--s2); min-width: 0; }
.ux-drop-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 1; font-size: 0; }
.ux-drop.has-files .ux-drop-input { height: var(--drop-h, 76px); bottom: auto; }
.ux-drop-face { display: flex; align-items: center; gap: var(--s3); min-height: 76px; padding: var(--s3) var(--s4); border: 1.5px dashed var(--border-strong);
  border-radius: var(--r); background: var(--surface-2); color: var(--text-2); transition: border-color .15s, background .15s; }
.ux-drop.compact .ux-drop-face { min-height: 56px; padding: var(--s2) var(--s3); }
.ux-drop.compact { --drop-h: 56px; }
.ux-drop-icon { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.ux-drop-text { display: grid; gap: 2px; min-width: 0; }
.ux-drop-main { font-weight: 600; font-size: 13.5px; color: var(--text); }
.ux-drop-main u { color: var(--accent-text); text-underline-offset: 3px; }
.ux-drop-hint { font-size: 12.5px; color: var(--muted); }
.ux-drop:hover .ux-drop-face, .ux-drop.is-over .ux-drop-face { border-color: var(--accent); background: var(--accent-soft); }
.ux-drop:focus-within .ux-drop-face { border-color: var(--focus-ring); box-shadow: var(--focus); }
.ux-drop-list { padding: 0; position: relative; z-index: 2; }

/* ------------------------------------------------------------------ statuses */
.ux-av { position: relative; display: inline-flex; flex: none; line-height: 0; align-self: flex-start; height: max-content; }
.ux-dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; box-sizing: border-box;
  border: 2px solid var(--surface); background: var(--faint); }
.ux-dot.inline { position: static; display: inline-block; border-width: 0; width: 9px; height: 9px; vertical-align: 0; margin-right: 6px; flex: none; }
.sidebar .ux-dot { border-color: var(--side-bg); }
.ux-dot-active { background: #16A34A; }
.ux-dot-away { background: #D97706; box-shadow: inset 0 0 0 2.5px #D97706, inset 0 0 0 9px var(--surface); }
.ux-dot.inline.ux-dot-away { box-shadow: inset 0 0 0 2px #D97706; background: transparent; }
.ux-dot-busy { background: #DC2626; }
.ux-dot-dnd { background: #DC2626; background-image: linear-gradient(#fff, #fff); background-size: 60% 2px; background-position: center; background-repeat: no-repeat; }
.ux-dot-meeting { background: #7C3AED; background-image: radial-gradient(circle, #fff 0 1.6px, transparent 1.8px); }
.ux-dot-ooo { background: #C026D3; background-image: linear-gradient(45deg, transparent 40%, #fff 40% 60%, transparent 60%); }
.ux-dot-offline { background: var(--surface); box-shadow: inset 0 0 0 2px var(--faint); }
.ux-dot.inline.ux-dot-offline { background: transparent; }
.ux-status-line { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 0 2px; }
.ux-status-note { color: var(--text-2); }
.ux-pop-status { margin-left: auto; white-space: nowrap; }
.msg-mention-pop .ux-av .avatar { --s: 24px; }
.msg-mention-pop .ux-dot { width: 10px; height: 10px; }
.side-status { display: flex; align-items: center; gap: 6px; margin: -4px 0 4px 46px; font-size: 12px; color: var(--side-muted); text-decoration: none;
  min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; border-radius: 6px; padding: 2px 4px; }
.side-status:hover { color: var(--side-text); background: var(--side-hover); text-decoration: none; }
.side-status-edit { margin-left: auto; color: var(--lavender); opacity: .85; flex: none; }
.ux-status-card .ux-status-now { font-size: 15px; font-weight: 600; margin: 0; }
.ux-status-choices { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.ux-status-choices legend { margin-bottom: var(--s2); padding: 0; }
.ux-status-choice { display: flex; align-items: flex-start; gap: var(--s3); padding: 10px var(--s3); border: 1px solid var(--border); border-radius: var(--r-sm); cursor: pointer; }
.ux-status-choice:hover { border-color: var(--border-strong); background: var(--surface-2); }
.ux-status-choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.ux-status-choice input { margin-top: 3px; accent-color: var(--accent); }
.ux-status-choice .ux-dot { margin-top: 6px; }
.ux-status-choice-text { display: grid; gap: 2px; }
.ux-plain-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: var(--text-2); }

/* ------------------------------------------------------------------ "What is this page?" */
.ux-hint { margin: calc(var(--s3) * -1) 0 var(--s4); }
.ux-hint-summary { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--accent-text); cursor: pointer;
  list-style: none; padding: 4px 8px 4px 4px; border-radius: 8px; min-height: 28px; }
.ux-hint-summary::-webkit-details-marker { display: none; }
.ux-hint-summary:hover { background: var(--accent-soft); }
.ux-hint-summary:focus-visible { outline: 2px solid var(--focus-ring); }
.ux-hint[open] { display: flex; flex-wrap: wrap; align-items: center; gap: 2px var(--s3); padding: 8px var(--s3) 8px var(--s4);
  border-radius: var(--r); background: var(--accent-soft); }
.ux-hint[open] .ux-hint-summary { padding-left: 0; }
.ux-hint[open] .ux-hint-summary:hover { background: transparent; }
.ux-hint-body { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s3); flex: 1 1 420px; min-width: 0; }
.ux-hint-body p { margin: 0; color: var(--text-2); flex: 1 1 320px; font-size: 13.5px; }
.ux-hint-actions { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.ux-hint-actions form { margin: 0; }

/* ------------------------------------------------------------------ calmer pages (fewer borders, clearer hierarchy) */
.empty { padding-top: var(--s8); padding-bottom: var(--s8); }
.empty .btn { margin-top: var(--s1); }

@media (max-width: 600px) {
  .ux-tb { padding: 4px 4px 0; }
  .ux-tb-b { width: 32px; height: 32px; }
  .ux-tb-sep { display: none; }
  .ux-tb [data-ux-cmd="pre"], .ux-tb [data-ux-cmd="blockquote"], .ux-tb [data-ux-cmd="mention"] { display: none; }   /* shortcuts and typing @ still work */
  .msg-attach-text { display: none; }
  .msg-img { max-width: 100%; max-height: 260px; }
  .ux-attach-name { max-width: 160px; }
  .ux-drop-face { min-height: 64px; }
  .side-status { margin-left: 46px; }
}
@media print { .ux-hint, .ux-tb { display: none !important; } }

/* ------------------------------------------------------------------ writing areas use the full width (3.2)
   Kept here rather than in assistant.css so the AI stream's changes merge cleanly. Reading width (about 72ch) is
   kept only for long read-only articles: knowledge pages (.kb-prose), ticket articles (.tk-article) and announcement
   bodies (.msg-ann-body). */
.ai-composer-box, .ai-composer-foot, .ai-thread { max-width: none; }
textarea.input, .rt-box, .rt-editor, .nt-rich, .ux-editor { max-width: none; }

/* long reference lists start folded (progressive disclosure): the permissions on My account */
details.card.ux-more > summary.card-head { cursor: pointer; list-style: none; align-items: center; }
details.card.ux-more > summary.card-head::-webkit-details-marker { display: none; }
details.card.ux-more:not([open]) > summary.card-head { border-bottom: 0; }
details.card.ux-more > summary:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.ux-more-count { margin-left: auto; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.ux-more-chev { color: var(--muted); transition: transform .15s; flex: none; margin-left: var(--s2); }
details.card.ux-more[open] .ux-more-chev { transform: rotate(180deg); }
.ux-account-status { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; margin: 0 0 var(--s4); padding-bottom: var(--s3); border-bottom: 1px solid var(--border); }
.ux-account-status .btn { margin-left: auto; }

/* Tickets list at laptop widths: the priority word never breaks into single letters, long e-mail addresses give way */
.tk-table .prio { white-space: nowrap; }
@media (max-width: 1500px) {
  .tk-table .tk-subject { min-width: 190px; }
  .tk-table .tk-person { max-width: 118px; }
  .tk-table th, .tk-table td { padding-left: 9px; padding-right: 9px; }
  .tk-table td.nowrap time { white-space: normal; }
}
.ux-av-big .ux-dot { width: 20px; height: 20px; border-width: 3px; right: 2px; bottom: 2px; }
.pf-status { margin-top: 4px; font-size: 13.5px; color: var(--text-2); display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.dir-card .ux-av { align-self: center; margin-bottom: 6px; }
.dir-card .ux-av .avatar, .ux-av img { margin-bottom: 0; }
.side-me { position: relative; }
.side-me-dot { left: 27px; top: 27px; right: auto; bottom: auto; }
