/* Compress PDF — a hero uploader (after="hide") over a form: the Document
   card (file, level picker, status, Options | Compress) and a Result card
   (hero percentage, size tiles, note, Download). The layout is
   styles/components/form.css; only the level picker, the file name and the
   result's colours and bar are the page's own. */

/* The PDF's name: one line, truncated, full name on hover. */
.cp-file {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

/* ── Compression level (three captioned choices) ──────────────────────────── */
.seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}

.seg__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 10px 8px;
  min-width: 0;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  text-align: center;
  transition:
    border-color var(--duration-snap) var(--ease-standard),
    background var(--duration-snap) var(--ease-standard),
    box-shadow var(--duration-snap) var(--ease-standard);
}

.seg__btn:hover { border-color: var(--accent); }

.seg__btn.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.seg__title {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.seg__sub {
  margin-block-start: 2px;
  font-size: 11.5px;
  color: var(--text-muted);
  text-wrap: balance;
}

.seg__btn.is-active .seg__sub { color: var(--accent-strong); }

/* ── Result ────────────────────────────────────────────────────────────────── */
.cp-pct { color: var(--accent); }
.cp-result--warn .cp-pct { color: var(--text-muted); }

.cp-bar {
  inline-size: min(100%, 360px);
  block-size: 8px;
  margin-block-start: var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  overflow: hidden;
}

.cp-bar__fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: inherit;
  transition: width var(--duration-snap) var(--ease-standard);
}

.cp-result--warn .cp-bar__fill { background: var(--text-muted); }

.cp-new { color: var(--accent-strong); }
.cp-result--warn .cp-new { color: var(--text); }
