/* Grand Lines — Command Dashboard (v1). Phone-first, max 480px centred. */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root { --red: #e11d2e; --ink: #1a1d21; --muted: #666; --line: #f0f0f0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; background: #eef1f4; color: var(--ink); }
.wrap { max-width: 480px; margin: 0 auto; padding: 12px 12px 28px; }
.hidden { display: none !important; }
.err { color: #b3261e; font-size: 12px; margin-top: 8px; line-height: 1.5; }
.okmsg { color: #187a33; font-size: 12px; margin-top: 8px; line-height: 1.5; }

/* ---------- header ---------- */
.top { background: linear-gradient(135deg, #14181d 0%, #232a31 100%); color: #fff; border-radius: 16px; padding: 18px 16px 14px; margin-bottom: 12px; position: relative; }
.top .brand { font-size: 12px; letter-spacing: 1.5px; color: var(--red); font-weight: 800; text-transform: uppercase; }
.top h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.3px; margin-top: 2px; }
.top .sub { font-size: 12px; color: #b9c0c8; margin-top: 5px; }
.live { display: inline-flex; align-items: center; gap: 6px; margin-top: 11px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.18); font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 20px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #2fd06b; box-shadow: 0 0 0 3px rgba(47,208,107,0.25); flex-shrink: 0; }
.dot.off { background: #999; box-shadow: 0 0 0 3px rgba(150,150,150,0.25); }
.logout { position: absolute; top: 14px; right: 14px; background: none; border: 1px solid rgba(255,255,255,0.3); color: #cfd6db; font-size: 11px; font-weight: 700; padding: 5px 10px; border-radius: 20px; cursor: pointer; }

/* ---------- stats ---------- */
.strip { display: flex; gap: 8px; margin-bottom: 12px; }
.stat { flex: 1; background: #fff; border-radius: 12px; padding: 11px 6px 9px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.stat b { display: block; font-size: 21px; line-height: 1.1; }
.stat b.red { color: var(--red); }
.stat span { font-size: 11px; color: var(--muted); }

h2 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); margin: 15px 2px 8px; }

/* ---------- chat ---------- */
.chat { background: #ece5dd; border-radius: 14px; padding: 14px 10px 10px; margin-bottom: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.chathead { display: flex; align-items: center; gap: 9px; padding: 0 4px 11px; border-bottom: 1px solid #d8d0c6; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--red); color: #fff; font-weight: 800; font-size: 15px; text-align: center; line-height: 36px; flex-shrink: 0; }
.chathead .nm { font-size: 14px; font-weight: 800; }
.chathead .on { font-size: 11px; color: #187a33; font-weight: 600; }
.chathead .on.off { color: #888; }
.msgs { max-height: 420px; overflow-y: auto; padding: 0 2px; }
.bub { max-width: 85%; padding: 8px 10px 6px; border-radius: 10px; font-size: 13px; line-height: 1.5; margin-top: 9px; box-shadow: 0 1px 1px rgba(0,0,0,0.1); cursor: pointer; word-wrap: break-word; overflow-wrap: anywhere; }
.bub.left { background: #fff; margin-right: auto; border-top-left-radius: 2px; }
.bub.right { background: #d9fdd3; margin-left: auto; border-top-right-radius: 2px; }
.bub .tm { font-size: 10px; color: #888; text-align: right; margin-top: 3px; }
.bub .tm .tk { color: #53bdeb; font-weight: 700; }
.bub .tm .tk.grey { color: #999; }
.quote { background: rgba(0,0,0,0.06); border-left: 3px solid var(--red); border-radius: 5px; padding: 6px 8px; margin-bottom: 6px; font-size: 12px; color: #555; }
.quote b { display: block; font-size: 11px; color: var(--red); }
.voice { display: flex; align-items: center; gap: 8px; }
.voice audio { height: 32px; max-width: 170px; }
.attachimg { max-width: 100%; border-radius: 8px; display: block; margin-bottom: 4px; }
.filelink { color: #1a5fc0; font-weight: 700; text-decoration: none; font-size: 12px; }
.kindtag { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; color: #8a6400; background: #fff3d6; padding: 2px 7px; border-radius: 10px; margin-bottom: 5px; }
.kindtag.rev { color: #187a33; background: #e3f6e8; }
.emptychat { text-align: center; font-size: 12px; color: #888; padding: 18px 8px; line-height: 1.6; }

/* quote bar above the input */
.quotebar { display: flex; align-items: center; gap: 8px; background: #fff; border-left: 3px solid var(--red); border-radius: 8px; padding: 8px 10px; margin-top: 10px; font-size: 12px; color: #555; }
.quotebar .qt { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quotebar button { background: none; border: none; font-size: 16px; color: #888; cursor: pointer; padding: 0 4px; }
.attachbar { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 8px; padding: 8px 10px; margin-top: 8px; font-size: 12px; color: #333; }
.attachbar .at { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachbar button { background: none; border: none; font-size: 16px; color: #888; cursor: pointer; padding: 0 4px; }

.inputbar { display: flex; align-items: center; gap: 7px; margin-top: 10px; background: #fff; border-radius: 24px; padding: 6px 6px 6px 12px; }
.inputbar .ic { font-size: 19px; color: #8696a0; background: none; border: none; cursor: pointer; padding: 4px; line-height: 1; }
.inputbar .ic.rec { color: var(--red); }
.msginput { flex: 1; border: none; outline: none; font-size: 14px; font-family: inherit; resize: none; max-height: 96px; background: transparent; }
.sendbtn { width: 38px; height: 38px; border-radius: 50%; background: #00a884; color: #fff; text-align: center; line-height: 38px; font-size: 17px; flex-shrink: 0; border: none; cursor: pointer; }
.sendbtn:disabled { background: #b9c4c9; cursor: default; }
.recbar { display: flex; align-items: center; gap: 10px; margin-top: 10px; background: #fff; border-radius: 24px; padding: 10px 14px; font-size: 13px; font-weight: 700; color: var(--red); }
.recdot { width: 11px; height: 11px; border-radius: 50%; background: var(--red); animation: pulse 1s infinite; flex-shrink: 0; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
.recbar button { margin-left: auto; background: var(--red); color: #fff; border: none; border-radius: 20px; padding: 7px 14px; font-size: 12px; font-weight: 800; cursor: pointer; }
.recbar .cancel { background: #eee; color: #555; }
.emojipop { background: #fff; border-radius: 12px; padding: 10px; margin-top: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.12); }
.emojipop span { font-size: 22px; cursor: pointer; padding: 4px; display: inline-block; }
.chatnote { font-size: 11px; color: #777; text-align: center; margin-top: 9px; line-height: 1.5; }

/* ---------- account cards ---------- */
.card { background: #fff; border-radius: 14px; padding: 13px 14px; margin-bottom: 9px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.card .head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.card .name { font-size: 14px; font-weight: 800; display: flex; align-items: center; gap: 7px; }
.card .role { font-size: 12px; color: var(--muted); margin-top: 2px; }
.pill { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.ok { background: #e3f6e8; color: #187a33; }
.work { background: #fff3d6; color: #8a6400; }
.warn { background: #fde8e8; color: #b3261e; }
.idle { background: #eceff1; color: #666; }
.bar { height: 6px; background: #eef1f4; border-radius: 4px; margin-top: 9px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 4px; background: #2fae5f; }
.bar i.amber { background: #e8a100; }
.bar i.redbar { background: var(--red); }
.barlab { display: flex; justify-content: space-between; font-size: 11px; color: #888; margin-top: 4px; }
.task { font-size: 12px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); line-height: 1.5; color: #333; }
.trow { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.4; }
.trow .tid { font-size: 11px; font-weight: 800; color: var(--red); white-space: nowrap; }
.trow .proof { font-size: 11px; font-weight: 700; color: #1a5fc0; text-decoration: none; white-space: nowrap; }
.meta { font-size: 11px; color: #888; margin-top: 7px; }

/* ---------- questions / reviews ---------- */
.q { background: #fff8e1; border: 1px solid #f5d97e; }
.qitem { padding: 9px 0; border-top: 1px solid #f0e2ae; font-size: 13px; line-height: 1.55; }
.qitem:first-of-type { border-top: none; }
.qitem .qt { font-weight: 700; }
.qopts { display: flex; gap: 7px; margin-top: 8px; flex-wrap: wrap; }
.qopt { background: #fff; border: 1px solid #e0c95e; border-radius: 20px; padding: 7px 12px; font-size: 12px; font-weight: 700; color: #5a4a00; cursor: pointer; }
.qopt:active { background: #f5d97e; }
.rev { background: #eef7ff; border: 1px solid #bcd8f5; }
.btns { display: flex; gap: 8px; margin-top: 11px; }
.btn { flex: 1; text-align: center; font-size: 12px; font-weight: 700; padding: 9px 0; border-radius: 9px; border: none; cursor: pointer; }
.btn.go { background: var(--red); color: #fff; }
.btn.green { background: #2fae5f; color: #fff; }
.btn.later { background: #fff; color: #555; border: 1px solid #e0e0e0; }
.allclear { font-size: 12px; color: #187a33; text-align: center; padding: 10px; }

/* ---------- health / footer ---------- */
.health { display: flex; gap: 8px; }
.h { flex: 1; background: #fff; border-radius: 12px; padding: 10px 8px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,0.08); font-size: 11px; color: #555; }
.h b { display: block; font-size: 12px; color: #187a33; margin-bottom: 2px; }
.h b.bad { color: #b3261e; }
.foot { text-align: center; font-size: 11px; color: #999; margin: 14px 0 4px; line-height: 1.6; }
.installbtn { display: inline-block; margin-top: 8px; background: #14181d; color: #fff; border: none; border-radius: 20px; padding: 8px 16px; font-size: 12px; font-weight: 700; cursor: pointer; }

/* ---------- login / setup / reset screens ---------- */
.loginscreen { min-height: 100vh; background: #14181d; color: #fff; display: flex; flex-direction: column; justify-content: center; padding: 16px; }
.loginwrap { max-width: 400px; margin: 0 auto; width: 100%; text-align: center; }
.loginwrap .brand { font-size: 13px; letter-spacing: 2px; color: var(--red); font-weight: 800; text-transform: uppercase; }
.loginwrap h1 { font-size: 28px; font-weight: 800; margin-top: 6px; }
.loginwrap .sub { font-size: 13px; color: #9aa3ab; margin-top: 6px; }
.loginbox { background: #1f262d; border: 1px solid #2c343c; border-radius: 16px; padding: 20px 16px; margin-top: 26px; text-align: left; }
.loginbox .lab { font-size: 12px; font-weight: 700; color: #b9c0c8; text-transform: uppercase; letter-spacing: 0.6px; margin-top: 12px; }
.loginbox .lab:first-child { margin-top: 0; }
.loginbox input { width: 100%; margin-top: 8px; background: #14181d; border: 1px solid #333c44; border-radius: 10px; padding: 13px 12px; font-size: 16px; color: #fff; outline: none; font-family: inherit; }
.loginbox input:focus { border-color: var(--red); }
.loginbtn { width: 100%; margin-top: 16px; background: var(--red); color: #fff; text-align: center; font-size: 15px; font-weight: 800; padding: 13px 0; border-radius: 10px; border: none; cursor: pointer; }
.loginbtn:disabled { background: #7a1d24; cursor: default; }
.loginlinks { display: flex; justify-content: space-between; margin-top: 14px; font-size: 12px; }
.loginlinks a { color: #7fb3ff; text-decoration: none; font-weight: 600; cursor: pointer; }
.loginlinks a.single { margin-left: auto; }
.loginnote { margin-top: 22px; font-size: 11px; color: #77828b; line-height: 1.6; text-align: center; }
