:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-strong: #f0f4f8;
  --text: #18212f;
  --muted: #607086;
  --line: #dbe2ea;
  --accent: #e23d3d;
  --accent-dark: #b72c2c;
  --green: #0d8a72;
  --blue: #2468d4;
  --shadow: 0 18px 50px rgba(24, 33, 47, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--bg);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px clamp(20px, 5vw, 72px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(219, 226, 234, 0.8);
  box-shadow: 0 12px 34px rgba(24, 33, 47, 0.08);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0;
  font-weight: 800;
  font-size: 1.05rem;
  flex: 0 0 auto;
}

.brand span:not(.brand-mark) {
  display: inline-block;
  width: 190px;
  height: 74px;
  background: url("pdftb-logo.svg") left center / contain no-repeat;
  color: transparent;
  font-size: 0;
}

.brand-mark {
  display: none;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #fff url("pdftb-icon.svg") center / contain no-repeat;
  color: transparent;
  font-size: 0;
  border: 1px solid rgba(226, 61, 61, 0.18);
  box-shadow: 0 8px 20px rgba(24, 33, 47, 0.08);
  overflow: hidden;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #3d4856;
  font-size: 0.92rem;
  font-weight: 800;
}

.nav-links a,
.mega-toggle,
.auth-logout {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  border-radius: 8px;
}

.nav-links a:hover,
.mega-toggle:hover,
.auth-logout:hover {
  background: #fff1ee;
  color: var(--text);
}

.nav-cta {
  margin-left: 6px;
  background: var(--text);
  color: #fff;
  box-shadow: 0 10px 22px rgba(24, 33, 47, 0.16);
}

.nav-links .nav-cta:hover {
  background: var(--accent-dark);
  color: #fff;
}

.mega-item {
  position: static;
}

.mega-toggle {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.mega-caret {
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 160ms ease;
}

.mega-item.is-open .mega-caret,
.mega-item:hover .mega-caret,
.mega-item:focus-within .mega-caret {
  transform: translateY(2px) rotate(225deg);
}

.auth-logout {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.mega-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: clamp(20px, 5vw, 72px);
  right: clamp(20px, 5vw, 72px);
  width: auto;
  display: grid;
  grid-template-columns: minmax(260px, 1.15fr) repeat(3, minmax(170px, 1fr));
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(24, 33, 47, 0.18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
}

.mega-panel::before {
  content: none;
}

.mega-item:hover .mega-panel,
.mega-item:focus-within .mega-panel,
.mega-item.is-open .mega-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mega-group h3 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

.mega-feature {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 250px;
  padding: 22px;
  border-radius: 8px;
  background: linear-gradient(135deg, #fff5f2 0%, #eef6ff 100%);
  border: 1px solid rgba(226, 61, 61, 0.16);
}

.mega-kicker {
  width: fit-content;
  padding: 6px 9px;
  border-radius: 999px;
  background: #fff;
  color: var(--accent-dark);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.mega-feature h2 {
  margin: 18px 0 10px;
  font-size: 1.45rem;
  line-height: 1.15;
}

.mega-feature p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.mega-cta {
  width: fit-content;
  margin-top: 22px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 900;
}

.mega-cta:hover {
  background: var(--accent-dark);
  color: #fff;
}

.mega-link {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  line-height: 1.25;
}

.mega-link span {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--accent-dark);
  font-size: 0.8rem;
  font-weight: 900;
}

.mega-link strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 0.92rem;
}

.mega-link:hover {
  background: #f8fafc;
  border-color: var(--line);
  color: var(--accent-dark);
}

.ad-slot {
  margin: 18px clamp(20px, 5vw, 72px);
  padding: 18px;
  border: 1px dashed #b9c5d4;
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  text-align: center;
}

.ad-slot strong {
  display: block;
  color: var(--text);
  font-size: 0.95rem;
}

.ad-slot span {
  display: block;
  margin-top: 4px;
  font-size: 0.85rem;
}

.ad-slot-top {
  margin-top: 14px;
}

.ad-slot-bottom {
  margin-bottom: 28px;
}

.nav-links a:focus-visible,
.mega-toggle:focus-visible,
.button:focus-visible,
.tool-card:focus-visible,
.related-tools a:focus-visible,
.tool-search input:focus-visible {
  outline: 3px solid rgba(226, 61, 61, 0.35);
  outline-offset: 3px;
}

.hero {
  min-height: 620px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 520px);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  padding: 64px clamp(20px, 5vw, 72px) 42px;
  background:
    linear-gradient(120deg, rgba(226, 61, 61, 0.08), rgba(36, 104, 212, 0.08)),
    var(--bg);
}

.hero-copy {
  max-width: 700px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-dark);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.78rem;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(2.4rem, 6vw, 5.4rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-text {
  max-width: 620px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.7;
}

.hero-actions,
.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 18px;
  border-radius: 8px;
  font-weight: 800;
  border: 1px solid transparent;
}

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

.button.primary:hover {
  background: var(--accent-dark);
}

.button.secondary {
  background: #fff;
  border-color: var(--line);
  color: var(--text);
}

.hero-visual {
  min-height: 420px;
  display: grid;
  place-items: center;
}

.paper-stack {
  position: relative;
  width: min(86vw, 390px);
  aspect-ratio: 0.78;
}

.paper {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.paper-back {
  transform: translate(34px, 22px) rotate(7deg);
  background: #dce9f8;
}

.paper-mid {
  transform: translate(14px, 10px) rotate(-4deg);
  background: #eef7f1;
}

.paper-front {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 34px;
}

.file-badge,
.tool-icon {
  display: inline-grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
}

.paper-line {
  display: block;
  height: 16px;
  width: 72%;
  border-radius: 6px;
  background: #d8e0ea;
}

.paper-line.wide {
  width: 100%;
}

.paper-line.short {
  width: 50%;
}

.tool-strip {
  margin-top: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.tool-strip span {
  min-width: 0;
  padding: 12px 8px;
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 0 clamp(20px, 5vw, 72px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  transform: translateY(18px);
}

.stats div {
  padding: 24px;
  background: #fff;
}

.stats strong,
.stats span {
  display: block;
}

.stats strong {
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.stats span {
  margin-top: 4px;
  color: var(--muted);
}

.section {
  padding: 86px clamp(20px, 5vw, 72px);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 28px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.05;
}

.section-intro {
  max-width: 720px;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.tool-search {
  display: block;
  max-width: 560px;
  margin: 0 0 20px;
}

.tool-search span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.tool-search input {
  width: 100%;
  min-height: 50px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  box-shadow: 0 8px 24px rgba(24, 33, 47, 0.06);
}

.tool-grid {
  counter-reset: tool-card;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.tool-card {
  counter-increment: tool-card;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 260px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.tool-card::before {
  content: counter(tool-card, decimal-leading-zero);
  position: absolute;
  top: 18px;
  right: 18px;
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid rgba(226, 61, 61, 0.22);
  border-radius: 8px;
  background: #fff6f4;
  color: var(--accent-dark);
  font-size: 0.8rem;
  font-weight: 900;
}

.tool-card[hidden] {
  display: none;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 38px rgba(24, 33, 47, 0.1);
  border-color: rgba(226, 61, 61, 0.45);
}

.tool-card h3 {
  margin: 18px 0 10px;
  font-size: 1.18rem;
}

.tool-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.card-link {
  margin-top: auto;
  color: var(--accent-dark);
  font-weight: 900;
}

.details-band {
  background: #fff;
  border-top: 1px solid var(--line);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.detail-grid div {
  padding: 26px;
  border-left: 4px solid var(--accent);
  background: var(--surface-strong);
  border-radius: 8px;
}

.detail-grid h3 {
  margin: 0 0 10px;
}

.detail-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.site-footer {
  padding: 0;
  color: #5d6876;
  border-top: 1px solid var(--line);
  background: #f7f8fb;
}

.footer-shell {
  width: 100%;
  padding: 54px clamp(20px, 5vw, 72px) 26px;
}

.footer-brand-block {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(0, 1.4fr);
  gap: clamp(28px, 7vw, 96px);
  align-items: start;
  padding-bottom: 44px;
  border-bottom: 1px solid var(--line);
}

.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 0;
  color: #232d36;
  font-size: 2rem;
  font-weight: 900;
}

.footer-logo-mark {
  width: 190px;
  height: 74px;
  background: url("pdftb-logo.svg") left center / contain no-repeat;
}

.footer-logo span:not(.footer-logo-mark) {
  color: transparent;
  font-size: 0;
}

.footer-brand-block p {
  max-width: 560px;
  margin: 10px 0 0;
  color: #5d6876;
  line-height: 1.65;
}

.footer-news {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  min-height: 42px;
  margin-top: 20px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #232d36;
  font-weight: 800;
}

.footer-news:hover {
  border-color: rgba(226, 61, 61, 0.45);
}

.footer-columns {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
  padding: 42px 0;
}

.footer-columns h2 {
  margin: 0 0 14px;
  color: #232d36;
  font-size: 0.94rem;
}

.footer-columns a {
  display: block;
  padding: 6px 0;
  color: #5d6876;
  line-height: 1.45;
}

.footer-columns a:hover,
.footer-bottom a:hover {
  color: #e23d3d;
}

.footer-bottom {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 22px;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: #5d6876;
  font-size: 0.92rem;
}

.footer-legal,
.footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.footer-bottom a {
  color: #5d6876;
  font-weight: 800;
}

.footer-social a {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: #232d36;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.content-page {
  padding: 64px clamp(20px, 5vw, 72px);
}

.content-wrap {
  max-width: 920px;
}

.content-wrap h1 {
  font-size: clamp(2.3rem, 6vw, 4.6rem);
}

.content-wrap h2 {
  margin: 34px 0 10px;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.content-wrap p,
.content-wrap li {
  color: var(--muted);
  line-height: 1.75;
}

.content-wrap ul,
.content-wrap ol {
  padding-left: 22px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.info-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.info-card h2,
.info-card h3 {
  margin: 0 0 10px;
}

.contact-panel {
  margin-top: 26px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.auth-page {
  padding-top: 52px;
}

.auth-layout {
  max-width: 1180px;
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(360px, 1.15fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}

.auth-copy {
  min-width: 0;
}

.auth-visual {
  margin: 0;
}

.auth-visual img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(24, 33, 47, 0.12);
}

.auth-card {
  max-width: 460px;
  margin-top: 28px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 38px rgba(24, 33, 47, 0.08);
}

.auth-card label {
  display: block;
  margin-bottom: 14px;
  color: var(--text);
  font-weight: 800;
}

.auth-card input {
  width: 100%;
  min-height: 46px;
  margin-top: 7px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
}

.auth-card .button {
  width: 100%;
  margin-top: 8px;
}

.auth-alt,
.auth-message {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.auth-alt a {
  color: var(--accent-dark);
  font-weight: 900;
}

.tool-page {
  min-height: calc(100vh - 160px);
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
  padding: 64px clamp(20px, 5vw, 72px);
}

.tool-summary {
  position: sticky;
  top: 100px;
}

.tool-summary h1 {
  font-size: clamp(2.25rem, 5vw, 4.4rem);
}

.tool-summary p {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

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

.feature-list li {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.upload-panel {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.drop-zone {
  display: grid;
  place-items: center;
  min-height: 280px;
  padding: 28px;
  border: 2px dashed #b9c5d4;
  border-radius: 8px;
  background: #f8fafc;
  text-align: center;
}

.drop-zone.is-dragging {
  border-color: var(--accent);
  background: #fff5f3;
}

.drop-zone strong {
  display: block;
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.drop-zone span {
  display: block;
  color: var(--muted);
  line-height: 1.5;
}

.fake-input {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--text);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.real-file-input {
  width: 100%;
  min-height: 46px;
  margin-top: 16px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

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

.selected-files {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.selected-files span {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--text);
}

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

.process-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.process-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.result-panel {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(13, 138, 114, 0.28);
  border-radius: 8px;
  background: #f1fbf8;
}

.result-panel[hidden] {
  display: none;
}

.result-label {
  display: block;
  margin-bottom: 6px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.result-panel strong {
  display: block;
  color: var(--text);
  overflow-wrap: anywhere;
}

.result-panel p {
  margin: 8px 0 14px;
  color: var(--muted);
  line-height: 1.55;
}

.tool-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.tool-meta div {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.tool-meta span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  margin-bottom: 5px;
}

.tool-meta strong {
  display: block;
}

.related-tools {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.related-tools a {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 700;
}

.related-tools a:hover {
  color: var(--text);
  border-color: var(--accent);
}

@media (max-width: 1100px) {
  .tool-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .site-header,
  .site-footer {
    align-items: stretch;
  }

  .footer-shell {
    padding: 42px 18px 22px;
  }

  .footer-brand-block,
  .footer-bottom {
    grid-template-columns: 1fr;
  }

  .footer-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 18px;
  }

  .site-header {
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 18px;
  }

  .brand span:not(.brand-mark) {
    width: 148px;
    height: 58px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .nav-links {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
    gap: 6px;
    scrollbar-width: none;
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .nav-links a,
  .mega-toggle {
    flex: 0 0 auto;
    padding: 9px 11px;
    background: #fff;
    border: 1px solid var(--line);
  }

  .nav-cta {
    margin-left: 0;
    background: var(--text) !important;
    color: #fff;
  }

  .mega-item {
    position: static;
    flex: 0 0 auto;
  }

  .mega-toggle {
    min-height: 40px;
  }

  .mega-panel {
    position: fixed;
    left: 18px;
    right: 18px;
    top: 92px;
    width: auto;
    max-height: calc(100vh - 120px);
    overflow: auto;
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .mega-panel::before {
    display: none;
  }

  .mega-feature {
    min-height: auto;
  }

  .hero,
  .tool-page {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding: 34px 18px 30px;
    gap: 20px;
  }

  .hero-visual {
    min-height: 250px;
  }

  h1 {
    font-size: clamp(2.1rem, 12vw, 3.6rem);
    line-height: 1.02;
  }

  .hero-text {
    margin-top: 18px;
    font-size: 1rem;
    line-height: 1.6;
  }

  .hero-actions,
  .tool-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }

  .stats {
    margin: 0 18px;
    transform: none;
  }

  .ad-slot {
    margin: 14px 18px;
    padding: 14px;
  }

  .stats div {
    padding: 18px;
  }

  .section {
    padding: 54px 18px;
  }

  .stats,
  .detail-grid,
  .tool-meta,
  .info-grid,
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-page {
    padding-top: 34px;
  }

  .auth-visual {
    order: -1;
  }

  .auth-card {
    max-width: none;
  }

  .tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .tool-card {
    min-height: 230px;
    padding: 18px;
  }

  .tool-icon {
    width: 46px;
    height: 46px;
  }

  .tool-page {
    padding: 34px 18px 46px;
  }

  .tool-summary {
    position: static;
  }

  .upload-panel {
    padding: 18px;
  }

  .drop-zone {
    min-height: 220px;
    padding: 22px;
  }
}

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

  .tool-card {
    min-height: auto;
  }

  .paper-front {
    padding: 24px;
  }

  .paper-stack {
    width: min(78vw, 300px);
  }

  .site-footer {
    padding: 0;
  }

  .footer-columns {
    grid-template-columns: 1fr;
  }

  .footer-logo {
    font-size: 1.65rem;
  }

  .footer-logo-mark {
    width: 148px;
    height: 58px;
  }

  .content-page {
    padding: 42px 18px;
  }
}
