
/* ==========================================================
   GermanBook v1.7.0
   COMPLETE STYLE REWRITE
   Unified rounded techno UI, dark/light, mobile-first.
   ========================================================== */

:root{
  color-scheme: light dark;

  --bg:#eaf0f4;
  --bg-deep:#e4ebef;
  --header:#f4f8fa;
  --footer:#f4f8fa;
  --surface:#f8fbfc;
  --surface-2:#eef4f7;
  --surface-3:#e8eff3;

  --text:#18232d;
  --muted:#687784;
  --soft:#87949f;
  --line:rgba(28,49,65,.10);
  --line-strong:rgba(28,49,65,.16);

  --blue:#5c96d8;
  --green:#78a95f;
  --cyan:#4da5a8;
  --violet:#9a70bc;
  --amber:#b38745;
  --red:#b7665e;

  --r-xl:26px;
  --r-lg:20px;
  --r-md:15px;
  --r-sm:11px;

  --nav-h:48px;
  --shadow:0 12px 30px rgba(28,48,64,.07);
  --shadow-soft:0 5px 18px rgba(28,48,64,.05);
}

html[data-theme="dark"]{
  color-scheme:dark;

  --bg:#08131c;
  --bg-deep:#061019;
  --header:#0e1c27;
  --footer:#0e1c27;
  --surface:#12212c;
  --surface-2:#172732;
  --surface-3:#1b2d39;

  --text:#f1f5f7;
  --muted:#9aa8b2;
  --soft:#768792;
  --line:rgba(174,208,229,.08);
  --line-strong:rgba(174,208,229,.13);

  --blue:#66a9ec;
  --green:#82bd68;
  --cyan:#55bfc0;
  --violet:#b47bd0;
  --amber:#c7984b;
  --red:#c46d62;

  --shadow:0 18px 42px rgba(0,0,0,.22);
  --shadow-soft:0 8px 24px rgba(0,0,0,.14);
}

/* ---------- reset ---------- */

*{box-sizing:border-box}
html,body{margin:0;min-height:100%;background:var(--bg)}
html{
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Roboto,Arial,sans-serif;
  -webkit-text-size-adjust:100%;
}
body{
  min-height:100vh;
  min-height:100svh;
  color:var(--text);
  font-size:16px;
  line-height:1.42;
  overflow-x:hidden;
}
button,input,select,textarea{font:inherit}
button{cursor:pointer;-webkit-tap-highlight-color:transparent;touch-action:manipulation}
button:disabled{opacity:.5;cursor:default}
a{color:inherit}
h1,h2,h3,h4,p{margin:0}
p{color:var(--muted)}
.hidden{display:none !important}
.muted{color:var(--muted)!important}
.wide{grid-column:1/-1}
.spacer{flex:1}

/* ---------- shared controls ---------- */

button,.linkbtn,input,select,textarea{
  border:1px solid var(--line);
  border-radius:var(--r-sm);
  outline:none;
}
input,select,textarea{
  width:100%;
  min-height:46px;
  padding:10px 13px;
  background:var(--surface-2);
  color:var(--text);
}
textarea{min-height:100px;resize:vertical}
input:focus,select:focus,textarea:focus{
  border-color:color-mix(in srgb,var(--blue) 64%,var(--line));
  box-shadow:0 0 0 3px color-mix(in srgb,var(--blue) 12%,transparent);
}
.primary-large,.mini-add,.return-review,.dialog-actions button{
  min-height:48px;
  padding:10px 17px;
  background:linear-gradient(180deg,#3d6a89,#315b76);
  color:#f7fafc;
  border:1px solid rgba(108,173,218,.35);
  border-radius:14px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.08);
}
.ghost,.linkbtn{
  min-height:42px;
  padding:0 12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:var(--surface-2);
  color:var(--text);
  text-decoration:none;
}

/* ---------- header ---------- */

.app-header{
  position:sticky;
  top:0;
  z-index:40;
  padding-top:env(safe-area-inset-top,0px);
  background:var(--header);
  border-bottom:1px solid var(--line-strong);
  box-shadow:0 5px 18px rgba(0,0,0,.035);
}
.header-row{
  min-height:58px;
  max-width:1180px;
  margin:0 auto;
  padding:8px 16px;
  display:flex;
  align-items:center;
  gap:14px;
}
.brand-mini{display:flex;align-items:center;gap:13px;min-width:max-content}
.logo-mini.logo-book{
  width:48px;
  height:48px;
  display:grid;
  place-items:center;
  border-radius:15px;
  background:var(--surface-2);
  color:var(--text);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb,var(--blue) 66%,transparent),
    inset 0 -2px 0 color-mix(in srgb,var(--amber) 82%,transparent);
}
.book-mark{font-size:1.72rem;line-height:1;transform:rotate(90deg)}
.brand-title{font-size:1.18rem;font-weight:720;letter-spacing:-.015em}
.brand-stats{font-size:.68rem;color:var(--soft)}
.top-tabs{
  margin-left:auto;
  display:flex;
  align-items:center;
  gap:3px;
  overflow-x:auto;
  scrollbar-width:none;
}
.top-tabs::-webkit-scrollbar{display:none}
.tab{
  border:0;
  background:transparent;
  color:var(--muted);
  min-height:40px;
  padding:0 11px;
  border-radius:12px;
  white-space:nowrap;
}
.tab.active{background:var(--surface-2);color:var(--text)}
.header-actions{margin-left:auto;display:flex;align-items:center;gap:5px}
.header-actions .theme-toggle{
  width:38px;
  height:38px;
  padding:0;
  border-radius:50%;
  background:var(--surface-2);
  font-size:1.18rem;
}
.compact-actions .ghost:not(.theme-toggle),
.compact-actions .linkbtn:not(.logout-icon){display:none}

/* ---------- main ---------- */

.shell{
  width:min(100%,1180px);
  margin:0 auto;
  padding:12px 12px calc(28px + env(safe-area-inset-bottom));
}
.view{width:100%}
.section-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  padding:10px 2px 14px;
}
.section-head h2{font-size:1.55rem;font-weight:730;letter-spacing:-.02em}
.section-head h3{font-size:1.12rem}
.section-head p{margin-top:4px}
.section-head.compact{padding:8px 0 10px}

/* ---------- home dashboard ---------- */

.render-home{
  display:grid;
  gap:10px;
  width:min(100%,760px);
  margin:0 auto;
}
.render-section{
  padding:12px;
  border-radius:22px;
  background:var(--surface);
  border:1px solid var(--line);
  box-shadow:var(--shadow-soft);
}
.render-section-title{
  margin:0 0 10px;
  font-size:1.14rem;
  line-height:1.15;
  font-weight:740;
  letter-spacing:-.02em;
}
.render-grid{display:grid;gap:9px}
.render-grid-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.render-grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}

.render-tile{
  --tile-color:var(--blue);
  --tile-bg1:#edf5ff;
  --tile-bg2:#e4eef9;
  --tile-glow:rgba(89,147,218,.17);

  position:relative;
  min-width:0;
  min-height:138px;
  padding:13px;
  overflow:hidden;
  display:grid;
  grid-template-rows:auto auto 1fr auto auto;
  text-align:left;
  color:var(--text);
  border:.7px solid color-mix(in srgb,var(--tile-color) 68%,transparent);
  border-radius:18px;
  background:
    radial-gradient(circle at 18% 4%,var(--tile-glow),transparent 48%),
    linear-gradient(145deg,var(--tile-bg1),var(--tile-bg2));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.08),0 8px 24px rgba(0,0,0,.06);
}
html[data-theme="dark"] .render-tile-blue{
  --tile-bg1:#163154;--tile-bg2:#13283f;--tile-glow:rgba(72,148,235,.31)
}
html[data-theme="dark"] .render-tile-green{
  --tile-bg1:#223e24;--tile-bg2:#17301e;--tile-glow:rgba(113,192,89,.28)
}
html[data-theme="dark"] .render-tile-cyan{
  --tile-bg1:#164044;--tile-bg2:#123136;--tile-glow:rgba(74,201,198,.25)
}
html[data-theme="dark"] .render-tile-violet{
  --tile-bg1:#3a2746;--tile-bg2:#2b2138;--tile-glow:rgba(190,99,223,.27)
}
html[data-theme="dark"] .render-tile-amber{
  --tile-bg1:#49331b;--tile-bg2:#302317;--tile-glow:rgba(226,161,52,.28)
}
html[data-theme="dark"] .render-tile-red{
  --tile-bg1:#482722;--tile-bg2:#311d1c;--tile-glow:rgba(225,91,72,.26)
}
html:not([data-theme="dark"]) .render-tile-blue{
  --tile-color:#5b97d9;--tile-bg1:#edf5ff;--tile-bg2:#e5effb;--tile-glow:rgba(80,141,219,.17)
}
html:not([data-theme="dark"]) .render-tile-green{
  --tile-color:#78a960;--tile-bg1:#eff8ed;--tile-bg2:#e6f2e4;--tile-glow:rgba(110,177,94,.17)
}
html:not([data-theme="dark"]) .render-tile-cyan{
  --tile-color:#4fa4a8;--tile-bg1:#edf9fa;--tile-bg2:#e4f3f4;--tile-glow:rgba(75,185,182,.17)
}
html:not([data-theme="dark"]) .render-tile-violet{
  --tile-color:#9971ba;--tile-bg1:#f6effb;--tile-bg2:#eee5f6;--tile-glow:rgba(165,100,215,.16)
}
html:not([data-theme="dark"]) .render-tile-amber{
  --tile-color:#b28645;--tile-bg1:#fbf3e6;--tile-bg2:#f4ead9;--tile-glow:rgba(211,156,65,.16)
}
html:not([data-theme="dark"]) .render-tile-red{
  --tile-color:#ba685f;--tile-bg1:#faefed;--tile-bg2:#f4e5e3;--tile-glow:rgba(206,103,89,.15)
}

.render-tile-icon{
  width:38px;
  height:38px;
  display:grid;
  place-items:center;
  margin-bottom:9px;
  border-radius:50%;
  color:color-mix(in srgb,var(--tile-color) 84%,var(--text));
  background:color-mix(in srgb,var(--tile-color) 17%,transparent);
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--tile-color) 38%,transparent);
  font-size:1.02rem;
}
.render-tile-label{
  min-height:0;
  color:var(--muted);
  font-size:.96rem;
  line-height:1.14;
  font-weight:560;
}
.render-tile strong{
  align-self:end;
  margin-top:8px;
  color:var(--text);
  font-size:1.72rem;
  line-height:1;
  font-weight:690;
}
.render-tile-unit{
  margin-top:4px;
  color:var(--muted);
  font-size:.68rem;
}
.render-stat{min-height:116px}
.render-training-stats .render-tile{padding:11px}
.render-training-stats .render-tile-icon{width:34px;height:34px;margin-bottom:7px}
.render-training-stats .render-tile-label{font-size:.84rem}
.render-training-stats .render-tile strong{font-size:1.48rem}

/* ---------- filters / dictionary ---------- */

.filters,.irr-filters{
  display:grid;
  grid-template-columns:minmax(180px,2fr) repeat(4,minmax(130px,1fr));
  gap:8px;
  margin-bottom:12px;
}
.cards{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(270px,1fr));
  gap:10px;
}
.card,.panel,.exercise{
  position:relative;
  padding:15px;
  border-radius:var(--r-lg);
  background:var(--surface);
  border:1px solid var(--line);
  box-shadow:var(--shadow-soft);
}
.card{cursor:pointer}
.card-edit{
  position:absolute;
  top:10px;
  right:10px;
  width:34px;
  height:34px;
  padding:0;
  border-radius:50%;
  background:var(--surface-2);
  color:var(--muted);
}
.card-meta-top{display:flex;gap:5px;flex-wrap:wrap;padding-right:38px;min-height:24px}
.card-top{display:flex;align-items:center;gap:8px;margin-top:6px}
.card-top h3{font-size:1.22rem;letter-spacing:-.015em}
.status-dot{width:8px;height:8px;border-radius:50%;margin-left:auto}
.status-new{background:var(--blue)}
.status-seen{background:var(--amber)}
.status-learned{background:var(--green)}
.top-chip,.badge,.freq-pill,.irr-status{
  display:inline-flex;
  align-items:center;
  min-height:24px;
  padding:2px 8px;
  border-radius:999px;
  background:var(--surface-2);
  color:var(--muted);
  font-size:.72rem;
}
.level{color:var(--blue)}
.verb-line{display:flex;flex-wrap:wrap;gap:5px;margin-top:8px;color:var(--muted);font-size:.86rem}
.dot{color:var(--soft)}
.translation{margin-top:10px;font-size:1rem;color:var(--text)}
.synonyms{margin-top:5px;color:var(--muted);font-size:.86rem}
.prep-pair{display:flex;align-items:center;gap:7px;margin-top:8px}
.prep-arrow{color:var(--blue)}
.card-examples{margin-top:10px}
.example-de{font-size:.88rem;color:var(--text)}
.example-ru{font-size:.82rem;color:var(--muted);margin-top:2px}
.empty{padding:28px;text-align:center;color:var(--muted)}

/* ---------- review ---------- */

.review-card{
  max-width:700px;
  margin:18px auto;
  padding:22px;
  border-radius:var(--r-xl);
  background:var(--surface);
  border:1px solid var(--line);
  box-shadow:var(--shadow);
}
.review-progress{text-align:right;color:var(--soft);font-size:.8rem}
.review-front{
  min-height:260px;
  display:grid;
  place-items:center;
  text-align:center;
}
.review-word{font-size:clamp(2rem,7vw,3.5rem);font-weight:720}
.review-back{margin-top:14px;text-align:center}
.review-translation{font-size:1.45rem;font-weight:650;margin-bottom:10px}
.grade-row,.detail-review-actions{display:grid;gap:8px;margin-top:14px}
.grade-row-3,.detail-review-actions{grid-template-columns:repeat(3,minmax(0,1fr))}
.grade,.detail-grade{
  min-height:54px;
  border-radius:14px;
  color:#fff;
  background:#775d32;
}
.grade.bad,.detail-grade.bad{background:#7a3838}
.grade.good,.detail-grade.good{background:#356747}

/* ---------- study ---------- */

.render-study-view{
  height:100%;
  display:flex;
  flex-direction:column;
  min-height:0;
}
.render-study-topbar{
  flex:0 0 46px;
  display:grid;
  grid-template-columns:42px 1fr 42px;
  align-items:center;
  gap:10px;
  margin-bottom:8px;
}
.render-round-btn{
  width:40px;
  height:40px;
  padding:0;
  border-radius:50%;
  background:var(--surface);
  color:var(--text);
  border:1px solid var(--line);
  box-shadow:var(--shadow-soft);
  font-size:1.3rem;
}
.render-study-title{text-align:center;font-size:1.02rem;font-weight:720}

.render-study-setup{
  width:100%;
  max-width:780px;
  margin:8px auto 0;
  padding:22px 18px 20px;
  border-radius:var(--r-xl);
  background:var(--surface);
  border:1px solid var(--line-strong);
  box-shadow:var(--shadow);
  text-align:center;
}
.study-launch-kicker{
  color:var(--blue);
  font-size:.8rem;
  font-weight:760;
  letter-spacing:.12em;
  text-transform:uppercase;
}
.render-study-setup h3{
  margin:6px 0 4px;
  font-size:clamp(1.7rem,6vw,2.25rem);
  letter-spacing:-.025em;
}
.study-count-note{color:var(--muted)}
.study-count-row-clean{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:9px;
  max-width:560px;
  margin:20px auto 18px;
}
.study-count{
  min-height:60px;
  background:var(--surface-2);
  color:var(--muted);
  border:1px solid var(--line);
  border-radius:15px;
}
.study-count.active{
  color:var(--text);
  background:var(--surface-3);
  border-color:color-mix(in srgb,var(--blue) 58%,var(--line));
  box-shadow:inset 0 -3px 0 var(--blue);
}
.study-start-clean{
  display:block;
  width:min(100%,320px);
  margin:0 auto;
  min-height:56px;
  border-radius:16px;
}

#studyArea{
  flex:1 1 auto;
  min-height:0;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
.study-progress-wrap{flex:0 0 auto;margin-bottom:10px}
.study-progress-top{
  display:flex;
  justify-content:space-between;
  gap:12px;
  color:var(--muted);
  font-size:.84rem;
  margin-bottom:7px;
}
.study-progress-bar{
  height:8px;
  overflow:hidden;
  border-radius:999px;
  background:var(--surface-3);
}
.study-progress-bar i{
  display:block;
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg,#76cf68,#b8d8f2);
}
.study-stage-sub{display:none}

.study-card.study-card-immersive{
  flex:1 1 auto;
  min-height:0;
  width:100%;
  padding:11px;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  border-radius:var(--r-xl);
  background:var(--surface);
  border:1px solid var(--line-strong);
  box-shadow:var(--shadow);
}
.study-scene{
  height:100%;
  min-height:0;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.study-focus-card{
  position:relative;
  flex:1 1 auto;
  min-height:0;
  padding:64px 18px 18px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  overflow:hidden;
  text-align:center;
  border-radius:20px;
  background:
    radial-gradient(circle at 50% 84%,rgba(83,166,142,.12),transparent 38%),
    var(--surface-2);
  border:1px solid var(--line);
}
.study-scene-top{
  position:absolute;
  top:15px;left:0;right:0;
  padding:0 17px;
  display:flex;
  justify-content:space-between;
  gap:10px;
  color:var(--muted);
}
.study-scene-kicker,.study-meta-badge{font-size:.9rem}
.study-focus-word{
  width:100%;
  font-size:clamp(2rem,7.2vw,3.5rem);
  line-height:1.05;
  font-weight:700;
  letter-spacing:-.03em;
  overflow-wrap:anywhere;
}
.study-focus-word-ru{font-size:clamp(1.55rem,5.6vw,2.7rem)}
.study-ask{font-size:1rem;color:var(--muted);margin-bottom:10px}
.study-example{
  width:100%;
  max-width:680px;
  margin:14px auto 0;
  color:var(--muted);
  font-size:.96rem;
  line-height:1.34;
}
.study-chip-action{
  min-height:48px;
  padding:0 22px;
  border-radius:999px;
  background:var(--surface-3);
  color:var(--text);
}
.study-answer{width:100%;display:grid;gap:12px;margin-top:auto}
.study-answer-main{font-size:1.6rem;font-weight:680;text-align:center}
.study-three-actions{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
  margin-top:10px;
}
.study-three-actions button{
  min-height:68px;
  border-radius:15px;
  color:#fff;
}
.study-wrong{background:#783638}
.study-repeat{background:#75572a}
.study-right{background:#356648}
.study-action-icon{display:block;margin-top:4px}

.study-options{width:100%;margin-top:auto}
.study-options-choices{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:9px;
}
.study-options-choices button{
  min-height:72px;
  padding:10px;
  border-radius:15px;
  background:var(--surface-3);
  color:var(--text);
}
.study-options-choices button.correct{background:#285b3d;color:#fff}
.study-options-choices button.wrong{background:#713539;color:#fff}

.study-typing{
  width:100%;
  margin-top:auto;
  display:grid;
  grid-template-columns:1fr;
  gap:9px;
}
.study-typing input{min-height:56px;border-radius:16px}
.study-typing button{
  min-height:54px;
  border-radius:16px;
  background:var(--surface-3);
  color:var(--blue);
}
.study-feedback{width:100%}
.study-result-panel{
  display:grid;
  gap:10px;
  padding:13px;
  border-radius:18px;
  border:1px solid var(--line);
}
.study-result-panel.is-correct{background:color-mix(in srgb,var(--green) 16%,var(--surface))}
.study-result-panel.is-wrong{background:color-mix(in srgb,var(--red) 15%,var(--surface))}
.study-result-head{display:flex;align-items:center;gap:11px}
.study-result-icon{
  width:42px;height:42px;display:grid;place-items:center;border-radius:50%;
  background:var(--surface-3);font-weight:800
}
.study-result-head>div{display:grid;gap:1px}
.study-result-head>div>span{font-size:.8rem;color:var(--muted)}
.study-result-line{
  display:grid;
  grid-template-columns:95px 1fr;
  gap:10px;
  padding-top:8px;
  border-top:1px solid var(--line);
}
.study-result-line span{font-size:.76rem;color:var(--muted)}
.study-next-btn{
  min-height:50px;
  border-radius:15px;
  background:color-mix(in srgb,var(--cyan) 23%,var(--surface-2));
  color:var(--text);
}
.study-finish{text-align:center;padding:20px}
.study-finish-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:8px;margin:16px 0}
.study-finish-actions{display:flex;justify-content:center;gap:8px}

/* ---------- topics / lessons ---------- */

.topics-list,.exercise-list{display:grid;gap:9px}
.topic-accordion{
  overflow:hidden;
  border-radius:var(--r-lg);
  background:var(--surface);
  border:1px solid var(--line);
  box-shadow:var(--shadow-soft);
}
.topic-accordion summary{
  list-style:none;
  cursor:pointer;
  padding:16px;
}
.topic-accordion summary::-webkit-details-marker{display:none}
.topic-kicker{color:var(--blue);font-size:.74rem;font-weight:720;text-transform:uppercase;letter-spacing:.08em}
.topic-accordion h3{margin-top:3px;font-size:1.1rem}
.topic-accordion summary p{margin-top:5px;font-size:.88rem}
.topic-body{padding:0 13px 13px;display:grid;gap:9px}
.topic-block{
  padding:13px;
  border-radius:15px;
  background:var(--surface-2);
  border:1px solid var(--line);
}
.topic-block h4{margin-bottom:7px}
.grammar-formula,.topic-compare{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:6px;
  margin:9px 0;
}
.grammar-formula span,.topic-compare>div{
  padding:9px;
  border-radius:11px;
  background:var(--surface-3);
  text-align:center;
}
.topic-example{
  padding:10px;
  margin-top:7px;
  border-radius:11px;
  background:var(--surface-3);
}
.topic-example .de{color:var(--text)}
.topic-example .ru{margin-top:3px;color:var(--muted)}
.topic-list{padding-left:20px}
.lesson-block{margin-bottom:12px}
.lessons-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:9px;
}
.exercise{display:grid;gap:7px}
.ex-delete{justify-self:end;background:transparent;color:var(--red)}
.checkline{display:flex;gap:8px;align-items:center}

/* ---------- irregular tables ---------- */

.irregular-head{align-items:center}
.irregular-view-toggle{display:flex;gap:6px}
.irregular-view-toggle .active{color:var(--blue)}
.irregular-table-wrap{
  overflow:auto;
  border-radius:var(--r-lg);
  border:1px solid var(--line);
  background:var(--surface);
}
.irr-table{
  width:100%;
  border-collapse:collapse;
  min-width:760px;
}
.irr-table th,.irr-table td{
  padding:11px 10px;
  text-align:left;
  border-bottom:1px solid var(--line);
  vertical-align:middle;
}
.irr-table th{font-size:.72rem;color:var(--muted);font-weight:650;background:var(--surface-2)}
.irr-click-row{cursor:pointer}
.irr-click-row:hover{background:var(--surface-2)}
.irr-click-row.is-mine{background:color-mix(in srgb,var(--green) 8%,transparent)}
.present-slash{color:var(--muted)}
.study-mask .maskable span{filter:blur(5px);user-select:none}
.in-dict-mark{color:var(--green)}
.mini-add{width:34px;height:34px;padding:0}

/* ---------- dialogs / detail ---------- */

dialog{
  padding:0;
  border:0;
  color:var(--text);
  background:transparent;
}
dialog::backdrop{background:rgba(2,8,13,.70);backdrop-filter:blur(7px)}
.detail-dialog,
dialog#editor,
dialog#exerciseDialog,
dialog#irrDetail{
  width:min(760px,calc(100vw - 20px));
  max-height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 20px);
  margin-top:max(10px,env(safe-area-inset-top));
  margin-bottom:max(10px,env(safe-area-inset-bottom));
  border-radius:var(--r-xl);
  background:var(--surface);
  box-shadow:0 28px 80px rgba(0,0,0,.42);
  overflow:auto;
}
.detail-wrap{padding:16px}
.detail-head,.dialog-head{
  position:sticky;
  top:0;
  z-index:2;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  padding:4px 0 13px;
  background:var(--surface);
}
.detail-meta{color:var(--muted);font-size:.8rem;margin-bottom:5px}
.detail-head h2{font-size:1.65rem;letter-spacing:-.025em}
.detail-head-actions{display:flex;gap:6px}
.icon-btn{
  width:42px;height:42px;padding:0;border-radius:50%;
  background:var(--surface-2);color:var(--text)
}
.detail-translation{
  padding:16px;
  border-radius:16px;
  background:color-mix(in srgb,var(--green) 9%,var(--surface-2));
  font-size:1.25rem;
  font-weight:650;
}
.detail-synonyms,.detail-prep{padding:9px 2px;color:var(--muted)}
.detail-section{
  margin-top:10px;
  padding:13px;
  border-radius:16px;
  background:var(--surface-2);
  border:1px solid var(--line);
}
.detail-section h3{margin-bottom:9px;font-size:1rem}
.detail-verb-grid,.detail-adjective-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:7px;
}
.detail-form-cell,.conj-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  min-height:46px;
  padding:9px 11px;
  border-radius:11px;
  background:var(--surface-3);
}
.detail-form-cell span,.conj-row span{color:var(--muted)}
.detail-example{
  padding:10px 12px;
  margin-bottom:7px;
  border-radius:11px;
  background:var(--surface-3);
}
.detail-example .ru{margin-top:3px;color:var(--muted)}
.conj-block{display:grid;gap:6px}
.conj-title{color:var(--muted);font-size:.8rem}
.dialog-actions{
  display:flex;
  justify-content:flex-end;
  gap:8px;
  margin-top:12px;
}

/* ---------- more sheet ---------- */

.more-sheet{position:fixed;inset:0;z-index:90;display:grid;align-items:end}
.more-sheet-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.54);backdrop-filter:blur(6px)}
.more-sheet-panel{
  position:relative;
  width:min(100%,640px);
  margin:0 auto;
  padding:15px 15px calc(15px + env(safe-area-inset-bottom));
  border-radius:24px 24px 0 0;
  background:var(--surface);
  border:1px solid var(--line-strong);
  box-shadow:0 -20px 60px rgba(0,0,0,.28);
}
.more-menu-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.more-close{width:40px;height:40px;padding:0;border-radius:50%;background:var(--surface-2);color:var(--text)}
.more-menu-grid{display:grid;gap:6px}
.more-menu-grid>button,.more-menu-grid>a{
  min-height:52px;
  padding:0 14px;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  border-radius:13px;
  background:var(--surface-2);
  color:var(--text);
  text-decoration:none;
}

/* ---------- bottom nav ---------- */

/* ---------- bottom nav + mobile layout: v1.7.8 ---------- */

.mobile-nav{display:none}

@media(max-width:900px){
  /*
    Mobile layout:
    - body is a normal flex column: header + content
    - footer is fixed independently
    - no vh/svh/dvh sizing for Home/Training
    - footer is extended down by iOS safe-area amount so its visible edge
      reaches the physical bottom of a standalone PWA.
  */
  html,body{
    width:100%;
    min-height:100%;
  }

  body{
    min-height:100vh;
    display:flex;
    flex-direction:column;
    overflow-x:hidden;
  }

  .app-header{
    position:relative;
    flex:0 0 auto;
    z-index:40;
  }

  .header-row{
    min-height:52px;
    padding:5px 12px;
  }

  .logo-mini.logo-book{
    width:39px;
    height:39px;
    border-radius:12px;
  }

  .brand-title{font-size:1.08rem}

  .header-actions .theme-toggle{
    width:38px;
    height:38px;
  }

  .top-tabs{display:none}

  .header-actions .ghost:not(.theme-toggle),
  .header-actions .linkbtn{display:none}

  .shell{
    flex:1 1 auto;
    width:100%;
    min-height:0;
    padding:10px 9px 68px;
  }

  .mobile-nav{
    position:fixed !important;
    z-index:100;
    left:0 !important;
    right:0 !important;

    /* Key iOS PWA fix: compensate the area Safari/standalone keeps
       below CSS bottom:0 on some first-render states. */
    bottom:calc(-1 * env(safe-area-inset-bottom, 0px)) !important;

    display:grid;
    grid-template-columns:repeat(5,minmax(0,1fr));

    width:100%;
    height:calc(60px + env(safe-area-inset-bottom, 0px));
    min-height:calc(60px + env(safe-area-inset-bottom, 0px));
    margin:0 !important;
    padding:0 0 env(safe-area-inset-bottom, 0px);

    background:var(--footer);
    border-top:1px solid var(--line-strong);
    box-shadow:0 -4px 16px rgba(0,0,0,.035);
  }

  .mobile-nav-btn{
    position:relative;
    min-width:0;
    height:60px;
    min-height:60px;
    padding:6px 2px 3px;
    border:0;
    border-radius:0;

    display:grid;
    grid-template-rows:33px 16px;
    align-content:center;
    justify-items:center;

    background:transparent;
    color:var(--soft);
  }

  .mobile-nav-btn + .mobile-nav-btn::before{
    content:"";
    position:absolute;
    left:0;
    top:14%;
    bottom:14%;
    width:1.25px;
    background:var(--line-strong);
    opacity:.62;
  }

  .mobile-nav-btn.active{color:var(--green)}

  .mobile-nav-btn.active::after{
    content:"";
    position:absolute;
    top:3px;
    left:35%;
    right:35%;
    height:2px;
    border-radius:999px;
    background:currentColor;
    opacity:.68;
  }

  .nav-glyph{
    height:33px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:1.58rem;
    line-height:1;
  }

  .mobile-nav-btn small{
    color:inherit;
    font-size:.57rem;
    line-height:1;
  }

  .filters,.irr-filters{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  /* HOME: use ALL free vertical space between header and footer. */
  body[data-view="home"] .shell{
    display:flex;
    flex-direction:column;
    overflow:hidden;
    padding:6px 8px 66px;
  }

  body[data-view="home"] .render-home{
    flex:1 1 auto;
    min-height:0;
    width:min(100%,760px);
    margin:0 auto;
    display:grid;
    grid-template-rows:minmax(0,1.82fr) minmax(0,.82fr) minmax(0,.80fr);
    gap:6px;
  }

  body[data-view="home"] .render-section{
    min-height:0;
    height:100%;
    padding:7px;
    display:grid;
    grid-template-rows:auto minmax(0,1fr);
    gap:5px;
    overflow:hidden;
  }

  body[data-view="home"] .render-section-title{
    margin:0;
    font-size:1.06rem;
  }

  body[data-view="home"] .render-grid{
    height:100%;
    min-height:0;
    gap:5px;
  }

  body[data-view="home"] .render-section:first-child .render-grid-2{
    grid-template-rows:repeat(2,minmax(0,1fr));
  }

  body[data-view="home"] .render-section:last-child .render-grid-2,
  body[data-view="home"] .render-grid-3{
    grid-template-rows:minmax(0,1fr);
  }

  body[data-view="home"] .render-tile{
    min-height:0;
    height:100%;
    padding:7px 8px;
    border-radius:13px;
  }

  body[data-view="home"] .render-tile-icon{
    width:27px;
    height:27px;
    margin-bottom:4px;
    font-size:.82rem;
  }

  body[data-view="home"] .render-tile-label{
    font-size:.88rem;
    line-height:1.12;
  }

  body[data-view="home"] .render-tile strong{
    font-size:1.28rem;
    margin-top:3px;
  }

  body[data-view="home"] .render-tile-unit{
    font-size:.60rem;
    margin-top:2px;
  }

  body[data-view="home"] .render-training-stats .render-tile-label{
    font-size:.76rem;
  }

  body[data-view="home"] .render-training-stats .render-tile strong{
    font-size:1.18rem;
  }

  /* TRAINING: no page-specific viewport/footer model.
     It intentionally uses the same .shell and .mobile-nav as every other page. */
  #studyView.render-study-view{
    min-height:calc(100vh - 128px);
    height:auto;
  }

  .render-study-topbar{
    flex:0 0 44px;
    grid-template-columns:40px 1fr 40px;
    margin-bottom:6px;
  }

  .render-round-btn{
    width:38px;
    height:38px;
  }

  .render-study-setup{
    max-width:780px;
    margin:6px auto 0;
    padding:20px 18px 18px;
  }
}

@media(max-width:620px){
  .filters,.irr-filters{grid-template-columns:1fr}
  .cards{grid-template-columns:1fr}

  .grade-row-3,.detail-review-actions{grid-template-columns:1fr}
  .grammar-formula,.topic-compare{grid-template-columns:1fr}
  .detail-verb-grid,.detail-adjective-grid{grid-template-columns:1fr}

  .study-count-row-clean{gap:7px}
  .study-count{min-height:56px}
  .study-three-actions{gap:6px}
  .study-three-actions button{min-height:62px;font-size:.78rem}
  .study-options-choices{gap:7px}
  .study-options-choices button{min-height:64px}
}

@media(max-width:390px){
  body[data-view="home"] .render-tile-label{font-size:.82rem}
  body[data-view="home"] .render-training-stats .render-tile-label{font-size:.70rem}
  body[data-view="home"] .render-tile strong{font-size:1.20rem}
  .study-result-line{grid-template-columns:82px 1fr}
}




/* v1.7.10 — Study uses the exact same footer anchoring as all other pages */
@media(max-width:900px){
  body[data-view="study"] .shell{
    overflow:visible !important;
  }

  body[data-view="study"] #studyView{
    padding-bottom:8px;
  }

  body[data-view="study"] .mobile-nav{
    /* deliberately only inherits the global mobile-nav geometry */
    height:calc(60px + env(safe-area-inset-bottom, 0px)) !important;
    min-height:calc(60px + env(safe-area-inset-bottom, 0px)) !important;
  }
}


/* ==========================================================
   v1.7.11 — Study feedback stability + compact correct state
   ========================================================== */
.study-feedback{
  min-height:96px;
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
}

.study-result-panel{
  min-height:88px;
  padding:10px 12px;
  gap:7px;
}

.study-result-panel.is-correct{
  grid-template-columns:1fr;
}

.study-result-head{
  min-height:34px;
}

.study-result-icon{
  width:34px;
  height:34px;
}

.study-result-hint{
  padding:7px 9px;
  border-radius:10px;
  background:var(--surface-3);
  color:var(--muted);
  font-size:.82rem;
  line-height:1.2;
}

.study-result-hint strong{
  color:var(--text);
  font-weight:620;
}

.study-next-btn{
  min-height:44px;
}


/* ==========================================================
   v1.7.12 — Grammar visual structure
   ========================================================== */

.grammar-legend{
  display:flex;
  flex-wrap:wrap;
  gap:6px 10px;
  margin:0 0 10px;
  padding:9px 11px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--surface);
  color:var(--muted);
  font-size:.72rem;
}

.grammar-legend>span{
  display:inline-flex;
  align-items:center;
  gap:5px;
}

.legend-dot{
  width:9px;
  height:9px;
  border-radius:50%;
  display:inline-block;
}
.legend-dot.connector{background:#4dbbc6}
.legend-dot.konj{background:#af79dc}
.legend-dot.vend{background:#68b77c}
.legend-dot.v2{background:#d6a14f}
.legend-dot.inf{background:#6ea2dc}

#topicsView .topic-example .de{
  line-height:1.85;
  font-size:.94rem;
}

#topicsView .g-connector,
#topicsView .g-konj,
#topicsView .g-vend,
#topicsView .g-v2,
#topicsView .g-inf,
#topicsView .g-case{
  display:inline-block;
  position:relative;
  padding:1px 5px 2px;
  border-radius:7px;
  font-weight:700;
  line-height:1.35;
}

#topicsView .g-connector{
  color:#79d9e1;
  background:rgba(63,184,195,.13);
  box-shadow:inset 0 0 0 1px rgba(83,203,212,.18);
}

#topicsView .g-konj{
  color:#d3a4ef;
  background:rgba(169,102,211,.14);
  box-shadow:inset 0 0 0 1px rgba(190,132,226,.18);
}

#topicsView .g-vend{
  color:#9bd4a6;
  background:rgba(84,166,105,.13);
  box-shadow:inset 0 0 0 1px rgba(105,190,126,.18);
}

#topicsView .g-v2{
  color:#e5bd72;
  background:rgba(190,139,54,.14);
  box-shadow:inset 0 0 0 1px rgba(214,161,73,.18);
}

#topicsView .g-inf{
  color:#9fc4eb;
  background:rgba(84,139,199,.13);
  box-shadow:inset 0 0 0 1px rgba(106,163,222,.18);
}

#topicsView [data-pos]::after{
  content:attr(data-pos);
  position:relative;
  top:-.08em;
  margin-left:4px;
  font-size:.52em;
  font-weight:800;
  letter-spacing:.05em;
  opacity:.68;
}

#topicsView .g-case.g-dativ{
  color:#9bd4a6;
  background:rgba(84,166,105,.13);
}
#topicsView .g-case.g-akk{
  color:#e5bd72;
  background:rgba(190,139,54,.14);
}

#topicsView .grammar-formula{
  align-items:stretch;
}

#topicsView .grammar-formula span{
  display:flex;
  align-items:center;
  justify-content:center;
  flex-wrap:wrap;
  gap:4px;
  min-height:48px;
  line-height:1.25;
}

#topicsView .grammar-formula small{
  display:block;
  width:100%;
  margin-top:2px;
  color:var(--soft);
  font-size:.66rem;
  font-weight:600;
}

#topicsView .topic-block h4 em,
#topicsView .topic-accordion summary em{
  color:#79d9e1;
  font-style:normal;
  font-weight:750;
}

html:not([data-theme="dark"]) #topicsView .g-connector{color:#267d86}
html:not([data-theme="dark"]) #topicsView .g-konj{color:#7c4ea0}
html:not([data-theme="dark"]) #topicsView .g-vend{color:#447f52}
html:not([data-theme="dark"]) #topicsView .g-v2{color:#8e641e}
html:not([data-theme="dark"]) #topicsView .g-inf{color:#477aa9}
html:not([data-theme="dark"]) #topicsView .topic-block h4 em,
html:not([data-theme="dark"]) #topicsView .topic-accordion summary em{color:#267d86}

@media(max-width:620px){
  .grammar-legend{
    gap:5px 8px;
    font-size:.67rem;
  }

  #topicsView .topic-example .de{
    line-height:1.9;
    font-size:.91rem;
  }

  #topicsView .g-connector,
  #topicsView .g-konj,
  #topicsView .g-vend,
  #topicsView .g-v2,
  #topicsView .g-inf,
  #topicsView .g-case{
    padding-left:4px;
    padding-right:4px;
  }
}


/* ==========================================================
   v1.7.13 — Grammar rule blocks / connected trotzdem examples
   ========================================================== */

#topicsView .topic-list{
  display:grid;
  gap:7px;
  margin:7px 0 0;
  padding-left:20px;
}

#topicsView .topic-list li{
  padding:7px 9px 7px 4px;
  line-height:1.55;
  border-bottom:1px solid var(--line);
}

#topicsView .topic-list li:last-child{
  border-bottom:0;
}

#topicsView .topic-list .g-connector,
#topicsView .topic-list .g-konj,
#topicsView .topic-list .g-vend,
#topicsView .topic-list .g-v2,
#topicsView .topic-list .g-inf{
  margin:0 1px;
}

#topicsView .topic-compare .g-connector{
  font-size:1.02rem;
  margin-bottom:4px;
}

#topicsView .topic-compare p .g-vend,
#topicsView .topic-compare p .g-v2{
  margin-top:4px;
}

#topicsView .topic-example .de{
  word-spacing:.03em;
}


/* ==========================================================
   v1.7.14 — Unified sentence structure diagrams
   ========================================================== */

#topicsView .grammar-formula{
  display:none;
}

#topicsView .sentence-structure{
  display:flex;
  flex-wrap:wrap;
  align-items:stretch;
  gap:5px;
  margin:10px 0 12px;
  padding:8px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--surface-2);
}

#topicsView .ss-part{
  min-width:58px;
  min-height:50px;
  padding:6px 8px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2px;
  border-radius:10px;
  background:var(--surface-3);
  box-shadow:inset 0 0 0 1px var(--line);
  text-align:center;
}

#topicsView .ss-part small{
  color:var(--soft);
  font-size:.56rem;
  line-height:1.05;
  font-weight:700;
  letter-spacing:.035em;
  text-transform:uppercase;
}

#topicsView .ss-part b{
  color:var(--text);
  font-size:.82rem;
  line-height:1.14;
  font-weight:720;
}

#topicsView .ss-punct{
  min-width:16px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:var(--text);
  font-size:1.35rem;
  font-weight:800;
}

#topicsView .ss-connector{
  background:rgba(63,184,195,.14);
  box-shadow:inset 0 0 0 1px rgba(83,203,212,.22);
}
#topicsView .ss-connector b{color:#79d9e1}

#topicsView .ss-konj{
  background:rgba(169,102,211,.14);
  box-shadow:inset 0 0 0 1px rgba(190,132,226,.22);
}
#topicsView .ss-konj b{color:#d3a4ef}

#topicsView .ss-vend{
  border-bottom:2px solid rgba(105,190,126,.72);
}
#topicsView .ss-vend small,
#topicsView .ss-vend b{color:#9bd4a6}

#topicsView .ss-v2{
  border-bottom:2px solid rgba(214,161,73,.78);
}
#topicsView .ss-v2 small,
#topicsView .ss-v2 b{color:#e5bd72}

#topicsView .ss-inf{
  background:rgba(84,139,199,.13);
  box-shadow:inset 0 0 0 1px rgba(106,163,222,.20);
}
#topicsView .ss-inf b{color:#9fc4eb}

#topicsView .ss-question{
  background:rgba(111,160,210,.11);
}
#topicsView .ss-question b{color:#9fc4eb}

#topicsView .ss-dativ{
  background:rgba(84,166,105,.13);
}
#topicsView .ss-dativ b{color:#9bd4a6}

#topicsView .ss-akk{
  background:rgba(190,139,54,.14);
}
#topicsView .ss-akk b{color:#e5bd72}

html:not([data-theme="dark"]) #topicsView .ss-connector b{color:#267d86}
html:not([data-theme="dark"]) #topicsView .ss-konj b{color:#7c4ea0}
html:not([data-theme="dark"]) #topicsView .ss-vend small,
html:not([data-theme="dark"]) #topicsView .ss-vend b{color:#447f52}
html:not([data-theme="dark"]) #topicsView .ss-v2 small,
html:not([data-theme="dark"]) #topicsView .ss-v2 b{color:#8e641e}
html:not([data-theme="dark"]) #topicsView .ss-inf b,
html:not([data-theme="dark"]) #topicsView .ss-question b{color:#477aa9}
html:not([data-theme="dark"]) #topicsView .ss-dativ b{color:#447f52}
html:not([data-theme="dark"]) #topicsView .ss-akk b{color:#8e641e}

@media(max-width:620px){
  #topicsView .sentence-structure{
    flex-wrap:nowrap;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
    padding:7px;
  }

  #topicsView .sentence-structure::-webkit-scrollbar{display:none}

  #topicsView .ss-part{
    flex:0 0 auto;
    min-width:68px;
    min-height:48px;
  }

  #topicsView .ss-part b{font-size:.78rem}
  #topicsView .ss-part small{font-size:.52rem}
}


/* ==========================================================
   v1.7.15 — Grammar structures wrap inside the topic card
   ========================================================== */

#topicsView .sentence-structure{
  width:100%;
  max-width:100%;
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:6px;
  margin:10px 0 12px;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
  overflow:visible;
}

#topicsView .ss-part{
  flex:0 1 auto;
  min-width:0;
  min-height:40px;
  max-width:100%;
  padding:6px 9px;
  display:inline-flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2px;
  border-radius:9px;
  white-space:normal;
  overflow-wrap:anywhere;
}

#topicsView .ss-part b{
  font-size:.91rem;
  line-height:1.16;
}

#topicsView .ss-part small{
  font-size:.57rem;
  line-height:1.05;
}

#topicsView .ss-punct{
  flex:0 0 auto;
  min-width:auto;
  padding:0 1px;
  font-size:1.22rem;
}

@media(max-width:620px){
  #topicsView .sentence-structure{
    display:flex;
    flex-wrap:wrap;
    overflow:visible;
    gap:5px;
    padding:0;
  }

  #topicsView .ss-part{
    flex:0 1 auto;
    min-width:0;
    min-height:38px;
    padding:6px 8px;
  }

  #topicsView .ss-part b{
    font-size:.88rem;
  }

  #topicsView .ss-part small{
    font-size:.54rem;
  }
}

/* ---------- Video lessons ---------- */

#topicsView .topic-video{
  margin-top:10px;
  padding:11px;
  border-radius:15px;
  border:1px solid var(--line);
  background:var(--surface-2);
}

#topicsView .topic-video-kicker{
  margin:0 0 7px 2px;
  color:var(--muted);
  font-size:.72rem;
  font-weight:720;
  letter-spacing:.05em;
  text-transform:uppercase;
}

#topicsView .topic-video-link{
  min-width:0;
  min-height:58px;
  padding:9px 10px;
  display:grid;
  grid-template-columns:38px minmax(0,1fr) 24px;
  align-items:center;
  gap:9px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--surface-3);
  color:var(--text);
  text-decoration:none;
}

#topicsView .topic-video-link + .topic-video-link{
  margin-top:6px;
}

#topicsView .topic-video-link.secondary{
  background:color-mix(in srgb,var(--surface-3) 72%,transparent);
}

#topicsView .topic-video-play{
  width:36px;
  height:36px;
  display:grid;
  place-items:center;
  border-radius:50%;
  background:rgba(201,65,55,.14);
  color:#e06b62;
  font-size:.92rem;
}

#topicsView .topic-video-copy{
  min-width:0;
  display:grid;
  gap:2px;
}

#topicsView .topic-video-copy strong{
  min-width:0;
  font-size:.88rem;
  line-height:1.18;
  overflow-wrap:anywhere;
}

#topicsView .topic-video-copy small{
  color:var(--muted);
  font-size:.70rem;
  line-height:1.2;
}

#topicsView .topic-video-open{
  color:var(--soft);
  font-size:1rem;
}

@media(max-width:620px){
  #topicsView .topic-video{
    padding:9px;
  }

  #topicsView .topic-video-link{
    grid-template-columns:34px minmax(0,1fr) 20px;
    min-height:54px;
    padding:8px;
    gap:8px;
  }

  #topicsView .topic-video-play{
    width:32px;
    height:32px;
  }

  #topicsView .topic-video-copy strong{
    font-size:.84rem;
  }
}


/* ==========================================================
   v1.7.16 — Momente B1 review section
   ========================================================== */

.momente-course{
  margin:0 0 14px;
  padding:12px;
  border-radius:22px;
  border:1px solid color-mix(in srgb,var(--cyan) 34%,var(--line));
  background:
    radial-gradient(circle at 92% 0%,rgba(70,174,171,.10),transparent 34%),
    var(--surface);
  box-shadow:var(--shadow-soft);
}

.momente-course-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:3px 3px 11px;
}

.momente-course-head h3{
  margin:3px 0 2px;
  font-size:1.18rem;
  letter-spacing:-.015em;
}

.momente-course-head p{
  font-size:.84rem;
}

.momente-badge{
  color:var(--cyan);
  font-size:.68rem;
  font-weight:800;
  letter-spacing:.12em;
}

.momente-progress{
  flex:0 0 auto;
  min-width:52px;
  padding:7px 9px;
  text-align:center;
  border-radius:12px;
  background:var(--surface-2);
  color:var(--muted);
  font-size:.78rem;
  font-weight:720;
  border:1px solid var(--line);
}

.momente-lessons{
  display:grid;
  gap:8px;
}

.momente-lesson{
  border-color:color-mix(in srgb,var(--cyan) 22%,var(--line));
}

.momente-lesson .topic-kicker{
  color:var(--cyan);
}

.momente-map-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:7px;
}

.momente-map-grid>div{
  min-width:0;
  padding:10px;
  display:grid;
  gap:4px;
  border-radius:11px;
  background:var(--surface-3);
}

.momente-map-grid span{
  color:var(--soft);
  font-size:.66rem;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.045em;
}

.momente-map-grid strong{
  font-size:.86rem;
  line-height:1.25;
}

.momente-compare{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:7px;
  margin:8px 0 10px;
}

.momente-compare.three{
  grid-template-columns:repeat(3,minmax(0,1fr));
}

.momente-compare>div{
  min-width:0;
  padding:10px;
  display:grid;
  gap:5px;
  border-radius:12px;
  background:var(--surface-3);
  border:1px solid var(--line);
}

.momente-compare>div>strong{
  font-size:.85rem;
  line-height:1.22;
}

.momente-compare>div>small{
  color:var(--muted);
  font-size:.70rem;
  line-height:1.25;
}

.momente-speaking{
  background:
    radial-gradient(circle at 0 0,rgba(93,151,218,.08),transparent 46%),
    var(--surface-2);
}

.momente-prompts{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:9px;
}

.momente-prompts span{
  padding:7px 9px;
  border-radius:10px;
  background:var(--surface-3);
  color:var(--text);
  font-size:.82rem;
  border:1px solid var(--line);
}

.topics-divider{
  display:flex;
  align-items:center;
  gap:10px;
  margin:14px 2px 10px;
  color:var(--muted);
  font-size:.72rem;
  font-weight:720;
  text-transform:uppercase;
  letter-spacing:.07em;
}

.topics-divider::before,
.topics-divider::after{
  content:"";
  height:1px;
  flex:1;
  background:var(--line);
}

@media(max-width:620px){
  .momente-course{
    padding:9px;
    border-radius:19px;
  }

  .momente-course-head{
    align-items:flex-start;
  }

  .momente-course-head h3{
    font-size:1.08rem;
  }

  .momente-map-grid,
  .momente-compare,
  .momente-compare.three{
    grid-template-columns:1fr;
  }

  .momente-progress{
    min-width:48px;
    padding:6px 7px;
  }
}


/* ==========================================================
   v1.7.17 — Momente mint panel + timestamp video badges
   ========================================================== */

.momente-course{
  border-color:rgba(74,190,170,.24);
  background:
    radial-gradient(circle at 88% 0%,rgba(70,204,177,.16),transparent 38%),
    linear-gradient(145deg,
      color-mix(in srgb,var(--surface) 86%,#5fc9af 14%),
      color-mix(in srgb,var(--surface) 94%,#5fc9af 6%));
}

html[data-theme="dark"] .momente-course{
  background:
    radial-gradient(circle at 90% 0%,rgba(68,211,179,.16),transparent 40%),
    linear-gradient(145deg,#102a2a,#112328 68%,#102128);
  border-color:rgba(93,214,187,.25);
}

html:not([data-theme="dark"]) .momente-course{
  background:
    radial-gradient(circle at 90% 0%,rgba(77,196,169,.18),transparent 40%),
    linear-gradient(145deg,#effaf7,#f5fbf9 70%,#eef7f5);
  border-color:rgba(68,173,151,.24);
}

.momente-badge{
  color:#69cfb6;
}

html:not([data-theme="dark"]) .momente-badge{
  color:#2f907c;
}

.topic-video-link{
  position:relative;
}

.topic-video-timebadge{
  position:absolute;
  top:6px;
  right:28px;
  padding:2px 5px;
  border-radius:999px;
  background:color-mix(in srgb,var(--cyan) 13%,var(--surface));
  color:var(--cyan);
  font-size:.55rem;
  font-weight:760;
  letter-spacing:.04em;
  text-transform:uppercase;
  pointer-events:none;
}

@media(max-width:620px){
  .topic-video-timebadge{
    top:5px;
    right:24px;
    font-size:.51rem;
  }
}


/* ==========================================================
   v1.7.18 — Momente flatter hierarchy + tense examples
   ========================================================== */

/* Outer Momente area remains the only clearly tinted container. */
.momente-course{
  padding:12px 12px 10px;
}

/* Lessons are no longer "cards inside a card": use flat rows + separators. */
.momente-course .momente-lessons{
  gap:0;
}

.momente-course .momente-lesson{
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
}

.momente-course .momente-lesson + .momente-lesson{
  margin-top:5px;
  padding-top:5px;
  border-top:1px solid color-mix(in srgb,var(--cyan) 20%,var(--line));
}

.momente-course .momente-lesson > summary{
  padding:12px 5px 10px;
  border-radius:12px;
  background:color-mix(in srgb,var(--surface-2) 76%,transparent);
}

.momente-course .momente-lesson[open] > summary{
  background:color-mix(in srgb,var(--cyan) 7%,var(--surface-2));
}

.momente-course .momente-lesson .topic-body{
  padding:5px 4px 10px;
  gap:0;
}

/* Inner learning sections are flat content sections, not nested cards. */
.momente-course .momente-lesson .topic-block{
  margin:0;
  padding:13px 4px 14px;
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
}

.momente-course .momente-lesson .topic-block + .topic-block,
.momente-course .momente-lesson .topic-video{
  border-top:1px solid var(--line);
}

.momente-course .momente-lesson .topic-block h4{
  margin-bottom:8px;
}

/* The "what we repeat" content becomes a simple compact grid with no boxes. */
.momente-course .momente-book-map{
  padding-top:9px;
}

.momente-course .momente-map-grid{
  gap:0;
  border-top:1px solid var(--line);
  border-bottom:1px solid var(--line);
}

.momente-course .momente-map-grid>div{
  padding:9px 7px;
  border-radius:0;
  background:transparent;
}

.momente-course .momente-map-grid>div:nth-child(odd){
  border-right:1px solid var(--line);
}

.momente-course .momente-map-grid>div:nth-child(n+3){
  border-top:1px solid var(--line);
}

/* Comparison elements keep emphasis, but lose another heavy container layer. */
.momente-course .momente-compare{
  gap:6px;
}

.momente-course .momente-compare>div{
  padding:9px 10px;
  border-radius:10px;
  background:color-mix(in srgb,var(--surface-3) 72%,transparent);
  border:0;
}

/* Sentence structures are kept flat within the lesson. */
.momente-course .sentence-structure{
  margin-top:10px;
}

/* Speaking area: subtle tint only, no full nested card look. */
.momente-course .momente-speaking{
  background:transparent;
}

.momente-course .momente-prompts span{
  background:color-mix(in srgb,var(--surface-3) 72%,transparent);
  border-color:color-mix(in srgb,var(--cyan) 12%,var(--line));
}

/* Video block also becomes a flat section. */
.momente-course .topic-video{
  margin-top:0;
  padding:13px 4px 4px;
  border-radius:0;
  border-left:0;
  border-right:0;
  border-bottom:0;
  background:transparent;
}

.momente-course .topic-video-link{
  background:color-mix(in srgb,var(--surface-3) 76%,transparent);
}

/* Tense examples: one vertical strip instead of another grid of cards. */
.momente-tense-strip>p{
  margin-bottom:8px;
}

.momente-tense-list{
  display:grid;
  gap:0;
  border-top:1px solid var(--line);
  border-bottom:1px solid var(--line);
}

.momente-tense-list>div{
  padding:10px 4px 9px;
}

.momente-tense-list>div + div{
  border-top:1px solid var(--line);
}

.momente-tense-list .de{
  margin:5px 0 3px;
  color:var(--text);
  font-size:.92rem;
  line-height:1.6;
}

.momente-tense-list small{
  color:var(--muted);
  font-size:.74rem;
  line-height:1.3;
}

.tense-tag{
  display:inline-flex;
  padding:2px 7px;
  border-radius:999px;
  background:color-mix(in srgb,var(--cyan) 10%,var(--surface-2));
  color:var(--cyan);
  font-size:.64rem;
  font-weight:750;
  letter-spacing:.03em;
}

/* Mobile: keep the hierarchy especially clean. */
@media(max-width:620px){
  .momente-course{
    padding:9px 9px 7px;
  }

  .momente-course .momente-lesson > summary{
    padding:11px 3px 9px;
  }

  .momente-course .momente-lesson .topic-body{
    padding-left:2px;
    padding-right:2px;
  }

  .momente-course .momente-map-grid{
    grid-template-columns:1fr;
  }

  .momente-course .momente-map-grid>div:nth-child(odd){
    border-right:0;
  }

  .momente-course .momente-map-grid>div + div{
    border-top:1px solid var(--line);
  }
}


/* ==========================================================
   v1.7.19 — Momente content cleanup
   ========================================================== */

.momente-intro-line{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:5px;
  padding:9px 4px 11px;
  color:var(--muted);
  font-size:.82rem;
  line-height:1.45;
  border-bottom:1px solid var(--line);
}

.momente-intro-sep{
  color:var(--soft);
}

.momente-core{
  padding-top:12px !important;
}

.momente-rule-line{
  display:grid;
  grid-template-columns:auto auto minmax(0,1fr);
  align-items:baseline;
  column-gap:6px;
  row-gap:2px;
  padding:7px 2px;
  line-height:1.35;
}

.momente-rule-line + .momente-rule-line{
  border-top:1px solid var(--line);
}

.momente-rule-line .g-connector{
  font-size:1rem;
  min-width:52px;
  text-align:center;
}

.momente-rule-dash{
  color:var(--soft);
}

.momente-rule-line strong{
  font-size:.88rem;
  font-weight:650;
}

.momente-rule-line small{
  grid-column:3;
  color:var(--muted);
  font-size:.72rem;
}

.momente-structure-title{
  margin-top:12px !important;
  margin-bottom:7px !important;
  font-size:.88rem !important;
  color:var(--muted);
  font-weight:700 !important;
}

/* Lessons themselves stay flat; summary is the only clear sub-panel. */
.momente-course .momente-lesson > summary{
  box-shadow:none;
}

/* Remove residual "card" feeling from inner Momente sections. */
.momente-course .topic-block,
.momente-course .topic-video{
  box-shadow:none !important;
}

@media(max-width:620px){
  .momente-rule-line{
    grid-template-columns:auto auto minmax(0,1fr);
    column-gap:5px;
    padding:7px 0;
  }

  .momente-rule-line .g-connector{
    min-width:48px;
  }

  .momente-rule-line strong{
    font-size:.84rem;
  }

  .momente-rule-line small{
    font-size:.69rem;
  }
}


/* ==========================================================
   v1.7.20 — General grammar cleanup
   Same content rhythm as Momente, without nested cards.
   ========================================================== */
#topicsView .general-topic .topic-body{
  display:block;
  padding-top:0;
}
#topicsView .general-topic .general-topic-intro{
  margin:0 2px;
}
#topicsView .general-topic .topic-block{
  margin:0;
  padding:14px 4px;
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
}
#topicsView .general-topic .topic-block + .topic-block,
#topicsView .general-topic .topic-video{
  border-top:1px solid var(--line);
}
#topicsView .general-topic .topic-block h4{
  margin-top:0;
}
#topicsView .general-topic .topic-video{
  margin-top:0;
  padding:13px 4px 4px;
  border-radius:0;
  border-left:0;
  border-right:0;
  border-bottom:0;
  background:transparent;
}
#topicsView .general-topic .topic-video-link{
  background:color-mix(in srgb,var(--surface-3) 76%,transparent);
}
#topicsView .topic-mini-review p{
  margin:0;
  line-height:1.6;
}
#topicsView .mini-review-answer{
  display:block;
  margin-top:7px;
  color:var(--muted);
}
@media(max-width:620px){
  #topicsView .general-topic .topic-body{
    padding-left:10px;
    padding-right:10px;
  }
  #topicsView .general-topic .topic-block{
    padding-left:2px;
    padding-right:2px;
  }
}


/* v1.7.23 — experimental vocabulary trainers */
.special-study-block{
  margin-top:22px;
  padding-top:18px;
  border-top:1px solid color-mix(in srgb,var(--border) 78%,transparent);
}
.special-study-head{display:grid;gap:4px;margin-bottom:12px}
.special-study-head>span{font-size:.78rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.special-study-head p{margin:0;color:var(--muted);font-size:.88rem;line-height:1.45}
.special-study-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.special-study-card{
  min-width:0;text-align:left;display:grid;grid-template-columns:38px 1fr;align-items:center;column-gap:10px;row-gap:2px;
  padding:14px;border-radius:18px;background:color-mix(in srgb,var(--surface) 92%,var(--violet) 8%);
  border:1px solid color-mix(in srgb,var(--border) 70%,var(--violet) 30%);color:var(--text);
}
.special-study-card:nth-child(2){background:color-mix(in srgb,var(--surface) 92%,var(--amber) 8%);border-color:color-mix(in srgb,var(--border) 70%,var(--amber) 30%)}
.special-study-card .special-study-icon{grid-row:1/3;display:grid;place-items:center;width:38px;height:38px;border-radius:12px;background:color-mix(in srgb,var(--violet) 15%,transparent);font-size:1.25rem;font-weight:800}
.special-study-card:nth-child(2) .special-study-icon{background:color-mix(in srgb,var(--amber) 15%,transparent)}
.special-study-card strong{font-size:.98rem}
.special-study-card small{display:block;min-width:0;color:var(--muted);font-size:.76rem;line-height:1.35;overflow-wrap:anywhere}
.special-study-session .study-focus-card{min-height:155px}
.special-prompt-translation{margin-top:8px;color:var(--muted);font-size:.9rem;text-align:center}
.special-example{display:grid;gap:3px;margin-top:10px;padding-top:10px;border-top:1px solid color-mix(in srgb,var(--border) 65%,transparent);font-size:.86rem;line-height:1.4}
.special-example span{color:var(--muted)}
.special-study-finish .study-finish-grid{grid-template-columns:repeat(2,minmax(0,1fr));max-width:360px;margin-inline:auto}
@media (max-width:640px){
  .special-study-grid{grid-template-columns:1fr}
  .special-study-card{padding:13px}
  .special-study-session .study-focus-card{min-height:140px}
}

/* v1.7.24 — short training builder */
.custom-study-block{
  margin-top:18px;padding-top:18px;border-top:1px solid var(--border);display:grid;gap:14px
}
.custom-study-head{display:grid;gap:4px}
.custom-study-head>span{font-size:.78rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.custom-study-head h3{margin:0;font-size:1.08rem}
.custom-study-head p{margin:0;color:var(--muted);font-size:.86rem;line-height:1.45}
.custom-mode-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.custom-mode-card{
  position:relative;display:grid;grid-template-columns:36px minmax(0,1fr);grid-template-rows:auto auto;
  column-gap:10px;align-items:center;padding:11px 12px;border:1px solid var(--border);border-radius:15px;
  background:color-mix(in srgb,var(--surface) 95%,var(--violet) 5%);cursor:pointer;min-width:0
}
.custom-mode-card input{position:absolute;opacity:0;pointer-events:none}
.custom-mode-icon{grid-row:1/3;display:grid;place-items:center;width:36px;height:36px;border-radius:11px;background:color-mix(in srgb,var(--violet) 14%,transparent);font-weight:800}
.custom-mode-card strong{font-size:.9rem;line-height:1.15}
.custom-mode-card small{color:var(--muted);font-size:.72rem;line-height:1.28;overflow-wrap:anywhere}
.custom-mode-card:has(input:checked){border-color:color-mix(in srgb,var(--green) 62%,var(--border));background:color-mix(in srgb,var(--surface) 88%,var(--green) 12%)}
.custom-mode-card:has(input:checked) .custom-mode-icon{background:color-mix(in srgb,var(--green) 20%,transparent)}
.custom-mode-card:has(input:checked)::after{content:'✓';position:absolute;right:9px;top:8px;color:var(--green);font-size:.76rem;font-weight:900}
.custom-study-note{font-size:.82rem;color:var(--muted)}
.custom-study-start{margin-top:0}
.custom-study-start:disabled{opacity:.45;cursor:not-allowed}
@media(max-width:520px){
  .custom-mode-grid{grid-template-columns:1fr 1fr;gap:7px}
  .custom-mode-card{grid-template-columns:31px minmax(0,1fr);column-gap:8px;padding:10px 9px;border-radius:13px}
  .custom-mode-icon{width:31px;height:31px;border-radius:9px}
  .custom-mode-card strong{font-size:.82rem;padding-right:10px}
  .custom-mode-card small{font-size:.67rem}
}

/* v1.7.25 — article choice */
.article-choice-options{
  grid-template-columns:repeat(3,minmax(0,1fr));
  margin-top:auto;
}
.article-choice-options button{
  min-height:54px;
  font-size:1.08rem;
  font-weight:750;
}


/* v1.7.28 — 5 минут сегодня + phrase foundation */
.daily-five-card{width:100%;display:flex;align-items:center;gap:14px;text-align:left;padding:16px 18px;margin:0 0 14px;border-radius:20px;border:1px solid rgba(91,231,184,.28);background:linear-gradient(135deg,rgba(41,123,101,.22),rgba(29,52,86,.20));box-shadow:none}
.daily-five-card:hover{transform:none;border-color:rgba(91,231,184,.48)}
.daily-five-icon{display:grid;place-items:center;width:42px;height:42px;flex:0 0 42px;border-radius:14px;background:rgba(91,231,184,.13);font-size:1.35rem}
.daily-five-copy{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}.daily-five-copy strong{font-size:1.08rem}.daily-five-copy small{opacity:.72;line-height:1.35}
.daily-five-arrow{font-size:1.8rem;opacity:.7}
@media(max-width:560px){.daily-five-card{padding:14px;border-radius:18px}.daily-five-copy small{font-size:.78rem}}


/* v1.7.31 — Daily Five layout + clearer short-training tasks */
.daily-five-card{
  min-height:76px;
  margin:0 0 10px;
  padding:12px 14px;
  gap:11px;
  align-self:start;
}
.daily-five-icon{width:38px;height:38px;flex-basis:38px;border-radius:12px}
.daily-five-copy{gap:2px;overflow:hidden}
.daily-five-copy strong{font-size:1rem;line-height:1.15}
.daily-five-copy small{font-size:.76rem;line-height:1.25;white-space:normal;overflow-wrap:anywhere}
.daily-five-arrow{font-size:1.55rem;line-height:1;flex:0 0 auto}

.study-ask{
  width:min(100%,680px);
  margin:0 auto 12px;
  font-size:.92rem;
  line-height:1.35;
  color:var(--muted);
  overflow-wrap:anywhere;
}
.special-study-session .study-focus-word{line-height:1.14}
.special-study-session .study-focus-word-ru{font-size:clamp(1.35rem,5vw,2.35rem)}

@media(max-width:900px){
  /* Home is allowed to grow vertically. Do not squeeze new content into a fixed viewport. */
  body[data-view="home"] .shell{
    display:block;
    overflow:visible;
    padding:6px 8px 76px;
  }
  body[data-view="home"] .render-home{
    min-height:0;
    height:auto;
    display:grid;
    grid-template-rows:auto auto auto;
    gap:8px;
  }
  body[data-view="home"] .render-section{
    height:auto;
    min-height:0;
    overflow:visible;
    display:block;
    padding:8px;
  }
  body[data-view="home"] .render-section-title{margin:0 0 7px}
  body[data-view="home"] .render-grid{height:auto;min-height:0}
  body[data-view="home"] .render-tile{min-height:112px;height:auto}
  body[data-view="home"] .render-training-stats .render-tile{min-height:92px}
}
@media(max-width:560px){
  .daily-five-card{min-height:72px;padding:11px 12px;border-radius:16px}
  .daily-five-copy small{font-size:.72rem}
  .special-study-session .study-focus-card{padding:60px 14px 16px;min-height:180px}
  .study-ask{font-size:.86rem;margin-bottom:10px}
}

/* v1.7.31 — contextual target highlighting */
.study-target-word{
  color:var(--accent, #7ee7c4);
  background:rgba(126,231,196,.10);
  border-radius:.28em;
  padding:0 .10em;
  font-weight:750;
  box-decoration-break:clone;
  -webkit-box-decoration-break:clone;
}


/* v1.7.31 — reliable context highlighting + adaptive home fill */
@media(max-width:900px){
  body[data-view="home"] .render-home{
    min-height:calc(100svh - 154px);
    grid-template-rows:minmax(max-content,1.55fr) minmax(max-content,1fr) minmax(max-content,.82fr);
    align-content:stretch;
  }
  body[data-view="home"] .render-section{
    display:flex;
    flex-direction:column;
  }
  body[data-view="home"] .render-section .render-grid{
    flex:1 1 auto;
    align-content:stretch;
  }
  body[data-view="home"] .render-section .render-grid-2{
    grid-auto-rows:minmax(112px,1fr);
  }
  body[data-view="home"] .render-training-stats{
    grid-auto-rows:minmax(92px,1fr);
  }
  body[data-view="home"] .render-tile{height:100%;}
}
@supports not (height:100svh){
  @media(max-width:900px){
    body[data-view="home"] .render-home{min-height:calc(100vh - 154px);}
  }
}


/* v1.7.36 — hidden Master Dictionary search */
.master-results{margin-top:14px;padding:14px;border:1px solid color-mix(in srgb,var(--accent,#76e6bf) 24%,transparent);border-radius:18px;background:color-mix(in srgb,var(--panel,#111827) 92%,var(--accent,#76e6bf) 8%)}
.master-results-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:10px}.master-results-head strong{display:block;font-size:14px}.master-results-head small{display:block;margin-top:3px;color:var(--muted);font-size:11px;line-height:1.35}.master-count{font-size:11px;color:var(--muted);white-space:nowrap}
.master-cards{display:grid;gap:9px}.master-card{display:flex;gap:12px;align-items:center;padding:12px 12px 12px 13px;border:1px solid color-mix(in srgb,var(--border,#334155) 75%,transparent);border-radius:15px;background:color-mix(in srgb,var(--panel,#111827) 96%,white 4%)}.master-card-main{min-width:0;flex:1}.master-card-title{font-weight:750;font-size:16px}.master-card-meta{margin-top:2px;font-size:10px;color:var(--muted)}.master-card-translation{margin-top:6px;font-size:13px;line-height:1.35}.master-card-forms{margin-top:4px;font-size:11px;color:var(--accent,#76e6bf)}.master-card-example{margin-top:7px;padding-top:7px;border-top:1px solid color-mix(in srgb,var(--border,#334155) 55%,transparent);font-size:11px;line-height:1.35}.master-card-example small{display:block;margin-top:2px;color:var(--muted)}.master-add{flex:0 0 auto;border:0;border-radius:11px;padding:9px 11px;font-weight:700;font-size:11px;background:var(--accent,#76e6bf);color:#07130f}.master-add.is-added{background:transparent;color:var(--muted);border:1px solid var(--border,#334155)}.master-empty{padding:12px;color:var(--muted);font-size:12px;text-align:center}
@media(max-width:640px){.master-results{padding:11px}.master-card{align-items:flex-start;flex-direction:column}.master-add{align-self:stretch}.master-results-head{align-items:flex-start}}

/* v1.7.36 · Master Dictionary: three examples without bloating search cards */
.master-more-examples{margin-top:8px;border-top:1px solid rgba(255,255,255,.06);padding-top:6px}
.master-more-examples summary{cursor:pointer;color:var(--muted);font-size:.82rem;list-style:none}
.master-more-examples summary::-webkit-details-marker{display:none}
.master-more-examples[open] summary{margin-bottom:6px}
.master-more-examples .master-card-example{margin-top:6px}

/* v1.7.38 — UI cleanup: search-first dictionary, calmer home, safer iPhone nav */
.dictionary-toolbar{
  margin-bottom:12px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:20px;
  background:var(--surface);
  box-shadow:var(--shadow-soft);
}
.dictionary-search-box{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:58px;
  padding:0 14px;
  border:1.2px solid color-mix(in srgb,var(--green) 42%,var(--line));
  border-radius:17px;
  background:var(--surface-2);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.035);
}
.dictionary-search-box:focus-within{
  border-color:color-mix(in srgb,var(--green) 78%,white 8%);
  box-shadow:0 0 0 3px color-mix(in srgb,var(--green) 12%,transparent);
}
.dictionary-search-icon{
  flex:0 0 auto;
  color:var(--green);
  font-size:1.45rem;
  line-height:1;
  opacity:.88;
}
.dictionary-search-box #search{
  width:100%;
  min-width:0;
  height:auto;
  padding:0;
  border:0;
  outline:0;
  background:transparent;
  box-shadow:none;
  font-size:1rem;
  color:var(--text);
}
.dictionary-search-box #search:focus{border:0;outline:0;box-shadow:none}
.dictionary-filters{
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:7px;
  margin:9px 0 0;
}
.dictionary-filters select{
  min-height:42px;
  padding:0 10px;
  border-radius:12px;
  font-size:.78rem;
  color:var(--soft);
  background:var(--surface-2);
}

/* Search results from the hidden master dictionary should look like the primary answer. */
.master-results{
  margin:0 0 12px;
  padding:13px;
  border:1.4px solid color-mix(in srgb,var(--green) 46%,transparent);
  border-radius:20px;
  background:linear-gradient(145deg,
    color-mix(in srgb,var(--surface) 92%,var(--green) 8%),
    color-mix(in srgb,var(--surface) 97%,var(--blue) 3%));
  box-shadow:0 8px 28px rgba(0,0,0,.08);
}
.master-results-head{align-items:center;margin-bottom:11px}
.master-results-head strong{font-size:1rem;line-height:1.15}
.master-kicker{
  display:inline-flex;
  margin-bottom:4px;
  padding:3px 7px;
  border-radius:999px;
  background:color-mix(in srgb,var(--green) 15%,transparent);
  color:var(--green);
  font-size:.62rem;
  font-weight:750;
  letter-spacing:.04em;
  text-transform:uppercase;
}
.master-count{font-size:.7rem}
.master-card{
  position:relative;
  align-items:flex-start;
  padding:14px;
  border:1px solid color-mix(in srgb,var(--green) 25%,var(--line));
  border-radius:17px;
  background:var(--surface-2);
}
.master-card::before{
  content:"";
  position:absolute;
  left:0;
  top:14px;
  bottom:14px;
  width:3px;
  border-radius:0 999px 999px 0;
  background:var(--green);
  opacity:.78;
}
.master-card-main{padding-left:4px}
.master-card-title{font-size:1.22rem;font-weight:780;letter-spacing:-.015em}
.master-card-translation{font-size:.96rem;line-height:1.4}
.master-card-meta{font-size:.68rem}
.master-card-forms{font-size:.78rem}
.master-card-example{font-size:.78rem}
.master-add{
  min-height:42px;
  padding:10px 15px;
  border-radius:12px;
  font-size:.78rem;
}

/* Home: one clear action + compact secondary information. */
.home-metrics{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:7px;
}
.home-metric{
  min-width:0;
  min-height:52px;
  padding:7px 5px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2px;
  border:1px solid var(--line);
  border-radius:13px;
  background:var(--surface-2);
  color:var(--text);
  text-align:center;
}
button.home-metric{cursor:pointer}
.home-metric strong{font-size:1.05rem;line-height:1;font-weight:730}
.home-metric span{font-size:.64rem;line-height:1.1;color:var(--muted)}
.home-quick-grid .render-tile{
  min-height:96px;
  padding:10px;
  grid-template-rows:auto auto 1fr;
}
.home-quick-grid .render-tile-icon{
  width:31px;height:31px;margin-bottom:6px;font-size:.86rem;
}
.home-quick-grid .render-tile-label{font-size:.76rem;line-height:1.08}
.home-quick-grid .render-tile strong{font-size:1.34rem;margin-top:5px}
.render-today-section .daily-five-card{margin-bottom:8px}

@media(max-width:900px){
  .shell{padding-bottom:84px}
  body[data-view="home"] .shell{padding-bottom:84px}

  .mobile-nav{
    grid-template-columns:repeat(4,minmax(0,1fr)) !important;
    height:calc(68px + env(safe-area-inset-bottom, 0px)) !important;
    min-height:calc(68px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .mobile-nav-btn{
    height:68px !important;
    min-height:68px !important;
    padding:7px 2px 5px;
    grid-template-rows:36px 18px;
  }
  .nav-glyph{height:36px;font-size:1.66rem}
  .mobile-nav-btn small{font-size:.64rem;font-weight:620;line-height:1.05}
  .mobile-nav-btn.active::after{top:4px;left:37%;right:37%;height:2.5px}
  body[data-view="study"] .mobile-nav{
    height:calc(68px + env(safe-area-inset-bottom, 0px)) !important;
    min-height:calc(68px + env(safe-area-inset-bottom, 0px)) !important;
  }

  body[data-view="home"] .render-home{
    min-height:calc(100svh - 166px);
    grid-template-rows:minmax(max-content,1.08fr) minmax(max-content,1fr) minmax(max-content,.92fr);
    gap:8px;
  }
  body[data-view="home"] .render-section{padding:9px}
  body[data-view="home"] .render-section-title{font-size:1.02rem;margin-bottom:7px}
  body[data-view="home"] .render-quick-section .render-grid{flex:1 1 auto}
  body[data-view="home"] .home-quick-grid .render-tile{height:100%}

  .dictionary-toolbar{padding:9px;border-radius:17px}
  .dictionary-search-box{min-height:54px;border-radius:15px;padding:0 12px}
  .dictionary-search-box #search{font-size:.96rem}
  .dictionary-filters{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
  .dictionary-filters select{min-height:40px;font-size:.72rem;padding:0 8px}
  .master-results{padding:11px;border-radius:17px}
  .master-card{padding:13px;gap:9px}
  .master-card-title{font-size:1.16rem}
  .master-add{align-self:stretch;width:100%;font-size:.82rem}
}
@media(max-width:560px){
  .home-quick-grid.render-grid-3{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
  .home-quick-grid .render-tile{min-height:88px;border-radius:15px;padding:8px}
  .home-quick-grid .render-tile-icon{width:28px;height:28px;margin-bottom:5px}
  .home-quick-grid .render-tile-label{font-size:.68rem}
  .home-quick-grid .render-tile strong{font-size:1.2rem}
  .home-metric{min-height:48px;border-radius:12px}
}
@media(max-width:900px){
  body[data-view="home"] .render-home{min-height:calc(100svh - 146px)}
}
@supports not (height:100svh){
  @media(max-width:900px){body[data-view="home"] .render-home{min-height:calc(100vh - 146px)}}
}


/* v1.7.39 — clearer training completion */
.study-promoted-box{
  margin:14px auto 16px;
  max-width:520px;
  padding:14px 15px;
  border:1px solid color-mix(in srgb,var(--green) 36%,var(--line));
  border-radius:18px;
  background:color-mix(in srgb,var(--green) 9%,var(--surface));
  text-align:left;
}
.study-promoted-kicker{font-size:.72rem;font-weight:850;letter-spacing:.05em;text-transform:uppercase;color:var(--green);margin-bottom:4px}
.study-promoted-title{font-weight:800;margin-bottom:9px}
.study-promoted-list{display:flex;flex-wrap:wrap;gap:7px}
.study-promoted-list span{display:inline-flex;padding:6px 9px;border-radius:999px;background:color-mix(in srgb,var(--green) 14%,var(--surface-2));border:1px solid color-mix(in srgb,var(--green) 22%,var(--line));font-weight:750}
.study-promoted-note{margin-top:9px;color:var(--muted);font-size:.78rem}
.study-action-count{display:inline-flex;align-items:center;justify-content:center;min-width:21px;height:21px;padding:0 6px;margin-left:5px;border-radius:999px;background:rgba(255,255,255,.16);font-size:.75rem}
@media(max-width:620px){.study-finish-actions{flex-wrap:wrap}.study-finish-actions button{min-height:46px}.study-promoted-box{margin-inline:0}}

/* v1.7.40 — accumulated error training */
.error-study-block{
  margin-top:14px;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:14px;
  align-items:center;
  padding:15px 16px;
  border-radius:18px;
  border:1px solid color-mix(in srgb,var(--red) 32%,var(--border));
  background:color-mix(in srgb,var(--surface) 92%,var(--red) 8%);
}
.error-study-copy{display:grid;gap:4px;min-width:0}
.error-study-kicker{font-size:.72rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:color-mix(in srgb,var(--red) 76%,var(--text))}
.error-study-copy h3{margin:0;font-size:1.02rem}
.error-study-copy p{margin:0;color:var(--muted);font-size:.82rem;line-height:1.35}
.error-study-types{display:flex;flex-wrap:wrap;gap:6px;margin-top:3px}
.error-study-types span{padding:4px 8px;border-radius:999px;background:rgba(255,255,255,.045);border:1px solid var(--border);font-size:.7rem;color:var(--muted)}
.error-study-types b{color:var(--text)}
.error-study-start{min-height:44px;padding:0 14px;border-radius:13px;white-space:nowrap}
.error-study-start:disabled{opacity:.45;cursor:not-allowed}
.error-study-block.is-empty{border-color:var(--border);background:color-mix(in srgb,var(--surface) 97%,var(--muted) 3%)}
@media(max-width:560px){
  .error-study-block{grid-template-columns:1fr;padding:13px 14px;gap:11px}
  .error-study-start{width:100%}
}

/* v1.7.41 — adaptive per-word training */
.adaptive-study-block{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:16px;
  border:1px solid rgba(100,255,184,.18);
  border-radius:18px;
  background:linear-gradient(135deg,rgba(48,122,92,.15),rgba(70,74,142,.10));
}
.adaptive-study-copy{min-width:0;}
.adaptive-study-kicker{
  display:block;
  margin-bottom:4px;
  color:#8de4b8;
  font-size:.72rem;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.adaptive-study-copy h3{margin:0 0 5px;font-size:1.05rem;}
.adaptive-study-copy p{margin:0;color:var(--muted);font-size:.86rem;line-height:1.35;max-width:36rem;}
.adaptive-study-start{
  flex:0 0 auto;
  min-width:94px;
  min-height:42px;
  border-radius:14px;
  font-weight:800;
}
@media(max-width:520px){
  .adaptive-study-block{align-items:stretch;flex-direction:column;padding:14px;}
  .adaptive-study-start{width:100%;}
}


/* v1.7.45 — simple spaced-repetition queue */
.srs-review-block{
  margin-top:14px;display:flex;align-items:center;justify-content:space-between;gap:14px;
  padding:15px 16px;border-radius:18px;
  border:1px solid color-mix(in srgb,var(--cyan) 30%,var(--border));
  background:linear-gradient(135deg,color-mix(in srgb,var(--cyan) 10%,var(--surface)),color-mix(in srgb,var(--blue) 7%,var(--surface)));
}
.srs-review-copy{min-width:0;display:grid;gap:4px}.srs-review-copy h3{margin:0;font-size:1.04rem}
.srs-review-copy p{margin:0;color:var(--muted);font-size:.83rem;line-height:1.35}
.srs-review-kicker{font-size:.72rem;font-weight:850;letter-spacing:.08em;text-transform:uppercase;color:var(--cyan)}
.srs-review-start{flex:0 0 auto;min-height:44px;padding:0 15px;border-radius:14px;font-weight:800;white-space:nowrap}
.srs-review-start:disabled{opacity:.48}.srs-review-block.is-empty{border-color:var(--border);background:var(--surface)}
.review-learned-badge{display:inline-flex;align-self:center;margin:4px auto 0;padding:5px 9px;border-radius:999px;font-size:.72rem;font-weight:750;color:var(--green);background:color-mix(in srgb,var(--green) 10%,transparent);border:1px solid color-mix(in srgb,var(--green) 22%,var(--border))}
.review-grade-help{margin:15px 0 7px;color:var(--muted);font-size:.8rem;text-align:center}
.grade-row .grade{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-height:54px}
.grade-row .grade small{font-size:.66rem;font-weight:600;opacity:.7}
.review-next-due{margin-top:10px;text-align:center;color:var(--soft);font-size:.78rem}
@media(max-width:520px){.srs-review-block{align-items:stretch;flex-direction:column;padding:14px}.srs-review-start{width:100%}}


/* v1.7.47 — swipeable flip cards */
.flashcard-study-block{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:16px;border:1px solid color-mix(in srgb,var(--violet) 28%,var(--border));border-radius:18px;background:linear-gradient(135deg,color-mix(in srgb,var(--violet) 10%,var(--surface)),color-mix(in srgb,var(--cyan) 7%,var(--surface)))}
.flashcard-study-copy{min-width:0}.flashcard-study-kicker{display:block;margin-bottom:4px;color:var(--violet);font-size:.72rem;font-weight:850;letter-spacing:.08em;text-transform:uppercase}.flashcard-study-copy h3{margin:0 0 5px;font-size:1.05rem}.flashcard-study-copy p{margin:0;color:var(--muted);font-size:.86rem;line-height:1.35}.flashcard-study-start{flex:0 0 auto;min-width:94px;min-height:42px;border-radius:14px;font-weight:800}
.flashcard-stage{position:relative;display:flex;flex-direction:column;justify-content:center;min-height:min(65vh,620px);padding:20px 0 8px;overflow:hidden}.flashcard-drag{position:relative;width:min(100%,560px);height:390px;margin:0 auto;perspective:1200px;touch-action:pan-y;user-select:none;-webkit-user-select:none;cursor:grab;z-index:2}.flashcard-drag:active{cursor:grabbing}.flashcard-flip{position:relative;width:100%;height:100%;transform-style:preserve-3d;transition:transform .46s cubic-bezier(.2,.7,.2,1)}.flashcard-flip.is-flipped{transform:rotateY(180deg)}.flashcard-face{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;padding:28px;text-align:center;border:1px solid var(--border);border-radius:28px;background:radial-gradient(circle at 50% 52%,color-mix(in srgb,var(--cyan) 10%,transparent),transparent 45%),var(--surface);box-shadow:0 18px 48px rgba(0,0,0,.18);backface-visibility:hidden;-webkit-backface-visibility:hidden}.flashcard-back{transform:rotateY(180deg);background:radial-gradient(circle at 50% 48%,color-mix(in srgb,var(--violet) 12%,transparent),transparent 48%),var(--surface)}.flashcard-face>strong{font-size:clamp(2rem,7vw,3.2rem);line-height:1.08;max-width:100%;overflow-wrap:anywhere}.flashcard-back>strong{font-size:clamp(1.7rem,6vw,2.7rem)}.flashcard-side-label{position:absolute;top:20px;left:22px;color:var(--muted);font-size:.76rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.flashcard-face>small{color:var(--muted);font-weight:750}.flashcard-tap-hint{position:absolute;bottom:18px;color:var(--muted);font-size:.76rem}.flashcard-meta{color:var(--soft);font-size:.88rem;line-height:1.35}.flashcard-example{display:grid;gap:5px;max-width:92%;padding-top:4px;color:var(--soft);font-size:.88rem;line-height:1.35}.flashcard-example span{color:var(--muted)}.flashcard-swipe-label{position:absolute;top:50%;z-index:1;opacity:0;padding:9px 13px;border-radius:12px;font-size:.86rem;font-weight:900;letter-spacing:.08em;transform:translateY(-50%);pointer-events:none}.flashcard-swipe-no{left:14px;color:var(--red);border:1px solid color-mix(in srgb,var(--red) 55%,transparent);background:color-mix(in srgb,var(--red) 12%,var(--surface))}.flashcard-swipe-yes{right:14px;color:var(--green);border:1px solid color-mix(in srgb,var(--green) 55%,transparent);background:color-mix(in srgb,var(--green) 12%,var(--surface))}.flashcard-gesture-help{display:flex;justify-content:space-between;width:min(100%,560px);margin:15px auto 0;padding:0 8px;color:var(--muted);font-size:.78rem}.flashcard-finish .study-promoted{margin-top:14px}
@media(max-width:520px){.flashcard-study-block{align-items:stretch;flex-direction:column;padding:14px}.flashcard-study-start{width:100%}.flashcard-stage{min-height:560px;padding-top:12px}.flashcard-drag{height:360px}.flashcard-face{padding:24px 20px;border-radius:24px}.flashcard-side-label{top:17px;left:18px}.flashcard-tap-hint{bottom:15px}}

/* v1.7.47 — richer swipe feedback for flashcards */
.flashcard-drag{isolation:isolate}
.flashcard-swipe-tint{position:absolute;inset:0;z-index:4;border-radius:28px;opacity:0;pointer-events:none;transition:opacity .06s linear;mix-blend-mode:normal}
.flashcard-swipe-tint-yes{background:linear-gradient(135deg,rgba(68,210,112,.16),rgba(54,190,94,.52));box-shadow:inset 0 0 0 2px rgba(98,235,138,.34),inset 0 -80px 120px rgba(25,135,67,.18)}
.flashcard-swipe-tint-no{background:linear-gradient(225deg,rgba(242,78,78,.16),rgba(210,47,62,.52));box-shadow:inset 0 0 0 2px rgba(255,113,113,.34),inset 0 -80px 120px rgba(145,25,43,.18)}
.flashcard-swipe-badge{position:absolute;top:24px;z-index:5;display:flex;align-items:center;gap:9px;padding:9px 13px 9px 9px;border-radius:999px;opacity:0;pointer-events:none;transform:scale(.72);transform-origin:center;will-change:transform,opacity;box-shadow:0 12px 30px rgba(0,0,0,.26);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px)}
.flashcard-swipe-badge b{font-size:.86rem;letter-spacing:.075em;white-space:nowrap}
.flashcard-swipe-badge-yes{right:20px;color:#dfffe8;background:rgba(31,124,65,.72);border:1px solid rgba(135,255,169,.55)}
.flashcard-swipe-badge-no{left:20px;color:#ffe7e7;background:rgba(151,39,53,.74);border:1px solid rgba(255,140,140,.52)}
.flashcard-swipe-icon{display:grid;place-items:center;width:38px;height:38px;border-radius:50%;font-size:1.22rem;background:rgba(255,255,255,.12);box-shadow:inset 0 0 0 1px rgba(255,255,255,.13)}
@media(max-width:520px){.flashcard-swipe-tint{border-radius:24px}.flashcard-swipe-badge{top:18px}.flashcard-swipe-badge-yes{right:14px}.flashcard-swipe-badge-no{left:14px}.flashcard-swipe-icon{width:36px;height:36px}}

/* v1.7.48 — smoother, viewport-anchored flashcard swipe */
body.flashcards-active{overflow:hidden;overscroll-behavior:none}
body.flashcards-active #studyArea{overflow:hidden}
body.flashcards-active .flashcard-stage{
  flex:1 1 auto;
  min-height:0;
  padding:8px 0 4px;
  overflow:clip;
  overscroll-behavior:none;
}
body.flashcards-active .flashcard-drag{
  height:clamp(300px,52svh,390px);
  max-height:100%;
  touch-action:none;
  overscroll-behavior:none;
  will-change:transform,opacity;
  transform:translate3d(0,0,0);
  -webkit-tap-highlight-color:transparent;
}
body.flashcards-active .flashcard-flip{will-change:transform}
body.flashcards-active .flashcard-swipe-badge{
  top:42%;
  z-index:8;
  transform:translateY(-50%) scale(.74);
  transform-origin:center;
  will-change:opacity,transform;
}
body.flashcards-active .flashcard-swipe-badge-yes{right:clamp(14px,5vw,38px)}
body.flashcards-active .flashcard-swipe-badge-no{left:clamp(14px,5vw,38px)}
body.flashcards-active .flashcard-swipe-icon{width:42px;height:42px;font-size:1.32rem}
body.flashcards-active .flashcard-swipe-badge b{font-size:.9rem}
@media(max-width:520px){
  body.flashcards-active .flashcard-stage{min-height:0;padding-top:6px}
  body.flashcards-active .flashcard-drag{height:clamp(300px,50svh,360px)}
  body.flashcards-active .flashcard-swipe-badge{top:41%}
}

/* v1.7.49 — unified training card system */
.unified-training-card{
  padding:0 !important;
  overflow:visible !important;
  border:0 !important;
  background:transparent !important;
  box-shadow:none !important;
}
.unified-training-card .study-scene{gap:14px}
.unified-training-card .study-focus-card{
  min-height:clamp(260px,42svh,390px);
  border-radius:28px;
  background:radial-gradient(circle at 50% 52%,color-mix(in srgb,var(--cyan) 9%,transparent),transparent 46%),var(--surface);
  border:1px solid var(--border);
  box-shadow:0 18px 48px rgba(0,0,0,.18);
}
.unified-training-card .study-options-choices button,
.unified-training-card .study-typing input,
.unified-training-card .study-typing button,
.unified-training-card .study-result-panel{border-radius:18px}

.study-swipe-stage{
  position:relative;
  width:min(100%,560px);
  min-height:clamp(330px,52svh,430px);
  margin:0 auto;
  display:flex;
  flex-direction:column;
  justify-content:center;
  overflow:hidden;
  touch-action:none;
}
.study-swipe-card{
  position:relative;
  width:100%;
  height:clamp(300px,48svh,390px);
  perspective:1200px;
  user-select:none;
  -webkit-user-select:none;
  cursor:grab;
  z-index:2;
  isolation:isolate;
  will-change:transform,opacity;
  touch-action:none;
}
.study-swipe-card:active{cursor:grabbing}
.study-swipe-flip{position:relative;width:100%;height:100%;transform-style:preserve-3d;transition:transform .46s cubic-bezier(.2,.7,.2,1);will-change:transform}
.study-swipe-flip.is-flipped{transform:rotateY(180deg)}
.study-swipe-face{
  position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;padding:28px;text-align:center;
  border:1px solid var(--border);border-radius:28px;background:radial-gradient(circle at 50% 52%,color-mix(in srgb,var(--cyan) 10%,transparent),transparent 45%),var(--surface);
  box-shadow:0 18px 48px rgba(0,0,0,.18);backface-visibility:hidden;-webkit-backface-visibility:hidden;
}
.study-swipe-back{transform:rotateY(180deg);background:radial-gradient(circle at 50% 48%,color-mix(in srgb,var(--violet) 12%,transparent),transparent 48%),var(--surface)}
.study-swipe-face>strong{font-size:clamp(2rem,7vw,3.2rem);line-height:1.08;max-width:100%;overflow-wrap:anywhere}
.study-swipe-back>strong{font-size:clamp(1.7rem,6vw,2.7rem)}
.study-swipe-face>small{color:var(--muted);font-weight:750}
.study-swipe-tint{position:absolute;inset:0;z-index:4;border-radius:28px;opacity:0;pointer-events:none;transition:opacity .06s linear}
.study-swipe-tint-yes{background:linear-gradient(135deg,rgba(68,210,112,.16),rgba(54,190,94,.52));box-shadow:inset 0 0 0 2px rgba(98,235,138,.34),inset 0 -80px 120px rgba(25,135,67,.18)}
.study-swipe-tint-no{background:linear-gradient(225deg,rgba(242,78,78,.16),rgba(210,47,62,.52));box-shadow:inset 0 0 0 2px rgba(255,113,113,.34),inset 0 -80px 120px rgba(145,25,43,.18)}
.study-swipe-badge{
  position:absolute;top:43%;z-index:5;display:flex;align-items:center;gap:9px;padding:9px 13px 9px 9px;border-radius:999px;opacity:0;pointer-events:none;
  transform:translateY(-50%) scale(.74);transform-origin:center;will-change:transform,opacity;box-shadow:0 12px 30px rgba(0,0,0,.26);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px)
}
.study-swipe-badge b{font-size:.9rem;letter-spacing:.075em;white-space:nowrap}
.study-swipe-badge-yes{right:clamp(14px,5vw,38px);color:#dfffe8;background:rgba(31,124,65,.72);border:1px solid rgba(135,255,169,.55)}
.study-swipe-badge-no{left:clamp(14px,5vw,38px);color:#ffe7e7;background:rgba(151,39,53,.74);border:1px solid rgba(255,140,140,.52)}
@media(max-width:520px){
  .unified-training-card .study-focus-card{min-height:270px;border-radius:24px;padding:58px 18px 20px}
  .study-swipe-stage{min-height:0;padding-top:4px}
  .study-swipe-card{height:clamp(300px,50svh,360px)}
  .study-swipe-face,.study-swipe-tint{border-radius:24px}
  .study-swipe-face{padding:24px 20px}
}


/* v1.7.51 — training hub + dynamic home focus */
.home-focus-section{padding-top:0}
.home-focus-card{position:relative;display:flex;align-items:center;gap:14px;min-height:104px;padding:16px 18px;border:1px solid color-mix(in srgb,var(--cyan) 28%,var(--border));border-radius:22px;overflow:hidden;background:linear-gradient(135deg,color-mix(in srgb,var(--surface) 92%,var(--cyan) 8%),color-mix(in srgb,var(--surface) 94%,var(--violet) 6%));box-shadow:0 10px 32px rgba(0,0,0,.10)}
.home-focus-card::after{content:"";position:absolute;inset:-35% auto auto 60%;width:180px;height:180px;border-radius:50%;background:color-mix(in srgb,var(--cyan) 11%,transparent);filter:blur(8px);pointer-events:none;animation:homeFocusGlow 6s ease-in-out infinite alternate}
@keyframes homeFocusGlow{from{transform:translate3d(-6px,0,0) scale(.92);opacity:.55}to{transform:translate3d(8px,4px,0) scale(1.08);opacity:1}}
.home-focus-review{border-color:color-mix(in srgb,var(--green) 42%,var(--border));background:linear-gradient(135deg,color-mix(in srgb,var(--green) 11%,var(--surface)),var(--surface))}
.home-focus-errors{border-color:color-mix(in srgb,#f0ad4e 38%,var(--border));background:linear-gradient(135deg,color-mix(in srgb,#f0ad4e 9%,var(--surface)),var(--surface))}
.home-focus-phrase{border-color:color-mix(in srgb,var(--violet) 38%,var(--border));background:linear-gradient(135deg,color-mix(in srgb,var(--violet) 11%,var(--surface)),color-mix(in srgb,var(--cyan) 5%,var(--surface)))}
.home-focus-orb{position:relative;z-index:1;display:grid;place-items:center;width:46px;height:46px;flex:0 0 46px;border-radius:16px;background:color-mix(in srgb,var(--green) 12%,var(--surface));font-size:1.3rem;font-weight:800}
.home-focus-body{position:relative;z-index:1;min-width:0;flex:1}.home-focus-kicker{display:block;margin-bottom:4px;font-size:.7rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase;opacity:.66}.home-focus-title{display:block;font-size:1.08rem;line-height:1.22}.home-focus-text{margin:5px 0 0;font-size:.8rem;line-height:1.35;opacity:.72}.home-focus-actions{position:relative;z-index:2;display:flex;gap:7px;flex-wrap:wrap}.home-focus-action{position:relative;z-index:2;flex:0 0 auto;padding:10px 14px;border-radius:13px;font-weight:800}.home-focus-action.ghost{background:transparent}.home-focus-phrase-reveal{margin-top:8px;padding-top:8px;border-top:1px solid var(--border)}.home-focus-phrase-reveal p{margin:0 0 5px;font-weight:700}.home-focus-phrase-reveal small{display:block;line-height:1.35;opacity:.8}
.training-mode-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:16px}
.training-mode-card{display:grid;grid-template-columns:auto minmax(0,1fr);grid-template-rows:1fr auto;gap:5px 12px;min-height:154px;padding:15px;border:1px solid var(--border);border-radius:20px;background:color-mix(in srgb,var(--surface) 97%,var(--muted) 3%);box-shadow:none}
.training-mode-card-primary{border-color:color-mix(in srgb,var(--green) 38%,var(--border));background:linear-gradient(140deg,color-mix(in srgb,var(--green) 9%,var(--surface)),var(--surface))}.training-mode-card-phrase{border-color:color-mix(in srgb,var(--violet) 35%,var(--border));background:linear-gradient(140deg,color-mix(in srgb,var(--violet) 9%,var(--surface)),var(--surface))}
.training-mode-icon{grid-row:1;width:38px;height:38px;display:grid;place-items:center;border-radius:12px;background:color-mix(in srgb,var(--cyan) 9%,var(--surface));font-size:1.2rem}.training-mode-copy{min-width:0}.training-mode-copy>span{display:block;font-size:.67rem;font-weight:800;letter-spacing:.07em;text-transform:uppercase;opacity:.57}.training-mode-copy h3{margin:3px 0 4px;font-size:1rem}.training-mode-copy p{margin:0;font-size:.76rem;line-height:1.35;opacity:.7}.training-mode-action{grid-column:1/-1;width:100%;margin-top:7px;padding:10px 12px;border-radius:13px;font-weight:800}.training-mode-card .error-study-types{grid-column:auto;display:flex;gap:5px;flex-wrap:wrap;margin-top:5px}.training-mode-card .error-study-types span{font-size:.66rem;padding:3px 6px;border-radius:8px}.training-mode-card.is-empty{opacity:.76}.custom-study-details{margin-top:14px;border:1px solid var(--border);border-radius:18px;background:color-mix(in srgb,var(--surface) 98%,var(--muted) 2%);overflow:hidden}.custom-study-details>summary{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:14px 16px;cursor:pointer;list-style:none;font-weight:800}.custom-study-details>summary::-webkit-details-marker{display:none}.custom-study-details>summary small{font-weight:500;opacity:.6}.custom-study-details .custom-study-block{margin:0;border:0;border-top:1px solid var(--border);border-radius:0;background:transparent}
.phrase-card-stage .flashcard-drag{height:370px}.phrase-main-word{font-size:clamp(1.5rem,5vw,2.25rem);line-height:1.2}.phrase-translation{font-size:clamp(1.25rem,4.4vw,1.85rem)}
@media(max-width:620px){.training-mode-grid{grid-template-columns:1fr 1fr;gap:9px}.training-mode-card{min-height:146px;padding:12px;gap:5px 9px;border-radius:17px}.training-mode-icon{width:34px;height:34px;border-radius:11px}.training-mode-copy h3{font-size:.93rem}.training-mode-copy p{font-size:.71rem}.training-mode-action{padding:9px 10px}.home-focus-card{min-height:96px;padding:14px;border-radius:19px}.home-focus-orb{width:40px;height:40px;flex-basis:40px}.home-focus-title{font-size:1rem}.home-focus-text{font-size:.74rem}.home-focus-actions{width:100%;margin-top:8px}.home-focus-phrase{flex-wrap:wrap}.home-focus-phrase .home-focus-body{min-width:calc(100% - 58px)}}
@media(max-width:390px){.training-mode-grid{grid-template-columns:1fr}.training-mode-card{min-height:126px}}


/* v1.7.56 — SRS review uses the same flip/swipe interaction as flashcards */
.review-flashcard-stage{margin-top:8px}
.review-flashcard-drag{height:clamp(330px,54svh,410px)}
.review-save-state{width:min(100%,560px);margin:10px auto 0;text-align:center;color:var(--red);font-size:.82rem}
.review-swipe-progress{margin-bottom:2px}
@media(max-width:520px){.review-flashcard-drag{height:clamp(310px,51svh,370px)}}


/* v1.7.61 — visible build/backend version */
.brand-version{
  margin-top:2px;
  font-size:10px;
  line-height:1.15;
  letter-spacing:.02em;
  color:var(--muted);
  opacity:.78;
  white-space:nowrap;
}
.brand-version.version-ok{color:#79c879;opacity:.85}
.brand-version.version-warn{color:#e6ad62;opacity:1}


/* v1.7.61 — training hub: the whole card is the action */
.training-mode-card.training-mode-clickable{
  width:100%;text-align:left;color:inherit;font:inherit;cursor:pointer;appearance:none;-webkit-appearance:none;
  transition:transform .16s ease,border-color .16s ease,filter .16s ease,box-shadow .16s ease;
}
.training-mode-card.training-mode-clickable:active{transform:scale(.985);filter:brightness(1.05)}
.training-mode-card.training-mode-clickable:focus-visible{outline:2px solid var(--cyan);outline-offset:3px}
.training-mode-card-cyan{border-color:color-mix(in srgb,var(--cyan) 36%,var(--border));background:linear-gradient(140deg,color-mix(in srgb,var(--cyan) 9%,var(--surface)),var(--surface))}
.training-mode-card-violet{border-color:color-mix(in srgb,var(--violet) 38%,var(--border));background:linear-gradient(140deg,color-mix(in srgb,var(--violet) 10%,var(--surface)),var(--surface))}
.training-mode-card-green{border-color:color-mix(in srgb,var(--green) 42%,var(--border));background:linear-gradient(140deg,color-mix(in srgb,var(--green) 11%,var(--surface)),var(--surface))}
.training-mode-card-amber{border-color:color-mix(in srgb,#e9a844 42%,var(--border));background:linear-gradient(140deg,color-mix(in srgb,#e9a844 10%,var(--surface)),var(--surface))}
.training-mode-card-rose{border-color:color-mix(in srgb,#e97993 36%,var(--border));background:linear-gradient(140deg,color-mix(in srgb,#e97993 9%,var(--surface)),var(--surface))}
.training-mode-card.training-mode-clickable.is-empty,.training-mode-card.training-mode-clickable[data-disabled="1"]{opacity:.55;cursor:default;filter:saturate(.6)}
.training-mode-card .training-mode-copy{grid-column:2;align-self:start}
.training-mode-card .training-mode-icon{grid-column:1}
