/*
 * app.css -- compact overrides on top of Sneat core.css, plus the few layout
 * rules Sneat keeps in demo.css. No SCSS build needed: the sidebar reads CSS
 * variables, and the rest is plain cascade.
 */

:root, [data-bs-theme] {
  /* Tighter sidebar */
  --bs-menu-width: 14.5rem;
  --bs-menu-collapsed-width: 4.5rem;
  --bs-menu-item-spacer: 0.0625rem;
  --bs-menu-vertical-link-padding-y: 0.3rem;
  --bs-menu-vertical-link-padding-x: 0.8rem;
  --bs-menu-vertical-menu-link-padding-y: 0.25rem;
  --bs-menu-vertical-menu-level-spacer: 0.5rem;
}

/* Base type one notch smaller than Sneat's 15px default */
html { font-size: 14px; }
body { font-size: 0.9286rem; line-height: 1.4; }
h1, .h1 { font-size: 1.85rem; } h2, .h2 { font-size: 1.55rem; } h3, .h3 { font-size: 1.3rem; }
h4, .h4 { font-size: 1.15rem; } h5, .h5 { font-size: 1rem; }   h6, .h6 { font-size: 0.9286rem; }

/* Compact controls */
.btn { padding: 0.36rem 0.9rem; font-size: 0.9286rem; }
.btn-sm { padding: 0.22rem 0.6rem; font-size: 0.8125rem; }
.btn-icon { width: calc(1.5em + 0.72rem + 2px); height: calc(1.5em + 0.72rem + 2px); }
.btn-icon.btn-sm { width: calc(1.5em + 0.44rem + 2px); height: calc(1.5em + 0.44rem + 2px); }
.btn:hover { transform: none; }
.form-control { padding: 0.4rem 0.75rem; font-size: 0.9286rem; }
.form-control-sm { padding: 0.25rem 0.6rem; font-size: 0.8125rem; }
/* Longhands only: the shorthand would reset the right gutter core.css reserves for the caret */
.form-select { padding-top: 0.4rem; padding-bottom: 0.4rem; padding-left: 0.75rem; font-size: 0.9286rem; }
.form-select-sm { padding-top: 0.25rem; padding-bottom: 0.25rem; padding-left: 0.6rem; font-size: 0.8125rem; }
.form-label { margin-bottom: 0.25rem; font-size: 0.8571rem; }
.input-group-text { padding: 0.4rem 0.75rem; }
.card .card-header { padding: 0.9rem 1.25rem; }
.card .card-body { padding: 1.25rem; }
.card-title { margin-bottom: 0.5rem; }
.table > :not(caption) > * > * { padding: 0.5rem 0.9rem; }
.table-sm > :not(caption) > * > * { padding: 0.3rem 0.6rem; }

/* Data tables inside cards (.table-wrap / .app-table) */
.app-table { margin-bottom: 0; }
.app-table > :not(caption) > * > * { padding: 0.7rem 0.9rem; vertical-align: middle; }
.app-table > :not(caption) > * > :first-child { padding-left: 1.25rem; }
.app-table > :not(caption) > * > :last-child { padding-right: 1.25rem; }
.app-table > thead > tr > th {
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--bs-secondary-color); background: color-mix(in srgb, var(--bs-body-color) 5%, transparent);
  border-bottom: 1px solid var(--bs-border-color);
  white-space: nowrap;
}
.app-table > tbody > tr:last-child > td { border-bottom: 0; }
.app-table > tbody > tr:hover > td { background: color-mix(in srgb, var(--bs-body-color) 3%, transparent); }
.app-table .table-serial { width: 3.25rem; color: var(--bs-secondary-color); font-variant-numeric: tabular-nums; text-align: right; }
.app-table .table-actions { width: 1%; text-align: right; }
.app-table .avatar.avatar-sm { width: 1.85rem; height: 1.85rem; }
.app-table .avatar.avatar-sm .avatar-initial { font-size: 0.7rem; }
.table-filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.25rem; border-bottom: 1px solid var(--bs-border-color);
}
.table-filters .form-select-sm { width: auto; min-width: 9rem; padding-right: 1.9rem; }
.table-filters-search { flex: 0 1 18rem; width: auto; }
.table-filters-search .input-group-text { padding-right: 0.25rem; color: var(--bs-secondary-color); }
.table-filters-search .input-group-text .bx { font-size: 1rem; }
.table-filters-search .form-control { padding-left: 0.4rem; }
/* Row count + rows-per-page sit at the right end of the filter row */
.table-filters-end { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; margin-left: auto; }
.table-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.25rem;
  padding: 0.75rem 1.25rem; border-bottom: 1px solid var(--bs-border-color);
}
.table-count { font-size: 0.8571rem; color: var(--bs-secondary-color); }
.table-count strong { color: var(--bs-body-color); font-weight: 600; }
.table-page-size { display: flex; align-items: center; gap: 0.5rem; margin: 0; font-size: 0.8571rem; color: var(--bs-secondary-color); white-space: nowrap; }
.table-page-size .form-select-sm { min-width: 4.5rem; }
.table-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.75rem 1.25rem; border-top: 1px solid var(--bs-border-color); }
.card > .table-wrap:first-child .table-toolbar, .card > .table-toolbar:first-child, .card > .table-filters:first-child { border-top-left-radius: inherit; border-top-right-radius: inherit; }
.dropdown-item { padding: 0.4rem 1rem; }
.alert { padding: 0.65rem 1rem; }
/* Impersonation / support-access notice at the top of every page */
.support-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.support-banner > .bx { font-size: 1.35rem; }
.support-banner form { margin: 0; }
.modal-header { padding: 1rem 1.25rem; }
.modal-body { padding: 1.25rem; }
.modal-footer { padding: 0.75rem 1.25rem; }
.badge { font-size: 0.75em; }
.breadcrumb { margin-bottom: 0.75rem; font-size: 0.8571rem; }

/* Menu chrome */
/* core.css positions the collapse pin for its own 16.25rem menu; follow ours */
.menu .app-brand .layout-menu-toggle { inset-inline-start: calc(var(--bs-menu-width) - 1.05rem); }
/* Icons inside buttons size from the button, not from .icon-base */
.btn .bx { font-size: 1.15em; vertical-align: -0.2em; }
.btn-icon .bx { font-size: 1.2rem; flex: none; inline-size: 1em; block-size: 1em; }
.btn-icon.btn-sm .bx { font-size: 1rem; }
.menu-vertical .menu-header { margin: 0.75rem 0 0.25rem; }
.menu-vertical .menu-header .menu-header-text { font-size: 0.75rem; }
.menu-vertical .menu-icon { font-size: 1.15rem; }
.menu .app-brand { height: 56px; margin-top: 8px; }
.app-brand-logo svg { width: 22px; height: 30px; }
.app-brand-logo .brand-mark { display: block; height: 22px; width: auto; }
.app-brand-text { font-size: 1.3rem; letter-spacing: -0.3px; }

/* Page gutter */
.container-p-y:not([class^="pb-"]):not([class*=" pb-"]) { padding-bottom: 1.25rem !important; }
.container-p-y:not([class^="pt-"]):not([class*=" pt-"]) { padding-top: 1.25rem !important; }

/* Keep the scrollbar track reserved so fixed elements never shift when a modal
   hides the page scrollbar; and restate the navbar inset for modal-open, because
   core.css hardcodes its own 16.25rem menu width there rather than the variable. */
html { scrollbar-gutter: stable; }
@media (min-width: 1200px) {
  .layout-menu-fixed.layout-navbar-fixed:not(.layout-menu-collapsed) .modal-open .layout-content-navbar:not(.layout-without-menu) .layout-navbar {
    inset-inline-start: var(--bs-menu-width);
  }
}

/* From Sneat demo.css: fixed navbar needs the page pushed down */
.layout-navbar-fixed .layout-wrapper:not(.layout-horizontal):not(.layout-without-menu) .layout-page { padding-top: 68px !important; }
.layout-navbar-fixed .layout-wrapper:not(.layout-without-menu) .layout-page { padding-top: 60px !important; }
.content-wrapper .navbar { z-index: auto; }
.layout-navbar { height: 3.6rem; }

/* Page header row: title left, actions right */
.page-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 1rem; }
.page-header h4 { margin: 0; }

/* Toasts */
#toast-container { position: fixed; top: 1rem; right: 1rem; z-index: 1090; display: flex; flex-direction: column; gap: 0.5rem; }
/* A paper card with a coloured left edge and icon; the level colour is --toast-accent.
   Sneat's .toast.bs-toast applies --bs-toast-bg with !important, so set the variable. */
#toast-container .toast {
  min-width: 18rem; font-weight: 500; color: var(--bs-heading-color);
  --bs-toast-bg: rgb(var(--bs-paper-bg-rgb));
  border-inline-start: 4px solid var(--toast-accent, var(--bs-primary));
}
#toast-container .toast-icon { color: var(--toast-accent, var(--bs-primary)); font-size: 1.25rem; }
#toast-container .toast-success { --toast-accent: var(--bs-success); }
#toast-container .toast-danger { --toast-accent: var(--bs-danger); }
#toast-container .toast-warning { --toast-accent: var(--bs-warning); }
#toast-container .toast-info { --toast-accent: var(--bs-info); }

/* htmx request state */
.htmx-indicator { opacity: 0; transition: opacity 150ms ease-in; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
.htmx-request .btn[type="submit"] { pointer-events: none; opacity: 0.7; }

/* Tables without DataTables: sortable headers and row actions */
th a.sort-link { color: inherit; text-decoration: none; white-space: nowrap; }
th a.sort-link .bx { font-size: 0.9em; vertical-align: -0.1em; }
.row-actions { white-space: nowrap; }
.row-actions .btn { margin-left: 0.15rem; }
.empty-state { padding: 3rem 1rem; text-align: center; color: var(--bs-secondary-color); }
.empty-state .bx { font-size: 2.5rem; margin-bottom: 0.5rem; }

/* Public site */
.site-nav .nav-link { padding: 0.5rem 0.8rem; }
/* Sign in / Sign up / Get started: one centred row on desktop, full-width
   stacked buttons when the menu is collapsed. */
.site-nav-actions { align-items: center; gap: 0.5rem; }
.site-nav-actions .btn { display: inline-flex; align-items: center; }
@media (max-width: 767.98px) {
  .site-nav-actions { align-items: stretch; padding: 0.5rem 0; border-top: 1px solid var(--bs-border-color); }
  .site-nav-actions .btn { width: 100%; justify-content: center; }
}
.hero { padding: 4rem 0; }
.site-footer { padding: 2rem 0; font-size: 0.8571rem; }
/* The company logo in every footer (partials/copyright.html); light lettering on the dark theme. */
.brand-footer { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.5rem 0.75rem; }
.brand-logo { height: 22px; width: auto; }
.brand-logo-on-dark { display: none; }
[data-bs-theme="dark"] .brand-logo-on-light { display: none; }
[data-bs-theme="dark"] .brand-logo-on-dark { display: inline; }
/* Our chatbot's button floats in the bottom corner: leave room under the footer
   so it never covers the footer links. Only when the widget is on the page. */
body:has(> [data-deq-chatbot]) .site-footer,
body:has(> [data-deq-chatbot]) .content-footer { padding-bottom: 5.5rem; }

/* Chatbot portal */
.chat-preview { display: block; width: 100%; height: 560px; border: 1px solid var(--bs-border-color); border-radius: 0.5rem; background: #f4f5fa; }
.code-block { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.75rem 1rem; background: var(--bs-tertiary-bg); border-radius: 0.375rem; }
.code-block pre { flex: 1; white-space: pre-wrap; word-break: break-all; font-size: 0.8125rem; }
.cell-truncate { max-width: 32rem; }
.transcript-row { display: flex; margin-bottom: 0.75rem; }
.transcript-row.is-visitor { justify-content: flex-end; }
.transcript-bubble { max-width: 80%; padding: 0.6rem 0.85rem; border-radius: 0.75rem; background: var(--bs-tertiary-bg); }
.transcript-row.is-visitor .transcript-bubble { background: var(--bs-primary-bg-subtle); }
.plan-option { cursor: pointer; }
.plan-option:has(input:checked) { border-color: var(--bs-primary); box-shadow: 0 0 0 2px var(--bs-primary); }
.onboarding-steps { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; padding: 0; list-style: none; counter-reset: step; font-size: 0.8571rem; color: var(--bs-secondary-color); }
.onboarding-steps li { counter-increment: step; }
.onboarding-steps li::before { content: counter(step); display: inline-flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem; margin-right: 0.4rem; border-radius: 50%; background: var(--bs-tertiary-bg); font-weight: 600; }
.onboarding-steps li.active { color: var(--bs-body-color); font-weight: 600; }
.onboarding-steps li.active::before { background: var(--bs-primary); color: #fff; }
.checklist .list-group-item { display: flex; align-items: center; gap: 0.6rem; }
.stat-tile h5 { margin-bottom: 0; }

/* Dashboard KPI tiles: label, value, change, then one small figure pinned to
   the bottom so figures line up across a row. Two series colours, validated
   as a pair for both themes (AI answers = brand indigo, organic = orange). */
:root { --viz-series-1: #696cff; --viz-series-2: #eb6834; }
[data-bs-theme="dark"] { --viz-series-2: #d95926; }
.kpi .card-body { display: flex; flex-direction: column; gap: 0.25rem; padding: 1.25rem; }
.kpi-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.25rem; }
.kpi-label { font-size: 0.8125rem; font-weight: 500; line-height: 1.35; color: var(--bs-secondary-color); }
.kpi-icon { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; border-radius: 0.5rem; font-size: 1.25rem; color: var(--bs-primary); background: rgba(var(--bs-primary-rgb), 0.12); }
.kpi-value { font-size: 1.875rem; font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; color: var(--bs-heading-color); }
.kpi-unit { margin-left: 0.3rem; font-size: 0.9375rem; font-weight: 500; letter-spacing: 0; color: var(--bs-secondary-color); }
.kpi-unit.is-tight { margin-left: 0.1rem; }
.kpi-change, .kpi-note { font-size: 0.8125rem; color: var(--bs-secondary-color); }
.kpi-change.is-up { color: var(--bs-success); font-weight: 500; }
.kpi-change.is-down { color: var(--bs-danger); font-weight: 500; }
.kpi-change-period { font-weight: 400; color: var(--bs-secondary-color); }
.kpi-note { margin-top: 0.45rem; }
.kpi-figure { margin-top: auto; padding-top: 0.75rem; }
.kpi-legend { display: flex; flex-wrap: wrap; gap: 0.15rem 1rem; margin: 0; padding: 0; list-style: none; font-size: 0.8125rem; color: var(--bs-secondary-color); }
.kpi-legend strong { margin-left: 0.2rem; font-weight: 600; color: var(--bs-heading-color); }
.kpi-swatch { display: inline-block; width: 0.625rem; height: 0.625rem; margin-right: 0.4rem; border-radius: 2px; vertical-align: -0.05em; }
.kpi-swatch.is-ai, .seg-bar .is-ai { background: var(--viz-series-1); }
.kpi-swatch.is-organic, .seg-bar .is-organic { background: var(--viz-series-2); }
/* Thin segmented bar: one whole split into parts, 2px gap between them. */
.seg-bar { display: flex; gap: 2px; height: 8px; border-radius: 4px; background: var(--bs-tertiary-bg); }
.seg-bar > span { min-width: 4px; border-radius: 4px; }
.seg-bar:has(> span) { background: none; }
/* Meter: the fill on a lighter step of its own colour. */
.meter { height: 8px; overflow: hidden; border-radius: 4px; background: rgba(var(--bs-primary-rgb), 0.16); }
.meter > span { display: block; height: 100%; border-radius: 4px; background: var(--bs-primary); }
.meter > .is-some { min-width: 4px; }
.meter.is-warning { background: rgba(var(--bs-warning-rgb), 0.2); }
.meter.is-warning > span { background: var(--bs-warning); }
.meter.is-danger { background: rgba(var(--bs-danger-rgb), 0.18); }
.meter.is-danger > span { background: var(--bs-danger); }
/* Sparkline: the line stretches to the box; the latest point is an HTML dot. */
.sparkline { position: relative; height: 2.5rem; }
.sparkline svg { display: block; width: 100%; height: 100%; overflow: visible; }
.sparkline-line { fill: none; stroke: var(--bs-secondary-color); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; opacity: 0.6; }
.sparkline-hit { fill: transparent; }
.sparkline-hit:hover { fill: rgba(var(--bs-primary-rgb), 0.08); }
.sparkline-dot { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--bs-primary); box-shadow: 0 0 0 2px var(--bs-paper-bg); transform: translate(-50%, -50%); pointer-events: none; }
.progress-thin { height: 6px; }
.navbar-client { max-width: 16rem; }

/* Public site */
.hero-title { font-size: clamp(2rem, 4.5vw, 3.1rem); line-height: 1.12; letter-spacing: -0.02em; }
.hero-lead { max-width: 40rem; }
.hero-demo { max-width: 26rem; margin-left: auto; margin-right: auto; }
.hero-demo .bubble-bot, .hero-demo .bubble-user { padding: 0.6rem 0.85rem; border-radius: 0.9rem; margin-bottom: 0.6rem; max-width: 88%; font-size: 0.9rem; }
.hero-demo .bubble-bot { background: var(--bs-tertiary-bg); border-bottom-left-radius: 0.25rem; }
.hero-demo .bubble-user { background: var(--bs-primary); color: #fff; margin-left: auto; border-bottom-right-radius: 0.25rem; }
.feature-icon { display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; border-radius: 0.6rem; background: var(--bs-primary-bg-subtle); color: var(--bs-primary); font-size: 1.4rem; }
.sent-icon { display: inline-flex; align-items: center; justify-content: center; width: 4.5rem; height: 4.5rem; border-radius: 50%; background: var(--bs-success-bg-subtle); color: var(--bs-success); font-size: 2.5rem; }
.step-number { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--bs-primary); color: #fff; font-weight: 700; }
.prose { max-width: 46rem; }
.prose h2 { font-size: 1.25rem; margin-top: 2rem; }
.price-card.featured { border: 2px solid var(--bs-primary); }

/* Plans and the launch offer (pricing and Choose a plan) */
.launch-banner { padding: 1rem 1.25rem; border-radius: 0.75rem; color: #fff; background: linear-gradient(120deg, var(--bs-primary) 0%, #9055fd 100%); box-shadow: 0 0.25rem 1rem rgba(105, 108, 255, 0.3); }
.launch-banner .launch-icon { display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; border-radius: 50%; background: rgba(255, 255, 255, 0.18); font-size: 1.5rem; }
.plan-card { position: relative; }
.plan-card.featured { border: 2px solid var(--bs-primary); box-shadow: 0 0.5rem 1.5rem rgba(105, 108, 255, 0.18); }
.plan-ribbon { position: absolute; top: 0; left: 50%; transform: translate(-50%, -50%); padding: 0.2rem 0.85rem; border-radius: 50rem; font-size: 0.75rem; font-weight: 600; white-space: nowrap; color: #fff; background: var(--bs-success); }
.plan-price .amount { font-size: 2.25rem; font-weight: 700; line-height: 1.1; color: var(--bs-heading-color); }
.plan-was { min-height: 1.5rem; }
.plan-features li { display: flex; gap: 0.4rem; margin-bottom: 0.4rem; }
.plan-features i { font-size: 1.1rem; }
.plan-pay { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; text-align: left; }
.plan-pay .plan-pay-note { font-size: 0.75rem; opacity: 0.85; }
.trust-item { display: flex; gap: 0.75rem; align-items: flex-start; }
@media (prefers-reduced-motion: no-preference) {
  .plan-card, .audience-card { transition: transform 0.15s ease, box-shadow 0.15s ease; }
  .plan-card:hover, .audience-card:hover { transform: translateY(-3px); box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.12); }
}
/* Home page cards that link to a page for colleges, schools or businesses. */
.audience-card { color: inherit; text-decoration: none; }
.audience-card:hover, .audience-card:focus-visible { color: inherit; border-color: var(--bs-primary); }
.audience-card h3 { color: var(--bs-heading-color); }
.plan-compare caption { caption-side: bottom; }
.plan-compare tbody th { font-size: inherit; font-weight: 600; letter-spacing: normal; text-transform: none; }
.section { padding: 3rem 0; }
