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

:root {
  --chris-bg: #0d0d12;
  --chris-surface: #14141c;
  --chris-surface2: #1c1c28;
  --chris-border: rgba(255,255,255,0.07);
  --chris-text: #e8e6f0;
  --chris-text-muted: #7a7890;
  --chris-accent: #4a3fa8;
  --chris-bubble: #1c1c28;

  --sumiya-bg: #fdf7f2;
  --sumiya-surface: #fff9f5;
  --sumiya-surface2: #f5e8de;
  --sumiya-border: rgba(180,140,120,0.18);
  --sumiya-text: #3a2a22;
  --sumiya-text-muted: #a08070;
  --sumiya-accent: #c97b5a;
  --sumiya-bubble: #fff2ea;

  --nav-height: 56px;
  --header-height: 56px;
  --radius: 18px;
  --radius-sm: 10px;
  font-size: 16px;
}

html, body { height: 100%; overflow: hidden; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

/* ── Sumiya light theme (chat page) ─────────────────────────── */
body.chat-page[data-user="sumiya"] {
  background: var(--sumiya-bg);
  color: var(--sumiya-text);
  --nav-bg: var(--sumiya-surface);
  --nav-border: var(--sumiya-border);
  --nav-color: rgba(58,42,34,0.35);
  --nav-active-color: var(--sumiya-accent);
}
body.chat-page[data-user="sumiya"] .chat-header {
  background: var(--sumiya-surface);
  border-bottom-color: var(--sumiya-border);
}
body.chat-page[data-user="sumiya"] .chat-partner-name { color: var(--sumiya-text); }
body.chat-page[data-user="sumiya"] .msg-row.outgoing .bubble {
  background: var(--sumiya-bubble);
  color: var(--sumiya-text);
  border-bottom-right-radius: 4px;
}
body.chat-page[data-user="sumiya"] .msg-row.incoming .bubble {
  background: var(--chris-surface2);
  color: var(--chris-text);
  border-bottom-left-radius: 4px;
}
body.chat-page[data-user="sumiya"] .compose-area {
  background: var(--sumiya-surface);
  border-top-color: var(--sumiya-border);
}
body.chat-page[data-user="sumiya"] .message-input {
  background: var(--sumiya-surface2);
  border-color: var(--sumiya-border);
  color: var(--sumiya-text);
}
body.chat-page[data-user="sumiya"] .message-input::placeholder { color: var(--sumiya-text-muted); }
body.chat-page[data-user="sumiya"] .send-btn { background: var(--sumiya-accent); }
body.chat-page[data-user="sumiya"] .tone-btn {
  border-color: rgba(58,42,34,0.15);
  color: var(--sumiya-text-muted);
}
body.chat-page[data-user="sumiya"] .tone-btn.active {
  background: var(--sumiya-accent);
  border-color: transparent;
  color: #fff;
}
body.chat-page[data-user="sumiya"] .preview-bubble {
  background: rgba(201,123,90,0.08);
  border-color: rgba(201,123,90,0.3);
}
body.chat-page[data-user="sumiya"] .preview-label { color: var(--sumiya-accent); }
body.chat-page[data-user="sumiya"] .preview-text { color: var(--sumiya-text); }
body.chat-page[data-user="sumiya"] .msg-time { color: var(--sumiya-text-muted); }

/* ── RTL support ─────────────────────────────────────────────── */
html[dir="rtl"] .nav-bar { flex-direction: row-reverse; }
html[dir="rtl"] .msg-row.outgoing { flex-direction: row; }
html[dir="rtl"] .msg-row.incoming { flex-direction: row-reverse; }
html[dir="rtl"] .msg-row.outgoing .bubble { border-bottom-right-radius: var(--radius); border-bottom-left-radius: 4px; }
html[dir="rtl"] .msg-row.incoming .bubble { border-bottom-left-radius: var(--radius); border-bottom-right-radius: 4px; }
html[dir="rtl"] .compose-area { direction: rtl; }
html[dir="rtl"] .tone-row { flex-direction: row-reverse; }

/* ── Navigation ──────────────────────────────────────────────── */
.nav-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
  border-top: 1px solid var(--nav-border, rgba(255,255,255,0.07));
  background: var(--nav-bg, #0d0d12);
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 48px;
  height: 48px;
  border-radius: 12px;
  color: var(--nav-color, rgba(255,255,255,0.3));
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s, background 0.15s;
  padding: 4px 6px;
}
.nav-label {
  font-size: 9px;
  letter-spacing: 0.04em;
  opacity: 0.75;
}
.nav-item.active  { color: var(--nav-active-color, #a09ae0); }
.nav-item:hover   { background: rgba(255,255,255,0.05); }
.nav-logout { cursor: pointer; }

/* ── Avatar ──────────────────────────────────────────────────── */
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 600; flex-shrink: 0;
}
.avatar.sm { width: 28px; height: 28px; font-size: 12px; }
.sumiya-avatar { background: #f5e4d5; color: #7a4030; }
.chris-avatar  { background: #1c1c28; color: #a09ae0; border: 1px solid rgba(160,154,224,0.3); }

/* ── Monitoring notice ───────────────────────────────────────── */
.monitoring-notice {
  position: fixed;
  top: 0; left: 0; right: 0;
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: rgba(232,160,122,0.7);
  background: rgba(232,160,122,0.06);
  padding: 4px 8px;
  z-index: 200;
  pointer-events: none;
}

/* ── Readonly notice (inline) ────────────────────────────────── */
.readonly-notice {
  font-size: 12px;
  color: rgba(255,255,255,0.35);
  text-align: center;
  padding: 8px;
  letter-spacing: 0.04em;
}

.section-label { font-size: 13px; letter-spacing: 0.06em; text-transform: lowercase; }
