/* ==========================================================================
   WayToType — Small Text Generator Styles
   ========================================================================== */

/* Keep header single-row and tighten hero-to-tool spacing */
.nav-link {
  white-space: nowrap;
}

.hero-section {
  padding: 1.1rem 0 0.95rem;
}

.hero-breadcrumbs {
  margin-bottom: 0.65rem;
}

.hero-subtitle {
  margin: 0 auto;
}

.page-content {
  padding-top: 0.65rem;
  padding-bottom: 3rem;
}

.small-tool-shell {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin-bottom: 1.75rem;
}

.small-studio-card {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  padding: 1.25rem 1.4rem;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
}

.small-studio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.small-mode-tabs {
  display: inline-flex;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.25rem;
  gap: 0.25rem;
}

.small-mode-tab {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.42rem 1rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}

.small-mode-tab.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 10px var(--primary-glow);
}

.small-stats-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.small-stat-badge {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.28rem 0.7rem;
  border-radius: var(--radius-full);
  background: var(--chip-bg);
  color: var(--text-secondary);
  border: 1px solid var(--chip-border);
  font-family: var(--font-mono);
}

.small-stat-badge.safe {
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.1);
}

/* Split Left Input / Right Output Studio Grid */
.small-io-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 0.85rem;
}

.small-io-pane {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}

.small-io-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 36px;
  flex-wrap: nowrap;
}

.small-io-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
}

.small-output-select {
  max-width: 240px;
  height: 32px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  cursor: pointer;
}

.small-textarea {
  width: 100%;
  min-height: 132px;
  resize: vertical;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 0.95rem 1.05rem;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.55;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.small-textarea-output {
  font-size: 1.15rem;
  line-height: 1.65;
  background: var(--bg-secondary);
}

.small-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  background: var(--bg-input-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.small-quick-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.small-sample-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.small-sample-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 0.2rem;
}

.small-sample-btn {
  border: 1px solid var(--chip-border);
  background: var(--chip-bg);
  color: var(--chip-text);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.18s ease;
}

.small-sample-btn:hover {
  background: var(--chip-bg-hover);
  color: var(--chip-text-hover);
  border-color: var(--primary);
}

.small-action-btns {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.small-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--border-medium);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.18s ease;
}

.small-btn:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.small-btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.small-btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.small-controls-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  padding-top: 0.95rem;
  border-top: 1px solid var(--border-subtle);
}

.small-control-box {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 0.95rem;
}

.small-control-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.small-toggle-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.small-check-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.36rem 0.68rem;
  border-radius: var(--radius-md);
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  color: var(--text-secondary);
  font-size: 0.81rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: all 0.18s ease;
}

.small-check-pill input {
  accent-color: var(--primary);
  cursor: pointer;
}

.small-check-pill:has(input:checked) {
  color: var(--text-primary);
  border-color: rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.12);
}

/* Reverse Decode / Normalizer Panel */
.small-normalizer-panel {
  display: none;
  margin-top: 0.9rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-lg);
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
}

.small-normalizer-panel.active {
  display: block;
}

.small-norm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-primary);
}

.small-norm-output {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-word;
}

/* Filter Bar */
.small-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.small-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.small-filter-tab {
  border: 1px solid var(--chip-border);
  background: var(--chip-bg);
  color: var(--chip-text);
  font-size: 0.83rem;
  font-weight: 600;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.18s ease;
}

.small-filter-tab.active,
.small-filter-tab:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* Output Style Cards: Symmetric 2-column grid (14 styles = 7 full rows) */
.small-styles-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.small-style-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem 1.15rem;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.small-style-card:hover {
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.small-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.small-style-name {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.small-compat-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.25);
  white-space: nowrap;
}

[data-theme="light"] .small-compat-tag {
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.08);
}

.small-preview-box {
  width: 100%;
  text-align: left;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  min-height: 58px;
  display: flex;
  align-items: center;
  color: var(--text-primary);
  font-size: 1.22rem;
  line-height: 1.55;
  word-break: break-word;
  cursor: pointer;
  transition: border-color 0.18s ease;
}

.small-preview-box:hover {
  border-color: var(--primary);
}

.small-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.small-card-meta {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.small-copy-btn {
  border: 1px solid var(--primary);
  background: rgba(59, 130, 246, 0.14);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.38rem 0.9rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.18s ease;
}

.small-copy-btn:hover {
  background: var(--primary);
  color: #ffffff;
}

.small-copy-btn.copied {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
}

/* Single Tiny Letter Picker Bar */
.small-picker-panel,
.small-presets-section {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.25rem 1.4rem;
}

.small-section-heading {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.25rem;
}

.small-section-sub {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin: 0 0 0.85rem;
}

/* Edge-to-edge full grid for 72 tiny characters (no uneven wrap gaps) */
.small-char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
  gap: 0.4rem;
}

.small-char-btn {
  height: 38px;
  padding: 0 0.25rem;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 1.12rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.16s ease;
}

.small-char-btn:hover {
  border-color: var(--primary);
  background: var(--chip-bg-hover);
  transform: translateY(-1px);
}

/* 8 presets = symmetric 4x2 grid */
.small-presets-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}

.small-preset-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.18s ease;
  overflow: hidden;
}

.small-preset-chip span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.small-preset-chip:hover {
  border-color: var(--primary);
  background: var(--bg-card-hover);
}

.small-preset-copy-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
}

/* Recent History */
.small-recents-bar {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1.15rem;
}

.small-recents-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.small-recents-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.small-recent-chip {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid var(--chip-border);
  background: var(--chip-bg);
  color: var(--text-primary);
  font-size: 0.88rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  cursor: pointer;
}

.small-recent-chip:hover {
  border-color: var(--primary);
}

/* ==========================================================================
   SEO Guide Cards, Typography, Pillars and Tables (Compact and Scannable)
   ========================================================================== */

.seo-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 0.5rem;
}

.seo-section .seo-block {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.55rem 1.85rem;
  box-shadow: var(--shadow-sm);
}

.seo-section .seo-header {
  margin-bottom: 0.95rem;
}

.seo-section .seo-tag {
  margin-bottom: 0.55rem;
}

.seo-section .seo-title {
  font-size: 1.5rem;
  margin-bottom: 0.35rem;
}

.seo-section .seo-subtitle {
  font-size: 0.96rem;
  line-height: 1.55;
  margin-bottom: 0;
}

.seo-section p {
  font-size: 0.97rem;
  line-height: 1.65;
  color: var(--text-secondary);
  margin-bottom: 0.8rem;
}

.seo-section p:last-child {
  margin-bottom: 0;
}

.seo-section strong {
  color: var(--text-primary);
}

.seo-section h3 {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 1.15rem 0 0.5rem;
}

.seo-section ul,
.seo-section ol {
  padding-left: 1.4rem;
  margin: 0.55rem 0 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: var(--text-secondary);
  line-height: 1.62;
}

.seo-section ul:last-child,
.seo-section ol:last-child {
  margin-bottom: 0;
}

.seo-section code {
  color: var(--primary);
  background: var(--bg-tertiary);
  padding: 0.12rem 0.38rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.88em;
  border: 1px solid var(--border-subtle);
}

.seo-section a:not(.small-related-card) {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Symmetric 2x2 Pillar Cards */
.seo-section .pillar-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}

.seo-section .pillar-card {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.3rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  gap: 0.45rem;
}

.seo-section .pillar-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
}

.seo-section .pillar-desc {
  font-size: 0.92rem;
  line-height: 1.58;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.seo-section .pillar-desc:last-child {
  margin-bottom: 0;
}

/* Tables in SEO Guide */
.small-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 0.95rem 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.small-info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: left;
}

.small-info-table th,
.small-info-table td {
  padding: 0.7rem 0.95rem;
  border-bottom: 1px solid var(--border-subtle);
}

.small-info-table tbody tr:last-child td {
  border-bottom: none;
}

.small-info-table th {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-weight: 700;
}

.small-info-table td {
  color: var(--text-secondary);
}

/* Symmetric 3x2 Related Tools Grid */
.small-related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 0.75rem;
}

.small-related-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  text-decoration: none;
  transition: all 0.2s ease;
}

.small-related-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.small-related-card strong {
  color: var(--text-primary);
  font-size: 0.96rem;
}

.small-related-card span {
  color: var(--text-secondary);
  font-size: 0.83rem;
  line-height: 1.45;
}

.seo-section .faq-list {
  margin-top: 0.75rem;
  gap: 0.65rem;
}

.seo-section .faq-question {
  padding: 0.95rem 1.25rem;
  font-size: 0.98rem;
}

.seo-section .faq-answer {
  padding: 0.75rem 1.25rem 1rem;
}

.seo-section .faq-answer p {
  font-size: 0.93rem;
  margin-bottom: 0;
}

@media (max-width: 960px) {
  .small-presets-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .small-related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .small-io-grid,
  .small-controls-grid,
  .small-styles-grid,
  .seo-section .pillar-grid,
  .small-related-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .small-studio-card,
  .seo-section .seo-block,
  .small-table-wrap,
  .small-io-pane {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  .small-studio-card,
  .seo-section .seo-block {
    padding: 1rem;
  }
  .small-io-head,
  .small-norm-head,
  .small-recents-head {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .small-output-select,
  .small-recent-chip {
    width: 100%;
    max-width: 100%;
  }
  .small-presets-grid {
    grid-template-columns: 1fr;
  }
}
