/*
 * control-page.css: the control page block of the May look (CTL-1): frame, KPIs, list, done box, chat, copied whole for fos/.
 * Source: wb-modules-core foundry/ui/css/control-page-{frame,kpis,list,done,chat}.css at 7038ae7, in that order, unchanged.
 */

/*
 * control-page-frame.css: the frame of the control page (pb-165). The chat and the information columns are in the ratio 1 to 2 at any width; no px
 * width fixes the split. Colours and sizes come from the shell tokens; Silky's design system replaces the --cp-* properties below by setting them.
 * The chat column (pb-521): wider than 720 px it is sticky, one gap from the top of the window and as tall as the window less two gaps, a column whose
 * message list takes what is left and whose composer stays at the bottom, so it stays in view while the information side scrolls. The top bar does not
 * stay, so the top is the gap, not the bar. At 720 px and below nothing is sticky: the chat is the one column the switch shows.
 * The header (pb-523): the frame has no side padding of its own (the shell's .page gives it), so the title starts where every screen's heading does;
 * Home is on its own line above the title and the type label, which wrap.
 * The Chat side group (pb-513) sits on the title's line, at its end, and wraps under it on a phone; its buttons are 44 px each way.
 */
.cp-frame {
  --cp-panel-bg: var(--bg-2);
  --cp-panel-line: var(--line);
  --cp-gap: 1rem;
  --cp-pad: 14px;
  --cp-radius: 8px;
  padding: 16px 0;
}
.cp-header { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-bottom: var(--cp-gap); min-width: 0; }
.cp-header::before { content: ''; flex-basis: 100%; order: 1; height: 0; }
.cp-home { order: 0; min-height: var(--tap-min); padding-left: 0; }
.cp-title, .cp-type, .cp-header-extra { order: 2; }
.cp-title { margin: 0; font-size: 20px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; min-width: 0; }
.cp-type { font-family: var(--mono); font-size: 11px; color: var(--text-3); background: var(--bg-3); padding: 1px 8px; border-radius: 3px; }
.cp-side { order: 2; margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.cp-side-button { min-height: var(--tap-min); min-width: var(--tap-min); }
.cp-side-button[aria-pressed='true'] { background: var(--bg-3); border-color: var(--accent); color: var(--text); }
.cp-header-extra { flex-basis: 100%; min-width: 0; font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.cp-grid { display: grid; gap: var(--cp-gap); align-items: start; }
.cp-frame[data-chat-side='left'] .cp-grid { grid-template-columns: minmax(0,1fr) minmax(0,2fr); }
.cp-frame[data-chat-side='right'] .cp-grid { grid-template-columns: minmax(0,2fr) minmax(0,1fr); }
.cp-chat, .cp-info > div { background: var(--cp-panel-bg); border: 1px solid var(--cp-panel-line); border-radius: var(--cp-radius); padding: var(--cp-pad); min-width: 0; overflow-wrap: anywhere; }
.cp-info { display: flex; flex-direction: column; gap: var(--cp-gap); min-width: 0; }
.cp-info > div:empty, .cp-chat:empty { display: none; }
.cp-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cp-controls button, .cp-controls input, .cp-controls select, .cp-controls a { min-height: var(--tap-min); min-width: var(--tap-min); }
.cp-switch { display: none; gap: 8px; margin-bottom: var(--cp-gap); }
.cp-switch button[aria-pressed='true'] { background: var(--bg-3); border-color: var(--accent); color: var(--text); }
@media (min-width: 721px) {
  .cp-chat { position: sticky; top: var(--cp-gap); height: calc(100vh - 2 * var(--cp-gap)); box-sizing: border-box; display: flex; flex-direction: column; }
  .cp-chat > *, .cp-chat > * > .cp-chat-stub { flex: 1; min-height: 0; display: flex; flex-direction: column; }
}
@media (max-width: 720px) {
  .cp-frame { padding: 12px 0; }
  .cp-grid { display: block; }
  .cp-chat, .cp-info { margin-bottom: var(--cp-gap); }
  .cp-switch { display: flex; }
  .cp-switch button, .cp-home { min-height: var(--tap-min); }
  .cp-switch button { flex: 1; }
  .cp-chat[hidden], .cp-info[hidden] { display: none; }
}

/*
 * control-page-kpis.css: the KPI strip (pb-166). Colours come from the shell tokens; Silky's design system replaces the --cp-* properties by setting them.
 * Wide, the tiles wrap into rows (auto-fit, none narrower than 150px). At 720px and below (pb-522) the strip is two columns and the value 16px, so 12
 * figures take 6 rows, not 12.
 */
.cp-kpi-strip {
  --cp-kpi-bg: var(--bg-3);
  --cp-kpi-value-size: 20px;
  --cp-kpi-label-color: var(--text-3);
  --cp-kpi-ok: var(--ok);
  --cp-kpi-warn: var(--warn);
  --cp-kpi-danger: var(--danger);
  --cp-kpi-unknown: var(--text-3);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.cp-kpi { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 10px 12px; background: var(--cp-kpi-bg); border: 1px solid var(--line); border-left: 3px solid var(--cp-kpi-unknown); border-radius: 8px; overflow-wrap: anywhere; }
.cp-kpi[data-state='ok'] { border-left-color: var(--cp-kpi-ok); }
.cp-kpi[data-state='warn'] { border-left-color: var(--cp-kpi-warn); }
.cp-kpi[data-state='danger'] { border-left-color: var(--cp-kpi-danger); }
.cp-kpi-label { font-size: 12px; color: var(--cp-kpi-label-color); }
.cp-kpi-value { font-size: var(--cp-kpi-value-size); font-weight: 600; color: var(--text); font-family: var(--mono); }
.cp-kpi-unmeasured { font-size: 13px; font-weight: 400; font-family: var(--sans); color: var(--text-3); }
.cp-kpi-note { font-size: 11px; color: var(--text-3); }
.cp-visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.cp-empty { font-size: 12px; color: var(--text-3); margin: 0; }
@media (max-width: 720px) {
  .cp-kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); --cp-kpi-value-size: 16px; }
}

/*
 * control-page-list.css: the list area (pb-167). Colours come from the shell tokens; Silky's design system replaces the --cp-* properties by setting them.
 */
.cp-list-area {
  --cp-row-bg: var(--bg-3);
  --cp-row-line: var(--line);
  --cp-tile-size: 140px;
  --cp-chip-bg: var(--bg);
}
.cp-choices { display: flex; gap: 8px; margin-bottom: 10px; }
.cp-choices button[aria-pressed='true'] { background: var(--bg-3); border-color: var(--accent); }
.cp-items { list-style: none; margin: 0; padding: 0; }
.cp-items-list { display: flex; flex-direction: column; gap: 6px; }
.cp-items-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--cp-tile-size), 1fr)); gap: 8px; }
.cp-item { background: var(--cp-row-bg); border: 1px solid var(--cp-row-line); border-radius: 8px; min-width: 0; overflow-wrap: anywhere; }
.cp-item-link, .cp-item-plain { display: flex; align-items: center; gap: 8px; padding: 8px 12px; min-height: var(--tap-min); color: var(--text); text-decoration: none; box-sizing: border-box; }
.cp-item-link:hover { background: var(--bg-3); }
.cp-item-icons .cp-item-link, .cp-item-icons .cp-item-plain { flex-direction: column; justify-content: center; text-align: center; }
.cp-item-icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--cp-chip-bg); border: 1px solid var(--line-2); font-weight: 600; color: var(--text-2); }
.cp-item-title { font-size: 13px; font-weight: 500; color: var(--text); }
.cp-item-state { font-size: 11px; font-family: var(--mono); color: var(--text-3); background: var(--cp-chip-bg); padding: 1px 6px; border-radius: 3px; }
.cp-item-detail { font-size: 12px; color: var(--text-3); }
.cp-more { margin-top: 10px; }
.cp-empty { font-size: 12px; color: var(--text-3); margin: 0; }
@media (max-width: 720px) {
  .cp-choices button, .cp-more, .cp-item-link, .cp-item-plain { min-height: var(--tap-min); }
  .cp-items-icons { grid-template-columns: repeat(auto-fill, minmax(min(var(--cp-tile-size), 45%), 1fr)); }
}

/*
 * control-page-done.css: the "what it has done" box (pb-168). Colours come from the shell tokens; Silky's design system replaces the --cp-* properties by setting them.
 */
.cp-done-box { --cp-done-bg: transparent; --cp-done-time-color: var(--text-3); background: var(--cp-done-bg); }
.cp-done-list { list-style: none; margin: 0; padding: 0; }
.cp-done-row { display: flex; gap: 12px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.cp-done-time { flex: 0 0 auto; min-width: 72px; font-size: 11px; font-family: var(--mono); color: var(--cp-done-time-color); }
.cp-done-text { font-size: 13px; color: var(--text); overflow-wrap: anywhere; }
.cp-done-link { display: inline-flex; align-items: center; min-height: var(--tap-min); color: var(--accent); text-decoration: none; min-width: 0; }
.cp-done-more { margin-top: 10px; }
.cp-empty { font-size: 12px; color: var(--text-3); margin: 0; }
@media (max-width: 720px) {
  .cp-done-more, .cp-done-link { min-height: var(--tap-min); }
}

/*
 * control-page-chat.css: the chat stub (pb-169). Colours come from the shell tokens; Silky's design system replaces the --cp-* properties by setting them.
 */
.cp-chat-stub { --cp-msg-bg: var(--bg-3); --cp-msg-mine-bg: var(--bg); --cp-msg-meta-color: var(--text-3); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cp-messages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 0; overflow-y: auto; }
.cp-message { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 8px 10px; background: var(--cp-msg-bg); border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.cp-message { align-self: flex-start; max-width: 85%; box-sizing: border-box; }
.cp-message-mine { align-self: flex-end; background: var(--cp-msg-mine-bg); border-color: var(--line-2); }
.cp-message-from { font-size: 12px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.cp-message-time { font-size: 11px; font-family: var(--mono); color: var(--cp-msg-meta-color); }
.cp-message-text { grid-column: 1 / -1; font-size: 13px; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.cp-composer { display: flex; flex-direction: column; gap: 8px; }
.cp-input { box-sizing: border-box; width: 100%; resize: vertical; font-family: var(--sans); font-size: 13px; color: var(--text); background: var(--bg); border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; min-height: var(--tap-min); }
.cp-input:disabled { color: var(--text-3); background: var(--bg-3); }
.cp-send { align-self: flex-end; }
.cp-chat-note, .cp-empty { font-size: 12px; color: var(--text-3); margin: 0; }
.cp-chat-error { font-size: 12px; color: var(--danger); margin: 0; }
@media (max-width: 720px) {
  .cp-send, .cp-input { min-height: var(--tap-min); }
  .cp-messages { max-height: 60vh; }
}

