:root {
  color-scheme: light;
  --navy: #0b2239; --blue: #1b63a2; --cyan: #2eb5c6;
  --ink: #14283d; --muted: #496174; --canvas: #f4f7fa; --surface: #fff;
  --line: #dce5ed; --tint: #eaf3fa; --green: #106a52; --green-bg: #e6f5ef;
  --amber: #80520b; --amber-bg: #fff1d8; --red: #9a313a;
  font-family: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
  color: var(--ink); background: var(--canvas);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; line-height: 1.65; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .48; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
.skip { position: absolute; z-index: 5; inset-inline-start: 1rem; top: -10rem; padding: .6rem 1rem; background: white; }
.skip:focus { top: 1rem; }
.shell { min-height: 100dvh; }
.masthead { background: white; border-block-start: 4px solid var(--navy); border-block-end: 1px solid var(--line); }
.masthead-inner, .nav { width: min(calc(100% - clamp(2rem, 6vw, 5.2rem)), 91rem); margin-inline: auto; }
.masthead-inner { min-height: 4.15rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; padding: .3rem 0; }
.brand img { display: block; width: 8.85rem; height: auto; }
.demo-note { color: var(--muted); font-size: .88rem; white-space: nowrap; }
.demo-note b { color: var(--navy); font-weight: 600; }
.nav { display: flex; gap: .3rem; overflow-x: auto; scrollbar-width: thin; padding-block: .2rem .55rem; padding-inline: 2px; }
.nav a { flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 2.7rem; padding: .35rem .87rem; border-radius: .48rem; color: #344c63; text-decoration: none; white-space: nowrap; font-weight: 500; }
.nav a:hover { background: #eef4f8; color: var(--navy); }
.nav a[aria-current="page"] { background: var(--navy); color: white; font-weight: 600; }
main { width: 100%; max-width: 96rem; margin-inline: auto; padding: clamp(1rem, 3vw, 2.6rem); min-width: 0; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .85rem; margin-block-end: 1.45rem; }
h1, h2, h3, p { margin-block: 0; }
h1 { font-size: clamp(1.75rem, 3vw, 2.45rem); font-weight: 700; line-height: 1.35; }
h2 { font-size: 1.19rem; font-weight: 600; line-height: 1.5; }
h3 { font-size: 1rem; }
.page-head p { color: var(--muted); margin-block-start: .3rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.actions > * { flex-shrink: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 2.65rem; padding: .44rem .85rem; border: 1px solid #b9cadd; border-radius: .53rem; background: white; color: var(--blue); text-decoration: none; font-weight: 600; white-space: nowrap; }
.btn:hover { background: var(--tint); }
.btn.primary { background: var(--blue); color: white; border-color: var(--blue); }
.btn.primary:hover { background: #174f83; }
.btn.danger { color: var(--red); border-color: #d5a5a9; }
.btn.danger:hover { background: #fff2f2; }
.btn.quiet { border-color: transparent; background: transparent; }
.btn.small { min-height: 2.25rem; padding: .29rem .62rem; font-size: .9rem; }
.dot { display: inline-block; width: .51rem; height: .51rem; border-radius: 50%; background: currentColor; vertical-align: middle; }
.pill { display: inline-flex; align-items: center; gap: .35rem; border-radius: 2rem; padding: .23rem .64rem; background: #edf1f5; color: #334e65; font-size: .86rem; font-weight: 700; white-space: nowrap; }
.pill.green { color: var(--green); background: var(--green-bg); }
.pill.amber { color: var(--amber); background: var(--amber-bg); }
.pill.blue { color: #185580; background: #e3f0fa; }
.pill.plain { color: #39566e; background: white; border: 1px solid var(--line); }
.surface { background: var(--surface); border: 1px solid var(--line); border-radius: .8rem; min-width: 0; }
.panel-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .7rem; padding: .95rem 1.1rem; border-block-end: 1px solid var(--line); }
.panel-body { padding: 1rem 1.1rem; }
.panel-body > * + * { margin-block-start: .85rem; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-block-end: 1.25rem; padding-block: .85rem; }
.metric { padding: .12rem .9rem; text-align: center; }
.metric + .metric { border-inline-start: 1px solid var(--line); }
.metric strong { display: block; color: var(--navy); font-size: 2rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.3; }
.metric span { color: var(--muted); font-size: .94rem; }
.table-filters { display: flex; align-items: end; flex-wrap: wrap; gap: .65rem; padding: .84rem 1.1rem; }
.table-filters label { flex: 0 1 auto; }
.table-filters label:first-child { flex: 1 1 12rem; }
label, .field-label { display: grid; gap: .27rem; font-size: .94rem; font-weight: 600; }
input, textarea, select { min-width: 0; width: 100%; background: #fbfdff; color: var(--ink); border: 1px solid #c2d0dc; border-radius: .45rem; min-height: 2.6rem; padding: .45rem .65rem; }
textarea { resize: vertical; min-height: 5.25rem; line-height: 1.65; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 45rem; text-align: start; }
th, td { padding: .72rem .9rem; border-block-start: 1px solid var(--line); text-align: start; white-space: nowrap; }
th { background: #f0f5f9; font-weight: 600; font-size: .94rem; }
td time, .number { font-variant-numeric: tabular-nums; }
td button.link { border: 0; color: var(--blue); background: transparent; padding: .25rem 0; font-weight: 700; }
td button:hover { text-decoration: underline; }
.table-foot { color: var(--muted); padding: .8rem 1.1rem; font-size: .88rem; border-block-start: 1px solid var(--line); }
.split { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 1.05rem; align-items: start; }
.stack { display: grid; gap: .95rem; min-width: 0; }
.chat { min-height: 25rem; display: flex; flex-direction: column; }
.callbar { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; padding: .55rem .7rem; background: var(--tint); }
.callbar bdi { color: var(--muted); font-variant-numeric: tabular-nums; }
.thread { padding: 1rem; display: grid; gap: .75rem; align-content: start; min-height: 11rem; max-height: 24rem; overflow-y: auto; }
.thread-label { color: var(--muted); font-size: .85rem; font-weight: 700; }
.bubble { max-width: 88%; padding: .6rem .78rem; border-radius: .65rem; background: #f2f6fa; white-space: pre-line; overflow-wrap: anywhere; }
.bubble.user { background: #dcecf8; justify-self: start; }
.bubble.agent { justify-self: end; }
.quick-prompts { display: flex; flex-wrap: wrap; gap: .45rem; margin: auto 1rem .65rem; }
.compose { display: flex; gap: .5rem; padding: .75rem 1rem; border-block-start: 1px solid var(--line); }
.compose input { flex: 1 1 auto; }
.compose .btn { flex: 0 0 auto; }
.steps { margin: 0; padding: 0; list-style-type: none; }
.steps li, .detail-row { display: flex; justify-content: space-between; align-items: center; gap: .65rem; padding-block: .6rem; border-block-end: 1px solid var(--line); }
.steps li:last-child, .detail-row:last-child { border-block-end: 0; }
.muted { color: var(--muted); font-size: .9rem; }
.plan-message { display: block; margin-block: .8rem 0; padding: .65rem; border-radius: .45rem; background: #f3f7fa; white-space: pre-line; overflow-wrap: anywhere; }
.learning { margin-block-start: 1.1rem; }
.learning .panel-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 1rem; align-items: start; }
.learning .panel-body > * { margin: 0; }
.word-list { display: flex; flex-wrap: wrap; gap: .43rem; margin-block-start: .4rem; }
.word { min-height: 2rem; padding: .22rem .52rem; border-radius: .45rem; background: #f5f9fd; color: var(--ink); border: 1px solid var(--line); }
.word:hover { border-color: #6e9cbe; }
.teach-form { display: flex; gap: .52rem; flex-wrap: wrap; align-items: end; }
.teach-form label { flex: 1 1 9rem; }
.tabs { display: flex; flex-wrap: wrap; gap: .45rem; margin-block-end: 1rem; }
.tabs button[aria-pressed="true"] { background: #e4f1fa; color: #154f7c; border-color: #9bbad2; }
.form-stack { display: grid; gap: .9rem; }
.form-stack .actions { align-self: start; }
.template-list { display: grid; }
.template-list button { width: 100%; padding: .68rem .76rem; color: var(--ink); background: white; border: 0; border-block-end: 1px solid var(--line); text-align: start; }
.template-list button:hover, .template-list button[aria-pressed="true"] { background: var(--tint); color: #154f7c; }
.file-box { display: flex; align-items: center; justify-content: space-between; gap: .55rem; flex-wrap: wrap; padding: .57rem .7rem; border: 1px solid var(--line); border-radius: .45rem; }
.file-box bdi { overflow-wrap: anywhere; }
.file-pick { display: inline-flex; width: fit-content; cursor: pointer; align-items: center; line-height: 1.3; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { margin-block-end: .45rem; font-size: .93rem; font-weight: 700; }
.segments { display: flex; flex-wrap: wrap; gap: .48rem; }
.segments label { display: flex; align-items: center; gap: .25rem; border: 1px solid var(--line); padding: .33rem .5rem; border-radius: .42rem; cursor: pointer; }
.segments label:has(:checked) { border-color: #97b6cc; background: var(--tint); }
.segments input, .toggle input { width: 1rem; height: 1rem; min-height: 0; margin: 0; accent-color: var(--blue); }
.toggle { display: inline-flex; align-items: center; gap: .55rem; }
.pair { text-align: center; display: grid; justify-items: center; gap: .7rem; padding: 1.15rem; }
.qr { display: grid; grid-template-columns: repeat(17, 1fr); width: min(76%, 13.25rem); aspect-ratio: 1; border: .75rem solid white; outline: 1px solid var(--line); border-radius: .5rem; background: white; }
.qr i { background: white; }
.qr i.ink { background: var(--navy); }
.detail-row span:first-child { font-weight: 700; }
.empty { color: var(--muted); text-align: center; padding: 1.15rem; }
.toast { position: fixed; inset-inline-end: 1rem; inset-block-end: 1rem; z-index: 4; max-width: calc(100vw - 2rem); padding: .75rem 1rem; color: white; background: var(--navy); border-radius: .55rem; }
.modal { color: var(--ink); border: 1px solid var(--line); border-radius: .8rem; padding: 0; width: min(33rem, calc(100% - 1.4rem)); }
.modal::backdrop { background: #0b223970; }
.overview { display: grid; gap: 1.05rem; }
.overview > .metrics { margin: 0; }
.contact-note { display: block; color: var(--muted); font-size: .84rem; }
.compact-table { min-width: 28rem; }
.details-layout { grid-template-columns: minmax(0, 1.38fr) minmax(0, 1fr); }
.profile-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.profile-fields > * + * { margin-block-start: 0; }
.wide { grid-column: 1 / -1; }
.reason-cell { white-space: normal; min-width: 9rem; }
.milestones { margin: 0; padding: 0; list-style: none; }
.milestones li { padding: .58rem 0; border-block-end: 1px solid var(--line); }
.milestones li:last-child { border-block-end: 0; }
.milestones .detail-row { padding: 0; border: 0; flex-wrap: wrap; }
.milestones strong, .activity strong { display: block; font-weight: 600; }
.conversation-note { padding: .65rem .8rem; background: #eef5fa; border-radius: .52rem; }
.conversation-note p { margin-block-start: .35rem; white-space: pre-line; overflow-wrap: anywhere; }
.activity { margin: 0; padding-inline-start: .85rem; list-style: none; border-inline-start: 2px solid #c4dce9; }
.activity li { position: relative; padding: .15rem .25rem .75rem; }
.activity li::before { content: ""; position: absolute; inset-inline-start: -1.16rem; inset-block-start: .42rem; width: .48rem; height: .48rem; border-radius: 50%; background: var(--blue); }
.activity p { white-space: pre-line; overflow-wrap: anywhere; }
details summary { cursor: pointer; color: var(--blue); font-weight: 600; }
@media (max-width: 680px) {
  .brand img { width: 7.7rem; }
  .nav a { padding-inline: .62rem; font-size: .92rem; }
  .split, .learning .panel-body { grid-template-columns: minmax(0, 1fr); }
  .profile-fields { gap: .7rem; }
  .profile-fields > label { grid-column: 1 / -1; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem 0; }
  .metric:nth-child(3) { border-inline-start: 0; }
  .metric:nth-child(n+3) { border-block-start: 1px solid var(--line); padding-block-start: .55rem; }
  .table-filters label { flex: 1 1 8rem; }
  .chat { min-height: 20rem; }
  .bubble { max-width: 95%; }
}
