/* Copyright 2026 CLEALINK TECHNOLOGY CO.,LTD. All rights reserved. */

/* Control button: icon plus a word for the current state. States differ in colour, outline shape and text. */

.ctl {
  appearance: none; position: relative; border: 1px solid var(--border); background: var(--raised); color: var(--text);
  border-radius: var(--r-xl); min-width: 64px; height: 56px; padding: 0 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font: 500 var(--fs-11)/1 var(--font); white-space: nowrap; user-select: none; -webkit-user-select: none;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.ctl .ctl-text { display: flex; flex-direction: column; gap: 3px; align-items: inherit; min-width: 0; }
.ctl .ctl-sub { font-weight: 400; font-size: var(--fs-11); line-height: 1.3; opacity: .85; }
:root[data-hover="1"] .ctl:hover:not([aria-disabled="true"]) { border-color: var(--border-strong); background: color-mix(in srgb, var(--raised) 86%, var(--text)); }
.ctl:active:not([aria-disabled="true"]) { transform: scale(.97); }

.ctl[data-state="on"] { background: var(--on-bg); border-color: var(--on-border); color: var(--on-text); }
:root[data-hover="1"] .ctl[data-state="on"]:hover { background: color-mix(in srgb, var(--on-bg) 88%, var(--on-border)); border-color: var(--on-border); }
.ctl[data-state="off"] { background: var(--red-bg); border-color: var(--red); color: var(--red-text); }
:root[data-hover="1"] .ctl[data-state="off"]:hover { background: color-mix(in srgb, var(--red-bg) 88%, var(--red)); border-color: var(--red); }
.ctl[data-state="ban"] { background: var(--ban-bg); border-style: dashed; border-color: var(--ban-border); color: var(--ban-text); cursor: not-allowed; }
.ctl[data-state="busy"] { color: var(--muted); cursor: progress; }
.ctl[data-state="busy"] svg.icon { animation: spin .8s linear infinite; }
.ctl[data-state="none"] { opacity: .45; cursor: not-allowed; }
.ctl[data-state="talk"] { background: var(--green-bg); border-color: var(--green); color: var(--green-text); }

.ctl-danger, .ctl[data-ctl="leave"] { background: var(--danger); border-color: var(--danger); color: var(--on-danger); font-weight: 600; }
:root[data-hover="1"] .ctl[data-ctl="leave"]:hover { background: var(--danger-hover); border-color: var(--danger-hover); }

.ctl-badge {
  position: absolute; right: -4px; top: -4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--on-border); color: #06121F; font-size: 9px; font-weight: 700; line-height: 16px; text-align: center;
}

/* Small square icon button used in headers and panels. */
.icon-btn {
  appearance: none; border: 0; background: none; color: var(--muted); width: 32px; height: 32px; border-radius: var(--r-md);
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}
:root[data-hover="1"] .icon-btn:hover { background: var(--raised); color: var(--text); }
:root[data-density="large"] .icon-btn { width: 44px; height: 44px; }
