.app-container.sq-page {
  display: flex;
  flex-direction: column;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--app-bg);
  padding-top: 2rem;
  padding-bottom: 2rem;
  border-radius: 30px;
  border: 2px solid var(--app-primary);
}

.sq-page .app-header {
  text-align: center;
  padding: 0 1rem;
}

.sq-page .app-title {
  color: var(--app-primary);
  font-weight: 700;
  margin: 0;
  padding: 0 0 0.75rem;
}

.sq-page .app-subtitle {
  color: var(--app-p-text);
  font-size: smaller;
  max-width: 640px;
  margin: 0 auto 1rem;
  line-height: 1.5;
}

.sq-page .app-content {
  padding: 0 1rem;
}

@media (min-width: 768px) {
  .app-container.sq-page {
    min-height: calc(100vh - 180px);
  }
  .sq-page .app-content {
    padding: 0 2rem;
  }
  .sq-page .px-main {
    height: auto;
    min-height: 560px;
  }
}

.px-choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.px-choice-btn {
  background: var(--app-secondary);
  border: 2px solid var(--app-border);
  border-radius: 8px;
  color: var(--app-text);
  padding: 0.65rem 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  line-height: 1.35;
  transition: border-color 0.2s, background 0.2s;
}

.px-choice-btn:hover {
  border-color: rgba(61, 217, 74, 0.5);
}

.px-choice-btn.active {
  border-color: var(--app-primary);
  background: rgba(61, 217, 74, 0.18);
  color: var(--app-primary);
}

.sq-download-btn {
  border-radius: 8px;
  padding: 0.5rem 1.4rem;
}

.sq-page .px-start-prompt {
  z-index: 2;
}

.sq-page .px-start-prompt[hidden] {
  display: none !important;
}

.sq-page .px-start-prompt .upload-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 0.75rem;
}

.sq-style-block {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding-top: 0.15rem;
}

.sq-export-modal {
  text-align: left;
  max-width: 420px;
}

.sq-export-group-title {
  margin: 0.9rem 0 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--app-primary);
}

.sq-export-group-title:first-of-type {
  margin-top: 0.2rem;
}

.sq-option-grid {
  display: grid;
  gap: 0.5rem;
}

.sq-option-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

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

.sq-option-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-height: 3.1rem;
  padding: 0.55rem 0.4rem;
  border: 2px solid var(--app-border);
  border-radius: 10px;
  background: var(--app-bg);
  color: var(--app-text);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.sq-option-btn:hover {
  border-color: rgba(61, 217, 74, 0.5);
}

.sq-option-btn.active {
  border-color: var(--app-primary);
  background: rgba(61, 217, 74, 0.16);
  color: var(--app-primary);
}

.sq-option-label {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
}

.sq-option-hint {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--app-disabled);
  line-height: 1.2;
}

.sq-option-btn.active .sq-option-hint {
  color: rgba(61, 217, 74, 0.85);
}

.sq-demo-gallery {
  width: 100%;
  max-width: 1000px;
  margin: 2rem auto;
}

.sq-demo-title {
  text-align: center;
  color: var(--app-primary);
  font-weight: 700;
  margin-bottom: 1rem;
}

.sq-demo-grid {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.sq-demo-card {
  background: var(--app-secondary);
  border: 1px solid var(--app-border);
  border-radius: 12px;
  overflow: hidden;
}

.sq-demo-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #0f0f0f;
  image-rendering: pixelated;
}

.sq-demo-card figcaption {
  padding: 0.75rem 0.85rem 1rem;
  color: var(--app-p-text);
  font-size: 0.82rem;
  line-height: 1.45;
}

.sq-size-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin: 1.5rem auto 0;
}

.sq-size-nav a {
  color: var(--app-primary);
  text-decoration: none;
  border: 1px solid var(--app-primary);
  border-radius: 8px;
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
}

.sq-size-nav a:hover {
  background: rgba(61, 217, 74, 0.12);
}

.sq-size-nav a.is-current {
  background: var(--app-primary);
  color: var(--app-bg);
  pointer-events: none;
}

.home-square-tools {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 1.25rem 1rem;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: var(--app-secondary);
  text-align: center;
}

.home-square-tools h2 {
  color: var(--app-primary);
  margin-bottom: 0.5rem;
}

.home-square-tools p {
  color: var(--app-p-text);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .sq-option-grid-3 {
    grid-template-columns: 1fr;
  }
}

/* Modern article layout — square landing pages only */
.sq-desc {
  max-width: 860px;
  margin: 2.5rem auto 1.5rem;
  padding: 0 1rem;
  font-family: Rubik, "Segoe UI", system-ui, sans-serif;
}

.sq-desc .retro-terminal {
  background: transparent;
  color: var(--app-p-text);
  border-radius: 0;
  padding: 0;
  margin: 0;
  box-shadow: none;
  overflow: visible;
}

.sq-desc section,
.sq-desc .pixel-box {
  background: var(--app-secondary);
  border: 1px solid var(--app-border);
  border-radius: 16px;
  padding: 1.35rem 1.4rem 1.45rem;
  margin: 0 0 1rem;
}

.sq-desc p {
  line-height: 1.7;
  margin: 0 0 0.85rem;
  letter-spacing: 0;
  font-size: 0.98rem;
  color: var(--app-p-text);
}

.sq-desc p:last-child {
  margin-bottom: 0;
}

.sq-desc strong {
  color: var(--app-text);
  font-weight: 650;
}

.sq-desc p a,
.sq-desc .cta-block a:not(.pixel-button) {
  color: var(--app-primary);
  text-decoration: none;
  border-bottom: 1px solid rgba(61, 217, 74, 0.4);
}

.sq-desc p a:hover,
.sq-desc .cta-block a:not(.pixel-button):hover {
  border-bottom-color: var(--app-primary);
}

.sq-desc ol,
.sq-desc ul {
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
  list-style: none;
}

.sq-desc ol {
  counter-reset: sq-step;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.sq-desc ol li {
  counter-increment: sq-step;
  display: grid;
  grid-template-columns: 1.75rem 1fr;
  gap: 0.75rem;
  align-items: start;
  padding: 0.85rem 0.95rem;
  background: var(--app-bg);
  border: 1px solid var(--app-border);
  border-radius: 12px;
  line-height: 1.55;
}

.sq-desc ol li::before {
  content: counter(sq-step);
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 8px;
  background: rgba(61, 217, 74, 0.16);
  color: var(--app-primary);
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.05rem;
}

.sq-desc .pixel-box ul {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.sq-desc .pixel-box li {
  padding: 0.85rem 0.95rem;
  background: var(--app-bg);
  border: 1px solid var(--app-border);
  border-radius: 12px;
  line-height: 1.55;
}

.sq-desc .faq-section h3 {
  margin: 0.85rem 0 0;
  padding: 0.85rem 0.95rem 0.35rem;
  background: var(--app-bg);
  border: 1px solid var(--app-border);
  border-bottom: none;
  border-radius: 12px 12px 0 0;
}

.sq-desc .faq-section h3:first-of-type {
  margin-top: 0.15rem;
}

.sq-desc .faq-section h3 + p {
  margin: 0 0 0.75rem;
  padding: 0 0.95rem 0.95rem;
  background: var(--app-bg);
  border: 1px solid var(--app-border);
  border-top: none;
  border-radius: 0 0 12px 12px;
  font-size: 0.92rem;
}

.sq-desc .cta-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.4rem;
  background: linear-gradient(135deg, rgba(61, 217, 74, 0.14), var(--app-secondary) 55%);
  border-color: rgba(61, 217, 74, 0.35);
}

.sq-desc .cta-block p {
  margin: 0;
  flex: 1 1 auto;
}

.sq-desc .pixel-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: var(--app-primary);
  color: #08140a;
  border: none;
  border-radius: 10px;
  padding: 0.7rem 1.15rem;
  margin: 0;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  text-transform: none;
  text-decoration: none;
  position: relative;
  box-shadow: none;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.sq-desc .pixel-button::before {
  display: none;
}

.sq-desc .pixel-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  text-shadow: none;
}

@media (max-width: 700px) {
  .sq-desc .pixel-box ul,
  .sq-desc .cta-block {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .sq-desc .pixel-button {
    width: 100%;
  }
}
