/* ============================================================
   CV Studio — application chrome & custom widget styles
   Light + dark theme via [data-theme] CSS variables.
   ============================================================ */

:root{
  --bg:#eceff4; --panel:#ffffff; --card:#ffffff;
  --line:#e2e5eb; --line2:#edeff3;
  --ink:#171922; --ink2:#3c4351; --mut:#7b8494;
  --pri:#0f766e; --pri-hover:#0d685f; --pri-ink:#ffffff; --pri-soft:rgba(15,118,110,.1);
  --danger:#dc2626; --danger-soft:rgba(220,38,38,.09);
  --shadow-sm:0 1px 2px rgba(15,23,42,.06);
  --shadow-md:0 4px 16px rgba(15,23,42,.1);
  --shadow-lg:0 16px 48px rgba(15,23,42,.22);
  --r:12px; --r-sm:8px;
  --dot:#d6dae2;
}
[data-theme="dark"]{
  --bg:#101218; --panel:#181b23; --card:#1e222c;
  --line:#2b303c; --line2:#232833;
  --ink:#e9ebf1; --ink2:#c4cad6; --mut:#8a92a3;
  --pri:#14a396; --pri-hover:#0f8c81; --pri-ink:#ffffff; --pri-soft:rgba(20,163,150,.15);
  --danger:#ef4444; --danger-soft:rgba(239,68,68,.14);
  --shadow-sm:0 1px 2px rgba(0,0,0,.35);
  --shadow-md:0 4px 16px rgba(0,0,0,.4);
  --shadow-lg:0 16px 48px rgba(0,0,0,.55);
  --dot:#262b36;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0; background:var(--bg); color:var(--ink);
  font:14px/1.45 'Inter',system-ui,-apple-system,'Segoe UI',sans-serif;
  -webkit-font-smoothing:antialiased; overflow:hidden;
}
button{font:inherit; color:inherit; background:none; border:0; padding:0; cursor:pointer}
button:disabled{opacity:.4; cursor:default}
::-webkit-scrollbar{width:10px; height:10px}
::-webkit-scrollbar-thumb{background:var(--line); border-radius:6px; border:2px solid transparent; background-clip:content-box}
::-webkit-scrollbar-thumb:hover{background:var(--mut); border:2px solid transparent; background-clip:content-box}
::-webkit-scrollbar-track{background:transparent}

#app{height:100vh; display:flex; flex-direction:column}

/* ============ topbar ============ */
.topbar{
  height:56px; flex:0 0 56px; display:flex; align-items:center; gap:8px;
  padding:0 14px; background:var(--panel); border-bottom:1px solid var(--line);
  position:relative; z-index:30;
}
.logo{display:flex; align-items:center; gap:9px; padding:6px 8px; border-radius:var(--r-sm)}
.logo:hover{background:var(--line2)}
.logo-mark{display:flex; align-items:center; justify-content:center; width:30px; height:30px;
  background:var(--pri); color:#fff; border-radius:9px}
.logo-mark .ic{width:16px; height:16px; display:inline-flex}
.logo-mark .ic svg{width:100%; height:100%}
.logo-text{font-size:16px; letter-spacing:.2px}
.logo-text b{font-weight:800}
.topbar-div{width:1px; height:24px; background:var(--line); margin:0 4px}
.topbar-spacer{flex:1}
.save-dot{width:8px; height:8px; border-radius:50%; background:var(--mut); margin:0 4px; transition:background .2s, box-shadow .2s}
.save-dot.pulse{background:#22c55e; box-shadow:0 0 0 4px rgba(34,197,94,.2)}

/* ============ layout ============ */
.main{flex:1; display:flex; min-height:0; position:relative}

.rail{
  width:68px; flex:0 0 68px; background:var(--panel); border-right:1px solid var(--line);
  display:flex; flex-direction:column; align-items:center; padding:10px 0; gap:6px; z-index:20;
}
.rail-btn{
  width:56px; padding:9px 0 7px; border-radius:10px; display:flex; flex-direction:column;
  align-items:center; gap:4px; color:var(--mut); font-size:10.5px; font-weight:600;
  transition:background .15s, color .15s;
}
.rail-btn .ic{width:19px; height:19px; display:inline-flex}
.rail-btn .ic svg{width:100%; height:100%}
.rail-btn:hover{background:var(--line2); color:var(--ink2)}
.rail-btn.active{background:var(--pri-soft); color:var(--pri)}
.rail-spacer{flex:1}
.rail-credit{
  width:34px; height:34px; border-radius:50%; background:linear-gradient(135deg,var(--pri),#0e4f8b);
  color:#fff; font-size:12px; font-weight:800; letter-spacing:.5px;
  display:flex; align-items:center; justify-content:center; box-shadow:var(--shadow-sm);
}
.rail-credit:hover{filter:brightness(1.1)}

.panel{
  width:390px; flex:0 0 390px; background:var(--panel); border-right:1px solid var(--line);
  overflow-y:auto; overscroll-behavior:contain; z-index:10;
}
.panel-page{display:none; padding:16px 16px 40px}
.panel-page.active{display:block}

/* ============ preview ============ */
.preview{
  flex:1; min-width:0; overflow:auto; position:relative;
  background-image:radial-gradient(var(--dot) 1.2px, transparent 1.2px);
  background-size:22px 22px;
}
#pagesOuter{margin:28px auto 90px; position:relative}
#pages{transform-origin:top left}
.preview-bar{
  position:sticky; bottom:18px; margin:0 auto; width:max-content;
  display:flex; align-items:center; gap:2px; padding:5px 10px;
  background:var(--panel); border:1px solid var(--line); border-radius:999px;
  box-shadow:var(--shadow-md); z-index:15;
}
.zoom-pct{min-width:46px; text-align:center; font-size:12px; color:var(--ink2); font-variant-numeric:tabular-nums}
.bar-div{width:1px; height:18px; background:var(--line); margin:0 6px}
.page-info{font-size:12px; color:var(--mut); padding-right:4px; white-space:nowrap}

/* ============ cards & panel content ============ */
.card{
  background:var(--card); border:1px solid var(--line); border-radius:var(--r);
  padding:16px; margin-bottom:14px; box-shadow:var(--shadow-sm);
}
.card-title{
  display:flex; align-items:center; gap:8px; font-size:13px; font-weight:700;
  color:var(--ink); margin-bottom:14px; letter-spacing:.2px;
}
.card-title .ic{color:var(--pri)}

.p-head{display:flex; gap:14px; margin-bottom:12px}
.p-names{flex:1; min-width:0}
.avatar{
  width:72px; height:72px; flex:0 0 72px; border-radius:50%; position:relative;
  background:var(--pri-soft); color:var(--pri); overflow:visible;
  display:flex; align-items:center; justify-content:center;
  border:2px dashed transparent; transition:border-color .15s;
}
.avatar:hover{border-color:var(--pri)}
.avatar img{width:100%; height:100%; object-fit:cover; border-radius:50%}
.avatar-init{font-size:22px; font-weight:800; letter-spacing:1px}
.avatar-badge{
  position:absolute; right:-2px; bottom:-2px; width:24px; height:24px; border-radius:50%;
  background:var(--pri); color:#fff; display:flex; align-items:center; justify-content:center;
  border:2px solid var(--card);
}
.avatar-badge .ic{width:12px; height:12px; display:inline-flex}
.avatar-badge .ic svg{width:100%; height:100%}

.links-block{margin-top:12px}
.links-list{display:flex; flex-direction:column; gap:6px; margin:6px 0 8px}
.link-row{display:flex; align-items:center; gap:6px}
.link-row .w-input:first-of-type{flex:0 0 32%}
.link-row .w-input{flex:1; min-width:0}

/* ---- sections ---- */
.sections{display:flex; flex-direction:column; gap:10px}
.sec-card{
  background:var(--card); border:1px solid var(--line); border-radius:var(--r);
  box-shadow:var(--shadow-sm); overflow:hidden; transition:border-color .15s;
}
.sec-card.sec-hidden{opacity:.6}
.sec-head{
  display:flex; align-items:center; gap:8px; padding:10px 12px; cursor:pointer;
  user-select:none;
}
.sec-head:hover{background:var(--line2)}
.sec-drag{color:var(--mut); cursor:grab; display:flex; padding:2px; touch-action:none}
.sec-ic{color:var(--pri); display:flex}
.sec-ic .ic, .sec-drag .ic{width:16px; height:16px; display:inline-flex}
.sec-ic .ic svg, .sec-drag .ic svg{width:100%; height:100%}
.sec-title-input{
  flex:1; min-width:0; border:0; background:transparent; color:var(--ink);
  font:inherit; font-weight:700; padding:4px 6px; border-radius:6px; outline:none;
}
.sec-title-input:hover, .sec-title-input:focus{background:var(--line2); box-shadow:inset 0 0 0 1px var(--line)}
.sec-count{
  font-size:11px; font-weight:700; color:var(--mut); background:var(--line2);
  border-radius:999px; padding:2px 8px; min-width:24px; text-align:center;
}
.sec-chev{color:var(--mut); display:flex; transition:transform .2s}
.sec-chev .ic{width:16px; height:16px; display:inline-flex}
.sec-chev .ic svg{width:100%; height:100%}
.sec-card.open > .sec-head .sec-chev{transform:rotate(180deg)}
.sec-body{display:none; padding:4px 12px 12px; border-top:1px solid var(--line2)}
.sec-card.open > .sec-body{display:block}
.item-list{display:flex; flex-direction:column; gap:8px; margin:8px 0}

/* items */
.item-card{border:1px solid var(--line); border-radius:var(--r-sm); background:var(--panel); overflow:hidden}
.item-head{display:flex; align-items:center; gap:6px; padding:8px 10px; cursor:pointer; user-select:none}
.item-head:hover{background:var(--line2)}
.item-drag{color:var(--mut); cursor:grab; display:flex; padding:2px; touch-action:none}
.item-drag .ic{width:14px; height:14px; display:inline-flex}
.item-drag .ic svg{width:100%; height:100%}
.item-title{flex:1; min-width:0; font-weight:600; font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.item-card .sec-chev{transition:transform .2s}
.item-card.open .sec-chev{transform:rotate(180deg)}
.item-body{display:none; padding:10px; border-top:1px solid var(--line2)}
.item-card.open .item-body{display:block}

.compact-row{display:flex; align-items:center; gap:8px; padding:2px 0}
.compact-row .grow{flex:1; min-width:0}
.compact-row .lvl-input{flex:0 0 84px}

.f-dates{display:flex; align-items:center; gap:6px}
.f-dates .w-select{flex:1; min-width:0}
.f-dash{color:var(--mut)}
.add-section-row{margin-top:14px; display:flex}
.add-section-row .w-btn{width:100%; justify-content:center}

/* add-section modal grid */
.type-grid{display:grid; grid-template-columns:repeat(3,1fr); gap:10px}
.type-card{
  display:flex; flex-direction:column; align-items:center; gap:8px; padding:16px 8px;
  border:1px solid var(--line); border-radius:var(--r-sm); background:var(--panel);
  transition:border-color .15s, background .15s; position:relative;
}
.type-card:hover:not(.used){border-color:var(--pri); background:var(--pri-soft)}
.type-card .ic{width:20px; height:20px; display:inline-flex; color:var(--pri)}
.type-card .ic svg{width:100%; height:100%}
.type-name{font-size:12px; font-weight:600; text-align:center}
.type-card.used{opacity:.5}
.type-used{font-size:10px; color:var(--mut)}

/* ============ template gallery ============ */
.gallery-head{margin-bottom:12px}
.gallery-head .card-title{margin-bottom:2px}
.gallery-sub{font-size:12px; color:var(--mut)}
.tgrid{display:grid; grid-template-columns:repeat(2,1fr); gap:12px}
.tcard{
  display:flex; flex-direction:column; align-items:center; gap:4px; padding:10px 8px 12px;
  border:2px solid var(--line); border-radius:var(--r); background:var(--card);
  transition:border-color .15s, transform .15s, box-shadow .15s;
}
.tcard:hover{transform:translateY(-2px); box-shadow:var(--shadow-md)}
.tcard.active{border-color:var(--pri); box-shadow:0 0 0 3px var(--pri-soft)}
.tthumb{
  overflow:hidden; border-radius:4px; border:1px solid var(--line);
  background:#fff; pointer-events:none; position:relative;
}
.tthumb .page{box-shadow:none !important}
.tname{font-size:13px; font-weight:700; margin-top:6px}
.ttags{font-size:10.5px; color:var(--mut)}
.tcard.active .tname{color:var(--pri)}

/* ============ widgets ============ */
.w-field{display:flex; flex-direction:column; gap:5px; margin-bottom:10px; min-width:0; flex:1}
.w-label{font-size:11.5px; font-weight:600; color:var(--mut); letter-spacing:.2px}
.w-row{display:flex; gap:10px}
.w-row > *{flex:1; min-width:0}

.w-input{
  width:100%; background:var(--panel); border:1px solid var(--line); color:var(--ink);
  border-radius:var(--r-sm); padding:8px 10px; font:inherit; outline:none;
  transition:border-color .15s, box-shadow .15s;
}
.w-input::placeholder{color:var(--mut); opacity:.7}
.w-input:focus{border-color:var(--pri); box-shadow:0 0 0 3px var(--pri-soft)}
.w-textarea{resize:none; min-height:60px; line-height:1.5}
.w-ta-wrap{display:flex; flex-direction:column; gap:0}
.w-ta-bar{
  display:flex; align-items:center; gap:2px; padding:4px 6px;
  border:1px solid var(--line); border-bottom:0; border-radius:var(--r-sm) var(--r-sm) 0 0;
  background:var(--line2);
}
.w-ta-bar + .w-textarea{border-radius:0 0 var(--r-sm) var(--r-sm)}
.w-ta-btn{
  width:24px; height:22px; border-radius:5px; font-size:12px; font-weight:700; color:var(--ink2);
}
.w-ta-btn:hover{background:var(--panel); color:var(--pri)}
.w-ta-hint{margin-left:auto; font-size:10px; color:var(--mut)}

.w-btn{
  display:inline-flex; align-items:center; gap:7px; padding:8px 14px;
  border-radius:var(--r-sm); font-weight:600; font-size:13px; white-space:nowrap;
  background:var(--line2); color:var(--ink2); border:1px solid transparent;
  transition:background .15s, color .15s, border-color .15s, transform .05s;
}
.w-btn:active{transform:translateY(1px)}
.w-btn .ic{width:15px; height:15px; display:inline-flex}
.w-btn .ic svg{width:100%; height:100%}
.w-btn:hover{background:var(--line)}
.w-btn.primary{background:var(--pri); color:var(--pri-ink)}
.w-btn.primary:hover{background:var(--pri-hover)}
.w-btn.ghost{background:transparent; border-color:var(--line); color:var(--ink2)}
.w-btn.ghost:hover{border-color:var(--mut); background:var(--line2)}
.w-btn.danger{background:var(--danger-soft); color:var(--danger)}
.w-btn.danger:hover{background:var(--danger); color:#fff}
.w-btn.small{padding:6px 11px; font-size:12px}

.w-iconbtn{
  width:32px; height:32px; border-radius:8px; display:inline-flex; align-items:center;
  justify-content:center; color:var(--ink2); flex:0 0 auto;
  transition:background .15s, color .15s;
}
.w-iconbtn .ic{width:16px; height:16px; display:inline-flex}
.w-iconbtn .ic svg{width:100%; height:100%}
.w-iconbtn:hover{background:var(--line2); color:var(--ink)}

/* custom select */
.w-select{
  display:flex; align-items:center; gap:8px; width:100%;
  background:var(--panel); border:1px solid var(--line); border-radius:var(--r-sm);
  padding:8px 10px; text-align:left; transition:border-color .15s, box-shadow .15s;
}
.w-select:hover{border-color:var(--mut)}
.w-select:focus-visible{border-color:var(--pri); box-shadow:0 0 0 3px var(--pri-soft); outline:none}
.w-select-label{flex:1; min-width:0; display:flex; align-items:center; gap:8px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.w-select > .ic{color:var(--mut); width:14px; height:14px; display:inline-flex; flex:0 0 auto}
.w-select > .ic svg{width:100%; height:100%}
.w-ph{color:var(--mut)}
.w-date .ic-calendar{color:var(--pri)}

.w-pop{
  position:fixed; z-index:1000; background:var(--panel); border:1px solid var(--line);
  border-radius:10px; box-shadow:var(--shadow-lg); overflow:hidden;
  opacity:0; transform:translateY(-4px); transition:opacity .12s, transform .12s;
}
.w-pop.open{opacity:1; transform:none}
.w-list{max-height:300px; overflow-y:auto; padding:5px; display:flex; flex-direction:column}
.w-opt{
  display:flex; align-items:center; gap:8px; padding:8px 10px; border-radius:7px;
  text-align:left; font-size:13px; color:var(--ink2);
}
.w-opt:hover{background:var(--line2); color:var(--ink)}
.w-opt.sel{color:var(--pri); font-weight:600}
.w-opt .ic{width:14px; height:14px; margin-left:auto; color:var(--pri); display:inline-flex; flex:0 0 auto}
.w-opt .ic svg{width:100%; height:100%}
.w-opt-lab{flex:0 1 auto; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.w-opt-hint{font-size:11px; color:var(--mut); margin-left:auto; padding-left:12px}
.w-opt.sel .w-opt-hint{margin-left:0}
.w-swatch{width:14px; height:14px; border-radius:4px; flex:0 0 auto; box-shadow:inset 0 0 0 1px rgba(0,0,0,.12)}

/* custom month/year calendar */
.w-cal{padding:10px; width:248px}
.w-cal-head{display:flex; align-items:center; justify-content:space-between; margin-bottom:8px}
.w-cal-year{font-weight:800; font-size:15px; letter-spacing:.5px}
.w-cal-grid{display:grid; grid-template-columns:repeat(4,1fr); gap:5px}
.w-cal-m{
  padding:9px 0; border-radius:7px; font-size:12px; font-weight:600; color:var(--ink2);
  transition:background .12s, color .12s;
}
.w-cal-m:hover{background:var(--line2); color:var(--ink)}
.w-cal-m.sel{background:var(--pri); color:#fff}
.w-cal-foot{display:flex; gap:6px; margin-top:9px; border-top:1px solid var(--line2); padding-top:9px}
.w-cal-act{
  flex:1; padding:7px 0; border-radius:7px; font-size:12px; font-weight:600;
  background:var(--line2); color:var(--ink2);
}
.w-cal-act:hover{background:var(--line)}
.w-cal-act.sel{background:var(--pri); color:#fff}
.w-cal-clear{flex:0 0 auto; padding:7px 12px; color:var(--mut); background:transparent}
.w-cal-clear:hover{color:var(--danger); background:var(--danger-soft)}

/* custom slider */
.w-slider{display:flex; align-items:center; gap:10px; min-height:28px}
.w-slider-track{
  position:relative; flex:1; height:22px; display:flex; align-items:center; cursor:pointer;
  touch-action:none;
}
.w-slider-track::before{
  content:''; position:absolute; left:0; right:0; height:5px; border-radius:3px;
  background:var(--line);
}
.w-slider-fill{position:absolute; left:0; height:5px; border-radius:3px; background:var(--pri); pointer-events:none}
.w-slider-thumb{
  position:absolute; width:16px; height:16px; border-radius:50%; background:#fff;
  border:2px solid var(--pri); transform:translateX(-50%);
  box-shadow:var(--shadow-sm); pointer-events:none; transition:box-shadow .15s;
}
.w-slider.dragging .w-slider-thumb{box-shadow:0 0 0 6px var(--pri-soft)}
.w-slider-val{flex:0 0 44px; text-align:right; font-size:12px; color:var(--mut); font-variant-numeric:tabular-nums}

/* toggle */
.w-toggle{
  width:42px; height:24px; border-radius:999px; background:var(--line); position:relative;
  transition:background .2s; flex:0 0 auto;
}
.w-toggle .w-knob{
  position:absolute; top:3px; left:3px; width:18px; height:18px; border-radius:50%;
  background:#fff; box-shadow:var(--shadow-sm); transition:left .2s;
}
.w-toggle.on{background:var(--pri)}
.w-toggle.on .w-knob{left:21px}

/* segmented */
.w-seg{display:flex; background:var(--line2); border-radius:var(--r-sm); padding:3px; gap:3px}
.w-seg-btn{
  flex:1; display:flex; align-items:center; justify-content:center; gap:6px;
  padding:6px 8px; border-radius:6px; font-size:12px; font-weight:600; color:var(--mut);
  transition:background .15s, color .15s; white-space:nowrap;
}
.w-seg-btn:hover{color:var(--ink2)}
.w-seg-btn.sel{background:var(--panel); color:var(--pri); box-shadow:var(--shadow-sm)}

/* dots rating */
.w-dots{display:flex; gap:4px; flex:0 0 auto}
.w-dot{width:14px; height:14px; border-radius:50%; background:var(--line); transition:background .12s, transform .12s}
.w-dot:hover{transform:scale(1.2)}
.w-dot.on{background:var(--pri)}

/* color picker */
.w-color{display:flex; flex-direction:column; gap:12px}
.w-color-swatches{display:grid; grid-template-columns:repeat(9,1fr); gap:7px}
.w-swatch-btn{
  aspect-ratio:1; border-radius:8px; box-shadow:inset 0 0 0 1px rgba(0,0,0,.12);
  transition:transform .12s, box-shadow .12s; position:relative;
}
.w-swatch-btn:hover{transform:scale(1.12)}
.w-swatch-btn.sel{box-shadow:0 0 0 2px var(--panel), 0 0 0 4px var(--pri)}
.w-color-custom{display:flex; align-items:center; gap:10px}
.w-color-cur{width:34px; height:34px; border-radius:9px; flex:0 0 auto; box-shadow:inset 0 0 0 1px rgba(0,0,0,.15)}
.w-hex{flex:0 0 92px; font-family:'JetBrains Mono',monospace; font-size:12.5px}
.w-color-sliders{flex:1; display:flex; flex-direction:column; gap:2px; min-width:0}
.w-hue .w-slider-track::before{
  background:linear-gradient(90deg,#f00,#ff0,#0f0,#0ff,#00f,#f0f,#f00);
}
.w-hue .w-slider-fill{display:none}
.w-lig .w-slider-track::before{background:linear-gradient(90deg,#111,#9ca3af,#fff)}
.w-lig .w-slider-fill{display:none}

/* ============ modal ============ */
.w-modal-overlay{
  position:fixed; inset:0; z-index:2000; background:rgba(10,14,22,.5);
  display:flex; align-items:center; justify-content:center; padding:20px;
  opacity:0; transition:opacity .16s; backdrop-filter:blur(2px);
}
.w-modal-overlay.show{opacity:1}
.w-modal{
  width:min(440px, 94vw); max-height:88vh; display:flex; flex-direction:column;
  background:var(--panel); border-radius:16px; box-shadow:var(--shadow-lg);
  border:1px solid var(--line);
  transform:translateY(10px) scale(.98); transition:transform .16s;
}
.w-modal-overlay.show .w-modal{transform:none}
.w-modal.wide{width:min(760px, 94vw)}
.w-modal-head{display:flex; align-items:center; justify-content:space-between; padding:16px 18px 0}
.w-modal-title{font-size:16px; font-weight:800}
.w-modal-body{padding:16px 18px; overflow-y:auto}
.w-modal-foot{
  display:flex; justify-content:flex-end; gap:8px; padding:12px 18px;
  border-top:1px solid var(--line2);
}
.w-confirm-msg{color:var(--ink2); line-height:1.55}

/* ============ toast ============ */
.w-toast-wrap{
  position:fixed; top:66px; right:16px; z-index:3000; display:flex;
  flex-direction:column; gap:8px; pointer-events:none;
}
.w-toast{
  display:flex; align-items:center; gap:9px; padding:10px 14px;
  background:var(--panel); color:var(--ink); border:1px solid var(--line);
  border-radius:10px; box-shadow:var(--shadow-md); font-size:13px; font-weight:500;
  opacity:0; transform:translateX(12px); transition:opacity .2s, transform .2s;
}
.w-toast.show{opacity:1; transform:none}
.w-toast .ic{width:15px; height:15px; display:inline-flex; flex:0 0 auto}
.w-toast .ic svg{width:100%; height:100%}
.w-toast.ok .ic{color:#22c55e}
.w-toast.error .ic{color:var(--danger)}
.w-toast.warn .ic{color:#f59e0b}

/* spinner + pdf progress */
.w-spinner{
  width:26px; height:26px; border-radius:50%; border:3px solid var(--line);
  border-top-color:var(--pri); animation:spin .8s linear infinite;
}
@keyframes spin{to{transform:rotate(360deg)}}
.pdf-prog{display:flex; align-items:center; gap:14px; padding:6px 0}
.pdf-prog-txt{color:var(--ink2)}

/* ============ drag & drop ============ */
.drag-handle{cursor:grab; touch-action:none}
.drag-ghost{
  position:fixed; z-index:5000; pointer-events:none; opacity:.92;
  box-shadow:var(--shadow-lg); border-radius:var(--r-sm);
  background:var(--card); transform:rotate(1.2deg);
}
.drag-src{opacity:.35}
body.dragging-any{cursor:grabbing; user-select:none}

/* ============ image editor ============ */
.ie-wrap{display:flex; gap:20px; align-items:flex-start}
.ie-left{flex:0 0 340px; display:flex; flex-direction:column; gap:8px}
.ie-stage{
  position:relative; width:340px; height:340px; border-radius:12px; overflow:hidden;
  background:
    linear-gradient(45deg, var(--line2) 25%, transparent 25%, transparent 75%, var(--line2) 75%),
    linear-gradient(45deg, var(--line2) 25%, transparent 25%, transparent 75%, var(--line2) 75%);
  background-size:18px 18px; background-position:0 0, 9px 9px;
}
.ie-canvas{display:block; cursor:grab; touch-action:none}
.ie-canvas:active{cursor:grabbing}
.ie-mask{
  position:absolute; inset:0; pointer-events:none;
  box-shadow:0 0 0 600px rgba(10,14,22,.35);
  border:1.5px dashed rgba(255,255,255,.8);
  transition:border-radius .2s;
}
.ie-drop{
  width:340px; height:340px; border:2px dashed var(--line); border-radius:12px;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px;
  color:var(--mut); cursor:pointer; transition:border-color .15s, background .15s, color .15s;
}
.ie-drop:hover, .ie-drop.over{border-color:var(--pri); background:var(--pri-soft); color:var(--pri)}
.ie-drop-t{font-weight:700; font-size:15px}
.ie-drop-s{font-size:12px}
.ie-hint{font-size:11.5px; color:var(--mut); text-align:center}
.ie-controls{flex:1; min-width:220px}
.ie-controls.disabled{opacity:.45; pointer-events:none}
.ie-rot-row{display:flex; align-items:center; gap:6px}
.ie-rot-row .w-slider{flex:1}
.ie-row{display:flex; gap:8px; margin-top:6px}

/* ============ misc panels ============ */
.data-col{display:flex; flex-direction:column; gap:8px}
.data-col .w-btn{justify-content:flex-start}
.data-note{font-size:12px; color:var(--mut); line-height:1.5; margin:6px 2px 0}
.design-reset{display:flex; margin-top:4px}
.design-reset .w-btn{width:100%; justify-content:center}

.about p{line-height:1.6; color:var(--ink2); margin:0 0 16px}
.about-credit{
  display:flex; align-items:center; gap:14px; padding:14px;
  border:1px solid var(--line); border-radius:12px; background:var(--line2);
}
.about-avatar{
  width:44px; height:44px; border-radius:50%; flex:0 0 auto;
  background:linear-gradient(135deg,var(--pri),#0e4f8b); color:#fff;
  display:flex; align-items:center; justify-content:center; font-weight:800; letter-spacing:.5px;
}
.about-who{display:flex; flex-direction:column; gap:4px; min-width:0}
.about-name{font-weight:700}
.about-links{display:flex; flex-wrap:wrap; gap:4px 16px; font-size:12.5px}
.about-links a{display:inline-flex; align-items:center; gap:5px; color:var(--pri); text-decoration:none}
.about-links a:hover{text-decoration:underline}
.about-links .ic{width:13px; height:13px; display:inline-flex}
.about-links .ic svg{width:100%; height:100%}

.only-mobile{display:none !important}

/* static intro content — shown full-width before boot (no-JS / crawlers),
   then moved into the About panel where users can read it */
.seo-static{max-width:760px; margin:48px auto; padding:0 24px; line-height:1.65; color:var(--ink)}
.seo-static h1{font-size:28px; line-height:1.25}
.seo-static h2{margin-top:28px; font-size:19px}
.seo-static ul{padding-left:22px}
.seo-static li{margin:6px 0}
.seo-static a{color:var(--pri)}
.panel-page .seo-static{max-width:none; margin:0; padding:0; font-size:13.5px; line-height:1.6}
.panel-page .seo-static h1{font-size:19px; margin:0 0 10px}
.panel-page .seo-static h2{font-size:14px; margin:22px 0 6px}
.panel-page .seo-static p{margin:0 0 12px; color:var(--ink2)}
.panel-page .seo-static li{color:var(--ink2)}

/* ============ responsive ============ */
@media (max-width:1100px){
  .panel{width:340px; flex-basis:340px}
}
@media (max-width:900px){
  .only-mobile{display:inline-flex !important}
  .topbar .w-btn span{display:none}
  .topbar .w-btn{padding:8px 10px}
  .rail{position:absolute; left:0; top:0; bottom:0; transform:translateX(-100%);
    transition:transform .2s; box-shadow:var(--shadow-lg)}
  .panel{position:absolute; left:0; top:0; bottom:0; width:min(86vw,390px);
    transform:translateX(-110%); transition:transform .2s; box-shadow:var(--shadow-lg)}
  .main.panel-open .rail{transform:none}
  .main.panel-open .panel{transform:translateX(68px)}
}
