:root {
  --navy: #071642;
  --navy-2: #123b73;
  --coral: #ff456d;
  --coral-dark: #e63158;
  --sky: #dff5ff;
  --paper: #ffffff;
  --line: #d8e8f5;
  --muted: #61718e;
  --shadow: 0 18px 40px rgba(19, 57, 99, 0.14);
  --soft-shadow: 0 10px 24px rgba(19, 57, 99, 0.1);
  --radius-lg: 28px;
  --radius-md: 20px;
}

body.img2grid-page {
  margin: 0;
  color: var(--navy);
  background:
    radial-gradient(circle at 8% 12%, rgba(100, 198, 250, 0.34), transparent 30%),
    linear-gradient(180deg, #aee9ff 0%, #effaff 26%, #fffaf0 100%);
  font-family: Inter, ui-rounded, "Nunito", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

body.img2grid-page main,
body.img2grid-page a,
body.img2grid-page button,
body.img2grid-page input {
  color: inherit;
  font: inherit;
}

body.img2grid-page a {
  text-decoration: none;
}

body.img2grid-page h1,
body.img2grid-page h2,
body.img2grid-page h3,
body.img2grid-page p {
  margin-top: 0;
}

body.img2grid-page h1 {
  max-width: 720px;
  margin-bottom: 22px;
  color: var(--navy);
  font-size: clamp(58px, 6vw, 96px);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.96;
}

body.img2grid-page h1 span {
  display: block;
  color: var(--coral);
}

body.img2grid-page h2 {
  color: var(--navy);
  font-size: clamp(34px, 3vw, 54px);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.05;
}

body.img2grid-page h3 {
  color: var(--navy);
  font-size: 22px;
  font-weight: 900;
  line-height: 1.16;
}

body.img2grid-page p {
  color: var(--muted);
  font-weight: 650;
  line-height: 1.7;
}

.page-shell {
  max-width: 1600px;
  margin: 0 auto;
  overflow-x: clip;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.28) 1px, transparent 1px) 0 0 / 26px 26px,
    linear-gradient(rgba(255, 255, 255, 0.28) 1px, transparent 1px) 0 0 / 26px 26px;
}

.site-header {
  position: sticky;
  top: 10px;
  z-index: 20;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) minmax(300px, auto);
  gap: 24px;
  align-items: center;
  width: min(96%, 1500px);
  min-height: 66px;
  margin: 10px auto 0;
  padding: 8px 18px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(180, 216, 240, 0.85);
  border-radius: 24px;
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: 100%;
  color: var(--navy);
  text-decoration: none;
}

.brand-mark {
  display: block;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(7, 22, 66, 0.1));
}

.brand-text {
  display: inline-block;
  color: var(--navy);
  font-size: 31px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
}

.brand-text span {
  color: var(--coral);
}

.nav-links {
  display: flex;
  justify-content: center;
  gap: clamp(16px, 2.2vw, 42px);
  color: var(--navy);
  font-weight: 800;
}

.nav-links a {
  transition: color 0.2s ease, transform 0.2s ease;
}

.nav-links a:hover {
  color: var(--coral);
  transform: translateY(-1px);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 58px;
  padding: 0 28px;
  border: 0;
  border-radius: 16px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.btn-primary {
  color: #fff !important;
  background: linear-gradient(180deg, #ff5981, var(--coral));
  box-shadow: 0 10px 0 var(--coral-dark), 0 18px 28px rgba(255, 69, 109, 0.24);
}

.btn-secondary {
  color: var(--navy);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  box-shadow: var(--soft-shadow);
}

.btn-small {
  justify-self: end;
  min-width: 174px;
  min-height: 54px;
  padding-inline: 24px;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.upload-icon,
.grid-icon,
.palette-icon,
.brush-icon,
.portrait-icon,
.number-icon {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
}

.upload-icon::before {
  content: "";
  position: absolute;
  inset: 7px 2px 4px;
  background: currentColor;
  border-radius: 12px;
  box-shadow: 8px -8px 0 -3px currentColor, 15px -2px 0 -4px currentColor;
}

.upload-icon::after {
  content: "";
  position: absolute;
  top: 5px;
  left: 12px;
  width: 5px;
  height: 15px;
  background: currentColor;
  border-radius: 5px;
}

.grid-icon {
  background:
    linear-gradient(#2d8ce9 0 0) 0 0 / 8px 8px,
    linear-gradient(#2d8ce9 0 0) 10px 0 / 8px 8px,
    linear-gradient(#2d8ce9 0 0) 20px 0 / 8px 8px,
    linear-gradient(#2d8ce9 0 0) 0 10px / 8px 8px,
    linear-gradient(#2d8ce9 0 0) 10px 10px / 8px 8px,
    linear-gradient(#2d8ce9 0 0) 20px 10px / 8px 8px,
    linear-gradient(#2d8ce9 0 0) 0 20px / 8px 8px,
    linear-gradient(#2d8ce9 0 0) 10px 20px / 8px 8px,
    linear-gradient(#2d8ce9 0 0) 20px 20px / 8px 8px;
  background-repeat: no-repeat;
  filter: drop-shadow(0 2px 0 #0b559a);
}

.palette-icon {
  border-radius: 50%;
  background: #ffc067;
  box-shadow: inset 0 0 0 3px #c77520;
}

.palette-icon::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 26% 36%, #ff4f6e 0 4px, transparent 5px),
    radial-gradient(circle at 66% 30%, #2f8ee8 0 4px, transparent 5px),
    radial-gradient(circle at 60% 68%, #67b84b 0 4px, transparent 5px);
}

.brush-icon::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12px;
  width: 8px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(#1f7fda 0 55%, #c26c29 56% 100%);
  transform: rotate(38deg);
}

.portrait-icon,
.number-icon {
  border-radius: 10px;
  background: linear-gradient(135deg, #ffd88f, #f77878);
  box-shadow: inset 0 0 0 3px rgba(7, 22, 66, 0.15);
}

.number-icon::after {
  content: "12";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
}

.ui-icon {
  --icon-size: 28px;
  display: inline-block;
  flex: 0 0 var(--icon-size);
  width: var(--icon-size);
  height: var(--icon-size);
  vertical-align: middle;
  background: var(--icon-url) center / contain no-repeat;
}

.icon-upload-large {
  --icon-size: 96px;
  --icon-url: url("/static/images/img2grid/assets/generated/icons/upload-cloud.webp");
  filter: drop-shadow(0 10px 18px rgba(45, 140, 233, 0.22));
}

.icon-grid { --icon-url: url("/static/images/img2grid/assets/generated/icons/grid-size.webp"); }
.icon-colors { --icon-url: url("/static/images/img2grid/assets/generated/icons/colors-palette.webp"); }
.icon-preview { --icon-url: url("/static/images/img2grid/assets/generated/icons/preview-eye.webp"); }
.icon-folder { --icon-url: url("/static/images/img2grid/assets/generated/icons/choose-folder.webp"); }

.section-band,
.section-pad {
  width: min(92%, 1460px);
  margin: 0 auto;
}

.section-pad {
  padding: 86px 0;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(620px, 1.25fr);
  gap: 48px;
  min-height: 820px;
  align-items: center;
  padding: 84px 0 52px;
}

.hero::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  z-index: 0;
  width: min(112vw, 1660px);
  height: clamp(260px, 31vw, 430px);
  background: url("/static/images/img2grid/assets/generated/hero-island-background.webp") center bottom / cover no-repeat;
  mask-image: linear-gradient(180deg, transparent 0 50%, rgba(0, 0, 0, 0.35) 64%, #000 78%);
  pointer-events: none;
  transform: translateX(-50%);
}

.pixel-sky {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.pixel-sky span {
  position: absolute;
  width: 18px;
  height: 18px;
  background: rgba(89, 190, 241, 0.25);
  box-shadow: 18px 18px 0 rgba(89, 190, 241, 0.18), -18px 36px 0 rgba(89, 190, 241, 0.14);
}

.pixel-sky span:nth-child(1) { top: 22%; left: 3%; }
.pixel-sky span:nth-child(2) { top: 10%; left: 52%; }
.pixel-sky span:nth-child(3) { top: 18%; right: 8%; }
.pixel-sky span:nth-child(4) { right: 3%; bottom: 24%; }

body.img2grid-page .eyebrow {
  margin: 0 0 12px;
  color: var(--coral);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-copy,
.hero-preview {
  position: relative;
  z-index: 1;
}

.hero-lede {
  max-width: 620px;
  margin-bottom: 10px;
  color: var(--navy) !important;
  font-size: 24px;
  line-height: 1.45;
}

.hero-support {
  max-width: 610px;
  font-size: 18px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin: 34px 0 28px;
}

.mini-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 640px;
  padding: 16px;
  background: rgba(255, 250, 240, 0.9);
  border: 1px solid rgba(230, 214, 187, 0.8);
  border-radius: 20px;
  box-shadow: var(--soft-shadow);
}

.mini-features div {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 5px 12px;
  align-items: center;
  padding: 8px 14px;
}

.mini-features div + div {
  border-left: 1px solid #e9d8be;
}

.mini-features strong,
.mini-features small {
  display: block;
}

.mini-features strong {
  font-weight: 900;
}

.mini-features small {
  grid-column: 2;
  color: var(--muted);
  font-weight: 750;
}

.preview-steps {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px minmax(0, 1fr) 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.preview-card {
  min-width: 0;
}

body.img2grid-page .preview-card h2 {
  width: auto;
  max-width: 100%;
  margin: 0 auto 10px;
  padding: 9px 12px;
  color: #fff;
  background: linear-gradient(180deg, #2d79ca, #215fa6);
  border-radius: 10px;
  box-shadow: 0 6px 0 rgba(10, 56, 118, 0.25);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
}

.art-card {
  aspect-ratio: 0.78;
  min-height: 320px;
  overflow: hidden;
  border: 12px solid #fff;
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.original-art {
  background: url("/static/images/img2grid/assets/generated/hero-original-pet.webp") center / cover no-repeat, linear-gradient(#61c5f6 0 48%, #7ac86c 49% 74%, #efbc62 75%);
}

.grid-art {
  background: url("/static/images/img2grid/assets/generated/hero-pixel-grid-pet.webp") center / cover no-repeat, #8fd6ff;
}

.number-art {
  background: url("/static/images/img2grid/assets/generated/hero-number-guide-pixel-dog.webp") center / cover no-repeat, #8fd6ff;
}

.step-arrow {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #fff;
  background: linear-gradient(180deg, #2d79ca, #215fa6);
  border-radius: 14px;
  box-shadow: 0 7px 0 rgba(10, 56, 118, 0.28);
  font-size: 26px;
  font-weight: 900;
}

.palette-card {
  margin: 26px auto 0;
  padding: 20px 24px;
  text-align: center;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--soft-shadow);
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}

.swatches span {
  display: block;
  width: 42px;
  height: 42px;
  background: var(--c);
  border-radius: 9px;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.12), 0 3px 8px rgba(7, 22, 66, 0.12);
}

.section-heading {
  max-width: 820px;
  margin: 0 auto 38px;
  text-align: center;
}

.converter-panel,
.difference-panel,
.import-card,
.palette-tool {
  display: grid;
  gap: 28px;
  padding: 28px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.converter-panel {
  grid-template-columns: 0.9fr 1.1fr;
}

.drop-zone {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  min-height: 420px;
  text-align: center;
  background:
    linear-gradient(rgba(45, 140, 233, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45, 140, 233, 0.06) 1px, transparent 1px),
    #f5fcff;
  background-size: 22px 22px;
  border: 3px dashed #9bd6f4;
  border-radius: 24px;
  transition: border-color 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.drop-zone:focus-visible {
  outline: 4px solid rgba(255, 69, 109, 0.28);
  outline-offset: 4px;
}

.drop-zone.is-dragging,
.drop-zone.has-file {
  background-color: #fff5f7;
  border-color: var(--coral);
  transform: translateY(-2px);
}

.tool-settings,
.converter-settings {
  display: grid;
  gap: 22px;
}

.setting-group,
.output-preview,
.feature-card,
.steps article,
.difference-cards article,
.usecase-grid article,
.example-card,
.faq-list details,
.palette-options article {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--soft-shadow);
}

.setting-group,
.output-preview {
  padding: 22px;
}

.setting-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-weight: 900;
}

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

.segmented button {
  min-height: 48px;
  color: var(--navy);
  background: #f6fbff;
  border: 1px solid var(--line);
  border-radius: 14px;
  font-weight: 900;
  cursor: pointer;
}

.segmented button.active {
  color: #fff;
  background: var(--coral);
  border-color: var(--coral);
}

.preview-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.preview-label strong {
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-label span {
  color: var(--muted);
  font-weight: 750;
}

.results-stage {
  position: relative;
  min-height: 280px;
  margin-bottom: 22px;
  overflow: hidden;
}

.results-empty-placeholder {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  min-height: 280px;
  padding: 24px;
  color: var(--muted);
  font-weight: 850;
  text-align: center;
  background:
    linear-gradient(rgba(45, 140, 233, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45, 140, 233, 0.07) 1px, transparent 1px),
    #f5fcff;
  background-size: 16px 16px;
  border: 1px dashed #98cfe9;
  border-radius: 16px;
}

.results-empty-placeholder .ui-icon {
  --icon-size: 48px;
  opacity: 0.72;
}

.results-empty-placeholder p {
  max-width: 28ch;
  margin: 0;
}

.results-stage[data-results-empty="false"] .results-empty-placeholder {
  display: none;
}

.results-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.results-grid[hidden],
.results-loading[hidden] {
  display: none;
}

.results-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: max-content;
  max-width: calc(100% - 32px);
  text-align: center;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.loading-spinner {
  width: 52px;
  height: 52px;
  border: 4px solid rgba(45, 140, 233, 0.18);
  border-top-color: var(--coral);
  border-radius: 50%;
  animation: converter-spin 0.85s linear infinite;
}

@keyframes converter-spin {
  to { transform: rotate(360deg); }
}

.result-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding-bottom: 8px;
}

.result-panel-title {
  display: block;
  font-size: 15px;
  line-height: 1.25;
}

.result-panel-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.preview-viewport,
.converter-preview-guide {
  position: relative;
  width: 100%;
  min-height: 220px;
  overflow: hidden;
  background:
    linear-gradient(rgba(45, 140, 233, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45, 140, 233, 0.07) 1px, transparent 1px),
    #f5fcff;
  background-size: 16px 16px;
  border: 1px solid #98cfe9;
  border-radius: 16px;
  box-shadow: var(--soft-shadow);
}

.converter-preview-guide {
  border-style: dashed;
}

.preview-viewport canvas,
.converter-preview-guide canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  background: transparent;
  border: 0;
  image-rendering: pixelated;
}

.result-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-height: 58px;
}

.result-actions .btn {
  min-width: 132px;
  min-height: 50px;
  padding-inline: 20px;
  white-space: nowrap;
}

.result-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 40px;
  margin: 4px 0 8px;
}

.result-palette span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: #fff;
  background: var(--c);
  border-radius: 9px;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.13), 0 3px 8px rgba(7, 22, 66, 0.12);
  font-size: 14px;
  font-weight: 900;
  text-shadow: 0 1px 3px rgba(7, 22, 66, 0.5);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  box-shadow: none;
  transform: none;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

.feature-card,
.usecase-grid article,
.example-card {
  display: block;
  padding: 24px;
}

.example-card::before {
  content: none;
}

.feature-icon {
  width: 42px;
  height: 42px;
  margin-bottom: 18px;
}

.feature-card .grid-icon,
.feature-card .portrait-icon,
.feature-card .number-icon,
.feature-card .palette-icon {
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  border-radius: 10px;
  box-shadow: none;
  filter: none;
}

.feature-card .grid-icon { background-image: url("/static/images/img2grid/assets/generated/feature-icon-grid.webp"); }
.feature-card .portrait-icon { background-image: url("/static/images/img2grid/assets/generated/feature-icon-photo.webp"); }
.feature-card .number-icon { background-image: url("/static/images/img2grid/assets/generated/feature-icon-number.webp"); }
.feature-card .palette-icon { background-image: url("/static/images/img2grid/assets/generated/feature-icon-palette.webp"); }
.feature-card .number-icon::after,
.feature-card .palette-icon::before { content: none; }

.card-visual {
  height: 128px;
  margin-top: 20px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  border-radius: 16px;
}

.grid-strip { background-image: url("/static/images/img2grid/assets/generated/feature-strip-grid.webp"); }
.portrait-strip { background-image: url("/static/images/img2grid/assets/generated/feature-strip-photo.webp"); background-position: center 44%; }
.number-strip { background-image: url("/static/images/img2grid/assets/generated/feature-strip-number.webp"); }
.swatch-strip { background-image: url("/static/images/img2grid/assets/generated/feature-strip-palette.webp"); }

.steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
  padding: 0;
  background: transparent;
}

.steps article {
  position: relative;
  overflow: hidden;
  padding: 24px 18px 22px;
}

.step-card h3 {
  min-height: 48px;
  color: var(--navy);
}

.step-card p {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.step-number {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 12px;
  color: #fff;
  background: var(--coral);
  border-radius: 12px;
  font-size: 22px;
  font-weight: 900;
}

.step-visual {
  position: relative;
  min-height: 154px;
  margin: 4px 0 18px;
  background: #f5fcff center / contain no-repeat;
  border: 8px solid #f7fbff;
  border-radius: 18px;
  box-shadow: inset 0 0 0 1px rgba(136, 200, 237, 0.42), var(--soft-shadow);
}

.step-upload .step-visual { background-image: url("/static/images/img2grid/assets/generated/hero-original-pet.webp"); background-size: cover; }
.step-grid .step-visual { background-image: url("/static/images/img2grid/assets/generated/icons/grid-size.webp"); background-size: 84px 84px; }
.step-colors .step-visual { background-image: url("/static/images/img2grid/assets/generated/icons/colors-palette.webp"); background-size: 88px 88px; }
.step-guide .step-visual { background-image: url("/static/images/img2grid/assets/generated/hero-number-guide-pixel-dog.webp"); background-size: cover; }
.step-recreate .step-visual { background-image: url("/static/images/img2grid/assets/generated/section-paint-mode.webp"); background-size: cover; }

.step-grid .step-visual::before {
  content: "32x32";
  position: absolute;
  top: 18px;
  right: 14px;
  color: var(--navy);
  font-weight: 900;
}

.step-colors .step-visual::after,
.step-recreate .step-visual::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  height: 22px;
  background: linear-gradient(90deg, #a66a2a 0 10%, #f5c983 10% 20%, #ff596d 20% 30%, #e85b35 30% 40%, #8abc35 40% 50%, #6bd0cf 50% 60%, #6652a8 60% 70%, #47433d 70% 80%, #d9d0c5 80%);
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(7, 22, 66, 0.1);
}

.difference-panel,
.import-card,
.palette-tool {
  grid-template-columns: 0.88fr 1.12fr;
  align-items: center;
}

.difference-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.difference-cards article {
  padding: 22px;
}

.usecase-artwork {
  width: min(880px, 100%);
  min-height: 360px;
  margin: 0 auto 28px;
  background: url("/static/images/img2grid/assets/generated/usecase-collage-art.webp") center / contain no-repeat, #f5fcff;
  border: 10px solid #fff;
  border-radius: 24px;
  box-shadow: var(--soft-shadow);
}

.usecase-grid,
.example-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.case-art {
  display: block;
  height: 300px;
  margin-bottom: 18px;
  background-color: #f7fbff;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  border-radius: 18px;
  box-shadow: inset 0 0 0 1px rgba(7, 22, 66, 0.08);
}

.album { background-image: url("/static/images/img2grid/assets/generated/usecases/album-cover.webp"); }
.face { background-image: url("/static/images/img2grid/assets/generated/usecases/portrait-icon.webp"); }
.shirt { background-image: url("/static/images/img2grid/assets/generated/usecases/shirt-pattern.webp"); }
.food { background-image: url("/static/images/img2grid/assets/generated/usecases/food-icon.webp"); }
.poster { background-image: url("/static/images/img2grid/assets/generated/usecases/room-poster.webp"); }
.item { background-image: url("/static/images/img2grid/assets/generated/usecases/custom-item.webp"); }

.import-logo-badge {
  display: block;
  width: min(280px, 52%);
  height: auto;
  margin: -4px 0 22px;
  filter: drop-shadow(0 8px 18px rgba(19, 57, 99, 0.08));
}

.compare-table {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
}

.compare-table div {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.compare-table div:first-child {
  color: #fff;
  background: #2771bd;
}

.compare-table strong,
.compare-table span {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  font-weight: 850;
}

.compare-table span:nth-child(2),
.compare-table strong:nth-child(2) {
  border-left: 1px solid var(--line);
}

.palette-preview {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: center;
}

.sample-thumb {
  width: min(100%, 520px);
  aspect-ratio: 1.62;
  background: url("/static/images/img2grid/assets/generated/palette-tool-art.webp") center / cover no-repeat, #9bd6ff;
  border: 10px solid #fff;
  border-radius: 22px;
  box-shadow: var(--soft-shadow);
}

.palette-options {
  display: grid;
  gap: 16px;
}

.palette-options article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px;
}

.palette-options article.active {
  border-color: var(--coral);
  box-shadow: 0 0 0 4px rgba(255, 69, 109, 0.14), var(--soft-shadow);
}

.palette-options strong {
  font-size: 22px;
}

.palette-options span {
  color: var(--muted);
  font-weight: 800;
}

.example-flow {
  display: grid;
  grid-template-columns: 1fr 22px 1fr 22px 1fr;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
}

#examples,
.examples,
.how-section {
  background: transparent;
}

.example-flow span {
  aspect-ratio: 1;
  background-color: #8fd6ff;
  background-position: center;
  background-size: cover;
  border: 6px solid #fff;
  border-radius: 16px;
  box-shadow: var(--soft-shadow);
}

.example-card:nth-child(1) .example-flow span:nth-of-type(1) { background-image: url("/static/images/img2grid/assets/generated/hero-original-pet.webp"); }
.example-card:nth-child(1) .example-flow span:nth-of-type(2) { background-image: url("/static/images/img2grid/assets/generated/hero-pixel-grid-pet.webp"); }
.example-card:nth-child(1) .example-flow span:nth-of-type(3) { background-image: url("/static/images/img2grid/assets/generated/hero-number-guide-pet.webp"); }
.example-card:nth-child(2) .example-flow span { background-image: url("/static/images/img2grid/assets/generated/feature-grid-art.webp"); }
.example-card:nth-child(3) .example-flow span { background-image: url("/static/images/img2grid/assets/generated/palette-tool-art.webp"); }

.example-flow i {
  height: 12px;
  background: #2771bd;
  border-radius: 99px;
}

.faq-list {
  display: grid;
  gap: 16px;
  max-width: 920px;
  margin: 0 auto;
}

.faq-list details {
  padding: 22px 26px;
}

.faq-list summary {
  color: var(--navy);
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
}

.faq-list p {
  margin: 14px 0 0;
}

.site-footer {
  width: 100%;
  margin: 0;
  padding: 24px 0 18px;
  color: var(--navy);
  background: #fffdf8 !important;
  border-top: 0;
  box-shadow: none;
}

.footer-wrap {
  width: min(95%, 1368px);
  margin: 0 auto;
}

.footer-main {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  align-items: flex-start;
  justify-content: space-between;
}

.footer-brand-block {
  max-width: 560px;
}

.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 14px;
  color: var(--navy);
  font-size: 25px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  letter-spacing: 0;
}

.footer-logo img {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  object-fit: contain;
  border-radius: 10px;
  filter: drop-shadow(2px 2px 0 rgba(7, 22, 66, 0.16));
}

.footer-brand-block p {
  margin: 0;
  color: #796d78;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.62;
}

.footer-email {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  color: #827682;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
  text-decoration: none;
}

.footer-email i {
  width: 15px;
  color: #827682;
  font-size: 14px;
  line-height: 1;
  transition: color 0.18s ease, transform 0.18s ease;
}

.footer-email:hover {
  color: var(--navy);
}

.footer-email:hover i {
  color: var(--coral);
  transform: translateY(-1px);
}

.footer-link-columns {
  display: grid;
  grid-template-columns: 140px 150px;
  gap: 44px 58px;
  min-width: 330px;
  max-width: 360px;
  align-content: start;
  justify-items: start;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  font-weight: 900;
}

.footer-link-group {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.footer-link-title {
  margin: 0 0 4px;
  color: #4c4350;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
}

.footer-link-group a {
  color: #827682;
  line-height: 1.35;
  text-decoration: none;
  transition: color 0.18s ease, transform 0.18s ease;
}

.footer-link-group a:hover {
  color: var(--coral);
  transform: translateY(-1px);
}

.footer-copyright {
  margin: 34px 0 0;
  color: #9b929a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.6;
}

.legal-page main {
  min-height: 70vh;
}

.legal-static-page {
  position: relative;
  width: min(92%, 1180px);
  margin: 0 auto;
  padding: 82px 0 96px;
}

.legal-static-page::before {
  content: "";
  position: absolute;
  inset: 30px 50% auto auto;
  z-index: 0;
  width: min(92vw, 980px);
  height: 320px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.28) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(rgba(255, 255, 255, 0.28) 1px, transparent 1px) 0 0 / 24px 24px;
  pointer-events: none;
  transform: translateX(50%);
}

.legal-static-wrap {
  position: relative;
  z-index: 1;
}

.legal-static-header {
  max-width: 820px;
  margin: 0 auto 34px;
  text-align: center;
}

.legal-static-header h1 {
  margin-bottom: 18px;
  color: var(--navy);
  font-size: clamp(46px, 5vw, 76px);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.98;
}

.legal-static-header p:not(.eyebrow) {
  max-width: 760px;
  margin: 0 auto;
  color: var(--navy);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.55;
}

.legal-static-panel {
  max-width: 920px;
  margin: 0 auto;
  padding: clamp(28px, 4vw, 48px);
  color: var(--navy);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(152, 207, 233, 0.75);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.legal-static-panel h2 {
  margin: 34px 0 12px;
  color: var(--navy);
  font-size: clamp(24px, 2.4vw, 34px);
  font-weight: 900;
  line-height: 1.12;
}

.legal-static-panel h2:first-child {
  margin-top: 0;
}

.legal-static-panel p,
.legal-static-panel li {
  color: #536985;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.78;
}

.legal-static-panel p {
  margin-bottom: 16px;
}

.legal-static-panel ul {
  display: grid;
  gap: 12px;
  margin: 0 0 18px;
  padding-left: 1.2rem;
}

.legal-static-panel strong {
  color: var(--navy);
}

.legal-static-panel a {
  color: var(--coral);
  font-weight: 900;
  text-decoration: none;
}

.legal-static-panel a:hover {
  text-decoration: underline;
}

.legal-static-meta {
  display: inline-flex;
  margin-bottom: 20px !important;
  padding: 8px 12px;
  color: var(--coral) !important;
  background: #fff5f7;
  border: 1px solid rgba(255, 69, 109, 0.18);
  border-radius: 10px;
  font-size: 14px !important;
  font-weight: 900 !important;
  line-height: 1.2 !important;
}

@media (max-width: 1180px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .nav-links {
    display: none;
  }

  .hero,
  .converter-panel,
  .difference-panel,
  .import-card,
  .palette-tool {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .feature-grid,
  .steps {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 820px) {
  .site-header {
    top: 8px;
    width: calc(100% - 20px);
    padding: 10px 12px;
  }

  .brand {
    gap: 6px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .brand-text {
    font-size: 26px;
  }

  .site-header .header-cta {
    display: none;
  }

  .header-actions {
    justify-self: end;
  }

  .hero {
    padding-top: 56px;
  }

  body.img2grid-page h1 {
    font-size: 54px;
  }

  .hero-lede {
    font-size: 20px;
  }

  .mini-features,
  .preview-steps,
  .feature-grid,
  .steps,
  .difference-cards,
  .usecase-grid,
  .example-grid {
    grid-template-columns: 1fr;
  }

  .mini-features div + div {
    border-top: 1px solid #e9d8be;
    border-left: 0;
  }

  .step-arrow {
    margin: 0 auto;
    transform: rotate(90deg);
  }

  .art-card {
    aspect-ratio: 1;
    min-height: 260px;
  }

  .site-footer {
    padding: 32px 0 24px;
  }

  .footer-main {
    gap: 24px;
  }

  .footer-brand-block {
    max-width: 100%;
  }

  .footer-link-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    min-width: 0;
    max-width: 100%;
    gap: 20px;
    font-size: 12px;
  }

  .footer-link-group {
    min-width: 0;
  }

  .footer-link-title {
    font-size: 11px;
  }

  .footer-copyright {
    margin-top: 20px;
    font-size: 11px;
  }

  .legal-static-page {
    padding: 58px 0 72px;
  }

  .legal-static-header {
    text-align: left;
  }

  .legal-static-header h1 {
    font-size: 44px;
  }

  .legal-static-header p:not(.eyebrow) {
    margin-left: 0;
    font-size: 18px;
  }

  .legal-static-panel {
    border-radius: 22px;
  }
}

@media (max-width: 520px) {
  .section-pad {
    padding: 62px 0;
  }

  body.img2grid-page h1 {
    font-size: 44px;
  }

  body.img2grid-page h2 {
    font-size: 34px;
  }

  .btn {
    width: 100%;
  }

  .converter-panel,
  .difference-panel,
  .import-card,
  .palette-tool {
    padding: 18px;
  }

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

  .legal-static-header h1 {
    font-size: 38px;
  }

  .legal-static-panel p,
  .legal-static-panel li {
    font-size: 16px;
  }
}
body.p5r-page {
  --navy: #151018;
  --navy-2: #3a1b24;
  --coral: #e51f35;
  --coral-dark: #9d1022;
  --sky: #f8d25b;
  --paper: #fffdf7;
  --line: #ead8c4;
  --muted: #665f68;
  --shadow: 0 18px 40px rgba(41, 14, 20, 0.16);
  --soft-shadow: 0 10px 24px rgba(41, 14, 20, 0.11);
  background:
    linear-gradient(135deg, rgba(229, 31, 53, 0.20) 0 18%, transparent 18% 100%),
    radial-gradient(circle at 88% 12%, rgba(248, 210, 91, 0.34), transparent 28%),
    linear-gradient(180deg, #fff7e8 0%, #fffdf8 42%, #f4f8ff 100%);
}

body.p5r-page *,
body.p5r-page *::before,
body.p5r-page *::after {
  box-sizing: border-box;
}

body.p5r-page {
  overflow-x: hidden;
}

.p5r-page .site-header {
  border-radius: 8px;
  background: rgba(24, 17, 25, 0.96);
  border-color: rgba(248, 210, 91, 0.24);
}

.p5r-page .brand-text {
  font-size: 25px;
  color: #fff8dc;
}

.p5r-page .nav-links,
.p5r-page .nav-links a {
  color: #ffe5b1;
}

.p5r-page .nav-links a:hover {
  color: #f8d25b;
}

.p5r-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, #151018 0%, #e51f35 72%);
  font-weight: 900;
  box-shadow: 0 6px 0 #9d1022;
}

.language-menu {
  position: relative;
  z-index: 80;
}

.language-menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  min-width: 116px;
  padding: 0 14px;
  color: #fffdf7;
  background: #2b1d25;
  border: 1px solid rgba(248, 210, 91, 0.78);
  border-radius: 8px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.36);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.p5r-page .language-menu-button,
.p5r-page .language-menu-button .language-current-name {
  color: #fffdf7;
}

.p5r-page .language-menu-button:focus-visible {
  outline: 3px solid rgba(248, 210, 91, 0.45);
  outline-offset: 3px;
}

.language-menu-button::after {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #f8d25b;
  content: "";
}

.p5r-page .language-menu-button::after {
  border-top-color: #f8d25b;
}

.language-menu:hover .language-menu-button,
.language-menu:focus-within .language-menu-button {
  background: #3a2530;
  border-color: #f8d25b;
  transform: translateY(-1px);
}

.language-current-code,
.language-option-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  min-height: 24px;
  padding: 0 6px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.language-current-code {
  color: #151018;
  background: #f8d25b;
}

.language-current-name {
  font-size: 14px;
  line-height: 1;
}

.language-menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 100;
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: min(300px, calc(100vw - 32px));
  padding: 10px;
  background: #fffdf7;
  border: 1px solid rgba(248, 210, 91, 0.9);
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(21, 16, 24, 0.28);
}

.language-menu:hover .language-menu-list,
.language-menu:focus-within .language-menu-list {
  display: grid;
}

.language-menu-list a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px;
  color: #151018;
  background: #fff7e8;
  border: 1px solid rgba(234, 216, 196, 0.9);
  border-radius: 6px;
  font-weight: 900;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.language-option-code {
  flex: 0 0 auto;
  color: #fffdf7;
  background: #151018;
}

.language-option-name {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.language-menu-list a:hover,
.language-menu-list a:focus-visible {
  color: #151018;
  background: #f8d25b;
  border-color: #e51f35;
  transform: translateY(-1px);
  outline: none;
}

.language-menu-list a.is-active {
  color: #fffdf7;
  background: #151018;
  border-color: #e51f35;
}

.language-menu-list a.is-active .language-option-code {
  color: #151018;
  background: #f8d25b;
}

.p5r-page .site-footer {
  color: #3a1b24;
  background: #fffdf8;
  border-top: 1px solid rgba(234, 216, 196, 0.78);
}

.p5r-page .site-footer p,
.p5r-page .site-footer a,
.p5r-page .footer-copyright {
  color: #4f3f49;
}

.p5r-page .footer-link-title {
  color: #9d1022;
}

.p5r-page .footer-logo span:not(.brand-mark) {
  color: #151018;
}

.p5r-page .footer-logo .brand-mark {
  color: #fffdf7;
}

.p5r-page .footer-email,
.p5r-page .footer-email i {
  color: #4f3f49;
}

.p5r-page .site-footer a:hover,
.p5r-page .footer-email:hover {
  color: #c9182d;
}

.p5r-localized-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  width: min(94%, 1320px);
  margin: 0 auto;
}

.p5r-shell {
  background:
    linear-gradient(90deg, rgba(21, 16, 24, 0.05) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(rgba(21, 16, 24, 0.05) 1px, transparent 1px) 0 0 / 28px 28px;
}

.p5r-page-main,
.p5r-hero,
.p5r-tool-section,
.p5r-content-grid,
.p5r-overview-grid,
.p5r-feature-grid,
.p5r-link-grid {
  width: min(94%, 1320px);
  margin-inline: auto;
}

.p5r-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.65fr);
  gap: 34px;
  align-items: stretch;
  min-height: auto;
  padding: clamp(56px, 7vw, 96px) 0 42px;
}

.p5r-hero-copy,
.p5r-quick-panel,
.p5r-tool-panel,
.p5r-rule-card,
.p5r-page .feature-card,
.p5r-page .example-card,
.p5r-page .faq-list details {
  border-radius: 8px;
}

.p5r-hero-copy {
  padding: clamp(26px, 4vw, 50px);
  background: rgba(255, 253, 247, 0.92);
  border: 2px solid rgba(21, 16, 24, 0.1);
  box-shadow: var(--shadow);
}

body.p5r-page h1 {
  max-width: 900px;
  color: #151018;
  font-size: clamp(44px, 5vw, 78px);
  line-height: 1;
}

.p5r-page .hero-lede {
  max-width: 880px;
  font-size: clamp(18px, 1.6vw, 24px);
}

.p5r-quick-panel {
  align-self: stretch;
  padding: 28px;
  color: #fff;
  background: #151018;
  border: 2px solid rgba(248, 210, 91, 0.55);
  box-shadow: var(--shadow);
}

.p5r-quick-panel strong {
  display: block;
  margin-bottom: 18px;
  color: #f8d25b;
  font-size: 22px;
}

.persona-chip-grid,
.p5r-link-grid {
  display: grid;
  gap: 12px;
}

.persona-chip-grid a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  color: #151018;
  background: #fffdf7;
  border-radius: 8px;
  font-weight: 900;
}

.p5r-quick-panel .persona-chip-grid a {
  color: #151018 !important;
}

.persona-chip-grid span {
  color: #e51f35;
}

.p5r-tool-panel {
  padding: clamp(20px, 3vw, 34px);
  background: rgba(255, 253, 247, 0.94);
  border: 2px solid rgba(21, 16, 24, 0.1);
  box-shadow: var(--shadow);
}

.compact-tool {
  margin: 24px 0;
}

.tool-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 6px;
  margin-bottom: 22px;
  background: #151018;
  border-radius: 8px;
}

.tool-tabs button,
.dlc-box button {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: transparent;
  font-weight: 900;
  cursor: pointer;
}

.tool-tabs button.active,
.dlc-box button {
  color: #151018;
  background: #f8d25b;
}

.tool-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.38fr) minmax(0, 1fr);
  gap: 24px;
}

.tool-controls {
  display: grid;
  align-content: start;
  gap: 12px;
}

.tool-controls label,
.p5r-tool-panel > label {
  color: #151018;
  font-weight: 900;
}

.p5r-input {
  width: 100%;
  min-height: 52px;
  padding: 0 15px;
  color: #151018;
  background: #fff;
  border: 2px solid #ead8c4;
  border-radius: 8px;
  outline: none;
}

.p5r-input:focus {
  border-color: #e51f35;
  box-shadow: 0 0 0 4px rgba(229, 31, 53, 0.13);
}

.p5r-calc-button {
  width: 100%;
  margin-top: 4px;
}

.dlc-box {
  padding: 16px;
  background: #fff7e8;
  border: 1px solid #ead8c4;
  border-radius: 8px;
}

.dlc-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.dlc-options {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.dlc-options label {
  display: flex;
  gap: 8px;
  color: #3a1b24;
  font-size: 14px;
  font-weight: 800;
}

.result-summary {
  margin-bottom: 14px;
  padding: 14px 16px;
  color: #151018;
  background: #fff7e8;
  border: 1px solid #ead8c4;
  border-radius: 8px;
  font-weight: 800;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

.p5r-results-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  color: #151018;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}

.p5r-results-table th,
.p5r-results-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #ead8c4;
  text-align: left;
  vertical-align: top;
}

.p5r-results-table th {
  color: #fff;
  background: #151018;
  font-weight: 900;
}

.p5r-results-table a {
  color: #c9182d;
  font-weight: 900;
}

.p5r-results-table span {
  color: #665f68;
  font-size: 13px;
}

.p5r-content-grid,
.p5r-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.55fr);
  gap: 26px;
}

.p5r-rule-card {
  padding: 24px;
  background: #fffdf7;
  border: 2px solid rgba(21, 16, 24, 0.1);
  box-shadow: var(--soft-shadow);
}

.p5r-steps {
  display: grid;
  gap: 10px;
  padding-left: 1.2em;
  color: #665f68;
  font-weight: 700;
  line-height: 1.7;
}

.p5r-link-grid .example-card {
  display: block;
}

.p5r-breadcrumb {
  margin: 0 0 20px;
  color: #665f68;
  font-weight: 800;
}

.p5r-breadcrumb a {
  color: #c9182d;
}

.p5r-overview-grid {
  margin-top: 24px;
  margin-bottom: 10px;
}

.p5r-stat-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.p5r-stat-list div,
.p5r-stat-bars div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #ead8c4;
}

.p5r-stat-list dt,
.p5r-stat-bars span {
  color: #665f68;
  font-weight: 800;
}

.p5r-stat-list dd,
.p5r-stat-bars strong {
  margin: 0;
  color: #151018;
  font-weight: 900;
}

.p5r-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin: 4px 6px 4px 0;
  padding: 0 8px;
  color: #151018;
  background: #f8d25b;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 900;
}

.compact-heading {
  text-align: left;
  margin-bottom: 18px;
}

.p5r-chart-table {
  min-width: 1100px;
  font-size: 13px;
}

@media (max-width: 980px) {
  .p5r-hero,
  .tool-grid,
  .p5r-content-grid,
  .p5r-overview-grid,
  .p5r-localized-grid {
    grid-template-columns: 1fr;
  }

  .p5r-page .site-header {
    grid-template-columns: 1fr;
  }

  .p5r-page .nav-links,
  .p5r-page .header-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .p5r-page .section-band,
  .p5r-page .section-pad,
  .p5r-page-main,
  .p5r-hero,
  .p5r-tool-section,
  .p5r-content-grid,
  .p5r-overview-grid,
  .p5r-feature-grid,
  .p5r-link-grid {
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
  }

  body.p5r-page h1 {
    font-size: 38px;
  }

  .p5r-hero-copy,
  .p5r-tool-panel,
  .p5r-rule-card {
    padding: 18px;
  }

  .p5r-hero-copy,
  .p5r-quick-panel {
    max-width: calc(100vw - 32px);
    overflow: hidden;
  }

  .p5r-page .hero-lede,
  .p5r-page .hero-support,
  .p5r-page .eyebrow,
  .p5r-page h1,
  .p5r-page h2,
  .p5r-page p {
    overflow-wrap: anywhere;
  }

  .tool-tabs {
    width: 100%;
  }

  .tool-tabs button {
    flex: 1;
  }

  .p5r-page .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .p5r-page .btn {
    width: 100%;
    min-width: 0;
    max-width: calc(100vw - 64px);
    padding-inline: 16px;
  }

  .p5r-quick-panel {
    width: 100%;
  }
}
