:root {
  --ink: #0e1a22;
  --ink-soft: #243844;
  --mist: #e7eef2;
  --paper: #f4f7f9;
  --line: rgba(14, 26, 34, 0.12);
  --accent: #d9772c;
  --accent-deep: #b85d18;
  --teal: #1f7a6c;
  --ok: #1f7a6c;
  --err: #b42318;
  --shadow: 0 24px 60px rgba(14, 26, 34, 0.12);
  --radius: 22px;
  --font-display: "Syne", sans-serif;
  --font-body: "Figtree", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 10% -10%, rgba(217, 119, 44, 0.18), transparent 55%),
    radial-gradient(900px 600px at 90% 0%, rgba(31, 122, 108, 0.16), transparent 50%),
    linear-gradient(180deg, #f7fafb 0%, var(--mist) 45%, #dfe8ee 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}

.app {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 1.35rem;
  animation: rise 0.7s ease both;
  position: relative;
  z-index: 1000;
  overflow: visible;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-inline-start: auto;
  overflow: visible;
}

.lang-picker {
  position: relative;
  z-index: 1000;
}

.lang-current {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: 999px;
  padding: 0.35rem 0.7rem 0.35rem 0.4rem;
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.lang-current:hover,
.lang-picker.open .lang-current {
  border-color: rgba(217, 119, 44, 0.45);
  background: #ffffff;
}

.lang-flag {
  display: inline-grid;
  place-items: center;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 50%;
  flex-shrink: 0;
  font-size: 1.05rem;
  line-height: 1;
  background: #eef3f6;
  box-shadow: inset 0 0 0 1px rgba(14, 26, 34, 0.1);
  overflow: hidden;
}

.lang-name {
  max-width: 7.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lang-caret {
  color: var(--ink-soft);
  font-size: 0.7rem;
  line-height: 1;
}

.lang-menu {
  position: fixed;
  z-index: 2000;
  min-width: 13.5rem;
  max-height: min(75vh, 520px);
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid rgba(14, 26, 34, 0.14);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(14, 26, 34, 0.18);
  padding: 0.4rem;
  overscroll-behavior: contain;
}

.lang-menu[hidden] {
  display: none !important;
}

.lang-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border: none;
  background: #ffffff;
  border-radius: 12px;
  padding: 0.5rem 0.6rem;
  font-family: var(--font-body);
  font-size: 0.86rem;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  box-sizing: border-box;
}

.lang-option:hover,
.lang-option.active {
  background: #f3f6f8;
}

html[dir="rtl"] .lang-option {
  text-align: right;
  flex-direction: row-reverse;
}

html[dir="rtl"] .topbar,
html[dir="rtl"] .topbar-right,
html[dir="rtl"] .brand,
html[dir="rtl"] .meta-row,
html[dir="rtl"] .actions {
  flex-direction: row-reverse;
}

html[dir="rtl"] .hero h1,
html[dir="rtl"] .hero p,
html[dir="rtl"] .footer-note,
html[dir="rtl"] .model,
html[dir="rtl"] .drop-empty {
  text-align: right;
}

.brand {
  display: flex;
  align-items: baseline;
  flex-shrink: 0;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

a.brand:visited {
  color: inherit;
}

a.brand:hover .brand-mark span {
  color: var(--accent-deep);
}

.brand-mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  letter-spacing: -0.04em;
  line-height: 1;
}

.brand-mark span {
  color: var(--accent);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(8px);
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
}

.status-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(217, 119, 44, 0.45);
  animation: pulse 2s infinite;
}

.status-dot.ok {
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(31, 122, 108, 0.45);
}

.status-dot.bad {
  background: var(--err);
  animation: none;
}

.service-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.1rem;
  margin: 0.15rem 0 0.85rem;
  padding: 0 0 0.55rem;
  border: none;
  border-bottom: 1px solid rgba(14, 26, 34, 0.1);
  border-radius: 0;
  background: none;
  box-shadow: none;
  width: 100%;
  max-width: 100%;
}

.service-nav[hidden] {
  display: none !important;
}

.service-nav .mode-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  border: none;
  background: transparent;
  border-radius: 0;
  padding: 0.35rem 0.55rem;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 550;
  color: var(--ink-soft);
  text-decoration: none;
  cursor: pointer;
  box-shadow: none;
  transition: color 0.15s ease;
}

.service-nav a.mode-btn:visited {
  color: var(--ink-soft);
}

.service-nav a.mode-btn.active:visited {
  color: var(--ink);
}

.service-nav .mode-btn:hover {
  color: var(--ink);
  background: transparent;
  border: none;
  transform: none;
  box-shadow: none;
}

.service-nav .mode-btn.active {
  background: transparent;
  border: none;
  color: var(--ink);
  font-weight: 700;
  box-shadow: inset 0 -2px 0 var(--accent);
}

.service-nav .mode-btn.active:hover {
  background: transparent;
  border: none;
  color: var(--ink);
  transform: none;
}

.service-nav .mode-btn-ai {
  overflow: visible;
}

.service-nav .ai-badge {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: auto;
  margin-left: 0.15rem;
  padding: 0;
  border-radius: 0;
  background: none;
  color: var(--accent-deep);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1;
  box-shadow: none;
  pointer-events: none;
  z-index: 2;
}

.service-nav .mode-btn-ai.active .ai-badge {
  background: none;
  color: var(--accent-deep);
  box-shadow: none;
}

.hero {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
  animation: rise 0.8s ease both;
}

.hub-categories {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0.28rem;
  border: 1px solid rgba(14, 26, 34, 0.12);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(245, 247, 249, 0.88));
  box-shadow:
    0 6px 18px rgba(14, 26, 34, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  max-width: 100%;
}

.hub-categories[hidden] {
  display: none !important;
}

.topbar .hub-filter {
  padding: 0.42rem 0.78rem;
  font-size: 0.86rem;
  border-radius: 10px;
}

.tools-hub {
  display: grid;
  gap: 1.5rem;
  margin: 0 0 1.25rem;
  animation: rise 0.85s ease both;
}

.tools-hub[hidden] {
  display: none !important;
}

.hub-empty {
  margin: 0;
  padding: 1.1rem 0.2rem;
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.5;
}

/* legacy alias */
.hub-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.hub-filter {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(14, 26, 34, 0.14);
  background: #fff;
  border-radius: 12px;
  padding: 0.55rem 0.95rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease;
}

a.hub-filter:visited {
  color: var(--ink);
}

a.hub-filter.active:visited {
  color: #fff;
}

.hub-filter:hover {
  border-color: rgba(217, 119, 44, 0.45);
  background: #fffaf5;
  transform: translateY(-1px);
}

.hub-filter.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.tools-hub-groups {
  display: grid;
  gap: 1.65rem;
}

.hub-group-head h2 {
  margin: 0 0 0.9rem;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.hub-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 0.85rem;
}

.hub-tile {
  position: relative;
  display: grid;
  gap: 0.4rem;
  align-content: start;
  text-align: left;
  padding: 1.15rem 1.05rem 1.2rem;
  min-height: 7.4rem;
  border: 1.5px solid rgba(14, 26, 34, 0.14);
  border-radius: 16px;
  background:
    linear-gradient(165deg, #ffffff 0%, #ffffff 55%, #f7fafb 100%);
  color: var(--ink);
  text-decoration: none;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 4px 14px rgba(14, 26, 34, 0.07),
    0 14px 28px rgba(14, 26, 34, 0.05);
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
  overflow: hidden;
}

.hub-tile::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--accent), var(--teal));
  opacity: 0.85;
}

a.hub-tile:visited {
  color: var(--ink);
}

.hub-tile:hover {
  border-color: rgba(217, 119, 44, 0.55);
  background:
    linear-gradient(165deg, #fffdf9 0%, #fff8f0 50%, #f3faf8 100%);
  transform: translateY(-3px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 10px 24px rgba(184, 93, 24, 0.14),
    0 18px 36px rgba(14, 26, 34, 0.08);
}

.hub-tile:hover::before {
  width: 5px;
  opacity: 1;
}

.hub-tile:active {
  transform: translateY(-1px);
}

.hub-tile-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  padding-right: 1.8rem;
  padding-left: 0.15rem;
}

.hub-tile-hint {
  font-size: 0.82rem;
  color: var(--ink-soft);
  line-height: 1.4;
  padding-left: 0.15rem;
}

.hub-tile-badge {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.65rem;
  height: 1.45rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #fff;
  background: linear-gradient(145deg, var(--accent), var(--accent-deep));
  box-shadow: 0 3px 10px rgba(184, 93, 24, 0.35);
}

body.is-home .service-nav[hidden],
body.is-home .service-nav {
  display: none !important;
}

body.is-home .workspace,
body.is-home #workspace {
  display: none !important;
}

body.is-home .hero {
  margin-bottom: 1.1rem;
}

body.is-home .topbar {
  margin-bottom: 1rem;
}

.trust-strip {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.55rem;
  justify-content: center;
}

.trust-strip li {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.7rem 0.32rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(14, 26, 34, 0.1);
  box-shadow: 0 1px 2px rgba(14, 26, 34, 0.04);
}

.trust-strip li::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--teal);
}

.drop-col {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-width: 0;
}

.trust-strip--under-drop {
  margin: 0;
  justify-content: flex-start;
}

.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.35rem, 3.2vw, 2.55rem);
  letter-spacing: -0.03em;
  max-width: none;
  white-space: nowrap;
  line-height: 1.05;
}

.hero h1.is-wrap {
  white-space: normal;
}

.hero p {
  margin: 0;
  max-width: none;
  width: 100%;
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1.55;
}

.hero p strong {
  color: var(--ink);
  font-weight: 600;
}

.workspace {
  display: grid;
  grid-template-columns: 1.35fr 0.9fr;
  gap: 1.1rem;
  align-items: start;
  animation: rise 0.95s ease both;
}

.workspace.is-pdf-layout,
.workspace.is-audio-layout {
  grid-template-areas:
    "pdf-tools pdf-tools"
    "drop side";
}

.workspace.is-pdf-merge-layout {
  grid-template-areas:
    "compress-fmt compress-fmt"
    "drop side";
}

.workspace.is-pdf-fmt-layout {
  grid-template-areas:
    "pdf-fmt pdf-fmt"
    "drop side";
}

.workspace.is-pdf-sign-layout {
  grid-template-columns: 1fr;
  grid-template-areas:
    "drop"
    "side";
  gap: 0.85rem;
}

.workspace.is-compress-layout {
  grid-template-areas:
    "compress-fmt compress-fmt"
    "drop side";
}

.workspace.is-pdf-layout > .pdf-tools-bar,
.workspace.is-audio-layout > .pdf-tools-bar {
  grid-area: pdf-tools;
}

.workspace.is-compress-layout > .compress-fmt-bar,
.workspace.is-pdf-merge-layout > .compress-fmt-bar {
  grid-area: compress-fmt;
}

.workspace.is-pdf-fmt-layout > #pdfFromFmtBar,
.workspace.is-pdf-fmt-layout > #pdfToFmtBar {
  grid-area: pdf-fmt;
  width: 100%;
}

.workspace.is-pdf-layout > .drop-col,
.workspace.is-audio-layout > .drop-col,
.workspace.is-compress-layout > .drop-col,
.workspace.is-pdf-merge-layout > .drop-col,
.workspace.is-pdf-fmt-layout > .drop-col,
.workspace.is-pdf-sign-layout > .drop-col {
  grid-area: drop;
}

.workspace.is-pdf-layout > .side,
.workspace.is-audio-layout > .side,
.workspace.is-compress-layout > .side,
.workspace.is-pdf-merge-layout > .side,
.workspace.is-pdf-fmt-layout > .side,
.workspace.is-pdf-sign-layout > .side {
  grid-area: side;
}

/* Sign PDF: compact upload strip (button only) on top, controls below */
.workspace.is-pdf-sign-layout .dropzone {
  height: auto;
  min-height: 0;
  max-height: none;
}

.workspace.is-pdf-sign-layout .dropzone:has(#dropEmpty:not([style*="display: none"])) {
  padding: 0.45rem;
  box-shadow: var(--shadow);
}

.workspace.is-pdf-sign-layout .drop-empty {
  flex: 0 0 auto;
  gap: 0;
  padding: 0.45rem 0.55rem;
  border-style: dashed;
  border-width: 1.5px;
  background: #fff;
  box-shadow: none;
}

.workspace.is-pdf-sign-layout .drop-empty .drop-badge,
.workspace.is-pdf-sign-layout .drop-empty .drop-orb,
.workspace.is-pdf-sign-layout .drop-empty h2,
.workspace.is-pdf-sign-layout .drop-empty .drop-or,
.workspace.is-pdf-sign-layout .drop-empty .drop-hint {
  display: none !important;
}

.workspace.is-pdf-sign-layout .drop-empty .drop-actions {
  margin: 0;
}

.workspace.is-pdf-sign-layout .drop-empty .btn-drop {
  min-height: 2.6rem;
  padding: 0.55rem 1.15rem;
}

.workspace.is-pdf-sign-layout .dropzone:has(.stage.active) {
  min-height: min(70vh, 640px);
}

.workspace.is-pdf-sign-layout .trust-strip--under-drop {
  display: none;
}

.workspace.is-pdf-sign-layout .side {
  width: 100%;
  max-width: none;
}

.workspace.is-pdf-sign-layout #pdfPanel > div:first-child {
  margin-bottom: 0.35rem;
}

.pdf-tools-bar {
  padding: 0.95rem 1rem 1rem;
  border: 1px solid rgba(14, 26, 34, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.88));
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.pdf-tools-bar[hidden] {
  display: none !important;
}

.pdf-tools-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  margin: 0 0 0.75rem;
  padding: 0 0.1rem 0.7rem;
  border-bottom: 1px solid rgba(14, 26, 34, 0.1);
}

.pdf-tools-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.08rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.pdf-tools-head .side-hint {
  margin: 0;
  max-width: 28rem;
}

.pdf-tools-tray {
  padding: 0.65rem;
  border-radius: 16px;
  border: 1px solid rgba(14, 26, 34, 0.1);
  background:
    linear-gradient(180deg, rgba(14, 26, 34, 0.045), rgba(14, 26, 34, 0.02));
  box-shadow: inset 0 1px 2px rgba(14, 26, 34, 0.04);
}

.panel {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(14px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.dropzone {
  height: 520px;
  min-height: 520px;
  max-height: 520px;
  padding: 0.85rem;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(14, 26, 34, 0.16);
  background: rgba(255, 255, 255, 0.78);
  transition:
    border-color 0.25s ease,
    transform 0.25s ease,
    background 0.25s ease,
    box-shadow 0.25s ease;
}

.dropzone:has(#dropEmpty:not([style*="display: none"])) {
  box-shadow:
    var(--shadow),
    0 0 0 1px rgba(217, 119, 44, 0.12);
}

.dropzone.dragover {
  border-color: var(--accent);
  background: rgba(217, 119, 44, 0.1);
  transform: translateY(-2px);
  box-shadow:
    0 20px 48px rgba(217, 119, 44, 0.18),
    0 0 0 2px rgba(217, 119, 44, 0.35);
}

.dropzone.dragover .drop-empty {
  border-color: var(--accent);
  background:
    linear-gradient(180deg, rgba(217, 119, 44, 0.14), rgba(255, 255, 255, 0.92));
  animation: dropPulse 1.1s ease-in-out infinite;
}

.drop-empty {
  flex: 1;
  min-height: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  gap: 0.7rem;
  padding: 1.6rem 1.25rem;
  border: 2.5px dashed rgba(14, 26, 34, 0.34);
  border-radius: calc(var(--radius) - 6px);
  background:
    linear-gradient(180deg, #ffffff 0%, #f3f7f9 100%),
    repeating-linear-gradient(
      -45deg,
      rgba(31, 122, 108, 0.035),
      rgba(31, 122, 108, 0.035) 8px,
      transparent 8px,
      transparent 16px
    );
  background-blend-mode: normal;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.drop-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  box-shadow: 0 8px 18px rgba(14, 26, 34, 0.14);
}

.drop-orb {
  width: 88px;
  height: 88px;
  margin: 0.15rem auto 0;
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(217, 119, 44, 0.98), rgba(31, 122, 108, 0.92));
  display: grid;
  place-items: center;
  color: white;
  font-size: 2.1rem;
  font-weight: 700;
  border: 3px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    0 14px 28px rgba(14, 26, 34, 0.16),
    0 0 0 6px rgba(217, 119, 44, 0.12);
  animation: float 4.5s ease-in-out infinite;
}

.drop-or {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.02rem;
  font-weight: 500;
}

.drop-hint {
  margin: 0;
  max-width: 28rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.4;
  opacity: 0.95;
  padding: 0.45rem 0.75rem;
  border-radius: 10px;
  background: rgba(14, 26, 34, 0.05);
}

.drop-empty h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.55rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.drop-empty p {
  margin: 0;
  color: var(--ink-soft);
}

.drop-actions {
  margin-top: 0.35rem;
}

.btn-drop {
  min-width: 12.5rem;
  min-height: 2.85rem;
  font-size: 1.02rem;
  box-shadow: 0 10px 22px rgba(217, 119, 44, 0.28);
}

@keyframes dropPulse {
  0%,
  100% {
    border-color: rgba(217, 119, 44, 0.55);
  }
  50% {
    border-color: rgba(217, 119, 44, 0.95);
  }
}

.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  border-radius: 999px;
  padding: 0.85rem 1.35rem;
  transition: transform 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--ink);
  color: #fff;
}

.btn-primary:hover {
  background: #162833;
}

.btn-accent {
  background: var(--accent);
  color: #fff;
}

.btn-accent:hover {
  background: var(--accent-deep);
}

.btn-ghost {
  background: #fff;
  color: var(--ink);
  border: 2px solid rgba(14, 26, 34, 0.55);
}

.btn-ghost:hover {
  background: #fff;
  border-color: var(--ink);
}

.actions .btn {
  min-height: 2.85rem;
  padding: 0.7rem 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-width: 2px;
  border-style: solid;
  line-height: 1.2;
  box-sizing: border-box;
}

.actions .btn-accent {
  border-color: var(--accent);
}

.actions .btn-accent:hover {
  border-color: var(--accent-deep);
}

.actions .btn-ghost {
  border-color: rgba(14, 26, 34, 0.65);
}

#resetBtn {
  border: 2px solid rgba(14, 26, 34, 0.65);
  background: #fff;
}

.stage {
  display: none;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 0.75rem;
  overflow: hidden;
}

.stage.active {
  display: flex;
}

.viewer {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  border-radius: 16px;
  overflow: hidden;
  background: #0e1a22;
}

.preview-only {
  position: absolute;
  inset: 0;
  overflow: hidden;
  box-sizing: border-box;
  padding: 1rem;
}

.preview-only[hidden],
.compare[hidden] {
  display: none !important;
}

/* When До/После compare is on (any tab), never show «Исходник». */
.viewer.is-comparing .preview-only,
.viewer.is-comparing .audio-stage,
.viewer.is-comparing .pdf-stage,
.dropzone.is-comparing [data-i18n="labelSource"],
#sourceChip[hidden] {
  display: none !important;
}

.source-carousel {
  position: absolute;
  inset: 1rem;
  display: grid;
  place-items: center;
}

.source-deck {
  position: relative;
  width: 100%;
  height: 100%;
}

.preview-only .preview-frame {
  position: absolute;
  inset: 0;
  border-radius: 4px;
  z-index: 3;
  overflow: visible;
  transition: transform 0.28s ease, opacity 0.28s ease;
}

.source-carousel.is-many .preview-frame {
  inset: 6% 10%;
}

.preview-only .preview-frame img#previewImg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: center;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.35);
  box-shadow: 0 10px 28px rgba(14, 26, 34, 0.16);
}

.source-peek {
  position: absolute;
  inset: 10% 14%;
  border-radius: 4px;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
  opacity: 0.55;
  filter: saturate(0.85);
  box-shadow: 0 8px 22px rgba(14, 26, 34, 0.14);
  transition: transform 0.28s ease, opacity 0.28s ease;
}

.source-peek img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.source-peek-prev {
  transform: translateX(-14%) scale(0.9) rotate(-2.5deg);
  z-index: 2;
}

.source-peek-next {
  transform: translateX(14%) scale(0.9) rotate(2.5deg);
  z-index: 1;
}

.source-carousel.is-sliding-next .preview-frame {
  transform: translateX(-18%) scale(0.94);
  opacity: 0.35;
}

.source-carousel.is-sliding-prev .preview-frame {
  transform: translateX(18%) scale(0.94);
  opacity: 0.35;
}

.source-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  border: 2px solid rgba(14, 26, 34, 0.45);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 14px rgba(14, 26, 34, 0.16);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.source-nav:hover {
  background: #fff;
  border-color: var(--ink);
  transform: translateY(-50%) scale(1.05);
}

.source-nav[hidden] {
  display: none !important;
}

.source-nav-prev {
  left: 0.15rem;
}

.source-nav-next {
  right: 0.15rem;
}

.source-counter {
  position: absolute;
  bottom: 0.35rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: rgba(14, 26, 34, 0.78);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  pointer-events: none;
}

.source-counter[hidden] {
  display: none !important;
}

.preview-only .chip-label {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 6;
}

.compare {
  position: absolute;
  inset: 0;
  overflow: hidden;
  user-select: none;
  touch-action: none;
  cursor: grab;
}

.compare.is-dragging-pan {
  cursor: grabbing;
}

.compare.is-sliding {
  cursor: ew-resize;
}

.compare-scene {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
  will-change: transform;
}

.compare-scene img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.after-clip {
  position: absolute;
  inset: 0;
  clip-path: inset(0 0 0 var(--pos, 50%));
  z-index: 1;
  pointer-events: none;
}

/*
 * Transparent results (bgremove): without this, the original sits under the
 * whole stage, so alpha holes show the old background and look "unremoved".
 */
.compare.is-alpha #beforeScene {
  clip-path: inset(0 calc(100% - var(--pos, 50%)) 0 0);
  z-index: 0;
}

.compare.is-alpha #afterScene {
  background-color: #c8ccd0;
  background-image:
    linear-gradient(45deg, #e8eaed 25%, transparent 25%),
    linear-gradient(-45deg, #e8eaed 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e8eaed 75%),
    linear-gradient(-45deg, transparent 75%, #e8eaed 75%);
  background-size: 18px 18px;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
}

.compare-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos, 50%);
  width: 28px;
  margin-left: -14px;
  z-index: 3;
  cursor: ew-resize;
}

.compare-handle::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.85);
}

.compare-handle::after {
  content: "⟷";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);
}

.compare-labels {
  position: absolute;
  inset: 0.75rem auto auto 0.75rem;
  display: flex;
  gap: 0.4rem;
  z-index: 4;
  pointer-events: none;
}

.zoom-tools {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 4;
  display: flex;
  gap: 0.3rem;
  background: rgba(14, 26, 34, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  padding: 0.25rem;
}

.zoom-tools button {
  appearance: none;
  border: none;
  background: transparent;
  color: #fff;
  min-width: 2rem;
  height: 2rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
}

.zoom-tools button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.chip-label {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(14, 26, 34, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.meta.meta-stacked {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  min-width: 0;
  flex: 1 1 12rem;
}

.meta .meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: baseline;
  min-width: 0;
}

.meta .meta-line-stats {
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.35;
}

.meta .meta-line-info {
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.meta .meta-info-label {
  opacity: 0.9;
}

.meta .meta-line-removed {
  font-weight: 500;
  max-width: 100%;
}

.meta .meta-line-removed span {
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  border-radius: 0.35rem;
  padding: 0.12rem 0.45rem;
}

.meta b {
  color: var(--ink);
  font-weight: 600;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.side {
  padding: 1.15rem;
  display: grid;
  gap: 1rem;
}

.side h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.side-hint {
  margin: 0.4rem 0 0;
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.4;
}

#upscalePanel,
#compressPanel,
#convertPanel,
#audioPanel,
#pdfPanel,
#faceblurPanel,
#bgremovePanel,
#unarchivePanel,
#watermarkPanel,
#cropPanel {
  display: grid;
  gap: 1rem;
}

#compressPanel[hidden],
#convertPanel[hidden],
#audioPanel[hidden],
#pdfPanel[hidden],
#faceblurPanel[hidden],
#bgremovePanel[hidden],
#unarchivePanel[hidden],
#watermarkPanel[hidden],
#upscalePanel[hidden],
#cropPanel[hidden] {
  display: none;
}

#watermarkPanel .field + .field {
  margin-top: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wm-logo-pick {
  width: 100%;
  margin-top: 0.35rem;
  border-radius: 12px;
}

.wm-text-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  margin-top: 0.35rem;
}

.wm-text-row input {
  flex: 1 1 auto;
  min-width: 0;
}

.wm-text-add {
  flex: 0 0 auto;
  border-radius: 12px;
  padding: 0.65rem 1rem;
  white-space: nowrap;
}

#wmLogoFileName:empty {
  display: none;
}

.wm-text-mark {
  position: absolute;
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
  box-sizing: border-box;
  max-width: 90%;
  padding: 0.35rem 0.55rem;
  border: 2px dashed rgba(217, 119, 44, 0.95);
  border-radius: 6px;
  background: rgba(14, 26, 34, 0.45);
  color: #fff;
  font-weight: 700;
  font-size: clamp(0.85rem, 2.4vw, 1.25rem);
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wm-text-mark:active,
.wm-text-mark.is-dragging {
  cursor: grabbing;
  border-style: solid;
}

.wm-text-mark[hidden],
.wm-mark[hidden] {
  display: none !important;
}

#watermarkPanel select,
#watermarkPanel input[type="text"] {
  width: 100%;
}

.crop-layer {
  position: absolute;
  pointer-events: none;
  z-index: 3;
}

.wm-layer {
  position: absolute;
  pointer-events: none;
  z-index: 8;
  overflow: visible;
}

.wm-layer[hidden] {
  display: none !important;
}

.wm-layer.is-ready {
  pointer-events: auto;
}

.wm-mark {
  position: absolute;
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
  box-sizing: border-box;
  border: 2px dashed rgba(217, 119, 44, 0.95);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 12px rgba(14, 26, 34, 0.22);
  user-select: none;
  overflow: visible;
}

.wm-mark:active,
.wm-mark.is-dragging {
  cursor: grabbing;
  border-style: solid;
  border-color: var(--accent-deep);
}

.wm-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.wm-mark-handle {
  position: absolute;
  right: -8px;
  bottom: -8px;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: #fff;
  border: 2px solid var(--ink);
  cursor: nwse-resize;
  pointer-events: auto;
  box-shadow: 0 1px 4px rgba(14, 26, 34, 0.3);
  z-index: 2;
}

.crop-box {
  position: absolute;
  border: 2px solid #fff;
  box-shadow: 0 0 0 9999px rgba(15, 23, 32, 0.45);
  cursor: move;
  pointer-events: auto;
  box-sizing: border-box;
}

.crop-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #fff;
  border: 1px solid var(--ink);
  border-radius: 2px;
  pointer-events: auto;
}

.crop-handle[data-handle="nw"] { left: -6px; top: -6px; cursor: nwse-resize; }
.crop-handle[data-handle="ne"] { right: -6px; top: -6px; cursor: nesw-resize; }
.crop-handle[data-handle="sw"] { left: -6px; bottom: -6px; cursor: nesw-resize; }
.crop-handle[data-handle="se"] { right: -6px; bottom: -6px; cursor: nwse-resize; }

.crop-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.crop-fields .field span {
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.crop-fields input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
}

.crop-fields input:focus {
  outline: none;
  border-color: var(--accent);
}

.format-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}

.convert-pair-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.5rem;
  align-items: stretch;
  margin: 0.25rem 0 0.95rem;
  padding: 0.55rem;
  border-radius: 16px;
  border: 1px solid rgba(14, 26, 34, 0.14);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 20px rgba(14, 26, 34, 0.06);
}

.convert-pair-side {
  display: grid;
  gap: 0.2rem;
  justify-items: start;
  text-align: left;
  min-height: 3.6rem;
  border: 2px dashed rgba(14, 26, 34, 0.28);
  background: #fff;
  border-radius: 14px;
  padding: 0.65rem 0.8rem;
  cursor: pointer;
  color: var(--ink);
  font: inherit;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease,
    transform 0.15s ease;
}

.convert-pair-side:hover {
  border-color: var(--accent);
  border-style: solid;
  background: #fffaf5;
  box-shadow: 0 0 0 3px rgba(217, 119, 44, 0.12);
}

.convert-pair-side.active {
  border-style: solid;
  border-color: var(--ink);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(14, 26, 34, 0.1);
}

.convert-pair-side:has(strong:not(.is-empty)) {
  border-style: solid;
  border-color: rgba(14, 26, 34, 0.35);
}

.convert-pair-kicker {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.72;
}

.convert-pair-side strong {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
}

.convert-pair-side strong.is-empty {
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--accent-deep);
}

.convert-pair-arrow {
  align-self: center;
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 800;
  opacity: 0.55;
}

#convertPickerField {
  padding: 0.75rem;
  border-radius: 16px;
  border: 1px solid rgba(14, 26, 34, 0.16);
  background: #fff;
  box-shadow: 0 10px 24px rgba(14, 26, 34, 0.07);
}

#convertPickerField > label {
  display: block;
  margin-bottom: 0.45rem;
  font-weight: 800;
  color: var(--ink);
}

.convert-picker {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.15rem;
}

.convert-cat-bar {
  padding: 0.4rem;
  border-radius: 12px;
  border: 1px solid rgba(14, 26, 34, 0.12);
  background: rgba(14, 26, 34, 0.05);
}

.convert-cat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
}

.convert-cat-tabs .cat-tab {
  border: 1px solid rgba(14, 26, 34, 0.16);
  background: #fff;
  border-radius: 999px;
  padding: 0.42rem 0.8rem;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.convert-cat-tabs .cat-tab:hover {
  color: var(--ink);
  border-color: rgba(217, 119, 44, 0.5);
  background: #fffaf5;
}

.convert-cat-tabs .cat-tab.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.convert-format-panel {
  padding: 0.7rem;
  border-radius: 12px;
  border: 1px solid rgba(14, 26, 34, 0.14);
  background: rgba(244, 247, 249, 0.9);
}

.convert-format-panel .format-options {
  grid-template-columns: repeat(4, 1fr);
}

#convertPanel .format-btn,
#audioPanel .format-btn {
  border: 1.5px solid rgba(14, 26, 34, 0.2);
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

#convertPanel .format-btn:hover,
#audioPanel .format-btn:hover {
  border-color: var(--accent);
  background: #fffaf5;
}

#convertPanel .format-btn.active,
#audioPanel .format-btn.active {
  border-color: var(--accent-deep);
  background: linear-gradient(135deg, rgba(217, 119, 44, 0.2), rgba(31, 122, 108, 0.12));
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(217, 119, 44, 0.25);
}

.convert-empty {
  margin: 0;
  padding: 0.35rem 0.1rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.45;
}

.pdf-tools {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 0.55rem;
  margin: 0;
}

.pdf-tool {
  display: grid;
  gap: 0.18rem;
  text-align: left;
  padding: 0.7rem 0.75rem;
  border: 1px solid rgba(14, 26, 34, 0.16);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(14, 26, 34, 0.04);
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
  min-height: 100%;
}

a.pdf-tool:visited {
  color: var(--ink);
}

.pdf-tool:hover {
  border-color: var(--accent);
  background: #fffaf5;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(14, 26, 34, 0.08);
}

.pdf-tool.active {
  border-color: var(--accent-deep);
  background: linear-gradient(135deg, rgba(217, 119, 44, 0.2), rgba(31, 122, 108, 0.12));
  box-shadow:
    inset 0 0 0 1px rgba(217, 119, 44, 0.28),
    0 4px 14px rgba(184, 93, 24, 0.12);
}

.pdf-tool-title {
  font-weight: 700;
  font-size: 0.88rem;
  line-height: 1.25;
}

.pdf-tool-hint {
  font-size: 0.75rem;
  color: var(--ink-soft);
  line-height: 1.3;
}

.pdf-tool-badge {
  justify-self: start;
  margin-top: 0.15rem;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--teal));
}

.pdf-options {
  display: grid;
  gap: 0.75rem;
}

.pdf-options[hidden],
#pdfOptions .field[hidden],
#pdfPagesField[hidden],
#pdfSplitModeField[hidden],
#pdfShowPreviewField[hidden],
#pdfPreviewBtnField[hidden],
#pdfPagePicker[hidden],
#pdfAngleField[hidden],
#pdfTextField[hidden],
#pdfWmField[hidden],
#pdfPasswordField[hidden],
#pdfPasswordConfirmField[hidden],
#pdfEditMetaField[hidden],
#pdfQualityField[hidden] {
  display: none !important;
}

.pdf-edit-meta-field {
  display: grid;
  gap: 0.55rem;
}

.pdf-edit-meta-grid {
  display: grid;
  gap: 0.55rem;
}

.pdf-edit-meta-grid .field input[readonly] {
  opacity: 0.72;
  cursor: default;
}

.pdf-edit-meta-status {
  color: var(--muted, #6b7280);
}

.pdf-split-modes {
  margin-top: 0.35rem;
}

.pdf-check-field {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  user-select: none;
}

.pdf-check-field input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.pdf-check-field > span {
  min-width: 0;
  line-height: 1.25;
}

#pdfPreviewBtn.active {
  border-color: var(--accent);
  color: var(--accent);
}

.pdf-page-picker.is-view-only .pdf-page-card {
  cursor: default;
}

.pdf-page-picker.is-view-only .pdf-page-card input {
  display: none;
}

.pdf-page-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pdf-page-picker-actions {
  display: flex;
  gap: 0.35rem;
}

.pdf-page-picker-btn {
  padding: 0.25rem 0.55rem;
  font-size: 0.85rem;
}

.pdf-page-picker-hint {
  margin: 0.35rem 0 0.55rem;
}

.pdf-stage {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
  padding: 0.85rem 1rem 1rem;
  overflow: auto;
  box-sizing: border-box;
  background:
    linear-gradient(180deg, #f4f6f8 0%, #e9eef2 100%);
  color: var(--ink, #0e1a22);
}

.pdf-stage[hidden] {
  display: none !important;
}

.pdf-stage > .chip-label {
  flex: 0 0 auto;
}

.pdf-stage .pdf-page-picker {
  flex: 1 1 auto;
  min-height: min-content;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: visible;
}

.pdf-stage .pdf-page-picker[hidden] {
  display: none !important;
}

.pdf-stage .pdf-page-picker-hint {
  color: rgba(14, 26, 34, 0.72);
}

.pdf-stage .pdf-page-grid {
  flex: 0 0 auto;
  max-height: none;
  min-height: 0;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 0.7rem;
  padding: 0.2rem 0.1rem 0.35rem;
  overflow: visible;
}

.pdf-stage .pdf-page-card img {
  height: 140px;
}

.pdf-stage .pdf-sign-stage {
  flex: 1 1 auto;
  margin-top: 0;
  min-height: min(58vh, 620px);
  max-height: none;
}

.workspace.is-pdf-sign-layout .pdf-stage .pdf-page-picker {
  flex: 0 0 auto;
}

.workspace.is-pdf-sign-layout .pdf-stage .pdf-page-card img {
  height: 84px;
}

.workspace.is-pdf-sign-layout .pdf-stage .pdf-page-picker-hint {
  margin: 0.25rem 0 0.4rem;
  font-size: 0.82rem;
}

.pdf-compare-summary {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(14, 26, 34, 0.1);
}

.pdf-compare-summary[hidden] {
  display: none !important;
}

.pdf-compare-summary-line {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: rgba(14, 26, 34, 0.88);
}

.pdf-compare-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.65rem;
}

.pdf-compare-swatch {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: rgba(14, 26, 34, 0.72);
}

.pdf-compare-swatch::before {
  content: "";
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 3px;
  flex-shrink: 0;
}

.pdf-compare-swatch.is-same::before {
  background: #16a34a;
}

.pdf-compare-swatch.is-diff::before {
  background: #f59e0b;
}

.pdf-compare-swatch.is-removed::before {
  background: #ef4444;
}

.pdf-compare-swatch.is-added::before {
  background: #22c55e;
}

.pdf-page-card.is-compare-same {
  border-color: #16a34a;
}

.pdf-page-card.is-compare-diff {
  border-color: #f59e0b;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.35);
}

.pdf-page-card.is-compare-legend {
  border-color: rgba(14, 26, 34, 0.2);
  opacity: 0.92;
}

.pdf-page-card .pdf-compare-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  background: rgba(14, 26, 34, 0.72);
  z-index: 2;
}

.pdf-page-card.is-compare-same .pdf-compare-badge {
  background: #16a34a;
}

.pdf-page-card.is-compare-diff .pdf-compare-badge {
  background: #d97706;
}

.pdf-page-card.is-compare-legend .pdf-compare-badge {
  background: #64748b;
}

.pdf-stage.is-compare .pdf-page-grid {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.pdf-stage.is-compare .pdf-page-card img {
  height: 120px;
}

.pdf-page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 0.55rem;
  max-height: 320px;
  overflow: auto;
  padding: 0.15rem;
}

.pdf-page-card {
  position: relative;
  display: block;
  margin: 0;
  padding: 0;
  border: 2px solid rgba(14, 26, 34, 0.12);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
  text-align: center;
}

.pdf-page-card img {
  display: block;
  width: 100%;
  height: 110px;
  object-fit: contain;
  background: #f3f5f7;
}

.pdf-page-card .pdf-page-num {
  display: block;
  font-size: 0.75rem;
  padding: 0.25rem 0.2rem;
  color: rgba(14, 26, 34, 0.72);
}

.pdf-page-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pdf-page-card.is-selected {
  border-color: var(--accent, #0f766e);
  box-shadow: 0 0 0 1px var(--accent, #0f766e);
}

.pdf-page-card.is-selected::after {
  content: "✓";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  background: var(--accent, #0f766e);
  color: #fff;
  font-size: 0.75rem;
  line-height: 1.25rem;
  font-weight: 700;
}

.pdf-sign-field {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.pdf-sign-modes {
  margin-top: 0.35rem;
}

.pdf-sign-image-controls .field {
  margin: 0;
}

.pdf-sign-draw-controls {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.pdf-sign-draw-controls[hidden],
.pdf-sign-image-controls[hidden] {
  display: none !important;
}

.pdf-sign-colors {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.pdf-sign-color {
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  border: 2px solid rgba(14, 26, 34, 0.18);
  padding: 0;
  cursor: pointer;
  background: var(--c, #111);
}

.pdf-sign-color[data-color="#111111"] {
  --c: #111111;
}

.pdf-sign-color[data-color="#0a2a6b"] {
  --c: #0a2a6b;
}

.pdf-sign-color[data-color="#c41e1e"] {
  --c: #c41e1e;
}

.pdf-sign-color.active {
  outline: 2px solid var(--accent, #0f766e);
  outline-offset: 2px;
  border-color: transparent;
}

.pdf-sign-clear {
  align-self: flex-start;
  padding: 0.3rem 0.65rem;
  font-size: 0.85rem;
}

#pdfSignDrawCanvas {
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 360 / 150;
  border: 1px solid rgba(14, 26, 34, 0.14);
  border-radius: 10px;
  background:
    linear-gradient(90deg, rgba(14, 26, 34, 0.04) 1px, transparent 1px) 0 0 / 16px 16px,
    linear-gradient(rgba(14, 26, 34, 0.04) 1px, transparent 1px) 0 0 / 16px 16px,
    #fff;
  touch-action: none;
  cursor: crosshair;
}

.pdf-sign-stage {
  margin-top: 0.15rem;
  border: 1px solid rgba(14, 26, 34, 0.12);
  border-radius: 12px;
  background: #e8ecef;
  overflow: auto;
  max-height: none;
}

.pdf-sign-page {
  position: relative;
  display: block;
  width: 100%;
  min-height: min(58vh, 620px);
  margin: 0 auto;
  background: #fff;
}

#pdfSignPageImg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: top center;
  user-select: none;
  -webkit-user-drag: none;
}

#pdfSignPageImg:not([src]),
#pdfSignPageImg[src=""] {
  display: none;
}

.pdf-sign-empty {
  margin: 0;
  padding: 2.5rem 1rem;
  text-align: center;
  color: rgba(14, 26, 34, 0.55);
  font-size: 0.92rem;
}

.pdf-sign-page.has-page .pdf-sign-empty {
  display: none;
}

.pdf-sign-mark {
  position: absolute;
  left: 0;
  top: 0;
  width: 22%;
  cursor: grab;
  touch-action: none;
  z-index: 2;
  box-sizing: border-box;
  padding: 3px;
  border: 2px dashed #0f766e;
  border-radius: 6px;
  background: rgba(15, 118, 110, 0.08);
  outline: 2px solid rgba(255, 255, 255, 0.92);
  outline-offset: 1px;
  box-shadow:
    0 0 0 3px rgba(15, 118, 110, 0.35),
    0 2px 10px rgba(0, 0, 0, 0.22);
}

.pdf-sign-mark.is-dragging {
  cursor: grabbing;
  border-color: #0d9488;
  background: rgba(13, 148, 136, 0.14);
  box-shadow:
    0 0 0 3px rgba(13, 148, 136, 0.45),
    0 4px 14px rgba(0, 0, 0, 0.28);
}

.pdf-sign-mark img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  user-select: none;
  border-radius: 3px;
}

.pdf-sign-mark img[hidden],
.pdf-sign-mark-text[hidden] {
  display: none !important;
}

.pdf-sign-mark-text {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 0.35em 0.15em;
  text-align: center;
  font-size: clamp(0.85rem, 4.2vw, 1.65rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.02em;
  color: rgba(70, 70, 70, 0.72);
  word-break: break-word;
  pointer-events: none;
  user-select: none;
}

.pdf-wm-text-controls[hidden],
#pdfWmField[hidden] {
  display: none !important;
}

.pdf-sign-handle {
  position: absolute;
  right: -8px;
  bottom: -8px;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: #0f766e;
  border: 2px solid #fff;
  box-shadow:
    0 0 0 2px rgba(15, 118, 110, 0.45),
    0 2px 6px rgba(0, 0, 0, 0.35);
  cursor: nwse-resize;
  touch-action: none;
}

#pdfPanel select,
#pdfPanel input[type="text"] {
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(14, 26, 34, 0.16);
  border-radius: 10px;
  font: inherit;
  background: #fff;
}

.audio-stage {
  display: grid;
  gap: 0.75rem;
  align-content: center;
  justify-items: stretch;
  min-height: 220px;
  padding: 1rem 0.25rem;
}

.audio-stage[hidden] {
  display: none !important;
}

.audio-stage .chip-label {
  justify-self: start;
}

.audio-media {
  width: 100%;
  max-width: 100%;
  border-radius: 14px;
  background: rgba(14, 26, 34, 0.06);
}

.audio-media[hidden] {
  display: none !important;
}

#audioVideoPreview.audio-media {
  max-height: 280px;
  background: #0e1a22;
}

.audio-file-name {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
  word-break: break-word;
}

.audio-transcript-wrap {
  display: grid;
  gap: 0.45rem;
  width: 100%;
}

.audio-transcript-wrap[hidden] {
  display: none !important;
}

.audio-transcript {
  width: 100%;
  min-height: 12rem;
  resize: vertical;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(14, 26, 34, 0.14);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font: inherit;
  line-height: 1.45;
}

.audio-waveform {
  display: grid;
  gap: 0.65rem;
  width: 100%;
}

.audio-waveform[hidden] {
  display: none !important;
}

.wave-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.wave-btn {
  padding: 0.45rem 0.75rem;
  font-size: 0.82rem;
}

.wave-btn.is-playing {
  border-color: color-mix(in srgb, var(--teal, #1f7a6c) 45%, transparent);
  color: var(--teal, #1f7a6c);
}

.wave-clock {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.wave-track {
  position: relative;
  height: 112px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(14, 26, 34, 0.16);
  background:
    linear-gradient(180deg, rgba(14, 26, 34, 0.04), rgba(14, 26, 34, 0.08)),
    #fff;
  cursor: pointer;
  touch-action: none;
  user-select: none;
}

.wave-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.wave-dim {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(14, 26, 34, 0.28);
  pointer-events: none;
  z-index: 1;
}

.wave-dim-left {
  left: 0;
}

.wave-dim-right {
  right: 0;
}

.wave-selection {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(217, 119, 44, 0.16);
  border-top: 2px solid rgba(217, 119, 44, 0.55);
  border-bottom: 2px solid rgba(217, 119, 44, 0.55);
  pointer-events: auto;
  cursor: grab;
  z-index: 2;
}

.wave-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 14px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: ew-resize;
  z-index: 4;
  transform: translateX(-50%);
}

.wave-handle::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: var(--accent-deep);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.wave-handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 28px;
  transform: translate(-50%, -50%);
  border-radius: 8px;
  background: var(--accent);
  box-shadow: 0 2px 8px rgba(184, 93, 24, 0.35);
}

.wave-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--teal);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5);
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 5;
}

.wave-playhead.is-scrubbing {
  width: 3px;
  background: var(--accent-deep, #b85d18);
}

.wave-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.wave-legend-mid {
  text-align: center;
  flex: 1;
  min-width: 0;
}

.wave-seek-row {
  margin-top: 0.55rem;
}

.wave-seek {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 0.55rem;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--accent) 0%,
    var(--accent) var(--wave-seek-pct, 0%),
    rgba(14, 26, 34, 0.12) var(--wave-seek-pct, 0%),
    rgba(14, 26, 34, 0.12) 100%
  );
  outline: none;
  cursor: pointer;
}

.wave-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--teal, #1f7a6c);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(14, 26, 34, 0.25);
  cursor: grab;
}

.wave-seek::-moz-range-thumb {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--teal, #1f7a6c);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(14, 26, 34, 0.25);
  cursor: grab;
}

@media (max-width: 560px) {
  .wave-track {
    height: 96px;
  }

  .wave-legend-mid {
    display: none;
  }

  .wave-toolbar .wave-btn {
    flex: 1 1 auto;
  }
}

@media (max-width: 720px) {
  .convert-format-panel .format-options {
    grid-template-columns: repeat(3, 1fr);
  }
}

.format-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  padding: 0.55rem 0.3rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.format-btn:hover {
  border-color: rgba(217, 119, 44, 0.45);
  color: var(--ink);
}

.format-btn.active {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(217, 119, 44, 0.14), rgba(31, 122, 108, 0.08));
  color: var(--ink);
}

.quality-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.quality-label #qualityValue {
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.quality-range {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

.eq-live-hint {
  margin: 0.15rem 0 0.45rem;
  font-size: 0.8rem;
}

.eq-reset {
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.15rem 0.25rem;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.eq-reset:hover {
  color: var(--ink);
}

.eq-bands {
  display: flex;
  gap: 0.2rem;
  justify-content: space-between;
  align-items: stretch;
  padding: 0.25rem 0 0.1rem;
  min-height: 10.5rem;
}

.eq-band {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.28rem;
  min-width: 0;
}

.eq-band-gain {
  font-size: 0.62rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--muted, rgba(14, 26, 34, 0.55));
  line-height: 1;
  min-height: 0.75rem;
}

.eq-band-slider-wrap {
  position: relative;
  width: 100%;
  height: 7.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.eq-band-slider-wrap input[type="range"] {
  width: 7.25rem;
  height: 1.25rem;
  margin: 0;
  transform: rotate(-90deg);
  transform-origin: center center;
  accent-color: var(--accent);
  cursor: pointer;
  background: transparent;
}

.eq-band-hz {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  white-space: nowrap;
  line-height: 1;
}

@media (max-width: 520px) {
  .eq-bands {
    gap: 0.1rem;
    min-height: 9.5rem;
  }
  .eq-band-slider-wrap {
    height: 6.4rem;
  }
  .eq-band-slider-wrap input[type="range"] {
    width: 6.4rem;
  }
  .eq-band-hz {
    font-size: 0.55rem;
  }
}

.compress-mode-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.compress-fmt-bar {
  width: 100%;
  padding: 0.95rem 1rem 1rem;
  border: 1px solid rgba(14, 26, 34, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.88));
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.compress-fmt-bar[hidden] {
  display: none !important;
}

.compress-fmt-tray {
  width: 100%;
}

.compress-fmt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  width: 100%;
}

.compress-fmt-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.2rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.compress-fmt-chip:hover {
  border-color: rgba(217, 119, 44, 0.45);
  color: var(--ink);
}

.compress-fmt-chip.active {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(217, 119, 44, 0.16), rgba(31, 122, 108, 0.1));
  color: var(--ink);
}

.compress-target-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem;
  align-items: stretch;
}

.compress-target-input,
.compress-target-unit {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.55rem 0.7rem;
}

.compress-target-input {
  min-width: 0;
}

.compress-target-unit {
  cursor: pointer;
  min-width: 4.5rem;
}

#compressTargetField .side-hint {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
}

.unarchive-files {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  align-items: center;
}

.unarchive-file-link {
  color: var(--teal);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.unarchive-file-link:hover {
  color: var(--accent);
}

.models {
  display: grid;
  gap: 0.55rem;
  max-height: min(52vh, 420px);
  overflow-y: auto;
  padding-right: 0.15rem;
}

.model {
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  padding: 0.85rem 0.95rem;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.model:hover {
  transform: translateY(-1px);
  border-color: rgba(217, 119, 44, 0.45);
}

.model.active {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(217, 119, 44, 0.12), rgba(31, 122, 108, 0.08));
}

.model-name {
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.model p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.4;
}

.model p.model-best {
  margin-bottom: 0.4rem;
  color: var(--teal);
  font-weight: 600;
  font-size: 0.8rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.55rem;
}

.tag {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
}

.field {
  display: grid;
  gap: 0.4rem;
}

/* Must beat .field { display:grid } so checkbox + label stay on one row */
label.field.pdf-check-field {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.55rem;
}

/* .field { display:grid } would otherwise override the HTML hidden attribute */
.field[hidden],
#compressQualityField[hidden],
#compressTargetField[hidden] {
  display: none !important;
}

.field-inline {
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 0.55rem;
  white-space: nowrap;
}

.field label {
  font-size: 0.82rem;
  color: var(--ink-soft);
  letter-spacing: 0.03em;
}

.scale-options {
  display: flex;
  align-items: baseline;
}

.scale-value {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
}

.scale-select {
  appearance: none;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  border-radius: 0;
  padding: 0.2rem 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}

.scale-select:focus {
  outline: none;
  border-bottom-color: var(--accent);
}

.progress {
  display: none;
  gap: 0.55rem;
}

.progress.active {
  display: grid;
}

.bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(14, 26, 34, 0.08);
  overflow: hidden;
}

.bar > i {
  display: block;
  height: 100%;
  width: 35%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--teal));
  animation: slide 1.2s ease-in-out infinite;
}

.progress span {
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.landing-block {
  margin: 2.25rem 0 0;
  padding: 1.25rem 1.3rem 1.4rem;
  border: 1px solid rgba(14, 26, 34, 0.12);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(248, 250, 252, 0.7));
  box-shadow: 0 12px 32px rgba(14, 26, 34, 0.06);
  animation: rise 1s ease both;
}

.landing-block h2 {
  margin: 0 0 0.55rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(14, 26, 34, 0.08);
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  letter-spacing: -0.02em;
}

.seo-article {
  display: grid;
  gap: 0.85rem;
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.55;
  max-width: 52rem;
}

.seo-article p {
  margin: 0;
}

.landing-lead {
  margin: 0 0 1rem;
  color: var(--ink-soft);
  font-size: 1.02rem;
  line-height: 1.5;
  max-width: 52rem;
}

.format-chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.format-chips li {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  padding: 0.38rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}

.how-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  counter-reset: how;
}

.how-steps li {
  counter-increment: how;
  position: relative;
  padding: 1rem 1rem 1rem 3.1rem;
  border: 1px solid rgba(14, 26, 34, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  border-top: 2px solid rgba(31, 122, 108, 0.45);
}

.how-steps li::before {
  content: counter(how);
  position: absolute;
  left: 0;
  top: 0.85rem;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
}

.how-steps h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-family: var(--font-body);
  font-weight: 700;
}

.how-steps p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.5;
}

.benefits {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
}

.benefits article {
  padding: 1rem 1.05rem;
  border: 1px solid rgba(14, 26, 34, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.benefits article h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-family: var(--font-body);
  font-weight: 700;
}

.benefits article p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.5;
}

.share-block {
  padding: 1.35rem 1.25rem 1.45rem;
  border-radius: var(--radius);
  border: 1px solid rgba(14, 26, 34, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(243, 247, 249, 0.95));
  box-shadow: 0 14px 36px rgba(14, 26, 34, 0.06);
}

.share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.35rem;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.55rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #fff;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 8px 18px rgba(14, 26, 34, 0.12);
}

.share-btn svg {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
}

.share-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.share-btn:active {
  transform: translateY(0);
}

.share-vk { background: #0077ff; }
.share-tg { background: #229ed9; }
.share-wa { background: #25d366; }
.share-fb { background: #1877f2; }
.share-li { background: #0a66c2; }
.share-reddit { background: #ff4500; }
.share-x { background: #111827; }
.share-ok { background: #ee8208; }
.share-mail { background: #1f7a6c; }
.share-copy {
  background: #fff;
  color: var(--ink);
  border-color: rgba(14, 26, 34, 0.18);
  box-shadow: 0 8px 18px rgba(14, 26, 34, 0.08);
}

.share-copied {
  margin: 0.75rem 0 0;
  color: var(--teal);
  font-size: 0.92rem;
  font-weight: 600;
}

.share-copied[hidden] {
  display: none;
}

.html-sitemap {
  margin: 0 0 1.5rem;
}

.html-sitemap[hidden] {
  display: none !important;
}

.html-sitemap-inner {
  display: grid;
  gap: 1.35rem 1.75rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

.html-sitemap-group h2 {
  margin: 0 0 0.55rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid rgba(14, 26, 34, 0.1);
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.html-sitemap-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.html-sitemap-list a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
  line-height: 1.4;
}

.html-sitemap-list a:hover {
  color: var(--teal);
  text-decoration: underline;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.15rem;
  margin: 1.75rem 0 0;
  font-size: 0.92rem;
}

.footer-nav a {
  color: var(--ink-soft);
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--teal);
  text-decoration: underline;
}

.footer-note {
  margin-top: 1.25rem;
  width: 100%;
  max-width: none;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.55;
  animation: rise 1.05s ease both;
}

@media (max-width: 560px) {
  .pdf-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pdf-tool-hint {
    display: none;
  }

  .share-btn span {
    display: none;
  }

  .share-btn {
    min-width: 2.55rem;
    justify-content: center;
    padding: 0.55rem;
  }

  .share-btn svg {
    width: 1.25rem;
    height: 1.25rem;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(31, 122, 108, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(31, 122, 108, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(31, 122, 108, 0);
  }
}

@keyframes slide {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(320%);
  }
}

@media (max-width: 900px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .workspace.is-pdf-layout,
  .workspace.is-audio-layout {
    grid-template-areas:
      "pdf-tools"
      "drop"
      "side";
  }

  .workspace.is-compress-layout,
  .workspace.is-pdf-merge-layout {
    grid-template-areas:
      "compress-fmt"
      "drop"
      "side";
  }

  .workspace.is-pdf-fmt-layout {
    grid-template-areas:
      "pdf-fmt"
      "drop"
      "side";
  }

  .dropzone {
    height: 420px;
    min-height: 420px;
    max-height: 420px;
  }

  .workspace.is-pdf-sign-layout .dropzone {
    height: auto;
    min-height: 0;
    max-height: none;
  }

  .workspace.is-pdf-sign-layout .dropzone:has(.stage.active) {
    min-height: min(70vh, 560px);
  }

  .how-steps,
  .benefits {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .app {
    width: min(100% - 1.2rem, 1180px);
  }

  .hub-tiles {
    grid-template-columns: 1fr 1fr;
  }

  .service-nav {
    width: 100%;
    gap: 0.1rem 0.05rem;
  }

  .service-nav .mode-btn {
    padding: 0.3rem 0.42rem;
    font-size: 0.78rem;
  }

  .hero h1 {
    white-space: normal;
  }

  .topbar {
    flex-wrap: wrap;
    align-items: center;
  }

  .topbar .brand {
    order: 1;
  }

  .topbar-right {
    order: 2;
    margin-inline-start: auto;
  }

  .topbar .hub-categories {
    order: 3;
    flex: 1 1 100%;
    width: 100%;
  }
}
