/* ─── RESET & TOKENS ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg:#f5f5fa; --s1:#ffffff; --s2:#f0f0f7; --s3:#e4e4ef; --s4:#d8d8eb;
  --bd:rgba(0,0,0,.08); --bd2:rgba(0,0,0,.14); --bd3:rgba(0,0,0,.22);
  --acc:#7c3aed; --acc2:#6d28d9;
  --teal:#0a9e87; --teal2:#087a69;
  --red:#dc2626; --amber:#d97706;
  --txt:#111118; --txt2:#5a5a78; --txt3:#8888a8;
  --h:'Bricolage Grotesque', sans-serif;
  --b:'DM Sans', sans-serif;
  --r:9px; --r2:13px; --r3:18px;
  /* layout */
  --topbar:56px;
  --sb-w:clamp(200px,22vw,280px);
  --prog:2px;
}

/* ─── BASE ────────────────────────────────────────────────────── */
html, body {
  height: 100%; overflow: hidden;
  background: var(--bg); color: var(--txt);
  font-family: var(--b); font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
}
input, textarea, select, button { font-family: var(--b); font-size: 16px; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: var(--teal); text-decoration: none; }
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-thumb { background: var(--bd3); border-radius: 2px; }
::placeholder { color: var(--txt3); }

/* ─── ANIMATIONS ──────────────────────────────────────────────── */
@keyframes spin    { to { transform: rotate(360deg); } }
@keyframes fadeUp  { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }
@keyframes fadeIn  { from { opacity:0; } to { opacity:1; } }
@keyframes pulse   { 0%,100% { opacity:1; } 50% { opacity:.35; } }
@keyframes bounce3 { 0%,80%,100% { transform:translateY(0); } 40% { transform:translateY(-6px); } }
@keyframes glow    { 0%,100% { box-shadow:0 0 24px rgba(124,58,237,.25); } 50% { box-shadow:0 0 48px rgba(124,58,237,.5); } }

/* ─── APP SHELL ───────────────────────────────────────────────── */
#app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.screen { height: 100%; display: flex; flex-direction: column; overflow: hidden; animation: fadeIn .22s ease; }
.gone { display: none !important; }

/* ─── TOPBAR ──────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar); flex-shrink: 0;
  background: var(--s1); border-bottom: 1px solid var(--bd);
  display: flex; align-items: center; gap: 10px;
  padding: 0 clamp(12px, 2vw, 20px);
  z-index: 100;
}
.logo-wrap { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.logo-mark {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--h); font-size: 15px; font-weight: 800; color: #fff;
}
.logo-name {
  font-family: var(--h); font-size: 17px; font-weight: 800;
  letter-spacing: -.04em; white-space: nowrap; color: var(--txt);
}
.logo-img { height: 28px; width: auto; flex-shrink: 0; }
.sp-logo-img {
  height: clamp(56px, 10vw, 72px); width: auto; margin-bottom: 24px;
  position: relative; z-index: 1;
  filter: drop-shadow(0 8px 32px rgba(124,58,237,.3));
  animation: fadeUp .5s ease both;
}
.topbar-div { width: 1px; height: 22px; background: var(--bd2); flex-shrink: 0; }
.topbar-ctx { font-size: 14px; font-weight: 500; color: var(--txt2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.topbar-r { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* ─── BUTTONS ─────────────────────────────────────────────────── */
.btn {
  padding: 9px 18px; border-radius: var(--r); font-size: 14px; font-weight: 600;
  letter-spacing: -.01em;
  transition: all .12s; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  border: none; white-space: nowrap;
}
.btn-p  { background: var(--acc); color: #fff; box-shadow: 0 1px 3px rgba(124,58,237,.3); }
.btn-p:hover { background: var(--acc2); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(124,58,237,.35); }
.btn-p:active { transform: none; box-shadow: none; }
.btn-p:disabled { background: var(--s3); color: var(--txt3); cursor: not-allowed; transform: none; box-shadow: none; }
.btn-g  { background: var(--s1); color: var(--txt); border: 1.5px solid var(--bd2); font-weight: 500; }
.btn-g:hover { background: var(--s2); border-color: var(--bd3); }
.btn-t  { background: var(--teal); color: #fff; font-weight: 700; }
.btn-t:hover { background: var(--teal2); }
.btn-sm { padding: 6px 13px; font-size: 13px; }
.btn-lg { padding: 14px 30px; font-size: clamp(15px, 1.4vw, 17px); font-family: var(--h); font-weight: 800; letter-spacing: -.02em; }
.btn-full { width: 100%; justify-content: center; }
.btn-icon { padding: 7px 10px; border-radius: var(--r); border: 1.5px solid var(--bd2); color: var(--txt2); }
.btn-icon:hover { background: var(--s2); color: var(--txt); }

/* ─── INPUTS ──────────────────────────────────────────────────── */
.inp {
  width: 100%; background: var(--s1); border: 2px solid var(--bd2);
  border-radius: var(--r); color: var(--txt); padding: 12px 16px;
  outline: none; transition: border-color .12s, box-shadow .12s; line-height: 1.6;
  font-size: 16px;
}
.inp:focus { border-color: var(--acc); box-shadow: 0 0 0 3px rgba(124,58,237,.1); }
textarea.inp { resize: vertical; font-family: var(--b); }

/* ─── BADGES ──────────────────────────────────────────────────── */
.badge      { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 20px; font-size: 10px; font-weight: 600; }
.bdg-purple { background: rgba(124,58,237,.15); color: #a78bfa; }
.bdg-teal   { background: rgba(0,201,167,.12);  color: var(--teal); }
.bdg-amber  { background: rgba(245,158,11,.12); color: var(--amber); }
.bdg-gray   { background: var(--s2); color: var(--txt2); border: 1px solid var(--bd); }

/* ─── CARD ────────────────────────────────────────────────────── */
.card   { background: var(--s1); border: 2px solid var(--bd2); border-radius: var(--r2); }
.card-p { padding: clamp(18px, 2.5vw, 26px) clamp(18px, 2.5vw, 28px); }

/* ─── TOGGLE ──────────────────────────────────────────────────── */
.tog { width: 36px; height: 20px; border-radius: 10px; background: var(--s3); border: 1px solid var(--bd); position: relative; cursor: pointer; transition: background .2s; flex-shrink: 0; }
.tog.on { background: var(--acc); border-color: var(--acc); }
.tog::after { content: ''; width: 14px; height: 14px; border-radius: 50%; background: var(--txt3); position: absolute; top: 2px; left: 2px; transition: all .2s; }
.tog.on::after { left: 18px; background: #fff; }

/* ─── STEP BAR ────────────────────────────────────────────────── */
.stepbar { display: flex; align-items: center; justify-content: center; gap: 0; margin-bottom: 14px; flex-wrap: nowrap; }
.step    { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.sdot2   { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; transition: all .3s; }
.sdot2.done   { background: var(--teal); color: #fff; border: 2px solid var(--teal); }
.sdot2.active { background: var(--acc);  color: #fff; border: 2px solid var(--acc); }
.sdot2.idle   { background: var(--s1);   color: var(--txt3); border: 2px solid var(--bd2); }
.slbl { font-size: 12px; font-weight: 600; white-space: nowrap; transition: color .3s; letter-spacing: -.01em; }
.slbl.done   { color: var(--teal); }
.slbl.active { color: var(--txt); }
.slbl.idle   { color: var(--txt3); }
.sline { width: clamp(24px, 3vw, 48px); height: 2px; margin-bottom: 19px; transition: background .3s; border-radius: 1px; }
.sline.done { background: var(--teal); }
.sline.idle { background: var(--bd2); }

/* ─── PROGRESS ────────────────────────────────────────────────── */
.prog-track { height: var(--prog); background: var(--s3); flex-shrink: 0; overflow: hidden; }
.prog-fill  { height: 100%; background: linear-gradient(90deg, var(--acc), #818cf8); transition: width .5s ease; }

/* ─── STATUS DOTS ─────────────────────────────────────────────── */
.sdot       { width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.sd-idle    { border: 1.5px solid var(--bd); }
.sd-spin    { border: 2px solid rgba(124,58,237,.2); border-top-color: var(--acc); animation: spin .7s linear infinite; }
.sd-done    { background: rgba(0,201,167,.12); border: 1.5px solid var(--teal); }
.sd-err     { background: rgba(240,75,75,.12);  border: 1.5px solid var(--red); }

/* ─── SIDEBAR TOGGLE BUTTON (mobile) ─────────────────────────── */
.sb-tog-btn {
  display: none;
  width: 32px; height: 32px; border-radius: var(--r);
  border: 1px solid var(--bd); background: var(--s2);
  color: var(--txt2); align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0; cursor: pointer;
}

/* ─── LOADING ─────────────────────────────────────────────────── */
#sc-loading { background: var(--bg); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 14px; }
.spin-lg  { width: 46px; height: 46px; border: 3px solid rgba(124,58,237,.15); border-top-color: var(--acc); border-radius: 50%; animation: spin .8s linear infinite; }
.ld-title { font-family: var(--h); font-size: clamp(20px, 2.5vw, 26px); font-weight: 800; letter-spacing: -.03em; text-align: center; }
.ld-sub   { font-size: 16px; color: var(--txt2); text-align: center; max-width: 320px; line-height: 1.6; }
.ld-steps { display:flex; flex-direction:column; gap:8px; margin-top:8px; min-width:260px; }
.ld-step { display:flex; align-items:center; gap:10px; font-size:14px; color:var(--txt3); transition:all .3s ease; }
.ld-step.active { color:var(--acc); }
.ld-step.done { color:var(--teal); }
.ld-step-dot { width:18px; height:18px; border-radius:50%; border:2px solid var(--s4); display:flex; align-items:center; justify-content:center; font-size:9px; flex-shrink:0; transition:all .3s ease; }
.ld-step.active .ld-step-dot { border-color:var(--acc); background:rgba(124,58,237,.1); animation:spin .8s linear infinite; }
.ld-step.done .ld-step-dot { border-color:var(--teal); background:rgba(10,158,135,.1); }
.dots     { display: flex; gap: 5px; margin-top: 4px; }
.dot3     { width: 5px; height: 5px; border-radius: 50%; background: var(--acc); animation: bounce3 .9s ease infinite; }
.dot3:nth-child(2) { animation-delay: .15s; }
.dot3:nth-child(3) { animation-delay: .3s; }

/* ─── MODAL ───────────────────────────────────────────────────── */
.modal-ov    { position: fixed; inset: 0; background: rgba(0,0,0,.45); backdrop-filter: blur(4px); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fadeIn .2s ease; }
.modal       { background: var(--s1); border: 2px solid var(--bd2); border-radius: var(--r3); padding: clamp(22px, 4vw, 34px); width: 100%; max-width: 460px; animation: fadeUp .25s ease; box-shadow: 0 16px 48px rgba(0,0,0,.15); position: relative; }
.modal-title { font-family: var(--h); font-size: 22px; font-weight: 800; letter-spacing: -.04em; margin-bottom: 8px; }
.modal-sub   { font-size: 15px; color: var(--txt2); line-height: 1.65; margin-bottom: 22px; }
.modal-lbl   { font-size: 13px; font-weight: 600; color: var(--txt2); margin-bottom: 7px; display: block; }
.modal-note  { font-size: 13px; color: var(--txt3); margin-top: 12px; line-height: 1.55; }
.modal-err   { font-size: 13px; color: var(--red); margin-top: 8px; display: none; font-weight: 500; }
.modal-close { position: absolute; top: 14px; right: 14px; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--bd2); background: var(--s2); color: var(--txt2); font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .12s; line-height: 1; }
.modal-close:hover { background: var(--bd2); color: var(--txt); }

/* ─── SPLASH ──────────────────────────────────────────────────── */
#sc-splash {
  background: var(--bg); display: flex; align-items: center;
  justify-content: center; flex-direction: column; position: relative; padding: 24px;
}
#sc-splash::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 40%, rgba(124,58,237,.07) 0%, transparent 65%); pointer-events: none; }
.sp-mark {
  width: clamp(48px, 8vw, 64px); height: clamp(48px, 8vw, 64px); border-radius: clamp(14px, 2vw, 18px);
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--h); font-size: clamp(22px, 4vw, 30px); font-weight: 800; color: #fff;
  box-shadow: 0 8px 40px rgba(124,58,237,.35); margin-bottom: 20px;
  animation: glow 3s ease infinite; position: relative; z-index: 1;
}
.sp-title { font-family: var(--h); font-size: clamp(34px, 7vw, 52px); font-weight: 800; letter-spacing: -.06em; line-height: 1; margin-bottom: 10px; animation: fadeUp .5s ease; position: relative; z-index: 1; }
.sp-sub   { font-size: clamp(15px, 1.6vw, 18px); color: var(--txt2); margin-bottom: 36px; text-align: center; line-height: 1.65; max-width: 420px; animation: fadeUp .5s ease .1s both; position: relative; z-index: 1; }
.sp-cta   { display: flex; flex-direction: column; align-items: center; gap: 10px; animation: fadeUp .5s ease .18s both; position: relative; z-index: 1; }
.sp-feats {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px;
  margin-top: 44px; animation: fadeUp .5s ease .25s both;
  position: relative; z-index: 1; max-width: 520px;
}
.sp-feat  { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 500; color: var(--txt2); }
.feat-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--teal); flex-shrink: 0; }

/* ─── BRIEF ───────────────────────────────────────────────────── */
#sc-brief { background: var(--bg); }
.brief-scroll { flex: 1; overflow-y: auto; display: flex; align-items: flex-start; justify-content: center; padding: clamp(20px, 5vw, 44px) clamp(16px, 4vw, 28px) 80px; }
.brief-inner  { width: 100%; max-width: 860px; }
.brief-h1     { font-family: var(--h); font-size: clamp(28px, 4vw, 40px); font-weight: 800; letter-spacing: -.05em; margin-bottom: 10px; line-height: 1.1; }
.brief-lead   { font-size: 17px; font-weight: 400; color: var(--txt2); line-height: 1.65; margin-bottom: 30px; }
.qdots        { display: flex; justify-content: center; gap: 6px; margin-bottom: 18px; }
.qdot         { height: 6px; border-radius: 3px; transition: all .3s; }
.qdot-done    { width: 20px; background: var(--teal); }
.qdot-active  { width: 26px; background: var(--acc); }
.qdot-idle    { width: 6px; background: var(--bd2); }
.qtag     { display: inline-flex; align-items: center; padding: 5px 13px; border-radius: 20px; font-size: 13px; font-weight: 700; background: rgba(124,58,237,.1); color: var(--acc); margin-bottom: 14px; gap: 6px; letter-spacing: -.01em; }
.qunlocks { font-size: 13px; font-weight: 400; color: var(--txt3); }
.qhead    { font-family: var(--h); font-size: clamp(22px, 3vw, 30px); font-weight: 800; letter-spacing: -.04em; margin-bottom: 20px; line-height: 1.2; color: var(--txt); }
.qwhy     { font-size: 15px; font-weight: 400; color: var(--txt2); line-height: 1.75; padding: 14px 18px; background: var(--s2); border-radius: var(--r); margin-top: 14px; border-left: 3px solid var(--acc); }
.qex      { font-size: 14px; color: var(--txt3); font-style: italic; margin-top: 10px; line-height: 1.65; }
.qnav     { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 26px; }
/* transform template */
.tframe { background: var(--s2); border: 2px solid var(--bd2); border-radius: var(--r); padding: 22px 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 2px; }
.tlbl   { font-size: 18px; font-weight: 600; color: var(--txt2); white-space: nowrap; letter-spacing: -.01em; }
.tinp   { background: transparent; border: none; border-bottom: 2.5px solid var(--bd3); color: var(--txt); font-size: 18px; font-weight: 600; padding: 3px 6px; outline: none; transition: border-color .12s; flex: 1; min-width: 110px; letter-spacing: -.01em; }
.tinp:focus { border-bottom-color: var(--acc); }
/* vibes */
.vgrid  { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.vcard  { padding: 14px; border-radius: var(--r); border: 2px solid var(--bd2); background: var(--s1); text-align: left; transition: all .12s; cursor: pointer; }
.vcard:hover { border-color: var(--acc); background: var(--s2); }
.vcard.sel   { border: 2.5px solid var(--acc); background: rgba(124,58,237,.05); }
.vsw-row { display: flex; gap: 4px; margin-bottom: 9px; }
.vsw     { width: 14px; height: 14px; border-radius: 4px; flex-shrink: 0; }
.vname   { font-size: 14px; font-weight: 700; margin-bottom: 3px; font-family: var(--h); letter-spacing: -.02em; color: var(--txt); }
.vsub    { font-size: 12px; color: var(--txt3); line-height: 1.35; font-weight: 400; }
/* upload */
.upzone { border: 1.5px dashed var(--bd2); border-radius: var(--r); padding: 14px 16px; cursor: pointer; transition: all .15s; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.upzone:hover { border-color: var(--acc); background: rgba(124,58,237,.03); }
.upprev { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--s3); border-radius: var(--r); border: 1px solid var(--bd); }
.upthumb { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; border: 1px solid var(--bd); flex-shrink: 0; }
.upclr   { color: var(--txt3); font-size: 16px; padding: 0 4px; margin-left: auto; }

/* ─── CONCEPT ─────────────────────────────────────────────────── */
#sc-concept { background: var(--bg); }
.cscroll { flex: 1; overflow-y: auto; display: flex; align-items: flex-start; justify-content: center; padding: clamp(12px, 1.5vw, 18px) clamp(14px, 2.5vw, 22px) 24px; }
.cinner  { width: 100%; max-width: 820px; }
.hmock     { border-radius: var(--r2); overflow: hidden; border: 1px solid var(--bd); margin-bottom: 10px; animation: fadeUp .4s ease; }
.hmock-nav  { padding: 8px 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,.06); gap: 12px; }
.hmock-hero { padding: clamp(16px, 2.5vw, 24px) clamp(16px, 3vw, 28px) clamp(18px, 2.5vw, 26px); }
.hmock-h1   { font-size: clamp(1.1rem, 2.2vw, 1.8rem); font-weight: 800; letter-spacing: -.025em; line-height: 1.12; margin-bottom: 8px; max-width: 560px; }
.hmock-sub  { font-size: 13px; line-height: 1.6; max-width: 460px; margin-bottom: 14px; }
.hmock-cta  { display: inline-block; padding: 8px 18px; border-radius: 8px; font-size: 12px; font-weight: 700; }
/* concept 2-col */
.c2col  { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.cleft  { display: flex; flex-direction: column; gap: 8px; }
.ccard  { background: var(--s1); border: 1.5px solid var(--bd2); border-radius: var(--r2); padding: 12px 14px; }
.ccard h4 { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--txt3); margin-bottom: 9px; }
.swrow  { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 10px; }
.sw     { width: 24px; height: 24px; border-radius: 6px; border: 1.5px solid var(--bd2); flex-shrink: 0; }
.fh     { font-size: 17px; font-weight: 700; line-height: 1.2; margin-bottom: 3px; letter-spacing: -.02em; }
.ftag   { font-size: 10px; padding: 2px 7px; border-radius: 4px; background: rgba(124,58,237,.1); color: var(--acc); font-weight: 700; }
.fb     { font-size: 13px; line-height: 1.5; margin: 7px 0 3px; }
.ftagb  { font-size: 10px; padding: 2px 7px; border-radius: 4px; background: var(--s2); color: var(--txt2); font-weight: 600; }
.voice-q { font-size: 13px; color: var(--txt2); line-height: 1.65; font-style: italic; border-left: 3px solid var(--acc); padding-left: 10px; margin-bottom: 8px; }
.strategy { font-size: 12px; color: var(--txt3); line-height: 1.5; }
.sects-scroll { overflow-y: visible; }
.sect-row     { display: flex; align-items: flex-start; gap: 7px; padding: 7px 0; border-bottom: 1px solid var(--bd2); }
.sect-row:last-child { border-bottom: none; }
.sect-num     { font-size: 11px; font-weight: 600; color: var(--txt3); min-width: 16px; padding-top: 1px; }
.sect-pill    { font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 3px; text-transform: uppercase; letter-spacing: .04em; flex-shrink: 0; margin-top: 1px; }
.sect-title   { font-size: 13px; font-weight: 700; margin-bottom: 2px; letter-spacing: -.01em; }
.sect-purpose { font-size: 11px; color: var(--txt2); line-height: 1.4; }
.refine-card  { background: var(--s1); border: 1.5px solid var(--bd2); border-radius: var(--r2); padding: 12px 14px; margin-bottom: 10px; }
.refine-card h4 { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--txt3); margin-bottom: 9px; }
.ref-row { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }

/* ─── DESIGN PREVIEW SCREEN ──────────────────────────────────── */
#sc-design { background: var(--bg); }
.design-body { flex:1; display:flex; overflow:hidden; min-height:0; position:relative; }
.design-sidebar { width:var(--sb-w); flex-shrink:0; background:var(--s1); border-right:1px solid var(--bd); display:flex; flex-direction:column; overflow:hidden; transition:width .28s cubic-bezier(.4,0,.2,1), transform .28s cubic-bezier(.4,0,.2,1); z-index:10; }
.design-sidebar.collapsed { width:0; border-right-color:transparent; }
.design-info { padding:14px; border-bottom:1px solid var(--bd2); }
.design-info-text { font-size:13px; color:var(--txt2); line-height:1.55; }
.design-refine-area { padding:14px; flex:1; }
.design-foot { padding:11px 14px; border-top:1px solid var(--bd2); flex-shrink:0; }

/* Design loader overlay */
.design-loader {
  position:absolute; inset:0; z-index:20;
  display:flex; align-items:center; justify-content:center;
  background:radial-gradient(ellipse at 50% 40%, #1a1130 0%, #0d0b1a 70%);
}
.design-loader.hidden { display:none; }
.dl-inner { text-align:center; }
.dl-rings { position:relative; width:120px; height:120px; margin:0 auto 28px; }
.dl-ring {
  position:absolute; inset:0; border-radius:50%;
  border:2px solid transparent;
}
.dl-ring-1 {
  border-top-color:#7c3aed; border-right-color:#7c3aed;
  animation:dl-spin 1.8s linear infinite;
}
.dl-ring-2 {
  inset:12px;
  border-bottom-color:#a78bfa; border-left-color:#a78bfa;
  animation:dl-spin 2.4s linear infinite reverse;
}
.dl-ring-3 {
  inset:24px;
  border-top-color:#c4b5fd; border-right-color:#c4b5fd;
  animation:dl-spin 1.4s linear infinite;
}
.dl-logo {
  position:absolute; inset:34px;
  display:flex; align-items:center; justify-content:center;
  font-family:var(--h); font-size:28px; font-weight:800; color:#fff;
  background:linear-gradient(135deg, #7c3aed, #a78bfa);
  border-radius:50%;
  animation:dl-pulse 2s ease-in-out infinite;
}
@keyframes dl-spin { to { transform:rotate(360deg); } }
@keyframes dl-pulse { 0%,100% { transform:scale(1); opacity:1; } 50% { transform:scale(1.08); opacity:.85; } }

.dl-title {
  font-family:var(--h); font-size:20px; font-weight:800; color:#fff;
  letter-spacing:-.03em; margin-bottom:8px;
}
.dl-sub {
  font-size:14px; color:rgba(255,255,255,.5); margin-bottom:20px;
}
.dl-dots { display:flex; gap:6px; justify-content:center; }
.dl-dots span {
  width:6px; height:6px; border-radius:50%;
  background:rgba(124,58,237,.7);
  animation:dl-bounce 1.4s ease-in-out infinite;
}
.dl-dots span:nth-child(2) { animation-delay:.2s; }
.dl-dots span:nth-child(3) { animation-delay:.4s; }
@keyframes dl-bounce {
  0%,80%,100% { transform:scale(0.6); opacity:.4; }
  40% { transform:scale(1); opacity:1; }
}
.design-saved-area { border-top:1px solid var(--bd2); overflow-y:auto; flex:0 1 auto; max-height:40%; }
.design-saved-hdr { padding:10px 14px 6px; font-size:10px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--txt3); }
.dsave-row { display:flex; align-items:center; gap:8px; padding:8px 14px; cursor:pointer; transition:background .1s; border-bottom:1px solid var(--bd); }
.dsave-row:hover { background:var(--s2); }
.dsave-row.active { background:rgba(124,58,237,.08); }
.dsave-name { flex:1; font-size:13px; font-weight:600; color:var(--txt); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.dsave-time { font-size:11px; color:var(--txt3); flex-shrink:0; }
.dsave-del { font-size:14px; color:var(--txt3); background:none; border:none; cursor:pointer; padding:2px 4px; border-radius:4px; line-height:1; }
.dsave-del:hover { color:var(--red); background:rgba(220,38,38,.08); }
.design-loading { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px; padding:40px 14px; text-align:center; }
.design-loading-text { font-size:13px; color:var(--txt2); }

/* ─── SECTIONS SCREEN ─────────────────────────────────────────── */
#sc-sections { background: var(--bg); }
.sect-body { flex: 1; display: flex; overflow: hidden; min-height: 0; position: relative; }

/* sidebar */
.sect-sb {
  width: var(--sb-w); flex-shrink: 0;
  background: var(--s1); border-right: 1px solid var(--bd);
  display: flex; flex-direction: column; overflow: hidden;
  transition: width .28s cubic-bezier(.4,0,.2,1), transform .28s cubic-bezier(.4,0,.2,1);
  z-index: 10;
}
.sect-sb.collapsed { width: 0; border-right-color: transparent; }

.sb-hdr      { padding: 10px 14px 8px; border-bottom: 1px solid var(--bd2); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--txt3); flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; }
.shell-row   { display: flex; align-items: center; gap: 9px; padding: 11px 14px; border-bottom: 1px solid var(--bd2); flex-shrink: 0; }
.slist       { flex: 1; overflow-y: auto; }
.srow:hover  { background: var(--s2); }
.srow-main   { display: flex; align-items: center; gap: 9px; padding: 10px 14px; }
.srow-body   { flex: 1; min-width: 0; }
.srow-meta   { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.srow-title  { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.01em; }
.srow-note   { font-size: 11px; color: var(--acc); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srow-arrow  { font-size: 11px; color: var(--txt3); flex-shrink: 0; }
.srow-exp    { background: var(--s2); padding: 12px 14px; border-top: 1px solid var(--bd2); }
.exp-purpose { font-size: 13px; color: var(--txt2); line-height: 1.55; margin-bottom: 10px; }
.exp-lbl     { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--txt3); margin-bottom: 6px; }
.exp-ta      { width: 100%; background: var(--s1); border: 1.5px solid var(--bd2); border-radius: 7px; color: var(--txt); font-size: 13px; padding: 8px 10px; outline: none; line-height: 1.5; transition: border-color .12s; font-family: var(--b); resize: none; }
.exp-ta:focus { border-color: var(--acc); }
.exp-acts    { display: flex; gap: 7px; margin-top: 9px; }
.sb-foot     { padding: 11px 14px; border-top: 1px solid var(--bd2); flex-shrink: 0; }
.bld-btn     { width: 100%; padding: 11px; border-radius: 9px; font-size: 14px; font-weight: 800; font-family: var(--h); letter-spacing: -.02em; transition: all .15s; cursor: pointer; border: none; }
.bld-go      { background: var(--acc); color: #fff; box-shadow: 0 2px 8px rgba(124,58,237,.25); }
.bld-go:hover { background: var(--acc2); box-shadow: 0 4px 14px rgba(124,58,237,.35); }
.bld-go:disabled, .bld-btn:disabled { background: var(--s3); color: var(--txt3); cursor: not-allowed; box-shadow: none; transform: none; }
.bld-pause   { background: var(--s2); color: var(--txt2); border: 1.5px solid var(--bd2); }
.bld-done    { background: var(--teal); color: #fff; }

/* preview pane */
.prev-pane {
  flex: 1; background: #e8e8f0; display: flex;
  flex-direction: column; align-items: center;
  padding: clamp(10px, 1.5vw, 18px); overflow: auto;
  gap: 0; min-height: 0;
}
.dev-frame {
  width: 100%; max-width: 100%;
  background: #fff; border-radius: 8px; overflow: hidden;
  box-shadow: 0 8px 48px rgba(0,0,0,.75);
  transition: max-width .35s cubic-bezier(.4,0,.2,1);
  flex: 1; min-height: 300px;
}
.dev-frame iframe { width: 100%; height: 100%; border: none; display: block; }
.dev-sw     { display: flex; gap: 2px; background: rgba(255,255,255,.04); border-radius: 8px; padding: 3px; }
.dsw-btn    { padding: 5px 10px; border-radius: 6px; border: none; background: transparent; color: var(--txt3); font-size: 12px; transition: all .15s; display: flex; align-items: center; justify-content: center; }
.dsw-btn svg { display: block; }
.dsw-btn.active { background: rgba(124,58,237,.15); color: var(--acc); }

/* ─── EDIT/PREVIEW ────────────────────────────────────────────── */
#sc-preview { background: var(--bg); }
.preview-body { flex: 1; display: flex; overflow: hidden; min-height: 0; position: relative; }

.edit-sb {
  width: var(--sb-w); flex-shrink: 0;
  background: var(--s1); border-right: 1px solid var(--bd);
  display: flex; flex-direction: column; overflow: hidden;
  transition: width .28s cubic-bezier(.4,0,.2,1);
  z-index: 10;
}
.edit-sb.collapsed { width: 0; border-right-color: transparent; }

.esb-hdr     { padding: 12px 14px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--txt3); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.ehist       { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.ex-box      { background: rgba(124,58,237,.05); border: 1.5px solid rgba(124,58,237,.18); border-radius: 10px; padding: 14px; }
.ex-lbl      { font-size: 13px; color: var(--txt2); margin-bottom: 10px; line-height: 1.6; font-weight: 500; }
.ex-item     { font-size: 13px; color: var(--acc); cursor: pointer; padding: 4px 0; line-height: 1.5; transition: opacity .1s; font-weight: 500; }
.ex-item:hover { opacity: .65; }
.ehist-item  { background: var(--s2); border-radius: 9px; padding: 10px 12px; border: 1.5px solid var(--bd2); animation: fadeUp .3s ease; }
.ehist-txt   { font-size: 13px; color: var(--txt); line-height: 1.45; margin-bottom: 3px; font-weight: 500; }
.ehist-check { font-size: 12px; color: var(--teal); font-weight: 600; }
.ehist-applying { background: var(--s2); border-radius: 9px; padding: 10px 12px; border: 1.5px solid rgba(124,58,237,.3); animation: pulse 1.5s ease infinite; }
.edit-foot   { padding: 10px 14px 14px; border-top: 1.5px solid var(--bd2); display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
.edit-ta     { width: 100%; background: var(--s1); border: 2px solid var(--bd2); border-radius: 9px; color: var(--txt); font-size: 14px; padding: 10px 13px; resize: none; outline: none; line-height: 1.55; transition: border-color .12s, box-shadow .12s; font-family: var(--b); }
.edit-ta:focus { border-color: var(--acc); box-shadow: 0 0 0 3px rgba(124,58,237,.1); }
.apply-can   { background: var(--acc); color: #fff; font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.apply-cnt   { background: var(--s3); color: var(--txt3); font-size: 14px; font-weight: 600; }
.apply-hint  { font-size: 12px; color: var(--txt3); text-align: center; font-weight: 500; }

/* ─── ADMIN ───────────────────────────────────────────────────── */
#sc-admin  { background: var(--bg); }
.atabs     { display: flex; gap: 0; border-bottom: 1.5px solid var(--bd2); padding: 0 clamp(12px, 2vw, 18px); background: var(--s1); flex-shrink: 0; overflow-x: auto; }
.atab      { padding: 12px clamp(12px, 1.5vw, 18px); border: none; background: transparent; font-size: 14px; font-weight: 500; color: var(--txt2); border-bottom: 2.5px solid transparent; margin-bottom: -1.5px; transition: all .15s; cursor: pointer; display: flex; align-items: center; gap: 6px; white-space: nowrap; flex-shrink: 0; letter-spacing: -.01em; }
.atab.active  { color: var(--txt); border-bottom-color: var(--acc); font-weight: 700; }
.atab:hover:not(.active) { color: var(--txt); background: var(--s2); }
.atab-ct   { font-size: 11px; padding: 2px 7px; border-radius: 10px; background: var(--s2); color: var(--txt3); font-weight: 600; }
.admin-body  { flex: 1; display: flex; overflow: hidden; min-height: 0; }
.agen-layout { flex: 1; display: flex; overflow: hidden; min-height: 0; }
.agen-list   { width: var(--sb-w); border-right: 1.5px solid var(--bd2); overflow-y: auto; background: var(--s1); flex-shrink: 0; }
.agen-row    { padding: 13px 16px; cursor: pointer; border-left: 3px solid transparent; transition: all .12s; border-bottom: 1px solid var(--bd2); }
.agen-row:hover  { background: var(--s2); }
.agen-row.active { background: var(--s2); border-left-color: var(--acc); }
.agen-nr     { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.agen-sdot   { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.agen-name   { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.agen-stage  { font-size: 12px; color: var(--txt3); font-weight: 400; }
.agen-detail { flex: 1; overflow-y: auto; padding: clamp(18px, 3vw, 28px) clamp(18px, 3vw, 30px); background: var(--bg); }
.admin-empty { height: 100%; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 10px; color: var(--txt3); font-size: 15px; }
.adetail-title { font-family: var(--h); font-size: clamp(20px, 2.5vw, 26px); font-weight: 800; letter-spacing: -.04em; margin-bottom: 6px; }
.adetail-desc  { font-size: 15px; color: var(--txt2); line-height: 1.65; }
.meta-chips    { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 18px; }
.mc     { padding: 7px 12px; border-radius: var(--r); background: var(--s1); border: 1.5px solid var(--bd2); }
.mc-l   { font-size: 11px; color: var(--txt3); display: block; margin-bottom: 2px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.mc-v   { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.admin-settings-row { display:flex; gap:16px; flex-wrap:wrap; margin-bottom:16px; padding:14px 16px; background:var(--s1); border:1.5px solid var(--bd2); border-radius:var(--r2); }
.admin-field-lbl { font-size:10px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--txt3); }
.admin-select { font-family:var(--b); font-size:13px; font-weight:500; padding:6px 10px; border:1.5px solid var(--bd2); border-radius:var(--r); background:var(--s2); color:var(--txt); cursor:pointer; outline:none; min-width:140px; }
.admin-select:focus { border-color:var(--acc); }
.admin-range { width:120px; accent-color:var(--acc); cursor:pointer; }
.admin-range-val { font-size:13px; font-weight:600; color:var(--txt); min-width:28px; text-align:center; }
.admin-num-inp { font-family:var(--b); font-size:13px; font-weight:500; padding:6px 10px; border:1.5px solid var(--bd2); border-radius:var(--r); background:var(--s2); color:var(--txt); outline:none; width:90px; }
.admin-num-inp:focus { border-color:var(--acc); }
.prompt-prev { background: var(--s1); border: 1.5px solid var(--bd2); border-radius: var(--r); padding: 16px; margin-bottom: 12px; position: relative; overflow: hidden; max-height: 200px; }
.prompt-prev pre { font-family: var(--b); font-size: 13px; color: var(--txt2); line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.pfade  { position: absolute; bottom: 0; left: 0; right: 0; height: 40px; background: linear-gradient(transparent, var(--s1)); pointer-events: none; }
.prompt-editor textarea { width: 100%; min-height: 200px; max-height: none; background: var(--s2); border: 2px solid var(--acc); border-radius: var(--r); color: var(--txt); font-size: 14px; padding: 14px; resize: vertical; outline: none; line-height: 1.65; font-family: var(--b); overflow-y: auto; }
.save-row  { display: flex; gap: 8px; margin-top: 12px; }
.toast-ok  { padding: 10px 16px; background: rgba(10,158,135,.1); border: 1.5px solid rgba(10,158,135,.25); border-radius: var(--r); font-size: 14px; color: var(--teal); margin-top: 12px; animation: fadeIn .2s ease; font-weight: 600; }
.acontent  { flex: 1; overflow-y: auto; padding: clamp(16px, 2.5vw, 26px) clamp(16px, 2.5vw, 30px); }
.ac-title  { font-family: var(--h); font-size: clamp(18px, 2.5vw, 24px); font-weight: 800; letter-spacing: -.04em; margin-bottom: 6px; }
.ac-sub    { font-size: 15px; color: var(--txt2); margin-bottom: 22px; line-height: 1.65; }
.asect-row  { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--s1); border-radius: var(--r); border: 1.5px solid var(--bd2); transition: opacity .2s; margin-bottom: 8px; }
.asect-row.off { opacity: .45; }
.asect-name { font-size: 14px; font-weight: 600; min-width: 110px; letter-spacing: -.01em; }
.asect-desc { font-size: 13px; color: var(--txt2); flex: 1; line-height: 1.4; }
.asect-uses { font-size: 11px; padding: 3px 9px; border-radius: 10px; background: var(--s2); color: var(--txt3); flex-shrink: 0; font-weight: 600; }
.apack-card { background: var(--s1); border: 1.5px solid var(--bd2); border-radius: var(--r2); padding: 16px 18px; margin-bottom: 10px; transition: opacity .2s; }
.apack-card.off { opacity: .45; }
.apack-hdr  { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.apack-name { font-size: 16px; font-weight: 700; flex: 1; letter-spacing: -.02em; }
.apack-desc { font-size: 14px; color: var(--txt2); line-height: 1.6; margin-bottom: 11px; }
.apack-sects { display: flex; gap: 6px; flex-wrap: wrap; }
.apack-sect  { font-size: 12px; padding: 3px 9px; border-radius: 10px; background: var(--s2); border: 1.5px solid var(--bd2); color: var(--txt2); font-weight: 500; }
.admin-note  { margin-top: 16px; padding: 12px 16px; background: var(--s1); border-radius: var(--r); border: 1.5px solid var(--bd2); font-size: 13px; color: var(--txt2); line-height: 1.65; }

/* ─── ERROR TOAST ─────────────────────────────────────────────── */
.err-toast { position: fixed; bottom: 20px; right: 20px; z-index: 9000; background: #fef2f2; border: 1px solid #fca5a5; border-radius: 10px; padding: 10px 16px; font-size: 13px; color: #b91c1c; display: flex; align-items: center; gap: 10px; animation: fadeUp .3s ease; max-width: min(360px, calc(100vw - 32px)); box-shadow: 0 4px 16px rgba(0,0,0,.12); }

/* ─── RESPONSIVE BREAKPOINTS ──────────────────────────────────── */

/* Medium: sidebar becomes overlay, toggle button appears */
@media (max-width: 860px) {
  :root { --sb-w: 240px; }
  .sb-tog-btn { display: flex; }
  .topbar-ctx { max-width: 100px; }
  .dev-sw .dsw-btn { padding: 4px 7px; font-size: 11px; }
}

/* Small: tighter layout, hide less critical labels */
@media (max-width: 640px) {
  :root { --sb-w: min(280px, 85vw); }

  .logo-name { display: none; }
  .topbar-div { display: none; }
  .topbar-ctx { display: none; }

  .sect-sb, .edit-sb, .design-sidebar {
    position: absolute; top: 0; left: 0; height: 100%;
    box-shadow: 4px 0 24px rgba(0,0,0,.6);
    transform: translateX(0);
  }
  .sect-sb.collapsed, .edit-sb.collapsed, .design-sidebar.collapsed {
    width: var(--sb-w) !important;
    transform: translateX(calc(-1 * var(--sb-w)));
    box-shadow: none;
  }

  .c2col { grid-template-columns: 1fr; }
  .agen-layout { flex-direction: column; }
  .agen-list { width: 100%; max-height: 200px; border-right: none; border-bottom: 1px solid var(--bd); }

  .brief-scroll { padding: 20px 14px 72px; }
  .stepbar { margin-bottom: 20px; }
  .sline { width: 20px; }

  .sp-feats { gap: 8px 14px; }
  .btn-lg { padding: 11px 20px; }

  .atab { padding: 8px 10px; font-size: 12px; }
  .atab-ct { display: none; }

  .asect-name { min-width: 80px; }
  .asect-desc { display: none; }
}

/* Very small: collapse more */
@media (max-width: 400px) {
  .dev-sw { display: none; }
  .vgrid  { grid-template-columns: 1fr 1fr; }
}

/* Sidebar overlay backdrop */
.sb-backdrop {
  display: none;
  position: absolute; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 9;
}
@media (max-width: 640px) {
  .sb-backdrop.visible { display: block; background: rgba(0,0,0,.3); }
}

/* ─── START / PATH SELECTION ─────────────────────────────────── */
#sc-start { background: var(--bg); display: flex; flex-direction: column; overflow: hidden; }
.start-scroll { flex: 1; overflow-y: auto; display: flex; align-items: flex-start; justify-content: center; padding: clamp(28px,5vw,52px) clamp(16px,4vw,28px) 60px; }
.start-inner { width: 100%; max-width: 720px; }
.start-h1 { font-family: var(--h); font-size: clamp(24px,4vw,36px); font-weight: 800; letter-spacing: -.05em; margin-bottom: 8px; line-height: 1.1; }
.start-lead { font-size: 16px; color: var(--txt2); line-height: 1.65; margin-bottom: 32px; }
.path-cards { display: flex; flex-direction: column; gap: 12px; }
.path-card {
  display: flex; align-items: flex-start; gap: 18px;
  padding: 22px 24px; background: var(--s1); border: 2px solid var(--bd2);
  border-radius: 14px; cursor: pointer; transition: all .15s; text-align: left;
}
.path-card:hover { border-color: var(--acc); background: var(--s2); transform: translateY(-1px); box-shadow: 0 4px 20px rgba(124,58,237,.1); }
.path-card.selected { border-color: var(--acc); background: rgba(124,58,237,.04); }
.path-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.path-body { flex: 1; min-width: 0; }
.path-title { font-family: var(--h); font-size: 18px; font-weight: 800; letter-spacing: -.03em; margin-bottom: 5px; color: var(--txt); }
.path-desc { font-size: 14px; color: var(--txt2); line-height: 1.6; margin-bottom: 10px; }
.path-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.path-tag { font-size: 12px; padding: 3px 9px; border-radius: 20px; font-weight: 500; }
.path-arrow { font-size: 20px; color: var(--txt3); align-self: center; flex-shrink: 0; }

/* ─── EXISTING SITE SCREEN ───────────────────────────────────── */
#sc-existing { background: var(--bg); }
.ex-scroll { flex: 1; overflow-y: auto; display: flex; align-items: flex-start; justify-content: center; padding: clamp(28px,5vw,52px) clamp(16px,4vw,28px) 60px; }
.ex-inner { width: 100%; max-width: 600px; }
.ex-h1 { font-family: var(--h); font-size: clamp(22px,3.5vw,32px); font-weight: 800; letter-spacing: -.04em; margin-bottom: 8px; line-height: 1.2; }
.ex-lead { font-size: 16px; color: var(--txt2); line-height: 1.65; margin-bottom: 28px; }
.ex-url-row { display: flex; gap: 10px; margin-bottom: 22px; align-items: stretch; }
.ex-url-inp { flex: 1; font-size: 16px; }
.content-opts { display: flex; flex-direction: column; gap: 10px; margin-bottom: 28px; }
.content-opt {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 18px; background: var(--s1); border: 2px solid var(--bd2);
  border-radius: 12px; cursor: pointer; transition: all .15s;
}
.content-opt:hover { border-color: var(--acc); background: var(--s2); }
.content-opt.selected { border-color: var(--acc); background: rgba(124,58,237,.04); }
.opt-radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--bd2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 2px; transition: all .15s; }
.content-opt.selected .opt-radio { border-color: var(--acc); background: var(--acc); }
.content-opt.selected .opt-radio::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.opt-body { flex: 1; }
.opt-title { font-size: 15px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 4px; color: var(--txt); }
.opt-desc { font-size: 13px; color: var(--txt2); line-height: 1.55; }

/* ─── UPLOAD SCREEN ──────────────────────────────────────────── */
#sc-upload { background: var(--bg); }
.up-scroll { flex: 1; overflow-y: auto; display: flex; align-items: flex-start; justify-content: center; padding: clamp(28px,5vw,52px) clamp(16px,4vw,28px) 60px; }
.up-inner { width: 100%; max-width: 680px; }
.up-h1 { font-family: var(--h); font-size: clamp(22px,3.5vw,32px); font-weight: 800; letter-spacing: -.04em; margin-bottom: 8px; line-height: 1.2; }
.up-lead { font-size: 16px; color: var(--txt2); line-height: 1.65; margin-bottom: 28px; }
.up-section { margin-bottom: 24px; }
.up-section-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--txt3); margin-bottom: 10px; }
.doc-zone {
  border: 2px dashed var(--bd2); border-radius: 12px; padding: 28px 24px;
  text-align: center; cursor: pointer; transition: all .15s;
  background: var(--s1);
}
.doc-zone:hover { border-color: var(--acc); background: rgba(124,58,237,.03); }
.doc-zone.drag-over { border-color: var(--acc); background: rgba(124,58,237,.05); }
.doc-zone-icon { font-size: 28px; margin-bottom: 8px; }
.doc-zone-label { font-size: 15px; font-weight: 600; color: var(--txt); margin-bottom: 4px; }
.doc-zone-hint { font-size: 13px; color: var(--txt3); }
.doc-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.doc-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  background: var(--s1); border: 1.5px solid var(--bd2); border-radius: 10px;
}
.doc-icon { font-size: 20px; flex-shrink: 0; }
.doc-name { font-size: 14px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.01em; }
.doc-status { font-size: 12px; font-weight: 600; flex-shrink: 0; }
.doc-remove { font-size: 16px; color: var(--txt3); cursor: pointer; flex-shrink: 0; padding: 0 4px; }
.doc-remove:hover { color: var(--red); }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; margin-top: 10px; }
.img-item { position: relative; border-radius: 10px; overflow: hidden; border: 1.5px solid var(--bd2); aspect-ratio: 1; cursor: pointer; }
.img-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-remove { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0,0,0,.65); color: #fff; font-size: 12px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.img-add { border: 2px dashed var(--bd2); border-radius: 10px; aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; background: var(--s1); transition: all .15s; font-size: 22px; color: var(--txt3); }
.img-add:hover { border-color: var(--acc); background: rgba(124,58,237,.03); }
.up-or { display: flex; align-items: center; gap: 12px; margin: 20px 0; }
.up-or-line { flex: 1; height: 1px; background: var(--bd2); }
.up-or-txt { font-size: 13px; color: var(--txt3); font-weight: 500; }
.proc-state { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: rgba(124,58,237,.06); border: 1.5px solid rgba(124,58,237,.18); border-radius: 10px; font-size: 14px; color: var(--acc); font-weight: 600; margin-top: 10px; }

/* ─── DOC PREVIEW SCREEN ─────────────────────────────────────── */
#sc-docview { background: var(--bg); }
.dv-body { flex: 1; display: flex; overflow: hidden; min-height: 0; }
.dv-sidebar { width: clamp(180px,20vw,240px); background: var(--s1); border-right: 1.5px solid var(--bd2); display: flex; flex-direction: column; overflow: hidden; flex-shrink: 0; }
.dv-sb-hdr { padding: 12px 14px 8px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--txt3); border-bottom: 1px solid var(--bd2); flex-shrink: 0; }
.dv-doc-list { flex: 1; overflow-y: auto; }
.dv-doc-row { padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--bd2); display: flex; align-items: center; gap: 9px; transition: background .1s; border-left: 3px solid transparent; }
.dv-doc-row:hover { background: var(--s2); }
.dv-doc-row.active { background: var(--s2); border-left-color: var(--acc); }
.dv-doc-row-name { font-size: 13px; font-weight: 600; letter-spacing: -.01em; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dv-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.dv-md { flex: 1; overflow-y: auto; padding: clamp(20px,3vw,36px) clamp(20px,3vw,40px); }
.dv-md h1,.dv-md h2,.dv-md h3 { font-family: var(--h); font-weight: 800; letter-spacing: -.03em; line-height: 1.2; margin: 1.2em 0 .5em; }
.dv-md h1 { font-size: 26px; }
.dv-md h2 { font-size: 20px; }
.dv-md h3 { font-size: 16px; }
.dv-md p { font-size: 15px; line-height: 1.75; margin-bottom: 1em; color: var(--txt); }
.dv-md ul,.dv-md ol { margin: .5em 0 1em 1.4em; }
.dv-md li { font-size: 15px; line-height: 1.7; margin-bottom: .3em; color: var(--txt); }
.dv-md strong { font-weight: 700; color: var(--txt); }
.dv-md em { font-style: italic; color: var(--txt2); }
.dv-md code { font-family: monospace; background: var(--s2); padding: 2px 6px; border-radius: 4px; font-size: 13px; }
.dv-md hr { border: none; border-top: 1.5px solid var(--bd2); margin: 1.5em 0; }
.dv-md table { width: 100%; border-collapse: collapse; margin-bottom: 1em; font-size: 14px; }
.dv-md th,.dv-md td { padding: 8px 12px; border: 1px solid var(--bd2); text-align: left; }
.dv-md th { background: var(--s2); font-weight: 700; }
.dv-foot { padding: 14px 20px; border-top: 1.5px solid var(--bd2); flex-shrink: 0; }
.dv-notes-lbl { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--txt3); margin-bottom: 8px; }
.dv-notes-ta { width: 100%; background: var(--s2); border: 1.5px solid var(--bd2); border-radius: 9px; color: var(--txt); font-size: 14px; padding: 10px 13px; resize: none; outline: none; line-height: 1.5; transition: border-color .12s; font-family: var(--b); }
.dv-notes-ta:focus { border-color: var(--acc); }
.img-analysis-badge { position: absolute; bottom: 4px; left: 4px; right: 4px; background: rgba(0,0,0,.72); color: #fff; font-size: 9px; font-weight: 700; padding: 3px 5px; border-radius: 4px; text-align: center; letter-spacing: .03em; line-height: 1.3; }

/* ─── SECTION PANEL TOOLS ────────────────────────────────────── */
.srow { border-bottom: 1px solid var(--bd2); cursor: default; transition: background .1s; }
.srow.dragging      { opacity: .4; background: rgba(124,58,237,.05); }
.srow.drop-above    { border-top: 2.5px solid var(--acc) !important; }
.srow.drop-below    { border-bottom: 2.5px solid var(--acc) !important; }
.drag-handle { font-size: 15px; color: var(--txt3); cursor: grab; padding: 0 3px 0 0; flex-shrink: 0; user-select: none; line-height: 1; }
.drag-handle:active { cursor: grabbing; }

.sect-tools       { display: flex; gap: 6px; flex-wrap: wrap; margin: 9px 0 2px; }
.stool            { font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 7px;
                    border: 1.5px solid var(--bd2); background: var(--s1); color: var(--txt2);
                    cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
                    transition: all .12s; white-space: nowrap; }
.stool:hover      { border-color: var(--acc); color: var(--acc); background: rgba(124,58,237,.05); }
.stool.set        { border-color: var(--acc); color: var(--acc); background: rgba(124,58,237,.08); }
.stool-thumb      { width: 100%; height: 72px; object-fit: cover; border-radius: 7px;
                    border: 1.5px solid var(--bd2); margin-top: 7px; display: block; }
.stool-note       { font-size: 11px; font-weight: 600; color: var(--acc); margin-top: 5px; }

/* ─── MULTI-PAGE NAV ─────────────────────────────────────────── */
.page-nav         { flex-shrink:0; border-bottom:1px solid var(--bd2); background:var(--s1); }
.page-tabs        { display:flex; align-items:center; overflow-x:auto; gap:0;
                    scrollbar-width:none; -ms-overflow-style:none; }
.page-tabs::-webkit-scrollbar { display:none; }
.page-tab         { display:flex; align-items:center; gap:5px; padding:8px 11px 7px;
                    font-size:12px; font-weight:600; color:var(--txt2); cursor:pointer;
                    border-bottom:2.5px solid transparent; white-space:nowrap;
                    flex-shrink:0; transition:all .12s; border:none; background:none;
                    letter-spacing:-.01em; }
.page-tab:hover   { color:var(--txt); background:var(--s2); }
.page-tab.active  { color:var(--acc); border-bottom-color:var(--acc); background:transparent; }
.page-tab-close   { width:14px; height:14px; border-radius:50%; display:flex;
                    align-items:center; justify-content:center; font-size:10px;
                    color:var(--txt3); transition:all .12s; flex-shrink:0;
                    cursor:pointer; border:none; background:none; padding:0; }
.page-tab-close:hover { background:var(--bd2); color:var(--red); }
.page-add-btn     { padding:6px 10px; font-size:13px; color:var(--txt3); cursor:pointer;
                    flex-shrink:0; border:none; background:none; font-weight:700;
                    transition:color .12s; }
.page-add-btn:hover { color:var(--acc); }

/* ─── ADD SECTION PICKER ─────────────────────────────────────── */
.add-sect-bar     { padding:8px 12px; border-top:1px solid var(--bd2); flex-shrink:0; }
.add-sect-btn     { width:100%; padding:7px; border-radius:7px; font-size:12px;
                    font-weight:700; font-family:var(--h); letter-spacing:-.01em;
                    border:1.5px dashed var(--bd2); background:transparent;
                    color:var(--txt2); cursor:pointer; transition:all .12s; }
.add-sect-btn:hover { border-color:var(--acc); color:var(--acc); background:rgba(124,58,237,.04); }
.sect-picker      { position:absolute; bottom:100%; left:0; right:0; margin-bottom:4px;
                    background:var(--s1); border:1.5px solid var(--bd2); border-radius:10px;
                    box-shadow:0 8px 32px rgba(0,0,0,.15); z-index:200;
                    max-height:240px; overflow-y:auto; }
.sect-pick-row    { display:flex; align-items:center; gap:9px; padding:8px 13px;
                    cursor:pointer; border-bottom:1px solid var(--bd2); transition:background .1s; }
.sect-pick-row:last-child { border-bottom:none; }
.sect-pick-row:hover { background:var(--s2); }
.sect-pick-pill   { font-size:9px; font-weight:700; padding:2px 6px; border-radius:3px;
                    text-transform:uppercase; letter-spacing:.04em; flex-shrink:0; }
.sect-pick-name   { font-size:13px; font-weight:600; flex:1; letter-spacing:-.01em; }
.sect-pick-desc   { font-size:11px; color:var(--txt3); }
.sect-delete      { width:18px; height:18px; border-radius:4px; border:none; background:none;
                    color:var(--txt3); font-size:14px; cursor:pointer; flex-shrink:0;
                    display:flex; align-items:center; justify-content:center;
                    transition:all .12s; padding:0; }
.sect-delete:hover { background:rgba(220,38,38,.1); color:var(--red); }
.add-sect-wrap    { position:relative; }
