/* PDF Tools. Light "calm workspace" design: lavender-grey ground, white
   cards, violet primary, one solid colour per tool. */
:root {
  --bg: #f4f5fb;
  --surface: #ffffff;
  --surface-2: #f7f8fc;
  --surface-3: #eef0f7;
  --stage: #eceef8;
  --line: #e5e7f0;
  --line-2: #d5d8e6;
  --text: #17173a;
  --muted: #646a8a;
  --faint: #9599b3;
  --primary: #6646e8;
  --primary-2: #5536d6;
  --primary-soft: #efebfe;
  --primary-line: #d9d0fc;
  --teal: #14c3a6;
  --bad: #e5484d;
  --ok: #12a37d;
  --radius: 18px;
  --radius-lg: 26px;
  --shadow-sm: 0 1px 2px rgba(23, 23, 58, .04), 0 4px 14px -6px rgba(23, 23, 58, .08);
  --shadow: 0 2px 6px rgba(23, 23, 58, .04), 0 18px 44px -20px rgba(54, 40, 140, .22);
  --gutter: clamp(16px, 4vw, 40px);
  --c: var(--primary);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font: 16px/1.55 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--primary); }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
h1, h2, h3 { color: var(--text); }
.ic { display: inline-grid; place-items: center; width: 1.15em; height: 1.15em; flex: none; }
.ic svg { width: 100%; height: 100%; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
::selection { background: var(--primary-soft); }

/* ---------- frame ---------- */
header.top { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .86); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.top__in, main, footer.bottom { width: 100%; max-width: 1280px; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.top__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 1.16rem; letter-spacing: -.02em; }
.brand img { width: 34px; height: 34px; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { padding: 8px 14px; border-radius: 11px; color: var(--muted); text-decoration: none; font-size: .93rem; font-weight: 500; transition: color .15s, background .15s; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a[aria-current] { color: var(--primary); background: var(--primary-soft); font-weight: 600; }
.nav .nav__apps { margin-left: 6px; border: 1px solid var(--line); }
.nav .short { display: none; }
main { flex: 1; padding-top: 28px; padding-bottom: 56px; }
footer.bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 22px; padding-bottom: calc(26px + env(safe-area-inset-bottom)); color: var(--faint); font-size: .82rem; letter-spacing: .02em; }
footer.bottom a { color: var(--muted); text-decoration: none; }
footer.bottom a:hover { color: var(--text); }

.card-lg { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.page-head { margin: 4px 0 24px; }
.page-head h1 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); letter-spacing: -.03em; line-height: 1.1; margin: 0; }
.crumbs { margin: 8px 0 0; color: var(--faint); font-size: .92rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--primary); }
.pill { display: inline-flex; margin: 0 0 22px; padding: 7px 14px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

/* ---------- home: hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 24px 48px; align-items: center; padding: clamp(28px, 5vw, 60px) clamp(22px, 5vw, 64px) 30px; }
.hero h1 { margin: 0; font-size: clamp(2.3rem, 5.2vw, 3.9rem); line-height: 1.05; letter-spacing: -.04em; font-weight: 800; text-wrap: balance; }
.hero h1 .accent { color: var(--primary); }
.hero__lead { margin: 20px 0 0; color: var(--muted); font-size: clamp(1rem, 1.5vw, 1.12rem); max-width: 30rem; text-wrap: pretty; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero__perks { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 16px; padding-top: 26px; border-top: 1px solid var(--line); }
.perk { display: flex; gap: 12px; align-items: center; }
.perk__icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--primary-soft); color: var(--primary); }
.perk__icon .ic { width: 19px; height: 19px; }
.perk strong { display: block; font-size: .95rem; }
.perk span { color: var(--muted); font-size: .86rem; }

/* the illustration: a document with floating PDF+ / EDIT chips */
.hero__art { display: grid; place-items: center; }
.art__frame { position: relative; width: min(100%, 470px); aspect-ratio: 1.25; border-radius: 30px; background: linear-gradient(150deg, #f1eeff, #e9e5fd); display: grid; place-items: center; }
.art__doc { position: relative; width: 74%; height: 80%; padding: 28px 26px; border-radius: 20px; background: #fff; box-shadow: 0 20px 50px -24px rgba(70, 50, 180, .35); display: flex; flex-direction: column; gap: 14px; animation: float 6s ease-in-out infinite; }
.art__doc .l { display: block; height: 10px; border-radius: 99px; background: #ebe8f8; }
.l--a { width: 34%; background: #ddd5ff !important; }
.l--b { width: 82%; }
.l--f { width: 70%; } .l--g { width: 46%; }
.art__block { display: flex; flex-direction: column; gap: 11px; padding: 18px; border-radius: 14px; background: #f7f6fd; }
.l--c { width: 58%; background: #ddd8f3 !important; } .l--d { width: 92%; } .l--e { width: 74%; }
.art__chip { position: absolute; display: inline-flex; align-items: center; gap: 6px; padding: 12px 20px; border-radius: 15px; color: #fff; font-weight: 800; font-size: 1.05rem; letter-spacing: .02em; box-shadow: 0 16px 30px -14px rgba(40, 20, 120, .55); }
.art__chip .ic { width: 18px; height: 18px; }
.art__chip--pdf { top: 16%; right: -4%; background: var(--primary); animation: float 5s ease-in-out infinite reverse; }
.art__chip--edit { bottom: 20%; left: -3%; background: var(--teal); animation: float 7s ease-in-out infinite; }
.art__sig { position: absolute; bottom: 12%; right: 12%; width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: #fff; color: var(--primary); box-shadow: 0 12px 24px -12px rgba(40, 20, 120, .45); }
.art__sig .ic { width: 26px; height: 26px; }
@keyframes float { 50% { transform: translateY(-8px); } }

/* ---------- home: tool collection ---------- */
.collection { margin-top: clamp(36px, 6vw, 64px); scroll-margin-top: 84px; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 20px; margin-bottom: 18px; }
.section-head h2 { margin: 0; font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: -.03em; }
.section-head p { margin: 0; color: var(--muted); }
.search { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 20px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.search:focus-within { border-color: var(--primary-line); box-shadow: 0 0 0 4px var(--primary-soft); }
.search > .ic { color: var(--faint); width: 20px; height: 20px; }
.search__input { flex: 1; min-width: 0; height: 44px; border: 0; outline: 0; background: none; font: inherit; font-size: 1rem; color: var(--text); }
.search__input::placeholder { color: var(--faint); }
.search .btn { padding: 12px 26px; }

.chips { display: flex; gap: 8px; margin: 18px 0 18px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-weight: 600; font-size: .88rem; cursor: pointer; transition: color .15s, background .15s, border-color .15s; }
.chip:hover { color: var(--text); border-color: var(--line-2); }
.chip.on { background: var(--primary); color: #fff; border-color: var(--primary); }

.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.tile {
  --c: var(--primary);
  position: relative; display: flex; flex-direction: column; gap: 3px; padding: 22px 22px 24px; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.tile:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--c) 30%, var(--line)); box-shadow: 0 22px 40px -24px color-mix(in srgb, var(--c) 55%, transparent); }
.tile strong { margin-top: 16px; font-size: 1.08rem; letter-spacing: -.01em; }
.tile__desc { color: var(--muted); font-size: .9rem; line-height: 1.45; }
.tile__icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; flex: none; color: #fff; background: var(--c); box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--c) 80%, transparent); }
.tile__icon .ic { width: 23px; height: 23px; }
.star { position: absolute; top: 18px; right: 16px; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; border: 0; background: none; color: var(--line-2); cursor: pointer; transition: color .15s, background .15s; }
.star:hover { background: var(--surface-2); color: var(--faint); }
.star.on { color: #f5b301; }
.star.on svg { fill: currentColor; }
.empty { margin: 30px 0; text-align: center; color: var(--muted); }

/* ---------- workspace (dashboard) ---------- */
.ws { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; align-items: start; }
.ws-nav { position: sticky; top: 88px; display: flex; flex-direction: column; justify-content: space-between; gap: 22px; min-height: 520px; padding: 18px; border-radius: var(--radius-lg); background: #17173a; color: #c9cbe0; }
.ws-nav nav { display: flex; flex-direction: column; gap: 6px; }
.ws-link { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: 14px; color: #b9bbd3; text-decoration: none; font-weight: 500; transition: background .15s, color .15s; }
.ws-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.ws-link.on { background: #33325c; color: #fff; font-weight: 700; }
.ws-link .ic { width: 18px; height: 18px; opacity: .9; }
.storage { padding: 18px; border-radius: 18px; background: #2a2950; display: flex; flex-direction: column; gap: 6px; }
.storage__label { margin: 0; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: #9fa1c2; }
.storage strong { color: #fff; font-size: 1.05rem; }
.meter { height: 7px; border-radius: 99px; background: rgba(255, 255, 255, .14); overflow: hidden; margin: 4px 0 6px; }
.meter span { display: block; height: 100%; border-radius: inherit; background: var(--teal); }
.check--dark { color: #c9cbe0; font-size: .84rem !important; }
.ws-body { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.welcome { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; padding: clamp(24px, 4vw, 40px); border-radius: var(--radius-lg); background: linear-gradient(135deg, #ece8fe, #f3f1ff); }
.welcome h2 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -.03em; }
.welcome p { margin: 4px 0 0; color: var(--muted); }
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.quick__card { --c: var(--primary); display: flex; flex-direction: column; gap: 2px; padding: 20px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--text); box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s; }
.quick__card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.quick__card strong { margin-top: 14px; }
.quick__card > span:last-child { color: var(--muted); font-size: .88rem; }
.docs { padding: 22px 24px; }
.docs__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.docs__head h2 { margin: 0; font-size: 1.08rem; }
.docs__head .linkbtn { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; }
.docs__list { list-style: none; margin: 0; padding: 0; }
.doc { display: grid; grid-template-columns: auto minmax(0, 1fr) 170px auto auto; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.doc:first-child { border-top: 0; }
.doc__icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-size: .68rem; font-weight: 800; letter-spacing: .04em; }
.doc__icon--img { background: #e3f8f4; color: #0f8f7a; }
.doc__icon--other { background: #eef0f4; color: #475569; }
.doc__meta { min-width: 0; }
.doc__meta strong { display: block; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc__meta span { color: var(--faint); font-size: .82rem; }
.doc__open { min-height: 38px; padding: 7px 10px; font-size: .86rem; }
.docs__empty { display: flex; align-items: center; gap: 16px; padding: 18px 0 8px; color: var(--muted); }
.docs__empty p { margin: 0; max-width: 34rem; }
.docs__icon { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; flex: none; background: var(--primary-soft); color: var(--primary); }
.tools--ws { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.ws-hint { margin-top: 14px; }

.pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.pick__item { display: flex; align-items: center; gap: 10px; padding: 9px; border-radius: 13px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-align: left; font-weight: 600; font-size: .9rem; }
.pick__item:hover { border-color: var(--line-2); }
.pick__item.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.pick__item .tile__icon { width: 34px; height: 34px; border-radius: 10px; box-shadow: none; }
.pick__item .tile__icon .ic { width: 17px; height: 17px; }

/* ---------- tool page ---------- */
.tool__head { margin-bottom: 24px; }
.tool__head .crumbs { margin: 0 0 14px; }
.tool__title { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "icon title" "icon desc"; column-gap: 18px; align-items: center; }
.tool__title .tile__icon { grid-area: icon; width: 62px; height: 62px; border-radius: 18px; }
.tool__title .tile__icon .ic { width: 28px; height: 28px; }
.tool__title h1 { grid-area: title; font-size: clamp(1.7rem, 3.6vw, 2.4rem); letter-spacing: -.03em; line-height: 1.1; margin: 0; align-self: end; }
.tool__title p { grid-area: desc; margin: 6px 0 0; color: var(--muted); max-width: 46rem; align-self: start; text-wrap: pretty; }

.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  min-height: clamp(300px, 46vh, 420px); padding: 44px 20px; border-radius: var(--radius-lg);
  border: 2px dashed var(--primary-line); background: var(--surface); box-shadow: var(--shadow-sm);
  transition: border-color .2s, background .2s;
}
.drop__icon { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; margin-bottom: 14px; color: #fff; background: var(--c); box-shadow: 0 14px 28px -12px color-mix(in srgb, var(--c) 75%, transparent); }
.drop__icon .ic { width: 32px; height: 32px; }
.drop__title { margin: 0; font-size: clamp(1.3rem, 2.4vw, 1.6rem); letter-spacing: -.02em; }
.drop__or { margin: 4px 0 18px; color: var(--muted); }
.drop__extra { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 12px; }
.drop__note { display: inline-flex; align-items: center; gap: 6px; margin: 22px 0 0; font-size: .84rem; color: var(--faint); }
body.dragging .drop, body.dragging .work__main { border-color: var(--primary); background: var(--primary-soft); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 13px; border: 1px solid transparent;
  font-weight: 700; font-size: .93rem; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .15s, transform .15s, box-shadow .15s, border-color .15s, color .15s;
}
.btn--solid { background: var(--primary); color: #fff; box-shadow: 0 10px 22px -12px rgba(102, 70, 232, .8); }
.btn--solid:hover { background: var(--primary-2); }
.btn--solid:active { transform: translateY(1px); }
.btn--solid:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; background: var(--primary); }
.btn--solid .ic:last-child:not(:first-child) { transition: transform .2s; }
.btn--solid:hover:not(:disabled) .ic:last-child:not(:first-child) { transform: translateX(3px); }
.btn--soft { background: var(--primary-soft); color: var(--primary); }
.btn--soft:hover { background: #e5defe; }
.btn--soft.on { background: var(--primary); color: #fff; }
.btn--ghost { background: var(--surface); border-color: var(--line); color: var(--text); }
.btn--ghost:hover { border-color: var(--line-2); background: var(--surface-2); }
.btn--ghost.on { border-color: var(--primary); color: var(--primary); }
.btn--big { padding: 15px 28px; font-size: 1.02rem; border-radius: 15px; }
.btn--block { width: 100%; }
.btn.danger { color: var(--bad); background: #fdeeee; }
.btn.danger:hover { background: #fbe0e0; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; font-weight: 600; font-size: .88rem; }
.linkbtn:hover { text-decoration: underline; }
.iconbtn {
  width: 36px; height: 36px; border-radius: 11px; display: inline-grid; place-items: center; flex: none;
  background: var(--surface); border: 1px solid var(--line); color: var(--text); cursor: pointer; font-size: 1.15rem; font-weight: 700;
  transition: background .15s, border-color .15s, color .15s;
}
.iconbtn:hover { background: var(--surface-2); border-color: var(--line-2); }
.iconbtn:disabled { opacity: .35; cursor: default; }
.iconbtn .ic { width: 17px; height: 17px; }
.iconbtn.flip .ic { transform: scaleX(-1); }

/* ---------- workspace for a tool ---------- */
.work { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.work--wide { grid-template-columns: minmax(0, 1fr) 330px; }
.work__main { min-height: 400px; padding: 24px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.work__sidewrap { position: sticky; top: 88px; display: flex; flex-direction: column; max-height: calc(100vh - 104px); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.work__sidehead { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px 6px; }
.work__sidehead h2 { margin: 0; font-size: 1.05rem; letter-spacing: -.01em; }
.work__side { padding: 12px 22px 18px; overflow: auto; display: flex; flex-direction: column; gap: 18px; }
.work__side > p { margin: 0; color: var(--muted); font-size: .92rem; }
.work__go { padding: 16px 22px 22px; border-top: 1px solid var(--line); }

/* ---------- form bits ---------- */
.f { display: flex; flex-direction: column; gap: 8px; }
.f__label { font-size: .82rem; font-weight: 600; color: var(--muted); margin: 0; }
.field { width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 12px; border: 1px solid transparent; background: var(--surface-2); color: var(--text); font: inherit; font-size: .95rem; transition: border-color .15s, background .15s, box-shadow .15s; }
.field:hover { border-color: var(--line); }
.field:focus { outline: 0; border-color: var(--primary-line); background: #fff; box-shadow: 0 0 0 4px var(--primary-soft); }
select.field { appearance: auto; }
.swatch { width: 100%; height: 44px; padding: 4px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; }
.unit { position: relative; }
.unit .field { padding-right: 36px; }
.unit span { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: .85rem; pointer-events: none; }
.seg { display: flex; padding: 4px; gap: 4px; border-radius: 13px; background: var(--surface-2); }
.seg button { flex: 1; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 6px; border: 0; border-radius: 10px; background: none; color: var(--muted); font-weight: 600; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; transition: background .15s, color .15s, box-shadow .15s; }
.seg button:hover { color: var(--text); }
.seg button.on { background: #fff; color: var(--primary); box-shadow: 0 1px 3px rgba(23, 23, 58, .1), 0 0 0 1px var(--primary-line); }
.seg--icons .ic { width: 16px; height: 16px; }
.choices { display: flex; flex-direction: column; gap: 10px; }
.choice { position: relative; text-align: left; padding: 14px 14px 14px 46px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.choice::before { content: ""; position: absolute; left: 16px; top: 17px; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); background: #fff; }
.choice.on::before { border-color: var(--primary); background: radial-gradient(circle, var(--primary) 42%, #fff 48%); }
.choice:hover { border-color: var(--line-2); }
.choice strong { display: block; font-size: .95rem; }
.choice span { color: var(--muted); font-size: .85rem; }
.choice.on { border-color: var(--primary); background: #faf8ff; box-shadow: 0 0 0 3px var(--primary-soft); }
.check { display: flex; align-items: center; gap: 10px; font-size: .93rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.slider { display: flex; align-items: center; gap: 12px; }
.slider input { flex: 1; min-width: 0; accent-color: var(--primary); }
.slider output { min-width: 4.6em; text-align: right; color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; }
.muted { color: var(--muted); }
.small { font-size: .86rem; margin: 0; line-height: 1.5; }
.bad { color: var(--bad) !important; }
.note { color: var(--muted); }
.pos9 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; width: 140px; padding: 7px; border-radius: 14px; background: var(--surface-2); }
.pos9 button { aspect-ratio: 1; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.pos9 button:hover { border-color: var(--line-2); }
.pos9 button.on { background: var(--primary); border-color: var(--primary); }
.pos9.off { opacity: .35; pointer-events: none; }
.pos6 { grid-template-rows: 1fr 40px 1fr; }
.pos6 button:nth-child(n+4) { grid-row: 3; }

/* colour dots */
.dots { display: flex; flex-wrap: wrap; gap: 8px; }
.dot { position: relative; width: 30px; height: 30px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); transition: transform .15s; }
.dot:hover { transform: scale(1.08); }
.dot.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--primary); }
.dot--custom { display: grid; place-items: center; background: conic-gradient(#f43f5e, #fbbf24, #22c55e, #06b6d4, #6646e8, #ec4899, #f43f5e); overflow: hidden; }
.dot--custom.on { background: var(--v); }
.dot--custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }

/* ---------- file cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); user-select: none; transition: border-color .15s, box-shadow .15s; }
.card[data-id] { cursor: grab; }
.card[data-id]:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.card__page { display: grid; place-items: center; height: 200px; border-radius: 12px; background: var(--stage); overflow: hidden; }
.card__page .thumb { max-width: 84%; max-height: 178px; width: auto !important; height: auto; object-fit: contain; box-shadow: 0 6px 18px -6px rgba(23, 23, 58, .3); background: #fff; border-radius: 3px; }
.card__meta { min-width: 0; padding: 0 2px; }
.card__meta strong { display: block; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card__meta span { color: var(--faint); font-size: .8rem; }
.card__x { position: absolute; top: 20px; right: 20px; width: 30px; height: 30px; border-radius: 50%; border: 0; box-shadow: var(--shadow-sm); }
.card__x:hover { color: var(--bad); }
.card--add { align-items: center; justify-content: center; gap: 10px; border-style: dashed; border-width: 2px; border-color: var(--primary-line); color: var(--primary); cursor: pointer; font-weight: 700; background: #fcfbff; }
.card--add:hover { border-color: var(--primary); background: var(--primary-soft); }
.card--add .ic { width: 26px; height: 26px; padding: 9px; border-radius: 14px; background: var(--primary); color: #fff; box-sizing: content-box; }
.grip { position: absolute; top: 20px; left: 20px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); color: var(--muted); cursor: grab; touch-action: none; }
.grip .ic { width: 15px; height: 15px; }
.placeholder { opacity: .3; }
.ghost { box-shadow: 0 24px 50px -16px rgba(23, 23, 58, .4); opacity: .97; }

.hero-file { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 352px; text-align: center; }
.hero-file__page { display: grid; place-items: center; width: 250px; height: 290px; margin-bottom: 16px; border-radius: 22px; background: var(--stage); }
.hero-file .thumb { max-width: 200px; max-height: 250px; width: auto !important; height: auto; background: #fff; box-shadow: 0 14px 30px -12px rgba(23, 23, 58, .35); border-radius: 3px; }
.hero-file strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.04rem; }
.hero-file span { color: var(--faint); font-size: .86rem; }
/* Compress video */
.vid { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.vid__player { width: 100%; max-width: 640px; max-height: 60vh; border-radius: 16px; background: #000; }
.vid .card__meta { max-width: 100%; }
.vid-est { margin: 4px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--stage); line-height: 1.5; }
.vid-bad { color: var(--bad); }
.vid-size b { color: var(--text); }

.file-row { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; background: var(--surface-2); }
.file-row__page { display: grid; place-items: center; width: 44px; height: 54px; flex: none; }
.file-row .thumb { max-width: 44px; max-height: 54px; width: auto !important; height: auto; background: #fff; border-radius: 2px; box-shadow: 0 2px 6px rgba(23, 23, 58, .15); }

/* ---------- page grids ---------- */
.pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.pg { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 10px 10px; border-radius: 16px; border: 2px solid transparent; background: var(--stage); user-select: none; transition: border-color .15s, background .15s; }
.pg__page { display: grid; place-items: center; width: 100%; height: 176px; }
.pg .thumb { max-width: 100%; max-height: 170px; width: auto !important; height: auto; background: #fff; box-shadow: 0 6px 16px -8px rgba(23, 23, 58, .35); border-radius: 3px; transition: transform .25s, opacity .15s; }
.pg__num { font-size: .8rem; color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.pg__tick { position: absolute; top: 10px; right: 10px; width: 26px; height: 26px; border-radius: 50%; display: none; place-items: center; background: var(--g, var(--primary)); color: #fff; box-shadow: 0 4px 10px -4px rgba(23, 23, 58, .5); }
.pg__tick .ic { width: 15px; height: 15px; }
.pg.on { border-color: var(--g, var(--primary)); background: color-mix(in srgb, var(--g, var(--primary)) 10%, #fff); }
.pg[data-group]:not([data-group=""])::after { content: attr(data-group); position: absolute; bottom: 8px; left: 8px; padding: 2px 9px; border-radius: 999px; background: var(--g); color: #fff; font-size: .7rem; font-weight: 700; }
.pickable .pg { cursor: pointer; }
.pickable .pg:hover { border-color: var(--line-2); }
.pickable .pg.on:hover { border-color: var(--g, var(--primary)); }
.pickable .pg.on .pg__tick { display: grid; }
.pickable .pg:not(.on) .thumb { opacity: .4; }
.pg__tools { display: flex; gap: 4px; }
.pg__tools .iconbtn { width: 32px; height: 32px; border-radius: 10px; }
.pages--edit .pg { cursor: grab; }
.pages--edit .pg:hover { border-color: var(--line-2); }

/* ---------- previews ---------- */
.preview { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.preview__page { display: grid; place-items: center; min-height: 340px; width: 100%; padding: 22px; border-radius: 18px; background: var(--stage); }
.preview__page canvas { max-width: 100%; height: auto !important; box-shadow: 0 14px 34px -14px rgba(23, 23, 58, .4); background: #fff; border-radius: 3px; }
.preview__nav { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }

/* ---------- done ---------- */
.done { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: clamp(36px, 6vw, 60px) 20px; }
.done h2 { margin: 8px 0 0; font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -.03em; }
.done__note { margin: 0 0 10px; color: var(--muted); max-width: 32rem; }
.done__text { display: flex; flex-direction: column; align-items: center; gap: 12px; width: min(100%, 44rem); margin-bottom: 4px; }
.done__text textarea { width: 100%; min-height: 220px; resize: vertical; text-align: start; font: inherit; font-size: .95rem; line-height: 1.55; padding: 14px 16px; }
.done__check { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; background: var(--c); color: #fff; box-shadow: 0 16px 30px -14px color-mix(in srgb, var(--c) 80%, transparent); animation: pop .45s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.done__check .ic { width: 34px; height: 34px; }
.done .muted { margin: 0; font-size: .86rem; }
.done__kept { display: inline-flex; align-items: center; gap: 6px; margin: 4px 0 0; padding: 6px 12px; border-radius: 999px; background: #e7f8f2; color: var(--ok); font-size: .84rem; font-weight: 600; }
.done__kept a { color: inherit; }
.done__list { list-style: none; margin: 10px 0 0; padding: 0; width: min(100%, 520px); max-height: 260px; overflow: auto; text-align: left; border: 1px solid var(--line); border-radius: 14px; }
.done__list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: .88rem; }
.done__list li:first-child { border-top: 0; }
.done__list li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.done__more { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 14px; }
.done__next { width: min(100%, 760px); margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.done__next .f__label { margin-bottom: 14px; }
.nexts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.next { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 600; font-size: .9rem; text-align: left; transition: border-color .15s, transform .15s, box-shadow .15s; }
.next:hover { border-color: var(--line-2); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.next .tile__icon { width: 38px; height: 38px; border-radius: 11px; box-shadow: none; }
.next .tile__icon .ic { width: 18px; height: 18px; }

/* ---------- busy, toast, modal ---------- */
.busy { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(23, 23, 58, .28); backdrop-filter: blur(4px); }
.busy__box { display: flex; flex-direction: column; align-items: center; gap: 14px; min-width: 230px; padding: 30px 38px; border-radius: 22px; background: #fff; box-shadow: var(--shadow); }
.busy__box p { margin: 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.busy__cancel { margin-top: 4px; }
.spinner { width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--primary-soft); border-top-color: var(--primary); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 120; width: max-content; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 14px; background: #17173a; color: #fff; box-shadow: 0 16px 40px -12px rgba(23, 23, 58, .5); font-size: .92rem; animation: rise .25s ease-out; }
@keyframes rise { from { transform: translate(-50%, 10px); opacity: 0; } }
.toast.bad { background: #b4232a; }
.modal { position: fixed; inset: 0; z-index: 110; display: grid; place-items: center; padding: 16px; background: rgba(23, 23, 58, .35); backdrop-filter: blur(4px); }
.modal__box { width: min(100%, 460px); max-height: calc(100dvh - 32px); overflow: auto; padding: 26px; border-radius: 24px; background: #fff; box-shadow: 0 30px 80px -20px rgba(23, 23, 58, .45); }
.modal__box--wide { width: min(100%, 660px); }
.modal__box h2 { margin: 0 0 14px; font-size: 1.22rem; letter-spacing: -.01em; }
.modal__body { display: flex; flex-direction: column; gap: 14px; }
.modal__body p { margin: 0; color: var(--muted); }
.modal__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.modal .btn--ghost { background: var(--surface-2); border-color: transparent; }

/* ---------- editor (concept 03) ---------- */
.work--editor { grid-template-columns: minmax(0, 1fr) 320px; gap: 0; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); overflow: hidden; }
.work--editor .work__main { padding: 0; min-height: 0; border: 0; border-radius: 0; box-shadow: none; }
.work--editor .work__sidewrap { position: static; max-height: none; height: 100%; border: 0; border-left: 1px solid var(--line); border-radius: 0; box-shadow: none; }
.work--editor .work__side { flex: 1; }
.ed-shell { display: grid; grid-template-columns: 96px 150px minmax(0, 1fr); height: calc(100vh - 150px); min-height: 560px; }
.ed-shell--one { grid-template-columns: 96px minmax(0, 1fr); }
.ed-shell--one .ed-thumbs { display: none; }
.ed-rail { display: flex; flex-direction: column; gap: 8px; padding: 18px 12px; background: #f6f5ff; overflow-y: auto; scrollbar-width: none; }
.ed-rail::-webkit-scrollbar { display: none; }
.ed-tool { flex: none; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 11px 4px 9px; border-radius: 15px; border: 0; background: #fff; color: var(--muted); font-size: .7rem; font-weight: 600; line-height: 1.15; text-align: center; cursor: pointer; box-shadow: 0 1px 2px rgba(23, 23, 58, .05); transition: background .15s, color .15s, transform .15s; }
.ed-tool .ic { width: 21px; height: 21px; }
.ed-tool:hover { color: var(--text); transform: translateY(-1px); }
.ed-tool.on { background: var(--primary); color: #fff; box-shadow: 0 10px 20px -10px rgba(102, 70, 232, .9); }
.ed-thumbs { display: flex; flex-direction: column; gap: 14px; padding: 18px 16px; background: #fbfbfe; border-right: 1px solid var(--line); overflow-y: auto; }
.ed-thumbs .f__label { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--faint); }
.ed-thumb { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.ed-thumb:hover { border-color: var(--line-2); }
.ed-thumb.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.ed-thumb__page { display: grid; place-items: center; width: 100%; min-height: 100px; }
.ed-thumb .thumb { max-width: 92px; max-height: 120px; width: auto !important; height: auto; box-shadow: 0 2px 6px rgba(23, 23, 58, .15); background: #fff; }
.ed-thumb__num { font-size: .8rem; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }
.ed-stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--stage); }
.ed-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--line); }
.ed-doc { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ed-doc__tag { padding: 4px 8px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); font-size: .68rem; font-weight: 800; letter-spacing: .06em; }
.ed-doc strong { min-width: 0; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-where { flex: none; color: var(--faint); font-size: .84rem; font-variant-numeric: tabular-nums; }
.ed-zoom { flex: none; display: flex; gap: 4px; align-items: center; }
.ed-zoom .iconbtn { width: 34px; height: 34px; }
.ed-sep { width: 1px; height: 22px; margin: 0 6px; background: var(--line); }
.ed-zoomlbl { min-width: 3.4em; text-align: center; font-size: .82rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.ed-pages { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: safe center; gap: 26px; padding: 30px 20px 40px; overflow: auto; }
.ed-page { position: relative; flex: none; background: #fff; border-radius: 4px; box-shadow: 0 2px 6px rgba(23, 23, 58, .06), 0 24px 50px -24px rgba(54, 40, 140, .3); }
.ed-page canvas { display: block; border-radius: 4px; }
.ed-layer { position: absolute; inset: 0; overflow: hidden; touch-action: pinch-zoom; }
.ed-pages[data-tool="text"] .ed-layer, .ed-pages[data-tool="date"] .ed-layer { cursor: text; }
.ed-pages[data-tool="draw"] .ed-layer, .ed-pages[data-tool="highlight"] .ed-layer, .ed-pages[data-tool="whiteout"] .ed-layer, .ed-pages[data-tool="place"] .ed-layer { cursor: crosshair; touch-action: none; }
.ed-pages[data-tool="draw"] .obj, .ed-pages[data-tool="highlight"] .obj, .ed-pages[data-tool="whiteout"] .obj { pointer-events: none; }
.tx { position: absolute; display: none; border-radius: 3px; cursor: text; }
.ed-pages[data-tool="edittext"] .tx { display: block; outline: 1px dashed rgba(102, 70, 232, .45); outline-offset: 1px; }
.ed-pages[data-tool="edittext"] .tx:hover, .ed-pages[data-tool="edittext"] .tx:focus-visible { background: rgba(102, 70, 232, .1); outline: 1.5px solid var(--primary); }
.obj:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.ed-scan { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 2; display: none; align-items: center; gap: 8px; max-width: calc(100% - 24px); padding: 10px 16px; border: 0; border-radius: 999px; background: var(--primary); color: #fff; font: inherit; font-size: .9rem; font-weight: 600; box-shadow: 0 8px 24px -8px rgba(54, 40, 140, .55); cursor: pointer; }
.ed-scan:hover { filter: brightness(1.08); }
.ed-scan .ic { width: 17px; height: 17px; flex: none; }
.ed-pages[data-tool="edittext"] .ed-scan { display: inline-flex; }
.sig-hint { margin: 10px 0 0; color: #b42318; font-size: .88rem; font-weight: 600; }
.mask { position: absolute; pointer-events: none; }
.obj { position: absolute; cursor: move; touch-action: none; }
.obj.sel { outline: 1.5px solid var(--primary); outline-offset: 3px; border-radius: 2px; }
.obj__h { display: none; position: absolute; right: -9px; bottom: -9px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid var(--primary); cursor: nwse-resize; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); }
.obj.sel .obj__h { display: block; }
.obj--text { white-space: pre; padding: 0; min-width: 4px; line-height: 1.2; }
.obj--text.editing { cursor: text; outline: 1.5px solid var(--primary); background: rgba(239, 235, 254, .7); }
.obj--text.editing .obj__h { display: none; }
.obj--img img { width: 100%; height: 100%; display: block; pointer-events: none; user-select: none; }
.obj--highlight { opacity: .45; mix-blend-mode: multiply; }
.obj--path svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.obj.live { pointer-events: none; }

.ed-props { display: flex; flex-direction: column; gap: 18px; }
.ed-copies { display: flex; flex-direction: column; gap: 8px; }
.props__title { margin: 0; padding-bottom: 14px; border-bottom: 1px solid var(--line); font-size: 1.02rem; }
.sigs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sig { position: relative; }
.sig__use { width: 100%; height: 70px; padding: 8px; border-radius: 13px; border: 1px solid var(--line); background: #fff; cursor: pointer; display: grid; place-items: center; transition: border-color .15s, box-shadow .15s; }
.sig__use:hover { border-color: var(--line-2); }
.sig__use img { max-width: 100%; max-height: 100%; }
.sig.on .sig__use, .sig__use.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.sig__x { position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 50%; box-shadow: var(--shadow-sm); }
.sig__x .ic { width: 11px; height: 11px; }
.sigs--pick { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.sigs--pick .sig__use { height: 86px; }
.sigpad { display: block; width: 100%; height: 210px; border-radius: 16px; background: #fff; border: 1.5px dashed var(--line-2); touch-action: none; cursor: crosshair; }
.sigfonts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.sigfont { height: 80px; padding: 0 12px; border-radius: 14px; border: 1px solid var(--line); background: #fff; font-size: 30px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; }
.sigfont.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.sigprev { display: grid; place-items: center; min-height: 140px; margin-top: 10px; border-radius: 16px; background: repeating-conic-gradient(#eef0f7 0 25%, #fff 0 50%) 0 0 / 16px 16px; color: var(--muted); }
.sigprev canvas { max-width: 100%; max-height: 220px; }
.inkrow { display: flex; gap: 10px; }
.ink { width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); }
.ink.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--primary); }

/* ---------- tablet and below ---------- */
@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; }
  .hero__art { order: -1; }
  .art__frame { width: min(100%, 420px); }
  .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ws { grid-template-columns: minmax(0, 1fr); }
  .ws-nav { position: static; min-height: 0; min-width: 0; gap: 10px; padding: 10px; }
  .ws-nav nav { flex-direction: row; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .ws-nav nav::-webkit-scrollbar { display: none; }
  .ws-link { flex: none; padding: 10px 14px; }
  .storage { padding: 12px 16px; }
}
@media (max-width: 960px) {
  .work, .work--wide { grid-template-columns: minmax(0, 1fr); }
  .work__sidewrap { position: static; max-height: none; }
  /* The main button lives in a bar pinned to the bottom of the screen. */
  .work__go {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .9); backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
  }
  .work__go .btn { max-width: 560px; margin: 0 auto; display: flex; }
  body.has-bar { padding-bottom: 86px; }
  body.has-bar .toast { bottom: calc(98px + env(safe-area-inset-bottom)); }

  /* Editor: tools become a strip above the page; thumbnails hide. */
  .work--editor { grid-template-columns: minmax(0, 1fr); }
  .work--editor .work__sidewrap { border-left: 0; border-top: 1px solid var(--line); }
  .ed-shell, .ed-shell--one { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); height: 74vh; height: 74svh; min-height: 420px; }
  .ed-thumbs { display: none; }
  .ed-rail { flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 10px; gap: 6px; mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
  .ed-tool { min-width: 72px; padding: 9px 6px 7px; }
  .nexts { grid-template-columns: 1fr 1fr; }
}

/* ---------- phones ---------- */
@media (max-width: 600px) {
  .top__in { height: 60px; }
  .brand { font-size: 1.05rem; }
  .brand img { width: 30px; height: 30px; }
  .nav a { padding: 7px 9px; font-size: .86rem; }
  .nav .nav__extra { display: none; }
  .nav .long { display: none; }
  .nav .short { display: inline; }
  main { padding-top: 18px; }

  .hero { padding: 22px 18px 22px; gap: 22px; }
  .hero__perks { grid-template-columns: 1fr; gap: 14px; margin-top: 4px; padding-top: 20px; }
  .hero__cta .btn { flex: 1; }
  .art__chip { padding: 9px 14px; font-size: .9rem; }
  .search { padding: 6px 6px 6px 14px; border-radius: 16px; }
  .search .btn { padding: 11px 16px; }
  .tools { grid-template-columns: 1fr 1fr; gap: 12px; }
  .tile { padding: 16px 14px 18px; border-radius: 18px; }
  .tile strong { margin-top: 12px; font-size: .98rem; }
  .tile__desc { font-size: .82rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .tile__icon { width: 42px; height: 42px; border-radius: 13px; }
  .tile__icon .ic { width: 20px; height: 20px; }
  .star { top: 12px; right: 10px; }

  .welcome { padding: 22px; }
  .welcome .btn { width: 100%; }
  .quick { gap: 12px; }
  .quick__card { padding: 16px; }
  .docs { padding: 16px; }
  .doc { grid-template-columns: auto minmax(0, 1fr) auto auto; row-gap: 8px; }
  .doc__open { grid-column: 2 / -1; grid-row: 2; }

  .tool__head { margin-bottom: 18px; }
  .tool__title { grid-template-areas: "icon title" "desc desc"; column-gap: 12px; }
  .tool__title .tile__icon { width: 46px; height: 46px; border-radius: 14px; }
  .tool__title .tile__icon .ic { width: 22px; height: 22px; }
  .tool__title h1 { font-size: 1.6rem; align-self: center; }
  .tool__title p { margin-top: 12px; font-size: .94rem; }

  .drop { min-height: 320px; padding: 34px 16px; }
  .work__main { min-height: 0; padding: 14px; border-radius: 22px; }
  .work__sidewrap { border-radius: 22px; }
  .work__sidehead { padding: 18px 18px 4px; }
  .work__side { padding: 10px 18px 18px; }

  .cards { grid-template-columns: 1fr 1fr; gap: 12px; }
  .card { padding: 10px; }
  .card__page { height: 150px; }
  .card__page .thumb { max-height: 134px; }
  .card__x { top: 16px; right: 16px; }
  .grip { top: 16px; left: 16px; }
  .card--add { min-height: 150px; }
  .hero-file { min-height: 0; padding: 14px 0; }
  .hero-file__page { width: 196px; height: 228px; }
  .hero-file .thumb { max-width: 160px; max-height: 200px; }

  .pages { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
  .pg { padding: 10px 6px 8px; }
  .pg__page { height: 130px; }
  .pg .thumb { max-height: 126px; }
  .pg__tools .iconbtn { width: 28px; height: 28px; }
  .preview__page { min-height: 0; padding: 12px; }

  .work--editor { border-radius: 22px; }
  .ed-top { padding: 8px 10px; }
  .ed-where, .ed-sep, .ed-zoomlbl { display: none; }
  .ed-zoom .iconbtn { width: 32px; height: 32px; }
  .ed-pages { padding: 16px 8px 28px; gap: 18px; }

  .done__next { margin-top: 20px; }
  .sigfonts { grid-template-columns: 1fr; }

  /* Dialogs become bottom sheets. */
  .modal { place-items: end stretch; padding: 0; }
  .modal__box, .modal__box--wide { width: 100%; max-height: 92dvh; border-radius: 24px 24px 0 0; padding: 24px 18px calc(18px + env(safe-area-inset-bottom)); animation: sheet .25s ease-out; }
  .modal__actions .btn { flex: 1; }
  @keyframes sheet { from { transform: translateY(40px); opacity: .4; } }
}
@media (max-width: 360px) {
  .tools, .cards, .quick { grid-template-columns: 1fr; }
}
@media (hover: none) {
  .tile:hover, .next:hover, .quick__card:hover, .ed-tool:hover { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
