/*!*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ../../node_modules/.pnpm/next@14.2.30_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[12].use[2]!../../node_modules/.pnpm/next@14.2.30_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[12].use[3]!./app/globals.css ***!
  \*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
:root {
  --bg: #f7f3ea;
  --bg-strong: #f0e6d2;
  --surface: #fffaf2;
  --surface-alt: #f8efd9;
  --text: #2f2419;
  --text-muted: #6a5846;
  --border: #d8c3a2;
  --accent: #1f7a5a;
  --accent-strong: #15563f;
  --danger: #a32121;
}

[data-theme="dark"] {
  --bg: #14110d;
  --bg-strong: #1a1612;
  --surface: #1e1a15;
  --surface-alt: #26211b;
  --text: #e7e0d3;
  --text-muted: #a49688;
  --border: #3d352c;
  --accent: #2da178;
  --accent-strong: #3ac091;
  --danger: #e64a4a;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(circle at 10% 10%, var(--bg-strong), var(--bg));
  color: var(--text);
  font-family: "Space Grotesk", "IBM Plex Sans", "Trebuchet MS", sans-serif;
}

.app {
  height: 100vh;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow: hidden;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.85rem;
}

.topbar h1 {
  margin: 0;
  font-size: 1.35rem;
}

.topbar-meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.topbar-meta .icon-button {
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.4rem;
  font-size: 1.1rem;
  line-height: 1.5;
}

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}

.modal-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  width: 100%;
  max-width: 440px;
  overflow: hidden;
  display: grid;
  grid-gap: 1.25rem;
  gap: 1.25rem;
  padding: 1.5rem;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.add-menu-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  z-index: 1000;
  display: grid;
  min-width: 140px;
  overflow: hidden;
  margin-top: 0.25rem;
}

.add-menu-dropdown button {
  background: transparent;
  color: var(--text);
  border: 0;
  border-radius: 0;
  text-align: left;
  padding: 0.65rem 0.95rem;
  font-size: 0.9rem;
  justify-content: flex-start;
}

.add-menu-dropdown button:hover {
  background: var(--surface-alt);
}

.search-results-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 4px;
  list-style: none;
  padding: 0;
  margin: 0;
  z-index: 1000;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.search-results-dropdown li {
  padding: 8px 12px;
  cursor: pointer;
}

.search-results-dropdown li:hover {
  background: rgba(255, 255, 255, 0.05);
}

.permissions-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  background: var(--accent);
  color: white;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.topbar-meta .icon-button:hover {
  background: var(--surface);
}

.status-pill {
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface-alt);
}

.status-pill[data-state="live"] {
  background: #d4efdf;
  border-color: #83b79a;
  color: #114d36;
}

.status-pill[data-state="polling"] {
  background: #ffeac2;
  border-color: #d6b066;
  color: #614411;
}

.status-pill[data-state="disconnected"] {
  background: #ffe4e4;
  border-color: #e6a5a5;
  color: #7a2121;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  padding: 1rem;
}

.panel h2 {
  margin-top: 0;
}

.error {
  margin: 0;
  color: var(--danger);
  background: #ffe9e9;
  border: 1px solid #f0b4b4;
  border-radius: 0.75rem;
  padding: 0.75rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 17, 13, 0.6);
  display: grid;
  place-items: center;
  z-index: 50;
  padding: 1rem;
}

.modal-panel {
  width: min(1100px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  padding: 1rem;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.modal-header h2 {
  margin: 0;
}

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

.stack {
  display: grid;
  grid-gap: 0.5rem;
  gap: 0.5rem;
  max-width: 480px;
}

label {
  font-weight: 600;
}

input {
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  padding: 0.65rem 0.8rem;
  font: inherit;
  color: inherit;
  background: var(--surface-alt);
}

select {
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  padding: 0.55rem 0.7rem;
  font: inherit;
  color: inherit;
  background: var(--surface-alt);
}

button,
.button-link {
  border: 0;
  border-radius: 0.6rem;
  padding: 0.65rem 0.95rem;
  font: inherit;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button:hover,
.button-link:hover {
  background: var(--accent-strong);
}

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

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.button-link:focus-visible {
  outline: 2px solid #184f95;
  outline-offset: 2px;
}

.ghost {
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
}

.ghost:hover {
  background: var(--surface);
  filter: brightness(0.95);
}

.chat-shell {
  flex: 1 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 220px 240px minmax(0, 1fr) 260px;
  grid-gap: 1rem;
  gap: 1rem;
  overflow: hidden;
}

.chat-shell.details-collapsed {
  grid-template-columns: 220px 240px minmax(0, 1fr);
}

.servers ul,
.channels ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-gap: 0.35rem;
  gap: 0.35rem;
}

.category-heading {
  margin: 0.35rem 0 0.2rem;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.nested-channel-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-gap: 0.25rem;
  gap: 0.25rem;
}

.list-item {
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--text);
  border: 1px solid transparent;
  padding: 0.6rem 0.7rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  overflow: hidden;
  border-radius: 0.6rem;
}

.list-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-item:hover {
  background: var(--surface-alt);
}

.list-item.active {
  background: #e0f0e8;
  border-color: #9dc9b5;
  color: #153f30;
}

.timeline {
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-gap: 0.75rem;
  gap: 0.75rem;
  height: 100%;
  min-height: 0;
}

.unread-pill {
  min-width: 1.2rem;
  height: 1.2rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #d74343;
  color: #fff;
  font-size: 0.72rem;
  line-height: 1.2rem;
  text-align: center;
}

.mention-pill {
  min-width: 1.4rem;
  height: 1.2rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #2359c7;
  color: #fff;
  font-size: 0.72rem;
  line-height: 1.2rem;
  text-align: center;
}



.channel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 1px solid #eadbc4;
  padding-bottom: 0.65rem;
}

.channel-header p {
  margin: 0.2rem 0 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.channel-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.channel-badge {
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.72rem;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
}

.channel-controls {
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  padding: 0.75rem;
  background: #fff7ea;
  display: grid;
  grid-gap: 0.6rem;
  gap: 0.6rem;
}

.controls-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.controls-form label {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.messages {
  list-style: none;
  margin: 0;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  background: var(--surface);
  overflow-y: auto;
  height: 100%;
  min-height: 0;
}

.messages li {
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid #efe3cf;
}

.messages li:last-child {
  border-bottom: 0;
}

.messages header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
}

.messages time {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.messages p {
  margin: 0.35rem 0 0;
  white-space: pre-wrap;
}

.date-divider {
  position: relative;
  text-align: center;
  margin: 0.2rem 0 0.35rem;
}

.date-divider::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 1px solid #eadbc4;
}

.date-divider span {
  position: relative;
  padding: 0 0.45rem;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.76rem;
}

.message-meta {
  display: inline-block;
  margin-top: 0.3rem;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.message-meta-error {
  color: #8f1e1e;
}

.inline-action {
  margin-left: 0.45rem;
  border: 1px solid var(--border);
  border-radius: 0.45rem;
  padding: 0.1rem 0.35rem;
  font-size: 0.75rem;
  background: #fff2f2;
  color: #7d1f1f;
}

.inline-action:hover {
  background: #ffe1e1;
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-gap: 0.55rem;
  gap: 0.55rem;
}

.jump-latest {
  display: flex;
  justify-content: center;
  margin-top: -0.2rem;
}

.jump-latest button {
  background: #2f4b8f;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.jump-latest button:hover {
  background: #20396f;
}

.composer textarea {
  min-height: 44px;
  max-height: 180px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  padding: 0.65rem 0.8rem;
  font: inherit;
  color: inherit;
  background: var(--surface);
}

.composer-actions {
  display: grid;
  grid-gap: 0.4rem;
  gap: 0.4rem;
  align-content: end;
  justify-items: end;
}

.char-count {
  color: var(--text-muted);
  font-size: 0.74rem;
}

.context {
  min-height: 0;
}



.context h3 {
  margin: 0.75rem 0 0.4rem;
  font-size: 0.95rem;
}

.context-line {
  margin: 0.4rem 0;
  color: var(--text-muted);
}

.manager-form {
  margin-top: 0.65rem;
  padding-top: 0.5rem;
  border-top: 1px dashed #e3cfae;
}

.manager-form-danger {
  border-top-color: #e3b3b3;
}

.manager-form-danger button {
  background: #9a2b2b;
}

.manager-form-danger button:hover {
  background: #7e2020;
}

.voice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.active-toggle {
  background: #d9e9ff;
  border-color: #8db0e1;
}

.audit-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-gap: 0.4rem;
  gap: 0.4rem;
}

.audit-list li {
  border: 1px solid #e7d8bf;
  border-radius: 0.5rem;
  padding: 0.45rem 0.55rem;
  font-size: 0.84rem;
}

.inline-buttons {
  display: inline-flex;
  gap: 0.35rem;
  margin-left: 0.45rem;
}

.member-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-gap: 0.35rem;
  gap: 0.35rem;
}

.member-list li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0;
}

.member-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: #2d9c73;
  display: inline-block;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sidebar-settings {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: grid;
  grid-gap: 0.5rem;
  gap: 0.5rem;
}

.inline-mgmt {
  display: flex;
  gap: 0.25rem;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.list-item:hover .inline-mgmt,
.inline-mgmt.persistent {
  opacity: 1;
}

.icon-button {
  width: 24px;
  height: 24px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  background: var(--surface-alt);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.icon-button:hover {
  background: var(--surface);
  color: var(--text);
}

.icon-button.danger:hover {
  background: var(--danger);
  color: #fff;
}

.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 0.5rem;
}

.inline-form {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.35rem;
  padding: 0 0.5rem;
  width: 100%;
}

.inline-form input {
  flex: 1 1;
  padding: 0.35rem 0.5rem;
  font-size: 0.85rem;
}

.inline-form button {
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
}

.scrollable-area {
  flex: 1 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-right: 0.5rem;
  /* Space for scrollbar */
}

.settings-page .panel {
  max-width: 800px;
  margin: 0 auto;
}

.settings-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  display: grid;
  grid-gap: 0.75rem;
  gap: 0.75rem;
}

.settings-list li {
  padding: 1rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.identity-info {
  display: flex;
  flex-direction: column;
}

.identity-info strong {
  text-transform: capitalize;
}

.identity-info span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.muted {
  color: var(--text-muted);
  font-size: 0.9rem;
}

[data-theme="dark"] .messages {
  background: var(--bg);
}

@media (max-width: 980px) {
  .chat-shell {
    grid-template-columns: 1fr;
  }

  .modal-grid {
    grid-template-columns: 1fr;
  }

  .messages {
    max-height: 48vh;
  }
}
