/* Vexora on the web: the app's monochrome palette (Sable/DesignSystem/Palette.swift). */
:root {
  --bg: #0A0A0B; --card: #141416; --elevated: #1D1D20; --bubble-in: #19191C; --bubble-out: #2C2C31;
  --text: #F4F4F5; --muted: #9A9AA2; --accent: #D9B46C; --accent-a: #ECCB8A; --accent-b: #C99A4E; --on-accent: #0A0A0B;
  --danger: #FF6B6B; --stroke: rgba(255,255,255,0.08); --separator: rgba(255,255,255,0.07);
  --primary-a: #FFFFFF; --primary-b: #D4D4D8; --on-primary: #0A0A0B; --out-text: #F4F4F5;
  --glass: #141416; --shadow: 0 18px 50px rgba(0,0,0,0.5); --tile: #2A2A2F;
  --blades: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='92' height='80' fill='rgba(255,255,255,0.05)'%3E%3Cpath transform='translate(14 16) rotate(-36)' d='M0 -9 L2 2.7 L0 9 L-2 2.7Z'/%3E%3Cpath transform='translate(60 14) rotate(30)' d='M0 -5.5 L1.5 1.65 L0 5.5 L-1.5 1.65Z'/%3E%3Cpath transform='translate(37 54) rotate(30)' d='M0 -5.5 L1.5 1.65 L0 5.5 L-1.5 1.65Z'/%3E%3Cpath transform='translate(83 56) rotate(-36)' d='M0 -9 L2 2.7 L0 9 L-2 2.7Z'/%3E%3C/svg%3E");
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #F4F4F5; --card: #FFFFFF; --elevated: #EAEAEC; --bubble-in: #FFFFFF; --bubble-out: #26262B;
    --text: #0A0A0B; --muted: #5E5E66; --accent: #74561C; --accent-a: #74561C; --accent-b: #74561C; --on-accent: #FFFFFF;
    --danger: #C2302D; --stroke: rgba(11,12,16,0.08); --separator: rgba(11,12,16,0.08);
    --primary-a: #0A0A0B; --primary-b: #26262B; --on-primary: #F4F4F5; --out-text: #F4F4F5;
    --glass: #FFFFFF; --shadow: 0 18px 50px rgba(20,22,40,0.16); --tile: #0A0A0B;
    --blades: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='92' height='80' fill='rgba(10,10,11,0.05)'%3E%3Cpath transform='translate(14 16) rotate(-36)' d='M0 -9 L2 2.7 L0 9 L-2 2.7Z'/%3E%3Cpath transform='translate(60 14) rotate(30)' d='M0 -5.5 L1.5 1.65 L0 5.5 L-1.5 1.65Z'/%3E%3Cpath transform='translate(37 54) rotate(30)' d='M0 -5.5 L1.5 1.65 L0 5.5 L-1.5 1.65Z'/%3E%3Cpath transform='translate(83 56) rotate(-36)' d='M0 -9 L2 2.7 L0 9 L-2 2.7Z'/%3E%3C/svg%3E");
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
}
#app { height: 100%; }
button, input, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
[hidden] { display: none !important; }
.noscript { text-align: center; padding: 3rem 1rem; }

.icon { display: inline-flex; width: 20px; height: 20px; flex: none; }
.icon svg { width: 100%; height: 100%; }
.icon.accent { color: var(--accent); }
.icon.verified { width: 15px; height: 15px; color: var(--accent); margin-left: 4px; }
.icon.kind { width: 15px; height: 15px; color: var(--muted); margin-right: 5px; }

/* ------------------------------------------------------------ buttons and fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
  border-radius: 14px; border: 0; font-weight: 600; font-size: 16px; cursor: pointer; transition: transform .12s, opacity .12s; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: default; transform: none; }
.btn.primary { background: linear-gradient(180deg, var(--primary-a), var(--primary-b)); color: var(--on-primary); }
.btn.secondary { background: var(--elevated); color: var(--text); border: 1px solid var(--stroke); }
.btn.secondary.on { border-color: var(--accent); color: var(--accent); }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 15px; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger-outline { background: transparent; color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); }
.link { background: none; border: 0; color: var(--accent); font-weight: 500; cursor: pointer; padding: 8px 4px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--elevated); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; text-decoration: none; }
.icon-btn.small { width: 32px; height: 32px; background: transparent; color: var(--muted); }
.icon-btn .icon { width: 19px; height: 19px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

input:not([type]), input[type=email], input[type=password], input[type=search], input[type=text], textarea, .field-line {
  width: 100%; border: 1px solid var(--stroke); background: var(--elevated); border-radius: 14px;
  padding: 13px 15px; font-size: 16px; outline: none; }
input:focus, textarea:focus { border-color: color-mix(in srgb, var(--text) 45%, transparent); }
label { font-size: 13px; color: var(--muted); font-weight: 600; letter-spacing: .02em; margin: 6px 2px -4px; }
.hint { font-size: 13px; color: var(--muted); margin: 0 2px; }
.hint.ok { color: var(--accent); }
.hint.bad, .error { color: var(--danger); font-size: 14px; margin: 0 2px; min-height: 1px; }
.prefixed { display: flex; align-items: center; border: 1px solid var(--stroke); background: var(--elevated); border-radius: 14px; padding-left: 15px; }
.prefixed span { color: var(--muted); }
.prefixed input { border: 0; background: transparent; padding-left: 3px; }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* ------------------------------------------------------------ sign in */
.auth { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 32px 16px;
  background: radial-gradient(ellipse 70% 50% at 50% 0%, color-mix(in srgb, var(--text) 7%, transparent), transparent 70%), var(--bg); }
.auth-card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 14px; }
.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.brand h1 { font-size: 34px; letter-spacing: -0.03em; margin: 0; }
.logo { width: 52px; height: 52px; }
.auth h2 { font-size: 24px; margin: 4px 0 0; letter-spacing: -0.02em; }
.lead { color: var(--muted); margin: 0 0 6px; font-size: 17px; }
.lead strong { color: var(--text); font-weight: 600; }
.fine { color: var(--muted); font-size: 13px; margin: 4px 2px 0; }
.code-input { font-size: 30px !important; letter-spacing: .5em; text-align: center; font-variant-numeric: tabular-nums; padding: 14px !important; }
.row-links { display: flex; justify-content: space-between; flex-wrap: wrap; }

/* ------------------------------------------------------------ layout */
.layout { display: grid; grid-template-columns: clamp(300px, 28vw, 420px) minmax(0, 1fr); height: 100%; height: 100dvh; }
.sidebar { border-right: 1px solid var(--separator); display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--bg); }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.bar { display: flex; align-items: center; gap: 12px; padding: 12px 14px; padding-top: max(12px, env(safe-area-inset-top)); }
.bar-title { flex: 1; text-align: center; font-size: 18px; margin: 0; }
.search-wrap { position: relative; margin: 0 14px 8px; }
.search-wrap .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 17px; height: 17px; }
.search-wrap .search { padding: 10px 12px 10px 38px; border-radius: 12px; }

.chat-list { overflow-y: auto; flex: 1; padding: 0 8px 16px; }
.chat-row { display: flex; gap: 12px; align-items: center; padding: 9px 10px; border-radius: 14px; color: inherit; text-decoration: none; }
.chat-row:hover { background: color-mix(in srgb, var(--elevated) 60%, transparent); }
.chat-row.active { background: var(--elevated); }
.row-body { flex: 1; min-width: 0; }
.row-top, .row-bottom { display: flex; align-items: center; gap: 8px; }
.row-name { font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; }
.row-time { color: var(--muted); font-size: 13px; flex: none; }
.row-preview { flex: 1; min-width: 0; color: var(--muted); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-preview .you { color: var(--text); }
.badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent-a), var(--accent-b)); color: var(--on-accent); }
.list-empty { text-align: center; color: var(--muted); padding: 40px 16px; }

.avatar { width: var(--size); height: var(--size); border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: calc(var(--size) * 0.38); color: #F4F4F5; overflow: hidden; letter-spacing: -0.02em; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.tone0 { background: linear-gradient(135deg, #7C7C84, #3E3E45); } .tone1 { background: linear-gradient(135deg, #55555C, #2A2A2F); }
.tone2 { background: linear-gradient(135deg, #6B6B72, #36363C); } .tone3 { background: linear-gradient(135deg, #45454C, #202024); }
.tone4 { background: linear-gradient(135deg, #606067, #2F2F34); } .tone5 { background: linear-gradient(135deg, #8A8A91, #45454B); }

.empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--muted); padding: 24px; text-align: center; }
.logo.faint { width: 84px; height: 84px; opacity: .5; }
.light-only { display: none; }
@media (prefers-color-scheme: light) { .light-only { display: block; } .dark-only { display: none; } }
.loading { margin: auto; color: var(--muted); }

/* ------------------------------------------------------------ conversation */
.chat-bar { border-bottom: 1px solid var(--separator); background: var(--glass); z-index: 2; }
.chat-heading { min-width: 0; flex: 1; }
.chat-name { font-weight: 600; display: flex; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.back { display: none; }
.wall { flex: 1; min-height: 0; display: flex; background-image: var(--blades); background-size: 92px 80px;
  background-color: var(--bg); }
.messages { flex: 1; overflow-y: auto; padding: 14px max(12px, calc((100% - 880px) / 2)) 10px; display: flex; flex-direction: column; gap: 3px; }
.day { align-self: center; font-size: 12px; font-weight: 600; color: var(--muted); background: color-mix(in srgb, var(--elevated) 85%, transparent);
  padding: 4px 10px; border-radius: 10px; margin: 12px 0 6px; }
.day.start { background: transparent; font-weight: 500; }
.msg { display: flex; flex-direction: column; max-width: min(78%, 560px); position: relative; margin-top: 6px; }
.msg.joined { margin-top: 0; }
.msg.in { align-self: flex-start; align-items: flex-start; }
.msg.out { align-self: flex-end; align-items: flex-end; }
.bubble { padding: 8px 12px 6px; border-radius: 18px; background: var(--bubble-in); border: 1px solid var(--stroke); cursor: pointer;
  overflow-wrap: anywhere; position: relative; max-width: 100%; }
.msg.out .bubble { background: linear-gradient(180deg, color-mix(in srgb, var(--bubble-out) 100%, #fff 3%), var(--bubble-out)); color: var(--out-text); border-color: transparent; }
.msg.in.joined .bubble { border-top-left-radius: 6px; }
.msg.out.joined .bubble { border-top-right-radius: 6px; }
.bubble.deleted { cursor: default; opacity: .7; }
.text { white-space: pre-wrap; font-size: 16px; line-height: 1.38; }
.sender { font-size: 13px; font-weight: 700; color: var(--accent); margin-bottom: 2px; }
.meta { float: right; margin: 6px 0 -2px 10px; font-size: 11.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.msg.out .meta { color: color-mix(in srgb, var(--out-text) 65%, transparent); }
.tick { width: 15px; height: 15px; }
.tick.read { color: var(--accent); }
.msg.out .tick.read { color: var(--accent-a); }
.retry { background: none; border: 0; color: var(--danger); font-size: 12px; cursor: pointer; padding: 0; }
.quote { border-left: 3px solid var(--accent); padding: 2px 0 2px 9px; margin: 2px 0 6px; font-size: 14px; }
.quote-who { font-weight: 700; color: var(--accent); font-size: 13px; }
.quote-text { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 360px; }
.msg.out .quote-text { color: color-mix(in srgb, var(--out-text) 70%, transparent); }
.gift { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); margin: 2px 0 4px; }
.photo { display: block; max-width: min(320px, 100%); max-height: 360px; border-radius: 12px; margin: 2px 0 6px; background: var(--elevated); }
.file { display: flex; gap: 10px; align-items: center; background: color-mix(in srgb, var(--text) 6%, transparent); border: 0; border-radius: 12px; padding: 8px 12px; margin: 2px 0 6px; cursor: pointer; text-align: left; color: inherit; }
.file > span:last-child { display: flex; flex-direction: column; }
.file-name { font-weight: 600; font-size: 14px; }
.file-size { font-size: 12px; opacity: .7; }
.reactions { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.reaction { display: inline-flex; gap: 4px; align-items: center; padding: 2px 8px; border-radius: 12px; background: var(--elevated); border: 1px solid var(--stroke); cursor: pointer; font-size: 14px; }
.reaction span { font-size: 12px; font-weight: 700; color: var(--muted); }
.reaction.mine { border-color: var(--accent); }

.menu { position: absolute; z-index: 20; top: calc(100% + 6px); min-width: 230px; background: var(--card); border: 1px solid var(--stroke); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.msg.in .menu { left: 0; } .msg.out .menu { right: 0; }
.menu-reactions { display: flex; padding: 6px; gap: 2px; border-bottom: 1px solid var(--separator); }
.menu-reactions button { flex: 1; background: none; border: 0; font-size: 21px; padding: 6px 0; border-radius: 10px; cursor: pointer; }
.menu-reactions button:hover { background: var(--elevated); }
.menu-item { display: flex; width: 100%; justify-content: space-between; align-items: center; padding: 11px 16px; background: none; border: 0; cursor: pointer; font-size: 15px; }
.menu-item:hover { background: var(--elevated); }
.menu-item.danger { color: var(--danger); }
.menu-item .icon { width: 18px; height: 18px; }

.composer { padding: 8px 12px; padding-bottom: max(10px, env(safe-area-inset-bottom)); background: var(--glass); border-top: 1px solid var(--separator); }
.compose-row { display: flex; align-items: flex-end; gap: 8px; max-width: 900px; margin: 0 auto; }
.composer .field { resize: none; min-height: 44px; max-height: 160px; border-radius: 22px; padding: 11px 16px; line-height: 1.35; }
.send { width: 44px; height: 44px; border-radius: 50%; border: 0; flex: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent-a), var(--accent-b)); color: var(--on-accent); }
.send:disabled { background: var(--elevated); color: var(--muted); cursor: default; }
.context-bar { display: flex; gap: 10px; align-items: center; max-width: 900px; margin: 0 auto 8px; padding: 6px 8px 6px 12px; border-radius: 14px; background: var(--elevated); }
.context-text { flex: 1; min-width: 0; }
.context-title { font-size: 13px; font-weight: 700; color: var(--accent); }
.context-body { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.readonly { text-align: center; color: var(--muted); padding: 14px; padding-bottom: max(14px, env(safe-area-inset-bottom)); border-top: 1px solid var(--separator); font-size: 14px; }

/* ------------------------------------------------------------ dialogs */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,0.55); display: flex; align-items: flex-start; justify-content: center; padding: 10vh 16px 16px; }
.sheet { width: 100%; max-width: 460px; max-height: 80vh; overflow-y: auto; background: var(--card); border: 1px solid var(--stroke); border-radius: 22px; padding: 18px; box-shadow: var(--shadow); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sheet-head h2 { margin: 0; font-size: 20px; }
.sheet-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }
.results { display: flex; flex-direction: column; gap: 2px; }
.person { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px; border: 0; border-radius: 12px; background: none; cursor: pointer; text-align: left; }
.person:hover { background: var(--elevated); }
.person > .icon { color: var(--muted); }
.person-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.person-name { font-weight: 600; display: flex; align-items: center; }
.person-sub { color: var(--muted); font-size: 14px; }
.group-box { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 16px; background: var(--elevated); }
.group-box .field-line { background: var(--card); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 8px 5px 12px; border-radius: 16px; border: 0; background: var(--text); color: var(--bg); font-size: 14px; cursor: pointer; }
.chip .icon { width: 14px; height: 14px; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 60; background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 14px; font-size: 15px; box-shadow: var(--shadow); transition: opacity .3s; max-width: calc(100vw - 32px); }
.toast.out { opacity: 0; }

/* ------------------------------------------------------------ settings and profiles */
.settings { overflow-y: auto; flex: 1; padding: 24px 16px 48px; }
.settings > * { max-width: 560px; margin-left: auto; margin-right: auto; }
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 8px 0 18px; }
.hero-avatar { position: relative; border: 0; padding: 0; background: none; border-radius: 50%; cursor: pointer; margin-bottom: 8px; }
.hero-avatar .avatar { box-shadow: 0 12px 34px rgba(0,0,0,0.35); }
.hero-camera { position: absolute; right: 2px; bottom: 2px; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--text); color: var(--bg); border: 3px solid var(--bg); }
.hero-camera .icon { width: 17px; height: 17px; }
.hero-name { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; display: flex; align-items: center; justify-content: center; }
.hero-name .icon.verified { width: 20px; height: 20px; }
.hero-sub { color: var(--muted); font-size: 15px; }
.hero-bio { margin: 6px 0 0; font-size: 15px; line-height: 1.45; max-width: 420px; white-space: pre-wrap; overflow-wrap: anywhere; }
.set-head { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 22px auto 8px; padding: 0 16px; }
.set-group { background: var(--card); border: 1px solid var(--stroke); border-radius: 18px; overflow: hidden; }
.set-group + .set-group { margin-top: 18px; }
.set-group.wide { width: 100%; margin-top: 16px; text-align: left; }
.set-row { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 54px; padding: 8px 14px; background: none; border: 0; text-align: left;
  font-size: 16px; position: relative; }
button.set-row { cursor: pointer; }
button.set-row:hover { background: color-mix(in srgb, var(--elevated) 70%, transparent); }
.set-row + .set-row::before { content: ""; position: absolute; top: 0; left: 60px; right: 0; height: 1px; background: var(--separator); }
.set-ic { width: 32px; height: 32px; border-radius: 9px; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--tile); color: #F4F4F5; }
.set-ic .icon { width: 17px; height: 17px; }
.set-title { flex: none; }
.set-value { flex: 1; min-width: 0; text-align: right; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
.set-row .chev { width: 16px; height: 16px; color: var(--muted); opacity: .7; }
.set-row.danger { color: var(--danger); }
.set-row.danger .set-ic { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.set-foot { font-size: 13px; color: var(--muted); margin: 8px auto 18px; padding: 0 16px; }
.profile-sheet { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 4px 0 8px; }
.profile-sheet .avatar { margin-bottom: 8px; }
.count { font-size: 12px; color: var(--muted); }
.chat-head-btn { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; background: none; border: 0; padding: 4px; margin: -4px; border-radius: 12px; cursor: pointer; text-align: left; }
.chat-head-btn:hover { background: color-mix(in srgb, var(--elevated) 60%, transparent); }

/* ------------------------------------------------------------ sign-in: brand panel on wide screens */
.auth-side { display: none; }
@media (min-width: 980px) {
  .auth { display: grid; grid-template-columns: minmax(380px, 1fr) minmax(420px, 1fr); padding: 0; align-items: stretch; }
  .auth-side { display: flex; flex-direction: column; justify-content: center; gap: 22px; padding: 64px clamp(40px, 6vw, 96px);
    background: radial-gradient(ellipse 80% 60% at 30% 20%, #26262B, #0A0A0B 70%); color: #F4F4F5; border-right: 1px solid rgba(255,255,255,0.06);
    background-image: var(--blades), radial-gradient(ellipse 80% 60% at 30% 20%, #26262B, #0A0A0B 70%); }
  .auth-side h2 { font-size: clamp(40px, 4vw, 60px); line-height: 1.02; letter-spacing: -0.04em; margin: 0; }
  .side-logo { width: 72px; height: 72px; }
  .auth-side ul { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 16px; }
  .auth-side li { display: flex; gap: 14px; align-items: center; font-size: 17px; color: #C8C8CE; }
  .auth-side li .icon { color: #D9B46C; width: 22px; height: 22px; }
  .auth .auth-card { align-self: center; justify-self: center; padding: 48px 24px; }
}

/* ------------------------------------------------------------ encryption */
.key-intro { display: flex; gap: 16px; align-items: flex-start; padding: 16px; border-radius: 18px; background: var(--card); border: 1px solid var(--stroke); }
.key-badge { width: 44px; height: 44px; border-radius: 14px; flex: none; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent-a), var(--accent-b)); color: var(--on-accent); }
.key-points { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; color: var(--muted); }
.warning { color: var(--danger); font-size: 15px; margin: 0; }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--text); font-weight: 500; margin: 4px 2px 0; letter-spacing: 0; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.e2e-note { align-self: center; display: flex; gap: 8px; align-items: flex-start; max-width: 460px; margin: 6px auto 10px; padding: 10px 14px;
  border-radius: 14px; background: var(--card); border: 1px solid var(--stroke); font-size: 13px; color: var(--muted); }
.e2e-note .icon { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.e2e-note.ok .icon { color: var(--accent); }
.safety { width: 100%; margin-top: 14px; padding: 14px; border-radius: 16px; background: var(--elevated); text-align: center; }
.safety-title { display: flex; gap: 6px; align-items: center; justify-content: center; font-weight: 600; margin-bottom: 8px; }
.safety-title .icon { width: 16px; height: 16px; color: var(--accent); }
.safety code { display: block; font: 600 17px/1.6 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.06em; word-spacing: 0.3em; }

/* ------------------------------------------------------------ sign-in extras */
.btn.google { background: #fff; color: #1f1f1f; border: 1px solid #dadce0; font-weight: 600; }
.g-logo { width: 20px; height: 20px; display: inline-flex; }
.g-logo svg { width: 100%; height: 100%; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 2px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--separator); }
.password { position: relative; display: flex; }
.password input { padding-right: 70px; }
.reveal { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer; padding: 6px 8px; }
.label-row { display: flex; justify-content: space-between; align-items: flex-end; }
.label-row label { margin-bottom: 0; }
.link.small { font-size: 14px; padding: 2px 4px; }
.link.subtle { color: var(--muted); font-weight: 500; }
.alt { text-align: center; color: var(--muted); font-size: 15px; margin-top: 6px; }
.alt p { margin: 4px 0; }

/* ------------------------------------------------------------ narrow screens: one pane at a time */
@media (max-width: 760px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .modal { align-items: flex-end; padding: 0; }
  .sheet { max-width: none; border-radius: 22px 22px 0 0; max-height: 90dvh; padding-bottom: max(18px, env(safe-area-inset-bottom)); border-bottom: 0; }
  .icon-btn { width: 44px; height: 44px; }
  .chat-row { padding: 10px 8px; }
  .settings { padding: 16px 12px 40px; }
  .auth { align-items: flex-start; padding-top: max(40px, env(safe-area-inset-top)); }
  .sheet-actions .btn { flex: 1; }
  .sidebar { border-right: 0; }
  .layout[data-view="chats"] .main { display: none; }
  .layout:not([data-view="chats"]) .sidebar { display: none; }
  .back { display: inline-flex; }
  .msg { max-width: 86%; }
  .menu { min-width: 210px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
