/* Kohli — SYRIX.
 *
 * Deliberately thin. The chat reuses the bubble and composer vocabulary from
 * components.css so it looks like the rest of the app rather than a bolted-on
 * widget, and every colour here is an existing token, so light, dark, large
 * text and Simple Mode all work without a second set of rules.
 */

/* ============ Overview card ============ */

.syrix-ov {
  background: var(--card);
  border: 0.5px solid var(--card-edge);
  border-radius: var(--radius-lg);
  margin: 0 16px 14px;
  overflow: hidden;
}

.syrix-ov-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 10px 4px 14px;
}

.syrix-ov-mark {
  display: grid;
  place-items: center;
  color: var(--text);
}
.syrix-ov-mark .icon { width: 15px; height: 15px; }

.syrix-ov-title {
  flex: 1;
  font-size: 0.68em;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-2);
}

/* Says plainly that a model wrote this, so nobody mistakes it for a figure
   the app calculated. */
.syrix-ov-kind {
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-3);
}

.syrix-ov-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text-3);
}
.syrix-ov-btn .icon { width: 15px; height: 15px; }
.syrix-ov-btn:active { background: var(--pressed); }

.syrix-ov-body {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0 14px 13px;
}

.syrix-ov-line {
  display: block;
  font-size: 0.9em;
  line-height: 1.45;
  color: var(--text);
}
.syrix-ov-line + .syrix-ov-line { margin-top: 3px; }

/* Refreshing in the background: say so quietly rather than blanking the card,
   which would make the screen jump about while you are reading it. */
.syrix-ov.busy .syrix-ov-body { opacity: 0.55; }
.syrix-ov.busy .syrix-ov-mark { animation: syrix-pulse 1.4s ease-in-out infinite; }

@keyframes syrix-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

/* ============ Chat ============ */

.syrix-screen {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.syrix-bar {
  display: flex;
  gap: 8px;
  padding: 0 16px 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.syrix-bar::-webkit-scrollbar { display: none; }

.syrix-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--fill);
  border: 0.5px solid var(--card-edge);
  font-size: 0.8em;
  color: var(--text);
}
.syrix-chip .icon { width: 14px; height: 14px; color: var(--text-2); }
.syrix-chip:active { background: var(--pressed); }

.syrix-thread { padding: 4px 16px 4px; flex: 1; }

/* SYRIX speaks in a card, the user in the filled bubble the family chat
   already uses — so at a glance you can tell which side is which. */
.syrix-bubble {
  max-width: 88%;
  background: var(--card);
  border: 0.5px solid var(--card-edge);
  border-radius: 18px;
  padding: 11px 14px;
  font-size: 0.95em;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.syrix-row { display: flex; flex-direction: column; align-items: flex-start; margin-bottom: 10px; }
.syrix-row.mine { align-items: flex-end; }
.syrix-row.mine .syrix-bubble {
  background: var(--accent);
  color: var(--on-accent);
  border-color: transparent;
  max-width: 78%;
}

.syrix-bubble.failed {
  border-color: var(--destructive);
  color: var(--text-2);
}

/* ---- the working state ---- */

.syrix-working {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  padding: 8px 11px;
  margin: 1px 0 11px;
  border-radius: 999px;
  background: var(--fill);
  border: 0.5px solid var(--card-edge);
  font-size: 0.8em;
  color: var(--text-2);
}
.syrix-working > span:last-child { min-width: 0; }
.syrix-working b { display: block; font-weight: 550; color: var(--text); }
.syrix-working small { display: block; overflow: hidden; max-width: 230px; margin-top: 1px; color: var(--text-3); text-overflow: ellipsis; white-space: nowrap; }
.syrix-thinking-mark { position: relative; width: 19px; height: 19px; flex-shrink: 0; }
.syrix-thinking-mark i { position: absolute; inset: 2px; border: 1.4px solid currentColor; border-radius: 50%; opacity: .16; animation: syrix-ripple 1.55s ease-out infinite; }
.syrix-thinking-mark i:nth-child(2) { animation-delay: .45s; }
.syrix-thinking-mark i:nth-child(3) { animation-delay: .9s; }
.syrix-working-searching .syrix-thinking-mark { color: var(--accent); }
@keyframes syrix-ripple {
  0% { transform: scale(.42); opacity: .72; }
  82%, 100% { transform: scale(1.05); opacity: .08; }
}

@media (prefers-reduced-motion: reduce) {
  .syrix-thinking-mark i, .syrix-ov.busy .syrix-ov-mark { animation: none; }
}

/* ---- sources ---- */

.syrix-sources { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }

.syrix-source {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--fill);
  border: 0.5px solid var(--card-edge);
  font-size: 0.74em;
  color: var(--text-2);
}
.syrix-source span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.syrix-source-mark { position: relative; display: grid; place-items: center; width: 15px; height: 15px; overflow: hidden; border-radius: 4px; background: var(--card); color: var(--text-2); flex-shrink: 0; }
.syrix-source-mark i { font-size: 9px; font-style: normal; font-weight: 700; line-height: 1; }
.syrix-source-logo { position: absolute; inset: 0; width: 15px; height: 15px; object-fit: cover; background: var(--card); }

/* ---- per-message actions ---- */

.syrix-acts { display: flex; gap: 2px; margin-top: 4px; }

.syrix-act {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 8px;
  font-size: 0.74em;
  color: var(--text-3);
}
.syrix-act .icon { width: 14px; height: 14px; }
.syrix-act:active { background: var(--pressed); }

/* ---- action and confirmation cards ---- */

.syrix-card {
  width: 100%;
  max-width: 88%;
  background: var(--card);
  border: 0.5px solid var(--card-edge);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-top: 8px;
}

.syrix-card-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  margin-bottom: 9px;
}
.syrix-card-title .icon { width: 18px; height: 18px; }

.syrix-card-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86em;
  color: var(--text-2);
  padding: 2px 0;
}
.syrix-card-row .icon { width: 15px; height: 15px; flex-shrink: 0; }

.syrix-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 13px;
}
.syrix-card-actions .btn { flex: 1; }

/* ---- attachments ---- */

.syrix-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 8px;
}

.syrix-att {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px 7px 11px;
  border-radius: 12px;
  background: var(--fill);
  border: 0.5px solid var(--card-edge);
  font-size: 0.78em;
  max-width: 100%;
}
.syrix-att .icon { width: 15px; height: 15px; flex-shrink: 0; color: var(--text-2); }
.syrix-att b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.syrix-att small { color: var(--text-3); flex-shrink: 0; }

.syrix-att-drop {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text-3);
  flex-shrink: 0;
}
.syrix-att-drop .icon { width: 13px; height: 13px; }

.syrix-att-bar {
  height: 2px;
  border-radius: 2px;
  background: var(--text-3);
  transition: width 0.2s linear;
}

.syrix-thumb {
  display: block;
  max-width: 220px;
  width: 100%;
  border-radius: 12px;
  margin-bottom: 6px;
}

/* ---- composer ---- */

.syrix-composer { align-items: flex-end; }

.syrix-input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  max-height: 132px;
  resize: none;
  background: var(--fill);
  border: 0.5px solid var(--card-edge);
  border-radius: 22px;
  padding: 12px 16px;
  font-size: 0.96em;
  line-height: 1.35;
  font-family: inherit;
}
.syrix-input:focus { border-color: var(--text-3); }

.syrix-mic.on {
  background: var(--accent);
  color: var(--on-accent);
}

.syrix-foot {
  text-align: center;
  font-size: 0.68em;
  color: var(--text-3);
  padding: 0 24px 8px;
}

.pair-status {
  display: none;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: 11px;
  font-size: 0.78em;
  line-height: 1.35;
}
.pair-status.busy, .pair-status.error, .pair-status.success { display: flex; }
.pair-status.busy { background: var(--fill); color: var(--text-2); }
.pair-status.error { background: var(--fill); color: var(--destructive); }
.pair-status.success { background: var(--fill); color: var(--green); }
.pair-status > .icon { width: 17px; height: 17px; flex-shrink: 0; }
.pair-status .syrix-thinking-mark { width: 17px; height: 17px; }

/* ---- empty state ---- */

.syrix-empty { text-align: center; padding: 48px 28px 30px; }

.syrix-empty .syrix-emblem {
  width: 62px;
  height: 62px;
  margin: 0 auto 16px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: var(--fill);
  border: 0.5px solid var(--card-edge);
  color: var(--text);
}
.syrix-empty .syrix-emblem .icon { width: 32px; height: 32px; }

.syrix-empty h2 { font-size: 1.24em; margin-bottom: 5px; }
.syrix-empty p { color: var(--text-2); font-size: 0.9em; line-height: 1.45; }

.syrix-suggests { display: grid; gap: 8px; margin-top: 22px; }

.syrix-suggest-head {
  font-size: 0.68em;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-3);
  text-align: left;
  margin-top: 10px;
}
.syrix-suggest-head:first-child { margin-top: 0; }

.syrix-suggest {
  padding: 12px 15px;
  border-radius: 14px;
  background: var(--card);
  border: 0.5px solid var(--card-edge);
  text-align: left;
  font-size: 0.88em;
  color: var(--text);
}
.syrix-suggest:active { background: var(--pressed); }

/* ---- setup notice ---- */

.syrix-notice {
  margin: 0 16px 14px;
  padding: 13px 15px;
  border-radius: var(--radius-lg);
  background: var(--fill);
  border: 0.5px solid var(--card-edge);
  font-size: 0.86em;
  color: var(--text-2);
  line-height: 1.45;
}
.syrix-notice b { color: var(--text); font-weight: 600; }

/* ---- mode picker ---- */

.syrix-mode {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 15px;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 0.5px solid var(--card-edge);
  margin-bottom: 10px;
}
.syrix-mode.on {
  background: var(--accent);
  color: var(--on-accent);
  border-color: transparent;
}
.syrix-mode .icon { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; }
.syrix-mode b { display: block; margin-bottom: 3px; letter-spacing: 0.04em; }
.syrix-mode small { font-size: 0.84em; opacity: 0.75; line-height: 1.4; display: block; }
.syrix-mode .syrix-mode-tick { margin-left: auto; align-self: center; }

/* ---- privacy sheet ---- */

.syrix-privacy-row {
  display: flex;
  gap: 13px;
  padding: 11px 0;
}
.syrix-privacy-row .icon { width: 19px; height: 19px; flex-shrink: 0; margin-top: 2px; color: var(--text-2); }
.syrix-privacy-row b { display: block; margin-bottom: 2px; }
.syrix-privacy-row p { font-size: 0.86em; color: var(--text-2); line-height: 1.45; }

/* ============ Simple Mode ============ */

:root[data-simple="on"] .syrix-ov-line { font-size: 1em; }
:root[data-simple="on"] .syrix-bubble { max-width: 94%; font-size: 1em; }
:root[data-simple="on"] .syrix-acts { gap: 6px; }
:root[data-simple="on"] .syrix-act { padding: 9px 12px; font-size: 0.82em; }
:root[data-simple="on"] .syrix-foot { font-size: 0.78em; }

/* ============ Kohli Control ============ */

.ctl-card { padding: 4px 0; }

.ctl-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 15px;
}
.ctl-row + .ctl-row { border-top: 0.5px solid var(--separator); }

.ctl-main { flex: 1; min-width: 0; }
.ctl-main b { display: block; font-weight: 500; }
.ctl-main small {
  display: block;
  font-size: 0.8em;
  color: var(--text-2);
  line-height: 1.35;
  margin-top: 1px;
}

/* Three states and no fourth. A light here has to have been checked. */
.ctl-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.ctl-dot .icon { width: 14px; height: 14px; }
.ctl-dot.green { background: var(--green-bg); color: var(--green); }
.ctl-dot.amber { background: var(--fill); color: var(--text-2); }
.ctl-dot.off   { background: var(--fill); color: var(--text-3); }
