/* Foundations v0.1: the app's own rules, on top of wf.css (the ported wireframe). Same tokens, same components. */
html,body{margin:0;height:100%;background:#252320;-webkit-text-size-adjust:100%;text-size-adjust:100%}
html[data-theme="light"],html[data-theme="light"] body{background:#F3F1EC}
body{overscroll-behavior:none;-webkit-tap-highlight-color:transparent}
#root{position:fixed;inset:0;display:flex;justify-content:center}
.app{width:100%;height:100%;display:flex;justify-content:center}

/* the phone frame becomes the real viewport; safe areas come from the device */
.app .ph{width:100%;max-width:520px;height:100%;--safe-t:max(12px, env(safe-area-inset-top, 0px));--safe-b:max(14px, env(safe-area-inset-bottom, 0px));
 padding-left:env(safe-area-inset-left, 0px);padding-right:env(safe-area-inset-right, 0px);position:relative}
.app .ph{--t-cap:13px}
.app .sheet{max-height:calc(100% - var(--safe-t) - 12px);overflow-y:auto;overscroll-behavior:contain;z-index:20;box-sizing:border-box}
.app .dim{z-index:19;border:0;padding:0;margin:0;width:100%;cursor:pointer}
.app .sheet .sh-hd{display:flex;justify-content:space-between;align-items:center;gap:10px}
.app button{font-family:inherit}
.app a.go,.app button.go{display:grid;place-items:center;text-decoration:none;color:#FFFFFF}
.app a.go:hover{color:#FFFFFF}
.app .ghost{border:0;font-family:inherit;cursor:pointer;text-decoration:none;display:grid;place-items:center}
.app a.ghost:hover{color:var(--text)}
.app [hidden]{display:none !important}

/* inputs at 16px or more so iPhone doesn't zoom */
.app input,.app textarea,.app select{font-size:17px !important}
.app textarea{font-family:'Nunito',sans-serif;font-weight:700;color:var(--text);background:var(--bg);border:0;border-radius:12px;padding:12px 14px;resize:vertical;min-height:104px;width:100%;box-sizing:border-box;line-height:1.4;outline:0}
.app textarea::placeholder{color:var(--muted2)}
.app textarea:focus-visible,.app .qin:focus-within,.app .srch:focus-within{outline:3px solid var(--bar-best);outline-offset:1px}
.app .qin input{min-height:44px}

/* drill: the content block fits the screen (autofit in app.js tunes --fitgap and the type steps) */
.app .d99.fit{gap:var(--fitgap,10px)}
.app .d99.fit .blk{gap:calc(var(--fitgap,10px) - 2px)}

/* tab bar: three tabs */
.app .nav{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}
.app .nav a{min-height:48px}

/* Today */
.app .tb106 .tbst{margin-right:auto}
.app .t106 .tiles106 small{white-space:normal}
.app .wl106 .st{min-height:44px}
.app .resume-note{margin:0}

/* Path: every drill in a stage sheet; locked ones are marked */
.app .sdr .lk{display:grid;place-items:center;width:32px;height:32px;border-radius:9px;background:var(--surface);color:var(--muted)}
.app .sdr small{white-space:normal}
.app .sdr.dn .k{background:var(--acc-soft);color:var(--teal-text)}
.app .sdr.dn .k svg{display:block}
.app .sdl{display:flex;flex-direction:column;gap:8px}
.app .pst-lk .pst-b{color:var(--muted)}

/* Classroom */
.app .cl-empty{margin:0;font-size:var(--t-sub);font-weight:700;color:var(--muted);line-height:1.45}

/* Profile */
.app .pf .lrow{border:0;width:100%;box-sizing:border-box;font-family:inherit;text-align:left;cursor:pointer}
.app .pf .lrow.warn b{color:var(--warn-text)}
.app .swr{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:center;min-height:60px}
.app .swr b{display:block;font-size:var(--t-sub);font-weight:900;color:var(--text)}
.app .swr small{display:block;font-size:var(--t-foot);font-weight:700;color:var(--muted);line-height:1.35;margin-top:2px}
.app .sw{position:relative;width:64px;height:44px;border:0;background:transparent;padding:0;cursor:pointer;flex:none}
.app .sw::before{content:"";position:absolute;left:4px;right:4px;top:8px;height:28px;border-radius:999px;background:var(--raised);box-shadow:inset 0 0 0 2px var(--outline)}
.app .sw::after{content:"";position:absolute;left:8px;top:12px;width:20px;height:20px;border-radius:50%;background:var(--text);transition:transform .15s ease-out}
.app .sw[aria-checked="true"]::before{background:var(--acc);box-shadow:none}
.app .sw[aria-checked="true"]::after{transform:translateX(28px);background:#FFFFFF}
.app .pfver{margin:4px 2px 0;font-size:var(--t-foot);font-weight:700;color:var(--muted)}

/* Ask the coach */
.app .aiw{margin:0;font-size:var(--t-sub);font-weight:800;color:var(--muted)}
.app .aif{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:var(--t-sub);font-weight:800;color:var(--text)}
.app .aif .ghost{min-height:44px;padding:0 14px;font-size:var(--t-sub)}
.app .ask-err{margin:0;font-size:var(--t-sub);font-weight:800;color:var(--warn-text)}
.app .sheet .cp{min-height:44px}
.app .ask-left{margin:0;font-size:var(--t-foot);font-weight:700;color:var(--muted)}

/* Send feedback */
.app .fbs label{display:flex;flex-direction:column;gap:6px}
.app .fbs .nml{font-size:var(--t-sub);font-weight:900;color:var(--text)}
.app .fbs .nmh{margin:0;font-size:var(--t-foot);font-weight:700;color:var(--muted);line-height:1.4}
.app .fbs .qin{background:var(--bg)}
.app .fbseg{grid-template-columns:repeat(5,minmax(0,1fr));background:var(--bg)}
.app .fbseg button[aria-pressed="true"]{background:var(--acc);color:#FFFFFF}
.app .fbst{margin:0;font-size:var(--t-sub);font-weight:800;line-height:1.4}
.app .fbst.ok{color:var(--teal-text)}
.app .fbst.err{color:var(--warn-text)}
.app .fbs .go{flex:none;width:100%;min-height:56px}
.app .fbrow{margin-top:2px}

/* confirm sheet (reset) */
.app .cfm-acts{display:flex;gap:12px}
.app .cfm-acts > *{flex:1 1 0;min-height:56px}

/* Job done: the progress block and the practice block keep the board's look */
.app .wd106 .pg99 .ln{white-space:normal}

/* toast for queued sends and offline notes */
.app .toast{position:absolute;left:16px;right:16px;bottom:calc(var(--safe-b) + 84px);z-index:30;padding:12px 14px;border-radius:14px;background:var(--inverse);color:var(--on-inverse);font-size:var(--t-sub);font-weight:800;line-height:1.35;box-shadow:var(--sh-pop)}

/* Admin and errors share nothing with this file */
.app .boot{margin:auto;color:var(--muted);font:800 15px 'Nunito',sans-serif}
.app .qin input:focus-visible,.app .srch input:focus-visible{outline:0}
.app .srch input{min-height:44px}
