:root{
  --bg1:#0a1022;
  --bg2:#120a24;
  --red:#ff3b6a;
  --blue:#3aa7ff;
  --text:#e9f1ff;
  --muted:rgba(233,241,255,.72);
  --glass:rgba(255,255,255,.10);
  --glass2:rgba(255,255,255,.06);
  --stroke:rgba(255,255,255,.18);
  --shadow: 0 18px 60px rgba(0,0,0,.35);
  --r:22px;
}

*{box-sizing:border-box}
html,body{min-height:100%}

html{background:var(--bg1);}

/* ФИКС “второго градиента”:
   Рисуем фон на фиксированном слое, который не зависит от высоты страницы */
body{
  margin:0;
  min-height:100vh;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial;
  color:var(--text);
  background: transparent;
  overflow-x:hidden;
  position:relative;
}
body::before{
  content:"";
  position:fixed;
  inset:0;
  z-index:-2;
  background:
    radial-gradient(1200px 700px at 12% 10%, rgba(58,167,255,.25), transparent 60%),
    radial-gradient(900px 700px at 88% 20%, rgba(255,59,106,.22), transparent 55%),
    radial-gradient(1100px 900px at 55% 95%, rgba(58,167,255,.18), transparent 60%),
    linear-gradient(140deg, var(--bg1), var(--bg2));
  background-repeat:no-repeat;
}

/* дополнительный “туман” */
.bg{
  position:fixed; inset:-20px;
  background:
    radial-gradient(500px 300px at 20% 30%, rgba(58,167,255,.18), transparent 70%),
    radial-gradient(500px 320px at 80% 35%, rgba(255,59,106,.14), transparent 70%);
  filter: blur(30px);
  pointer-events:none;
  z-index:-1;
}

.container{max-width:1100px;margin:0 auto;padding:18px}
.glass{
  background: linear-gradient(135deg, var(--glass), var(--glass2));
  border:1px solid var(--stroke);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}

.isHidden{display:none !important;}

.topbar{
  margin:16px auto 0;
  max-width:1100px;
  padding:12px 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.brand{display:flex;align-items:center;gap:12px;text-decoration:none;color:inherit}

.logoWrap{
  width:64px;height:64px;
  border-radius:20px;
  padding:6px;
  background: linear-gradient(135deg, rgba(255,255,255,.10), rgba(255,255,255,.06));
  border:1px solid rgba(255,255,255,.20);
  box-shadow:
    0 12px 40px rgba(0,0,0,.35),
    0 0 0 1px rgba(255,255,255,.06) inset,
    0 0 26px rgba(58,167,255,.22),
    0 0 28px rgba(255,59,106,.16);
  display:flex;align-items:center;justify-content:center;
}
.logo{
  width:52px;height:52px;
  border-radius:16px;
  object-fit:cover;
  border:1px solid rgba(255,255,255,.22);
  box-shadow: 0 10px 26px rgba(0,0,0,.25);
}

.title{font-weight:800;letter-spacing:.2px}
.nav{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end}

.pill{
  text-decoration:none;color:var(--text);
  padding:10px 12px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
}
.pill:hover{transform: translateY(-1px); filter:brightness(1.06)}
.pill.small{padding:8px 10px;font-size:13px}
.pill.danger{border-color: rgba(255,59,106,.35); background: rgba(255,59,106,.12)}

.hero{padding:22px}
.hero h1{margin:0 0 8px;font-size:26px}
.muted{color:var(--muted)}
.smallText{font-size:13px}
.footer{max-width:1100px;margin:0 auto;padding:18px}
.footer .muted{font-size:12px}

.langGrid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap:14px;
  margin-top:16px;
}
.langCard{
  padding:18px;
  text-decoration:none;
  color:inherit;
  display:flex;
  align-items:center;
  gap:12px;
  min-height:82px;
}
.langCard:hover{transform: translateY(-2px); filter:brightness(1.06)}
.flagImg{
  width:44px;
  height:30px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,.20);
  box-shadow: 0 10px 24px rgba(0,0,0,.22);
  background: rgba(255,255,255,.08);
  flex:0 0 auto;
}
.langName{font-size:18px;font-weight:750}

.card{padding:20px}
.card.center{text-align:center}
h2{margin:0 0 14px}
h3{margin:0 0 8px}

.form{display:flex;flex-direction:column;gap:14px}
.grid2{display:grid;grid-template-columns: repeat(2, 1fr);gap:12px}
.field{display:flex;flex-direction:column;gap:6px}
.field input,.field textarea{
  padding:12px 12px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.16);
  background: rgba(10,16,34,.45);
  color:var(--text);
  outline:none;
}
.field input:focus,.field textarea:focus{border-color: rgba(58,167,255,.55)}
.divider{height:1px;background:rgba(255,255,255,.12);margin:6px 0}

.actions{display:flex;gap:10px;flex-wrap:wrap}
.btn{
  text-decoration:none;color:var(--text);
  padding:12px 14px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
  cursor:pointer;
}
.btn:hover{transform: translateY(-1px); filter:brightness(1.06)}
.btn.primary{
  border-color: rgba(58,167,255,.45);
  background: linear-gradient(135deg, rgba(58,167,255,.18), rgba(255,59,106,.12));
}

.workGrid{
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap:12px;
}
.workCard{padding:14px}
.workHead{display:flex;align-items:center;gap:12px;margin-bottom:10px}
.workTitle{font-weight:800;font-size:18px}
.materialsBlock{margin-top:10px}
.chipRow{display:flex;flex-wrap:wrap;gap:10px}
.chip{
  border:none;
  padding:10px 12px;
  border-radius:999px;
  background: rgba(255,255,255,.07);
  border:1px solid rgba(255,255,255,.14);
  color:var(--text);
  cursor:pointer;
  text-align:left;
}
.chip:hover{filter:brightness(1.08); transform: translateY(-1px)}
.chip.active{
  border-color: rgba(58,167,255,.55);
  box-shadow: 0 0 0 2px rgba(58,167,255,.14) inset;
}
.chip.active.red{
  border-color: rgba(255,59,106,.55);
  box-shadow: 0 0 0 2px rgba(255,59,106,.14) inset;
}

.matPanels{margin-top:12px;display:flex;flex-direction:column;gap:10px}
.matPanel{padding:12px}
.matPanelHead{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px}
.matTitle{font-weight:850}
.matRemove{
  border:none;
  background: rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.16);
  color:var(--text);
  width:34px;height:34px;
  border-radius:12px;
  cursor:pointer;
}
.matRemove:hover{filter:brightness(1.08); transform: translateY(-1px)}
.methodsRow{margin-top:8px}

.row{display:flex;gap:10px;flex-wrap:wrap}
.radio{
  display:flex;gap:10px;align-items:center;
  padding:10px 12px;
  border-radius:16px;
}
.radio input{accent-color: var(--blue)}

.toggle{position:relative;display:inline-block;width:54px;height:30px}
.toggle input{display:none}
.slider{
  position:absolute;cursor:pointer;inset:0;
  background: rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.16);
  border-radius:999px;
  transition:.2s;
}
.slider:before{
  content:"";
  position:absolute; height:24px;width:24px; left:3px; top:2px;
  background: linear-gradient(135deg, rgba(58,167,255,.9), rgba(255,59,106,.7));
  border-radius:999px;
  transition:.2s;
}
.toggle input:checked + .slider{background: rgba(58,167,255,.12); border-color: rgba(58,167,255,.35)}
.toggle input:checked + .slider:before{transform: translateX(24px)}

@media (max-width: 900px){
  .langGrid{grid-template-columns: repeat(2, 1fr)}
  .workGrid{grid-template-columns: 1fr}
  .grid2{grid-template-columns: 1fr}
  .topbar{flex-direction:column;align-items:stretch}
  .nav{justify-content:space-between}
}

/* Dashboard: cleaner "Что варил" */
.skillsPlain{display:flex;flex-direction:column;gap:12px}
.skillBlockPlain{padding:10px 12px;border-radius:18px;border:1px solid rgba(255,255,255,.12);background: rgba(255,255,255,.04)}
.skillTitlePlain{font-weight:850;margin-bottom:6px}
.skillRowPlain{display:flex;flex-wrap:wrap;gap:8px;align-items:baseline;margin:6px 0}
.skillMatPlain{font-weight:700}
.skillMethodsPlain{color: rgba(233,241,255,.82)}

/* === DASHBOARD_LIST_FIX_V5 ===
   Чиним налезание “жидкого стекла” карточек списка в кабинете инженера */
.list{gap:10px}

/* делаем сами элементы спокойнее: меньше тени, меньше блика, чёткая рамка */
.item.glass{
  box-shadow: none !important;
  background: rgba(255,255,255,.055) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden; /* чтобы блик/границы не вылезали наружу */
}

/* summary — ровная строка без “наезда” */
.item summary{
  padding: 12px 14px;
  align-items: center;
}
.item summary .sumLeft{
  min-width: 0;
}
.item summary .sumTitle{
  line-height: 1.25;
  margin-bottom: 2px;
}
.item summary .muted.smallText{
  line-height: 1.25;
  opacity: .85;
}

/* тело раскрытой анкеты отделяем и не даём эффектам лезть */
.itemBody{
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(255,255,255,.10);
}

/* лёгкий hover без размазывания */
.item:hover{
  filter: brightness(1.03);
  transform: translateY(-1px);
}

/* на мобилке ещё спокойнее */
@media (max-width: 900px){
  .item:hover{transform:none}
}
/* === /DASHBOARD_LIST_FIX_V5 === */






/* === LANG_LAYOUT_V10 ===
   Цель: ПК вернуть “плитки 2x2”, мобилки оставить рабочими.
*/

/* По умолчанию (ПК/ноут): 2 колонки => 2x2 большие кнопки */
.langGrid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:16px;
  margin-top:16px;
}

/* Карточка как “плитка” */
.langCard{
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  min-height: 120px;
  padding: 18px;
  min-width: 0;
}

.langName{
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.15;
  min-width: 0;
}

/* На средних/мелких экранах тоже 2 колонки (как на Samsung) */
@media (max-width: 900px){
  .langGrid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .langCard{ min-height: 110px; padding: 16px; }
}

/* “анти-самсунг”: blur у карточек языков выключаем только на очень узких */
@media (max-width: 460px){
  .langGrid .langCard.glass{
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: linear-gradient(135deg, rgba(255,255,255,.12), rgba(255,255,255,.07)) !important;
    border: 1px solid rgba(255,255,255,.18) !important;
    box-shadow: 0 14px 34px rgba(0,0,0,.22) !important;
  }
}

/* === /LANG_LAYOUT_V10 === */

/* === DESKTOP_CENTER_FIX_V11 ===
   Возвращаем “всё по центру” на ПК, но не ломаем мобилки.
*/

/* Десктоп: жёстко возвращаем центрирование */
@media (min-width: 901px){
  .container{ max-width:1100px !important; margin:0 auto !important; }
  .topbar{ max-width:1100px !important; margin-left:auto !important; margin-right:auto !important; }
}

/* Мобилки: безопасно, без горизонтальных вылетов */
@media (max-width: 900px){
  .container{ max-width:100% !important; }
  .topbar{ max-width:100% !important; }
  .hero, .card{ overflow-x: clip; }
}

/* Картинки никогда не должны раздувать блоки */
img{ max-width:100%; height:auto; }

/* === /DESKTOP_CENTER_FIX_V11 === */

/* === TOPBAR_MOBILE_FIX_V12 ===
   Укорачиваем шапку на телефонах, чтобы не вылезала за рамки.
*/
@media (max-width: 480px){
  .topbar{
    padding: 10px 10px !important;
    gap: 10px !important;
  }

  .brand{
    gap: 10px !important;
  }

  .logoWrap{
    width: 52px !important;
    height: 52px !important;
    border-radius: 18px !important;
    padding: 5px !important;
  }
  .logo{
    width: 42px !important;
    height: 42px !important;
    border-radius: 14px !important;
  }

  .title{
    font-size: 16px !important;
  }

  .nav{
    gap: 8px !important;
    justify-content: space-between !important;
  }

  .pill{
    padding: 9px 10px !important;
    font-size: 13px !important;
  }
}
/* === /TOPBAR_MOBILE_FIX_V12 === */

/* === TOPBAR_IOS_FIX_V13 ===
   Ещё компактнее шапка на iOS/Safari (iPhone, включая Pro Max).
   Плюс учитываем safe-area.
*/
@supports (-webkit-touch-callout: none){
  @media (max-width: 520px){
    .topbar{
      padding-top: 8px !important;
      padding-bottom: 8px !important;
      padding-left: calc(10px + env(safe-area-inset-left)) !important;
      padding-right: calc(10px + env(safe-area-inset-right)) !important;
      gap: 8px !important;
    }

    .brand{ gap: 8px !important; }

    .logoWrap{
      width: 48px !important;
      height: 48px !important;
      border-radius: 16px !important;
      padding: 4px !important;
    }
    .logo{
      width: 38px !important;
      height: 38px !important;
      border-radius: 12px !important;
    }

    .title{ font-size: 15px !important; }

    .nav{
      gap: 7px !important;
      flex-wrap: wrap !important;
    }

    .pill{
      padding: 8px 9px !important;
      font-size: 12.5px !important;
    }
  }
}
/* === /TOPBAR_IOS_FIX_V13 === */

/* === TOPBAR_COMPACT_V14 ===
   На телефонах делаем шапку ниже:
   - шапка снова в одну строку (не column)
   - скрываем заголовок (оставляем лого)
   - кнопки компактнее и не переносятся
*/
@media (max-width: 520px){
  .topbar{
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    padding-left: calc(10px + env(safe-area-inset-left)) !important;
    padding-right: calc(10px + env(safe-area-inset-right)) !important;
    gap: 10px !important;
  }

  /* бренд: оставляем только лого, текст скрываем */
  .brandText{ display:none !important; }

  .logoWrap{
    width: 48px !important;
    height: 48px !important;
    padding: 4px !important;
    border-radius: 16px !important;
  }
  .logo{
    width: 38px !important;
    height: 38px !important;
    border-radius: 12px !important;
  }

  /* кнопки: компактнее, в одну строку */
  .nav{
    flex-wrap: nowrap !important;
    gap: 8px !important;
  }
  .pill{
    padding: 8px 10px !important;
    font-size: 12.5px !important;
    white-space: nowrap !important;
  }
}
/* === /TOPBAR_COMPACT_V14 === */

/* === DASH_TOOLS_V16 === */
.dashTools{
  display:flex;
  gap:12px;
  align-items:flex-end;
  justify-content:space-between;
  flex-wrap:wrap;
  margin: 12px 0 6px;
}
.dashTools input{
  width:100%;
}
.dashActions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
/* === /DASH_TOOLS_V16 === */

/* === DASH_HEAD_ROW_V18 === */
.dashHeadRow{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
@media (max-width: 520px){
  .dashHeadRow{
    align-items:center;
  }
}
/* === /DASH_HEAD_ROW_V18 === */

/* === MOBILE_RIGHT_BUTTONS_V20 ===
   Мобилки: "Выйти" прижать вправо в topbar,
   "Архив" в кабинете — вправо от заголовка.
*/
@media (max-width: 520px){

  /* Topbar: делаем сетку 2 колонки для кнопок:
     слева: На главную + ЛК, справа: Выйти (и/или Engineer) */
  .topbar .nav{
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    align-items: center !important;
    gap: 10px !important;
  }

  /* Все "обычные" кнопки встают в левую колонку */
  .topbar .nav .pill{
    justify-self: start;
  }

  /* Кнопка выхода (обычно имеет класс danger) — вправо */
  .topbar .nav .pill.danger{
    justify-self: end !important;
    margin-left: 0 !important;
  }

  /* Если пользователь НЕ залогинен, кнопка Engineer пусть тоже будет справа */
  .topbar .nav .pill[href*="engineer"]{
    justify-self: end;
  }

  /* Кабинет: "Архив" вправо в одной строке с заголовком */
  .dashHeadRow{
    align-items: center !important;
  }
  .dashHeadRow > a.pill{
    margin-left: auto !important;
    justify-self: end !important;
  }
}

/* === /MOBILE_RIGHT_BUTTONS_V20 === */

/* === MOBILE_RIGHT_BUTTONS_V21 ===
   Phone: move Logout to the right in topbar,
   and move Archive button to the right in dashboard header.
*/
@media (max-width: 520px){

  /* Topbar nav: keep buttons in one row and push last one to the right */
  .topbar .nav{
    display:flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items:center !important;
    gap:10px !important;
  }

  /* Push logout to the right */
  .topbar .nav a.pill.danger{
    margin-left: auto !important;
  }

  /* If not logged in: push "Engineer" to the right (usually the last pill) */
  .topbar .nav a.pill:last-child{
    margin-left: auto !important;
  }

  /* Dashboard header: archive button to the right */
  .dashHeadRow{
    display:flex !important;
    align-items:center !important;
    gap:12px !important;
  }
  .dashHeadRow > a.pill{
    margin-left:auto !important;
  }

  /* If somewhere "Архив" appears as plain link inside dashTools, make it look nice */
  .dashTools a.pill, .dashTools a.btn{
    margin-left:auto !important;
  }
}
/* === /MOBILE_RIGHT_BUTTONS_V21 === */
