/* Kanvas free PDF tools — shared styles (hub + every tool page). Mobile first.
   Visual identity "Stabilo", shared with the landing page (public/index.html):
   ink on light paper, Bricolage Grotesque display type, highlighter yellow
   reserved for the AI step and small accents. */
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 800; font-display: swap; src: url(/assets/fonts/bricolage-800-latin.woff2) format("woff2") }
:root {
  --paper: #F4F5F2;
  --sheet: #FFFFFF;
  --ink: #121418;
  --ink-soft: #2A2E36;
  --muted: #5A606B;
  --line: #D9DCD8;
  --line-soft: #E7E9E5;
  --sb: #FFE03D;
  --sb-soft: #FFF3A6;
  --ok: #11804A;
  --ok-bg: #E8F5EE;
  --warn: #7A5200;
  --warn-bg: #FFF6D6;
  --err: #A3261A;
  --err-bg: #FCEDEB;
  --disp: "Bricolage Grotesque", "Arial Black", "Segoe UI", system-ui, sans-serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius-sheet: 22px;
  --radius-ctl: 14px;
}
* { box-sizing: border-box }
[hidden] { display: none !important }
html, body { margin: 0; padding: 0; overflow-x: hidden }
body { background: var(--paper); color: var(--ink); font: 400 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent }
a { color: inherit }
button, input, select, textarea { font: inherit; color: inherit }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px }
.wrap { width: min(1120px, 100% - 32px); margin: 0 auto }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important } }

/* Header */
.site-header { position: sticky; top: 0; z-index: 30; padding-top: env(safe-area-inset-top); background: rgba(244, 245, 242, .92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line) }
.nav { display: flex; flex-wrap: wrap; align-items: center; column-gap: 12px; min-height: 64px }
.nav > .brand, .nav > .nav-actions { min-height: 64px }
.brand { display: flex; align-items: center; gap: 9px; font-family: var(--disp); font-weight: 800; letter-spacing: -.03em; font-size: 19px; text-decoration: none; flex: none }
.brand svg { width: 26px; height: 26px }
.brand small { font-family: var(--sans); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-left: 7px }
/* phones: the nav is a second row so "Studio Desain" is always one tap away */
.links { display: flex; order: 3; width: 100%; gap: 22px; margin: -6px 0 0; padding: 0 0 10px; font-size: 14.5px; font-weight: 600; color: var(--muted) }
.links .studio-link { color: var(--ink); box-shadow: inset 0 -3px 0 var(--sb) }
.links a { text-decoration: none; padding: 6px 0 }
.links a:hover { color: var(--ink); box-shadow: inset 0 -3px 0 var(--sb) }
.nav-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; min-width: 0 }
@media (min-width: 860px) { .links { order: 0; width: auto; margin: 0 0 0 auto; padding: 0; gap: 26px; font-size: 15px } .nav-actions { margin-left: 8px } }
.acct-pill { display: none; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 999px; background: var(--sheet); border: 1px solid var(--line); font-size: 13px; font-weight: 600; white-space: nowrap }
.acct-pill:not([hidden]) { display: inline-flex }
.acct-pill b { color: var(--ok) }
.acct-email { max-width: 18ch; overflow: hidden; text-overflow: ellipsis }
@media (max-width: 560px) { .acct-email { display: none } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 14px; border: 1px solid transparent; font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s }
.btn:active { transform: translateY(1px) }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: 12px }
.btn-dark, .btn-primary { background: var(--ink); color: #fff }
.btn-dark:hover:not(:disabled), .btn-primary:hover:not(:disabled) { background: var(--ink-soft) }
.btn-sb { background: var(--sb); color: var(--ink) }
.btn-sb:hover:not(:disabled) { background: #F5D420 }
.btn-ghost { background: var(--sheet); border-color: var(--line); color: var(--ink) }
.btn-ghost:hover:not(:disabled) { border-color: var(--ink) }
.btn-link { background: none; border: 0; padding: 0; min-height: 0; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; font-weight: 600 }

/* Hero */
.tool-hero { padding: 22px 0 14px }
.crumb { display: inline-block; font-size: 14px; color: var(--ink-soft); text-decoration: none; margin-bottom: 10px }
.crumb:hover { color: var(--ink) }
h1 { font: 800 clamp(34px, 8.6vw, 64px)/.98 var(--disp); letter-spacing: -.04em; margin: 0 0 12px; max-width: 18ch; text-wrap: balance }
.lede { font-size: 16px; color: var(--ink-soft); margin: 0; max-width: 60ch }
.privacy { display: inline-flex; gap: 6px; margin: 12px 0 0; font-size: 13.5px; font-weight: 600; color: var(--ok) }
.privacy-server { color: var(--ink-soft) }
.label { display: inline-block; font-size: 12.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted) }
.label i { font-style: normal; color: var(--ok) }
.eyebrow { margin-bottom: 12px }
h2 { font: 800 clamp(24px, 5vw, 34px)/1.05 var(--disp); letter-spacing: -.035em; margin: 0 0 14px }

/* Tool workspace — the sheet */
.tool-app { position: relative; background: var(--sheet); border: 2px solid var(--ink); border-radius: var(--radius-sheet); padding: 16px; margin: 8px 0 32px; min-height: 220px }
.tool-loading, .noscript { color: var(--muted); margin: 40px 0; text-align: center }
.tool-layout { display: grid; gap: 18px }
.tool-layout > * { min-width: 0 }
@media (min-width: 960px) {
  .tool-app { padding: 22px }
  .tool-layout.has-side { grid-template-columns: minmax(0, 1fr) 320px; align-items: start }
  .tool-side { position: sticky; top: 76px }
}

/* Drop tray: the one memorable element */
.tray { display: grid; place-items: center; gap: 10px; text-align: center; padding: 30px 18px 26px; border: 2px dashed var(--ink); border-radius: 18px; background: var(--sheet); cursor: pointer; transition: background-color .15s }
.tray:hover, .tray.is-over { background-color: var(--sb-soft) }
.tray-glyph { width: 64px; height: 78px; position: relative }
.tray-glyph::before, .tray-glyph::after { content: ""; position: absolute; inset: 0; border-radius: 6px; border: 2px solid var(--ink); background: var(--sheet) }
.tray-glyph::before { transform: rotate(-10deg) translate(-6px, 2px); background: var(--sb-soft) }
.tray-glyph span { position: absolute; z-index: 1; left: 50%; bottom: 8px; transform: translateX(-50%); font: 800 11px/1 var(--sans); letter-spacing: .02em; color: var(--ink) }
.tray-title { font: 800 clamp(22px, 5.6vw, 32px)/1 var(--disp); letter-spacing: -.035em; margin: 0 }
.tray-hint { font-size: 14px; color: var(--muted); margin: 0 }
.tray-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 4px }
.tray-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none }

/* File list */
.files { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px }
.file { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--line-soft); border-radius: var(--radius-ctl); background: #FCFBF8 }
.file.dragging { opacity: .5 }
.file-thumb { width: 44px; height: 56px; border-radius: 6px; background: var(--paper); border: 1px solid var(--line-soft); object-fit: cover; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: var(--muted); overflow: hidden }
.file-thumb canvas, .file-thumb img { width: 100%; height: 100%; object-fit: cover }
.file-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.file-meta { font-size: 12.5px; color: var(--muted) }
.file-tools { display: flex; gap: 2px }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; cursor: pointer; font-size: 17px; color: var(--ink-soft) }
.icon-btn:hover:not(:disabled) { background: var(--paper); color: var(--ink) }
.icon-btn:disabled { opacity: .3; cursor: default }
.add-more { margin-top: 10px }

/* Options */
.opts { display: grid; gap: 16px }
.opt-label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 7px }
.opt-help { font-size: 13px; color: var(--muted); margin: 6px 0 0 }
.seg { display: flex; flex-wrap: wrap; gap: 6px }
.seg button { min-height: 40px; padding: 0 13px; border-radius: 10px; border: 1px solid var(--line); background: var(--sheet); font-size: 14px; font-weight: 600; cursor: pointer }
.seg button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff }
.field { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--sheet); font-size: 15px }
textarea.field { padding: 10px 12px; min-height: 80px; resize: vertical }
.check { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 14.5px; cursor: pointer }
.check input { width: 20px; height: 20px; accent-color: var(--ink) }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center }

/* Sticky action bar (thumb zone on phones) */
.action-bar { position: sticky; bottom: 0; z-index: 20; margin: 18px -16px -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px); border-top: 1px solid var(--line-soft); border-radius: 0 0 var(--radius-sheet) var(--radius-sheet); display: flex; gap: 10px; align-items: center }
.action-bar .btn-primary { flex: 1 }
.action-note { font-size: 13px; color: var(--muted) }
@media (min-width: 960px) { .action-bar { position: static; margin: 16px 0 0; padding: 0; background: none; border: 0; backdrop-filter: none } }

/* Progress */
.progress { display: grid; gap: 10px; padding: 26px 8px; text-align: center }
.progress-bar { height: 8px; border-radius: 999px; background: var(--line-soft); overflow: hidden }
.progress-bar i { display: block; height: 100%; width: 0; background: var(--ink); transition: width .2s }
.progress-label { font-size: 14.5px; color: var(--ink-soft) }

/* Thumbnails grid */
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px }
@media (min-width: 700px) { .thumbs { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) } }
.thumb { position: relative; display: grid; gap: 6px; padding: 6px; border-radius: 12px; border: 2px solid transparent; background: #FCFBF8; user-select: none }
.thumb.is-selected { border-color: var(--ink) }
.thumb.is-deleted { opacity: .35 }
.thumb.dragging { opacity: .5 }
.thumb-page { aspect-ratio: 1 / 1.35; display: grid; place-items: center; background: var(--sheet); border: 1px solid var(--line-soft); border-radius: 6px; overflow: hidden; cursor: pointer }
.thumb-page canvas { max-width: 100%; max-height: 100%; transition: transform .2s; box-shadow: 0 1px 3px rgba(16, 21, 50, .15) }
.thumb-foot { display: flex; align-items: center; justify-content: space-between; gap: 2px; font-size: 13px; font-weight: 700; color: var(--ink-soft) }
.thumb-foot .icon-btn { width: 34px; height: 34px; font-size: 15px }
.thumb-mark { position: absolute; top: 10px; left: 10px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; font-size: 13px; font-weight: 800 }

/* Result card */
.result { display: grid; gap: 16px }
.result-head { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 14px; align-items: center }
.result-preview { width: 92px; aspect-ratio: 1 / 1.35; border-radius: 8px; background: var(--paper); border: 1px solid var(--line); overflow: hidden; display: grid; place-items: center }
.result-preview canvas, .result-preview img { width: 100%; height: 100%; object-fit: contain }
.result-title { font: 800 26px/1.02 var(--disp); letter-spacing: -.035em; margin: 0 0 6px }
.result-size { font-size: 15px; color: var(--ink-soft); margin: 0 }
.result-size b { color: var(--ink) }
.badge { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 4px 10px; border-radius: 999px; background: var(--ok-bg); color: var(--ok); font-size: 13px; font-weight: 700 }
.notice { padding: 11px 13px; border-radius: 12px; font-size: 14px; line-height: 1.45 }
.notice-warn { background: var(--warn-bg); color: var(--warn) }
.notice-err { background: var(--err-bg); color: var(--err) }
.notice-ok { background: var(--ok-bg); color: var(--ok) }
.result-actions { display: grid; gap: 8px }
@media (min-width: 560px) { .result-actions { grid-template-columns: 1fr auto } }
.chain { display: grid; gap: 8px }
.chain-title, .ai-title { font-size: 14px; font-weight: 700; margin: 0 }
.chips { display: flex; flex-wrap: wrap; gap: 8px }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--sheet); font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none }
.chip:hover { border-color: var(--ink) }
.ai-card { display: grid; gap: 8px; padding: 14px; border-radius: 16px; background: var(--paper); border: 1px solid var(--line) }
/* "Langkah berikutnya" on the result: the highlighter yellow marks the AI step */
.next-card { display: grid; gap: 12px; padding: 18px; border-radius: 18px; background: var(--paper); border: 1px solid var(--line) }
.next-card h3 { font: 800 clamp(22px, 5vw, 28px)/1.02 var(--disp); letter-spacing: -.035em; margin: 0 }
.next-card p { margin: 0; color: var(--ink-soft); font-size: 15px; max-width: 52ch }
.next-card figure { position: relative; margin: 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 16 / 9; background: var(--sheet) }
.next-card figure img { width: 100%; height: 100%; object-fit: cover; display: block }
.next-card figcaption { position: absolute; left: 10px; top: 10px; padding: 3px 9px; border-radius: 999px; background: rgba(18, 20, 24, .82); color: #fff; font-size: 12px; font-weight: 700 }
.next-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center }
@media (min-width: 720px) { .next-card.has-figure { grid-template-columns: minmax(0, 1fr) 260px; align-items: center } .next-card.has-figure figure { grid-column: 2; grid-row: 1 / span 5 } }
.ai-note { font-size: 12.5px; color: var(--muted); margin: 0 }
.result-files { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; max-height: 240px; overflow: auto }
.result-files li { display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: 14px }

/* Install prompt */
.install { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 50; display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 16px; background: var(--ink); color: #fff; box-shadow: 0 18px 40px -18px rgba(16, 21, 50, .7); max-width: 520px; margin: 0 auto }
.install p { margin: 0; flex: 1; font-size: 14px }
.install .btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35) }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; padding: 10px 16px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 14px; max-width: calc(100% - 32px); box-shadow: 0 12px 30px -16px rgba(16, 21, 50, .8) }
.toast.err { background: var(--err) }

/* Content sections */
.howto, .faq, .related, .all-tools, .recent, .shared-files { margin: 0 0 34px }
.howto ol { margin: 0; padding-left: 22px; display: grid; gap: 8px; max-width: 62ch }
.faq details { border-top: 1px solid var(--line); padding: 4px 0 }
.faq details:last-child { border-bottom: 1px solid var(--line) }
.faq summary { cursor: pointer; padding: 12px 0; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 12px }
.faq summary::after { content: "+"; font-size: 20px; line-height: 1; color: var(--muted) }
.faq details[open] summary::after { content: "−" }
.faq details p { margin: 0 0 12px; color: var(--ink-soft); max-width: 66ch }
.tool-grid { display: grid; grid-template-columns: 1fr; gap: 10px }
@media (min-width: 560px) { .tool-grid { grid-template-columns: repeat(2, 1fr) } }
@media (min-width: 900px) { .tool-grid { grid-template-columns: repeat(3, 1fr) } }
.tool-card { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 14px; background: var(--sheet); border: 1px solid var(--line); text-decoration: none; min-height: 72px }
.tool-card:hover { border-color: var(--ink); box-shadow: 4px 4px 0 var(--sb) }
.tool-card-icon { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--paper); font-size: 22px }
.tool-card-text { display: grid; gap: 2px; min-width: 0 }
.tool-card-text b { font: 800 17px/1.1 var(--disp); letter-spacing: -.02em }
.tool-card-text small { font-size: 13.5px; color: var(--muted) }
.tool-card.is-featured { grid-column: 1 / -1; border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--sb) }
.tool-card.is-featured .tool-card-icon { background: var(--sb-soft) }
.tool-card-badge { display: inline-block; vertical-align: 2px; margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: var(--ink); color: #fff; font: 700 11px/1.5 var(--sans); letter-spacing: .04em; text-transform: uppercase }
.hub-hero h1 { max-width: 18ch }

/* Bongkar PDF result */
.decompose-preview { display: block; width: 100%; max-width: 420px; margin: 0 auto; border-radius: 10px; border: 1px solid var(--line); background: #fff }
.decompose-stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none }
.decompose-stats li { padding: 4px 10px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line-soft); font-size: 13px; font-weight: 600 }
.gate { display: grid; gap: 10px; padding: 14px; border-radius: var(--radius-ctl); border: 2px solid var(--ink); background: var(--sb-soft) }
.gate p { margin: 0 }
.shared-files { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius-sheet); padding: 16px }

/* Placer (signature / edit) */
.placer { display: grid; gap: 12px }
.placer-stage { position: relative; margin: 0 auto; touch-action: pan-y; background: #fff; box-shadow: 0 1px 4px rgba(16, 21, 50, .2); max-width: 100% }
.placer-stage canvas { display: block; width: 100%; height: auto }
.placer-obj { position: absolute; border: 1.5px dashed transparent; touch-action: none; cursor: move }
.placer-obj.is-active { border-color: #121418 }
.placer-obj img { width: 100%; height: 100%; pointer-events: none; display: block }
.placer-obj .txt { width: 100%; height: 100%; white-space: pre; overflow: hidden; line-height: 1.2; outline: none; cursor: text }
.placer-handle { position: absolute; right: -14px; bottom: -14px; width: 28px; height: 28px; border-radius: 50%; background: #121418; border: 3px solid #fff; touch-action: none; cursor: nwse-resize; display: none }
.placer-del { position: absolute; right: -14px; top: -14px; width: 28px; height: 28px; border-radius: 50%; background: var(--err); color: #fff; border: 3px solid #fff; font-size: 13px; line-height: 1; display: none; cursor: pointer }
.placer-obj.is-active .placer-handle, .placer-obj.is-active .placer-del { display: block }
.placer-nav { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 14px; font-weight: 600 }
.toolbar { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin }
.toolbar button { flex: none }
.sig-pad { width: 100%; height: 180px; border: 1px dashed var(--line); border-radius: 12px; background: #fff; touch-action: none; display: block }
.sig-saved { display: flex; gap: 8px; flex-wrap: wrap }
.sig-saved button { position: relative; width: 120px; height: 56px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; padding: 4px }
.sig-saved img { max-width: 100%; max-height: 100%; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px }
.compare figure { margin: 0; display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); text-align: center }
.compare img { width: 100%; border-radius: 8px; border: 1px solid var(--line-soft); background: var(--paper) }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 22px 0 calc(28px + env(safe-area-inset-bottom)); font-size: 13.5px; color: var(--muted) }
.foot { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between }
.foot nav { display: flex; gap: 16px }
.foot a { text-decoration: none }
.foot a:hover { color: var(--ink) }

/* Hub: the Studio Desain band */
.studio-band { display: grid; gap: 16px; align-items: center; margin: 0 0 34px; padding: 22px; border-radius: var(--radius-sheet); background: var(--ink); color: #fff }
.studio-band .label { color: #A9AEB8 }
.studio-band h2 { color: #fff; margin: 6px 0 8px; max-width: 22ch }
.studio-band p { margin: 0; color: #D5D8DD; max-width: 58ch }
.studio-band .btn { justify-self: start }
@media (min-width: 760px) { .studio-band { grid-template-columns: minmax(0, 1fr) auto; padding: 28px 32px } }

/* phones: keep the account button on screen (the landing hides this label too) */
@media (max-width: 560px) { .brand small { display: none } }
