/* Grammar card — luxury redesign (Claude Code 2026-11-08, owner: "redesign more professional, luxury: text style, font, colour").
   Scoped to the word page's Grammar card (#sec-structure). Loaded by StructurePanel.js (ensureCss) and index.html.
   Sizes in rem so the reader's text size (14–26 px) still applies. Remove the <link> / ensureCss call to go back. */
#sec-structure {
  --gx-ink: #14223F; --gx-ink-2: #5B6B85; --gx-gold: #A97C2E; --gx-gold-hi: #E7C676; --gx-line: rgba(169, 124, 46, .26);
  --gx-sapph: #1E46A0; --gx-ivory: #FFFDF8;
}

/* card title */
#sec-structure .ecard-head .h-card { font: 700 1.3rem/1.15 var(--serif); letter-spacing: .01em; color: var(--gx-ink); }

/* short preview (card closed): gold diamonds, formula text */
#sec-structure:has(#stFull:not([hidden])) #stPreview { display: none; }   /* no duplicate list above the open card */
#sec-structure .pattern-list { list-style: none; padding-left: 0; gap: 6px; }
#sec-structure .pattern-list li { position: relative; padding-left: 1.1em; font: 500 .82rem/1.45 var(--sans); color: var(--gx-ink); }
#sec-structure .pattern-list li::before { content: ""; position: absolute; left: .15em; top: .62em; width: .42em; height: .42em; transform: rotate(45deg);
  background: linear-gradient(135deg, #F6E3A8, var(--gx-gold)); }
#sec-structure .pattern-list li.more { padding-left: 0; margin-left: 0; font: 600 .7rem/1.4 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--gx-gold); }
#sec-structure .pattern-list li.more::before { content: none; }

/* the gold "+" of every formula */
#sec-structure .st-plus { font-weight: 800; color: var(--gx-gold); padding: 0 .08em; }

/* ---------------------------------------------------------------- Advanced Structures box */
#sec-structure .st-ielts-box {
  position: relative; margin: 2px 0 18px; padding: 16px 16px 14px; border-radius: 18px; overflow: hidden;
  border: 1px solid rgba(169, 124, 46, .45);
}
#sec-structure .st-ielts-box::before { content: ""; position: absolute; left: 18px; right: 18px; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, #E7C676, var(--gx-gold), #E7C676, transparent); }
#sec-structure button.st-ielts-head { border-bottom-color: var(--gx-line); padding-bottom: 10px; margin-bottom: 12px; }
#sec-structure .st-ielts-box.is-closed button.st-ielts-head { padding-bottom: 0; margin-bottom: 0; }
#sec-structure .st-ielts-head h3 { font: 700 1.2rem/1.15 var(--serif); letter-spacing: .01em; color: var(--gx-ink); }
#sec-structure .st-ielts-tag { font: 700 .62rem/1.3 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: #F6E7BE; padding: 4px 10px; }
#sec-structure .st-ielts-chev { color: var(--gx-gold); border-color: rgba(169, 124, 46, .55); }
#sec-structure .st-ielts-cards { gap: 12px; }
#sec-structure .st-ielts-card { position: relative; padding: 14px 14px 12px 16px; border-radius: 14px;
  border: 1px solid rgba(20, 34, 63, .08); }
#sec-structure .st-ielts-card::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 3px;
  background: linear-gradient(180deg, #F6E3A8, var(--gx-gold)); }
#sec-structure .st-ielts-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
#sec-structure .st-ielts-num { display: grid; place-items: center; width: 1.55em; height: 1.55em; border-radius: 50%; flex: none;
  font: 800 .7rem/1 var(--sans); color: #fff; }
#sec-structure .st-ielts-title { font: 700 .82rem/1.25 var(--sans); letter-spacing: .02em; color: var(--gx-ink); }
#sec-structure .st-ielts-sentence { margin: 0; font: 400 .93rem/1.6 var(--sans); color: #1F2A44; }
#sec-structure .st-ielts-sentence b, #sec-structure .st-ielts-sentence strong { color: var(--gx-gold); font-weight: 700; }
#sec-structure .st-ielts-footer { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--gx-line); }
#sec-structure .st-ielts-pattern { font: italic 500 .74rem/1.4 var(--sans); color: var(--gx-ink-2); }

/* level badges: refined pills */
#sec-structure .lvl-badge, #sec-structure .st-ielts-badge { padding: .22em .7em; border-radius: 999px; border-width: 1px; font: 700 .62rem/1.3 var(--sans);
  letter-spacing: .06em; text-transform: uppercase; filter: none !important; }
#sec-structure .lvl-badge.lvl-essential { }
#sec-structure .lvl-badge.lvl-academic { }
#sec-structure :is(.lvl-badge, .st-ielts-badge).lvl-c1 { }
#sec-structure :is(.lvl-badge, .st-ielts-badge).lvl-c2 { }
#sec-structure .lvl-badge.lvl-advanced { }

/* ---------------------------------------------------------------- pattern groups */
#sec-structure .st-group { margin-top: 14px; }
#sec-structure .st-ghead { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 6px; margin-bottom: 4px;
  border-bottom: 1px solid var(--gx-line); }
#sec-structure .st-ghead h3 { display: inline-flex; align-items: center; gap: 8px; margin: 0; font: 700 .7rem/1.3 var(--sans); letter-spacing: .14em;
  text-transform: uppercase; color: var(--gx-gold); }
#sec-structure .st-ghead .rel-count { display: grid; place-items: center; min-width: 1.7em; height: 1.7em; padding: 0 .4em; border-radius: 999px;
  font: 700 .66rem/1 var(--sans); letter-spacing: 0; color: var(--gx-gold); }
#sec-structure .st-learn { display: inline-flex; align-items: center; gap: 2px; font: 600 .74rem/1 var(--sans); color: var(--gx-sapph); text-decoration: none;
  padding: 6px 10px; border-radius: 999px; }
#sec-structure .st-learn .ic { width: 14px; height: 14px; }

#sec-structure .prow-d { border-top: 1px solid rgba(20, 34, 63, .08); }
#sec-structure .prow-d:first-child { border-top: 0; }
#sec-structure .prow-d > button { gap: 12px; min-height: 58px; padding: 8px 4px; border-radius: 12px; transition: background .15s; }
#sec-structure .prow-d > button:hover, #sec-structure .prow-d > button[aria-expanded="true"] { }
#sec-structure .st-n { flex: none; width: 1.9em; font: italic 600 1.05rem/1 var(--serif); color: var(--gx-gold); text-align: left; }
#sec-structure .st-name { flex: 1; min-width: 0; display: grid; gap: 3px; }
#sec-structure .st-formula { font: 600 .9rem/1.35 var(--sans); color: var(--gx-ink); letter-spacing: .005em; }
#sec-structure .st-type { display: block; font: 500 .66rem/1.3 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--gx-ink-2); }
#sec-structure .prow-d > button > .ic { color: var(--gx-gold); }

/* opened pattern: meaning + Learner / C1 / C2 examples */
#sec-structure .prow-d .pb { padding: 4px 4px 14px 2.4em; gap: 8px; }
#sec-structure .st-mean { margin: 0; font: 500 .84rem/1.5 var(--sans); color: var(--gx-ink); }
#sec-structure .st-expl { color: var(--gx-ink-2); font-style: italic; }
#sec-structure .lvl-ex { border-left: 3px solid var(--gx-line); border-radius: 10px; }
#sec-structure .lvl-ex.lvl-learner { border-left-color: #6FBF96; }
#sec-structure .lvl-ex.lvl-c1 { border-left-color: #A782CF; }
#sec-structure .lvl-ex.lvl-c2 { border-left-color: #D58A95; }
#sec-structure .lvl-ex > p { font: 400 .86rem/1.55 var(--sans); }
#sec-structure .lvl-ex .lvl { font: 700 .6rem/1.4 var(--sans); letter-spacing: .08em; text-transform: uppercase; }
#sec-structure .st-gram a { display: inline-flex; align-items: center; gap: 6px; font: 600 .76rem/1.2 var(--sans); color: var(--gx-sapph); text-decoration: none; }

/* "Grammar for <word> as a verb ›" */
#sec-structure .st-all { margin: 16px 0 2px; }
#sec-structure .st-all a { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 16px; border-radius: 14px;
  font: 600 .8rem/1.2 var(--sans); color: #F6E7BE; text-decoration: none; letter-spacing: .01em; }
#sec-structure .st-all a .ic { width: 16px; height: 16px; color: var(--gx-gold-hi); }

/* ================================================================ round 2 (owner: "cover all Grammar"): opened pattern + lesson pages */
/* opened pattern: one white card — header row + meaning + examples */
#sec-structure .prow-d:has(> button[aria-expanded="true"]) { margin: 8px -6px; padding: 0 6px 4px; border-top-color: transparent; border-radius: 16px; border: 1px solid rgba(169, 124, 46, .3); }
#sec-structure .prow-d:has(> button[aria-expanded="true"]) + .prow-d { border-top-color: transparent; }
#sec-structure .prow-d > button[aria-expanded="true"] { }
#sec-structure .prow-d > button[aria-expanded="true"] > .ic { transform: rotate(90deg); }
#sec-structure .prow-d .pb { padding: 2px 6px 12px; gap: 10px; }
#sec-structure .st-mean { position: relative; padding: 2px 0 2px 12px; font: 500 .92rem/1.5 var(--serif); font-family: "Cormorant Garamond", var(--serif); font-size: 1.02rem; font-weight: 600; color: var(--gx-ink); }
#sec-structure .st-mean::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 3px; border-radius: 3px; background: linear-gradient(180deg, #F6E3A8, var(--gx-gold)); }
#sec-structure .st-expl { display: table; margin-top: 6px; padding: 3px 10px; border-radius: 8px; font: 600 .72rem/1.4 var(--sans); font-style: normal; letter-spacing: .02em;
  color: var(--gx-ink); }

/* Learner / C1 / C2 examples: white cards, coloured edge and label */
#sec-structure .lvl-list { gap: 8px; }
#sec-structure .lvl-ex, #sec-structure .lvl-ex.lvl-learner, #sec-structure .lvl-ex.lvl-c1, #sec-structure .lvl-ex.lvl-c2, #sec-structure .lvl-ex.lvl-academic { border: 1px solid rgba(20, 34, 63, .08); border-left: 3px solid #9DB4EA; border-radius: 12px; padding: 8px 6px 10px 12px; }
#sec-structure .lvl-ex.lvl-learner { border-left-color: #4FB386; }
#sec-structure .lvl-ex.lvl-c1 { border-left-color: #5C83D6; }
#sec-structure .lvl-ex.lvl-c2 { border-left-color: #9A6BCB; }
#sec-structure .lvl-ex .lvl { padding: 2px 9px; border-radius: 999px; font: 800 .58rem/1.5 var(--sans); letter-spacing: .1em; text-transform: uppercase; }
#sec-structure .lvl-ex.lvl-learner .lvl { color: #0F6A44; }
#sec-structure .lvl-ex.lvl-c1 .lvl { color: #1E46A0; }
#sec-structure .lvl-ex.lvl-c2 .lvl { color: #5B2C83; }
#sec-structure .lvl-ex > p { font: 400 .9rem/1.55 var(--sans); color: #1A2540; }
#sec-structure .lvl-ex > p b { color: var(--gx-ink); font-weight: 800; }
#sec-structure .lvl-ex .tr-line { display: block; margin-top: 6px; padding-top: 6px; border-top: 1px dashed rgba(20, 34, 63, .12); }
#sec-structure .lvl-ex .tr-text { font: 400 .8rem/1.6 var(--khmer, var(--sans)); color: #56637D; }
#sec-structure :is(.say, .say-tr) .ic { color: var(--gx-gold); }
#sec-structure .ai-tag { font: 700 .55rem/1.4 var(--sans); letter-spacing: .06em; color: #7A5A1E; border-radius: 6px; padding: 0 5px; }

/* ---------------------------------------------------------------- Grammar lesson pages (#/grammar/<lesson>) */
#v-grammar { --gx-ink: #14223F; --gx-ink-2: #5B6B85; --gx-gold: #A97C2E; --gx-line: rgba(169, 124, 46, .26); --gx-sapph: #1E46A0; }
#v-grammar .gr-head .h-page { font: 700 2rem/1.1 var(--serif); letter-spacing: .01em; }
#v-grammar .gr-crumbs a { font-weight: 600; }
#v-grammar .gr-sec { border-radius: 18px; border: 1px solid rgba(169, 124, 46, .35); padding: 16px 14px; }
#v-grammar .gr-sec > .h-card { font: 700 1.2rem/1.2 var(--serif); color: var(--gx-ink); padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--gx-line); }
#v-grammar .gr-sec > .h-card .rel-count { font: 700 .66rem/1 var(--sans); color: var(--gx-gold); border-radius: 999px; padding: 4px 7px; vertical-align: middle; }
#v-grammar .gr-sec > p.small { font: 500 .78rem/1.5 var(--sans); color: var(--gx-ink-2); }
#v-grammar .gr-forms { display: grid; gap: 14px; }
#v-grammar .gr-f { position: relative; margin: 0 0 8px; padding: 8px 12px 8px 26px; border-radius: 12px; font: 700 .9rem/1.4 var(--sans); color: var(--gx-ink); }
#v-grammar .gr-f::before { content: ""; position: absolute; left: 11px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; transform: rotate(45deg);
  background: linear-gradient(135deg, #F6E3A8, var(--gx-gold)); }
#v-grammar .gr-ex { display: grid; gap: 8px; list-style: none; margin: 0; padding: 0; }
#v-grammar .gr-ex > li { position: relative; padding: 8px 10px 9px 12px; border-radius: 12px; font: 400 .9rem/1.55 var(--sans); color: #1A2540; border: 1px solid rgba(20, 34, 63, .08); border-left: 3px solid #C9A24A; }
#v-grammar .gr-ex > li.lvl-learner { border-left-color: #4FB386; }
#v-grammar .gr-ex > li.lvl-c1 { border-left-color: #5C83D6; }
#v-grammar .gr-ex > li.lvl-c2 { border-left-color: #9A6BCB; }
#v-grammar .gr-ex > li b { color: var(--gx-ink); font-weight: 800; }
#v-grammar .gr-ex .lvl { display: table; margin-bottom: 4px; padding: 2px 9px; border-radius: 999px; font: 800 .58rem/1.5 var(--sans); letter-spacing: .1em; text-transform: uppercase; }
#v-grammar .gr-ex > li.lvl-learner .lvl { color: #0F6A44; }
#v-grammar .gr-ex > li.lvl-c1 .lvl { color: #1E46A0; }
#v-grammar .gr-ex > li.lvl-c2 .lvl { color: #5B2C83; }
#v-grammar .ai-tag { font: 700 .55rem/1.4 var(--sans); letter-spacing: .06em; color: #7A5A1E; border-radius: 6px; padding: 0 5px; }

/* 2026-11-08 owner: "all Grammar back to previous colours" — new fonts / layout kept, backgrounds are the app's own again */
#sec-structure .st-ielts-tag { color: #92400e; }
#sec-structure .st-all a { color: var(--gx-sapph); justify-content: flex-start; min-height: 40px; padding: 0; }
#sec-structure .st-all a .ic { color: var(--gx-sapph); }
#sec-structure .st-learn { padding: 6px 0; }

/* ================================================================ round 3 (owner: "keep background colour; redesign text style, font,
   colour; cover all Grammar") — text only: no background is changed here */
#sec-structure, #v-grammar { --gt-ink: #0F1C3A; --gt-body: #18233F; --gt-muted: #4E5C78; --gt-gold: #9A6E22; --gt-gold-2: #B8862F; --gt-sapph: #1B3F96; }

/* headings */
#sec-structure .ecard-head .h-card { font-weight: 700; color: var(--gt-ink); letter-spacing: .015em; }
#sec-structure .st-ghead h3 { font: 800 .7rem/1.3 var(--sans); letter-spacing: .18em; color: var(--gt-gold); }
#sec-structure .st-ghead .rel-count { color: var(--gt-gold); font-weight: 800; }
#sec-structure .st-learn, #sec-structure .st-gram a, #sec-structure .st-all a { font-weight: 700; color: var(--gt-sapph); letter-spacing: .01em; }
#sec-structure .st-learn .ic, #sec-structure .st-gram a .ic, #sec-structure .st-all a .ic { color: var(--gt-sapph); }

/* pattern rows */
#sec-structure .st-n { font: italic 600 1.3rem/1 "Cormorant Garamond", var(--serif); color: var(--gt-gold-2); }
#sec-structure .st-formula { font: 700 .95rem/1.35 var(--sans); color: var(--gt-ink); letter-spacing: 0; }
#sec-structure .st-plus { color: var(--gt-gold-2); font-weight: 900; }
#sec-structure .st-type { font: 700 .6rem/1.3 var(--sans); letter-spacing: .14em; color: #8A6A2E; }
#sec-structure .lvl-badge { font-weight: 800; letter-spacing: .08em; }

/* opened pattern: meaning, rule, examples */
#sec-structure .st-mean { font: 700 1.14rem/1.42 "Cormorant Garamond", var(--serif); color: #0F1C3A; letter-spacing: .005em; }
#sec-structure .st-expl { display: block; margin-top: 6px; padding: 0; font: italic 600 .86rem/1.4 "Cormorant Garamond", var(--serif); letter-spacing: .02em; color: var(--gt-gold); }
#sec-structure .st-expl::before { content: "Pattern · "; font: 800 .56rem/1 var(--sans); font-style: normal; letter-spacing: .16em; text-transform: uppercase; color: #8A6A2E; vertical-align: 2px; }
#sec-structure .lvl-ex .lvl { font: 800 .58rem/1.5 var(--sans); letter-spacing: .16em; }
#sec-structure .lvl-ex.lvl-learner .lvl { color: #0B5D3B; }
#sec-structure .lvl-ex.lvl-c1 .lvl { color: #1C3F94; }
#sec-structure .lvl-ex.lvl-c2 .lvl { color: #4B2577; }
#sec-structure .lvl-ex > p { font: 450 .95rem/1.6 var(--sans); color: var(--gt-body); letter-spacing: .003em; }
#sec-structure .lvl-ex > p b { color: var(--gt-ink); font-weight: 800; background: none; }
#sec-structure .lvl-ex .tr-text { font-size: .82rem; color: var(--gt-muted); }

/* Advanced Structures */
#sec-structure .st-ielts-head h3 { color: var(--gt-ink); font-weight: 700; }
#sec-structure .st-ielts-title { font: 800 .8rem/1.25 var(--sans); letter-spacing: .02em; color: var(--gt-ink); }
#sec-structure .st-ielts-sentence { font: 450 .97rem/1.62 var(--sans); color: var(--gt-body); }
#sec-structure .st-ielts-sentence b, #sec-structure .st-ielts-sentence strong { color: var(--gt-gold); font-weight: 800; }
#sec-structure .st-ielts-pattern { font: italic 600 .86rem/1.4 "Cormorant Garamond", var(--serif); color: #7A5A1E; letter-spacing: .01em; }

/* short preview list (card closed) */
#sec-structure .pattern-list li { font: 600 .84rem/1.45 var(--sans); color: var(--gt-ink); }

/* Grammar lesson pages */
#v-grammar .gr-sec > .h-card { color: var(--gt-ink); }
#v-grammar .gr-sec > p.small { color: var(--gt-muted); }
#v-grammar .gr-f { font: 700 .93rem/1.4 var(--sans); color: var(--gt-ink); }
#v-grammar .gr-ex > li { font: 450 .95rem/1.6 var(--sans); color: var(--gt-body); }
#v-grammar .gr-ex > li b { color: var(--gt-ink); font-weight: 800; background: none; }
#v-grammar .gr-ex .lvl { font: 800 .58rem/1.5 var(--sans); letter-spacing: .16em; }
#v-grammar .gr-ex > li.lvl-learner .lvl { color: #0B5D3B; }
#v-grammar .gr-ex > li.lvl-c1 .lvl { color: #1C3F94; }
#v-grammar .gr-ex > li.lvl-c2 .lvl { color: #4B2577; }
#v-grammar .gr-crumbs a { color: #E9CB80; }

/* 2026-11-08 owner: "erase or hide, it repeats the same all the time" — the long explanation under each pattern's meaning is hidden
   (data kept; delete this rule to show it again) */
#sec-structure .st-expl { display: none !important; }
/* 2026-11-08 Advanced card source (Tatoeba / Wiktionary / LexiGlobal; "rewritten" = changed by the grammar rules) */
#sec-structure .st-ielts-src { font: 500 .62rem/1.3 var(--sans); color: #8a8f9c; letter-spacing: .02em; font-style: normal; white-space: nowrap; }

/* 2026-11-09 owner: "luxury design, compact space, font style and size" — pattern rows (Verb Phrases, Verb Patterns …).
   Sizes in rem follow the user's Text size setting; at 20 px a row is about 44–52 px high instead of 60–86 px. */
#sec-structure .st-ghead { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 0 6px; border-bottom: 1px solid rgba(176, 141, 62, .35); }
#sec-structure .st-ghead h3 { display: flex; align-items: center; gap: 7px; margin: 0; font: 700 .62rem/1.2 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: #8A6A2E; }
#sec-structure .st-ghead .rel-count { min-width: 1.15rem; height: 1.15rem; padding: 0 .3rem; display: inline-grid; place-items: center; border-radius: 999px; border: 1px solid rgba(176, 141, 62, .45); font: 700 .56rem/1 var(--sans); letter-spacing: 0; color: #8A6A2E; background: transparent; }
#sec-structure .st-learn { font: 600 .66rem/1.2 var(--sans); letter-spacing: .02em; color: #1D4ED8; white-space: nowrap; }
#sec-structure .st-learn .ic { width: .7rem; height: .7rem; }
#sec-structure .st-rows .prow-d > button { display: grid; grid-template-columns: 1.35rem minmax(0, 1fr) auto .8rem; align-items: center; column-gap: 9px;
  padding: .42rem .1rem; min-height: 0; border-bottom: 1px solid rgba(176, 141, 62, .16); }
#sec-structure .st-rows .prow-d:last-child > button { border-bottom: 0; }
#sec-structure .st-n { font: italic 600 .9rem/1 "Cormorant Garamond", var(--serif); color: #B08D3E; text-align: left; letter-spacing: .02em; }
#sec-structure .st-name { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
#sec-structure .st-formula { font: 600 .78rem/1.32 var(--sans); color: #1E2C4A; letter-spacing: .003em; }
#sec-structure .st-formula .st-plus { font-weight: 500; color: #B08D3E; margin: 0 .08em; }
#sec-structure .st-type { font: 600 .5rem/1.25 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: #A4874F; }
#sec-structure .st-rows .lvl-badge { font: 700 .52rem/1 var(--sans); letter-spacing: .06em; padding: .2rem .45rem; border-radius: 999px; }
#sec-structure .st-rows .prow-d > button > .ic { width: .8rem; height: .8rem; opacity: .55; color: #8A6A2E; }
#sec-structure .st-group { margin-top: 12px; }

/* 2026-11-09 (owner: "what happened on the text, I can see some only"): the source line under an Advanced Structure card
   was nowrap and pushed the whole Grammar card wider than the screen (narrow phones, dictionary side panel). Everything wraps. */
#sec-structure { grid-template-columns: minmax(0, 1fr) !important; }
#sec-structure > *, #sec-structure .st-ielts-box, #sec-structure .st-ielts-card, #sec-structure .st-ielts-footer { min-width: 0; max-width: 100%; }
#sec-structure .st-ielts-src { white-space: normal !important; overflow-wrap: anywhere; }
#sec-structure .st-ielts-pattern, #sec-structure .st-ielts-sentence { overflow-wrap: anywhere; }
