:root{
  color-scheme:dark;
  --bg:#07111b;
  --panel:#101d2c;
  --panel-2:#14263a;
  --line:rgba(142,193,227,.20);
  --text:#edf7ff;
  --muted:#a4b8ca;
  --accent:#61d8ff;
  --accent-2:#1686c9;
  --ok:#8fe7b6;
  --warn:#ffd28a;
  --danger:#ff9d9d;
  font-family:Arial,Helvetica,sans-serif;
}

*{box-sizing:border-box}
html{min-height:100%;background:var(--bg)}
body{
  min-height:100vh;
  margin:0;
  color:var(--text);
  background:
    radial-gradient(circle at 9% 0,rgba(22,134,201,.20),transparent 31rem),
    linear-gradient(180deg,#091522,#06101a 72%);
}

button,input,select,textarea{font:inherit}

.hpEditorShell{
  width:min(1580px,calc(100% - 24px));
  margin:0 auto;
  padding:17px 0 38px;
}

.hpEditorTop{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:20px;
  padding:21px;
  border:1px solid var(--line);
  border-radius:19px;
  background:linear-gradient(145deg,rgba(24,49,73,.97),rgba(11,26,41,.97));
  box-shadow:0 20px 52px rgba(0,0,0,.26);
}

.hpEditorTop h1{
  margin:0 0 7px;
  font-size:clamp(29px,5vw,48px);
  letter-spacing:-.045em;
}

.hpEditorTop > div > p:last-child{
  max-width:830px;
  margin:0;
  color:var(--muted);
  line-height:1.58;
}

.hpEditorKicker{
  margin:0 0 5px;
  color:var(--accent);
  font-size:11px;
  font-weight:850;
  letter-spacing:.14em;
  text-transform:uppercase;
}

.hpEditorBadges{
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:7px;
  max-width:420px;
}

.hpEditorBadges span{
  padding:7px 10px;
  border:1px solid rgba(143,231,182,.28);
  border-radius:999px;
  color:var(--ok);
  background:rgba(32,115,79,.16);
  font-size:12px;
  font-weight:750;
}

.hpEditorNav{
  display:flex;
  align-items:center;
  gap:6px;
  min-height:49px;
  margin:9px 0 16px;
  padding:7px 8px;
  overflow-x:auto;
  border:1px solid var(--line);
  border-radius:14px;
  background:rgba(11,24,38,.94);
  scrollbar-width:none;
}

.hpEditorNav::-webkit-scrollbar{display:none}

.hpEditorNav a,
.hpEditorNav strong{
  flex:0 0 auto;
  padding:8px 10px;
  border-radius:9px;
  color:#dcecff;
  font-size:12px;
  text-decoration:none;
}

.hpEditorNav a:hover{background:#162d44}
.hpEditorNav strong{
  margin-left:auto;
  color:#fff;
  background:linear-gradient(180deg,#1776ab,#10557d);
}

.hpEditorWorkspace{
  display:grid;
  grid-template-columns:minmax(0,1.05fr) minmax(390px,.95fr);
  gap:16px;
  align-items:start;
}

.hpEditorSidebar{
  display:grid;
  gap:16px;
}

.hpEditorPanel{
  min-width:0;
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:18px;
  background:rgba(16,29,44,.95);
  box-shadow:0 18px 44px rgba(0,0,0,.22);
}

.hpEditorPanel__head{
  display:flex;
  justify-content:space-between;
  gap:14px;
  align-items:flex-start;
  padding:15px 17px;
  border-bottom:1px solid var(--line);
}

.hpEditorPanel__head h2{
  margin:0;
  font-size:18px;
}

.hpEditorPanel__head p{
  margin:4px 0 0;
  color:var(--muted);
  font-size:12px;
  line-height:1.45;
}

.hpEditorPanel__body{padding:17px}

.hpFormGrid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}

.hpField{min-width:0}
.hpField--wide{grid-column:1/-1}
.hpField + .hpField{margin-top:0}

.hpField label{
  display:block;
  margin-bottom:6px;
  color:#dcecff;
  font-size:12px;
  font-weight:750;
}

.hpField input,
.hpField textarea,
.hpField select{
  width:100%;
  padding:10px 11px;
  border:1px solid rgba(142,193,227,.22);
  border-radius:10px;
  color:var(--text);
  background:#091625;
  outline:none;
}

.hpField textarea{
  min-height:92px;
  resize:vertical;
}

.hpField input:focus,
.hpField textarea:focus,
.hpField select:focus{
  border-color:var(--accent);
  box-shadow:0 0 0 3px rgba(97,216,255,.09);
}

.hpEditorSection{
  margin-top:15px;
  padding-top:15px;
  border-top:1px solid var(--line);
}

.hpEditorSection__head{
  display:flex;
  justify-content:space-between;
  gap:12px;
  margin-bottom:11px;
}

.hpEditorSection__head h3{
  margin:0;
  font-size:16px;
}

.hpEditorSection__head p{
  margin:4px 0 0;
  color:var(--muted);
  font-size:12px;
  line-height:1.48;
}

.hpEditorFrame{
  overflow:hidden;
  border:1px solid rgba(142,193,227,.23);
  border-radius:14px;
  background:#fff;
}

.hpEditorNote{
  margin-top:9px;
  color:var(--muted);
  font-size:11px;
  line-height:1.45;
}

.hpCheck{
  display:flex;
  gap:9px;
  align-items:flex-start;
  padding:11px;
  border:1px solid var(--line);
  border-radius:11px;
  cursor:pointer;
}

.hpCheck input{margin-top:3px}
.hpCheck strong,
.hpCheck small{display:block}
.hpCheck small{margin-top:3px;color:var(--muted)}

.hpPageTemplates{
  display:grid;
  gap:8px;
  margin-bottom:10px;
}

.hpPageTemplateButton{
  display:block;
  width:100%;
  padding:13px 14px;
  border:1px solid rgba(255,91,150,.48);
  border-radius:11px;
  color:#fff;
  background:
    radial-gradient(circle at 100% 0,rgba(255,91,150,.22),transparent 16rem),
    #111d2b;
  cursor:pointer;
  text-align:left;
}

.hpPageTemplateButton:hover{
  border-color:rgba(255,122,171,.82);
  background:
    radial-gradient(circle at 100% 0,rgba(255,91,150,.32),transparent 18rem),
    #172a3d;
}

.hpPageTemplateButton--noir{
  border-color:rgba(217,174,92,.52);
  background:
    radial-gradient(circle at 100% 0,rgba(217,174,92,.18),transparent 16rem),
    linear-gradient(135deg,#171717,#0b1118);
}

.hpPageTemplateButton--noir:hover{
  border-color:rgba(238,199,120,.88);
  background:
    radial-gradient(circle at 100% 0,rgba(217,174,92,.28),transparent 18rem),
    linear-gradient(135deg,#23201a,#101a24);
}

.hpPageTemplateButton strong,
.hpPageTemplateButton span{display:block}
.hpPageTemplateButton strong{font-size:13px}
.hpPageTemplateButton span{margin-top:5px;color:#b9c9d9;font-size:11px;line-height:1.45}

.hpTemplateGrid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:7px;
}

.hpTemplateGrid button,
.hpPresetImages button,
.hpPreviewSizes button{
  padding:8px 9px;
  border:1px solid var(--line);
  border-radius:9px;
  color:#dcecff;
  background:#0b1928;
  cursor:pointer;
  font-size:12px;
  font-weight:700;
}

.hpTemplateGrid button:hover,
.hpPresetImages button:hover,
.hpPreviewSizes button:hover,
.hpPreviewSizes button[aria-pressed="true"]{
  border-color:rgba(97,216,255,.55);
  background:#15344e;
}

.hpPresetImages{
  display:grid;
  gap:9px;
}

.hpPresetImages article{
  display:grid;
  grid-template-columns:92px 1fr;
  gap:9px;
  align-items:center;
  padding:8px;
  border:1px solid var(--line);
  border-radius:11px;
  background:#0a1725;
}

.hpPresetImages img{
  width:92px;
  aspect-ratio:16/9;
  object-fit:cover;
  border-radius:7px;
}

.hpPresetImages strong{
  display:block;
  margin-bottom:7px;
  font-size:12px;
}

.hpPresetImages article > div:last-child{
  grid-column:2;
  display:flex;
  flex-wrap:wrap;
  gap:5px;
}

.hpLocalImageLoader{
  display:grid;
  grid-template-columns:minmax(220px,1fr) minmax(220px,1fr) auto;
  gap:9px;
  align-items:end;
}

.hpImageLibrary{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(145px,1fr));
  gap:8px;
  margin-top:10px;
}

.hpLocalImageCard{
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:11px;
  background:#091625;
}

.hpLocalImageCard img{
  display:block;
  width:100%;
  aspect-ratio:4/3;
  object-fit:cover;
}

.hpLocalImageCard__body{
  padding:8px;
}

.hpLocalImageCard strong{
  display:block;
  overflow:hidden;
  margin-bottom:7px;
  font-size:11px;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.hpLocalImageCard__actions{
  display:flex;
  gap:5px;
}

.hpLocalImageCard__actions button{
  flex:1 1 0;
  min-width:0;
  padding:6px;
  border:1px solid var(--line);
  border-radius:7px;
  color:#dcecff;
  background:#132a40;
  cursor:pointer;
  font-size:10px;
}

.hpButton{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:40px;
  padding:8px 13px;
  border:1px solid rgba(97,216,255,.34);
  border-radius:10px;
  color:#fff;
  background:linear-gradient(180deg,#1977aa,#10547c);
  cursor:pointer;
  font-weight:750;
}

.hpButton:hover{filter:brightness(1.08)}
.hpButton--ghost{
  color:#dcecff;
  border-color:var(--line);
  background:#13263a;
}

.hpEditorActions{
  position:sticky;
  z-index:20;
  bottom:0;
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px;
  margin-top:16px;
  padding:11px;
  border:1px solid rgba(97,216,255,.25);
  border-radius:13px;
  background:rgba(8,20,33,.96);
  box-shadow:0 12px 30px rgba(0,0,0,.26);
}

.hpStatus{
  min-height:18px;
  color:var(--muted);
  font-size:11px;
  line-height:1.4;
}

.hpStatus.is-ok{color:var(--ok)}
.hpStatus.is-error{color:var(--danger)}
.hpStatus.is-warn{color:var(--warn)}

.hpPreviewPanel{
  position:sticky;
  top:9px;
}

.hpPreviewPanel .hpEditorPanel__head{
  align-items:center;
}

.hpPreviewSizes{
  display:flex;
  gap:5px;
}

.hpPreviewStage{
  display:grid;
  place-items:center;
  min-height:660px;
  padding:10px;
  overflow:auto;
  background:
    linear-gradient(45deg,#0b1623 25%,transparent 25%) 0 0/18px 18px,
    linear-gradient(45deg,transparent 75%,#0b1623 75%) 0 0/18px 18px,
    linear-gradient(45deg,transparent 75%,#0b1623 75%) 9px -9px/18px 18px,
    linear-gradient(45deg,#0b1623 25%,#07111b 25%) 9px -9px/18px 18px;
}

.hpPreviewStage iframe{
  display:block;
  width:100%;
  height:640px;
  border:0;
  border-radius:11px;
  background:#fff;
  box-shadow:0 16px 40px rgba(0,0,0,.32);
  transition:width .2s ease;
}

.hpPreviewStage[data-size="mobile"] iframe{
  width:390px;
  max-width:100%;
}

.hpEditorFooter{
  display:flex;
  justify-content:space-between;
  gap:15px;
  padding:15px 4px 0;
  color:#7f95a9;
  font-size:11px;
}

.hpEditorFooter p{margin:0}

@media(max-width:1180px){
  .hpEditorWorkspace{
    grid-template-columns:1fr;
  }

  .hpPreviewPanel{
    position:static;
  }

  .hpPreviewStage iframe{
    height:720px;
  }
}

@media(max-width:720px){
  .hpEditorShell{
    width:calc(100% - 12px);
    padding-top:6px;
  }

  .hpEditorTop{
    display:block;
    padding:16px;
  }

  .hpEditorBadges{
    justify-content:flex-start;
    margin-top:13px;
  }

  .hpEditorNav strong{margin-left:0}

  .hpFormGrid,
  .hpLocalImageLoader{
    grid-template-columns:1fr;
  }

  .hpField--wide{grid-column:auto}
  .hpTemplateGrid{grid-template-columns:1fr}
  .hpEditorPanel__body{padding:12px}
  .hpEditorFooter{display:block}
  .hpEditorFooter p + p{margin-top:4px}
}

@media(prefers-reduced-motion:reduce){
  *,
  *::before,
  *::after{
    scroll-behavior:auto!important;
    transition-duration:.01ms!important;
    animation-duration:.01ms!important;
    animation-iteration-count:1!important;
  }
}
