
/* ===== Layout foundation: one spacing scale, one header height, one content edge and one rule for list widths, shared by every look =====
   A look keeps its own shapes, glass, borders and fonts; it only picks values for these tokens. Desktop only: phones and narrow windows keep their own layout.
   Priority when space is short: chat, message box, channel list, member list. Lists are a share of the window between a floor and a ceiling. */
:root {
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px;
  --lay-inset: 16px;                              /* the one left and right edge for message text, day dividers, the message box */
  --lay-hdr: 48px;                                /* channel header, chat header and member header share one height */
  --lay-list: clamp(184px, 12vw, 224px);          /* channel list: about a third narrower than before (it was mostly empty space); drag its edge to change it */
  --lay-members: clamp(232px, 16vw, 264px);       /* member list: wide enough that names are not cut before their BOT or ROLE tag */
}
:root.ui-lq { --lay-inset: 20px; --lay-hdr: 52px; }
:root[data-theme="system24"]:not(.ui-classic):not(.ui-lq) { --lay-inset: 16px; --lay-hdr: 44px; }
@media (min-width: 861px) {
  html:root.ui-classic { --cx-side: var(--lay-list); --cx-members: var(--lay-members); --cx-head: var(--lay-hdr); }
  html:not(.ph) .app > .channels-pane { width: var(--lay-list); }
  html:not(.ph) .app > .members-pane:not(.dm-profile) { width: var(--lay-members); }
  /* member header: the same band as the other two (Classic hides it and lets the chat header run over the list) */
  html:not(.ui-classic) .members-pane > .section-header { height: var(--lay-hdr); min-height: var(--lay-hdr); box-sizing: border-box; }
  /* one content edge: message text, avatars, day dividers and the message box start and end on the same lines */
  html:root.ui-classic .msg { padding-inline: var(--lay-inset); margin-top: var(--sp-4); }
  html:root.ui-classic .msg.grouped { margin-top: 0; }
  html:root.ui-lq .msg { margin-inline: var(--sp-2); padding-inline: calc(var(--lay-inset) - var(--sp-2)); }
  html:root[data-theme="system24"]:not(.ui-classic):not(.ui-lq) .msg { margin-inline: var(--sp-2); padding-inline-start: calc(var(--lay-inset) - var(--sp-2) - 2px); padding-inline-end: calc(var(--lay-inset) - var(--sp-2)); }
  html:root .chat-messages > .date-divider { padding-inline: var(--lay-inset); }
  html:root:is(.ui-classic, .ui-lq, [data-theme="system24"]) .composer-wrap { padding-inline: var(--lay-inset); }
  html:root.ui-classic .composer-wrap .typing-indicator { inset-inline: var(--lay-inset); }
}
/* desktop frame: where a look already floats its panels inside an outer margin (Crystal 12, System24 10), that margin is the room above the
   window edge, so the extra 10 px guard is dropped: the bottom margin equals the gaps between panels. A window that really hangs under the
   taskbar or Dock is still lifted by the measured overhang. The title bar has no hairline and takes the backdrop's own tone, so it reads as the
   top of the frame, not a separate strip. */
html.desk-tb.ui-lq, html.desk-tb[data-theme="system24"]:not(.ui-classic) { --desk-bot: max(var(--desk-over, 0px), var(--desk-over-pg, 0px)); }
html.desk-tb.desk-fs.ui-lq, html.desk-tb.desk-full.ui-lq, html.desk-tb.desk-fs[data-theme="system24"], html.desk-tb.desk-full[data-theme="system24"] { --desk-bot: 0px; }
html.desk-tb.ui-lq #desk-tb { background: var(--lq-wall-base); border-bottom: 0; }
html.desk-tb[data-theme="system24"]:not(.ui-classic):not(.ui-lq) #desk-tb { border-bottom: 0; }
