:root{
  /* EPIC 1: global background + typography scale */
  --bg:#f1f7fb;
  --card:#ffffffcc;
  --card-solid:#ffffff;
  --text:#0b1220;
  --muted:#516079;
  --blue:#0070F0;
  --blue-2:#4DA6FF;
  --border:#dbe8ff;
  --shadow: 0 10px 35px rgba(13, 55, 120, .12);

  /* Typography (<= 5 sizes) */
  --fs-h1:40px;
  --fs-h2:28px;
  --fs-h3:20px;
  --fs-body:15px;
  --fs-caption:12px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Liberation Sans";
  color:var(--text);
  /* No gradients / decorative patterns (EPIC 1.1) */
  background: var(--bg);
  font-size: var(--fs-body);
  overflow-x:hidden;
}

/* Decorative backgrounds removed (EPIC 1.1) */
.bg-orbs{ display:none !important; }

.container{
  min-height:100%;
  display:flex;
  flex-direction:column;
}

.topbar{
  position:sticky; top:0;
  backdrop-filter: blur(10px);
  background: rgba(255,255,255,.92);
  border-bottom:1px solid rgba(219,232,255,.9);
  z-index:10;
}

.topbar-inner{
  max-width:1100px;
  margin:0 auto;
  padding:16px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.brand{
  display:flex; align-items:center; gap:10px;
  font-weight:600; letter-spacing:.2px;
}
.logo{
  width:34px; height:34px; border-radius:12px;
  background: var(--blue);
  box-shadow: 0 8px 20px rgba(43,124,255,.25);
}
.brand span{font-size:var(--fs-body)}
.nav-actions{display:flex; gap:10px; align-items:center;}

.btn{
  border:1px solid var(--border);
  background: #ffffff;
  color:var(--text);
  padding:10px 12px;
  border-radius:12px;
  box-shadow: 0 6px 16px rgba(13,55,120,.08);
  cursor:pointer;
  transition: transform .08s ease, box-shadow .15s ease, border-color .15s ease;
  user-select:none;
  font-weight:600;
}
.btn:hover{ transform: translateY(-1px); border-color:#c7dcff; box-shadow: 0 10px 24px rgba(13,55,120,.12);}
.btn:active{ transform: translateY(0px); box-shadow: 0 6px 16px rgba(13,55,120,.09);}
.btn.primary{
  border-color: rgba(43,124,255,.35);
  background: var(--blue);
  color:white;
}
.btn.ghost{
  background: transparent;
  border-color: transparent;
  box-shadow:none;
  color:var(--muted);
}
.btn.ghost:hover{border-color: rgba(219,232,255,.9); background: rgba(255,255,255,.6); box-shadow: 0 10px 24px rgba(13,55,120,.08); color:var(--text);}

main{
  flex:1;
  max-width:1100px;
  width:100%;
  margin:0 auto;
  padding:26px 18px 54px;
}

.hero{
  margin: 26px auto 14px;
  text-align:center;
}
.hero h1{
  margin:0 0 10px;
  font-size:var(--fs-h1);
  line-height:1.05;
  letter-spacing:-.6px;
}
.hero p{
  margin:0;
  color:var(--muted);
  font-size:var(--fs-body);
}

.search-wrap{
  margin: 22px auto 10px;
  max-width:760px;
  position:relative;
}
.search{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 14px 14px 14px 16px;
  background: var(--card);
  border:1px solid rgba(219,232,255,.95);
  border-radius:18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.search input{
  flex:1;
  border:none;
  outline:none;
  font-size:16px;
  background:transparent;
  color:var(--text);
}
.search .hint{
  font-size:12px;
  color:var(--muted);
  white-space:nowrap;
  display:none;
}
@media (min-width:860px){ .search .hint{display:block;} }

.suggestions{  z-index:25;

  position:absolute;
  left:0; right:0;
  margin-top:10px;
  background: rgba(255,255,255,.92);
  border:1px solid rgba(219,232,255,.95);
  border-radius:16px;
  box-shadow: var(--shadow);
  overflow:hidden;
  display:none;
  backdrop-filter: blur(10px);
}
.suggestions.open{display:block;}
.suggestion{
  padding:10px 12px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  cursor:pointer;
}
.suggestion:hover{background: rgba(246,251,255,1);}
.suggestion .meta{
  font-size:12px; color:var(--muted);
  border:1px solid rgba(219,232,255,.95);
  padding:4px 8px;
  border-radius:999px;
  background: rgba(246,251,255,1);
}

.grid{
  margin-top:18px;
  display:grid;
  grid-template-columns: 1fr;
  gap:14px;
}
@media (min-width:900px){
  .grid{ grid-template-columns: 1.2fr .8fr; gap:16px; }
}

.card{
  background: var(--card);
  border:1px solid rgba(219,232,255,.95);
  border-radius:18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  padding:16px;
}
.card h2{
  margin:0 0 10px;
  font-size:16px;
}
.row{
  display:flex; gap:10px; flex-wrap:wrap; align-items:center;
}
.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 12px;
  border-radius:999px;
  border:1px solid rgba(219,232,255,.95);
  background: rgba(255,255,255,.78);
  cursor:pointer;
  transition: transform .08s ease, border-color .15s ease;
  user-select:none;
}
.pill:hover{ transform: translateY(-1px); border-color:#c7dcff;}
.pill.active{
  border-color: rgba(43,124,255,.55);
  background: rgba(43,124,255,.10);
}
.pill small{color:var(--muted); font-weight:650;}

.field{
  display:flex;
  flex-direction:column;
  gap:6px;
  margin-top:10px;
}
.label{font-size:12px; color:var(--muted); font-weight:700;}
textarea{
  width:100%;
  min-height:78px;
  resize:vertical;
  border-radius:14px;
  border:1px solid rgba(219,232,255,.95);
  padding:10px 12px;
  outline:none;
  font-size:14px;
  background: rgba(255,255,255,.86);
}
textarea:focus{ border-color: rgba(43,124,255,.5); box-shadow: 0 0 0 4px rgba(43,124,255,.12); }

.divider{ height:1px; background: rgba(219,232,255,.95); margin:14px 0; }

.q-list{ display:flex; flex-direction:column; gap:10px; margin-top:10px; }
.q{
  background: rgba(255,255,255,.88);
  border:1px solid rgba(219,232,255,.95);
  border-radius:16px;
  padding:12px 12px 10px;
}
.q-top{ display:flex; justify-content:space-between; gap:10px; align-items:flex-start; }
.q-num{ color:var(--muted); font-weight:800; font-size:12px; }
.q-actions{ display:flex; gap:8px; }
.icon-btn{
  width:34px; height:34px;
  border-radius:12px;
  border:1px solid rgba(219,232,255,.95);
  background: rgba(246,251,255,1);
  cursor:pointer;
}
.icon-btn:hover{ border-color:#c7dcff; }
.q-text{
  margin-top:6px;
  outline:none;
  padding:8px 10px;
  border-radius:12px;
  border:1px dashed transparent;
}
.q-text:focus{
  background: rgba(246,251,255,1);
  border-color: rgba(43,124,255,.35);
  box-shadow: 0 0 0 4px rgba(43,124,255,.10);
}

.footer{
  border-top:1px solid rgba(219,232,255,.95);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
}
.footer-inner{
  max-width:1100px;
  margin:0 auto;
  padding:14px 18px;
  color:var(--muted);
  font-size:13px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}
.link{
  color:var(--blue);
  text-decoration:none;
  font-weight:600;
}
.link:hover{
  color:#b0e277;
  text-decoration:none;
}

/* Cookie banner */
.cookie-banner{
  position:fixed;
  left:0;
  right:0;
  bottom:0;
  z-index:60;
  transform: translateY(110%);
  opacity:0;
  pointer-events:none;
  transition: transform .25s ease, opacity .25s ease;
}
.cookie-banner--visible{
  transform: translateY(0);
  opacity:1;
  pointer-events:auto;
}
.cookie-banner__inner{
  max-width:1100px;
  margin:0 auto 14px;
  padding:12px 16px;
  border-radius:999px;
  background: rgba(15,23,42,.94);
  color:#e5e7eb;
  box-shadow: 0 18px 40px rgba(15,23,42,.6);
  display:flex;
  align-items:flex-start;
  gap:16px;
}
.cookie-banner__text{
  font-size:13px;
  line-height:1.5;
  flex:1 1 auto;
}
.cookie-banner__text .link{
  color:#a5b4fc;
}
.cookie-banner__text .link:hover{
  color:#c7d2fe;
}
.cookie-banner__actions{
  display:flex;
  gap:8px;
  flex-shrink:0;
}
.cookie-banner__actions .btn{
  font-size:13px;
  padding:6px 12px;
}
@media (max-width: 720px){
  .cookie-banner__inner{
    border-radius:18px;
    flex-direction:column;
    align-items:stretch;
  }
  .cookie-banner__actions{
    justify-content:flex-end;
  }
}

.modal-backdrop{
  position:fixed; inset:0;
  background: rgba(9,16,30,.35);
  display:none;
  /* Center dialog within the area below the fixed header */
  flex-direction:column;
  align-items:center;
  justify-content:center;
  /* Top padding keeps it clear of the header; centering happens in the remaining space */
  padding: calc(18px + var(--site-header-offset, 0px)) 18px 18px;
  z-index:50;
  overflow:auto;
  opacity:0;
  pointer-events:none;
  transition: opacity .18s ease;
}
.modal-backdrop.open{display:flex; opacity:1; pointer-events:auto;}
.modal,
.modal-card{
  max-width:640px;
  width:100%;
  background: rgba(255,255,255,.95);
  border:1px solid rgba(219,232,255,.95);
  border-radius:18px;
  box-shadow: 0 18px 60px rgba(9,16,30,.25);
  padding:16px;
  /* Keep the top of the modal visible under the site header */
  margin-top:0;
  margin-bottom:24px;
  /* Fit into viewport even with a tall header */
  max-height: calc(100vh - var(--site-header-offset, 0px) - 48px);
  overflow:auto;
  transform: translateY(10px) scale(.995);
  opacity: .98;
  transition: transform .18s ease, opacity .18s ease;
}
.modal-backdrop.open .modal,
.modal-backdrop.open .modal-card{
  transform: translateY(0) scale(1);
  opacity: 1;
}
.modal h3{ margin:0 0 6px; }
.modal p{ margin: 8px 0; color:var(--muted); }
.modal .modal-actions{ display:flex; justify-content:flex-end; gap:10px; margin-top:12px; }

/* Header row for modal-card variants (e.g., generator modal) */
.modal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.modal-head h3{ margin:0; }

/* Generator modal ("Генерация вопросов") spacing + hierarchy */
#genModal .gen-body{
  margin-top:12px;
  max-height:60vh;
  overflow:auto;
}
#genModal .gen-meta{
  font-size:13px;
  color:var(--muted);
  line-height:1.45;
  padding-bottom:12px;
  border-bottom:1px solid rgba(0,0,0,.06);
}
#genModal .gen-meta b{ font-weight:700; color: rgba(0,0,0,.78); }
#genModal .gen-state{
  margin:16px 0;
}
#genModal .gen-state-title{
  font-weight:900;
  margin:0 0 6px;
}
#genModal .gen-hint{
  font-size:12px;
  color:var(--muted);
  line-height:1.45;
  margin:0;
}
#genModal .q-preview{
  margin-top:10px;
  border:1px solid rgba(219,232,255,.95);
  border-radius:14px;
  padding:10px;
  background: rgba(255,255,255,.88);
}
#genModal .btn.secondary{ margin-top:10px; }
#genModal .gen-note{
  margin-top:12px;
  padding-top:12px;
  border-top:1px solid rgba(0,0,0,.06);
  color:var(--muted);
  line-height:1.45;
}

/* --- Modal layout helpers (request modal + general spacing) --- */
.modal-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding-bottom:10px;
  border-bottom:1px solid rgba(0,0,0,.08);
}
.modal-title{
  font-size:18px;
  font-weight:800;
  line-height:1.2;
}
.modal-close{
  width:36px;
  height:36px;
  border-radius:12px;
  border:1px solid rgba(219,232,255,.95);
  background: rgba(246,251,255,1);
  cursor:pointer;
  font-size:22px;
  line-height:1;
  display:flex;
  align-items:center;
  justify-content:center;
  color: rgba(0,0,0,.55);
}
.modal-close:hover{ border-color:#c7dcff; }

.modal-body{ padding:12px 0; }
.modal-footer{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  padding-top:10px;
  border-top:1px solid rgba(0,0,0,.08);
  flex-wrap:wrap;
}

.form-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:12px;
}
@media (max-width: 720px){
  .form-grid{ grid-template-columns: 1fr; }
}

.form-group{ margin-top:12px; }
.form-group:first-child{ margin-top:0; }
.form-group label{
  display:block;
  font-size:13px;
  font-weight:800;
  color: rgba(0,0,0,.72);
  margin-bottom:6px;
}
.form-group .small{
  margin-top:6px;
  font-size:12px;
  color: var(--muted);
}

/* Make request questions list breathe */
.request-questions{ display:flex; flex-direction:column; gap:8px; }

/* Ensure modal buttons don't stick to edges */
.modal-backdrop .modal{ padding:16px; }
.badge{
  display:inline-flex; align-items:center; gap:8px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(219,232,255,.95);
  background: rgba(246,251,255,1);
  color:var(--muted);
  font-weight:800;
  font-size:12px;
}
.toast{
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  background: rgba(11,18,32,.92);
  color:white;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 13px;
  display:none;
  z-index:80;
}
.toast.show{display:block;}


/* Drawer for parameters */
.drawer-backdrop{
  position:fixed; inset:0;
  background: rgba(9,16,30,.28);
  display:none;
  z-index:40;
}
.drawer-backdrop.open{display:block;}
.drawer{
  position:fixed;
  top:0; left:0;
  height:100%;
  width:min(420px, 92vw);
  background: rgba(255,255,255,.96);
  border-right:1px solid rgba(219,232,255,.95);
  box-shadow: 0 18px 60px rgba(9,16,30,.18);
  transform: translateX(-105%);
  transition: transform .18s ease;
  z-index:45;
  padding:16px;
  overflow:auto;
}
.drawer-backdrop.open .drawer{transform: translateX(0);}
.drawer h2{margin:0 0 8px; font-size:16px;}
.drawer .drawer-actions{display:flex; justify-content:flex-end; gap:10px; margin-top:12px;}

.icon-gear{
  width:42px; height:42px;
  border-radius:16px;
  border:1px solid rgba(219,232,255,.95);
  background: rgba(255,255,255,.86);
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  box-shadow: 0 8px 20px rgba(13,55,120,.10);
}
.icon-gear:hover{border-color:#c7dcff; transform: translateY(-1px);}
.icon-gear:active{transform: translateY(0px);}

/* Multi-select pills */
.pill.multi::after{
  content:"";
  width:8px; height:8px;
  border-radius:999px;
  background: rgba(43,124,255,.0);
  margin-left:6px;
}
.pill.active.multi::after{
  background: rgba(0,112,240,.95);
}

/* Request modal */
.form-grid{display:grid; grid-template-columns:1fr; gap:10px;}
@media(min-width:720px){ .form-grid{ grid-template-columns:1fr 1fr; } }
.input{
  width:100%;
  border-radius:14px;
  border:1px solid rgba(219,232,255,.95);
  padding:10px 12px;
  outline:none;
  background: rgba(255,255,255,.86);
  font-size:14px;
}
.input:focus{ border-color: rgba(0,112,240,.55); box-shadow: 0 0 0 4px rgba(0,112,240,.12); }
.filebox{
  border:1px dashed rgba(219,232,255,.95);
  background: rgba(246,251,255,1);
  padding:12px;
  border-radius:16px;
}
.filelist{margin:8px 0 0; padding-left:18px; color:var(--muted); font-size:13px;}
.small{font-size:12px; color:var(--muted);}


/* Params panel under search */
.search-wrap{position:relative; z-index:30;}
.params-panel{
  margin-top:12px;
  background: rgba(255,255,255,.92);
  border:1px solid rgba(219,232,255,.95);
  border-radius:18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  padding:14px;
  display:none;
}
.params-panel.open{display:block;}
.params-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap:12px;
}
@media(min-width:980px){
  .params-grid{grid-template-columns: 1fr 1fr;}
  .params-grid .field{grid-column:1 / -1;}
}


/* Decorative backgrounds removed (EPIC 1.1) */
.bg-blueprint{ display:none !important; }

.header-nav{
  display:flex; gap:16px; align-items:center; flex-wrap:wrap;
  font-weight:700; color:var(--muted);
}
.header-nav a{
  color:var(--muted);
  text-decoration:none;
  padding:8px 10px;
  border-radius:12px;
}
.header-nav a:hover{
  background: rgba(246,251,255,1);
  color:var(--text);
  border:1px solid rgba(219,232,255,.95);
}

/* Autocomplete multi-select fields */
.selectbox{
  position:relative;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  padding:10px 10px;
  border-radius:16px;
  border:1px solid rgba(219,232,255,.95);
  background: rgba(255,255,255,.86);
}
.selectbox input{
  border:none; outline:none;
  min-width:180px;
  flex:1;
  font-size:14px;
  background:transparent;
}
.chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border-radius:999px;
  background: rgba(0,112,240,.12);
  border:1px solid rgba(0,112,240,.20);
  color: var(--text);
  font-weight:750;
  font-size:13px;
}
.chip .x{
  cursor:pointer;
  width:18px;height:18px;
  border-radius:6px;
  display:flex;align-items:center;justify-content:center;
  border:1px solid rgba(0,112,240,.25);
  background: rgba(255,255,255,.7);
}
.chip.exam{ background: rgba(77,166,255,.12); border-color: rgba(77,166,255,.25); }

.dropdown{
  position:absolute;
  left:0; right:0;
  top: calc(100% + 8px);
  background: rgba(255,255,255,.96);
  border:1px solid rgba(219,232,255,.95);
  border-radius:16px;
  box-shadow: var(--shadow);
  overflow:hidden;
  display:none;
  z-index:30;
  max-height: 260px;
  overflow:auto;
}
.dropdown.open{ display:block; }
.dd-item{
  padding:10px 12px;
  display:flex;
  justify-content:space-between;
  gap:10px;
  cursor:pointer;
}
.dd-item:hover{ background: rgba(246,251,255,1); }
.dd-item small{ color:var(--muted); font-weight:750; }

.stepper{
  display:flex; gap:8px; align-items:center;
}
.stepper button{
  width:38px; height:38px;
  border-radius:14px;
  border:1px solid rgba(219,232,255,.95);
  background: rgba(255,255,255,.86);
  cursor:pointer;
  box-shadow: 0 6px 16px rgba(13,55,120,.08);
}
.stepper input{
  width:74px;
  text-align:center;
}

/* Explanations panel */
.explain{
  display:none;
}
.explain.open{ display:block; }
.explain h2{ margin:0 0 10px; font-size:16px; }
.explain .item{ margin:10px 0; }
.explain .item b{ display:block; margin-bottom:4px; }


/* LSEI header replica */
.lsei-header{
  position:sticky;
  top:0;
  z-index:60;
  background:#fff;
}

/* When any modal is open, reduce the header to just the logo so it never covers the dialog. */
body.modal-open .lsei-nav{ display:none; }
body.modal-open .lsei-top-mid,
body.modal-open .lsei-top-right{ display:none; }
body.modal-open .lsei-top-inner{
  justify-content:flex-start;
  padding:8px 18px;
}
body.modal-open .lsei-logo{ height:36px; }
.lsei-top{
  background:#fff;
  border-bottom:1px solid rgba(219,232,255,.95);
}
.lsei-top-inner{
  max-width:1100px;
  margin:0 auto;
  padding:10px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}
.lsei-brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:120px;
}
.lsei-logo{
  height:44px;
  width:auto;
  display:block;
}
.lsei-brand-text{line-height:1.1}
.lsei-brand-name{
  font-weight:900;
  font-size:24px;
  color:var(--blue);
  letter-spacing:.2px;
}
.lsei-brand-sub{
  font-size:12px;
  color:var(--muted);
  font-weight:700;
}
.lsei-top-mid{
  display:flex;
  flex-direction:column;
  gap:6px;
  flex:1;
  min-width:280px;
}
.lsei-meta{
  display:flex;
  align-items:center;
  gap:10px;
  color:var(--muted);
  font-size:var(--fs-caption);
  font-weight:500;
}
.lsei-meta .dot{
  width:10px; height:10px;
  border-radius:999px;
  background: rgba(0,112,240,.20);
  border:1px solid rgba(0,112,240,.25);
}
.lsei-top-right{
  display:flex;
  flex-direction:column;
  gap:6px;
  align-items:flex-end;
  min-width:240px;
}
.lsei-phones{
  display:flex;
  gap:16px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.lsei-phones a{
  color:var(--text);
  text-decoration:none;
  font-weight:900;
  font-size:14px;
}
.lsei-phones a:hover{ text-decoration:underline; }
.lsei-links{
  display:flex;
  gap:16px;
  flex-wrap:wrap;
  justify-content:flex-end;
  font-size:12px;
}
.lsei-links a{
  color:var(--muted);
  text-decoration:none;
  font-weight:800;
}
.lsei-links a:hover{ text-decoration:underline; }

.lsei-nav{
  background: rgba(246,251,255,.8);
  border-bottom:1px solid rgba(219,232,255,.95);
}
.lsei-nav-inner{
  max-width:1100px;
  margin:0 auto;
  padding:10px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.lsei-menu{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}
.lsei-menu a{
  color:var(--text);
  text-decoration:none;
  font-weight:500;
  font-size:var(--fs-body);
  padding:8px 10px;
  border-radius:12px;
}
.lsei-menu a:hover{
  color: #b0e277;
}
.lsei-cta{
  /* EPIC 2.3: make CTA secondary so it doesn't compete with search */
  background: rgba(255,255,255,.92);
  color: var(--text);
  font-weight:600;
  text-decoration:none;
  padding:9px 12px;
  border-radius:12px;
  border:1px solid rgba(219,232,255,.95);
  box-shadow: 0 6px 16px rgba(13,55,120,.06);
  white-space:nowrap;
}
.lsei-cta:hover{ color:#b0e277; }

/* EPIC 2.3: hide CTA on the home screen (search must be the only focus) */
/* On the home page the search should be the main visual focus.
   Keep the CTA available, but make it visually secondary. */
body.home .lsei-cta{
  background: transparent;
  border-color: transparent;
  opacity: .65;
}
body.home .lsei-cta:hover{
  opacity: 1;
  border-color: rgba(0,0,0,.10);
}

@media (max-width: 900px){
  .lsei-top-inner{ flex-wrap:wrap; }
  .lsei-top-right{ align-items:flex-start; }
  .lsei-nav-inner{ flex-wrap:wrap; }
}


.tg-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:34px; height:34px;
  border-radius:12px;
  border:1px solid rgba(219,232,255,.95);
  color:#2AABEE;
  background: rgba(255,255,255,.92);
  box-shadow: 0 6px 16px rgba(13,55,120,.08);
}
.tg-link:hover{
  background:#2AABEE;
  color:#fff;
}

.lsei-top-right:empty{display:none;}

.suggestion.active{background: rgba(241,245,255,1);}

.q-preview{
  border:1px solid rgba(219,232,255,.95);
  background: rgba(255,255,255,.75);
  border-radius:14px;
  padding:10px;
}
.q-item{display:flex; gap:8px; padding:6px 0; border-bottom:1px dashed rgba(219,232,255,.9);}
.q-item:last-child{border-bottom:none;}
.q-n{min-width:28px; font-weight:900; color:var(--primary);}

/* App modal (contacts, etc.) */
.app-modal{position:fixed;inset:0;display:block;z-index:1000;opacity:0;pointer-events:none;visibility:hidden;transition:opacity .18s ease, visibility 0s linear .18s}
.app-modal[aria-hidden="false"]{opacity:1;pointer-events:auto;visibility:visible;transition:opacity .18s ease}
.modal__backdrop{position:absolute;inset:0;background:rgba(0,0,0,.35);backdrop-filter:blur(2px)}
.modal__panel{position:relative;max-width:560px;margin:8vh auto;background:#fff;border-radius:16px;box-shadow:0 20px 60px rgba(0,0,0,.2);padding:18px;transform:translateY(10px) scale(.995);transition:transform .18s ease}
.app-modal[aria-hidden="false"] .modal__panel{transform:translateY(0) scale(1)}
.modal__header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-bottom:10px;border-bottom:1px solid rgba(0,0,0,.08)}
.modal__title{font-size:18px;font-weight:800}
.modal__close{border:0;background:transparent;font-size:28px;line-height:1;cursor:pointer;color:rgba(0,0,0,.55)}
.modal__body{padding:16px 0 14px}
.app-modal .modal__body p{margin:0 0 14px;line-height:1.45}
.modal__footer{display:flex;justify-content:flex-end;gap:10px;padding-top:10px;border-top:1px solid rgba(0,0,0,.08)}
.app-modal .form-grid{display:grid;grid-template-columns:1fr;gap:10px;margin:12px 0 14px}
.app-modal .form-grid .field{margin-top:0;gap:6px}
.app-modal .field input{padding:10px 12px;border-radius:12px}
.app-modal .field span{display:block;font-size:12px;color:rgba(0,0,0,.7);margin-bottom:6px}
.field input{width:100%}
.check{display:flex;gap:10px;align-items:flex-start;margin-top:12px;padding:4px 0}
.check + .check{margin-top:8px}
.check span{font-size:13px;color:rgba(0,0,0,.75)}
.muted{color:rgba(0,0,0,.65)}

.send-row{display:flex;gap:10px;flex-wrap:wrap;align-items:center;justify-content:flex-end}


/* Request modal helpers */
.file-list{
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 140px;
  overflow: auto;
}
.file-list .file-item{
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 10px;
  background: rgba(255,255,255,0.6);
  font-size: 13px;
}
.request-questions{
  max-height: 220px;
  overflow: auto;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255,255,255,0.6);
  font-size: 13px;
  line-height: 1.45;
}
.request-questions .q{
  margin-bottom: 8px;
}


/* --- Explanations formatting (AI + admin) --- */
.explain-content { font-size: 14px; line-height: 1.45; }
.explain-content .item { margin: 10px 0; }
.explain-content b { display:block; margin-bottom:6px; font-size: 13px; letter-spacing: 0.2px; text-transform: none; }
.explain-content .exp-block { background: #fff; border: 1px solid rgba(0,0,0,0.08); border-radius: 12px; padding: 10px 12px; }
.explain-content .exp-meta { font-size: 12px; opacity: 0.8; margin-bottom: 6px; }
.explain-content .md { white-space: normal; }
.explain-content .md p { margin: 8px 0; }
.explain-content .md ul, .explain-content .md ol { margin: 8px 0 8px 18px; }
.explain-content .md li { margin: 4px 0; }
.explain-content .md code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 12px; padding: 1px 4px; border-radius: 6px; background: rgba(0,0,0,0.06); }
.explain-content .md pre { overflow:auto; padding: 10px; border-radius: 12px; background: rgba(0,0,0,0.06); }
.explain-content .md h3 { margin: 12px 0 8px; font-size: 14px; }
.explain-content .md hr { border: none; border-top: 1px solid rgba(0,0,0,0.12); margin: 10px 0; }
.explain-content .callout { border-left: 4px solid rgba(0,0,0,0.18); padding-left: 10px; margin: 10px 0; }

