@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap');
:root{font-family:'DM Sans',system-ui,sans-serif;color:#263e35;background:#f8f9f5;font-synthesis:none;--green:#244d3f;--muted:#7a847e;--border:#e2e7dd}*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit}button,a,select{ -webkit-tap-highlight-color:transparent}button{cursor:pointer}button:disabled{opacity:.45;cursor:default}button:focus-visible,a:focus-visible{outline:3px solid #b4be63;outline-offset:4px}[hidden]{display:none!important}.shell{display:flex;min-height:100vh;min-height:100dvh}aside{width:246px;position:fixed;inset:0 auto 0 0;border-right:1px solid var(--border);padding:39px 25px;background:#f1f4ec;display:flex;flex-direction:column}.brand{display:flex;gap:10px;align-items:center;font-size:31px;font-weight:800;text-decoration:none;color:var(--green);letter-spacing:-1.5px}.brand-dot{color:#a1ac66}.eyebrow{font-size:10px;letter-spacing:1.9px;font-weight:700;color:#89917c}aside>.eyebrow{margin:49px 10px 16px;font-size:9px}nav{display:grid;gap:9px}nav button{display:flex;align-items:center;gap:12px;border:0;background:transparent;text-align:left;padding:14px 15px;color:#69766b;border-radius:7px;font-size:15px}nav button.active{background:#e0e7d6;color:var(--green);font-weight:700}nav .badge{margin-left:auto;background:#cdd7bc;border-radius:5px;padding:2px 7px;font-size:11px}.sidebar-note{margin:auto 8px 30px;padding-top:50px}.sprout{font-size:40px;color:#95a470}.sidebar-note h3{line-height:1.6;font-size:16px;font-weight:500}.sidebar-note p{font-size:12px;line-height:1.8;color:var(--muted)}.local-label{font-size:10px;color:#7b8675;border-top:1px solid #dce2d6;padding:22px 0 0}.local-label span{display:inline-block;width:6px;height:6px;border-radius:50%;background:#98a77b;margin-right:7px}main{margin-left:246px;padding:30px 46px;width:calc(100% - 246px);max-width:1650px}header{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--border);padding-bottom:25px}header .eyebrow{font-size:9px}header p{font-size:12px;margin:9px 0 0;color:var(--muted)}.button{border:1px solid #d8dfd2;background:#fff;color:var(--green);border-radius:6px;padding:11px 17px;font-size:12px;font-weight:600;display:inline-flex;gap:22px;align-items:center;justify-content:center}.button:hover{filter:brightness(.96)}.primary{background:var(--green);border-color:var(--green);color:white}.cream{background:#e7eccd;border-color:#e7eccd;color:#2b4937}.page-heading{display:flex;justify-content:space-between;align-items:center;gap:16px;margin:37px 0 27px}.page-heading .eyebrow{font-size:9px;margin-bottom:10px}h1,h2,h3{font-family:Manrope,system-ui,sans-serif}h1{font-size:36px;letter-spacing:-1.5px;margin:0;font-weight:600}.page-heading p:not(.eyebrow){font-size:13px;color:var(--muted);margin:12px 0 0}.pill{font-size:10px;background:#eef1e4;color:#75825d;border:1px solid #e3e7d7;border-radius:20px;padding:9px 13px}
.version-tag{font-family:ui-monospace,Menlo,monospace;font-size:9px;opacity:.75;margin-left:2px}
footer .version-tag{margin-left:14px}
.version-standalone{display:none}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:15px}.stats article{border:1px solid var(--border);border-radius:9px;padding:22px 21px;background:#fff}.stats article>span{font-size:12px;color:#7b847c}.stats strong{display:block;font-size:34px;font-weight:500;margin:13px 0 10px;letter-spacing:-1px}.stats small{font-size:10px;color:#92998d}.overview-grid{display:grid;grid-template-columns:1.55fr 1fr;gap:20px;margin-top:24px}.practice-banner{background:#244b3e;border-radius:10px;min-height:278px;padding:29px;display:flex;position:relative;overflow:hidden;color:#f6f7ef}.practice-banner .eyebrow{color:#bbcca4;font-size:8px}.practice-banner h2{font-size:28px;font-weight:500;line-height:1.4;letter-spacing:-.8px;margin:16px 0 12px}.practice-banner p{font-size:11px;color:#c1cebd;max-width:250px;margin-bottom:24px}.card-art{position:absolute;right:26px;top:58px;width:155px;height:183px;transform:rotate(9deg)}.art-front,.art-back{position:absolute;inset:0;border-radius:8px;background:#f0f0dd}.art-back{transform:rotate(-19deg);background:#95a585}.art-front{padding:20px;color:#44523b;box-shadow:0 10px 30px #0b221938}.art-front>span:first-child{font-size:6px;letter-spacing:1.5px}.art-front b{display:block;font-size:14px;line-height:1.6;margin-top:18px;font-weight:500}.art-star{display:block;font-size:40px;color:#a3ac78;margin-top:7px}.art-front small{font-size:6px;color:#899075}.panel{border:1px solid var(--border);border-radius:10px;background:white}.activity-panel{padding:24px 22px}.panel-heading{display:flex;align-items:center;justify-content:space-between;gap:14px}.panel-heading h3{font-size:13px;font-weight:600;margin:0}.muted{color:var(--muted);font-size:11px}.panel-heading>span{font-size:9px}.activity{height:170px;display:flex;gap:12px;align-items:flex-end;padding-top:20px}.activity>div{flex:1;text-align:center;height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:8px}.activity .bar{width:100%;max-width:29px;border-radius:4px 4px 0 0;background:#dce4cc;min-height:3px}.activity>div:last-child .bar{background:#8ea779}.activity small{font-size:9px;color:#8a9285}.activity .count{font-size:9px;color:#6a805f}.activity-panel>p{border-top:1px solid #eef0e9;padding-top:17px;margin-bottom:0;font-size:10px}.section-heading{margin:33px 0 20px}.section-heading h2{font-size:18px;margin:0;font-weight:600}.section-heading p{margin:7px 0 0}.text-button{border:0;background:none;color:#637b53;font-size:11px}.deck-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:17px}.deck{background:#fff;border:1px solid var(--border);border-radius:9px;padding:21px}.deck-icon{display:inline-grid;place-items:center;width:37px;height:37px;background:#edf0e0;border-radius:8px;color:#879567;font-size:22px}.deck:nth-child(3n+2) .deck-icon{background:#f4ece0;color:#b49b70}.deck:nth-child(3n) .deck-icon{background:#e4edeb;color:#78958a}.deck h3{font-size:15px;margin:17px 0 7px;overflow-wrap:anywhere}.deck p{font-size:11px;color:var(--muted);margin:0 0 22px}.deck-bottom{border-top:1px solid #edf0e7;padding-top:13px;display:flex;gap:10px;justify-content:space-between;align-items:center}.deck-bottom button{font-size:11px}.empty{grid-column:1/-1;text-align:center;border:1px dashed #d4ddc8;border-radius:10px;padding:38px;color:var(--muted);font-size:13px}.empty h2{color:var(--green);font-size:22px}.empty p{line-height:1.8}.filters{display:flex;align-items:flex-end;gap:14px;margin:25px 0;flex-wrap:wrap}.filters label{min-width:120px;flex:1}.filters .grow{flex:2}label{display:grid;gap:8px;font-size:12px;color:#51624f}input,textarea,select{border:1px solid #d7dfd0;border-radius:6px;padding:11px 12px;background:#fff;color:#304636;min-width:0;width:100%}input:focus,select:focus,textarea:focus{outline:2px solid #a2b186;outline-offset:1px}textarea{resize:vertical;line-height:1.6}.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse;text-align:left;font-size:12px}th{font-size:10px;text-transform:uppercase;letter-spacing:1px;color:#89917e;padding:17px 20px;background:#f4f6ef}td{padding:19px 20px;border-top:1px solid #edf0e6;max-width:430px}td .front,td .back{white-space:pre-wrap;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.front{font-weight:600;margin-bottom:7px}.back{color:var(--muted)}.tag{display:inline-block;background:#eef2e5;border-radius:4px;padding:3px 6px;font-size:9px;margin:6px 4px 0 0}.pagination{display:flex;align-items:center;justify-content:space-between;margin-top:20px;font-size:12px;color:var(--muted)}.study-area{max-width:730px;margin:40px auto 0}.flashcard{min-height:330px;border:1px solid var(--border);border-radius:14px;background:white;box-shadow:0 10px 30px #244d3f06;padding:30px;display:flex;flex-direction:column;align-items:center;text-align:center}.flashcard .eyebrow{margin:0}.flashcard .content{white-space:pre-wrap;overflow-wrap:anywhere;max-width:100%;font-size:25px;line-height:1.7;margin:auto;padding:35px 0}.flashcard .button{min-width:160px}.flashcard[data-flip]{cursor:pointer}.flip-hint{font-size:10px;color:var(--muted);letter-spacing:.4px}.ratings{display:grid;grid-template-columns:repeat(5,1fr);gap:10px;margin-top:20px}.ratings button{display:grid;gap:6px;padding:13px 5px;border-radius:7px;border:1px solid #dce2d1;background:#edf1e4;color:#3e5939;font-size:13px}.ratings button:first-child{background:#f7eae5;color:#a06b59;border-color:#eddbd3}.ratings button small{font-size:10px;opacity:.8}.study-tip{text-align:center;color:#97a08e;font-size:11px;margin:25px 0}.form-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:22px}dialog{border:1px solid var(--border);border-radius:13px;width:min(540px,calc(100% - 30px));padding:28px;color:var(--green);box-shadow:0 20px 90px #102a3433}dialog::backdrop{background:#18332866;backdrop-filter:blur(3px)}dialog h2{font-size:22px;margin:0}dialog label{margin-top:20px}#ai-draft{justify-self:end}.icon-button{border:0;background:none;color:#80916f;font-size:25px}.form-error{font-size:12px;color:#a04736}.danger{color:#a04736}#message,#offline{padding:13px 17px;border-radius:6px;margin-top:16px;font-size:12px;background:#f4e8d4;color:#6c573b}footer{border-top:1px solid var(--border);margin-top:45px;padding:20px 0 0;font-size:10px;color:#9ca491;display:flex;justify-content:space-between}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(min-width:1450px){main{padding:35px 60px}.card-art{right:40px;width:170px;height:190px}}@media(max-width:1200px){main{padding:25px}.card-art{opacity:.35;right:10px}.practice-banner>div:first-child{z-index:1}.stats article{padding:18px 15px}.stats small{line-height:1.6;display:block}.overview-grid{grid-template-columns:1.2fr 1fr}}@media(max-width:950px){aside{width:190px;padding:30px 17px}main{margin-left:190px;width:calc(100% - 190px)}.brand{font-size:26px}.stats{grid-template-columns:repeat(2,1fr)}.overview-grid{grid-template-columns:1fr}.card-art{opacity:1;right:40px}.deck-grid{grid-template-columns:repeat(2,1fr)}.pill{display:none}.version-standalone{display:inline-block}#sync-note{display:none}.activity{height:130px}}@media(max-width:650px){aside{position:static;width:100%;padding:20px 18px 10px;border-right:0;border-bottom:1px solid var(--border)}.shell{display:block}.brand{font-size:27px}aside>.eyebrow,.sidebar-note,.local-label{display:none}nav{display:flex;gap:2px;margin-top:16px;justify-content:space-between}nav button{padding:10px 8px;gap:5px;font-size:11px}nav .badge{font-size:9px;margin-left:1px;padding:1px 4px}main{margin:0;padding:20px 18px;width:100%}header .eyebrow{font-size:7px}header .button{padding:10px;font-size:11px}.page-heading{margin:28px 0 22px}h1{font-size:29px}.page-heading p:not(.eyebrow){font-size:12px;line-height:1.7}.stats{gap:10px}.stats article{padding:16px}.stats strong{font-size:29px}.stats article>span{font-size:11px}.stats small{font-size:9px}.practice-banner{padding:24px;min-height:275px}.practice-banner h2{font-size:25px}.card-art{right:16px;top:67px;width:127px;height:170px;opacity:.5}.art-front{padding:14px}.deck-grid{grid-template-columns:1fr}.filters{gap:10px}.filters label{min-width:calc(50% - 10px)}.filters>.button{width:100%}.ratings{gap:5px}.ratings button{font-size:11px}.flashcard{padding:24px;min-height:300px}.flashcard .content{font-size:21px}.study-tip{font-size:9px}.pagination .button{padding:9px}footer span{display:none}.page-heading>.button{white-space:nowrap;padding:10px}.study-area{margin-top:25px}}
@media(max-width:650px){.card-art{display:none}.practice-banner p{max-width:100%}}
/* Practice keeps the prompt central and the actions within comfortable reach. */
.flashcard,.study-area,.study-controls{touch-action:manipulation}
.header-actions{display:flex;align-items:center;gap:12px}
.header-actions .muted{max-width:320px;text-align:right;line-height:1.5}
.study-filters{max-width:800px;margin:0 auto;border:1px solid var(--border);border-radius:8px;background:#fff;padding:13px 16px}
.study-filters summary{cursor:pointer;font-size:12px;font-weight:600;min-height:24px;line-height:24px}
.study-filters summary span{float:right;max-width:55%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted);font-weight:400}
.study-filters .filters{margin:18px 0 4px}.session-summary{max-width:800px;margin:20px auto 12px;display:flex;justify-content:space-between;gap:12px;font-size:11px;color:var(--muted)}
.study-area{max-width:800px;margin:0 auto}.flashcard{min-height:clamp(260px,38dvh,480px)}.flashcard .content{font-size:clamp(23px,3vw,34px)}
.study-controls{padding-top:18px;text-align:center}.study-controls #reveal{width:100%;min-height:56px;font-size:15px}.ratings{grid-template-columns:repeat(4,minmax(0,1fr));margin:0;gap:12px}.ratings button{min-height:66px;font-size:15px}.ratings button[data-rating=Good]{background:var(--green);color:#fff;border-color:var(--green)}.rating-prompt{font-size:12px;color:var(--muted);margin:0 0 12px}.study-controls #reveal+.rating-prompt{margin:12px 0}.bury-button{min-height:44px;padding:10px 20px;margin-top:8px;border:0;background:transparent;color:#64745d;font-size:12px}
@media(max-width:650px){
 aside{padding:14px 18px}.brand{font-size:24px}nav{position:fixed;bottom:0;left:0;right:0;z-index:10;margin:0;padding:7px 8px calc(7px + env(safe-area-inset-bottom));border-top:1px solid var(--border);background:#f1f4ec;display:grid;grid-template-columns:repeat(3,1fr)}nav button{min-height:48px;justify-content:center;flex-wrap:wrap;font-size:11px;padding:8px 4px}nav button[data-view=cards]{display:none}nav button[data-view=practice]{order:-1}nav button span{white-space:nowrap}main{padding:16px 16px calc(90px + env(safe-area-inset-bottom))}header{padding-bottom:15px}button,.text-button{min-height:44px}input,select,textarea{font-size:16px}.page-heading{flex-wrap:wrap}dialog{max-height:calc(100dvh - 24px);overflow:auto}
 body[data-view=practice] header{position:absolute;top:9px;right:16px;border:0;padding:0}body[data-view=practice] header>div{display:none}body[data-view=practice] header .button{min-height:36px;padding:8px 12px}body[data-view=practice] footer{display:none}#practice .page-heading{margin:4px 0 17px}#practice .page-heading .eyebrow{display:none}#practice h1{font-size:24px}#practice .page-heading p{font-size:12px;margin-top:5px}.study-filters{padding:10px 12px}.study-filters summary{min-height:24px;font-size:11px}.study-filters .filters label{min-width:100%}.session-summary{margin:14px auto 10px;font-size:10px}.session-summary>span:last-child{display:none}.study-area{margin:0}.flashcard{padding:22px 18px;min-height:clamp(200px,34dvh,380px);border-radius:12px}.flashcard .content{font-size:25px;padding:24px 0;line-height:1.5}.flashcard .eyebrow{font-size:9px;overflow-wrap:anywhere}.study-controls{position:sticky;bottom:calc(70px + env(safe-area-inset-bottom));background:#f8f9f5;padding:12px 0 0;z-index:2}.ratings{gap:7px}.ratings button{min-height:62px;font-size:13px;touch-action:manipulation}.ratings button small{font-size:11px}.rating-prompt{font-size:11px;margin-bottom:9px}.bury-button{margin:3px 0 0}.study-tip,.shortcut{display:none}.study-controls #reveal{min-height:56px}.table-wrap{border:0;background:transparent}table,tbody,tr,td{display:block;width:100%;max-width:none}thead{display:none}tbody tr{background:white;border:1px solid var(--border);border-radius:10px;margin-bottom:12px;padding:10px 15px}td{padding:9px 0;border:0}td:last-child{display:flex;justify-content:flex-end;border-top:1px solid var(--border)}td .front,td .back{-webkit-line-clamp:3}.pagination{gap:10px;flex-wrap:wrap}.deck-bottom{flex-wrap:wrap}
}
@media(max-width:360px){nav button{font-size:10px}.ratings{gap:5px}.ratings button{font-size:12px}#practice h1{font-size:22px}}
.study-filters summary{display:flex;align-items:center;gap:12px;list-style:none;min-height:32px}
.study-filters summary::-webkit-details-marker{display:none}
.study-filters summary::before{content:'›';font-size:20px;transition:transform .15s}
.study-filters[open] summary::before{transform:rotate(90deg)}
.study-filters summary .filter-title{float:none;flex-shrink:0;max-width:none;color:var(--green);font-weight:600}
.study-filters summary #study-scope{float:none;margin-left:auto;min-width:0;text-align:right}
.overview-actions{display:flex;gap:16px;justify-content:center;align-items:center;margin-top:36px;padding-top:22px;border-top:1px solid var(--border)}@media(max-width:650px){.overview-actions{flex-wrap:wrap}}
.sync-log{list-style:none;margin:0;padding:0;max-height:50vh;overflow:auto;font-size:12px;line-height:1.8;color:var(--muted)}.sync-log li{padding:5px 2px;border-bottom:1px solid var(--border);white-space:pre-wrap;word-break:break-word}
/* Startup loader: shown until auth state resolves (see auth.js). */
.startup-loader{position:fixed;inset:0;display:grid;place-items:center;background:var(--canvas);z-index:50;color:var(--green)}.loader-brand{display:flex;align-items:baseline;font-size:31px;font-weight:800;letter-spacing:-1.5px;animation:loader-pulse 1.6s ease-in-out infinite}.loader-brand .brand-dot{color:#a1ac66}@keyframes loader-pulse{0%,100%{opacity:.4}50%{opacity:1}}
/* Press feedback: a subtle dip on press, smooth color transitions on hover/focus. */
button:not(:disabled){transition:transform .08s ease,filter .12s ease,outline-color .12s ease}
button:not(:disabled):active{transform:translateY(1px)}
.icon-button:not(:disabled):active{transform:translateY(1px) scale(.92)}
/* On mobile, card management lives on the Decks page (the 'My cards' nav item is hidden). */
.deck-cards{display:none}@media(max-width:650px){.deck-cards{display:inline-block}}
/* Conflicts need a decision: a warning bar with an obvious action, plus the auto-opened dialog. */
#conflict-banner{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 17px;border-radius:6px;margin-top:16px;font-size:12px;background:#faf0df;color:#7c5426;border:1px solid #e6c99c;box-shadow:0 2px 8px #7c54260d}
/* Passkey management: one row per device, actions right-aligned. */
.passkey-list{list-style:none;margin:0;padding:0;font-size:13px}.passkey-list li{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 2px;border-bottom:1px solid var(--border)}.passkey-list li:last-child{border-bottom:0}#passkey-signin{margin-top:14px;width:100%}
/* AI chat on a card answer. */
.ai-thread{max-height:45vh;overflow:auto;display:flex;flex-direction:column;gap:10px;padding:4px 2px 16px;-webkit-overflow-scrolling:touch;overscroll-behavior:contain}.ai-turn{max-width:88%;padding:11px 14px;border-radius:10px;font-size:13px;line-height:1.6;white-space:normal;word-break:break-word}.ai-turn.assistant{background:#eef1e4;color:#2b3a2e;border:1px solid var(--border);align-self:flex-start}.ai-turn.user{background:var(--green);color:#fff;align-self:flex-end;border-radius:10px 10px 2px 10px}.ai-turn p{margin:0 0 8px}.ai-turn p:last-child{margin-bottom:0}.ai-turn h2,.ai-turn h3,.ai-turn h4{margin:10px 0 6px;line-height:1.3}.ai-turn h2{font-size:15px}.ai-turn h3{font-size:14px}.ai-turn h4{font-size:13px}.ai-turn ul{margin:6px 0 8px;padding-left:18px}.ai-turn li{margin:3px 0}.ai-turn code{font-family:ui-monospace,Menlo,monospace;font-size:12px;background:#00000014;padding:1px 4px;border-radius:4px}.ai-turn pre{padding:10px 12px;border-radius:8px;background:#101613;color:#e4eae5;overflow-x:auto;margin:8px 0}.ai-turn pre code{background:none;padding:0}.ai-turn a{color:#2f6b4f;text-decoration:underline}#ai-form{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin-top:14px;padding-top:14px;border-top:1px solid var(--border)}#ai-form input{flex:1;min-width:0;min-height:44px}#ai-form .form-error{flex-basis:100%;margin:0}#ai-form .button{margin-left:auto}
/* Touch polish: controls never select text, never double-tap-zoom, never show the iOS grey flash. */
button,a,select,.text-button,.icon-button,summary,label,nav,[role=button]{-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation}
/* Text content stays selectable: answers should be copyable, prompts may be quoted. */
.flashcard .content,input,textarea,.front,.back,td,.sync-log{-webkit-user-select:text;user-select:text}
/* Inner scroll areas get native momentum scrolling and don't chain to the page. */
.sync-log,.passkey-list,table,.table-wrap{-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
dialog{overscroll-behavior:contain}
