/* Chat home and conversation layout. This sheet is loaded only by index.html. */

[data-theme="light"] .app {
  --bg-primary: #fffaf6;
  --bg-secondary: #fffaf6;
  --bg-sidebar: #f8f2ed;
  --bg-input: #fffaf6;
  --bg-hover: #eee6df;
  --text-primary: #2c2927;
  --text-white: #2c2927;
  --text-secondary: #675f5a;
  --text-muted: #80766f;
  --border: #d4c9c2;
  --accent: #247e9e;
  --accent-hover: #1d6a85;
  background: var(--bg-primary);
}

.sidebar {
  width: 490px;
  min-width: 490px;
  border-right-color: color-mix(in srgb, var(--border) 72%, transparent);
}

.sidebar-rail {
  width: 190px;
  min-width: 190px;
  gap: 0;
  padding: 20px 12px 12px;
  overflow-y: auto;
}

.sidebar-rail-item {
  flex: none;
  flex-direction: row;
  justify-content: flex-start;
  gap: 16px;
  width: 100%;
  min-height: 58px;
  height: auto;
  padding: 12px 8px;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  font-size: 15px;
  font-weight: 750;
  color: var(--text-primary);
  text-align: left;
  text-decoration: none;
}

.sidebar-rail-item.active {
  background: #d9eef3;
  color: #2c2927;
  box-shadow: inset 3px 0 0 var(--accent);
}
.sidebar-index-number { flex: none; color: var(--text-secondary); font-size: 12px; font-weight: 600; }
.sidebar-index-brand { display: grid; place-items: center; width: 100%; padding: 2px 0 20px; }
.sidebar-index-brand img { width: 82px; height: 100px; object-fit: contain; }
.sidebar-index-heading { display: flex; align-items: baseline; justify-content: space-between; width: 100%; padding: 14px 8px; border-block: 1px solid var(--border); }
.sidebar-index-heading strong { font-size: 22px; font-weight: 850; letter-spacing: -.04em; }
.sidebar-index-heading span { font-size: 10px; color: var(--text-secondary); }
.sidebar-panel { min-width: 0; }
.sidebar-panel .sidebar-header .logo { display: none; }

.sidebar-panel .sidebar-header {
  padding: 10px 18px 0;
}

.sidebar-search {
  height: 42px;
  margin: 4px 14px 12px;
  padding-inline: 12px;
  border-radius: 10px;
  font-size: 13px;
}

.sidebar-chat-title {
  padding: 0 18px 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.sidebar-chat-title .sidebar-nav-link {
  min-height: 42px;
  font-size: 20px;
  font-weight: 700;
}
.sidebar-chat-title .sidebar-nav-icon { display: none; }

.sidebar .sidebar-section {
  padding: 14px 0 12px;
}

.sidebar .sidebar-section + .sidebar-section {
  border-top: 1px solid var(--border);
}

.sidebar .section-header {
  min-height: 32px;
  padding: 0 16px 8px;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-secondary);
}

.sidebar .dm-list li,
.sidebar .channel-list li {
  min-height: 42px;
  padding: 7px 14px 7px 18px;
  font-size: 13px;
  border-radius: 9px;
  margin: 1px 8px;
}

.sidebar .dm-list li .dm-avatar {
  width: 28px;
  height: 28px;
}

.main {
  background: transparent;
}

.welcome {
  justify-content: flex-start;
  background: transparent;
}

.welcome-home {
  max-width: 1440px;
  margin: 0 auto;
  padding: clamp(48px, 7vh, 96px) clamp(28px, 4vw, 76px) 72px;
  gap: 34px;
}

.welcome-head {
  padding-bottom: 26px;
  border-bottom: 1px solid var(--border);
}

.welcome-eyebrow {
  display: block;
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .18em;
}

.welcome-head h2 {
  margin-bottom: 10px;
  font-size: clamp(30px, 3vw, 44px);
  letter-spacing: -.04em;
  line-height: 1.2;
}

.welcome-sub {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
}

.welcome-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
  gap: clamp(24px, 3vw, 48px);
}

.welcome-col {
  gap: 16px;
  min-width: 0;
}

.welcome-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.welcome-sec-title {
  margin: 0;
  color: var(--text-white);
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -.02em;
}

.welcome-section-note {
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}

.welcome-unread,
.welcome-actions {
  gap: 10px;
}

.welcome-row,
.welcome-action,
.welcome-favorite {
  min-height: 64px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  box-shadow: 0 4px 16px rgba(43, 25, 36, .035);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background .18s ease;
}

.welcome-row,
.welcome-action {
  padding: 12px 18px;
  font-size: 14px;
}

.welcome-row:hover,
.welcome-action:hover,
.welcome-favorite:hover {
  border-color: var(--accent);
  background: var(--bg-secondary);
  box-shadow: 0 8px 24px rgba(43, 25, 36, .09);
  transform: translateY(-2px);
}

.welcome-row-avatar,
.welcome-row-hash {
  width: 38px;
  height: 38px;
  border-radius: 50%;
}

.welcome-row-name {
  font-size: 14px;
}

.welcome-action svg {
  width: 21px;
  height: 21px;
  color: var(--accent);
}

.welcome-action kbd {
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 5px;
}

.welcome-empty {
  min-height: 98px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  font-size: 14px;
}

.welcome-favorites {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.welcome-favorite {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-width: 0;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.welcome-favorite img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
}

.welcome-favorite span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.welcome-favorite-arrow {
  margin-left: auto;
  color: var(--accent);
  font-size: 18px;
}

#build-version {
  display: none;
}

.chat-header {
  min-height: 70px;
  padding-inline: clamp(20px, 3vw, 48px);
}

.chat-channel-name {
  font-size: 18px;
}

.messages {
  padding: 24px max(24px, calc((100% - 980px) / 2)) 56px;
}

.message {
  max-width: min(84%, 760px);
}

.message-input-area {
  width: min(100%, 1020px);
  margin-inline: auto;
  padding: 8px 20px max(20px, env(safe-area-inset-bottom));
}

.message-input-area .message-input {
  min-height: 74px;
}

.sidebar :is(button, a):focus-visible,
.welcome :is(button, a):focus-visible,
.chat-view :is(button, a, textarea):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 1180px) {
  .sidebar { width: 420px; min-width: 420px; }
  .sidebar-rail { width: 160px; min-width: 160px; }
  .welcome-home { max-width: 1080px; }
  .welcome-favorites { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .welcome-grid { grid-template-columns: 1fr; }
  .welcome-home { gap: 28px; }
}

@media (max-width: 768px) {
  body.lp-mobile .sidebar { width: min(420px,100vw); min-width: 0; }
  body.lp-mobile .sidebar-rail { width: 140px; min-width: 140px; }
  body.lp-mobile .sidebar-rail-item { gap: 10px; font-size: 13px; }
  body.lp-mobile .welcome-home { padding: 28px 18px 80px; gap: 28px; }
  .welcome-head { padding-bottom: 20px; }
  .welcome-head h2 { font-size: 30px; }
  .welcome-grid { gap: 28px; }
  .welcome-favorites { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .welcome-section-note { display: none; }
  body.lp-mobile .messages { padding: 16px 14px 40px; }
  body.lp-mobile .message-input-area { width: 100%; padding-inline: 12px; }
  body.lp-mobile .chat-header { min-height: 56px; padding-right: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .welcome-row,
  .welcome-action,
  .welcome-favorite { transition: none; }
  .welcome-row:hover,
  .welcome-action:hover,
  .welcome-favorite:hover { transform: none; }
}
