:root{
  --bg:#070707; --bg2:#0b0b0b;
  --line:rgba(255,255,255,.08);
  --muted:rgba(255,255,255,.66);
  --text:#f2f2f2;
  --gold1:#f5d27b; --gold2:#caa24a;
  --shadow: 0 18px 60px rgba(0,0,0,.55);
  --shadow2: 0 10px 30px rgba(0,0,0,.35);
  --r:18px;
  --ui: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--ui);
  color:var(--text);
  background:
    radial-gradient(1100px 700px at 18% 10%, rgba(202,162,74,.14), transparent 62%),
    radial-gradient(900px 600px at 88% 20%, rgba(245,210,123,.11), transparent 62%),
    radial-gradient(900px 800px at 55% 95%, rgba(255,255,255,.03), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg2));
}

/* Topbar */
.topbar{
  position:sticky; top:0; z-index:10;
  display:flex; align-items:center; justify-content:space-between; gap:14px;
  padding:14px 18px;
  border-bottom:1px solid var(--line);
  background: rgba(7,7,7,.62);
  backdrop-filter: blur(14px);
}
.brand{display:flex; flex-direction:column; gap:6px}
.brand__sub{font-size:12px; color:var(--muted)}

/* Neon logo */
.logo-neon{
  font-weight:900;
  letter-spacing:.14em;
  font-size:18px;
  line-height:1;
  display:inline-flex;
  align-items:baseline;
  user-select:none;
}
.logo-neon__base{
  color: rgba(245,210,123,.92);
  text-shadow: 0 0 10px rgba(245,210,123,.10), 0 0 22px rgba(245,210,123,.08);
}
.logo-neon__v{
  color: rgba(245,210,123,.98);
  margin: 0 1px;
  text-shadow:
    0 0 2px rgba(245,210,123,.35),
    0 0 10px rgba(245,210,123,.28),
    0 0 22px rgba(245,210,123,.22),
    0 0 40px rgba(245,210,123,.16);
  animation: neonFlicker 3.6s infinite;
}
@keyframes neonFlicker{
  0%, 6%, 8%, 10%, 100% { opacity: 1; filter: saturate(1); }
  7% { opacity: .55; filter: saturate(.7); }
  9% { opacity: .35; filter: saturate(.6); }
  46% { opacity: 1; }
  47% { opacity: .62; }
  48% { opacity: 1; }
  72% { opacity: 1; }
  73% { opacity: .40; }
  74% { opacity: 1; }
}

.topbar__actions{display:flex;gap:10px;flex-wrap:wrap;align-items:stretch}
.topbar__actions .btn{height:42px;min-width:180px;justify-content:center}
@media (max-width:760px){
  .topbar{flex-direction:column; align-items:flex-start}
  .topbar__actions{width:100%}
  .topbar__actions .btn{flex:1;min-width:0}
}

/* Buttons */
.btn{
  border:1px solid rgba(255,255,255,.10);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  color:var(--text);
  border-radius:14px;
  padding:10px 14px;
  font-weight:800;
  cursor:pointer;
  box-shadow: var(--shadow2);
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
  display:inline-flex; align-items:center; justify-content:center;
  text-decoration:none;
}
.btn:hover{transform: translateY(-1px); border-color: rgba(245,210,123,.30)}
.btn--ghost{background: rgba(0,0,0,.10); box-shadow:none}
.btn--gold{
  border-color: rgba(245,210,123,.35);
  background: linear-gradient(135deg, rgba(245,210,123,.24), rgba(202,162,74,.10));
}

/* Layout */
.layout{
  display:grid;
  grid-template-columns: 420px 1fr;
  gap:18px;
  padding:18px;
  max-width: 1320px;
  margin: 0 auto;
}
.panel{display:flex; flex-direction:column; gap:14px}
.preview{display:flex; flex-direction:column; gap:12px}

/* Card */
.card{
  position:relative;
  background:
    radial-gradient(1200px 600px at 10% 10%, rgba(245,210,123,.06), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.018));
  border:1px solid var(--line);
  border-radius: var(--r);
  padding:14px;
  box-shadow: var(--shadow2);
}
.card::after{
  content:"";
  position:absolute; inset:0;
  border-radius: var(--r);
  pointer-events:none;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,0));
  opacity:.22;
  mask: linear-gradient(#000, transparent 70%);
}
.card__title{
  font-weight:900;
  margin-bottom:10px;
  color: rgba(245,210,123,.94);
  letter-spacing:.02em;
}

.row{display:flex; flex-direction:column; gap:8px; margin-bottom:12px}
.row:last-child{margin-bottom:0}
.row--inline{flex-direction:row; align-items:center; gap:12px; flex-wrap:wrap}

.label{font-size:12px; color:var(--muted)}
.hint{font-size:12px; color:rgba(255,255,255,.55); line-height:1.35}

/* Controls */
.control{
  width:100%;
  border-radius: 14px;
  padding: 10px 12px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(5,5,5,.40);
  color: var(--text);
  outline:none;
  min-height:44px;
  font-size:14px;
}
.control:focus{border-color: rgba(245,210,123,.32); box-shadow: 0 0 0 3px rgba(245,210,123,.08)}
.control--textarea{resize: vertical; min-height: 98px}
select.control{min-height:46px;font-size:15px;font-weight:800}

.link{
  color: rgba(245,210,123,.92);
  text-decoration:none;
  border-bottom:1px dashed rgba(245,210,123,.35);
}
.link:hover{border-bottom-color: rgba(245,210,123,.75)}

.badge{
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  color: rgba(255,255,255,.70);
}
.badge--ok{border-color: rgba(42,211,124,.25); background: rgba(42,211,124,.08); color: rgba(255,255,255,.86);}
.badge--bad{border-color: rgba(255,77,77,.25); background: rgba(255,77,77,.10); color: rgba(255,255,255,.86);}
.badge--muted{border-color: rgba(255,255,255,.10); background: rgba(255,255,255,.03); color: rgba(255,255,255,.65);}

/* Preview area */
.preview__card{
  background:
    radial-gradient(1200px 600px at 20% 10%, rgba(245,210,123,.10), transparent 60%),
    radial-gradient(900px 650px at 80% 70%, rgba(202,162,74,.08), transparent 65%),
    linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.015));
  border:1px solid var(--line);
  border-radius: var(--r);
  padding:14px;
  box-shadow: var(--shadow2);
}
.preview__top{display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:10px;}
.preview__title{font-weight:900; color: rgba(245,210,123,.94)}
.pill{
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(245,210,123,.22);
  background: rgba(245,210,123,.06);
  color: rgba(255,255,255,.84);
}
.canvasWrap{
  width:100%;
  border-radius: 18px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.08);
  background:
    radial-gradient(800px 480px at 28% 18%, rgba(245,210,123,.10), transparent 60%),
    radial-gradient(900px 650px at 80% 70%, rgba(202,162,74,.08), transparent 65%),
    linear-gradient(135deg, rgba(255,255,255,.03), rgba(0,0,0,.22));
}
canvas{display:block; width:100%; height:auto}
.preview__bottom{margin-top:12px}
.footnote{color: rgba(255,255,255,.45); font-size:12px; padding: 0 6px}

/* Steps */
.steps{display:flex; gap:10px; flex-wrap:wrap; margin-top:12px}
.step{
  display:flex; gap:8px; align-items:center;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.14);
  color: rgba(255,255,255,.82);
  font-size:12px;
}
.step__n{
  width:20px; height:20px;
  border-radius:999px;
  display:inline-flex; align-items:center; justify-content:center;
  border:1px solid rgba(245,210,123,.25);
  background: rgba(245,210,123,.08);
  color: rgba(245,210,123,.95);
  font-weight:900;
}

/* Chips */
.chips{display:flex; flex-wrap:wrap; align-items:center; gap:8px}
.chips__label{font-size:12px; color:rgba(255,255,255,.55); margin-right:4px}
.chip{
  border-radius: 999px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(5,5,5,.30);
  color: rgba(255,255,255,.90);
  padding:6px 10px;
  cursor:pointer;
  transition: border-color .12s ease, background .12s ease, transform .12s ease;
}
.chip:hover{border-color: rgba(245,210,123,.25); background: rgba(245,210,123,.06); transform: translateY(-1px)}

/* Emoji grid */
.chips--emoji{
  display:grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap:8px;
  align-items:stretch;
}
.chips--emoji .chip{
  padding:8px 0;
  text-align:center;
  border-radius: 12px;
  font-size:16px;
}

/* Details (collapsible) */
.details{
  border:1px solid rgba(255,255,255,.08);
  border-radius:14px;
  overflow:hidden;
  background: rgba(0,0,0,.14);
}
.details summary{
  cursor:pointer;
  padding:10px 12px;
  list-style:none;
  display:flex;
  align-items:center;
  justify-content:space-between;
  color: rgba(255,255,255,.84);
}
.details summary::-webkit-details-marker{display:none}
.details__body{padding:12px; border-top:1px solid rgba(255,255,255,.08)}

/* Font sample */
.fontSample{
  border:1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.18);
  border-radius: 14px;
  padding:10px 12px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.02);
  color: rgba(255,255,255,.92);
  font-size:18px;
  line-height:1.2;
}

/* Font gallery */
.fontGallery{
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.fontGallery__head{
  display:flex; align-items:baseline; justify-content:space-between; gap:10px;
  margin-bottom:10px;
}
.fontGallery__title{
  font-weight:900;
  color: rgba(255,255,255,.86);
}
.fontList{
  display:grid;
  grid-template-columns: 1fr;
  gap:10px;
  max-height: 360px;
  overflow:auto;
  padding-right:6px;
}
.fontCard{
  border:1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.14);
  border-radius:16px;
  padding:12px;
  cursor:pointer;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.fontCard:hover{transform: translateY(-1px); border-color: rgba(245,210,123,.25); background: rgba(245,210,123,.05)}
.fontCard.is-active{
  border-color: rgba(245,210,123,.38);
  background: rgba(245,210,123,.07);
  box-shadow: 0 0 0 3px rgba(245,210,123,.07) inset;
}
.fontCard__top{display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:8px}
.fontCard__name{font-weight:900; color: rgba(245,210,123,.92); font-size:13px}
.fontCard__meta{display:flex; gap:8px; align-items:center; flex-wrap:wrap}
.fontCard__sample{
  font-size:24px;
  line-height:1.12;
  letter-spacing:.01em;
  color: rgba(255,255,255,.92);
}
.fontCard__small{
  margin-top:6px;
  font-size:12px;
  color: rgba(255,255,255,.58);
}

/* Compact contacts */
.contacts--compact{display:grid;gap:10px}
.contacts--compact .btn{height:40px;min-width:0;font-weight:800;padding:10px 12px}
.contacts--compact .btn--wide{width:100%}

/* Toast */
.toast{
  position:fixed; left:50%; bottom:18px;
  transform: translateX(-50%);
  padding:10px 12px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(10,10,10,.85);
  backdrop-filter: blur(10px);
  color: rgba(255,255,255,.86);
  max-width: 92vw;
  box-shadow: var(--shadow2);
  opacity:0; pointer-events:none;
  transition: opacity .16s ease, transform .16s ease;
}
.toast.is-on{opacity:1; transform: translateX(-50%) translateY(-2px)}

/* Responsive */
@media (max-width: 1100px){
  .layout{grid-template-columns: 1fr;}
}
@media (max-width: 760px){
  .chips--emoji{grid-template-columns: repeat(8, minmax(0, 1fr));}
  .fontList{max-height: 280px}
}

/* STICKY_LEFT_PANEL */
:root{
  --topbar-offset: 86px; /* запас под sticky header */
}
.panel{
  position: sticky;
  top: var(--topbar-offset);
  align-self: start;
  max-height: calc(100vh - var(--topbar-offset) - 18px);
  overflow: auto;
  padding-right: 8px; /* чтобы скролл не лип к контенту */
}

/* чуть аккуратнее скроллбар (работает в WebKit/Chromium) */
.panel::-webkit-scrollbar{width:10px}
.panel::-webkit-scrollbar-track{background:rgba(255,255,255,.03);border-radius:999px}
.panel::-webkit-scrollbar-thumb{background:rgba(245,210,123,.22);border:1px solid rgba(255,255,255,.08);border-radius:999px}
.panel::-webkit-scrollbar-thumb:hover{background:rgba(245,210,123,.32)}

/* на узких экранах sticky не нужен */
@media (max-width: 1100px){
  .panel{
    position: static;
    top: auto;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
}
/* END STICKY_LEFT_PANEL */


/* TOPBAR_BUTTON_TUNING */
.topbar__actions{gap:10px}
.topbar__actions .btn{
  min-width: 200px;
  height: 42px;
  border-radius: 14px;
  box-shadow: none;
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.10);
}
.topbar__actions .btn:hover{
  background: rgba(255,255,255,.06);
  border-color: rgba(245,210,123,.22);
  transform: translateY(-1px);
}

/* делаем "Скопировать" чуть контрастнее, чтобы не терялась */
.topbar__actions .btn#btnCopy{
  background: rgba(0,0,0,.22);
  border-color: rgba(245,210,123,.20);
}
.topbar__actions .btn#btnCopy:hover{
  background: rgba(245,210,123,.07);
  border-color: rgba(245,210,123,.30);
}

/* главная кнопка — заметная, но не кричащая */
.topbar__actions .btn--gold{
  background: linear-gradient(135deg, rgba(245,210,123,.14), rgba(202,162,74,.08));
  border-color: rgba(245,210,123,.25);
}
.topbar__actions .btn--gold:hover{
  background: linear-gradient(135deg, rgba(245,210,123,.18), rgba(202,162,74,.10));
  border-color: rgba(245,210,123,.34);
}

/* на мобиле — одинаковые по ширине */
@media (max-width: 760px){
  .topbar__actions .btn{min-width:0}
}
/* END TOPBAR_BUTTON_TUNING */


/* BTN_FONT_WEIGHT_NORMAL */
.btn{
  font-weight: 600;      /* было слишком жирно */
  letter-spacing: .01em; /* аккуратнее */
}

/* CONTACTS_WEIGHT_NORMAL */
.contacts--compact .btn{
  font-weight: 600;  /* было жирно */
}

/* COPY_BUTTON_HIGHLIGHT */
.topbar__actions #btnCopy{
  min-width: 240px !important;          /* чтобы не переносилось */
  white-space: nowrap;                  /* запрет переносов */
  background: rgba(245,210,123,.08) !important;
  border-color: rgba(245,210,123,.38) !important;
  box-shadow: 0 0 0 3px rgba(245,210,123,.10) inset;
}
.topbar__actions #btnCopy:hover{
  background: rgba(245,210,123,.12) !important;
  border-color: rgba(245,210,123,.48) !important;
  transform: translateY(-1px);
}
@media (max-width: 760px){
  .topbar__actions #btnCopy{
    min-width: 0 !important;            /* на мобиле пусть тянется */
    flex: 1;
  }
}
/* END COPY_BUTTON_HIGHLIGHT */

