/* OfficeAI, aplicatia live din pagina „Aplicatia”, in stilul Windows 11 (Fluent 2, tema deschisa).
   Aplicatia ruleaza pe Windows Server si se foloseste din Windows 11: Edge o poate instala ca aplicatie,
   cu fereastra ei. De aici: bara de titlu, Mica, NavigationView ca in Setari, accentul Windows,
   controale si flyout-uri Fluent. Nimic nativ din browser (fara <select>). */

/* Desktopul din spatele ferestrei: lumina rece a fundalului Windows 11, foarte discret. */
.oa-stage {
  margin-bottom: 72px;
  border-radius: 14px;
  padding: 32px;
  background:
    radial-gradient(900px 420px at 78% -10%, rgba(0, 103, 192, 0.20), transparent 70%),
    radial-gradient(700px 380px at 0% 110%, rgba(0, 120, 212, 0.12), transparent 70%),
    #e9eef6;
}

.oa-footnote {
  max-width: 820px;
  margin: 22px auto 0;
  color: #5b6573;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

/* ---------- Token-uri Fluent 2 (light) ---------- */
.oa {
  --w-text: #1a1a1a;
  --w-text-2: #5d5d5d;
  --w-text-3: #8a8a8a;
  --w-accent: #005fb8;
  --w-accent-hover: #1a6fc0;
  --w-accent-press: #3381c9;
  --w-accent-text: #003e92;
  --w-accent-soft: rgba(0, 95, 184, 0.08);
  --w-stroke: rgba(0, 0, 0, 0.0578);
  --w-stroke-2: #e5e5e5;
  --w-subtle-hover: rgba(0, 0, 0, 0.0373);
  --w-subtle-press: rgba(0, 0, 0, 0.0241);
  --w-card: #ffffff;
  --w-layer: #f9f9f9;
  --w-mica: #f1f3f7;
  --w-acrylic: rgba(249, 249, 249, 0.86);
  --w-shadow-flyout: 0 8px 16px rgba(0, 0, 0, 0.14);
  position: relative;
  display: grid;
  grid-template-rows: 44px minmax(0, 1fr);
  height: 720px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  background: linear-gradient(180deg, #edf1f8 0, var(--w-mica) 220px);
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.19), 0 2px 21px rgba(0, 0, 0, 0.15);
  color: var(--w-text);
  font-family: "Segoe UI Variable Text", "Segoe UI Variable", "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 14px;
  line-height: 20px;
  -webkit-font-smoothing: antialiased;
}

.oa *, .oa *::before, .oa *::after { box-sizing: border-box; }
.oa button, .oa input { font: inherit; color: inherit; }
.oa button { cursor: pointer; }
.oa h3 { margin: 0; font-family: "Segoe UI Variable Display", "Segoe UI Variable", "Segoe UI", system-ui, sans-serif; font-weight: 600; letter-spacing: 0; }

.oa svg {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Focus vizibil Fluent: contur dublu, negru in afara si alb in interior. */
.oa :focus-visible { outline: 2px solid #000; outline-offset: 1px; box-shadow: 0 0 0 1px #fff inset; }

/* ---------- Bara de titlu ---------- */
.oa-titlebar { display: flex; align-items: center; gap: 12px; padding-left: 16px; user-select: none; }
.oa-appicon { display: grid; place-items: center; width: 18px; height: 18px; color: var(--w-accent); }
.oa-appicon svg { width: 18px; height: 18px; stroke-width: 1.4; }
.oa-apptitle { font-size: 12px; }
.oa-caption { display: flex; align-self: stretch; margin-left: auto; }
.oa-caption i { display: grid; place-items: center; width: 46px; color: var(--w-text); }
.oa-caption svg { width: 14px; height: 14px; stroke-width: 1; }

.oa-burger {
  display: none;
  place-items: center;
  width: 36px;
  height: 32px;
  margin-left: -10px;
  border: 0;
  border-radius: 4px;
  background: none;
}

.oa-burger:hover { background: var(--w-subtle-hover); }

/* ---------- Corpul: panou de navigare + continut ---------- */
.oa-body { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 0; }

.oa-pane { display: flex; flex-direction: column; gap: 2px; min-height: 0; padding: 4px 4px 12px; }

.oa-account { position: relative; margin: 0 0 10px; }

.oa-persona {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  border-radius: 4px;
  padding: 8px 10px;
  background: none;
  text-align: left;
}

.oa-persona:hover { background: var(--w-subtle-hover); }
.oa-persona:active { background: var(--w-subtle-press); }

.oa-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 50%;
  background: #dfe5ee;
  color: var(--w-text);
  font-size: 13px;
  font-weight: 600;
}

.oa-who { display: grid; min-width: 0; }
.oa-who strong { font-weight: 600; }
.oa-who small { color: var(--w-text-2); font-size: 12px; line-height: 16px; }
.oa-persona .oa-chev { margin-left: auto; color: var(--w-text-2); transition: transform 160ms ease; }
.oa-persona[aria-expanded="true"] .oa-chev { transform: rotate(180deg); }

/* Flyout acrylic */
.oa-menu, .oa-sug {
  position: absolute;
  z-index: 20;
  border: 1px solid var(--w-stroke);
  border-radius: 8px;
  padding: 4px;
  background: var(--w-acrylic);
  box-shadow: var(--w-shadow-flyout);
  -webkit-backdrop-filter: blur(30px) saturate(125%);
  backdrop-filter: blur(30px) saturate(125%);
  animation: oa-pop 160ms cubic-bezier(0, 0, 0, 1);
}

.oa-menu[hidden], .oa-sug[hidden] { display: none; }

@keyframes oa-pop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.oa-menu { top: calc(100% + 4px); right: 0; left: 0; }
.oa-menu p, .oa-sug p { margin: 4px 10px 6px; color: var(--w-text-2); font-size: 12px; line-height: 16px; }

.oa-menu button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  border-radius: 4px;
  padding: 6px 10px;
  background: none;
  text-align: left;
}

.oa-menu button:hover { background: var(--w-subtle-hover); }
.oa-menu .oa-avatar { width: 28px; height: 28px; font-size: 11px; }
.oa-menu span:last-child { display: grid; }
.oa-menu strong { font-weight: 400; }
.oa-menu small { color: var(--w-text-2); font-size: 12px; line-height: 16px; }
.oa-menu button[aria-checked="true"] { background: var(--w-subtle-hover); }

/* Indicatorul de selectie Fluent: pastila de accent din stanga. */
.oa-menu button[aria-checked="true"]::before,
.oa-nav[aria-current]::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 3px;
  height: 16px;
  border-radius: 2px;
  background: var(--w-accent);
  transform: translateY(-50%);
}

.oa-nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 36px;
  border: 0;
  border-radius: 4px;
  padding: 0 12px;
  background: none;
  text-align: left;
}

.oa-nav:hover { background: var(--w-subtle-hover); }
.oa-nav:active { background: var(--w-subtle-press); }
.oa-nav[aria-current] { background: var(--w-subtle-hover); font-weight: 600; }
.oa-nav svg { width: 18px; height: 18px; }

.oa-navhead { margin: 14px 12px 4px; color: var(--w-text-2); font-size: 12px; font-weight: 600; line-height: 16px; }

/* ---------- Continutul (stratul peste Mica) ---------- */
.oa-content {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-top: 1px solid var(--w-stroke);
  border-left: 1px solid var(--w-stroke);
  border-top-left-radius: 8px;
  background: var(--w-layer);
}

.oa-view { display: none; height: 100%; flex-direction: column; min-height: 0; }
.oa-view.is-active { display: flex; }

.oa-top { padding: 22px 28px 16px; }
.oa-top h3, .oa-page h3 { margin-bottom: 14px; font-size: 28px; line-height: 36px; }

.oa-search { display: flex; gap: 8px; max-width: 760px; }
.oa-box { position: relative; flex: 1; min-width: 0; }

.oa-box input {
  width: 100%;
  height: 34px;
  border: 1px solid var(--w-stroke);
  border-bottom-color: #868686;
  border-radius: 4px;
  padding: 0 40px 0 11px;
  background: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

.oa-box input:hover { background: #f9f9f9; }
.oa-box input:focus { border-bottom: 2px solid var(--w-accent); padding-bottom: 1px; background: #fff; outline: none; box-shadow: none; }
.oa-box input::-webkit-search-cancel-button { display: none; }

.oa-sug-btn {
  position: absolute;
  top: 3px;
  right: 3px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 28px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--w-text-2);
}

.oa-sug-btn:hover { background: var(--w-subtle-hover); }

.oa-sug { top: calc(100% + 4px); right: 0; left: 0; }

.oa-sug button {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 8px;
  width: 100%;
  border: 0;
  border-radius: 4px;
  padding: 8px 10px;
  background: none;
  text-align: left;
}

.oa-sug button:hover { background: var(--w-subtle-hover); }
.oa-sug em { color: var(--w-text-3); font-size: 12px; font-style: normal; }

.oa .oa-accent {
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom-color: rgba(0, 0, 0, 0.4);
  border-radius: 4px;
  padding: 0 20px;
  background: var(--w-accent);
  color: #fff;
}

.oa .oa-accent:hover { background: var(--w-accent-hover); }
.oa .oa-accent:active { background: var(--w-accent-press); }

/* ---------- Raspuns + document ---------- */
.oa-split {
  display: grid;
  flex: 1;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: 12px;
  min-height: 0;
  padding: 0 28px 24px;
}

.oa-col { min-height: 0; overflow-y: auto; scrollbar-width: thin; }

/* Fara raspuns nu exista document: mesajul ramane singur, pe latimea cautarii. */
.oa-split.is-gol { grid-template-columns: minmax(0, 760px); }
.oa-split.is-gol .oa-doc { display: none; }

.oa-card {
  border: 1px solid var(--w-stroke-2);
  border-radius: 8px;
  padding: 16px 18px;
  background: var(--w-card);
}

.oa-answer h4 { margin: 0 0 10px; font-size: 16px; font-weight: 600; line-height: 22px; }
.oa-point { margin: 0 0 8px; }
.oa-point b { font-weight: 600; }
.oa-point ul { margin: 4px 0 0; padding-left: 18px; }
.oa-point li { margin-bottom: 4px; }
.oa-nw { white-space: nowrap; }

.oa-cites { position: relative; top: -0.4em; margin-left: 2px; color: var(--w-accent); font-size: 11px; font-weight: 600; line-height: 0; }
.oa .oa-cite { border: 0; padding: 0; background: none; color: var(--w-accent); font-size: inherit; font-weight: inherit; }
.oa .oa-cite:hover, .oa .oa-cite.is-on { color: var(--w-accent-text); text-decoration: underline; text-underline-offset: 2px; }

.oa-nota { display: flex; align-items: center; gap: 6px; margin: 12px 0 0; color: var(--w-text-2); font-size: 12px; line-height: 16px; }
.oa-nota svg { width: 14px; height: 14px; color: var(--w-text-3); }

.oa-sources h4 { margin: 18px 2px 8px; font-size: 14px; font-weight: 600; }

/* Randurile de surse: carduri stivuite, ca in Setari. */
.oa-src {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 2px 12px;
  margin-bottom: 4px;
  border: 1px solid var(--w-stroke-2);
  border-radius: 6px;
  padding: 11px 12px 11px 14px;
  background: var(--w-card);
  cursor: pointer;
}

.oa-src:hover { border-color: #d6d6d6; background: #fbfbfb; }
.oa-src.is-open { border-color: rgba(0, 95, 184, 0.35); background: #f5f9fd; }
.oa-src.is-open::before { content: ""; position: absolute; top: 12px; left: -1px; width: 3px; height: 18px; border-radius: 2px; background: var(--w-accent); }

.oa-src-n {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: #f0f0f0;
  color: var(--w-text-2);
  font-size: 12px;
  font-weight: 600;
}

.oa-src.is-open .oa-src-n { background: var(--w-accent); color: #fff; }
.oa-src-body { min-width: 0; }
.oa-src-body strong { display: block; font-weight: 600; }
.oa-src-body span { display: block; color: var(--w-text-2); font-size: 12px; line-height: 16px; }

.oa-src-body p {
  display: -webkit-box;
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--w-text-2);
  font-size: 13px;
  line-height: 18px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.oa mark { background: none; color: var(--w-text); font-weight: 600; }

.oa-dl { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 4px; color: var(--w-text-2); }
.oa-dl:hover { background: var(--w-subtle-hover); color: var(--w-text); }

@keyframes oa-flash { from { box-shadow: 0 0 0 3px rgba(0, 95, 184, 0.35); } to { box-shadow: 0 0 0 0 rgba(0, 95, 184, 0); } }
.oa-src.is-flash { animation: oa-flash 0.9s ease-out; }

/* Documentul: card cu antet fix si foaia documentului */
.oa-doc { border: 1px solid var(--w-stroke-2); border-radius: 8px; background: #f3f3f3; }

.oa-doc-head {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 12px 16px;
  border-bottom: 1px solid var(--w-stroke-2);
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

.oa-doc-head strong { display: block; font-weight: 600; }
.oa-doc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; margin-top: 2px; color: var(--w-text-2); font-size: 12px; line-height: 16px; }
.oa-doc-meta a { color: var(--w-accent); }
.oa-doc-meta a:hover { text-decoration: underline; }

.oa-sheet {
  margin: 14px 16px 18px;
  border-radius: 2px;
  padding: 26px 28px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
  font-size: 13.5px;
  line-height: 21px;
}

.oa-sheet h5 { margin: 16px 0 6px; font-size: 13.5px; font-weight: 600; }
.oa-sheet h5:first-child { margin-top: 0; }
.oa-sheet p { margin: 0 0 10px; }
.oa-sheet p.is-hit { position: relative; margin: 0 -12px 10px; border-radius: 4px; padding: 6px 12px; background: var(--w-accent-soft); }
.oa-sheet p.is-hit::before { content: ""; position: absolute; top: 8px; bottom: 8px; left: 0; width: 3px; border-radius: 2px; background: var(--w-accent); }

.oa-scan-label { margin: 14px 16px 6px; color: var(--w-text-2); font-size: 12px; font-weight: 600; line-height: 16px; }
.oa-scan { display: block; margin: 0 16px; border-radius: 2px; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04); cursor: zoom-in; }
.oa-scan img { display: block; width: 100%; height: auto; }
.oa-scan + .oa-scan-label { margin-top: 16px; }
.oa-scan-label + .oa-sheet { margin-top: 0; }

/* ---------- Stari: InfoBar Fluent ---------- */
.oa-info {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 2px 12px;
  border: 1px solid var(--w-stroke);
  border-radius: 4px;
  padding: 14px 16px;
  background: #f6f6f6;
}

.oa-info svg { width: 16px; height: 16px; margin-top: 2px; color: var(--w-accent); stroke-width: 1.5; }
.oa-info strong { font-weight: 600; }
.oa-info p { grid-column: 2; margin: 0; color: var(--w-text-2); }
.oa-empty { display: grid; place-items: center; height: 100%; min-height: 160px; padding: 24px; color: var(--w-text-3); text-align: center; }

.oa-skel { display: grid; gap: 10px; padding: 18px; }
.oa-skel span { display: block; height: 10px; border-radius: 4px; background: linear-gradient(90deg, #ececec, #f5f5f5, #ececec); background-size: 200% 100%; animation: oa-shim 1.2s linear infinite; }
.oa-skel span:nth-child(2) { width: 86%; }
.oa-skel span:nth-child(3) { width: 72%; }
.oa-skel span:nth-child(4) { width: 54%; }
@keyframes oa-shim { to { background-position: -200% 0; } }

/* ---------- Surse / Acces / Jurnal ---------- */
.oa-page { overflow-y: auto; padding: 22px 28px 28px; }
.oa-page h3 { margin-bottom: 4px; }
.oa-lead { max-width: 680px; margin: 0 0 18px; color: var(--w-text-2); }

.oa-grid { overflow: hidden; border: 1px solid var(--w-stroke-2); border-radius: 8px; background: var(--w-card); }
.oa-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.oa-table th { padding: 10px 14px; border-bottom: 1px solid var(--w-stroke-2); color: var(--w-text-2); font-size: 12px; font-weight: 600; text-align: left; }
.oa-table td { height: 42px; padding: 6px 14px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.oa-table tr:last-child td { border-bottom: 0; }
.oa-table tbody tr:hover td { background: #fafafa; }
.oa-table .c { width: 110px; text-align: center; }
.oa-table .is-me, .oa-table tbody tr:hover td.is-me { background: var(--w-accent-soft); }
.oa-table th.is-me { color: var(--w-accent-text); }
.oa-table .t { color: var(--w-text-3); font-size: 12px; white-space: nowrap; }
.oa-table .muted { color: var(--w-text-3); }
.oa-yes svg { width: 16px; height: 16px; stroke-width: 1.6; }
.oa-no { color: #c4c4c4; }
.oa-s { display: none; }
.oa-path { font-weight: 600; }
.oa-sub { display: block; color: var(--w-text-2); font-size: 12px; line-height: 16px; }

/* ToggleSwitch Fluent */
.oa-switch { position: relative; display: inline-block; width: 40px; height: 20px; vertical-align: middle; cursor: pointer; }
.oa-switch input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.oa-switch i { position: absolute; inset: 0; border: 1px solid #868686; border-radius: 10px; background: rgba(0, 0, 0, 0.02); transition: background 120ms; }
.oa-switch i::after { content: ""; position: absolute; top: 3px; left: 4px; width: 12px; height: 12px; border-radius: 50%; background: #5d5d5d; transition: transform 160ms cubic-bezier(0, 0, 0, 1); }
.oa-switch input:checked + i { border-color: var(--w-accent); background: var(--w-accent); }
.oa-switch input:checked + i::after { background: #fff; transform: translateX(18px); }
.oa-switch input:focus-visible + i { outline: 2px solid #000; outline-offset: 2px; }

/* ---------- Ferestre mai inguste: NavigationView „compact”, apoi „minimal” ---------- */
@media (max-width: 1100px) {
  .oa-stage { padding: 24px; }
  .oa { height: auto; min-height: 640px; }
  .oa-body { grid-template-columns: 52px minmax(0, 1fr); }
  .oa-nav span, .oa-navhead, .oa-who, .oa-persona .oa-chev { display: none; }
  .oa-nav { justify-content: center; padding: 0; }
  .oa-persona { justify-content: center; padding: 6px 0; }
  .oa-avatar { width: 32px; height: 32px; font-size: 12px; }
  .oa-menu { right: auto; width: 240px; }
  .oa-burger { display: grid; }
  .oa-split { grid-template-columns: minmax(0, 1fr); }
  .oa-col { overflow: visible; }
  .oa-doc-head { position: static; }
  .oa-view { height: auto; }
  .oa-page { overflow: visible; }

  /* Panoul deschis din ☰ se suprapune peste continut, ca in Windows. */
  .oa.is-pane-open .oa-pane {
    position: absolute;
    z-index: 15;
    top: 44px;
    bottom: 0;
    left: 0;
    width: 280px;
    border: 1px solid var(--w-stroke);
    border-radius: 0 8px 8px 0;
    background: var(--w-acrylic);
    box-shadow: var(--w-shadow-flyout);
    -webkit-backdrop-filter: blur(30px) saturate(125%);
    backdrop-filter: blur(30px) saturate(125%);
  }
  .oa.is-pane-open .oa-nav span, .oa.is-pane-open .oa-navhead { display: block; }
  .oa.is-pane-open .oa-who { display: grid; }
  .oa.is-pane-open .oa-persona .oa-chev { display: block; }
  .oa.is-pane-open .oa-nav { justify-content: flex-start; padding: 0 12px; }
  .oa.is-pane-open .oa-persona { justify-content: flex-start; padding: 8px 10px; }
  .oa.is-pane-open .oa-menu { right: 0; width: auto; }
}

@media (max-width: 640px) {
  .oa-stage { border-radius: 10px; padding: 8px; }
  .oa-body { grid-template-columns: minmax(0, 1fr); }
  .oa-pane { display: none; }
  .oa.is-pane-open .oa-pane { display: flex; }
  .oa-content { border-left: 0; border-top-left-radius: 0; }
  .oa-caption i { width: 40px; }
  .oa-top { padding: 16px 14px 12px; }
  .oa-top h3, .oa-page h3 { font-size: 24px; line-height: 32px; }
  .oa .oa-accent { padding: 0 14px; }
  .oa-split { padding: 0 10px 14px; }
  .oa-card { padding: 14px; }
  .oa-sheet { margin: 12px 10px 14px; padding: 18px 16px; }
  .oa-scan, .oa-scan-label { margin-right: 10px; margin-left: 10px; }
  .oa-page { padding: 16px 12px 20px; }
  .oa-table th, .oa-table td { padding: 6px; }
  .oa-table .c { width: auto; }
  .oa-table .oa-l { display: none; }
  .oa-table .oa-s { display: inline; }
  .oa-table .t { display: none; }
  .oa-grid { overflow-x: auto; }
}
