/* app.css — shared layout + components */
/* Every color comes from a theme file; this file uses var(--*) only. */
/* ---------- reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 0.6rem;
  line-height: 1.2;
  color: var(--navy-deep);
  font-weight: 800;
  letter-spacing: -0.02em;
}

p {
  margin: 0 0 1rem;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

::selection {
  background: var(--blue);
  color: var(--foot-text);
}

/* ---------- layout ---------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.page {
  min-height: 70vh;
  padding: 48px 0 72px;
}

.section {
  padding: 64px 0;
}

.section-head {
  max-width: 680px;
  margin: 0 auto 40px;
  text-align: center;
}

.section-head h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
}

.section-head p {
  color: var(--muted);
  margin-bottom: 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.flex {
  display: flex;
  align-items: center;
  gap: 12px;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.2s ease;
}

.site-header.scrolled {
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 68px;
}

.logo,
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--navy-deep);
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.logo:hover,
.brand:hover {
  text-decoration: none;
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--navy-deep);
  letter-spacing: -0.02em;
  line-height: 1;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--grad);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--foot-text);
  flex-shrink: 0;
}

.logo-mark svg {
  width: 20px;
  height: 20px;
}

.main-nav,
.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
}

.main-nav a,
.site-nav a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
}

.main-nav a:hover,
.main-nav a.active,
.site-nav a:hover,
.site-nav a.active {
  color: var(--navy);
  background: var(--card-soft);
  text-decoration: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.theme-toggle:hover {
  color: var(--navy);
  border-color: var(--blue);
}

.theme-toggle svg {
  width: 19px;
  height: 19px;
}

.burger {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--text);
  align-items: center;
  justify-content: center;
}

.burger svg {
  width: 20px;
  height: 20px;
}

.mobile-menu {
  display: none;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  padding: 8px 24px 20px;
}

.mobile-menu.open {
  display: block;
}

.mobile-menu a {
  display: block;
  padding: 12px 4px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-weight: 600;
}

.mobile-menu a:last-child {
  border-bottom: 0;
}

.mobile-menu .btn {
  margin-top: 14px;
  width: 100%;
  justify-content: center;
}

/* ---------- footer ---------- */
.site-footer {
  background: var(--foot-bg);
  color: var(--foot-text);
  padding: 56px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
}

.site-footer .logo,
.site-footer .brand {
  color: var(--foot-text);
}

.site-footer .brand-name {
  color: var(--foot-text);
}

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

.footer-col a {
  display: block;
  margin-bottom: 10px;
}

.footer-col a:last-child {
  margin-bottom: 0;
}

.site-footer h4 {
  color: var(--foot-text);
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.site-footer p {
  color: var(--foot-muted);
  font-size: 0.95rem;
}

.site-footer a {
  color: var(--foot-muted);
  font-size: 0.95rem;
}

.site-footer a:hover {
  color: var(--foot-text);
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-bottom {
  border-top: 1px solid var(--foot-border);
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--foot-muted);
  font-size: 0.9rem;
}

.footer-bottom a {
  color: var(--foot-muted);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.btn-primary {
  background-color: #2e63f6;
  background: var(--grad);
  color: var(--foot-text);
  box-shadow: var(--shadow-btn);
}

.btn-primary:hover {
  box-shadow: var(--shadow);
}

.btn-ghost {
  background: var(--card);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-ghost:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.btn-danger {
  background: var(--red);
  color: var(--foot-text);
}

.btn-outline {
  background: transparent;
  color: var(--blue);
  border-color: var(--blue);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 15px 30px;
  font-size: 1.05rem;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-btn:hover {
  color: var(--blue);
  border-color: var(--blue);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

/* ---------- forms ---------- */
.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 7px;
  color: var(--text);
}

.field label .req {
  color: var(--red);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field textarea {
  min-height: 120px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--border);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--muted-2);
}

.field .hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 6px;
  margin-bottom: 0;
}

.field .error-text {
  font-size: 0.85rem;
  color: var(--red);
  margin-top: 6px;
  margin-bottom: 0;
}

.field.has-error input,
.field.has-error select,
.field.has-error textarea {
  border-color: var(--red);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.input-group {
  display: flex;
  gap: 8px;
}

.input-group .field {
  flex: 1;
  margin-bottom: 0;
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.password-toggle:hover {
  color: var(--blue);
}

.password-toggle svg {
  width: 18px;
  height: 18px;
}

.strength {
  margin-top: 8px;
}

.strength-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.strength-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--red);
  transition: width 0.3s ease, background 0.3s ease;
}

.strength[data-level="medium"] .strength-fill {
  width: 60%;
  background: var(--amber);
}

.strength[data-level="strong"] .strength-fill {
  width: 100%;
  background: var(--green);
}

.strength[data-level="weak"] .strength-fill {
  width: 30%;
  background: var(--red);
}

.strength-label {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 5px;
  margin-bottom: 0;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border-strong);
}

.toggle button {
  padding: 8px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--muted);
}

.toggle button.active {
  background: var(--grad);
  color: var(--foot-text);
  box-shadow: var(--shadow-btn);
}

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-track {
  width: 48px;
  height: 27px;
  border-radius: 999px;
  background: var(--border-strong);
  position: relative;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--bg-2);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}

.switch input:checked + .switch-track {
  background: var(--blue);
}

.switch input:checked + .switch-track::after {
  transform: translateX(21px);
}

.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.switch-label {
  font-weight: 600;
  font-size: 0.92rem;
  margin-left: 10px;
}

.checkbox-row,
.radio-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.92rem;
  color: var(--muted);
}

.checkbox-row input,
.radio-row input {
  margin-top: 4px;
  accent-color: var(--blue);
}

/* ---------- tables ---------- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
  background: var(--card);
}

.table th,
.table td {
  text-align: left;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: var(--card-soft);
  white-space: nowrap;
}

.table tr:last-child td {
  border-bottom: 0;
}

.table tbody tr:hover {
  background: var(--card-soft);
}

.table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---------- cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.card-title {
  font-size: 1.15rem;
  margin-bottom: 4px;
}

.card-sub {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 0;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.card-head .card-title {
  margin-bottom: 2px;
}

.admin-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.admin-card h3 {
  font-size: 1.05rem;
}

/* ---------- badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--card-soft);
  color: var(--muted);
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.badge-green {
  color: var(--green);
  border-color: var(--green);
  background: var(--card);
}

.badge-amber {
  color: var(--amber);
  border-color: var(--amber);
  background: var(--card);
}

.badge-red {
  color: var(--red);
  border-color: var(--red);
  background: var(--card);
}

.badge-blue {
  color: var(--blue);
  border-color: var(--blue);
  background: var(--card);
}

/* ---------- tabs ---------- */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  margin-bottom: 24px;
}

.tab {
  padding: 11px 18px;
  font-weight: 700;
  font-size: 0.93rem;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* ---------- modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: color-mix(in srgb, var(--navy-deep) 55%, transparent);
}

.modal.open {
  display: flex;
}

.modal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 28px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.modal-card h3 {
  padding-right: 36px;
}

/* ---------- toast ---------- */
.toast-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(360px, calc(100vw - 48px));
}

.toast {
  background: var(--navy-deep);
  color: var(--foot-text);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 13px 16px;
  font-size: 0.92rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--green);
}

.toast.error svg {
  color: var(--red);
}

/* ---------- sidebar ---------- */
.layout-shell {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}

.sidebar {
  width: 260px;
  flex-shrink: 0;
  position: sticky;
  top: 92px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.sidebar-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-2);
  font-weight: 800;
  padding: 10px 12px 6px;
}

.sidebar a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.94rem;
}

.sidebar a:hover {
  background: var(--card-soft);
  color: var(--text);
  text-decoration: none;
}

.sidebar a.active {
  background: var(--grad);
  color: var(--foot-text);
}

.sidebar a svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar .sidebar-foot {
  border-top: 1px solid var(--border);
  margin-top: 12px;
  padding-top: 12px;
}

.main-col {
  flex: 1;
  min-width: 0;
}

/* ---------- stat-card ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.stat-card .stat-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
}

.stat-card .stat-value {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--navy-deep);
  letter-spacing: -0.02em;
}

.stat-card .stat-delta {
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 8px;
  margin-bottom: 0;
}

.stat-card .stat-delta.up {
  color: var(--green);
}

.stat-card .stat-delta.down {
  color: var(--red);
}

.stat-card .stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--card-soft);
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.stat-card .stat-icon svg {
  width: 21px;
  height: 21px;
}

/* ---------- chat ---------- */
.chat-window {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 560px;
  max-height: 75vh;
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--card-soft);
}

.chat-head h3 {
  margin-bottom: 0;
  font-size: 1.05rem;
}

.chat-head p {
  margin-bottom: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.msg {
  max-width: 78%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.95rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

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

.msg.user {
  align-self: flex-end;
  background: var(--grad);
  color: var(--foot-text);
  border-bottom-right-radius: 5px;
}

.msg.ai {
  align-self: flex-start;
  background: var(--card-soft);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 5px;
}

.msg .msg-time {
  display: block;
  font-size: 0.75rem;
  margin-top: 6px;
  color: var(--muted-2);
}

.msg.user .msg-time {
  color: var(--foot-muted);
}

.chat-foot {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  background: var(--card);
}

.chat-foot input {
  flex: 1;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--card-soft);
  color: var(--text);
  outline: none;
}

.chat-foot input:focus {
  border-color: var(--blue);
}

.chat-send {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--grad);
  color: var(--foot-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-btn);
}

.chat-send svg {
  width: 19px;
  height: 19px;
}

.chat-typing {
  display: inline-flex;
  gap: 5px;
  padding: 14px 18px;
}

.chat-typing span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted-2);
}

/* ---------- pricing ---------- */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: stretch;
}

.plan {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 26px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.plan.featured {
  border: 2px solid var(--blue);
  transform: translateY(-8px);
}

.plan-badge {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--grad);
  color: var(--foot-text);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 5px 14px;
  border-radius: 999px;
  white-space: nowrap;
}

.plan h3 {
  font-size: 1.25rem;
}

.plan .plan-price {
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1;
  color: var(--navy-deep);
  letter-spacing: -0.03em;
  margin: 10px 0 4px;
}

.plan .plan-price small {
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
}

.plan .plan-desc {
  color: var(--muted);
  font-size: 0.93rem;
}

.plan ul {
  margin: 20px 0 26px;
  flex: 1;
}

.plan ul li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 7px 0;
  font-size: 0.94rem;
  color: var(--muted);
}

.plan ul li svg {
  width: 18px;
  height: 18px;
  color: var(--green);
  flex-shrink: 0;
  margin-top: 3px;
}

.plan .btn {
  justify-content: center;
}

.billing-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 36px;
  font-weight: 700;
  color: var(--muted);
}

.billing-toggle .save-note {
  color: var(--green);
  font-size: 0.85rem;
}

.cta-card {
  background: var(--grad);
  color: var(--foot-text);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 44px 32px;
  text-align: center;
  align-items: center;
}

.cta-card h2 {
  color: var(--foot-text);
}

.cta-card p {
  color: var(--foot-muted);
}

.cta-card .btn-primary {
  background: var(--bg-2);
  color: var(--navy);
  box-shadow: none;
}

/* ---------- hero ---------- */
.hero {
  padding: 84px 0 72px;
  text-align: center;
  background: var(--bg);
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border-strong);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.hero h1 {
  font-size: clamp(2.3rem, 5.4vw, 4rem);
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

.hero h1 .grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p.lead {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 640px;
  margin: 0 auto 32px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-proof {
  display: flex;
  gap: 28px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 44px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.hero-proof span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.hero-proof svg {
  width: 17px;
  height: 17px;
  color: var(--green);
}

/* ---------- auth ---------- */
.auth-wrap {
  min-height: 78vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 0;
}

.auth-card {
  width: 100%;
  max-width: 980px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.auth-form-col {
  padding: 44px 40px;
}

.auth-form-col h1 {
  font-size: 1.7rem;
}

.auth-form-col .auth-sub {
  color: var(--muted);
  font-size: 0.95rem;
}

.auth-side {
  background: var(--grad);
  color: var(--foot-text);
  padding: 44px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.auth-side h2 {
  color: var(--foot-text);
  font-size: 1.6rem;
}

.auth-side p {
  color: var(--foot-muted);
  margin-bottom: 0;
}

.auth-side ul li {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  color: var(--foot-text);
  font-weight: 600;
  font-size: 0.94rem;
}

.auth-side ul li svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  color: var(--sky);
}

.google-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--text);
  font-weight: 700;
  font-size: 0.95rem;
}

.google-btn:hover {
  border-color: var(--blue);
}

.google-btn svg {
  width: 19px;
  height: 19px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted-2);
  font-size: 0.85rem;
  margin: 22px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.9rem;
  margin-top: 18px;
}

/* ---------- dashboard ---------- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  align-items: start;
}

.chart-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  min-height: 280px;
}

.chart-box h3 {
  font-size: 1.05rem;
}

.chart-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  color: var(--muted-2);
  font-size: 0.9rem;
}

.date-pills {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: var(--card-soft);
  border: 1px solid var(--border);
  flex-wrap: wrap;
}

.date-pills button,
.date-pills a {
  padding: 7px 15px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.date-pills button:hover,
.date-pills a:hover {
  color: var(--text);
  text-decoration: none;
}

.date-pills button.active,
.date-pills a.active {
  background: var(--grad);
  color: var(--foot-text);
  box-shadow: var(--shadow-btn);
}

/* ---------- hero demo pills wrap on narrow screens ---------- */
.chat-window .date-pills {
  display: flex;
  flex-wrap: wrap;
  border-radius: 18px;
}

.quick-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.quick-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-weight: 700;
  font-size: 0.93rem;
}

.quick-link:hover {
  border-color: var(--blue);
  text-decoration: none;
}

.quick-link svg {
  width: 20px;
  height: 20px;
  color: var(--blue);
  flex-shrink: 0;
}

/* ---------- admin-table ---------- */
.admin-table {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.admin-table .table {
  box-shadow: none;
  border: 0;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.admin-toolbar .field {
  flex: 1;
  min-width: 220px;
  margin-bottom: 0;
}

.admin-toolbar .field input {
  background: var(--card);
}

.admin-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--muted);
  font-weight: 700;
  font-size: 0.86rem;
}

.filter-chip:hover,
.filter-chip.active {
  color: var(--blue);
  border-color: var(--blue);
}

/* ---------- pagination ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--muted);
  font-weight: 700;
  font-size: 0.92rem;
}

.pagination a:hover {
  color: var(--blue);
  border-color: var(--blue);
  text-decoration: none;
}

.pagination .current,
.pagination span.current {
  background: var(--grad);
  color: var(--foot-text);
  border-color: transparent;
}

.pagination .disabled {
  opacity: 0.5;
}

/* ---------- utilities ---------- */
.alert {
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--card-soft);
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.alert svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  margin-top: 2px;
}

.alert-success {
  color: var(--green);
  border-color: var(--green);
}

.alert-error,
.alert-danger {
  color: var(--red);
  border-color: var(--red);
}

.alert-warning {
  color: var(--amber);
  border-color: var(--amber);
}

.alert-info {
  color: var(--blue);
  border-color: var(--blue);
}

.empty-state {
  text-align: center;
  padding: 56px 24px;
  color: var(--muted);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  color: var(--muted-2);
}

.empty-state h3 {
  color: var(--muted);
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--grad);
  color: var(--foot-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  flex-shrink: 0;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 0.8rem;
}

.avatar-lg {
  width: 64px;
  height: 64px;
  font-size: 1.3rem;
}

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

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

.text-right {
  text-align: right;
}

.hidden {
  display: none;
}

.w-full {
  width: 100%;
}

.cookie {
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  max-width: 560px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.cookie p {
  flex: 1;
  min-width: 220px;
  margin-bottom: 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.faq-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 12px;
  overflow: hidden;
}

.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  text-align: left;
}

.faq-q svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.faq-item.open .faq-q svg {
  transform: rotate(180deg);
}

.faq-a {
  display: none;
  padding: 0 20px 20px;
  color: var(--muted);
}

.faq-item.open .faq-a {
  display: block;
}

.seo-preview {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
}

.seo-preview .preview-title {
  color: var(--blue);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.seo-preview .preview-url {
  color: var(--green);
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.seo-preview .preview-desc {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0;
}

/* ---------- eyebrow ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border-strong);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

/* ---------- hero-inner ---------- */
.hero .hero-inner {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
  text-align: left;
}

.hero-copy h1 {
  margin-left: 0;
  margin-right: 0;
  max-width: 560px;
  text-wrap: balance;
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 520px;
  margin-bottom: 32px;
}

.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.trust-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.trust-row span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.trust-row span::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

.hero-demo {
  min-width: 0;
}

.chat-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18);
}

/* ---------- marquee ---------- */
.marquee {
  overflow: hidden;
  padding: 18px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--card-soft);
}

.marquee-track {
  display: flex;
  gap: 12px;
  width: max-content;
  animation: marquee-drift 24s ease-in-out infinite alternate;
}

.marquee-item {
  white-space: nowrap;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

@keyframes marquee-drift {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-140px);
  }
}

/* ---------- stats-band ---------- */
.stats-band {
  padding: 48px 0 8px;
}

/* ---------- features ---------- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--grad);
  color: var(--foot-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.feature-icon svg {
  width: 22px;
  height: 22px;
}

.feature-card h3 {
  font-size: 1.08rem;
  margin-bottom: 8px;
}

.feature-card p {
  color: var(--muted);
  font-size: 0.94rem;
  margin-bottom: 0;
}

/* ---------- models ---------- */
.models-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.model-card {
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.model-card:hover {
  transform: translateY(-4px);
}

.model-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.model-head strong {
  font-size: 1.05rem;
  color: var(--navy-deep);
}

.model-price {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 14px;
}

.model-caps {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.model-caps li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 0.9rem;
  color: var(--muted);
}

.model-caps li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
  margin-top: 7px;
  flex-shrink: 0;
}

.model-card .btn {
  align-self: flex-start;
  margin-top: auto;
}

/* ---------- benefits ---------- */
.benefits {
  background: var(--card-soft);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.benefits-grid .card h3 {
  font-size: 1.08rem;
  margin-bottom: 8px;
}

.benefits-grid .card p {
  color: var(--muted);
  font-size: 0.94rem;
  margin-bottom: 0;
}

/* ---------- plans ---------- */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  align-items: stretch;
}

.plan.plan-featured {
  border: 2px solid var(--blue);
  transform: translateY(-8px);
}

.price-value {
  font-family: var(--font-head);
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--navy-deep);
}

.price-period {
  font-size: 0.9rem;
  color: var(--muted-2);
}

.plan-credits {
  font-weight: 700;
  color: var(--blue);
  font-size: 0.92rem;
  margin-bottom: 16px;
}

.plan-features {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.plan-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--muted);
}

.plan-features li::before {
  content: "";
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: rgba(22, 163, 74, 0.14);
  flex-shrink: 0;
  margin-top: 2px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316a34a' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-size: 11px 11px;
  background-position: center;
  background-repeat: no-repeat;
}

.plans-more {
  text-align: center;
  margin-top: 28px;
}

.plans-more a {
  font-weight: 600;
  color: var(--blue);
}

/* ---------- faq ---------- */
.faq-list {
  max-width: 780px;
  margin: 0 auto;
}

/* ---------- cta ---------- */
.cta-section {
  padding-top: 40px;
}

/* ---------- pricing page ---------- */
.pricing-page {
  padding-top: 64px;
}

.pricing-table-wrap {
  margin-top: 48px;
  overflow-x: auto;
  padding: 8px 26px 20px;
}

/* ---------- auth ---------- */
.auth-page {
  padding-top: 64px;
  padding-bottom: 72px;
}

.auth-card-single {
  grid-template-columns: 1fr;
  max-width: 520px;
  margin: 0 auto;
}

.auth-switch {
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 22px;
  margin-bottom: 0;
}

.auth-switch a {
  color: var(--blue);
  font-weight: 700;
}

.auth-side .brand-name {
  color: var(--foot-text);
}

.auth-side-tagline {
  font-size: 1.05rem;
  color: var(--foot-muted);
  margin-bottom: 24px;
}

.auth-chat {
  margin-bottom: 24px;
}

.auth-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-points li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.94rem;
  color: var(--foot-text);
}

.auth-points li svg {
  width: 18px;
  height: 18px;
  color: var(--green);
  flex-shrink: 0;
  margin-top: 2px;
}

/* ---------- chat workspace ---------- */
.chat-wrap {
  display: flex;
  gap: 1rem;
  min-height: 70vh;
}

.chat-sessions {
  width: 260px;
  flex-shrink: 0;
}

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.msg-user {
  align-self: flex-end;
  background: var(--grad);
  color: var(--foot-text);
  border-bottom-right-radius: 5px;
}

.msg-ai {
  align-self: flex-start;
  background: var(--card-soft);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 5px;
}

.msg .msg-meta,
.msg-meta {
  display: block;
  font-size: 0.75rem;
  opacity: 0.7;
  margin-top: 0.25rem;
}

.msg-user .msg-meta {
  color: var(--foot-muted);
  opacity: 0.9;
}

/* Thin, subtle scrollbars for the chat panes (no chunky native bars). */
.chat-messages,
.chat-sessions .list-group {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.chat-messages::-webkit-scrollbar,
.chat-sessions .list-group::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb,
.chat-sessions .list-group::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
}

.chat-messages::-webkit-scrollbar-track,
.chat-sessions .list-group::-webkit-scrollbar-track {
  background: transparent;
}

.prompt-item {
  cursor: pointer;
  text-align: left;
}

.prompt-item:hover {
  background: var(--card-soft);
}

/* ---------- fund ---------- */
.preset-btn {
  border-radius: 999px;
  font-weight: 700;
  white-space: nowrap;
  background: var(--card);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 8px 18px;
}

.preset-btn.active {
  background: var(--grad);
  color: var(--foot-text);
  border-color: transparent;
  box-shadow: var(--shadow-btn);
}

.gateway-card {
  width: 100%;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.gateway-card .card-body {
  padding: 14px 16px;
}

.gateway-card:hover {
  border-color: var(--blue);
}

.gateway-card:has(.gateway-radio:checked) {
  border-color: var(--blue);
  background: var(--card-soft);
  box-shadow: 0 0 0 3px rgba(46, 99, 246, 0.16);
}

.gateway-radio {
  accent-color: var(--blue);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  cursor: pointer;
}

.copy-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

/* ---------- user shell ---------- */
.app-header .theme-toggle {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  color: var(--text);
  border-radius: 50%;
}

.app-header .theme-toggle svg {
  width: 21px;
  height: 21px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.topbar h1 {
  font-size: 1.35rem;
  margin-bottom: 0;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar .burger {
  display: none;
}

.credit-balance {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border-strong);
  color: var(--navy-deep);
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.credit-balance svg {
  color: var(--blue);
}

.avatar-menu {
  position: relative;
}

.avatar-menu summary {
  list-style: none;
  cursor: pointer;
}

.avatar-menu summary::-webkit-details-marker {
  display: none;
}

.avatar-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 200px;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 10px;
  z-index: 70;
  display: flex;
  flex-direction: column;
}

.avatar-dropdown .avatar-name {
  display: block;
  padding: 8px 12px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
  font-weight: 700;
  color: var(--navy-deep);
  font-size: 0.92rem;
}

.avatar-dropdown a,
.avatar-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border-radius: 9px;
  background: none;
  border: 0;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
}

.avatar-dropdown a:hover,
.avatar-dropdown button:hover {
  background: var(--card-soft);
  text-decoration: none;
}

.sidebar .sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  color: var(--navy-deep);
  flex-shrink: 0;
}

.sidebar .sidebar-brand:hover {
  text-decoration: none;
}

.sidebar .sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 12px;
  flex: 1;
  overflow-y: auto;
}

.sidebar .sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.93rem;
}

.sidebar .sidebar-nav a svg {
  flex-shrink: 0;
  color: var(--muted-2);
}

.sidebar .sidebar-nav a:hover {
  background: var(--card-soft);
  color: var(--navy-deep);
  text-decoration: none;
}

.sidebar .sidebar-nav a.active {
  background: var(--grad);
  color: var(--foot-text);
}

.sidebar .sidebar-nav a.active svg {
  color: var(--foot-text);
}

/* ---------- footer extras ---------- */
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-brand .brand-name {
  font-size: 1.2rem;
}

.secure-payments {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.secure-payments svg {
  color: var(--green);
}

/* ---------- stat-card body ---------- */
.stat-card h3 {
  font-size: 1.4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-card .card-body {
  min-width: 0;
}

.stat-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.stat-title {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--muted);
}

.stat-trend {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--green);
}

/* ---------- forms extras ---------- */
.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.field-row a {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--blue);
  white-space: nowrap;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.checkbox-label input {
  accent-color: var(--blue);
  width: 16px;
  height: 16px;
  cursor: pointer;
  flex-shrink: 0;
}

.field-error {
  display: block;
  color: var(--red);
  font-size: 0.82rem;
  font-weight: 600;
  margin-top: 6px;
}

.agreement {
  font-size: 0.82rem;
  color: var(--muted-2);
  text-align: center;
  line-height: 1.6;
  margin-top: 16px;
  margin-bottom: 0;
}

.agreement a {
  color: var(--blue);
  font-weight: 600;
}

.row-check {
  accent-color: var(--blue);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.seo-title {
  font-weight: 600;
}

.seo-desc {
  resize: vertical;
}

/* ---------- toggle switch ---------- */
/* Bare checkbox switch: visible on its own (e.g. currencies list). When the
   checkbox lives inside a label.switch, the span.slider provides the visuals
   and the input itself stays hidden (rule below). */
.toggle-switch {
  appearance: none;
  -webkit-appearance: none;
  width: 48px;
  height: 27px;
  border-radius: 999px;
  background: var(--border-strong);
  position: relative;
  transition: background 0.2s ease;
  flex-shrink: 0;
  cursor: pointer;
  margin: 0;
}

.toggle-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--bg-2);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}

.toggle-switch:checked {
  background: var(--blue);
}

.toggle-switch:checked::after {
  transform: translateX(21px);
}

.toggle-switch:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

label.switch .toggle-switch,
.switch .toggle-switch {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle .switch {
  width: 48px;
  height: 27px;
  border-radius: 999px;
  background: var(--border-strong);
  position: relative;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.toggle .switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--bg-2);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}

.toggle input:checked + .switch {
  background: var(--blue);
}

.toggle input:checked + .switch::after {
  transform: translateX(21px);
}

.toggle input:focus-visible + .switch {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.slider {
  width: 48px;
  height: 27px;
  border-radius: 999px;
  background: var(--border-strong);
  position: relative;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.slider::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--bg-2);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}

.switch input:checked + .slider {
  background: var(--blue);
}

.switch input:checked + .slider::after {
  transform: translateX(21px);
}

.switch input:focus-visible + .slider {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.toggle-label {
  font-weight: 600;
  font-size: 0.92rem;
  margin-left: 10px;
}

/* ---------- error page ---------- */
.error-page {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.error-card {
  text-align: center;
  padding: 48px 36px;
  max-width: 520px;
  width: 100%;
}

.error-code {
  display: block;
  font-family: var(--font-head);
  font-size: 4.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
  margin-bottom: 16px;
}

.error-card h1 {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.error-card p {
  color: var(--muted);
  margin-bottom: 24px;
}

/* ---------- clear page ---------- */
.clear-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}

.clear-card {
  width: 100%;
  max-width: 520px;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 36px 32px;
  box-shadow: var(--shadow);
}

.clear-card h1 {
  font-size: 1.4rem;
  margin-bottom: 6px;
  color: var(--navy-deep);
}

.clear-card p {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 24px;
}

.clear-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 4px;
  border-bottom: 1px solid var(--border);
}

.clear-row:last-of-type {
  border-bottom: 0;
}

.clear-row .ic {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.clear-row .ic.ok {
  background: rgba(22, 163, 74, 0.14);
  color: var(--green);
}

.clear-row .ic.bad {
  background: rgba(220, 38, 38, 0.12);
  color: var(--red);
}

.clear-row .ic svg {
  width: 15px;
  height: 15px;
}

.clear-row b {
  font-size: 0.95rem;
  color: var(--text);
}

.clear-row code {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--muted-2);
  background: var(--card-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px 8px;
}

.clear-actions {
  display: flex;
  gap: 10px;
  margin-top: 26px;
  flex-wrap: wrap;
}

/* ---------- misc ---------- */
.cookie-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.no-print {
  margin-top: 1.5rem;
}

@media print {
  .no-print {
    display: none;
  }
}

/* ---------- bootstrap-4 badge compat ---------- */
.badge-success {
  background: var(--green);
  color: #fff;
}

.badge-info {
  background: var(--sky);
  color: #fff;
}

.badge-secondary {
  background: var(--muted);
  color: #fff;
}

.badge-danger {
  background: var(--red);
  color: #fff;
}

/* ---------- testimonials ---------- */
.testimonials {
  background: var(--card-soft);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.testimonial-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.testimonial-card::before {
  content: "";
  width: 34px;
  height: 26px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%232e63f6'%3E%3Cpath d='M9.5 8C7 8 5 10 5 12.5S7 17 9.5 17c.4 0 .8-.1 1.1-.2C10 18.4 8.9 19.5 7.5 20l.8 1.5C11.5 20.5 14 17.5 14 12.5 14 10 12 8 9.5 8zm10 0C17 8 15 10 15 12.5S17 17 19.5 17c.4 0 .8-.1 1.1-.2-.6 1.6-1.7 2.7-3.1 3.2l.8 1.5C21.5 20.5 24 17.5 24 12.5 24 10 22 8 19.5 8z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  flex-shrink: 0;
}

.testimonial-quote {
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: 0;
  flex: 1;
}

.testimonial-author {
  font-size: 0.95rem;
  color: var(--navy-deep);
}

.testimonial-role {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}

/* ---------- reveal ---------- */
/* Scroll-reveal: JS adds .js-reveal to <html> and .visible to each
   .reveal element as it enters view. Without JS nothing is hidden. */
.js-reveal .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.js-reveal .reveal.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .js-reveal .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .marquee-track {
    animation: none;
  }
}

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 520px;
    margin: 0 auto;
  }

  .plan.featured,
  .plan.plan-featured {
    transform: none;
  }

  .layout-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    position: static;
    display: none;
  }

  .sidebar.sidebar-open {
    display: block;
  }

  .topbar .burger {
    display: inline-flex;
  }

  .hero .hero-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .features-grid,
  .models-grid,
  .benefits-grid,
  .plans-grid,
  .testimonials-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 920px) {
  .main-nav,
  .site-nav {
    display: none;
  }

  /* Wide tables scroll inside their card instead of overflowing the page
     on tablets/phones (no dropdown menus live inside admin card bodies,
     so clipping is safe; tooltips render in <body>). */
  .card-body {
    overflow-x: auto;
  }

  .header-actions .btn {
    display: none;
  }

  .burger {
    display: inline-flex;
  }

  .auth-card {
    grid-template-columns: 1fr;
    max-width: 520px;
  }

  .auth-side {
    display: none;
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero {
    padding: 56px 0 48px;
  }

  .chat-wrap {
    flex-direction: column;
  }

  .chat-sessions {
    width: 100%;
  }

  .chat-window {
    height: 480px;
  }

  .msg {
    max-width: 88%;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 15px;
  }

  .container {
    padding: 0 16px;
  }

  .grid-2,
  .grid-3,
  .grid-4,
  .form-row,
  .form-row-3,
  .features-grid,
  .models-grid,
  .benefits-grid,
  .plans-grid,
  .testimonials-grid {
    grid-template-columns: 1fr;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .section {
    padding: 44px 0;
  }

  .page {
    padding: 28px 0 48px;
  }

  .card,
  .admin-card {
    padding: 18px;
  }

  .auth-form-col {
    padding: 30px 22px;
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .header-inner {
    gap: 12px;
    height: 60px;
  }

  .toast-wrap {
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: none;
  }

  .cookie {
    left: 12px;
    right: 12px;
    bottom: 12px;
    padding: 16px;
  }

  .modal-card {
    padding: 22px 18px;
  }

  .table th,
  .table td {
    padding: 10px 12px;
  }

  .quick-links {
    grid-template-columns: 1fr;
  }
}
