:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #cfd5df;
  --surface: #e9edf3;
  --surface-2: #e5eaf1;
  --line: rgba(35,50,76,.15);
  --text: #1c2638;
  --muted: #667387;
  --blue: #4663ed;
  --blue-soft: rgba(70,99,237,.1);
  --green: #70d78a;
  --orange: #ff9b51;
  --danger: #ff6d75;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 50% -10%, #e8ecf2 0, var(--bg) 48%); color: var(--text); }
.boot-screen { min-height:100dvh; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; padding:24px; color:var(--muted); text-align:center; }
.boot-screen img { width:74px; height:74px; border-radius:20px; }
.boot-screen b { color:var(--text); font-size:18px; }
.boot-screen span { max-width:460px; line-height:1.5; }
.boot-error b { color:#b72d38; }
.login-page { min-height:100dvh; display:grid; place-items:center; padding:22px; }
.login-card { width:min(100%,390px); padding:28px; border:1px solid var(--line); border-radius:25px; background:rgba(233,237,243,.96); box-shadow:0 22px 65px rgba(35,50,76,.18); text-align:center; }
.login-logo { display:block; width:170px; height:52px; object-fit:contain; margin:0 auto 18px; }
.login-icon img { width:70px; height:70px; border-radius:19px; box-shadow:0 9px 25px rgba(20,47,91,.2); }
.login-card h1 { margin:16px 0 7px; font-size:23px; }
.login-card > p { margin:0 0 20px; color:var(--muted); }
.login-card .field { text-align:left; }
.login-input { text-align:center; letter-spacing:4px; font-size:18px; }
.login-error { margin:8px 0 12px; padding:9px 11px; border-radius:10px; background:rgba(215,71,82,.1); color:#a92f39; font-size:12px; }
.login-card > small { display:block; margin-top:16px; color:#8792a3; line-height:1.4; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
.app-shell { min-height: 100dvh; max-width: 680px; margin: auto; padding: max(20px, env(safe-area-inset-top)) 18px calc(94px + env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; gap: 12px; margin: 6px 0 22px; }
.topbar h1 { margin: 0; font-size: 20px; letter-spacing: -.35px; }
.brand-logo { width:126px; height:44px; object-fit:contain; object-position:left center; flex:0 0 auto; }
.avatar { width: 42px; height: 42px; border: 0; border-radius: 15px; background: linear-gradient(145deg,#795cff,#3e57e9); font-weight: 800; cursor: pointer; box-shadow: 0 8px 24px rgba(62,87,233,.25); }
.top-copy { flex: 1; }
.eyebrow { color: var(--muted); font-size: 12px; margin-bottom: 2px; }
.icon-btn { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; font-size: 18px; }
.install-short { display:flex; align-items:center; gap:5px; flex:0 0 auto; border:1px solid rgba(70,99,237,.28); border-radius:12px; padding:8px 10px; background:rgba(70,99,237,.1); color:#304bc6; font-size:11px; font-weight:700; cursor:pointer; }
.install-short span { font-size:18px; line-height:1; }
.greeting { margin-bottom: 18px; }
.greeting h2 { font-size: 21px; margin: 0 0 6px; }
.greeting p { color: var(--muted); margin: 0; line-height: 1.45; }
.filters { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 18px; scrollbar-width: none; }
.chip { white-space: nowrap; border: 1px solid var(--line); border-radius: 12px; padding: 9px 14px; background: var(--surface); color: #5d6a7e; cursor: pointer; }
.chip.active { background: var(--blue); border-color: var(--blue); color: white; }
.section-title { display: flex; align-items: center; gap: 8px; margin: 10px 2px 12px; font-size: 16px; }
.count { display: inline-grid; place-items: center; min-width: 23px; height: 23px; padding: 0 7px; border-radius: 99px; background: #e5eaf2; color: #536075; font-size: 12px; }
.task-list { display: grid; gap: 10px; }
.task { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; padding: 16px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 8px 26px rgba(46,63,94,.08); cursor: pointer; transition:.2s ease; }
.task.overdue { border-color:#d6545d; background:linear-gradient(100deg,rgba(214,84,93,.16),var(--surface-2) 48%); box-shadow:0 8px 24px rgba(173,47,58,.12); }
.task.overdue .meta span:nth-child(2) { color:#b72d38; font-weight:700; }
.task.due-soon { border-color:#d79a38; background:linear-gradient(100deg,rgba(230,166,62,.14),var(--surface-2) 48%); }
.complete-btn { border:1px solid #73839a; border-radius:10px; background:rgba(255,255,255,.35); color:#425168; padding:7px 9px; cursor:pointer; font-size:11px; font-weight:700; }
.complete-btn:hover { border-color:var(--blue); color:#304bc6; }
.complete-btn.done { border-color:#65a873; background:rgba(82,173,103,.13); color:#337b43; }
.task-title { font-size: 15px; line-height: 1.35; margin-bottom: 8px; }
.task.done .task-title { text-decoration: line-through; color: #87919b; }
.meta { display: flex; flex-wrap: wrap; gap: 7px 10px; align-items: center; color: var(--muted); font-size: 12px; }
.tag { border-radius: 7px; padding: 3px 7px; color: #415bd2; background: var(--blue-soft); }
.tag.work { color: #298441; background: rgba(74,181,99,.11); }
.tag.shop { color: #c4631c; background: rgba(255,155,81,.13); }
.star { border: 0; background: transparent; font-size: 20px; color: #65717f; padding: 0; cursor: pointer; }
.star.on { color: #f5b34f; }
.empty { padding: 46px 22px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 18px; }
.empty b { display: block; color: var(--text); margin-bottom: 8px; }
.fab { position: fixed; z-index: 5; right: max(22px, calc((100vw - 640px)/2)); bottom: calc(92px + env(safe-area-inset-bottom)); width: 58px; height: 58px; border: 0; border-radius: 20px; background: linear-gradient(145deg,#6077ff,#3049e2); font-size: 30px; box-shadow: 0 12px 30px rgba(50,72,230,.45); cursor: pointer; }
.bottom-nav { position: fixed; z-index: 4; bottom: 0; left: 50%; transform: translateX(-50%); width: min(100%,680px); display: grid; grid-template-columns: repeat(4,1fr); padding: 10px 8px calc(9px + env(safe-area-inset-bottom)); background: rgba(225,230,237,.92); border-top: 1px solid var(--line); backdrop-filter: blur(18px); }
.nav-btn { border: 0; background: transparent; color: var(--muted); padding: 6px 3px; font-size: 11px; cursor: pointer; }
.nav-btn span { position:relative; display: block; width:max-content; margin:0 auto 3px; font-size: 20px; }
.nav-btn.active { color: #7185ff; }
.nav-badge { position:absolute; top:-6px; right:-13px; display:grid; place-items:center; min-width:18px; height:18px; padding:0 5px; border:2px solid #e1e6ed; border-radius:99px; background:#d74752; color:white; font-style:normal; font-size:9px; font-weight:800; }
.unread-alert { width:100%; display:grid; grid-template-columns:38px 1fr 18px; gap:10px; align-items:center; margin:-2px 0 17px; padding:12px 14px; border:1px solid rgba(70,99,237,.26); border-radius:15px; background:linear-gradient(100deg,rgba(70,99,237,.16),rgba(70,99,237,.07)); color:var(--text); text-align:left; cursor:pointer; }
.unread-alert > span:nth-child(2) { min-width:0; }
.unread-alert b, .unread-alert small { display:block; }
.unread-alert small { margin-top:3px; overflow:hidden; color:var(--muted); white-space:nowrap; text-overflow:ellipsis; }
.unread-alert > i { color:#5369cb; font-size:25px; font-style:normal; }
.unread-bell { display:grid; place-items:center; width:36px; height:36px; border-radius:12px; background:#5369da; color:#ff6b73; font-size:13px; box-shadow:0 5px 14px rgba(70,99,237,.22); }
.unread-inline { display:inline-block; margin-left:5px; padding:2px 6px; border-radius:99px; background:#d74752; color:white; font-size:9px; font-weight:800; vertical-align:2px; }
.new-task-inline { display:inline-block; margin-left:5px; padding:2px 6px; border-radius:99px; background:#d98728; color:white; font-size:9px; font-weight:800; vertical-align:2px; }
.modal-wrap, .detail-wrap { position: fixed; z-index: 20; inset: 0; background: rgba(0,0,0,.6); display: grid; align-items: end; }
.modal { width: min(100%,680px); max-height: 92dvh; overflow: auto; margin: auto; padding: 22px 20px calc(24px + env(safe-area-inset-bottom)); border: 1px solid var(--line); border-bottom: 0; border-radius: 26px 26px 0 0; background: var(--surface); }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal h2 { margin: 0; font-size: 20px; }
.close { border: 0; background: #d7dde6; border-radius: 50%; width: 36px; height: 36px; cursor: pointer; }
.field { display: grid; gap: 7px; margin: 14px 0; }
.field label { color: #69768b; font-size: 13px; }
.input { width: 100%; border: 1px solid var(--line); background: #f2f4f7; color: var(--text); border-radius: 13px; padding: 13px 14px; outline: none; }
.input:focus { border-color: #526cff; }
textarea.input { resize: vertical; min-height: 84px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.created-note { display:grid; grid-template-columns:1fr auto; gap:3px 12px; padding:12px 14px; border-radius:13px; background:#dce2ea; color:var(--muted); font-size:12px; }
.created-note b { color:var(--text); font-size:13px; }
.created-note small { grid-column:1/-1; color:#98a2b2; }
.primary { width: 100%; border: 0; border-radius: 14px; padding: 14px 18px; background: linear-gradient(90deg,#3049e2,#526cff); font-weight: 700; cursor: pointer; margin-top: 8px; }
.danger { background: rgba(255,109,117,.1); color: var(--danger); }
.detail-wrap { align-items: stretch; background: var(--bg); }
.detail { width: min(100%,680px); height: var(--app-height, 100dvh); min-height:0; margin: auto; display:flex; flex-direction:column; overflow:hidden; }
.detail-header { display: flex; gap: 12px; align-items: center; padding: max(18px,env(safe-area-inset-top)) 18px 16px; border-bottom: 1px solid var(--line); }
.detail-header h2 { flex:1; font-size: 16px; margin:0; }
.messages { flex:1 1 auto; min-height:0; overflow-x:hidden; overflow-y:auto; padding:22px 18px; display:flex; flex-direction:column; gap:12px; overscroll-behavior:contain; -webkit-overflow-scrolling:touch; scroll-behavior:smooth; }
.date-line { text-align:center; color:var(--muted); font-size:12px; margin: 4px 0 8px; }
.bubble { position:relative; max-width: 84%; background: #e9edf3; border:1px solid var(--line); box-shadow:0 5px 18px rgba(46,63,94,.08); border-radius: 16px 16px 16px 5px; padding:12px 13px; line-height:1.4; font-size:14px; transition:.25s; }
.bubble.mine { align-self:flex-end; background:#dbe2fb; border-color:#c4cef2; border-radius:16px 16px 5px 16px; }
.bubble.message-flash { box-shadow:0 0 0 3px rgba(70,99,237,.35),0 8px 25px rgba(46,63,94,.15); transform:scale(1.015); }
.bubble-head { display:flex; align-items:center; gap:5px; min-height:27px; font-size:11px; color:#5369cb; margin-bottom:5px; }
.bubble-head > span:first-child { min-width:0; white-space:nowrap; }
.bubble a { color:#405ad1; overflow-wrap:anywhere; }
.message-actions { display:flex; flex:0 0 auto; gap:3px; margin-left:auto; }
.reply-btn, .forward-btn, .edit-message-btn, .delete-message-btn { display:grid; place-items:center; width:27px; height:27px; padding:0; border:0; border-radius:9px; background:rgba(70,99,237,.08); color:#6d7890; font-size:16px; cursor:pointer; }
.reply-btn:hover, .reply-btn:focus, .forward-btn:hover, .forward-btn:focus, .edit-message-btn:hover, .edit-message-btn:focus { color:var(--text); background:rgba(82,108,255,.18); }
.delete-message-btn { color:#a64a51; background:rgba(190,66,76,.08); }
.message-status { flex:0 0 auto; margin-left:1px; font-size:12px; font-weight:800; letter-spacing:-3px; padding-right:3px; color:#8993a3; }
.message-status.read { color:#287ce5; }
.forwarded-label { margin-bottom:6px; color:#66748a; font-size:11px; font-style:italic; }
.quoted { display:block; width:100%; margin:0 0 8px; padding:7px 9px; border:0; border-left:3px solid #7185ff; border-radius:6px; background:rgba(70,99,237,.07); color:#657188; font:inherit; font-size:12px; line-height:1.35; text-align:left; cursor:pointer; }
.quoted b { display:block; color:#5369cb; margin-bottom:2px; font-size:11px; }
.composer-area { flex:0 0 auto; border-top:1px solid var(--line); background:rgba(225,230,237,.96); padding-bottom:env(safe-area-inset-bottom); }
.reply-preview { display:grid; grid-template-columns:1fr 32px; align-items:center; gap:8px; margin:10px 14px 0; padding:9px 10px 9px 12px; border-left:3px solid #7185ff; border-radius:8px; background:#f0f3fb; font-size:12px; color:#657188; }
.reply-preview b { display:block; color:#5369cb; margin-bottom:2px; }
.reply-preview span { display:block; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.reply-cancel { width:30px; height:30px; border:0; border-radius:9px; background:transparent; color:var(--muted); cursor:pointer; font-size:18px; }
.composer { display:grid; grid-template-columns:44px 1fr 48px; gap:8px; padding:12px 14px; }
.attachment-input { position:absolute; width:1px; height:1px; overflow:hidden; opacity:0; pointer-events:none; }
.attach-btn { display:grid; place-items:center; border:1px solid var(--line); border-radius:14px; background:#d6dde7; color:#44536b; font-size:24px; cursor:pointer; }
.send { border:0; border-radius:14px; background:var(--blue); font-size:20px; cursor:pointer; }
.send:disabled { opacity:.55; cursor:wait; }
.attachment { margin-top:9px; max-width:360px; overflow:hidden; border-radius:12px; }
.attachment img, .attachment video { display:block; width:100%; max-height:300px; object-fit:cover; border-radius:12px; background:#c9d0da; }
.attachment.file a { display:flex; align-items:center; gap:10px; padding:11px; background:rgba(70,99,237,.08); color:var(--text); text-decoration:none; }
.attachment.file a span { flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.attachment.file a b { color:#405ad1; font-size:11px; }
.attachment-loading { display:block; padding:10px; color:var(--muted); background:rgba(70,99,237,.06); font-size:12px; }
.file-preview { display:grid; grid-template-columns:32px 1fr 30px; align-items:center; gap:8px; margin:10px 14px 0; padding:9px 10px; border-radius:10px; background:#d7deea; }
.file-preview b, .file-preview small { display:block; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.file-preview small { color:var(--muted); margin-top:2px; }
.file-preview button { border:0; background:transparent; font-size:18px; color:var(--muted); cursor:pointer; }
.profile-card { padding:20px; border:1px solid var(--line); border-radius:20px; background:var(--surface); margin-bottom:12px; }
.profile-card h3 { margin:0 0 5px; }
.profile-card p { color:var(--muted); margin:0 0 16px; line-height:1.45; }
.switcher { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.person { border:1px solid var(--line); border-radius:14px; background:#dde3eb; padding:13px; cursor:pointer; }
.confirm-wrap { align-items:center; }
.confirm-modal { width:min(calc(100% - 32px),430px); border-radius:24px; border:1px solid var(--line); text-align:center; padding:26px; }
.confirm-modal p { color:var(--muted); line-height:1.45; }
.confirm-icon { display:grid; place-items:center; width:52px; height:52px; margin:0 auto 14px; border-radius:18px; background:rgba(82,173,103,.15); color:#347e45; font-size:25px; font-weight:800; }
.dont-ask { display:flex; gap:8px; align-items:center; justify-content:center; margin:18px 0; color:var(--muted); font-size:12px; }
.confirm-actions { display:grid; grid-template-columns:1fr 1.4fr; gap:10px; }
.confirm-actions .primary { margin:0; }
.forward-modal { width:min(calc(100% - 32px),460px); border:1px solid var(--line); border-radius:24px; }
.forward-preview { display:grid; gap:3px; padding:12px 14px; border-left:3px solid var(--blue); border-radius:9px; background:rgba(70,99,237,.08); color:var(--muted); font-size:13px; }
.forward-preview b { color:#405ad1; }
.person.active { border-color:var(--blue); background:var(--blue-soft); }
.logout-btn { width:100%; color:#a92f39; }
.install-profile { display:grid; grid-template-columns:58px 1fr; gap:12px; align-items:center; }
.install-profile img { width:58px; height:58px; border-radius:15px; }
.install-profile p { margin-bottom:0; }
.install-profile .primary { grid-column:1/-1; }
.apk-profile .primary { display:block; color:white; text-decoration:none; text-align:center; }
.install-modal { width:min(calc(100% - 32px),460px); border:1px solid var(--line); border-radius:24px; }
.install-modal .modal-head > div { display:flex; align-items:center; gap:11px; }
.install-modal .modal-head img { width:46px; height:46px; border-radius:12px; }
.install-modal ol { margin:8px 0 18px; padding-left:24px; color:#4d5a70; line-height:1.55; }
.install-modal li { margin:9px 0; padding-left:4px; }
.install-domain { padding:11px 13px; border-radius:12px; background:rgba(70,99,237,.09); color:#526078; font-size:12px; text-align:center; }
.notice { padding:14px; color:#d3b18d; background:rgba(255,155,81,.08); border:1px solid rgba(255,155,81,.15); border-radius:14px; font-size:13px; line-height:1.45; }
.toast { position:fixed; z-index:50; left:50%; bottom:105px; transform:translateX(-50%); width:max-content; max-width:calc(100% - 32px); background:#eef2f7; color:#111821; border-radius:12px; padding:11px 16px; box-shadow:0 10px 30px #0008; font-size:13px; }
@media (min-width:700px) { .modal-wrap { align-items:center; } .modal { border-radius:26px; border-bottom:1px solid var(--line); } }
@media (max-width:460px) { .brand-logo { width:98px; } .install-short { width:38px; height:38px; justify-content:center; padding:0; font-size:0; } .topbar { gap:8px; } .topbar h1 { font-size:17px; } }
