:root{
  --bg:#0f0f0f;
  --card:#ffffff;
  --muted:#777;
  --line:#e9e9e9;
  --primary:#1f6feb;
  --radius:14px;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background:#f6f6f6;
  color:#111;
}

/* TOPBAR */
.topbar{
  position:sticky;
  top:0;
  z-index:50;
  background:#111;
  color:#fff;
  padding:10px;
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}
.brand{font-weight:800}
.searchWrap{flex:1; min-width:220px}
.search{
  width:100%;
  padding:12px 12px;
  border-radius:12px;
  border:0;
  outline:none;
}
.adminWrap,.aiWrap{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
}
.adminWrap input,.aiWrap input{
  padding:10px 10px;
  border-radius:12px;
  border:0;
  outline:none;
  min-width:170px;
}
.status{font-weight:800; color:#7CFC00}
.hidden{display:none!important}

/* MAIN */
.main{padding:12px}
.toolbar{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  margin-bottom:10px;
}
.muted{color:var(--muted); font-size:14px}

/* BUTTONS */
.btn{
  padding:10px 12px;
  border-radius:12px;
  border:0;
  cursor:pointer;
  background:#e8e8e8;
}
.btn.primary{background:var(--primary); color:#fff}
.btn.ghost{background:transparent; border:1px solid rgba(255,255,255,.25); color:#fff}
.btn.small{padding:8px 10px; border-radius:10px}
.iconBtn{
  border:0;
  background:#eee;
  border-radius:10px;
  padding:6px 8px;
  cursor:pointer;
}

/* LIST */
.list{display:flex; flex-direction:column; gap:10px}
.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:12px;
}
.cardTop{
  display:flex;
  gap:10px;
  align-items:flex-start;
  justify-content:space-between;
}
.wordRu{font-weight:900; font-size:18px}
.pos{color:var(--muted); font-size:13px; margin-top:3px}
.ingLine{margin-top:8px; color:#111}
.examples{margin-top:10px; padding-top:10px; border-top:1px dashed var(--line)}
.exItem{margin-top:6px; color:#111}
.exSub{color:var(--muted); font-size:13px}

.cardActions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:10px;
}
.pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background:#fafafa;
  cursor:pointer;
}
.dot{font-weight:900}

/* MODAL (fullscreen on mobile) */
.modal{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.55);
  display:flex;
  justify-content:center;
  align-items:flex-end;
  z-index:9999;
}
.modal.hidden{display:none}
.modalBox{
  width:100%;
  height:92vh;
  background:#fff;
  border-radius:18px 18px 0 0;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
.modalHeader{
  padding:12px;
  border-bottom:1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.modalTitle{font-weight:900}
.modalBody{
  padding:12px;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
}
.modalFooter{
  padding:12px;
  border-top:1px solid var(--line);
  display:flex;
  gap:10px;
  justify-content:flex-end;
}

/* FIELDS */
.field{display:block; margin-bottom:12px}
.fieldLabel{
  display:flex;
  align-items:center;
  justify-content:space-between;
  font-weight:800;
  margin-bottom:6px;
}
.input{
  width:100%;
  padding:12px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  outline:none;
}
textarea.input{min-height:86px; resize:vertical}

.block{
  border:1px solid var(--line);
  border-radius:14px;
  padding:10px;
  margin-bottom:12px;
  background:#fcfcfc;
}
.blockHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  font-weight:900;
  margin-bottom:8px;
}
.stack{display:flex; flex-direction:column; gap:8px}
.row{display:flex; gap:8px; flex-wrap:wrap}
.hint{color:var(--muted); font-size:13px}

/* DESKTOP: modal not fullscreen */
@media(min-width: 900px){
  .modal{align-items:center}
  .modalBox{
    width:min(820px, 95vw);
    height:min(92vh, 820px);
    border-radius:18px;
  }
}
.pill.disabled {
  opacity: 0.3;
  cursor: default;
}
.btn.ghost {
  border: 1px solid #ccc;
  color: #444;
}
.btn.danger {
  background: #e74c3c;
  color: #fff;
}
.btn.danger:hover {
  background: #c0392b;
}
