/* Scissor PDF. Restrained, typographic, one accent colour. */

:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #f5f5f7;
  --fill: #e8e8ed;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #86868b;
  --line: #d2d2d7;
  --hair: rgba(0, 0, 0, 0.08);
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --link: #0066cc;
  --accent-soft: rgba(0, 113, 227, 0.1);
  --danger: #e30000;
  --ok: #008009;
  --paper-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08);
  --lift: 0 0 0 0.5px rgba(0, 0, 0, 0.1), 0 18px 40px rgba(0, 0, 0, 0.18);
  --nav: rgba(255, 255, 255, 0.8);
  --radius: 18px;
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', system-ui, Roboto, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-alt: #161617;
    --surface: #1d1d1f;
    --surface-2: #2c2c2e;
    --fill: #3a3a3c;
    --text: #f5f5f7;
    --text-2: #a1a1a6;
    --text-3: #86868b;
    --line: #424245;
    --hair: rgba(255, 255, 255, 0.12);
    --accent: #0071e3;
    --accent-hover: #0077ed;
    --link: #2997ff;
    --accent-soft: rgba(41, 151, 255, 0.18);
    --danger: #ff453a;
    --ok: #30d158;
    --paper-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.1), 0 1px 3px rgba(0, 0, 0, 0.6);
    --lift: 0 0 0 0.5px rgba(255, 255, 255, 0.12), 0 18px 40px rgba(0, 0, 0, 0.7);
    --nav: rgba(22, 22, 23, 0.8);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.47059 var(--font); letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
img, svg, canvas { display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; letter-spacing: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(980px, 100% - 44px); margin-inline: auto; }
.section { padding: 100px 0; }
.section.alt { background: var(--bg-alt); }
.section.dark { background: #000; color: #f5f5f7; }
.eyebrow { font-size: 21px; font-weight: 600; letter-spacing: 0.011em; margin: 0 0 6px; color: var(--text); }
.headline { font-family: var(--display); font-size: clamp(32px, 5vw, 48px); line-height: 1.08; font-weight: 600; letter-spacing: -0.003em; margin: 0 0 20px; }
.more { font-size: 19px; color: var(--link); }
.more::after { content: ' ›'; }
[dir='rtl'] .more::after { content: ' ‹'; }

/* Navigation */
.nav { position: sticky; top: 0; z-index: 50; background: var(--nav); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); }
.nav .wrap { display: flex; align-items: center; gap: 28px; height: 48px; }
.brand { display: flex; align-items: center; gap: 7px; color: var(--text); font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand svg { width: 18px; height: 18px; }
.nav-links { margin-inline-start: auto; display: flex; align-items: center; gap: 28px; font-size: 12px; letter-spacing: -0.01em; }
.nav-links a { color: var(--text); opacity: 0.8; }
.nav-links a:hover { opacity: 1; text-decoration: none; }
.lang-link { display: inline-flex; align-items: center; gap: 5px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 8px 18px; border: 0; border-radius: 980px;
  background: var(--fill); color: var(--text); font-size: 15px; font-weight: 400; cursor: pointer;
  transition: background 0.2s; -webkit-tap-highlight-color: transparent; white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.big { min-height: 48px; padding: 12px 26px; font-size: 17px; }
.btn.block { width: 100%; }
.btn.small { min-height: 30px; padding: 4px 12px; font-size: 14px; }
.btn[disabled] { opacity: 0.35; pointer-events: none; }
.btn-plain { background: none; border: 0; color: var(--link); cursor: pointer; padding: 4px 0; font-size: 14px; }
.btn-plain:hover { text-decoration: underline; }

/* Hero */
.hero { text-align: center; padding: 72px 0 0; }
.hero h1 { font-family: var(--display); font-size: clamp(40px, 7vw, 80px); line-height: 1.05; font-weight: 600; letter-spacing: -0.015em; margin: 0 0 14px; }
.hero h1 .soft { color: var(--text-3); }
.hero .lead { font-size: clamp(19px, 2.4vw, 24px); line-height: 1.34; color: var(--text-2); max-width: 720px; margin: 0 auto; letter-spacing: 0.009em; font-weight: 400; }
.hero-ctas { display: flex; justify-content: center; align-items: center; gap: 28px; margin: 32px 0 0; flex-wrap: wrap; }
.home-hero { padding-top: 96px; }
.hero-art { margin: 64px auto 0; max-width: 980px; }
.hero-art svg { width: 100%; height: auto; overflow: visible; }
.art-phone { display: none; }
@media (max-width: 640px) {
  .art-wide { display: none; }
  .art-phone { display: block; max-width: 340px; margin: 0 auto; }
}
.crumbs { font-size: 12px; color: var(--text-3); margin-bottom: 18px; }
.crumbs a { color: var(--text-3); }
.crumbs ol { list-style: none; display: flex; justify-content: center; gap: 6px; margin: 0; padding: 0; }
.crumbs li + li::before { content: '›'; margin-inline-end: 6px; }
[dir='rtl'] .crumbs li + li::before { content: '‹'; }

/* Hero illustration (theme aware) */
.a-window { fill: var(--surface); }
.a-stage { fill: var(--bg-alt); }
.a-page { fill: #fff; }
.a-ink { fill: #1d1d1f; opacity: 0.8; }
.a-text { fill: #c7c7cc; }
.a-photo { fill: url(#artPhoto); }
.a-line { stroke: var(--hair); fill: none; }
.a-label { fill: var(--text); font-family: var(--display); }
.a-muted { fill: var(--text-3); font-family: var(--font); }
.a-fill { fill: var(--fill); }
.a-seg { fill: var(--surface); }
.a-accent { fill: var(--accent); }
.a-ring { stroke: var(--accent); fill: none; }
.a-white { fill: #fff; font-family: var(--font); }
.a-panel { fill: var(--surface); }
.a-doc { fill: #1d1d1f; font-family: var(--display); letter-spacing: -0.01em; }
.a-docsoft { fill: #86868b; font-family: var(--font); }
.a-text2 { fill: #8e8e93; }
.a-row { fill: #f2f2f5; }
.a-axis { stroke: #d8d8de; stroke-width: 0.8; }
.a-slot { fill: none; stroke: var(--line); stroke-width: 1.2; stroke-dasharray: 5 4; }
.a-float { animation: float 5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.a-caret { animation: caret 1.6s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translate(0, 0) rotate(-4deg); } 50% { transform: translate(0, -6px) rotate(-3deg); } }
@keyframes caret { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.a-shadow { filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.14)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.06)); }
@media (prefers-color-scheme: dark) { .a-shadow { filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.8)); } .a-page { fill: #f5f5f7; } }

/* Tool icons (monochrome line icons) */
.glyph { color: var(--text); }
.chiclets { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 28px 12px; }
.chiclet { display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--text); text-align: center; font-size: 14px; font-weight: 500; line-height: 1.25; letter-spacing: -0.016em; }
.chiclet svg { width: 40px; height: 40px; stroke-width: 1.4; transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1); }
.chiclet:hover { text-decoration: none; color: var(--link); }
.chiclet:hover svg { transform: translateY(-2px); }
.tool-group + .tool-group { margin-top: 56px; }
.tool-group h3 { font-size: 21px; font-weight: 600; letter-spacing: 0.011em; margin: 0 0 28px; color: var(--text); }

/* Points (three columns, no boxes) */
.points { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 48px; }
.point svg { width: 32px; height: 32px; stroke-width: 1.5; margin-bottom: 16px; }
.point h3 { font-size: 21px; font-weight: 600; letter-spacing: 0.011em; margin: 0 0 8px; }
.point p { margin: 0; color: var(--text-2); }

/* Dark privacy statement */
.dark .headline { color: #f5f5f7; }
.statement { max-width: 760px; }
.statement p { font-size: 21px; line-height: 1.43; color: #86868b; margin: 0 0 20px; letter-spacing: 0.011em; }
.statement p strong { color: #f5f5f7; font-weight: 600; }
.statement a { color: #2997ff; }
.statement svg { width: 44px; height: 44px; color: #f5f5f7; margin-bottom: 28px; stroke-width: 1.4; }

/* Steps */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 40px; counter-reset: s; }
.steps li { counter-increment: s; border-top: 1px solid var(--line); padding-top: 18px; font-size: 17px; color: var(--text-2); }
.steps li::before { content: counter(s); display: block; font-family: var(--display); font-size: 40px; font-weight: 600; line-height: 1; color: var(--text); margin-bottom: 14px; }

/* Editorial copy */
.prose { max-width: 720px; }
.prose h2, .prose h3 { font-family: var(--font); font-size: 24px; line-height: 1.17; font-weight: 600; letter-spacing: 0.009em; margin: 48px 0 12px; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 14px; color: var(--text-2); }
.prose p strong { color: var(--text); font-weight: 600; }
.prose ul { color: var(--text-2); padding-inline-start: 20px; }
.split-copy { display: grid; grid-template-columns: 1fr 1.6fr; gap: 24px 64px; }
.split-copy h2 { font-size: 24px; line-height: 1.17; font-weight: 600; margin: 0; letter-spacing: 0.009em; }
.split-copy p { margin: 0; color: var(--text-2); }
.split-copy + .split-copy { margin-top: 48px; padding-top: 48px; border-top: 1px solid var(--line); }

/* FAQ */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 22px 40px 22px 0; font-weight: 600; font-size: 19px; position: relative; letter-spacing: 0.012em; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ''; position: absolute; right: 6px; top: 50%; width: 9px; height: 9px; border-right: 1.5px solid var(--text-2); border-bottom: 1.5px solid var(--text-2); transform: translateY(-70%) rotate(45deg); transition: transform 0.25s; }
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details p { margin: -6px 0 24px; color: var(--text-2); max-width: 760px; }
[dir='rtl'] .faq summary { padding: 22px 0 22px 40px; }
[dir='rtl'] .faq summary::after { right: auto; left: 6px; }

/* Comparison table */
.table-wrap { overflow-x: auto; }
.compare { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 640px; }
.compare th, .compare td { padding: 16px 12px; text-align: start; border-bottom: 1px solid var(--line); vertical-align: top; }
.compare thead th { font-size: 19px; font-weight: 600; border-bottom-color: var(--text); }
.compare tbody th { font-weight: 400; color: var(--text-2); width: 28%; }
.compare .us { font-weight: 600; }
.hint { font-size: 12px; color: var(--text-3); margin-top: 8px; }
.hint.error { color: var(--danger); }

/* Footer */
.footer { background: var(--bg-alt); color: var(--text-2); font-size: 12px; line-height: 1.33; letter-spacing: -0.01em; padding: 20px 0 32px; }
.footer-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 24px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.footer h2 { margin: 0 0 10px; color: var(--text); font-size: 12px; font-weight: 600; letter-spacing: -0.01em; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.footer a { color: var(--text-2); }
.footer a:hover { color: var(--text); }
.footer > .wrap > p { margin: 16px 0 0; }
.langs { padding: 20px 0; border-bottom: 1px solid var(--line); }
.langs h2 { display: flex; align-items: center; gap: 6px; }
.langs ul { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.langs a[aria-current] { color: var(--text); font-weight: 600; }
.lang-suggest { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; padding: 10px 16px; background: var(--bg-alt); font-size: 14px; text-align: center; }
.lang-suggest .icon-btn { width: 26px; height: 26px; box-shadow: none; background: none; }

/* ---------- Tool workspace ---------- */

.app { scroll-margin-top: 64px; max-width: 980px; margin: 48px auto 0; text-align: start; position: relative; }
.drop {
  position: relative; border-radius: var(--radius); background: var(--bg-alt);
  padding: 72px 24px; text-align: center; transition: background 0.2s, box-shadow 0.2s;
}
.drop.over, body.dragging .drop { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.drop .glyph svg { width: 56px; height: 56px; margin: 0 auto 24px; stroke-width: 1.2; color: var(--text-3); }
.drop p { margin: 14px 0 0; color: var(--text-3); font-size: 14px; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.assure { display: flex; justify-content: center; align-items: baseline; gap: 6px; color: var(--text-3); font-size: 12px; margin: 16px auto 0; max-width: 34em; text-align: center; line-height: 1.5; }
.assure svg { flex: none; transform: translateY(1px); }
.assure svg { width: 12px; height: 12px; }

.work { display: grid; grid-template-columns: 1fr 300px; border-radius: var(--radius); overflow: hidden; background: var(--bg-alt); min-height: 440px; }
.stage { padding: 24px; min-width: 0; }
.stage-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; color: var(--text-2); font-size: 14px; }
.stage-head .spacer { flex: 1; }
.panel { background: var(--surface); padding: 28px 24px; border-inline-start: 1px solid var(--hair); display: flex; flex-direction: column; }
.panel h2 { font-size: 24px; font-weight: 600; margin: 0 0 4px; letter-spacing: 0.009em; }
.panel .sub { color: var(--text-2); font-size: 14px; margin: 0 0 24px; line-height: 1.43; }
.panel > .btn.primary { margin-top: auto; }
.panel .fine { text-align: center; color: var(--text-3); font-size: 12px; margin: 12px 0 0; display: flex; gap: 5px; justify-content: center; align-items: center; }
.field { margin: 0 0 20px; }
.field > .label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; letter-spacing: -0.01em; }
.input { width: 100%; min-height: 40px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: 15px; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.seg { display: flex; background: var(--fill); border-radius: 9px; padding: 2px; gap: 2px; }
.seg button { flex: 1; min-height: 30px; border: 0; border-radius: 7px; background: none; cursor: pointer; font-size: 13px; color: var(--text); padding: 0 6px; }
.seg button[aria-pressed='true'] { background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.04); font-weight: 500; }
.choices { display: grid; gap: 8px; }
.choice { display: block; text-align: start; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface); cursor: pointer; }
.choice[aria-pressed='true'] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.choice b { display: block; font-weight: 600; font-size: 15px; }
.choice span { display: block; font-size: 13px; color: var(--text-2); }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; margin: 8px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.range { width: 100%; accent-color: var(--accent); }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.swatches { display: flex; gap: 12px; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 0; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15); }
.swatch[aria-pressed='true'] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.pos-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; width: 120px; aspect-ratio: 3 / 4; padding: 8px; border-radius: 6px; background: #fff; box-shadow: var(--paper-shadow); align-content: space-between; }
.pos-grid button { height: 18px; border-radius: 4px; border: 0; background: var(--fill); cursor: pointer; }
.pos-grid button[aria-pressed='true'] { background: var(--accent); }

/* Page and file thumbnails: paper on a grey desk */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 24px 16px; }
.card { position: relative; border-radius: 12px; padding: 8px; user-select: none; -webkit-user-select: none; touch-action: manipulation; transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s, background 0.2s; }
.card.sortable { cursor: grab; touch-action: none; }
.card.dragging { opacity: 0.2; }
.card.ghost { position: fixed; z-index: 100; pointer-events: none; transform: scale(1.04) rotate(2deg); transition: none; background: none; }
.card.ghost canvas, .card.ghost img { box-shadow: var(--lift); }
.thumb { aspect-ratio: 1; display: grid; place-items: center; position: relative; }
.thumb canvas, .thumb img { max-width: 100%; max-height: 100%; box-shadow: var(--paper-shadow); background: #fff; border-radius: 2px; transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s; }
.thumb img { object-fit: contain; }
.thumb .skeleton { width: 72%; height: 94%; border-radius: 2px; background: var(--surface); box-shadow: var(--paper-shadow); }
.card .meta { margin-top: 10px; font-size: 12px; color: var(--text-3); display: flex; justify-content: center; gap: 8px; }
.card .name { font-size: 12px; color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 10px; text-align: center; }
.card .num { color: var(--text-2); font-variant-numeric: tabular-nums; }
.card-actions { position: absolute; top: 4px; inset-inline-end: 4px; display: flex; gap: 4px; opacity: 0; transition: opacity 0.15s; }
.card:hover .card-actions, .card:focus-within .card-actions { opacity: 1; }
.icon-btn { width: 28px; height: 28px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; background: color-mix(in srgb, var(--surface) 90%, transparent); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2), 0 0 0 0.5px rgba(0, 0, 0, 0.08); backdrop-filter: blur(10px); }
.icon-btn:hover { background: var(--surface); }
.card.selectable { cursor: pointer; }
.card.selected { background: var(--accent-soft); }
.card.marked { background: color-mix(in srgb, var(--danger) 10%, transparent); }
.card.marked canvas { opacity: 0.35; }
.card.marked .num, .card.marked .state { color: var(--danger); }
.tick { position: absolute; top: 14px; inset-inline-start: 14px; z-index: 1; width: 22px; height: 22px; border-radius: 50%; background: rgba(255, 255, 255, 0.9); box-shadow: inset 0 0 0 1.5px var(--line); display: grid; place-items: center; color: transparent; }
.card.selected .tick { background: var(--accent); box-shadow: none; color: #fff; }
.card.marked .tick { background: var(--danger); box-shadow: none; color: #fff; }
.badge { position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 600; color: #fff; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.add-card { display: grid; place-items: center; align-content: center; gap: 8px; min-height: 150px; border: 1.5px dashed var(--line); border-radius: 12px; color: var(--text-2); cursor: pointer; background: none; font-size: 13px; }
.add-card:hover { border-color: var(--accent); color: var(--link); }

.single { display: grid; grid-template-columns: minmax(0, 240px) 1fr; gap: 32px; align-items: center; min-height: 380px; }
.single .thumb { aspect-ratio: 3 / 4; }
.single .preview-wrap { position: relative; display: grid; place-items: center; }
.single h3 { margin: 0 0 4px; font-size: 21px; font-weight: 600; word-break: break-word; }
.single p { margin: 0; color: var(--text-2); font-size: 15px; }
.overlay-preview { position: absolute; pointer-events: none; }

/* Busy, errors, result */
.busy { position: absolute; inset: 0; z-index: 5; border-radius: var(--radius); background: color-mix(in srgb, var(--bg-alt) 80%, transparent); backdrop-filter: blur(8px); display: grid; place-items: center; text-align: center; font-weight: 600; font-size: 17px; }
.spinner { width: 32px; height: 32px; margin: 0 auto 16px; border-radius: 50%; border: 3px solid var(--fill); border-top-color: var(--text-2); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.busy small { display: block; font-weight: 400; font-size: 13px; color: var(--text-2); margin-top: 4px; }
.alert { border-radius: 12px; padding: 12px 16px; background: color-mix(in srgb, var(--danger) 8%, var(--bg)); margin: 0 0 16px; font-size: 15px; display: flex; gap: 10px; align-items: flex-start; }
.alert b { color: var(--danger); }
.done { background: var(--bg-alt); border-radius: var(--radius); padding: 64px 24px; text-align: center; }
.done h2 { font-family: var(--display); font-size: clamp(32px, 4.5vw, 48px); line-height: 1.08; font-weight: 600; margin: 20px 0 8px; }
.done .file { color: var(--text-2); margin: 0; word-break: break-word; }
.done .saving { display: block; font-family: var(--display); font-weight: 600; color: var(--text); margin: 16px 0 0; font-size: 21px; background: none; }
.done .actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 32px; }
.check-anim { width: 64px; height: 64px; margin: 0 auto; }
.check-anim circle { stroke: var(--ok); stroke-dasharray: 260; stroke-dashoffset: 260; animation: draw 0.6s ease-out forwards; }
.check-anim path { stroke: var(--ok); stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw 0.35s 0.45s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.next { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--line); }
.next h3 { font-size: 12px; font-weight: 600; color: var(--text-3); margin: 0 0 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 99px; background: var(--surface); color: var(--text); border: 0; cursor: pointer; font-size: 14px; box-shadow: 0 0 0 1px var(--hair); }
.chip:hover { box-shadow: 0 0 0 1px var(--accent); }
.chip .tool-icon { display: grid; color: var(--text-2); background: none !important; box-shadow: none !important; }

/* Whole-window drop target */
.drop-veil { position: fixed; inset: 0; z-index: 200; display: none; place-items: center; background: color-mix(in srgb, var(--accent) 10%, transparent); backdrop-filter: blur(3px); font-size: 28px; font-weight: 600; pointer-events: none; }
body.dragging .drop-veil { display: grid; }

/* Mobile action bar */
.mobile-bar { display: none; }

/* Scripts with their own rhythm */
[dir='rtl'] body, :lang(ja), :lang(ko), :lang(zh-Hans), :lang(hi) { letter-spacing: 0; }
[dir='rtl'] .hero h1, [dir='rtl'] .headline { letter-spacing: 0; }
:lang(ja) .hero h1, :lang(zh-Hans) .hero h1, :lang(ko) .hero h1 { line-height: 1.15; letter-spacing: 0; }

@media (max-width: 860px) {
  .section { padding: 72px 0; }
  .work { grid-template-columns: 1fr; }
  .panel { border-inline-start: 0; border-top: 1px solid var(--hair); }
  .single { grid-template-columns: 1fr; min-height: 0; text-align: center; }
  .single .thumb { max-width: 220px; margin: 0 auto; }
  .stage { padding: 16px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 16px 8px; }
  .card-actions { position: static; opacity: 1; justify-content: center; margin-top: 8px; gap: 6px; }
  .card-actions .icon-btn { box-shadow: 0 0 0 0.5px var(--hair); background: var(--surface); }
  .split-copy { grid-template-columns: 1fr; }
  .mobile-bar {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: var(--nav); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--hair); transition: transform 0.25s;
  }
  .mobile-bar.away { transform: translateY(110%); }
  .mobile-bar .btn { width: 100%; }
  body.has-bar .footer { padding-bottom: 100px; }
  .busy { position: fixed; z-index: 70; border-radius: 0; }
}
@media (max-width: 640px) {
  .nav-links { gap: 18px; }
  .nav-links a.opt, .lang-link span { display: none; }
  .hero { padding-top: 48px; }
  .home-hero { padding-top: 56px; }
  .hero-art { margin-top: 40px; }
  .drop { padding: 48px 20px; }
  .chiclets { grid-template-columns: repeat(3, 1fr); gap: 24px 8px; }
  .chiclet { font-size: 12px; }
  .chiclet svg { width: 34px; height: 34px; }
}
.touch .drop .drop-hint { display: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .check-anim circle, .check-anim path { stroke-dashoffset: 0; }
}
.tool-hero, .home-hero { padding-bottom: 100px; }
@media (max-width: 860px) { .tool-hero, .home-hero { padding-bottom: 72px; } }
@media (max-width: 640px) {
  .section { padding: 56px 0; }
  .tool-hero, .home-hero { padding-bottom: 56px; }
  .headline { margin-bottom: 16px; }
  .points { gap: 28px; }
  .point { display: grid; grid-template-columns: 32px 1fr; column-gap: 16px; }
  .point svg { grid-row: span 2; margin: 2px 0 0; width: 28px; height: 28px; }
  .point h3 { font-size: 19px; margin-bottom: 4px; }
  .point p { font-size: 15px; }
  .statement p { font-size: 19px; }
  .tool-group + .tool-group { margin-top: 40px; }
  .tool-group h3 { font-size: 19px; margin-bottom: 20px; }
  .steps { gap: 24px; }
  .steps li::before { font-size: 32px; margin-bottom: 8px; }
  .split-copy + .split-copy { margin-top: 32px; padding-top: 32px; }
  .faq summary { font-size: 17px; padding: 18px 36px 18px 0; }
  .hero-ctas { gap: 20px; margin-top: 24px; }
}
@media (max-width: 640px) {
  .hero .lead { font-size: 17px; line-height: 1.47; }
  .hero h1 { margin-bottom: 12px; }
  .app { margin-top: 32px; }
  .drop .glyph svg { width: 44px; height: 44px; margin-bottom: 20px; }
  .done { padding: 48px 20px; }
  .done .actions .btn { flex: 1 1 100%; }
}
.done .actions { flex-direction: column; align-items: center; gap: 16px; }
.start-over { font-size: 17px; }
/* A lone remove button (file cards) stays a small corner badge, even on phones. */
.card-actions:has(> :only-child) { position: absolute; top: 2px; inset-inline-end: 2px; margin: 0; opacity: 1; }
.card-actions:has(> :only-child) .icon-btn { width: 24px; height: 24px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); }
@media (max-width: 640px) { .done .actions .btn { width: 100%; } }

/* ---------- Sign / add text editor ---------- */
.sheets { display: grid; gap: 24px; max-width: 640px; margin: 0 auto; }
.sheet { position: relative; width: 100%; background: #fff; box-shadow: var(--paper-shadow); border-radius: 2px; touch-action: pan-y; }
.sheet-canvas canvas { width: 100%; height: auto; display: block; border-radius: 2px; }
.placed { position: absolute; cursor: grab; touch-action: none; border-radius: 4px; outline: 1px dashed transparent; outline-offset: 4px; }
.placed.active { outline-color: var(--accent); }
.placed-image img { width: 100%; height: auto; display: block; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.placed-text .placed-body { font-family: var(--font); letter-spacing: 0; line-height: 1.25; padding: 2px 4px; white-space: pre; outline: none; cursor: text; min-width: 1ch; }
.placed-del, .placed-size { position: absolute; display: none; }
.placed.active .placed-del, .placed.active .placed-size { display: grid; }
.placed-del { top: -14px; inset-inline-end: -14px; width: 24px; height: 24px; border-radius: 50%; border: 0; place-items: center; background: var(--text); color: var(--bg); cursor: pointer; }
.placed-size { right: -9px; bottom: -9px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px #fff; cursor: nwse-resize; }
.sig-tile { background: #fff; border-radius: 10px; box-shadow: var(--paper-shadow); padding: 14px; margin-bottom: 12px; display: grid; place-items: center; }
.sig-tile img { max-width: 100%; max-height: 72px; }
.secondary-action { display: block; margin: 12px auto 0; }

.sig-dialog { border: 0; border-radius: 22px; padding: 28px; width: min(560px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35); }
.sig-dialog::backdrop { background: rgba(0, 0, 0, 0.35); backdrop-filter: blur(4px); }
.sig-dialog h2 { font-size: 24px; font-weight: 600; margin: 0 0 18px; }
.sig-tabs { margin-bottom: 18px; }
.sig-pad-wrap { position: relative; background: #fff; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); }
.sig-pad { width: 100%; height: 200px; display: block; cursor: crosshair; }
.sig-line { position: absolute; left: 24px; right: 24px; bottom: 44px; border-bottom: 1px solid #c7c7cc; color: #aeaeb2; font-size: 13px; padding-bottom: 6px; pointer-events: none; transition: opacity 0.3s; }
.sig-line.used { opacity: 0.25; }
.sig-name { margin-bottom: 14px; }
.sig-fonts { display: grid; gap: 8px; }
.sig-font { background: #fff; border: 0; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); padding: 10px 16px; font-size: 34px; text-align: start; cursor: pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sig-font[aria-pressed='true'] { box-shadow: inset 0 0 0 2px var(--accent); }
.sig-upload-preview { margin-top: 12px; background: repeating-conic-gradient(#f2f2f5 0 25%, #fff 0 50%) 0 0 / 16px 16px; border-radius: 12px; display: grid; place-items: center; min-height: 40px; }
.sig-upload-preview canvas { max-width: 100%; max-height: 180px; }
.sig-foot { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.sig-foot .spacer { flex: 1; }
.sig-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
@media (max-width: 640px) {
  .sig-dialog { padding: 22px 18px; border-radius: 18px; }
  .sig-actions .btn { flex: 1; }
}

/* ---------- Crop frame ---------- */
.crop-frame { position: absolute; overflow: hidden; touch-action: none; }
.crop-box { position: absolute; box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45); outline: 1.5px solid #fff; }
.crop-box i { position: absolute; background: #fff; border-radius: 3px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35); }
.crop-box i[data-e='0'], .crop-box i[data-e='2'] { top: 50%; width: 6px; height: 36px; margin-top: -18px; cursor: ew-resize; }
.crop-box i[data-e='0'] { left: -3px; }
.crop-box i[data-e='2'] { right: -3px; }
.crop-box i[data-e='1'], .crop-box i[data-e='3'] { left: 50%; height: 6px; width: 36px; margin-left: -18px; cursor: ns-resize; }
.crop-box i[data-e='1'] { top: -3px; }
.crop-box i[data-e='3'] { bottom: -3px; }
.crop-box i::after { content: ''; position: absolute; inset: -14px; }
.crop-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }

/* ---------- Metadata ---------- */
.meta-extra dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; }
.meta-extra dt { color: var(--text-3); }
.meta-extra dd { margin: 0; color: var(--text-2); word-break: break-word; }
.single-large { grid-template-columns: 1fr; text-align: center; gap: 20px; }
.single-large .thumb { aspect-ratio: auto; max-width: 560px; width: 100%; margin: 0 auto; }
.single-large .thumb canvas { max-height: 62vh; width: auto; }

/* ---------- Newer tools ---------- */
.slot-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.slot-row .input { min-width: 0; padding: 8px; font-size: 13px; }
.text-preview { text-align: start; background: var(--surface); border-radius: 12px; padding: 16px; max-height: 260px; overflow: auto; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; margin: 20px auto 0; max-width: 720px; box-shadow: var(--paper-shadow); }
.info-table { margin-top: 28px; background: var(--surface); border-radius: 14px; padding: 20px 22px; box-shadow: var(--paper-shadow); }
.info-table dl { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: 8px 20px; margin: 0; font-size: 14px; }
.info-table dt { color: var(--text-3); }
.info-table dd { margin: 0; word-break: break-word; }
.info-table h4 { font-size: 13px; margin: 20px 0 8px; color: var(--text-2); }
.info-table ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 14px; }
.info-table li span { color: var(--text-3); font-size: 12px; margin-inline-start: 6px; }
.compare-result .diff { text-align: start; max-width: 760px; margin: 24px auto 0; display: grid; gap: 16px; }
.compare-result section { background: var(--surface); border-radius: 12px; padding: 16px 18px; box-shadow: var(--paper-shadow); }
.compare-result h3 { font-size: 13px; color: var(--text-3); margin: 0 0 8px; }
.compare-result p { margin: 0; font-size: 15px; line-height: 1.6; }
.compare-result del { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); text-decoration: line-through; border-radius: 3px; padding: 0 2px; }
.compare-result ins { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); text-decoration: none; border-radius: 3px; padding: 0 2px; }
.placed-box .placed-body { width: 100%; height: 100%; border-radius: 1px; }
.form-sheet { overflow: hidden; }
.form-sheet .annotationLayer { position: absolute; inset: 0; }
/* Overlapping icon shapes are filled with whatever they sit on. */
:root { --icon-bg: var(--bg); }
.section.alt, .drop, .work, .done { --icon-bg: var(--bg-alt); }
.chip, .panel { --icon-bg: var(--surface); }

/* ---------- PDF Studio ---------- */
.studio-hero { padding-bottom: 40px; }
.studio-wrap { width: min(1240px, 100% - 32px); margin: 0 auto 80px; }
.studio-window { position: relative; border-radius: 22px; overflow: hidden; background: var(--bg-alt); box-shadow: 0 0 0 1px var(--hair), 0 30px 80px rgba(0, 0, 0, 0.12); min-height: 640px; display: flex; flex-direction: column; }
.studio-bar { display: flex; align-items: center; gap: 10px; padding: 14px 20px; background: var(--surface); border-bottom: 1px solid var(--hair); }
.studio-bar .spacer { flex: 1; }
.studio-file { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.studio-file b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.studio-file span { font-size: 13px; color: var(--text-3); white-space: nowrap; }
.studio-bar .icon-btn { box-shadow: none; background: var(--fill); }
.studio-bar .icon-btn[disabled] { opacity: 0.35; }
.studio-body { flex: 1; display: flex; flex-direction: column; }
.studio-body > * { flex: 1; }
.studio-empty { padding: 56px 40px 48px; }
.studio-open-box { text-align: center; margin-bottom: 48px; }
.studio-open-box .glyph svg { margin: 0 auto 20px; color: var(--text-3); }
.studio-open-box .hint { font-size: 13px; margin-top: 12px; }
.studio-group + .studio-group { margin-top: 28px; }
.studio-group h3 { font-size: 13px; font-weight: 600; color: var(--text-2); margin: 0 0 12px; }
.studio-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.studio-action { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px 12px; border: 0; border-radius: 14px; background: var(--surface); color: var(--text); cursor: pointer; font-size: 12.5px; line-height: 1.25; text-align: center; box-shadow: 0 0 0 0.5px var(--hair); transition: transform 0.15s, box-shadow 0.15s; --icon-bg: var(--surface); }
.studio-action:hover { box-shadow: 0 0 0 1.5px var(--accent); }
.studio-action:active { transform: scale(0.97); }
.studio-action svg { width: 30px; height: 30px; }
.studio-actions.compact { grid-template-columns: repeat(3, 1fr); gap: 6px; }
.studio-actions.compact .studio-action { padding: 10px 4px 8px; font-size: 11px; box-shadow: none; background: var(--bg-alt); --icon-bg: var(--bg-alt); }
.studio-actions.compact .studio-action:hover { background: var(--accent-soft); }
.studio-actions.compact svg { width: 26px; height: 26px; }
.studio-work { border-radius: 0; min-height: 600px; grid-template-columns: 1fr 340px; }
.studio-work .panel { max-height: 760px; overflow-y: auto; }
.studio-work .panel h2 { margin-bottom: 4px; }
.studio-app { margin: 0; max-width: none; }
.studio-app .work { border-radius: 0; min-height: 600px; }
.studio-app .done, .studio-app .alert { margin: 20px; }
.studio-app .stage-head .btn-plain, .studio-app .single .btn-plain { display: none; }
.studio-back { display: block; margin: -6px 0 12px; font-size: 14px; }
.studio-toast { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; gap: 14px; align-items: center; background: var(--text); color: var(--bg); padding: 10px 12px 10px 18px; border-radius: 99px; font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); z-index: 20; max-width: calc(100% - 32px); }
@media (max-width: 860px) {
  .studio-wrap { width: 100%; margin-bottom: 40px; }
  .studio-window { border-radius: 0; min-height: 0; }
  .studio-empty { padding: 32px 16px; }
  .studio-actions { grid-template-columns: repeat(3, 1fr); }
  .studio-work { grid-template-columns: 1fr; }
  .studio-work .panel { max-height: none; }
  .studio-file b { max-width: 34vw; }
}

/* ---------- Full-page app (/app/) ---------- */
body.app-mode { height: 100dvh; overflow: hidden; background: var(--bg-alt); }
body.app-mode main { height: 100dvh; }
.app-mode .studio { height: 100%; }
.app-mode .studio-window { height: 100%; min-height: 0; border-radius: 0; box-shadow: none; }
.studio-bar { padding-top: max(14px, env(safe-area-inset-top)); }
.studio-brand { display: flex; align-items: center; gap: 7px; color: var(--text); font-weight: 600; font-size: 15px; white-space: nowrap; padding-inline-end: 14px; margin-inline-end: 4px; border-inline-end: 1px solid var(--hair); }
.studio-brand:hover { text-decoration: none; }
.studio-main { flex: 1; display: flex; min-height: 0; }
.studio-body { flex: 1; min-width: 0; overflow: auto; }
.app-mode .studio-body { overflow: hidden; display: flex; }
.app-mode .studio-empty { overflow: auto; }
.app-mode .studio-work { min-height: 0; height: 100%; }
.app-mode .studio-work .stage, .app-mode .studio-work .panel { overflow: auto; max-height: none; }
.app-mode .studio-app { height: 100%; overflow: auto; }
.app-mode .studio-app .work { min-height: 100%; }
.studio-files { width: 240px; flex: none; overflow: auto; background: var(--surface); border-inline-end: 1px solid var(--hair); padding: 14px 10px; }
.studio-files h3 { font-size: 12px; font-weight: 600; color: var(--text-2); margin: 4px 8px 10px; display: flex; justify-content: space-between; }
.studio-files h3 span { color: var(--text-3); font-weight: 400; }
.studio-file-item { display: flex; align-items: center; gap: 4px; border-radius: 10px; padding-inline-end: 4px; }
.studio-file-item.active { background: var(--accent-soft); }
.studio-file-item .icon-btn { width: 24px; height: 24px; box-shadow: none; background: none; opacity: 0; flex: none; }
.studio-file-item:hover .icon-btn, .studio-file-item.active .icon-btn { opacity: 0.7; }
.studio-file-pick { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 8px; text-align: start; cursor: pointer; color: var(--text); }
.studio-file-pick .thumb { width: 34px; height: 44px; aspect-ratio: auto; flex: none; }
.studio-file-pick .thumb canvas { box-shadow: var(--paper-shadow); }
.studio-file-text { min-width: 0; display: grid; }
.studio-file-text b { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.studio-file-text small { font-size: 11px; color: var(--text-3); }
.studio-menu { position: relative; }
.studio-menu-list { position: absolute; top: calc(100% + 6px); inset-inline-end: 0; z-index: 30; background: var(--surface); border-radius: 12px; box-shadow: 0 0 0 0.5px var(--hair), 0 12px 32px rgba(0, 0, 0, 0.18); padding: 6px; min-width: 170px; display: grid; }
.studio-menu-list[hidden] { display: none; }
.studio-menu-list button { background: none; border: 0; text-align: start; padding: 9px 12px; border-radius: 8px; font-size: 14px; cursor: pointer; color: var(--text); }
.studio-menu-list button:hover { background: var(--accent); color: #fff; }
.studio-open-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
@media (max-width: 860px) {
  .studio-main { flex-direction: column; }
  .studio-files { width: auto; display: flex; gap: 6px; overflow-x: auto; padding: 8px 10px; border-inline-end: 0; border-bottom: 1px solid var(--hair); }
  .studio-files h3 { display: none; }
  .studio-file-item { flex: none; max-width: 200px; }
  .studio-brand span, .studio-file span { display: none; }
  .studio-bar { gap: 6px; padding-inline: 12px; }
  .app-mode .studio-work { height: auto; }
  .app-mode .studio-body { overflow: auto; display: block; }
}

/* ---------- App, Apple-style shell ---------- */
.app-mode .studio-window { background: var(--bg-alt); font-size: 13px; letter-spacing: -0.01em; }
.app-mode .studio-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 52px; padding: 0 12px; padding-top: env(safe-area-inset-top); background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px); border-bottom: 1px solid var(--hair); gap: 12px; }
.bar-left, .bar-right { display: flex; align-items: center; gap: 6px; min-width: 0; }
.bar-right { justify-content: flex-end; }
.bar-title { display: flex; flex-direction: column; align-items: center; line-height: 1.2; min-width: 0; max-width: 46vw; }
.bar-title b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bar-title span { font-size: 11px; color: var(--text-3); }
.app-mode .studio-brand { border: 0; padding: 0 6px; margin: 0; color: var(--text); }
.tb-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; min-width: 32px; padding: 0 8px; justify-content: center; border: 0; border-radius: 7px; background: none; color: var(--text-2); font-size: 13px; cursor: pointer; white-space: nowrap; }
.tb-btn:hover { background: var(--fill); color: var(--text); text-decoration: none; }
.tb-btn[disabled] { opacity: 0.3; pointer-events: none; }
.tb-btn.primary { background: var(--accent); color: #fff; padding: 0 12px; }
.tb-btn.primary:hover { background: var(--accent-hover); }
.tb-group { display: flex; }
.app-mode .studio-menu-list { top: calc(100% + 4px); min-width: 180px; padding: 5px; border-radius: 10px; }
.app-mode .studio-menu-list button { font-size: 13px; padding: 6px 10px; border-radius: 6px; }

.app-mode .studio-main { display: flex; flex: 1; min-height: 0; }
.app-mode .studio-files { width: 0; padding: 0; overflow: hidden; transition: width 0.25s cubic-bezier(0.2, 0.8, 0.2, 1); background: color-mix(in srgb, var(--surface) 70%, transparent); backdrop-filter: blur(20px); border-inline-end: 1px solid var(--hair); }
.app-mode .sidebar-open .studio-files:not([hidden]) { width: 220px; padding: 12px 8px; overflow: auto; }
.app-mode .studio-files[hidden] { display: block !important; width: 0; border: 0; }
.app-mode .studio-files h3 { font-size: 11px; font-weight: 600; color: var(--text-3); margin: 6px 10px 6px; text-transform: none; }
.app-mode .studio-file-item { border-radius: 8px; }
.app-mode .studio-file-item.active { background: color-mix(in srgb, var(--text) 10%, transparent); }
.app-mode .studio-file-pick { padding: 6px 8px; gap: 10px; }
.app-mode .studio-file-pick .thumb { width: 28px; height: 36px; }
.app-mode .studio-file-text b { font-size: 13px; font-weight: 400; }

.app-mode .studio-body { display: flex; flex: 1; min-width: 0; overflow: hidden; }
.studio-canvas { flex: 1; min-width: 0; overflow: auto; padding: 32px; }
.studio-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 32px 28px; max-width: 1100px; margin: 0 auto; }
.studio-page { margin: 0; text-align: center; }
.studio-page .thumb { aspect-ratio: 0.77; }
.studio-page figcaption { margin-top: 10px; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.studio-welcome { height: 100%; min-height: 420px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.studio-welcome img { border-radius: 20px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15); margin-bottom: 18px; }
.studio-welcome h2 { font-family: var(--display); font-size: 28px; font-weight: 600; margin: 0 0 6px; letter-spacing: -0.01em; }
.studio-welcome > p { font-size: 15px; color: var(--text-2); margin: 0 0 22px; }
.studio-welcome .hint { margin-top: 14px; font-size: 12px; }
.studio-welcome .btn { font-size: 14px; min-height: 34px; padding: 6px 18px; }

.inspector { width: 290px; flex: none; overflow: auto; background: var(--surface); border-inline-start: 1px solid var(--hair); padding: 12px 10px 24px; --icon-bg: var(--surface); }
.tools-search { position: sticky; top: -12px; z-index: 1; display: flex; align-items: center; gap: 6px; background: var(--fill); border-radius: 8px; padding: 0 8px; margin: 0 2px 10px; color: var(--text-3); box-shadow: 0 -12px 0 var(--surface); }
.tools-search input { flex: 1; min-width: 0; border: 0; background: none; height: 30px; font-size: 13px; outline: none; color: var(--text); }
.tools-list section { margin-bottom: 14px; }
.tools-list h4 { font-size: 11px; font-weight: 600; color: var(--text-3); margin: 8px 10px 4px; }
.tool-row { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 8px 0 10px; border: 0; border-radius: 7px; background: none; color: var(--text); font-size: 13px; text-align: start; cursor: pointer; }
.tool-row svg:first-child { width: 20px; height: 20px; flex: none; color: var(--text-2); stroke-width: 1.7; }
.tool-row span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tool-row > svg:last-child { color: var(--text-3); opacity: 0; transition: opacity 0.15s; }
.tool-row:hover { background: var(--fill); }
.tool-row:hover > svg:last-child { opacity: 1; }
.tool-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* A tool running inside the app: its stage is the canvas, its panel the inspector. */
.app-mode .studio-app { flex: 1; height: 100%; overflow: hidden; display: flex; }
.app-mode .studio-app > .work { flex: 1; display: grid; grid-template-columns: 1fr 290px; border-radius: 0; min-height: 0; background: var(--bg-alt); }
.app-mode .studio-app .stage { overflow: auto; padding: 28px; }
.app-mode .studio-app .panel { overflow: auto; border-inline-start: 1px solid var(--hair); padding: 16px 16px 24px; font-size: 13px; }
.app-mode .studio-app .panel h2 { font-size: 17px; }
.app-mode .studio-app .panel .sub { font-size: 12px; margin-bottom: 16px; }
.app-mode .studio-app .panel .btn.big { min-height: 36px; font-size: 14px; padding: 6px 16px; }
.app-mode .studio-app .done { margin: auto; max-width: 560px; }
.studio-back { color: var(--link); font-size: 13px; margin: 0 0 10px; }

.studio-tabbar, .studio-sheet, .studio-sheet-backdrop { display: none; }
.app-mode .studio-toast { bottom: 24px; }

@media (max-width: 760px) {
  .app-mode .studio-bar { grid-template-columns: auto 1fr auto; height: 48px; }
  .app-mode .bar-right .tb-group, .app-mode .studio-menu, .app-mode .studio-download, .app-mode .studio-download-all { display: none !important; }
  .bar-title { max-width: none; align-items: flex-start; }
  .app-mode .studio-main { flex-direction: column; }
  .app-mode .sidebar-open .studio-files:not([hidden]), .app-mode .studio-files:not([hidden]) { width: auto; display: flex; gap: 4px; overflow-x: auto; padding: 6px 8px; border-inline-end: 0; border-bottom: 1px solid var(--hair); flex: none; }
  .app-mode .studio-files h3 { display: none; }
  .app-mode .studio-file-item { flex: none; max-width: 170px; }
  .app-mode .studio-body .inspector { display: none; }
  .studio-canvas { padding: 20px 16px 96px; }
  .studio-pages { grid-template-columns: repeat(2, 1fr); gap: 20px 16px; }
  .studio-tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; justify-content: space-around; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px); border-top: 1px solid var(--hair); }
  .studio-tabbar button { display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: 0; color: var(--accent); font-size: 10px; padding: 4px 16px; cursor: pointer; }
  .studio-tabbar button svg { width: 24px; height: 24px; }
  .studio-tabbar button[disabled] { color: var(--text-3); }
  .studio-sheet-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0.3); }
  .studio-sheet:not([hidden]) { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; max-height: 78dvh; overflow: auto; background: var(--surface); border-radius: 14px 14px 0 0; padding: 6px 12px calc(16px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2); animation: sheet-up 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); --icon-bg: var(--surface); }
  .sheet-grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--fill); margin: 4px auto 12px; }
  .studio-sheet .tool-row { height: 44px; font-size: 16px; }
  .studio-sheet .tools-search { top: -6px; }
  .studio-sheet .tools-search input { height: 36px; font-size: 16px; }
  .app-mode .studio-app > .work { grid-template-columns: 1fr; display: block; overflow: auto; }
  .app-mode .studio-app { overflow: auto; display: block; }
  .app-mode .studio-app .panel { border-inline-start: 0; border-top: 1px solid var(--hair); }
  body.app-mode.has-bar .studio-tabbar { display: none; }
}
@keyframes sheet-up { from { transform: translateY(100%); } }
.app-mode .studio-body { flex-direction: row; }
.app-mode .studio-body > .inspector { flex: none; }
.app-mode .studio-body > .studio-canvas { flex: 1; }
@media (max-width: 760px) { .app-mode .studio-body { flex-direction: column; } }
.gh-link { display: inline-flex; align-items: center; gap: 5px; }
.gh-link svg { width: 12px; height: 12px; }
.source-link a { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.welcome-source { margin-top: 28px; font-size: 12px; color: var(--text-3); }
.gh-nav { display: inline-flex; align-items: center; }
.gh-nav svg { width: 17px; height: 17px; }
.gh-cta { display: inline-flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 500; padding: 10px 18px; border-radius: 980px; background: rgba(255, 255, 255, 0.1); color: #f5f5f7 !important; }
.gh-cta:hover { background: rgba(255, 255, 255, 0.18); text-decoration: none; }
@media (max-width: 760px) { .app-mode .studio-sidebar-toggle { display: none !important; } }
