.main-wrap {
  max-width: 84rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  width: 100%;
  box-sizing: border-box;
}

.page-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.page-title {
  font-size: clamp(1.6rem, 2.8vw, 2.2rem);
  font-weight: 900;
  color: var(--heading);
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 0.45rem;
}
.page-subtitle {
  font-size: 0.98rem;
  color: var(--dim);
  font-weight: 500;
  line-height: 1.65;
  max-width: 850px;
}

.layout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  margin-bottom: 3.5rem;
  position: relative;
}
@media (min-width: 860px) {
  .layout-grid {
    grid-template-columns: 375px 1fr;
    align-items: start;
  }
}
@media (min-width: 1140px) {
  .layout-grid {
    grid-template-columns: 390px 1fr;
    gap: 2rem;
  }
}

.tool-col {
  width: 100%;
  position: relative;
}
@media (min-width: 860px) {
  .tool-col {
    position: -webkit-sticky;
    position: sticky;
    top: 5rem;
    align-self: start;
    z-index: 25;
  }
}

.sticky-tool {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  box-sizing: border-box;
}
@media (min-width: 860px) {
  .sticky-tool {
    max-height: calc(100vh - 6.2rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
  }
  .sticky-tool::-webkit-scrollbar {
    width: 5px;
  }
  .sticky-tool::-webkit-scrollbar-track {
    background: transparent;
  }
  .sticky-tool::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
  }
  .sticky-tool::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
  }
}
@media (max-width: 859px) {
  .tool-col {
    position: static;
  }
  .sticky-tool {
    position: static;
    max-height: none;
    overflow-y: visible;
  }
}

.ctrl-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.ctrl-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--heading);
}
.ctrl-value {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(5, 150, 105, 0.1);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.text-box {
  width: 100%;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--heading);
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 0.75rem 0.85rem;
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}
.text-box:focus {
  background: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
}

.align-group {
  display: flex;
  background: #f1f5f9;
  border-radius: 6px;
  padding: 0.15rem;
  gap: 0.15rem;
  border: 1px solid #e2e8f0;
}
.align-btn {
  background: transparent;
  border: none;
  border-radius: 4px;
  padding: 0.2rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--dim);
  cursor: pointer;
  transition: all 0.15s ease;
}
.align-btn.active {
  background: #ffffff;
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.quick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.4rem;
}
.quick-tag {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #334155;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.quick-tag:hover {
  background: rgba(5, 150, 105, 0.12);
  border-color: var(--accent);
  color: var(--accent);
}

.range-slider {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
  height: 6px;
  background: #cbd5e1;
  border-radius: 999px;
}

.colors-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}
.color-picker-box {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 0.4rem 0.65rem;
}
.color-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px #cbd5e1;
  flex-shrink: 0;
  position: relative;
}
.color-input {
  position: absolute;
  top: -10px;
  left: -10px;
  width: 50px;
  height: 50px;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}
.color-hex {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--heading);
  letter-spacing: 0.04em;
  font-family: monospace;
}

.file-upload-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: #f8fafc;
  border: 1.5px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--dim);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}
.file-upload-btn:hover {
  background: rgba(5, 150, 105, 0.05);
  border-color: var(--accent);
  color: var(--accent);
}
.reset-link {
  background: none;
  border: none;
  color: #dc2626;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.fonts-col {
  width: 100%;
}
.fonts-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.font-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}
.font-card:hover {
  border-color: #6ee7b7;
  box-shadow: 0 8px 24px rgba(5, 150, 105, 0.1);
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid #f1f5f9;
}
.font-name {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--heading);
}
.font-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(5, 150, 105, 0.08);
  color: var(--accent);
  border: 1px solid rgba(5, 150, 105, 0.18);
}

.card-preview {
  min-height: 120px;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: break-word;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: all 0.15s ease;
  user-select: all;
  -webkit-user-select: all;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid #f1f5f9;
}
.btn-copy-card {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: var(--dim);
  border-radius: 6px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-copy-card:hover {
  background: #f1f5f9;
  color: var(--heading);
  border-color: #94a3b8;
}
.btn-copy-card.copied {
  background: #0f172a !important;
  color: #34d399 !important;
  border-color: #0f172a !important;
}

.btn-download-card {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 1rem;
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff;
  border: 1px solid #059669;
  border-radius: 6px;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.2);
}
.btn-download-card:hover {
  background: linear-gradient(135deg, #047857 0%, #065f46 100%);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.seo-section {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.03);
  margin-top: 2rem;
}
.prose-container {
  max-width: 900px;
  margin: 0 auto;
}
.prose-container h2 {
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  font-weight: 900;
  color: var(--heading);
  margin-bottom: 1rem;
  line-height: 1.3;
}
.prose-container h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--heading);
  margin: 2rem 0 0.85rem;
}
.prose-container p {
  font-size: 0.98rem;
  color: var(--text);
  line-height: 1.85;
  margin-bottom: 1.25rem;
}
.prose-container ul {
  padding-right: 1.5rem;
  margin-bottom: 1.5rem;
}
.prose-container li {
  font-size: 0.96rem;
  color: var(--text);
  line-height: 1.8;
  margin-bottom: 0.5rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}
.feature-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 1.25rem;
}
.feature-item h4 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--heading);
  margin-bottom: 0.4rem;
}
.feature-item p {
  font-size: 0.9rem;
  color: var(--dim);
  margin: 0;
  line-height: 1.6;
}

.cta-box {
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.08) 0%, rgba(217, 119, 6, 0.06) 100%);
  border: 1px solid rgba(5, 150, 105, 0.25);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  text-align: center;
  margin: 2rem 0;
}
.cta-box p {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--heading);
  margin: 0;
}

#export-canvas {
  display: none;
}

