*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --page-bg: #e3e4e8;
    --page-bg-soft: #f4f4f7;
    --surface: rgba(253, 253, 253, 0.9);
    --surface-strong: #ffffff;
    --surface-muted: #f7f7fa;
    --border: #e6e8ef;
    --border-strong: #d9dce8;
    --text: #1a1a2e;
    --text-muted: #7d8094;
    --text-soft: #9a9daf;
    --primary: #4f8cff;
    --primary-hover: #3b74d8;
    --primary-soft: rgba(79, 140, 255, 0.12);
    --success: #00a86b;
    --success-soft: rgba(0, 168, 107, 0.12);
    --danger: #d64545;
    --danger-soft: rgba(214, 69, 69, 0.12);
    --warning: #d98b11;
    --warning-soft: rgba(217, 139, 17, 0.14);
    --shadow-lg: 0 18px 60px rgba(20, 24, 40, 0.08);
    --shadow-md: 0 10px 30px rgba(20, 24, 40, 0.06);
    --shadow-sm: 0 6px 18px rgba(20, 24, 40, 0.05);
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 12px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(79, 140, 255, 0.14), transparent 28%),
        radial-gradient(circle at top right, rgba(79, 140, 255, 0.12), transparent 24%),
        linear-gradient(180deg, #eeeff3 0%, var(--page-bg) 30%, #ececef 100%);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-shell {
    display: flex;
    width: 100%;
    height: 100vh;
    min-height: 100vh;
    background: #fdfdfd;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.site-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #fdfcfd;
    overflow-y: auto;
}

.site-content > .site-main {
    flex: 1 0 auto;
    width: 100%;
}

.topbar {
    padding: 30px 24px 0;
}

.topbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(224, 226, 236, 0.9);
    border-radius: 999px;
    min-height: 86px;
    padding: 1.2rem 2.8rem;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(24px);
    max-width: 1200px;
}

.topbar-nav {
    min-width: 0;
}

.topbar .nav-links {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.85rem;
}

.topbar .nav-links a {
    width: auto;
    padding: 0.7rem 1.4rem;
    border-radius: 999px;
    font-size: 0.96rem;
    font-weight: 500;
}

.topbar .nav-links a.nav-btn-primary {
    background: var(--text);
    color: #fff;
}

.topbar .nav-links a.nav-btn-primary:hover {
    background: #4a4c59;
}

.topbar .nav-links a.nav-btn-outline {
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text);
}

.topbar .nav-links a.nav-btn-outline:hover {
    background: var(--surface-muted);
}

.usage-meter-shell {
    position: fixed;
    top: 18px;
    right: 20px;
    z-index: 64;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.usage-meter-trigger {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
    color: #1a1a2e;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    position: relative;
}

.usage-meter-value {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.usage-meter-stamina {
    --usage-ring-angle: 1turn;
    --usage-ring-fill: #6eee54;
    --usage-ring-empty: #273630;
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: conic-gradient(from -90deg, var(--usage-ring-fill) 0turn var(--usage-ring-angle), var(--usage-ring-empty) var(--usage-ring-angle) 1turn);
    -webkit-mask-image: radial-gradient(circle, transparent 34%, black 35%);
    mask-image: radial-gradient(circle, transparent 34%, black 35%);
}

.usage-meter-progress {
    --usage-meter-fill: #1fbf51;
    --usage-meter-empty: #e6e8ef;
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: var(--usage-meter-empty);
    overflow: hidden;
}

.usage-meter-progress-fill {
    height: 100%;
    background: var(--usage-meter-fill);
    border-radius: 999px;
    transition: width 0.3s ease;
}

.usage-meter-progress.is-warning {
    --usage-meter-fill: #d98b11;
    --usage-meter-empty: #f7e8ce;
}

.usage-meter-stamina.is-warning {
    --usage-ring-fill: #f1c84e;
}

.usage-meter-stamina.is-danger,
.usage-meter-progress.is-danger {
    --usage-meter-fill: #d64545;
    --usage-meter-empty: #f5d4d4;
}

.usage-meter-stamina.is-danger {
    --usage-ring-fill: #ef6565;
}

.usage-meter-panel {
    width: min(360px, calc(100vw - 24px));
    padding: 16px;
    border: 1px solid rgba(26, 26, 46, 0.09);
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.usage-meter-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.usage-meter-panel-title {
    font-size: 1.05rem;
    line-height: 1.2;
    color: #1a1a2e;
    font-weight: 600;
}

.usage-meter-stat-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 0;
}

.usage-meter-stat-block + .usage-meter-stat-block {
    border-top: 1px solid rgba(230, 232, 239, 0.9);
}

.usage-meter-stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.92rem;
    color: #4f4f66;
}

.usage-meter-stat-row strong {
    color: #1a1a2e;
    font-size: 0.95rem;
}

.usage-meter-note {
    font-size: 0.8rem;
    color: #7d8094;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.25), transparent 82%);
}

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

.site-main {
    padding-top: 0;
    padding-bottom: 3rem;
}

.topbar-main {
    padding-top: 3rem;
}

.minimal-main {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.landing-main {
    padding: 0;
}

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

a:hover {
    color: var(--primary-hover);
}

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

h1, h2, h3 {
    color: var(--text);
    line-height: 1.15;
}

h2 {
    font-size: clamp(1.9rem, 2.4vw, 2.5rem);
    letter-spacing: -0.03em;
    margin-bottom: 1.25rem;
}

code {
    background: var(--surface-muted);
    border: 1px solid var(--border);
    padding: 0.15em 0.45em;
    border-radius: 8px;
    font-size: 0.9em;
    color: var(--text);
}

.site-sidebar.sidebar {
    width: 250px;
    max-width: 250px;
    flex-shrink: 0;
    background: #fdfdfd;
    border-right: 1px solid #eaeaef;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    position: sticky;
    top: 0;
    align-self: stretch;
    height: 100vh;
    max-height: 100vh;
    transition: width 0.3s ease;
}

.site-sidebar.sidebar.collapsed {
    width: 76px;
    max-width: 76px;
}

.site-nav {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.workspace-logo {
    width: 32px;
    height: 32px;
    background: #1a1a2e;
    color: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.workspace-text {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.workspace-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.workspace-role {
    font-size: 0.75rem;
    color: #8b8b9b;
}

.header-expand-icon {
    color: #8b8b9b;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.site-sidebar.sidebar.collapsed .workspace-text,
.site-sidebar.sidebar.collapsed .nav-item span,
.site-sidebar.sidebar.collapsed .nav-item .dropdown-icon,
.site-sidebar.sidebar.collapsed .sidebar-section-label,
.site-sidebar.sidebar.collapsed .user-info,
.site-sidebar.sidebar.collapsed .history-empty,
.site-sidebar.sidebar.collapsed .history-delete {
    display: none;
}

.site-sidebar.sidebar.collapsed .nav-item,
.site-sidebar.sidebar.collapsed .user-block {
    justify-content: center;
}

.site-sidebar.sidebar.collapsed .history-list {
    display: none;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 0.98rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
    flex-shrink: 0;
}

.logo::before {
    content: "T";
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--text);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.92rem;
    font-weight: 700;
}

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

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

.nav-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    flex: 1;
    min-height: 0;
    padding: 12px;
    overflow-y: auto;
}

.nav-items::-webkit-scrollbar {
    width: 4px;
}

.nav-items::-webkit-scrollbar-track {
    background: transparent;
}

.nav-items::-webkit-scrollbar-thumb {
    background: #d1d1db;
    border-radius: 4px;
}

.nav-items::-webkit-scrollbar-thumb:hover {
    background: #b0b0be;
}

.nav-item {
    width: 100%;
    min-height: 40px;
    border-radius: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #4f4f66;
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 12px;
    transition: all 0.2s;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.nav-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
    flex: 1;
}

.nav-item svg:not(.dropdown-icon) {
    color: #8b8b9b;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.nav-item:hover,
.nav-item.active {
    background: #f4f4f7;
    color: #1a1a2e;
}

.nav-item:hover svg:not(.dropdown-icon),
.nav-item.active svg:not(.dropdown-icon) {
    color: #1a1a2e;
}

.nav-items > a.nav-item:first-child {
    margin-top: 4px;
}

.nav-group {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.nav-group-pinned {
    padding-top: 12px;
}

.sidebar-section-label {
    padding: 14px 12px 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8b8b9b;
}

.sub-nav-items {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: max-height 0.24s ease, opacity 0.18s ease, transform 0.18s ease;
    padding: 0 12px;
}

.nav-group.open .sub-nav-items {
    max-height: 250px;
    overflow-y: auto;
    margin-top: 4px;
    padding-bottom: 8px;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.dropdown-icon {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
    color: #8b8b9b;
}

.nav-group.open .dropdown-icon {
    transform: rotate(180deg);
}

.sub-nav-item {
    width: 100%;
    text-align: left;
    padding: 8px 12px 8px 42px;
    border-radius: 6px;
    background: transparent;
    border: none;
    font-size: 0.85rem;
    color: #4f4f66;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.2s;
}

.sub-nav-item:hover,
.sub-nav-item.active {
    background: #f4f4f7;
    color: #1a1a2e;
}

.admin-sub-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 18px;
}

.admin-sub-nav-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-sub-nav-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #8b8b9b;
}

.admin-sub-nav-item:hover svg,
.admin-sub-nav-item.active svg {
    color: #1a1a2e;
}

.history-item {
    position: relative;
    display: flex;
    align-items: center;
}

.history-link {
    flex: 1;
    min-width: 0;
    display: block;
    text-align: left;
    padding: 8px 12px;
    border-radius: 8px;
    background: transparent;
    border: none;
    font-size: 0.85rem;
    color: #4f4f66;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 12px;
    transition: background 0.2s ease, color 0.2s ease, padding-right 0.18s ease;
}

.history-link:hover,
.history-link.active {
    background: #f4f4f7;
    color: #1a1a2e;
}

.history-item:hover .history-link,
.history-item:focus-within .history-link {
    padding-right: 42px;
}

.history-title {
    display: block;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-delete {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #a0a0b0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    opacity: 0;
    pointer-events: none;
    transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.history-item:hover .history-delete,
.history-delete:focus-visible {
    opacity: 1;
    pointer-events: auto;
}

.history-delete:hover {
    background: #f4f4f7;
    color: #c63f3f;
}

.history-empty {
    padding: 8px 12px;
    font-size: 0.82rem;
    color: #8b8b9b;
}

.nav-links a {
    display: flex;
    align-items: center;
    width: 100%;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.72rem 0.9rem;
    border-radius: 14px;
    transition: all 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text);
    background: var(--page-bg-soft);
}

.bottom-nav {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 12px;
    border-top: 1px solid #eaeaef;
    flex-shrink: 0;
}

.user-block {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.user-block:hover,
.user-block.active {
    background: #f4f4f7;
}

.user-block-main {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
}

.user-block-logout {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #8b8b9b;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.user-block-logout:hover {
    background: #ececf4;
    color: #1a1a2e;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    background: #4f8cff;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-backdrop,
.mobile-sidebar-toggle,
.site-sidebar-backdrop,
.site-sidebar-toggle {
    display: none;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.72rem 1.25rem;
    border-radius: 14px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

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

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 10px 22px rgba(79, 140, 255, 0.22);
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: #fff;
}

.btn-outline {
    border-color: var(--border);
    color: var(--text);
    background: rgba(255, 255, 255, 0.72);
}

.btn-outline:hover {
    border-color: var(--border-strong);
    color: var(--text);
    background: #fff;
}

.btn-success {
    background: var(--success);
    color: #fff;
}

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

.btn-sm {
    padding: 0.48rem 0.8rem;
    font-size: 0.78rem;
    border-radius: 10px;
}

.btn-full {
    width: 100%;
}

.card,
.feature-card,
.plan-card,
.stat-card,
.auth-container,
.chat-panel,
.modal-content {
    background: rgba(253, 253, 253, 0.88);
    border: 1px solid rgba(230, 232, 239, 0.95);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(16px);
}

.card {
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card h3 {
    margin-bottom: 1rem;
    font-size: 1.15rem;
}

.auth-form {
    max-width: 100%;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.42rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.78rem 0.95rem;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text);
    font-size: 0.94rem;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: rgba(79, 140, 255, 0.45);
    box-shadow: 0 0 0 4px rgba(79, 140, 255, 0.12);
    background: #fff;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.inline-form {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.inline-form .form-group {
    flex: 1;
    min-width: 160px;
    margin-bottom: 0;
}

.alert {
    padding: 0.9rem 1rem;
    border-radius: 14px;
    margin-bottom: 1rem;
    font-size: 0.92rem;
    font-weight: 500;
}

.alert-error {
    background: var(--danger-soft);
    border: 1px solid rgba(214, 69, 69, 0.22);
    color: #ad3434;
}

.alert-success {
    background: var(--success-soft);
    border: 1px solid rgba(0, 168, 107, 0.2);
    color: #0a8255;
}

.auth-container {
    max-width: 460px;
    margin: 3.5rem auto;
    border-radius: 24px;
    padding: 2rem;
}

.auth-container h2 {
    text-align: center;
    margin-bottom: 1.4rem;
}

.auth-container p {
    text-align: center;
}

.auth-links {
    margin-top: 1.25rem;
    text-align: center;
    font-size: 0.9rem;
}

.auth-links a {
    display: inline-block;
    margin-top: 0.45rem;
}

.profile-page {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-top: 2rem;
}

.profile-section-copy,
.profile-reset-text {
    color: var(--text-muted);
}

.profile-detail-label {
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-soft);
}

.profile-overview-grid,
.profile-section-grid {
    display: grid;
    gap: 1.5rem;
}

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

.profile-section-grid {
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.85fr);
    align-items: start;
}

.profile-main-column,
.profile-side-column {
    display: grid;
    gap: 1.5rem;
}

.profile-usage-card,
.profile-section-card {
    position: relative;
    overflow: hidden;
    margin-bottom: 0;
    padding: 1.35rem;
    border-radius: 24px;
}

.profile-usage-card::before,
.profile-section-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 1px;
    background: rgba(79, 140, 255, 0.16);
}

.profile-usage-card {
    background: #fbfcff;
    border-color: rgba(212, 220, 236, 0.95);
}

.profile-usage-card-monthly {
    background: #fcfcfd;
    border-color: rgba(220, 223, 231, 0.95);
}

.profile-account-card {
    background: #ffffff;
}

.profile-settings-card {
    background: #fbfbfc;
}

.profile-api-card {
    background: #f8f9fb;
}

.profile-card-topline,
.profile-usage-head,
.profile-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.profile-card-title,
.profile-section-title {
    margin: 0.25rem 0 0;
    font-size: 1.2rem;
    letter-spacing: -0.03em;
}

.profile-usage-mainline {
    display: flex;
    align-items: baseline;
    gap: 0.55rem;
    margin: 0.55rem 0 0.1rem;
}

.profile-usage-value {
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    line-height: 1;
    letter-spacing: -0.05em;
    color: var(--text);
}

.profile-usage-total {
    color: var(--text-soft);
    font-weight: 600;
    font-size: 1rem;
}

.profile-progress-bar {
    width: 100%;
    height: 8px;
    margin: 0.9rem 0 0.65rem;
    appearance: none;
    -webkit-appearance: none;
}

.profile-progress-bar::-webkit-progress-bar {
    background: rgba(79, 140, 255, 0.1);
    border-radius: 999px;
}

.profile-progress-bar::-webkit-progress-value {
    border-radius: 999px;
    background: #4f8cff;
}

.profile-progress-bar::-moz-progress-bar {
    border-radius: 999px;
    background: #4f8cff;
}

.profile-progress-bar-monthly::-webkit-progress-bar {
    background: rgba(26, 26, 46, 0.08);
}

.profile-progress-bar-monthly::-webkit-progress-value,
.profile-progress-bar-monthly::-moz-progress-bar {
    background: #1a1a2e;
}

.profile-details-grid,
.profile-form-grid,
.profile-api-list {
    display: grid;
    gap: 1rem;
}

.profile-details-grid,
.profile-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-detail,
.profile-api-item {
    display: flex;
    flex-direction: column;
    gap: 0.38rem;
    padding: 1.05rem 1.1rem;
    border-radius: 18px;
    background: #f8f9fb;
    border: 1px solid rgba(230, 232, 239, 0.95);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.profile-detail-topline {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.profile-detail-icon {
    width: 1.7rem;
    height: 1.7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #eef2f8;
    color: #53657f;
    flex-shrink: 0;
}

.profile-detail-value {
    color: var(--text);
    font-weight: 600;
    font-size: 1rem;
}

.profile-form {
    margin-top: 1rem;
}

.profile-section-head {
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(230, 232, 239, 0.95);
}

.profile-api-block {
    margin-top: 1rem;
    padding: 1rem 1.05rem;
    border-radius: 18px;
    background: #111827;
    color: #f4f7ff;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, monospace;
    font-size: 0.9rem;
    overflow-x: auto;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.profile-api-list {
    margin-top: 1rem;
}

.profile-api-list-compact {
    gap: 0.75rem;
}

.profile-api-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.profile-api-item code {
    width: 100%;
    overflow-wrap: anywhere;
}
.profile-api-key-value,
.profile-api-endpoint-value {
    display: block;
    margin-top: 0.2rem;
    padding: 0.8rem 0.9rem;
    border-radius: 14px;
    background: #eef2f7;
    border: 1px solid #dce3ef;
    color: var(--text);
    font-size: 0.84rem;
}

.profile-copy-btn {
    flex-shrink: 0;
}

.profile-api-new-key-notice {
    background: var(--success-soft);
    border-color: rgba(0, 168, 107, 0.25);
}

.profile-api-new-key-notice .profile-detail-label {
    color: var(--success);
    font-weight: 600;
    font-size: 0.82rem;
    margin-bottom: 0.3rem;
}

.profile-api-new-key-notice .profile-api-key-value {
    flex: 1;
    min-width: 0;
}

.profile-api-new-key-notice .profile-api-item-head {
    gap: 0.5rem;
}

.profile-api-key-date {
    font-size: 0.78rem;
    color: var(--text-soft);
}

.profile-api-key-empty {
    color: var(--text-soft);
    font-style: italic;
}

.profile-api-key-actions {
    margin-top: 0.5rem;
}

.btn-danger-outline {
    color: var(--danger);
    border-color: var(--danger);
}

.btn-danger-outline:hover {
    background: var(--danger-soft);
}

.landing-page {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: linear-gradient(180deg, #ffffff 0%, #f9f9fb 40%, #f5f5f8 100%);
}

.landing-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid rgba(200, 210, 230, 0.35);
    backdrop-filter: blur(12px);
    padding: 1rem 0;
}

.landing-header-inner {
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 2rem;
}

.landing-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #1a1a2e;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
}

.landing-brand:hover {
    color: #1a1a2e;
}

.landing-nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.landing-nav-links a {
    color: #595b6f;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
}

.landing-nav-links a:hover {
    color: #1a1a2e;
}

.landing-nav-actions {
    display: flex;
    justify-content: flex-end;
}

.landing-nav-link-button {
    padding: 0.7rem 1.3rem;
    border-radius: 10px;
    background: #4f8cff;
    border: none;
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
}

.landing-nav-link-button:hover {
    background: #3f7add;
    color: white;
}

/* Hero Section */
.landing-hero {
    padding: 5rem 2rem 3rem;
    text-align: center;
}

.landing-hero-inner {
    max-width: 820px;
    margin: 0 auto;
}

.landing-hero-title {
    font-size: clamp(2.2rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.04em;
    color: #1a1a2e;
    margin-bottom: 1rem;
    max-width: 15ch;
    margin-left: auto;
    margin-right: auto;
}

.landing-hero-description {
    font-size: 1.15rem;
    color: #595b6f;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.landing-hero-ctas {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.btn-lg {
    padding: 0.9rem 1.8rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 10px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: inline-block;
}

.btn-lg.btn-primary {
    background: #4f8cff;
    color: white;
}

.btn-lg.btn-primary:hover {
    background: #3f7add;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 140, 255, 0.3);
}

.btn-lg.btn-outline {
    background: white;
    color: #1a1a2e;
    border: 2px solid rgba(200, 210, 230, 0.5);
}

.btn-lg.btn-outline:hover {
    background: #f9f9fb;
    border-color: #c8d2e6;
}

/* Stats Grid in Hero */
.landing-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(200, 210, 230, 0.35);
}

.landing-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.landing-stat-label {
    font-size: 0.85rem;
    color: #95a8c8;
    font-weight: 500;
    margin-bottom: 0.3rem;
}

.landing-stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: #1a1a2e;
}

/* Section Headers */
.landing-section-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.landing-section-header h2 {
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 800;
    color: #1a1a2e;
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.landing-section-header p {
    font-size: 1.05rem;
    color: #595b6f;
    line-height: 1.6;
}

/* Features Section */
.landing-features,
.landing-featured-models,
.landing-how-it-works,
.landing-pricing-band,
.landing-announcements {
    max-width: 1360px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

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

.editorial-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(79, 140, 255, 0.15), rgba(79, 140, 255, 0.1));
}

.editorial-info-card {
    background: white;
    border: 1px solid rgba(200, 210, 230, 0.35);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: left;
    transition: all 0.3s;
}

.editorial-info-card:hover {
    border-color: rgba(79, 140, 255, 0.3);
    box-shadow: 0 8px 24px rgba(79, 140, 255, 0.1);
    transform: translateY(-4px);
}

.editorial-info-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 1rem 0 0.5rem;
}

.editorial-info-card p {
    color: #595b6f;
    font-size: 0.95rem;
    line-height: 1.6;
}

.landing-section-heading-row {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1.5rem;
    margin: 0 auto 2rem;
    max-width: 1080px;
}

.landing-section-heading-row h2 {
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    font-weight: 800;
    color: #1a1a2e;
    line-height: 1.15;
}

.landing-section-heading-row p {
    margin-top: 0.45rem;
    color: #595b6f;
    font-size: 1rem;
}

.landing-inline-link {
    color: #4f8cff;
    font-weight: 600;
    white-space: nowrap;
}

.landing-inline-link:hover {
    color: #3b74d8;
}

.landing-carousel-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.carousel-nav-btn {
    background: white;
    border: 1px solid rgba(200, 210, 230, 0.6);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.2s ease;
}

.carousel-nav-btn:hover {
    border-color: #4f8cff;
    color: #4f8cff;
    background: #f4f7ff;
}

.landing-models-carousel {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding-top: 1rem;     /* Space for hover bounding box */
    padding-bottom: 2rem;  /* Space for shadow overflow */
    margin: -1rem auto -1rem; /* Offset padding + auto center */
    max-width: 1080px;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.landing-models-carousel::-webkit-scrollbar {
    display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
.landing-models-carousel {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.landing-model-card {
    flex: 0 0 auto;
    width: calc((100% - 3rem) / 3); /* 3 cards */
    scroll-snap-align: start;
    background: white;
    border: 1px solid rgba(200, 210, 230, 0.4);
    border-radius: 18px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(31, 42, 68, 0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.landing-model-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 34px rgba(31, 42, 68, 0.1);
    border-color: rgba(79, 140, 255, 0.35);
}

.landing-model-head {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 1.35rem;
}

.landing-model-head h3 {
    color: #1a1a2e;
    font-size: 1.15rem;
    font-weight: 700;
}

.landing-model-head p {
    color: #7a859f;
    font-size: 0.88rem;
}

.landing-model-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 999px;
    color: white;
}

.landing-model-badge svg {
    width: 24px;
    height: 24px;
    display: block;
    fill: currentColor;
}

.provider-openai {
    background: linear-gradient(135deg, #20293e, #111827);
}

.provider-anthropic {
    background: linear-gradient(135deg, #8c5f3d, #5f3c24);
}

.provider-google {
    background: linear-gradient(135deg, #4f8cff, #6f5fff);
}

.landing-model-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(200, 210, 230, 0.45);
}

.landing-model-meta span {
    display: block;
    color: #95a8c8;
    font-size: 0.78rem;
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.landing-model-meta strong {
    color: #1a1a2e;
    font-size: 0.92rem;
    line-height: 1.5;
}

/* How it Works - Modern Steps */
.landing-steps-grid.modern-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
}

.modern-step-card {
    background: #ffffff;
    border: 1px solid rgba(200, 210, 230, 0.4);
    border-radius: 18px;
    padding: 2rem;
    box-shadow: 0 4px 14px rgba(31, 42, 68, 0.03);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
    height: 100%;
}

.modern-step-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(31, 42, 68, 0.08);
    border-color: rgba(79, 140, 255, 0.35);
}

.step-content {
    margin-bottom: 2rem;
}

.step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(79, 140, 255, 0.1);
    color: #4f8cff;
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 1.25rem;
}

.step-content h3 {
    font-size: 1.25rem;
    color: #1a1a2e;
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.step-content p {
    color: #595b6f;
    font-size: 0.95rem;
    line-height: 1.6;
}

.step-ui-window {
    background: #fafafc;
    border: 1px solid rgba(200, 210, 230, 0.4);
    border-radius: 12px;
    padding: 1.5rem;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
}

.mock-oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.7rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(200, 210, 230, 0.55);
    background: white;
    color: #1a1a2e;
    box-shadow: 0 2px 4px rgba(31, 42, 68, 0.02);
    cursor: pointer;
    transition: all 0.2s ease;
}

.mock-oauth-btn:hover {
    background: #f9fafb;
    border-color: rgba(200, 210, 230, 0.8);
    box-shadow: 0 4px 6px rgba(31, 42, 68, 0.04);
    transform: translateY(-1px);
}

.mock-oauth-btn.outline {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    color: #7a859f;
    font-weight: 500;
}

.step-ui-window.bg-dots {
    background-image: radial-gradient(rgba(200, 210, 230, 0.5) 1px, transparent 1px);
    background-size: 16px 16px;
}

.mock-input {
    width: 100%;
    padding: 0.65rem 0.8rem;
    border-radius: 8px;
    border: 1px solid rgba(200, 210, 230, 0.8);
    background: #f9fafb;
    color: #4b5563;
    font-size: 0.85rem;
    font-family: monospace;
}

.mock-btn {
    width: 100%;
    padding: 0.7rem;
    border-radius: 8px;
    background: #4f8cff;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    margin-top: 0.25rem;
}

.mock-plan-card {
    background: white;
    border: 1px solid rgba(200, 210, 230, 0.45);
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 4px 14px rgba(31, 42, 68, 0.05);
    width: 100%;
    max-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.mock-plan-card .mock-plan-title {
    font-size: 0.85rem;
    color: #7a859f;
    font-weight: 600;
}
.mock-plan-card strong {
    font-size: 1.8rem;
    color: #1a1a2e;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.mock-plan-card .mock-plan-sub {
    font-size: 0.85rem;
    color: #9ba1b0;
    margin-top: 0.2rem;
}

.step-ui-window.code-dark {
    background: #0f172a;
    border-color: #1e293b;
    align-items: stretch;
    justify-content: flex-start;
    padding: 1.25rem;
}
.code-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #94a3b8;
    font-size: 0.8rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-weight: 600;
    margin-bottom: 1rem;
    border-bottom: 1px solid #1e293b;
    padding-bottom: 0.5rem;
}
.code-val {
    color: #10b981;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.9rem;
    word-break: break-all;
    background: rgba(16, 185, 129, 0.1);
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}


/* Pricing Section */
.landing-pricing-band {
    max-width: 1360px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.modern-plan-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 1.5rem;
    padding-top: 1.5rem;
    padding-bottom: 2rem;
    margin-top: -1.5rem;
    align-items: stretch;
    scrollbar-width: thin;
    scrollbar-color: rgba(200, 210, 230, 0.8) transparent;
    /* padding to allow shadow cutoff */
    padding-left: 0.25rem;
    padding-right: 0.25rem;
}

.modern-plan-grid::-webkit-scrollbar {
    height: 8px;
}
.modern-plan-grid::-webkit-scrollbar-track {
    background: transparent;
}
.modern-plan-grid::-webkit-scrollbar-thumb {
    background: rgba(200, 210, 230, 0.8);
    border-radius: 4px;
}

.modern-plan-card {
    background: white;
    border: 1px solid rgba(200, 210, 230, 0.4);
    border-radius: 18px;
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 14px rgba(31, 42, 68, 0.03);
    position: relative;
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
    flex: 0 0 calc(25% - 1.125rem); /* exactly 4 cards in a row based on gap */
    min-width: 290px;
    scroll-snap-align: start;
}

.modern-plan-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(31, 42, 68, 0.08);
    border-color: rgba(79, 140, 255, 0.35);
}

.modern-plan-card.featured {
    border: 2px solid #4f8cff;
    box-shadow: 0 12px 30px rgba(79, 140, 255, 0.15);
}

.modern-plan-badge {
    position: absolute;
    top: -12px;
    left: 2rem;
    display: inline-block;
    padding: 0.35rem 1rem;
    background: linear-gradient(135deg, #1b5edc, #4f8cff);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.modern-plan-header {
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(200, 210, 230, 0.4);
    padding-bottom: 2rem;
}

.modern-plan-header h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 1rem;
}

.modern-plan-price {
    font-size: 3rem;
    font-weight: 800;
    color: #1a1a2e;
    line-height: 1;
    display: flex;
    align-items: flex-end;
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.modern-plan-price .currency {
    font-size: 1.5rem;
    font-weight: 600;
    color: #595b6f;
    margin-bottom: 0.5rem;
}

.modern-plan-price .period {
    font-size: 1rem;
    color: #7a859f;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.modern-plan-header p {
    color: #595b6f;
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
}

.modern-plan-features {
    flex-grow: 1;
    margin-bottom: 2.5rem;
}

.modern-plan-features ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 0;
    margin: 0;
}

.modern-plan-features li {
    color: #1a1a2e;
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modern-plan-features li svg {
    color: #4f8cff;
    flex-shrink: 0;
}

.modern-plan-action {
    display: flex;
}

.btn-full {
    width: 100%;
    margin-top: auto;
}

/* Footer Section */
.landing-footer {
    background: #0f111a;
    padding: 1.5rem 2rem;
    font-size: 0.85rem;
    border-top: 1px solid rgba(200, 210, 230, 0.1);
}

.landing-footer-inner {
    max-width: 1360px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.landing-footer-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer-brand-logo {
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
}

.footer-separator {
    color: rgba(255, 255, 255, 0.15);
}

.footer-tagline {
    color: #8c93a1;
}

.landing-footer-right {
    white-space: nowrap;
    color: #6b7280;
}

.hero {
    position: relative;
    overflow: hidden;
    text-align: center;
    padding: 4.5rem 2rem 3.6rem;
    border-radius: 34px;
    background:
        radial-gradient(circle at 20% 18%, rgba(79, 140, 255, 0.2), transparent 26%),
        radial-gradient(circle at 80% 0%, rgba(79, 140, 255, 0.18), transparent 24%),
        rgba(253, 253, 253, 0.86);
    border: 1px solid rgba(230, 232, 239, 0.9);
    box-shadow: var(--shadow-lg);
}

.hero h1 {
    font-size: clamp(2.8rem, 6vw, 4.7rem);
    margin-bottom: 1rem;
    line-height: 0.98;
    letter-spacing: -0.05em;
}

.hero h1,
.pricing-section h2 {
    background: linear-gradient(90deg, #1a1a2e 0%, #295ed9 48%, #477bff 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.06rem;
    max-width: 680px;
    margin: 0 auto 2rem;
}

.hero-actions {
    display: flex;
    gap: 0.9rem;
    justify-content: center;
    flex-wrap: wrap;
}

.features {
    padding: 2.2rem 0;
}

.feature-grid,
.plans-grid,
.stats-grid {
    display: grid;
    gap: 1.25rem;
}

.feature-grid {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.feature-card {
    border-radius: 22px;
    padding: 1.5rem;
}

.feature-card h3 {
    margin-bottom: 0.55rem;
    font-size: 1.05rem;
}

.feature-card p {
    font-size: 0.92rem;
}

.pricing-section {
    padding: 2.4rem 0 0.5rem;
    text-align: center;
}

.pricing-section h2 {
    margin-bottom: 1.8rem;
}

.plans-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.plan-card {
    border-radius: 24px;
    padding: 2rem;
    text-align: center;
}

.plan-price {
    font-size: 2.3rem;
    font-weight: 800;
    margin: 0.75rem 0;
    color: var(--text);
}

.plan-price span {
    font-size: 0.92rem;
    color: var(--text-muted);
    font-weight: 500;
}

.plan-card ul {
    list-style: none;
    margin: 1rem 0 1.3rem;
}

.plan-card li {
    padding: 0.28rem 0;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.profile-container {
    max-width: 760px;
    margin: 0 auto;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.16rem;
    padding: 0.85rem 0.95rem;
    background: var(--surface-muted);
    border-radius: 14px;
}

.info-item .label {
    font-size: 0.77rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.usage-bar-container {
    height: 10px;
    background: #ebeaf2;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 0.6rem;
}

.usage-bar {
    height: 100%;
    background: linear-gradient(90deg, #1b5edc 0%, #4f8cff 100%);
    border-radius: 999px;
    transition: width 0.3s;
}

.code-block {
    display: block;
    margin: 0.75rem 0;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 14px;
    font-size: 0.85rem;
    overflow-x: auto;
}

.text-muted,
small {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.chat-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 1.5rem;
    margin: 2rem 0;
    min-height: calc(100vh - 180px);
}

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

.chat-sidebar .card {
    margin-bottom: 0;
}

.chat-meta {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
}

.chat-meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.chat-meta-item .label {
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.chat-panel {
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    min-height: 70vh;
    overflow: hidden;
}

.chat-composer {
    border-top: 1px solid var(--border);
    padding: 1rem;
    background: rgba(255, 255, 255, 0.7);
}

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

.chat-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.85rem;
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    margin: 1.5rem 0;
}

.stat-card {
    border-radius: 20px;
    padding: 1.3rem;
    text-align: center;
}

.stat-value {
    font-size: 1.9rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.table-responsive {
    overflow-x: auto;
    margin-top: 1.5rem;
    background: rgba(253, 253, 253, 0.88);
    border: 1px solid rgba(230, 232, 239, 0.95);
    border-radius: 20px;
    box-shadow: var(--shadow-md);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.89rem;
}

.data-table th,
.data-table td {
    padding: 0.85rem 0.9rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: top;
}

.data-table th {
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.77rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(247, 247, 250, 0.9);
}

.data-table tbody tr:hover {
    background: rgba(79, 140, 255, 0.04);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.row-banned {
    opacity: 0.7;
}

.actions-cell {
    white-space: nowrap;
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
}

.badge-admin { background: var(--primary-soft); color: var(--primary); }
.badge-banned { background: var(--danger-soft); color: var(--danger); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-inactive { background: rgba(154, 157, 175, 0.18); color: var(--text-muted); }

.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

.modal {
    position: fixed;
    inset: 0;
    background: rgba(26, 26, 46, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(8px);
}

.modal-content {
    border-radius: 24px;
    padding: 2rem;
    min-width: 420px;
    max-width: 92vw;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h3 {
    margin-bottom: 1.25rem;
}

/* =========================================================================
   Admin Pages Redesign
   ========================================================================= */
.admin-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 0 2rem;
}

.admin-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.admin-page-title {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    margin: 0;
}

.admin-page-subtitle {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin: 0.25rem 0 0;
}

/* Admin stat cards */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.admin-stat-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.3rem;
}

.admin-stat-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.admin-stat-icon--primary {
    background: var(--primary-soft);
    color: var(--primary);
}

.admin-stat-icon--success {
    background: var(--success-soft);
    color: var(--success);
}

.admin-stat-icon--warning {
    background: var(--warning-soft);
    color: var(--warning);
}

.admin-stat-body {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.admin-stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.1;
}

.admin-stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

/* Admin section cards */
.admin-section-card {
    padding: 1.5rem;
}

.admin-section-head {
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.admin-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.admin-section-desc {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin: 0 0 1rem;
}

.admin-inline-form .form-group {
    margin-bottom: 0;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.admin-form-grid--5 {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

/* Admin tables */
.admin-table-card {
    padding: 0;
    overflow: hidden;
}

.admin-table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

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

.admin-table th {
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--surface-muted);
    position: sticky;
    top: 0;
}

.admin-table tbody tr:hover {
    background: rgba(79, 140, 255, 0.03);
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

.admin-table-actions-th {
    text-align: right;
    white-space: nowrap;
}

.admin-table-actions-cell {
    white-space: nowrap;
    text-align: right;
}

.admin-table-actions {
    display: inline-flex;
    white-space: nowrap;
    gap: 0.35rem;
    flex-wrap: nowrap;
    justify-content: flex-end;
    align-items: center;
}

.admin-table-actions form {
    display: inline-flex;
}

.admin-table--users .admin-table-actions-th,
.admin-table--users .admin-table-actions-cell,
.admin-table--plans .admin-table-actions-th,
.admin-table--plans .admin-table-actions-cell {
    width: 108px;
    min-width: 108px;
    max-width: 108px;
    text-align: center;
}

.admin-table--codex .admin-table-actions-th,
.admin-table--codex .admin-table-actions-cell {
    width: 156px;
    min-width: 156px;
    max-width: 156px;
    text-align: center;
}

.admin-table--users .admin-table-actions,
.admin-table--plans .admin-table-actions,
.admin-table--codex .admin-table-actions {
    width: 100%;
    justify-content: center;
}

.admin-table-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem 1rem !important;
}

.admin-row-banned {
    opacity: 0.6;
}

.admin-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.86rem;
}

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

.admin-meta {
    display: block;
    font-size: 0.75rem;
    color: var(--text-soft);
    line-height: 1.4;
}

/* User cell with avatar */
.admin-user-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-user-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.82rem;
    flex-shrink: 0;
}

.admin-user-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.admin-user-name {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.admin-user-email {
    font-size: 0.8rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Codex cell */
.admin-codex-cell {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.admin-codex-id {
    font-size: 0.78rem;
    color: var(--text-soft);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.admin-limit-cell {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

/* Admin modals */
.admin-modal {
    position: fixed;
    inset: 0;
    background: rgba(26, 26, 46, 0.32);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
    padding: 1rem;
}

.admin-modal-content {
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.75rem;
}

.admin-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.admin-modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
}

.admin-modal-close {
    width: 2rem;
    height: 2rem;
    border-radius: 10px;
    border: none;
    background: var(--surface-muted);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}

.admin-modal-close:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

/* Admin icon action buttons */
.admin-action-btn {
    width: 2rem;
    height: 2rem;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    flex-shrink: 0;
}

.admin-action-btn--outline {
    border-color: var(--border-strong);
    color: var(--text-muted);
}

.admin-action-btn--outline:hover {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: var(--primary);
}

.admin-action-btn--danger {
    color: var(--danger);
    background: var(--danger-soft);
}

.admin-action-btn--danger:hover {
    background: var(--danger);
    color: #fff;
}

.admin-action-btn--success {
    color: var(--success);
    background: var(--success-soft);
}

.admin-action-btn--success:hover {
    background: var(--success);
    color: #fff;
}

/* Admin charts */
.admin-charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

.admin-chart-card {
    padding: 1.25rem 1.5rem;
}

.admin-chart-card canvas {
    width: 100%;
    display: block;
}

@media (max-width: 980px) {
    .admin-page {
        padding-top: 3rem;
    }

    .admin-page-header {
        flex-direction: column;
        align-items: stretch;
        margin-bottom: 1rem;
    }

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

    .admin-charts-grid,
    .admin-form-grid,
    .admin-form-grid--5 {
        grid-template-columns: 1fr;
    }

    .admin-stat-card {
        padding: 1rem 1.05rem;
    }

    .admin-table-card {
        padding: 0;
        overflow: hidden;
    }

    .admin-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .admin-table-actions-cell {
        text-align: center;
    }

    .admin-table-actions {
        justify-content: center;
        overflow-x: auto;
        padding-bottom: 0.1rem;
        transform: translateX(-5px);
    }

    .admin-table--users {
        min-width: 720px;
    }

    .admin-table--plans {
        min-width: 760px;
    }

    .admin-table--codex {
        min-width: 980px;
    }

    .admin-user-cell {
        align-items: flex-start;
    }

    .admin-modal-content {
        max-width: 100%;
        padding: 1.1rem;
    }
}

@media (max-width: 640px) {
    .admin-page {
        padding-top: 3.25rem;
    }

    .admin-page-title {
        font-size: 1.35rem;
    }

    .admin-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }

    .admin-section-card,
    .admin-chart-card {
        padding: 1rem;
    }

    .admin-table-card {
        padding: 0;
    }

    .admin-user-avatar {
        width: 1.8rem;
        height: 1.8rem;
    }

    .admin-action-btn {
        width: 2.15rem;
        height: 2.15rem;
    }
}

.footer {
    margin-top: auto;
    padding: 1rem 0 0.4rem;
    color: var(--text-muted);
    text-align: left;
    font-size: 0.82rem;
}

.app-footer {
    margin-top: auto;
    width: 100%;
}

/* =========================================================================
   Auth Split Layout Redesign 
   ========================================================================= */
.auth-split-main {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    min-height: 100dvh;
    background: #fbfbfc; /* Light theme background */
}

.auth-split-wrapper {
    display: flex;
    width: 100%;
    max-width: 1100px;
    background: #ffffff;
    border-radius: 28px;
    border: 1px solid rgba(200, 210, 230, 0.4);
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(31, 42, 68, 0.06);
    min-height: 700px;
}

.auth-split-wrapper--compact {
    max-width: 560px;
    min-height: auto;
}

.auth-brand {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1a1a2e; /* Light theme text */
    margin-bottom: 2rem;
    display: inline-block;
}

.auth-split-left {
    flex: 1;
    padding: 3rem 4rem;
    display: flex;
    flex-direction: column;
}

.auth-split-form-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 380px;
    margin: 0 auto;
    width: 100%;
}

.auth-split-header {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
}

.auth-split-title-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.auth-split-icon {
    width: 48px;
    height: 48px;
    background: rgba(79, 140, 255, 0.1);
    color: #4f8cff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.auth-split-form-container h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a1a2e; /* Light theme heading */
    margin-bottom: 0.4rem;
}

.auth-split-title-row h2 {
    margin-bottom: 0;
}

.auth-split-header p {
    margin-bottom: 0;
}

.auth-split-form-container p {
    font-size: 0.95rem;
    color: #595b6f; /* Light theme text-muted */
    margin-bottom: 1.5rem;
}

.auth-split-form .floating-group label {
    font-size: 0.85rem;
    color: #595b6f; /* Light theme specific */
    margin-bottom: 0.4rem;
    display: block;
    font-weight: 500;
}

.auth-split-form input[type="email"],
.auth-split-form input[type="password"],
.auth-split-form input[type="text"] {
    background: #f9fafb; /* Light theme input bg */
    border: 1px solid rgba(200, 210, 230, 0.8);
    color: #1a1a2e; /* Light theme input text */
    border-radius: 12px;
    padding: 0.9rem 1.1rem;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.auth-split-form input:focus {
    border-color: #4f8cff;
    outline: none;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.1);
}

.auth-split-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.25rem 0 2rem;
    font-size: 0.85rem;
}

.custom-checkbox {
    display: flex;
    align-items: center;
    color: #595b6f; /* Light theme text */
    cursor: pointer;
    position: relative;
    padding-left: 24px;
    user-select: none;
}

.custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.custom-checkbox .checkmark {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 16px;
    width: 16px;
    background-color: #ffffff;
    border: 1px solid rgba(200, 210, 230, 1);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.custom-checkbox input:checked ~ .checkmark {
    background-color: #4f8cff;
    border-color: #4f8cff;
}

.custom-checkbox .checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.custom-checkbox input:checked ~ .checkmark:after {
    display: block;
}

.forgot-link {
    color: #4f8cff;
    font-weight: 500;
}

.auth-split-btn {
    padding: 0.9rem;
    font-size: 1rem;
    border-radius: 12px;
}

.auth-split-links {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.9rem;
    color: #8c93a1;
}

.auth-split-links a {
    color: #4f8cff;
    font-weight: 600;
}

.auth-split-right {
    flex: 1;
    padding: 1.5rem;
    display: flex;
}

.auth-split-graphic {
    flex: 1;
    background: linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
    border-radius: 20px;
    border: 1px solid rgba(79, 140, 255, 0.12);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-chat-demo {
    width: 100%;
    max-width: 520px;
    height: 100%;
    min-height: 560px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(79, 140, 255, 0.16);
    border-radius: 28px;
    box-shadow: 0 24px 60px rgba(64, 95, 160, 0.12);
    backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.auth-chat-header {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.35rem 0.35rem 0.9rem;
    border-bottom: 1px solid rgba(79, 140, 255, 0.08);
}

.auth-chat-avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, #4f8cff 0%, #76b1ff 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.auth-chat-meta {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
}

.auth-chat-title {
    color: #1a1a2e;
    font-size: 1rem;
    font-weight: 700;
}

.auth-chat-status {
    color: #7c879b;
    font-size: 0.85rem;
}

.auth-chat-thread {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    overflow: hidden;
    padding: 0.25rem 0.15rem;
}

.auth-chat-message {
    max-width: 86%;
    border-radius: 20px;
    padding: 0.8rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    box-shadow: 0 8px 20px rgba(44, 68, 120, 0.05);
}

.auth-chat-message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #4f8cff 0%, #6aa7ff 100%);
    color: #ffffff;
    border-bottom-right-radius: 8px;
}

.auth-chat-message.assistant {
    align-self: flex-start;
    background: #ffffff;
    color: #1a1a2e;
    border: 1px solid rgba(79, 140, 255, 0.12);
    border-bottom-left-radius: 8px;
}

.auth-chat-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.7;
}

.auth-chat-message p {
    margin: 0;
    line-height: 1.55;
}

.auth-chat-message pre {
    margin: 0;
    background: #f6f8fc;
    border-radius: 14px;
    padding: 0.9rem 1rem;
    font-size: 0.84rem;
    line-height: 1.5;
    overflow-x: auto;
}

.auth-chat-composer {
    background: #ffffff;
    border: 1px solid rgba(79, 140, 255, 0.12);
    border-radius: 18px;
    padding: 0.95rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    color: #7c879b;
    box-shadow: 0 10px 24px rgba(44, 68, 120, 0.06);
}

.auth-chat-composer-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.auth-chat-composer-icon,
.auth-chat-composer-send {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.auth-chat-composer-icon {
    background: #f2f6ff;
    border: 1px solid rgba(79, 140, 255, 0.12);
    color: #1a1a2e;
}

.auth-chat-composer-send {
    background: #1a1a2e;
    color: #ffffff;
}

@media (max-width: 1024px) {
    .landing-model-card {
        width: calc((100% - 1.5rem) / 2); /* 2 cards */
    }
}

@media (max-width: 900px) {
    .topbar {
        padding: 14px 12px 0;
    }

    .usage-meter-shell {
        top: 14px;
        right: 14px;
    }

    .usage-meter-trigger {
        width: 36px;
        height: 36px;
    }

    .usage-meter-stamina {
        width: 36px;
        height: 36px;
    }

    .usage-meter-panel {
        width: min(340px, calc(100vw - 20px));
    }

    .topbar-container {
        border-radius: 18px;
        min-height: 72px;
        padding: 1rem 1.1rem;
    }

    .chat-layout {
        grid-template-columns: 1fr;
    }

    .site-sidebar.sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(280px, 74vw);
        max-width: 280px;
        height: 100dvh;
        max-height: 100dvh;
        z-index: 80;
        box-shadow: 12px 0 32px rgba(15, 23, 42, 0.12);
        transition: transform 0.24s ease;
        border-right: 1px solid #eaeaef;
        top: 0;
        align-self: auto;
    }

    .site-sidebar.sidebar.collapsed {
        width: min(280px, 74vw);
        max-width: 280px;
        transform: translateX(calc(-100% - 12px));
    }

    .site-shell.mobile-sidebar-open .site-sidebar.sidebar {
        transform: translateX(0);
    }

    .sidebar-backdrop,
    .site-sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        border: 0;
        background: rgba(15, 23, 42, 0.22);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
        z-index: 70;
    }

    .site-shell.mobile-sidebar-open .sidebar-backdrop,
    .site-shell.mobile-sidebar-open .site-sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .mobile-sidebar-toggle,
    .site-sidebar-toggle {
        display: inline-flex;
        position: fixed;
        top: 14px;
        left: 14px;
        z-index: 65;
        width: 42px;
        height: 42px;
        border: 1px solid #e5e7eb;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.92);
        color: #1a1a2e;
        align-items: center;
        justify-content: center;
        box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
        backdrop-filter: blur(10px);
        cursor: pointer;
    }

    .landing-reference {
        padding: 1.2rem 1rem 2rem;
    }

    .landing-app-nav,
    .landing-band-intro,
    .landing-band-columns,
    .landing-stats-strip {
        grid-template-columns: 1fr;
    }

    .landing-app-nav {
        justify-items: start;
    }

    .landing-nav-links {
        justify-content: flex-start;
    }

    .landing-hero-grid {
        grid-template-columns: 1fr;
        padding-top: 2.25rem;
    }

    .landing-hero-copy {
        max-width: none;
        padding-left: 0;
    }

    .landing-hero-copy h1,
    .landing-band-intro h2,
    .stats-panel-heading h2 {
        max-width: none;
    }

    .landing-device-scene {
        min-height: 620px;
    }

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

    .landing-header-inner {
        gap: 1rem;
        padding: 0 1rem;
    }

    .landing-nav-links {
        gap: 1.5rem;
        font-size: 0.85rem;
    }

    .landing-hero-title {
        font-size: 2.5rem;
    }

    .landing-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
    }

    .landing-app-nav {
        justify-items: start;
    }

    .landing-nav-links {
        justify-content: flex-start;
    }

    .landing-hero-grid {
        grid-template-columns: 1fr;
        padding-top: 2.25rem;
    }

    .landing-hero-copy {
        max-width: none;
        padding-left: 0;
    }

    .landing-hero-copy h1,
    .landing-band-intro h2,
    .stats-panel-heading h2 {
        max-width: none;
    }

    .landing-device-scene {
        min-height: 620px;
    }

    .editorial-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .auth-split-right {
        display: none;
    }

    .auth-split-wrapper {
        min-height: auto;
        border: none;
        background: transparent;
        box-shadow: none;
    }

    .auth-split-left {
        padding: 2rem 1.5rem;
    }

    .auth-split-main {
        align-items: flex-start;
        padding-top: 4rem;
    }

    .profile-section-grid {
        grid-template-columns: 1fr;
    }

    .profile-overview-grid,
    .profile-details-grid,
    .profile-form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .site-main {
        padding-top: 3.7rem;
        padding-bottom: 2rem;
    }

    .topbar-main,
    .minimal-main {
        padding-top: 1.2rem;
    }

    .container {
        padding: 0 1rem;
    }

    .topbar-container {
        align-items: flex-start;
        flex-direction: column;
        min-height: unset;
        padding: 1rem;
    }

    .topbar .nav-links {
        width: 100%;
        justify-content: flex-start;
    }

    .hero {
        padding: 3rem 1.25rem 2.6rem;
        border-radius: 28px;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

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

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

    .landing-reference {
        padding-left: 0.7rem;
        padding-right: 0.7rem;
    }

    .landing-shell {
        border-radius: 20px;
    }

    .landing-browser-bar,
    .landing-app-nav,
    .landing-hero-grid {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .landing-notice-bar {
        margin-left: 0.8rem;
        margin-right: 0.8rem;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .landing-hero-copy h1 {
        font-size: clamp(2.4rem, 10vw, 3.5rem);
    }

    .landing-hero-copy p {
        font-size: 0.96rem;
    }

    .landing-hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .landing-hero-actions .btn {
        width: 100%;
    }

    .landing-proof-row,
    .editorial-card-grid {
        grid-template-columns: 1fr;
    }

    .landing-device-scene {
        min-height: 540px;
    }

    .device-frame {
        width: 252px;
        min-height: 510px;
    }

    .device-frame-front {
        right: 18%;
    }

    .device-frame-back {
        right: 3%;
    }

    .editorial-plan-topline {
        flex-direction: column;
        gap: 0.55rem;
    }

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

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

    .inline-form {
        flex-direction: column;
        align-items: stretch;
    }

    .inline-form .form-group {
        width: 100%;
    }

    .modal-content {
        min-width: 92vw;
        padding: 1.4rem;
    }

    .chat-bubble,
    .chat-actions {
        max-width: 100%;
    }

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

    .profile-page {
        padding-top: 1rem;
    }

    .profile-card-topline,
    .profile-usage-head,
    .profile-section-head {
        flex-direction: column;
        align-items: flex-start;
    }

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

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

    /* Landing responsive */
    .landing-header-inner {
        grid-template-columns: auto 1fr auto;
        gap: 0.5rem;
        padding: 0 1rem;
    }

    .landing-nav-links {
        gap: 1rem;
        font-size: 0.85rem;
    }

    .landing-features,
    .landing-featured-models,
    .landing-how-it-works,
    .landing-pricing-band,
    .landing-announcements {
        padding: 2rem 1rem;
    }

    .landing-hero {
        padding: 3rem 1rem 2rem;
    }

    .landing-hero-title {
        font-size: 2rem;
    }

    .landing-hero-ctas {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-lg {
        width: 100%;
    }

    .landing-stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .landing-features-grid,
    .landing-models-grid,
    .landing-steps-grid,
    .landing-announcements-grid {
        grid-template-columns: 1fr;
    }

    .landing-section-heading-row {
        align-items: start;
        flex-direction: column;
    }

    .landing-section-header h2 {
        font-size: 1.8rem;
    }

    .editorial-plan-card.featured {
        border: 1px solid rgba(200, 210, 230, 0.35);
    }

    .landing-footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 560px) {
    .site-sidebar.sidebar {
        width: min(248px, 78vw);
        max-width: 248px;
    }

    .site-sidebar.sidebar.collapsed {
        width: min(248px, 78vw);
        max-width: 248px;
    }

    .stats-grid,
    .plans-grid,
    .feature-grid {
        grid-template-columns: 1fr;
    }

    .landing-shell,
    .landing-stat-panel,
    .editorial-stats-panel,
    .editorial-info-card,
    .editorial-stat-card,
    .editorial-plan-card {
        border-radius: 18px;
    }

    .landing-browser-bar {
        grid-template-columns: 1fr;
        justify-items: start;
    }

    .browser-address {
        max-width: none;
    }

    .landing-app-nav {
        padding-top: 1rem;
    }

    .landing-nav-links {
        gap: 0.8rem;
    }

    .landing-hero-grid {
        padding-bottom: 2.2rem;
    }

    .landing-hero-copy h1 {
        font-size: 2rem;
    }

    .landing-band-intro h2,
    .stats-panel-heading h2 {
        font-size: 1.7rem;
    }

    .landing-device-scene {
        min-height: 470px;
    }

    .device-frame {
        width: 208px;
        min-height: 420px;
        border-radius: 32px;
        padding: 0.85rem 0.75rem 0.95rem;
    }

    .device-frame-front {
        right: 22%;
    }

    .device-frame-back {
        right: 2%;
        top: 20px;
    }

    .device-schedule-row {
        grid-template-columns: 1fr;
    }

    .editorial-plan-price {
        font-size: 1.7rem;
    }

    /* Landing responsive */
    .landing-header-inner {
        grid-template-columns: auto 1fr auto;
        gap: 0.25rem;
        padding: 0 0.75rem;
    }

    .landing-nav-links {
        gap: 0.5rem;
        font-size: 0.75rem;
    }

    .landing-nav-link-button {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
    }

    .landing-hero {
        padding: 2rem 1rem;
    }

    .landing-hero-title {
        font-size: 1.6rem;
    }

    .landing-hero-description {
        font-size: 0.95rem;
    }

    .landing-stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding-top: 1rem;
        margin-top: 1rem;
    }

    .landing-stat-label {
        font-size: 0.75rem;
    }

    .landing-stat-value {
        font-size: 1.5rem;
    }

    .landing-features,
    .landing-featured-models,
    .landing-how-it-works,
    .landing-pricing-band,
    .landing-announcements {
        padding: 1.5rem 1rem;
    }

    .landing-section-header h2 {
        font-size: 1.4rem;
    }

    .landing-section-header p {
        font-size: 0.9rem;
    }

    .landing-features-grid,
    .landing-models-carousel,
    .landing-steps-grid,
    .landing-announcements-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .landing-model-card {
        width: calc(100% - 1rem); /* mostly 1 card on mobile */
    }

    .landing-model-meta {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .social-visual {
        flex-wrap: wrap;
    }

    .landing-step-number {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .editorial-plan-card.featured {
        border: 1px solid rgba(200, 210, 230, 0.35);
        box-shadow: none;
    }

    .editorial-plan-price {
        font-size: 1.8rem;
    }

    .landing-footer {
        padding: 1.5rem;
    }

    .landing-footer-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .landing-footer-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .footer-separator {
        display: none;
    }

    .auth-container,
    .card,
    .plan-card,
    .feature-card,
    .stat-card {
        border-radius: 18px;
    }

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

    .form-actions .btn {
        width: 100%;
    }
}
