@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

body {
  font-family: "Inter", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  overflow: auto;
}

html,
body {
  height: 100%;
}

body.app-active {
  overflow: hidden;
}

.card {
  border-radius: 0.5rem;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  padding: 1.25rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.hidden {
  display: none;
}

.auth-screen {
  min-height: 100vh;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
  color: #0f172a;
}

.auth-card {
  width: min(1100px, 100%);
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.auth-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #0f172a;
}

.auth-subtitle {
  color: #64748b;
  font-size: 0.9rem;
}

.auth-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.auth-panel {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1.5rem;
  display: grid;
  gap: 0.75rem;
}

.auth-panel h2 {
  font-size: 1.1rem;
  font-weight: 600;
}

.auth-footer {
  border-top: 1px solid #e2e8f0;
  padding-top: 1.5rem;
  display: grid;
  gap: 0.5rem;
}

.auth-footer h3 {
  font-size: 1rem;
  font-weight: 600;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #475569;
}

body.dark {
  background: #0b1120;
  color: #e2e8f0;
}

body.dark .content {
  background: #0b1120;
}

body.dark .card {
  border-color: #1e293b;
  background: #0f172a;
  color: #e2e8f0;
}

body.dark .page-subtitle,
body.dark .section-subtitle,
body.dark .label,
body.dark .help-text {
  color: #94a3b8;
}

body.dark .input {
  background: #0b1220;
  border-color: #1e293b;
  color: #e2e8f0;
}

body.dark .btn-secondary {
  border-color: #1e293b;
  background: #0b1220;
  color: #e2e8f0;
}

body.dark .btn-secondary:hover {
  background: #111827;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 260px 1fr;
  height: 100vh;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 0 1fr;
}

.app-shell.sidebar-collapsed .sidebar {
  transform: translateX(-100%);
}

.sidebar {
  background: #0f172a;
  color: #e2e8f0;
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  transition: transform 200ms ease;
}

.sidebar-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  background: #1e293b;
  border-radius: 0.75rem;
  padding: 0.5rem 0.75rem;
  font-size: 1.25rem;
}

.brand-icon img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  display: block;
}

.brand-title {
  font-weight: 600;
  font-size: 1rem;
  color: #f8fafc;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: #94a3b8;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-item {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-radius: 0.5rem;
  background: transparent;
  color: #cbd5f5;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 150ms ease, color 150ms ease;
}

.nav-icon {
  display: inline-flex;
  width: 22px;
  justify-content: center;
  margin-right: 8px;
}

.nav-item:hover,
.nav-item.active {
  background: #1e293b;
  color: #ffffff;
}

.sidebar-footer .input {
  background: #0b1220;
  border: 1px solid #1e293b;
  color: #e2e8f0;
}

.sidebar-footer .label {
  color: #94a3b8;
}

.help-text {
  font-size: 0.7rem;
  color: #64748b;
  margin-top: 0.25rem;
}

.profile-card {
  border: 1px solid #1e293b;
  border-radius: 0.75rem;
  padding: 0.75rem;
  background: #0b1220;
  display: grid;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.profile-title {
  font-weight: 600;
  color: #e2e8f0;
}

.profile-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  color: #cbd5f5;
}

body.dark .profile-card {
  border-color: #1e293b;
  background: #0b1220;
}

.content {
  padding: 2rem 2.5rem;
  height: 100vh;
  overflow-y: auto;
  position: relative;
  z-index: 1;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
  z-index: 40;
}

.mobile-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  font-size: 1.1rem;
  padding: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  gap: 1rem;
  position: relative;
  z-index: 2;
}

.topbar-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 600;
}

.page-subtitle {
  color: #64748b;
  font-size: 0.875rem;
}

.section {
  display: none;
}

.section.active {
  display: block;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.section-subtitle {
  color: #64748b;
  font-size: 0.875rem;
}

.label {
  margin-bottom: 0.25rem;
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
}

.input {
  width: 100%;
  border-radius: 0.375rem;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.input:focus {
  border-color: #0f172a;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.1);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  background: #0f172a;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #ffffff;
  transition: background 150ms ease;
}

.btn-primary:hover {
  background: #1e293b;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #334155;
  transition: background 150ms ease;
}

.btn-secondary:hover {
  background: #f1f5f9;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
}

.sidebar .badge {
  background: #1e293b;
  border-color: #1e293b;
  color: #cbd5f5;
}

.message-user {
  margin-left: auto;
  width: fit-content;
  max-width: 48rem;
  border-radius: 0.5rem;
  background: #0f172a;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  color: #ffffff;
}

.message-bot {
  margin-right: auto;
  width: fit-content;
  max-width: 48rem;
  border-radius: 0.5rem;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  color: #1e293b;
}

.chat-markdown p {
  margin: 0 0 0.75rem 0;
}

.chat-markdown p:last-child {
  margin-bottom: 0;
}

.chat-markdown h2,
.chat-markdown h3,
.chat-markdown h4 {
  margin: 0.75rem 0 0.5rem;
  font-weight: 600;
}

.chat-markdown h3 {
  font-size: 1rem;
}

.chat-markdown ol,
.chat-markdown ul {
  margin: 0 0 0.75rem 1.25rem;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.chat-markdown pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 0.75rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 0.5rem 0 0.75rem;
  font-size: 0.8rem;
}

.chat-markdown code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

body.dark .message-bot {
  border-color: #1e293b;
  background: #111827;
  color: #e2e8f0;
}

body.dark .chat-markdown pre {
  background: #020617;
  color: #e2e8f0;
}

.message-meta {
  margin-top: 0.25rem;
  font-size: 0.6875rem;
  color: #94a3b8;
}

.message-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.btn-ghost {
  background: transparent;
  border: 1px solid #e2e8f0;
  color: #475569;
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.btn-ghost:hover {
  background: #f1f5f9;
}

body.dark .btn-ghost {
  border-color: #1e293b;
  color: #cbd5f5;
}

body.dark .btn-ghost:hover {
  background: #111827;
}

.messages {
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}

.plan-card {
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  padding: 1rem;
  background: #f8fafc;
}

.plan-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.code-card {
  margin-top: 1rem;
  border-radius: 0.5rem;
  border: 1px solid #e2e8f0;
  padding: 0.75rem;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.8rem;
  overflow-x: auto;
}

.widget-preview {
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  font-size: 0.85rem;
}

.widget-preview-wrap {
  display: flex;
  justify-content: flex-end;
}

.widget-preview-wrap.left {
  justify-content: flex-start;
}

.widget-preview-light .widget-preview-header {
  background: #0f172a;
  color: #ffffff;
}

.widget-preview-light .widget-preview-body {
  background: #f8fafc;
}

.widget-preview-dark .widget-preview-header {
  background: #111827;
  color: #ffffff;
}

.widget-preview-dark .widget-preview-body {
  background: #0b1220;
}

.widget-preview-header {
  padding: 0.75rem 1rem;
  font-weight: 600;
  background: #0f172a;
  color: #ffffff;
}

.widget-preview-body {
  padding: 1rem;
  display: grid;
  gap: 0.5rem;
  background: #f8fafc;
}

.widget-preview-bot {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  width: fit-content;
}

.widget-preview-user {
  background: #0f172a;
  color: #ffffff;
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  width: fit-content;
  margin-left: auto;
}

.widget-preview-input {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
}

.widget-preview-input input {
  flex: 1;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  padding: 0.4rem 0.6rem;
}

.widget-preview-input button {
  border-radius: 0.5rem;
  background: #0f172a;
  color: #ffffff;
  padding: 0.4rem 0.75rem;
  font-weight: 600;
}

.feed-list {
  margin-top: 1rem;
  display: grid;
  gap: 0.75rem;
}

.feed-card {
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  background: #ffffff;
  display: grid;
  gap: 0.35rem;
}

.feed-card a {
  color: #0f172a;
  font-weight: 600;
}

.feed-meta {
  font-size: 0.75rem;
  color: #64748b;
}

body.dark .feed-card {
  border-color: #1e293b;
  background: #0f172a;
}

body.dark .feed-card a {
  color: #e2e8f0;
}

.rules-answer {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #f8fafc;
  min-height: 48px;
  white-space: pre-line;
}

.rules-progress-wrap {
  display: none;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.rules-progress {
  flex: 1;
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.rules-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #1d4ed8, #0ea5e9);
  transition: width 200ms ease;
}

.rules-progress-value {
  min-width: 60px;
  text-align: right;
  font-size: 0.75rem;
  color: #475569;
}

.rules-accordion {
  display: grid;
  gap: 0.75rem;
}

.rules-input-wrap {
  display: grid;
  gap: 0.75rem;
}

.rules-input-row {
  display: block;
}

.rules-input-shell {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rules-question {
  min-height: 56px;
  resize: none;
  padding: 0.8rem 9.5rem 3.25rem 1rem;
  line-height: 1.4;
}

.rules-mic-btn {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #334155;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.rules-mic-btn:hover {
  background: #f1f5f9;
}

.rules-mic-btn.active {
  border-color: #2563eb;
  color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.rules-mic-status {
  font-size: 0.75rem;
  color: #64748b;
  min-height: 18px;
}

.rules-action-btn {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  padding: 0;
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border: 1px solid transparent;
}

.rules-send-btn {
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
}

.rules-clear-btn {
  color: #334155;
}

.visually-hidden {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

.rules-input-actions {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: flex;
  gap: 0.5rem;
}

.rules-input-actions .rules-action-btn {
  width: 40px;
  height: 40px;
  font-size: 1rem;
}

.rules-library-scroll {
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

.rules-pagination {
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.rules-page-info {
  font-size: 0.8rem;
  color: #64748b;
}

.rules-accordion-item {
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #ffffff;
  overflow: hidden;
}

.rules-accordion-item summary {
  list-style: none;
  cursor: pointer;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  color: #0f172a;
  background: #f8fafc;
}

.rules-accordion-item summary::after {
  content: "▾";
  font-size: 0.9rem;
  color: #64748b;
  margin-left: auto;
  transition: transform 150ms ease, color 150ms ease;
}

.rules-accordion-item[open] summary::after {
  transform: rotate(180deg);
  color: #334155;
}

.rules-accordion-item summary::-webkit-details-marker {
  display: none;
}

.rules-accordion-title {
  font-weight: 600;
}

.rules-accordion-badges {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.rules-accordion-status {
  font-size: 0.7rem;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
}

.rules-accordion-body {
  padding: 0.75rem 1rem;
  display: grid;
  gap: 0.5rem;
}

.rules-library-meta {
  font-size: 0.75rem;
  color: #64748b;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.rules-library-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.rules-badge {
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 600;
  background: #e2e8f0;
  color: #334155;
}

.rules-badge.active {
  background: rgba(34, 197, 94, 0.2);
  color: #15803d;
}

body.dark .rules-accordion-item {
  border-color: #1e293b;
  background: #0f172a;
}

body.dark .rules-accordion-item summary {
  background: #0f172a;
  color: #e2e8f0;
}

body.dark .rules-accordion-item summary::after {
  color: #94a3b8;
}

body.dark .rules-accordion-item[open] summary::after {
  color: #cbd5f5;
}

body.dark .rules-accordion-status {
  color: #cbd5f5;
}

body.dark .rules-library-meta {
  color: #94a3b8;
}

body.dark .rules-page-info {
  color: #94a3b8;
}

body.dark .rules-mic-btn {
  background: #0b1220;
  border-color: #1e293b;
  color: #cbd5f5;
}

body.dark .rules-mic-btn:hover {
  background: #111827;
}

body.dark .rules-mic-btn.active {
  border-color: #60a5fa;
  color: #bfdbfe;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

body.dark .rules-mic-status {
  color: #94a3b8;
}

body.dark .rules-clear-btn {
  color: #cbd5f5;
}

@media (max-width: 900px) {
  .rules-question {
    padding-right: 9rem;
    padding-bottom: 3.25rem;
  }
}

body.dark .rules-badge {
  background: #1e293b;
  color: #cbd5f5;
}

body.dark .rules-badge.active {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

body.dark .rules-answer {
  border-color: #1e293b;
  background: #0f172a;
  color: #e2e8f0;
}

body.dark .rules-progress {
  background: #1e293b;
}

body.dark .rules-progress-value {
  color: #94a3b8;
}
body.dark .widget-preview {
  border-color: #1e293b;
}

body.dark .widget-preview-header {
  background: #111827;
}

body.dark .widget-preview-body {
  background: #0b1220;
}

body.dark .widget-preview-bot {
  background: #0f172a;
  border-color: #1e293b;
  color: #e2e8f0;
}

body.dark .widget-preview-input {
  border-color: #1e293b;
  background: #0f172a;
}

body.dark .widget-preview-input input {
  background: #0b1220;
  border-color: #1e293b;
  color: #e2e8f0;
}
.chart-container {
  margin-top: 1rem;
  width: 100%;
  height: 260px;
}

.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

.plan-card {
   border-radius: 0.75rem;
   border: 1px solid #e2e8f0;
   padding: 1rem;
   background: #ffffff;
   display: grid;
   gap: 0.5rem;
 }

.plan-card h3 {
   font-size: 1rem;
   font-weight: 600;
 }

.plan-card .plan-price {
   font-size: 1.1rem;
   font-weight: 600;
 }

.plan-card ul {
   list-style: none;
   padding: 0;
   margin: 0;
   display: grid;
   gap: 0.35rem;
   font-size: 0.85rem;
   color: #475569;
 }

.plan-card .plan-actions {
   margin-top: 0.75rem;
   display: flex;
   gap: 0.5rem;
 }

.plan-card.current {
   border-color: #22c55e;
   box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.15);
 }

.history-list {
   display: grid;
   gap: 0.5rem;
   margin-top: 0.75rem;
 }

.billing-table {
  margin-top: 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  overflow: hidden;
}

.billing-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  align-items: center;
  font-size: 0.85rem;
}

.billing-body .billing-row {
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
}

.billing-row .muted {
  color: #94a3b8;
}

.billing-accordion {
  display: grid;
  gap: 0.75rem;
}

.billing-accordion details {
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #ffffff;
  overflow: hidden;
}

.billing-accordion summary {
  list-style: none;
  cursor: pointer;
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: #1e293b;
  background: #f8fafc;
}

.billing-accordion summary::-webkit-details-marker {
  display: none;
}

.billing-accordion .month-details summary {
  padding: 0.6rem 1rem;
  font-weight: 600;
  color: #334155;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
}

.billing-accordion .month-details summary::-webkit-details-marker {
  display: none;
}

.billing-accordion .month-block {
  border-top: 1px solid #e2e8f0;
  padding: 0.5rem 0;
}

.billing-accordion .billing-row {
  border-top: 1px solid #e2e8f0;
}

body.dark .billing-accordion details {
  border-color: #1e293b;
  background: #0f172a;
}

body.dark .billing-accordion summary {
  background: #0f172a;
  color: #e2e8f0;
}

body.dark .billing-accordion .month-details summary {
  background: #0f172a;
  color: #cbd5f5;
}

body.dark .chart-container {
  background: transparent;
}

body.dark .plan-card {
   background: #0f172a;
   border-color: #1e293b;
 }

body.dark .plan-card ul {
   color: #cbd5f5;
 }

body.dark .history-item {
   border-color: #1e293b;
   background: #111827;
 }

body.dark .billing-table {
  border-color: #1e293b;
}

body.dark .billing-header {
  background: #0f172a;
  color: #cbd5f5;
}

body.dark .billing-body .billing-row {
  border-top: 1px solid #1e293b;
  background: #111827;
}
footer.footer {
  margin-top: 2rem;
  padding: 1.5rem 0 0;
  border-top: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

body.dark footer.footer {
  border-color: #1e293b;
  color: #94a3b8;
}

body.dark .badge {
  border-color: #1e293b;
  background: #0b1220;
  color: #cbd5f5;
}

@media (max-width: 1024px) {
  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 280px;
    transform: translateX(-100%);
    transition: transform 200ms ease;
    z-index: 50;
    height: 100vh;
  }

  body.sidebar-open .sidebar,
  .app-shell.sidebar-open .sidebar {
    transform: translateX(0);
  }

  body.sidebar-open {
    overflow: hidden;
  }

  .content {
    padding: 1.5rem;
    height: auto;
    overflow: visible;
  }

  body {
    overflow: auto;
  }

  body.sidebar-open .sidebar-overlay,
  .app-shell.sidebar-open .sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-menu-btn {
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
    padding: 0;
  }
}

@media (max-width: 768px) {
  .auth-screen {
    padding: 1.5rem;
  }

  .auth-card {
    padding: 1.5rem;
  }

  .sidebar {
    padding: 1rem;
  }

  .sidebar-header,
  .sidebar-footer {
    width: 100%;
  }

  .nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.25rem;
  }

  .nav-item {
    flex: 0 0 auto;
  }

  .content {
    padding: 1rem;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-actions {
    width: 100%;
  }

  .topbar-actions > * {
    flex: 1 1 100%;
  }

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

  .messages {
    max-height: 60vh;
  }

  .message-user,
  .message-bot {
    max-width: 100%;
  }

  .widget-preview-wrap {
    justify-content: center;
  }

  .widget-preview {
    width: 100%;
  }

  .plan-card .plan-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .billing-table,
  .billing-accordion .month-block {
    overflow-x: auto;
  }

  .billing-row {
    min-width: 640px;
  }

  footer.footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 520px) {
  .auth-title {
    font-size: 1.25rem;
  }

  .page-title {
    font-size: 1.25rem;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
  }

  .input {
    font-size: 0.85rem;
  }
}
