:root {
    --brand-green: #07261e;
    --brand-green-2: #0d3b30;
    --brand-green-soft: #eaf2ef;
    --brand-purple: #5712c6;
    --brand-purple-soft: #f1eafb;
    --ink: #111915;
    --ink-soft: #34413c;
    --muted: #68746f;
    --muted-light: #8b9691;
    --canvas: #f6f8f7;
    --surface: #ffffff;
    --card: #ffffff;
    --line: #dfe7e3;
    --line-strong: #c9d5d0;
    --positive: #147354;
    --positive-soft: #e7f5ef;
    --warning: #9b6513;
    --warning-soft: #fff5e4;
    --danger: #b42318;
    --danger-soft: #fff0ef;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(7, 38, 30, 0.04);
    --shadow-md: 0 12px 32px rgba(7, 38, 30, 0.07);
    --sidebar-width: 264px;
    --topbar-height: 72px;
    --accent: var(--brand-purple);
    --accent-soft: var(--brand-purple-soft);
    --success: var(--positive);
    --success-soft: var(--positive-soft);
    --shadow: var(--shadow-sm);
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: light;
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    margin: 0;
    color: var(--ink);
    background: var(--canvas);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

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

button,
a,
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent;
}

a,
button,
input,
select,
textarea {
    transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease,
        box-shadow 160ms ease, transform 160ms ease, opacity 160ms ease;
}

:focus-visible {
    outline: 3px solid rgba(87, 18, 198, 0.28) !important;
    outline-offset: 3px;
}

::selection {
    color: #fff;
    background: var(--brand-purple);
}

[hidden] {
    display: none !important;
}

/* Shared authenticated app shell */
.app-page {
    background: var(--canvas);
}

.app-page .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 300;
    display: flex;
    width: var(--sidebar-width);
    height: 100dvh;
    padding: 24px 18px;
    flex-direction: column;
    background: var(--brand-green);
    box-shadow: none;
}

.app-page .brand {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 40px;
    margin: 0 6px 31px;
    color: #fff;
}

.app-page .brand h1,
.app-page .sidebar > h1 {
    margin: 0;
    color: #fff;
    font-size: 17px;
    font-weight: 750;
    letter-spacing: -0.025em;
}

.app-page .sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.app-page .sidebar nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 10px 13px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 560;
    text-decoration: none;
}

.app-page .sidebar nav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.app-page .sidebar nav a.active,
.app-page .sidebar nav a[aria-current="page"] {
    border-color: rgba(255, 255, 255, 0.72);
    color: var(--brand-green);
    background: #fff;
    font-weight: 750;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.13);
}

.app-page .sidebar a:focus-visible,
.auth-brand-panel a:focus-visible {
    outline-color: #fff !important;
}

.app-page .nav-icon {
    display: grid;
    flex: 0 0 20px;
    width: 20px;
    place-items: center;
    color: inherit;
    font-size: 16px;
    font-weight: 800;
}

.app-page .sidebar-note {
    position: static;
    right: auto;
    bottom: auto;
    left: auto;
    margin-top: auto;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    color: rgba(255, 255, 255, 0.62);
    background: rgba(255, 255, 255, 0.055);
    font-size: 12px;
    line-height: 1.5;
}

.app-page .sidebar-note strong {
    display: block;
    margin-bottom: 4px;
    color: #fff;
    font-size: 12px;
}

.app-page .sidebar-settings-nav {
    width: 100%;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.app-page .sidebar-settings-nav a {
    width: 100%;
}

.app-page .sidebar .sidebar-legal-nav {
    display: flex;
    margin-top: 10px;
    flex-direction: row;
    justify-content: center;
    gap: 14px;
}

.app-page .sidebar .sidebar-legal-nav a {
    min-height: 0;
    padding: 2px;
    border: 0;
    border-radius: 0;
    color: rgba(255, 255, 255, 0.58);
    font-size: 11px;
    font-weight: 600;
}

.app-page .sidebar .sidebar-legal-nav a:hover {
    color: #fff;
    background: transparent;
    text-decoration: underline;
    transform: none;
}

.app-page .sidebar > nav:first-of-type {
    margin-bottom: auto;
}

.app-page .sidebar-note {
    margin-top: 0;
}

html[data-layout-density="compact"] {
    --topbar-height: 64px;
}

html[data-layout-density="compact"] .app-page .sidebar {
    padding-top: 18px;
    padding-bottom: 18px;
}

html[data-layout-density="compact"] .app-page .brand {
    margin-bottom: 20px;
}

html[data-layout-density="compact"] .app-page .sidebar nav {
    gap: 3px;
}

html[data-layout-density="compact"] .app-page .sidebar nav a {
    min-height: 38px;
    padding-top: 7px;
    padding-bottom: 7px;
}

html[data-layout-density="compact"] .app-page .main-content {
    padding-top: 88px;
}

html[data-layout-density="compact"] .app-page .card,
html[data-layout-density="compact"] .app-page .panel {
    padding: 19px;
}

html[data-contrast="enhanced"] {
    --muted: #4b5752;
    --muted-light: #63706a;
    --line: #c9d5d0;
    --line-strong: #a8bab2;
}

html[data-contrast="enhanced"] .app-page .sidebar nav a {
    color: rgba(255, 255, 255, 0.86);
}

html.preferences-reduce-motion {
    scroll-behavior: auto;
}

html.preferences-reduce-motion *,
html.preferences-reduce-motion *::before,
html.preferences-reduce-motion *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
}

.app-page .topbar {
    position: fixed;
    inset: 0 0 auto var(--sidebar-width);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--topbar-height);
    padding: 0 32px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
}

.app-page .topbar-start,
.app-page .topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-page .topbar h2 {
    margin: 0;
    color: var(--ink);
    font-size: 18px;
    font-weight: 750;
    letter-spacing: -0.02em;
}

.app-page #user-email {
    max-width: 260px;
    overflow: hidden;
    color: var(--muted);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-page .topbar button,
.app-page #logout-button {
    min-height: 38px;
    padding: 8px 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--ink-soft);
    background: #fff;
    font-weight: 650;
    cursor: pointer;
}

.app-page .topbar button:hover,
.app-page #logout-button:hover {
    border-color: var(--line-strong);
    color: var(--brand-green);
    background: var(--brand-green-soft);
    transform: translateY(-1px);
}

.sidebar-toggle {
    display: grid !important;
    width: 38px;
    padding: 0 !important;
    place-items: center;
    color: var(--brand-green) !important;
}

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

.sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 250;
    visibility: hidden;
    background: rgba(3, 20, 15, 0.46);
    opacity: 0;
    transition: opacity 180ms ease, visibility 180ms ease;
}

.app-page .main-content {
    min-height: 100dvh;
    margin-left: var(--sidebar-width);
    padding: 104px 32px 48px;
    background: var(--canvas);
}

.app-page .dashboard-container,
.app-page .record-container,
.app-page .dashboard,
.app-page .insights-container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
}

.app-page .page-heading,
.app-page .welcome-row,
.app-page .intro,
.app-page .insights-intro {
    margin-bottom: 26px;
}

.app-page .page-heading h3,
.app-page .welcome-row h3,
.app-page .intro h3,
.app-page .insights-intro h3 {
    margin-bottom: 8px;
    color: var(--ink);
    font-size: clamp(27px, 3vw, 36px);
    line-height: 1.1;
    letter-spacing: -0.045em;
}

.app-page .page-heading p,
.app-page .welcome-row p,
.app-page .intro p,
.app-page .insights-intro p,
.app-page .muted-text {
    color: var(--muted);
    line-height: 1.6;
}

.app-page .eyebrow {
    margin-bottom: 7px;
    color: var(--brand-purple);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

/* Shared cards, forms, buttons, tables and states */
.app-page .card,
.app-page .panel,
.app-page .filter-bar {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.app-page .card,
.app-page .panel {
    padding: 24px;
}

.app-page .card:hover,
.app-page .panel:hover {
    border-color: var(--line-strong);
    box-shadow: 0 14px 34px rgba(7, 38, 30, 0.06);
}

.app-page .card-header,
.app-page .panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.app-page .card h4,
.app-page .card-title,
.app-page .panel h4 {
    color: var(--ink);
    font-size: 17px;
    font-weight: 750;
    letter-spacing: -0.02em;
}

.app-page .card-subtitle,
.app-page .panel-header p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.app-page input,
.app-page select,
.app-page textarea,
.auth-page input {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    color: var(--ink);
    background: #fff;
    outline: none;
}

.app-page input:hover,
.app-page select:hover,
.app-page textarea:hover,
.auth-page input:hover {
    border-color: #9eb0a8;
}

.app-page input:focus,
.app-page select:focus,
.app-page textarea:focus,
.auth-page input:focus {
    border-color: var(--brand-purple);
    box-shadow: 0 0 0 3px rgba(87, 18, 198, 0.11);
}

.app-page label,
.auth-page label {
    display: block;
    margin-bottom: 7px;
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 700;
}

.app-page .primary-button,
.app-page .secondary-button,
.app-page .danger-button,
.app-page .text-button,
.app-page .primary-link {
    min-height: 42px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.app-page .primary-button,
.app-page .primary-link {
    color: #fff;
    background: var(--brand-green);
}

.app-page .primary-button:hover,
.app-page .primary-link:hover {
    color: #fff;
    background: var(--brand-green-2);
    box-shadow: 0 8px 20px rgba(7, 38, 30, 0.16);
    transform: translateY(-1px);
}

.app-page .secondary-button {
    border-color: var(--line);
    color: var(--brand-purple);
    background: var(--brand-purple-soft);
}

.app-page .secondary-button:hover {
    border-color: rgba(87, 18, 198, 0.25);
    background: #e8dcf8;
    transform: translateY(-1px);
}

.app-page .danger-button {
    color: var(--danger);
    background: var(--danger-soft);
}

.app-page .text-button,
.app-page .text-link {
    color: var(--brand-purple);
    background: transparent;
    font-weight: 700;
}

.app-page button:disabled,
.app-page select:disabled,
.app-page input:disabled {
    cursor: not-allowed;
    opacity: 0.52;
}

.app-page .summary-grid {
    gap: 16px;
}

.app-page .summary-card {
    min-height: 126px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    color: var(--ink);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.app-page .summary-card.featured,
.page-record .summary-card:first-child {
    border-color: var(--brand-green);
    color: #fff;
    background: var(--brand-green);
}

.page-record .summary-card:nth-child(2),
.page-record .summary-card:nth-child(3) {
    color: var(--ink);
    background: #fff;
}

.app-page .summary-label {
    display: block;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.app-page .summary-card.featured .summary-label,
.page-record .summary-card:first-child .summary-label {
    color: rgba(255, 255, 255, 0.7);
}

.app-page .summary-value {
    font-size: 30px;
    font-weight: 820;
    letter-spacing: -0.04em;
}

.app-page .summary-detail {
    color: var(--muted);
}

.app-page .summary-card.featured .summary-detail {
    color: rgba(255, 255, 255, 0.68);
}

.app-page .notice,
.app-page .status-message {
    border: 1px solid rgba(155, 101, 19, 0.16);
    border-radius: 10px;
    background: var(--warning-soft);
    color: #755018;
}

.app-page .notice.success {
    border-color: rgba(20, 115, 84, 0.18);
    background: var(--positive-soft);
    color: #115c44;
}

.app-page .notice.error {
    border-color: rgba(180, 35, 24, 0.18);
    background: var(--danger-soft);
    color: #8e1b14;
}

.app-page .table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.app-page table {
    width: 100%;
    border-collapse: collapse;
}

.app-page th,
.app-page td {
    padding: 14px 15px;
    border-bottom: 1px solid var(--line);
}

.app-page th {
    color: var(--muted);
    background: #f8faf9;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.app-page td {
    color: var(--ink-soft);
    font-size: 14px;
}

.app-page tbody tr:hover {
    background: #f7faf8;
}

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

.app-page .empty-state {
    border-color: var(--line-strong);
    color: var(--muted);
}

.app-page .empty-icon,
.app-page .fact-icon {
    color: var(--brand-purple);
    background: var(--brand-purple-soft);
}

/* Dashboard */
.page-dashboard .date-pill,
.page-statistics .data-count,
.insight-status-pill {
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: #fff;
    font-size: 12px;
    font-weight: 650;
}

.page-dashboard .summary-card.featured::after {
    background: var(--brand-purple);
    opacity: 0.32;
}

.page-dashboard .subject-progress span {
    background: linear-gradient(90deg, var(--brand-green), var(--brand-purple));
}

.page-dashboard .result-grade {
    color: var(--positive);
    background: var(--positive-soft);
}

.page-dashboard .ai-panel {
    border: 0;
    color: #fff;
    background: linear-gradient(145deg, var(--brand-green) 0%, #123c32 58%, #40217c 130%);
}

.page-dashboard .ai-panel h4 {
    color: #fff;
}

.page-dashboard .ai-panel p {
    color: rgba(255, 255, 255, 0.72);
}

.page-dashboard .ai-spark,
.page-dashboard .pulse-dot {
    color: #fff;
    background: var(--brand-purple);
}

/* Record */
.page-record .type-manager {
    border-color: var(--line);
    background: #f8faf9;
}

.page-record .field-help,
.page-record .type-manager-note,
.page-record .type-toolbar p {
    color: var(--muted);
}

/* Import */
.page-import .import-container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
}

.page-import .drop-zone {
    border-color: var(--line-strong);
    background: #fafcfb;
}

.page-import .drop-zone:hover,
.page-import .drop-zone.is-dragging {
    border-color: var(--brand-purple);
    background: var(--brand-purple-soft);
}

.page-import .upload-icon {
    color: var(--brand-purple);
    background: var(--brand-purple-soft);
}

.page-import .file-label {
    border-color: var(--brand-green);
    color: #fff;
    background: var(--brand-green);
}

.page-import .file-label:hover {
    border-color: var(--brand-green-2);
    background: var(--brand-green-2);
    box-shadow: 0 8px 20px rgba(7, 38, 30, 0.16);
    transform: translateY(-1px);
}

.page-import .requirements li {
    border-color: var(--line);
    color: var(--ink-soft);
}

.page-import .pill {
    background: var(--brand-green-soft);
}

/* Statistics and charts */
.page-statistics .filter-bar {
    padding: 17px;
}

.page-statistics .overall-chip {
    background: var(--brand-green);
}

.page-statistics .overall-label,
.page-statistics .change-line {
    color: rgba(255, 255, 255, 0.68);
}

.page-statistics .chart-line,
.page-statistics .chart-point {
    stroke: var(--brand-purple);
}

.page-statistics .trend-line {
    stroke: var(--brand-green);
}

.page-statistics .legend-dot,
.page-statistics .bar-fill {
    background: var(--brand-purple);
}

.page-statistics .trend-status {
    background: var(--brand-purple-soft);
}

.page-statistics .trend-status span,
.page-statistics .trend-icon {
    color: var(--brand-purple);
}

.page-statistics .consistency-level {
    background: var(--positive-soft);
}

.page-statistics .result-card::after {
    background: var(--positive);
}

/* AI prompt studio */
.page-ai-insights .insights-intro {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.page-ai-insights .insights-intro > div {
    max-width: 720px;
}

.page-ai-insights .insight-status-pill {
    flex: 0 0 auto;
    color: var(--brand-green);
    background: var(--brand-green-soft);
    font-weight: 750;
}

.insights-notice {
    position: fixed;
    z-index: 500;
    right: 24px;
    bottom: 24px;
    max-width: min(420px, calc(100vw - 32px));
    padding: 13px 16px;
    border: 1px solid #9fd2bd;
    border-radius: 11px;
    color: #0b553d;
    background: #edf9f3;
    box-shadow: 0 16px 40px rgba(7, 38, 30, 0.16);
    font-size: 13px;
    font-weight: 680;
}

.insights-notice.is-error {
    border-color: #efb4ae;
    color: var(--danger);
    background: var(--danger-soft);
}

.insights-loading,
.insights-empty {
    min-height: 330px;
}

.insights-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    color: var(--ink-soft);
}

.insights-loading strong {
    display: block;
    margin-bottom: 4px;
}

.insights-loading p {
    color: var(--muted);
    font-size: 13px;
}

.loading-orb {
    display: block;
    width: 38px;
    height: 38px;
    border: 4px solid var(--brand-purple-soft);
    border-top-color: var(--brand-purple);
    border-radius: 50%;
    animation: insight-spin 800ms linear infinite;
}

@keyframes insight-spin {
    to { transform: rotate(360deg); }
}

.insights-empty {
    display: flex;
    padding: 50px 24px !important;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
}

.empty-insight-icon {
    display: grid;
    width: 52px;
    height: 52px;
    margin-bottom: 18px;
    place-items: center;
    border-radius: 15px;
    color: var(--brand-purple);
    background: var(--brand-purple-soft);
    font-size: 22px;
}

.insights-empty h4 {
    max-width: 510px;
    margin: 4px 0 10px;
    font-size: clamp(22px, 3vw, 29px) !important;
}

.insights-empty > p:not(.eyebrow) {
    max-width: 520px;
    margin-bottom: 22px;
    color: var(--muted);
    line-height: 1.65;
}

.insight-spotlight {
    position: relative;
    display: grid;
    min-height: 250px;
    padding: clamp(28px, 4vw, 42px);
    overflow: hidden;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.48fr);
    align-items: center;
    gap: 40px;
    border-radius: 20px;
    color: #fff;
    background:
        radial-gradient(circle at 87% 18%, rgba(160, 112, 237, 0.28), transparent 32%),
        linear-gradient(135deg, #08271f 0%, #0b382d 58%, #30205d 125%);
    box-shadow: 0 20px 46px rgba(7, 38, 30, 0.15);
}

.insight-spotlight::after {
    position: absolute;
    right: -85px;
    bottom: -175px;
    width: 340px;
    height: 340px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 50%;
    content: "";
}

.spotlight-copy,
.priority-meter-card {
    position: relative;
    z-index: 1;
}

.insights-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 18px;
    padding: 7px 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    color: #eee5ff;
    background: rgba(255, 255, 255, 0.075);
    font-size: 10px;
    font-weight: 820;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.spotlight-copy h4 {
    max-width: 760px;
    margin-bottom: 12px;
    color: #fff;
    font-size: clamp(26px, 4vw, 40px);
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.spotlight-copy > p {
    max-width: 720px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 14px;
    line-height: 1.65;
}

.spotlight-signals {
    display: flex;
    margin-top: 22px;
    flex-wrap: wrap;
    gap: 8px;
}

.spotlight-signals span {
    padding: 7px 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.07);
    font-size: 11px;
    font-weight: 680;
}

.priority-meter-card {
    display: flex;
    padding: 18px;
    align-items: center;
    gap: 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.09);
    backdrop-filter: blur(14px);
}

.priority-meter {
    position: relative;
    display: flex;
    flex: 0 0 86px;
    width: 86px;
    height: 86px;
    align-items: baseline;
    justify-content: center;
    padding-top: 28px;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, #153b32 56%, transparent 58%),
        conic-gradient(#b891f2 calc(var(--priority) * 1%), rgba(255, 255, 255, 0.12) 0);
}

.priority-meter span {
    color: #fff;
    font-size: 23px;
    font-weight: 820;
}

.priority-meter small {
    color: rgba(255, 255, 255, 0.55);
    font-size: 10px;
}

.priority-meter-card strong {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
}

.priority-meter-card p {
    color: rgba(255, 255, 255, 0.62);
    font-size: 11px;
    line-height: 1.5;
}

.prompt-studio-layout {
    display: grid;
    margin-top: 20px;
    grid-template-columns: minmax(0, 1fr) 318px;
    align-items: start;
    gap: 20px;
}

.prompt-builder {
    padding: clamp(22px, 3vw, 30px) !important;
}

.section-step {
    margin: 0 0 7px;
    color: var(--brand-purple);
    font-size: 10px;
    font-weight: 820;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.prompt-card-header h4,
.prompt-preview-header h4,
.feedback-context-card h4,
.service-card h4,
.method-card h4 {
    margin: 0 0 5px;
    font-size: 19px !important;
}

.data-count-chip,
.privacy-chip,
.method-version {
    display: inline-flex;
    flex: 0 0 auto;
    padding: 7px 10px;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    color: var(--muted);
    background: var(--canvas);
    font-size: 10px;
    font-weight: 750;
}

.prompt-template-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.prompt-template {
    position: relative;
    display: grid;
    min-height: 88px;
    padding: 15px 40px 15px 14px;
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--ink);
    background: #fff;
    text-align: left;
    cursor: pointer;
}

.prompt-template:hover {
    border-color: #bda7df;
    background: #fcfaff;
    transform: translateY(-1px);
}

.prompt-template.is-selected {
    border-color: var(--brand-purple);
    background: #fbf9ff;
    box-shadow: 0 0 0 3px rgba(87, 18, 198, 0.07);
}

.template-icon {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 10px;
    color: var(--brand-green);
    background: var(--brand-green-soft);
}

.is-selected .template-icon {
    color: var(--brand-purple);
    background: var(--brand-purple-soft);
}

.template-icon svg,
.prompt-actions svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.prompt-template strong,
.prompt-template small {
    display: block;
}

.prompt-template strong {
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 760;
}

.prompt-template small {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.42;
}

.template-check {
    position: absolute;
    top: 12px;
    right: 12px;
    display: grid;
    width: 20px;
    height: 20px;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--brand-purple);
    font-size: 11px;
    font-weight: 850;
    opacity: 0;
    transform: scale(0.8);
}

.prompt-template.is-selected .template-check {
    opacity: 1;
    transform: scale(1);
}

.prompt-controls {
    display: grid;
    margin: 18px 0 28px;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.prompt-controls label > span {
    display: block;
    margin: 0 0 7px;
    color: var(--ink-soft);
    font-size: 11px;
    font-weight: 740;
}

.prompt-controls select,
.service-select-copy select {
    width: 100%;
    border: 0;
    color: var(--ink);
    background: transparent;
    font-size: 13px;
    font-weight: 670;
    outline: 0;
}

.prompt-controls label {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--canvas);
}

.prompt-controls label:focus-within {
    border-color: var(--brand-purple);
    box-shadow: 0 0 0 3px rgba(87, 18, 198, 0.08);
}

.prompt-preview-header {
    display: flex;
    margin-bottom: 12px;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.privacy-chip {
    color: #176849;
    background: var(--positive-soft);
}

.privacy-chip span {
    font-size: 7px;
}

.prompt-preview-shell {
    position: relative;
}

#generated-prompt {
    display: block;
    width: 100%;
    min-height: 330px;
    padding: 18px 18px 38px;
    resize: vertical;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: #26342e;
    background: #f8faf9;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 11px;
    line-height: 1.62;
}

#generated-prompt:focus {
    border-color: #bda7df;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(87, 18, 198, 0.08);
}

.prompt-length {
    position: absolute;
    right: 12px;
    bottom: 10px;
    padding: 4px 6px;
    border-radius: 5px;
    color: var(--muted-light);
    background: rgba(248, 250, 249, 0.9);
    font-size: 9px;
}

.prompt-actions {
    display: flex;
    margin-top: 14px;
    justify-content: flex-end;
    gap: 10px;
}

.prompt-actions .button {
    gap: 8px;
}

.open-ai-button {
    min-width: 176px;
}

.prompt-sidebar {
    display: grid;
    gap: 16px;
}

.feedback-context-card,
.service-card,
.method-card {
    padding: 21px !important;
}

.feedback-context-copy {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
}

.feedback-context-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-top: 16px;
}

.feedback-context-stats span {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--canvas);
}

.feedback-context-stats strong,
.feedback-context-stats small {
    display: block;
}

.feedback-context-stats strong {
    margin-bottom: 4px;
    color: var(--brand-green);
    font-size: 22px;
}

.feedback-context-stats small {
    color: var(--muted);
    font-size: 10px;
    line-height: 1.35;
}

.service-select-wrap {
    display: flex;
    margin-top: 17px;
    padding: 10px;
    align-items: center;
    gap: 11px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--canvas);
}

.service-select-wrap:focus-within {
    border-color: var(--brand-purple);
    box-shadow: 0 0 0 3px rgba(87, 18, 198, 0.08);
}

.service-monogram {
    display: grid;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(145deg, var(--brand-green), #145946);
    font-size: 13px;
    font-weight: 850;
}

.service-select-copy {
    min-width: 0;
    flex: 1;
}

.service-select-copy > span {
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
}

.service-help,
.method-note {
    margin-top: 12px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.55;
}

.method-heading {
    display: flex;
    margin-bottom: 18px;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.method-version {
    padding: 5px 7px;
    color: var(--brand-purple);
    background: var(--brand-purple-soft);
}

.method-factor {
    margin-top: 13px;
}

.method-factor > span {
    display: flex;
    margin-bottom: 6px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--ink-soft);
    font-size: 10px;
}

.method-factor strong {
    font-weight: 690;
}

.method-factor small {
    color: var(--muted-light);
}

.method-factor > div {
    height: 5px;
    overflow: hidden;
    border-radius: 99px;
    background: #edf1ef;
}

.method-factor i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand-green), var(--brand-purple));
}

.method-note {
    padding-top: 13px;
    border-top: 1px solid var(--line);
}

.recommendation-boundary {
    display: flex;
    padding: 17px;
    gap: 12px;
    border: 1px solid #d7c6f1;
    border-radius: var(--radius-lg);
    color: #3f1d79;
    background: #f8f4ff;
}

.boundary-icon {
    display: grid;
    flex: 0 0 31px;
    width: 31px;
    height: 31px;
    place-items: center;
    border-radius: 9px;
    color: #fff;
    background: var(--brand-purple);
    font-weight: 800;
}

.recommendation-boundary strong {
    display: block;
    margin-bottom: 5px;
    font-size: 11px;
}

.recommendation-boundary p {
    color: #6f55a0;
    font-size: 10px;
    line-height: 1.55;
}

@media (max-width: 1120px) {
    .prompt-studio-layout {
        grid-template-columns: 1fr;
    }

    .prompt-sidebar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .recommendation-boundary {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    .insight-spotlight {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .priority-meter-card {
        max-width: 420px;
    }

    .prompt-sidebar {
        grid-template-columns: 1fr;
    }

    .recommendation-boundary {
        grid-column: auto;
    }
}

@media (max-width: 620px) {
    .prompt-template-grid,
    .prompt-controls {
        grid-template-columns: 1fr;
    }

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

    .prompt-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .prompt-actions .button {
        width: 100%;
    }

    #generated-prompt {
        min-height: 400px;
    }
}

/* Public marketing page */
.marketing-page,
.auth-page {
    background: #fff;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid rgba(223, 231, 227, 0.8);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
}

.site-nav {
    display: flex;
    width: min(1180px, calc(100% - 40px));
    min-height: 72px;
    margin: 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.public-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--brand-green);
    font-weight: 800;
    text-decoration: none;
    letter-spacing: -0.02em;
}

.site-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.site-links a {
    color: var(--muted);
    font-size: 14px;
    font-weight: 650;
    text-decoration: none;
}

.site-links a:hover {
    color: var(--brand-green);
}

.site-links .nav-signup,
.site-links .nav-signup:hover {
    color: #fff;
}

.button,
.hero-actions button,
.nav-login,
.nav-signup,
.auth-submit {
    display: inline-flex;
    min-height: 44px;
    padding: 10px 17px;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 9px;
    font-weight: 750;
    text-decoration: none;
    cursor: pointer;
}

.button-primary,
.hero-actions #get-started,
.nav-signup,
.auth-submit {
    color: #fff;
    background: var(--brand-green);
    box-shadow: 0 8px 22px rgba(7, 38, 30, 0.15);
}

.button-primary:hover,
.hero-actions #get-started:hover,
.nav-signup:hover,
.auth-submit:hover {
    color: #fff;
    background: var(--brand-green-2);
    box-shadow: 0 11px 27px rgba(7, 38, 30, 0.2);
    transform: translateY(-1px);
}

.button-secondary,
.hero-actions #login,
.nav-login {
    border-color: var(--line);
    color: var(--brand-green);
    background: #fff;
}

.button-secondary:hover,
.hero-actions #login:hover,
.nav-login:hover {
    border-color: var(--line-strong);
    background: var(--brand-green-soft);
    transform: translateY(-1px);
}

.hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #fff 0%, #f4f8f6 100%);
}

.hero::after {
    position: absolute;
    top: 5%;
    right: -8%;
    width: 410px;
    height: 410px;
    content: "";
    border-radius: 50%;
    background: radial-gradient(circle, rgba(87, 18, 198, 0.1), transparent 68%);
    pointer-events: none;
}

.hero-inner {
    position: relative;
    z-index: 1;
    display: grid;
    width: min(1180px, calc(100% - 40px));
    min-height: 690px;
    margin: 0 auto;
    padding: 72px 0 82px;
    grid-template-columns: minmax(0, 0.95fr) minmax(420px, 1.05fr);
    align-items: center;
    gap: 70px;
}

.free-banner {
    display: inline-flex;
    margin: 0 0 22px;
    padding: 10px 14px;
    align-items: baseline;
    gap: 5px;
    border: 1px solid rgba(87, 18, 198, 0.2);
    border-radius: 999px;
    color: var(--brand-purple);
    background: rgba(87, 18, 198, 0.08);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.free-banner span {
    color: var(--brand-green);
    font-size: 17px;
    font-weight: 900;
}

.hero-eyebrow,
.section-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 18px;
    color: var(--brand-purple);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hero-eyebrow::before,
.section-eyebrow::before {
    width: 7px;
    height: 7px;
    content: "";
    border-radius: 50%;
    background: var(--brand-purple);
}

.hero h1 {
    max-width: 680px;
    margin: 0 0 22px;
    color: var(--brand-green);
    font-size: clamp(46px, 6vw, 76px);
    line-height: 0.98;
    letter-spacing: -0.065em;
}

.hero-lead {
    max-width: 610px;
    margin: 0 0 30px;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.65;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 11px;
}

.hero-note {
    display: flex;
    margin-top: 21px;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 12px;
}

.hero-note::before {
    width: 17px;
    height: 17px;
    content: "✓";
    border-radius: 50%;
    color: var(--positive);
    background: var(--positive-soft);
    font-size: 11px;
    font-weight: 900;
    text-align: center;
    line-height: 17px;
}

.product-preview {
    position: relative;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 28px 80px rgba(7, 38, 30, 0.13);
}

.preview-window {
    display: grid;
    min-height: 430px;
    overflow: hidden;
    grid-template-columns: 132px 1fr;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--canvas);
}

.preview-sidebar {
    padding: 20px 13px;
    background: var(--brand-green);
}

.preview-brand {
    display: block;
    margin: 3px 2px 31px;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.preview-nav-item {
    height: 28px;
    margin-bottom: 8px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.08);
}

.preview-nav-item.active {
    background: #fff;
}

.preview-main {
    padding: 22px;
}

.preview-topline {
    width: 44%;
    height: 12px;
    margin-bottom: 19px;
    border-radius: 99px;
    background: #ccd7d2;
}

.preview-metrics {
    display: grid;
    margin-bottom: 15px;
    grid-template-columns: repeat(3, 1fr);
    gap: 9px;
}

.preview-metric {
    min-height: 83px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}

.preview-metric:first-child {
    border-color: var(--brand-green);
    background: var(--brand-green);
}

.preview-metric i,
.preview-metric strong {
    display: block;
    border-radius: 99px;
    background: #d7e0dc;
}

.preview-metric i {
    width: 65%;
    height: 7px;
    margin-bottom: 13px;
}

.preview-metric strong {
    width: 40%;
    height: 16px;
}

.preview-metric:first-child i,
.preview-metric:first-child strong {
    background: rgba(255, 255, 255, 0.72);
}

.preview-chart-card {
    min-height: 245px;
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
}

.preview-chart-title {
    width: 38%;
    height: 9px;
    margin-bottom: 28px;
    border-radius: 99px;
    background: #ccd7d2;
}

.preview-chart {
    display: flex;
    height: 154px;
    padding: 10px 5px 0;
    align-items: flex-end;
    justify-content: space-around;
    gap: 8px;
    border-bottom: 1px solid var(--line);
}

.preview-chart span {
    width: 11%;
    border-radius: 6px 6px 2px 2px;
    background: var(--brand-green);
}

.preview-chart span:nth-child(2n) {
    background: var(--brand-purple);
}

.trust-strip {
    border-block: 1px solid var(--line);
    background: #fff;
}

.trust-inner {
    display: grid;
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 24px 0;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.trust-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 700;
}

.trust-icon {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 8px;
    color: var(--brand-purple);
    background: var(--brand-purple-soft);
}

.marketing-section {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 96px 0;
}

.section-heading {
    max-width: 700px;
    margin-bottom: 42px;
}

.section-heading h2 {
    margin: 0 0 14px;
    color: var(--brand-green);
    font-size: clamp(34px, 5vw, 52px);
    line-height: 1.05;
    letter-spacing: -0.05em;
}

.section-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.65;
}

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

.feature-card {
    min-height: 240px;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.feature-card:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.feature-icon {
    display: grid;
    width: 42px;
    height: 42px;
    margin-bottom: 34px;
    place-items: center;
    border-radius: 11px;
    color: var(--brand-purple);
    background: var(--brand-purple-soft);
    font-weight: 900;
}

.feature-card h3 {
    margin: 0 0 9px;
    color: var(--ink);
    font-size: 18px;
    letter-spacing: -0.025em;
}

.feature-card p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.65;
}

.cta-panel {
    position: relative;
    display: flex;
    overflow: hidden;
    padding: clamp(32px, 6vw, 62px);
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    border-radius: 22px;
    color: #fff;
    background: var(--brand-green);
}

.cta-panel::after {
    position: absolute;
    top: -80px;
    right: -20px;
    width: 260px;
    height: 260px;
    content: "";
    border-radius: 50%;
    background: rgba(87, 18, 198, 0.34);
}

.cta-copy,
.cta-panel .button {
    position: relative;
    z-index: 1;
}

.cta-panel h2 {
    max-width: 650px;
    margin: 0 0 10px;
    font-size: clamp(30px, 5vw, 46px);
    line-height: 1.04;
    letter-spacing: -0.05em;
}

.cta-panel p {
    margin: 0;
    color: rgba(255, 255, 255, 0.68);
}

.cta-panel .button {
    flex: 0 0 auto;
    color: var(--brand-green);
    background: #fff;
}

.site-footer {
    display: flex;
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 28px 0 36px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
}

.site-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

.site-footer a,
.auth-legal a,
.onboarding-privacy a {
    color: var(--brand-purple);
    font-weight: 700;
    text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible,
.auth-legal a:hover,
.auth-legal a:focus-visible,
.onboarding-privacy a:hover,
.onboarding-privacy a:focus-visible {
    text-decoration: underline;
}

/* Legal documents */
.legal-page {
    background: var(--canvas);
}

.legal-main {
    width: min(900px, calc(100% - 40px));
    margin: 0 auto;
    padding: clamp(54px, 8vw, 92px) 0 72px;
}

.legal-document {
    padding: clamp(28px, 6vw, 64px);
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fff;
    box-shadow: var(--shadow-md);
}

.legal-heading {
    padding-bottom: 30px;
    border-bottom: 1px solid var(--line);
}

.legal-heading h1 {
    margin: 0 0 12px;
    color: var(--brand-green);
    font-size: clamp(40px, 7vw, 64px);
    line-height: 1;
    letter-spacing: -0.055em;
}

.legal-heading > p:last-child,
.legal-document section p,
.legal-document li {
    color: var(--ink-soft);
    font-size: 15px;
    line-height: 1.75;
}

.legal-updated {
    margin: 0 0 25px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.legal-summary {
    margin: 32px 0 40px;
    padding: 24px 26px;
    border: 1px solid #d8cbed;
    border-radius: 14px;
    background: var(--brand-purple-soft);
}

.legal-summary h2 {
    margin-top: 0;
}

.legal-summary ul,
.legal-document section ul {
    padding-left: 21px;
}

.legal-summary li + li,
.legal-document section li + li {
    margin-top: 7px;
}

.legal-document section {
    margin-top: 38px;
    scroll-margin-top: 100px;
}

.legal-document h2 {
    margin: 0 0 13px;
    color: var(--brand-green);
    font-size: 21px;
    letter-spacing: -0.025em;
}

.legal-document p {
    margin: 0 0 14px;
}

.legal-document a {
    color: var(--brand-purple);
    font-weight: 700;
}

.legal-footer {
    width: min(900px, calc(100% - 40px));
}

/* Authentication */
.auth-shell {
    display: grid;
    min-height: 100dvh;
    grid-template-columns: minmax(360px, 0.85fr) minmax(520px, 1.15fr);
}

.auth-brand-panel {
    position: relative;
    display: flex;
    overflow: hidden;
    padding: clamp(32px, 5vw, 70px);
    flex-direction: column;
    color: #fff;
    background: linear-gradient(145deg, var(--brand-green), #0c3a30 64%, #331667 150%);
}

.auth-brand-panel::before,
.auth-brand-panel::after {
    position: absolute;
    content: "";
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.055);
}

.auth-brand-panel::before {
    right: -110px;
    bottom: 10%;
    width: 330px;
    height: 330px;
}

.auth-brand-panel::after {
    right: 28%;
    bottom: -170px;
    width: 340px;
    height: 340px;
}

.auth-brand-panel .public-brand {
    position: relative;
    z-index: 1;
    color: #fff;
}

.auth-story {
    position: relative;
    z-index: 1;
    max-width: 570px;
    margin: auto 0;
}

.auth-story .hero-eyebrow {
    color: #cfb7f1;
}

.auth-story .hero-eyebrow::before {
    background: #cfb7f1;
}

.auth-story h2 {
    margin: 0 0 18px;
    font-size: clamp(40px, 6vw, 64px);
    line-height: 0.99;
    letter-spacing: -0.06em;
}

.auth-story > p {
    max-width: 530px;
    margin: 0;
    color: rgba(255, 255, 255, 0.68);
    font-size: 16px;
    line-height: 1.65;
}

.auth-points {
    display: grid;
    margin-top: 35px;
    gap: 12px;
}

.auth-point {
    display: flex;
    align-items: center;
    gap: 11px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
}

.auth-point span {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 7px;
    color: #fff;
    background: rgba(255, 255, 255, 0.11);
    font-size: 11px;
    font-weight: 900;
}

.auth-panel {
    display: grid;
    min-height: 100%;
    padding: 42px clamp(24px, 7vw, 100px);
    place-items: center;
    background: #fff;
}

.auth-card {
    width: min(440px, 100%);
}

.auth-back {
    display: flex;
    width: fit-content;
    margin-bottom: 42px;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
    text-decoration: none;
}

.auth-back:hover {
    color: var(--brand-purple);
    transform: translateX(-2px);
}

.auth-card .section-eyebrow {
    margin-bottom: 13px;
}

.auth-card h1 {
    margin: 0 0 10px;
    color: var(--brand-green);
    font-size: 38px;
    letter-spacing: -0.05em;
}

.auth-subtitle {
    margin: 0 0 30px;
    color: var(--muted);
    line-height: 1.6;
}

.auth-form {
    display: grid;
    gap: 18px;
}

.auth-field {
    display: grid;
    gap: 0;
}

.password-input-wrap {
    position: relative;
}

.auth-page .password-input-wrap input {
    padding-right: 70px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    min-width: 56px;
    min-height: 32px;
    padding: 5px 9px;
    border: 0;
    border-radius: 7px;
    color: var(--brand-purple);
    background: transparent;
    font-size: 12px;
    font-weight: 750;
    cursor: pointer;
    transform: translateY(-50%);
}

.password-toggle:hover {
    background: var(--brand-purple-soft);
}

.password-toggle:focus-visible {
    outline: 2px solid var(--brand-purple);
    outline-offset: 1px;
}

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

.auth-inline-link {
    margin-bottom: 7px;
    color: var(--brand-purple);
    font-size: 13px;
    font-weight: 750;
    text-decoration: none;
    white-space: nowrap;
}

.auth-inline-link:hover,
.auth-inline-link:focus-visible {
    text-decoration: underline;
}

.field-note {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.auth-submit {
    width: 100%;
    min-height: 48px;
    margin-top: 3px;
}

.auth-submit:disabled {
    cursor: wait;
    opacity: 0.62;
    transform: none;
}

.auth-switch {
    margin: 25px 0 0;
    color: var(--muted);
    font-size: 14px;
    text-align: center;
}

.auth-switch a {
    color: var(--brand-purple);
    font-weight: 750;
    text-decoration: none;
}

.auth-consent {
    display: grid !important;
    margin: 1px 0 2px !important;
    grid-template-columns: 20px 1fr;
    align-items: start;
    gap: 10px;
    color: var(--muted) !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    line-height: 1.5;
}

.auth-page .auth-consent input {
    width: 18px;
    min-height: 18px;
    height: 18px;
    margin: 1px 0 0;
    accent-color: var(--brand-purple);
}

.auth-consent a {
    color: var(--brand-purple);
    font-weight: 750;
}

.auth-legal {
    display: flex;
    margin: 18px 0 0;
    justify-content: center;
    gap: 9px;
    color: var(--muted-light);
    font-size: 11px;
}

.auth-message {
    min-height: 20px;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.auth-message:not(:empty) {
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #f8faf9;
}

.auth-message[data-type="error"]:not(:empty) {
    border-color: #f1c6c1;
    color: var(--danger);
    background: var(--danger-soft);
}

.auth-message[data-type="success"]:not(:empty) {
    border-color: #b9dfce;
    color: var(--positive);
    background: var(--positive-soft);
}

.confirmation-card {
    width: min(470px, 100%);
    text-align: center;
}

.confirmation-card .auth-back {
    margin-bottom: 52px;
}

.confirmation-card .section-eyebrow {
    justify-content: center;
}

.confirmation-icon {
    display: grid;
    width: 76px;
    height: 76px;
    margin: 0 auto 24px;
    border: 1px solid #b9dfce;
    border-radius: 50%;
    place-items: center;
    color: var(--positive);
    background: var(--positive-soft);
    box-shadow: 0 12px 32px rgba(7, 38, 30, 0.08);
}

.confirmation-icon svg {
    width: 34px;
    height: 34px;
}

.confirmation-icon.is-loading svg {
    width: 30px;
    height: 30px;
    animation: confirmation-spin 0.9s linear infinite;
}

.confirmation-icon.is-error {
    border-color: #f1c6c1;
    color: var(--danger);
    background: var(--danger-soft);
}

.confirmation-card .auth-subtitle {
    max-width: 410px;
    margin-inline: auto;
}

.confirmation-status {
    min-height: 24px;
    margin: -10px 0 24px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.confirmation-actions {
    display: grid;
    gap: 12px;
}

.confirmation-actions .auth-submit {
    justify-content: center;
    text-decoration: none;
}

.confirmation-secondary {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    color: var(--brand-purple);
    font-size: 14px;
    font-weight: 750;
    text-decoration: none;
}

.confirmation-secondary:hover,
.confirmation-secondary:focus-visible {
    text-decoration: underline;
}

.confirmation-state[hidden] {
    display: none;
}

@keyframes confirmation-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .confirmation-icon.is-loading svg {
        animation: none;
    }
}

@media (min-width: 901px) {
    .app-page.sidebar-collapsed {
        --sidebar-width: 84px;
    }

    .app-page.sidebar-collapsed .brand {
        margin-inline: 5px;
        justify-content: center;
    }

    .app-page.sidebar-collapsed .brand h1,
    .app-page.sidebar-collapsed .nav-label,
    .app-page.sidebar-collapsed .sidebar-note {
        display: none;
    }

    .app-page.sidebar-collapsed .sidebar-settings-nav {
        padding-top: 8px;
    }

    .app-page.sidebar-collapsed .sidebar-legal-nav {
        display: none;
    }

    .app-page.sidebar-collapsed .sidebar nav a {
        justify-content: center;
        padding-inline: 10px;
    }
}

@media (max-width: 1050px) {
    .hero-inner {
        gap: 38px;
        grid-template-columns: minmax(0, 0.9fr) minmax(380px, 1.1fr);
    }

    .preview-window {
        grid-template-columns: 105px 1fr;
    }

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

    .feature-card:last-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 900px) {
    .app-page .sidebar {
        width: min(286px, calc(100vw - 50px));
        transform: translateX(-105%);
        box-shadow: 16px 0 38px rgba(7, 38, 30, 0.2);
    }

    .app-page.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .app-page.sidebar-open .sidebar-overlay {
        visibility: visible;
        opacity: 1;
    }

    .app-page .topbar {
        inset-left: 0;
        left: 0;
        height: 68px;
        padding: 0 20px;
    }

    .app-page .main-content {
        margin-left: 0;
        padding: 94px 20px 38px;
    }

    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-brand-panel {
        min-height: 310px;
        padding: 30px;
    }

    .auth-story {
        margin: 58px 0 8px;
    }

    .auth-story h2 {
        max-width: 670px;
        font-size: clamp(36px, 8vw, 56px);
    }

    .auth-points {
        display: none;
    }

    .auth-panel {
        padding: 54px 24px 70px;
    }

    .auth-back {
        margin-bottom: 30px;
    }

    .hero-inner {
        min-height: auto;
        padding: 68px 0;
        grid-template-columns: 1fr;
    }

    .hero-copy {
        max-width: 740px;
    }

    .product-preview {
        max-width: 720px;
    }

    .insights-hero {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .site-nav {
        min-height: 64px;
    }

    .site-links > a:not(.nav-login):not(.nav-signup) {
        display: none;
    }

    .legal-nav-links > a:not(.nav-login):not(.nav-signup) {
        display: block;
    }

    .nav-login {
        display: none !important;
    }

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

    .hero h1 {
        font-size: clamp(43px, 13vw, 64px);
    }

    .hero-lead {
        font-size: 16px;
    }

    .preview-window {
        grid-template-columns: 78px 1fr;
    }

    .preview-main {
        padding: 16px;
    }

    .trust-inner,
    .feature-grid,
    .insight-feature-grid {
        grid-template-columns: 1fr;
    }

    .feature-card:last-child {
        grid-column: auto;
    }

    .trust-item {
        justify-content: flex-start;
    }

    .marketing-section {
        padding: 72px 0;
    }

    .cta-panel,
    .insights-intro {
        align-items: flex-start;
        flex-direction: column;
    }

    .cta-panel {
        display: flex;
    }

    .insights-hero {
        padding: 30px 24px;
    }
}

@media (max-width: 560px) {
    .app-page .topbar {
        padding-inline: 14px;
    }

    .app-page .topbar h2 {
        font-size: 16px;
    }

    .app-page #user-email {
        display: none;
    }

    .app-page .main-content {
        padding: 88px 14px 34px;
    }

    .app-page .card,
    .app-page .panel {
        padding: 19px;
    }

    .app-page .summary-card {
        min-height: 112px;
    }

    .app-page .card-header,
    .app-page .panel-header {
        gap: 12px;
    }

    .site-nav,
    .hero-inner,
    .trust-inner,
    .marketing-section,
    .site-footer {
        width: min(100% - 28px, 1180px);
    }

    .public-brand {
        font-size: 14px;
    }

    .nav-signup {
        min-height: 40px;
        padding: 8px 12px;
        font-size: 13px;
    }

    .hero-inner {
        padding: 54px 0 62px;
    }

    .hero-actions {
        flex-direction: column;
    }

    .hero-actions button {
        width: 100%;
    }

    .product-preview {
        padding: 8px;
        border-radius: 17px;
    }

    .preview-window {
        min-height: 360px;
        grid-template-columns: 56px 1fr;
    }

    .preview-sidebar {
        padding: 14px 8px;
    }

    .preview-chart-card {
        min-height: 202px;
    }

    .preview-chart {
        height: 125px;
    }

    .auth-brand-panel {
        min-height: 260px;
        padding: 24px 20px;
    }

    .auth-story {
        margin-top: 48px;
    }

    .auth-story > p {
        font-size: 14px;
    }

    .auth-panel {
        padding: 44px 20px 56px;
    }

    .auth-card h1 {
        font-size: 34px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Onboarding */
.onboarding-shell {
    grid-template-columns: minmax(370px, 0.82fr) minmax(600px, 1.18fr);
}

.onboarding-brand-panel {
    background: linear-gradient(145deg, #071f19, var(--brand-green-2) 62%, #401a79 155%);
}

.onboarding-story {
    max-width: 600px;
}

.onboarding-preview {
    display: flex;
    max-width: 480px;
    margin-top: 38px;
    padding: 17px 18px;
    align-items: center;
    gap: 13px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(10px);
}

.onboarding-preview-icon {
    display: grid;
    flex: 0 0 39px;
    width: 39px;
    height: 39px;
    place-items: center;
    border-radius: 11px;
    color: #fff;
    background: rgba(255, 255, 255, 0.13);
    font-size: 17px;
}

.onboarding-preview strong,
.onboarding-preview span {
    display: block;
}

.onboarding-preview strong {
    margin-bottom: 3px;
    color: #fff;
    font-size: 13px;
}

.onboarding-preview span {
    color: rgba(255, 255, 255, 0.62);
    font-size: 12px;
    line-height: 1.5;
}

.onboarding-panel {
    padding-block: 34px;
}

.onboarding-card {
    width: min(610px, 100%);
}

.onboarding-progress {
    margin-bottom: 44px;
}

.onboarding-progress-copy {
    display: flex;
    margin-bottom: 10px;
    align-items: center;
    justify-content: space-between;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.onboarding-progress-copy #step-label {
    color: var(--brand-purple);
}

.onboarding-progress-track {
    height: 5px;
    overflow: hidden;
    border-radius: 99px;
    background: var(--brand-purple-soft);
}

.onboarding-progress-track span {
    display: block;
    width: 33.333%;
    height: 100%;
    border-radius: inherit;
    background: var(--brand-purple);
    transition: width 260ms ease;
}

.onboarding-step {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.onboarding-step legend {
    width: 100%;
    margin: 0 0 10px;
    padding: 0;
    color: var(--brand-green);
    font-size: clamp(30px, 4vw, 40px);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.045em;
}

.onboarding-step-copy {
    max-width: 530px;
    margin: 0 0 30px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.6;
}

.onboarding-name-field {
    max-width: 500px;
}

.auth-page .onboarding-name-field input {
    min-height: 52px;
    padding-inline: 15px;
    font-size: 16px;
}

.choice-grid {
    display: grid;
    gap: 12px;
}

.choice-grid-two,
.learning-choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.choice-card {
    position: relative;
    display: grid !important;
    min-height: 136px;
    margin: 0 !important;
    padding: 20px;
    grid-template-columns: 42px minmax(0, 1fr) 22px;
    align-items: flex-start;
    gap: 13px;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 13px;
    color: var(--ink);
    background: #fff;
    cursor: pointer;
}

.choice-card:hover {
    border-color: #9d82ce;
    background: #fcfaff;
    box-shadow: 0 9px 24px rgba(87, 18, 198, 0.07);
    transform: translateY(-1px);
}

.choice-card:has(input:focus-visible) {
    outline: 3px solid rgba(87, 18, 198, 0.25);
    outline-offset: 2px;
}

.choice-card:has(input:checked) {
    border-color: var(--brand-purple);
    background: var(--brand-purple-soft);
    box-shadow: inset 0 0 0 1px var(--brand-purple);
}

.choice-card input {
    position: absolute;
    width: 1px;
    height: 1px;
    min-height: 0;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    border: 0;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.choice-card-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 11px;
    color: var(--brand-purple);
    background: var(--brand-purple-soft);
    font-size: 19px;
    font-weight: 850;
}

.choice-card:has(input:checked) .choice-card-icon {
    color: #fff;
    background: var(--brand-purple);
}

.choice-card-copy strong,
.choice-card-copy span {
    display: block;
}

.choice-card-copy strong {
    margin: 2px 0 6px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 800;
}

.choice-card-copy span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.45;
}

.choice-card-check {
    display: grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    color: transparent;
    background: #fff;
    font-size: 11px;
    font-weight: 900;
}

.choice-card:has(input:checked) .choice-card-check {
    border-color: var(--brand-purple);
    color: #fff;
    background: var(--brand-purple);
}

.compact-choice-card {
    min-height: 118px;
    padding: 17px;
}

.onboarding-message {
    margin-top: 18px;
}

.onboarding-message[data-type="error"]:not(:empty) {
    border-color: #f1c6c1;
    color: var(--danger);
    background: var(--danger-soft);
}

.onboarding-message[data-type="success"]:not(:empty) {
    border-color: #b9dfce;
    color: var(--positive);
    background: var(--positive-soft);
}

.onboarding-actions {
    display: flex;
    margin-top: 26px;
    align-items: center;
    justify-content: flex-end;
    gap: 11px;
}

.onboarding-actions .onboarding-continue-button {
    width: auto;
    min-width: 154px;
    margin: 0;
    padding-inline: 22px;
}

.onboarding-back-button {
    min-height: 48px;
    padding: 10px 18px;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    color: var(--ink-soft);
    background: #fff;
    font-weight: 750;
    cursor: pointer;
}

.onboarding-back-button:hover {
    border-color: #aab9b3;
    background: var(--canvas);
}

.onboarding-actions button:disabled {
    cursor: wait;
    opacity: 0.62;
    transform: none;
}

.onboarding-privacy {
    display: flex;
    margin: 30px 0 0;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: var(--muted-light);
    font-size: 11px;
    text-align: center;
}

@media (max-width: 1050px) {
    .onboarding-shell {
        grid-template-columns: minmax(320px, 0.72fr) minmax(550px, 1.28fr);
    }
}

@media (max-width: 900px) {
    .onboarding-shell {
        grid-template-columns: 1fr;
    }

    .onboarding-brand-panel {
        min-height: 270px;
    }

    .onboarding-story {
        margin-top: 50px;
    }

    .onboarding-preview {
        display: none;
    }

    .onboarding-progress {
        margin-bottom: 36px;
    }
}

@media (max-width: 560px) {
    .onboarding-brand-panel {
        min-height: 235px;
    }

    .onboarding-story h2 {
        font-size: clamp(32px, 10vw, 43px);
    }

    .choice-grid-two,
    .learning-choice-grid {
        grid-template-columns: 1fr;
    }

    .choice-card,
    .compact-choice-card {
        min-height: 104px;
        padding: 15px;
    }

    .onboarding-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .onboarding-actions .onboarding-continue-button,
    .onboarding-back-button {
        width: 100%;
    }
}
