:root {
  --bg: #0f171c;
  --bg-elev: #162028;
  --surface: #1c2a33;
  --text: #e8eef2;
  --muted: #8fa3b0;
  --accent: #2ec4b6;
  --accent-2: #1a9e94;
  --line: rgba(232, 238, 242, 0.1);
  --danger: #e85d5d;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --font: "DM Sans", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  min-height: 100vh;
}

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

img {
  max-width: 100%;
}

.container {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

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

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(15, 23, 28, 0.82);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 700;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--accent), #178f86);
  color: #042f2c;
  font-family: var(--display);
  font-size: 1.2rem;
}

.brand-text em {
  font-style: normal;
  color: var(--accent);
}

.nav {
  display: flex;
  gap: 1.25rem;
  color: var(--muted);
}

.nav a:hover {
  color: var(--text);
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: 5rem 0 4rem;
  isolation: isolate;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 20%, rgba(46, 196, 182, 0.22), transparent 55%),
    radial-gradient(ellipse 70% 50% at 85% 10%, rgba(80, 140, 180, 0.18), transparent 50%),
    linear-gradient(180deg, #121c22 0%, var(--bg) 100%);
  z-index: -2;
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(232, 238, 242, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 238, 242, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, #000 30%, transparent 90%);
  z-index: -1;
  animation: gridPulse 8s ease-in-out infinite alternate;
}

@keyframes gridPulse {
  from { opacity: 0.35; }
  to { opacity: 0.7; }
}

.hero-content {
  animation: fadeUp 0.7s ease both;
}

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

.hero-brand {
  margin: 0 0 0.75rem;
  font-family: var(--display);
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.hero-title {
  margin: 0 0 0.85rem;
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
  font-weight: 500;
  color: var(--muted);
  max-width: 34ch;
}

.hero-sub {
  margin: 0 0 1.75rem;
  max-width: 48ch;
  color: var(--muted);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
}

.search-wrap input {
  width: min(280px, 100%);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 999px;
  padding: 0.75rem 1.1rem;
  font: inherit;
}

.search-wrap input:focus {
  outline: 2px solid rgba(46, 196, 182, 0.45);
  border-color: transparent;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 0;
  border-radius: 999px;
  padding: 0.75rem 1.25rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

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

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

.btn-primary {
  background: var(--accent);
  color: #042f2c;
}

.btn-primary:hover {
  background: #3dd4c5;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

/* Tools catalog */
.tools-section {
  padding: 2rem 0 4rem;
}

.cpc-tip,
.gen-spotlight {
  margin: 0 0 2rem;
  padding: 1.15rem 1.25rem 1.25rem;
  border-radius: 16px;
  border: 1px solid rgba(46, 196, 182, 0.35);
  background:
    linear-gradient(135deg, rgba(46, 196, 182, 0.12), rgba(22, 32, 40, 0.55)),
    var(--bg-elev);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.cpc-tip-title,
.gen-spotlight-title {
  margin: 0 0 0.45rem;
  font-family: var(--display);
  font-size: clamp(1.15rem, 2.5vw, 1.35rem);
  color: var(--text);
}

.cpc-tip-lead,
.gen-spotlight-lead {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.cpc-tip-list,
.gen-spotlight-list {
  margin: 0;
  padding-left: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.cpc-tip-list strong,
.gen-spotlight-list strong {
  color: var(--text);
  font-weight: 600;
}

.cpc-tip-list a,
.gen-spotlight-list a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cpc-tip-list a:hover,
.gen-spotlight-list a:hover {
  color: #7ee8dc;
}

.gen-spotlight-note {
  margin: 0.85rem 0 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted);
  opacity: 0.9;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 2rem;
}

.chip {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font: inherit;
  cursor: pointer;
}

.chip.is-active,
.chip:hover {
  color: var(--text);
  border-color: rgba(46, 196, 182, 0.5);
  background: rgba(46, 196, 182, 0.12);
}

.category-block {
  margin-bottom: 2.5rem;
}

.category-block.is-hidden {
  display: none;
}

.category-title {
  margin: 0 0 1rem;
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 600;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.tool-card {
  display: flex;
  gap: 0.9rem;
  padding: 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(28, 42, 51, 0.9), rgba(22, 32, 40, 0.9));
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: rgba(46, 196, 182, 0.45);
  box-shadow: var(--shadow);
}

.tool-card.is-hidden {
  display: none;
}

.tool-icon {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(46, 196, 182, 0.15);
  position: relative;
}

.tool-icon::before {
  content: "";
  position: absolute;
  inset: 11px;
  border: 2px solid var(--accent);
  border-radius: 4px;
}

.tool-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.tool-name {
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.tool-desc {
  color: var(--muted);
  font-size: 0.92rem;
}

.tool-mode {
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(232, 238, 242, 0.1);
  color: var(--muted);
  font-weight: 600;
}

.pricing-section {
  padding: 3rem 0 4rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.pricing-section h2 {
  margin: 0 0 0.5rem;
  font-family: var(--display);
  color: var(--text);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0;
  color: var(--muted);
}

.footer-inner {
  display: grid;
  gap: 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: 2rem 1.5rem;
}

.footer-brand p {
  margin: 0.5rem 0 0;
  max-width: 28ch;
  font-size: 0.92rem;
  line-height: 1.55;
}

.footer-col-title {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
}

.footer-col-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.footer-col-list a {
  font-size: 0.92rem;
  color: var(--muted);
  transition: color 0.15s ease;
}

.footer-col-list a:hover {
  color: var(--accent);
}

.footer-copy {
  margin: 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
}

.footer-copy a {
  color: var(--muted);
}

.footer-copy a:hover {
  color: var(--accent);
}

.generator-seo {
  padding-bottom: 3rem;
  background: var(--bg);
}

.static-page {
  padding: 2.5rem 0 4rem;
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(46, 196, 182, 0.08), transparent 60%),
    var(--bg);
}

.static-page-header {
  max-width: 760px;
  margin: 0 auto 2rem;
  text-align: center;
}

.static-page-header h1 {
  margin: 0 0 0.75rem;
  font-family: var(--display);
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 600;
  line-height: 1.2;
}

.static-page-lead {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.contact-email {
  font-size: 1.15rem;
}

.contact-email a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Related tools / generators internal linking */
.related-tools {
  max-width: 760px;
  margin: 2rem auto 0;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
}

.related-tools-title {
  margin: 0 0 1rem;
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}

.related-tools-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.related-tools-list a {
  display: grid;
  gap: 0.15rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(22, 32, 40, 0.45);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.related-tools-list a:hover {
  border-color: rgba(46, 196, 182, 0.35);
  background: rgba(46, 196, 182, 0.06);
}

.related-tools-list strong {
  font-size: 0.95rem;
  color: var(--text);
}

.related-tools-list span {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}

/* Guides hub */
.guides-hub {
  padding-bottom: 4rem;
}

.guides-category {
  margin-bottom: 2.5rem;
}

.guides-category-title {
  margin: 0 0 1rem;
  font-family: var(--display);
  font-size: 1.25rem;
  color: var(--text);
}

.guides-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.guide-card {
  display: grid;
  gap: 0.45rem;
  padding: 1.15rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(22, 32, 40, 0.45);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.guide-card:hover {
  border-color: rgba(46, 196, 182, 0.35);
  background: rgba(46, 196, 182, 0.06);
}

.guide-card-title {
  font-size: 1rem;
  color: var(--text);
}

.guide-card-desc {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.5;
}

.guide-card-link {
  font-size: 0.88rem;
  color: var(--accent);
}

.guide-page-header {
  text-align: left;
  max-width: 760px;
  margin: 0 auto 2rem;
}

.guide-page-header .back-link {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.guide-page-header .back-link:hover {
  color: var(--accent);
}

.guide-kicker {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.guide-article {
  max-width: 760px;
  margin: 0 auto;
}

/* Workspace */
.workspace {
  padding: 2rem 0 4rem;
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(46, 196, 182, 0.08), transparent 60%),
    var(--bg);
}

.workspace-header {
  margin-bottom: 1.5rem;
}

.workspace-header h1 {
  margin: 0.35rem 0 0.5rem;
  font-family: var(--display);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
}

.workspace-header p {
  margin: 0.25rem 0;
  color: var(--muted);
  max-width: 55ch;
}

.back-link {
  color: var(--accent);
  font-size: 0.92rem;
}

.mode-note {
  font-size: 0.9rem !important;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
  padding: 1rem 1.15rem;
}

.dropzone {
  border: 2px dashed rgba(46, 196, 182, 0.35);
  border-radius: var(--radius);
  background: rgba(46, 196, 182, 0.05);
  padding: 2.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  margin-bottom: 1rem;
}

.dropzone:hover,
.dropzone.is-drag {
  border-color: var(--accent);
  background: rgba(46, 196, 182, 0.1);
  box-shadow: 0 0 0 6px rgba(46, 196, 182, 0.08);
  animation: dropPulse 1.2s ease infinite;
}

@keyframes dropPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(46, 196, 182, 0.05); }
  50% { box-shadow: 0 0 0 10px rgba(46, 196, 182, 0.12); }
}

.dropzone-title {
  margin: 0;
  font-weight: 650;
  font-size: 1.15rem;
}

.dropzone-sub {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.file-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.file-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.file-list .meta {
  min-width: 0;
}

.file-list .name {
  display: block;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-list .size {
  color: var(--muted);
  font-size: 0.85rem;
}

.file-list .row-actions {
  display: flex;
  gap: 0.35rem;
}

.file-list button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  padding: 0.3rem 0.55rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
}

/* Visual page board (iLovePDF-style) */
.page-board {
  margin: 0 0 1.25rem;
}

.page-board-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.85rem;
}

.page-board-count {
  color: var(--muted);
  font-size: 0.92rem;
  flex: 1;
  min-width: 12rem;
}

.page-board-action {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  padding: 0.35rem 0.7rem;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}

.page-board-action:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.page-board-loading {
  margin: 0;
  padding: 1.25rem;
  text-align: center;
  color: var(--muted);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.page-board-loading.is-error {
  color: var(--danger);
}

.page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 1rem;
}

.page-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  user-select: none;
}

.page-card:hover {
  border-color: rgba(46, 196, 182, 0.45);
}

.page-card.is-dragging {
  opacity: 0.45;
}

.page-card.is-drop {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(46, 196, 182, 0.2);
}

.page-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(46, 196, 182, 0.25);
}

.page-card.is-marked {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(232, 93, 93, 0.25);
}

.page-card.is-marked .page-card-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(232, 93, 93, 0.28);
}

.page-card.is-selected .page-card-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(46, 196, 182, 0.18);
}

.page-card-preview {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  background: #dfe6eb;
  padding: 0.55rem;
}

.page-card-preview canvas {
  display: block;
  max-width: 100%;
  height: auto;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.page-card-pos {
  position: absolute;
  left: 0.45rem;
  top: 0.45rem;
  z-index: 2;
  min-width: 1.4rem;
  height: 1.4rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: rgba(15, 23, 28, 0.82);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.page-card-x {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  z-index: 3;
  width: 1.7rem;
  height: 1.7rem;
  border: none;
  border-radius: 999px;
  background: rgba(232, 93, 93, 0.95);
  color: #fff;
  font: inherit;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.page-card-x:hover {
  background: #ff4d4d;
  transform: scale(1.06);
}

.page-card-meta {
  padding: 0.45rem 0.55rem 0.2rem;
}

.page-card-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-card-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.25rem;
  min-height: 1.75rem;
  padding: 0 0.4rem 0.4rem;
}

.page-card-btn {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 1rem;
  line-height: 1;
}

.page-card-btn.danger:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(232, 93, 93, 0.12);
}

.page-card-check {
  font-weight: 700;
  color: var(--accent);
  font-size: 1rem;
  min-width: 1.2rem;
  text-align: center;
}

.page-card.is-marked .page-card-check {
  color: var(--danger);
}

/* Visual crop editor */
.crop-editor {
  margin: 0 0 1.25rem;
}

.crop-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
}

.crop-hint {
  color: var(--muted);
  font-size: 0.92rem;
  flex: 1;
  min-width: 12rem;
}

.crop-stage {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #121a20;
  overflow: hidden;
  touch-action: none;
  max-height: min(70vh, 720px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: crosshair;
}

.crop-image {
  display: block;
  max-width: 100%;
  max-height: min(70vh, 720px);
  width: auto;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.crop-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.28);
}

.crop-box {
  position: absolute;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  box-sizing: border-box;
}

.crop-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 2px;
}

.crop-handle.tl { left: -5px; top: -5px; }
.crop-handle.tr { right: -5px; top: -5px; }
.crop-handle.bl { left: -5px; bottom: -5px; }
.crop-handle.br { right: -5px; bottom: -5px; }

.crop-meta {
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Image studio (Cropper.js — resize / crop / convert) */
.image-studio {
  margin: 0 0 1.25rem;
}

.image-studio-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, 0.9fr);
  gap: 1rem;
  align-items: start;
}

.image-studio-main {
  padding: 1rem;
}

.image-studio-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.image-studio-label {
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.65rem;
}

.image-studio-toolbar .image-studio-label {
  margin-bottom: 0;
}

.aspect-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.aspect-btn,
.tool-chip {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  padding: 0.35rem 0.65rem;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.aspect-btn:hover,
.tool-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.aspect-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #062a27;
}

.cropper-wrap {
  background: #0b1217;
  border-radius: 10px;
  overflow: hidden;
  max-height: 420px;
}

.cropper-wrap img {
  display: block;
  max-width: 100%;
}

.image-studio-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.image-studio-info {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.image-studio-side {
  display: grid;
  gap: 0.85rem;
}

.image-studio-card {
  padding: 1rem;
}

.image-studio-card.is-focus {
  border-color: rgba(46, 196, 182, 0.45);
  box-shadow: 0 0 0 3px rgba(46, 196, 182, 0.12);
}

.image-studio-size-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.image-studio-card .field {
  margin-bottom: 0.75rem;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
}

.studio-preview-canvas {
  display: block;
  width: 100%;
  max-height: 160px;
  margin: 0 auto;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #0b1217;
  object-fit: contain;
}

.dim-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.65rem;
}

.dim-badge {
  font-size: 0.75rem;
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
}

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

.page-tool .container {
  width: min(1180px, calc(100% - 2rem));
}

@media (max-width: 640px) {
  .page-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.7rem;
  }

  .page-card-preview {
    min-height: 140px;
  }
}

.options-panel {
  margin-bottom: 1rem;
}

.field {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.field span {
  color: var(--muted);
  font-size: 0.9rem;
}

.field input,
.field select {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
  font: inherit;
}

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

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.status-msg {
  min-height: 1.4em;
  color: var(--muted);
}

.status-msg.is-error {
  color: var(--danger);
}

.progress {
  height: 6px;
  border-radius: 999px;
  background: var(--surface);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.2s ease;
}

.coming-soon {
  text-align: center;
  padding: 2.5rem 1rem;
}

/* SEO article below each tool */
.tool-article {
  max-width: 760px;
  margin: 3rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
  line-height: 1.7;
  color: var(--text);
}

.tool-article h2 {
  font-family: var(--display);
  font-size: clamp(1.4rem, 2.4vw, 1.8rem);
  margin: 0 0 1rem;
}

.tool-article h3 {
  font-size: 1.15rem;
  margin: 1.75rem 0 0.6rem;
}

.tool-article p {
  margin: 0 0 1rem;
  color: var(--muted);
}

.tool-article strong {
  color: var(--text);
}

.tool-article ol,
.tool-article ul {
  margin: 0 0 1rem;
  padding-left: 1.4rem;
  color: var(--muted);
}

.tool-article li {
  margin-bottom: 0.4rem;
}

.tool-article a {
  color: var(--accent);
  text-decoration: underline;
}

/* Home page long-form SEO content */
.home-seo {
  padding: 2.5rem 0 3.5rem;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(22, 32, 40, 0.35), transparent);
}

.home-article {
  max-width: 760px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.home-article h2 {
  margin: 0 0 1.1rem;
  font-family: var(--display);
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
}

.home-article h3 {
  margin: 1.75rem 0 0.65rem;
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
}

.home-article p {
  margin: 0 0 1.05rem;
}

.home-article strong {
  color: var(--text);
  font-weight: 600;
}

.home-article ul {
  margin: 0 0 1.1rem;
  padding-left: 1.35rem;
}

.home-article li {
  margin-bottom: 0.45rem;
}

.home-article a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.home-article a:hover {
  color: #7ee8dc;
}

@media (max-width: 640px) {
  .hero {
    padding-top: 3.5rem;
  }

  .nav {
    gap: 0.85rem;
    font-size: 0.92rem;
  }

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

  .footer-brand {
    grid-column: 1 / -1;
  }
}

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