/* studio.css — PDF Studio layar penuh */
body.studio-open { overflow: hidden; }
.studio { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; background: var(--bg); opacity: 0; transform: scale(0.985); transition: opacity 0.25s ease, transform 0.3s cubic-bezier(.2, 1, .3, 1); }
.studio.open { opacity: 1; transform: none; }
.studio::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(900px 500px at 0% 0%, color-mix(in srgb, var(--cloud-1) 30%, transparent), transparent 70%), radial-gradient(800px 500px at 100% 100%, color-mix(in srgb, var(--cloud-2) 25%, transparent), transparent 70%); }

.st-top { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--surface); backdrop-filter: blur(14px); }
.st-brand { font-family: var(--serif); font-weight: var(--display-weight); font-size: 19px; line-height: 1; letter-spacing: -0.02em; }
.st-name { min-width: 120px; width: 280px; height: 38px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-solid); color: var(--ink); font: inherit; font-weight: 650; }
.st-name:focus { outline: 2px solid var(--lav); }
.st-count { font-size: 13px; color: var(--muted); }
.st-spacer { flex: 1; }
.st-iconbtn { width: 38px; height: 38px; border-radius: 12px; display: inline-grid; place-items: center; border: 1px solid var(--line); background: var(--surface-solid); color: var(--ink); cursor: pointer; }
.st-iconbtn:disabled { opacity: 0.4; cursor: default; }
.st-iconbtn.flip svg { transform: scaleX(-1); }
.st-zoomwrap { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.st-zoom { width: 110px; accent-color: var(--primary); }
.st-save { height: 40px; }

.st-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 210px minmax(0, 1fr) 300px; }
.st-rail { overflow: auto; padding: 14px 10px 24px; border-right: 1px solid var(--line); background: var(--surface-2); }
.st-group { margin: 14px 10px 6px; font-size: 11px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.st-group:first-child { margin-top: 2px; }
.st-tool { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; border: 0; background: transparent; color: var(--ink-soft); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; text-align: left; transition: background 0.15s, color 0.15s; }
.st-tool:hover { background: var(--lav-soft); color: var(--ink); }
.st-tool.active { background: var(--primary); color: var(--on-primary); }
.st-tool svg { flex: none; }

.st-main { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.st-gridbar, .st-editbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.chipbtn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-solid); color: var(--ink); font: inherit; font-size: 12.5px; font-weight: 650; cursor: pointer; }
.chipbtn:hover:not(:disabled) { border-color: var(--lav); background: var(--lav-soft); }
.chipbtn:disabled { opacity: 0.4; cursor: default; }

.st-grid { list-style: none; margin: 0; padding: 22px; display: grid; grid-template-columns: repeat(auto-fill, var(--thumb, 168px)); justify-content: start; gap: 22px; align-content: start; overflow: auto; flex: 1; }
.st-empty { grid-column: 1 / -1; padding: 60px; text-align: center; color: var(--muted); }
.st-page { position: relative; display: grid; gap: 8px; cursor: grab; outline: none; }
.st-page.dragging { opacity: 0.35; }
.st-thumb { position: relative; border-radius: 10px; overflow: hidden; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 10px 24px -14px rgba(40, 30, 90, 0.4); border: 2px solid transparent; transition: transform 0.18s, border-color 0.15s, box-shadow 0.18s; }
.st-thumb canvas { width: 100%; height: 100%; display: block; }
.st-page:hover .st-thumb { transform: translateY(-3px); }
.st-page[aria-selected="true"] .st-thumb { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 22%, transparent); }
.st-page:focus-visible .st-thumb { outline: 3px solid var(--lav); outline-offset: 3px; }
.st-page.drop-before::before, .st-page.drop-after::after { content: ""; position: absolute; top: 0; bottom: 26px; width: 4px; border-radius: 4px; background: var(--primary); }
.st-page.drop-before::before { left: -13px; }
.st-page.drop-after::after { right: -13px; }
.st-page-foot { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.pg-badge { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; background: var(--lav-soft); color: var(--lav-strong); }
.pg-badge.dark { background: #1f1b2e; color: #fff; }
.st-page-acts { position: absolute; top: 8px; right: 8px; display: flex; flex-direction: column; gap: 4px; opacity: 0; transition: opacity 0.15s; }
.st-page:hover .st-page-acts, .st-page:focus-within .st-page-acts { opacity: 1; }
.mini { width: 28px; height: 28px; border-radius: 9px; border: 0; display: grid; place-items: center; background: rgba(31, 27, 46, 0.78); color: #fff; cursor: pointer; }
.mini:hover { background: var(--primary); }

/* editor */
.st-editwrap { flex: 1; min-height: 0; display: grid; grid-template-columns: 96px minmax(0, 1fr); }
.st-strip { overflow: auto; padding: 14px 10px; display: grid; gap: 12px; align-content: start; border-right: 1px solid var(--line); }
.st-strip-item { display: grid; gap: 4px; justify-items: center; padding: 4px; border: 0; background: none; cursor: pointer; color: var(--muted); font: inherit; font-size: 11px; font-weight: 700; border-radius: 10px; }
.st-strip-thumb { width: 64px; display: block; overflow: hidden; border-radius: 6px; background: #fff; border: 2px solid transparent; box-shadow: 0 4px 10px -6px rgba(0, 0, 0, 0.35); }
.st-strip-thumb canvas { width: 100%; height: 100%; display: block; }
.st-strip-item.active .st-strip-thumb { border-color: var(--primary); }
.st-strip-item.active { color: var(--primary); }
.st-stage { position: relative; min-height: 0; display: grid; place-items: start; overflow: auto; padding: 24px; }
/* margin:auto = di tengah bila muat, bisa digulir penuh bila diperbesar (place-items:center memotong sisi kiri/atas) */
.st-stage > .st-pagebox { margin: auto; }
.st-pagebox { position: relative; background: #fff; box-shadow: 0 30px 60px -30px rgba(30, 20, 70, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.06); touch-action: none; }
.st-pagebox canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.st-layer { position: absolute; inset: 0; cursor: crosshair; }
.st-pagebox.tool-text .st-layer { cursor: text; }
.st-pagebox.placing .st-layer { cursor: copy; }
.annot { position: absolute; border: 1.5px dashed transparent; border-radius: 3px; cursor: move; }
.annot:hover { border-color: color-mix(in srgb, var(--primary) 55%, transparent); }
.annot.sel { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.annot-handle { position: absolute; right: -7px; bottom: -7px; width: 14px; height: 14px; border-radius: 50%; background: var(--primary); border: 2px solid #fff; cursor: nwse-resize; opacity: 0; }
.annot-del { position: absolute; right: -10px; top: -10px; width: 22px; height: 22px; border-radius: 50%; border: 0; display: grid; place-items: center; background: #b23a48; color: #fff; cursor: pointer; opacity: 0; }
.annot.sel .annot-handle, .annot.sel .annot-del { opacity: 1; }
.annot.editing { border-color: var(--primary); background: rgba(255, 255, 255, 0.92); }
.annot-edit { position: absolute; inset: 0; width: 100%; min-height: 100%; border: 0; outline: 0; resize: none; background: transparent; font-family: var(--font); line-height: 1.25; padding: 0; overflow: hidden; }
.ghost { position: absolute; border: 1.5px solid var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent); pointer-events: none; }
.ghost-highlight { background: rgba(255, 224, 102, 0.45); border-color: #d4a800; }
.ghost-redact { background: rgba(0, 0, 0, 0.7); border-color: #000; }
.ghost-whiteout { background: rgba(255, 255, 255, 0.9); border-color: #999; }
.ghost-crop { background: transparent; border: 2px dashed var(--primary); }
.crop-shade { position: absolute; inset: 0; background: rgba(20, 16, 32, 0.45); pointer-events: none; }
.crop-frame { position: absolute; border: 2px dashed var(--primary); pointer-events: none; }
.place-hint { font-size: 12.5px; font-weight: 700; color: var(--primary); padding: 6px 12px; border-radius: 999px; background: var(--lav-soft); animation: pulse 1.6s infinite; }

/* panel kanan */
.st-panel { overflow: auto; padding: 18px; border-left: 1px solid var(--line); background: var(--surface-2); display: grid; gap: 14px; align-content: start; }
.st-ptitle { font-family: var(--serif); font-weight: var(--display-weight); font-size: 21px; line-height: 1.15; letter-spacing: -0.01em; }
.st-hint { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.55; }
.st-note { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--lav-soft); color: var(--ink-soft); font-size: 12.5px; line-height: 1.5; }
.st-err { margin: 0; color: var(--rose-strong); font-size: 13px; font-weight: 650; }
.st-field { display: grid; gap: 6px; font-size: 12.5px; font-weight: 650; color: var(--ink-soft); }
.st-field input[type=range] { width: 100%; accent-color: var(--primary); }
.st-input { width: 100%; height: 40px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface-solid); color: var(--ink); font: inherit; font-size: 14px; }
.st-input:focus { outline: 2px solid var(--lav); border-color: transparent; }
.st-seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-solid); border: 1px solid var(--line); }
.st-seg button { flex: 1 1 auto; min-height: 32px; padding: 0 10px; border-radius: 10px; border: 0; background: transparent; color: var(--ink-soft); font: inherit; font-size: 12.5px; font-weight: 650; cursor: pointer; white-space: nowrap; }
.st-seg button.on { background: var(--primary); color: var(--on-primary); }
.st-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.st-swatches button { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--surface-solid); box-shadow: 0 0 0 1px var(--line-strong); cursor: pointer; }
.st-swatches button.on { box-shadow: 0 0 0 2px var(--primary); }
.st-posgrid { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: 40px 40px; gap: 6px; padding: 8px; border-radius: 12px; background: #fff; border: 1px solid var(--line); aspect-ratio: 3 / 2.2; }
.st-posgrid button { border: 1.5px dashed #d8d2e6; border-radius: 8px; background: transparent; cursor: pointer; display: grid; place-items: center; }
.st-posgrid button:nth-child(-n+3) { align-self: start; }
.st-posgrid button:nth-child(n+4) { grid-row: 3; align-self: end; }
.st-posgrid i { width: 18px; height: 5px; border-radius: 3px; background: #cfc8e0; }
.st-posgrid button.on { border-style: solid; border-color: var(--primary); }
.st-posgrid button.on i { background: var(--primary); }
.st-preview { display: grid; place-items: center; padding: 10px; border-radius: 14px; background: var(--surface-solid); border: 1px solid var(--line); min-height: 120px; }
.st-preview canvas { max-width: 100%; border-radius: 6px; box-shadow: 0 8px 20px -12px rgba(0, 0, 0, 0.5); }
.st-wide { width: 100%; }
.switch-row.compact { margin: 0; padding: 10px 12px; }
.sig-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sig-item { height: 64px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; padding: 6px; }
.sig-item img { max-width: 100%; max-height: 100%; }
.sig-item.on { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent); }
.st-forms { display: grid; gap: 10px; }
.st-forms h4 { margin: 8px 0 0; font-size: 13px; }
.danger-text { color: var(--rose-strong); }

/* lembar popup studio */
.st-sheet { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 20px; background: var(--overlay); backdrop-filter: blur(6px); opacity: 0; transition: opacity 0.22s; }
.st-sheet.open { opacity: 1; }
.st-sheet-card { width: min(460px, 100%); max-height: 88vh; overflow: auto; padding: 24px; border-radius: 26px; background: var(--surface-solid); border: 1px solid var(--line); box-shadow: var(--shadow-lg); display: grid; gap: 16px; transform: translateY(14px) scale(0.98); transition: transform 0.32s cubic-bezier(.2, 1.1, .3, 1); }
.st-sheet.open .st-sheet-card { transform: none; }
.st-sheet.wide .st-sheet-card { width: min(600px, 100%); }
.st-sheet-head { display: flex; align-items: center; gap: 12px; }
.st-sheet-head h3 { font-family: var(--serif); font-weight: var(--display-weight); font-size: 22px; line-height: 1.15; letter-spacing: -0.01em; }
.st-sheet-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--glow); color: #3d3290; }
.st-sheet-body { display: grid; gap: 14px; font-size: 14px; color: var(--ink-soft); }
.st-sheet-body p { margin: 0; }
.st-sheet-actions { display: flex; justify-content: flex-end; gap: 10px; }
.ex-body { display: grid; gap: 14px; }
.ex-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 280px; overflow: auto; }
.ex-results li { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); }
.ex-ext { flex: none; width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: var(--rose-soft); color: var(--rose-strong); font-size: 11px; font-weight: 800; }
.ex-name { flex: 1; min-width: 0; display: grid; }
.ex-name b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.ex-name small { color: var(--muted); }
.sig-body { display: grid; gap: 10px; }
.sig-padwrap { display: grid; gap: 6px; justify-items: end; }
.sig-pad { width: 100%; aspect-ratio: 720 / 260; border-radius: 16px; background: #fff repeating-linear-gradient(transparent 0 72%, #e6e1f0 72% calc(72% + 1.5px), transparent calc(72% + 1.5px) 100%); border: 1.5px dashed var(--line-strong); touch-action: none; cursor: crosshair; }
.sig-name { font-family: "Segoe Script", "Snell Roundhand", "Brush Script MT", cursive; font-style: italic; font-size: 26px; height: 56px; }

.st-busy { position: absolute; z-index: 6; left: 50%; bottom: 28px; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 18px; background: var(--surface-solid); border: 1px solid var(--line); box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 650; min-width: 280px; }
.st-busybar { margin-top: 6px; height: 5px; border-radius: 5px; background: var(--lav-soft); overflow: hidden; }
.st-busybar i { display: block; height: 100%; width: 0; background: var(--primary); transition: width 0.2s; }

@media (max-width: 1100px) {
  .st-body { grid-template-columns: 64px minmax(0, 1fr) 270px; }
  .st-tool span, .st-group { display: none; }
  .st-tool { justify-content: center; padding: 10px; }
  .st-name { width: 180px; }
}
@media (max-width: 760px) {
  .st-body { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; }
  .st-rail { display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; }
  .st-tool { width: auto; }
  .st-panel { max-height: 40vh; border-left: 0; border-top: 1px solid var(--line); }
  .st-brand, .st-zoomwrap { display: none; }
}

/* alat baru: putar, bandingkan */
.st-btnrow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.st-btnrow .btn { justify-content: center; gap: 6px; }
.cmp-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0 12px; }
.cmp-out { min-height: 60px; }
.cmp-sum { margin: 4px 0 10px; font-size: 14px; color: var(--muted); }
.cmp-add { color: var(--mint-strong); }
.cmp-del { color: var(--rose-strong); }
.cmp-list { list-style: none; margin: 0; padding: 6px; max-height: 46vh; overflow: auto; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); font-family: var(--mono); font-size: 12.5px; line-height: 1.5; scroll-behavior: smooth; }
.cmp-list li { display: grid; grid-template-columns: 18px 1fr; gap: 6px; padding: 3px 8px; border-radius: 8px; white-space: pre-wrap; word-break: break-word; }
.cmp-list .cmp-plus { background: var(--mint-soft); color: var(--mint-strong); }
.cmp-list .cmp-minus { background: var(--rose-soft); color: var(--rose-strong); text-decoration: line-through; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
.cmp-list .cmp-same { color: var(--muted); }
@media (max-width: 640px) { .cmp-pick { grid-template-columns: 1fr; } }

.st-brand { display: inline-flex; align-items: center; gap: 8px; }
.st-mark { width: 26px; height: 26px; flex: none; }

.st-zoombtn { width: 28px; height: 28px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.st-zoombtn:hover { background: var(--lav-soft); color: var(--lav-strong); }
.st-zoomval { min-width: 48px; height: 28px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-solid); color: var(--ink-soft); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.st-zoomval:hover { color: var(--lav-strong); border-color: var(--lav); }
