/* Lesson Studio — Claude-inspired warm, calm interface */

:root {
  --bg: #faf9f5;
  --sidebar-bg: #f0eee6;
  --border: #e3e0d5;
  --border-strong: #d3cfc0;
  --text: #3d3a34;
  --text-soft: #6f6a5e;
  --text-faint: #9b968a;
  --accent: #d97757;
  --accent-hover: #c4633f;
  --accent-soft: #f7e4dc;
  --card: #ffffff;
  --user-bubble: #f0eee6;
  --code-bg: #f2f0e8;
  --warn-bg: #fdf3d7;
  --warn-border: #e5c869;
  --ok: #5a9a68;
  --bad: #c65b4e;
  --radius: 14px;
  --font-display: "Iowan Old Style", "Palatino", Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
}

.app { display: flex; height: 100vh; overflow: hidden; }

/* ------------------------------------------------------------- sidebar */

.sidebar {
  width: 268px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 14px 12px;
  gap: 6px;
}

.sidebar-resizer {
  width: 5px; flex-shrink: 0; cursor: col-resize;
  background: transparent; transition: background 0.15s ease;
}
.sidebar-resizer:hover, .sidebar-resizer.dragging { background: var(--accent-soft); }

.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 14px; }

.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
}

.brand-text { display: flex; flex-direction: column; }
.brand-name { font-family: var(--font-display); font-size: 17px; font-weight: 600; }
.brand-sub { font-size: 11px; color: var(--text-faint); }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px; border: none; border-radius: 9px;
  background: transparent; color: var(--text);
  font-family: var(--font-body); font-size: 14px; font-weight: 500;
  cursor: pointer; text-align: left; width: 100%;
}
/* .nav-item sets display:flex, which would otherwise beat the browser's
   [hidden] rule — Super-User-only items must actually disappear. */
.nav-item[hidden] { display: none; }
.nav-item:hover { background: rgba(0, 0, 0, 0.05); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-hover); }
.nav-icon { font-size: 15px; }

.sidebar-section-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-faint); padding: 14px 10px 4px;
}

.chat-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }

.chat-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border: none; border-radius: 9px;
  background: transparent; color: var(--text-soft);
  font-family: var(--font-body); font-size: 13px; cursor: pointer;
  text-align: left; width: 100%;
}
.chat-item:hover { background: rgba(0, 0, 0, 0.05); }
.chat-item.active { background: rgba(0, 0, 0, 0.07); color: var(--text); }
.chat-item .mini-avatar { width: 22px; height: 22px; flex-shrink: 0; }
.chat-item .mini-avatar svg { width: 100%; height: 100%; display: block; }
.chat-item .chat-title {
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-item .chat-delete {
  border: none; background: none; color: var(--text-faint);
  font-size: 13px; cursor: pointer; padding: 2px 4px; border-radius: 5px;
  visibility: hidden;
}
.chat-item:hover .chat-delete { visibility: visible; }
.chat-item .chat-delete:hover { color: var(--bad); background: rgba(0,0,0,0.06); }

.empty-chats { font-size: 12.5px; color: var(--text-faint); padding: 6px 10px; }

.sidebar-foot { border-top: 1px solid var(--border); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }

.local-badge { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-soft); padding: 0 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); flex-shrink: 0; }
.dot.ok { background: var(--ok); }
.dot.bad { background: var(--bad); }
.privacy-note { font-size: 11.5px; color: var(--text-faint); padding: 0 6px; }

/* ---------------------------------------------------------------- main */

.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.view { flex: 1; overflow-y: auto; padding: 36px 32px 48px; }

.view-header { max-width: 880px; margin: 0 auto 26px; }
.view-header h1 { font-family: var(--font-display); font-size: 30px; font-weight: 600; margin-bottom: 6px; }
.view-header p { color: var(--text-soft); font-size: 15px; max-width: 620px; }

/* ------------------------------------------------------------ role cards */

.role-grid {
  max-width: 880px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.role-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 20px 18px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 4px; transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.role-card:hover { box-shadow: 0 6px 20px rgba(60, 50, 30, 0.1); transform: translateY(-2px); }

.role-avatar { width: 84px; height: 84px; margin-bottom: 8px; }
.role-avatar svg { width: 100%; height: 100%; display: block; }

.role-title { font-family: var(--font-display); font-size: 19px; font-weight: 600; }
.role-name { font-size: 13px; color: var(--accent-hover); font-weight: 600; }
.role-tagline { font-size: 13px; color: var(--text-soft); margin-top: 4px; min-height: 38px; }

.chip-row { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; margin: 8px 0 14px; }
.chip {
  font-size: 11px; padding: 3px 9px; border-radius: 999px;
  background: var(--sidebar-bg); border: 1px solid var(--border);
  color: var(--text-soft);
}

.btn-col { display: flex; flex-direction: column; gap: 8px; align-items: center; }

.btn {
  border: none; border-radius: 10px; padding: 9px 18px;
  font-family: var(--font-body); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background 0.12s ease;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: transparent; color: var(--text-soft); border: 1px solid var(--border-strong); }
.btn-secondary:hover { background: rgba(0, 0, 0, 0.04); }
.btn-small { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: 0.5; cursor: default; }

/* ------------------------------------------------------------- students */

.students-wrap { max-width: 880px; margin: 0 auto; }

.privacy-banner {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--warn-bg); border: 1px solid var(--warn-border);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 22px;
  font-size: 13.5px; color: #6b5620;
}
.privacy-banner strong { display: block; margin-bottom: 2px; }

.student-toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }

.student-table-wrap { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; }
table.students { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.students th {
  text-align: left; padding: 10px 14px; font-size: 11.5px; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-faint); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.students td { padding: 9px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.students tr:last-child td { border-bottom: none; }
table.students td .row-del {
  border: none; background: none; cursor: pointer; color: var(--text-faint); font-size: 13px;
  padding: 2px 5px; border-radius: 5px;
}
table.students td .row-del:hover { color: var(--bad); background: rgba(0,0,0,0.05); }

.student-form {
  margin-top: 16px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px;
  align-items: end;
}
.student-form label { font-size: 12px; color: var(--text-soft); display: flex; flex-direction: column; gap: 4px; }
.student-form input, .student-form select {
  font-family: var(--font-body); font-size: 13.5px; padding: 8px 10px;
  border: 1px solid var(--border-strong); border-radius: 8px; background: var(--bg); color: var(--text);
}
.student-form input:focus, .student-form select:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

/* ------------------------------------------------------------- teachers */

.teachers-wrap { max-width: 880px; margin: 0 auto; }

.teacher-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.teacher-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 16px 18px;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  text-align: center;
}

.teacher-card.add {
  cursor: pointer; border-style: dashed; border-color: var(--border-strong);
  background: transparent; font-family: var(--font-body);
  justify-content: center; transition: border-color 0.12s ease;
}
.teacher-card.add:hover { border-color: var(--accent); }

.add-plus {
  width: 56px; height: 56px; border-radius: 50%;
  border: 2px dashed var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: var(--text-faint); margin-bottom: 4px;
}

.profile-avatar.xl { width: 56px; height: 56px; font-size: 20px; margin-bottom: 6px; }

.teacher-name {
  font-family: var(--font-display); font-size: 16.5px; font-weight: 600;
  display: flex; align-items: center; gap: 7px; justify-content: center;
}
.you-badge {
  font-family: var(--font-body); font-size: 10.5px; font-weight: 700;
  background: var(--accent-soft); color: var(--accent-hover);
  padding: 2px 8px; border-radius: 999px;
}
.admin-badge { background: #e3e9f2; color: #41537a; }
.super-badge { background: #efe3ef; color: #6b3f6b; }

.oversight-msg { padding: 10px 0; border-bottom: 1px solid var(--border); }
.oversight-msg:last-child { border-bottom: none; }
.oversight-who { font-size: 12px; font-weight: 600; color: var(--text-soft); margin-bottom: 4px; }
.teacher-card > .btn { margin-top: 8px; }
.teacher-role { font-size: 12.5px; color: var(--text-soft); }
.teacher-grades { font-size: 12px; color: var(--text-faint); }
.teacher-joined { font-size: 11px; color: var(--text-faint); margin-top: 4px; }
.teacher-lock { font-size: 11px; color: var(--text-faint); }

/* ------------------------------------------------------- shared library */

.library-list { display: flex; flex-direction: column; gap: 12px; }

.lib-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px 14px;
}
.lib-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lib-title { font-family: var(--font-display); font-size: 17px; font-weight: 600; }
.lib-meta { font-size: 12px; color: var(--text-faint); margin-top: 3px; }
.lib-snippet { font-size: 13px; color: var(--text-soft); margin: 8px 0 12px; }
.lib-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.chip-shared { background: #e3efe0; border-color: #b9d4b1; color: #3f6b39; }
.chip-private { background: var(--sidebar-bg); }

/* ------------------------------------------------------------ user guide */

.guide-content {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 30px 34px; font-size: 14.5px;
}
.guide-content h1 { font-size: 26px; }
.guide-content h2 { font-size: 20px; margin-top: 22px; }

.library-modal { width: min(680px, 94vw); }
.library-view-content {
  max-height: 52vh; overflow-y: auto; text-align: left;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 18px;
}

/* ---------------------------------------------------- document reading */
/* Strategies and shared products are read like a handout, not scanned like
   a chat: wider measure, looser leading, real heading hierarchy. */

.doc-modal { width: min(780px, 95vw); }
.doc-modal .modal-title { text-align: left; margin-bottom: 4px; }
.doc-summary {
  text-align: left; font-size: 15px; color: var(--text); margin-bottom: 6px;
}
.doc-byline {
  text-align: left; font-size: 12.5px; color: var(--text-faint);
  margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
}

.doc-view {
  max-height: 62vh; overflow-y: auto; text-align: left;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 26px 32px;
  font-size: 15.5px; line-height: 1.75; color: var(--text);
}

.doc-view > :first-child { margin-top: 0; }
.doc-view h1, .doc-view h2, .doc-view h3 {
  font-family: var(--font-display); font-weight: 600; line-height: 1.3;
  color: var(--text);
}
.doc-view h1 { font-size: 23px; margin: 26px 0 10px; }
.doc-view h2 {
  font-size: 19px; margin: 26px 0 8px;
  padding-bottom: 5px; border-bottom: 1px solid var(--border);
}
.doc-view h3 { font-size: 16.5px; margin: 20px 0 6px; }
.doc-view p { margin: 12px 0; }
.doc-view ul, .doc-view ol { margin: 12px 0 12px 6px; padding-left: 22px; }
.doc-view li { margin: 7px 0; padding-left: 3px; }
.doc-view li::marker { color: var(--accent-hover); font-weight: 600; }
.doc-view li > ul, .doc-view li > ol { margin: 6px 0; }
.doc-view strong { font-weight: 650; }
.doc-view blockquote {
  margin: 16px 0; padding: 10px 16px;
  border-left: 3px solid var(--accent); background: var(--sidebar-bg);
  border-radius: 0 8px 8px 0; color: var(--text-soft);
}
.doc-view blockquote p { margin: 0; }
.doc-view hr { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
.doc-view table { border-collapse: collapse; margin: 16px 0; font-size: 14px; width: 100%; }
.doc-view th, .doc-view td { border: 1px solid var(--border-strong); padding: 8px 12px; text-align: left; }
.doc-view th { background: var(--sidebar-bg); font-weight: 600; }
.doc-view code { background: var(--code-bg); padding: 1px 6px; border-radius: 5px; font-size: 13.5px; }
.doc-view pre { background: var(--code-bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; overflow-x: auto; margin: 16px 0; }

@media (max-width: 620px) {
  .doc-view { padding: 18px 20px; font-size: 15px; }
}

/* ----------------------------------------------------------------- chat */

.chat-screen { display: flex; flex-direction: column; height: 100%; }

.chat-topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px; border-bottom: 1px solid var(--border);
  background: var(--bg); flex-wrap: wrap;
}
.chat-topbar .mini-avatar { width: 34px; height: 34px; }
.chat-topbar .mini-avatar svg { width: 100%; height: 100%; display: block; }
.topbar-names { display: flex; flex-direction: column; line-height: 1.25; }
.topbar-role { font-family: var(--font-display); font-weight: 600; font-size: 15.5px; }
.topbar-person { font-size: 12px; color: var(--text-soft); }
.topbar-spacer { flex: 1; }

.model-select, .filter-select {
  font-family: var(--font-body); font-size: 13px; padding: 7px 10px;
  border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--card); color: var(--text); max-width: 220px;
}

.messages { flex: 1; overflow-y: auto; padding: 28px 20px 16px; }
.messages-inner { max-width: 730px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }

.msg { display: flex; gap: 12px; }
.msg .msg-avatar { width: 30px; height: 30px; flex-shrink: 0; margin-top: 2px; }
.msg .msg-avatar svg { width: 100%; height: 100%; display: block; }
.msg-user-mark {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; margin-top: 2px;
  background: var(--text-soft); color: #fff; display: flex; align-items: center;
  justify-content: center; font-size: 12.5px; font-weight: 700;
}
.msg-body { flex: 1; min-width: 0; }
.msg-sender { font-size: 12.5px; font-weight: 600; color: var(--text-soft); margin-bottom: 3px; }
.msg-content { font-size: 15px; overflow-wrap: break-word; }

.msg.user .msg-content {
  background: var(--user-bubble); border-radius: 12px; padding: 10px 14px;
  display: inline-block; max-width: 100%; white-space: pre-wrap;
}

.msg-content h1, .msg-content h2, .msg-content h3 {
  font-family: var(--font-display); margin: 14px 0 6px; line-height: 1.3;
}
.msg-content h1 { font-size: 21px; } .msg-content h2 { font-size: 18px; } .msg-content h3 { font-size: 16px; }
.msg-content p { margin: 7px 0; }
.msg-content ul, .msg-content ol { margin: 7px 0 7px 22px; }
.msg-content li { margin: 3px 0; }
.msg-content code { font-family: var(--font-mono); font-size: 13px; background: var(--code-bg); padding: 1px 5px; border-radius: 5px; }
.msg-content pre { background: var(--code-bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; overflow-x: auto; margin: 10px 0; }
.msg-content pre code { background: none; padding: 0; }
.msg-content blockquote { border-left: 3px solid var(--border-strong); padding-left: 12px; color: var(--text-soft); margin: 8px 0; }
.msg-content hr { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
.msg-content table { border-collapse: collapse; margin: 10px 0; font-size: 13.5px; }
.msg-content th, .msg-content td { border: 1px solid var(--border-strong); padding: 5px 10px; text-align: left; }

.msg-actions { display: flex; gap: 8px; margin-top: 6px; }
.msg-action {
  border: none; background: none; color: var(--text-faint); font-size: 12px;
  cursor: pointer; padding: 3px 7px; border-radius: 6px;
}
.msg-action:hover { background: rgba(0, 0, 0, 0.05); color: var(--text-soft); }

.typing-cursor { display: inline-block; width: 8px; height: 15px; background: var(--accent); border-radius: 2px; animation: blink 1s infinite; vertical-align: text-bottom; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.2; } }

/* -------------------------------------------------------------- composer */

.composer-wrap { padding: 8px 20px 18px; }
.composer-inner { max-width: 730px; margin: 0 auto; }

.pii-warning {
  display: none; margin-bottom: 8px; padding: 10px 14px;
  background: var(--warn-bg); border: 1px solid var(--warn-border); border-radius: 10px;
  font-size: 13px; color: #6b5620;
}
.pii-warning.visible { display: flex; gap: 10px; align-items: center; }
.pii-warning .btn { flex-shrink: 0; }

.composer {
  display: flex; align-items: flex-end; gap: 8px;
  background: var(--card); border: 1px solid var(--border-strong);
  border-radius: 16px; padding: 10px 12px;
  box-shadow: 0 2px 10px rgba(60, 50, 30, 0.06);
}
.composer:focus-within { border-color: var(--accent); }
.composer textarea {
  flex: 1; border: none; resize: none; background: transparent;
  font-family: var(--font-body); font-size: 15px; color: var(--text);
  line-height: 1.5; max-height: 190px; outline: none;
}
.composer .send-btn {
  width: 36px; height: 36px; border: none; border-radius: 10px;
  background: var(--accent); color: #fff; font-size: 16px; cursor: pointer;
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
}
.composer .send-btn:hover { background: var(--accent-hover); }
.composer .send-btn:disabled { opacity: 0.4; cursor: default; }
.composer .send-btn.stop { background: var(--bad); }

.composer-hints { display: flex; justify-content: space-between; margin-top: 7px; font-size: 11.5px; color: var(--text-faint); padding: 0 6px; }

/* --------------------------------------------------------------- banner */

.offline-banner {
  max-width: 730px; margin: 0 auto 14px; padding: 12px 16px;
  background: var(--warn-bg); border: 1px solid var(--warn-border); border-radius: 10px;
  font-size: 13.5px; color: #6b5620; display: flex; gap: 10px; align-items: center;
}
.offline-banner code { font-family: var(--font-mono); background: rgba(0,0,0,0.06); padding: 1px 6px; border-radius: 5px; }

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 9px 18px; border-radius: 10px;
  font-size: 13.5px; opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
  z-index: 50;
}
.toast.visible { opacity: 1; }

/* ------------------------------------------------------- stacked avatars */

.avatar-stack { display: inline-flex; align-items: center; flex-shrink: 0; }
.avatar-stack .mini-avatar + .mini-avatar { margin-left: -9px; }
.chat-item .avatar-stack .mini-avatar + .mini-avatar { margin-left: -7px; }

/* --------------------------------------------------- team builder modal */

.modal-overlay {
  position: fixed; inset: 0; background: rgba(45, 40, 30, 0.45);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}

.modal {
  background: var(--bg); border: 1px solid var(--border); border-radius: 18px;
  padding: 26px; width: min(600px, 92vw); max-height: 86vh; overflow-y: auto;
  box-shadow: 0 18px 50px rgba(40, 32, 18, 0.25);
}

.modal-title { font-family: var(--font-display); font-size: 22px; font-weight: 600; margin-bottom: 6px; }
.modal-sub { color: var(--text-soft); font-size: 14px; margin-bottom: 16px; }

.team-lead-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--accent-soft); border-radius: 12px; padding: 10px 14px;
  margin-bottom: 14px; font-size: 14px; font-weight: 600; color: var(--accent-hover);
}
.team-lead-row .mini-avatar { width: 30px; height: 30px; flex-shrink: 0; }
.team-lead-row .mini-avatar svg { width: 100%; height: 100%; display: block; }

.team-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.team-option {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 14px 10px; border: 1.5px solid var(--border); border-radius: 12px;
  background: var(--card); cursor: pointer; font-family: var(--font-body);
  transition: border-color 0.12s ease, background 0.12s ease;
}
.team-option:hover { border-color: var(--border-strong); }
.team-option.selected { border-color: var(--accent); background: var(--accent-soft); }
.team-option .role-avatar-sm { width: 46px; height: 46px; }
.team-option .role-avatar-sm svg { width: 100%; height: 100%; display: block; }
.team-option-title { font-size: 12.5px; font-weight: 600; color: var(--text); }
.team-option-name { font-size: 11px; color: var(--text-faint); }

.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ---------------------------------------------------------- memory modal */

.memory-empty { color: var(--text-faint); font-size: 14px; padding: 8px 0; }
.memory-list { display: flex; flex-direction: column; gap: 6px; max-height: 46vh; overflow-y: auto; }
.memory-row {
  display: flex; align-items: flex-start; gap: 8px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 12px;
}
.memory-text { flex: 1; font-size: 13.5px; text-align: left; }
.memory-meta { font-size: 11px; color: var(--text-faint); margin-top: 3px; }
.memory-arch-title {
  font-family: var(--font-display); font-size: 15.5px; font-weight: 600;
  text-align: left; margin: 16px 0 8px;
}

/* --------------------------------------------------------- sign-in screen */

.login-screen {
  position: fixed; inset: 0; background: var(--bg); z-index: 200;
  display: flex; align-items: center; justify-content: center;
  overflow-y: auto; padding: 30px 16px;
}

.login-card {
  width: min(540px, 94vw); background: var(--card);
  border: 1px solid var(--border); border-radius: 20px;
  padding: 34px 30px; text-align: center;
  box-shadow: 0 14px 40px rgba(60, 50, 30, 0.08);
}

.login-brand .brand-mark { margin: 0 auto 14px; width: 46px; height: 46px; font-size: 18px; }
.login-title { font-family: var(--font-display); font-size: 28px; font-weight: 600; margin-bottom: 8px; }
.login-sub { color: var(--text-soft); font-size: 14px; margin-bottom: 22px; }

.profile-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px; margin-bottom: 18px;
}

.profile-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 16px 10px; background: var(--bg);
  border: 1.5px solid var(--border); border-radius: 14px; cursor: pointer;
  font-family: var(--font-body);
  transition: border-color 0.12s ease;
}
.profile-card:hover { border-color: var(--accent); }

.profile-avatar {
  width: 52px; height: 52px; border-radius: 50%; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px;
}
.profile-avatar.sm { width: 32px; height: 32px; font-size: 12.5px; flex-shrink: 0; }
.profile-avatar.lg { width: 76px; height: 76px; font-size: 26px; flex-shrink: 0; }

/* photo / generated variants (shared by profile avatars and chat user marks) */
.profile-avatar.photo, .profile-avatar.gen,
.msg-user-mark.photo, .msg-user-mark.gen { background: none; overflow: hidden; }
.profile-avatar.photo img, .msg-user-mark.photo img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block;
}
.profile-avatar.gen svg, .msg-user-mark.gen svg { width: 100%; height: 100%; display: block; }

.avatar-row { display: flex; align-items: center; gap: 14px; }
.avatar-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.file-hidden { display: none; }

/* ---------------------------------------------------------- camera modal */

.camera-overlay { z-index: 300; }
.camera-modal { width: min(460px, 92vw); }
.camera-video-wrap {
  border-radius: 14px; overflow: hidden; background: #1a1815;
  aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center;
}
.camera-video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }

.profile-name { font-weight: 600; font-size: 14px; color: var(--text); }
.profile-type { font-size: 11.5px; color: var(--text-faint); }
.profile-lock { font-size: 11px; color: var(--text-soft); }

.login-form { display: flex; flex-direction: column; gap: 12px; text-align: left; margin-top: 6px; }
.login-form label { font-size: 12.5px; color: var(--text-soft); display: flex; flex-direction: column; gap: 5px; font-weight: 600; }
.login-form input, .login-form select {
  font-family: var(--font-body); font-size: 14px; padding: 10px 12px;
  border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--bg); color: var(--text);
}
.login-form input:focus, .login-form select:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

.login-error { color: var(--bad); font-size: 13px; min-height: 16px; }
.field-note { display: block; font-size: 11.5px; color: var(--text-faint); font-weight: 400; margin-top: 3px; }
.login-status { color: var(--text-soft); font-size: 13px; min-height: 16px; }
.login-actions { display: flex; gap: 10px; justify-content: center; margin-top: 8px; }
.login-foot { font-size: 11.5px; color: var(--text-faint); margin-top: 18px; }

/* ------------------------------------------------------------ profile chip */

.profile-chip { display: flex; align-items: center; gap: 8px; padding: 2px 6px 10px; }
.profile-chip-info { flex: 1; min-width: 0; text-align: left; }
.profile-chip-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-chip-type { font-size: 11px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-btn {
  border: none; background: none; color: var(--text-faint); font-size: 11.5px;
  cursor: pointer; padding: 3px 6px; border-radius: 6px; font-family: var(--font-body);
}
.chip-btn:hover { background: rgba(0, 0, 0, 0.05); color: var(--text-soft); }

@media (max-width: 760px) {
  .sidebar { width: 210px; }
  .view { padding: 22px 16px 40px; }
}
