/* Webmail design system. The sign-in shell uses the AlphaSecure CRM styles in login.css. */

:root {
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, 'Cascadia Code', 'SF Mono', Menlo, Consolas, monospace;
  --bg: #000000; --bg-2: #0a0a0a; --panel: rgba(255,255,255,.045); --panel-2: rgba(255,255,255,.08); --panel-solid: #121212;
  --line: rgba(255,255,255,.09); --line-2: rgba(255,255,255,.16);
  --text: #f5f5f4; --text-2: #b8b8b4; --muted: #7c7c78;
  --accent: #bff747; --accent-2: #a6e02e; --on-accent: #0a0f00; --accent-soft: rgba(191,247,71,.14); --accent-glow: rgba(191,247,71,.35);
  --danger: #ff5d5d; --warn: #ffba00; --info: #6fc3ff; --ok: #4ade80;
  --radius: 18px; --radius-s: 12px; --pill: 999px;
  --shadow: 0 20px 60px rgba(0,0,0,.6), 0 2px 8px rgba(0,0,0,.4);
  --shadow-s: 0 6px 24px rgba(0,0,0,.45);
  --glow: radial-gradient(60% 60% at 15% 0%, rgba(58,110,20,.45) 0%, rgba(58,110,20,.12) 40%, rgba(0,0,0,0) 70%);
  --sidebar-w: 268px; --list-w: 420px; --top-h: 64px;
  --row-h: 64px; --ease: cubic-bezier(.2,.8,.2,1);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f4f5f2; --bg-2: #ffffff; --panel: #ffffff; --panel-2: #eef0ea; --panel-solid: #ffffff;
  --line: rgba(0,0,0,.08); --line-2: rgba(0,0,0,.16);
  --text: #111311; --text-2: #4a4c48; --muted: #8a8c88;
  --accent: #6f9c12; --accent-2: #5d8410; --on-accent: #ffffff; --accent-soft: rgba(111,156,18,.12); --accent-glow: rgba(191,247,71,.6);
  --shadow: 0 20px 60px rgba(20,30,10,.18), 0 2px 8px rgba(0,0,0,.08);
  --shadow-s: 0 6px 24px rgba(20,30,10,.12);
  --glow: radial-gradient(60% 60% at 15% 0%, rgba(191,247,71,.35) 0%, rgba(191,247,71,.1) 40%, rgba(0,0,0,0) 70%);
  color-scheme: light;
}
[data-density="compact"] { --row-h: 48px; }

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.45; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; overflow: hidden; }
body::before { content: ''; position: fixed; inset: 0; background: var(--glow); pointer-events: none; z-index: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--accent); }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: var(--on-accent); }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: rgba(128,128,128,.25); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; } ::-webkit-scrollbar-thumb:hover { background: rgba(128,128,128,.45); background-clip: padding-box; border: 2px solid transparent; }

/* ---- primitives ---- */
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 16px; height: 16px; } .icon.xs { width: 14px; height: 14px; }
.btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: var(--pill); font-weight: 600; letter-spacing: .01em; background: var(--panel-2); color: var(--text); transition: transform .15s var(--ease), background .15s, box-shadow .2s; white-space: nowrap; user-select: none; }
.btn:hover { background: var(--line-2); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 0 0 0 var(--accent-glow); }
.btn.primary:hover { background: var(--accent-2); box-shadow: 0 8px 30px -6px var(--accent-glow); }
.btn.ghost { background: transparent; } .btn.ghost:hover { background: var(--panel-2); }
.btn.danger { background: rgba(255,93,93,.14); color: var(--danger); } .btn.danger:hover { background: rgba(255,93,93,.24); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.lg { height: 48px; padding: 0 24px; font-size: 15px; }
.ibtn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: var(--pill); color: var(--text-2); transition: background .15s, color .15s, transform .15s var(--ease); position: relative; }
.ibtn:hover { background: var(--panel-2); color: var(--text); }
.ibtn.active { color: var(--accent); background: var(--accent-soft); }
.ibtn.sm { width: 30px; height: 30px; }
.ibtn[data-tip]:hover::after { content: attr(data-tip); position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--panel-solid); border: 1px solid var(--line); color: var(--text); font-size: 12px; font-weight: 500; padding: 5px 9px; border-radius: 8px; white-space: nowrap; z-index: 50; box-shadow: var(--shadow-s); pointer-events: none; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 600; color: var(--text-2); letter-spacing: .02em; text-transform: uppercase; }
.input, select.input, textarea.input { width: 100%; height: 44px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; min-height: 90px; padding: 12px 16px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.input::placeholder { color: var(--muted); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 40px; }
select.input option { background: var(--panel-solid); color: var(--text); }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.check input { appearance: none; width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line-2); background: var(--panel); display: grid; place-items: center; transition: all .15s; flex: none; }
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after { content: ''; width: 6px; height: 10px; border: solid var(--on-accent); border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px,-1px); }
.switch { position: relative; width: 44px; height: 26px; border-radius: var(--pill); background: var(--line-2); transition: background .2s; flex: none; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); }
.switch.on { background: var(--accent); } .switch.on::after { transform: translateX(18px); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--pill); background: var(--panel-2); font-size: 12px; font-weight: 600; color: var(--text-2); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.badge { min-width: 20px; height: 20px; padding: 0 7px; border-radius: var(--pill); background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 800; display: inline-grid; place-items: center; }
.muted { color: var(--muted); } .small { font-size: 12px; } .mono { font-family: var(--mono); }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; flex: none; letter-spacing: .02em; text-transform: uppercase; box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); }
.avatar.sm { width: 30px; height: 30px; font-size: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.divider { height: 1px; background: var(--line); margin: 12px 0; }
.spinner { width: 22px; height: 22px; border: 2.5px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
.skeleton { background: linear-gradient(90deg, var(--panel) 25%, var(--panel-2) 50%, var(--panel) 75%); background-size: 800px 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }
kbd { font-family: var(--mono); font-size: 11px; background: var(--panel-2); border: 1px solid var(--line-2); border-bottom-width: 2px; padding: 1px 6px; border-radius: 6px; color: var(--text-2); }

/* ---- login ---- */
#login { position: fixed; inset: 0; display: grid; place-items: center; z-index: 5; padding: 20px; }
.login-card { width: min(440px, 100%); padding: 40px 36px; background: rgba(12,12,12,.7); backdrop-filter: blur(24px); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow); animation: pop .4s var(--ease); }
[data-theme="light"] .login-card { background: rgba(255,255,255,.8); }
.login-card h1 { margin: 18px 0 4px; font-size: 30px; font-weight: 300; letter-spacing: -.02em; }
.login-card h1 b { font-weight: 800; color: var(--accent); }
.login-card p { margin: 0 0 24px; color: var(--text-2); }
.login-card form { display: grid; gap: 14px; }
.login-card .input { height: 50px; font-size: 15px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
.logo .mark { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); display: grid; place-items: center; color: var(--on-accent); box-shadow: 0 6px 20px -4px var(--accent-glow); }
.logo .mark .icon { width: 20px; height: 20px; stroke-width: 2.2; }
.error { color: var(--danger); font-size: 13px; font-weight: 600; min-height: 18px; }
.qr { display: block; margin: 8px auto; width: 200px; height: 200px; border-radius: 16px; background: #fff; padding: 8px; }

/* ---- app shell ---- */
#app { position: relative; z-index: 1; display: grid; grid-template-columns: var(--sidebar-w) 1fr; grid-template-rows: var(--top-h) 1fr; height: 100vh; height: 100dvh; }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 0 18px 0 20px; border-bottom: 1px solid var(--line); background: rgba(0,0,0,.35); backdrop-filter: blur(20px); }
[data-theme="light"] .topbar { background: rgba(255,255,255,.6); }
.topbar .logo { width: calc(var(--sidebar-w) - 20px); }
.search { flex: 1; max-width: 720px; position: relative; }
.search .input { height: 44px; padding-left: 46px; padding-right: 44px; border-radius: var(--pill); background: var(--panel); }
.search > .icon { position: absolute; left: 16px; top: 12px; color: var(--muted); pointer-events: none; }
.search .ibtn { position: absolute; right: 4px; top: 3px; }
.search-help { position: absolute; top: calc(100% + 8px); left: 0; right: 0; padding: 14px 16px; border-radius: 16px; background: var(--panel-solid); border: 1px solid var(--line); box-shadow: var(--shadow); z-index: 40; font-size: 13px; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 14px; animation: pop .2s var(--ease); }
.search-help b { font-family: var(--mono); color: var(--accent); font-weight: 600; }
.topbar .spacer { flex: 1; }
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: var(--pill); padding: 3px; }
.seg button { height: 34px; padding: 0 16px; border-radius: var(--pill); font-weight: 600; color: var(--text-2); display: inline-flex; align-items: center; gap: 8px; transition: all .15s; }
.seg button.active { background: var(--accent); color: var(--on-accent); }
.seg button:not(.active):hover { color: var(--text); }
.me { display: flex; align-items: center; gap: 10px; padding: 4px 4px 4px 12px; border-radius: var(--pill); transition: background .15s; }
.me:hover { background: var(--panel-2); }
.me .name { font-weight: 600; font-size: 13px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sidebar { display: flex; flex-direction: column; border-right: 1px solid var(--line); overflow: hidden auto; padding: 16px 12px 24px; gap: 4px; }
.sidebar .compose { margin: 0 4px 14px; height: 50px; font-size: 15px; justify-content: center; }
.nav-item { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 14px; border-radius: var(--pill); color: var(--text-2); font-weight: 500; transition: background .15s, color .15s; cursor: pointer; user-select: none; position: relative; }
.nav-item:hover { background: var(--panel-2); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--text); font-weight: 700; }
.nav-item.active .icon { color: var(--accent); }
.nav-item .label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .count { font-size: 12px; font-weight: 700; color: var(--muted); }
.nav-item.active .count, .nav-item.unread .count { color: var(--accent); }
.nav-item.sub { padding-left: 30px; height: 36px; font-size: 13px; }
.nav-group { margin-top: 10px; }
.nav-group > .head { display: flex; align-items: center; gap: 8px; padding: 8px 14px 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); cursor: pointer; user-select: none; }
.nav-group > .head .caret { transition: transform .2s; margin-left: auto; }
.nav-group.collapsed > .head .caret { transform: rotate(-90deg); }
.nav-group.collapsed > .items { display: none; }
.nav-group .head .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.nav-group .head .err { color: var(--danger); }
.sidebar .foot { margin-top: auto; padding-top: 12px; display: grid; gap: 4px; }

/* ---- mail area ---- */
.main { display: grid; grid-template-columns: var(--list-w) 1fr; overflow: hidden; min-width: 0; }
.main.layout-list { grid-template-columns: 1fr; }
.main.layout-list .reader { position: absolute; inset: var(--top-h) 0 0 var(--sidebar-w); background: var(--bg); z-index: 3; }
.main.layout-list .reader:not(.open) { display: none; }
.list-pane { display: flex; flex-direction: column; border-right: 1px solid var(--line); min-width: 0; overflow: hidden; }
.main.layout-list .list-pane { border-right: 0; }
.toolbar { display: flex; align-items: center; gap: 4px; height: 52px; padding: 0 10px 0 14px; border-bottom: 1px solid var(--line); flex: none; }
.toolbar .title { font-weight: 800; font-size: 16px; letter-spacing: -.01em; margin-right: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toolbar .sub { color: var(--muted); font-size: 12px; font-weight: 600; }
.toolbar .grow { flex: 1; }
.toolbar .pager { display: inline-flex; align-items: center; gap: 2px; color: var(--muted); font-size: 12px; font-weight: 600; }
.list { flex: 1; overflow: auto; overscroll-behavior: contain; }
.row { display: grid; grid-template-columns: 22px 40px 1fr auto; align-items: center; gap: 12px; min-height: var(--row-h); padding: 8px 14px 8px 12px; border-bottom: 1px solid var(--line); cursor: pointer; position: relative; transition: background .12s; }
.row:hover { background: var(--panel); }
.row.selected { background: var(--accent-soft); }
.row.current { box-shadow: inset 3px 0 0 var(--accent); background: var(--panel-2); }
.row .from { font-weight: 600; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.row .subj { display: flex; gap: 6px; min-width: 0; align-items: baseline; }
.row .subj .s { font-weight: 500; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none; max-width: 100%; }
.row .subj .snip { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 400; }
.row.unread .from, .row.unread .subj .s { color: var(--text); font-weight: 700; }
.row.unread .from::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; box-shadow: 0 0 10px var(--accent-glow); }
.row .meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.row.unread .meta .d { color: var(--accent); }
.row .meta .ic { display: flex; gap: 6px; color: var(--muted); }
.row .star { color: var(--muted); } .row .star.on { color: var(--warn); } .row .star.on .icon { fill: var(--warn); }
.row .acc { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.row .check input { width: 18px; height: 18px; }
[data-density="compact"] .row { grid-template-columns: 22px 1fr auto; padding: 4px 14px 4px 12px; } [data-density="compact"] .row .avatar { display: none; }
[data-density="compact"] .row .subj { display: inline; } [data-density="compact"] .row .subj .s { display: inline; }
.empty { display: grid; place-items: center; height: 100%; color: var(--muted); text-align: center; padding: 40px; gap: 8px; }
.empty .icon { width: 44px; height: 44px; opacity: .5; }
.empty h3 { margin: 0; font-weight: 700; color: var(--text-2); }

/* ---- reader ---- */
.reader { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.reader .toolbar { padding-left: 10px; }
.reader-body { flex: 1; overflow: auto; padding: 22px 28px 60px; }
.reader h2 { margin: 0 0 18px; font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; }
.msg { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); margin-bottom: 14px; animation: rise .3s var(--ease); overflow: hidden; }
.msg-head { display: flex; align-items: flex-start; gap: 14px; padding: 16px 20px; cursor: pointer; }
.msg-head .who { flex: 1; min-width: 0; }
.msg-head .who .n { font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.msg-head .who .n .addr { font-weight: 500; color: var(--muted); font-size: 13px; }
.msg-head .who .to { color: var(--muted); font-size: 13px; margin-top: 2px; display: flex; gap: 6px; align-items: center; }
.msg-head .when { color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.msg-head .when .acts { display: flex; gap: 2px; }
.msg.collapsed .msg-body, .msg.collapsed .atts, .msg.collapsed .msg-foot { display: none; }
.msg.collapsed .msg-head { opacity: .75; }
.msg.collapsed .msg-head .who .to { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.details { padding: 0 20px 12px; font-size: 13px; display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; color: var(--text-2); }
.details b { color: var(--muted); font-weight: 600; }
.banner { display: flex; align-items: center; gap: 12px; margin: 0 20px 12px; padding: 10px 14px; border-radius: 12px; background: var(--panel-2); font-size: 13px; }
.banner.warn { background: rgba(255,186,0,.12); color: var(--warn); }
.banner .btn { margin-left: auto; }
.msg-body { padding: 4px 20px 18px; }
.msg-body iframe { width: 100%; border: 0; display: block; min-height: 60px; color-scheme: light; background: #fff; border-radius: 12px; }
.msg-body .plainbox { white-space: pre-wrap; word-break: break-word; font-size: 14.5px; line-height: 1.6; }
.atts { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 20px 18px; }
.att { display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-2); max-width: 300px; transition: border-color .15s, transform .15s var(--ease); cursor: pointer; }
.att:hover { border-color: var(--accent); transform: translateY(-1px); }
.att .thumb { width: 44px; height: 44px; border-radius: 10px; background: var(--panel-2); display: grid; place-items: center; overflow: hidden; color: var(--accent); flex: none; }
.att .thumb img { width: 100%; height: 100%; object-fit: cover; }
.att .fn { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.att .fs { color: var(--muted); font-size: 12px; }
.att .dl { margin-left: auto; }
.att.img-card { padding: 0; max-width: 220px; flex-direction: column; align-items: stretch; gap: 0; }
.att.img-card .thumb { width: 100%; height: 150px; border-radius: 14px 14px 0 0; }
.att.img-card .fi { display: flex; align-items: center; gap: 8px; padding: 8px 10px; }
.msg-foot { display: flex; gap: 8px; padding: 0 20px 18px; }
.quick-reply { margin: 6px 0 0; }

/* ---- compose ---- */
.compose-win { position: fixed; right: 24px; bottom: 0; width: min(680px, calc(100vw - 48px)); height: min(640px, calc(100vh - 80px)); background: var(--panel-solid); border: 1px solid var(--line-2); border-bottom: 0; border-radius: 22px 22px 0 0; box-shadow: var(--shadow); display: flex; flex-direction: column; z-index: 30; animation: pop .25s var(--ease); overflow: hidden; }
.compose-win.max { right: 5vw; bottom: 3vh; width: 90vw; height: 94vh; border-radius: 22px; border-bottom: 1px solid var(--line-2); }
.compose-win.min { height: 52px; }
.compose-head { display: flex; align-items: center; gap: 6px; height: 52px; padding: 0 8px 0 18px; background: var(--panel-2); font-weight: 700; flex: none; cursor: default; }
.compose-head .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compose-form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.c-row { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 18px; border-bottom: 1px solid var(--line); }
.c-row label { color: var(--muted); font-size: 13px; font-weight: 600; width: 48px; flex: none; }
.c-row .in { flex: 1; min-width: 0; border: 0; background: none; outline: none; height: 34px; }
.c-row .links { display: flex; gap: 10px; font-size: 12px; font-weight: 600; color: var(--muted); }
.c-row .links button:hover { color: var(--accent); }
.c-row select { border: 0; background: none; outline: none; font-weight: 600; max-width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; align-items: center; min-width: 0; position: relative; }
.chips .in { flex: 1; min-width: 140px; }
.rchip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 6px 0 10px; border-radius: var(--pill); background: var(--panel-2); font-size: 13px; font-weight: 600; max-width: 260px; }
.rchip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rchip.bad { background: rgba(255,93,93,.15); color: var(--danger); }
.rchip button { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: var(--muted); } .rchip button:hover { background: var(--line-2); color: var(--text); }
.suggest { position: absolute; top: 100%; left: 0; min-width: 300px; background: var(--panel-solid); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); z-index: 20; overflow: hidden; }
.suggest div { padding: 8px 14px; cursor: pointer; display: flex; gap: 10px; align-items: center; }
.suggest div:hover, .suggest div.hi { background: var(--accent-soft); }
.suggest .e { color: var(--muted); font-size: 12px; }
.editor-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.editor { flex: 1; overflow: auto; padding: 16px 18px; outline: none; font-size: 14.5px; line-height: 1.55; min-height: 120px; }
.editor blockquote { border-left: 3px solid var(--line-2); margin: 8px 0; padding-left: 12px; color: var(--text-2); }
.editor img { max-width: 100%; border-radius: 8px; }
.editor a { color: var(--accent); }
.c-atts { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 18px 8px; }
.c-atts .att { cursor: default; } .c-atts .att:hover { transform: none; border-color: var(--line); }
.c-foot { display: flex; align-items: center; gap: 4px; padding: 10px 14px; border-top: 1px solid var(--line); flex: none; }
.c-foot .send { height: 42px; padding: 0 22px; }
.fmt { display: flex; gap: 2px; padding: 4px 12px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.fmt .ibtn { width: 32px; height: 32px; }
.fmt .ibtn.on { color: var(--accent); background: var(--accent-soft); }
.drop { outline: 2px dashed var(--accent); outline-offset: -8px; }

/* ---- modals / popovers ---- */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); backdrop-filter: blur(6px); z-index: 40; display: grid; place-items: center; padding: 20px; animation: rise .2s var(--ease); }
.modal { width: min(760px, 100%); max-height: min(88vh, 900px); background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; animation: pop .25s var(--ease); }
.modal.sm { width: min(460px, 100%); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 14px 24px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.01em; flex: 1; }
.modal-body { padding: 20px 24px; overflow: auto; display: grid; gap: 16px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 24px 18px; border-top: 1px solid var(--line); }
.tabs { display: flex; gap: 4px; padding: 10px 16px 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { height: 40px; padding: 0 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.active { color: var(--text); border-color: var(--accent); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.setting { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.setting:last-child { border-bottom: 0; }
.setting .txt { flex: 1; } .setting .txt b { display: block; } .setting .txt span { color: var(--muted); font-size: 13px; }
.acct-card { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.acct-card .txt { flex: 1; min-width: 0; } .acct-card .txt b { display: block; overflow: hidden; text-overflow: ellipsis; } .acct-card .txt span { color: var(--muted); font-size: 12px; }
.toast-wrap { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 60; }
.toast { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-radius: var(--pill); background: #1c1c1c; color: #fff; box-shadow: var(--shadow); font-weight: 600; font-size: 13px; animation: pop .25s var(--ease); border: 1px solid var(--line-2); }
.toast.err { background: #3a1212; border-color: rgba(255,93,93,.4); }
.toast button { color: var(--accent); font-weight: 800; }
.toast .x { color: var(--muted); }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 70; display: grid; place-items: center; animation: rise .2s; }
.lightbox img { max-width: 94vw; max-height: 88vh; border-radius: 12px; box-shadow: var(--shadow); object-fit: contain; }
.lightbox .bar { position: absolute; top: 16px; right: 16px; display: flex; gap: 6px; }
.lightbox .bar .ibtn { background: rgba(255,255,255,.1); color: #fff; }
.lightbox .cap { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); color: #ddd; font-size: 13px; font-weight: 600; }
.menu { position: fixed; min-width: 220px; background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: var(--shadow); padding: 6px; z-index: 55; animation: pop .15s var(--ease); }
.menu button { display: flex; align-items: center; gap: 12px; width: 100%; height: 38px; padding: 0 12px; border-radius: 10px; font-weight: 500; text-align: left; }
.menu button:hover { background: var(--panel-2); }
.menu .sep { height: 1px; background: var(--line); margin: 6px 4px; }
.menu .lbl { padding: 6px 12px 2px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.shortcuts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; font-size: 13px; }
.shortcuts div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--line); }

/* ---- calendar ---- */
.cal { display: grid; grid-template-rows: 52px 1fr; overflow: hidden; min-width: 0; }
.cal .toolbar .today { margin-right: 4px; }
.cal .toolbar .title { font-size: 18px; min-width: 200px; }
.cal-body { overflow: auto; position: relative; }
.month { display: grid; grid-template-columns: repeat(7, 1fr); grid-template-rows: 34px repeat(6, minmax(110px, 1fr)); height: 100%; min-height: 640px; }
.month .dh { position: sticky; top: 0; z-index: 2; background: var(--bg); padding: 8px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); text-align: center; border-bottom: 1px solid var(--line); grid-row: auto; height: 34px; }
.month .day { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; transition: background .12s; min-width: 0; }
.month .day:hover { background: var(--panel); }
.month .day.other { color: var(--muted); background: rgba(128,128,128,.03); }
.month .day .n { font-weight: 700; font-size: 13px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; }
.month .day.today .n { background: var(--accent); color: var(--on-accent); box-shadow: 0 0 14px var(--accent-glow); }
.ev { display: flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 8px; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; background: var(--c, var(--accent)); color: #000; border-left: 3px solid rgba(0,0,0,.25); transition: transform .12s var(--ease), filter .12s; min-width: 0; }
.ev:hover { filter: brightness(1.08); transform: translateY(-1px); }
.ev.timed { background: transparent; color: var(--text); border-left: 3px solid var(--c); }
.ev.timed:hover { background: var(--panel-2); }
.ev .t { color: var(--muted); font-weight: 600; flex: none; }
.ev.timed .t { color: var(--c); }
.ev.cancelled { text-decoration: line-through; opacity: .6; }
.more { font-size: 11px; font-weight: 700; color: var(--accent); padding: 0 8px; cursor: pointer; }
.week { display: grid; grid-template-columns: 56px repeat(7, 1fr); grid-template-rows: auto auto 1fr; min-height: 100%; }
.week .corner { position: sticky; top: 0; background: var(--bg); z-index: 3; border-bottom: 1px solid var(--line); }
.week .wh { position: sticky; top: 0; z-index: 3; background: var(--bg); text-align: center; padding: 8px 4px 6px; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); }
.week .wh .d { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.week .wh .n { font-size: 22px; font-weight: 700; width: 38px; height: 38px; margin: 2px auto 0; border-radius: 50%; display: grid; place-items: center; }
.week .wh.today .n { background: var(--accent); color: var(--on-accent); box-shadow: 0 0 14px var(--accent-glow); }
.week .allday { border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); min-height: 28px; padding: 3px; display: grid; gap: 2px; align-content: start; }
.week .allday-lbl { border-bottom: 1px solid var(--line); font-size: 10px; color: var(--muted); text-align: right; padding: 6px; }
.week .gutter { position: relative; }
.week .gutter div { height: 56px; font-size: 11px; color: var(--muted); text-align: right; padding-right: 8px; transform: translateY(-7px); }
.week .col { position: relative; border-left: 1px solid var(--line); background-image: linear-gradient(var(--line) 1px, transparent 1px); background-size: 100% 56px; cursor: pointer; }
.week .col.today { background-color: rgba(191,247,71,.03); }
.week .tev { position: absolute; left: 3px; right: 6px; border-radius: 10px; padding: 4px 8px; background: color-mix(in srgb, var(--c) 22%, var(--panel-solid)); border-left: 3px solid var(--c); font-size: 12px; overflow: hidden; cursor: pointer; transition: transform .12s var(--ease), box-shadow .12s; }
.week .tev:hover { transform: scale(1.01); box-shadow: var(--shadow-s); z-index: 5; }
.week .tev b { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.week .tev span { color: var(--text-2); font-size: 11px; }
.week .now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 4; pointer-events: none; }
.week .now::before { content: ''; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
.agenda { padding: 16px 24px; display: grid; gap: 4px; max-width: 900px; }
.agenda .dhd { font-weight: 800; margin: 18px 0 6px; display: flex; align-items: baseline; gap: 8px; } .agenda .dhd span { color: var(--muted); font-weight: 600; font-size: 12px; }
.agenda .ev { padding: 10px 14px; border-radius: 12px; font-size: 13px; white-space: normal; }
.mini { padding: 10px 6px 0; }
.mini .mh { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 13px; padding: 0 6px 6px; }
.mini .mg { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; font-size: 11px; }
.mini .mg .h { color: var(--muted); font-weight: 700; font-size: 10px; }
.mini .mg button { height: 28px; border-radius: 50%; font-weight: 600; color: var(--text-2); }
.mini .mg button:hover { background: var(--panel-2); }
.mini .mg button.o { color: var(--muted); opacity: .5; }
.mini .mg button.t { background: var(--accent); color: var(--on-accent); }
.mini .mg button.sel { box-shadow: inset 0 0 0 2px var(--accent); }
.mini .mg button.has::after { content: ''; display: block; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); margin: -3px auto 0; }
.cal-list .nav-item .sw { width: 14px; height: 14px; border-radius: 4px; flex: none; border: 2px solid var(--c); background: var(--c); }
.cal-list .nav-item.off .sw { background: transparent; }
.cal-list .nav-item.off .label { color: var(--muted); text-decoration: line-through; }
.ev-pop { position: fixed; width: 360px; max-width: calc(100vw - 24px); background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: 20px; box-shadow: var(--shadow); z-index: 45; padding: 16px 18px; animation: pop .2s var(--ease); }
.ev-pop h4 { margin: 0 0 6px; font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.ev-pop h4 .sw { width: 12px; height: 12px; border-radius: 4px; background: var(--c); flex: none; }
.ev-pop .l { display: flex; gap: 10px; align-items: flex-start; color: var(--text-2); font-size: 13px; margin: 6px 0; }
.ev-pop .l .icon { color: var(--muted); margin-top: 1px; }
.ev-pop .acts { display: flex; gap: 4px; justify-content: flex-end; margin-top: 10px; }
.color-row { display: flex; gap: 8px; flex-wrap: wrap; }
.color-row button { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; transition: transform .12s; }
.color-row button.sel { border-color: var(--text); transform: scale(1.15); }
.attendee-list { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---- responsive ---- */
.menu-btn { display: none; }
@media (max-width: 1100px) { :root { --list-w: 360px; } }
@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  #app { grid-template-columns: 1fr; }
  .topbar .logo { width: auto; } .topbar .logo .txt { display: none; } .menu-btn { display: inline-flex; }
  .sidebar { position: fixed; top: var(--top-h); bottom: 0; left: 0; width: 290px; background: var(--bg); z-index: 20; transform: translateX(-100%); transition: transform .25s var(--ease); box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .main { grid-template-columns: 1fr; }
  .reader { position: absolute; inset: var(--top-h) 0 0 0; background: var(--bg); z-index: 3; }
  .reader:not(.open) { display: none; }
  .main.layout-list .reader { left: 0; }
  .reader-body { padding: 14px 14px 80px; }
  .compose-win, .compose-win.max { right: 0; bottom: 0; width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; }
  .search { max-width: none; } .me .name { display: none; }
  .month { grid-template-rows: 34px repeat(6, minmax(84px, 1fr)); }
  .week { grid-template-columns: 44px repeat(7, 1fr); } .week .wh .n { font-size: 16px; width: 30px; height: 30px; }
  .grid2 { grid-template-columns: 1fr; }
  .modal { border-radius: 20px; max-height: 94vh; }
  .ibtn[data-tip]:hover::after { display: none; }
}
@media print { .topbar, .sidebar, .list-pane, .toolbar, .compose-win, .toast-wrap { display: none !important; } #app { display: block; } .reader { position: static; } body { background: #fff; color: #000; overflow: visible; } }

/* ---- chat ---- */
.chat { display: block; overflow: hidden; min-width: 0; }
.chat-main { display: grid; grid-template-rows: 52px 1fr auto auto; height: 100%; min-width: 0; }
.chat-msgs { overflow: auto; padding: 10px 20px 14px; overscroll-behavior: contain; }
.chat-start { display: flex; gap: 14px; align-items: center; padding: 26px 8px 18px; }
.chat-start .icon { width: 36px; height: 36px; color: var(--accent); }
.chat-day { display: flex; align-items: center; gap: 12px; margin: 16px 0 8px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.chat-day::before, .chat-day::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.chat-day.new { color: var(--danger); } .chat-day.new::before, .chat-day.new::after { background: rgba(255,93,93,.4); }
.chat-msg { display: grid; grid-template-columns: 40px 1fr; gap: 12px; padding: 5px 8px; border-radius: 12px; position: relative; align-items: start; }
.chat-msg:hover { background: var(--panel); }
.chat-msg.grouped { padding-top: 1px; padding-bottom: 1px; }
.chat-msg .av { display: grid; place-items: center; min-height: 22px; }
.chat-msg .av .tm { font-size: 10px; color: var(--muted); opacity: 0; } .chat-msg:hover .av .tm { opacity: 1; }
.chat-msg .hd { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.chat-msg .txt { font-size: 14.5px; line-height: 1.5; word-break: break-word; }
.chat-msg .txt code { font-family: var(--mono); font-size: 12.5px; background: var(--panel-2); padding: 1px 6px; border-radius: 6px; }
.chat-msg .txt a { color: var(--accent); }
.chat-msg .acts { display: none; gap: 2px; position: absolute; right: 10px; top: -14px; background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: var(--pill); padding: 2px; box-shadow: var(--shadow-s); }
.chat-msg:hover .acts { display: flex; }
.chat-msg.deleted .txt { color: var(--muted); }
.chat-reply { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); border-left: 2px solid var(--line-2); padding-left: 8px; margin: 2px 0 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.chat-img img { max-width: min(420px, 100%); max-height: 320px; border-radius: 12px; margin-top: 6px; display: block; border: 1px solid var(--line); }
.chat-msg .att { margin-top: 6px; }
.chat-reacts { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.react { height: 26px; padding: 0 8px; border-radius: var(--pill); background: var(--panel-2); border: 1px solid transparent; font-size: 12px; font-weight: 600; }
.react.on { border-color: var(--accent); background: var(--accent-soft); }
.mention { background: var(--accent-soft); color: var(--accent); padding: 0 4px; border-radius: 4px; font-weight: 600; }
.mention.me { background: var(--accent); color: var(--on-accent); }
.chat-typing { min-height: 18px; padding: 0 22px; font-size: 12px; color: var(--muted); font-style: italic; }
.chat-compose { padding: 6px 12px 8px; border-top: 1px solid var(--line); }
.chat-compose.drop { outline: 2px dashed var(--accent); outline-offset: -6px; }
.chat-row { display: flex; align-items: flex-end; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 6px 6px 6px 8px; }
.chat-row:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.chat-row textarea { flex: 1; border: 0; background: none; outline: none; resize: none; padding: 9px 6px; max-height: 200px; font-size: 14.5px; line-height: 1.45; }
.chat-send { height: 38px; padding: 0 16px; }
.chat-ctx { display: flex; align-items: center; gap: 8px; padding: 6px 12px; font-size: 12px; color: var(--muted); }
.chat-ctx span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.chat-item { height: auto; min-height: 44px; padding: 5px 10px 5px 8px; gap: 10px; }
.chat-item .chat-ic { position: relative; width: 30px; height: 30px; display: grid; place-items: center; flex: none; }
.chat-item .label { display: grid; gap: 1px; } .chat-item .label .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item .label .prev { font-size: 11px; color: var(--muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item.unread .label .n, .chat-item.unread .label .prev { color: var(--text); font-weight: 700; }
.chat-item.joinable { opacity: .7; }
.hash { font-weight: 800; color: var(--muted); font-size: 16px; }
.pres { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); border: 2px solid var(--bg); z-index: 1; }
.pres.on { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.acct-card .pres { position: static; border: 0; width: 8px; height: 8px; }
#chat-badge { position: absolute; top: -4px; right: -4px; }
.seg button { position: relative; }
.chat #chat-back { display: none; }
@media (max-width: 900px) {
  .chat { position: relative; }
  .chat-main { position: absolute; inset: 0; background: var(--bg); }
  .chat #chat-back { display: inline-flex; }
  .chat-send .lbl { display: none; } .chat-send { padding: 0 12px; }
}

/* ---- rich text toolbar ---- */
.fmt { display: flex; gap: 2px; padding: 4px 10px; border-top: 1px solid var(--line); flex-wrap: wrap; align-items: center; }
.fmt .sep { width: 1px; height: 20px; background: var(--line-2); margin: 0 4px; }
.fmt-sel { height: 28px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: 12px; padding: 0 6px; max-width: 130px; }
.fmt-sel option { background: var(--panel-solid); color: var(--text); }
.ibtn.color { position: relative; overflow: hidden; cursor: pointer; }
.ibtn.color input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.ibtn.color .bar { position: absolute; left: 9px; right: 9px; bottom: 6px; height: 3px; border-radius: 2px; }
.editor pre { background: var(--panel-2); padding: 8px 10px; border-radius: 8px; font-family: var(--mono); font-size: 13px; white-space: pre-wrap; }
.card + .fmt, .field .fmt { border: 1px solid var(--line); border-bottom: 0; border-radius: 12px 12px 0 0; background: var(--panel); }
.field .fmt + .editor { border-top-left-radius: 0; border-top-right-radius: 0; }
/* ---- calendar invitations ---- */
.invite { display: flex; gap: 14px; margin: 0 20px 14px; padding: 14px 16px; border-radius: 14px; background: var(--accent-soft); border: 1px solid var(--accent); }
.invite > .icon { color: var(--accent); width: 26px; height: 26px; flex: none; margin-top: 2px; }
.invite .iv { display: grid; gap: 6px; min-width: 0; flex: 1; }
.invite .ih b { font-size: 16px; display: block; }
.invite .ir { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--text-2); }
.invite .ir .icon { color: var(--muted); margin-top: 2px; }
.guests { display: flex; flex-wrap: wrap; gap: 4px; }
.rs { width: 16px; height: 16px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 10px; font-weight: 800; background: var(--line-2); color: var(--text); }
.rs.accepted { background: var(--ok); color: #042; } .rs.declined { background: var(--danger); color: #fff; } .rs.tentative { background: var(--warn); color: #321; }
.rsvp { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

/* ---- business card + scanner ---- */
.bc-layout { display: grid; grid-template-columns: 1fr 340px; gap: 20px; }
.bc-form { display: grid; gap: 12px; align-content: start; }
.bc-side { display: grid; gap: 12px; align-content: start; }
.bcard { border-radius: 22px; overflow: hidden; background: #111; border: 1px solid rgba(255,255,255,.1); color: #f5f5f4; box-shadow: var(--shadow-s); }
.bc-top { background: var(--a); color: var(--on); padding: 18px 18px 44px; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.bc-ph { width: 84px; height: 84px; border-radius: 50%; border: 4px solid #111; background: #222; margin: -42px auto 0; display: grid; place-items: center; font-size: 28px; font-weight: 800; overflow: hidden; color: #fff; }
.bc-ph img { width: 100%; height: 100%; object-fit: cover; }
.bc-who { text-align: center; padding: 10px 16px 4px; } .bc-who b { font-size: 18px; }
.bc-org { color: var(--a); font-weight: 700; font-size: 13px; }
.bc-bio { padding: 6px 18px 0; text-align: center; font-size: 12.5px; color: #c8c8c4; }
.bc-rows { display: grid; gap: 4px; padding: 12px 12px 4px; }
.bc-row { display: flex; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 10px; background: rgba(255,255,255,.05); font-size: 12.5px; word-break: break-all; }
.bc-row .icon { color: var(--a); }
.bc-qr { text-align: center; padding: 8px 12px 16px; } .bc-qr img { width: 120px; height: 120px; border-radius: 10px; background: #fff; padding: 6px; } .bc-qr small { display: block; color: #8a8a86; margin-top: 6px; }
.scan-box { position: relative; border-radius: 16px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; }
.scan-box video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; inset: 14%; border: 2px solid var(--accent); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); pointer-events: none; }
@media (max-width: 900px) { .bc-layout { grid-template-columns: 1fr; } }

.bc-frame { border-radius: 24px; overflow: hidden; border: 1px solid var(--line); background: #000; height: 640px; }
.bc-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
#bc-theme button { height: 32px; padding: 0 12px; font-size: 13px; }

/* ---- sign-in trust badge ---- */
.trust { display: flex; align-items: center; gap: 12px; margin: 22px -8px -12px; padding: 12px 14px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); text-decoration: none; color: var(--text); transition: border-color .15s, transform .15s var(--ease); }
.trust:hover { border-color: var(--accent); transform: translateY(-1px); }
.trust img { width: 96px; height: auto; flex: none; filter: drop-shadow(0 2px 6px rgba(0,0,0,.4)); }
[data-theme="light"] .trust img { filter: none; }
.trust span { display: grid; line-height: 1.25; } .trust small { color: var(--muted); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; font-weight: 700; } .trust b { font-size: 13px; }
.trust small:last-child { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 11.5px; margin-top: 2px; }
