:root {
  --slate: #212b30; --slate-2: #2d3a40; --slate-3: #3b4a51;
  --orange: #e39a28; --orange-d: #c7811a; --orange-soft: #fdf3e3;
  --bg: #f2f3f4; --card: #fff; --text: #1b2327; --muted: #67757b; --line: #e4e7e9;
  --safety: #c8423b; --company: #35668f; --production: #1f7f69; --voice: #c7811a; --social: #7356c4;
  --radius: 16px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); color: var(--text); background: var(--bg); font-size: 16px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
.ic { flex: none; display: block; }
[hidden] { display: none !important; }

/* ---- Device frame: full screen on phones, framed on desktop ------------- */
.device { height: 100%; }
.phone { position: relative; height: 100%; overflow: hidden; background: var(--bg); display: flex; flex-direction: column; }
.statusbar { display: none; }
@media (min-width: 560px) {
  body { background: radial-gradient(circle at 30% 20%, #3b4a51, #161d21 70%); }
  .device { display: grid; place-items: center; min-height: 100%; padding: 28px 0; }
  .phone { width: 390px; height: min(844px, calc(100vh - 56px)); border-radius: 46px; border: 10px solid #0d1215; box-shadow: 0 30px 80px rgba(0,0,0,.55), 0 0 0 2px #3a464c; }
  .statusbar { display: flex; justify-content: space-between; align-items: center; height: 34px; padding: 0 26px; font-size: 14px; font-weight: 600; background: var(--slate); color: #fff; flex: none; }
  .phone.light-top .statusbar { background: var(--bg); color: var(--text); }
  .sb-icons { display: flex; gap: 4px; align-items: flex-end; }
  .sb-icons i { display: block; width: 4px; background: currentColor; border-radius: 1px; }
  .sb-icons i:nth-child(1) { height: 6px; } .sb-icons i:nth-child(2) { height: 9px; } .sb-icons i:nth-child(3) { height: 12px; }
}
.screen { flex: 1; min-height: 0; min-width: 0; display: flex; flex-direction: column; position: relative; }
.scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.scroll::-webkit-scrollbar { width: 0; }

/* ---- Buttons ------------------------------------------------------------ */
.btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 54px; border-radius: 14px; font-weight: 600; font-size: 17px; padding: 0 18px; transition: transform .08s, background .15s; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:active { background: var(--orange-d); }
.btn-dark { background: var(--slate); color: #fff; }
.btn-light { background: #fff; color: var(--text); border: 1px solid var(--line); }
.btn-ghost { background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.25); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.link { color: var(--orange-d); font-weight: 600; }

/* ---- Auth screens ------------------------------------------------------- */
.auth { flex: 1; display: flex; flex-direction: column; background: var(--slate); color: #fff; padding: 0 26px 30px; }
.auth-top { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 18px; }
.auth-logo { width: 220px; }
.wordmark { font-size: 15px; letter-spacing: .32em; text-transform: uppercase; color: var(--orange); font-weight: 700; }
.auth h1 { margin: 0; font-size: 26px; font-weight: 600; }
.auth .sub { color: #b7c1c5; margin: 0; font-size: 15px; }
.auth-actions { display: grid; gap: 12px; }
.ms-logo { display: grid; grid-template-columns: 9px 9px; gap: 2px; }
.ms-logo i { width: 9px; height: 9px; display: block; }
.ms-logo i:nth-child(1) { background: #f25022; } .ms-logo i:nth-child(2) { background: #7fba00; }
.ms-logo i:nth-child(3) { background: #00a4ef; } .ms-logo i:nth-child(4) { background: #ffb900; }
.back-btn { display: flex; align-items: center; gap: 4px; height: 52px; color: inherit; font-weight: 600; margin-left: -6px; }
.auth-form { flex: 1; display: flex; flex-direction: column; gap: 16px; padding-top: 10px; }
.auth-form h1 { font-size: 26px; }
.phone-input { display: flex; align-items: center; background: #fff; color: var(--text); border-radius: 14px; height: 60px; padding: 0 16px; gap: 10px; font-size: 22px; }
.phone-input span { color: var(--muted); font-weight: 600; }
.phone-input input { border: 0; outline: 0; flex: 1; font-size: 22px; letter-spacing: .04em; min-width: 0; background: none; }
.otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.otp input { height: 62px; text-align: center; font-size: 26px; font-weight: 700; border-radius: 12px; border: 0; background: #fff; color: var(--text); outline: 0; min-width: 0; }
.otp input.filled { box-shadow: inset 0 0 0 2px var(--orange); }
.muted-light { color: #b7c1c5; font-size: 15px; }
.spinner { width: 22px; height: 22px; border: 3px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Microsoft account sheet */
.sheet-bg { position: absolute; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; z-index: 20; animation: fade .2s; }
.sheet { background: #fff; color: #1b1b1b; width: 100%; border-radius: 20px 20px 0 0; padding: 24px 22px 30px; animation: up .25s ease-out; }
.sheet h2 { font-size: 21px; margin: 14px 0 16px; font-weight: 600; }
.ms-brand { display: flex; align-items: center; gap: 8px; font-weight: 600; color: #5e5e5e; }
.acct { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 4px; border-top: 1px solid #eee; text-align: left; }
.acct:last-child { border-bottom: 1px solid #eee; }
.acct small { display: block; color: #666; font-size: 13px; }
@keyframes up { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }

/* ---- Profile setup ------------------------------------------------------ */
.setup { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--bg); }
.setup-head { padding: 20px 22px 6px; }
.setup-head h1 { margin: 0; font-size: 24px; }
.steps { display: flex; gap: 6px; margin-bottom: 14px; }
.steps i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.steps i.on { background: var(--orange); }
.form { padding: 10px 22px 20px; display: grid; gap: 14px; }
.photo-pick { display: flex; align-items: center; gap: 14px; }
.avatar { width: 72px; height: 72px; border-radius: 50%; background: var(--slate); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 24px; overflow: hidden; flex: none; background-size: cover; background-position: center; }
.avatar.sm { width: 44px; height: 44px; font-size: 16px; }
.avatar.md { width: 56px; height: 56px; font-size: 19px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: var(--muted); }
.field input, .field select { width: 100%; height: 52px; border-radius: 12px; border: 1px solid var(--line); background: #fff; padding: 0 14px; font-size: 17px; outline: 0; appearance: none; -webkit-appearance: none; }
.field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2367757b' stroke-width='2.4'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.field input:focus, .field select:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(227,154,40,.18); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.setup-foot { padding: 12px 22px 22px; background: var(--bg); border-top: 1px solid var(--line); }

/* ---- Main shell --------------------------------------------------------- */
.topbar { background: var(--slate); color: #fff; padding: 12px 18px 16px; flex: none; }
.topbar-row { display: flex; align-items: center; justify-content: space-between; }
.topbar img { height: 34px; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; position: relative; color: inherit; }
.icon-btn .dot { position: absolute; top: 7px; right: 7px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--orange); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
.greet { margin-top: 14px; }
.greet h1 { margin: 0; font-size: 23px; font-weight: 600; }
.greet p { margin: 2px 0 0; color: #b7c1c5; font-size: 14px; }
.page-title { font-size: 24px; font-weight: 700; margin: 6px 0 0; }
.tabbar { flex: none; display: grid; grid-template-columns: repeat(5, 1fr); background: #fff; border-top: 1px solid var(--line); padding: 6px 4px calc(8px + env(safe-area-inset-bottom)); }
.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; color: #8a969b; padding: 6px 0; position: relative; }
.tab.on { color: var(--slate); }
.tab.on .ic { color: var(--orange); }
.tab .dot { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 17px; height: 17px; border-radius: 9px; background: var(--orange); color: #fff; font-size: 10px; display: grid; place-items: center; padding: 0 4px; }

.section { padding: 18px 16px 0; }
.section:last-child { padding-bottom: 24px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin: 0 2px 10px; }
.section-head h2 { margin: 0; font-size: 18px; }

/* Action card */
.action { background: var(--orange-soft); border: 1px solid #f3d7a8; border-radius: var(--radius); padding: 16px; display: grid; gap: 12px; }
.action-top { display: flex; gap: 12px; align-items: flex-start; }
.action-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--safety); color: #fff; display: grid; place-items: center; flex: none; }
.action h3 { margin: 0; font-size: 17px; }
.action p { margin: 3px 0 0; font-size: 14px; color: #6b5a3e; }
.action .btn { min-height: 48px; font-size: 16px; }

/* Message cards */
.card { background: var(--card); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(16,24,28,.06); overflow: hidden; }
.feed { display: grid; gap: 12px; }
.post { display: block; width: 100%; text-align: left; }
.post-media { position: relative; aspect-ratio: 16/9; background: #ddd; }
.post-media .art { width: 100%; height: 100%; display: block; }
.post-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.play { position: absolute; inset: 0; margin: auto; width: 58px; height: 58px; border-radius: 50%; background: rgba(255,255,255,.95); color: var(--slate); display: grid; place-items: center; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.play .ic { margin-left: 3px; }
.badge-dur { position: absolute; right: 10px; bottom: 10px; background: rgba(0,0,0,.65); color: #fff; font-size: 12px; font-weight: 600; padding: 3px 7px; border-radius: 6px; }
.post-body { padding: 14px 16px 16px; }
.post-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.post h3 { margin: 0; font-size: 17px; line-height: 1.3; }
.post p { margin: 6px 0 0; font-size: 15px; color: #4a575d; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cat { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.cat-Safety { color: var(--safety); } .cat-Company { color: var(--company); } .cat-Production { color: var(--production); }
.cat-Voice { color: var(--voice); } .cat-Social { color: var(--social); }
.unread-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--orange); flex: none; }
.attach { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin: 12px 0 0; background: var(--bg); border-radius: 12px; font-size: 14px; font-weight: 600; }
.attach .file-ic { width: 38px; height: 46px; border-radius: 6px; background: #fff; color: var(--safety); display: grid; place-items: center; border: 1px solid var(--line); flex: none; }
.attach small { display: block; font-weight: 400; color: var(--muted); }

/* Inbox list */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px 4px; scrollbar-width: none; flex: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 38px; padding: 0 15px; border-radius: 19px; background: #fff; border: 1px solid var(--line); font-size: 14px; font-weight: 600; color: var(--muted); }
.chip.on { background: var(--slate); color: #fff; border-color: var(--slate); }
.list { padding: 8px 16px 20px; display: grid; gap: 10px; }
.item { display: flex; gap: 12px; align-items: center; background: #fff; border-radius: 14px; padding: 14px; width: 100%; text-align: left; box-shadow: 0 1px 2px rgba(16,24,28,.05); }
.item-ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex: none; color: #fff; }
.bg-Safety { background: var(--safety); } .bg-Company { background: var(--company); } .bg-Production { background: var(--production); }
.bg-Voice { background: var(--voice); } .bg-Social { background: var(--social); }
.item-main { flex: 1; min-width: 0; }
.item-main h3 { margin: 0; font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item.unread h3 { font-weight: 700; }
.item-main p { margin: 2px 0 0; font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.tag-ack { font-size: 11px; font-weight: 700; color: var(--safety); background: #fbe9e7; padding: 2px 6px; border-radius: 5px; }
.tag-done { font-size: 11px; font-weight: 700; color: var(--production); background: #e3f3ee; padding: 2px 6px; border-radius: 5px; }
.empty { text-align: center; color: var(--muted); padding: 50px 20px; }

/* Celebrations */
.hscroll { display: flex; gap: 10px; overflow-x: auto; padding: 0 16px 4px; margin: 0 -16px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.celebrate { flex: none; width: 150px; background: #fff; border-radius: var(--radius); padding: 14px 12px; text-align: center; box-shadow: 0 1px 2px rgba(16,24,28,.06); }
.celebrate .avatar { margin: 0 auto 8px; }
.celebrate h4 { margin: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.celebrate p { margin: 2px 0 10px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.celebrate .why { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; font-weight: 700; color: var(--orange-d); margin-bottom: 10px; }
.wish { width: 100%; height: 36px; border-radius: 10px; background: var(--orange-soft); color: var(--orange-d); font-weight: 700; font-size: 13px; }
.wish.sent { background: #e3f3ee; color: var(--production); }

/* About tabs */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); background: #e6e9eb; border-radius: 12px; padding: 4px; margin-bottom: 12px; }
.seg button { height: 38px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--muted); }
.seg button.on { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.about { padding: 18px; }
.about p { margin: 0 0 10px; line-height: 1.55; color: #3d494e; font-size: 15px; }
.about p:last-child { margin-bottom: 0; }
.addr { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); padding-top: 10px; border-top: 1px solid var(--line); margin-top: 12px; }
.org { display: grid; gap: 8px; }
.org-node { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.org-node.root { background: var(--slate); color: #fff; border-color: var(--slate); }
.org-node h4 { margin: 0; font-size: 15px; display: flex; justify-content: space-between; align-items: center; }
.org-node small { color: var(--muted); font-size: 12px; }
.org-node.root small { color: #b7c1c5; }
.org-sites { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.org-sites span { font-size: 12px; background: var(--bg); padding: 4px 8px; border-radius: 6px; font-weight: 600; }
.leader { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.leader:last-child { border-bottom: 0; }
.leader h4 { margin: 0; font-size: 15px; }
.leader small { color: var(--muted); }

/* Library */
.searchbox { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.12); border-radius: 12px; padding: 0 12px; height: 46px; margin-top: 12px; }
.searchbox input { flex: 1; border: 0; outline: 0; background: none; color: #fff; font-size: 16px; min-width: 0; }
.searchbox input::placeholder { color: #9aa7ac; }

/* Me */
.me-card { background: #fff; border-radius: var(--radius); padding: 18px; display: flex; gap: 14px; align-items: center; }
.me-card h2 { margin: 0; font-size: 19px; }
.me-card p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.menu { background: #fff; border-radius: var(--radius); overflow: hidden; }
.menu-row { display: flex; align-items: center; gap: 14px; padding: 0 16px; min-height: 58px; width: 100%; text-align: left; border-bottom: 1px solid var(--line); font-size: 16px; }
.menu-row:last-child { border-bottom: 0; }
.menu-row .val { margin-left: auto; color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 4px; }
.menu-row .ic { color: var(--muted); }
.menu-row.danger { color: var(--safety); }
.menu-row.danger .ic { color: var(--safety); }
.switch { margin-left: auto; width: 48px; height: 28px; border-radius: 14px; background: #cfd5d8; position: relative; transition: background .15s; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch.on { background: var(--production); }
.switch.on::after { transform: translateX(20px); }

/* ---- Detail overlay ----------------------------------------------------- */
.overlay { position: absolute; inset: 0; z-index: 10; background: var(--bg); display: flex; flex-direction: column; animation: slide .22s ease-out; }
.phone .overlay { top: 0; }
@media (min-width: 560px) { .phone .overlay { top: 34px; } }
@keyframes slide { from { transform: translateX(30%); opacity: 0; } }
.detail-bar { display: flex; align-items: center; gap: 6px; padding: 6px 8px; background: #fff; border-bottom: 1px solid var(--line); flex: none; }
.detail-bar span { font-weight: 600; font-size: 15px; color: var(--muted); }
.detail { padding: 18px 18px 24px; }
.detail h1 { font-size: 24px; margin: 8px 0 6px; line-height: 1.25; }
.detail .by { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.detail .body { font-size: 17px; line-height: 1.6; color: #2b373c; margin: 16px 0 0; }
.media-box { border-radius: var(--radius); overflow: hidden; background: #000; position: relative; }
.media-box .art { width: 100%; display: block; aspect-ratio: 16/9; }
.media-box img { width: 100%; display: block; }
.player { background: #10171a; padding: 10px 14px 12px; color: #fff; display: flex; align-items: center; gap: 12px; font-size: 13px; font-variant-numeric: tabular-nums; }
.player .bar { flex: 1; height: 5px; background: rgba(255,255,255,.2); border-radius: 3px; overflow: hidden; }
.player .bar i { display: block; height: 100%; width: 0; background: var(--orange); }
.player button { color: #fff; }
.pdf-pages { display: grid; gap: 12px; }
.pdf-page { background: #fff; border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,.08); aspect-ratio: 1/1.32; padding: 22px 20px; position: relative; overflow: hidden; }
.pdf-page img { height: 18px; margin-bottom: 18px; }
.pdf-page .ln { height: 7px; background: #e6e9eb; border-radius: 4px; margin-bottom: 9px; }
.pdf-page .pg { position: absolute; bottom: 10px; right: 14px; font-size: 11px; color: var(--muted); }
.pdf-page .art { border-radius: 6px; margin: 10px 0 14px; width: 100%; aspect-ratio: 16/9; }
.poll { display: grid; gap: 10px; margin-top: 18px; }
.opt { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; min-height: 56px; padding: 0 16px; border-radius: 14px; background: #fff; border: 1.5px solid var(--line); font-weight: 600; font-size: 16px; text-align: left; width: 100%; }
.opt .fill { position: absolute; inset: 0 auto 0 0; background: var(--orange-soft); transition: width .5s; }
.opt span { position: relative; }
.opt.mine { border-color: var(--orange); }
.poll-note { font-size: 14px; color: var(--muted); margin-top: 4px; }
.ack-bar { flex: none; padding: 12px 18px 18px; background: #fff; border-top: 1px solid var(--line); }
.ack-done { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--production); font-weight: 700; min-height: 54px; }

/* ---- Notification banner & toast --------------------------------------- */
.banner { position: absolute; top: 8px; left: 8px; right: 8px; z-index: 30; background: rgba(250,250,250,.97); backdrop-filter: blur(10px); border-radius: 18px; padding: 12px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25); display: flex; gap: 12px; align-items: center; text-align: left; animation: drop .35s cubic-bezier(.2,.9,.3,1.2); width: calc(100% - 16px); }
@media (min-width: 560px) { .banner { top: 40px; } }
@keyframes drop { from { transform: translateY(-140%); } }
.banner img { width: 38px; height: 38px; border-radius: 9px; flex: none; }
.banner b { display: block; font-size: 14px; }
.banner small { display: block; font-size: 12px; color: var(--muted); }
.banner p { margin: 1px 0 0; font-size: 14px; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.banner > div { min-width: 0; flex: 1; }
.toast { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); background: var(--slate); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; z-index: 40; white-space: nowrap; animation: fade .2s; display: flex; align-items: center; gap: 8px; }
.list, .feed { grid-template-columns: minmax(0, 1fr); }
#tab { overflow: hidden; }

/* ---- Home: hero ---------------------------------------------------------- */
.hero { position: relative; overflow: hidden; flex: none; color: #fff; padding: 12px 18px 44px;
  background: radial-gradient(120% 90% at 100% 0%, rgba(227,154,40,.28), transparent 55%), linear-gradient(160deg, #2d3a40 0%, #1b2327 100%); }
.hero::after { content: ""; position: absolute; right: -60px; bottom: -90px; width: 220px; height: 220px; border-radius: 50%; border: 26px solid rgba(227,154,40,.12); pointer-events: none; }
.hero-top { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }
.hero-top img { height: 32px; }
.hero-greet { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: 16px; position: relative; z-index: 1; }
.hero-greet h1 { margin: 2px 0 4px; font-size: 24px; font-weight: 700; line-height: 1.2; }
.hero-date { margin: 0; font-size: 13px; color: #e8b86b; font-weight: 600; letter-spacing: .02em; }
.hero-site { margin: 0; font-size: 14px; color: #c3cdd1; display: flex; align-items: center; gap: 5px; }
.avatar.ring { box-shadow: 0 0 0 3px #e39a28, 0 0 0 5px rgba(255,255,255,.15); }
.home .section:first-child { padding-top: 0; }
.lift { margin-top: -30px; position: relative; z-index: 2; }
.kicker { display: block; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--safety); }
.action { box-shadow: 0 8px 24px rgba(16,24,28,.12); }

/* Pillars */
.pillars { display: grid; grid-template-columns: repeat(5, 1fr); padding: 14px 6px 12px; box-shadow: 0 8px 24px rgba(16,24,28,.08); }
.pillar { display: flex; flex-direction: column; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: #3d494e; }
.pillar-ic { position: relative; width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center; color: #fff; box-shadow: 0 4px 10px rgba(16,24,28,.15); }
.pillar-ic b { position: absolute; top: -5px; right: -6px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--orange); border: 2px solid #fff; font-size: 11px; display: grid; place-items: center; padding: 0 4px; }
.bg-Safety { background: linear-gradient(145deg, #dd5a52, #b5352f); } .bg-Company { background: linear-gradient(145deg, #4a82ad, #2c5778); }
.bg-Production { background: linear-gradient(145deg, #2c9a80, #18684f); } .bg-Voice { background: linear-gradient(145deg, #eba94a, #c4801b); }
.bg-Social { background: linear-gradient(145deg, #8a6fd6, #6046ad); }

/* Featured */
.featured { position: relative; display: block; width: 100%; aspect-ratio: 16/10; border-radius: 20px; overflow: hidden; text-align: left; box-shadow: 0 10px 26px rgba(16,24,28,.18); }
.featured .art, .featured img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.featured-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(10,14,16,.85) 100%); }
.featured .play { top: -30px; }
.featured-text { position: absolute; left: 16px; right: 16px; bottom: 14px; color: #fff; display: grid; gap: 6px; justify-items: start; }
.featured-text b { font-size: 19px; line-height: 1.25; }
.chip-cat { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 6px; color: #fff; text-transform: uppercase; letter-spacing: .04em; }
.featured-cta { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: #f3c784; }

/* Quick actions */
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quick-tile { background: #fff; border-radius: 16px; padding: 14px 8px; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; text-align: center; line-height: 1.25; box-shadow: 0 1px 2px rgba(16,24,28,.06); }
.quick-ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; }
.soft-Voice { background: #fdf0dc; color: var(--orange-d); } .soft-Social { background: #eee9fb; color: var(--social); } .soft-Company { background: #e6eef6; color: var(--company); }
.list.flush { padding: 0; }

/* Cards */
.card.pad { padding: 16px; }
.card.block { display: block; width: 100%; text-align: left; }
.card-title { margin: 0 0 4px; font-size: 16px; }
.meta-line { margin: 2px 0 0; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; }
.muted { color: var(--muted); }
.small { font-size: 13px; margin-top: 8px; }

/* Production ring */
.prod { display: flex; align-items: center; gap: 16px; }
.prod-fig { display: grid; gap: 3px; font-size: 14px; }
.prod-fig small { color: var(--muted); font-weight: 600; }
.prod-fig b { font-size: 22px; }
.tag-warn { font-size: 11px; font-weight: 700; color: var(--orange-d); background: var(--orange-soft); padding: 3px 7px; border-radius: 5px; justify-self: start; }
.prod .tag-done { justify-self: start; }

/* Events */
.event-row { display: flex; gap: 14px; align-items: center; cursor: pointer; }
.dateblock { width: 60px; flex: none; border-radius: 14px; background: var(--slate); color: #fff; text-align: center; padding: 8px 0; display: grid; }
.dateblock b { font-size: 24px; line-height: 1.1; }
.dateblock small { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #e8b86b; font-weight: 700; }
.rsvp { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.rsvp .btn { min-height: 46px; font-size: 15px; }
.rsvp-done { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 12px 14px; border-radius: 12px; font-weight: 700; }
.rsvp-done.yes { background: #e3f3ee; color: var(--production); }
.rsvp-done.no { background: #eef0f1; color: var(--muted); }
.rsvp-done .link { margin-left: auto; font-size: 14px; }

/* Celebrations */
.celebrate { position: relative; overflow: hidden; }
.celebrate.bday { background: linear-gradient(170deg, #fff4e2 0%, #fff 55%); }
.celebrate.anniv { background: linear-gradient(170deg, #ece8fa 0%, #fff 55%); }
.celebrate.anniv .why { color: var(--social); }
.celebrate .avatar { box-shadow: 0 0 0 3px #fff, 0 4px 10px rgba(0,0,0,.12); }

/* Shout-outs */
.shout { padding: 14px 16px; }
.shout-top { display: flex; align-items: center; gap: 12px; }
.duo { display: flex; flex: none; }
.duo .avatar + .avatar { margin-left: -12px; box-shadow: 0 0 0 2px #fff; background: var(--orange); }
.shout-names { font-size: 14px; min-width: 0; }
.shout-names small { display: block; color: var(--muted); font-size: 12px; }
.value-badge { display: inline-flex; align-items: center; gap: 5px; margin-top: 10px; font-size: 12px; font-weight: 700; color: var(--social); background: #eee9fb; padding: 4px 9px; border-radius: 20px; }
.shout p { margin: 8px 0 0; font-size: 15px; line-height: 1.45; color: #2f3b40; }
.shout-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; font-size: 13px; }
.clap { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 20px; background: var(--bg); font-weight: 700; color: var(--muted); }
.clap.on { background: #fde8e7; color: var(--safety); }
.clap.on .ic { fill: currentColor; }
.tag-wait { font-size: 11px; font-weight: 700; color: var(--company); background: #e6eef6; padding: 3px 7px; border-radius: 5px; }

/* Ask */
.topics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.topic { background: #fff; border-radius: 16px; padding: 14px; text-align: left; display: grid; gap: 4px; border: 2px solid transparent; box-shadow: 0 1px 2px rgba(16,24,28,.06); }
.topic.on { border-color: var(--orange); background: var(--orange-soft); }
.topic-ic { width: 38px; height: 38px; border-radius: 12px; background: var(--bg); display: grid; place-items: center; color: var(--slate); margin-bottom: 4px; }
.topic.on .topic-ic { background: var(--orange); color: #fff; }
.topic b { font-size: 15px; }
.topic small { color: var(--muted); font-size: 12px; }
.ask-box { margin-top: 12px; display: grid; gap: 12px; }
.ask-to { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.ask-to b { color: var(--text); }
textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font: inherit; font-size: 16px; resize: none; outline: 0; background: #fff; }
textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(227,154,40,.18); }
.q-top { display: flex; justify-content: space-between; align-items: center; }
.topic-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--muted); }
.q-text { margin: 8px 0 0; font-size: 16px; font-weight: 600; line-height: 1.4; }
.reply { margin-top: 10px; background: var(--bg); border-radius: 12px; padding: 10px 12px; font-size: 14px; line-height: 1.5; color: #2f3b40; border-left: 3px solid var(--production); }
.reply-by { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--production); margin-bottom: 4px; }

/* People and sheets */
.people-search { padding: 12px 16px 0; }
.searchbox.light { background: #fff; border: 1px solid var(--line); margin-top: 0; }
.searchbox.light input { color: var(--text); }
.searchbox.light input::placeholder { color: #8a969b; }
.item .avatar.sm { flex: none; }
.app-sheet { position: relative; max-height: 88%; overflow-y: auto; display: grid; gap: 14px; padding-top: 30px; }
.grab { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); width: 40px; height: 5px; border-radius: 3px; background: #d5dadd; }
.sheet-title { margin: 0; font-size: 20px; }
.person { text-align: center; display: grid; justify-items: center; gap: 2px; }
.person h2 { margin: 8px 0 0; font-size: 20px; }
.person p { margin: 0; color: var(--muted); }
.avatar.lg { width: 84px; height: 84px; font-size: 28px; }
.menu.flat { border: 1px solid var(--line); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.to-picked { display: flex; align-items: center; gap: 12px; background: var(--bg); border-radius: 12px; padding: 10px 12px; }
.to-picked small { display: block; color: var(--muted); font-size: 12px; }
.to-picked .link { margin-left: auto; }
.sugg { display: grid; gap: 6px; }
.sugg .item { padding: 10px; box-shadow: none; border: 1px solid var(--line); }
.values { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.value { display: flex; align-items: center; gap: 8px; padding: 12px; border-radius: 12px; border: 1.5px solid var(--line); font-weight: 600; font-size: 14px; }
.value.on { border-color: var(--social); background: #eee9fb; color: var(--social); }
.tab { font-size: 11px; }

/* ---- One colour per pillar / topic / value (set inline as --c) --------- */
.cat-pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 14px; font-size: 13px; font-weight: 700; color: var(--c); background: color-mix(in srgb, var(--c) 13%, #fff); }
.detail h1 { margin: 12px 0 6px; }
.detail .media-box { margin-top: 4px; }
.detail .body { white-space: pre-line; }

/* Topics in Ask */
.topic-ic { background: color-mix(in srgb, var(--c) 13%, #fff); color: var(--c); }
.topic.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 7%, #fff); }
.topic.on .topic-ic { background: var(--c); color: #fff; }
.topic { border-top: 3px solid var(--c); }
.topic.on { border-top-width: 3px; }
.ask-box { border: 1.5px solid color-mix(in srgb, var(--c) 40%, #fff); }
.ask-to .ic { color: var(--c); }
.topic-chip { color: var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); padding: 3px 8px; border-radius: 12px; }
.value-badge { color: var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); }
.value .ic { color: var(--c); }
.value.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 10%, #fff); color: var(--c); }

/* Media inside the message */
.media-box { border-radius: 18px; }
.media-box.tap { display: block; width: 100%; padding: 0; position: relative; }
.media-box img, .media-box .art { width: 100%; display: block; }
.media-box.video { background: #000; }
.media-box video { width: 100%; display: block; max-height: 60vh; background: #000; }
.zoom { position: absolute; right: 10px; bottom: 10px; width: 32px; height: 32px; border-radius: 9px; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; }
.file-line { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.file-line span:last-child { margin-left: auto; flex: none; }
.featured video.art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.post-media video.art { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Audio — plays right in the message */
.audio-card { margin-top: 4px; background: #fff; border-radius: 18px; padding: 14px; box-shadow: 0 1px 3px rgba(16,24,28,.08); border-left: 4px solid var(--c); }
.audio-top { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.audio-ic { width: 44px; height: 44px; border-radius: 13px; background: color-mix(in srgb, var(--c) 13%, #fff); color: var(--c); display: grid; place-items: center; flex: none; }
.audio-main { min-width: 0; display: grid; }
.audio-main b { font-size: 15px; }
.audio-main small { color: var(--muted); font-size: 13px; }
.audio-card audio { width: 100%; height: 44px; }

/* PDF attachment */
.doc { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; margin-top: 18px; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 1px 3px rgba(16,24,28,.06); }
.doc:active { background: #fafbfb; }
.doc-ic { width: 48px; height: 48px; border-radius: 13px; background: #fbe9e7; color: var(--safety); display: grid; place-items: center; flex: none; }
.doc-main { flex: 1; min-width: 0; display: grid; gap: 3px; }
.doc-main b { font-size: 16px; }
.doc-main small { color: var(--muted); font-size: 13px; }
.doc > .ic { color: var(--muted); }

/* Document viewer and image lightbox */
.viewer { position: absolute; inset: 0; z-index: 25; background: #2b2f31; display: flex; flex-direction: column; animation: up .22s ease-out; }
@media (min-width: 560px) { .viewer { top: 34px; } }
.viewer-bar { flex: none; display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: var(--slate); color: #fff; font-weight: 600; font-size: 15px; }
.viewer-bar .ellipsis { flex: 1; }
.viewer-bar .icon-btn { color: #fff; }
.viewer-bar.dark { background: transparent; position: absolute; top: 0; left: 0; right: 0; z-index: 1; }
.viewer-frame { flex: 1; width: 100%; border: 0; background: #fff; }
.lightbox { flex: 1; display: grid; place-items: center; background: #000; padding: 10px; }
.lightbox img, .lightbox svg { max-width: 100%; max-height: 100%; width: 100%; height: auto; border-radius: 8px; }

.detail .media-box + .media-box, .detail .media-box + .audio-card, .detail .audio-card + .media-box, .detail .audio-card + .audio-card, .detail .file-line + .media-box, .detail .file-line + .audio-card { margin-top: 12px; }
.detail .doc + .doc { margin-top: 10px; }

/* "Showing x of y" + Show More under every list */
.more { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 2px 4px; font-size: 13px; color: var(--muted); }
.more .btn { width: auto; min-height: 40px; font-size: 14px; padding: 0 16px; }
.searchbox input[type=search]::-webkit-search-cancel-button { filter: invert(1); }
.searchbox.light input[type=search]::-webkit-search-cancel-button { filter: none; }

/* a reply that has just arrived */
.q.fresh { box-shadow: 0 0 0 2px var(--production), 0 6px 18px rgba(31,127,105,.15); }
.tag-new { font-size: 11px; font-weight: 700; color: #fff; background: var(--production); padding: 3px 8px; border-radius: 5px; }

/* ---- Microsoft sign-in: profile from Microsoft Graph -------------------- */
.ms-logo.big { grid-template-columns: 20px 20px; gap: 4px; }
.ms-logo.big i { width: 20px; height: 20px; }
.graph-steps { display: grid; gap: 12px; margin-top: 10px; text-align: left; width: 100%; max-width: 300px; }
.gs { display: flex; align-items: center; gap: 12px; font-size: 15px; color: #fff; }
.gs .spinner { width: 18px; height: 18px; border-width: 2.5px; flex: none; }
.gs.wait { color: #7f8d93; }
.gs-dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #4b5a61; flex: none; }
.gs.ok { color: #9fd9c6; }
.gs.ok .ic { color: #3fbf95; }
.welcome-me { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.08); border-radius: 16px; padding: 12px 16px; text-align: left; }
.welcome-me b { display: block; font-size: 16px; }
.welcome-me small { color: #b7c1c5; font-size: 13px; }
.ms-note { display: flex; align-items: center; gap: 10px; margin: 2px 22px 0; padding: 10px 14px; border-radius: 12px; background: #fff; border: 1px solid var(--line); font-size: 14px; font-weight: 600; color: #3d494e; }
.ms-tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 6px; font-size: 11px; font-weight: 700; color: #0067b8; background: #e8f1fb; vertical-align: 1px; }
.field input.locked { background: #f4f6f7; color: var(--muted); }

/* ---- Company information in the app -------------------------------------- */
button.leader { width: 100%; text-align: left; }
.leader > div:not(.avatar) { flex: 1; min-width: 0; }
.leader > .avatar { flex: none; }
.leader .ic { color: #b9c1c5; }
.leader-n { font-size: 11px; font-weight: 700; color: var(--company); background: #e6eef6; padding: 2px 7px; border-radius: 10px; white-space: nowrap; }
.leader-bio { margin: 0; color: #3d494e; line-height: 1.55; font-size: 15px; text-align: center; }
.notices { display: grid; gap: 10px; }
.notice { display: flex; gap: 12px; align-items: flex-start; background: #fff; border-radius: 14px; padding: 12px 14px; border-left: 4px solid var(--company); box-shadow: 0 1px 2px rgba(16,24,28,.06); }
.notice.important { border-left-color: var(--safety); }
.notice-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; color: var(--company); background: #e6eef6; }
.notice.important .notice-ic { color: var(--safety); background: #fbe9e7; }
.notice b { display: block; font-size: 15px; }
.notice p { margin: 3px 0 4px; font-size: 14px; line-height: 1.45; color: #3d494e; }
.notice small { font-size: 12px; color: var(--muted); font-weight: 600; }
.item-ic.pol-ic { background: linear-gradient(145deg, #dd5a52, #b5352f); }
.avatar.xs { width: 34px; height: 34px; font-size: 12px; flex: none; }
.by.from-leader { display: flex; align-items: center; gap: 10px; text-align: left; color: var(--muted); font-size: 13px; line-height: 1.35; }
.by.from-leader b { color: var(--text); }

/* ---- Companies and sites in the app -------------------------------------- */
button.org-node { display: block; width: 100%; text-align: left; }
.org-node h4 .ic { margin-left: auto; color: #b9c1c5; }
.org-node.root h4 .ic { color: #8f9da3; }
.org-node h4 { gap: 8px; }
.addr-block { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.contact-row { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; font-size: 14px; color: #3d494e; line-height: 1.45; }
.contact-row .ic { color: var(--muted); margin-top: 1px; }
.contact-row a { color: var(--company); font-weight: 600; }
.contact-row.emergency { color: var(--safety); font-weight: 700; }
.contact-row.emergency .ic, .contact-row.emergency a { color: var(--safety); }
.contact-card { margin-top: 10px; }
.menu.flat.contact-card { padding: 6px 14px; }
.co-hero { display: flex; align-items: center; gap: 14px; padding: 18px 16px 4px; }
.co-hero h1 { margin: 0; font-size: 21px; }
.co-hero small { color: var(--muted); }
.co-badge { width: 52px; height: 52px; border-radius: 14px; background: var(--slate); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 15px; letter-spacing: .02em; flex: none; }
.lead-group { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 10px 0 2px; }
.lead-group:first-child { margin-top: 0; }
.item-ic.site-ic { background: linear-gradient(145deg, #4a82ad, #2c5778); }
.item-ic.site-ic.big { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; color: #fff; }
.site-about p { margin: 0 0 8px; line-height: 1.55; color: #3d494e; font-size: 15px; }

/* ---- Our Companies as a tree: group → companies → sites ------------------- */
.org { gap: 10px; }
.org .org-node:not(.root) { position: relative; margin-left: 20px; width: calc(100% - 20px); }
.org .org-node:not(.root)::before { content: ""; position: absolute; left: -14px; top: -11px; width: 12px; height: calc(50% + 11px); border-left: 2px solid #c9d0d3; border-bottom: 2px solid #c9d0d3; border-bottom-left-radius: 7px; }
.org .org-node:not(.root):not(:last-child)::after { content: ""; position: absolute; left: -14px; top: 50%; bottom: -11px; border-left: 2px solid #c9d0d3; }
.org-node .org-sites span { position: relative; padding-left: 16px; }
.org-node .org-sites span::before { content: ""; position: absolute; left: 6px; top: 50%; width: 6px; height: 6px; border-radius: 50%; background: #c9d0d3; transform: translateY(-50%); }

/* Profile: celebrations group */
.form-group { margin: 10px 0 -4px; padding-top: 14px; border-top: 1px solid var(--line, #e4e7e9); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.toggle-line { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 1px solid var(--line, #e4e7e9); border-radius: 14px; background: #fff; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.toggle-line span:first-child { display: grid; gap: 2px; }
.toggle-line b { font-size: 15px; }
.toggle-line small { font-size: 13px; color: var(--muted); }
/* Celebrations: the employee's own day */
.celebrate.me { width: 190px; background: linear-gradient(160deg, #e39a28 0%, #f0b45a 100%); color: #fff; }
.celebrate.me h4 { white-space: normal; font-size: 15px; }
.celebrate.me p { color: rgba(255,255,255,.9); white-space: normal; }
.celebrate.me .why { color: #fff; }
