:root {
  --bg-top: #c9d4dd;
  --bg-bottom: #0b1c25;
  --paper: rgba(255, 251, 242, 0.92);
  --panel: rgba(22, 48, 65, 0.92);
  --ink: #24303a;
  --muted: #516271;
  --line: rgba(30, 115, 190, 0.16);
  --accent: #3fa9f5;
  --accent-dark: #1e73be;
  --accent-soft: rgba(63, 169, 245, 0.14);
  --gold: #f6c453;
  --gold-soft: rgba(246, 196, 83, 0.16);
  --success: #1d7a59;
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow: 0 28px 90px rgba(6, 20, 31, 0.22);
  --tool-card-height: 1140px;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(201, 212, 221, 0.94), rgba(11, 28, 37, 0.96)),
    var(--pattern-url, url("./assets/pattern.png"));
  background-size: cover, 420px;
  background-attachment: fixed, fixed;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(8px);
}

body::before {
  width: 420px;
  height: 420px;
  top: -110px;
  right: -120px;
  background: rgba(246, 196, 83, 0.22);
}

body::after {
  width: 320px;
  height: 320px;
  left: -70px;
  bottom: 14%;
  background: rgba(63, 169, 245, 0.14);
}

body.auth-pending .page-shell {
  opacity: 0;
  pointer-events: none;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 0;
}

.intro-grid {
  display: grid;
  gap: 24px;
  margin-bottom: 28px;
}

.intro-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(300px, 0.95fr);
  gap: 24px;
  align-items: stretch;
  margin-top: 28px;
}

.hero-copy,
.hero-panel,
.tool-card,
.info-card {
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-copy {
  padding: 34px;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(160deg, rgba(255, 251, 242, 0.96), rgba(239, 245, 249, 0.84));
}

.hero-copy h1 {
  margin: 0 0 14px;
  max-width: 12ch;
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  line-height: 0.92;
  letter-spacing: -0.05em;
}

.hero-copy--wide h1 {
  max-width: 13ch;
}

.hero-copy--wide .lede {
  max-width: none;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.hero-logo {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 24px rgba(30, 115, 190, 0.18);
  object-fit: cover;
}

.eyebrow,
.section-kicker,
.panel-label {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-dark);
}

.lede {
  margin: 0;
  max-width: 48ch;
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.7;
}

.hero-panel {
  padding: 28px;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 24%),
    var(--panel);
  color: #f7f2ea;
  position: relative;
  overflow: hidden;
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: auto -40px -50px auto;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: rgba(246, 196, 83, 0.18);
  filter: blur(18px);
}

.hero-mascot {
  position: relative;
  z-index: 1;
  display: block;
  width: min(100%, 260px);
  margin: 8px auto 18px;
  filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.2));
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: grid;
  gap: 12px;
}

.feature-menu {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
}

.feature-button {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.08);
  color: #f7f2ea;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
  display: grid;
  gap: 4px;
}

.feature-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

.feature-button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.12);
}

.feature-button:disabled:hover {
  transform: none;
  background: rgba(255, 255, 255, 0.05);
}

.feature-button.is-active {
  background: rgba(246, 196, 83, 0.18);
  border-color: rgba(246, 196, 83, 0.42);
  color: #fff8ea;
}

.feature-button.is-active:disabled {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(247, 242, 234, 0.74);
}

.feature-button strong,
.feature-button span {
  display: block;
}

.feature-button strong {
  font-size: 0.98rem;
  font-weight: 700;
}

.feature-button span {
  color: rgba(247, 242, 234, 0.8);
  font-size: 0.82rem;
  line-height: 1.45;
}

.feature-button.is-active span {
  color: rgba(255, 248, 234, 0.88);
}

.feature-button.is-active:disabled span {
  color: rgba(247, 242, 234, 0.58);
}

.feature-list li {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  z-index: 1;
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.95fr) minmax(0, 1.75fr);
  gap: 24px;
  align-items: stretch;
}

.side-column {
  display: grid;
  gap: 24px;
  align-self: stretch;
}

.tool-column {
  display: grid;
  gap: 24px;
}

.tool-card,
.info-card {
  border-radius: var(--radius-xl);
  background: var(--paper);
}

.tool-card {
  padding: 28px;
}

.tool-card-main {
  min-width: 0;
  position: relative;
  height: var(--tool-card-height);
  min-height: var(--tool-card-height);
  max-height: var(--tool-card-height);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.functions-panel {
  height: var(--tool-card-height);
  min-height: var(--tool-card-height);
  max-height: var(--tool-card-height);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.tool-card-scroll {
  width: 100%;
  height: 100%;
  flex: 1 1 auto;
  max-height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 24px;
  overflow-y: auto;
  scrollbar-gutter: stable;
  padding-right: 8px;
}

.tool-card-scroll::-webkit-scrollbar {
  width: 10px;
}

.tool-card-scroll::-webkit-scrollbar-track {
  background: rgba(30, 115, 190, 0.08);
  border-radius: 999px;
}

.tool-card-scroll::-webkit-scrollbar-thumb {
  background: rgba(30, 115, 190, 0.28);
  border-radius: 999px;
}

.tool-card-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(30, 115, 190, 0.42);
}

.functions-panel.is-locked .hero-mascot {
  opacity: 0.68;
  filter: grayscale(0.18) drop-shadow(0 18px 34px rgba(0, 0, 0, 0.16));
}

.functions-lock-message {
  position: relative;
  z-index: 1;
  margin: 16px 0 0;
  color: rgba(247, 242, 234, 0.82);
  line-height: 1.55;
}

.subscription-card {
  padding: 28px;
  align-self: stretch;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.subscription-summary {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.info-card {
  padding: 28px;
  align-self: start;
}

.tool-header,
.queue-head,
.actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.tool-header h2,
.info-card h2,
.queue-head h3 {
  margin: 0;
}

.tool-title-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tool-icon {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 14px 28px rgba(30, 115, 190, 0.14);
  object-fit: cover;
}

.beta-pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: #6f4a00;
  font-weight: 700;
  font-size: 0.88rem;
}

.tool-panel {
  display: block;
}

.tool-panel-fusion {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  align-items: stretch;
}

.tool-panel-gallery {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  align-items: stretch;
}

.tool-card-main.is-locked > :not(.tool-access-overlay) {
  opacity: 0.34;
  filter: grayscale(0.22);
  pointer-events: none;
  user-select: none;
}

.tool-access-overlay {
  position: absolute;
  inset: 24px;
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 28px;
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(255, 251, 242, 0.96), rgba(239, 245, 249, 0.94));
  border: 1px solid rgba(30, 115, 190, 0.12);
  box-shadow: 0 18px 44px rgba(6, 20, 31, 0.12);
  text-align: left;
  z-index: 4;
}

.tool-access-overlay h3 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.tool-access-overlay .lede {
  max-width: none;
}

.tool-access-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.api-config {
  display: grid;
  gap: 8px;
  margin-top: 24px;
}

.api-config span {
  font-size: 0.9rem;
  font-weight: 700;
}

.field-hint {
  color: var(--muted);
  line-height: 1.5;
}

.api-config input,
.ghost-button,
.primary-button,
.download-link {
  border-radius: var(--radius-md);
  font: inherit;
}

.api-config input {
  width: 100%;
  border: 1px solid var(--line);
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.85);
}

.dropzone {
  position: relative;
  margin-top: 20px;
  padding: 28px;
  border: 2px dashed rgba(30, 115, 190, 0.28);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(63, 169, 245, 0.08)),
    #fff;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  cursor: pointer;
}

.dropzone-large {
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fusion-dropzone {
  flex: 1 1 auto;
  min-height: 0;
  align-items: stretch;
  justify-content: flex-start;
  gap: 18px;
  overflow: hidden;
}

.tool-drop-gallery {
  flex: 1 1 auto;
  min-height: 0;
  align-items: stretch;
  justify-content: flex-start;
  gap: 18px;
  overflow: hidden;
}

.tool-drop-gallery input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  inset: auto;
  opacity: 0;
}

.tool-drop-gallery .dropzone-copy {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.tool-drop-gallery.has-content .dropzone-copy {
  display: none;
}

.tool-drop-gallery .page-list,
.tool-drop-gallery .file-list {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  align-content: start;
  overflow-y: auto;
  padding-right: 6px;
}

.tool-drop-gallery .page-list:empty,
.tool-drop-gallery .file-list:empty {
  display: none;
}

.tool-drop-gallery .page-row,
.tool-drop-gallery .file-item:not(.fusion-file-item) {
  grid-template-columns: 1fr;
  gap: 12px;
  align-content: start;
  padding: 12px;
}

.tool-drop-gallery .page-preview {
  width: 100%;
  min-width: 0;
  min-height: 152px;
}

.tool-drop-gallery .page-meta {
  align-items: center;
  text-align: center;
}

.tool-drop-gallery .page-actions,
.tool-drop-gallery .file-actions {
  justify-content: center;
  flex-wrap: wrap;
}

.fusion-dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  inset: auto;
  opacity: 0;
}

.fusion-dropzone-copy {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-right: 0;
  text-align: center;
}

.fusion-dropzone.has-files .fusion-dropzone-copy {
  display: none;
}

.fusion-dropzone-copy .drop-title {
  margin-bottom: 4px;
}

.fusion-dropzone-copy .drop-subtitle {
  max-width: 52ch;
  margin-left: auto;
  margin-right: auto;
}

.fusion-file-list {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(152px, 1fr));
  align-content: start;
  overflow-y: auto;
  padding-right: 6px;
}

.file-list.fusion-file-list:empty {
  min-height: 0;
  display: none;
  border: 0;
  background: transparent;
  margin-top: 0;
}

.file-list.fusion-file-list:empty::before {
  content: none;
  display: none;
}

.file-item.fusion-file-item {
  grid-template-columns: 1fr;
  align-content: start;
  cursor: grab;
  gap: 12px;
  padding: 12px;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    margin 160ms ease,
    opacity 160ms ease;
}

.file-item.fusion-file-item.is-dragging {
  opacity: 0.72;
  transform: translateY(-6px) rotate(-1deg);
  border-color: rgba(30, 115, 190, 0.3);
  box-shadow: 0 26px 40px rgba(17, 43, 61, 0.18);
}

.file-item.fusion-file-item.is-drop-target {
  margin-top: 12px;
  border-color: rgba(30, 115, 190, 0.36);
  box-shadow:
    inset 0 0 0 2px rgba(63, 169, 245, 0.18),
    0 12px 28px rgba(63, 169, 245, 0.12);
}

.page-row.reorder-page-row {
  cursor: grab;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    margin 160ms ease,
    opacity 160ms ease;
}

.page-row.reorder-page-row.is-dragging {
  opacity: 0.72;
  transform: translateY(-6px) rotate(-1deg);
  border-color: rgba(30, 115, 190, 0.3);
  box-shadow: 0 26px 40px rgba(17, 43, 61, 0.18);
}

.page-row.reorder-page-row.is-drop-target {
  border-color: rgba(30, 115, 190, 0.36);
  box-shadow:
    inset 0 0 0 2px rgba(63, 169, 245, 0.18),
    0 12px 28px rgba(63, 169, 245, 0.12);
}

.page-row.reorder-page-row.is-drop-before {
  margin-top: 18px;
}

.page-row.reorder-page-row.is-drop-after {
  margin-bottom: 18px;
}

.fusion-file-preview {
  position: relative;
  min-height: 152px;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}

.fusion-file-preview img,
.fusion-file-preview-placeholder {
  width: 116px;
  border-radius: 12px;
  border: 1px solid rgba(31, 40, 54, 0.1);
  box-shadow: 0 10px 24px rgba(31, 40, 54, 0.08);
  background: #fff;
}

.fusion-file-preview img {
  display: block;
  height: auto;
}

.fusion-file-preview-placeholder {
  min-height: 152px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(31, 40, 54, 0.03));
}

.reorder-page-preview {
  touch-action: none;
}

.reorder-page-row .page-preview img,
.reorder-page-row .page-preview-placeholder {
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.file-meta.fusion-file-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.file-meta.fusion-file-meta strong {
  display: block;
  width: 100%;
  white-space: normal;
  line-height: 1.4;
  overflow: visible;
  text-overflow: clip;
  word-break: break-word;
}

.file-meta.fusion-file-meta span {
  display: block;
  width: 100%;
  margin-top: 0;
}

.fusion-remove-button {
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  display: grid;
  place-items: center;
  position: absolute;
  top: 8px;
  right: 8px;
  border-radius: 999px;
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1;
  background: #d83b3b !important;
  color: #fff !important;
  box-shadow: 0 10px 20px rgba(216, 59, 59, 0.28);
}

.fusion-remove-button:hover {
  background: #c52b2b !important;
}

.fusion-remove-button:disabled:hover {
  background: #d83b3b !important;
}

.dropzone:hover,
.dropzone:focus-visible,
.dropzone.is-active {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 18px 40px rgba(63, 169, 245, 0.16);
  outline: none;
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone-copy {
  text-align: center;
}

.drop-title {
  margin: 0 0 6px;
  font-size: 1.16rem;
  font-weight: 700;
}

.drop-subtitle {
  margin: 0;
  color: var(--muted);
}

.queue-head {
  margin-top: 28px;
}

.file-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.page-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.file-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(31, 40, 54, 0.08);
}

.file-index {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--gold-soft);
  color: #6f4a00;
  font-weight: 800;
}

.file-meta strong,
.file-meta span {
  display: block;
}

.file-meta strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-meta span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.rotation-badge {
  display: inline-flex;
  width: fit-content;
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.85rem;
  font-weight: 700;
}

.file-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.page-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(31, 40, 54, 0.08);
}

.page-row.is-removed {
  background: rgba(255, 241, 241, 0.92);
  border-color: rgba(170, 47, 47, 0.18);
}

.page-row.is-selected {
  background: rgba(235, 247, 255, 0.92);
  border-color: rgba(30, 115, 190, 0.18);
}

.page-row.is-duplicated {
  background: rgba(255, 248, 231, 0.92);
  border-color: rgba(246, 196, 83, 0.24);
}

.page-row.is-removed .page-preview img,
.page-row.is-removed .page-preview-placeholder {
  opacity: 0.52;
}

.page-preview {
  width: 152px;
  min-width: 152px;
  min-height: 152px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.remove-page-preview {
  position: relative;
}

.page-preview img,
.page-preview-placeholder {
  width: 116px;
  border-radius: 12px;
  border: 1px solid rgba(31, 40, 54, 0.1);
  box-shadow: 0 10px 24px rgba(31, 40, 54, 0.08);
  background: #fff;
}

.page-preview img {
  display: block;
  height: auto;
  transform-origin: center center;
  transition: transform 180ms ease;
}

.page-preview-placeholder {
  min-height: 152px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(31, 40, 54, 0.03));
  transform-origin: center center;
  transition: transform 180ms ease;
}

.page-meta {
  display: grid;
  gap: 8px;
}

.page-badge {
  display: inline-flex;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(31, 40, 54, 0.08);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.page-badge.is-active {
  background: var(--gold-soft);
  color: #6f4a00;
}

.page-badge.is-danger {
  background: rgba(170, 47, 47, 0.12);
  color: #aa2f2f;
}

.page-badge.is-accent {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.page-badge.is-gold {
  background: var(--gold-soft);
  color: #6f4a00;
}

.page-order-chip {
  display: inline-flex;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.85rem;
  font-weight: 700;
}

.page-caption {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.page-actions {
  display: flex;
  gap: 10px;
}

.remove-page-toggle {
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  display: grid;
  place-items: center;
  position: absolute;
  top: 8px;
  right: 8px;
  border-radius: 999px;
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1;
  background: #d83b3b !important;
  color: #fff !important;
  box-shadow: 0 10px 20px rgba(216, 59, 59, 0.28);
}

.remove-page-toggle:hover {
  background: #c52b2b !important;
}

.mini-button,
.arrow-button,
.ghost-button,
.primary-button {
  border: 0;
  cursor: pointer;
}

.mini-button,
.arrow-button,
.ghost-button {
  padding: 10px 12px;
  background: rgba(31, 40, 54, 0.06);
  color: var(--ink);
}

.mini-button:hover,
.arrow-button:hover,
.ghost-button:hover {
  background: rgba(31, 40, 54, 0.1);
}

.mini-button:disabled,
.arrow-button:disabled,
.ghost-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.mini-button:disabled:hover,
.arrow-button:disabled:hover,
.ghost-button:disabled:hover {
  background: rgba(31, 40, 54, 0.06);
}

.mini-button.is-danger {
  background: rgba(170, 47, 47, 0.1);
  color: #8d2424;
}

.mini-button.is-danger:hover {
  background: rgba(170, 47, 47, 0.16);
}

.mini-button.is-accent {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.mini-button.is-accent:hover {
  background: rgba(63, 169, 245, 0.2);
}

.mini-button.is-gold {
  background: var(--gold-soft);
  color: #6f4a00;
}

.mini-button.is-gold:hover {
  background: rgba(246, 196, 83, 0.24);
}

.arrow-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-size: 1.15rem;
  font-weight: 700;
  padding: 0;
}

.actions {
  margin-top: 26px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.inline-actions {
  margin-top: 18px;
}

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

.primary-button,
.download-link {
  padding: 14px 18px;
  text-decoration: none;
}

.primary-button {
  background: linear-gradient(135deg, #3fa9f5 0%, #1e73be 100%);
  color: #fff7f0;
  font-weight: 700;
  box-shadow: 0 16px 34px rgba(30, 115, 190, 0.28);
}

.primary-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.download-link {
  background: rgba(29, 122, 89, 0.12);
  color: var(--success);
  font-weight: 700;
}

.status {
  margin: 18px 0 0;
  min-height: 1.5em;
  color: var(--muted);
}

.status.is-error {
  color: #aa2f2f;
}

.status.is-success {
  color: var(--success);
}

.info-mascot-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.info-mascot {
  width: min(100%, 188px);
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.18));
}

.info-card p {
  color: var(--muted);
  line-height: 1.7;
}

.info-block {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(63, 169, 245, 0.08);
}

.info-block strong,
.info-block code {
  display: block;
}

.info-block code {
  margin-top: 4px;
}

.closing-card {
  margin-top: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.closing-card h2 {
  margin: 0 0 14px;
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 0.96;
  letter-spacing: -0.04em;
}

.closing-card .info-block {
  margin-top: 16px;
}

.closing-card .lede {
  max-width: none;
}

.closing-link {
  display: inline-flex;
  margin-top: 18px;
}

.privacy-page .hero {
  display: grid;
  gap: 24px;
  margin-bottom: 28px;
}

.privacy-card {
  height: auto;
}

.privacy-article {
  display: grid;
  gap: 22px;
}

.privacy-section {
  display: grid;
  gap: 10px;
}

.privacy-section p,
.privacy-section li {
  margin: 0;
  color: var(--muted);
  line-height: 1.72;
}

.privacy-section ul {
  margin: 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 8px;
}

.privacy-section a {
  color: var(--accent-dark);
}

.social-icons {
  text-align: center;
  margin: 1.8rem 0 0;
}

.social-icons a {
  display: inline-block;
  margin: 0 0.8em;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.social-icons img {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.social-icons a:hover img {
  transform: scale(1.2) rotate(5deg);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.site-footer {
  margin-top: 2.2rem;
  padding: 1.2rem 1rem 1.6rem;
  text-align: center;
  color: #fffdfa;
  background: linear-gradient(135deg, var(--accent-dark), rgba(11, 28, 37, 0.92));
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.site-footer a {
  color: #fff;
  font-weight: 900;
  text-decoration: none;
}

.site-footer-title {
  font-weight: 1000;
  letter-spacing: 0.2px;
  font-size: 1.05rem;
}

.site-footer-meta {
  opacity: 0.92;
  margin-top: 0.25rem;
  font-weight: 800;
}

.access-sections {
  display: grid;
  gap: 24px;
  margin-top: 24px;
}

.pricing-card .info-block code {
  font-size: 0.95rem;
  line-height: 1.55;
  white-space: normal;
}

.access-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.access-actions--billing {
  align-items: flex-start;
}

.access-actions--billing .status {
  width: 100%;
  margin-top: 0;
}

.offer-block {
  display: grid;
  gap: 4px;
}

.offer-meta {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.apple-apps-card {
  display: grid;
  gap: 14px;
}

.native-download-card {
  margin-top: 26px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.95fr);
  gap: 22px;
  align-items: center;
}

.native-download-copy {
  display: grid;
  gap: 10px;
}

.native-download-copy h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.native-download-copy .subscription-summary {
  margin: 0;
}

.native-download-actions {
  display: grid;
  gap: 14px;
  justify-items: start;
}

.store-badge-link {
  display: inline-flex;
  align-items: center;
  transition: transform 180ms ease, filter 180ms ease;
}

.store-badge-link:hover {
  transform: translateY(-2px);
  filter: drop-shadow(0 12px 20px rgba(11, 28, 37, 0.14));
}

.store-badge {
  display: block;
  width: min(100%, 220px);
  height: auto;
}

.app-store-list {
  display: grid;
  gap: 14px;
  margin-top: 4px;
}

.app-store-item {
  display: grid;
  gap: 5px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(63, 169, 245, 0.08);
  color: var(--ink);
  text-decoration: none;
  border: 1px solid rgba(30, 115, 190, 0.12);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.app-store-item:hover {
  transform: translateY(-1px);
  border-color: rgba(30, 115, 190, 0.28);
  box-shadow: 0 14px 30px rgba(30, 115, 190, 0.12);
}

.app-store-item strong {
  font-size: 1rem;
}

.app-store-item span {
  color: var(--muted);
  line-height: 1.55;
}

.legal-links {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.hidden,
.file-list:empty::before {
  display: none;
}

.file-list:empty,
.page-list:empty {
  min-height: 108px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(31, 40, 54, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.52);
}

.file-list:empty::before,
.page-list:empty::before {
  display: block;
  color: var(--muted);
}

.file-list:empty::before {
  content: "Aucun PDF ajoute pour le moment.";
}

.page-list:empty::before {
  content: "Les pages du PDF apparaitront ici.";
  color: var(--muted);
}

@media (max-width: 940px) {
  .intro-bottom,
  .tool-layout,
  .native-download-card,
  .access-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy h1 {
    max-width: 100%;
  }

  .native-download-actions {
    justify-items: stretch;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 20px;
  }

  .hero-copy,
  .hero-panel,
  .tool-card,
  .info-card,
  .closing-card {
    padding: 22px;
  }

  .tool-header,
  .queue-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .tool-title-wrap {
    align-items: flex-start;
  }

  .functions-panel,
  .tool-card-main {
    height: auto;
    min-height: 0;
    max-height: none;
  }

  .functions-panel,
  .tool-card-scroll {
    justify-content: flex-start;
  }

  .tool-card-scroll {
    overflow: visible;
    max-height: none;
    padding-right: 0;
  }

  .tool-icon {
    width: 56px;
    height: 56px;
    flex-basis: 56px;
  }

  .file-item {
    grid-template-columns: 1fr;
  }

  .file-actions {
    flex-wrap: wrap;
  }

  .page-row {
    grid-template-columns: 1fr;
  }

  .page-preview {
    width: 100%;
    justify-content: flex-start;
  }
}
