/* Hegetic · control panel (control.js). Uses the brand tokens; on a sector page it picks up the sector's colours. */
.hx-ctl { --c-auto: #2E9E6B; --c-draft: #D9962B; --c-off: var(--stone); --c-acc: var(--s-deep, var(--aegean)); }
.hx-ctl__panel {
  display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: 0;
  background: #fff; border: 1px solid var(--line); border-radius: 22px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(14, 17, 23, .06), 0 40px 80px -50px rgba(14, 17, 23, .45);
  color: var(--ink); font-family: var(--sans);
}
.hx-ctl__list { padding: 26px 26px 18px; border-right: 1px solid var(--line); container-type: inline-size; }
.hx-ctl__k { font: 500 11.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--stone-text); margin-bottom: 14px; }
.hx-ctl__list ul { display: grid; }
.hx-ctl__row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 10px; margin: 0 -10px; border-radius: 12px; transition: background-color .25s var(--ease); }
.hx-ctl__row + .hx-ctl__row::before { content: ""; position: absolute; left: 10px; right: 10px; top: 0; height: 1px; background: var(--line); }
.hx-ctl__row.is-sel::before, .hx-ctl__row.is-sel + .hx-ctl__row::before { display: none; }
.hx-ctl__row.is-sel { background: color-mix(in srgb, var(--c-acc) 7%, transparent); }
.hx-ctl__name { display: flex; align-items: center; gap: 10px; min-width: 0; border: 0; background: none; padding: 4px 0; font: 600 15.5px/1.25 var(--sans); color: inherit; text-align: left; cursor: pointer; flex: 1 1 auto; }
.hx-ctl__dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--c-off); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-off) 18%, transparent); transition: background-color .3s, box-shadow .3s; }
.hx-ctl__dot[data-m="auto"] { background: var(--c-auto); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-auto) 18%, transparent); }
.hx-ctl__dot[data-m="draft"] { background: var(--c-draft); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-draft) 20%, transparent); }

/* the three-way switch: a thumb slides under the chosen mode */
.hx-seg { position: relative; flex: none; display: grid; grid-template-columns: repeat(3, 1fr); padding: 3px; border-radius: 10px; background: #F1F1EE; isolation: isolate; }
.hx-seg button { position: relative; z-index: 1; border: 0; background: none; padding: 7px 9px; min-width: 60px; font: 600 12.5px/1 var(--sans); color: var(--stone-text); cursor: pointer; border-radius: 8px; transition: color .25s; white-space: nowrap; }
.hx-seg button[aria-checked="true"] { color: var(--ink); }
.hx-seg button:focus-visible { outline: 2px solid var(--aegean); outline-offset: 1px; }
.hx-seg__thumb { position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / 3); border-radius: 8px; background: #fff; box-shadow: 0 1px 2px rgba(14, 17, 23, .12), 0 2px 8px -2px rgba(14, 17, 23, .12); transition: transform .35s var(--ease-out); }
.hx-seg__thumb[data-m="draft"] { transform: translateX(100%); }
.hx-seg__thumb[data-m="off"] { transform: translateX(200%); }

/* the preview: one conversation */
.hx-ctl__view { display: flex; flex-direction: column; min-height: 420px; background: linear-gradient(180deg, #FAFAF8, #F4F4F1); }
.hx-ctl__head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); background: #fff; }
.hx-ctl__head b { display: block; font: 650 15px/1.2 var(--sans); }
.hx-ctl__head small { display: block; font: 500 12px/1.3 var(--mono); color: var(--stone-text); margin-top: 3px; }
.hx-ctl__av { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: color-mix(in srgb, var(--c-acc) 14%, #fff); color: var(--c-acc); font: 700 14px/1 var(--sans); }
.hx-ctl__thread { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 20px 22px; }
.hx-ctl__msg { max-width: 86%; padding: 11px 14px; border-radius: 16px; font-size: 14.5px; line-height: 1.45; }
.hx-ctl__msg--in { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.hx-ctl__out { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; transition: opacity .3s; }
.hx-ctl__msg--out { background: var(--ink); color: var(--plaster); border-bottom-right-radius: 5px; animation: hx-ctl-in .45s var(--ease-out) both; }
.hx-ctl__msg--draft { background: #fff; border: 1.5px dashed var(--c-draft); color: var(--ink); border-bottom-right-radius: 5px; animation: hx-ctl-in .45s var(--ease-out) both; }
.hx-ctl__tag { display: block; font: 600 11px/1 var(--mono); letter-spacing: .04em; color: #A86C10; margin-bottom: 7px; }
.hx-ctl__tag--ok { color: var(--c-auto); margin: 0; }
.hx-ctl__approve { border: 0; border-radius: 999px; padding: 9px 16px; background: var(--c-draft); color: #fff; font: 650 13px/1 var(--sans); cursor: pointer; animation: hx-ctl-in .45s .1s var(--ease-out) both; }
.hx-ctl__approve:hover { filter: brightness(.95); }
.hx-ctl__note { align-self: center; max-width: 90%; padding: 8px 14px; border-radius: 999px; background: #ECECE8; color: var(--stone-text); font-size: 13.5px; text-align: center; animation: hx-ctl-in .45s var(--ease-out) both; }
.hx-ctl__note--you { background: color-mix(in srgb, var(--ember) 12%, #fff); color: var(--ink); }
.hx-ctl__out.is-typing > * { display: none; }
.hx-ctl__out.is-typing::before { content: ""; width: 46px; height: 30px; border-radius: 15px; background: #E7E7E3 radial-gradient(circle, #9AA0A8 2.5px, transparent 3px) 0 50% / 12px 100% repeat-x; background-origin: content-box; padding: 0 10px; animation: hx-ctl-dots 1s steps(3) infinite; }
.hx-ctl__log { margin-top: auto; display: grid; gap: 6px; padding-top: 12px; border-top: 1px dashed var(--line); }
.hx-ctl__log li { display: flex; gap: 8px; align-items: baseline; font: 500 12.5px/1.35 var(--mono); color: var(--stone-text); animation: hx-ctl-in .4s var(--ease-out) both; }
.hx-ctl__log li:nth-child(2) { animation-delay: .12s; } .hx-ctl__log li:nth-child(3) { animation-delay: .24s; }
.hx-ctl__log i { font-style: normal; color: var(--c-auto); }
.hx-ctl__foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 18px 14px 22px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--c-auto) 8%, #fff); font-size: 13.5px; line-height: 1.4; transition: background-color .3s; }
.hx-ctl__foot[data-m="draft"] { background: color-mix(in srgb, var(--c-draft) 10%, #fff); }
.hx-ctl__foot[data-m="off"] { background: #F1F1EE; }
.hx-ctl__foot.is-taken { background: color-mix(in srgb, var(--ember) 10%, #fff); }
.hx-ctl__take { flex: none; border: 1px solid rgba(14, 17, 23, .18); background: #fff; border-radius: 999px; padding: 9px 15px; font: 650 13px/1 var(--sans); color: var(--ink); cursor: pointer; }
.hx-ctl__take:hover { border-color: var(--ink); }
@keyframes hx-ctl-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes hx-ctl-dots { 0% { background-size: 12px 100%; } }

/* a narrow list: the switch goes under the job name */
@container (max-width: 430px) {
  .hx-ctl__row { flex-wrap: wrap; gap: 8px; }
  .hx-seg { width: 100%; }
  .hx-seg button { min-width: 0; }
}
@media (max-width: 860px) {
  .hx-ctl__panel { grid-template-columns: 1fr; }
  .hx-ctl__list { border-right: 0; border-bottom: 1px solid var(--line); padding: 20px 18px 12px; }
  .hx-ctl__row { flex-wrap: wrap; }
  .hx-seg { width: 100%; }
  .hx-seg button { min-width: 0; padding: 8px 6px; }
  .hx-ctl__view { min-height: 380px; }
  .hx-ctl__foot { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  .hx-ctl *, .hx-ctl *::before { animation: none !important; transition: none !important; }
}
