/* ═══════════════════════ LAYOUT ═══════════════════════ */
.app {
  display: grid;
  grid-template-rows: 50px 1fr;
  grid-template-columns: minmax(0, 80%) minmax(300px, 20%);
  height: 100vh;
}

.topbar {
  grid-column: 1 / -1;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 18px;
  gap: 12px;
  z-index: 100;
}

.main-area {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-app);
  position: relative;
}

.right-panel {
  background: var(--bg-sidebar);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Stage — scrollable Discord window area */
.messages-scroll {
  flex: 1;
  overflow-y: auto;
  scrollbar-gutter: stable;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 20px;
  gap: 0;
}

/* Discord window card */
.dc-win {
  width: 100%;
  max-width: 680px;
  background: var(--dc-bg);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(0,0,0,.22);
}

[data-theme="light"] .dc-win {
  border-color: rgba(0,0,0,.07);
}

.dc-winbar {
  background: rgba(0,0,0,.18);
  border-bottom: 1px solid rgba(0,0,0,.18);
  border-radius: 12px 12px 0 0;
  padding: 0 14px;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
}

[data-theme="light"] .dc-winbar {
  background: rgba(0,0,0,.04);
  border-bottom-color: rgba(0,0,0,.06);
  border-radius: 12px 12px 0 0;
}

.dc-dots { display: flex; gap: 5px; }
.dc-dot  { width: 10px; height: 10px; border-radius: 50%; }
.dc-dot:nth-child(1) { background: #ff5f57; }
.dc-dot:nth-child(2) { background: #febc2e; }
.dc-dot:nth-child(3) { background: #28c840; }

#dcClearDot {
  cursor: pointer;
  transition: transform .12s ease, filter .12s ease;
}

#dcClearDot:hover {
  transform: scale(1.08);
  filter: saturate(1.08);
}

.dc-wintitle {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,.3);
  display: flex;
  align-items: center;
  gap: 6px;
}
[data-theme="light"] .dc-wintitle { color: rgba(0,0,0,.3); }

.dc-winhint {
  margin-left: auto;
  font-size: 11px;
  color: rgba(255,255,255,.2);
  font-style: italic;
  transition: opacity .2s;
}
[data-theme="light"] .dc-winhint { color: rgba(0,0,0,.2); }
.preview-mode .dc-winhint { opacity: 0; }

.dc-win-scroll { padding: 10px 0 28px; }

@media (max-width: 1100px) {
  .app { grid-template-columns: 1fr 300px; }
}
@media (max-width: 860px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: 50px 1fr auto;
  }
  .right-panel {
    border-left: none;
    border-top: 1px solid var(--border);
    min-height: 320px;
  }
}
