/* ============================================================
   GheReCess -- layout.css
   Structural placement only; visual styling lives in components.css
   ============================================================ */

.screen {
  min-height: 100vh;
}

.screen-center {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
}

.app {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ---------- Sidebar ---------- */
.sidebar {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-soft);
  min-height: 0;
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-4) var(--space-2);
}

.me-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
}

.me-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-2) var(--space-2) var(--space-4);
}

/* ---------- Chat panel ---------- */
.chat-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg-deep);
}

.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  color: var(--text-muted);
  text-align: center;
}

.chat-empty-mark {
  width: 56px;
  opacity: 0.5;
}

.chat-active {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
}

.chat-header-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.message-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5) var(--space-5) var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.typing-row {
  padding: 0 var(--space-5);
  min-height: 22px;
  flex-shrink: 0;
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4) var(--space-4);
  flex-shrink: 0;
}

.composer textarea {
  flex: 1;
  resize: none;
  max-height: 140px;
}

/* ---------- Modals ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 12, 20, 0.45);
  z-index: 1000;
  padding: var(--space-4);
}

.modal-card {
  width: min(420px, 100%);
  max-height: 86vh;
  overflow-y: auto;
}

.modal-sheet {
  width: min(360px, 100%);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.settings-section {
  margin-top: var(--space-4);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) 0;
}

.settings-row-stack {
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-2);
}
