:root {
  color-scheme: dark;
  --bg: #050a12;
  --surface: #091522;
  --surface-2: #0d1d2d;
  --surface-3: #12283b;
  --line: rgba(94, 182, 255, 0.2);
  --line-strong: rgba(100, 238, 255, 0.42);
  --text: #eef8ff;
  --muted: #93a9bd;
  --muted-2: #5e7387;
  --accent: #42f8e8;
  --accent-strong: #21c8ff;
  --warn: #f7b85f;
  --danger: #ff637e;
  --terminal: #02070d;
  --radius: 8px;
  --glow-cyan: rgba(66, 248, 232, 0.34);
  --glow-blue: rgba(47, 183, 255, 0.24);
  --panel-shadow: 0 18px 60px rgba(0, 0, 0, 0.38);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(15, 34, 57, 0.72), rgba(5, 10, 18, 0.96)),
    repeating-linear-gradient(90deg, rgba(83, 201, 255, 0.055) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(0deg, rgba(83, 201, 255, 0.035) 0 1px, transparent 1px 72px),
    var(--bg);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

button:hover:not(:disabled),
button:focus-visible {
  border-color: var(--accent);
  outline: none;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0b0c0a;
  color: var(--text);
  outline: none;
}

input,
select {
  min-height: 38px;
  padding: 0 11px;
}

textarea {
  min-height: 104px;
  padding: 10px 11px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.is-hidden {
  display: none !important;
}

.login-view {
  display: grid;
  min-height: 100%;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.login-shell {
  display: grid;
  width: min(840px, 100%);
  grid-template-columns: minmax(280px, 390px) minmax(260px, 1fr);
  gap: 16px;
}

.login-panel,
.saved-panel {
  display: grid;
  align-content: start;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--surface);
}

.brand-block h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: 0;
}

.brand-block p {
  margin: 6px 0 0;
  color: var(--muted);
}

.message {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 11px;
  color: var(--text);
  background: var(--surface-2);
  font-size: 13px;
}

.message.error {
  border-color: rgba(232, 93, 93, 0.7);
  background: rgba(232, 93, 93, 0.12);
  color: #ffd7d7;
}

.message.info {
  border-color: rgba(52, 209, 123, 0.55);
  background: rgba(52, 209, 123, 0.12);
}

.login-panel button[type="submit"],
.stack-form button[type="submit"],
.modal-actions button[type="submit"] {
  border-color: transparent;
  background: var(--accent);
  color: #041008;
  font-weight: 700;
}

.app {
  position: relative;
  display: grid;
  height: 100%;
  grid-template-rows: 56px minmax(0, 1fr);
}

.topbar {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 8px 12px;
  background: var(--surface);
}

.icon-button {
  display: grid;
  place-items: center;
  gap: 4px;
  width: 38px;
  min-height: 38px;
  padding: 8px;
}

.icon-button span {
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
}

.title-block {
  display: grid;
  min-width: 0;
}

.title-block strong,
.title-block small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.title-block strong {
  font-size: 15px;
}

.title-block small {
  color: var(--muted);
  font-size: 12px;
}

.top-actions {
  display: flex;
  min-width: 0;
  max-width: min(520px, 52vw);
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.top-actions .compact-button {
  display: grid;
  place-items: center;
  grid-auto-flow: column;
  align-content: center;
  justify-content: center;
  line-height: 1;
}

.top-actions .compact-button::before {
  display: block;
}

.top-actions::-webkit-scrollbar {
  display: none;
}

.compact-button {
  min-height: 34px;
  padding: 0 11px;
}

.danger {
  color: #ffdada;
}

.app-message {
  position: absolute;
  z-index: 6;
  top: 66px;
  right: 14px;
  width: min(420px, calc(100% - 28px));
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.28);
}

.layout {
  display: grid;
  min-height: 0;
  grid-template-columns: 340px minmax(0, 1fr);
  background: var(--terminal);
}

.app.sidebar-collapsed .layout {
  grid-template-columns: 0 minmax(0, 1fr);
}

.app.sidebar-collapsed .sidebar {
  display: none;
}

.sidebar {
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.sidebar-scroll {
  display: grid;
  height: 100%;
  min-height: 0;
  grid-template-rows: minmax(140px, 0.9fr) minmax(160px, 1.1fr) auto;
  gap: 12px;
  overflow: hidden;
  padding: 12px;
}

.panel-section {
  display: grid;
  gap: 9px;
  min-height: 0;
}

.grow-section {
  grid-template-rows: auto minmax(0, 1fr);
}

.panel-section:first-child {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 22px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.stack-form {
  display: grid;
  gap: 10px;
}

.form-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.section-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.section-actions button {
  min-width: 0;
  min-height: 32px;
  padding: 0 8px;
  font-size: 12px;
}

.profile-list,
.session-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.profile-list::-webkit-scrollbar,
.session-list::-webkit-scrollbar {
  width: 8px;
}

.profile-list::-webkit-scrollbar-thumb,
.session-list::-webkit-scrollbar-thumb {
  border-radius: 8px;
  background: var(--line-strong);
}

.saved-panel .profile-list {
  max-height: 380px;
}

.list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 8px;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #141610;
}

.list-row.is-active {
  border-color: var(--accent);
  background: #132016;
}

.row-main {
  display: grid;
  min-width: 0;
  min-height: 56px;
  gap: 4px;
  border: 0;
  padding: 9px 10px;
  text-align: left;
  background: transparent;
}

.row-main strong,
.row-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-main strong {
  font-size: 14px;
}

.row-main span {
  color: var(--muted);
  font-size: 12px;
}

.row-actions {
  display: grid;
  grid-auto-flow: column;
  align-content: center;
  gap: 6px;
  padding: 8px 8px 8px 0;
}

.mini-button {
  min-width: 54px;
  min-height: 34px;
  padding: 0 8px;
  font-size: 12px;
}

.status-dot {
  width: 9px;
  height: 9px;
  margin: 14px 12px 0 0;
  border-radius: 50%;
  background: var(--muted-2);
}

.status-dot.running {
  background: var(--accent);
}

.status-dot.exited {
  background: var(--warn);
}

.empty-list-item {
  min-height: 42px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.segmented button {
  min-width: 0;
  min-height: 36px;
  padding: 0 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.segmented button.is-active {
  border-color: var(--accent);
  background: #142418;
}

.terminal-area {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) auto;
  background: var(--terminal);
}

.meeting-room {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--bg);
}

.meeting-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  background: var(--surface);
}

.meeting-title-block {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.meeting-title-block strong,
.meeting-title-block span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meeting-title-block span {
  color: var(--muted);
  font-size: 12px;
}

.meeting-actions {
  display: flex;
  max-width: min(620px, 58vw);
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.meeting-actions::-webkit-scrollbar {
  display: none;
}

.meeting-actions button {
  min-height: 34px;
  padding: 0 10px;
  white-space: nowrap;
}

.meeting-body {
  display: grid;
  min-height: 0;
  grid-template-columns: 260px minmax(0, 1fr);
}

.meeting-rail {
  display: grid;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  border-right: 1px solid var(--line);
  padding: 12px;
  background: var(--surface);
}

.participant-list {
  display: grid;
  align-content: start;
  min-height: 0;
  gap: 8px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.participant-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  background: #141610;
}

.participant-item div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.participant-item strong,
.participant-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.participant-item span {
  color: var(--muted);
  font-size: 12px;
}

.participant-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted-2);
}

.participant-dot.ready {
  background: var(--accent);
}

.participant-dot.thinking,
.participant-dot.queued,
.participant-dot.connecting,
.participant-dot.executing {
  background: var(--warn);
}

.participant-dot.approval {
  background: var(--danger);
}

.participant-dot.error,
.participant-dot.offline {
  background: var(--danger);
}

.meeting-chat {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) auto;
}

.meeting-chat-log {
  display: grid;
  align-content: start;
  min-height: 0;
  gap: 10px;
  overflow: auto;
  padding: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.chat-message {
  display: grid;
  width: min(760px, 92%);
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--surface);
}

.chat-message.host {
  justify-self: end;
  border-color: rgba(74, 163, 255, 0.48);
  background: #101a22;
}

.chat-message.host .chat-message-header strong {
  color: #8ec8ff;
}

.chat-message.task {
  justify-self: end;
  border-color: rgba(226, 173, 79, 0.62);
  background: #241b0d;
}

.chat-message.task .chat-message-header strong {
  color: var(--warn);
}

.chat-message.memo {
  width: min(880px, 96%);
  border-color: rgba(226, 173, 79, 0.55);
  background: #211b10;
}

.chat-message.system {
  width: min(620px, 88%);
  justify-self: center;
  border-style: dashed;
  color: var(--muted);
  background: #11130f;
}

.chat-message-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.chat-message-header strong {
  color: var(--text);
}

.chat-message-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.45;
  font-size: 14px;
}

.meeting-composer {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) 84px;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding: 10px 12px;
  background: var(--surface);
}

.composer-input-wrap {
  position: relative;
  display: grid;
  align-items: center;
  min-width: 0;
}

.meeting-composer select,
.meeting-composer button {
  height: 38px;
  min-height: 38px;
}

.meeting-composer textarea {
  display: block;
  height: 38px;
  min-height: 38px;
  max-height: 38px;
  padding: 8px 10px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 20px;
  resize: none;
}

.meeting-composer button {
  width: 84px;
  min-width: 0;
  padding: 0 10px;
}

.mention-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 6px);
  z-index: 20;
  display: grid;
  width: min(320px, 100%);
  max-height: 230px;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 4px;
  background: #10120e;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.42);
}

.mention-menu button {
  display: grid;
  min-height: 44px;
  min-width: 0;
  justify-items: start;
  gap: 2px;
  border-color: transparent;
  padding: 6px 8px;
  background: transparent;
  text-align: left;
}

.mention-menu button.is-active,
.mention-menu button:hover {
  border-color: var(--accent);
  background: #142418;
}

.mention-menu strong,
.mention-menu span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mention-menu span {
  color: var(--muted);
  font-size: 12px;
}

#terminal {
  min-width: 0;
  min-height: 0;
  padding: 10px 12px 10px 10px;
}

#terminal .xterm {
  box-sizing: border-box;
  height: 100%;
  max-width: 100%;
}

.empty-state {
  position: absolute;
  inset: 0 0 56px 0;
  display: grid;
  place-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
  pointer-events: none;
}

.empty-state strong {
  color: var(--text);
  font-size: 18px;
}

.send-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(7, auto);
  gap: 8px;
  border-top: 1px solid var(--line);
  padding: 8px;
  background: var(--surface);
}

.send-bar input {
  min-width: 0;
}

.send-bar button {
  min-width: 44px;
  min-height: 38px;
  padding: 0 8px;
}

.send-bar button[type="submit"] {
  border-color: transparent;
  background: var(--warn);
  color: #181004;
  font-weight: 700;
}

.sidebar-backdrop {
  display: none;
}

.modal {
  width: min(430px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

.meeting-modal {
  width: min(700px, calc(100vw - 32px));
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.modal-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.modal-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.modal-header div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.modal-header strong {
  font-size: 16px;
}

.modal-header span {
  color: var(--muted);
  font-size: 12px;
}

.icon-close {
  width: 34px;
  min-height: 34px;
  padding: 0;
}

.modal-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.meeting-modal .modal-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.meeting-candidate-list {
  display: grid;
  max-height: min(340px, 42vh);
  gap: 8px;
  overflow: auto;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.candidate-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(120px, 0.55fr);
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px;
  background: #141610;
}

.candidate-row.is-disabled {
  opacity: 0.55;
}

.candidate-row input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  padding: 0;
}

.candidate-details {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.candidate-details strong,
.candidate-details span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.candidate-details span {
  color: var(--muted);
  font-size: 12px;
}

/* Imago sci-fi console theme. Layout selectors stay unchanged so TUI behavior is intact. */
button,
input,
select,
textarea {
  border-color: var(--line);
}

button {
  background:
    linear-gradient(180deg, rgba(27, 57, 82, 0.92), rgba(9, 22, 35, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

button:hover:not(:disabled),
button:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(66, 248, 232, 0.14), 0 0 18px rgba(66, 248, 232, 0.16);
}

input,
select,
textarea {
  background: rgba(2, 9, 16, 0.82);
  box-shadow: inset 0 0 0 1px rgba(66, 248, 232, 0.03);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(66, 248, 232, 0.1);
}

.login-view {
  background:
    linear-gradient(135deg, rgba(7, 22, 36, 0.95), rgba(5, 10, 18, 0.98)),
    repeating-linear-gradient(90deg, rgba(66, 248, 232, 0.05) 0 1px, transparent 1px 84px),
    repeating-linear-gradient(0deg, rgba(66, 248, 232, 0.035) 0 1px, transparent 1px 84px);
}

.login-shell {
  width: min(900px, 100%);
}

.login-panel,
.saved-panel,
.modal {
  border-color: rgba(66, 248, 232, 0.24);
  background:
    linear-gradient(180deg, rgba(11, 30, 48, 0.9), rgba(7, 17, 28, 0.96));
  box-shadow: var(--panel-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.brand-block {
  display: grid;
  justify-items: start;
  gap: 10px;
}

.brand-mark {
  width: 72px;
  height: 72px;
  filter: drop-shadow(0 0 18px rgba(66, 248, 232, 0.42));
}

.brand-block h1 {
  font-size: 34px;
  font-weight: 750;
  line-height: 1;
}

.brand-block p {
  color: #9ffcf4;
  font-size: 13px;
  text-transform: uppercase;
}

.message {
  border-color: rgba(66, 248, 232, 0.22);
  background: rgba(4, 15, 25, 0.88);
}

.login-panel button[type="submit"],
.stack-form button[type="submit"],
.modal-actions button[type="submit"] {
  background: linear-gradient(135deg, #42f8e8, #2fb7ff 56%, #7c5dff);
  color: #021018;
}

.app {
  background:
    linear-gradient(180deg, rgba(7, 18, 30, 0.95), rgba(2, 7, 13, 1)),
    repeating-linear-gradient(90deg, rgba(66, 248, 232, 0.04) 0 1px, transparent 1px 88px);
}

.topbar {
  border-bottom-color: rgba(66, 248, 232, 0.22);
  background:
    linear-gradient(90deg, rgba(8, 23, 37, 0.98), rgba(11, 27, 45, 0.95));
  box-shadow: 0 1px 24px rgba(47, 183, 255, 0.12);
}

.title-block {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.title-block > div {
  display: grid;
  min-width: 0;
}

.topbar-mark {
  width: 34px;
  height: 34px;
  filter: drop-shadow(0 0 12px rgba(66, 248, 232, 0.34));
}

.title-block strong {
  color: var(--text);
  font-size: 16px;
  font-weight: 760;
}

.title-block small {
  color: #8eb5c9;
}

.icon-button {
  border-color: rgba(66, 248, 232, 0.2);
  background: rgba(3, 12, 20, 0.78);
}

.icon-button span {
  background: var(--accent);
  box-shadow: 0 0 8px rgba(66, 248, 232, 0.45);
}

.compact-button,
.mini-button,
.section-actions button,
.meeting-actions button {
  color: #dffbff;
}

.compact-button.danger,
.mini-button.danger,
.danger {
  color: #ffdce4;
}

.layout {
  background:
    linear-gradient(180deg, rgba(4, 13, 22, 0.96), rgba(2, 7, 13, 1)),
    var(--terminal);
}

.sidebar,
.meeting-rail {
  border-color: rgba(66, 248, 232, 0.18);
  background:
    linear-gradient(180deg, rgba(8, 22, 35, 0.96), rgba(5, 13, 23, 0.98));
}

.section-title {
  color: #7bd8e8;
  font-weight: 700;
}

.list-row,
.participant-item,
.candidate-row,
.chat-message {
  border-color: rgba(66, 248, 232, 0.16);
  background:
    linear-gradient(180deg, rgba(12, 29, 45, 0.86), rgba(6, 16, 27, 0.92));
}

.list-row.is-active {
  border-color: rgba(66, 248, 232, 0.72);
  background:
    linear-gradient(180deg, rgba(18, 54, 75, 0.88), rgba(7, 22, 34, 0.95));
  box-shadow: inset 3px 0 0 var(--accent), 0 0 24px rgba(66, 248, 232, 0.1);
}

.row-main strong {
  color: #f4fbff;
}

.row-main span {
  color: #88a8ba;
}

.status-dot.running,
.participant-dot.ready {
  background: var(--accent);
  box-shadow: 0 0 14px rgba(66, 248, 232, 0.58);
}

.status-dot.exited,
.participant-dot.thinking,
.participant-dot.queued,
.participant-dot.connecting,
.participant-dot.executing {
  background: var(--warn);
}

.segmented button.is-active,
.mention-menu button.is-active,
.mention-menu button:hover {
  border-color: var(--accent);
  background: rgba(18, 66, 85, 0.72);
}

.terminal-area {
  border-left: 1px solid rgba(66, 248, 232, 0.08);
  background:
    linear-gradient(180deg, rgba(4, 13, 22, 0.8), rgba(1, 6, 12, 1)),
    repeating-linear-gradient(0deg, rgba(66, 248, 232, 0.035) 0 1px, transparent 1px 24px),
    var(--terminal);
}

#terminal {
  background:
    linear-gradient(180deg, rgba(3, 10, 17, 0.22), rgba(1, 5, 10, 0.64));
}

#terminal .xterm {
  filter: saturate(1.08);
}

.empty-state strong {
  color: #dffbff;
}

.send-bar,
.meeting-header,
.meeting-composer {
  border-color: rgba(66, 248, 232, 0.18);
  background:
    linear-gradient(180deg, rgba(9, 24, 38, 0.98), rgba(5, 14, 24, 0.98));
}

.send-bar button[type="submit"] {
  background: linear-gradient(135deg, #f7b85f, #42f8e8);
  color: #031018;
}

.meeting-room {
  background:
    linear-gradient(180deg, rgba(5, 15, 25, 0.98), rgba(2, 7, 13, 1));
}

.meeting-chat-log {
  background:
    repeating-linear-gradient(90deg, rgba(66, 248, 232, 0.025) 0 1px, transparent 1px 80px);
}

.chat-message.host {
  border-color: rgba(66, 248, 232, 0.44);
  background: rgba(8, 39, 55, 0.86);
}

.chat-message.host .chat-message-header strong {
  color: #7ff8f0;
}

.chat-message.task,
.chat-message.memo {
  border-color: rgba(247, 184, 95, 0.52);
  background: rgba(42, 29, 12, 0.78);
}

.mention-menu {
  border-color: rgba(66, 248, 232, 0.38);
  background: #06111d;
}

/* Imago button system refresh. Keeps existing sizing/layout and replaces the visual skin. */
button {
  position: relative;
  border-color: rgba(154, 223, 208, 0.24);
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.012)),
    linear-gradient(180deg, rgba(32, 46, 50, 0.96), rgba(18, 27, 30, 0.98));
  color: #eef4ee;
  font-weight: 650;
  letter-spacing: 0;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 8px 20px rgba(0, 0, 0, 0.14);
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

button:hover:not(:disabled),
button:focus-visible {
  border-color: rgba(154, 223, 208, 0.82);
  outline: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 0 3px rgba(154, 223, 208, 0.16),
    0 12px 28px rgba(0, 0, 0, 0.2);
}

button:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow:
    inset 0 1px 4px rgba(0, 0, 0, 0.28),
    0 0 0 3px rgba(154, 223, 208, 0.1);
}

button:disabled {
  border-color: rgba(60, 83, 86, 0.42);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)),
    rgba(18, 27, 30, 0.74);
  color: rgba(170, 184, 178, 0.48);
  box-shadow: none;
  opacity: 1;
}

.login-panel button[type="submit"],
.stack-form button[type="submit"],
.modal-actions button[type="submit"],
.send-bar button[type="submit"],
.meeting-composer button {
  border-color: transparent;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.34), transparent 42%),
    linear-gradient(135deg, #9adfd0 0%, #d9f4e8 48%, #f0b98e 100%);
  color: #081012;
  font-weight: 760;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    0 12px 30px rgba(154, 223, 208, 0.16),
    0 8px 22px rgba(0, 0, 0, 0.22);
}

.login-panel button[type="submit"]:hover,
.stack-form button[type="submit"]:hover,
.modal-actions button[type="submit"]:hover,
.send-bar button[type="submit"]:hover,
.meeting-composer button:hover {
  border-color: transparent;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 0 0 3px rgba(240, 185, 142, 0.16),
    0 14px 34px rgba(154, 223, 208, 0.2);
}

.compact-button,
.mini-button,
.section-actions button,
.meeting-actions button,
.send-bar button {
  min-height: 34px;
  border-color: rgba(154, 223, 208, 0.2);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.006)),
    rgba(23, 35, 39, 0.92);
  color: #eef4ee;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.065);
}

.compact-button:hover:not(:disabled),
.mini-button:hover:not(:disabled),
.section-actions button:hover:not(:disabled),
.meeting-actions button:hover:not(:disabled),
.send-bar button:hover:not(:disabled) {
  background:
    linear-gradient(180deg, rgba(154, 223, 208, 0.105), rgba(255, 255, 255, 0.014)),
    rgba(32, 46, 50, 0.96);
}

.danger,
.compact-button.danger,
.mini-button.danger {
  border-color: rgba(237, 125, 120, 0.34);
  background:
    linear-gradient(180deg, rgba(237, 125, 120, 0.16), rgba(237, 125, 120, 0.045)),
    rgba(32, 30, 30, 0.96);
  color: #ffe1de;
}

.danger:hover:not(:disabled),
.compact-button.danger:hover:not(:disabled),
.mini-button.danger:hover:not(:disabled) {
  border-color: rgba(237, 125, 120, 0.72);
  box-shadow:
    0 0 0 3px rgba(237, 125, 120, 0.14),
    0 12px 26px rgba(0, 0, 0, 0.22);
}

.icon-button {
  border-color: rgba(154, 223, 208, 0.26);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.052), rgba(255, 255, 255, 0.006)),
    rgba(18, 27, 30, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.075),
    0 8px 18px rgba(0, 0, 0, 0.18);
}

.icon-button span {
  background: #d9f4e8;
  box-shadow: 0 0 9px rgba(154, 223, 208, 0.36);
}

.segmented {
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(154, 223, 208, 0.2);
  border-radius: 7px;
  background: rgba(7, 16, 18, 0.56);
}

.segmented button {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.segmented button + button {
  border-left: 1px solid rgba(154, 223, 208, 0.16);
}

.segmented button.is-active {
  border-color: transparent;
  background:
    linear-gradient(135deg, rgba(154, 223, 208, 0.26), rgba(240, 185, 142, 0.12)),
    rgba(23, 35, 39, 0.98);
  color: #f8fff8;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -2px 0 rgba(154, 223, 208, 0.72);
}

.mention-menu button {
  box-shadow: none;
}

.row-main,
.sidebar-backdrop {
  box-shadow: none;
}

#refresh-button,
#meeting-button,
#new-session-button,
#kill-button,
#delete-session-button,
#add-profile-button,
#edit-profile-button,
#remove-profile-button,
#session-start-button,
#meeting-terminal-button,
#meeting-add-button,
#meeting-auto-button,
#meeting-end-button,
#meeting-send-button,
#meeting-refresh-button,
#login-submit,
#profile-save-button,
.send-bar button,
.icon-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

#refresh-button::before,
#meeting-button::before,
#new-session-button::before,
#kill-button::before,
#delete-session-button::before,
#add-profile-button::before,
#edit-profile-button::before,
#remove-profile-button::before,
#session-start-button::before,
#meeting-terminal-button::before,
#meeting-add-button::before,
#meeting-auto-button::before,
#meeting-end-button::before,
#meeting-send-button::before,
#meeting-refresh-button::before,
#login-submit::before,
#profile-save-button::before,
.send-bar button::before,
.icon-close::before {
  content: "";
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  background: currentColor;
  opacity: 0.92;
  -webkit-mask-image: var(--button-icon);
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-image: var(--button-icon);
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
}

#refresh-button,
#meeting-refresh-button {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a9 9 0 0 1-15.2 6.5'/%3E%3Cpath d='M3 12A9 9 0 0 1 18.2 5.5'/%3E%3Cpath d='M18 3v5h-5'/%3E%3Cpath d='M6 21v-5h5'/%3E%3C/svg%3E");
}

#meeting-button,
#meeting-add-button {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M22 21v-2a4 4 0 0 0-3-3.9'/%3E%3Cpath d='M16 3.1a4 4 0 0 1 0 7.8'/%3E%3C/svg%3E");
}

#new-session-button,
#add-profile-button {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M12 5v14'/%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E");
}

#kill-button,
#meeting-end-button {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='6' y='6' width='12' height='12' rx='2'/%3E%3C/svg%3E");
}

#delete-session-button,
#remove-profile-button {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M8 6V4h8v2'/%3E%3Cpath d='M19 6l-1 14H6L5 6'/%3E%3Cpath d='M10 11v5'/%3E%3Cpath d='M14 11v5'/%3E%3C/svg%3E");
}

#edit-profile-button {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z'/%3E%3C/svg%3E");
}

#session-start-button,
#login-submit,
#profile-save-button {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M8 5.4v13.2c0 .8.9 1.3 1.6.9l10.2-6.6c.6-.4.6-1.4 0-1.8L9.6 4.5C8.9 4.1 8 4.6 8 5.4Z'/%3E%3C/svg%3E");
}

#meeting-terminal-button {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 17 6-6-6-6'/%3E%3Cpath d='M12 19h8'/%3E%3C/svg%3E");
}

#meeting-auto-button {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12a8 8 0 0 1 13.6-5.7'/%3E%3Cpath d='M18 3v5h-5'/%3E%3Cpath d='M20 12a8 8 0 0 1-13.6 5.7'/%3E%3Cpath d='M6 21v-5h5'/%3E%3C/svg%3E");
}

#meeting-send-button,
.send-bar button[type="submit"] {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m22 2-7 20-4-9-9-4Z'/%3E%3Cpath d='M22 2 11 13'/%3E%3C/svg%3E");
}

.send-bar button[data-send-key="up"] {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 15 6-6 6 6'/%3E%3C/svg%3E");
}

.send-bar button[data-send-key="down"] {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

.send-bar button[data-send-key="enter"] {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 4v7a4 4 0 0 1-4 4H5'/%3E%3Cpath d='m9 11-4 4 4 4'/%3E%3C/svg%3E");
}

.send-bar button[data-send-key="tab"] {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8h10'/%3E%3Cpath d='m10 4 4 4-4 4'/%3E%3Cpath d='M20 4v16'/%3E%3C/svg%3E");
}

.send-bar button[data-send-key="esc"] {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 9 4 14l5 5'/%3E%3Cpath d='M20 5v5a4 4 0 0 1-4 4H4'/%3E%3C/svg%3E");
}

.send-bar button[data-send-key="ctrlc"] {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18a6 6 0 1 1 0-12'/%3E%3Cpath d='M17 18a6 6 0 1 1 0-12'/%3E%3C/svg%3E");
}

.icon-close {
  font-size: 0;
}

.icon-close::before {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12'/%3E%3Cpath d='M18 6 6 18'/%3E%3C/svg%3E");
  width: 16px;
  height: 16px;
}

#sidebar-toggle {
  gap: 0;
  font-size: 0;
}

#sidebar-toggle span {
  display: none;
}

#sidebar-toggle::before {
  content: "";
  width: 18px;
  height: 18px;
  background: #d9f4e8;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M4 7h16'/%3E%3Cpath d='M4 12h16'/%3E%3Cpath d='M4 17h16'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M4 7h16'/%3E%3Cpath d='M4 12h16'/%3E%3Cpath d='M4 17h16'/%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 0 8px rgba(154, 223, 208, 0.32));
}

@media (max-width: 860px) {
  .login-shell {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .app {
    grid-template-rows: 54px minmax(0, 1fr);
  }

  .topbar {
    grid-template-columns: 40px minmax(0, 1fr) minmax(0, 54vw);
    padding: 7px 8px;
  }

  .top-actions {
    gap: 6px;
    max-width: none;
  }

  .compact-button {
    min-width: 52px;
    padding: 0 8px;
  }

  .top-actions {
    justify-content: end;
  }

  .top-actions .compact-button {
    display: grid;
    place-items: center;
    position: relative;
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
    gap: 0;
    font-size: 0;
    line-height: 0;
  }

  .top-actions .compact-button::before {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: 0;
    transform: translate(-50%, -50%);
  }

  .layout,
  .app.sidebar-collapsed .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .app.sidebar-collapsed .sidebar {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: 5;
    top: 54px;
    bottom: 0;
    left: 0;
    width: min(88vw, 360px);
    transform: translateX(-105%);
    transition: transform 160ms ease;
    box-shadow: 16px 0 30px rgba(0, 0, 0, 0.36);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-backdrop.is-visible {
    position: fixed;
    z-index: 4;
    display: block;
    inset: 54px 0 0 0;
    width: 100%;
    min-height: 0;
    border: 0;
    border-radius: 0;
    background: rgba(0, 0, 0, 0.38);
  }

  #terminal {
    padding: 6px;
  }

  .send-bar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .send-bar input {
    grid-column: 1 / -1;
  }

  .send-bar button {
    min-width: 0;
    padding: 0 6px;
  }

  .send-bar button {
    gap: 0;
    font-size: 0;
  }

  .send-bar button::before {
    width: 16px;
    height: 16px;
  }

  .section-actions button {
    gap: 5px;
    padding: 0 6px;
    font-size: 12px;
  }

  .meeting-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .meeting-rail {
    max-height: 160px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .meeting-header {
    grid-template-columns: minmax(0, 1fr);
  }

  .meeting-actions {
    max-width: none;
  }

  .meeting-composer {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .meeting-composer select {
    grid-column: 1 / -1;
  }

  .composer-input-wrap {
    min-width: 0;
  }

  .candidate-row,
  .meeting-modal .modal-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .candidate-row input[type="checkbox"] {
    grid-row: span 2;
  }
}
