:root {
  --radius: .5rem;
  --background: light-dark(#fff, #0e0e0e);
  --foreground: light-dark(#111, #f2f2f2);
  --primary: light-dark(#111, #f2f2f2);
  --primary-foreground: light-dark(#fff, #0e0e0e);
  --muted: light-dark(#f3f3f3, #1c1c1c);
  --muted-foreground: light-dark(#6f6f6f, #9a9a9a);
  --accent: light-dark(#f3f3f3, #1c1c1c);
  --border: light-dark(#e3e3e3, #2a2a2a);
  --input: light-dark(#d6d6d6, #3a3a3a);
  --ring: light-dark(#111, #f2f2f2);
  --grid-line: light-dark(rgba(17,17,17,.07), rgba(242,242,242,.07));
}
[data-theme=encre]{--primary:light-dark(#111,#f2f2f2)}
[data-theme=bleu]{--primary:light-dark(#2a5bd7,#8ab4ff)}
[data-theme=vert]{--primary:light-dark(#1f7a4c,#6fd39c)}
[data-theme=rouge]{--primary:light-dark(#c72f2f,#ff8f86)}
[data-theme=violet]{--primary:light-dark(#6b3fd4,#b7a1ff)}
[data-theme=orange]{--primary:light-dark(#c2410c,#fb923c)}
[data-theme]:not([data-theme=encre]){--ring:var(--primary);--grid-line:color-mix(in srgb,var(--primary) 14%,transparent)}
*{box-sizing:border-box}
[hidden]{display:none!important}
html{color-scheme:light dark;-webkit-text-size-adjust:100%}
html[data-mode=light]{color-scheme:light}
html[data-mode=dark]{color-scheme:dark}
body{margin:0;min-height:100dvh;background:var(--background);color:var(--foreground);font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;font-feature-settings:"tnum" 1}
button,input{font:inherit;color:inherit}
button,a{-webkit-tap-highlight-color:transparent}
a{color:inherit}
svg{display:block;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.paper-grid{background-image:linear-gradient(var(--grid-line) 1px,transparent 1px),linear-gradient(90deg,var(--grid-line) 1px,transparent 1px);background-size:20px 20px;background-position:center}
.bare-shell{width:100%;max-width:32rem;min-height:100dvh;margin:auto;display:flex;flex-direction:column}
.app-shell{min-height:100dvh}
.content-shell{display:flex;width:100%;min-height:100dvh;padding-bottom:6rem}
.content{display:flex;flex:1;flex-direction:column;width:100%;max-width:32rem;margin:auto}
.page{display:flex;flex:1;flex-direction:column;padding:2rem 1.25rem 1rem}
.page-header{margin:0 0 1.5rem}.page-header h1{margin:0;font-size:1.5rem;line-height:1.25;letter-spacing:-.025em}.page-header p{margin:.25rem 0 0;color:var(--muted-foreground);font-size:.875rem}
.section-title{margin:0 0 .75rem;color:var(--muted-foreground);font-size:.875rem;font-weight:500}
.analysis-choice{display:flex;flex-direction:column;gap:.625rem;margin-top:1rem}.analysis-choice .button{width:100%;white-space:normal}
.side-nav{display:none}
.bottom-nav{position:fixed;z-index:20;inset:auto 0 0;display:flex;align-items:stretch;justify-content:space-around;padding:.375rem .75rem max(.5rem,env(safe-area-inset-bottom));border-top:1px solid var(--border);background:color-mix(in srgb,var(--background) 90%,transparent);backdrop-filter:blur(12px)}
.nav-link{display:flex;flex:1;flex-direction:column;align-items:center;gap:.25rem;padding:.375rem;border-radius:var(--radius);color:var(--muted-foreground);font-size:.6875rem;font-weight:500;text-decoration:none;transition:.15s color,.15s background}
.nav-link svg{width:1.25rem;height:1.25rem}.nav-link.active{color:var(--primary)}
.button{display:inline-flex;align-items:center;justify-content:center;gap:.5rem;min-height:2.75rem;padding:0 1rem;border:0;border-radius:var(--radius);background:var(--primary);color:var(--primary-foreground);font-size:.875rem;font-weight:600;text-decoration:none;cursor:pointer;transition:opacity .15s,background .15s}
.button:hover{opacity:.9}.button:disabled{pointer-events:none;opacity:.4}.button.large{min-height:3rem;padding:0 1.25rem;font-size:.9375rem}.button.small{min-height:2.25rem;padding:0 .75rem}.button.outline{border:1px solid var(--input);background:var(--background);color:var(--foreground)}.button.outline:hover,.button.ghost:hover{background:var(--accent)}.button.ghost{border:0;background:transparent;color:var(--foreground)}.button.full{width:100%}
button:focus-visible,a:focus-visible,input:focus-visible{outline:2px solid var(--ring);outline-offset:2px}
.presentation{display:flex;flex:1;flex-direction:column;padding:3rem 1.5rem 4rem}.hero-mark{display:flex;width:3rem;height:3rem;align-items:center;justify-content:center;margin-bottom:2rem;border:1px solid var(--border);border-radius:var(--radius)}.hero-mark svg{width:1.75rem;height:1.75rem;stroke-width:34}.presentation h1{margin:0;font-size:2.25rem;line-height:1.1;letter-spacing:-.04em}.lead{max-width:24rem;margin:1rem 0 0;color:var(--muted-foreground);font-size:1rem;line-height:1.65}.hero-actions{display:flex;max-width:20rem;flex-direction:column;gap:.75rem;margin-top:2rem}.marketing-section{margin-top:4rem}.steps{padding:0;margin:1rem 0 0;list-style:none}.steps li{display:flex;gap:1rem;padding:1rem 0;border-top:1px solid var(--border)}.steps li:last-child{border-bottom:1px solid var(--border)}.steps>li>span{width:1.25rem;flex:none;color:var(--muted-foreground);font-size:.875rem}.steps h3,.feature-grid h3{margin:0;font-size:.875rem}.steps p,.feature-grid p{margin:.25rem 0 0;color:var(--muted-foreground);font-size:.875rem;line-height:1.45}.feature-grid{display:grid;grid-template-columns:1fr;gap:.75rem;margin-top:1rem}.feature-grid article{padding:1rem;border:1px solid var(--border);border-radius:.625rem}.final-cta h2{margin:0;font-size:1.5rem;letter-spacing:-.025em}.final-cta .button{width:100%;max-width:20rem;margin-top:1.25rem}
.auth-page{display:flex;flex:1;flex-direction:column;align-items:center;justify-content:center;padding:2.5rem 1.5rem}.auth-heading,.auth-body{width:100%;max-width:24rem}.auth-heading{margin-bottom:2rem}.auth-heading .hero-mark{margin-bottom:1.5rem}.auth-heading h1{margin:0;font-size:1.5rem;letter-spacing:-.025em}.auth-heading>p{margin:.25rem 0 0;color:var(--muted-foreground);font-size:.875rem}.form{display:flex;flex-direction:column;gap:1rem}.form label{display:flex;flex-direction:column;gap:.375rem;font-size:.875rem;font-weight:500}.form input{width:100%;height:2.75rem;padding:0 .75rem;border:1px solid var(--input);border-radius:var(--radius);background:var(--background);font-size:1rem;outline:none}.form input:focus{border-color:var(--ring);box-shadow:0 0 0 1px var(--ring)}.form small{color:var(--muted-foreground);font-size:.75rem;font-weight:400}.form .button{margin-top:.5rem}.label-row{display:flex;justify-content:space-between}.label-row a{color:var(--muted-foreground);font-size:.75rem;font-weight:400;text-decoration:none}.form-error{margin:0;font-size:.875rem}.auth-switch{margin:.5rem 0 0;text-align:center;color:var(--muted-foreground);font-size:.875rem}.auth-switch a,.message-card a{color:var(--foreground);font-weight:600;text-underline-offset:4px}.auth-switch .muted-link{color:var(--muted-foreground);font-weight:400;text-decoration:none}.message-card{padding:1.25rem;border:1px solid var(--border);border-radius:.625rem}.message-card p{margin:0;font-size:.875rem;line-height:1.55}.message-card a{display:inline-block;margin-top:1rem;font-size:.875rem}
.photo-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.75rem}.photo-picker{display:flex;width:100%;min-height:11rem;height:auto;flex-direction:column;align-items:center;justify-content:center;gap:.75rem;padding:.75rem;border:1px dashed var(--input);border-radius:.625rem;background:transparent;color:var(--muted-foreground);font-size:.875rem;font-weight:600;text-align:center;cursor:pointer;transition:.15s}.photo-picker:hover{border-color:var(--foreground);color:var(--foreground)}.photo-picker svg{width:2rem;height:2rem;flex:none}.photo-picker small{color:var(--muted-foreground);font-size:.75rem;font-weight:400;line-height:1.35}.desktop-only{display:none}.photo-heading{display:flex;align-items:baseline;justify-content:space-between;margin-bottom:.5rem}.photo-heading h2{margin:0;font-size:.875rem}.photo-heading span{color:var(--muted-foreground);font-size:.75rem}.photo-list{display:flex;gap:.75rem;overflow:auto;padding:.25rem .125rem}.photo-card{position:relative;flex:none}.photo-card img{width:7rem;height:9rem;border:1px solid var(--border);border-radius:var(--radius);object-fit:cover}.remove-photo{position:absolute;top:-.4rem;right:-.4rem;display:flex;width:1.75rem;height:1.75rem;align-items:center;justify-content:center;border:2px solid var(--background);border-radius:999px;background:var(--foreground);color:var(--background);cursor:pointer}.remove-photo svg{width:.875rem;height:.875rem}.capture-save{margin-top:2rem}.pending-note{display:flex;align-items:center;justify-content:space-between;margin-top:2rem;padding-top:1rem;border-top:1px solid var(--border)}.pending-note p{margin:0;font-size:.875rem}.pending-note small{display:block;margin-top:.125rem;color:var(--muted-foreground);font-size:.75rem}.pending-note code{font-family:ui-monospace,monospace}.toast{position:fixed;z-index:30;bottom:6rem;left:50%;max-width:calc(100vw - 2rem);transform:translateX(-50%);padding:.5rem 1rem;border-radius:var(--radius);background:var(--foreground);color:var(--background);font-size:.875rem;font-weight:600;text-align:center;white-space:normal;overflow-wrap:anywhere}
.empty-state{padding:2rem;border:1px dashed var(--input);border-radius:.625rem;text-align:center}.empty-state p{margin:0;color:var(--muted-foreground);font-size:.875rem}.empty-state a{display:inline-block;margin-top:.5rem;font-size:.875rem;font-weight:600;text-underline-offset:4px}.empty-state strong{display:block;font-size:.875rem}.empty-state small{display:block;margin-top:.25rem;color:var(--muted-foreground)}.list-section{margin-bottom:2rem}.exercise-list{display:flex;flex-direction:column;padding:0;margin:0 -.5rem;list-style:none}.exercise-row{border-bottom:1px solid var(--border)}.exercise-row:last-child{border:0}.exercise-row>a{display:flex;gap:.75rem;padding:.75rem .5rem;border-radius:var(--radius);text-decoration:none}.exercise-row>a:hover{background:var(--accent)}.exercise-row img,.image-placeholder{width:3rem;height:4rem;flex:none;border:1px solid var(--border);border-radius:.25rem;object-fit:cover}.image-placeholder{background:var(--muted)}.exercise-copy{display:flex;min-width:0;flex:1;flex-direction:column;gap:.25rem}.row-top{display:flex;align-items:baseline;justify-content:space-between;gap:.75rem}.row-title{display:flex;min-width:0;align-items:center;gap:.5rem}.row-title strong{overflow:hidden;font-size:.875rem;font-weight:600;text-overflow:ellipsis;white-space:nowrap}.row-top time{flex:none;color:var(--muted-foreground);font-size:.75rem}.exercise-copy>p{overflow:hidden;margin:0;color:var(--muted-foreground);font-size:.75rem;text-overflow:ellipsis;white-space:nowrap}.row-result{display:flex;align-items:center;gap:.75rem;margin-top:auto}.result-label{display:inline-flex;align-items:center;gap:.375rem;font-size:.75rem;font-weight:600;white-space:nowrap}.result-mark{position:relative;display:inline-block;width:.625rem;height:.625rem;flex:none;border:1.5px solid currentColor;border-radius:50%}.result-mark.reussi{background:currentColor}.result-mark.partiel{overflow:hidden}.result-mark.partiel:before{content:"";position:absolute;inset:0 50% 0 0;background:currentColor}.error-chips{display:flex;min-width:0;flex:1;flex-wrap:wrap;gap:.25rem}.badge{display:inline-flex;width:max-content;align-items:center;padding:.125rem .375rem;border:1px solid var(--border);border-radius:.25rem;color:var(--muted-foreground);font-size:.75rem;font-weight:600;line-height:1rem;white-space:nowrap}.score{margin-left:auto;font-style:normal;white-space:nowrap}.score strong{font-weight:700}.score em{color:var(--muted-foreground);font-style:normal}.score.big{font-size:1.5rem}
.detail-page{padding-top:1.5rem}.detail-actions{display:flex;align-items:center;justify-content:space-between;margin-bottom:1.25rem}.back-link{display:inline-flex;align-items:center;gap:.25rem;margin-left:-.5rem;padding:.5rem;color:var(--muted-foreground);font-size:.875rem;font-weight:600;text-decoration:none}.back-link:hover{color:var(--foreground)}.back-link svg{width:1rem}.detail-images{display:flex;gap:.75rem;margin-bottom:1.5rem;overflow:auto}.detail-images img{height:14rem;border:1px solid var(--border);border-radius:var(--radius);object-fit:cover}.detail-content{display:flex;flex-direction:column;gap:2rem}.detail-content header h1{margin:.25rem 0 0;font-size:1.5rem;line-height:1.25;letter-spacing:-.025em}.detail-content header p:not(.eyebrow){margin:.25rem 0 0;color:var(--muted-foreground);font-size:.875rem}.eyebrow{margin:0;color:var(--muted-foreground);font-size:.75rem;font-weight:600;letter-spacing:.05em;text-transform:uppercase}.grade-header{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem}.grade-meta{display:flex;flex-wrap:wrap;align-items:center;gap:.75rem;margin-top:-1.25rem}.remember{padding-left:1rem;border-left:2px solid var(--foreground)}.advice{padding:1rem;border-radius:.625rem;background:var(--muted)}.prose-correction,.remember,.advice{font-size:.875rem;line-height:1.65}.prose-correction p,.remember p,.advice p{margin:.5rem 0}.prose-correction strong{font-weight:650}.math-display{display:block;max-width:100%;padding:.25rem 0;overflow:auto}.math-display math{display:block}
.course-note h3{margin:1.25rem 0 .5rem;font-size:1rem;line-height:1.4}.course-note h3:first-child{margin-top:0}.course-note ul,.course-note ol{padding-left:1.25rem;margin:.25rem 0 .75rem}.course-note li{padding-left:.125rem;margin:.2rem 0}.course-note p{margin:.5rem 0}
.score-panel{padding:1.25rem;border:1px solid var(--border);border-radius:.625rem}.score-panel>p{margin:0;color:var(--muted-foreground);font-size:.875rem}.average{margin-top:.25rem;font-size:3rem;font-weight:650;line-height:1;letter-spacing:-.04em}.average span{color:var(--muted-foreground);font-size:1.25rem;font-weight:400}.result-counts{display:flex;flex-wrap:wrap;gap:.25rem 1rem;margin-top:1.25rem;font-size:.875rem}.result-counts span{display:inline-flex;align-items:center;gap:.375rem}.score-panel>small{display:block;margin-top:.5rem;color:var(--muted-foreground);font-size:.75rem}.weakest{margin-top:1.5rem;padding-left:1rem;border-left:2px solid var(--primary)}.weakest p{margin:0;font-size:.875rem;font-weight:600}.stats-section{margin-top:2rem}.chapter-list{display:flex;flex-direction:column;gap:1rem}.chapter-list p{display:flex;align-items:baseline;justify-content:space-between;gap:.75rem;margin:0 0 .375rem;font-size:.875rem}.chapter-list p strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chapter-list p span{flex:none}.chapter-list p em{color:var(--muted-foreground);font-style:normal}.progress{position:relative;width:100%;height:.375rem;overflow:hidden;border-radius:999px;background:var(--muted)}.progress i{display:block;height:100%;border-radius:inherit;background:var(--primary)}.error-list{display:flex;flex-direction:column;gap:.75rem}.error-list>div{display:flex;align-items:center;gap:.75rem}.error-list span{width:7rem;flex:none;font-size:.875rem}.error-list strong{width:1.5rem;text-align:right;font-size:.875rem}.level-actions{display:flex;flex-direction:column;gap:.75rem;margin-top:2.5rem}.connect-link{display:flex;align-items:center;justify-content:space-between;gap:.75rem;padding:1rem;border:1px solid var(--border);border-radius:.625rem;text-decoration:none}.connect-link:hover{background:var(--accent)}.connect-link span{display:flex;flex-direction:column}.connect-link strong{font-size:.875rem}.connect-link small{margin-top:.125rem;color:var(--muted-foreground);font-size:.875rem}.connect-link b{color:var(--muted-foreground);font-weight:400}
.settings-section{margin-top:2rem}.mode-picker{display:grid;grid-template-columns:repeat(3,1fr);gap:.25rem;padding:.25rem;border:1px solid var(--input);border-radius:var(--radius)}.mode-picker button{height:2.25rem;border:0;border-radius:.25rem;background:transparent;color:var(--muted-foreground);font-size:.875rem;font-weight:600;cursor:pointer}.mode-picker button.active{background:var(--primary);color:var(--primary-foreground)}.theme-picker{display:grid;grid-template-columns:repeat(6,1fr);gap:.5rem}.theme-picker button{display:flex;min-width:0;flex-direction:column;align-items:center;gap:.5rem;padding:.25rem 0;border:0;border-radius:var(--radius);background:transparent;cursor:pointer}.theme-picker i{display:flex;width:2.5rem;height:2.5rem;align-items:center;justify-content:center;border-radius:50%;background:var(--primary);color:var(--primary-foreground);font-style:normal}.theme-picker i span{display:none}.theme-picker button.active i{outline:2px solid var(--foreground);outline-offset:2px}.theme-picker button.active i span{display:block}.theme-picker small{overflow:hidden;width:100%;color:var(--muted-foreground);font-size:.6875rem;text-overflow:ellipsis}.theme-picker button.active small{color:var(--foreground)}.section-help{margin:-.25rem 0 .75rem;color:var(--muted-foreground);font-size:.875rem}.new-token{margin-top:1rem;padding:1rem;border:1px solid var(--foreground);border-radius:.625rem}.new-token>strong{font-size:.875rem}.new-token>p{margin:.125rem 0 .75rem;color:var(--muted-foreground);font-size:.75rem}.connect-block{margin-top:1.5rem}.copy-block{position:relative}.copy-block code{display:block;min-height:3.25rem;padding:.75rem 5.25rem .75rem .75rem;overflow:auto;border:1px solid var(--border);border-radius:var(--radius);background:var(--muted);font: .75rem/1.6 ui-monospace,SFMono-Regular,Consolas,monospace;white-space:pre-wrap;word-break:break-word}.copy-block .button{position:absolute;top:.5rem;right:.5rem;height:1.75rem;min-height:1.75rem;padding:0 .5rem;font-size:.75rem}.muted{color:var(--muted-foreground);font-size:.875rem}.keys-list{padding:0;margin:0;list-style:none}.key-row{display:flex;align-items:center;justify-content:space-between;gap:.75rem;padding:.75rem 0;border-bottom:1px solid var(--border)}.key-row:last-child{border:0}.key-row p{overflow:hidden;margin:0;font-size:.875rem;font-weight:600;text-overflow:ellipsis;white-space:nowrap}.key-row code{color:var(--muted-foreground);font-size:.75rem}.key-row small{display:block;margin-top:.125rem;color:var(--muted-foreground);font-size:.75rem}
@media (min-width:640px){.feature-grid{grid-template-columns:repeat(2,1fr)}}
@media (min-width:1024px){.app-shell{display:flex}.side-nav{position:sticky;top:0;display:flex;width:15rem;height:100dvh;flex:none;flex-direction:column;padding:1.5rem .75rem;border-right:1px solid var(--border)}.brand{display:flex;align-items:center;gap:.625rem;margin-bottom:2rem;padding:0 .75rem;font-weight:650;text-decoration:none}.mark-box{display:flex;width:2rem;height:2rem;align-items:center;justify-content:center;border:1px solid var(--border);border-radius:var(--radius)}.mark-box svg{width:1.25rem;height:1.25rem;stroke-width:34}.side-nav nav{display:flex;flex-direction:column;gap:.25rem}.side-nav .nav-link{flex:none;flex-direction:row;gap:.75rem;padding:.5rem .75rem;font-size:.875rem}.side-nav .nav-link.active{background:var(--accent)}.content-shell{padding-bottom:2rem}.content{max-width:42rem}.bottom-nav{display:none}.desktop-only{display:block}.mobile-only{display:none}.toast{bottom:2rem}}
@media (prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;transition-duration:.01ms!important}}

/* Mise en page plus ample, avec des surfaces légères et une navigation discrète. */
:root{--radius:.65rem;--surface:color-mix(in srgb,var(--background) 94%,var(--foreground));--surface-raised:color-mix(in srgb,var(--background) 97%,var(--primary))}
body{background:var(--background)}
.page-header h1{font-size:clamp(1.65rem,2.1vw,2rem);letter-spacing:-.04em}
.page-header p{max-width:42rem;line-height:1.55}
.button{border-radius:.6rem;transition:transform .16s ease,opacity .16s ease,background .16s ease,border-color .16s ease}
.button:hover{transform:translateY(-1px)}
.button:active{transform:translateY(0)}
.empty-state{background:var(--surface)}
.photo-picker{min-height:11rem;border-radius:.8rem;background:var(--surface);transition:border-color .18s ease,background .18s ease,color .18s ease}
.photo-choices.has-photos .photo-picker{min-height:5rem;flex-direction:row;gap:.5rem;padding:.65rem;font-size:.8rem}
.photo-choices.has-photos .photo-picker svg{width:1.25rem;height:1.25rem}
.photo-choices.has-photos .photo-picker small{display:none}
.photo-picker:hover{border-color:var(--primary);background:var(--surface-raised)}
.score-panel,.connect-link,.feature-grid article,.message-card{border-radius:.8rem}
.score-panel{background-color:var(--surface-raised)}
.progress{height:.45rem}
.chapter-list{gap:1.25rem}
.bottom-nav{border-color:color-mix(in srgb,var(--border) 80%,transparent)}
.nav-link{transition:color .15s ease,background .15s ease}
.nav-link:hover{color:var(--foreground);background:var(--accent)}
.nav-link.active{color:var(--primary)}

@media (min-width:720px){
  .content{max-width:52rem}
  .settings-page{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-content:start;gap:1.25rem 1.5rem}
  .settings-page>.page-header,.settings-page>section:last-of-type{grid-column:1/-1}
  .settings-page>.settings-section{margin-top:0;padding:1.25rem;border:1px solid var(--border);border-radius:.8rem;background:var(--surface)}
  .settings-page>.settings-section:last-of-type{padding:1.5rem}
  .settings-page .section-title{margin-bottom:.875rem}
}

@media (min-width:1024px){
  .side-nav{width:16rem;padding:1.75rem 1rem;background:var(--background)}
  .brand{margin-bottom:2.5rem}
  .side-nav nav{gap:.35rem}
  .side-nav .nav-link{min-height:2.75rem;border-radius:.6rem;transition:color .15s ease,background .15s ease}
  .side-nav .nav-link:not(.active):hover{background:var(--surface);color:var(--foreground)}
  .side-nav .nav-link.active{background:var(--accent);font-weight:650}
  .content-shell{background:radial-gradient(ellipse at 82% 0%,color-mix(in srgb,var(--primary) 4%,transparent),transparent 38rem)}
  .content{max-width:82rem}
  .page{padding:clamp(2.25rem,4vw,3.75rem) clamp(2rem,4vw,4rem) 3.5rem;gap:1.35rem}
  .page-header{margin-bottom:.25rem}
  .photos-page .list-section{margin:0 0 1.25rem}
  .exercise-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.65rem;margin:0}
  .exercise-row,.exercise-row:last-child{overflow:hidden;border:1px solid var(--border);border-radius:.75rem;background:color-mix(in srgb,var(--background) 78%,var(--surface))}
  .exercise-row>a{min-height:6.2rem;gap:.9rem;padding:.75rem;transition:background .15s ease}
  .exercise-row>a:hover{background:var(--accent)}
  .exercise-row img,.exercise-row .image-placeholder{width:3.35rem;height:4.6rem;border-radius:.4rem}
  .row-title strong{font-size:.9375rem}
  .photos-page>.empty-state{padding:3rem}
  .level-page{display:grid;grid-template-columns:minmax(18rem,.78fr) minmax(0,1.22fr);align-content:start;gap:1.5rem 2rem}
  .level-page>.page-header,.level-page>.level-actions,.level-page>.empty-state{grid-column:1/-1}
  .level-overview,.level-details{display:flex;min-width:0;flex-direction:column;gap:1.25rem}
  .level-overview .score-panel{flex:1;padding:1.75rem;border-radius:.9rem}
  .level-overview .average{font-size:clamp(3.5rem,6vw,5.5rem)}
  .level-overview .weakest{margin:0;padding:1rem 1.1rem;border:1px solid var(--border);border-left:3px solid var(--primary);border-radius:.7rem;background:var(--surface)}
  .level-details .stats-section{margin:0;padding:1.25rem 1.35rem;border:1px solid var(--border);border-radius:.8rem;background:var(--surface)}
  .level-details .section-title{margin-bottom:1rem}
  .level-actions{display:grid;grid-template-columns:1fr 1fr;gap:1rem;margin-top:.25rem}
  .level-actions form{display:flex}
  .level-actions form .button{align-self:stretch}
  .detail-page{display:grid;grid-template-columns:minmax(19rem,.78fr) minmax(0,1.22fr);align-content:start;gap:1.5rem 2rem}
  .detail-page>.detail-actions{grid-column:1/-1;margin:0}
  .detail-page>.detail-images{grid-column:1;grid-row:2;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-content:start;gap:.75rem;max-height:calc(100dvh - 12rem);margin:0;padding:.15rem;overflow:auto;overscroll-behavior:contain}
  .detail-images img{width:100%;height:auto;max-height:34rem;object-fit:contain;background:var(--surface)}
  .detail-page>.empty-state,.detail-page>.detail-content{grid-column:2;grid-row:2;align-self:start}
  .detail-page>.empty-state{padding:2rem}
  .detail-content{gap:1.5rem}
  .detail-content header h1{font-size:clamp(1.65rem,2.3vw,2.2rem)}
  .advice,.score-panel{border-radius:.8rem}
  .capture-page{display:grid;grid-template-columns:minmax(0,1fr) minmax(16rem,.7fr);align-content:start;gap:1.25rem 2rem}
  .capture-page>.page-header,.capture-page>.capture-save,.capture-page>.pending-note,.capture-page>.muted{grid-column:1/-1}
  .capture-page>.photo-choices{grid-column:1}
  .capture-page:has(#photo-section[hidden])>.photo-choices{grid-column:1/-1}
  .capture-page>#photo-section{grid-column:2;align-self:start;min-width:0}
  .capture-page>.capture-save{max-width:26rem}
  .bare-shell:has(.presentation){max-width:88rem}
  .presentation{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(22rem,.95fr);align-content:start;gap:0 clamp(3rem,7vw,7rem);padding:clamp(3rem,7vh,6rem) clamp(2.5rem,8vw,8rem)}
  .presentation>section:first-child{grid-column:1;grid-row:1/span 2;align-self:center;padding-bottom:3rem}
  .presentation>.marketing-section:nth-child(2){grid-column:2;grid-row:1}
  .presentation>.marketing-section:nth-child(3){grid-column:2;grid-row:2;margin-top:2.5rem}
  .presentation>.final-cta{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;gap:2rem;margin-top:3rem;padding-top:2rem;border-top:1px solid var(--border)}
  .presentation>.final-cta .button{width:auto;margin:0}
  .marketing-section{margin-top:2rem}
  .feature-grid{gap:.65rem}
  .feature-grid article{padding:1.1rem}
}

@media (max-width:719px){
  .page{gap:1rem}
  .page-header{margin-bottom:.25rem}
  .detail-page{gap:1.25rem}
}
@media (prefers-reduced-motion:reduce){.button:hover,.button:active{transform:none}}

.course-practice{display:flex;flex-direction:column;align-items:flex-start;gap:.5rem;margin-top:1.25rem;padding:1rem;border:1px solid var(--border);border-left:3px solid var(--primary);border-radius:.7rem;background:var(--surface)}
.course-practice .section-title{margin:0}
.course-practice p{max-width:44rem;margin:0 0 .25rem;color:var(--muted-foreground);font-size:.875rem;line-height:1.55}
.course-practice label{font-size:.875rem;font-weight:600}
.course-guidance{width:100%;min-height:4.5rem;padding:.8rem;border:1px solid var(--input);border-radius:.6rem;background:var(--background);color:var(--foreground);font:inherit;font-size:.9375rem;line-height:1.55;resize:vertical}
.course-guidance:focus{border-color:var(--ring);outline:2px solid color-mix(in srgb,var(--ring) 30%,transparent);outline-offset:1px}
.generated-question{padding:1.1rem 1.25rem;border:1px solid var(--border);border-radius:.75rem;background:var(--surface)}
.generated-question .section-title{margin-bottom:.65rem}
.generated-answer-form{display:flex;flex-direction:column;align-items:flex-start;gap:.65rem}
.generated-answer-form label{font-size:.875rem;font-weight:600}
.generated-answer-form textarea{width:100%;min-height:10rem;padding:.8rem;border:1px solid var(--input);border-radius:.6rem;background:var(--background);color:var(--foreground);font:inherit;font-size:.9375rem;line-height:1.55;resize:vertical}
.generated-answer-form textarea:focus{border-color:var(--ring);outline:2px solid color-mix(in srgb,var(--ring) 30%,transparent);outline-offset:1px}
.generated-answer-form p{margin:0;color:var(--muted-foreground);font-size:.8125rem;line-height:1.5}
.source-course-link{text-decoration:none}
.source-course-link:hover{background:var(--accent);color:var(--foreground)}
@media (min-width:1024px){.generated-exercise{grid-template-columns:minmax(0,1fr)}.generated-exercise>.detail-content{grid-column:1;grid-row:auto;max-width:72rem}.generated-exercise>.detail-actions{grid-column:1}}
.ai-model-label{display:block;margin:.75rem 0 .375rem;font-size:.875rem;font-weight:600}
.ai-model-select{width:100%;min-height:2.75rem;padding:.625rem .75rem;border:1px solid var(--input);border-radius:var(--radius);background:var(--background);color:var(--foreground);font:inherit}
.ai-model-select:focus{border-color:var(--ring);outline:2px solid color-mix(in srgb,var(--ring) 30%,transparent);outline-offset:1px}
.settings-warning{padding:.75rem 1rem;border-left:3px solid var(--primary);border-radius:.4rem;background:var(--surface);font-size:.875rem}
