
:root{--bg:#eafff2;--panel:#fbfffc;--ink:#0e1a36;--muted:#697083;--line:#cbe9d6;--navy:#13264a;--green:#16805f;--red:#b51f3d;--gold:#d99a00;--soft-green:#eef7ee;--soft-red:#fff4f3;--soft-gold:#fff8e6;--shadow:0 18px 45px rgba(40,32,18,.08)}
*{box-sizing:border-box} body{margin:0;background:var(--bg);color:var(--ink);font-family:-apple-system,BlinkMacSystemFont,"Hiragino Sans","Yu Gothic",Meiryo,sans-serif;font-weight:650} .topbar{height:72px;display:flex;align-items:center;justify-content:space-between;padding:0 20px;border-bottom:1px solid var(--line);background:rgba(255,250,240,.78);backdrop-filter:blur(10px);position:sticky;top:0;z-index:5}.brand{font-size:12px;letter-spacing:.18em;color:#12824e;font-weight:900}.topbar h1{font-size:22px;margin:2px 0 0}.home-btn,.pill,.small-btn{border:1px solid var(--line);background:#f8fff9;border-radius:14px;color:var(--ink);font-weight:900;padding:10px 15px;box-shadow:0 4px 12px rgba(0,0,0,.04);cursor:pointer}.home-btn{font-size:17px}.home{max-width:1120px;margin:32px auto}.hero{display:flex;gap:26px;align-items:center;background:#fbfffc;border:1px solid var(--line);border-radius:28px;padding:34px;box-shadow:var(--shadow)}.mark{width:78px;height:78px;border-radius:22px;background:#0f7b4c;color:white;display:grid;place-items:center;font-size:38px;font-weight:900}.hero h2{font-size:34px;margin:8px 0}.hero p{color:var(--muted);margin:0}.grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-top:20px}.card{background:#fbfffc;border:1px solid var(--line);border-radius:20px;padding:24px;min-height:116px;box-shadow:var(--shadow);cursor:pointer}.card:hover{transform:translateY(-1px)}.card h3{margin:0 0 12px;font-size:21px}.card p{margin:0;color:var(--muted)}.study{display:grid;grid-template-columns:58.5% 41.5%;height:calc(100vh - 72px)}.left,.right{padding:18px}.left{border-right:1px solid var(--line);overflow:auto}.right{overflow:auto}.toolbar{display:flex;align-items:center;gap:12px;margin-bottom:18px}.toolbar .spacer{flex:1}.qcard{background:rgba(255,250,240,.95);border:1px solid var(--line);border-radius:18px;margin:0 0 14px;padding:20px 18px;cursor:pointer;box-shadow:0 8px 20px rgba(0,0,0,.035)}.qcard.selected{background:var(--soft-green);outline:3px solid rgba(22,128,95,.20);border-color:#a8cdbf}.qhead{display:flex;align-items:center;gap:10px;margin-bottom:12px}.qno{font-size:18px;font-weight:950}.section{font-size:12px;color:var(--muted)}.badge{margin-left:auto;border-radius:999px;padding:6px 10px;background:white;border:1px solid var(--line);font-size:12px}.badge.easy{background:#e8f7ef;color:#096a4a}.badge.sus{background:#fff1c7;color:#865b00}.badge.bad{background:#ffe4e7;color:#a10d2c}.question{font-size:17px;line-height:1.85;white-space:pre-wrap}.command{background:#fbfffc;border:1px solid var(--line);border-radius:22px;padding:18px;box-shadow:var(--shadow)}.cmdtop{display:flex;justify-content:space-between;align-items:start}.label{font-size:11px;letter-spacing:.18em;color:#12824e}.cmdno{font-size:28px;font-weight:950}.answer-row{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:14px 0}.big{border:0;border-radius:14px;color:white;padding:20px;font-size:24px;font-weight:950;cursor:pointer}.ok{background:var(--green)}.ng{background:var(--red)}.feedback{min-height:48px;border:1px dashed var(--line);border-radius:16px;padding:14px;color:var(--muted);background:rgba(255,255,255,.45)}.rank-row{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin:12px 0}.rank{border:0;border-radius:12px;color:white;padding:14px;font-size:18px;font-weight:950;cursor:pointer}.rank.easy{background:#159b70}.rank.sus{background:#dfa000}.rank.bad{background:#d51d3f}.explain{border-top:1px solid var(--line);margin-top:12px;padding-top:12px}.explain summary{cursor:pointer;font-size:17px;font-weight:950}.exp-body{line-height:1.8;font-size:15px;margin-top:10px}.selects{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:10px}.selects select{width:100%;border:1px solid var(--line);border-radius:10px;padding:8px;background:white}.memoBox{background:#fbfffc;border:1px solid var(--line);border-radius:22px;margin-top:14px;padding:18px;box-shadow:var(--shadow)}.tabs{display:flex;gap:10px;margin-bottom:10px}.tab{border:0;border-radius:10px;background:#fff;padding:10px 14px;font-weight:950;cursor:pointer}.tab.active{background:#0f7b4c;color:white}textarea{width:100%;min-height:160px;resize:vertical;border:1px solid var(--line);border-radius:16px;padding:14px;font-size:16px;line-height:1.7;background:white}.memo-actions{display:flex;gap:10px;margin-top:10px}.hidden{display:none}.stats{display:grid;grid-template-columns:repeat(5,1fr);gap:10px;margin-top:16px}.stat{background:#fbfffc;border:1px solid var(--line);border-radius:16px;padding:16px}.stat b{font-size:28px} .chapters{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}.chapter{padding:18px;border:1px solid var(--line);border-radius:16px;background:#fbfffc;cursor:pointer}.search{flex:0 0 260px;border:1px solid var(--line);border-radius:12px;padding:10px 12px;background:white;font-weight:700}@media(max-width:1100px){.study{grid-template-columns:1fr}.right{border-top:1px solid var(--line)}.grid{grid-template-columns:repeat(2,1fr)}}

.explain.locked{padding:14px 16px; border:1px dashed #d8cbb8; border-radius:14px; color:#6f6a60; background:#fffdf7; margin-top:12px;}
.explain.locked p{margin:6px 0 0;}
.copyline{display:flex;align-items:center;gap:10px;margin:10px 0 8px 0;}
.copy-btn{background:#14224a;color:white;border-color:#14224a;}
.copyhint{font-size:12px;color:#6b7280;}

.syncbox{margin-top:18px;background:#fbfffc;border:1px solid var(--line);border-radius:22px;padding:24px;box-shadow:var(--shadow);display:grid;gap:14px;max-width:850px}.sync-input{width:100%;border:1px solid var(--line);border-radius:12px;padding:12px 14px;background:white;font-size:16px;font-weight:700;color:var(--ink)}.checkline{display:flex;gap:10px;align-items:center;font-weight:900}.sync-actions{display:flex;gap:10px;flex-wrap:wrap}.sync-status{padding:12px 14px;border:1px dashed var(--line);border-radius:14px;background:#fffdf7}.sync-note{color:var(--muted);font-size:14px;margin:0}

.answer-row.wide{display:block}.answer-row .choice{background:#127d4f}.multi-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:10px;margin-bottom:10px}.big.choice.chosen{outline:4px solid rgba(18,125,79,.28);filter:brightness(1.18)}.big.submit{width:100%;margin-top:4px}.copyhint{font-size:12px;color:var(--muted);margin-left:8px}.copyline{margin:10px 0}.qcard{border-left:6px solid rgba(18,125,79,.25)}


/* clean-v4: 長い解説をカード内で読みやすくする */
.exp-body{
  line-height:1.78;
  font-size:15px;
  max-height:58vh;
  overflow:auto;
  padding-right:8px;
}
.exp-result{
  position:sticky;
  top:0;
  z-index:1;
  background:rgba(255,255,255,.96);
  border-bottom:1px solid rgba(12,82,53,.16);
  padding:6px 0 8px;
  margin-bottom:8px;
  font-weight:900;
}
.exp-para{
  margin:0 0 10px;
  padding:0;
}
.exp-para.key{
  margin-top:14px;
  padding:8px 10px;
  border-left:4px solid #11854f;
  background:rgba(17,133,79,.07);
  border-radius:8px;
  font-weight:800;
}
.explain summary{
  position:sticky;
  top:0;
  z-index:2;
  background:rgba(250,255,252,.98);
  padding:8px 0;
}
.copyline{
  position:sticky;
  top:38px;
  z-index:2;
  background:rgba(250,255,252,.98);
  padding:6px 0 10px;
}
@media(max-width: 760px){
  .exp-body{max-height:52vh;font-size:14.5px;line-height:1.72;}
  .exp-para.key{padding:7px 9px;}
}


/* clean-v5: 解説の不自然なぶつ切りを抑え、見出し＋本文の読み物カードにする */
.exp-body{
  line-height:1.86;
  font-size:15.5px;
  max-height:58vh;
  overflow:auto;
  padding:0 10px 8px 2px;
}
.exp-result{
  position:sticky;
  top:0;
  z-index:1;
  background:rgba(255,255,255,.98);
  border-bottom:1px solid rgba(12,82,53,.16);
  padding:8px 0 10px;
  margin-bottom:12px;
  font-weight:950;
}
.exp-lead{
  margin:10px 0 16px;
  padding:12px 14px;
  border-radius:12px;
  background:#f7fbf8;
  border:1px solid rgba(17,133,79,.16);
  font-weight:850;
  line-height:1.85;
}
.exp-heading{
  margin:18px 0 8px;
  padding:8px 12px;
  border-left:5px solid #11854f;
  background:#eef8f2;
  border-radius:10px;
  font-weight:950;
  line-height:1.45;
}
.exp-para{
  margin:0 0 13px;
  padding:0 2px;
  line-height:1.9;
  font-weight:720;
}
.exp-para + .exp-heading{margin-top:20px;}
.explain summary{
  position:sticky;
  top:0;
  z-index:2;
  background:rgba(250,255,252,.99);
  padding:8px 0;
}
.copyline{
  position:sticky;
  top:38px;
  z-index:2;
  background:rgba(250,255,252,.99);
  padding:6px 0 10px;
}
@media(max-width: 760px){
  .exp-body{max-height:52vh;font-size:14.8px;line-height:1.78;}
  .exp-para{line-height:1.82;}
  .exp-heading{margin-top:15px;}
}


/* clean-v6: 解説を「①について → 説明」のまとまりで見せる */
.exp-answer{border-left:5px solid #0f7b4c;background:#f3fbf6;border-radius:12px;padding:12px 14px;margin:12px 0 14px;font-weight:900;line-height:1.75;}
.exp-section-block{margin:18px 0 20px;border:1px solid #d9eadf;border-radius:16px;background:#fff;overflow:hidden;}
.exp-heading{display:block;background:#edf7f1;border-left:6px solid #0f7b4c;padding:11px 14px;font-size:17px;font-weight:950;line-height:1.5;color:#10223b;}
.exp-section-body{padding:12px 16px 14px;}
.exp-para{margin:0 0 12px;line-height:1.95;font-size:16px;font-weight:750;}
.exp-para:last-child{margin-bottom:0;}
.exp-lead{display:none;}


/* clean-v8: 解説と問題文の可読性調整 */
.qtext, .question, .card { line-height: 1.9; }
.exp-body { line-height: 1.9; }
.exp-section-block { margin: 18px 0 20px; padding: 0 0 0 10px; border-left: 4px solid #15935f; }
.exp-heading { display: inline-block; margin: 0 0 8px; padding: 6px 10px; border-radius: 10px; background: #eef7f1; font-weight: 800; color: #173b2a; }
.exp-section-body { padding-left: 2px; }
.exp-para { margin: 0 0 12px; }
.exp-answer { margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; background: #fffdf0; font-weight: 700; }

/* clean-v9-source */
.card .source, .source { display:block; margin-bottom:10px; }

/* clean-v10-polish */
.exp-body{line-height:1.85;}
.exp-section-block{margin:14px 0 18px; padding:0 0 0 10px; border-left:4px solid var(--accent, #0b8f55);}
.exp-heading{font-weight:800; font-size:1.05em; margin:0 0 8px; padding:6px 10px; background:rgba(0,0,0,.04); border-radius:8px;}
.exp-section-body .exp-para{margin:8px 0;}
.exp-answer{font-weight:800; margin:8px 0 14px; padding:8px 10px; border-radius:8px; background:rgba(0,0,0,.035);}
.qtext{line-height:1.75;}


/* clean-v12: source/肢番号の余白を圧縮し、カード密度を上げる */
.qcard{padding:14px 16px;margin-bottom:10px;}
.qhead{margin-bottom:8px;}
.question{font-size:17px;line-height:1.65;white-space:normal;}
.qtext{line-height:1.68;white-space:normal;}
.source{display:block;margin:0 0 6px;font-size:15px;font-weight:950;color:#14224a;}
.qtext br{display:block;content:"";margin:3px 0;}
.left,.right{padding:14px;}
.toolbar{margin-bottom:12px;gap:10px;}
@media(max-width:760px){.qcard{padding:13px 14px}.question{font-size:16px;line-height:1.62}.source{font-size:14px}}


/* clean-v13: 会話・語句群・選択肢の読みやすさを改善 */
.qtext{line-height:1.72;}
.qtext br{display:block;content:"";margin:4px 0;}
.source{margin-bottom:8px;}


/* clean-v14: 問題文の会話・語句群・選択肢をさらに整形 */
.qtext{line-height:1.74;}
.qtext br{display:block;content:"";margin:4px 0;}
.source{margin-bottom:10px;}


/* clean-v15: 会話問題の最終整形 */
.qtext{line-height:1.76;}
.qtext br{display:block;content:"";margin:4px 0;}
