:root {
  --bg-code: rgba(15, 23, 42, 0.06);
  --border-code: rgba(15, 23, 42, 0.18);
  --bg: #f5f7fb;
  --surface: #ffffff;
  --border: rgba(0, 0, 0, 0.12);
  --text: #0f172a;
  --muted: rgba(15, 23, 42, 0.68);
  --primary: #2563eb;
  --primary-bg: rgba(37, 99, 235, 0.1);
}

html,
body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Basic layout utilities */
.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -0.5rem;
}

.col-12 {
  width: 100%;
  padding: 0 0.5rem;
}

@media (min-width: 768px) {
  .col-md-6 {
    width: 50%;
  }
}

.d-none {
  display: none !important;
}

.d-flex {
  display: flex !important;
}

.align-items-center {
  align-items: center !important;
}

.justify-content-between {
  justify-content: space-between !important;
}

.justify-content-center {
  justify-content: center !important;
}

.gy-3 > * {
  margin-bottom: 1rem;
}

.card {
  border-radius: 1rem;
  overflow: hidden;
}

.card-body {
  padding: 1.5rem;
}

.note-section {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.09);
  border-radius: 0.85rem;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.note-section h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.note-section p {
  margin: 0;
}

.note-section pre {
  margin: 0;
  background: rgba(15, 23, 42, 0.05);
}

.topic-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
  padding-bottom: 0.5rem;
  margin-bottom: 1.25rem;
}

.toggle-group {
  margin-top: 1rem;
}

.toggle-group button {
  min-width: 120px;
}

.toggle-group.right {
  margin-left: auto;
}

.shadow-sm {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.bg-light {
  background-color: var(--bg) !important;
}

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

.card-body {
  padding: 1.5rem;
}

.card-title {
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
}

/* Form */
.form-label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.form-control {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 0.5rem;
  font-size: 1rem;
  background: #fff;
  color: var(--text);
  outline: none;
  box-sizing: border-box;
}

.form-control:focus {
  border-color: rgba(37, 99, 235, 0.9);
  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.16);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1rem;
  border-radius: 0.7rem;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  color: inherit;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  box-shadow: 0 14px 35px rgba(37, 99, 235, 0.25);
}

.btn-outline-secondary {
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.btn-outline-secondary:hover {
  background: rgba(255, 255, 255, 1);
  border-color: rgba(0, 0, 0, 0.18);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.08);
}

.btn-sm {
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
}

.py-5 {
  padding-top: 3rem !important;
  padding-bottom: 3rem !important;
}

.mt-3 {
  margin-top: 1rem !important;
}

.mb-0 {
  margin-bottom: 0 !important;
}

.mb-1 {
  margin-bottom: 0.25rem !important;
}

.mb-2 {
  margin-bottom: 0.5rem !important;
}

.mb-3 {
  margin-bottom: 1rem !important;
}

.text-muted {
  color: var(--muted);
}

.text-center {
  text-align: center !important;
}

.text-danger {
  color: #b91c1c;
}

.small {
  font-size: 0.85rem;
}

.d-grid {
  display: grid;
};

.d-grid > * {
  width: 100%;
}

.align-items-start {
  align-items: flex-start !important;
}

.flex-column {
  flex-direction: column !important;
}

.flex-md-row {
  flex-direction: row !important;
}

.gap-2 {
  gap: 0.5rem;
}

@media (min-width: 768px) {
  .flex-md-row {
    flex-direction: row !important;
  }
}

.btn-group {
  display: inline-flex;
}

.btn-group-sm > .btn {
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
}

.btn-group .btn + .btn {
  margin-left: -1px;
}

/* Keep rest of existing styles below */

pre {
  background: var(--bg-code);
  border: 1px solid var(--border-code);
  border-radius: 0.55rem;
  padding: 1rem;
  overflow-x: auto;
  font-size: 0.92rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Droid Sans Mono', 'Source Code Pro', 'Courier New', monospace;
}

.code-keyword {
  color: #1d4ed8;
  font-weight: 600;
}

.code-comment {
  color: #6b7280;
  font-style: italic;
}

.code-string {
  color: #15803d;
}

.code-number {
  color: #b91c1c;
}

.code-block-wrapper {
  position: relative;
}

.copy-code-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  opacity: 0.75;
  transition: opacity 0.2s ease;
  z-index: 2;
}

.copy-code-btn:hover {
  opacity: 1;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.topic-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
  padding-bottom: 0.5rem;
  margin-bottom: 1.25rem;
}

.note-section + .note-section {
  margin-top: 1.75rem;
}

.toggle-group {
  margin-top: 1rem;
}

.toggle-group button {
  min-width: 110px;
}

.alert-small {
  font-size: 0.9rem;
  padding: 0.65rem 0.75rem;
}

hr {
  margin: 2rem 0;
}

.alert-small {
  font-size: 0.9rem;
  padding: 0.65rem 0.75rem;
}

hr {
  margin: 2rem 0;
}
