* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.tsg-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  background: #f8f9fa;
  border-radius: 16px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.tsg-content {
  background: white;
  border-radius: 12px;
  padding: 2rem;
}

.tsg-title {
  font-size: 2rem;
  font-weight: 700;
  color: #1a202c;
  margin: 0 0 0.5rem 0;
  text-align: center;
}

.tsg-subtitle {
  color: #718096;
  text-align: center;
  margin: 0 0 2rem 0;
  font-size: 1rem;
}

.tsg-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: #f7fafc;
  border-radius: 8px;
}

.tsg-control-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tsg-control-group-full {
  grid-column: 1 / -1;
}

.tsg-label {
  font-weight: 600;
  color: #2d3748;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tsg-input,
.tsg-select,
.tsg-textarea {
  padding: 0.75rem;
  border: 2px solid #e2e8f0;
  border-radius: 6px;
  font-size: 1rem;
  transition: all 0.2s;
  background: white;
}

.tsg-input:focus,
.tsg-select:focus,
.tsg-textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.tsg-input {
  width: 100%;
}

.tsg-select {
  cursor: pointer;
  width: 100%;
}

.tsg-textarea {
  width: 100%;
  resize: vertical;
  min-height: 60px;
  font-family: inherit;
}

.tsg-checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.tsg-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.tsg-checkbox-label {
  font-weight: 500;
  color: #2d3748;
  font-size: 0.875rem;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
}

.tsg-unit-switcher {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.tsg-unit-btn {
  flex: 1;
  padding: 0.5rem;
  border: 2px solid #e2e8f0;
  background: white;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.tsg-unit-btn:hover {
  border-color: #cbd5e0;
}

.tsg-unit-btn.active {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}

.tsg-section {
  margin-bottom: 2rem;
}

.tsg-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  cursor: pointer;
  user-select: none;
}

.tsg-section-header:hover .tsg-section-title {
  color: #2563eb;
}

.tsg-section-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #2d3748;
  margin: 0;
  transition: color 0.2s;
}

.tsg-toggle-icon {
  color: #718096;
  transition: transform 0.2s;
}

.tsg-scale-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.tsg-scale-item {
  padding: 1.5rem;
  background: #f7fafc;
  border-radius: 8px;
  border-left: 4px solid #2563eb;
  transition: transform 0.2s, box-shadow 0.2s;
}

.tsg-scale-item:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tsg-scale-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tsg-scale-name {
  font-weight: 700;
  color: #2563eb;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
}

.tsg-scale-specs {
  font-size: 0.875rem;
  color: #718096;
  font-family: 'Courier New', monospace;
}

.tsg-scale-sample {
  color: #1a202c;
  margin: 0;
  word-break: break-word;
}

.tsg-hierarchy-view {
  padding: 2rem;
  background: white;
  border-radius: 8px;
  border: 2px solid #e2e8f0;
}

.tsg-hierarchy-item {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.tsg-hierarchy-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.tsg-code-section {
  background: #1a202c;
  border-radius: 8px;
  padding: 1.5rem;
  position: relative;
}

.tsg-code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.tsg-code-title {
  color: #fff;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
}

.tsg-export-select {
  padding: 0.5rem 0.75rem;
  background: #2d3748;
  color: #e2e8f0;
  border: 1px solid #4a5568;
  border-radius: 6px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.tsg-export-select:hover {
  border-color: #2563eb;
}

.tsg-export-select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.tsg-copy-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.2s;
}

.tsg-copy-btn:hover {
  background: #1d4ed8;
}

.tsg-copy-btn.copied {
  background: #48bb78;
}

.tsg-code-block {
  background: #2d3748;
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
}

.tsg-code {
  color: #e2e8f0;
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  white-space: pre;
  margin: 0;
  line-height: 1.6;
}

.tsg-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 2rem;
  overflow-x: auto;
}

.tsg-tab {
  padding: 0.75rem 1.5rem;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: #718096;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  margin-bottom: -2px;
}

.tsg-tab:hover {
  color: #2563eb;
  background: rgba(37, 99, 235, 0.05);
}

.tsg-tab.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}

.tsg-tab-content {
  min-height: 400px;
}

.tsg-preview-landing {
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.tsg-landing-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e2e8f0;
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

.tsg-landing-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.tsg-landing-nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.tsg-landing-hero {
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
  padding: 5rem 2rem;
  background: linear-gradient(135deg, #f6f9fc 0%, #ffffff 100%);
}

.tsg-landing-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: #e0f2fe;
  color: #0369a1;
  border-radius: 20px;
  margin-bottom: 1.5rem;
}

.tsg-landing-button {
  padding: 1rem 2rem;
  background: #0ea5e9;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  margin: 0.5rem;
  font-weight: 600;
}

.tsg-landing-button:hover {
  background: #0284c7;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.tsg-landing-button.secondary {
  background: white;
  color: #0ea5e9;
  border: 2px solid #0ea5e9;
}

.tsg-landing-button.secondary:hover {
  background: #f0f9ff;
}

.tsg-landing-section {
  padding: 4rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.tsg-landing-section.alt {
  background: #f8fafc;
}

.tsg-landing-section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.tsg-landing-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.tsg-landing-feature {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  transition: all 0.3s;
}

.tsg-landing-feature:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.tsg-landing-feature-icon {
  width: 48px;
  height: 48px;
  background: #e0f2fe;
  color: #0369a1;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-weight: 700;
  font-size: 1.25rem;
}

.tsg-landing-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3rem;
  text-align: center;
  padding: 3rem 0;
}

.tsg-landing-testimonial {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  margin-bottom: 1.5rem;
}

.tsg-landing-testimonial-author {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.tsg-landing-testimonial-avatar {
  width: 48px;
  height: 48px;
  background: #e0f2fe;
  border-radius: 50%;
}

.tsg-landing-cta {
  text-align: center;
  padding: 5rem 2rem;
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: white;
}

.tsg-landing-footer {
  background: #1e293b;
  color: #94a3b8;
  padding: 3rem 2rem 2rem;
}

.tsg-landing-footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.tsg-landing-footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid #334155;
  text-align: center;
}

.tsg-preview-blog {
  background: white;
  padding: 3rem 2rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.tsg-blog-article {
  max-width: 700px;
  margin: 0 auto;
  color: #1a202c;
}

.hidden {
  display: none !important;
}

@media (max-width: 768px) {
  .tsg-container {
    padding: 1rem;
  }

  .tsg-content {
    padding: 1rem;
  }

  .tsg-title {
    font-size: 1.5rem;
  }

  .tsg-controls {
    grid-template-columns: 1fr;
  }

  .tsg-scale-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .tsg-tab {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }

  .tsg-landing-nav {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .tsg-landing-nav-links {
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .tsg-preview-landing,
  .tsg-preview-blog {
    padding: 1.5rem 1rem;
  }

  .tsg-landing-feature-grid {
    grid-template-columns: 1fr;
  }
}
