/* Profile layout built exclusively from the shared BETOOTH tokens/components. */
.profile-lecture-achievements{display:grid;gap:16px;min-width:0;padding:20px}
.profile-lecture-achievements h2,.profile-lecture-achievements h3,.profile-lecture-achievements h4,.profile-lecture-achievements p{margin:0;overflow-wrap:anywhere}
.profile-lecture-achievements>p{color:var(--text-secondary);line-height:1.7}
.profile-lecture-achievements>div{display:grid;gap:16px;min-width:0}
.profile-lecture-medals{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr)));gap:12px}
.profile-lecture-medal{display:grid;gap:8px;padding:16px;border:1px solid var(--line);min-width:0}
.profile-lecture-medal>.ui-icon{color:var(--betooth-orange)}
.profile-lecture-history{display:grid;gap:12px;margin:0;padding-inline-start:24px}
.profile-lecture-history li{padding:12px;min-width:0;border-bottom:1px solid var(--line)}
.profile-lecture-history li>*+*{margin-top:8px}
.profile-lecture-history-actions{display:flex;gap:8px;flex-wrap:wrap}
.profile-lecture-achievements button,.profile-lecture-achievements a{min-height:44px;max-width:100%;white-space:normal;text-align:start}
/* Personal account closure: compact, readable, no permanent administrative form. */
.profile-edit input,.profile-edit textarea,.profile-edit select{min-height:48px;box-sizing:border-box;line-height:1.7;padding:10px 12px;text-align:start;max-width:100%;min-width:0;font:inherit}
.profile-edit textarea{min-height:112px;resize:vertical;unicode-bidi:plaintext}
.profile-edit-group{min-width:0}.profile-edit-actions button,.profile-account button,.profile-avatar-choice{min-height:44px}
.profile-avatar-controls{display:grid;grid-template-columns:112px minmax(0,1fr);gap:12px;min-width:0}.profile-avatar-controls input[type=file]{width:100%;min-width:0;font-size:.875rem}
.profile-avatar-controls>.profile-avatar{grid-row:1/4}.profile-avatar-controls>:not(.profile-avatar){grid-column:2}.profile-avatar-controls>.field-help{grid-column:1/-1}
.profile-avatar-choices{display:flex;flex-wrap:wrap;gap:10px}.profile-avatar-choice{padding:8px;border:1px solid var(--line);border-radius:2px;background:var(--surface)}
.profile-avatar-choice .profile-avatar{width:64px;height:64px;font-size:1.4rem}
.profile-avatar-choice[aria-pressed=true]{border-color:var(--betooth-orange);box-shadow:inset 0 -3px var(--betooth-orange)}
.profile-account{padding:20px;display:grid;gap:12px;border-radius:2px;border-top:2px solid var(--line)}
.profile-account h2,.profile-account p{margin:0}.profile-account>p{max-width:72ch;color:var(--text-secondary);line-height:1.75}
.profile-account>div{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.profile-account label{display:flex;align-items:flex-start;gap:10px;flex-basis:100%;line-height:1.7}.profile-account input{width:20px;height:20px;flex:none}
.profile-account [role=status]:empty{display:none}.profile-save-notice{color:var(--betooth-light);margin:0}
.legal-hub{max-width:850px;margin-inline:auto}.legal-hub .panel{padding:24px;line-height:1.8}.legal-hub ul{padding-inline-start:24px}
@media(max-width:700px){.profile-account{padding:16px}.profile-edit input,.profile-edit textarea,.profile-edit select{font-size:1rem}.profile-edit-actions{flex-wrap:wrap}}
#publicProfileMount{max-width:1120px;margin-inline:auto;display:grid;gap:24px}
.profile-hero{position:relative;display:grid;grid-template-columns:auto minmax(0,1fr);align-items:start;gap:24px;padding:32px;border:1px solid var(--line);border-radius:var(--radius-card);background:linear-gradient(115deg,var(--surface-soft),var(--surface) 65%);box-shadow:var(--shadow-sm);overflow:hidden}
.profile-hero::before{content:"";position:absolute;inset:0 0 auto;height:4px;background:linear-gradient(90deg,var(--betooth-orange) 0 80px,var(--betooth-light) 80px)}
.profile-hero>.profile-avatar{margin-top:8px;box-shadow:0 0 0 6px var(--surface)}
.profile-identity{min-width:0;padding-inline-end:36px}.profile-identity h1{font-size:clamp(1.75rem,3vw,2.5rem);margin:4px 0;line-height:1.15;letter-spacing:-.035em;overflow-wrap:anywhere}
.profile-handle{font-size:.875rem;color:var(--text-secondary);margin:8px 0;overflow-wrap:anywhere;unicode-bidi:isolate;text-align:left}
html[dir=rtl] .profile-handle{text-align:right}
.profile-bio{max-width:64ch;margin:12px 0;color:var(--text-primary);font-size:.9375rem;line-height:1.6;overflow-wrap:anywhere}
.profile-metadata{list-style:none;display:flex;flex-wrap:wrap;gap:8px 16px;padding:0;margin:16px 0 8px;color:var(--text-secondary);font-size:.8125rem}
.profile-metadata li{display:inline-flex;align-items:center;gap:6px;min-width:0;max-width:100%;overflow-wrap:anywhere}.profile-metadata .ui-icon{width:16px;height:16px}
.profile-joined{font-size:.75rem;color:var(--text-secondary);margin:8px 0 16px}
.profile-refresh{position:absolute;inset-block-start:16px;inset-inline-end:16px}
.profile-edit-trigger{min-width:0}.profile-section-title{font-size:1rem;letter-spacing:-.01em;line-height:1.3;margin:0 0 16px}
.profile-metrics{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px}
.profile-metric{display:flex;flex-direction:column;align-items:start;gap:8px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-md);padding:16px;min-width:0;box-shadow:var(--shadow-sm)}
.profile-metric>.ui-icon{color:var(--text-secondary);width:20px;height:20px}.profile-metric strong{font-size:clamp(1.25rem,1.8vw,1.75rem);line-height:1.2;letter-spacing:-.025em;overflow-wrap:anywhere}
.profile-metric h3{font-size:.75rem;color:var(--text-secondary);font-weight:650;line-height:1.35;margin:0}
.profile-tabs{margin:0;justify-self:start}.profile-tab-panel{display:grid;gap:24px}
.profile-rank-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.rank-card{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:12px;padding:16px;border:1px solid var(--line);border-radius:var(--radius-md);background:var(--surface)}
.rank-card .ui-icon{color:var(--text-secondary)}.rank-card h3{font-size:.8125rem;margin:0}.rank-card strong{font-size:1.4rem}
.profile-overview-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px;align-items:start}
.profile-section-note{font-size:.8125rem;margin:0 0 16px;line-height:1.55}
.profile-day-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:8px;max-width:340px}
.profile-day{aspect-ratio:1;display:grid;place-items:center;background:var(--bg-panel);border:1px solid var(--line);color:var(--text-secondary);border-radius:6px;font-size:.75rem}
.profile-day.studied{background:var(--betooth-muted);border-color:var(--text-secondary);color:var(--text-primary)}
.profile-day-legend{font-size:.6875rem;margin:12px 0 0}.profile-best-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.best-card{display:flex;flex-direction:column;gap:8px;min-width:0;padding:12px;background:var(--surface-soft);border-radius:var(--radius-control)}
.best-card .ui-icon{color:var(--text-secondary)}.best-card strong{font-size:1.25rem;overflow-wrap:anywhere}.best-card h3{font-size:.75rem;margin:0;color:var(--text-secondary);line-height:1.4}
.profile-course-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.profile-course-top{display:flex;align-items:start;gap:16px;justify-content:space-between}.profile-course-top h3{font-size:1rem;margin:0;max-width:36ch}
.profile-course-percent{font-size:1.5rem;white-space:nowrap}.profile-course .learning-state{margin-block:12px}.profile-course progress{margin:4px 0 12px}
.profile-course-caption{font-size:.8125rem;margin:0}.profile-course.state-completed{border-inline-start:3px solid var(--betooth-orange)}
.profile-section-head{display:flex;justify-content:space-between;align-items:center;gap:12px}.profile-section-head h2{margin:0}
.achievement-total{font-size:.8125rem;font-weight:700;color:var(--text-secondary)}
.profile-achievement-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.achievement{position:relative;display:grid;grid-template-columns:80px minmax(0,1fr);gap:12px;padding:20px;border:1px solid var(--line);border-radius:var(--radius-card);background:var(--surface-soft);align-content:start}
.achievement.unlocked{border-color:var(--betooth-orange-line);background:var(--surface);box-shadow:var(--shadow-sm)}
.achievement.locked{background:var(--surface-soft)}.achievement-copy{min-width:0}.achievement h3{font-size:.9375rem;margin:4px 0 8px;line-height:1.3}
.achievement-category{font-size:.625rem;text-transform:uppercase;letter-spacing:.08em;color:var(--text-secondary);font-weight:800}
.achievement-requirement{font-size:.75rem;color:var(--text-secondary);margin:0;line-height:1.4}
.achievement-state{grid-column:1/-1;font-size:.6875rem;font-weight:800;color:var(--text-secondary)}
.achievement.unlocked .achievement-state{color:var(--text-primary)}.achievement progress{grid-column:1/-1}
.achievement-progress{grid-column:1/-1;margin:0;font-size:.75rem;font-variant-numeric:tabular-nums;color:var(--text-primary)}
.achievement-badge{position:relative;width:80px;height:88px;display:grid;place-items:center;color:var(--text-secondary)}
.badge-outline{position:absolute;inset:0;width:80px;height:88px;fill:var(--surface);stroke:var(--betooth-light);stroke-width:.8}
.badge-glyph{position:relative;width:28px;height:28px;margin-top:-12px;stroke:currentColor}
.badge-mark{position:absolute;bottom:2px;inset-inline-end:3px;border:3px solid var(--surface-soft);border-radius:50%;width:25px;height:25px;display:grid;place-items:center;background:var(--betooth-light);color:var(--text-primary)}
.badge-mark .ui-icon{width:12px;height:12px}
.unlocked .badge-outline{fill:var(--surface-orange);stroke:var(--betooth-orange)}
.unlocked .badge-mark{background:var(--betooth-orange);border-color:var(--text-primary)}
.unlocked .badge-glyph{color:var(--text-primary)}
.category-perfect .badge-glyph{width:32px;height:32px}.category-streak .badge-glyph{width:30px;height:30px}
.profile-edit{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px}
.profile-edit>.profile-section-title,.profile-edit>[role="alert"],.profile-edit-actions{grid-column:1/-1}
.profile-edit-group{border:0;padding:0;margin:0;min-width:0;display:grid;align-content:start;gap:16px}.profile-edit-group:last-of-type{grid-column:1/-1}
.profile-edit-group legend{font-size:.8125rem;font-weight:800;color:var(--text-secondary);padding:0 0 16px}
.profile-edit label{font-size:.8125rem;font-weight:700;min-width:0}
.profile-edit input,.profile-edit textarea,.profile-edit select{display:block;box-sizing:border-box;width:100%;margin-top:8px;padding:12px;min-height:44px}
.profile-edit textarea{min-height:100px;resize:vertical}.profile-edit .field-help{font-size:.75rem;font-weight:400;margin:0;line-height:1.45}
.profile-edit [aria-invalid="true"]{border-color:var(--betooth-orange);box-shadow:0 0 0 1px var(--betooth-orange)}
.profile-edit [role="alert"]:empty{display:none}.profile-edit [role="alert"]{margin:0;font-size:.8125rem}.profile-edit-actions{display:flex;gap:8px}
@media(max-width:1100px){.profile-metrics{grid-template-columns:repeat(3,minmax(0,1fr))}.profile-achievement-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){.profile-hero{padding:24px;gap:16px}.profile-hero .avatar-xl{width:88px;height:88px;font-size:1.75rem}.profile-overview-grid,.profile-course-grid{grid-template-columns:1fr}.profile-rank-grid{grid-template-columns:1fr}.rank-card{padding:12px 16px}.profile-edit{grid-template-columns:1fr}}
@media(max-width:500px){
 #publicProfileMount{gap:24px}.profile-hero{grid-template-columns:1fr;padding:24px}.profile-identity{padding-inline-end:0}
 .profile-identity h1{font-size:1.75rem}.profile-metadata{gap:8px 12px}.profile-hero>.profile-avatar{margin-top:0}
 .profile-metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.profile-metric{padding:12px}.profile-metric strong{font-size:1.35rem}
 .profile-tabs{width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.profile-tabs button{min-width:0;padding:10px 8px}
 .profile-achievement-grid{grid-template-columns:1fr}.achievement{grid-template-columns:80px minmax(0,1fr);padding:16px}
 .profile-section-head{flex-wrap:wrap}.profile-section-title{font-size:.9375rem}.profile-course-top{gap:8px}.profile-course-percent{font-size:1.35rem}
}
@media(max-width:600px){.profile-avatar-controls{grid-template-columns:minmax(0,1fr)}.profile-avatar-controls>*{grid-column:1!important}.profile-avatar-controls>.profile-avatar{grid-row:auto}}
.profile-name-row{display:flex;align-items:center;flex-wrap:wrap;gap:12px}
.profile-plus-badge{display:inline-flex;align-items:center;gap:6px;padding:3px 10px;border-radius:var(--radius-pill);font-size:.75rem;font-weight:700;letter-spacing:.02em;background:var(--surface-orange);color:var(--betooth-orange);border:1px solid var(--betooth-orange-line);box-shadow:var(--glow-orange)}
.profile-plus-badge .ui-icon{width:14px;height:14px;color:var(--betooth-orange)}
.profile-medals-strip{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:8px 0}
.profile-medal-chip{display:inline-flex;align-items:center;gap:6px;padding:3px 10px;border-radius:var(--radius-pill);font-size:.75rem;font-weight:600;background:var(--surface-soft);border:1px solid var(--line);color:var(--text-primary)}
.profile-medal-chip.medal-diamond{border-color:var(--border-active);background:color-mix(in srgb,var(--accent-primary) 14%,var(--bg-panel))}
.profile-medal-chip.medal-gold{border-color:var(--betooth-orange-line);background:color-mix(in srgb,var(--betooth-orange) 14%,var(--bg-panel))}
.profile-medal-chip.medal-silver{border-color:var(--line-strong);background:color-mix(in srgb,var(--betooth-light) 12%,var(--bg-panel))}

/* Keep long synthetic or real account identifiers inside student administration cards. */
#studentManagementMount>.profile-edit-group{grid-template-columns:minmax(0,1fr);overflow-wrap:anywhere}
#studentManagementMount>.profile-edit-group>*{min-width:0}
