:root{--ink:#253d37;--green:#28584c;--light:#edf3ed;--pink:#f2ddd9;--muted:#6b7b74;--line:#dce4dd;--bg:#f7f8f3;--white:#fff;--orange:#95652d}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font:15px/1.75 -apple-system,BlinkMacSystemFont,'Hiragino Kaku Gothic ProN','Noto Sans JP',sans-serif}button,input,textarea,select{font:inherit}button,a{touch-action:manipulation}button{cursor:pointer;border:1px solid var(--line);border-radius:12px;background:white;color:var(--ink);padding:11px 18px;min-height:46px;transition:background .15s}button:hover{background:#edf3ed}button:disabled{opacity:.5;cursor:wait}a{color:var(--green);text-decoration:none}a:hover{text-decoration:underline}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #b98568;outline-offset:3px}.primary{background:var(--green);color:white;border-color:var(--green)}.primary:hover{background:#1e443b}.soft{background:var(--light)}.pink{background:#f9eeeb;border-color:#ead4ce}.danger{color:#a43c38}.small{font-size:12px;color:var(--muted)}.muted{color:var(--muted)}h1,h2,h3,p{margin:0 0 16px}h1{font-size:30px;line-height:1.45;letter-spacing:.02em}h2{font-size:21px}h3{font-size:16px}.eyebrow{font-size:11px;letter-spacing:.18em;font-weight:700;color:var(--muted)}.brand{display:flex;align-items:center;gap:10px;letter-spacing:.15em;font-weight:700;line-height:1.3}.brand small{display:block;letter-spacing:.12em;font-size:10px;font-weight:500;color:var(--muted);margin-top:5px}.flower{display:grid;place-items:center;background:var(--pink);width:42px;height:42px;border-radius:14px;font-size:29px;color:#9b625a;flex-shrink:0}.shell{display:grid;grid-template-columns:235px minmax(0,1fr);min-height:100vh}.sidebar{padding:32px 22px;position:sticky;top:0;height:100vh;border-right:1px solid var(--line);display:flex;flex-direction:column;gap:32px;background:#fafbf7}.nav{display:grid;gap:8px}.nav a{display:flex;align-items:center;gap:14px;padding:13px;border-radius:10px;color:var(--muted);font-size:14px}.nav a.active{background:#e5eee4;color:var(--green);font-weight:600}.nav svg{width:20px;height:20px}.sidebar-bottom{margin-top:auto;font-size:12px;color:var(--muted)}.profile{display:flex;gap:10px;align-items:center;margin-top:20px}.avatar{width:36px;height:36px;background:#e3eadf;border-radius:50%;display:grid;place-items:center}.main{padding:30px 46px 50px;max-width:1400px;width:100%;margin:auto}.topbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:28px;font-size:12px}.pill{padding:4px 11px;border-radius:20px;background:#e6efe7;color:#3c6653;font-size:11px;display:inline-block;white-space:nowrap}.pill.wait{background:#f9edda;color:#8e642e}.pill.done{background:#e4edf6;color:#486480}.hero{display:grid;grid-template-columns:1.35fr 1fr;background:#eaf0e6;border:1px solid #dce5d7;padding:34px;border-radius:22px;position:relative;overflow:hidden;margin:22px 0}.hero h1{font-size:32px;margin:10px 0 16px}.hero p{color:#617364;font-size:14px}.hero .primary{margin-top:10px}.illustration{display:grid;place-items:center;position:relative;min-height:200px}.notebook{transform:rotate(-8deg);width:200px;min-height:160px;border-radius:12px;background:#fffef9;box-shadow:9px 12px 0 #d4dfcf;padding:24px;border-left:12px solid #e6c6bd}.notebook .formula{font:italic 29px Georgia,serif;margin:15px 0;color:var(--green)}.notebook .line{height:1px;background:#e3e6dc;margin:14px 0}.spark{position:absolute;right:10%;top:10%;color:#b27464;font-size:32px}.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin:24px 0}.stat{border:1px solid var(--line);border-radius:15px;padding:20px;background:white}.stat strong{font-size:28px;font-weight:600;margin-right:8px}.stat .small{display:block;margin-bottom:8px}.grid2{display:grid;grid-template-columns:1.65fr 1fr;gap:24px}.card{background:white;border:1px solid var(--line);border-radius:17px;padding:25px;margin-bottom:20px}.section-head{display:flex;align-items:center;justify-content:space-between;margin:26px 0 14px}.section-head h2{margin:0}.rows{display:grid;gap:10px}.row{display:flex;align-items:center;gap:15px;padding:17px;border:1px solid var(--line);border-radius:13px;background:white;width:100%;text-align:left}.subject-icon{width:44px;height:44px;border-radius:12px;background:#eff2e9;display:grid;place-items:center;font:20px Georgia,serif;flex-shrink:0}.row-body{flex:1;min-width:0}.row-title{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500;max-width:100%}.row .small{font-size:11px}.empty{padding:30px;text-align:center;color:var(--muted);border:1px dashed var(--line);border-radius:12px}.notice{padding:12px 16px;border-radius:10px;background:#f6f0e4;color:#7d6843;font-size:12px;margin-bottom:20px}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}label{display:block;font-size:13px;font-weight:600;margin-bottom:17px}input,select,textarea{display:block;width:100%;border:1px solid #cbd7ce;background:#fff;border-radius:9px;padding:12px;margin-top:7px;color:var(--ink);font-size:16px}textarea{resize:vertical;min-height:120px}input[type=checkbox]{width:auto;display:inline-block;margin-right:8px}input[type=file]{font-size:12px}.upload{border:2px dashed #cbd9cc;border-radius:14px;background:#fafcf8;padding:22px;text-align:center;margin:15px 0}.upload svg{width:30px;height:30px;color:var(--green)}.upload input{background:transparent;border:0}.preview{max-height:260px;max-width:100%;object-fit:contain;border-radius:12px;margin:12px auto;display:block}.actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center}.actions>*{flex-grow:0}.full{width:100%}.form-foot{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-top:22px}.progress{height:7px;border-radius:8px;background:#e9eee6;overflow:hidden;margin:12px 0}.progress i{display:block;background:#658a6c;height:100%}.lesson-card{border-radius:12px;background:#f4f6ef;padding:15px;margin:12px 0}.lesson-card button{text-align:left;width:100%;background:transparent;border:0;padding:0;min-height:35px;font-size:13px}.chat-layout{display:grid;grid-template-columns:1fr 270px;gap:22px;align-items:start}.chat-card{border:1px solid var(--line);background:#fff;border-radius:18px;overflow:hidden}.chat-head{padding:18px 22px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:center}.chat-head p{margin:0}.messages{padding:24px;max-height:54vh;min-height:300px;overflow-y:auto;scroll-behavior:smooth}.message{margin-bottom:22px;max-width:92%}.message.student{margin-left:auto}.message-label{font-size:11px;color:var(--muted);margin-bottom:5px}.message.student .message-label{text-align:right}.bubble{padding:16px 19px;border-radius:0 15px 15px;background:#f0f4ec;white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px;line-height:1.9}.student .bubble{background:#f8eeeb;border-radius:15px 0 15px 15px}.teacher .bubble{background:#eef2f8;border:1px solid #d5dfeb}.system .bubble{background:#faf8ef;color:#716842;font-size:12px}.composer{padding:18px;border-top:1px solid var(--line)}.composer textarea{min-height:72px;margin:10px 0}.quick{display:flex;gap:8px;flex-wrap:wrap}.quick button{font-size:12px;min-height:40px;padding:7px 10px}.question-image{display:block;width:100%;max-height:320px;object-fit:contain;background:#f6f7f2;border:1px solid var(--line);border-radius:10px}.question-text{white-space:pre-wrap;overflow-wrap:anywhere}.katex-display{overflow:auto;max-width:100%;padding:4px}.tabs{display:flex;gap:8px;flex-wrap:wrap;margin:18px 0}.tabs button.active{background:var(--green);color:white}.filters{display:flex;gap:12px;align-items:center;margin-bottom:18px}.filters input,.filters select{margin:0}.student-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:15px}.student-card{text-align:left;background:white;border-radius:14px;padding:20px;border:1px solid var(--line)}.student-card h3{margin:12px 0 4px}.bar-row{display:grid;grid-template-columns:60px 1fr 30px;gap:10px;align-items:center;margin:12px 0;font-size:12px}.bar-row .progress{margin:0}.login-layout{min-height:100vh;display:grid;grid-template-columns:1.05fr 1fr}.login-art{padding:50px 10%;background:#e8eee3;display:flex;flex-direction:column;justify-content:center}.login-art .brand{margin-bottom:65px}.login-art h1{font-size:44px;line-height:1.65;font-weight:600}.login-art .illustration{margin:15px 0 30px}.login-side{display:flex;justify-content:center;align-items:center;padding:35px}.login-form{width:100%;max-width:410px}.login-form h2{font-size:25px}.demo-box{background:#f1f4eb;border-radius:12px;padding:16px;margin-top:26px}.demo-buttons{display:flex;gap:8px;flex-wrap:wrap}.demo-buttons button{font-size:12px;padding:8px 12px}.error{color:#a34237;font-size:13px;margin-top:12px}.mobile-brand{display:none}#toast{position:fixed;bottom:26px;left:50%;transform:translateX(-50%);background:#294b40;color:white;border-radius:12px;padding:14px 24px;z-index:30;box-shadow:0 8px 30px #0002;max-width:90vw;display:none}dialog{border:1px solid var(--line);border-radius:18px;width:500px;max-width:92vw;padding:28px;color:var(--ink)}dialog::backdrop{background:#183b3255;backdrop-filter:blur(3px)}.loading{padding:50px}.back{display:inline-block;margin-bottom:18px;font-size:13px}.login-note{font-size:12px;color:var(--muted);margin-top:20px}.table-wrap{overflow:auto}table{border-collapse:collapse;width:100%;font-size:13px}th,td{text-align:left;padding:13px;border-bottom:1px solid var(--line)}th{color:var(--muted);font-weight:500}.hidden{display:none!important}
@media(min-width:1400px){.main{padding-top:40px}}@media(max-width:1100px){.main{padding:25px}.shell{grid-template-columns:200px 1fr}.sidebar{padding:26px 16px}.chat-layout{grid-template-columns:1fr}.chat-aside{order:-1}.chat-aside .card{padding:15px;margin-bottom:0}.chat-aside .question-image{max-height:180px}.chat-aside .advice{display:none}.hero{padding:25px}.hero h1{font-size:27px}.notebook{width:160px}.grid2{grid-template-columns:1fr}}@media(max-width:700px){body{font-size:14px}.shell{display:block}.sidebar{position:fixed;bottom:0;top:auto;height:auto;width:100%;padding:7px 8px calc(7px + env(safe-area-inset-bottom));z-index:20;border-top:1px solid var(--line);background:#fff}.sidebar>.brand,.sidebar-bottom{display:none}.nav{display:flex;justify-content:space-around;gap:0}.nav a{flex:1;flex-direction:column;gap:3px;font-size:10px;padding:7px 2px;line-height:1.4}.nav svg{width:21px;height:21px}.main{padding:18px 17px 100px}.topbar{margin-bottom:22px}.mobile-brand{display:flex}.topbar>.muted{display:none}.brand{font-size:13px}.brand .flower{width:32px;height:32px;font-size:23px}.brand small{font-size:8px}h1{font-size:24px}.hero{display:block;padding:25px 22px;margin-top:18px}.hero h1{font-size:27px}.hero .illustration{display:none}.hero .primary{width:100%}.stats{gap:9px;margin:17px 0}.stat{padding:13px 10px}.stat strong{font-size:24px}.stat .small{font-size:10px}.grid2{gap:0}.card{padding:20px}.section-head h2{font-size:18px}.row{padding:13px 10px;gap:10px}.row .pill{font-size:9px;padding:3px 7px}.subject-icon{width:36px;height:36px}.form-grid{grid-template-columns:1fr;gap:0}.form-foot{display:block}.form-foot button{width:100%;margin-top:12px}.chat-layout{gap:12px}.messages{padding:18px 13px;min-height:260px;max-height:50vh}.bubble{padding:13px}.message{max-width:96%}.composer{padding:13px}.composer .actions button{flex:1}.student-grid{grid-template-columns:1fr}.student-card{padding:15px}.login-layout{display:block}.login-art{padding:25px}.login-art .brand{margin:0 0 22px}.login-art h1{font-size:28px;margin:0}.login-art p,.login-art .illustration{display:none}.login-side{padding:27px 22px}.filters{flex-wrap:wrap}.filters>*{min-width:0;flex:1}.notice{font-size:11px}.chat-head{padding:14px}.topbar .pill{font-size:9px}.actions button{font-size:12px}}
summary{cursor:pointer;font-weight:600;min-height:32px}details[open] summary{margin-bottom:15px}@media(max-width:700px){.messages{max-height:38vh}.chat-aside .card{padding:12px 16px}.chat-layout{gap:10px}.chat-aside details:not([open]) summary{margin:0}.composer textarea{min-height:65px}}
/* Grid children must be allowed to shrink when a question contains a long line. */
.main,.grid2>*,.chat-layout>*,.rows,.row{min-width:0}
.grid2{grid-template-columns:minmax(0,1.65fr) minmax(0,1fr)}
.chat-layout{grid-template-columns:minmax(0,1fr) 270px}
@media(max-width:1100px){.grid2,.chat-layout{grid-template-columns:minmax(0,1fr)}}
