﻿/* Account surfaces share Whalia's blue/lilac palette and reading font. */
.account-nav,.account-modal,.account-profile,.account-toast,.account-panel { font-family:var(--global-font-family,'StudyBuddy Lexend',sans-serif);color:var(--ink,#1f2a37);box-sizing:border-box }
.account-nav button,.account-modal button,.account-profile button,.account-panel button,.account-input {font:inherit;cursor:pointer}
.account-nav {position:relative;flex-shrink:0}
.account-login-btn,.account-primary {border:0;border-radius:12px;padding:11px 20px;font-weight:700;color:white;background:linear-gradient(90deg,#5aa6e8,#b07cd8,#5aa6e8);background-size:200% 100%;box-shadow:0 6px 16px #7a82dc33;transition:background-position .2s,transform .2s}
.account-login-btn:hover,.account-primary:hover {background-position:100% 0;transform:translateY(-1px)}
.account-modal {position:fixed;inset:0;width:min(460px,calc(100vw - 32px));max-height:calc(100dvh - 32px);margin:auto;border:1px solid #e3e9f0;border-radius:26px;padding:30px;background:linear-gradient(160deg,#f4f9ff 0%,#fff 35%,#fff 80%,#faf4ff 100%);box-shadow:0 24px 80px #243e6440;overflow:auto}
.account-modal {transform:translateZ(0)} /* keeps the "check your email" layer inside the popup */
.account-modal::backdrop {background:#1f2a3766;backdrop-filter:blur(5px)}
.account-modal-close {position:absolute;top:14px;right:14px;display:grid;place-items:center;width:34px;height:34px;border:0;border-radius:50%;background:#eaf1f7;color:#53667a;font-size:22px}
.account-panel {width:100%;text-align:center}
.account-sabi {display:block;width:92px;height:92px;object-fit:contain;margin:0 auto 12px;filter:drop-shadow(0 8px 12px #8ca2bb26)}
.account-heading {margin:0 0 10px;font-size:26px;line-height:1.35;font-weight:700;letter-spacing:-.6px}
.account-intro {color:#62758a;font-size:14px;line-height:1.8;margin:0 auto 22px;max-width:36ch}
.account-tabs {display:flex;gap:5px;padding:5px;background:#edf3fa;border-radius:13px;margin:0 0 22px}
.account-tab {flex:1;border:0;border-radius:10px;background:transparent;color:#61748b;padding:10px 8px;font-size:14px;font-weight:700}
.account-tab.is-active {background:white;color:#405c8c;box-shadow:0 2px 8px #1f2a3710}
.account-form {display:grid;gap:16px;text-align:left}
.account-field {display:grid;gap:7px;font-size:13px;font-weight:700;color:#3a5068}
.account-input {width:100%;box-sizing:border-box;cursor:text;border:1px solid #dbe4ef;border-radius:12px;padding:13px 14px;background:#fff;color:#1f2a37;outline:none;transition:border-color .15s,box-shadow .15s;min-width:0}
.account-input:focus {border-color:#8c9de2;box-shadow:0 0 0 3px #dfe8ff}
.account-primary {display:inline-flex;justify-content:center;align-items:center;gap:8px;min-height:44px;text-decoration:none}
.account-form .account-primary {width:100%;margin-top:4px}
.account-secondary {border:1px solid #dce5f0;background:#f4f8fc;border-radius:12px;padding:11px 18px;color:#40566d;font-weight:700;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;gap:8px}
.account-link {display:inline-block;border:0;background:none;color:#627bb4;font-size:13px;padding:14px 4px;text-decoration:underline;text-underline-offset:4px}
.account-status {font-size:14px;line-height:1.7;border-radius:12px;padding:12px 14px;margin:16px 0 0;background:#edf4ff;color:#476185;text-align:left}
.account-status:empty {display:none}.account-status.is-error {background:#fff1f0;color:#a54949}.account-status.is-success,.account-success {background:#eaf7ef;color:#367254;border:1px solid #d2ebdc;border-radius:16px;padding:18px;line-height:1.7}
.account-success {margin:18px 0}.account-success h3 {margin:0 0 8px}
.account-avatar {display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;flex-shrink:0;border-radius:50%;background:linear-gradient(135deg,#e0efff,#efe0fa);color:#6477af;object-fit:cover;border:2px solid #fff;box-shadow:0 2px 7px #52689918}
.account-avatar svg {width:22px;height:22px;stroke:currentColor;fill:none;stroke-width:1.8}
.account-profile-menu>button {display:flex;align-items:center;gap:8px;border:1px solid #e3e9f0;background:#f6f9fd;border-radius:30px;padding:4px 12px 4px 4px;font-size:13px;font-weight:700;color:#40566d;max-width:190px}
.account-profile-menu>button span {overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.account-dropdown {position:absolute;top:calc(100% + 12px);left:0;z-index:60;width:228px;padding:8px;background:white;border:1px solid #e3e9f0;border-radius:17px;box-shadow:0 12px 40px #263c6029;text-align:left}
.account-dropdown a,.account-dropdown button {display:block;box-sizing:border-box;width:100%;padding:12px;border:0;border-radius:10px;background:transparent;color:#40566d;text-align:left;font:inherit;font-size:14px;text-decoration:none}
.account-dropdown a:hover,.account-dropdown button:hover {background:#edf4ff}
.account-dropdown button:last-child {color:#a75767;border-top:1px solid #edf1f6;border-radius:0 0 10px 10px}
.account-toast {position:fixed;top:76px;left:50%;transform:translateX(-50%);z-index:1000;padding:14px 22px;border:1px solid #cfe7d8;border-radius:16px;background:#f0faf4;color:#367254;box-shadow:0 8px 28px #284b3920;max-width:calc(100vw - 40px);font-size:14px;text-align:center}
.account-profile {width:min(920px,calc(100% - 40px));margin:48px auto 80px}
.account-profile>.account-panel {text-align:left;background:white;border:1px solid #e0e8f2;border-radius:24px;padding:32px;box-shadow:0 12px 40px #405d8010}
.account-profile .account-sabi {width:100px;height:100px}.account-profile .account-heading,.account-profile .account-intro {text-align:center}
.account-profile-details {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;background:#f5f8fc;border:1px solid #e3e9f0;border-radius:16px;padding:22px;margin:24px 0}
.account-profile-details dt {font-size:12px;color:#76879c;margin-bottom:7px}.account-profile-details dd {margin:0;color:#354d69;overflow-wrap:anywhere;font-size:15px}
.account-usage {text-align:left;padding:22px;border:1px solid #dfdff3;background:linear-gradient(135deg,#f0f7ff,#faf4ff);border-radius:18px;margin:22px 0}
.account-usage h3 {margin:0 0 18px;font-size:17px}.account-progress {width:100%;height:10px;border:0;border-radius:20px;overflow:hidden;accent-color:#8b94d7;background:#e2e7f2}
.account-progress::-webkit-progress-bar {background:#e2e7f2;border-radius:20px}.account-progress::-webkit-progress-value {background:linear-gradient(90deg,#5aa6e8,#b07cd8);border-radius:20px}
.account-usage-meta {display:flex;justify-content:space-between;flex-wrap:wrap;gap:12px;font-size:13px;color:#687b92;line-height:1.7;margin-top:14px}.account-usage-meta strong {color:#405a80}
.account-panel button:disabled {opacity:.6;cursor:wait;transform:none}.account-nav :focus-visible,.account-panel :focus-visible,.account-modal-close:focus-visible {outline:3px solid #b4c8f0;outline-offset:3px}
@media(max-width:700px){.account-modal{padding:26px 22px}.account-heading{font-size:24px}.account-profile{margin-top:24px}.account-profile>.account-panel{padding:24px 18px}.account-profile-details{grid-template-columns:1fr;padding:18px}.account-login-btn{padding:9px 12px;font-size:13px}.account-profile-menu>button{max-width:112px}.account-profile-menu>button>span{display:none}.account-profile-menu>button{padding-right:5px}.app-bar{gap:6px}.account-profile-menu .account-dropdown{left:0}}
@media(prefers-reduced-motion:reduce){.account-login-btn,.account-primary{transition:none}}
.account-avatar-fallback {stroke:currentColor;stroke-width:1.6;padding:6px;box-sizing:border-box}
.account-dropdown-name {display:block;padding:10px 12px 8px;color:#8390a3;font-size:12px;font-weight:700;border-bottom:1px solid #edf1f6;margin-bottom:4px}
.account-guest-note {margin:4px 0 0;font-size:12px;color:#8a96a7;line-height:1.8}
.account-success-mark {display:grid;place-items:center;margin:20px auto;width:56px;height:56px;border-radius:50%;background:#d9efe2;font-size:30px;color:#448461}
.account-usage-title {display:flex;align-items:center;justify-content:space-between;gap:12px}.account-usage-title h3 {margin:0}.account-usage-title>span {font-size:11px;background:#e9e8f9;color:#7c77a9;padding:5px 9px;border-radius:20px;white-space:nowrap}
.account-usage-remaining {font-size:13px;color:#7b89a0;margin:22px 0 18px}.account-usage-remaining strong {display:block;font-size:36px;letter-spacing:-1.5px;line-height:1.35;color:#435d86;margin-bottom:2px}
.account-profile-page>.account-profile {box-sizing:border-box;background:white;border:1px solid #e0e8f2;border-radius:24px;padding:36px;box-shadow:0 12px 40px #405d8010}
.account-profile-header {display:flex;align-items:center;gap:18px;padding-bottom:6px}.account-profile-header .account-avatar {width:68px;height:68px}.account-profile-header .account-heading {text-align:left;margin:0;font-size:28px}.account-eyebrow {font-size:12px;color:#8b80ae;margin:0 0 7px}.account-verification {color:#4e8969!important}
.account-profile-page .account-profile-details {grid-template-columns:1fr 1.6fr 1fr}.account-profile-page>.account-profile>.account-primary {display:flex;width:max-content;margin:auto}
@media(max-width:700px){.account-profile-page>.account-profile{padding:24px 20px}.account-profile-page .account-profile-details{grid-template-columns:1fr}.account-profile-header .account-heading{font-size:24px}.account-usage-title{align-items:flex-start}.account-usage-title h3{font-size:15px}.account-usage{padding:18px}}
.app-bar a.app-brand {text-decoration:none;color:inherit}
.account-nav.is-signed-in {margin-left:auto}
.account-nav.is-signed-in .account-dropdown {left:auto;right:0}
.account-menu-toggle,.account-mobile-menu {display:none}
@media(max-width:700px){
 .lp-barnav>.account-nav,#appNav>.account-nav,.account-mobile-menu>.account-nav {width:100%;margin:8px 0 0!important;padding-top:12px;border-top:1px solid #e3e9f0}
 .lp-barnav .account-login-btn,#appNav .account-login-btn,.account-mobile-menu .account-login-btn {width:100%;padding:12px 16px;font-size:15px}
 .lp-barnav .account-profile-toggle,#appNav .account-profile-toggle,.account-mobile-menu .account-profile-toggle {width:100%;max-width:none;border-radius:12px;padding:8px;justify-content:flex-start}
 .lp-barnav .account-profile-toggle>span,#appNav .account-profile-toggle>span,.account-mobile-menu .account-profile-toggle>span {display:inline}
 .account-nav .account-dropdown {position:static;width:100%;box-shadow:none;margin-top:6px;box-sizing:border-box}
 .account-nav .account-dropdown-name {display:none}
 body[data-screen="start"] .account-menu-toggle,body[data-screen="sessions"] .account-menu-toggle,body[data-screen="profile"] .account-menu-toggle {display:inline-flex}
 .account-mobile-menu.is-open {display:block;position:fixed;top:64px;left:8px;right:8px;padding:12px;background:white;border:1px solid #e3e9f0;border-radius:16px;box-shadow:0 12px 32px #263c6029;z-index:60;max-height:calc(100dvh - 76px);overflow-y:auto;overscroll-behavior:contain}
 .account-menu-toggle svg {width:20px;height:20px;stroke:currentColor;fill:none;stroke-width:1.8}
}
@media(max-width:700px){body[data-screen="landing"]:not(.lp-menu-open) .lp-barnav>.account-nav {display:none}}
/* Profile navigation keeps the live study DOM and document frames mounted. */
.account-workspace-profile {position:fixed;inset:58px 0 0;z-index:28;background:var(--bg,#eaf1f7);overflow:auto;overscroll-behavior:contain}
.account-workspace-profile[hidden] {display:none}
.account-return-bar {width:min(920px,calc(100% - 40px));margin:22px auto -22px}
.account-profile-open .lp-barnav,.account-profile-open #chatToggle,.account-profile-open #navToggle {visibility:hidden}
@media(max-width:700px){.account-workspace-profile{inset-block-start:58px}.account-return-bar{margin-bottom:0}.account-workspace-profile .account-profile{margin-top:20px}.account-profile-open .account-nav{visibility:visible}}
/* After creating an account: "Check your email", green, in the middle of the popup (wherever it is scrolled). */
.account-check-email {position:fixed;inset:0;z-index:5;display:grid;place-items:center;padding:16px;background:#ffffff99;backdrop-filter:blur(2px);animation:account-pop-in .18s ease-out}
.account-check-email-card {box-sizing:border-box;width:min(340px,100%);padding:24px 22px 20px;border:1px solid #bfe3cc;border-radius:20px;background:#eaf7ef;color:#2f6b4c;text-align:center;box-shadow:0 16px 44px #284b3933}
.account-check-email-icon {display:grid;place-items:center;width:52px;height:52px;margin:0 auto 10px;border-radius:50%;background:#d2eedd;font-size:26px}
.account-check-email-card h3 {margin:0 0 8px;font-size:20px;color:#2a6345}
.account-check-email-card p {margin:0 0 18px;font-size:14px;line-height:1.7;overflow-wrap:anywhere}
.account-check-email-ok {border:0;border-radius:12px;padding:10px 26px;min-height:44px;font-weight:700;color:#fff;background:#3f9667;box-shadow:0 6px 14px #3f966733}
.account-check-email-ok:hover {background:#368559}
@keyframes account-pop-in {from{opacity:0;transform:scale(.96)}to{opacity:1;transform:none}}
@media(prefers-reduced-motion:reduce){.account-check-email{animation:none}}
/* Your account (logged in): the two buttons apart, one under the other */
.account-actions {display:grid;gap:10px;margin-top:4px}
.account-actions--row {grid-template-columns:repeat(auto-fit,minmax(140px,1fr))}
.account-actions .account-primary,.account-actions .account-secondary {width:100%;box-sizing:border-box}
/* Password: an eye to show or hide what was typed */
.account-password {position:relative;display:block}
.account-password .account-input {padding-right:48px}
.account-eye {position:absolute;top:50%;right:6px;transform:translateY(-50%);display:grid;place-items:center;width:36px;height:36px;border:0;border-radius:10px;background:transparent;color:#61748b}
.account-eye:hover {background:#edf3fa;color:#405c8c}
.account-eye svg {width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
/* Continue with Google, then "or" and the email form */
.account-google {display:flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:46px;border:1px solid #dbe4ef;border-radius:12px;background:#fff;color:#2f3e50;font-weight:700}
.account-google:hover {background:#f6f9fd}
.account-google svg {width:20px;height:20px}
.account-or {display:flex;align-items:center;gap:12px;margin:14px 0;color:#8a96a7;font-size:12px}
.account-or::before,.account-or::after {content:"";flex:1;height:1px;background:#e3e9f0}
/* Profile: edit the name and the picture */
.account-profile-header .account-edit-btn {margin-left:auto;padding:9px 14px;font-size:14px}
.account-profile-edit {display:grid;gap:16px;text-align:left;margin:22px 0;padding:22px;background:#f5f8fc;border:1px solid #e3e9f0;border-radius:16px}
.account-photo-row {display:flex;align-items:center;gap:18px;flex-wrap:wrap}
.account-photo-row .account-avatar {width:84px;height:84px}
.account-photo-actions {display:grid;justify-items:start;gap:6px}
.account-field-label {font-size:13px;font-weight:700;color:#3a5068}
.account-photo-actions .account-link {padding:4px}
@media(max-width:700px){.account-profile-header{flex-wrap:wrap}.account-profile-header .account-edit-btn{margin-left:0}}


/* Choosing what shows in the round profile picture (frontend/account.tsx, PhotoCropper) */
.account-cropper {display:grid;justify-items:center;gap:12px;text-align:center}
.account-cropper-title {margin:0;font-weight:800;font-size:17px}
.account-cropper-stage {position:relative;overflow:hidden;border-radius:18px;background:#1f2a37;cursor:grab;touch-action:none;user-select:none;max-width:100%}
.account-cropper-stage:active {cursor:grabbing}
.account-cropper-stage:focus-visible {outline:3px solid #b4c8f0;outline-offset:3px}
.account-cropper-stage img {position:absolute;top:0;left:0;max-width:none;transform-origin:0 0;pointer-events:none}
/* Everything outside the circle is dimmed */
.account-cropper-ring {position:absolute;inset:0;border-radius:50%;box-shadow:0 0 0 200px rgba(20,28,40,.55);outline:3px solid #fff;outline-offset:-3px;pointer-events:none}
.account-cropper-hint {margin:0;font-size:13px;color:#5b6b80}
.account-cropper-zoom {display:flex;align-items:center;gap:10px;width:min(260px,100%);font-weight:800;color:#5b6b80}
.account-cropper-zoom input {flex:1;accent-color:#8b6fd6}

/* Profile: change the email or the password (frontend/account.tsx, ChangeEmail and ChangePassword) */
.account-security {display:grid;gap:12px;margin-top:18px;padding:18px;border:1px solid #e3e9f2;border-radius:18px;background:#fbfcfe}
.account-security-title {margin:0;font-size:17px;font-weight:800}
.account-security-hint {margin:0;font-size:14px;color:#5b6b80;overflow-wrap:anywhere}
.account-security .account-secondary {justify-self:start}
/* The shared stylesheet stops the page scrolling (the extension's side panel needs that); the profile
   and insights pages are longer than a screen, so they scroll. */
body:has(> .account-profile-page),body:has(> .account-insights-page) {height:auto;min-height:100%;overflow-y:auto}
/* Whalia insights (admins only): the card in the profile and /insights.html */
.account-insights-card {text-align:left;padding:22px;border:1px solid #d9e4f5;background:linear-gradient(135deg,#eef8ff,#f6f2ff);border-radius:18px;margin:0 0 22px}
.account-insights-card h2 {margin:0 0 8px;font-size:17px}.account-insights-card p {margin:0 0 16px;color:#5d7088;font-size:14px;line-height:1.7}
.account-insights-card .account-primary {display:inline-flex;text-decoration:none}
.account-insights-page.account-profile {width:min(1180px,calc(100% - 32px))}
.insights {text-align:left}
.insights-head {display:flex;justify-content:space-between;align-items:flex-end;gap:20px;flex-wrap:wrap;margin-bottom:22px}
.insights-head .account-heading {text-align:left;margin:0 0 6px}
.insights-controls {display:flex;align-items:flex-end;gap:12px;flex-wrap:wrap}
.insights-controls .account-field {min-width:170px}
.insights-check {display:flex;align-items:center;gap:8px;font-size:14px;color:#3a5068;padding:11px 0}
.insights-hint {color:#687b92;font-size:13px;line-height:1.7;margin:0 0 12px}
.insights-tiles {display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px;margin-bottom:12px}
.insights-tile {display:flex;flex-direction:column;gap:2px;padding:18px;border:1px solid #e0e8f2;border-radius:16px;background:white;box-shadow:0 6px 20px #405d800c}
.insights-tile strong {font-size:32px;letter-spacing:-1px;color:#435d86;line-height:1.2}
.insights-tile-label {font-weight:700;font-size:14px;color:#2e4560}.insights-tile-sub {font-size:12px;color:#7b89a0;line-height:1.5}
.insights-section {margin-top:30px}.insights-section h2 {font-size:19px;margin:0 0 6px}
.insights-tabs {display:flex;gap:6px;margin:6px 0 22px;padding:5px;border:1px solid #e0e8f2;border-radius:16px;background:#f3f7fc;overflow-x:auto;scrollbar-width:thin}
.insights-tab {flex:1 0 auto;display:inline-flex;align-items:center;justify-content:center;gap:8px;border:0;border-radius:12px;padding:11px 16px;background:transparent;color:#4d6178;font:inherit;font-size:14px;font-weight:700;cursor:pointer;white-space:nowrap}
.insights-tab:hover {background:#e8f0fa}
.insights-tab[aria-selected="true"] {background:white;color:#26364a;box-shadow:0 2px 10px #405d801a}
.insights-tab:focus-visible {outline:3px solid #8b94d7;outline-offset:1px}
.insights-tab-count {font-size:12px;font-weight:700;color:#5d6bc4;background:#eceffd;border-radius:20px;padding:2px 8px}
.insights-panel > .insights-section:first-child {margin-top:0}
.insights-label {display:block;font-weight:700;color:#26364a}
.insights-raw {display:block;font-size:11px;color:#7d8da2;margin-top:2px}
@media(max-width:700px){.insights-tabs{display:grid;grid-template-columns:1fr 1fr;overflow:visible}.insights-tab{white-space:normal;text-align:center;padding:10px 8px;font-size:13px;line-height:1.3}}
.insights-table-wrap {overflow-x:auto;border:1px solid #e0e8f2;border-radius:14px;background:white}
.insights-table {width:100%;border-collapse:collapse;font-size:14px}
.insights-table th,.insights-table td {padding:9px 12px;border-bottom:1px solid #edf2f7;text-align:left;white-space:nowrap}
.insights-table tbody tr:last-child td {border-bottom:0}.insights-table tbody tr:hover {background:#f7faff}
.insights-table th {background:#f4f8fc;color:#40566d;font-size:12px;position:sticky;top:0}
.insights-table th button {all:unset;cursor:pointer;font-weight:700}.insights-table th button:focus-visible {outline:3px solid #b4c8f0;outline-offset:2px;border-radius:4px}
.insights-table .is-num {text-align:right}.insights-table th.is-num button {display:block;text-align:right}
.insights-name code {font-family:inherit;font-size:13px;color:#2e4560;white-space:normal;word-break:break-word}
.insights-name {white-space:normal!important;min-width:180px}
.insights-bar {display:inline-flex;align-items:center;justify-content:flex-end;gap:8px;min-width:120px;width:100%}
.insights-bar span {display:block;height:8px;border-radius:8px;background:linear-gradient(90deg,#5aa6e8,#b07cd8);flex:0 0 auto}
.insights-filter {max-width:320px;margin:0 0 10px}
.insights-empty {color:#7b89a0;font-size:14px;padding:14px;border:1px dashed #dce5f0;border-radius:12px}
@media(max-width:700px){.insights-tile strong{font-size:26px}.insights-controls{width:100%}.insights-controls .account-field{flex:1}.insights-table{font-size:13px}.insights-table th,.insights-table td{padding:8px}}
