/* CISSP Study app 1.0. The :root block is the original indigo theme (sampled from the reference screenshot); every other theme and the
   font colours are generated by tools/make_themes.py between the THEMES markers. 'op-*' = text that sits directly on the page;
   'content-*' = a card behind long text on mid-tone pages; '*-fill' / 'on-*' = a button fill and the text drawn on it. */
:root {
  --know: #a258f2; --knowt: #c39bff; --review: #e27d60; --bm: #e264b4; --pink: #ed71d7; --pinkt: #d98ab3; --ok: #3ecf8e; --bad: #ff6b81; --fs: 1; --sb: env(safe-area-inset-bottom, 0px); --st: env(safe-area-inset-top, 0px);
  --bg: #14143e; --bg-top: #171645; --bg-mid: #13133d; --bg-bot: #101038; --panel: #1a1a45; --card: #191b4c; --cardh: #221e58; --line: #7d72d2;
  --panel-line: rgba(125, 114, 210, .75); --glass-line: rgba(125, 114, 210, .2); --rule: #2a2864; --dash: #3a3a66; --nav: #2c246b; --field: #1d1d52;
  --edge: #3b3890; --raise: #2c2a74; --raise2: #24226a; --tag: #262463; --th: #25236a; --tline: #34327a; --expline: #2f2d72; --termline: #2c2a6c;
  --dot: #4f4a9c; --sheet: #1f1e58; --glass: rgba(20, 20, 62, .94); --glass2: rgba(27, 26, 74, .97); --text: #ece9ff; --head: #f3f0ff; --head2: #e6e1ff;
  --body: #e3dffb; --body2: #d9d4f9; --soft: #a79dea; --soft2: #9d93dd; --dim: #8b84c6; --softhead: #d3ccff; --knob: #d9d3ff; --toast: #f1edff;
  --ink: #1b1442; --ph: #7d77b8; --remain: #7e72d3; --rem-a: #a197e5; --rem-b: #8074d5; --plain-bg: rgba(157, 147, 221, .12); --op-head: #f3f0ff;
  --op-text: #ece9ff; --op-soft: #a79dea; --op-soft2: #9d93dd; --op-dim: #8b84c6; --op-accent: #ed71d7; --op-rule: #2a2864; --chip-edge: #3b3890;
  --content-bg: transparent; --content-pad: 0px; --fb-base: transparent;
  --know-fill: #a258f2; --on-know: #ffffff; --pink-fill: #ed71d7; --on-pink: #2a0b2a; --review-fill: #e27d60; --on-review: #2a0f08; --on-ok: #06281a;
  --on-bad: #2b0710; --ok-t: #8ef0c2; --bad-t: #ffadb9; --review-t: #ffb39e; --bm-t: #ff9fd8; --gold-t: #ffd98a; --tip-t: #c6f2dd; --link: #f39ae0;
  --danger-bg: #4d1a36; --danger-t: #ffc0cf; --press: rgba(255, 255, 255, .07); --hair: rgba(255, 255, 255, .06); --strong: var(--head);
  --scheme: dark; --statusbar: transparent;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "SF Pro", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --search-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a79dea' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m15.5 15.5 5 5'/%3E%3C/svg%3E");
}
/* THEMES:BEGIN generated by tools/make_themes.py: edit the lists there, not these blocks */
/* Rookwood Shutter Green (Sherwin-Williams SW 2809) */
:root[data-theme="shutter"] {
  --bg: #303b39; --bg-top: #34403d; --bg-mid: #303b39; --bg-bot: #2c3735; --panel: #222928; --card: #232b29; --cardh: #2f3938; --field: #1d2422;
  --nav: #1f2524; --sheet: #252d2c; --raise: #394744; --raise2: #303c3a; --tag: #41504e; --th: #3f4e4b; --tline: #4f615d; --expline: #445350;
  --termline: #3f4e4b; --rule: #35413f; --dash: #536562; --dot: #6d8682; --edge: #586d69; --line: #5eafa1; --panel-line: rgba(94, 175, 161, 0.72);
  --glass-line: rgba(94, 175, 161, 0.22); --glass: rgba(48, 59, 57, 0.94); --glass2: rgba(31, 38, 37, 0.97); --text: #edf2f1; --head: #f4f7f7;
  --head2: #e6edec; --body: #dce6e5; --body2: #d1dfdd; --soft: #b3cbc6; --soft2: #a1beb9; --dim: #83a9a3; --softhead: #d5e2e0; --knob: #d9e4e2;
  --toast: #edf2f1; --ink: #151e1d; --ph: #67958c; --remain: #90bbb4; --rem-a: #accac4; --rem-b: #7caba3; --plain-bg: rgba(179, 203, 198, 0.11);
  --op-head: #f4f7f7; --op-text: #edf2f1; --op-soft: #b3cbc6; --op-soft2: #a1beb9; --op-dim: #85aaa4; --op-accent: #f08ddb; --op-rule: #35413f;
  --chip-edge: #586d69; --content-bg: transparent; --content-pad: 0px; --fb-base: transparent;
  --search-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b3cbc6' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m15.5 15.5 5 5'/%3E%3C/svg%3E");
  --know: #b47ff7; --knowt: #c39bff; --review: #e27d60; --bm: #ec7cc4; --pink: #ed71d7; --pinkt: #d98ab3; --ok: #3ecf8e; --bad: #ff6b81;
  --know-fill: #a258f2; --on-know: #ffffff; --pink-fill: #ed71d7; --on-pink: #2a0b2a; --review-fill: #e27d60; --on-review: #2a0f08; --on-ok: #06281a;
  --on-bad: #2b0710; --ok-t: #8ef0c2; --bad-t: #ffadb9; --review-t: #ffb39e; --bm-t: #ff9fd8; --gold-t: #ffd98a; --tip-t: #c6f2dd; --link: #f39ae0;
  --danger-bg: #4d1a36; --danger-t: #ffc0cf; --press: rgba(255, 255, 255, .07); --hair: rgba(255, 255, 255, .06); --strong: var(--head); --scheme: dark;
  --statusbar: transparent; color-scheme: var(--scheme);
}
/* Rookwood Sash Green (Sherwin-Williams SW 2810) */
:root[data-theme="sash"] {
  --bg: #506a67; --bg-top: #55706d; --bg-mid: #506a67; --bg-bot: #4a6360; --panel: #1f2a28; --card: #202b29; --cardh: #2b3a38; --field: #1b2322;
  --nav: #1c2624; --sheet: #222d2c; --raise: #354745; --raise2: #2e3c3b; --tag: #324241; --th: #3b4f4c; --tline: #4a615f; --expline: #3f5451;
  --termline: #3b4f4c; --rule: #324241; --dash: #4d6663; --dot: #668884; --edge: #536e6a; --line: #5eafa6; --panel-line: rgba(94, 175, 166, 0.72);
  --glass-line: rgba(94, 175, 166, 0.22); --glass: rgba(80, 106, 103, 0.94); --glass2: rgba(30, 39, 38, 0.97); --text: #ebf2f2; --head: #f3f8f7;
  --head2: #e5eeed; --body: #dae7e6; --body2: #cfe1df; --soft: #aecbc8; --soft2: #9cbfbb; --dim: #7baba5; --softhead: #d2e3e1; --knob: #d7e5e3;
  --toast: #ebf2f2; --ink: #141e1d; --ph: #60968f; --remain: #89bdb7; --rem-a: #a6cbc7; --rem-b: #73ada6; --plain-bg: rgba(174, 203, 200, 0.11);
  --op-head: #ffffff; --op-text: #ffffff; --op-soft: #e2edec; --op-dim: #dae7e6; --op-soft2: #e2edec; --op-accent: #ffd9f3;
  --op-rule: rgba(255, 255, 255, .2); --chip-edge: rgba(255, 255, 255, .4); --content-bg: #202b29; --content-pad: 14px; --fb-base: #202b29;
  --search-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23aecbc8' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m15.5 15.5 5 5'/%3E%3C/svg%3E");
  --know: #b47ff7; --knowt: #c39bff; --review: #e27d60; --bm: #ec7cc4; --pink: #ed71d7; --pinkt: #d98ab3; --ok: #3ecf8e; --bad: #ff6b81;
  --know-fill: #a258f2; --on-know: #ffffff; --pink-fill: #ed71d7; --on-pink: #2a0b2a; --review-fill: #e27d60; --on-review: #2a0f08; --on-ok: #06281a;
  --on-bad: #2b0710; --ok-t: #8ef0c2; --bad-t: #ffadb9; --review-t: #ffb39e; --bm-t: #ff9fd8; --gold-t: #ffd98a; --tip-t: #c6f2dd; --link: #f39ae0;
  --danger-bg: #4d1a36; --danger-t: #ffc0cf; --press: rgba(255, 255, 255, .07); --hair: rgba(255, 255, 255, .06); --strong: var(--head); --scheme: dark;
  --statusbar: transparent; color-scheme: var(--scheme);
}
/* Rookwood Dark Green (Sherwin-Williams SW 2816) */
:root[data-theme="olive"] {
  --bg: #565c4a; --bg-top: #5c624f; --bg-mid: #565c4a; --bg-bot: #505545; --panel: #262921; --card: #272a22; --cardh: #35382d; --field: #20231c;
  --nav: #22251e; --sheet: #2a2c24; --raise: #414638; --raise2: #373b30; --tag: #3d4134; --th: #484d3e; --tline: #59604d; --expline: #4c5242;
  --termline: #484d3e; --rule: #3d4134; --dash: #5d6450; --dot: #7c846b; --edge: #646c56; --line: #8fab55; --panel-line: rgba(143, 171, 85, 0.72);
  --glass-line: rgba(143, 171, 85, 0.22); --glass: rgba(86, 92, 74, 0.94); --glass2: rgba(36, 38, 31, 0.97); --text: #eff2eb; --head: #f6f8f4;
  --head2: #ebede5; --body: #e3e6db; --body2: #d9dfcf; --soft: #c0c8af; --soft2: #b2bc9e; --dim: #99a77e; --softhead: #dde1d4; --knob: #dfe3d7;
  --toast: #eff2eb; --ink: #1b1e14; --ph: #829263; --remain: #aab98b; --rem-a: #bec8a8; --rem-b: #97a875; --plain-bg: rgba(192, 200, 175, 0.11);
  --op-head: #ffffff; --op-text: #ffffff; --op-soft: #e5e9de; --op-dim: #d7ddcc; --op-soft2: #e5e9de; --op-accent: #ffd9f3;
  --op-rule: rgba(255, 255, 255, .2); --chip-edge: rgba(255, 255, 255, .4); --content-bg: #272a22; --content-pad: 14px; --fb-base: #272a22;
  --search-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c0c8af' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m15.5 15.5 5 5'/%3E%3C/svg%3E");
  --know: #b47ff7; --knowt: #c39bff; --review: #e27d60; --bm: #ec7cc4; --pink: #ed71d7; --pinkt: #d98ab3; --ok: #3ecf8e; --bad: #ff6b81;
  --know-fill: #a258f2; --on-know: #ffffff; --pink-fill: #ed71d7; --on-pink: #2a0b2a; --review-fill: #e27d60; --on-review: #2a0f08; --on-ok: #06281a;
  --on-bad: #2b0710; --ok-t: #8ef0c2; --bad-t: #ffadb9; --review-t: #ffb39e; --bm-t: #ff9fd8; --gold-t: #ffd98a; --tip-t: #c6f2dd; --link: #f39ae0;
  --danger-bg: #4d1a36; --danger-t: #ffc0cf; --press: rgba(255, 255, 255, .07); --hair: rgba(255, 255, 255, .06); --strong: var(--head); --scheme: dark;
  --statusbar: transparent; color-scheme: var(--scheme);
}
/* Forest */
:root[data-theme="forest"] {
  --bg: #1e3a2f; --bg-top: #214033; --bg-mid: #1e3a2f; --bg-bot: #1c352b; --panel: #182c24; --card: #192c25; --cardh: #223d32; --field: #15261f;
  --nav: #162721; --sheet: #1b3027; --raise: #2a4a3d; --raise2: #243f34; --tag: #305546; --th: #2e5143; --tline: #396554; --expline: #315748;
  --termline: #2e5143; --rule: #27453a; --dash: #3c6a58; --dot: #4f8d75; --edge: #40725f; --line: #61b191; --panel-line: rgba(97, 177, 145, 0.72);
  --glass-line: rgba(97, 177, 145, 0.22); --glass: rgba(30, 58, 47, 0.94); --glass2: rgba(23, 40, 34, 0.97); --text: #eaf3f0; --head: #f3f8f6;
  --head2: #e2f0ea; --body: #d5e9e1; --body2: #cae3d9; --soft: #a5cfbe; --soft2: #8fc3af; --dim: #6baf95; --softhead: #cee4dc; --knob: #d1e6de;
  --toast: #eaf3f0; --ink: #11201a; --ph: #52987d; --remain: #72c3a3; --rem-a: #95cfb9; --rem-b: #55b28e; --plain-bg: rgba(165, 207, 190, 0.11);
  --op-head: #f3f8f6; --op-text: #eaf3f0; --op-soft: #a5cfbe; --op-soft2: #8fc3af; --op-dim: #6baf95; --op-accent: #f08ddb; --op-rule: #27453a;
  --chip-edge: #40725f; --content-bg: transparent; --content-pad: 0px; --fb-base: transparent;
  --search-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a5cfbe' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m15.5 15.5 5 5'/%3E%3C/svg%3E");
  --know: #b47ff7; --knowt: #c39bff; --review: #e27d60; --bm: #ec7cc4; --pink: #ed71d7; --pinkt: #d98ab3; --ok: #3ecf8e; --bad: #ff6b81;
  --know-fill: #a258f2; --on-know: #ffffff; --pink-fill: #ed71d7; --on-pink: #2a0b2a; --review-fill: #e27d60; --on-review: #2a0f08; --on-ok: #06281a;
  --on-bad: #2b0710; --ok-t: #8ef0c2; --bad-t: #ffadb9; --review-t: #ffb39e; --bm-t: #ff9fd8; --gold-t: #ffd98a; --tip-t: #c6f2dd; --link: #f39ae0;
  --danger-bg: #4d1a36; --danger-t: #ffc0cf; --press: rgba(255, 255, 255, .07); --hair: rgba(255, 255, 255, .06); --strong: var(--head); --scheme: dark;
  --statusbar: transparent; color-scheme: var(--scheme);
}
/* Deep Teal */
:root[data-theme="teal"] {
  --bg: #173c40; --bg-top: #194146; --bg-mid: #173c40; --bg-bot: #15373b; --panel: #192a2c; --card: #1a2b2d; --cardh: #223b3d; --field: #152526;
  --nav: #172628; --sheet: #1b2e31; --raise: #2b484c; --raise2: #243e40; --tag: #315356; --th: #2f5054; --tline: #3a6468; --expline: #325559;
  --termline: #2f5054; --rule: #284347; --dash: #3d696d; --dot: #518b91; --edge: #427074; --line: #67adb4; --panel-line: rgba(103, 173, 180, 0.72);
  --glass-line: rgba(103, 173, 180, 0.22); --glass: rgba(23, 60, 64, 0.94); --glass2: rgba(23, 40, 42, 0.97); --text: #eaf3f3; --head: #f3f8f8;
  --head2: #e3eef0; --body: #d7e7e9; --body2: #cbe0e3; --soft: #a7ccd0; --soft2: #93c0c5; --dim: #70acb2; --softhead: #d0e3e5; --knob: #d3e6e7;
  --toast: #eaf3f3; --ink: #111e20; --ph: #54969d; --remain: #79bec6; --rem-a: #9bcdd2; --rem-b: #5daeb6; --plain-bg: rgba(167, 204, 208, 0.11);
  --op-head: #f3f8f8; --op-text: #eaf3f3; --op-soft: #a7ccd0; --op-soft2: #93c0c5; --op-dim: #70acb2; --op-accent: #f08ddb; --op-rule: #284347;
  --chip-edge: #427074; --content-bg: transparent; --content-pad: 0px; --fb-base: transparent;
  --search-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a7ccd0' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m15.5 15.5 5 5'/%3E%3C/svg%3E");
  --know: #b47ff7; --knowt: #c39bff; --review: #e27d60; --bm: #ec7cc4; --pink: #ed71d7; --pinkt: #d98ab3; --ok: #3ecf8e; --bad: #ff6b81;
  --know-fill: #a258f2; --on-know: #ffffff; --pink-fill: #ed71d7; --on-pink: #2a0b2a; --review-fill: #e27d60; --on-review: #2a0f08; --on-ok: #06281a;
  --on-bad: #2b0710; --ok-t: #8ef0c2; --bad-t: #ffadb9; --review-t: #ffb39e; --bm-t: #ff9fd8; --gold-t: #ffd98a; --tip-t: #c6f2dd; --link: #f39ae0;
  --danger-bg: #4d1a36; --danger-t: #ffc0cf; --press: rgba(255, 255, 255, .07); --hair: rgba(255, 255, 255, .06); --strong: var(--head); --scheme: dark;
  --statusbar: transparent; color-scheme: var(--scheme);
}
/* Navy */
:root[data-theme="navy"] {
  --bg: #1f2a44; --bg-top: #222e4b; --bg-mid: #1f2a44; --bg-bot: #1c263e; --panel: #171d2a; --card: #181e2c; --cardh: #232a3d; --field: #141923;
  --nav: #151a26; --sheet: #1a202f; --raise: #36425f; --raise2: #2d3851; --tag: #3f4d6f; --th: #3d4a6c; --tline: #4b5c86; --expline: #415073;
  --termline: #3d4a6c; --rule: #333f5a; --dash: #4e608b; --dot: #6e81ad; --edge: #546896; --line: #91a2c9; --panel-line: rgba(145, 162, 201, 0.72);
  --glass-line: rgba(145, 162, 201, 0.22); --glass: rgba(31, 42, 68, 0.94); --glass2: rgba(22, 27, 39, 0.97); --text: #eff1f7; --head: #f5f7fa;
  --head2: #eaedf3; --body: #e0e5ee; --body2: #d7dce9; --soft: #bcc6db; --soft2: #adb8d3; --dim: #93a2c5; --softhead: #dadfeb; --knob: #dee2ed;
  --toast: #eff1f7; --ink: #171c2a; --ph: #798cb7; --remain: #a3b3d8; --rem-a: #b9c4df; --rem-b: #8fa2cd; --plain-bg: rgba(188, 198, 219, 0.11);
  --op-head: #f5f7fa; --op-text: #eff1f7; --op-soft: #bcc6db; --op-soft2: #adb8d3; --op-dim: #93a2c5; --op-accent: #f08ddb; --op-rule: #333f5a;
  --chip-edge: #546896; --content-bg: transparent; --content-pad: 0px; --fb-base: transparent;
  --search-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23bcc6db' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m15.5 15.5 5 5'/%3E%3C/svg%3E");
  --know: #b47ff7; --knowt: #c39bff; --review: #e27d60; --bm: #ec7cc4; --pink: #ed71d7; --pinkt: #d98ab3; --ok: #3ecf8e; --bad: #ff6b81;
  --know-fill: #a258f2; --on-know: #ffffff; --pink-fill: #ed71d7; --on-pink: #2a0b2a; --review-fill: #e27d60; --on-review: #2a0f08; --on-ok: #06281a;
  --on-bad: #2b0710; --ok-t: #8ef0c2; --bad-t: #ffadb9; --review-t: #ffb39e; --bm-t: #ff9fd8; --gold-t: #ffd98a; --tip-t: #c6f2dd; --link: #f39ae0;
  --danger-bg: #4d1a36; --danger-t: #ffc0cf; --press: rgba(255, 255, 255, .07); --hair: rgba(255, 255, 255, .06); --strong: var(--head); --scheme: dark;
  --statusbar: transparent; color-scheme: var(--scheme);
}
/* Ocean */
:root[data-theme="ocean"] {
  --bg: #16384f; --bg-top: #183d56; --bg-mid: #16384f; --bg-bot: #143349; --panel: #1c2a32; --card: #1d2b34; --cardh: #273946; --field: #18242b;
  --nav: #1a252e; --sheet: #1f2d37; --raise: #304656; --raise2: #293c48; --tag: #375162; --th: #354d5e; --tline: #426176; --expline: #395365;
  --termline: #354d5e; --rule: #2d4250; --dash: #45657b; --dot: #5c87a3; --edge: #4a6c84; --line: #80a6c0; --panel-line: rgba(128, 166, 192, 0.72);
  --glass-line: rgba(128, 166, 192, 0.22); --glass: rgba(22, 56, 79, 0.94); --glass2: rgba(26, 38, 47, 0.97); --text: #ecf2f5; --head: #f5f8f9;
  --head2: #e7eef2; --body: #dce6ec; --body2: #d2dfe7; --soft: #b4c9d7; --soft2: #a2bccd; --dim: #85a6bd; --softhead: #d5e1e9; --knob: #d9e4eb;
  --toast: #ecf2f5; --ink: #141e24; --ph: #6790ad; --remain: #93b8d1; --rem-a: #acc8da; --rem-b: #7da8c4; --plain-bg: rgba(180, 201, 215, 0.11);
  --op-head: #f5f8f9; --op-text: #ecf2f5; --op-soft: #b4c9d7; --op-soft2: #a2bccd; --op-dim: #85a6bd; --op-accent: #f08ddb; --op-rule: #2d4250;
  --chip-edge: #4a6c84; --content-bg: transparent; --content-pad: 0px; --fb-base: transparent;
  --search-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b4c9d7' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m15.5 15.5 5 5'/%3E%3C/svg%3E");
  --know: #b47ff7; --knowt: #c39bff; --review: #e27d60; --bm: #ec7cc4; --pink: #ed71d7; --pinkt: #d98ab3; --ok: #3ecf8e; --bad: #ff6b81;
  --know-fill: #a258f2; --on-know: #ffffff; --pink-fill: #ed71d7; --on-pink: #2a0b2a; --review-fill: #e27d60; --on-review: #2a0f08; --on-ok: #06281a;
  --on-bad: #2b0710; --ok-t: #8ef0c2; --bad-t: #ffadb9; --review-t: #ffb39e; --bm-t: #ff9fd8; --gold-t: #ffd98a; --tip-t: #c6f2dd; --link: #f39ae0;
  --danger-bg: #4d1a36; --danger-t: #ffc0cf; --press: rgba(255, 255, 255, .07); --hair: rgba(255, 255, 255, .06); --strong: var(--head); --scheme: dark;
  --statusbar: transparent; color-scheme: var(--scheme);
}
/* Mahogany */
:root[data-theme="mahogany"] {
  --bg: #4a2321; --bg-top: #512724; --bg-mid: #4a2321; --bg-bot: #44201f; --panel: #2f1b1a; --card: #301c1b; --cardh: #432725; --field: #271716;
  --nav: #2a1918; --sheet: #331d1c; --raise: #5f3735; --raise2: #51302e; --tag: #6e413e; --th: #6b3f3c; --tline: #854e4b; --expline: #724340;
  --termline: #6b3f3c; --rule: #5a3533; --dash: #8c514e; --dot: #ae716e; --edge: #965754; --line: #ca9592; --panel-line: rgba(202, 149, 146, 0.72);
  --glass-line: rgba(202, 149, 146, 0.22); --glass: rgba(74, 35, 33, 0.94); --glass2: rgba(44, 25, 24, 0.97); --text: #f6efef; --head: #faf6f6;
  --head2: #f3eaea; --body: #efe1e1; --body2: #ead9d8; --soft: #dcbfbd; --soft2: #d4b0ae; --dim: #c59794; --softhead: #ebdcdb; --knob: #eddede;
  --toast: #f6efef; --ink: #2a1717; --ph: #b77c79; --remain: #d8a8a5; --rem-a: #e0bbba; --rem-b: #cd9391; --plain-bg: rgba(220, 191, 189, 0.11);
  --op-head: #faf6f6; --op-text: #f6efef; --op-soft: #dcbfbd; --op-soft2: #d4b0ae; --op-dim: #c59794; --op-accent: #f08ddb; --op-rule: #5a3533;
  --chip-edge: #965754; --content-bg: transparent; --content-pad: 0px; --fb-base: transparent;
  --search-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23dcbfbd' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m15.5 15.5 5 5'/%3E%3C/svg%3E");
  --know: #b47ff7; --knowt: #c39bff; --review: #e27d60; --bm: #ec7cc4; --pink: #ed71d7; --pinkt: #d98ab3; --ok: #3ecf8e; --bad: #ff6b81;
  --know-fill: #a258f2; --on-know: #ffffff; --pink-fill: #ed71d7; --on-pink: #2a0b2a; --review-fill: #e27d60; --on-review: #2a0f08; --on-ok: #06281a;
  --on-bad: #2b0710; --ok-t: #8ef0c2; --bad-t: #ffadb9; --review-t: #ffb39e; --bm-t: #ff9fd8; --gold-t: #ffd98a; --tip-t: #c6f2dd; --link: #f39ae0;
  --danger-bg: #4d1a36; --danger-t: #ffc0cf; --press: rgba(255, 255, 255, .07); --hair: rgba(255, 255, 255, .06); --strong: var(--head); --scheme: dark;
  --statusbar: transparent; color-scheme: var(--scheme);
}
/* Burgundy */
:root[data-theme="burgundy"] {
  --bg: #4a1d2e; --bg-top: #512033; --bg-mid: #4a1d2e; --bg-bot: #441a2a; --panel: #2c1820; --card: #2d1a21; --cardh: #40242f; --field: #24151b;
  --nav: #28171d; --sheet: #311b24; --raise: #5f3645; --raise2: #512d3b; --tag: #6f3f51; --th: #6c3c4e; --tline: #864c62; --expline: #734153;
  --termline: #6c3c4e; --rule: #5b3343; --dash: #8c4e66; --dot: #ae6e86; --edge: #96546d; --line: #ca93a7; --panel-line: rgba(202, 147, 167, 0.72);
  --glass-line: rgba(202, 147, 167, 0.22); --glass: rgba(74, 29, 46, 0.94); --glass2: rgba(41, 23, 30, 0.97); --text: #f7eff2; --head: #faf6f7;
  --head2: #f3e9ed; --body: #efe1e7; --body2: #ead8df; --soft: #dcbdc9; --soft2: #d4aebd; --dim: #c695a7; --softhead: #ecdbe2; --knob: #eddee4;
  --toast: #f7eff2; --ink: #2b171e; --ph: #b77991; --remain: #d8a5b9; --rem-a: #e0bac8; --rem-b: #cd90a7; --plain-bg: rgba(220, 189, 201, 0.11);
  --op-head: #faf6f7; --op-text: #f7eff2; --op-soft: #dcbdc9; --op-soft2: #d4aebd; --op-dim: #c695a7; --op-accent: #f08ddb; --op-rule: #5b3343;
  --chip-edge: #96546d; --content-bg: transparent; --content-pad: 0px; --fb-base: transparent;
  --search-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23dcbdc9' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m15.5 15.5 5 5'/%3E%3C/svg%3E");
  --know: #b47ff7; --knowt: #c39bff; --review: #e27d60; --bm: #ec7cc4; --pink: #ed71d7; --pinkt: #d98ab3; --ok: #3ecf8e; --bad: #ff6b81;
  --know-fill: #a258f2; --on-know: #ffffff; --pink-fill: #ed71d7; --on-pink: #2a0b2a; --review-fill: #e27d60; --on-review: #2a0f08; --on-ok: #06281a;
  --on-bad: #2b0710; --ok-t: #8ef0c2; --bad-t: #ffadb9; --review-t: #ffb39e; --bm-t: #ff9fd8; --gold-t: #ffd98a; --tip-t: #c6f2dd; --link: #f39ae0;
  --danger-bg: #4d1a36; --danger-t: #ffc0cf; --press: rgba(255, 255, 255, .07); --hair: rgba(255, 255, 255, .06); --strong: var(--head); --scheme: dark;
  --statusbar: transparent; color-scheme: var(--scheme);
}
/* Plum */
:root[data-theme="plum"] {
  --bg: #3b2342; --bg-top: #412649; --bg-mid: #3b2342; --bg-bot: #37203d; --panel: #28192c; --card: #291a2d; --cardh: #3a2541; --field: #221525;
  --nav: #241728; --sheet: #2c1c31; --raise: #563660; --raise2: #4a2e52; --tag: #653f71; --th: #623d6c; --tline: #794c87; --expline: #694174;
  --termline: #623d6c; --rule: #53345c; --dash: #7f4f8d; --dot: #a070ae; --edge: #895597; --line: #bd93ca; --panel-line: rgba(189, 147, 202, 0.72);
  --glass-line: rgba(189, 147, 202, 0.22); --glass: rgba(59, 35, 66, 0.94); --glass2: rgba(37, 23, 42, 0.97); --text: #f5eff7; --head: #faf6fa;
  --head2: #f1e9f3; --body: #ece1ef; --body2: #e6d8ea; --soft: #d5bddc; --soft2: #cbaed4; --dim: #bb95c6; --softhead: #e8dbec; --knob: #eadeed;
  --toast: #f5eff7; --ink: #27172b; --ph: #aa7bb8; --remain: #cda6d9; --rem-a: #d8bae0; --rem-b: #c091ce; --plain-bg: rgba(213, 189, 220, 0.11);
  --op-head: #faf6fa; --op-text: #f5eff7; --op-soft: #d5bddc; --op-soft2: #cbaed4; --op-dim: #bb95c6; --op-accent: #f08ddb; --op-rule: #53345c;
  --chip-edge: #895597; --content-bg: transparent; --content-pad: 0px; --fb-base: transparent;
  --search-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d5bddc' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m15.5 15.5 5 5'/%3E%3C/svg%3E");
  --know: #b47ff7; --knowt: #c39bff; --review: #e27d60; --bm: #ec7cc4; --pink: #ed71d7; --pinkt: #d98ab3; --ok: #3ecf8e; --bad: #ff6b81;
  --know-fill: #a258f2; --on-know: #ffffff; --pink-fill: #ed71d7; --on-pink: #2a0b2a; --review-fill: #e27d60; --on-review: #2a0f08; --on-ok: #06281a;
  --on-bad: #2b0710; --ok-t: #8ef0c2; --bad-t: #ffadb9; --review-t: #ffb39e; --bm-t: #ff9fd8; --gold-t: #ffd98a; --tip-t: #c6f2dd; --link: #f39ae0;
  --danger-bg: #4d1a36; --danger-t: #ffc0cf; --press: rgba(255, 255, 255, .07); --hair: rgba(255, 255, 255, .06); --strong: var(--head); --scheme: dark;
  --statusbar: transparent; color-scheme: var(--scheme);
}
/* Espresso */
:root[data-theme="espresso"] {
  --bg: #2f2621; --bg-top: #352a25; --bg-mid: #2f2621; --bg-bot: #2b221e; --panel: #201916; --card: #211b17; --cardh: #302721; --field: #1b1513;
  --nav: #1c1714; --sheet: #231d19; --raise: #4f3f37; --raise2: #42362f; --tag: #5b4a40; --th: #58473e; --tline: #6e594d; --expline: #5f4d42;
  --termline: #58473e; --rule: #4b3d35; --dash: #725d50; --dot: #987c6c; --edge: #7b6456; --line: #c29983; --panel-line: rgba(194, 153, 131, 0.72);
  --glass-line: rgba(194, 153, 131, 0.22); --glass: rgba(47, 38, 33, 0.94); --glass2: rgba(30, 24, 21, 0.97); --text: #f5f0ee; --head: #f9f7f5;
  --head2: #f1ece8; --body: #ebe3de; --body2: #e6dbd4; --soft: #d5c2b7; --soft2: #cbb4a7; --dim: #ba9c8b; --softhead: #e8ddd8; --knob: #eae1db;
  --toast: #f5f0ee; --ink: #241b15; --ph: #a9836f; --remain: #cbad9c; --rem-a: #d6bfb3; --rem-b: #be9b87; --plain-bg: rgba(213, 194, 183, 0.11);
  --op-head: #f9f7f5; --op-text: #f5f0ee; --op-soft: #d5c2b7; --op-soft2: #cbb4a7; --op-dim: #ba9c8b; --op-accent: #f08ddb; --op-rule: #4b3d35;
  --chip-edge: #7b6456; --content-bg: transparent; --content-pad: 0px; --fb-base: transparent;
  --search-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d5c2b7' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m15.5 15.5 5 5'/%3E%3C/svg%3E");
  --know: #b47ff7; --knowt: #c39bff; --review: #e27d60; --bm: #ec7cc4; --pink: #ed71d7; --pinkt: #d98ab3; --ok: #3ecf8e; --bad: #ff6b81;
  --know-fill: #a258f2; --on-know: #ffffff; --pink-fill: #ed71d7; --on-pink: #2a0b2a; --review-fill: #e27d60; --on-review: #2a0f08; --on-ok: #06281a;
  --on-bad: #2b0710; --ok-t: #8ef0c2; --bad-t: #ffadb9; --review-t: #ffb39e; --bm-t: #ff9fd8; --gold-t: #ffd98a; --tip-t: #c6f2dd; --link: #f39ae0;
  --danger-bg: #4d1a36; --danger-t: #ffc0cf; --press: rgba(255, 255, 255, .07); --hair: rgba(255, 255, 255, .06); --strong: var(--head); --scheme: dark;
  --statusbar: transparent; color-scheme: var(--scheme);
}
/* Black (Pure black, best for OLED screens) */
:root[data-theme="midnight"] {
  --bg: #000000; --bg-top: #060606; --bg-mid: #000000; --bg-bot: #000000; --panel: #161616; --card: #171717; --cardh: #242424; --field: #121212;
  --nav: #141414; --sheet: #191919; --raise: #424242; --raise2: #383838; --tag: #4d4d4d; --th: #4a4a4a; --tline: #5d5d5d; --expline: #4f4f4f;
  --termline: #4a4a4a; --rule: #3f3f3f; --dash: #616161; --dot: #828282; --edge: #686868; --line: #a2a2a2; --panel-line: rgba(162, 162, 162, 0.72);
  --glass-line: rgba(162, 162, 162, 0.22); --glass: rgba(0, 0, 0, 0.94); --glass2: rgba(21, 21, 21, 0.97); --text: #f2f2f2; --head: #f7f7f7;
  --head2: #ededed; --body: #e5e5e5; --body2: #dddddd; --soft: #c6c6c6; --soft2: #b9b9b9; --dim: #a2a2a2; --softhead: #e0e0e0; --knob: #e2e2e2;
  --toast: #f2f2f2; --ink: #1c1c1c; --ph: #8c8c8c; --remain: #c2aeae; --rem-a: #cec1c1; --rem-b: #b29d9d; --plain-bg: rgba(198, 198, 198, 0.11);
  --op-head: #f7f7f7; --op-text: #f2f2f2; --op-soft: #c6c6c6; --op-soft2: #b9b9b9; --op-dim: #a2a2a2; --op-accent: #f08ddb; --op-rule: #3f3f3f;
  --chip-edge: #686868; --content-bg: transparent; --content-pad: 0px; --fb-base: transparent;
  --search-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c6c6c6' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m15.5 15.5 5 5'/%3E%3C/svg%3E");
  --know: #b47ff7; --knowt: #c39bff; --review: #e27d60; --bm: #ec7cc4; --pink: #ed71d7; --pinkt: #d98ab3; --ok: #3ecf8e; --bad: #ff6b81;
  --know-fill: #a258f2; --on-know: #ffffff; --pink-fill: #ed71d7; --on-pink: #2a0b2a; --review-fill: #e27d60; --on-review: #2a0f08; --on-ok: #06281a;
  --on-bad: #2b0710; --ok-t: #8ef0c2; --bad-t: #ffadb9; --review-t: #ffb39e; --bm-t: #ff9fd8; --gold-t: #ffd98a; --tip-t: #c6f2dd; --link: #f39ae0;
  --danger-bg: #4d1a36; --danger-t: #ffc0cf; --press: rgba(255, 255, 255, .07); --hair: rgba(255, 255, 255, .06); --strong: var(--head); --scheme: dark;
  --statusbar: transparent; color-scheme: var(--scheme);
}
/* Soft Black (Near-black, a little gentler on the eyes) */
:root[data-theme="softblack"] {
  --bg: #121212; --bg-top: #171717; --bg-mid: #121212; --bg-bot: #101010; --panel: #1f1f1f; --card: #202020; --cardh: #2e2e2e; --field: #1a1a1a;
  --nav: #1c1c1c; --sheet: #232323; --raise: #424242; --raise2: #383838; --tag: #4d4d4d; --th: #4a4a4a; --tline: #5d5d5d; --expline: #4f4f4f;
  --termline: #4a4a4a; --rule: #3f3f3f; --dash: #616161; --dot: #828282; --edge: #686868; --line: #a2a2a2; --panel-line: rgba(162, 162, 162, 0.72);
  --glass-line: rgba(162, 162, 162, 0.22); --glass: rgba(18, 18, 18, 0.94); --glass2: rgba(29, 29, 29, 0.97); --text: #f2f2f2; --head: #f7f7f7;
  --head2: #ededed; --body: #e5e5e5; --body2: #dddddd; --soft: #c6c6c6; --soft2: #b9b9b9; --dim: #a2a2a2; --softhead: #e0e0e0; --knob: #e2e2e2;
  --toast: #f2f2f2; --ink: #1c1c1c; --ph: #8c8c8c; --remain: #c2aeae; --rem-a: #cec1c1; --rem-b: #b29d9d; --plain-bg: rgba(198, 198, 198, 0.11);
  --op-head: #f7f7f7; --op-text: #f2f2f2; --op-soft: #c6c6c6; --op-soft2: #b9b9b9; --op-dim: #a2a2a2; --op-accent: #f08ddb; --op-rule: #3f3f3f;
  --chip-edge: #686868; --content-bg: transparent; --content-pad: 0px; --fb-base: transparent;
  --search-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c6c6c6' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m15.5 15.5 5 5'/%3E%3C/svg%3E");
  --know: #b47ff7; --knowt: #c39bff; --review: #e27d60; --bm: #ec7cc4; --pink: #ed71d7; --pinkt: #d98ab3; --ok: #3ecf8e; --bad: #ff6b81;
  --know-fill: #a258f2; --on-know: #ffffff; --pink-fill: #ed71d7; --on-pink: #2a0b2a; --review-fill: #e27d60; --on-review: #2a0f08; --on-ok: #06281a;
  --on-bad: #2b0710; --ok-t: #8ef0c2; --bad-t: #ffadb9; --review-t: #ffb39e; --bm-t: #ff9fd8; --gold-t: #ffd98a; --tip-t: #c6f2dd; --link: #f39ae0;
  --danger-bg: #4d1a36; --danger-t: #ffc0cf; --press: rgba(255, 255, 255, .07); --hair: rgba(255, 255, 255, .06); --strong: var(--head); --scheme: dark;
  --statusbar: transparent; color-scheme: var(--scheme);
}
/* Charcoal */
:root[data-theme="charcoal"] {
  --bg: #26292d; --bg-top: #2a2e32; --bg-mid: #26292d; --bg-bot: #232629; --panel: #191c1e; --card: #1a1d1f; --cardh: #262a2e; --field: #16181a;
  --nav: #18191c; --sheet: #1d1f22; --raise: #3e4349; --raise2: #34383e; --tag: #484e56; --th: #464b53; --tline: #575d67; --expline: #4b5158;
  --termline: #464b53; --rule: #3b3f46; --dash: #5a626b; --dot: #79828e; --edge: #626974; --line: #8aa4c6; --panel-line: rgba(138, 164, 198, 0.72);
  --glass-line: rgba(138, 164, 198, 0.22); --glass: rgba(38, 41, 45, 0.94); --glass2: rgba(24, 26, 29, 0.97); --text: #f0f2f4; --head: #f6f7f9;
  --head2: #eaedf0; --body: #e2e5ea; --body2: #d9dde3; --soft: #bfc6d1; --soft2: #afb9c6; --dim: #97a3b4; --softhead: #dbe0e5; --knob: #dfe2e8;
  --toast: #f0f2f4; --ink: #191d22; --ph: #7d8ca2; --remain: #a7b4c7; --rem-a: #bbc5d2; --rem-b: #94a3b8; --plain-bg: rgba(191, 198, 209, 0.11);
  --op-head: #f6f7f9; --op-text: #f0f2f4; --op-soft: #bfc6d1; --op-soft2: #afb9c6; --op-dim: #97a3b4; --op-accent: #f08ddb; --op-rule: #3b3f46;
  --chip-edge: #626974; --content-bg: transparent; --content-pad: 0px; --fb-base: transparent;
  --search-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23bfc6d1' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m15.5 15.5 5 5'/%3E%3C/svg%3E");
  --know: #b47ff7; --knowt: #c39bff; --review: #e27d60; --bm: #ec7cc4; --pink: #ed71d7; --pinkt: #d98ab3; --ok: #3ecf8e; --bad: #ff6b81;
  --know-fill: #a258f2; --on-know: #ffffff; --pink-fill: #ed71d7; --on-pink: #2a0b2a; --review-fill: #e27d60; --on-review: #2a0f08; --on-ok: #06281a;
  --on-bad: #2b0710; --ok-t: #8ef0c2; --bad-t: #ffadb9; --review-t: #ffb39e; --bm-t: #ff9fd8; --gold-t: #ffd98a; --tip-t: #c6f2dd; --link: #f39ae0;
  --danger-bg: #4d1a36; --danger-t: #ffc0cf; --press: rgba(255, 255, 255, .07); --hair: rgba(255, 255, 255, .06); --strong: var(--head); --scheme: dark;
  --statusbar: transparent; color-scheme: var(--scheme);
}
/* White (Light, with white cards) */
:root[data-theme="white"] {
  --bg: #f2f2f2; --bg-top: #f6f6f6; --bg-mid: #f2f2f2; --bg-bot: #ededed; --panel: #ffffff; --card: #ffffff; --cardh: #efefef; --field: #ffffff;
  --nav: #fafafa; --sheet: #ffffff; --raise: #e5e5e5; --raise2: #dddddd; --tag: #e0e0e0; --th: #e8e8e8; --tline: #cccccc; --expline: #d5d5d5;
  --termline: #dadada; --rule: #dddddd; --dash: #bcbcbc; --dot: #a0a0a0; --edge: #bcbcbc; --line: #aeaeae; --panel-line: rgba(174, 174, 174, 0.8);
  --glass-line: rgba(174, 174, 174, 0.35); --glass: rgba(242, 242, 242, 0.94); --glass2: rgba(255, 255, 255, 0.97); --text: #222222; --head: #191919;
  --head2: #282828; --body: #2a2a2a; --body2: #323232; --soft: #595959; --soft2: #616161; --dim: #646464; --softhead: #3f3f3f; --knob: #ffffff;
  --toast: #262626; --ink: #ffffff; --ph: #898989; --remain: #4b5b8c; --rem-a: #b3bbd4; --rem-b: #96a1c4; --plain-bg: rgba(89, 89, 89, 0.07);
  --op-head: #191919; --op-text: #222222; --op-soft: #595959; --op-soft2: #616161; --op-dim: #646464; --op-accent: #a3168f; --op-rule: #dddddd;
  --chip-edge: #bcbcbc; --content-bg: transparent; --content-pad: 0px; --fb-base: transparent;
  --search-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23595959' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m15.5 15.5 5 5'/%3E%3C/svg%3E");
  --know: #7c3aed; --knowt: #6d28d9; --review: #c2410c; --bm: #be185d; --pink: #b0178f; --pinkt: #9d1a72; --ok: #15803d; --bad: #be123c;
  --know-fill: #7c3aed; --on-know: #ffffff; --pink-fill: #b0178f; --on-pink: #ffffff; --review-fill: #c2410c; --on-review: #ffffff; --on-ok: #ffffff;
  --on-bad: #ffffff; --ok-t: #166534; --bad-t: #9f1239; --review-t: #9a3412; --bm-t: #9d174d; --gold-t: #854d0e; --tip-t: #14532d; --link: #a21caf;
  --danger-bg: #fde2e8; --danger-t: #9f1239; --press: rgba(0, 0, 0, .06); --hair: rgba(0, 0, 0, .09); --strong: var(--head); --scheme: light;
  --statusbar: #262626; color-scheme: var(--scheme);
}
/* Paper (Light) */
:root[data-theme="paper"] {
  --bg: #f4efe6; --bg-top: #f6f2eb; --bg-mid: #f4efe6; --bg-bot: #f0e9dd; --panel: #fdfcfa; --card: #fdfcfa; --cardh: #f2eee8; --field: #ffffff;
  --nav: #fbfaf6; --sheet: #fdfcfa; --raise: #ebe4d9; --raise2: #e4dccd; --tag: #e8dfce; --th: #ece7dc; --tline: #d7cbb4; --expline: #ded4c1;
  --termline: #e2d9c8; --rule: #e4dccd; --dash: #cab99c; --dot: #b49c73; --edge: #cab99c; --line: #c5aa79; --panel-line: rgba(197, 170, 121, 0.8);
  --glass-line: rgba(197, 170, 121, 0.35); --glass: rgba(244, 239, 230, 0.94); --glass2: rgba(253, 252, 250, 0.97); --text: #292114; --head: #1e190e;
  --head2: #302817; --body: #332a19; --body2: #3c311d; --soft: #6a5733; --soft2: #735e38; --dim: #78623a; --softhead: #4b3e24; --knob: #ffffff;
  --toast: #2e2616; --ink: #ffffff; --ph: #a3854e; --remain: #715a2e; --rem-a: #cfb990; --rem-b: #bd9e65; --plain-bg: rgba(106, 87, 51, 0.07);
  --op-head: #1e190e; --op-text: #292114; --op-soft: #6a5733; --op-soft2: #735e38; --op-dim: #78623a; --op-accent: #a3168f; --op-rule: #e4dccd;
  --chip-edge: #cab99c; --content-bg: transparent; --content-pad: 0px; --fb-base: transparent;
  --search-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236a5733' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m15.5 15.5 5 5'/%3E%3C/svg%3E");
  --know: #7c3aed; --knowt: #6d28d9; --review: #c2410c; --bm: #be185d; --pink: #b0178f; --pinkt: #9d1a72; --ok: #15803d; --bad: #be123c;
  --know-fill: #7c3aed; --on-know: #ffffff; --pink-fill: #b0178f; --on-pink: #ffffff; --review-fill: #c2410c; --on-review: #ffffff; --on-ok: #ffffff;
  --on-bad: #ffffff; --ok-t: #166534; --bad-t: #9f1239; --review-t: #9a3412; --bm-t: #9d174d; --gold-t: #854d0e; --tip-t: #14532d; --link: #a21caf;
  --danger-bg: #fde2e8; --danger-t: #9f1239; --press: rgba(0, 0, 0, .06); --hair: rgba(0, 0, 0, .09); --strong: var(--head); --scheme: light;
  --statusbar: #2f2614; color-scheme: var(--scheme);
}
/* Sage Mist (Light) */
:root[data-theme="sage"] {
  --bg: #e3ece6; --bg-top: #e7efe9; --bg-mid: #e3ece6; --bg-bot: #dce8e0; --panel: #f9fdfb; --card: #f9fdfb; --cardh: #eaf0ec; --field: #ffffff;
  --nav: #f7faf8; --sheet: #f9fdfb; --raise: #dce8e0; --raise2: #d2e1d7; --tag: #d1e4d8; --th: #dfe9e3; --tline: #bad1c2; --expline: #c6d9cd;
  --termline: #ceddd3; --rule: #d2e1d7; --dash: #a6c3af; --dot: #81a98e; --edge: #a6c3af; --line: #82ba94; --panel-line: rgba(130, 186, 148, 0.8);
  --glass-line: rgba(130, 186, 148, 0.35); --glass: rgba(227, 236, 230, 0.94); --glass2: rgba(249, 253, 251, 0.97); --text: #15251a; --head: #101d14;
  --head2: #192e20; --body: #1a2f21; --body2: #1e3827; --soft: #366345; --soft2: #3b6b4b; --dim: #3d704e; --softhead: #264531; --knob: #ffffff;
  --toast: #172a1e; --ink: #ffffff; --ph: #53976a; --remain: #366847; --rem-a: #98c6a8; --rem-b: #6eb084; --plain-bg: rgba(54, 99, 69, 0.07);
  --op-head: #101d14; --op-text: #15251a; --op-soft: #366345; --op-soft2: #3b6b4b; --op-dim: #3d704e; --op-accent: #a3168f; --op-rule: #d2e1d7;
  --chip-edge: #a6c3af; --content-bg: transparent; --content-pad: 0px; --fb-base: transparent;
  --search-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23366345' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m15.5 15.5 5 5'/%3E%3C/svg%3E");
  --know: #7c3aed; --knowt: #6d28d9; --review: #c2410c; --bm: #be185d; --pink: #b0178f; --pinkt: #9d1a72; --ok: #15803d; --bad: #be123c;
  --know-fill: #7c3aed; --on-know: #ffffff; --pink-fill: #b0178f; --on-pink: #ffffff; --review-fill: #c2410c; --on-review: #ffffff; --on-ok: #ffffff;
  --on-bad: #ffffff; --ok-t: #166534; --bad-t: #9f1239; --review-t: #9a3412; --bm-t: #9d174d; --gold-t: #854d0e; --tip-t: #14532d; --link: #a21caf;
  --danger-bg: #fde2e8; --danger-t: #9f1239; --press: rgba(0, 0, 0, .06); --hair: rgba(0, 0, 0, .09); --strong: var(--head); --scheme: light;
  --statusbar: #172a1e; color-scheme: var(--scheme);
}
/* Font colours: dark themes */
:root[data-ink="contrast"] {
  --head: #ffffff; --text: #ffffff; --head2: #ffffff; --body: #ffffff; --body2: #f2f2f2;
}
:root[data-ink="cream"] {
  --head: #ffeccd; --text: #ffe4b8; --head2: #ffe4b8; --body: #ffe4b8; --body2: #f2d9af;
}
:root[data-ink="mint"] {
  --head: #b0f0ce; --text: #8ee9b9; --head2: #8ee9b9; --body: #8ee9b9; --body2: #87ddb0;
}
:root[data-ink="sky"] {
  --head: #c2e2ff; --text: #a8d5ff; --head2: #a8d5ff; --body: #a8d5ff; --body2: #a0caf2;
}
:root[data-ink="lavender"] {
  --head: #dcd0ff; --text: #cdbcff; --head2: #cdbcff; --body: #cdbcff; --body2: #c3b3f2;
}
:root[data-ink="rose"] {
  --head: #ffcbe2; --text: #ffb5d5; --head2: #ffb5d5; --body: #ffb5d5; --body2: #f2acca;
}
:root[data-ink="lemon"] {
  --head: #fff1ad; --text: #ffeb8a; --head2: #ffeb8a; --body: #ffeb8a; --body2: #f2df83;
}
:root[data-ink="peach"] {
  --head: #ffd5bc; --text: #ffc3a0; --head2: #ffc3a0; --body: #ffc3a0; --body2: #f2b998;
}
/* Font colours: light themes */
:root[data-theme="white"][data-ink="contrast"] {
  --head: #000000; --text: #000000; --head2: #000000; --body: #000000; --body2: #0f0f0f;
}
:root[data-theme="white"][data-ink="cream"] {
  --head: #38200e; --text: #4a2a12; --head2: #4a2a12; --body: #4a2a12; --body2: #553720;
}
:root[data-theme="white"][data-ink="mint"] {
  --head: #093820; --text: #0c4a2a; --head2: #0c4a2a; --body: #0c4a2a; --body2: #1b5537;
}
:root[data-theme="white"][data-ink="sky"] {
  --head: #0b254c; --text: #0f3166; --head2: #0f3166; --body: #0f3166; --body2: #1d3d6f;
}
:root[data-theme="white"][data-ink="lavender"] {
  --head: #2e1756; --text: #3d1f73; --head2: #3d1f73; --body: #3d1f73; --body2: #492c7b;
}
:root[data-theme="white"][data-ink="rose"] {
  --head: #500e30; --text: #6b1240; --head2: #6b1240; --body: #6b1240; --body2: #74204b;
}
:root[data-theme="white"][data-ink="lemon"] {
  --head: #383208; --text: #4a420a; --head2: #4a420a; --body: #4a420a; --body2: #554d19;
}
:root[data-theme="white"][data-ink="peach"] {
  --head: #502009; --text: #6b2a0c; --head2: #6b2a0c; --body: #6b2a0c; --body2: #74371b;
}
:root[data-theme="paper"][data-ink="contrast"] {
  --head: #000000; --text: #000000; --head2: #000000; --body: #000000; --body2: #0f0f0f;
}
:root[data-theme="paper"][data-ink="cream"] {
  --head: #38200e; --text: #4a2a12; --head2: #4a2a12; --body: #4a2a12; --body2: #553720;
}
:root[data-theme="paper"][data-ink="mint"] {
  --head: #093820; --text: #0c4a2a; --head2: #0c4a2a; --body: #0c4a2a; --body2: #1b5537;
}
:root[data-theme="paper"][data-ink="sky"] {
  --head: #0b254c; --text: #0f3166; --head2: #0f3166; --body: #0f3166; --body2: #1d3d6f;
}
:root[data-theme="paper"][data-ink="lavender"] {
  --head: #2e1756; --text: #3d1f73; --head2: #3d1f73; --body: #3d1f73; --body2: #492c7b;
}
:root[data-theme="paper"][data-ink="rose"] {
  --head: #500e30; --text: #6b1240; --head2: #6b1240; --body: #6b1240; --body2: #74204b;
}
:root[data-theme="paper"][data-ink="lemon"] {
  --head: #383208; --text: #4a420a; --head2: #4a420a; --body: #4a420a; --body2: #554d19;
}
:root[data-theme="paper"][data-ink="peach"] {
  --head: #502009; --text: #6b2a0c; --head2: #6b2a0c; --body: #6b2a0c; --body2: #74371b;
}
:root[data-theme="sage"][data-ink="contrast"] {
  --head: #000000; --text: #000000; --head2: #000000; --body: #000000; --body2: #0f0f0f;
}
:root[data-theme="sage"][data-ink="cream"] {
  --head: #38200e; --text: #4a2a12; --head2: #4a2a12; --body: #4a2a12; --body2: #553720;
}
:root[data-theme="sage"][data-ink="mint"] {
  --head: #093820; --text: #0c4a2a; --head2: #0c4a2a; --body: #0c4a2a; --body2: #1b5537;
}
:root[data-theme="sage"][data-ink="sky"] {
  --head: #0b254c; --text: #0f3166; --head2: #0f3166; --body: #0f3166; --body2: #1d3d6f;
}
:root[data-theme="sage"][data-ink="lavender"] {
  --head: #2e1756; --text: #3d1f73; --head2: #3d1f73; --body: #3d1f73; --body2: #492c7b;
}
:root[data-theme="sage"][data-ink="rose"] {
  --head: #500e30; --text: #6b1240; --head2: #6b1240; --body: #6b1240; --body2: #74204b;
}
:root[data-theme="sage"][data-ink="lemon"] {
  --head: #383208; --text: #4a420a; --head2: #4a420a; --body: #4a420a; --body2: #554d19;
}
:root[data-theme="sage"][data-ink="peach"] {
  --head: #502009; --text: #6b2a0c; --head2: #6b2a0c; --body: #6b2a0c; --body2: #74371b;
}
/* THEMES:END */

/* Font styles (Settings > Appearance). SF Pro is the default; Rounded and New York show on Apple devices, others get the closest match. */
:root[data-font="rounded"] { --font: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
:root[data-font="serif"] { --font: ui-serif, "New York", "Iowan Old Style", Georgia, "Noto Serif", "Times New Roman", serif; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: calc(16px * var(--fs)); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); color-scheme: var(--scheme); }
body {
  margin: 0; min-height: 100vh; color: var(--text); line-height: 1.45;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 50%, var(--bg-bot) 100%) fixed var(--bg);
  font-family: var(--font);
}
/* Light themes: a dark strip behind the iPhone status bar, whose text is always white in the installed app. */
body::after { content: ""; position: fixed; top: 0; left: 0; right: 0; height: var(--st); background: var(--statusbar); z-index: 60; pointer-events: none; }
button { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }
#app { max-width: 640px; margin: 0 auto; min-height: 100vh; padding: 0 14px calc(92px + var(--sb)); }
body.study #app { padding-bottom: calc(150px + var(--sb)); }
body.study #tabs { display: none; }

/* ---- boot / empty ---- */
.boot, .empty { text-align: center; color: var(--op-soft); padding: 18vh 20px 40px; }
.empty { padding: 36px 16px; }
.empty h2 { color: var(--op-text); font-size: 1.15rem; margin: 0 0 6px; }
.spinner { width: 38px; height: 38px; margin: 0 auto 14px; border-radius: 50%; border: 4px solid var(--raise); border-top-color: var(--pink); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- headers ---- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(16px + var(--st)) 2px 12px; }
.top h1 { margin: 0; font-size: 1.45rem; color: var(--op-head); letter-spacing: .2px; }
.top small { display: block; color: var(--op-dim); font-weight: 600; font-size: .82rem; }
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand svg { width: 38px; height: 38px; flex: none; }
.brand b { display: block; font-size: 1.28rem; color: var(--op-head); letter-spacing: .2px; }
.bar-top {
  position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 4px;
  margin: 0 -14px 8px; padding: calc(6px + var(--st)) 6px 6px;
  background: var(--glass); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-line);
}
.bar-top .t { flex: 1; min-width: 0; font-weight: 700; color: var(--head2); font-size: 1rem; line-height: 1.25; }
.bar-top .t, .bar-top .t small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-top .t small { display: block; font-size: .76rem; color: var(--op-dim); font-weight: 600; }
.bar-top .prog { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; }
.prog i { display: block; height: 100%; background: linear-gradient(90deg, var(--pink), var(--know)); border-radius: 0 3px 3px 0; transition: width .25s; }
.ib { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; border: 0; background: transparent; color: var(--op-soft); cursor: pointer; text-decoration: none; }
.ib svg { width: 25px; height: 25px; }
.ib:active { background: var(--press); }
.ib.bm.on { color: var(--bm); }
.pos { flex: none; font-variant-numeric: tabular-nums; color: var(--op-soft); font-weight: 800; font-size: .92rem; padding: 0 4px; }
.timer { flex: none; font-variant-numeric: tabular-nums; font-weight: 800; color: var(--soft); padding: 4px 8px; border-radius: 10px; background: var(--raise2); font-size: .95rem; }
.timer.low { color: #fff; background: #8a2546; }

/* ---- dashboard stats card ---- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--panel); border: 1.5px solid var(--panel-line); border-radius: 18px; padding: 14px 2px 12px; margin: 4px 0 14px; }
.stat { display: flex; flex-direction: column; align-items: center; text-decoration: none; padding: 2px 2px; position: relative; min-width: 0; }
.stat + .stat::before { content: ""; position: absolute; left: 0; top: 8%; bottom: 8%; border-left: 2px dashed var(--dash); }
.stat .num { display: flex; align-items: center; gap: 1px; font-size: clamp(1.3rem, 6.4vw, 1.8rem); font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.15; letter-spacing: -.3px; }
.stat .num svg { width: .62em; height: .62em; opacity: .9; flex: none; }
.stat .lab { font-size: clamp(.68rem, 3.1vw, .86rem); font-weight: 500; margin-top: 3px; white-space: nowrap; }
.stats.sm .lab i { display: none; }
.stat .lab i { font-style: normal; color: var(--soft); }
.stat.know { color: var(--know); } .stat.review { color: var(--review); } .stat.remaining { color: var(--remain); } .stat.bookmarked { color: var(--bm); }
.stat:active { opacity: .7; }
.stats.sm { margin: 10px 0 10px; padding: 10px 2px 9px; }
.stats.sm .num { font-size: clamp(1.1rem, 5.2vw, 1.4rem); }

/* ---- quick actions / banners ---- */
.quick { display: flex; gap: 10px; margin: 0 0 4px; }
.qbtn { flex: 1; display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 16px; background: var(--card); border: 1.5px solid var(--edge); color: var(--text); text-decoration: none; text-align: left; cursor: pointer; min-width: 0; }
.qbtn svg { width: 24px; height: 24px; flex: none; color: var(--pink); }
.qbtn > span { min-width: 0; }
.qbtn b { display: block; font-size: .93rem; }
.qbtn small { display: block; color: var(--dim); font-size: .76rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.banner { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; margin: 0 0 12px; border-radius: 14px; background: linear-gradient(90deg, rgba(237, 113, 215, .16), rgba(162, 88, 242, .16)); border: 1px solid rgba(237, 113, 215, .35); font-size: .88rem; color: #f3dcff; }
.banner .grow { flex: 1; }
.banner svg { width: 18px; height: 18px; vertical-align: -3px; }
.banner .ib { width: 34px; height: 34px; }
.banner .ib svg { width: 18px; height: 18px; }

/* ---- section titles + deck cards ---- */
.sec { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 22px 2px 10px; font-size: 1.05rem; color: var(--op-soft2); font-weight: 700; }
.sec small { color: var(--op-dim); font-weight: 600; font-size: .8rem; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.card { display: flex; flex-direction: column; border: 1.5px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--card); text-decoration: none; color: inherit; min-width: 0; }
.card:active { transform: scale(.985); }
.card .ch { display: flex; justify-content: space-between; align-items: center; background: var(--cardh); padding: 9px 10px 9px 12px; color: var(--soft2); font-weight: 600; font-size: .95rem; }
.card .ch svg { width: 18px; height: 18px; opacity: .85; }
.card .cb { padding: 10px 12px 14px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.card .ct { color: var(--soft); font-weight: 500; font-size: 1.04rem; line-height: 1.3; }
.card .cq { display: flex; align-items: center; gap: 6px; color: var(--pinkt); font-weight: 500; font-size: .9rem; margin-top: auto; }
.card .cq svg { width: 20px; height: 20px; flex: none; }
.bar { height: 12px; border-radius: 7px; background: linear-gradient(90deg, var(--rem-a), var(--rem-b)); display: flex; overflow: hidden; flex: none; }
.bar i { display: block; height: 100%; transition: width .3s; }
.bar .bk { background: linear-gradient(90deg, #a65ff6, #7f19d1); }
.bar .br { background: linear-gradient(90deg, #f0906f, #d96a4c); }
.bar.mini { height: 8px; flex: 1; min-width: 40px; }
.bar.big { height: 14px; margin: 2px 0 4px; }

/* ---- panels, chips, buttons ---- */
.hero h1 { margin: 6px 2px 2px; font-size: 1.35rem; line-height: 1.25; color: var(--op-head); }
.hero p { margin: 4px 2px; color: var(--op-soft); font-size: .92rem; }
.panel { background: var(--panel); border: 1px solid var(--rule); border-radius: 18px; padding: 14px; margin: 14px 0; }
.panel h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 1.04rem; color: var(--head2); }
.panel h2 svg { width: 20px; height: 20px; color: var(--pink); }
.panel h3 { margin: 14px 0 6px; font-size: .95rem; color: var(--soft); }
.panel p { margin: 0 0 10px; color: var(--body2); font-size: .93rem; }
.fine { color: var(--op-dim) !important; font-size: .8rem !important; line-height: 1.45; }
.panel .fine, .sheet .fine, .card .fine { color: var(--dim) !important; }
.center { text-align: center; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 7px 12px; border-radius: 999px; border: 1.5px solid var(--chip-edge); background: transparent; color: var(--op-soft); font-size: .85rem; font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap; }
.chip b { font-weight: 800; opacity: .85; margin-left: 2px; }
.chip.on { background: var(--pink-fill); border-color: var(--pink-fill); color: var(--on-pink); }
.chip:disabled { opacity: .4; cursor: default; }
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 50px; border-radius: 14px; border: 0; font-weight: 800; font-size: 1rem; background: var(--raise); color: var(--text); text-decoration: none; cursor: pointer; padding: 10px 14px; text-align: center; margin: 0 0 10px; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn.primary { background: linear-gradient(90deg, #e45fc8, #a258f2); color: #fff; box-shadow: 0 6px 18px rgba(228, 95, 200, .22); }
.btn.ghost { background: transparent; border: 1.5px solid var(--chip-edge); color: var(--op-soft); }
.btn.danger { background: var(--danger-bg); color: var(--danger-t); }
.btn:disabled { opacity: .45; cursor: default; box-shadow: none; }
.btn:active:not(:disabled) { transform: scale(.985); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.row3 .btn { padding: 8px 6px; font-size: .92rem; }
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1.5px solid var(--chip-edge); background: transparent; color: var(--op-soft); font-size: .85rem; font-weight: 800; text-decoration: none; cursor: pointer; white-space: nowrap; }
.pill svg { width: 16px; height: 16px; flex: none; }
.pill.hot { border-color: rgba(237, 113, 215, .7); color: var(--pink); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 2px; font-weight: 700; cursor: pointer; }
.switch small { display: block; color: var(--dim); font-weight: 500; font-size: .8rem; margin-top: 2px; }
.switch input { -webkit-appearance: none; appearance: none; flex: none; width: 50px; height: 30px; border-radius: 999px; background: var(--tline); position: relative; cursor: pointer; margin: 0; transition: background .2s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--knob); transition: transform .2s; }
.switch input:checked { background: var(--pink-fill); }
.switch input:checked::after { transform: translateX(20px); background: #fff; }
.setrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 2px; font-weight: 700; }
.seg { display: flex; background: var(--raise2); border-radius: 12px; padding: 3px; }
.seg button { border: 0; background: transparent; color: var(--soft); font-weight: 800; padding: 6px 12px; border-radius: 9px; cursor: pointer; }
.seg button.on { background: var(--pink-fill); color: var(--on-pink); }
/* ---- settings 1.0 ---- */
.subh { margin: 16px 2px 8px; font-size: .74rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--dim); }
.panel > h2 + .subh { margin-top: 2px; }
.tgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 4px; }
.tsw { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 2px; border: 0; background: none; cursor: pointer; min-width: 0; }
.tsw i { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 2px solid; }
.tsw i svg { width: 22px; height: 22px; color: #fff; opacity: 0; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .55)); }
.tsw.lt i svg { color: #1d1d1d; filter: none; }
.tsw.on i { outline: 3px solid var(--pink); outline-offset: 2px; }
.tsw.on i svg { opacity: 1; }
.tsw b { font-size: .7rem; font-weight: 700; line-height: 1.15; text-align: center; color: var(--soft); overflow-wrap: anywhere; }
.tsw.on b { color: var(--text); }
.panel p.tnow { margin: 12px 2px 2px; font-size: .82rem; color: var(--dim); }
.tnow b { color: var(--text); }
.igrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.isw { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; padding: 9px 4px 8px; border-radius: 12px; border: 1.5px solid var(--edge); background: var(--card); cursor: pointer; text-align: center; }
.isw .aa { font-size: 1.3rem; font-weight: 800; line-height: 1.1; }
.isw b { min-width: 0; font-size: .74rem; font-weight: 700; line-height: 1.15; color: var(--soft); overflow-wrap: anywhere; }
.isw.on { border-color: var(--pink); box-shadow: 0 0 0 2px rgba(237, 113, 215, .25); }
.isw.on b { color: var(--text); }
.setcol { padding: 10px 2px 6px; font-weight: 700; }
.setcol > span { display: block; margin-bottom: 8px; }
.setcol > small, .setrow small { display: block; color: var(--dim); font-weight: 500; font-size: .8rem; margin-top: 6px; }
.seg.wide { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.seg.wide button { padding: 9px 2px; font-size: .86rem; white-space: nowrap; }
.datein { flex: none; height: 42px; max-width: 172px; padding: 0 10px; border-radius: 10px; border: 1.5px solid var(--edge); background: var(--field); color: var(--text); font: inherit; font-size: .92rem; }
.linkbtn { background: none; border: 0; padding: 4px 0; color: var(--pink); font-weight: 700; font-size: .84rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.rowlist { margin: 0 -2px; }
.rowbtn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 4px; border: 0; border-top: 1px solid var(--rule); background: transparent; color: var(--text); text-align: left; font-weight: 700; cursor: pointer; text-decoration: none; border-radius: 0; }
.rowbtn:first-child { border-top: 0; }
.rowbtn:active { background: var(--press); }
.rowbtn > svg:first-child { width: 22px; height: 22px; flex: none; color: var(--pink); }
.rowbtn .grow { flex: 1; min-width: 0; }
.rowbtn small { display: block; color: var(--dim); font-weight: 500; font-size: .8rem; margin-top: 1px; }
.rowbtn .val { flex: none; color: var(--soft); font-size: .85rem; }
.rowbtn > svg:last-child { width: 15px; height: 15px; flex: none; color: var(--dim); }
.starline { color: #f5b82e; letter-spacing: 1px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 2px 0 12px; font-size: .93rem; }
.kv dt { color: var(--dim); font-weight: 700; }
.kv dd { margin: 0; color: var(--text); font-weight: 700; overflow-wrap: anywhere; }
.legal { font-size: .78rem; color: var(--dim); line-height: 1.5; margin: 10px 0 0; }
/* ---- dashboard: today ---- */
.today { display: grid; grid-template-columns: 1.3fr 1fr 1fr; margin: 0 0 12px; background: var(--panel); border: 1.5px solid var(--panel-line); border-radius: 18px; overflow: hidden; }
.today > * { display: flex; flex-direction: column; justify-content: center; gap: 3px; min-width: 0; padding: 10px 11px; color: var(--text); text-decoration: none; border-left: 1px dashed var(--dash); }
.today > :first-child { border-left: 0; }
.today b { font-size: 1rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today small { font-size: .72rem; font-weight: 600; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today svg { width: 15px; height: 15px; margin-right: 3px; vertical-align: -2px; }
.today .fl svg { color: var(--review); }
.today .ex svg { color: var(--pink); }
.today .gbar { height: 6px; margin-top: 3px; border-radius: 99px; background: var(--rule); overflow: hidden; }
.today .gbar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #e45fc8, #a258f2); }
.today .met b { color: var(--ok-t); }
.today .met .gbar i { background: var(--ok); }
/* ---- help, reports ---- */
.faqsec { margin: 18px 2px 8px; font-size: .76rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--op-dim); }
details.faq { margin: 0 0 8px; background: var(--card); border: 1px solid var(--rule); border-radius: 14px; }
details.faq summary { display: flex; align-items: center; gap: 10px; padding: 13px 14px; font-weight: 700; color: var(--text); cursor: pointer; list-style: none; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary svg { width: 16px; height: 16px; flex: none; margin-left: auto; color: var(--dim); transition: transform .2s; }
details.faq[open] summary svg { transform: rotate(90deg); }
details.faq .a { padding: 0 14px 12px; color: var(--body); font-size: .94rem; line-height: 1.55; }
details.faq .a p { margin: 0 0 8px; }
details.faq .a b { color: var(--strong); }
.rep { margin: 0 0 10px; padding: 12px 14px; background: var(--card); border: 1px solid var(--rule); border-radius: 14px; }
.rep .rh { display: flex; justify-content: space-between; gap: 8px; font-size: .76rem; font-weight: 800; color: var(--dim); }
.rep .rr { margin: 4px 0 2px; font-size: .9rem; font-weight: 800; color: var(--review-t); }
.rep .rs { margin: 2px 0 6px; font-size: .92rem; color: var(--body); }
.rep .rn { margin: 0 0 8px; font-size: .88rem; font-style: italic; color: var(--soft); overflow-wrap: anywhere; }
.rep .ra { display: flex; flex-wrap: wrap; gap: 8px; }
.replink { display: inline-flex; align-items: center; gap: 6px; margin: 8px 0 0; padding: 6px 2px; background: none; border: 0; color: var(--op-dim); font-size: .84rem; font-weight: 700; cursor: pointer; }
.replink svg { width: 16px; height: 16px; }
.replink.done { color: var(--review-t); }
/* ---- sheet forms ---- */
.sheet .form { margin: 0 0 14px; color: var(--soft); font-size: .93rem; }
.sheet .form p { margin: 0 0 10px; }
.sheet .form label.lbl { display: block; margin: 8px 0 6px; font-weight: 700; color: var(--text); }
.sheet .opts2 { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 10px; }
.sheet .opts2 label { position: relative; }
.sheet .opts2 input, .sheet .stars input { position: absolute; opacity: 0; pointer-events: none; }
.sheet .opts2 span { display: inline-block; padding: 8px 12px; border-radius: 999px; border: 1.5px solid var(--edge); color: var(--soft); font-size: .86rem; font-weight: 700; cursor: pointer; }
.sheet .opts2 input:checked + span { background: var(--pink-fill); border-color: var(--pink-fill); color: var(--on-pink); }
.sheet .opts2 input:focus-visible + span, .sheet .stars input:focus-visible + label { outline: 2px solid var(--pink); outline-offset: 2px; }
.sheet textarea { display: block; width: 100%; min-height: 84px; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--edge); background: var(--field); color: var(--text); font: inherit; font-size: .95rem; resize: vertical; }
.sheet .stars { display: flex; flex-direction: row-reverse; justify-content: center; gap: 4px; margin: 4px 0 12px; }
.sheet .stars label { padding: 2px; color: var(--tline); cursor: pointer; }
.sheet .stars label svg { display: block; width: 42px; height: 42px; }
.sheet .stars input:checked ~ label { color: #f5b82e; }
.sheet ul.new { margin: 0 0 4px; padding-left: 20px; color: var(--body); line-height: 1.5; }
.sheet ul.new li { margin: 0 0 6px; }
.sheet .copybox { width: 100%; min-height: 120px; font-size: .82rem; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
.weblink { display: block; text-align: center; color: var(--op-soft); font-size: .88rem; font-weight: 700; padding: 8px; text-decoration: none; }

/* ---- chapter lists ---- */
.chap { list-style: none; margin: 0; padding: 0; }
.chap li { padding: 12px 0; border-top: 1px solid var(--rule); }
.chap li:first-child { border-top: 0; padding-top: 2px; }
.chap .cht { display: flex; gap: 8px; align-items: baseline; color: var(--text); font-weight: 700; font-size: .95rem; line-height: 1.35; text-decoration: none; }
.obj { flex: none; font-size: .76rem; font-weight: 800; color: var(--ink); background: var(--soft); border-radius: 6px; padding: 1px 6px; }
.chap .chb { display: flex; align-items: center; gap: 8px; margin-top: 9px; }

/* ---- question / study ---- */
.qhead { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0 10px; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: .74rem; font-weight: 800; background: var(--tag); color: var(--soft); }
.tag.k { background: rgba(162, 88, 242, .22); color: var(--knowt); }
.tag.r { background: rgba(226, 125, 96, .2); color: var(--review-t); }
.tag.b { background: rgba(226, 100, 180, .2); color: var(--bm-t); }
.tag.y { background: rgba(62, 207, 142, .16); color: var(--ok-t); }
.stem { font-size: 1.07rem; line-height: 1.56; color: var(--op-head); }
.stem p, .exp p { margin: 0 0 .7em; }
.stem ul, .stem ol { padding-left: 1.2em; }
.opts { display: flex; flex-direction: column; gap: 10px; margin: 14px 0 6px; }
.opt { display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left; padding: 13px 14px; border-radius: 14px; border: 1.5px solid var(--edge); background: var(--field); color: var(--text); font-size: 1rem; line-height: 1.42; cursor: pointer; }
.opt .L { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--raise); color: var(--soft); font-weight: 800; font-size: .88rem; margin-top: -2px; }
.opt .o { flex: 1; min-width: 0; }
.opt .mk-ic { flex: none; width: 22px; height: 22px; }
.opt .mk-ic svg { width: 22px; height: 22px; }
.opt:active:not(:disabled) { transform: scale(.99); }
.opt:disabled { cursor: default; }
.opt.sel { border-color: var(--pink); background: rgba(237, 113, 215, .12); }
.opt.sel .L { background: var(--pink-fill); color: var(--on-pink); }
.opt.right { border-color: var(--ok); background: rgba(62, 207, 142, .12); }
.opt.right .L { background: var(--ok); color: var(--on-ok); }
.opt.right .mk-ic { color: var(--ok); }
.opt.wrong { border-color: var(--bad); background: rgba(255, 107, 129, .12); }
.opt.wrong .L { background: var(--bad); color: var(--on-bad); }
.opt.wrong .mk-ic { color: var(--bad); }
.opt.dim { opacity: .62; }
.ghostlink { display: block; width: 100%; background: transparent; border: 0; color: var(--op-soft); font-weight: 700; font-size: .9rem; padding: 10px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.fb { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 14px 0 10px; padding: 11px 14px; border-radius: 14px; font-weight: 800; scroll-margin-bottom: 120px; background-color: var(--fb-base); }
.fb svg { width: 20px; height: 20px; flex: none; }
.fb .grow { flex: 1; }
.fb.ok { background-image: linear-gradient(rgba(62, 207, 142, .14), rgba(62, 207, 142, .14)); color: var(--ok-t); }
.fb.no { background-image: linear-gradient(rgba(255, 107, 129, .14), rgba(255, 107, 129, .14)); color: var(--bad-t); }
.fb.shown { background-image: linear-gradient(var(--plain-bg), var(--plain-bg)); color: var(--soft); }
.fb .note { font-size: .8rem; font-weight: 700; color: var(--soft); }
.fb .note button { border: 0; background: none; color: var(--pink); font-weight: 800; padding: 0 2px; cursor: pointer; text-decoration: underline; }
.exp { background: var(--card); border: 1px solid var(--expline); border-radius: 14px; padding: 12px 14px 4px; line-height: 1.55; font-size: .97rem; color: var(--body); margin-bottom: 12px; }
.exp ul { padding-left: 1.1em; margin: .4em 0 .8em; }
.exp li { margin: 7px 0; }
.exp strong { color: var(--strong); }
.exp a, .stem a { color: var(--link); }
.actbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--glass2); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-top: 1px solid var(--tline); padding: 10px 12px calc(10px + var(--sb)); }
.actbar .in { max-width: 640px; margin: 0 auto; display: flex; gap: 8px; align-items: center; }
.actbar .btn { margin: 0; }
.nav { flex: none; width: 50px; height: 52px; border-radius: 14px; background: var(--raise); color: var(--soft); border: 0; display: grid; place-items: center; cursor: pointer; }
.nav svg { width: 24px; height: 24px; }
.nav:disabled { opacity: .35; cursor: default; }
.mk { flex: 1; height: 52px; border-radius: 14px; font-weight: 800; font-size: 1.02rem; border: 2px solid; background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; }
.mk svg { width: 18px; height: 18px; }
.mk.review { border-color: var(--review-fill); color: var(--review-t); }
.mk.review.on { background: var(--review-fill); color: var(--on-review); }
.mk.know { border-color: var(--know-fill); color: var(--knowt); }
.mk.know.on { background: var(--know-fill); color: var(--on-know); }
.pace { font-size: .8rem; color: var(--op-dim); font-weight: 700; margin: 4px 2px 8px; }
.pace b { color: var(--op-soft); }

/* ---- results ---- */
.score .big, .big { font-size: 3rem; font-weight: 900; color: var(--strong); line-height: 1.1; margin: 4px 0 6px; }
.badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-weight: 800; font-size: .84rem; margin-bottom: 8px; white-space: nowrap; }
.badge.sm { padding: 2px 8px; font-size: .74rem; margin: 0; }
.badge.above { background: rgba(62, 207, 142, .18); color: var(--ok-t); }
.badge.near { background: rgba(240, 190, 90, .18); color: var(--gold-t); }
.badge.below { background: rgba(255, 107, 129, .18); color: var(--bad-t); }
table.res { width: 100%; border-collapse: collapse; font-size: .88rem; margin-bottom: 8px; }
table.res td { padding: 9px 4px; border-top: 1px solid var(--rule); vertical-align: middle; }
table.res tr:first-child td { border-top: 0; }
table.res .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 800; white-space: nowrap; }
table.res td:last-child { text-align: right; width: 1%; }
.hist { list-style: none; margin: 0 0 10px; padding: 0; }
.hist li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--rule); font-size: .9rem; }
.hist li span { flex: 1; color: var(--soft); }

/* ---- lists ---- */
.qrow { display: flex; gap: 10px; width: 100%; text-align: left; padding: 12px 4px; border: 0; border-top: 1px solid var(--op-rule); background: transparent; color: var(--op-text); cursor: pointer; }
.qrow:active { background: var(--press); }
.qrow .tx { flex: 1; min-width: 0; }
.qrow .m { display: flex; align-items: center; gap: 6px; font-size: .76rem; color: var(--op-dim); font-weight: 800; margin-bottom: 3px; }
.qrow .m svg { width: 13px; height: 13px; color: var(--bm); }
.qrow .s { font-size: .92rem; line-height: 1.42; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; margin-top: 5px; background: var(--dot); }
.dot.k { background: var(--know); } .dot.r { background: var(--review); }

/* ---- glossary + acronyms ---- */
.search { position: sticky; top: 0; z-index: 12; margin: 0 -14px; padding: calc(8px + var(--st)) 14px 8px; background: var(--glass); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.search input {
  width: 100%; height: 46px; border-radius: 14px; border: 1.5px solid var(--edge); background-color: var(--field); color: var(--text); font: inherit; font-size: 1rem; padding: 0 14px 0 42px; outline: none;
  background-image: var(--search-icon);
  background-repeat: no-repeat; background-position: 13px center; background-size: 19px;
}
.search input:focus { border-color: var(--pink); }
.search input::placeholder { color: var(--ph); }
.count { color: var(--op-dim); font-size: .8rem; font-weight: 700; margin: 4px 2px 0; }
.letter { margin: 18px 2px 6px; color: var(--op-accent); font-weight: 900; font-size: .95rem; scroll-margin-top: 130px; }
.term { background: var(--card); border: 1px solid var(--termline); border-radius: 14px; padding: 12px 14px; margin: 8px 0; scroll-margin-top: 130px; }
.term h3 { margin: 0; font-size: 1.03rem; color: var(--head); line-height: 1.3; }
.term .ab { font-size: .82rem; color: var(--pink); font-weight: 900; margin-left: 4px; }
.term .tags { display: flex; gap: 5px; margin: 6px 0 2px; flex-wrap: wrap; }
.term p { margin: 6px 0 0; font-size: .94rem; line-height: 1.52; color: var(--body2); }
.term .tip { color: var(--tip-t); }
.term .tip b { color: var(--ok-t); }
.term .pill { margin-top: 10px; }
.term.hl { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(237, 113, 215, .22); }
mark { background: rgba(237, 113, 215, .38); color: inherit; border-radius: 3px; padding: 0 1px; }
.acr { display: flex; gap: 12px; align-items: baseline; padding: 11px 4px; border-top: 1px solid var(--rule); }
.acr b { flex: none; width: 84px; color: var(--knowt); font-size: 1rem; font-weight: 900; overflow-wrap: anywhere; }
.acr .x { flex: 1; min-width: 0; font-size: .94rem; color: var(--body); }
.acr .x small { display: block; color: var(--dim); font-size: .74rem; font-weight: 800; margin-top: 2px; }
.acr a { color: var(--pink); font-size: .82rem; font-weight: 800; text-decoration: none; white-space: nowrap; }

/* ---- lessons ---- */
.lesson { line-height: 1.62; font-size: 1rem; color: var(--body); overflow-wrap: break-word; background: var(--content-bg); padding: 0 var(--content-pad); border-radius: 16px; display: flow-root; }
.rows, #alist { background: var(--content-bg); padding: 0 var(--content-pad); border-radius: 16px; display: flow-root; }
.rows .qrow:first-child, #alist .count + .letter { border-top: 0; }
.lesson h1 { font-size: 1.36rem; line-height: 1.3; color: var(--head); margin: 8px 0 12px; }
.lesson h2 { font-size: 1.14rem; color: var(--soft); margin: 1.7em 0 .5em; padding-bottom: 5px; border-bottom: 1px solid var(--rule); line-height: 1.3; }
.lesson h3 { font-size: 1.02rem; color: var(--softhead); margin: 1.3em 0 .4em; }
.lesson [id] { scroll-margin-top: 72px; }
.lesson a { color: var(--link); }
.lesson strong { color: var(--strong); }
.lesson ul, .lesson ol { padding-left: 1.25em; }
.lesson li { margin: 4px 0; }
.lesson code { background: var(--raise2); padding: 1px 5px; border-radius: 5px; font-size: .9em; }
.lesson blockquote { margin: 12px 0; padding: 4px 14px; border-left: 3px solid var(--edge); color: var(--soft); }
.tw { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 12px 0; border-radius: 10px; border: 1px solid var(--tline); }
.tw table { border-collapse: collapse; width: 100%; font-size: .86rem; line-height: 1.45; }
.tw.c4 table, .tw.c5 table, .tw.c6 table { min-width: 560px; }
.tw th, .tw td { border-top: 1px solid var(--tline); border-left: 1px solid var(--tline); padding: 7px 9px; vertical-align: top; text-align: left; }
.tw tr > :first-child { border-left: 0; }
.tw thead tr:first-child > *, .tw tr:first-child > th { border-top: 0; }
.tw th { background: var(--th); color: var(--text); font-weight: 800; }
.lesson .plain, .lesson .analogy, .lesson .tip, .lesson .trap, .lesson .memory, .lesson .example, .lesson .note, .lesson .local { border-left: 4px solid; border-radius: 10px; padding: 10px 14px 2px; margin: 14px 0; }
.lesson .plain { border-color: var(--soft2); background: var(--plain-bg); }
.lesson .analogy { border-color: #56b6ef; background: rgba(86, 182, 239, .09); }
.lesson .tip { border-color: #3ecf8e; background: rgba(62, 207, 142, .09); }
.lesson .trap { border-color: #ff6b81; background: rgba(255, 107, 129, .09); }
.lesson .memory { border-color: #a258f2; background: rgba(162, 88, 242, .11); }
.lesson .example { border-color: #e9b85b; background: rgba(233, 184, 91, .09); }
.lesson .note { border-color: var(--remain); background: var(--plain-bg); }
.lesson .local { border-color: #f0906f; background: rgba(240, 144, 111, .09); }
.lesson > div > p:last-child { margin-bottom: 8px; }
.qrun { margin: 14px 0 20px; padding: 12px; border-radius: 16px; background: rgba(237, 113, 215, .07); border: 1px dashed rgba(237, 113, 215, .45); }
.qrun .btn { margin: 0; }
.qrun-meta { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: .78rem; color: var(--dim); font-weight: 700; white-space: nowrap; }
.lnav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.lnav .btn { font-size: .86rem; min-height: 46px; justify-content: flex-start; text-align: left; line-height: 1.25; }
.lnav .btn.nx { justify-content: flex-end; text-align: right; }

/* ---- bottom tabs ---- */
#tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--nav); border-top: 1px solid var(--hair); padding: 7px 4px calc(7px + var(--sb)); }
#tabs .in { max-width: 640px; margin: 0 auto; display: flex; justify-content: space-around; }
#tabs a { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--soft); text-decoration: none; font-size: .74rem; font-weight: 500; padding: 3px 0; }
#tabs a span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#tabs a svg { width: 26px; height: 26px; }
#tabs a.on { color: var(--pink); }

/* ---- sheet + toast ---- */
.sheet-bg { position: fixed; inset: 0; z-index: 50; background: rgba(6, 6, 22, .62); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s ease-out; }
.sheet { width: 100%; max-width: 640px; background: var(--sheet); border-radius: 22px 22px 0 0; padding: 20px 16px calc(14px + var(--sb)); border-top: 1px solid var(--edge); animation: up .2s ease-out; }
.sheet h3 { margin: 0 0 6px; font-size: 1.12rem; }
.sheet p { color: var(--soft); margin: 0 0 16px; font-size: .93rem; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(30px); } }
#toast { position: fixed; left: 50%; bottom: calc(100px + var(--sb)); transform: translate(-50%, 16px); opacity: 0; transition: opacity .2s, transform .2s; background: var(--toast); color: var(--ink); padding: 10px 16px; border-radius: 999px; font-weight: 800; font-size: .9rem; z-index: 60; pointer-events: none; max-width: 90vw; text-align: center; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }
body.study #toast { bottom: calc(150px + var(--sb)); }

@media (min-width: 700px) { #app { padding-left: 20px; padding-right: 20px; } .bar-top, .search { margin-left: -20px; margin-right: -20px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---- question of the day ---- */
.qotd { background: var(--card); border: 1.5px solid var(--line); border-radius: 18px; padding: 12px 14px; margin: 0 0 12px; }
.qotd .qh { display: flex; align-items: center; gap: 8px; color: var(--head2); min-width: 0; }
.qotd .qh svg { width: 20px; height: 20px; color: var(--review); flex: none; }
.qotd .qh b { font-size: .98rem; white-space: nowrap; }
.qotd .qh small { margin-left: auto; min-width: 0; color: var(--dim); font-size: .74rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qotd .qs { margin: 8px 0 10px; color: var(--body2); font-size: .93rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.qotd .qf { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.qotd .qr { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; font-size: .86rem; color: var(--soft); }
.qotd .qr svg { width: 16px; height: 16px; }
.qotd .qr.ok { color: var(--ok-t); }
.qotd .qr.no { color: var(--bad-t); }
.qotd .qst { margin-left: auto; display: inline-flex; align-items: center; gap: 3px; color: var(--dim); font-size: .76rem; font-weight: 700; }
.qotd .qst svg { width: 14px; height: 14px; color: var(--review); }

/* ---- flashcards ---- */
.flash { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; width: 100%; min-height: 50vh; margin: 6px 0 10px; padding: 26px 18px; border-radius: 22px; border: 1.5px solid var(--line); background: var(--card); color: var(--text); text-align: center; cursor: pointer; box-shadow: 0 10px 28px rgba(0, 0, 0, .18); }
.flash:active { transform: scale(.99); }
.flash .side { font-size: .74rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--dim); }
.flash .front { font-size: 1.35rem; font-weight: 800; line-height: 1.3; color: var(--head); overflow-wrap: anywhere; }
.flash.on .front { font-size: 1.02rem; font-weight: 700; color: var(--soft); }
.flash .back { font-size: 1.1rem; line-height: 1.5; color: var(--body); overflow-wrap: anywhere; }
.flash .xtra { font-size: .9rem; line-height: 1.45; color: var(--tip-t); }
.flash .hint { display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; font-weight: 700; color: var(--pink); }
.flash .hint svg { width: 16px; height: 16px; }
.myc { display: flex; align-items: center; gap: 2px; padding: 10px 2px; border-top: 1px solid var(--op-rule); }
.rows .myc:first-child { border-top: 0; }
.myc .tx { flex: 1; min-width: 0; }
.myc .tx b { display: block; color: var(--op-text); font-size: .95rem; overflow-wrap: anywhere; }
.myc .tx span { display: block; color: var(--op-soft); font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.myc .ib { width: 40px; height: 40px; }
.myc .ib svg { width: 20px; height: 20px; }
.btn svg { width: 20px; height: 20px; flex: none; }

/* ---- adaptive exam ---- */
.catfacts { margin: 0 0 12px; padding-left: 20px; color: var(--body2); font-size: .9rem; line-height: 1.45; }
.catfacts li { margin: 0 0 5px; }
.meter { position: relative; height: 16px; margin: 20px 8px 8px; border-radius: 99px; background: linear-gradient(90deg, rgba(255, 107, 129, .45), rgba(240, 190, 90, .45) 50%, rgba(62, 207, 142, .45)); }
.meter .band { position: absolute; top: 4px; bottom: 4px; border-radius: 99px; background: var(--text); opacity: .3; }
.meter .cut { position: absolute; top: -7px; bottom: -7px; width: 2px; margin-left: -1px; background: var(--text); }
.meter .you { position: absolute; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; border: 3px solid var(--card); background: var(--ok); box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
.meter .you.no { background: var(--bad); }
.meterlab { display: flex; justify-content: space-between; margin: 0 2px 12px; font-size: .72rem; font-weight: 700; color: var(--dim); }
.tag.u { background: rgba(240, 190, 90, .18); color: var(--gold-t); }

/* ---- version 1.3: accounts, free plan and the paywall ---- */
.au-nav { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; padding: 9px 12px; border-radius: 12px; background: var(--raise2); border: 1px solid var(--rule); text-decoration: none; color: var(--text); }
.au-nav .au-dot { width: 9px; height: 9px; flex: none; border-radius: 50%; background: var(--pink); }
.au-nav .au-name { flex: 1; min-width: 0; font-weight: 700; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.au-nav .au-plan { flex: none; font-size: .74rem; font-weight: 800; color: var(--pink); }
.au-nav .au-sub-hidden { display: none; }
body.is-premium .au-nav .au-dot { background: var(--ok); }
body.is-premium .au-nav .au-plan { color: var(--ok); }
.pw-banner { display: grid; gap: 6px; margin: 10px 0 4px; padding: 12px 14px; border-radius: 16px; background: linear-gradient(135deg, rgba(228, 95, 200, .16), rgba(162, 88, 242, .16)); border: 1px solid rgba(228, 95, 200, .35); font-size: .88rem; color: var(--body2); }
.pw-banner b { color: var(--text); font-size: .95rem; }
.pw-banner .pill, .pw-banner a.pill { justify-self: start; }
.pw-banner.trial { background: linear-gradient(135deg, rgba(240, 190, 90, .14), rgba(228, 95, 200, .12)); border-color: rgba(240, 190, 90, .4); }
.pw-wall { margin: 18px 0; padding: 18px 16px; border-radius: 18px; background: var(--panel); border: 1px solid var(--chip-edge); text-align: center; }
.pw-wall h2 { margin: 0 0 8px; font-size: 1.15rem; color: var(--head2); }
.pw-wall p { margin: 0 0 12px; color: var(--body2); font-size: .92rem; }
.pw-wall .fine { color: var(--dim); font-size: .8rem; }
.pw-plan { display: grid; gap: 4px; margin: 0 0 12px; padding: 12px; border-radius: 14px; background: var(--raise2); }
.pw-plan b { font-size: 1.05rem; color: var(--text); }
.pw-plan span { font-size: .86rem; color: var(--soft); }
.au-err { min-height: 18px; margin: 0 0 8px; color: var(--danger-t); font-size: .86rem; font-weight: 700; }
.form label { display: block; margin: 0 0 10px; font-size: .86rem; font-weight: 700; color: var(--soft); }
.form input { display: block; width: 100%; margin-top: 4px; padding: 12px; border-radius: 12px; border: 1px solid var(--chip-edge); background: var(--raise); color: var(--text); font-size: 1rem; font-family: inherit; }
.form input:focus { outline: 2px solid var(--pink); outline-offset: 1px; }
.toast { position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%); z-index: 60; max-width: min(92vw, 420px); padding: 12px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--chip-edge); color: var(--text); font-size: .9rem; font-weight: 700; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
.p-lock { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 99px; background: rgba(240, 190, 90, .16); color: var(--gold-t); font-size: .74rem; font-weight: 800; }
