html,
body {
  height: 100%;
}

body {
  background:
    radial-gradient(circle at left top, rgba(59, 130, 246, 0.14), transparent 24%),
    radial-gradient(circle at 80% 0, rgba(251, 191, 36, 0.08), transparent 20%),
    var(--bg-gradient);
  overflow: hidden;
  height: 100vh;
}

.sm-header,
.sm-topbar,
.sm-main {
  padding-left: 24px;
  padding-right: 24px;
}

.sm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
}

.sm-header-left,
.sm-header-right,
.sm-panel-header,
.sm-topbar,
.sm-toolbar,
.sm-stats,
.sm-quick-row,
.sm-editor-footer,
.sm-result-header,
.sm-result-meta {
  display: flex;
  align-items: center;
}

.sm-header-left,
.sm-header-right,
.sm-toolbar,
.sm-stats,
.sm-quick-row,
.sm-result-meta {
  gap: 12px;
}

.sm-logo {
  font-size: 17px;
  font-weight: 700;
}

.sm-subtitle,
.sm-back-link,
.sm-topbar-copy p,
.sm-hint-card li,
.sm-result-header p,
.sm-stat-label,
.sm-result-meta,
.sm-check,
.sm-option {
  color: var(--muted);
}

.sm-subtitle,
.sm-back-link {
  font-size: 13px;
}

.sm-back-link:hover {
  color: var(--accent);
  text-decoration: none;
}

.sm-topbar {
  justify-content: space-between;
  gap: 18px;
  padding-top: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sm-topbar-copy p {
  max-width: 720px;
  font-size: 13px;
  line-height: 1.7;
}

.sm-topbar-badge,
.sm-result-badge {
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.sm-topbar-badge {
  height: 24px;
  margin-bottom: 10px;
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent);
}

.sm-stat-card,
.sm-panel,
.sm-side-panel,
.sm-result-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 16px;
  backdrop-filter: blur(10px);
}

.sm-stat-card {
  min-width: 106px;
  padding: 12px 14px;
}

.sm-stat-label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
}

.sm-stat-card strong {
  font-size: 20px;
  line-height: 1;
}

.sm-main {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) 320px minmax(0, 1fr);
  gap: 18px;
  flex: 1;
  min-height: 0;
  padding-top: 18px;
  padding-bottom: 18px;
}

.sm-panel,
.sm-editor-panel,
.sm-results-panel,
.sm-side-panel {
  min-height: 0;
}

.sm-editor-panel,
.sm-results-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sm-panel-header {
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sm-panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

.sm-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.sm-dot-blue { background: #60a5fa; }

.sm-mini-btn,
.sm-chip-btn,
.sm-btn,
.sm-platform-chip,
.sm-textarea,
.sm-output {
  font-family: inherit;
}

.sm-mini-btn,
.sm-chip-btn,
.sm-platform-chip,
.sm-btn-outline {
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.sm-mini-btn,
.sm-chip-btn,
.sm-platform-chip {
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 12px;
  cursor: pointer;
}

.sm-chip-btn.active,
.sm-platform-chip.active {
  border-color: rgba(59, 130, 246, 0.34);
  background: rgba(59, 130, 246, 0.1);
  color: #dbeafe;
}

.sm-quick-row {
  flex-wrap: wrap;
  padding: 14px 18px 0;
}

.sm-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  margin-right: auto;
}

.sm-textarea,
.sm-output {
  width: calc(100% - 36px);
  margin: 16px 18px 0;
  flex: 1;
  min-height: 0;
  resize: none;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(4, 10, 20, 0.35);
  color: var(--text);
  padding: 18px;
  font-size: 14px;
  line-height: 1.72;
  outline: none;
}

.sm-textarea:focus,
.sm-output:focus {
  border-color: rgba(59, 130, 246, 0.36);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.sm-editor-footer {
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 18px;
  flex-shrink: 0;
}

.sm-btn {
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.sm-btn-primary {
  border: 1px solid rgba(37, 99, 235, 0.45);
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
}

.sm-btn-primary:hover {
  filter: brightness(1.04);
}

.sm-side-panel {
  overflow: auto;
  padding: 18px;
}

.sm-side-section {
  margin-bottom: 18px;
}

.sm-side-section h3 {
  margin-bottom: 10px;
  font-size: 13px;
}

.sm-radio-list,
.sm-check-grid,
.sm-platform-grid {
  display: grid;
  gap: 10px;
}

.sm-option,
.sm-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.sm-platform-grid {
  grid-template-columns: 1fr 1fr;
}

.sm-check-grid {
  grid-template-columns: 1fr;
}

.sm-hint-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
}

.sm-hint-card ul {
  list-style: none;
}

.sm-hint-card li {
  font-size: 12px;
  line-height: 1.7;
  padding: 4px 0;
}

.sm-hint-card li::before {
  content: '·';
  color: var(--accent);
  font-weight: 700;
  margin-right: 8px;
}

.sm-results-panel {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 18px;
}

.sm-result-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.sm-result-header {
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sm-result-header p {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.6;
}

.sm-result-badge {
  height: 24px;
}

.sm-result-badge-primary {
  background: rgba(34, 197, 94, 0.14);
  color: #bbf7d0;
}

.sm-result-badge-muted {
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
}

.sm-result-meta {
  justify-content: flex-end;
  padding: 12px 18px 16px;
  font-size: 12px;
  flex-shrink: 0;
}

.sm-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(12px);
  opacity: 0;
  pointer-events: none;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: #fff;
  font-size: 12px;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 40;
}

.sm-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

[data-theme="light"] .sm-header {
  background: rgba(255, 255, 255, 0.72);
}

[data-theme="light"] .sm-stat-card,
[data-theme="light"] .sm-panel,
[data-theme="light"] .sm-side-panel,
[data-theme="light"] .sm-result-card {
  background: rgba(255, 255, 255, 0.76);
}

[data-theme="light"] .sm-chip-btn.active,
[data-theme="light"] .sm-platform-chip.active {
  color: var(--accent);
}

@media (max-width: 1280px) {
  .sm-main {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .sm-results-panel {
    grid-template-rows: none;
    grid-template-columns: 1fr;
  }

  .sm-editor-panel,
  .sm-results-panel,
  .sm-side-panel {
    min-height: 320px;
  }
}

@media (max-width: 768px) {
  body {
    overflow: auto;
    height: auto;
  }

  .sm-header,
  .sm-topbar,
  .sm-main {
    padding-left: 16px;
    padding-right: 16px;
  }

  .sm-header,
  .sm-topbar,
  .sm-result-header,
  .sm-panel-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .sm-stats,
  .sm-quick-row,
  .sm-platform-grid {
    width: 100%;
    flex-wrap: wrap;
  }

  .sm-textarea,
  .sm-output {
    width: calc(100% - 32px);
    min-height: 260px;
  }

  .sm-editor-footer {
    flex-direction: column;
    align-items: stretch;
  }
}
