/* ITECH AI OS — brand tokens from brand/itech-brand-tokens.json (brand block only) */
@font-face { font-family: "Cairo"; font-weight: 400; font-display: swap; src: url("fonts/Cairo-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Cairo"; font-weight: 600; font-display: swap; src: url("fonts/Cairo-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Cairo"; font-weight: 700; font-display: swap; src: url("fonts/Cairo-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Cairo"; font-weight: 800; font-display: swap; src: url("fonts/Cairo-800.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Cairo"; font-weight: 400; font-display: swap; src: url("fonts/Cairo-400-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Cairo"; font-weight: 600; font-display: swap; src: url("fonts/Cairo-600-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Cairo"; font-weight: 700; font-display: swap; src: url("fonts/Cairo-700-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Cairo"; font-weight: 800; font-display: swap; src: url("fonts/Cairo-800-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url("fonts/JetBrainsMono-400.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-display: swap; src: url("fonts/JetBrainsMono-500.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 700; font-display: swap; src: url("fonts/JetBrainsMono-700.woff2") format("woff2"); }

:root {
  --navy: #0F1E3A;
  --navy-deep: #0A1528;
  --navy-light: #1B3358;
  --blueprint: #2C5DA8;
  --gold: #B79251;
  --gold-light: #D4AE73;
  --cream: #F7F5F2;
  --ink: #12161C;
  --muted: #5B6472;
  --line: #E4E1DB;
  --white: #FFFFFF;
  --danger: #A3302A;
  --danger-bg: #FBEDEB;
  --on-navy: rgba(255, 255, 255, 0.92);
  --on-navy-soft: rgba(255, 255, 255, 0.58);
  --on-navy-line: rgba(255, 255, 255, 0.10);
  --font: "Cairo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --sidebar: 288px;
  --radius-s: 6px;
  --radius: 10px;
  --radius-l: 16px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.6;
  color: var(--ink); background: var(--white);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blueprint); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------- shared controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: var(--radius-s);
  border: 1px solid var(--line); background: var(--white); font-weight: 600; font-size: 15px;
}
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-primary { background: var(--navy); border-color: var(--navy); color: var(--white); }
.btn-primary:hover:not(:disabled) { background: var(--navy-light); }
.btn-block { width: 100%; }
.btn-small { min-height: 32px; padding: 0 12px; font-size: 14px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none;
  border: 0; border-radius: var(--radius-s); background: transparent; color: inherit;
}
.icon-btn:hover { background: rgba(15, 30, 58, 0.06); }
.field { display: grid; gap: 4px; margin-bottom: 14px; }
.field-label { font-size: 14px; font-weight: 600; color: var(--ink); }
.field input, .field select {
  width: 100%; min-height: 46px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: var(--radius-s); background: var(--white); font-size: 16px;
}
.field input:focus, .field select:focus { border-color: var(--blueprint); outline: none; box-shadow: 0 0 0 3px rgba(44, 93, 168, 0.15); }
.field-help { margin: -4px 0 14px; font-size: 13.5px; color: var(--muted); }
.form-error {
  margin: 0 0 14px; padding: 10px 12px; border-radius: var(--radius-s);
  background: var(--danger-bg); color: var(--danger); font-size: 14.5px;
}
.form-msg { margin: 0 0 14px; padding: 10px 12px; border-radius: var(--radius-s); background: var(--cream); font-size: 14.5px; }
.form-msg.is-error { background: var(--danger-bg); color: var(--danger); }

.lang-toggle {
  display: inline-flex; align-items: stretch; height: 34px; padding: 2px; flex: none;
  border: 1px solid var(--line); border-radius: 999px; background: var(--white);
  font-weight: 700; font-size: 13px; line-height: 1;
}
.lang-toggle span { display: grid; place-items: center; min-width: 32px; padding: 0 8px; border-radius: 999px; color: var(--muted); }
.lang-toggle .lang-ar { font-size: 15px; }
html[lang="en"] .lang-toggle .lang-en, html[lang="ar"] .lang-toggle .lang-ar { background: var(--navy); color: var(--white); }

/* ---------- login ---------- */
.login-body { background: var(--white); }
.login { min-height: 100%; display: grid; grid-template-rows: auto 1fr; }
.login-art {
  position: relative; overflow: hidden; color: var(--white); padding: 28px 20px 26px;
  background-color: var(--navy);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 96px 96px, 96px 96px, 24px 24px, 24px 24px;
  border-block-end: 3px solid var(--gold);
}
.login-art-inner { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 16px; }
.login-logo { width: 64px; height: auto; grid-row: span 2; }
.login-product { margin: 0; font-weight: 800; font-size: 26px; line-height: 1.1; letter-spacing: 0.02em; }
.login-tagline { margin: 2px 0 0; color: var(--on-navy-soft); font-size: 14.5px; line-height: 1.45; }
.login-panel { padding: 20px 20px 40px; width: 100%; max-width: 440px; margin-inline: auto; }
.login-top { display: flex; justify-content: flex-end; align-items: center; margin-bottom: 22px; }
.login-logo-sm { display: none; }
.login-title { margin: 0 0 4px; font-size: 28px; font-weight: 800; line-height: 1.2; color: var(--navy); }
.login-sub { margin: 0 0 24px; color: var(--muted); }
.login-help { margin: 18px 0 0; font-size: 14px; color: var(--muted); }

@media (min-width: 900px) {
  .login { grid-template-rows: none; grid-template-columns: minmax(0, 1.1fr) minmax(420px, 1fr); }
  .login-art { padding: 56px; display: flex; align-items: flex-end; border-block-end: 0; border-inline-end: 3px solid var(--gold); }
  .login-art-inner { display: block; max-width: 420px; }
  .login-logo { width: 132px; margin-bottom: 28px; }
  .login-product { font-size: 44px; }
  .login-tagline { margin-top: 10px; font-size: 18px; }
  .login-panel { align-self: center; padding: 40px 48px; }
  .login-top { margin-bottom: 40px; }
}

/* ---------- app shell ---------- */
.app-body { overflow: hidden; }
.app-body.is-loading .shell { visibility: hidden; }
.shell { height: 100%; height: 100dvh; display: flex; }

.sidebar {
  position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 30;
  width: min(86vw, var(--sidebar)); display: flex; flex-direction: column;
  background: var(--navy); color: var(--on-navy);
  transform: translateX(-100%); visibility: hidden; transition: transform 0.22s ease, visibility 0.22s;
  padding-block-end: env(safe-area-inset-bottom);
}
html[dir="rtl"] .sidebar { transform: translateX(100%); }
.sidebar.is-open, html[dir="rtl"] .sidebar.is-open { transform: none; visibility: visible; box-shadow: 0 0 40px rgba(10, 21, 40, 0.4); }
.scrim { position: fixed; inset: 0; z-index: 25; background: rgba(10, 21, 40, 0.5); }

.brand { display: flex; align-items: center; gap: 10px; padding: 16px 12px 14px 16px; padding-inline: 16px 8px; }
.brand-logo { width: 40px; height: auto; }
.brand-name { font-weight: 800; font-size: 19px; letter-spacing: 0.03em; color: var(--white); flex: 1; }
.drawer-close { color: var(--on-navy-soft); }
.drawer-close:hover { background: var(--on-navy-line); }

.btn-new {
  display: flex; align-items: center; gap: 8px; margin: 2px 12px 10px; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--gold); border-radius: var(--radius-s); background: transparent;
  color: var(--gold-light); font-weight: 700; font-size: 15px;
}
.btn-new:hover { background: rgba(183, 146, 81, 0.12); }

.nav { flex: 1; overflow-y: auto; padding: 0 8px 12px; overscroll-behavior: contain; }
.nav-label {
  margin: 18px 8px 6px; font-size: 12.5px; font-weight: 700; color: var(--on-navy-soft);
  display: flex; align-items: center; gap: 8px;
}
.nav-label::after { content: ""; flex: 1; height: 1px; background: var(--on-navy-line); }
.nav-empty { margin: 4px 10px; font-size: 14px; color: var(--on-navy-soft); }
.chat-list { list-style: none; margin: 0; padding: 0; }
.nav-item, .chat-link {
  display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 10px;
  border-radius: var(--radius-s); color: var(--on-navy); text-decoration: none; font-size: 15px;
  border-inline-start: 3px solid transparent;
}
.chat-link span.chat-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html[dir="rtl"] .chat-title, html[dir="rtl"] .view-title { text-align: right; }
.nav-item:hover, .chat-link:hover { background: var(--on-navy-line); }
.nav-item.is-active, .chat-link.is-active { background: var(--navy-light); border-inline-start-color: var(--gold); color: var(--white); }
.busy-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold-light); flex: none; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }

.user { position: relative; border-block-start: 1px solid var(--on-navy-line); padding: 10px 8px; }
.user-btn {
  width: 100%; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 8px;
  border: 0; border-radius: var(--radius-s); background: transparent; color: var(--on-navy); text-align: start;
}
.user-btn:hover, .user-btn[aria-expanded="true"] { background: var(--on-navy-line); }
.avatar {
  width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 50%;
  background: var(--gold); color: var(--navy-deep); font-weight: 800; font-size: 15px;
}
.user-text { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.user-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-size: 13px; color: var(--on-navy-soft); }
.chev { color: var(--on-navy-soft); }
.user-menu {
  position: absolute; inset-inline: 8px; inset-block-end: calc(100% - 4px);
  background: var(--white); color: var(--ink); border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(10, 21, 40, 0.35); padding: 6px; display: grid;
}
.menu-item {
  min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--radius-s); background: transparent;
  text-align: start; font-size: 15px; font-weight: 600;
}
.menu-item:hover { background: var(--cream); }
#connect-btn { color: var(--blueprint); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100%; }
.topbar {
  display: flex; align-items: center; gap: 6px; min-height: 56px; padding: 6px 12px;
  padding-inline: 6px 12px; border-block-end: 1px solid var(--line); background: var(--white);
}
.view-title {
  flex: 1; min-width: 0; margin: 0; font-size: 17px; font-weight: 700; color: var(--navy);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.update-bar {
  display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
  padding: 8px 16px; background: var(--cream); border-block-end: 1px solid var(--line); font-size: 14.5px;
}

@media (min-width: 900px) {
  .sidebar, html[dir="rtl"] .sidebar { position: static; transform: none; visibility: visible; width: var(--sidebar); flex: none; box-shadow: none; }
  .scrim, .menu-btn, .drawer-close { display: none !important; }
  .topbar { padding-inline: 24px; }
}

/* ---------- views ---------- */
.view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.view-page { overflow-y: auto; background: var(--cream); }
.page { width: 100%; max-width: 860px; margin: 0 auto; padding: 20px 16px 48px; }
.person-pick { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.person-select {
  flex: 1; min-width: 0; max-width: 320px; min-height: 44px; padding: 0 10px; border: 1px solid var(--line);
  border-radius: var(--radius-s); background: var(--white); font-size: 16px;
}
.page-lead { margin: 0 0 18px; color: var(--muted); }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card-title { margin: 0 0 14px; font-size: 18px; font-weight: 700; color: var(--navy); }
.empty-list { padding: 28px 16px; text-align: center; color: var(--muted); background: var(--white); border: 1px dashed var(--line); border-radius: var(--radius); }

/* chat */
.view-chat { background: var(--white); }
.scroller { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; }
.messages { width: 100%; max-width: 780px; margin: 0 auto; padding: 20px 16px 8px; }
.empty {
  flex: 1; display: grid; place-items: center; padding: 32px 16px;
  background-color: var(--cream);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: center;
}
.empty-inner {
  max-width: 460px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; border-block-start: 3px solid var(--gold);
}
.empty-title { margin: 0 0 6px; font-size: 22px; font-weight: 800; line-height: 1.3; color: var(--navy); }
.empty-body { margin: 0; color: var(--muted); }
.connect-hint { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.connect-hint p { margin: 0 0 12px; }

.msg { margin: 0 0 22px; }
.msg-user { display: flex; justify-content: flex-end; }
.bubble {
  max-width: min(85%, 620px); padding: 10px 14px; border-radius: var(--radius-l);
  border-end-end-radius: 4px; background: var(--navy); color: var(--white);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.msg-ai { position: relative; padding-inline-start: 14px; border-inline-start: 2px solid var(--line); }
.msg-ai.is-live { border-inline-start-color: var(--gold); }
.msg-who { margin: 0 0 4px; font-size: 13px; font-weight: 700; color: var(--muted); }
.status { margin: 4px 0; font-size: 14.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); animation: pulse 1.4s ease-in-out infinite; }

.steps { margin: 0 0 8px; font-size: 14px; color: var(--muted); }
.steps summary {
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: 32px;
  padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; list-style: none; max-width: 100%;
}
.steps summary::-webkit-details-marker { display: none; }
.steps summary::before { content: "›"; font-weight: 700; transition: transform 0.15s; }
html[dir="rtl"] .steps summary::before { content: "‹"; }
.steps[open] summary::before { transform: rotate(90deg); }
html[dir="rtl"] .steps[open] summary::before { transform: rotate(-90deg); }
.steps-last { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.steps ol { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.chip {
  display: flex; gap: 8px; align-items: baseline; padding: 4px 10px; border-radius: var(--radius-s);
  background: var(--cream); min-width: 0;
}
.chip-name { font-family: var(--mono); font-size: 12.5px; font-weight: 500; color: var(--navy); flex: none; }
.chip-sum { font-family: var(--mono); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; direction: ltr; }

.file-card {
  display: flex; align-items: center; gap: 12px; margin: 8px 0; padding: 10px 12px;
  border: 1px solid var(--line); border-inline-start: 3px solid var(--blueprint); border-radius: var(--radius-s);
  background: var(--white); max-width: 520px;
}
.file-ext {
  flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--radius-s);
  background: rgba(44, 93, 168, 0.1); color: var(--blueprint); font-family: var(--mono); font-weight: 700; font-size: 12px;
}
.file-meta { flex: 1; min-width: 0; display: grid; line-height: 1.35; }
.file-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: start; }
.file-sub { font-family: var(--mono); font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-dl {
  flex: none; display: inline-flex; align-items: center; min-height: 38px; padding: 0 12px; border-radius: var(--radius-s);
  background: var(--blueprint); color: var(--white); font-weight: 600; font-size: 14px; text-decoration: none;
}
.file-dl:hover { background: var(--navy); }

.notice-error {
  margin: 8px 0; padding: 10px 12px; border-radius: var(--radius-s); border-inline-start: 3px solid var(--danger);
  background: var(--danger-bg); color: var(--danger); font-size: 14.5px; overflow-wrap: anywhere;
}

/* markdown */
.md { overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p, .md ul, .md ol, .md pre, .md .table-wrap { margin: 0 0 12px; }
.md ul, .md ol { padding-inline-start: 22px; }
.md li { margin: 2px 0; }
.md h3, .md h4 { margin: 18px 0 6px; font-size: 16.5px; font-weight: 700; color: var(--navy); line-height: 1.4; }
.md h3 { font-size: 18px; }
.md code { font-family: var(--mono); font-size: 0.86em; padding: 1px 5px; border-radius: 4px; background: var(--cream); border: 1px solid var(--line); direction: ltr; unicode-bidi: isolate; }
.md pre { padding: 12px 14px; border-radius: var(--radius-s); background: var(--navy-deep); color: var(--on-navy); overflow-x: auto; direction: ltr; text-align: left; }
.md pre code { padding: 0; border: 0; background: none; color: inherit; font-size: 13px; }
.md .table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-s); }
.md table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
.md th, .md td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
.md th { background: var(--cream); font-weight: 700; color: var(--navy); }
.md tr:last-child td { border-bottom: 0; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.md blockquote { margin: 0 0 12px; padding-inline-start: 12px; border-inline-start: 3px solid var(--gold); color: var(--muted); }
.doc { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }

/* composer */
.composer {
  width: 100%; max-width: 780px; margin: 0 auto; padding: 8px 12px;
  padding-block-end: calc(10px + env(safe-area-inset-bottom));
}
.composer-box {
  display: flex; align-items: flex-end; gap: 4px; padding: 4px; border: 1px solid var(--line);
  border-radius: var(--radius-l); background: var(--white); box-shadow: 0 2px 10px rgba(15, 30, 58, 0.06);
}
.composer-box:focus-within { border-color: var(--blueprint); }
.attach { color: var(--muted); cursor: pointer; border-radius: 12px; }
.input {
  flex: 1; min-width: 0; min-height: 44px; max-height: 40vh; padding: 10px 4px; border: 0; outline: none; resize: none;
  background: transparent; font-size: 16px; line-height: 1.5;
}
.send {
  flex: none; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 12px;
  background: var(--blueprint); color: var(--white);
}
.send:disabled { background: var(--line); color: var(--muted); cursor: default; }
html[dir="rtl"] .send-icon { transform: scaleX(-1); }
.composer-hint { margin: 6px 4px 0; font-size: 12.5px; color: var(--muted); display: none; }
@media (min-width: 900px) and (pointer: fine) { .composer-hint { display: block; } }
.attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.att {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 34px; padding: 2px 4px 2px 10px;
  padding-inline: 10px 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--cream); font-size: 14px;
}
.att-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; max-width: 220px; direction: ltr; }
.att.is-busy { color: var(--muted); }
.att.is-error { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.att button { width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; }
.att button:hover { background: rgba(15, 30, 58, 0.08); }

/* files, agents, people */
.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rows .file-card { margin: 0; max-width: none; }
.agents { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.agent { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.agent-name { margin: 0 0 2px; font-family: var(--mono); font-weight: 500; font-size: 14px; color: var(--navy); direction: ltr; text-align: start; }
.agent-desc { margin: 0; color: var(--muted); font-size: 15px; }
@media (min-width: 700px) { .agents { grid-template-columns: 1fr 1fr; } }

.people { list-style: none; margin: 0 0 20px; padding: 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.person { padding: 14px 16px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.person:last-child { border-bottom: 0; }
.person-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person-head .avatar { background: var(--navy); color: var(--white); }
.person-id { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.person-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-slug { font-family: var(--mono); font-size: 12.5px; color: var(--muted); direction: ltr; text-align: start; }
.tag { font-size: 12.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--cream); color: var(--muted); white-space: nowrap; }
.tag.is-ok { background: rgba(44, 93, 168, 0.1); color: var(--blueprint); }
.person-controls { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.person-controls select { min-height: 38px; padding: 0 8px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--white); }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 14.5px; cursor: pointer; }
.switch input { width: 18px; height: 18px; accent-color: var(--navy); }
.pw-row { display: flex; gap: 8px; flex: 1 1 260px; min-width: 0; }
.pw-row input { flex: 1; min-width: 0; min-height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius-s); }
.person-locked { font-size: 13.5px; color: var(--muted); }
.grid-2 { display: grid; gap: 0 14px; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* dialog */
.dialog {
  width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); border: 0; border-radius: var(--radius-l);
  padding: 22px 20px 20px; color: var(--ink); box-shadow: 0 24px 64px rgba(10, 21, 40, 0.4);
  border-block-start: 3px solid var(--gold);
}
.dialog::backdrop { background: rgba(10, 21, 40, 0.55); }
.dialog-close-form { position: absolute; inset-block-start: 8px; inset-inline-end: 8px; margin: 0; }
.dialog-title { margin: 0 0 6px; padding-inline-end: 40px; font-size: 21px; font-weight: 800; color: var(--navy); }
.dialog-body { margin: 0 0 16px; color: var(--muted); }
.cd-link {
  display: block; margin: 0 0 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--cream); font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; text-align: left;
}
#cd-msg { margin: 14px 0 0; }
