/* Application chrome - the app UI itself (colours come from config.js at runtime) */
:root{
  --navy:#0B1526; --navy2:#122644; --navy3:#1B3563; --navy4:#24467E;
  --gold:#F2B93B; --gold-dk:#B98514; --gold-bg:#FFF8E6;
  --cyan:#22D3EE; --cyan-dk:#0E8FA6; --cyan-lt:#D9F6FB;
  --ink:#152033; --muted:#5A6980; --line:#DDE4EF; --light:#F5F7FB; --tint:#EAF0F8;
  --ok:#12A150; --warn:#D97706; --bad:#DC2626;
  --panel-w:392px;
  --shadow:0 10px 30px rgba(11,21,38,0.10);
}
*{ box-sizing:border-box; margin:0; padding:0; }
html,body{ height:100%; }
body{ font-family:"Inter","Segoe UI",Arial,sans-serif; color:var(--ink); background:var(--tint); font-size:14px;
      overflow:hidden; -webkit-font-smoothing:antialiased; }
button,input,select,textarea{ font:inherit; color:inherit; }
button{ cursor:pointer; border:0; background:none; }
a{ color:var(--cyan-dk); }
[hidden]{ display:none !important; }
::-webkit-scrollbar{ width:11px; height:11px; }
::-webkit-scrollbar-thumb{ background:#C3CEDF; border-radius:8px; border:3px solid transparent; background-clip:padding-box; }
::-webkit-scrollbar-thumb:hover{ background:#A6B4CA; background-clip:padding-box; }

/* ---------- TOP BAR ---------- */
.top{ height:58px; background:linear-gradient(120deg,var(--navy),var(--navy2)); color:#fff; display:flex;
      align-items:center; gap:16px; padding:0 16px; position:relative; z-index:40; }
.top .logo{ display:flex; align-items:center; gap:10px; font-weight:900; letter-spacing:-0.01em; font-size:16px; }
.top .logo .mark{ width:30px; height:30px; border-radius:8px; background:var(--gold); color:var(--navy);
  display:flex; align-items:center; justify-content:center; font-weight:900; font-size:15px; }
.top .logo .markimg{ height:32px; max-width:170px; border-radius:6px; display:block; }
.top .logo small{ display:block; font-weight:600; font-size:10.5px; letter-spacing:0.1em; text-transform:uppercase;
  color:var(--cyan); margin-top:2px; }
.top .docname{ margin-left:6px; padding-left:16px; border-left:1px solid rgba(255,255,255,0.18); font-size:13px;
  color:#C9D6EA; max-width:340px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.top .sp{ flex:1; }
.btn{ display:inline-flex; align-items:center; gap:7px; padding:8px 14px; border-radius:9px; font-weight:700;
  font-size:13px; background:var(--tint); color:var(--navy2); transition:.14s; white-space:nowrap; }
.btn:hover{ background:#DCE5F2; }
.btn.pri{ background:var(--gold); color:var(--navy); }
.btn.pri:hover{ background:var(--gold-hov,#FFCB55); }
.btn.ghost{ background:rgba(255,255,255,0.12); color:#fff; }
.btn.ghost:hover{ background:rgba(255,255,255,0.2); }
.btn.sm{ padding:6px 11px; font-size:12px; border-radius:8px; }
.btn.block{ width:100%; justify-content:center; }
.btn:disabled{ opacity:.45; cursor:not-allowed; }
.btn.working{ opacity:1; cursor:progress; }
.btn .mini-spin{ margin-right:8px; flex:0 0 14px; width:14px; height:14px;
  border-color:rgba(11,21,38,0.22); border-top-color:var(--navy2); }
.btn.pri .mini-spin{ border-color:rgba(11,21,38,0.28); border-top-color:var(--navy); }
.btn svg{ width:15px; height:15px; }

/* ---------- LAYOUT ---------- */
.wrap{ display:flex; height:calc(100% - 58px); }
.panel{ width:var(--panel-w); flex:0 0 var(--panel-w); background:#fff; border-right:1px solid var(--line);
  display:flex; flex-direction:column; z-index:20; }
.tabs{ display:flex; border-bottom:1px solid var(--line); background:var(--light); flex-wrap:wrap; }
.tab{ flex:1 0 25%; padding:11px 6px; font-size:11.5px; font-weight:700; color:var(--muted); border-bottom:3px solid transparent;
  letter-spacing:0.01em; }
.tab:hover{ color:var(--navy2); background:#EEF2F9; }
.tab.on{ color:var(--navy2); border-bottom-color:var(--gold); background:#fff; }
.panel-body{ flex:1; overflow-y:auto; padding:16px 16px 40px; }
.stage{ flex:1; position:relative; overflow:auto; background:
  linear-gradient(#E7EDF6,#E7EDF6); display:flex; flex-direction:column; }

/* ---------- FORM BITS ---------- */
.fld{ margin-bottom:13px; }
.fld > label:not(.switch){ display:block; font-size:11.5px; font-weight:800; letter-spacing:0.04em; text-transform:uppercase;
  color:var(--muted); margin-bottom:5px; }
.fld > .switch{ margin:0; }
.fld .hint{ font-size:11.5px; color:var(--muted); margin-top:4px; line-height:1.45; }
input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=range]):not([type=file]),
select,textarea{ width:100%; padding:9px 11px; border:1px solid var(--line);
  border-radius:9px; background:#fff; font-size:13.5px; transition:.14s; }
input::placeholder,textarea::placeholder{ color:#9AA8BE; }
input[type=password]{ letter-spacing:0.08em; }
input:focus,select:focus,textarea:focus{ outline:0; border-color:var(--cyan); box-shadow:0 0 0 3px var(--cyan-lt); }
input:hover:not(:focus),select:hover:not(:focus),textarea:hover:not(:focus){ border-color:#C2CEE0; }
textarea{ resize:vertical; min-height:76px; line-height:1.5; }
.row{ display:flex; gap:9px; }
.row > *{ flex:1; min-width:0; }
.sec-h{ font-size:12px; font-weight:900; letter-spacing:0.1em; text-transform:uppercase; color:var(--navy2);
  margin:20px 0 10px; padding-bottom:7px; border-bottom:2px solid var(--tint); display:flex; align-items:center; gap:8px; }
.sec-h:first-child{ margin-top:0; }
.sec-h .n{ width:19px; height:19px; border-radius:50%; background:var(--navy2); color:var(--gold); font-size:10px;
  display:flex; align-items:center; justify-content:center; }
.switch{ display:flex; align-items:center; gap:9px; cursor:pointer; padding:8px 0; }
.switch input{ display:none; }
.switch .kn{ width:38px; height:21px; border-radius:20px; background:#C9D3E2; position:relative; transition:.16s; flex:0 0 38px; }
.switch .kn:after{ content:""; position:absolute; top:2.5px; left:2.5px; width:16px; height:16px; border-radius:50%;
  background:#fff; transition:.16s; box-shadow:0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + .kn{ background:var(--ok); }
.switch input:checked + .kn:after{ transform:translateX(17px); }
.switch span{ font-size:13px; font-weight:600; }
.swatches{ display:grid; grid-template-columns:repeat(3,1fr); gap:9px; }
.sw{ text-align:center; }
.sw input[type=color]{ width:100%; height:34px; padding:0; border:1px solid var(--line); border-radius:8px; background:#fff; cursor:pointer; }
.sw label{ display:block; font-size:10.5px; font-weight:700; color:var(--muted); margin-top:4px; }
.chips{ display:flex; flex-wrap:wrap; gap:7px; }
.chip{ padding:6px 11px; border-radius:20px; background:var(--tint); font-size:12px; font-weight:700; color:var(--navy2); }
.chip:hover{ background:#DCE5F2; }
.chip.on{ background:var(--navy2); color:#fff; }

/* theme cards */
.themes{ display:grid; grid-template-columns:repeat(2,1fr); gap:10px; }
.theme{ border:2px solid var(--line); border-radius:11px; overflow:hidden; background:#fff; text-align:left; transition:.14s; }
.theme:hover{ border-color:#B9C7DD; }
.theme.on{ border-color:var(--gold); box-shadow:0 0 0 3px var(--gold-bg); }
.theme .sw3{ height:44px; display:flex; }
.theme .sw3 i{ flex:1; }
.theme .nm{ display:block; padding:7px 10px; font-size:12px; font-weight:800; }
.theme .nm small{ display:block; font-weight:500; color:var(--muted); font-size:10.5px; margin-top:1px; }

/* file drop */
.drop{ border:2px dashed #B9C7DD; border-radius:14px; padding:22px 16px; text-align:center; background:var(--light); transition:.14s; }
.drop.hot{ border-color:var(--cyan); background:var(--cyan-lt); }
.drop h4{ font-size:14px; margin-bottom:4px; }
.drop p{ font-size:12px; color:var(--muted); margin-bottom:11px; }

/* doc list */
.doclist{ display:flex; flex-direction:column; gap:7px; margin-bottom:14px; }
.docitem{ display:flex; align-items:center; gap:9px; padding:9px 10px; border:1px solid var(--line); border-radius:10px;
  background:#fff; text-align:left; transition:.14s; }
.docitem:hover{ border-color:#B9C7DD; background:var(--light); }
.docitem.on{ border-color:var(--navy2); background:var(--tint); }
.docitem .ic{ flex:0 0 26px; height:26px; border-radius:7px; background:var(--navy2); color:var(--gold); font-size:10px;
  font-weight:900; display:flex; align-items:center; justify-content:center; }
.docitem .tx{ flex:1; min-width:0; }
.docitem .tx b{ display:block; font-size:12.5px; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.docitem .tx small{ color:var(--muted); font-size:11px; }
.docitem .x{ flex:0 0 22px; height:22px; border-radius:6px; color:var(--muted); font-size:16px; line-height:1;
  display:flex; align-items:center; justify-content:center; padding-bottom:1px; }
.docitem .x:hover{ background:#FEE2E2; color:var(--bad); }

/* structure list */
.struct{ border:1px solid var(--line); border-radius:11px; overflow:hidden; }
.srow{ display:flex; align-items:center; gap:8px; padding:7px 9px; border-bottom:1px solid var(--line); background:#fff; }
.srow:last-child{ border-bottom:0; }
.srow:hover{ background:var(--light); }
.srow .lv{ flex:0 0 84px; }
.srow .lv select{ padding:4px 6px; font-size:11.5px; border-radius:7px; }
.srow .tx{ flex:1; min-width:0; font-size:12.5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.srow.is-h1 .tx{ font-weight:900; color:var(--navy2); }
.srow.is-h2 .tx{ font-weight:800; color:var(--navy3); }
.srow.is-h3 .tx{ font-weight:700; padding-left:10px; }
.srow.is-h4 .tx{ font-weight:600; padding-left:20px; color:var(--cyan-dk); }
.srow.is-p .tx{ color:var(--muted); padding-left:30px; }
.srow .go{ flex:0 0 24px; opacity:0; color:var(--muted); }
.srow:hover .go{ opacity:1; }
.filterbar{ display:flex; gap:7px; margin-bottom:10px; }

/* preview */
.stagebar{ height:44px; flex:0 0 44px; background:#fff; border-bottom:1px solid var(--line); display:flex;
  align-items:center; gap:10px; padding:0 14px; position:sticky; top:0; z-index:10; }
.stagebar .pg{ font-size:12.5px; font-weight:700; color:var(--navy2); min-width:104px; text-align:center; }
.stagebar .nav{ display:flex; align-items:center; gap:4px; }
.iconbtn{ width:30px; height:30px; border-radius:8px; display:flex; align-items:center; justify-content:center;
  color:var(--navy2); background:var(--tint); font-size:15px; }
.iconbtn:hover{ background:#DCE5F2; }
.iconbtn:disabled{ opacity:.4; }
.scroller{ flex:1; overflow:auto; padding:22px; display:flex; justify-content:center;
  justify-content:safe center; }   /* safe: never clip the left edge when zoomed past the window */
/* the page host must keep its true width - the zoom is a transform, so letting flex
   shrink it would wrap the second page away long before it stopped fitting */
.pagehost{ transform-origin:top center; flex:0 0 auto; }

/* empty state */
.empty{ flex:1; display:flex; align-items:center; justify-content:center; padding:40px; }
.empty .card{ background:#fff; border-radius:18px; box-shadow:var(--shadow); padding:40px 44px; max-width:560px; text-align:center; }
.empty h2{ font-size:23px; font-weight:900; color:var(--navy2); margin-bottom:8px; letter-spacing:-0.02em; }
.empty p{ color:var(--muted); font-size:14px; line-height:1.6; margin-bottom:20px; }
.empty .steps{ display:flex; gap:14px; margin-top:26px; text-align:left; }
.empty .steps .s{ flex:1; }
.empty .steps .s b{ display:flex; align-items:center; justify-content:center; width:26px; height:26px; border-radius:50%;
  background:var(--navy2); color:var(--gold); font-size:12px; margin-bottom:7px; }
.empty .steps .s span{ font-size:12.5px; color:var(--muted); line-height:1.45; }

/* modal */
.mask{ position:fixed; inset:0; background:rgba(11,21,38,0.55); display:flex; align-items:center; justify-content:center;
  z-index:100; padding:24px; backdrop-filter:blur(2px); }
.modal{ background:#fff; border-radius:16px; box-shadow:0 24px 70px rgba(0,0,0,.35); width:100%; max-width:520px;
  max-height:86vh; display:flex; flex-direction:column; overflow:hidden; }
.modal.wide{ max-width:760px; }
.modal .mh{ padding:16px 20px; border-bottom:1px solid var(--line); display:flex; align-items:center; gap:10px; }
.modal .mh h3{ flex:1; font-size:16px; font-weight:900; color:var(--navy2); }
.modal .mb{ padding:18px 20px; overflow-y:auto; }
.modal .mf{ padding:14px 20px; border-top:1px solid var(--line); display:flex; gap:9px; justify-content:flex-end; background:var(--light); }
.modal .mf .btn:disabled{ opacity:.45; cursor:not-allowed; }
/* ---------- the tutorial video ---------- */
.modal.vid{ max-width:1000px; }
.modal.vid .mb{ padding:0; background:#0B1526; }
.vidbox{ position:relative; width:100%; aspect-ratio:16/9; background:#0B1526; }
.vidbox video{ position:absolute; inset:0; width:100%; height:100%; display:block; background:#000; }
.vidmiss{ position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:8px; text-align:center; padding:30px; color:#E7EDF6; }
.vidmiss b{ font-size:15px; font-weight:800; }
.vidmiss span{ font-size:13px; color:#9FB0C9; max-width:420px; line-height:1.5; }
.vidmiss b b{ font-family:"SFMono-Regular",Consolas,monospace; font-size:12.5px; color:var(--gold); }
.vidmiss span b{ font-family:"SFMono-Regular",Consolas,monospace; font-size:12.5px; color:var(--gold); font-weight:700; }

.vidbtn{ display:inline-flex; align-items:center; gap:7px; }
.vidbtn .play{ width:0; height:0; border-left:8px solid var(--gold);
  border-top:5px solid transparent; border-bottom:5px solid transparent; }

.lightbox{ position:fixed; inset:0; background:rgba(0,0,0,.86); display:flex; align-items:center; justify-content:center;
  z-index:200; padding:30px; cursor:zoom-out; }
.lightbox img{ max-width:100%; max-height:100%; border-radius:8px; }

/* progress + toast */
.prog{ height:8px; background:var(--tint); border-radius:5px; overflow:hidden; margin-top:12px; }
.prog i{ display:block; height:100%; background:linear-gradient(90deg,var(--cyan),var(--gold)); width:0; transition:.2s; }
.toasts{ position:fixed; right:18px; bottom:18px; display:flex; flex-direction:column; gap:9px; z-index:300; }
.toast{ background:var(--navy2); color:#fff; padding:11px 15px; border-radius:11px; font-size:13px; font-weight:600;
  box-shadow:var(--shadow); max-width:340px; animation:tin .22s ease; }
.toast.ok{ background:var(--ok); } .toast.bad{ background:var(--bad); } .toast.warn{ background:var(--warn); }
@keyframes tin{ from{ transform:translateY(10px); opacity:0; } }
.note{ background:var(--gold-bg); border:1px solid #F1DDA3; border-left:4px solid var(--gold); border-radius:10px;
  padding:10px 12px; font-size:12.5px; line-height:1.5; color:#7A5A08; margin-bottom:13px; }
.note b{ color:#5C4406; }
.note.blue{ background:var(--cyan-lt); border-color:#A9E9F5; border-left-color:var(--cyan); color:#0B5F6E; }
.note.blue b{ color:#08414B; }
.busy{ position:fixed; inset:0; background:rgba(255,255,255,.82); z-index:250; display:flex; align-items:center;
  justify-content:center; flex-direction:column; gap:14px; }
.spin{ width:38px; height:38px; border:4px solid var(--tint); border-top-color:var(--gold); border-radius:50%;
  animation:sp .8s linear infinite; }
@keyframes sp{ to{ transform:rotate(360deg); } }
.busy p{ font-weight:700; color:var(--navy2); }
.busy .sub{ font-weight:500; color:var(--muted); font-size:13px; }


/* ---------- v2 additions ---------- */
.zlab{ border-radius:8px; }
.zlab:hover{ background:var(--tint); }
.btn.on{ background:var(--navy2); color:#fff; }
.pagehost.spread{ display:flex; flex-wrap:wrap; gap:24px; align-content:flex-start; }
.pagehost.spread .sheet{ margin-bottom:0 !important; }

.aibtn{ flex:0 0 46px; align-self:flex-start; height:38px; padding:0; display:inline-flex;
  align-items:center; justify-content:center; background:var(--navy2); color:var(--gold);
  font-weight:800; letter-spacing:0.03em; border-radius:9px; }
.aibtn:hover{ background:var(--navy3); }
.aibtn:disabled{ opacity:1; cursor:progress; }
.aibtn.working{ background:var(--navy3); }
.mini-spin{ width:16px; height:16px; border:2px solid rgba(242,185,59,0.28); border-top-color:var(--gold);
  border-radius:50%; animation:sp .7s linear infinite; }

.imgbox{ background:var(--light); border:1px solid var(--line); border-radius:10px; padding:12px; text-align:center; margin-bottom:9px; }
.imgbox img{ max-height:64px; max-width:100%; cursor:zoom-in; }
.imgbox.tall img{ max-height:190px; border-radius:8px; }

.fontprev{ background:var(--light); border:1px solid var(--line); border-radius:10px; padding:12px 13px; margin-top:4px; }

.palgrid{ display:grid; grid-template-columns:repeat(2,1fr); gap:8px; margin-top:10px; }
.pal{ position:relative; border:2px solid var(--line); border-radius:10px; overflow:hidden; cursor:pointer; background:#fff; }
.pal:hover{ border-color:#B9C7DD; }
.pal.on{ border-color:var(--gold); box-shadow:0 0 0 3px var(--gold-bg); }
.pal-sw{ display:flex; height:26px; }
.pal-sw i{ flex:1; }
.pal-nm{ display:block; padding:5px 8px; font-size:11.5px; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pal-x{ position:absolute; top:3px; right:4px; width:16px; height:16px; display:flex; align-items:center;
  justify-content:center; color:#fff; font-size:15px; line-height:1; text-shadow:0 1px 3px rgba(0,0,0,.6); opacity:0; }
.pal:hover .pal-x{ opacity:1; }

.cutlist{ margin-top:8px; border:1px solid var(--line); border-radius:9px; overflow:hidden; background:#fff; }
.cutlist > div{ padding:6px 9px; font-size:11.5px; line-height:1.4; border-bottom:1px solid var(--line); }
.cutlist > div:last-child{ border-bottom:0; }
.cut-x{ color:var(--muted); text-decoration:line-through; background:var(--tint); }
.cut-n{ color:var(--muted); }
.cut-c{ color:var(--muted); background:var(--tint); font-style:italic; }
.cut-k{ color:var(--navy2); font-weight:600; background:var(--cyan-lt); }
.cut-k b{ display:block; font-size:9.5px; font-weight:800; letter-spacing:0.07em; text-transform:uppercase;
  color:var(--cyan-dk); margin-bottom:2px; }

.patgrid{ display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.pat{ border:2px solid var(--line); border-radius:10px; overflow:hidden; background:#fff; text-align:center; }
.pat:hover{ border-color:#B9C7DD; }
.pat.on{ border-color:var(--gold); box-shadow:0 0 0 3px var(--gold-bg); }
.pat-art{ display:block; height:52px; background-size:cover; background-position:center; }
.pat-nm{ display:block; padding:5px 4px; font-size:11px; font-weight:700; }

input[type=range]{ width:100%; accent-color:var(--cyan-dk); }

.aiprov{ border:1px solid var(--line); border-radius:14px; padding:14px 16px 15px; margin-bottom:12px; background:#fff;
  box-shadow:0 1px 2px rgba(11,21,38,.04); transition:.15s; }
.aiprov.live{ border-color:var(--cyan); box-shadow:0 0 0 3px var(--cyan-lt); }
.aiprov-h{ display:flex; align-items:center; gap:9px; margin-bottom:11px; font-size:14.5px; }
.aiprov-h b{ font-weight:800; color:var(--navy2); }
.aiprov-h .tags{ display:flex; align-items:center; gap:5px; flex:0 0 auto; }
.aitag{ display:inline-flex; align-items:center; justify-content:center; flex:0 0 auto; height:19px;
  padding:0 9px; font-size:9.5px; font-weight:800; letter-spacing:0.08em; text-transform:uppercase; line-height:1;
  white-space:nowrap; aspect-ratio:auto; border:0; border-radius:20px; background:var(--cyan-lt); color:var(--cyan-dk); }
.aitag.img{ background:var(--gold-bg); color:var(--gold-dk); }
.aiprov .fld{ margin-bottom:10px; }
.aiprov .fld > label{ font-size:10.5px; }
.aiprov input{ font-family:"SFMono-Regular",Consolas,"Liberation Mono",monospace; font-size:12.5px; }
.aiprov .aifoot{ display:flex; align-items:center; gap:8px; margin-top:11px; }
.aiprov .aifoot .btn{ flex:0 0 auto; }
.aiprov .aifoot .grow{ flex:1; min-width:0; }
.aikeylink{ font-size:12px; font-weight:700; color:var(--cyan-dk); text-decoration:none; white-space:nowrap; }
.aikeylink:hover{ text-decoration:underline; }
.aistat{ font-size:12px; font-weight:600; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.aistat.ok{ color:var(--ok); }
.aistat.bad{ color:var(--bad); }
.aihead{ display:flex; gap:10px; margin-bottom:4px; }
.aihead .fld{ flex:1; margin-bottom:14px; }
.modelrow{ display:flex; gap:8px; }
.modelrow input{ flex:1; min-width:0; }
.modelrow .btn{ flex:0 0 auto; }

.chooser{ display:flex; flex-direction:column; gap:7px; }
.pickrow{ text-align:left; padding:11px 13px; border:1px solid var(--line); border-radius:10px; background:#fff; font-size:14px; }
.pickrow:hover{ border-color:var(--cyan); background:var(--cyan-lt); }

#xEd{ min-height:190px; border:1px solid var(--line); border-radius:10px; padding:11px; background:#fff;
  font-size:13.5px; line-height:1.6; overflow:auto; max-height:340px; }
#xEd:focus{ outline:0; border-color:var(--cyan); box-shadow:0 0 0 3px var(--cyan-lt); }


/* ---------- drop-downs ---------- */
.sel{ position:relative; display:block; width:100%; }
.sel > select{ position:absolute; inset:0; width:100%; height:100%; opacity:0; pointer-events:none; }
.sel-btn{ display:flex; align-items:center; gap:9px; width:100%; padding:9px 11px; border:1px solid var(--line);
  border-radius:9px; background:#fff; font-size:13.5px; text-align:left; transition:.14s; color:var(--ink); min-height:38px; }
.sel-btn:hover{ border-color:#C2CEE0; }
.sel-btn:focus-visible{ outline:0; border-color:var(--cyan); box-shadow:0 0 0 3px var(--cyan-lt); }
.sel.open .sel-btn{ border-color:var(--cyan); box-shadow:0 0 0 3px var(--cyan-lt); }
.sel-lab{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sel-arw{ flex:0 0 9px; height:9px; border-right:2px solid var(--muted); border-bottom:2px solid var(--muted);
  transform:rotate(45deg) translate(-2px,-2px); transition:.16s; }
.sel.open .sel-arw{ transform:rotate(225deg) translate(-1px,-1px); border-color:var(--cyan-dk); }
.sel-dots{ flex:0 0 auto; display:flex; border-radius:4px; overflow:hidden; box-shadow:0 0 0 1px rgba(11,21,38,.12); }
.sel-dots i{ display:block; width:9px; height:16px; }

.sel-pop{ position:fixed; z-index:400; background:#fff; border:1px solid var(--line); border-radius:12px;
  box-shadow:0 16px 40px rgba(11,21,38,.20), 0 2px 6px rgba(11,21,38,.08); overflow-y:auto; padding:5px;
  animation:selin .12s ease; }
.sel-pop.up{ transform-origin:bottom; }
@keyframes selin{ from{ opacity:0; transform:translateY(-4px); } }
.sel-opt{ display:flex; align-items:center; gap:9px; width:100%; padding:8px 10px; border-radius:8px;
  font-size:13.5px; text-align:left; color:var(--ink); background:none; }
.sel-opt:hover,.sel-opt.hot{ background:var(--tint); }
.sel-opt.on{ background:var(--cyan-lt); color:var(--navy2); font-weight:600; }
.sel-opt .sel-txt{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sel-opt .sel-tick{ flex:0 0 auto; color:var(--cyan-dk); font-weight:800; opacity:0; font-size:12px; }
.sel-opt.on .sel-tick{ opacity:1; }


/* ---------- picture library ---------- */
.piclib{ margin-top:12px; }
.pic-head{ display:flex; align-items:center; justify-content:space-between; font-size:11px; font-weight:800;
  letter-spacing:0.06em; text-transform:uppercase; color:var(--muted); margin-bottom:7px; }
.linkbtn{ font-size:11.5px; font-weight:800; color:var(--cyan-dk); text-transform:none; letter-spacing:0; }
.linkbtn:hover{ text-decoration:underline; }
.pic-strip{ display:grid; grid-template-columns:repeat(4,1fr); gap:7px; }
.pic-strip .pic{ position:relative; border:2px solid var(--line); border-radius:9px; overflow:hidden; cursor:pointer;
  background:var(--light); aspect-ratio:3/4; transition:.14s; padding:0; }
.pic-strip .pic:hover{ border-color:var(--cyan); }
.pic-strip .pic img{ width:100%; height:100%; object-fit:cover; display:block; }
.pic-acts{ position:absolute; top:3px; right:3px; display:flex; gap:3px; opacity:0; transition:.14s; }
.pic-strip .pic:hover .pic-acts{ opacity:1; }
.pic-a{ width:20px; height:20px; border-radius:6px; background:rgba(11,21,38,0.82); color:#fff; font-size:13px;
  line-height:1; display:flex; align-items:center; justify-content:center; padding-bottom:1px; }
.pic-a:hover{ background:var(--navy3); }
.pic-strip .pic.full{ border-color:var(--gold); }
.pic-tag{ position:absolute; left:0; right:0; bottom:0; background:rgba(11,21,38,0.78); color:var(--gold);
  font-size:8.5px; font-weight:800; letter-spacing:0.06em; text-transform:uppercase; text-align:center; padding:2px 0; }
.tagpill{ display:inline-block; font-size:9px; font-weight:800; letter-spacing:0.05em; text-transform:uppercase;
  padding:2px 7px; border-radius:20px; background:var(--gold-bg); color:var(--gold-dk); margin-left:4px; }
.tagpill.soft{ background:var(--tint); color:var(--muted); }
.pic-strip .pic.more{ display:flex; align-items:center; justify-content:center; font-weight:800; color:var(--muted);
  border-style:dashed; background:#fff; }
.pic-strip .pic.more:hover{ color:var(--navy2); }

.galgrid{ display:grid; grid-template-columns:repeat(3,1fr); gap:14px; }
.galcard{ border:1px solid var(--line); border-radius:12px; overflow:hidden; background:#fff; display:flex; flex-direction:column; }
.galimg{ background:var(--light); aspect-ratio:3/4; overflow:hidden; }
.galimg img{ width:100%; height:100%; object-fit:cover; cursor:zoom-in; display:block; }
.galmeta{ padding:8px 10px 0; font-size:11px; font-weight:700; color:var(--muted); }
.galprompt{ padding:4px 10px 0; font-size:11px; line-height:1.4; color:var(--muted); overflow:hidden;
  display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; }
.galacts{ display:flex; gap:5px; padding:10px; margin-top:auto; }
.galacts .btn{ flex:1; padding:6px 4px; font-size:11.5px; }


/* ---------- cover framing ---------- */
.framer{ position:relative; margin-top:10px; width:100%; aspect-ratio:8.5/11; max-height:250px; border-radius:11px;
  overflow:hidden; border:2px solid var(--line); background:var(--light); cursor:grab; user-select:none; }
.framer:hover{ border-color:var(--cyan); }
.framer.grabbing{ cursor:grabbing; border-color:var(--cyan); }
.framer-in{ position:absolute; inset:0; }
.framer-hint{ position:absolute; left:50%; bottom:8px; transform:translateX(-50%); background:rgba(11,21,38,0.75);
  color:#fff; font-size:10px; font-weight:800; letter-spacing:0.08em; text-transform:uppercase; padding:4px 10px;
  border-radius:20px; pointer-events:none; transition:.15s; }
.framer.grabbing .framer-hint{ opacity:0; }
