:root {
  --ink: #14212B; --muted: #56656F; --bg: #F2F4F6; --card: #fff; --line: #DCE2E7;
  --navy: #10232E; --teal: #0E7C74; --teal-dark: #0B6B64; --danger: #9B1C1C;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: 'IBM Plex Sans', system-ui, sans-serif; color: var(--ink); background: var(--bg); }
h1 { font-size: 28px; margin: 6px 0 8px; letter-spacing: -0.01em; }
h2 { font-size: 17px; margin: 0 0 8px; }
.muted { color: var(--muted); margin: 0 0 20px; line-height: 1.5; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; margin-bottom: 26px; }
.brand.light { color: #fff; padding: 0 8px; }
.mark { width: 40px; height: 40px; flex-shrink: 0; }
.brand.light .mark { width: 36px; height: 36px; }

/* auth */
.auth { position: relative; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; background: var(--navy); }
.auth-card { width: 100%; max-width: 400px; background: var(--card); border-radius: 14px; padding: 32px 28px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
label { display: block; font-size: 14px; font-weight: 600; margin: 14px 0 6px; }
.hint { font-weight: 400; color: var(--muted); }
input { width: 100%; min-height: 46px; padding: 0 12px; font: inherit; font-size: 15px; border: 1px solid #C3CDD4; border-radius: 8px; background: #FAFBFC; color: var(--ink); }
input:focus { outline: 2px solid var(--teal); outline-offset: 1px; background: #fff; }
.btn { width: 100%; min-height: 46px; margin-top: 22px; font: inherit; font-weight: 600; font-size: 15px; color: #fff; background: var(--teal); border: 0; border-radius: 8px; cursor: pointer; }
.btn:hover { background: var(--teal-dark); }
.alert { background: #FDECEC; color: var(--danger); border-radius: 8px; padding: 10px 12px; font-size: 14px; margin: 0 0 6px; }
.alert p { margin: 2px 0; }
.foot { color: #8FA5B2; font-size: 12px; margin-top: 18px; }
.foot.left { color: var(--muted); margin-top: 28px; }

/* language switch */
.lang-switch { position: absolute; top: 20px; inset-inline-end: 24px; color: #C9D7DE; font-size: 15px; font-weight: 500; text-decoration: none; padding: 8px 12px; border: 1px solid #2E4C5C; border-radius: 8px; }
.lang-switch:hover { color: #fff; border-color: #5F7A88; }
.lang-switch:focus-visible, .linkbtn:focus-visible, .nav:focus-visible { outline: 2px solid #5CC9B9; outline-offset: 2px; }

/* Arabic: right-to-left, Arabic typeface, no letter-spacing (it breaks joined letters) */
[dir="rtl"] body { font-family: 'IBM Plex Sans Arabic', 'IBM Plex Sans', system-ui, sans-serif; }
[dir="rtl"] h1, [dir="rtl"] .kicker, [dir="rtl"] .brand { letter-spacing: 0; }
[dir="rtl"] .kicker { text-transform: none; font-size: 13px; }
[dir="rtl"] .muted, [dir="rtl"] .card p { line-height: 1.7; }
[lang="ar"]:not(html) { font-family: 'IBM Plex Sans Arabic', sans-serif; }
[lang="en"]:not(html) { font-family: 'IBM Plex Sans', sans-serif; }

/* shell */
.shell { min-height: 100vh; display: flex; flex-wrap: wrap; }
.side { flex: 1 1 220px; max-width: 100%; background: var(--navy); padding: 24px 14px; display: flex; flex-direction: column; gap: 2px; }
.nav { display: flex; gap: 8px; justify-content: space-between; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 8px; color: #C9D7DE; text-decoration: none; font-size: 14px; font-weight: 500; }
.nav.on { background: #1F4050; color: #fff; }
.nav.soon { color: #7F97A4; }
.nav em { font-style: normal; font-size: 11px; color: #5F7A88; }
.side-foot { margin-top: auto; padding: 16px 12px 0; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.side-foot form { margin: 0; }
.linkbtn { text-decoration: none; background: none; border: 0; color: #C9D7DE; font: inherit; font-size: 14px; cursor: pointer; padding: 0; }
.linkbtn:hover { color: #fff; }
.content { flex: 999 1 560px; min-width: 0; padding: 32px; }
.kicker { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.card p { color: #3E4C56; font-size: 14px; line-height: 1.5; margin: 0 0 14px; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: #F0F2F4; color: #3A4750; }
.tag.next { background: #E7F3F1; color: #0B5F59; }
@media (max-width: 640px) { .content { padding: 20px 16px; } .side { flex-basis: 100%; padding: 16px 14px; } .nav.soon { display: none; } .side-foot { flex-direction: row; gap: 20px; } .brand { margin-bottom: 14px; } }

/* ---------- Claim checker ---------- */
.card-link { margin: 14px 0 0 !important; }
.card-link a { color: var(--teal-dark); font-weight: 600; text-decoration: none; }
.card-link a:hover { text-decoration: underline; }
.cc-layout { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.cc-form { flex: 1 1 520px; min-width: 0; }
.cc-result { flex: 1 1 460px; min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 22px; }
.panel { min-width: 0; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 14px 18px 18px; margin: 0 0 14px; }
.panel legend { font-weight: 700; font-size: 15px; padding: 0 6px; }
.panel label { margin-top: 10px; }
.sub-label { font-size: 14px; font-weight: 600; margin: 14px 0 6px; }
.choices { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.choice { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; margin: 6px 0 0; min-height: 32px; cursor: pointer; }
.choice input { width: 18px; height: 18px; min-height: 0; accent-color: var(--teal); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; }
.check-row { display: flex; align-items: flex-end; padding-bottom: 8px; }
select { width: 100%; min-height: 46px; padding: 0 10px; font: inherit; font-size: 15px; border: 1px solid #C3CDD4; border-radius: 8px; background: #FAFBFC; color: var(--ink); }
input[aria-invalid="true"] { border-color: var(--danger); background: #FFF6F6; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { text-align: start; font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px; white-space: nowrap; }
td { padding: 4px 6px; border-top: 1px solid var(--line); }
.cheques { min-width: 720px; }
.cheques td:nth-child(1), .cheques td:nth-child(2) { width: 15%; }
.cheques td:nth-child(3), .cheques td:nth-child(5) { width: 20%; }
.cheques td:nth-child(4) { width: 30%; }
.cheques input { min-height: 40px; font-size: 14px; padding: 0 8px; }
.btn-inline { width: auto; padding: 0 28px; margin-top: 4px; }
.status { font-size: 17px; padding: 12px 14px; border-radius: 10px; margin: 0 0 16px; }
.status.good { background: #E7F3F1; color: #0B5F59; }
.status.warn { background: #FFF4E0; color: #7A4B00; }
.status.bad { background: #FDECEC; color: var(--danger); }
.cc-result h3 { font-size: 15px; margin: 22px 0 10px; }
.totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0; }
.totals div { background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.totals dt { font-size: 12px; color: var(--muted); font-weight: 600; }
.totals dd { margin: 4px 0 0; font-size: 17px; font-weight: 700; text-align: start; }
.findings { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.finding { display: flex; gap: 10px; align-items: baseline; font-size: 14px; line-height: 1.6; padding: 10px 12px; border-radius: 8px; background: var(--bg); }
.finding .lvl { flex-shrink: 0; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.finding.error .lvl { background: #9B1C1C; color: #fff; }
.finding.warning .lvl { background: #8A5A00; color: #fff; }
.finding.info .lvl { background: #3A4750; color: #fff; }
.wording { font-family: 'IBM Plex Sans Arabic', sans-serif; background: #FBFCFC; border: 1px solid var(--line); border-radius: 10px; padding: 6px 16px 14px; }
.w-label { font-size: 12px; font-weight: 700; color: var(--teal-dark); margin: 14px 0 4px; }
.w-text { font-size: 15px; line-height: 1.9; margin: 0; white-space: pre-line; user-select: all; }
ol.w-text { padding-inline-start: 22px; white-space: normal; }
.schedule tr.claimed td { background: #E7F3F1; font-weight: 600; }
.mini { font-size: 11px; color: var(--muted); font-weight: 500; }
@media (max-width: 640px) { .cc-result { padding: 16px; } }

/* ---------- Notice drafter ---------- */
textarea { width: 100%; padding: 10px 12px; font: inherit; font-size: 15px; border: 1px solid #C3CDD4; border-radius: 8px; background: #FAFBFC; color: var(--ink); resize: vertical; }
textarea:focus { outline: 2px solid var(--teal); outline-offset: 1px; background: #fff; }
.narrow { max-width: 720px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-secondary { background: var(--navy); }
.btn-secondary:hover { background: #1F4050; }
.notice-tip { background: #FFF4E0; color: #6A4300; border-radius: 10px; padding: 10px 14px; font-size: 14px; }
.notice-tip a { color: #6A4300; font-weight: 700; }
.hint-line { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.notice-paper { font-family: 'IBM Plex Sans Arabic', sans-serif; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 28px 26px; box-shadow: 0 2px 10px rgba(16,35,46,.06); font-size: 15px; line-height: 1.85; text-align: justify; }
.notice-paper p { margin: 0 0 4px; }
.np-title { text-align: center; font-weight: 700; }
.np-heading { font-weight: 700; text-decoration: underline; margin-top: 12px !important; }
.np-center { text-align: center; }
.np-line { display: flex; gap: 10px; text-align: start; }
.np-party { font-weight: 700; }
.np-label { flex: 0 0 110px; font-weight: 700; white-space: nowrap; overflow: hidden; }
.np-item { display: flex; gap: 8px; }
.np-num { flex: 0 0 22px; }
.np-pre { white-space: pre-line; }

/* ---------- AI Agents' Room ---------- */
.room-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
.room-controls { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.room-controls .btn { margin-top: 0; }
.live-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: #0B5F59; }
.live-dot::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #1FA38F; box-shadow: 0 0 0 4px rgba(31,163,143,.18); }
.live-dot.offline { color: var(--muted); }
.live-dot.offline::before { background: #9AA7AF; box-shadow: none; }
.demo-banner { background: #FFF4E0; color: #6A4300; border-radius: 10px; padding: 10px 14px; font-size: 14px; font-weight: 600; margin: 0 0 14px; }
.room-layout { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.room { position: relative; flex: 999 1 620px; min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; padding: 22px; border-radius: 16px;
  background: #E9EEF1; background-image: linear-gradient(#DCE3E7 1px, transparent 1px), linear-gradient(90deg, #DCE3E7 1px, transparent 1px); background-size: 32px 32px; }
.desk { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px 14px; min-height: 178px; cursor: pointer; transition: box-shadow .3s, border-color .3s; }
.desk.owner { background: #F3FAF8; border-color: #B9DDD6; }
.desk.offline { opacity: .62; }
.desk.working { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(14,124,116,.15); }
.desk.done { border-color: #7FC6B9; }
.desk-top { display: flex; justify-content: center; height: 26px; }
.screen { width: 46px; height: 24px; border-radius: 4px 4px 2px 2px; background: #10232E; position: relative; }
.desk.working .screen { background: linear-gradient(90deg, #10232E, #1F6F68, #10232E); background-size: 200% 100%; animation: screen 1.4s linear infinite; }
@keyframes screen { to { background-position: -200% 0; } }
.seat { height: 50px; }
.desk-name { margin: 0; font-weight: 700; font-size: 14px; }
.desk-role { margin: 2px 0 8px; font-size: 12px; color: var(--muted); line-height: 1.4; }
.desk-status { margin: 0; font-size: 12.5px; line-height: 1.45; background: var(--bg); border-radius: 8px; padding: 6px 8px; min-height: 34px; }
.desk.working .desk-status { background: #E7F3F1; color: #0B5F59; font-weight: 600; }
.desk.done .desk-status { background: #EEF7F5; color: #0B5F59; }
.avatar { position: absolute; width: 44px; height: 44px; border-radius: 50%; border: 2px solid #fff; background: var(--teal); color: #fff; display: grid; place-items: center; padding: 0; cursor: pointer;
  box-shadow: 0 4px 12px rgba(16,35,46,.25); transition: left .9s cubic-bezier(.4,.1,.3,1), top .9s cubic-bezier(.4,.1,.3,1), transform .3s; z-index: 2; }
.avatar.owner { background: var(--navy); }
.avatar.offline { background: #8A9AA4; }
.room.demo-mode .avatar.offline { background: #4E8C86; }
.avatar.walking { z-index: 4; transform: scale(1.08); }
.avatar.pulse { animation: pulse 1.2s ease-out; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(14,124,116,.55); } 100% { box-shadow: 0 0 0 16px rgba(14,124,116,0); } }
.speech { position: absolute; z-index: 5; max-width: 220px; background: var(--navy); color: #fff; font-size: 12.5px; line-height: 1.45; padding: 8px 10px; border-radius: 10px; box-shadow: 0 6px 18px rgba(16,35,46,.3); pointer-events: none; }
.feed { flex: 1 1 280px; min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; max-height: 640px; overflow-y: auto; }
.feed h2 { font-size: 15px; }
.feed-filter { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.linkish { background: none; border: 0; padding: 0; color: var(--teal-dark); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }
.feed-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.feed-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; font-size: 13px; padding: 8px 10px; border-radius: 8px; background: var(--bg); }
.feed-item.demo { background: #FFF8EC; }
.feed-who { font-weight: 700; }
.feed-when { color: var(--muted); font-size: 12px; }
.feed-what { grid-column: 1 / -1; line-height: 1.45; }
.feed-empty { font-size: 13px; color: var(--muted); }
@media (max-width: 640px) { .room { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px; gap: 10px; } .desk { min-height: 160px; } }
@media (prefers-reduced-motion: reduce) { .avatar, .desk { transition: none; } .avatar.pulse, .desk.working .screen { animation: none; } }

/* ---------- Mail ---------- */
.settings-tabs { font-size: 14px; margin: -8px 0 16px; }
.settings-tabs a { color: var(--teal-dark); font-weight: 600; }
.btn-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; min-height: 44px; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--bg); }
.acct-list { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.acct { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; background: var(--bg); font-size: 14px; }
.acct.shared { margin-inline-start: 18px; }
.acct form { margin: 0; }
.shared-form { display: flex; flex-direction: column; }
.empty-state { max-width: 640px; }
.mail-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.mail-head .btn { margin-top: 0; }
.mail-accounts, .mail-folders { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chip { font-size: 13px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; }
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip.add { color: var(--teal-dark); border-style: dashed; }
.mail-folders { border-bottom: 1px solid var(--line); padding-bottom: 0; }
.tab { padding: 8px 14px; font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tab.on { color: var(--ink); border-bottom-color: var(--teal); }
.mail-layout { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; margin-top: 14px; }
.msg-list { list-style: none; margin: 0; padding: 0; flex: 1 1 340px; min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.msg a { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 11px 14px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.msg a:hover { background: #F7F9FA; }
.msg.on a { background: #E7F3F1; }
.msg.unread .msg-who, .msg.unread .msg-subj { font-weight: 700; }
.msg.unread a { border-inline-start: 3px solid var(--teal); }
.msg-who { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-when { font-size: 12px; color: var(--muted); }
.msg-subj { grid-column: 1 / -1; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-prev { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-empty, .msg-more { padding: 16px; font-size: 14px; color: var(--muted); }
.msg-more a { color: var(--teal-dark); font-weight: 600; }
.reader { flex: 2 1 520px; min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.reader-back { margin: 0 0 8px; font-size: 13px; display: none; }
.reader-back a { color: var(--teal-dark); }
.reader-subj { font-size: 19px; }
.reader-meta { margin: 6px 0 12px; display: grid; gap: 4px; font-size: 13.5px; }
.reader-meta div { display: flex; gap: 8px; }
.reader-meta dt { flex: 0 0 64px; color: var(--muted); font-weight: 600; }
.reader-meta dd { margin: 0; min-width: 0; overflow-wrap: anywhere; text-align: start; }
.reader-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.reader-actions .btn, .review .btn { margin-top: 0; }
.atts { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.atts a { font-size: 13px; background: var(--bg); border-radius: 8px; padding: 6px 10px; color: var(--ink); text-decoration: none; }
.reader-body { width: 100%; min-height: 460px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.review { max-width: 900px; }
.review .btn-row { margin-top: 14px; align-items: center; }
.review form { margin: 0; }
.fixed-from { margin: 0; padding: 10px 0; font-weight: 600; }
.re-line { font-size: 14px; background: var(--bg); padding: 8px 10px; border-radius: 8px; margin: 14px 0 0; }
.warn-text { color: var(--danger); font-weight: 600; }
@media (max-width: 760px) {
  .mail-layout.has-message .msg-list { display: none; }
  .reader-back { display: block; }
  .reader { padding: 14px; }
}
