:root{font-family:ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;color:#243b38;background:#f9f7f1;font-synthesis:none;font-smoothing:antialiased}
*{box-sizing:border-box}html{min-width:320px}body{margin:0}button,input,select{font:inherit}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.55}a{color:inherit;text-decoration:none}button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #e2a75f;outline-offset:3px}.loading{padding:50px;text-align:center;color:#6a7774}
.shell{min-height:100vh;display:grid;grid-template-columns:244px minmax(0,1fr)}.sidebar{background:#f1f4ee;border-right:1px solid #e3e7df;padding:32px 22px;display:flex;flex-direction:column;gap:32px;position:sticky;top:0;height:100vh}.brand{display:flex;gap:12px;align-items:center}.brand-mark{background:#286d67;color:white;width:43px;height:43px;display:grid;place-items:center;border-radius:15px;font-size:24px;font-weight:750;transform:rotate(-6deg)}.brand strong{font-family:Georgia,serif;color:#315a53;font-size:22px;letter-spacing:-.8px}.brand small{font-size:10px;color:#73918a;letter-spacing:1.7px;font-weight:700;display:block}.nav{display:flex;flex-direction:column;gap:8px}.nav button{border:0;text-align:left;background:transparent;border-radius:14px;padding:13px 14px;color:#62716e;font-size:15px;font-weight:620;display:flex;align-items:center;gap:12px;min-height:46px}.nav button.active{background:#dcebe3;color:#225d54}.nav .emoji{font-size:20px;width:25px;text-align:center}.side-foot{margin-top:auto;border-top:1px solid #dbe2d9;padding-top:20px}.avatar{height:38px;width:38px;display:grid;place-items:center;background:#dcebe3;border-radius:50%;font-size:19px}.profile{display:flex;align-items:center;gap:10px;font-size:13px}.profile strong{font-size:14px;display:block}.profile span{color:#8b9b96}.main{padding:40px clamp(22px,5.2vw,80px) 80px;max-width:1400px;width:100%;margin:0 auto}.topline{display:flex;justify-content:space-between;align-items:center;margin-bottom:38px}.eyebrow{font-size:12px;letter-spacing:2px;color:#8a9a93;font-weight:800;text-transform:uppercase}.topline .date{color:#798984;font-size:14px}.page-title{font-size:clamp(28px,3vw,42px);line-height:1.25;letter-spacing:-1.1px;font-weight:750;margin:0 0 10px;color:#244f49}.subtitle{font-size:15px;color:#74837e;line-height:1.7;margin:0}.section-title{font-size:20px;margin:34px 0 18px;color:#315b54}.pill{border:1px solid #dce8e1;border-radius:99px;padding:8px 13px;font-size:12px;color:#50756b;background:#f8fbf7;font-weight:700}
.hero{display:grid;grid-template-columns:1fr 250px;gap:20px;background:#dcebe3;border-radius:28px;padding:30px 34px;min-height:240px;overflow:hidden;position:relative}.hero h2{font-size:clamp(25px,2.7vw,38px);line-height:1.35;margin:12px 0;color:#25594f;letter-spacing:-.5px}.hero p{color:#597a70;line-height:1.7;max-width:440px;margin:0 0 20px;font-size:15px}.hero-art{display:grid;place-items:center;position:relative;font-size:112px;filter:drop-shadow(0 16px 10px #3e745329)}.hero-art:before{content:'';position:absolute;background:#b5d7c6;border-radius:50%;width:180px;height:180px;z-index:-1;transform:rotate(-14deg)}.btn{border:0;border-radius:14px;padding:13px 21px;background:#286d67;color:#fff;font-weight:740;display:inline-flex;align-items:center;justify-content:center;gap:9px;min-height:48px;transition:transform .15s,background .15s}.btn:hover{background:#225c57;transform:translateY(-1px)}.btn.secondary{background:#fff;color:#2d645c;border:1px solid #dce5df}.btn.secondary:hover{background:#f3faf5}.btn.ghost{background:transparent;color:#3a7168;border:1px solid #bed5ca}.btn.block{width:100%}.btn:disabled:hover{transform:none}.stat-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:17px;margin:23px 0}.stat{background:#fff;border:1px solid #e9ede6;padding:22px 24px;border-radius:20px;min-height:142px;display:flex;flex-direction:column;justify-content:space-between}.stat .stat-tag{font-size:13px;color:#80908a}.stat .stat-value{font-size:40px;font-weight:780;color:#2f665e;line-height:1}.stat .stat-foot{font-size:12px;color:#93a09a}.card-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:17px}.tile{background:#fff;border:1px solid #e7ede7;padding:25px;border-radius:22px;min-height:196px;display:flex;flex-direction:column;align-items:start;gap:10px}.tile .tile-icon{font-size:26px;background:#edf5f0;padding:12px;border-radius:16px}.tile.pink .tile-icon{background:#f9e9ed}.tile.yellow .tile-icon{background:#fff3db}.tile h3{margin:4px 0 0;font-size:20px;color:#324f4a}.tile p{font-size:14px;color:#87948f;margin:0 0 8px;line-height:1.65}.tile .btn{margin-top:auto}.footer-note{color:#97a49d;font-size:12px;margin-top:35px}
.login-screen{min-height:100vh;display:grid;grid-template-columns:1fr 1fr;background:#edf4eb}.login-art{display:flex;flex-direction:column;justify-content:center;padding:clamp(30px,9vw,110px);background:#dcebe3}.login-art .illustration{font-size:115px;margin-top:50px;filter:drop-shadow(0 16px 11px #315e4322)}.login-art h1{font-family:Georgia,"PingFang SC",serif;font-size:clamp(39px,5vw,68px);color:#285f52;line-height:1.1;letter-spacing:-2px}.login-art p{font-size:18px;line-height:1.9;color:#66897d}.login-panel{display:flex;justify-content:center;align-items:center;padding:28px}.login-card{max-width:420px;width:100%;background:#fff;border-radius:28px;padding:clamp(28px,4vw,46px);box-shadow:0 20px 50px #2a594a13}.login-card h2{font-size:30px;color:#315b54;margin:0 0 6px}.login-card .sub{color:#8a9b94;font-size:14px;margin-bottom:28px}.field{display:flex;flex-direction:column;gap:9px;margin-bottom:17px;font-size:14px;font-weight:600;color:#506b63}.field input,.field select,.answer-input,.search{background:#fcfdfa;border:1px solid #d8e2d9;padding:15px 16px;border-radius:13px;outline:none;min-height:48px;color:#28554d;width:100%}.field input:focus,.answer-input:focus,.search:focus{border-color:#72a68f;box-shadow:0 0 0 3px #cfe7d63b}.error-message{color:#ae4b43;background:#fbefec;padding:11px 14px;border-radius:12px;margin:12px 0;font-size:13px}.success-message{color:#286d58;background:#e5f5ec;padding:12px 15px;border-radius:12px;margin:12px 0;font-size:14px}
.exercise-shell{max-width:760px;margin:0 auto}.exercise-top{display:flex;justify-content:space-between;align-items:center;gap:12px;color:#7d9087;font-size:14px;margin-bottom:18px}.progress{height:9px;background:#e6ebe5;border-radius:99px;overflow:hidden;margin-bottom:24px}.progress>div{height:100%;background:#65a58d;transition:width .2s}.exercise-card{background:#fff;border:1px solid #e5ece5;border-radius:28px;padding:clamp(23px,5vw,48px);box-shadow:0 12px 30px #3b60500d}.exercise-card .q-kind{color:#5d8d7f;font-size:13px;font-weight:740;letter-spacing:.4px}.exercise-card h2{color:#2d514b;font-size:clamp(21px,3.4vw,32px);line-height:1.65;margin:14px 0 24px;white-space:pre-line}.context{border-left:4px solid #b0d7c5;background:#f4f8f3;padding:16px 18px;border-radius:0 12px 12px 0;color:#567a6c;line-height:1.9;margin:0 0 22px;white-space:pre-line}.answer-input{font-size:21px;line-height:1.4;padding:18px 20px;margin-bottom:17px}.exercise-actions{display:flex;flex-wrap:wrap;gap:12px;align-items:center;margin-top:18px}.choice-group{display:grid;gap:12px}.choice{border:1.5px solid #e0e8e1;background:#fbfdfa;padding:16px 20px;text-align:left;border-radius:15px;font-size:17px;color:#3c6158}.choice.selected{background:#e2f2e8;border-color:#53997f}.feedback{padding:19px 22px;background:#f0f7f0;border-radius:18px;margin-top:20px;border-left:5px solid #69a38c}.feedback.wrong{background:#fff5eb;border-left-color:#dfaa63}.feedback h3{margin:0 0 9px;color:#385e55;font-size:18px}.feedback p{margin:6px 0;color:#64746c;line-height:1.75;white-space:pre-line}.feedback .answer-key{font-size:21px;color:#315e56;font-weight:780;overflow-wrap:anywhere}.finished{max-width:620px;margin:90px auto;text-align:center;background:#fff;border-radius:26px;padding:50px 28px;border:1px solid #e6ede5}.finished .big{font-size:75px}.finished h2{color:#2d5e53;font-size:30px}.finished p{color:#80938a;line-height:1.8}.empty{padding:48px;text-align:center;background:#fff;border:1px dashed #cbdcd2;border-radius:22px;color:#7f9287;line-height:2}.empty .big{font-size:45px;display:block}.filters{display:flex;flex-wrap:wrap;gap:10px;margin:18px 0}.seg{border:1px solid #d6e6da;background:#fff;color:#617f70;border-radius:12px;padding:10px 16px;min-height:42px}.seg.active{background:#286d67;color:white;border-color:#286d67}.list-card{background:#fff;border:1px solid #e8ede7;border-radius:18px;padding:18px 22px;margin-bottom:10px}.list-card strong{color:#315d54;font-size:18px}.list-card .meta{font-size:12px;color:#879b8e;margin-top:6px}.list-card p{margin:8px 0;color:#697e71;white-space:pre-line;line-height:1.7}.report-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px}.report-row{display:grid;grid-template-columns:170px 1fr 80px;gap:16px;align-items:center;padding:15px 0;border-bottom:1px solid #e6eee7;color:#58766c}.bar{height:9px;border-radius:99px;background:#e8f0e9;overflow:hidden}.bar>div{height:100%;background:#6aab91}.panel{background:#fff;border:1px solid #e5ece5;border-radius:22px;padding:25px}.panel h3{margin:0 0 17px;color:#345c54}.unit-row{display:flex;gap:12px;align-items:center;justify-content:space-between;padding:12px 0;border-bottom:1px solid #edf1ed}.unit-row label{display:flex;gap:10px;align-items:center;min-height:40px;font-size:15px}.unit-row small{font-size:12px;color:#899b92}.tiny{font-size:12px;color:#879b92;line-height:1.7}.two-cols{display:grid;grid-template-columns:1fr 1fr;gap:16px}.mt{margin-top:22px}
@media (max-width:900px){.shell{grid-template-columns:1fr}.sidebar{height:auto;position:static;display:contents}.sidebar>.brand,.side-foot{display:none}.nav{position:fixed;bottom:0;left:0;right:0;z-index:100;background:#fff;border-top:1px solid #dce8de;display:flex;flex-direction:row;justify-content:space-around;padding:7px 4px max(8px,env(safe-area-inset-bottom));box-shadow:0 -7px 20px #27493212;gap:0}.nav button{flex-direction:column;gap:2px;min-height:55px;padding:5px 3px;font-size:10px;border-radius:11px;min-width:55px;text-align:center}.nav .emoji{font-size:20px}.main{padding:30px 20px calc(100px + env(safe-area-inset-bottom))}.topline{margin-bottom:24px}.hero{grid-template-columns:1fr 130px}.hero-art{font-size:80px}.hero-art:before{width:115px;height:115px}}@media(max-width:620px){.login-screen{grid-template-columns:1fr}.login-art{min-height:225px;padding:25px}.login-art h1{font-size:38px;margin:12px 0 4px}.login-art p{font-size:13px;margin:0}.login-art .illustration{display:none}.login-panel{margin-top:-22px}.login-card{border-radius:22px;box-shadow:0 8px 20px #294c3815}.topline .date{display:none}.hero{grid-template-columns:1fr;padding:25px;min-height:auto}.hero-art{display:none}.stat-grid{gap:9px}.stat{padding:14px;min-height:104px}.stat .stat-value{font-size:31px}.stat .stat-tag,.stat .stat-foot{font-size:11px}.card-grid,.report-grid,.two-cols{grid-template-columns:1fr}.tile{min-height:150px;padding:20px}.tile p{margin-bottom:0}.exercise-card{border-radius:20px}.report-row{grid-template-columns:96px 1fr 50px;gap:10px;font-size:12px}.main{padding-left:15px;padding-right:15px}.footer-note{margin-top:26px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{transition:none!important;animation:none!important}}

/* v1.1: phonetics, controlled audio playback and preview cards */
.speech-controls{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin:20px 0;padding:12px 16px;border:1px solid #e0ebe2;border-radius:16px;background:#f8fcf7}.speech-controls .settings-label{font-size:13px;font-weight:750;color:#547368}.speech-toggle{display:flex;gap:5px}.speech-controls .seg{min-height:38px;padding:7px 12px;font-size:13px}.preview-card{background:white;border:1px solid #e3ebe3;border-radius:26px;margin:18px 0 24px;padding:clamp(24px,5vw,42px);box-shadow:0 10px 24px #3b60500c}.preview-top{display:flex;justify-content:space-between;gap:15px;align-items:center}.preview-card h2{font-size:clamp(32px,6vw,57px);line-height:1.2;margin:26px 0 12px;color:#235d52;overflow-wrap:anywhere}.preview-pronunciation{display:flex;align-items:center;flex-wrap:wrap;gap:14px;margin:5px 0 20px}.ipa{font-family:Arial,"Times New Roman",sans-serif;font-size:20px;letter-spacing:.3px;color:#53806e}.ipa-pending{font-size:12px;color:#8b9d90}.word-pos{font-size:13px;color:#698779;background:#eff5ee;border-radius:20px;padding:5px 12px}.preview-meaning{font-size:22px;color:#365e54;font-weight:730;margin-bottom:22px;line-height:1.55}.preview-audio{display:flex;gap:12px;flex-wrap:wrap}.preview-pagination{border-top:1px solid #e6eee8;padding-top:22px;margin-top:24px;display:flex;justify-content:space-between;align-items:center;gap:10px}.preview-pagination .btn:disabled{opacity:.4;cursor:not-allowed}.preview-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.preview-list-item{display:flex;align-items:center;gap:13px;border:1px solid #e7eee7;background:white;border-radius:16px;text-align:left;padding:14px 16px;color:#557567;min-height:70px;cursor:pointer}.preview-list-item.selected{border-color:#72ad98;background:#f0f8f1}.preview-list-index{background:#f1f7f2;color:#638e7f;min-width:30px;height:30px;border-radius:50%;display:grid;place-items:center;font-size:12px;font-weight:800}.preview-list-item span:nth-child(2){flex:1;min-width:0}.preview-list-item strong{display:block;font-size:16px;color:#2d5c50;overflow-wrap:anywhere}.preview-list-item small{display:block;font-size:12px;color:#839a8a;line-height:1.5;margin-top:3px}.dictation-panel{margin:12px 0 18px}.dictation-panel .tiny{margin:10px 0}.example-action{margin-top:12px}.example-action .btn{font-size:13px;min-height:38px;padding:7px 12px}.preview-card .context{margin-top:12px}.preview-card .context .tiny{display:block;margin-bottom:6px}
@media(max-width:620px){.preview-list{grid-template-columns:1fr}.preview-top{align-items:flex-start}.preview-pagination .tiny{display:none}.preview-pagination .btn{padding:10px 14px}.speech-controls{padding:10px}.preview-card{border-radius:20px}.preview-meaning{font-size:19px}}


/* v1.2: Pencil-first iPad spelling; standard iPadOS Scribble, or actual ink plus self-review. */
.pencil-input{background:#f8fbf8;border:1px solid #d7e5da;border-radius:22px;padding:clamp(14px,3vw,22px);margin:16px 0 10px}
.pencil-title{display:flex;justify-content:space-between;align-items:center;gap:12px;color:#285f55;font-weight:750;font-size:15px}
.pencil-title small{font-size:12px;color:#849989;font-weight:500}
.pencil-switch{display:flex;flex-wrap:wrap;gap:10px;margin:18px 0 20px}
.pencil-switch button{flex:1 1 210px;min-height:48px;padding:10px 12px;font-size:14px;white-space:normal}
.pencil-label{display:block;margin:0 0 12px;font-size:15px;font-weight:700;color:#345f56}
.pencil-textarea{width:100%;height:142px;min-height:142px;resize:vertical;display:block;
  background:repeating-linear-gradient(to bottom,#ffffff 0px,#ffffff 46px,#dce7e1 47px,#dce7e1 48px);
  border:2px solid #9abfb0;border-radius:15px;line-height:48px;padding:8px 17px;
  font-size:27px;font-family:system-ui,-apple-system,sans-serif;color:#285b50;
  touch-action:auto;-webkit-user-select:text;user-select:text;letter-spacing:1px;caret-color:#286d67}
.pencil-textarea:focus{border-color:#3c9d82;outline:3px solid #c6e6d7;outline-offset:1px}
.pencil-textarea::placeholder{color:#9aa9a1;font-size:19px;letter-spacing:0}
.pencil-note{font-size:13px;color:#718b7c;line-height:1.85;margin:12px 2px 0}
.pencil-paper{border:2px solid #b9d5c5;border-radius:15px;position:relative;background:#fff;overflow:hidden}
.ink-canvas{width:100%;height:210px;display:block;touch-action:none;cursor:crosshair;
 background:repeating-linear-gradient(to bottom,transparent 0px,transparent 46px,#e1eee3 47px,#e1eee3 48px),linear-gradient(#fff,#fdfefc)}
.ink-canvas[data-readonly="true"]{cursor:default;touch-action:auto}
.paper-hint{position:absolute;bottom:9px;right:14px;color:#ccd9d0;font-size:14px;pointer-events:none;user-select:none}
.pencil-tools{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:12px}
.pencil-tools .seg{padding:9px 14px}
.pencil-tools .tiny{margin-left:auto}
.ink-compare{border-radius:16px;padding:16px 18px;background:#eaf6ed;border:1px solid #bddfc9;margin:18px 0 4px}
.ink-compare span{display:block;font-size:13px;color:#5b7a69;margin-bottom:8px}
.ink-compare strong{display:block;color:#24644f;font-size:clamp(25px,5vw,38px);overflow-wrap:anywhere}
.ink-compare p{margin:8px 0 0;font-size:13px;color:#718c7a}
.pencil-result-label{color:#5a7f70;font-weight:750;margin-top:22px;margin-bottom:10px}
@media(max-width:620px){.pencil-input{padding:14px}.pencil-title{align-items:flex-start;flex-direction:column;gap:3px}.pencil-switch{gap:7px}.pencil-switch button{flex-basis:100%;min-height:44px}.ink-canvas{height:190px}.pencil-textarea{font-size:25px}}

/* Shared study palette and page accents */
:root {
  --ink: #172e51;
  --muted: #495b73;
  --violet: #245fb4;
  --violet-dark: #194a91;
  --lavender: #e8f2ff;
  --stroke: #cbdcf3;
  --sun: #ffcbe2;
  --mint: #dceffb;
  --surface: #fff;
  color: var(--ink);
  background: #f8faff;
}

body {
  background:
    radial-gradient(ellipse at 95% 0, #dcecff 0, transparent 33rem),
    radial-gradient(ellipse at 30% 0, #ffe4ef 0, transparent 22rem),
    #f8faff;
}
.sidebar { background: #143760; border-color: transparent; color: #fff; }
.brand-mark { background: var(--sun); color: var(--ink); }
.sidebar .brand strong, .login-art .brand strong { color: #fff; }
.sidebar .brand small, .login-art .brand small, .side-foot .profile span { color: #dceaff; }
.side-foot { border-color: #3d6088; }
.side-foot .avatar { background: var(--lavender); }
.nav button { color: #eef6ff; }
.nav button:hover { background: #244a76; }
.nav button.active { background: var(--sun); color: var(--ink); }
.eyebrow, .topline .date, .subtitle, .tiny, .footer-note { color: var(--muted); }
.page-title, .section-title, .panel h3, .list-card strong, .finished h2, .login-card h2 { color: var(--ink); }
.page-title { font-weight: 830; }
.pill { background: var(--lavender); border-color: var(--stroke); color: var(--violet-dark); }

.hero, .login-art { background: linear-gradient(118deg, #184b91, #295da6 65%, #a22c62); }
.hero { align-items: center; box-shadow: 0 18px 34px #173e782e; }
.hero > div:first-child { position: relative; z-index: 1; }
.hero h2, .login-art h1 { color: #fff; }
.hero h2 { font-size: clamp(32px, 4vw, 54px); line-height: 1.18; font-weight: 830; }
.hero p { color: #eff6ff; }
.hero .pill { display: inline-block; background: #ffffff22; border-color: #ffffff66; color: #fff; }
.hero .btn { color: var(--ink); background: var(--sun); }
.hero .btn:hover { background: #ffdfed; }
.hero-art { isolation: isolate; }
.hero-art::before { background: #a0cbff63; border: 2px dashed #d3e7ff; }
.hero-art::after { content: ''; position: absolute; width: 20px; height: 20px; top: 6%; right: 6%;
  border-radius: 5px; background: var(--sun); transform: rotate(22deg); }
.studio-hero { min-height: 0; grid-template-columns: 1fr; padding: 19px 24px; margin-top: 18px; }
.word-studio { background: linear-gradient(110deg, #1c4f99, #286bb9); }
.phrase-studio { background: linear-gradient(110deg, #8f2858, #ac3569); }
.login-screen { background: #f5eff9; }
.login-art h1 { font-family: inherit; font-weight: 850; }
.login-card { border: 1px solid var(--stroke); box-shadow: 0 20px 50px #173e7824; }

.btn, .seg.active { background: var(--violet); color: #fff; border-color: var(--violet); }
.btn:hover { background: var(--violet-dark); }
.btn.secondary, .btn.ghost, .seg { background: var(--surface); color: var(--violet-dark); border-color: var(--stroke); }
.btn.secondary:hover, .seg:not(.active):hover { background: var(--lavender); }
.btn:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline-color: var(--violet); }
.sidebar button:focus-visible { outline-color: var(--sun); }
.tile { background: #eaf3ff; border-color: #c6daf6; }
.tile.pink { background: #ffebf1; border-color: #f3bfd3; }
.tile .tile-icon { background: #cfe4ff; color: var(--violet-dark); }
.tile.pink .tile-icon { background: #ffd1e1; color: #8b2354; }
.tile h3, .tile p, .stat .stat-tag, .stat .stat-foot { color: var(--muted); }
.tile h3, .stat .stat-value { color: var(--ink); }
.tile .btn { box-shadow: 0 2px 0 #17478725; }
.panel, .list-card, .finished, .stat { border-color: var(--stroke); }
.stat { border-top: 5px solid #4a82cb; }
.stat:nth-child(2) { border-top-color: #ed86aa; }
.stat:nth-child(3) { border-top-color: #79a9eb; }
.bar { background: var(--lavender); }
.bar > div { background: var(--violet); }
.speech-controls { background: var(--lavender); border-color: var(--stroke); }
.speech-controls .settings-label, .preview-list-item small { color: var(--muted); }
.preview-card { border-color: var(--stroke); box-shadow: 0 10px 25px #173e7816; }
.preview-card h2, .preview-meaning, .preview-list-item strong { color: var(--ink); }
.preview-list-item { border-color: var(--stroke); color: var(--violet-dark); }
.preview-list-item.selected { background: var(--lavender); border-color: #739ed8; }
.preview-list-index { background: var(--lavender); color: var(--violet-dark); }
[data-action="preview-meaning"] { background: var(--sun); color: var(--ink); border-color: #dfa2c0; }
#preview-translation:not([hidden]) { margin-top: 10px; }

.exercise-top { color: var(--muted); font-weight: 650; }
.progress { height: 11px; background: #e2edfd; }
.progress > div { background: linear-gradient(90deg, #3679c9, #d54f8f); }
.exercise-card { border-color: var(--stroke); box-shadow: 0 12px 30px #173e7817; }
.exercise-card .q-kind { color: var(--violet-dark); }
.exercise-card h2 { color: var(--ink); }
.prompt-instruction { color: var(--muted); margin: 14px 0 12px; font-weight: 650; }
.exercise-card .prompt-term {
  width: fit-content;
  max-width: 100%;
  padding: .22em .53em;
  margin: 0 0 24px;
  background: #ffd9e9;
  border: 1px solid #e4acc8;
  border-radius: 16px;
  color: var(--ink);
  font-size: clamp(36px, 7vw, 64px);
  font-weight: 850;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.context, .pencil-input { background: #f4f8ff; border-color: var(--stroke); color: var(--muted); }
.pencil-title, .pencil-label { color: var(--ink); }
.pencil-textarea, .pencil-paper { border-color: #9fbce6; }
.pencil-textarea:focus { border-color: var(--violet); outline-color: var(--stroke); }
.feedback { background: var(--mint); border-left-color: #377abd; }
.feedback.wrong { background: #fff0f6; border-left-color: #c44878; }
.choice.selected { background: var(--lavender); border-color: var(--violet); color: var(--ink); }

@media (max-width: 900px) {
  .nav { background: #143760; border-color: #3d6088; box-shadow: 0 -5px 22px #173e7833; }
  .nav button { min-width: 0; flex: 1; line-height: 1.2; }
}


.field input, .field select, .field textarea, .answer-input { border-color: var(--stroke); }
.field textarea:focus-visible, .answer-input:focus-visible { outline-color: var(--violet); }
.pencil-textarea {
  background: repeating-linear-gradient(to bottom, #fff 0 46px, #d8e7fa 47px 48px);
  color: var(--ink);
  caret-color: var(--violet);
}
.ink-compare { background: var(--lavender); border-color: var(--stroke); }
.ink-compare strong { color: var(--violet-dark); }

.mistake-date{display:inline-flex;align-items:center;gap:.6rem;font-weight:700}
.mistake-date input{font:inherit;color:inherit;background:var(--surface,#fff);border:1px solid currentColor;border-radius:.65rem;padding:.45rem .6rem;max-width:100%}

.daily-count { margin: .45rem 0; }
.daily-count strong { font-size: 1.8rem; }
.study-progress { display: block; width: 100%; height: .65rem; margin: .6rem 0 1rem; accent-color: #276585; }
.checkin-panel { background: #fff5df; border-color: #efce94; margin: 0; }
.checkin-title { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .4rem; }
.checkin-title h2 { margin: 0; }
.checkin-title strong { color: #803d1f; font-size: 1.25rem; }
.checkin-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .35rem; list-style: none; padding: 0; margin: 1rem 0; }
.week-day { min-height: 3.85rem; display: grid; justify-items: center; align-content: start; gap: .16rem; padding: .35rem 0; text-align: center; border: 1px solid #ead2a8; border-radius: .6rem; color: #58432d; background: #fffcf6; font-size: .72rem; }
.week-day strong { font-size: .9rem; }
.week-day[aria-current] { outline: 2px solid #a24c25; outline-offset: 1px; }
.week-day.checked { background: #d7f1d8; border-color: #82ba8d; color: #185731; }
.week-day small { font-size: inherit; color: #803d1f; }
.reward-status { padding: .75rem; margin: .6rem 0 0; background: #fff; border-radius: .75rem; }
.game-grid .tile { background: #eee9fd; border-color: #d6c9f5; }
.game-grid .tile + .tile { background: #e1f6fc; border-color: #b7e1ef; }
.word-filter { margin-top: 1rem; max-width: 20rem; }
.word-filter select { background: white; }
.phrase-studio > div { display: flex; flex-wrap: wrap; gap: .6rem; }
.phrase-row { border: 1px solid #d6e3e6; background: #fff; border-radius: 1rem; overflow: hidden; }
.phrase-row-main { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .65rem; padding: .6rem .8rem; }
.phrase-row-main > button.seg { white-space: nowrap; }
.phrase-row-toggle, .phrase-row-text { display: grid; justify-items: start; gap: .15rem; text-align: left; color: inherit; overflow-wrap: anywhere; }
.phrase-row-toggle { background: transparent; border: 0; padding: .5rem .2rem; width: 100%; }
.phrase-row-toggle small, .phrase-row-text small { color: #536b7c; }
.phrase-translation { margin: 0 .9rem .65rem; padding: .7rem; border-radius: .55rem; background: #edf5fa; }
.game-clues { margin-bottom: 1rem; }
.game-clues ol { padding: .6rem .75rem .6rem 2rem; background: #f4eefd; border-radius: .6rem; }
.game-clues li + li { margin-top: .3rem; }
.plan-numbers { display: grid; grid-template-columns: repeat(auto-fit,minmax(7rem,1fr)); gap: .5rem; }
.units-controls { display: flex; flex-wrap: wrap; gap: .4rem .75rem; padding: .6rem 0; }
.units-controls label { display: inline-flex; gap: .2rem; align-items: center; min-height: 2rem; }
.units-controls small, .coverage-row small { color: #526777; }
.focus-check { display: block; margin-top: 1rem; }
.coverage-row { padding: .6rem 0; border-top: 1px solid #d8e3e8; }
.coverage-row > div { display: flex; align-items: baseline; gap: .35rem; }
.coverage-row > div span { margin-left: auto; }
.coverage-row p { overflow-wrap: anywhere; }
@media (max-width: 420px) {
  .phrase-row-main > button.seg span { display: none; }
  .phrase-row-main { gap: .4rem; padding: .45rem; }
}

.checkin-status { margin: .75rem 0 .3rem; font-weight: 750; color: #664321; }
.feedback-example { padding: .7rem .85rem; border-radius: .55rem; background: #fff; }

.topline { flex-wrap: wrap; gap: .55rem; }
.topline-actions { display: flex; align-items: center; gap: .75rem; margin-left: auto; }
.return-login { white-space: nowrap; min-height: 44px; }

.verb-cue { color: #3150a3; white-space: nowrap; }
.ai-review-question { font-size: 1.2rem; font-weight: 650; }
.ai-question-edit { margin-top: .85rem; }

.grammar-checks { display: flex; flex-wrap: wrap; gap: .35rem 1rem; padding: .6rem 0; }
.grammar-checks label { display: inline-flex; align-items: center; gap: .35rem; min-height: 2rem; }

.phrase-unit { display: block; margin: 0 .9rem .65rem; }

.phrase-row-actions{display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-end}
.phrase-row-actions .seg{white-space:nowrap}
@media(max-width:520px){.phrase-row-actions{grid-column:2/-1;justify-content:flex-start}}

.verb-table { width:100%; table-layout:fixed; border-collapse:collapse; text-align:left; }
.verb-table th, .verb-table td { padding:.65rem .45rem; vertical-align:top; overflow-wrap:anywhere; border-bottom:1px solid #dddcec; }
.verb-table summary { cursor:pointer; font-weight:700; }
.verb-table details div { margin-top:.4rem; }
.verb-table .phrase-row-actions { display:flex; flex-wrap:wrap; gap:.25rem; margin-top:.35rem; justify-content:flex-start; }
.verb-table .phrase-row-actions .seg { padding:.25rem .4rem; }
.verb-mask { opacity:.65; }
[data-action="verb-column"][aria-pressed="true"] { outline:2px solid currentColor; outline-offset:-2px; }
[data-action="verb-column"][aria-pressed="false"] { opacity:.7; }

.verb-base-line {display:flex; align-items:baseline; flex-wrap:wrap; gap:.4rem;}
.verb-base-line > * {min-width:0;}
.verb-base-line .seg {padding:.25rem .4rem;}
.verb-table .phrase-row-actions:empty {display:none;}

.verb-table-scroll {max-height:65vh; overflow:auto; scrollbar-gutter:stable;}
.verb-table-scroll .verb-table {min-width:40rem; border-collapse:separate; border-spacing:0;}
.verb-table-scroll .verb-table thead {position:sticky; top:0; z-index:2; background:var(--card, #fff);}
.verb-table-scroll .verb-column-controls {justify-content:flex-start; margin:0;}
.verb-table .verb-mask {width:100%; text-align:left; padding:.2rem .3rem; color:inherit; background:transparent; border:1px dashed currentColor; border-radius:.4rem; cursor:pointer;}
.verb-table .verb-mask:disabled {cursor:default; border-color:transparent;}

.preview-list > .verb-table-scroll { grid-column: 1 / -1; min-width: 0; }

.verb-table .verb-base-line .phrase-row-actions { margin-top: 0; align-self: baseline; }

.preview-list > .word-review-group { grid-column: 1 / -1; min-width: 0; }

.student-list-card .phrase-row-main { align-items: start; }
.student-list-card .phrase-row-main > .preview-list-index { align-self: start; }
.student-list-card .phrase-row-actions { grid-column: 3; grid-row: 1; justify-content: flex-end; flex-wrap: nowrap; gap: .2rem; }
.student-list-card .phrase-row-actions .seg { min-width: 2rem; min-height: 2.25rem; padding: .25rem .35rem; }
.student-list-card .phrase-row-toggle, .student-list-card .phrase-row-text { padding: .35rem .1rem; }
.word-study-example { margin: 0 .8rem .6rem; }
.word-study-example summary, .day-plan summary { cursor: pointer; }
.word-study-example p { margin: .35rem 0 0; }
.day-plan { border-bottom: 1px solid var(--stroke); padding: .6rem 0; }
.day-plan summary small { color: var(--muted); margin-left: .35rem; }
.day-plan-fields { margin: .4rem 0 0; padding: 0; border: 0; min-width: 0; }
.day-plan-fields:disabled { display: none; }


.student-list-card strong[lang="en"],
.verb-table summary[lang="en"],
.verb-table td span[lang="en"] {
  font-size: clamp(1.25rem, 1rem + .65vw, 1.5rem);
  line-height: 1.3;
}
.student-list-card small[lang="en"],
.student-list-card .word-study-example p[lang="en"],
.verb-table details div[lang="en"] {
  font-size: 1.125rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.ability-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .85rem;
  align-items: start;
}
.ability-card {
  --ability-ink: #194e92;
  --ability-fill: #2d65b3;
  --ability-track: #ccdef4;
  --ability-surface: #edf5ff;
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--ability-track);
  border-radius: 1rem;
  background: var(--ability-surface);
  color: var(--ability-ink);
}
.ability-phrases {
  --ability-ink: #793155;
  --ability-fill: #a14773;
  --ability-track: #f0cfe0;
  --ability-surface: #fff0f7;
}
.ability-verbs {
  --ability-ink: #513880;
  --ability-fill: #7351ab;
  --ability-track: #e0d2f5;
  --ability-surface: #f6f0ff;
}
.ability-card h4 { display: flex; align-items: center; gap: .4rem; margin: 0; font-size: 1.1rem; }
.ability-score { display: flex; align-items: baseline; flex-wrap: wrap; gap: .4rem; margin: .55rem 0 .2rem; }
.ability-score strong { font-size: 2rem; line-height: 1; }
.ability-progress {
  display: block;
  width: 100%;
  height: .7rem;
  border: 0;
  border-radius: 99px;
  appearance: none;
  overflow: hidden;
  background: var(--ability-track);
  color: var(--ability-fill);
}
.ability-progress::-webkit-progress-bar { background: var(--ability-track); border-radius: 99px; }
.ability-progress::-webkit-progress-value { background: var(--ability-fill); border-radius: 99px; }
.ability-progress::-moz-progress-bar { background: var(--ability-fill); border-radius: 99px; }
.ability-total { margin: .35rem 0 .6rem; font-size: .9rem; }
.ability-details summary { cursor: pointer; font-weight: 700; padding: .5rem 0 .15rem; }
.ability-details ul { list-style: none; padding: 0; margin: .45rem 0 0; }
.ability-details li { margin-top: .65rem; }
.ability-detail-label { display: flex; justify-content: space-between; align-items: baseline; gap: .35rem; margin-bottom: .2rem; font-size: .9rem; overflow-wrap: anywhere; }
.ability-detail-label b { flex: none; font-variant-numeric: tabular-nums; }
.ability-details .ability-progress { height: .44rem; }
.ability-empty { margin: .6rem 0 .15rem; font-size: .95rem; }
@media (max-width: 720px) {
  .ability-grid { grid-template-columns: 1fr; }
}

.home-practice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.home-practice-grid .home-exam-card { grid-column: 2; grid-row: 2; }
.home-practice-grid .home-detective-card { grid-column: 1; grid-row: 2; }
.checkin-celebration {
  display: flex;
  align-items: center;
  gap: .85rem;
  margin: .85rem 0;
  padding: .8rem 1rem;
  border: 1px solid #bddec9;
  border-radius: .85rem;
  background: #eaf8ef;
  color: #1e5235;
}
.checkin-celebration > span { font-size: 1.9rem; }
.checkin-celebration strong { display: block; font-size: 1.12rem; }
.checkin-celebration div span { display: block; margin-top: .2rem; }
.study-explanation { margin: .65rem 0; }
.study-explanation summary { cursor: pointer; }
@media (max-width: 720px) {
  .home-practice-grid { grid-template-columns: 1fr; }
  .home-practice-grid .home-exam-card, .home-practice-grid .home-detective-card {
    grid-row: auto;
    grid-column: auto;
  }
}
