/* ══════════════════════════════════════════════════════════════════════
   GUIDE ROOMS — per-question guidance chat for Campus Connect
   Self-contained styles (mirrors study-groups.css / virtual-rooms.css).
   All colour via semantic brand.css tokens so dark mode just works —
   never hardcode #fff / #000 here.
   ────────────────────────────────────────────────────────────────────── */

/* The embed sits in the Campus Connect 3-col shell (rail | feed | side),
   spanning the feed+side columns like the sibling workspaces. */
.gr-embed { grid-column: 2 / 4; min-width: 0; }
[x-cloak] { display: none !important; }
@media (max-width: 1100px) { .gr-embed { grid-column: 1 / -1; } }

/* ───────── BROWSE ───────── */
.gr-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.gr-tb-head h2 { font-family: 'Inter', sans-serif; font-weight: 800; font-size: 19px; color: var(--ink); }
.gr-tb-stats { display: flex; align-items: center; gap: 10px; margin-top: 4px; font-size: 12.5px; color: var(--mute); font-weight: 600; }
.gr-tb-stats b { color: var(--ink-2); }
.gr-dot-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--line); display: inline-block; }
.gr-hot-text { color: var(--rose-d); }
.gr-search { display: flex; align-items: center; gap: 7px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 0 12px; height: 40px; min-width: 260px; }
.gr-search:focus-within { border-color: var(--honey); }
.gr-search-ic { color: var(--mute); font-size: 15px; }
.gr-search input { border: none; outline: none; background: transparent; flex: 1; font-size: 13px; color: var(--ink); font-family: 'Inter', sans-serif; }

.gr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.gr-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px; display: flex; flex-direction: column; gap: 12px;
  transition: border-color .15s, transform .15s, box-shadow .15s; cursor: pointer;
}
.gr-card:hover { border-color: var(--honey); transform: translateY(-2px); box-shadow: 0 10px 26px -16px var(--shadow); }
.gr-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.gr-card h3 { font-family: 'Inter', sans-serif; font-weight: 800; font-size: 15.5px; color: var(--ink); line-height: 1.3; }
.gr-card-sum { font-size: 12.5px; color: var(--body); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.gr-hot {
  flex: none; display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase;
  color: var(--rose-d); background: var(--rose-glow); padding: 3px 8px; border-radius: 999px;
}

.gr-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.gr-chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700;
  color: var(--body); background: var(--mist); border: 1px solid var(--line); padding: 3px 9px; border-radius: 999px;
}
.gr-chip i { font-style: normal; color: var(--mute); font-weight: 600; }
.gr-chip.gr-u-high   { color: var(--rose-d);    background: var(--rose-glow);    border-color: transparent; }
.gr-chip.gr-u-medium { color: var(--honey-d);   background: var(--honey-glow);   border-color: transparent; }
.gr-chip.gr-u-low    { color: var(--emerald-d); background: var(--emerald-glow); border-color: transparent; }
.gr-chip.gr-st-solved { color: var(--emerald-d); background: var(--emerald-glow); border-color: transparent; }

.gr-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 2px; padding-top: 12px; border-top: 1px solid var(--line); }
.gr-asker { display: flex; align-items: center; gap: 8px; min-width: 0; }
.gr-card-stats { display: flex; align-items: center; gap: 9px; font-size: 11.5px; color: var(--mute); font-weight: 600; white-space: nowrap; }
.gr-card-stats i { font-style: normal; }

/* ───────── AVATARS ───────── */
.gr-ava { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; border: 1px solid var(--line); }
.gr-ava-fb {
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-family: 'Inter', sans-serif; font-weight: 800; font-size: 12px; color: var(--on-accent);
  background: linear-gradient(135deg, var(--plum), var(--teal));
}
.gr-ava.sm, .gr-ava-fb.sm { width: 28px; height: 28px; font-size: 10.5px; }
.gr-ava.lg, .gr-ava-fb.lg { width: 40px; height: 40px; font-size: 14px; }
.gr-asker-txt b { font-size: 12.5px; font-weight: 700; color: var(--ink); display: block; line-height: 1.2; }
.gr-asker-txt i { font-style: normal; font-size: 10.5px; color: var(--mute); }

/* ───────── ROOM (detail) ───────── */
.gr-room { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
@media (max-width: 980px) { .gr-room { grid-template-columns: 1fr; } }

.gr-back { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--accent); background: none; border: none; cursor: pointer; padding: 0; margin-bottom: 12px; }
.gr-back:hover { text-decoration: underline; }

.gr-main { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.gr-head { padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.gr-head-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.gr-head h2 { font-family: 'Inter', sans-serif; font-weight: 800; font-size: 20px; color: var(--ink); line-height: 1.25; flex: 1; }
.gr-head-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.gr-follow {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700;
  color: var(--accent); background: var(--surface); border: 1px solid var(--accent); border-radius: 9px; padding: 6px 13px; cursor: pointer;
}
.gr-follow.on { color: var(--on-accent); background: var(--honey); border-color: var(--honey); }
.gr-kebab { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--mute); cursor: pointer; }
.gr-kebab:hover, .gr-kebab.on { color: var(--ink); border-color: var(--honey); }
.gr-kebab-host { position: relative; }
.gr-kebab-menu { position: absolute; top: 38px; right: 0; z-index: 40; min-width: 176px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 34px rgba(11,18,32,.18); padding: 6px; display: flex; flex-direction: column; gap: 1px; }
.gr-kebab-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 11px; border: none; background: transparent; border-radius: 8px; font: inherit; font-size: 13px; font-weight: 500; color: var(--ink); cursor: pointer; text-align: left; }
.gr-kebab-menu button:hover { background: var(--honey-tint, rgba(245,180,40,.14)); }
.gr-kebab-menu button i { width: 17px; text-align: center; }
.gr-head-sum { font-size: 13.5px; color: var(--body); line-height: 1.6; margin-bottom: 12px; }
.gr-head-who { display: flex; align-items: center; gap: 9px; }

.gr-metabar { display: flex; flex-wrap: wrap; gap: 7px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--fog); }

/* tabs */
.gr-tabs { display: flex; gap: 4px; padding: 0 12px; border-bottom: 1px solid var(--line); }
.gr-tab { position: relative; font-size: 13px; font-weight: 700; color: var(--mute); background: none; border: none; padding: 13px 12px; cursor: pointer; }
.gr-tab:hover { color: var(--ink); }
.gr-tab.active { color: var(--accent); }
.gr-tab.active::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: var(--honey); border-radius: 2px 2px 0 0; }
.gr-tab-n { margin-left: 5px; font-size: 11px; background: var(--mist); color: var(--mute); padding: 1px 6px; border-radius: 999px; }

/* thread */
.gr-thread-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px 4px; }
.gr-thread-head span { font-size: 11.5px; font-weight: 700; color: var(--mute); text-transform: uppercase; letter-spacing: .03em; }
.gr-sort { font-size: 11.5px; font-weight: 700; color: var(--accent); background: none; border: none; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.gr-thread { padding: 8px 20px 16px; display: flex; flex-direction: column; gap: 16px; max-height: 560px; overflow-y: auto; }
.gr-msg { display: flex; gap: 11px; }
.gr-msg.me { flex-direction: row-reverse; }
.gr-msg-body { min-width: 0; flex: 1; }
.gr-msg.me .gr-msg-body { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.gr-msg-head { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; flex-wrap: wrap; }
.gr-msg-head b { font-size: 13px; font-weight: 700; color: var(--ink); }
.gr-msg-head time { font-size: 11px; color: var(--mute); }
.gr-badge { font-size: 10px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; color: var(--plum-d); background: var(--plum-glow); }
.gr-badge.role-mentor { color: var(--teal-d);    background: var(--teal-glow); }
.gr-badge.role-faculty,
.gr-badge.role-professor { color: var(--honey-d); background: var(--honey-glow); }
.gr-badge.role-you { color: var(--emerald-d); background: var(--emerald-glow); }
.gr-msg-text { font-size: 13.5px; color: var(--body); line-height: 1.6; }
.gr-msg.me .gr-msg-text {
  background: var(--honey-glow); color: var(--ink-2); padding: 9px 13px; border-radius: 12px 12px 4px 12px; display: inline-block; text-align: left;
}
.gr-code {
  margin-top: 8px; background: var(--deep); color: var(--teal-soft); border: 1px solid var(--ink-3);
  border-radius: 10px; padding: 12px 14px; font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
  font-size: 12px; line-height: 1.6; white-space: pre; overflow-x: auto;
}
.gr-file {
  margin-top: 8px; display: inline-flex; align-items: center; gap: 9px; background: var(--mist);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; max-width: 320px;
}
.gr-file-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--rose-glow); color: var(--rose-d); font-size: 15px; flex: none; }
.gr-file b { font-size: 12.5px; color: var(--ink); display: block; line-height: 1.2; }
.gr-file small { font-size: 11px; color: var(--mute); }

/* composer */
.gr-composer { display: flex; align-items: flex-end; gap: 9px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--fog); }
.gr-composer textarea {
  flex: 1; resize: none; min-height: 42px; max-height: 120px; border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 14px; font-family: 'Inter', sans-serif; font-size: 13.5px; color: var(--ink); background: var(--surface); outline: none; line-height: 1.5;
}
.gr-composer textarea:focus { border-color: var(--honey); }
.gr-attach { width: 42px; height: 42px; flex: none; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--mute); cursor: pointer; font-size: 16px; }
.gr-attach:hover { color: var(--ink); border-color: var(--honey); }
.gr-send { width: 42px; height: 42px; flex: none; border-radius: 11px; border: none; background: var(--honey); color: var(--on-accent); cursor: pointer; font-size: 16px; display: grid; place-items: center; }
.gr-send:hover { background: var(--honey-d); }

/* placeholder tabs */
.gr-empty { padding: 48px 20px; text-align: center; color: var(--mute); font-size: 13px; }
.gr-empty i { font-size: 30px; display: block; margin-bottom: 10px; color: var(--line); }

/* ───────── ASIDE ───────── */
.gr-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 14px; }
.gr-panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 15px 16px; }
.gr-panel h4 { font-family: 'Inter', sans-serif; font-weight: 800; font-size: 13px; color: var(--ink); margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; }
.gr-panel h4 .gr-link { font-size: 11.5px; font-weight: 700; color: var(--accent); cursor: pointer; }

/* ask for guidance */
.gr-ask { background: linear-gradient(135deg, var(--plum), var(--teal)); border: none; color: var(--on-accent); }
.gr-ask h4 { color: var(--on-accent); }
.gr-ask p { font-size: 12px; line-height: 1.55; opacity: .9; margin-bottom: 12px; }
.gr-ask-btn {
  width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 13px; font-weight: 800; color: var(--plum-d); background: #fff; border: none; border-radius: 10px; padding: 10px; cursor: pointer;
}
.gr-ask-btn:hover { filter: brightness(.96); }

/* about */
.gr-about-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 12.5px; border-bottom: 1px solid var(--line); }
.gr-about-row:last-child { border-bottom: none; }
.gr-about-row span { color: var(--mute); font-weight: 600; flex: none; }
.gr-about-row b { color: var(--ink); font-weight: 700; text-align: right; }

/* active guides */
.gr-guide { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.gr-guide + .gr-guide { border-top: 1px solid var(--line); }
.gr-guide-txt { flex: 1; min-width: 0; }
.gr-guide-txt b { font-size: 12.5px; font-weight: 700; color: var(--ink); display: block; line-height: 1.2; }
.gr-guide-txt i { font-style: normal; font-size: 11px; color: var(--mute); }
.gr-state { font-size: 10.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; }
.gr-state::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--mute); }
.gr-state.online { color: var(--emerald-d); }
.gr-state.online::before { background: var(--emerald); }
.gr-state.busy { color: var(--honey-d); }
.gr-state.busy::before { background: var(--honey); }

/* solution status stepper */
.gr-stepper { display: flex; flex-direction: column; gap: 0; margin-bottom: 14px; }
.gr-step { display: flex; align-items: center; gap: 10px; position: relative; padding: 4px 0; }
.gr-step-dot { width: 18px; height: 18px; border-radius: 50%; flex: none; border: 2px solid var(--line); background: var(--surface); display: grid; place-items: center; font-size: 9px; color: var(--on-accent); z-index: 1; }
.gr-step:not(:last-child)::before { content: ''; position: absolute; left: 8px; top: 22px; bottom: -4px; width: 2px; background: var(--line); }
.gr-step.done .gr-step-dot { background: var(--emerald); border-color: var(--emerald); }
.gr-step.done:not(:last-child)::before { background: var(--emerald); }
.gr-step.current .gr-step-dot { border-color: var(--honey); background: var(--honey); }
.gr-step-lbl { font-size: 12.5px; font-weight: 600; color: var(--mute); }
.gr-step.done .gr-step-lbl, .gr-step.current .gr-step-lbl { color: var(--ink); font-weight: 700; }
.gr-solve-btn {
  width: 100%; font-size: 13px; font-weight: 800; color: var(--on-accent); background: var(--emerald-d);
  border: none; border-radius: 10px; padding: 10px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
}
.gr-solve-btn:hover { filter: brightness(1.05); }
.gr-solve-btn:disabled { background: var(--mist); color: var(--mute); cursor: default; filter: none; }
