:root{
  --bg:#f5f5f3;
  --surface:#ffffff;
  --surface-soft:#fafafa;
  --text:#16171a;
  --muted:#737780;
  --line:#e2e3e5;
  --line-strong:#cfd1d5;
  --shadow:0 18px 55px rgba(22,23,26,.08);
  --accent:#111214;
}
html[data-site-theme="dark"]{
  --bg:#0d0e10;
  --surface:#151619;
  --surface-soft:#1b1c20;
  --text:#f6f6f6;
  --muted:#969aa4;
  --line:#292b30;
  --line-strong:#3b3e45;
  --shadow:0 22px 70px rgba(0,0,0,.34);
  --accent:#f6f6f6;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  min-height:100vh;
  background:var(--bg);
  color:var(--text);
  font-family:"Rubik",sans-serif;
  transition:background .2s,color .2s
}
button,input,textarea{font:inherit}
button{cursor:pointer}
.topbar{
  width:calc(100% - 32px);
  min-height:72px;
  margin:16px auto 0;
  padding:0 22px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border:1px solid var(--line);
  border-radius:18px;
  background:var(--surface);
  box-shadow:0 8px 28px rgba(0,0,0,.035)
}
.brand{
  display:flex;
  align-items:center;
  gap:12px;
  color:var(--text);
  text-decoration:none;
  direction:ltr
}
.brand-mark{
  width:34px;
  height:34px;
  display:grid;
  place-items:center;
  border-radius:0;
  background:transparent
}
.brand-mark img{
  width:31px;
  height:31px;
  filter:none
}
html[data-site-theme="dark"] .brand-mark img{filter:invert(1)}
.brand strong{font-size:1.35rem;letter-spacing:-.025em}
.top-actions{display:flex;align-items:center;gap:12px}
.tools-entry-button{
  min-height:40px;
  padding:0 14px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  border:1px solid var(--text);
  border-radius:11px;
  color:var(--surface);
  background:var(--text);
  text-decoration:none;
  font-size:.82rem;
  font-weight:600;
  white-space:nowrap;
  transition:transform .16s ease,opacity .16s ease
}
.tools-entry-button:hover{transform:translateY(-1px);opacity:.9}
.tools-entry-icon{font-size:.95rem;line-height:1}
.text-button,.icon-button{
  border:0;
  color:var(--text);
  background:transparent
}
.text-button{font-weight:600}
.icon-button{
  width:38px;
  height:38px;
  border:1px solid var(--line);
  border-radius:12px
}
.top-divider{width:1px;height:22px;background:var(--line)}
.generator{
  width:min(1540px,calc(100% - 32px));
  margin:22px auto;
  display:grid;
  grid-template-columns:390px minmax(0,1fr);
  gap:24px;
  direction:ltr
}
.editor-card,.preview-area{direction:rtl}
.editor-card{
  align-self:start;
  padding:20px;
  border:1px solid var(--line);
  border-radius:20px;
  background:var(--surface);
  box-shadow:var(--shadow)
}
.editor-tabs{
  display:grid;
  grid-template-columns:1fr 1fr 1fr;
  margin-bottom:20px;
  border-bottom:1px solid var(--line)
}
.editor-tabs button{
  position:relative;
  padding:11px;
  border:0;
  color:var(--muted);
  background:transparent;
  font:inherit;
  font-weight:500;
  text-align:center
}
.editor-tabs button:hover,
.editor-tabs button.active{color:var(--text)}
.editor-tabs button:after{
  content:"";
  position:absolute;
  right:0;
  bottom:-1px;
  width:100%;
  height:2px;
  background:transparent
}
.editor-tabs button.active:after{background:var(--text)}
.tab-pane{display:none}
.tab-pane.active{display:block}
.profile-editor{margin-bottom:18px}
.profile-preview{
  display:grid;
  grid-template-columns:88px minmax(0,1fr);
  gap:14px;
  direction:ltr;
  align-items:center
}
.avatar-preview{
  width:88px;
  height:88px;
  display:grid;
  place-items:center;
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:50%;
  background:linear-gradient(145deg,#eeeeee,#d8dade)
}
.avatar-preview img{width:100%;height:100%;object-fit:contain;background:transparent}
.avatar-placeholder{
  color:#747881;
  font-size:3rem;
  font-weight:300;
  transform:translateY(-2px)
}
.upload-box{
  min-height:88px;
  padding:10px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  border:1px dashed var(--line-strong);
  border-radius:13px;
  color:var(--text);
  background:var(--surface-soft);
  direction:rtl
}
.upload-box input{display:none}
.upload-box strong{font-size:.87rem}
.upload-box small{margin-top:3px;color:var(--muted);font-size:.67rem}
.upload-icon{font-size:1.3rem;margin-bottom:2px}
.small-link{
  margin:7px 0 0;
  padding:0;
  border:0;
  color:var(--muted);
  background:transparent;
  font-size:.75rem
}
.field{
  display:block;
  margin-bottom:15px
}
.field>span{
  margin-bottom:7px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  font-size:.82rem
}
.field>span small{color:var(--muted);font-size:.7rem}
.field input,.field textarea{
  width:100%;
  border:1px solid var(--line);
  border-radius:10px;
  outline:0;
  color:var(--text);
  background:var(--surface-soft)
}
.field input{
  height:43px;
  padding:0 12px
}
.field textarea{
  min-height:190px;
  padding:12px;
  resize:vertical;
  line-height:1.65
}
.field input:focus,.field textarea:focus{border-color:var(--line-strong);box-shadow:0 0 0 3px rgba(90,110,255,.07)}
.privacy-note{
  display:flex;
  gap:8px;
  margin-top:10px;
  padding:10px;
  border:1px solid #dbe5f5;
  border-radius:10px;
  color:#47617c;
  background:#f6f9fd;
  font-size:.72rem;
  line-height:1.5
}
html[data-site-theme="dark"] .privacy-note{
  border-color:#29394e;
  color:#a9bad0;
  background:#171e27
}
.privacy-note p{margin:0}
.metrics-editor{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:8px;
  direction:ltr
}
.metrics-editor label{
  min-width:0;
  padding:8px 5px 7px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:4px;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--surface-soft)
}
.metrics-editor input{
  height:auto;
  padding:0;
  border:0;
  text-align:center;
  background:transparent;
  font-size:.8rem;
  -moz-appearance:textfield
}
.metrics-editor input::-webkit-outer-spin-button,
.metrics-editor input::-webkit-inner-spin-button{margin:0;-webkit-appearance:none}
.metrics-editor small{color:var(--muted);font-size:.59rem;white-space:nowrap}
.metric-symbol{font-size:1.22rem;line-height:1}
.segmented{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:7px
}
.segmented button{
  min-height:43px;
  border:1px solid var(--line);
  border-radius:10px;
  color:var(--muted);
  background:var(--surface-soft)
}
.segmented button.active{
  border-color:var(--text);
  color:var(--text);
  box-shadow:inset 0 0 0 1px var(--text)
}
.size-options{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px
}
.size-options button{
  min-height:64px;
  padding:7px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:3px;
  border:1px solid var(--line);
  border-radius:10px;
  color:var(--text);
  background:var(--surface-soft)
}
.size-options button small{color:var(--muted);font-size:.65rem}
.size-options button.active{
  border-color:var(--text);
  box-shadow:inset 0 0 0 1px var(--text)
}
.switch-row{
  margin:18px 0 24px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px
}
.switch-row b,.switch-row small{display:block}
.switch-row b{font-size:.82rem}
.switch-row small{margin-top:3px;color:var(--muted);font-size:.68rem}
.switch-row input{
  appearance:none;
  width:42px;
  height:24px;
  position:relative;
  flex:none;
  border:1px solid var(--line-strong);
  border-radius:20px;
  background:var(--line)
}
.switch-row input:after{
  content:"";
  width:18px;
  height:18px;
  position:absolute;
  top:2px;
  left:3px;
  border-radius:50%;
  background:#fff;
  transition:.2s
}
.switch-row input:checked{background:#111}
.switch-row input:checked:after{left:20px}
.primary-button{
  width:100%;
  min-height:49px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:9px;
  border:0;
  border-radius:11px;
  color:#fff;
  background:#111214;
  font-weight:600
}
html[data-site-theme="dark"] .primary-button{color:#111;background:#f5f5f5}
.share-logo{width:22px;height:22px;display:block;filter:invert(1) brightness(3)}
html[data-site-theme="dark"] .share-logo{filter:none}
.share-note{
  margin:8px 0 0;
  color:var(--muted);
  text-align:center;
  font-size:.7rem
}
.preview-area{min-width:0;padding:17px 0}
.preview-copy{
  margin:0 4px 20px;
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:18px
}
.preview-copy h1{margin:0;font-size:1.35rem}
.preview-copy p{margin:6px 0 0;color:var(--muted);font-size:.86rem}
.adaptive-pill{
  padding:8px 11px;
  border:1px solid var(--line);
  border-radius:999px;
  color:var(--muted);
  background:var(--surface);
  font-size:.72rem
}
.canvas-wrap{
  width:100%;
  min-height:430px;
  padding:28px;
  display:grid;
  place-items:center;
  overflow:auto;
  border:1px solid var(--line);
  border-radius:24px;
  background:
    radial-gradient(circle at 50% 50%,rgba(0,0,0,.028),transparent 58%),
    var(--surface-soft)
}
#cardCanvas{
  display:block;
  width:auto;
  height:auto;
  max-width:100%;
  max-height:720px;
  border-radius:20px;
  box-shadow:0 22px 55px rgba(0,0,0,.14)
}
.adaptive-message{
  margin-top:18px;
  padding:18px 20px;
  display:flex;
  align-items:center;
  gap:13px;
  border:1px solid var(--line);
  border-radius:16px;
  background:var(--surface)
}
.adaptive-message strong{font-size:.85rem}
.adaptive-message p{margin:5px 0 0;color:var(--muted);font-size:.75rem}
.sparkle{color:var(--muted);font-size:1.6rem}
.seo-content{
  width:min(980px,calc(100% - 32px));
  margin:65px auto 45px;
  text-align:center
}
.seo-content h2{margin:0 0 10px}
.seo-content p{margin:0;color:var(--muted);line-height:1.8}
.footer{
  width:min(1540px,calc(100% - 32px));
  margin:0 auto 25px;
  padding:20px 0;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  border-top:1px solid var(--line);
  color:var(--muted);
  font-size:.75rem
}
.footer nav{display:flex;flex-wrap:wrap;gap:15px}
.footer a{color:inherit;text-decoration:none}
dialog{
  max-width:430px;
  padding:25px;
  border:1px solid var(--line);
  border-radius:18px;
  color:var(--text);
  background:var(--surface)
}
dialog::backdrop{background:rgba(0,0,0,.5)}
dialog h2{margin:0 0 10px;font-size:1.2rem}
dialog p{color:var(--muted);line-height:1.7}
dialog button{
  width:100%;
  min-height:42px;
  border:0;
  border-radius:9px;
  color:#fff;
  background:#111
}
.ad-container[hidden]{display:none!important}
.noscript-message{
  position:fixed;
  z-index:100;
  right:16px;
  bottom:16px;
  padding:13px;
  border-radius:9px;
  color:#fff;
  background:#711
}
@media(max-width:980px){
  .generator{grid-template-columns:1fr}
  .editor-card{order:2}
  .preview-area{order:1}
  .canvas-wrap{min-height:390px;padding:20px}
}
@media(max-width:600px){
  .top-actions{gap:7px}
  .top-divider{height:18px}
  .topbar,.generator,.footer,.seo-content{width:calc(100% - 20px)}
  .topbar{margin-top:10px;padding:0 14px}
  .brand strong{font-size:1.1rem}
  .generator{margin-top:12px;gap:12px}
  .editor-card{padding:14px}
  .preview-copy{align-items:flex-start}
  .adaptive-pill{display:none}
  .canvas-wrap{min-height:300px;padding:10px;border-radius:17px}
  #cardCanvas{max-height:490px;border-radius:13px}
  .metrics-editor{gap:5px}
  .metrics-editor small{font-size:.52rem}
  .footer{align-items:flex-start;flex-direction:column}
}
