/* ── Reset & root variables ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sb-bg:          #3F0E40;
  --sb-bg-hover:    rgba(255,255,255,.08);
  --sb-bg-active:   rgba(255,255,255,.15);
  --sb-text:        #CFC3CF;
  --sb-text-bright: #FFFFFF;
  --sb-border:      rgba(255,255,255,.1);

  --main-bg:        #FFFFFF;
  --msg-hover:      #F8F8F8;
  --border:         #E8E8E8;

  --text-primary:   #1D1C1D;
  --text-secondary: #616061;
  --text-muted:     #868686;

  --blue:           #1264A3;
  --blue-light:     #D8EAFD;
  --green:          #007A5A;
  --green-light:    #D7F7C2;
  --yellow:         #ECB22E;
  --yellow-light:   #FFF4CE;
  --red:            #E01E5A;
  --red-light:      #FCEBF0;
  --purple:         #7C3085;
  --purple-light:   #F0E6F6;
  --orange:         #D94F00;
  --orange-light:   #FDECD5;

  --radius:         6px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

@keyframes bg-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

html, body { height: 100%; overflow: hidden; }

html {
  background: linear-gradient(135deg, #1a1525, #0a1628, #2d0f3a, #0e2236, #3F0E40, #0a1628, #1a1525);
  background-size: 400% 400%;
  animation: bg-shift 12s ease infinite;
}

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.46667;
  color: var(--text-primary);
  background: transparent;
}

/* ── Themes ─────────────────────────────────────────────────── */

/* Hoth — light sidebar */
[data-theme="hoth"] {
  --sb-bg:          #F8F8F8;
  --sb-bg-hover:    rgba(0,0,0,.06);
  --sb-bg-active:   rgba(18,100,163,.12);
  --sb-text:        #606060;
  --sb-text-bright: #1D1C1D;
  --sb-border:      rgba(0,0,0,.12);
}
[data-theme="hoth"] .sidebar { border-right: 1px solid #E0E0E0; }
[data-theme="hoth"] .sidebar-search { background: rgba(0,0,0,.06); border-color: rgba(0,0,0,.1); color: #606060; }
[data-theme="hoth"] .workspace-btn { color: #1D1C1D; }
[data-theme="hoth"] .compose-btn { background: rgba(0,0,0,.08); color: #1D1C1D; }
[data-theme="hoth"] .online-dot { border: 2px solid #F8F8F8; }

/* Ocean */
[data-theme="ocean"] {
  --sb-bg:          #0C4A6E;
  --sb-bg-hover:    rgba(255,255,255,.09);
  --sb-bg-active:   rgba(255,255,255,.16);
  --sb-text:        #9DC4D8;
  --sb-text-bright: #FFFFFF;
  --sb-border:      rgba(255,255,255,.1);
}

/* Dark — full dark mode */
[data-theme="dark"] {
  --sb-bg:          #1a1d21;
  --sb-bg-hover:    rgba(255,255,255,.07);
  --sb-bg-active:   rgba(255,255,255,.13);
  --sb-text:        #C9C9C9;
  --sb-text-bright: #FFFFFF;
  --sb-border:      rgba(255,255,255,.08);

  --main-bg:        #222529;
  --msg-hover:      #27292d;
  --border:         #424447;
  --text-primary:   #D1D2D3;
  --text-secondary: #9b9b9b;
  --text-muted:     #6c7074;

  --blue-light:     #1a2f42;
  --green-light:    #1a3028;
  --purple-light:   #2a1f35;
  --yellow-light:   #2e2510;
  --red-light:      #2e1520;
  --orange-light:   #2e1a0a;
}
[data-theme="dark"] .channel-header { background: #222529; border-color: #424447; }
[data-theme="dark"] .input-wrapper  { background: #222529; border-color: #424447; }
[data-theme="dark"] .input-row      { border-color: #555860; background: #2a2d31; }
[data-theme="dark"] .message-input  { color: #D1D2D3; }
[data-theme="dark"] .send-btn.active { background: #007A5A; }

[data-theme="dark"] .canvas-block   { background: #2a2d31; border-color: #424447; box-shadow: none; }
[data-theme="dark"] .canvas-header  { background: #222529; border-color: #424447; }
[data-theme="dark"] .canvas-btn     { background: #2a2d31; border-color: #555860; color: #9b9b9b; }
[data-theme="dark"] .canvas-label svg { color: #9b9b9b; }
[data-theme="dark"] .canvas-title,
[data-theme="dark"] .canvas-p,
[data-theme="dark"] .canvas-list li,
[data-theme="dark"] .canvas-section h3,
[data-theme="dark"] .edu-degree { color: #D1D2D3; }

[data-theme="dark"] .attachment     { background: #2a2d31; border-top-color: #424447; border-right-color: #424447; border-bottom-color: #424447; }
[data-theme="dark"] .attach-text,
[data-theme="dark"] .attach-field-value { color: #D1D2D3; }
[data-theme="dark"] .tech-tag       { background: rgba(255,255,255,.08); color: #9b9b9b; }

[data-theme="dark"] .project-card   { background: #2a2d31; border-color: #424447; }
[data-theme="dark"] .project-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.4); }
[data-theme="dark"] .project-name   { color: #D1D2D3; }
[data-theme="dark"] .project-desc   { color: #9b9b9b; }

[data-theme="dark"] .reaction       { background: #2a2d31; border-color: #424447; }
[data-theme="dark"] .reaction:hover { background: #1a2f42; }
[data-theme="dark"] .reaction.reacted { background: #1a2f42; }

[data-theme="dark"] .bot-response   { background: #2a2d31; border-color: #424447; }
[data-theme="dark"] .bot-response p,
[data-theme="dark"] .bot-response li { color: #D1D2D3; }

[data-theme="dark"] .msg-actions    { background: #2a2d31; border-color: #424447; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
[data-theme="dark"] .action-btn     { color: #D1D2D3; }
[data-theme="dark"] .action-btn:hover { background: #343840; }
[data-theme="dark"] .msg-text a     { color: #5dade2; }

[data-theme="dark"] .suggestion-chip { background: #2a2d31; border-color: #424447; }
[data-theme="dark"] .suggestion-chip:hover { background: #1a2f42; }

[data-theme="dark"] .profile-avatar-large { background: linear-gradient(135deg, #1a1d21, #4A154B); }
[data-theme="dark"] .profile-info h2,
[data-theme="dark"] .profile-info .role { color: #D1D2D3; }

[data-theme="dark"] .skill-chip     { background: rgba(255,255,255,0.04); }
[data-theme="dark"] .date-divider   { color: #6c7074; }
[data-theme="dark"] .date-divider::before,
[data-theme="dark"] .date-divider::after { background: #424447; }
[data-theme="dark"] .channel-intro h1 { color: #D1D2D3; }
[data-theme="dark"] .toolbar-btn    { color: #9b9b9b; }
[data-theme="dark"] .toolbar-btn:hover { background: #2a2d31; color: #D1D2D3; }
[data-theme="dark"] .toolbar-divider { background: #424447; }
[data-theme="dark"] .header-btn     { color: #9b9b9b; }
[data-theme="dark"] .header-btn:hover { background: #2a2d31; color: #D1D2D3; }
[data-theme="dark"] .huddle-btn     { background: #2a2d31; border-color: #555860; color: #9b9b9b; }
[data-theme="dark"] .huddle-btn:hover { border-color: #2BAC76; color: #2BAC76; background: #1a3028; }
[data-theme="dark"] .huddle-btn.active { background: #007A5A; border-color: #007A5A; color: white; }

/* ── Theme panel ─────────────────────────────────────────────── */
.theme-panel {
  display: none;
  margin: 2px 8px 8px;
  background: #2c1f3e;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  padding: 12px;
  animation: theme-panel-in .15s ease;
}
[data-theme="hoth"] .theme-panel { background: #fff; border-color: #E0E0E0; }
[data-theme="dark"]  .theme-panel { background: #2a2d31; border-color: #424447; }
[data-theme="ocean"] .theme-panel { background: #07344e; border-color: rgba(255,255,255,.12); }

@keyframes theme-panel-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.theme-panel.open { display: block; }

.theme-panel-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--sb-text);
  margin-bottom: 10px;
  letter-spacing: .04em;
}

.theme-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.theme-card {
  background: rgba(255,255,255,.06);
  border: 1.5px solid transparent;
  border-radius: 6px;
  padding: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
  position: relative;
  transition: border-color .15s, background .15s;
  font-family: var(--font);
}
[data-theme="hoth"] .theme-card { background: #f0f0f0; }
.theme-card:hover { border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.1); }
[data-theme="hoth"] .theme-card:hover { border-color: #aaa; background: #e8e8e8; }
.theme-card.active { border-color: #2BAC76; background: rgba(43,172,118,.1); }

.theme-preview {
  width: 100%;
  height: 32px;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  border: 1px solid rgba(0,0,0,.15);
}
.tp-sidebar { width: 38%; height: 100%; flex-shrink: 0; }
.tp-main    { flex: 1; height: 100%; }

.theme-card span {
  font-size: 11px;
  font-weight: 600;
  color: #fff;
}
[data-theme="hoth"] .theme-card span { color: #1D1C1D; }

.theme-check {
  width: 14px; height: 14px;
  color: #2BAC76;
  position: absolute;
  top: 6px; right: 6px;
  display: none;
}
.theme-card.active .theme-check { display: block; }

/* ── App layout ─────────────────────────────────────────────── */
#app {
  display: flex;
  width: calc(100% - 40px);
  max-width: 1280px;
  height: calc(100vh - 40px);
  margin: 20px auto;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.65), 0 0 0 1px rgba(255,255,255,.05);
}

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--sb-bg);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.2) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 4px; }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--sb-border);
  min-height: 52px;
}

.workspace-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--sb-text-bright);
  font-weight: 700;
  font-size: 15px;
  padding: 4px 6px;
  border-radius: var(--radius);
  transition: background .15s;
}
.workspace-btn:hover { background: var(--sb-bg-hover); }
.workspace-btn svg { opacity: .7; }

.compose-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  border: none;
  cursor: pointer;
  color: var(--sb-text-bright);
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.compose-btn:hover { background: rgba(255,255,255,.2); }

.sidebar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 12px;
  padding: 6px 10px;
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--radius);
  color: var(--sb-text);
  font-size: 13px;
  cursor: pointer;
  transition: background .15s;
}
.sidebar-search:hover { background: rgba(255,255,255,.13); }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 4px 0;
  border-bottom: 1px solid var(--sb-border);
  margin-bottom: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 16px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--sb-text);
  font-size: 14px;
  font-family: var(--font);
  border-radius: var(--radius);
  margin: 1px 8px;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--sb-bg-hover); color: var(--sb-text-bright); }
.nav-item.active { background: var(--sb-bg-active); color: var(--sb-text-bright); }

.sidebar-section { padding: 4px 0 8px; }

.section-header {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px 2px 12px;
  cursor: pointer;
  color: var(--sb-text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
  user-select: none;
  border-radius: var(--radius);
  margin: 0 4px;
  transition: background .12s;
}
.section-header:hover { background: var(--sb-bg-hover); color: var(--sb-text-bright); }
.section-header span { flex: 1; }

.section-chevron {
  transition: transform .2s;
  flex-shrink: 0;
}
.section-chevron.open { transform: rotate(0deg); }
.section-chevron.closed { transform: rotate(-90deg); }

.section-add {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--sb-text);
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px;
  padding: 2px;
  transition: background .12s, color .12s;
  flex-shrink: 0;
  opacity: 0;
}
.section-header:hover .section-add { opacity: 1; }
.section-add:hover { background: rgba(255,255,255,.15); color: var(--sb-text-bright); }

.sidebar-list {
  list-style: none;
  padding: 0;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 16px;
  cursor: pointer;
  color: var(--sb-text);
  font-size: 14.5px;
  border-radius: var(--radius);
  margin: 1px 8px;
  transition: background .12s, color .12s;
  position: relative;
}
.sidebar-item:hover { background: var(--sb-bg-hover); color: var(--sb-text-bright); }
.sidebar-item.active {
  background: var(--sb-bg-active);
  color: var(--sb-text-bright);
  font-weight: 700;
}

.item-hash {
  font-size: 17px;
  font-weight: 400;
  line-height: 1;
  opacity: .8;
  flex-shrink: 0;
  width: 16px;
  text-align: center;
}

.dm-item { gap: 8px; }
.dm-avatar {
  width: 20px; height: 20px;
  border-radius: 4px;
  background: #36C5F0;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: white;
  font-size: 11px;
}
.dm-avatar.bot { background: transparent; overflow: hidden; }
.dm-avatar.bot img { width: 20px; height: 20px; object-fit: contain; }

.online-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #2BAC76;
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
}

/* ── Main content ───────────────────────────────────────────── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  background: var(--main-bg);
}

.channel-header {
  height: 52px;
  min-height: 52px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--main-bg);
  z-index: 10;
}

.channel-header-left { display: flex; align-items: center; gap: 12px; }

.channel-title {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
}
.channel-title:hover .channel-name-display { text-decoration: underline; }
.channel-prefix { font-size: 18px; font-weight: 400; color: var(--text-secondary); }

.channel-desc {
  font-size: 13px;
  color: var(--text-secondary);
  border-left: 1px solid var(--border);
  padding-left: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 400px;
}

.channel-header-right { display: flex; align-items: center; gap: 4px; }
.header-btn {
  width: 32px; height: 32px;
  border-radius: var(--radius);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s;
}
.header-btn:hover { background: var(--msg-hover); color: var(--text-primary); }

/* ── Messages area ──────────────────────────────────────────── */
.messages-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 0 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.messages-area::-webkit-scrollbar { width: 6px; }
.messages-area::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; }

/* Date divider */
.date-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}
.date-divider::before, .date-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Message ────────────────────────────────────────────────── */
.message {
  display: flex;
  gap: 10px;
  padding: 6px 20px;
  position: relative;
  transition: background .1s;
}
.message:hover { background: var(--msg-hover); }
.message:hover .msg-actions { opacity: 1; }

.message.continued {
  padding-top: 2px;
  padding-bottom: 2px;
}

.msg-avatar {
  width: 36px; height: 36px;
  border-radius: 4px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: white;
  margin-top: 2px;
  overflow: hidden;
}

.message.continued .msg-avatar { visibility: hidden; }

.msg-body { flex: 1; min-width: 0; }

.msg-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
}

.msg-author {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
  cursor: pointer;
}
.msg-author:hover { text-decoration: underline; }

.msg-time {
  font-size: 12px;
  color: var(--text-muted);
}

.message.continued .msg-header { display: none; }
.message.continued .msg-time {
  display: block;
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  opacity: 0;
}
.message.continued:hover .msg-time { opacity: 1; }

.msg-text { color: var(--text-primary); word-break: break-word; }
.msg-text a { color: var(--blue); text-decoration: none; }
.msg-text a:hover { text-decoration: underline; }
.msg-text code {
  background: rgba(97,96,97,.1);
  border: 1px solid rgba(97,96,97,.2);
  border-radius: 3px;
  padding: 2px 4px;
  font-size: 12px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}
.msg-text strong { font-weight: 700; }
.msg-text em { font-style: italic; }

/* ── Message actions (hover) ────────────────────────────────── */
.msg-actions {
  position: absolute;
  right: 20px;
  top: 4px;
  background: var(--main-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  gap: 2px;
  padding: 3px;
  opacity: 0;
  transition: opacity .1s;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  z-index: 5;
}
.action-btn {
  width: 28px; height: 28px;
  border-radius: 4px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  transition: background .1s;
}
.action-btn:hover { background: var(--msg-hover); }

/* ── Emoji reactions ────────────────────────────────────────── */
.reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.reaction {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--main-bg);
  cursor: pointer;
  font-size: 14px;
  transition: background .1s, border-color .1s;
  user-select: none;
}
.reaction:hover { background: var(--blue-light); border-color: var(--blue); }
.reaction.reacted { background: var(--blue-light); border-color: var(--blue); }
.reaction-count { font-size: 12px; font-weight: 700; color: var(--text-secondary); }
.reaction.reacted .reaction-count { color: var(--blue); }

/* ── Canvas block ───────────────────────────────────────────── */
.canvas-block {
  background: var(--main-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 8px 0;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  max-width: 680px;
}

.canvas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: #FAFAFA;
}

.canvas-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.canvas-label svg { color: #7B5EA7; }

.canvas-actions { display: flex; gap: 6px; }
.canvas-btn {
  padding: 3px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--main-bg);
  font-size: 12px;
  cursor: pointer;
  color: var(--text-secondary);
  font-family: var(--font);
  transition: background .1s;
}
.canvas-btn:hover { background: var(--msg-hover); }

.canvas-body { padding: 20px 24px; }

.canvas-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  line-height: 1.3;
}
.canvas-title .emoji { margin-right: 8px; }

.canvas-section { margin-bottom: 20px; }
.canvas-section h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.canvas-p {
  font-size: 15px;
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: 8px;
}

.canvas-list { list-style: none; padding: 0; }
.canvas-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 4px 0;
  font-size: 15px;
  color: var(--text-primary);
  line-height: 1.5;
}
.canvas-list li::before { content: '•'; color: var(--text-muted); flex-shrink: 0; margin-top: 1px; }

.edu-entry { display: flex; align-items: center; gap: 12px; }
.edu-entry .attach-logo-img { width: 40px; height: 40px; }
.edu-degree { font-size: 15px; font-weight: 600; color: var(--text-primary); line-height: 1.4; }
.edu-institution { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* profile hero in canvas */
.profile-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 0 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.profile-avatar-large {
  width: 72px; height: 72px;
  border-radius: 12px;
  background: linear-gradient(135deg, #4A154B 0%, #7C3085 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  letter-spacing: -1px;
}
.profile-info h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.profile-info .role {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.profile-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge-blue { background: var(--blue-light); color: var(--blue); }
.badge-green { background: var(--green-light); color: var(--green); }
.badge-purple { background: var(--purple-light); color: var(--purple); }
.badge-yellow { background: var(--yellow-light); color: #946000; }

/* ── Attachment block ───────────────────────────────────────── */
.attachment {
  border-left: 3px solid var(--blue);
  background: var(--main-bg);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 12px 14px;
  margin: 8px 0;
  max-width: 680px;
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.attachment.green { border-left-color: var(--green); }
.attachment.purple { border-left-color: var(--purple); }
.attachment.orange { border-left-color: var(--orange); }
.attachment.yellow { border-left-color: var(--yellow); }
.attachment.red { border-left-color: var(--red); }

.attach-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 6px; }
.attach-header-main { display: flex; align-items: center; gap: 10px; }
.attach-logo-img { width: 18px; height: 18px; object-fit: contain; border-radius: 2px; flex-shrink: 0; }
.attach-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}

.attach-date {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  margin-left: 8px;
  flex-shrink: 0;
}
.attach-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.attach-text { font-size: 14px; color: var(--text-primary); line-height: 1.55; margin-bottom: 10px; }
.attach-fields { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 10px; }
.attach-field-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 2px; }
.attach-field-value { font-size: 13px; color: var(--text-primary); }

/* ── Attachment highlight list ──────────────────────────────── */
.attach-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 8px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.attach-list li {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 3px 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.attach-list-bullet {
  color: var(--text-muted);
  flex-shrink: 0;
  margin-top: 1px;
  font-size: 12px;
}
[data-theme="dark"] .attach-list li { color: #9b9b9b; }

.tech-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.tech-tag {
  padding: 2px 8px;
  background: rgba(97,96,97,.08);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  font-family: "SFMono-Regular", Consolas, Menlo, monospace;
}

/* ── Skills ─────────────────────────────────────────────────── */
@keyframes chipIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.skill-featured {
  margin-bottom: 20px;
  padding: 16px;
  border-radius: 8px;
  background: var(--bg-secondary);
  border-left: 3px solid var(--cat-color);
}

.skills-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .skills-grid { grid-template-columns: 1fr; } }

.skill-category {
  padding: 14px;
  border-radius: 8px;
  background: var(--bg-secondary);
  border-left: 3px solid var(--cat-color);
}

.skill-cat-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}
.skill-cat-icon { font-size: 14px; }
.skill-cat-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-secondary);
}

.skill-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.skill-chip {
  font-size: 13px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1.5px solid;
  background: transparent;
  color: var(--text-primary);
  opacity: 0;
  animation: chipIn 0.35s ease forwards;
}
.skill-featured .skill-chip { font-size: 14px; padding: 5px 13px; }

/* ── Project cards ──────────────────────────────────────────── */
.projects-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 8px 0; max-width: 680px; }
@media (max-width: 600px) { .projects-grid { grid-template-columns: 1fr; } }

.project-card {
  background: var(--main-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  transition: box-shadow .2s, transform .2s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}
.project-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); transform: translateY(-2px); }

.project-icon { font-size: 28px; margin-bottom: 10px; }
.project-name { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.project-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 8px; }
.project-impact { font-size: 12px; font-weight: 600; color: var(--green); margin-bottom: 10px; line-height: 1.4; }
.project-stats { display: flex; gap: 12px; margin-bottom: 10px; }
.project-stat { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 3px; }

.qr-block { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.qr-code { width: 140px; height: 140px; border-radius: 8px; border: 1px solid var(--border); display: block; }
.qr-label { font-size: 12px; color: var(--text-muted); }

/* ── Input area ─────────────────────────────────────────────── */
.input-wrapper {
  border-top: 1px solid var(--border);
  padding: 12px 20px 16px;
  background: var(--main-bg);
}

.input-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-bottom: 6px;
}

.toolbar-btn {
  width: 28px; height: 28px;
  border-radius: 4px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  transition: background .1s, color .1s;
}
.toolbar-btn:hover { background: var(--msg-hover); color: var(--text-primary); }
.toolbar-btn b, .toolbar-btn i, .toolbar-btn s { font-size: 14px; }

.toolbar-divider { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }

.input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px 10px 14px;
  transition: border-color .15s, box-shadow .15s;
}
.input-row:focus-within {
  border-color: #aaa;
  box-shadow: 0 0 0 2px rgba(18,100,163,.1);
}

.message-input {
  flex: 1;
  min-height: 22px;
  max-height: 180px;
  overflow-y: auto;
  outline: none;
  font-size: 15px;
  font-family: var(--font);
  color: var(--text-primary);
  line-height: 1.46667;
  word-break: break-word;
}
.message-input:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  pointer-events: none;
}

.send-btn {
  width: 30px; height: 30px;
  border-radius: 6px;
  background: #007A5A;
  border: none;
  cursor: pointer;
  color: white;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .15s;
  opacity: .4;
  pointer-events: none;
}
.send-btn.active { opacity: 1; pointer-events: all; }
.send-btn.active:hover { background: #006043; }

/* ── Slackbot typing indicator ──────────────────────────────── */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 6px 0 2px;
}
.typing-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typing-bounce 1.2s infinite;
}
.typing-dot:nth-child(2) { animation-delay: .2s; }
.typing-dot:nth-child(3) { animation-delay: .4s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .6; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* ── Bot suggestion chips ───────────────────────────────────── */
.bot-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.suggestion-chip {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--blue);
  cursor: pointer;
  background: var(--main-bg);
  font-family: var(--font);
  transition: background .12s, border-color .12s;
}
.suggestion-chip:hover { background: var(--blue-light); border-color: var(--blue); }

/* ── Slackbot message bubble ────────────────────────────────── */
.bot-response { background: var(--msg-hover); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin: 4px 0; max-width: 600px; }
.bot-response p { font-size: 14px; color: var(--text-primary); line-height: 1.6; margin-bottom: 6px; }
.bot-response p:last-child { margin-bottom: 0; }
.bot-response strong { font-weight: 700; }
.bot-response ul { padding-left: 18px; margin: 6px 0; }
.bot-response li { font-size: 14px; color: var(--text-primary); line-height: 1.55; margin-bottom: 3px; }
.bot-response code { background: rgba(97,96,97,.1); border-radius: 3px; padding: 1px 5px; font-size: 12px; font-family: monospace; }
.bot-response .bot-code-block {
  background: #1D1C1D;
  color: #F2EFEF;
  border-radius: 6px;
  padding: 12px 14px;
  font-size: 13px;
  font-family: monospace;
  margin: 8px 0;
  overflow-x: auto;
  white-space: pre;
}

/* ── Utility ────────────────────────────────────────────────── */
.tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}
.tag-blue { background: var(--blue-light); color: var(--blue); }
.tag-green { background: var(--green-light); color: var(--green); }

.channel-intro {
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.channel-intro h1 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.channel-intro .intro-desc { font-size: 15px; color: var(--text-secondary); }

/* animate in messages */
@keyframes msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.message { animation: msg-in .18s ease forwards; }

/* slackbot channel */
.channel-slackbot .msg-avatar { background: linear-gradient(135deg, #4A154B, #7C3085); }

/* ── Huddle button ──────────────────────────────────────────── */
.huddle-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  background: var(--main-bg);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  transition: all .15s;
}
.huddle-btn:hover {
  border-color: #2BAC76;
  color: #007A5A;
  background: var(--green-light);
}
.huddle-btn.active {
  background: #007A5A;
  border-color: #007A5A;
  color: white;
  animation: huddle-glow .8s ease-in-out infinite alternate;
}
@keyframes huddle-glow {
  from { box-shadow: 0 0 0 0 rgba(0,122,90,.4); }
  to   { box-shadow: 0 0 0 6px rgba(0,122,90,0); }
}
.huddle-btn-label { white-space: nowrap; }

/* ── Huddle bar (bottom of sidebar) ────────────────────────── */
.huddle-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 12px;
  border-top: 1px solid transparent;
  background: rgba(0,0,0,.25);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height .3s ease-out, padding .3s ease-out, opacity .2s, border-color .3s;
  flex-shrink: 0;
}
.huddle-bar.active {
  max-height: 140px;
  padding: 10px 12px 12px;
  border-top-color: rgba(255,255,255,.1);
  opacity: 1;
}
.huddle-bar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.huddle-bar-left { display: flex; align-items: center; gap: 10px; }

/* Mini player */
.huddle-player {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}
.huddle-nav-btn {
  width: 24px; height: 24px;
  background: rgba(255,255,255,.1);
  border: none;
  border-radius: 4px;
  color: rgba(255,255,255,.8);
  font-size: 9px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .12s;
}
.huddle-nav-btn:hover { background: rgba(255,255,255,.22); }
.huddle-track-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
#huddle-track-emoji { font-size: 13px; flex-shrink: 0; }
.huddle-track-name {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.huddle-track-counter {
  font-size: 10px;
  color: rgba(255,255,255,.4);
  text-align: center;
  margin-top: 3px;
  letter-spacing: .04em;
}

.huddle-pulse {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #2BAC76;
  flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(43,172,118,.7);
  animation: huddle-pulse 1.4s ease-in-out infinite;
}
@keyframes huddle-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(43,172,118,.7); }
  70%  { box-shadow: 0 0 0 8px rgba(43,172,118,0); }
  100% { box-shadow: 0 0 0 0 rgba(43,172,118,0); }
}
.huddle-title { font-size: 12px; font-weight: 700; color: white; margin-bottom: 3px; }

.huddle-waves {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}
.huddle-waves span {
  display: block;
  width: 3px;
  background: #2BAC76;
  border-radius: 2px;
  animation: wave-bounce 1s ease-in-out infinite;
  transform-origin: bottom;
}
.huddle-waves span:nth-child(1) { height: 4px;  animation-delay: 0s; }
.huddle-waves span:nth-child(2) { height: 8px;  animation-delay: .1s; }
.huddle-waves span:nth-child(3) { height: 12px; animation-delay: .2s; }
.huddle-waves span:nth-child(4) { height: 6px;  animation-delay: .15s; }
.huddle-waves span:nth-child(5) { height: 10px; animation-delay: .05s; }
@keyframes wave-bounce {
  0%, 100% { transform: scaleY(.4); }
  50%       { transform: scaleY(1); }
}

.huddle-leave {
  padding: 3px 10px;
  border-radius: 4px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  color: white;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background .12s;
}
.huddle-leave:hover { background: rgba(255,255,255,.22); }

/* sidebar needs flex column to push huddle bar down */
.sidebar { flex-direction: column; }

/* ── Sidebar footer (user area + huddle) ────────────────────── */
.sidebar-footer {
  margin-top: auto;
  flex-shrink: 0;
}

.user-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 8px;
  cursor: pointer;
  border-top: 1px solid var(--sb-border);
  transition: background .12s;
}
.user-area:hover { background: var(--sb-bg-hover); }

.user-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}
.user-area-avatar {
  width: 28px; height: 28px;
  border-radius: 6px;
  object-fit: cover;
  display: block;
}
.user-area-status-dot {
  width: 10px; height: 10px;
  background: #2BAC76;
  border-radius: 50%;
  border: 2px solid var(--sb-bg);
  position: absolute;
  bottom: -2px; right: -2px;
}
[data-theme="hoth"] .user-area-status-dot { border-color: #F8F8F8; }

.user-area-info {
  flex: 1;
  min-width: 0;
}
.user-area-name {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--sb-text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.user-area-status-text {
  display: block;
  font-size: 11px;
  color: var(--sb-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-area-mic {
  width: 26px; height: 26px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--sb-text);
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px;
  flex-shrink: 0;
  transition: background .12s, color .12s;
}
.user-area-mic:hover { background: var(--sb-bg-hover); color: var(--sb-text-bright); }

/* ── Hamburger (hidden on desktop) ─────────────────────────── */
.hamburger-btn { display: none; }

/* ── Sidebar overlay ────────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 99;
}
.sidebar-overlay.visible { display: block; }

/* ── Mobile ──────────────────────────────────────────────────── */
@media (max-width: 768px) {

  #app {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    border-radius: 0;
    max-width: none;
    box-shadow: none;
  }

  .sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100%;
    height: 100dvh;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,.45);
  }

  .hamburger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: var(--radius);
    flex-shrink: 0;
    transition: background .12s;
    margin-right: 2px;
  }
  .hamburger-btn:hover { background: var(--msg-hover); }

  .channel-header { padding: 0 12px; }
  .channel-desc { display: none; }

  .message { padding: 6px 12px; }
  .message.continued { padding: 2px 12px; }
  .date-divider { padding: 12px 12px 6px; }
  .channel-intro { padding: 16px 12px 12px; }

  .canvas-body { padding: 14px; }
  .canvas-title { font-size: 18px; }
  .canvas-block { max-width: none; }
  .attachment { padding: 10px 12px; max-width: none; }
  .attach-fields { flex-direction: column; gap: 8px; }
  .projects-grid { grid-template-columns: 1fr; max-width: none; }
  .skills-grid { grid-template-columns: 1fr; }

  .profile-hero { flex-direction: column; align-items: flex-start; gap: 14px; }

  .input-wrapper { padding: 8px 12px 12px; }
  .input-toolbar { display: none; }

  .msg-actions { display: none; }

  .huddle-btn { padding: 5px 8px; }
  .huddle-btn-label { display: none; }

}

/* photo avatar */
.msg-avatar-img {
  width: 36px; height: 36px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  margin-top: 2px;
}
.message.continued .msg-avatar-img { visibility: hidden; }

/* canvas featured photo */
.canvas-featured-photo {
  position: relative;
  width: 100%;
  height: 300px;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 24px;
  background: #000;
}
.canvas-featured-photo-bg {
  position: absolute;
  inset: 0;
  background: url('../assets/me.jpg') center/cover;
  filter: blur(18px) brightness(0.45);
  transform: scale(1.1);
}
.canvas-featured-photo img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center top;
  display: block;
}
.canvas-featured-photo-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding: 40px 20px 18px;
  background: linear-gradient(transparent, rgba(0,0,0,0.62));
}
.canvas-featured-name {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.canvas-featured-role {
  font-size: 13px;
  color: rgba(255,255,255,0.82);
  margin-top: 3px;
}

/* profile hero photo */
.profile-avatar-large img {
  width: 72px; height: 72px;
  border-radius: 12px;
  object-fit: cover;
  display: block;
}
