/* FSRE Assistant — interface. One typeface for both languages; reference numbers are the visual motif. */
:root {
  --paper: #F5F7FA; --surface: #FFFFFF; --sunk: #EDF1F6; --ink: #0E2033; --ink-2: #4A5B70; --ink-3: #7A8899; --line: #DCE3EC;
  --brand: #1557FF; --brand-ink: #0B3BD1; --tint: #EAF0FF; --teal: #0B8F8F; --ok: #0F8A5F; --warn: #A86A12; --no: #C2334D; --no-tint: #FBECEF;
  --r1: 8px; --r2: 12px; --r3: 18px; --rail: 228px;
  --font: "Readex Pro", "Segoe UI", Tahoma, system-ui, sans-serif;
}
:root[data-theme="dark"] {
  --paper: #0A1220; --surface: #111C2E; --sunk: #0D1626; --ink: #E6EDF7; --ink-2: #A3B1C6; --ink-3: #74839A; --line: #22314A;
  --brand: #6C93FF; --brand-ink: #9DB6FF; --tint: #16264A; --teal: #4CC9C0; --ok: #46C795; --warn: #E0A84B; --no: #F07A90; --no-tint: #3A1620;
}
* { box-sizing: border-box; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100%; background: var(--paper); color: var(--ink); font: 300 15px/1.5 var(--font); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 26px; line-height: 1.2; font-weight: 500; letter-spacing: -0.015em; }
h2 { font-size: 16px; font-weight: 500; }
h3 { font-size: 14px; font-weight: 500; }
a { color: var(--brand); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--ink-2); } .small { font-size: 13px; } .tnum { font-variant-numeric: tabular-nums; }
.ref { font-variant-numeric: tabular-nums; letter-spacing: 0.01em; color: var(--ink-2); font-size: 12.5px; direction: ltr; unicode-bidi: isolate; }
.ic { width: 20px; height: 20px; flex: none; display: inline-block; }
.ic svg { width: 100%; height: 100%; display: block; }
.row { display: flex; align-items: center; gap: 10px; } .wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; } .stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; } .end { margin-inline-start: auto; }
.hide { display: none !important; }

/* controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: var(--r1); border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 400; white-space: nowrap; }
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 500; }
:root[data-theme="dark"] .btn.primary { color: #061022; }
.btn.primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); }
.btn.quiet { border-color: transparent; background: transparent; } .btn.quiet:hover { background: var(--sunk); }
.btn.danger { color: var(--no); } .btn.sm { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: default; }
.field { display: grid; gap: 5px; } .field > span { font-size: 13px; color: var(--ink-2); }
.input, select.input, textarea.input { width: 100%; min-height: 42px; padding: 9px 12px; border-radius: var(--r1); border: 1px solid var(--line); background: var(--surface); }
textarea.input { resize: vertical; line-height: 1.55; }
.input:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: transparent; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; cursor: pointer; white-space: nowrap; }
.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 6px; font-size: 12px; background: var(--sunk); color: var(--ink-2); white-space: nowrap; }
.tag.private { background: var(--sunk); } .tag.department, .tag.people { background: color-mix(in srgb, var(--teal) 14%, transparent); color: var(--teal); }
.tag.company { background: var(--tint); color: var(--brand-ink); } .tag.restricted, .tag.confidential { background: var(--no-tint); color: var(--no); }
.tag .ic { width: 13px; height: 13px; }

/* shell */
.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.rail { background: var(--surface); border-inline-end: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; height: 100dvh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; font-weight: 600; letter-spacing: -0.01em; }
.brand i { width: 30px; height: 30px; border-radius: 9px; background: var(--brand); display: grid; place-items: center; color: #fff; font-style: normal; font-size: 10px; font-weight: 700; letter-spacing: .02em; }
.nav { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: var(--r1); color: var(--ink-2); text-decoration: none; cursor: pointer; border: 0; background: none; width: 100%; text-align: start; }
.nav:hover { background: var(--sunk); color: var(--ink); }
.nav.on { background: var(--tint); color: var(--brand-ink); font-weight: 500; }
.rail .foot { margin-top: auto; display: grid; gap: 4px; }
.who { padding: 10px; border-top: 1px solid var(--line); margin-top: 8px; } .who b { display: block; font-weight: 500; } .who span { font-size: 12.5px; color: var(--ink-2); display: block; }
.main { min-width: 0; padding: 0 28px 80px; }
.top { display: flex; align-items: center; gap: 10px; height: 60px; position: sticky; top: 0; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px); z-index: 5; margin: 0 -28px; padding: 0 28px; }
.crumb { font-size: 13px; color: var(--ink-3); } .crumb b { color: var(--ink); font-weight: 500; } .crumb span { margin: 0 6px; }
.net { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); padding: 0 6px; }
.net i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); } .net.off i { background: var(--warn); }
.page { max-width: 1060px; margin: 0 auto; padding-top: 14px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 26px; }
.page > header p { color: var(--ink-2); margin-top: 4px; max-width: 62ch; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); }
.panel > .hd { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.pad { padding: 16px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 18px; align-items: start; } .cols > * { min-width: 0; }

/* the ask bar — the one loud element */
.ask { position: relative; }
.askbar { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1.5px solid var(--ink); border-radius: var(--r3); padding: 8px 8px 8px 18px; box-shadow: 5px 5px 0 var(--brand); }
[dir="rtl"] .askbar { padding: 8px 18px 8px 8px; box-shadow: -5px 5px 0 var(--brand); }
.askbar input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 19px; font-weight: 300; min-height: 48px; }
.askbar input::placeholder { color: var(--ink-3); }
.sugg { position: absolute; inset-inline: 0; top: calc(100% + 10px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); box-shadow: 0 18px 40px -18px rgba(14, 32, 51, .35); z-index: 20; overflow: hidden; }
.sugg .item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer; border: 0; background: none; width: 100%; text-align: start; }
.sugg .item:hover, .sugg .item.on { background: var(--tint); }
.sugg .grp { padding: 8px 14px 2px; font-size: 12px; color: var(--ink-3); }
.starts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

/* lists */
.list { display: grid; grid-template-columns: minmax(0, 1fr); }
.item-row { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border: 0; border-bottom: 1px solid var(--line); background: none; width: 100%; text-align: start; cursor: pointer; }
.item-row:last-child { border-bottom: 0; } .item-row:hover { background: var(--sunk); }
.item-row .t { font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .item-row .s { font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kind { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--sunk); color: var(--ink-2); flex: none; }
.kind.document, .kind.text { background: var(--tint); color: var(--brand-ink); } .kind.sheet { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.kind.drawing, .kind.map { background: color-mix(in srgb, var(--teal) 14%, transparent); color: var(--teal); } .kind.pdf { background: var(--no-tint); color: var(--no); }
.empty { padding: 28px 16px; text-align: center; color: var(--ink-2); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 10px; }
.tile { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface); cursor: pointer; text-align: start; align-content: start; }
.tile:hover { border-color: var(--brand); } .tile b { font-weight: 500; } .tile span { font-size: 12.5px; color: var(--ink-2); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13.5px; } table.grid th { text-align: start; font-weight: 500; color: var(--ink-2); font-size: 12.5px; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.grid td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; } .scroll-x { overflow-x: auto; }

/* assistant */
.thread { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 4px 0 18px; }
.msg { max-width: 74ch; padding: 12px 15px; border-radius: var(--r2); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.user { background: var(--ink); color: var(--paper); justify-self: end; border-end-end-radius: 4px; }
.msg.bot { background: var(--surface); border: 1px solid var(--line); border-end-start-radius: 4px; }
.msg .srcs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; white-space: normal; } .msg .meta { margin-top: 8px; font-size: 12px; color: var(--ink-3); white-space: normal; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.composer { position: sticky; bottom: 14px; display: flex; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); padding: 8px; box-shadow: 0 12px 30px -16px rgba(14, 32, 51, .4); }
.composer textarea { flex: 1; border: 0; outline: 0; background: none; resize: none; min-height: 44px; max-height: 180px; padding: 10px; }

/* editor */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.sec { border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface); padding: 12px; display: grid; gap: 8px; }
.sec .h { font-weight: 500; border: 0; background: none; padding: 4px 2px; width: 100%; }
.tbl-ed { overflow-x: auto; } .tbl-ed table { border-collapse: collapse; min-width: 100%; } .tbl-ed th { font-size: 12px; font-weight: 500; text-align: start; padding: 4px 6px; color: var(--ink-2); white-space: nowrap; }
.tbl-ed td { padding: 2px; } .tbl-ed input { width: 100%; min-width: 96px; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; background: var(--surface); }
.preview { position: sticky; top: 74px; background: #fff; border: 1px solid var(--line); border-radius: var(--r2); padding: 26px 28px; max-height: calc(100dvh - 100px); overflow: auto; box-shadow: 0 20px 40px -28px rgba(14, 32, 51, .5); }
.preview .doc { font-size: 8.4pt; } .preview .doc-ref { font-size: 7.4pt; } .preview .doc-ref th, .preview .doc-ref td { padding: 3pt 4pt; } .preview .doc-qr { width: 21mm; } .preview .doc-qr svg { width: 19mm; height: 19mm; } .preview .doc-refno { white-space: normal; } .preview .doc-both .doc-ref th { font-size: 6.2pt; width: 14%; } .preview .doc-both .doc-ref { font-size: 6.8pt; } .preview .doc-org { font-size: 10pt; } .preview .doc-title { font-size: 16pt; margin-top: 12pt; } .preview .doc h2 { font-size: 10pt; }
.bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* overlays */
.scrim { position: fixed; inset: 0; background: rgba(8, 16, 28, .5); z-index: 40; display: grid; }
.drawer { justify-self: end; width: min(520px, 100%); height: 100%; background: var(--surface); overflow: auto; padding: 20px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-content: start; }
.modal { place-self: center; width: min(520px, calc(100% - 28px)); max-height: calc(100dvh - 40px); overflow: auto; background: var(--surface); border-radius: var(--r3); padding: 22px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.modal.wide { width: min(680px, calc(100% - 28px)); align-self: start; margin-top: 12vh; padding: 14px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 13.5px; } .kv dt { color: var(--ink-2); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.code { font-size: 22px; font-weight: 500; letter-spacing: .08em; padding: 12px 14px; background: var(--sunk); border-radius: var(--r1); text-align: center; direction: ltr; user-select: all; overflow-wrap: anywhere; }
.pre { white-space: pre-wrap; background: var(--sunk); border-radius: var(--r1); padding: 12px; font-size: 13px; max-height: 260px; overflow: auto; overflow-wrap: anywhere; }
#toasts { position: fixed; inset-inline: 0; bottom: 84px; display: grid; justify-items: center; gap: 8px; z-index: 60; pointer-events: none; }
.toast { background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 99px; font-size: 14px; max-width: calc(100% - 32px); } .toast.bad { background: var(--no); color: #fff; }
.note { padding: 10px 14px; border-radius: var(--r1); background: var(--tint); color: var(--brand-ink); font-size: 13.5px; } .note.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }

/* sign-in */
.auth { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.auth .side { background: var(--ink); color: var(--paper); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
:root[data-theme="dark"] .auth .side { background: #050B16; color: var(--ink); }
.auth .side h1 { font-size: clamp(30px, 4vw, 46px); max-width: 14ch; font-weight: 400; } .auth .side .refs { display: grid; gap: 6px; opacity: .55; font-size: 13px; direction: ltr; text-align: start; }
.auth .form { display: grid; align-content: center; justify-items: center; padding: 32px 22px; } .auth .form > div { width: min(380px, 100%); display: grid; gap: 16px; }

.scan { position: relative; border-radius: var(--r2); overflow: hidden; background: #000; aspect-ratio: 1; }
.scan video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan::after { content: ""; position: absolute; inset: 16%; border: 3px solid #fff; border-radius: 14px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .35); pointer-events: none; }
.note.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.or { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 12.5px; } .or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn.big { min-height: 48px; font-weight: 500; }
.brand img.logo { height: 30px; max-width: 132px; object-fit: contain; }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--no); color: #fff; font-size: 11px; font-weight: 600; display: inline-grid; place-items: center; line-height: 1; }
.nav .badge { margin-inline-start: auto; } .top .btn { position: relative; } .top .btn .badge { position: absolute; top: 0; inset-inline-end: 0; display: inline-grid; }
.tag.approved { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); } .tag.in_review { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); } .tag.over { background: var(--no-tint); color: var(--no); }
.check { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--ink-3); background: var(--surface); display: grid; place-items: center; cursor: pointer; flex: none; color: transparent; padding: 0; } .check:hover { border-color: var(--ok); color: var(--ok); } .check.on { background: var(--ok); border-color: var(--ok); color: #fff; } .check .ic { width: 14px; height: 14px; }
.done-t { text-decoration: line-through; color: var(--ink-3); } .star.on { color: #D69A00; } .star.on svg path { fill: currentColor; }
.thumb { width: 92px; height: 70px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); flex: none; background: var(--sunk); }
.photo { align-items: flex-start; padding-top: 8px; border-top: 1px solid var(--line); }
.cmt { padding: 8px 10px; background: var(--sunk); border-radius: var(--r1); overflow-wrap: anywhere; } .cmt .small { display: flex; align-items: center; gap: 6px; }
.live { display: grid; gap: 5px; } .live a { text-decoration: none; }
.sec [dir="rtl"] { text-align: right; }
.bars { display: grid; gap: 6px; } .barrow { display: grid; grid-template-columns: minmax(70px, 28%) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13px; }
.barrow > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .track { background: var(--sunk); border-radius: 5px; height: 16px; overflow: hidden; } .fill { background: var(--brand); height: 100%; border-radius: 5px; min-width: 2px; } .fill.neg { background: var(--no); }
.barrow b { font-weight: 500; font-variant-numeric: tabular-nums; }
.files { display: flex; gap: 6px; flex-wrap: wrap; } .composer .btn.quiet { align-self: flex-end; }
#print-root { display: none; }
@media print { body.printing > *:not(#print-root) { display: none !important; } body.printing #print-root { display: block; } body.printing { background: #fff; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; } .main { padding: 0 16px 96px; } .top { margin: 0 -16px; padding: 0 16px; }
  .rail { position: fixed; inset: auto 0 0 0; top: auto; height: auto; flex-direction: row; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); border-inline-end: 0; border-top: 1px solid var(--line); z-index: 30; gap: 2px; }
  .rail .brand, .rail .who, .rail .nav.desk { display: none; } .nav .badge { position: absolute; margin: -22px 0 0 22px; } .nav { position: relative; } .rail .foot { margin: 0; display: contents; }
  .nav { flex: 1 1 0; min-width: 0; width: auto; flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 2px; justify-content: center; text-align: center; } .top .btn span:not(.ic) { display: none; } .top { gap: 2px; } .top .btn.sm { padding: 0 8px; } .net { font-size: 0; padding: 0 8px; } .crumb { white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .editor { grid-template-columns: 1fr; } .preview { position: static; max-height: none; padding: 16px; }
  .auth { grid-template-columns: 1fr; } .auth .side { padding: 28px 22px; } .auth .side .refs { display: none; }
  h1 { font-size: 22px; } .askbar input { font-size: 16px; } .drawer { width: 100%; } .composer { bottom: 78px; }
}
@media (prefers-reduced-motion: no-preference) { .drawer { animation: in .18s ease-out; } @keyframes in { from { transform: translateX(24px); opacity: 0; } } }
