/* The habitat group chat (js/group-chat.js): a tab in the docked terminal, and a sidebar panel on the habitat page.
   Button rules carry .gc so they beat the terminal's own `.hab button` reset. */
.gc {
  --gy: #FED804; --gink: #0A0A0B; --gp: #6D28D9; --gline: rgba(255, 255, 255, .14); --gtext: #F4F2EC; --ggrey: #8C8C93;
  --gmono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, "JetBrains Mono", Consolas, monospace;
  --gsans: "Avenir Next", Avenir, "Nunito Sans", "Segoe UI", system-ui, sans-serif;
  display: flex; flex-direction: column; min-height: 0; height: 100%; color: var(--gtext); font: 400 13px/1.4 var(--gsans);
}
.gc__head { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-bottom: 1px solid var(--gline);
  font: 600 9px/1.35 var(--gmono); letter-spacing: .1em; text-transform: uppercase; color: #c9c7c1; }
.gc__dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #77767c; }
.gc[data-state="at-desk"] .gc__dot { background: #3ddc84; box-shadow: 0 0 8px rgba(61, 220, 132, .7); }
.gc[data-state="checking"] .gc__dot { background: var(--gy); box-shadow: 0 0 8px rgba(254, 216, 4, .8); animation: gc-pulse 1s ease-in-out infinite; }
.gc[data-state="asleep"] .gc__dot { background: #6e6af0; }
.gc[data-state="checking"] .gc__say::after { content: ""; display: inline-block; width: 1.4em; text-align: left; animation: gc-dots 1.2s steps(4) infinite; }
@keyframes gc-pulse { 50% { opacity: .35; } }
@keyframes gc-dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.gc__online { margin-left: auto; flex: none; color: var(--ggrey); }
.gc__soon { margin: 0; padding: 28px 18px; text-align: center; color: #c9c7c1; }

.gc__log { list-style: none; margin: 0; padding: 12px 14px 6px; flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px;
  scrollbar-width: thin; scrollbar-color: #333 transparent; }
.gc__empty { margin: auto 0; padding: 24px 12px; text-align: center; color: var(--ggrey); }
.gc__m { max-width: 88%; align-self: flex-start; }
.gc__m.is-mine { align-self: flex-end; }
.gc__by { display: flex; align-items: baseline; gap: 6px; font: 600 8.5px/1 var(--gmono); font-style: normal; letter-spacing: .1em; text-transform: uppercase; color: #a9a7a1; }
.gc__by b { color: #e9e7e1; font-weight: 700; }
.gc__by time { color: var(--ggrey); }
.gc__tag { font-style: normal; color: #b57bff; }
.gc__m--satya .gc__by b { color: var(--gy); }
.gc__t { margin: 4px 0 0; padding: 8px 11px; border-radius: 12px; background: rgba(255, 255, 255, .07); white-space: pre-wrap; overflow-wrap: anywhere; }
.gc__m.is-mine .gc__t { background: rgba(109, 40, 217, .42); }
.gc__m--satya .gc__t { background: rgba(254, 216, 4, .1); border: 1px solid rgba(254, 216, 4, .35); }
.gc__m.is-question .gc__t { background: var(--gy); border-color: var(--gy); color: var(--gink); font-weight: 700; }
.gc__m.is-held .gc__t { opacity: .55; border: 1px dashed rgba(255, 179, 71, .7); }
.gc__quote { margin: 4px 0 0; padding: 4px 9px; border-left: 2px solid var(--gy); color: #a9a7a1; font-size: 11.5px; }
.gc__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 5px; font: 600 8.5px/1 var(--gmono); letter-spacing: .06em; text-transform: uppercase; color: #8f8d87; }
.gc__seen { color: #3ddc84; }
.gc__seen::before { content: "✓ "; }
.gc .gc__heart, .gc .gc__re { padding: 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.gc .gc__heart:hover, .gc .gc__re:hover { color: var(--gtext); }
.gc .gc__heart.is-on { color: #ff4fb3; }
.gc__held { display: block; margin-top: 5px; color: #ffb347; font-size: 11px; }

.gc__reply { display: flex; align-items: center; gap: 8px; margin: 4px 10px 0; padding: 6px 10px; border-radius: 6px; background: rgba(254, 216, 4, .08); color: #c9c7c1; font-size: 11.5px; }
.gc__reply[hidden] { display: none; }
.gc .gc__x { margin-left: auto; padding: 0 2px; border: 0; background: none; color: #c9c7c1; cursor: pointer; }
.gc__in { flex: none; display: flex; height: 42px; margin: 8px 10px 6px; border: 1px solid rgba(255, 255, 255, .2); }
.gc__in[hidden] { display: none; }
.gc__in:focus-within { border-color: var(--gy); }
.gc__in input { min-width: 0; padding: 0 11px; border: 0; background: none; color: var(--gtext); font: 400 13px var(--gsans); }
.gc__in input:focus-visible { outline: none; }
.gc__name { width: 32%; border-right: 1px solid var(--gline) !important; }
.gc__name[hidden] { display: none; }
.gc__text { flex: 1; }
.gc .gc__send { flex: none; width: 44px; border: 0; background: var(--gy); color: var(--gink); font: 700 16px/1 var(--gsans); cursor: pointer; }
.gc .gc__send:disabled { opacity: .5; }
.gc__note { margin: 0 14px 4px; color: #8f8d87; font-size: 10.5px; line-height: 1.4; }
.gc__note.is-error { color: #ff8a8a; }
.gc__who { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 14px 10px; font: 600 8.5px/1.4 var(--gmono); letter-spacing: .08em; text-transform: uppercase; color: #a9a7a1; }
.gc .gc__link { padding: 0; border: 0; background: none; color: var(--gy); font: inherit; letter-spacing: inherit; text-transform: inherit; text-decoration: underline; cursor: pointer; }

/* in the docked terminal: two tabs above the chat, only while it's open */
.hab__tabs { display: none; flex: none; gap: 4px; padding: 8px 10px 2px; }
.hab[data-size="open"] .hab__tabs { display: flex; }
.hab .hab__tab { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; height: 30px; padding: 0 6px; border: 1px solid rgba(255, 255, 255, .16); background: none;
  color: #c9c7c1; font: 600 9px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .12em; text-transform: uppercase; cursor: pointer; }
.hab .hab__tab[aria-selected="true"] { border-color: var(--y, #FED804); background: var(--y, #FED804); color: var(--ink, #0A0A0B); }
.hab__unread { min-width: 16px; padding: 2px 5px; border-radius: 8px; background: #ff4fb3; color: #fff; font-size: 8px; letter-spacing: 0; }
.hab__unread[hidden] { display: none; }
.hab__group { display: none; flex: 1; min-height: 0; }
.hab[data-size="open"] .hab__group:not([hidden]) { display: flex; flex-direction: column; }
.hab--group .hab__log, .hab--group .hab__chips, .hab--group .hab__in, .hab--group .hab__privacy { display: none !important; }

/* on the habitat page: the sidebar panel */
.hp-panel[data-panel="group"] .gc { height: min(68vh, 640px); margin-top: 10px; border: 1px solid var(--gline); border-radius: 10px; overflow: hidden; background: rgba(10, 10, 11, .55); }
/* the sidebar body holds the chat at its own height, so her presence line never scrolls away */
.hp-side__body:has(> .hp-panel[data-panel="group"].on) { display: flex; flex-direction: column; overflow: hidden; }
.hp-side__body:has(> .hp-panel[data-panel="group"].on) > .hp-panel.on { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.hp-side__body:has(> .hp-panel[data-panel="group"].on) .gc { flex: 1; height: auto; margin-top: 0; }
.hp-slot[data-group-open] { position: relative; }
.hp-slot[data-group-open][hidden] { display: none; }
.hp-slot[data-group-open] .hab__unread { position: absolute; top: 4px; right: 4px; }

@media (prefers-reduced-motion: reduce) { .gc[data-state="checking"] .gc__dot, .gc[data-state="checking"] .gc__say::after { animation: none; } }
