/* ============================================
   Page Specific Styles (404, Login, Dashboard, Legal)
   ============================================ */

/* 404 Error Page */
.error-page {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}
.error-code {
    font-size: clamp(6rem, 20vw, 12rem);
    font-weight: 800;
    line-height: 1;
    margin-bottom: 1rem;
    letter-spacing: -0.05em;
}
.error-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}
.error-message {
    color: var(--color-text-muted);
    margin-bottom: 2rem;
    max-width: 400px;
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.login-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.login-card {
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
}
.login-header {
    text-align: center;
    margin-bottom: 2rem;
}
.login-title {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}
.login-subtitle {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}
.login-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.login-divider {
    margin: 1.5rem 0;
}
.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}
.login-footer a {
    font-weight: 600;
}
#error-message {
    display: none;
    margin-bottom: 1rem;
}

/* ============================================
   Dashboard App Shell
   Design language matched to the main sign-in
   page (index.html): soft gray canvas, white
   surfaces, 1px hairline borders, square
   corners, muted slate text.
   ============================================ */
.dash-shell,
.dash-auth-gate {
    --d-50: #f9fafb;
    --d-100: #f3f4f6;
    --d-200: #e5e7eb;
    --d-300: #d1d5db;
    --d-400: #9ca3af;
    --d-500: #6b7280;
    --d-900: #111827;
}

.dash-auth-gate {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: var(--d-100);
}

.dash-auth-card {
    width: 100%;
    max-width: 340px;
    padding: 2.25rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(229, 231, 235, 0.8);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.dash-auth-card h2 {
    font-size: 25px;
    font-weight: 500;
    letter-spacing: -0.025em;
    color: var(--d-900);
    margin-bottom: 0.5rem;
}

.dash-auth-card p {
    font-size: 13.5px;
    color: var(--d-500);
}

.dash-shell {
    display: flex;
    min-height: 100vh;
    background: var(--d-100);
    color: var(--d-900);
}

/* ── Desktop Left Sidebar ─────────────────────── */
.dash-sidebar {
    width: 240px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-right: 1px solid var(--d-200);
    background: var(--color-white);
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 1.25rem 1rem;
    z-index: 50;
    box-sizing: border-box;
}

.dash-sidebar__top {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.dash-sidebar__brand-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    transition: opacity 150ms ease;
}

.dash-sidebar__brand-link:hover {
    opacity: 0.85;
}

.dash-sidebar__logo-wrap {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dash-sidebar__logo-wrap svg {
    width: 100%;
    height: 100%;
}

.dash-sidebar__brand-meta {
    display: flex;
    flex-direction: column;
}

.dash-sidebar__brand-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--d-900);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.dash-sidebar__brand-tag {
    font-size: 11px;
    font-weight: 500;
    color: var(--d-500);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* Nav Menu */
.dash-sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.dash-nav-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid transparent;
    background: transparent;
    color: var(--d-500);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

.dash-nav-btn:hover {
    color: var(--d-900);
    background: var(--d-50);
}

.dash-nav-btn.is-active {
    color: var(--d-900);
    background: var(--d-100);
    font-weight: 600;
    border-color: rgba(209, 213, 219, 0.6);
}

.dash-nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.dash-nav-label {
    flex: 1;
}

/* User mini chip at bottom of sidebar */
.dash-sidebar__bottom {
    padding-top: 1rem;
    border-top: 1px solid var(--d-200);
}

.dash-user-chip {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.6rem;
    cursor: pointer;
    transition: background-color 120ms ease;
}

.dash-user-chip:hover {
    background: var(--d-100);
}

.dash-user-chip__avatar {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, #111827 0%, #374151 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dash-user-chip__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.dash-user-chip__name {
    font-size: 13px;
    font-weight: 600;
    color: var(--d-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-user-chip__email {
    font-size: 11px;
    color: var(--d-400);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Mobile Floating Bottom Dock ─────────────── */
.dash-dock {
    display: none; /* hidden on desktop view */
}

/* ── Content area ──────────────────────────── */
.dash-content {
    flex: 1;
    min-width: 0;
    padding: 2.5rem clamp(1.25rem, 4vw, 3.5rem);
}

.dash-view {
    display: none;
    max-width: 880px;
    margin: 0 auto;
}

.dash-view.is-active {
    display: block;
    animation: dashViewIn 0.22s ease;
}

@keyframes dashViewIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dash-view-head {
    margin-bottom: 2rem;
}

.dash-view-title {
    font-size: 25px;
    font-weight: 500;
    letter-spacing: -0.025em;
    color: var(--d-900);
    margin-bottom: 0.35rem;
}

.dash-view-sub {
    color: var(--d-500);
    font-size: 13.5px;
    margin: 0;
}

.dash-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--d-900);
    margin-bottom: 0.75rem;
}

.dash-section-title--spaced {
    margin-top: 2rem;
}

/* ── Home view ─────────────────────────────── */
.dash-home {
    min-height: 100%;
}


.dash-home-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 500;
    letter-spacing: -0.025em;
    color: var(--d-300);
    text-transform: lowercase;
    margin: 0;
}

/* ── Apps view ─────────────────────────────── */
.app-box {
    border: 1px solid var(--d-200);
    background: var(--color-white);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}

.app-box--unavailable {
    border-style: dashed;
    border-color: var(--d-300);
    background: var(--d-50);
    box-shadow: none;
}

.app-box__header {
    margin-bottom: 1.25rem;
}

.app-box__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--d-900);
    margin: 0 0 0.25rem;
}

.app-box__sub {
    color: var(--d-500);
    font-size: 12.5px;
    margin: 0;
}

.app-box__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.app-box__empty {
    display: flex;
    justify-content: flex-start;
}

.app-item {
    border: 1px solid var(--d-200);
    background: var(--d-50);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
    transition: border-color 150ms ease, background-color 150ms ease;
}

.app-item:hover {
    border-color: var(--d-300);
    background: var(--color-white);
}

.app-item--unavailable {
    border-style: dashed;
    opacity: 0.8;
}

.app-item__logo {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    object-fit: contain;
}

.app-item__logo--placeholder {
    border: 1px solid var(--d-200);
    background: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--d-400);
}

.app-item__logo--placeholder svg {
    width: 20px;
    height: 20px;
}

.app-item__info {
    flex: 1;
    min-width: 0;
}

.app-item__name {
    font-weight: 500;
    font-size: 13.5px;
    color: var(--d-900);
}

.app-item__desc {
    color: var(--d-500);
    font-size: 12px;
    margin-top: 2px;
}

.app-item__side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    flex-shrink: 0;
}

.app-badge {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 9px;
    border: 1px solid var(--d-200);
}

.app-badge--unavailable {
    background: var(--d-100);
    border-color: var(--d-200);
    color: var(--d-500);
}

.dash-logout-link {
    font-size: 12px;
    font-weight: 500;
    color: var(--d-900);
    background: var(--color-white);
    border: 1px solid var(--d-200);
    padding: 4px 10px;
    transition: background-color 150ms ease, border-color 150ms ease;
    display: inline-block;
}

.dash-logout-link:hover {
    background: #fafafa;
    border-color: #a3a3a3;
    opacity: 1;
}

.dash-placeholder {
    border: 1px dashed var(--d-300);
    background: var(--d-50);
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--d-500);
    font-size: 13.5px;
}

.dash-placeholder p {
    margin: 0;
}

/* ── Profile view ──────────────────────────── */
.profile-card {
    border: 1px solid var(--d-200);
    background: var(--color-white);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    padding: 1.75rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.profile-card__info {
    flex: 1;
    min-width: 0;
}

.profile-card__name {
    font-size: 25px;
    font-weight: 500;
    letter-spacing: -0.025em;
    color: var(--d-900);
    margin: 0 0 0.15rem;
}

.profile-card__email {
    color: var(--d-500);
    font-size: 13.5px;
    margin: 0 0 0.35rem;
}

.pfp-avatar-badge {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #111827 0%, #374151 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    user-select: none;
    flex-shrink: 0;
}

/* ── Pricing & Credits View ──────────────────────────── */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.pricing-card {
    border: 1px solid var(--d-200);
    background: var(--color-white);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.pricing-card--highlight {
    border-color: #111827;
    position: relative;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.pricing-card__badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #111827;
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pricing-card__title {
    font-size: 18px;
    font-weight: 600;
    color: var(--d-900);
    margin: 0 0 0.25rem;
}

.pricing-card__sub {
    font-size: 13px;
    color: var(--d-500);
    margin: 0 0 1.25rem;
}

.pricing-stat {
    font-size: 32px;
    font-weight: 700;
    color: var(--d-900);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.pricing-stat span {
    font-size: 14px;
    font-weight: 400;
    color: var(--d-500);
}

.pricing-list {
    list-style: none;
    padding: 0;
    margin: 1.25rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    font-size: 13px;
    color: var(--d-700);
}

.pricing-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pricing-list li svg {
    flex-shrink: 0;
    color: #16a34a;
}

.redeem-box {
    border: 1px solid var(--d-200);
    background: var(--color-white);
    padding: 1.75rem;
    margin-bottom: 2rem;
}

.redeem-box__title {
    font-size: 17px;
    font-weight: 600;
    margin: 0 0 0.35rem;
    color: var(--d-900);
}

.redeem-box__sub {
    font-size: 13px;
    color: var(--d-500);
    margin: 0 0 1.25rem;
}

.redeem-form {
    display: flex;
    gap: 0.75rem;
    max-width: 480px;
}

.redeem-input {
    flex: 1;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--d-300);
    font-size: 14px;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    color: var(--d-900);
    background: #fafafa;
    transition: all 0.15s ease;
}

.redeem-input:focus {
    outline: none;
    border-color: #111827;
    background: #ffffff;
}

.redeem-msg {
    margin-top: 0.85rem;
    font-size: 13px;
    display: none;
    padding: 0.6rem 0.85rem;
}

.redeem-msg.success {
    display: block;
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.redeem-msg.error {
    display: block;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.history-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--d-200);
    background: var(--color-white);
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.history-table th {
    background: #f9fafb;
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: var(--d-600);
    border-bottom: 1px solid var(--d-200);
}

.history-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--d-100);
    color: var(--d-800);
}

.pulse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    margin-right: 4px;
    animation: pulseGlow 1.8s infinite;
}

@keyframes pulseGlow {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 6px #22c55e; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

/* ── Scoped base-component restyle ─────────── */
.dash-shell .card,
.dash-auth-gate .card {
    border: 1px solid var(--d-200);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    background: var(--color-white);
}

.dash-shell .btn,
.dash-auth-gate .btn {
    border: 1px solid var(--d-200);
    background: var(--color-white);
    color: var(--d-900);
    font-weight: 500;
    font-size: 13.5px;
    padding: 10px 16px;
}

.dash-shell .btn:hover,
.dash-auth-gate .btn:hover {
    background: #fafafa;
    border-color: #a3a3a3;
    opacity: 1;
}

.dash-shell .btn-primary,
.dash-auth-gate .btn-primary {
    background: var(--d-900);
    border-color: var(--d-900);
    color: var(--color-white);
}

.dash-shell .btn-primary:hover,
.dash-auth-gate .btn-primary:hover {
    background: #1f2937;
}

.dash-shell .badge {
    border: 1px solid var(--d-200);
    background: var(--d-50);
    color: var(--d-500);
    font-weight: 500;
}

.dash-shell .badge-success {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.25);
    color: #16a34a;
}

/* ── Linked accounts & providers ───────────── */
.account-card {
    margin-bottom: 1rem;
    padding: 1.25rem 1.5rem;
}
.account-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    gap: 1rem;
    flex-wrap: wrap;
}
.account-info {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}
.provider-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--d-200);
    background: var(--color-white);
    flex-shrink: 0;
}
.provider-icon svg {
    width: 22px;
    height: 22px;
}
.provider-name {
    font-weight: 500;
    font-size: 13.5px;
    color: var(--d-900);
    margin-bottom: 0.15rem;
}
.provider-email {
    color: var(--d-500);
    font-size: 12.5px;
}
.linked-date {
    color: var(--d-500);
    font-size: 12px;
}
.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}
.link-card {
    padding: 1.25rem 1.5rem;
}
.link-card h4 {
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 0.25rem;
}
.link-card p {
    color: var(--d-500);
    font-size: 12.5px;
    margin-bottom: 0.75rem;
}
.not-linked {
    border-style: dashed;
    background: var(--d-50);
    box-shadow: none;
}
.not-linked .provider-icon {
    background: var(--color-white);
}
.signout-btn {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--d-200);
    text-align: center;
}

/* ============================================
   Profile Picture
   ============================================ */
.pfp-current-wrap {
    position: relative;
    flex-shrink: 0;
}

.pfp-current {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid var(--d-200);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--d-100);
}

.pfp-current svg {
    width: 100%;
    height: 100%;
}

.pfp-status-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--color-white);
    background: var(--d-400);
    transition: background 150ms ease;
}

.pfp-section-sub {
    font-size: 12.5px;
    color: var(--d-500);
    margin: 0;
}

/* ============================================
   App login status badges
   ============================================ */
.studio-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.74rem;
    font-weight: 600;
    padding: 3px 9px 3px 7px;
    white-space: nowrap;
}

.studio-status-loggedin {
    background: rgba(34, 197, 94, 0.12);
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.studio-status-loggedout {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.studio-status-idle {
    background: rgba(107, 114, 128, 0.1);
    color: var(--color-text-muted);
    border: 1px solid rgba(107, 114, 128, 0.2);
}

/* ============================================
   Dashboard Modern Components
   ============================================ */

/* Home Hero & Metrics */
.dash-welcome-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--d-200);
}

.dash-welcome-hero__text {
    flex: 1;
    min-width: 260px;
}

.dash-welcome-hero__pill {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--d-500);
    background: var(--d-100);
    padding: 3px 8px;
    margin-bottom: 0.5rem;
}

/* CrumAtlas launch button in home hero */
.btn-crumatlas {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    height: 34px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    background: #111827;
    color: #fff;
    border: 1px solid #111827;
    cursor: pointer;
    transition: background-color 120ms ease, border-color 120ms ease;
    white-space: nowrap;
}

.btn-crumatlas:hover {
    background: #1f2937;
    border-color: #1f2937;
}

.dash-welcome-hero__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dash-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.dash-metric-card {
    border: 1px solid var(--d-200);
    background: var(--color-white);
    padding: 1.25rem 1.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
}

.dash-metric-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.dash-metric-card__label {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--d-500);
}

.dash-metric-card__val {
    font-size: 26px;
    font-weight: 700;
    color: var(--d-900);
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.dash-metric-card__sub {
    font-size: 12px;
    color: var(--d-400);
}

.dash-metric-card__icon-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
}

/* Studio "Coming Soon" */
.studio-coming-soon-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--d-200);
    background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
    padding: 2.5rem 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.studio-coming-soon-glow {
    position: absolute;
    top: -60px;
    right: -60px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(244, 63, 94, 0.08) 60%, transparent 100%);
    filter: blur(30px);
    pointer-events: none;
}

.studio-coming-soon-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #4f46e5;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 1.25rem;
}

.studio-coming-soon-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--d-900);
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
}

.studio-coming-soon-desc {
    color: var(--d-500);
    font-size: 14px;
    line-height: 1.6;
    max-width: 680px;
    margin-bottom: 2rem;
}

.studio-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.studio-preview-item {
    border: 1px solid var(--d-200);
    background: var(--color-white);
    padding: 1.25rem;
    transition: transform 150ms ease, border-color 150ms ease;
}

.studio-preview-item:hover {
    transform: translateY(-2px);
    border-color: var(--d-300);
}

.studio-preview-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--d-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--d-900);
    margin-bottom: 0.75rem;
}

.studio-preview-icon svg {
    width: 20px;
    height: 20px;
}

.studio-preview-item h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--d-900);
    margin: 0 0 0.25rem;
}

.studio-preview-item p {
    font-size: 12.5px;
    color: var(--d-500);
    margin: 0;
    line-height: 1.5;
}

.studio-coming-soon-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--d-200);
    font-size: 13px;
    color: var(--d-400);
}

/* Usage Card & Token Gauge */
.usage-card {
    border: 1px solid var(--d-200);
    background: var(--color-white);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    padding: 1.75rem;
}

.usage-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.usage-card__badge-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--d-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--d-900);
}

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

.usage-card__title {
    font-size: 17px;
    font-weight: 600;
    color: var(--d-900);
    margin: 0 0 0.15rem;
}

.usage-card__sub {
    font-size: 12.5px;
    color: var(--d-500);
    margin: 0;
}

.usage-meter-box {
    background: var(--d-50);
    border: 1px solid var(--d-200);
    padding: 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.usage-meter-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.usage-meter-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--d-900);
}

.usage-meter-numbers {
    font-size: 18px;
    font-weight: 700;
    color: var(--d-900);
    font-family: monospace;
}

.usage-progress-track {
    width: 100%;
    height: 10px;
    background: var(--d-200);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.usage-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    border-radius: 999px;
    transition: width 400ms cubic-bezier(0.16, 1, 0.3, 1), background-color 200ms ease;
}

.usage-progress-bar.warning {
    background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
}

.usage-progress-bar.danger {
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

.usage-meter-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.6rem;
    font-size: 12px;
    color: var(--d-500);
}

.usage-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.usage-stat-box {
    border: 1px solid var(--d-200);
    background: var(--d-50);
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.usage-stat-box__title {
    font-size: 11.5px;
    color: var(--d-500);
    margin-bottom: 0.35rem;
}

.usage-stat-box__val {
    font-size: 20px;
    font-weight: 700;
    color: var(--d-900);
    line-height: 1.2;
}

.usage-stat-box__desc {
    font-size: 11px;
    color: var(--d-400);
    margin-top: 0.2rem;
}

.usage-web-banner {
    background: linear-gradient(135deg, #f0fdf4 0%, #f8fafc 100%);
    border: 1px solid #bbf7d0;
    padding: 1.5rem;
    border-radius: 8px;
}

.usage-web-banner h3 {
    font-size: 15px;
    font-weight: 600;
    color: #166534;
    margin: 0 0 0.5rem;
}

.usage-web-banner p {
    font-size: 13px;
    color: #15803d;
    line-height: 1.6;
    margin: 0;
}

/* Profile Login Method Badge */
.login-method-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--d-100);
    color: var(--d-900);
    border: 1px solid var(--d-200);
}

.login-method-badge svg {
    width: 14px;
    height: 14px;
}

/* Settings Controls */
.settings-card {
    border: 1px solid var(--d-200);
    background: var(--color-white);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.settings-card__header {
    margin-bottom: 1.25rem;
}

.settings-card__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--d-900);
    margin: 0 0 0.25rem;
}

.settings-card__sub {
    font-size: 12.5px;
    color: var(--d-500);
    margin: 0;
}

.settings-theme-selector {
    display: inline-flex;
    background: var(--d-100);
    padding: 4px;
    border-radius: 8px;
    gap: 4px;
}

.theme-choice-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--d-500);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 150ms ease;
}

.theme-choice-btn:hover {
    color: var(--d-900);
}

.theme-choice-btn.is-active {
    background: var(--color-white);
    color: var(--d-900);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-weight: 600;
}

.settings-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--d-100);
}

.settings-toggle-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.settings-toggle-label {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--d-900);
}

.settings-toggle-desc {
    font-size: 12px;
    color: var(--d-500);
}

/* Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: var(--d-300);
    transition: 0.2s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.2s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #111827;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* ============================================
   Dashboard responsive (Mobile Dock & Layout)
   ============================================ */
@media (max-width: 768px) {
    .dash-sidebar {
        display: none !important;
    }

    .dash-dock {
        display: flex !important;
        position: fixed;
        bottom: 1rem;
        left: 50%;
        transform: translateX(-50%);
        z-index: 999;
        background: rgba(255, 255, 255, 0.92);
        -webkit-backdrop-filter: blur(20px);
        backdrop-filter: blur(20px);
        border: 1px solid rgba(229, 231, 235, 0.9);
        box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.16), 0 0 0 1px rgba(0, 0, 0, 0.04);
        padding: 6px 8px;
        gap: 2px;
        align-items: center;
        justify-content: space-around;
        width: calc(100vw - 24px);
        max-width: 440px;
        box-sizing: border-box;
    }

    .dash-dock__item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 6px 8px;
        color: var(--d-400);
        background: transparent;
        border: none;
        cursor: pointer;
        transition: color 120ms ease, background-color 120ms ease;
        flex: 1;
        min-width: 0;
    }

    .dash-dock__item:hover {
        color: var(--d-900);
    }

    .dash-dock__item.is-active {
        color: var(--d-900);
        background: rgba(17, 24, 39, 0.08);
    }

    .dash-dock__item svg {
        width: 20px;
        height: 20px;
    }

    .dash-dock__label {
        font-size: 10px;
        font-weight: 600;
        margin-top: 2px;
        letter-spacing: -0.01em;
        white-space: nowrap;
    }

    .dash-content {
        padding: 1.5rem 1rem 6.5rem 1rem !important;
    }

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

    .dash-welcome-hero__actions {
        width: 100%;
    }

    .dash-welcome-hero__actions .btn {
        flex: 1;
        text-align: center;
    }

    .dash-metrics-grid {
        grid-template-columns: 1fr;
    }

    .app-box {
        padding: 1.25rem;
    }

    .app-box__grid {
        grid-template-columns: 1fr;
    }

    .app-item {
        flex-wrap: wrap;
    }

    .app-item__side {
        width: 100%;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .profile-card {
        padding: 1.25rem;
        gap: 1rem;
    }
}


/* Loading Overlay & Spinner (matched to index.html) */
#loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
}
#loading-overlay.active {
    display: flex;
}
.spinner {
    width: 28px;
    height: 28px;
    border: 2.5px solid #e5e7eb;
    border-top-color: #111827;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
#loading-text {
    color: #6b7280;
    font-size: 13.5px;
    font-weight: 500;
    margin: 0;
}

/* Legal Pages (Privacy & Terms) */
.legal-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.legal-main {
    flex: 1;
    padding: 3rem 0;
}
.legal-container {
    max-width: 800px;
}
.legal-header {
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 1.5rem;
}
.legal-title {
    font-size: 2.25rem;
    margin-bottom: 0.5rem;
}
.legal-updated {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}
.legal-content h2 {
    font-size: 1.35rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}
.legal-content p,
.legal-content ul {
    color: var(--color-text-muted);
    line-height: 1.7;
    margin-bottom: 1rem;
    font-size: var(--font-size-base);
}
.legal-content ul {
    padding-left: 1.5rem;
}
.legal-content li {
    margin-bottom: 0.5rem;
}
