@import url('https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;500;700&display=swap');

:root {
  --mwd-radius: 1rem;
  --mwd-radius-sm: .75rem;
  --mwd-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.08);
  --mwd-shadow-sm: 0 .5rem 1rem rgba(0, 0, 0, 0.06);
  --mwd-preview-height: 190px;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(13, 110, 253, 0.12), transparent 30%),
    radial-gradient(circle at top right, rgba(111, 66, 193, 0.10), transparent 25%),
    var(--bs-body-bg);
}

.mwd-section {
  padding: 3rem 0 4rem;
}

.mwd-page-header {
  margin-bottom: 2rem;
}

.mwd-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .75rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 999px;
  background: rgba(var(--bs-emphasis-color-rgb), 0.04);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .02em;
}

.mwd-page-title {
  margin: .9rem 0 .5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.mwd-page-lead {
  max-width: 760px;
  color: var(--bs-secondary-color);
  margin-bottom: 0;
}

.mwd-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1.25rem;
}

.mwd-theme-toggle {
  border-radius: 999px;
  padding-inline: 1rem;
  font-weight: 600;
}

.mwd-panel,
.mwd-preview-card,
.mwd-code-card {
  border: 1px solid var(--bs-border-color);
  border-radius: var(--mwd-radius);
  box-shadow: var(--mwd-shadow-sm);
  background: var(--bs-body-bg);
  overflow: hidden;
}

.mwd-panel-header,
.mwd-code-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--bs-border-color);
  background: rgba(var(--bs-emphasis-color-rgb), 0.03);
}

.mwd-panel-title,
.mwd-code-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.mwd-panel-subtitle,
.mwd-code-subtitle {
  margin: .35rem 0 0;
  color: var(--bs-secondary-color);
  font-size: .92rem;
}

.mwd-panel-body,
.mwd-code-body {
  padding: 1.25rem;
}

.mwd-stat-grid {
  display: grid;
  gap: .75rem;
  margin-bottom: 1.25rem;
}

.mwd-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1rem;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--mwd-radius-sm);
  background: rgba(var(--bs-emphasis-color-rgb), 0.02);
}

.mwd-stat-label {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  font-weight: 700;
}

.mwd-stat-label span {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  font-size: .9rem;
  color: #fff;
}

.mwd-stat-label .mwd-r { background: #dc3545; }
.mwd-stat-label .mwd-g { background: #198754; }
.mwd-stat-label .mwd-b { background: #0d6efd; }

.mwd-stat-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--bs-emphasis-color);
}

.mwd-action-btn {
  width: 100%;
  min-height: 52px;
  border-radius: .85rem;
  font-weight: 700;
  text-transform: none;
  box-shadow: var(--mwd-shadow-sm);
}

.mwd-action-btn i {
  margin-right: .5rem;
}

.mwd-preview-card {
  height: 100%;
}

.mwd-preview-surface {
  min-height: var(--mwd-preview-height);
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 1rem;
}

.mwd-preview-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-weight: 700;
  backdrop-filter: blur(6px);
}

.mwd-preview-footer {
  padding: .9rem 1rem;
  border-top: 1px solid var(--bs-border-color);
  background: rgba(var(--bs-emphasis-color-rgb), 0.03);
}

.mwd-preview-title {
  margin: 0;
  font-weight: 700;
  font-size: .95rem;
}

.mwd-preview-text {
  margin: .25rem 0 0;
  font-size: .86rem;
  color: var(--bs-secondary-color);
}

.mwd-code-list {
  display: grid;
  gap: 1rem;
  margin: 0;
}

.mwd-code-item {
  padding: 1rem;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--mwd-radius-sm);
  background: rgba(var(--bs-emphasis-color-rgb), 0.02);
}

.mwd-code-label {
  display: block;
  margin-bottom: .5rem;
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--bs-secondary-color);
}

.mwd-code {
  margin: 0;
  font-family: "Source Code Pro", monospace;
  font-size: .95rem;
  line-height: 1.7;
  word-break: break-word;
  color: var(--bs-emphasis-color);
  white-space: pre-wrap;
}

.mwd-note {
  margin-top: 1rem;
  font-size: .9rem;
  color: var(--bs-secondary-color);
}

.mwd-note-accent {
  margin-top: 1rem;
  padding: .9rem 1rem;
  border: 1px solid rgba(13, 110, 253, 0.25);
  border-radius: .85rem;
  background: linear-gradient(135deg, rgba(13, 110, 253, 0.18), rgba(111, 66, 193, 0.14));
  color: var(--bs-emphasis-color);
}

[data-bs-theme="light"] .mwd-note-accent {
  border-color: rgba(13, 110, 253, 0.18);
  background: linear-gradient(135deg, rgba(13, 110, 253, 0.10), rgba(111, 66, 193, 0.08));
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] .mwd-note-accent {
  border-color: rgba(13, 110, 253, 0.28);
  background: linear-gradient(135deg, rgba(13, 110, 253, 0.22), rgba(111, 66, 193, 0.18));
  color: rgba(255, 255, 255, 0.92);
}

[data-bs-theme="light"] .mwd-preview-badge {
  background: rgba(255, 255, 255, 0.72);
  color: #212529;
}

@media (max-width: 991.98px) {
  .mwd-toolbar {
    justify-content: flex-start;
  }

  .mwd-preview-surface {
    min-height: 150px;
  }
}