/* Image Tools. Light "calm workspace" design shared with PDF Tools: mint-grey
   ground, white cards, teal primary, one solid colour per tool. */
:root {
  --bg: #f2f6f5;
  --surface: #ffffff;
  --surface-2: #f5f8f8;
  --surface-3: #ecf1f0;
  --stage: #e8eeed;
  --line: #e1e8e7;
  --line-2: #cfdad8;
  --text: #122826;
  --muted: #5b6e6b;
  --faint: #90a19e;
  --primary: #0e8f80;
  --primary-2: #0b776b;
  --primary-soft: #e2f4f1;
  --primary-line: #b5e2da;
  --teal: #f08c00;
  --bad: #e5484d;
  --ok: #12a37d;
  --radius: 18px;
  --radius-lg: 26px;
  --shadow-sm: 0 1px 2px rgba(18, 40, 38, .04), 0 4px 14px -6px rgba(18, 40, 38, .08);
  --shadow: 0 2px 6px rgba(18, 40, 38, .04), 0 18px 44px -20px rgba(12, 80, 72, .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, #e4f4f0, #d9eeea); display: grid; place-items: center; }
.art__photo { position: relative; width: 76%; height: 74%; border-radius: 20px; overflow: hidden; background: linear-gradient(180deg, #ffd9a8, #ffb88a 55%, #f59f7a); box-shadow: 0 20px 50px -24px rgba(12, 80, 72, .45); animation: float 6s ease-in-out infinite; }
.art__sun { position: absolute; top: 18%; right: 22%; width: 18%; aspect-ratio: 1; border-radius: 50%; background: #fff3c4; }
.art__hill { position: absolute; left: -10%; right: -10%; border-radius: 50% 50% 0 0; }
.art__hill--back { bottom: -18%; height: 62%; left: 30%; background: #2f9e8f; }
.art__hill--front { bottom: -30%; height: 70%; right: 35%; background: #0e6e63; }
.art__crop { position: absolute; width: 22%; aspect-ratio: 1; border: 5px solid #fff; }
.art__crop--tl { top: 7%; left: 6%; border-right: 0; border-bottom: 0; border-top-left-radius: 6px; }
.art__crop--br { bottom: 7%; right: 6%; border-left: 0; border-top: 0; border-bottom-right-radius: 6px; }
.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(12, 70, 62, .55); }
.art__chip .ic { width: 18px; height: 18px; }
.art__chip--size { top: 12%; right: -5%; background: var(--primary); animation: float 5s ease-in-out infinite reverse; font-variant-numeric: tabular-nums; }
.art__chip--save { bottom: 18%; left: -4%; 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(12, 70, 62, .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(14, 143, 128, .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(18, 40, 38, .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, #7048e8, #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(18, 40, 38, .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: #f8fcfb; }
.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(18, 40, 38, .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(18, 40, 38, .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); }
/* Enhance image */
.enh-holder { display: grid; place-items: center; padding: 10px; border-radius: 16px; background: var(--stage); }
.enh-stage canvas { max-height: 68vh; width: auto !important; }
.enh-grid::after { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(rgba(255,255,255,.55) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.55) 1px, transparent 1px); background-size: 12.5% 12.5%; }
.enh-hint { margin: 10px 0 0; text-align: center; }
.enh-row { display: flex; gap: 8px; }
.enh-row .btn:last-child { flex: 1; }
.enh-auto.on { background: var(--primary); color: #fff; }

.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(18, 40, 38, .15); }

/* ---------- 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(18, 40, 38, .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(18, 40, 38, .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(18, 40, 38, .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(18, 40, 38, .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(18, 40, 38, .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; }

/* ---------- 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); }
  .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; }
  .pg__page { height: 130px; }
  .pg__tools .iconbtn { width: 28px; height: 28px; }
  .preview__page { min-height: 0; padding: 12px; }

  .work--editor { border-radius: 22px; }

  .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 { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* link to the sister app, under the tool grid */
.sister { display: flex; align-items: center; gap: 18px; margin-top: 28px; padding: 20px 24px; color: var(--text); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.sister:hover { border-color: var(--primary-line); box-shadow: var(--shadow); }
.sister img { width: 48px; height: 48px; flex: none; }
.sister__text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.sister__text span { color: var(--muted); font-size: .92rem; }
.sister__go { display: inline-flex; align-items: center; gap: 8px; color: var(--primary); font-weight: 700; white-space: nowrap; }
@media (max-width: 640px) { .sister { flex-wrap: wrap; } .sister__go { width: 100%; } }
