/* Page « Grammaire » : tableaux des cas et générateur de phrases */

/* Grammar */
.gram { display: flex; flex-direction: column; gap: 14px; }
.gram h3 { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 4px 0 0; font-weight: 600; }
.gram em, .gram i { font-style: italic; }
.g-cases { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.g-case { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.g-case > b { font-family: var(--f-display); font-size: 18px; }
.g-case .q { font-family: var(--f-mono); font-size: 13px; color: var(--accent); }
.g-case p { margin: 0; font-size: 14px; color: var(--muted); }
.g-toc { display: flex; flex-wrap: wrap; gap: 6px; }
.g-toc a { font-size: 13px; color: var(--accent); text-decoration: none; border: 1px solid var(--line); border-radius: 99px; padding: 4px 11px; }
.g-toc a:hover { border-color: var(--accent); }
.g-steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; max-width: 70ch; }
.g-steps li { padding-left: 4px; }
.c { color: var(--accent); font-weight: 600; }
.g-note { font-size: 13.5px; }
.panel .g-note { color: var(--muted); }
.g-tips { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; max-width: 75ch; font-size: 14.5px; }
.g-tables { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.g-tables.three { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.tw { overflow-x: auto; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
table.g { border-collapse: collapse; width: 100%; font-size: 15px; }
table.g.wide { min-width: 640px; }
table.g caption { text-align: left; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding-bottom: 6px; }
table.g th, table.g td { border: 1px solid var(--line); padding: 7px 9px; text-align: left; }
table.g thead th { font-size: 12px; font-weight: 600; background: var(--bg); }
table.g tbody th { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--bg); white-space: nowrap; }
table.g td { font-family: var(--f-display); font-variant-numeric: tabular-nums; }
table.g td small { font-family: var(--f-body); font-size: 11px; color: var(--muted); }
table.g td.chg { color: var(--accent); font-weight: 600; }
table.g th.m { color: var(--der); } table.g th.f { color: var(--die); } table.g th.n { color: var(--das); } table.g th.p { color: var(--muted); }
.g-prep { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.g-pcol { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.g-pcol h3 { margin: 0; }
.g-list { font-family: var(--f-display); font-size: 16px; color: var(--ink) !important; }
.g-mnemo { font-size: 13px; }
.g-two { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; }
.g-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.g-chips span { border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; font-family: var(--f-display); font-size: 15px; }
.g-chips i { font-family: var(--f-body); font-style: normal; font-size: 12px; color: var(--muted); margin-left: 4px; }
p.ex { margin: 0; font-family: var(--f-display); font-size: 16px; color: var(--ink) !important; display: flex; align-items: center; gap: 10px; }

/* Sentence generator */
.gen-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.gen-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.gen-field.wide { grid-column: 1 / -1; }
.seg button.k-nom[aria-pressed="true"] { background: var(--nom); border-color: var(--nom); }
.seg button.k-akk[aria-pressed="true"] { background: var(--akk); border-color: var(--akk); }
.seg button.k-dat[aria-pressed="true"] { background: var(--dat); border-color: var(--dat); }
.seg button.k-gen[aria-pressed="true"] { background: var(--gen); border-color: var(--gen); }
.seg button[aria-pressed="true"]:not([data-case="all"]) { color: var(--surface); }
.formula { font-size: 14px; border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.formula b { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.formula code { font-family: var(--f-mono); font-size: 13.5px; color: var(--ink); }
.gen-out { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--line); padding-top: 16px; }
.gen-sentence { display: flex; align-items: center; gap: 10px; }
.gen-sentence p { margin: 0; font-family: var(--f-display); font-size: 21px; color: var(--ink) !important; flex: 1; min-width: 0; }
.gen-tr { font-size: 14.5px; }
.sx { display: flex; flex-wrap: wrap; gap: 18px 12px; align-items: stretch; padding-block: 8px; }
.sg { display: flex; flex-direction: column; align-items: center; max-width: 230px; min-width: 0; --cc: var(--line); }
.sg.k-nom { --cc: var(--nom); } .sg.k-akk { --cc: var(--akk); } .sg.k-dat { --cc: var(--dat); } .sg.k-gen { --cc: var(--gen); } .sg.t-verb { --cc: var(--verb); }
.sg-top { min-height: 52px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; text-align: center; }
.sg-top .pill { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--surface); background: var(--cc); padding: 2px 8px; border-radius: 99px; }
.sg.t-verb .pill { background: transparent; color: var(--cc); border: 1px solid var(--cc); }
.sg-top .fn { font-size: 12px; color: var(--cc); font-weight: 600; line-height: 1.2; }
.sg-top::after { content: ""; width: 2px; height: 10px; background: var(--cc); }
.sg.t-other .sg-top::after { background: transparent; }
.sg-txt { font-family: var(--f-display); font-size: 20px; line-height: 1.3; padding: 0 6px 5px; border: 2px solid var(--cc); border-top: 0; border-radius: 0 0 7px 7px; text-align: center; overflow-wrap: anywhere; }
.sg.t-other .sg-txt { border-color: transparent; color: var(--muted); }
.sg-txt mark { background: transparent; color: var(--cc); font-weight: 700; }
.sg-why { font-size: 12.5px; color: var(--muted); text-align: center; padding-top: 6px; line-height: 1.35; }
.sg-why::before { content: "↑"; display: block; color: var(--cc); font-weight: 700; }
.sg.t-other .sg-why::before { content: none; }
.gen-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: var(--muted); }
.gen-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; background: var(--cc); vertical-align: -1px; }
.gen-legend .k-nom { --cc: var(--nom); } .gen-legend .k-akk { --cc: var(--akk); } .gen-legend .k-dat { --cc: var(--dat); } .gen-legend .k-gen { --cc: var(--gen); } .gen-legend .k-verb { --cc: var(--verb); }
@media (max-width: 480px) { .sg-txt { font-size: 18px; } .gen-sentence p { font-size: 19px; } }

/* sub-tabs Phrases | Grammaire */
.gram-sub { display: inline-flex; margin: 0 0 14px; }
.gram-sub button { padding: 8px 18px; font-weight: 600; }
.gram-sub button[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* Exercise: the articles to find (js/pages/exercise.js) */
.ex-tag { align-self: flex-start; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 2px 9px; }
.ex-hint { margin: 0; font-size: 13.5px; color: var(--muted); }
.ex-sent { font-family: var(--f-display); font-size: 22px; line-height: 2.1; color: var(--ink); }
.ex-sent .tk { font: inherit; color: inherit; }
.ex-sent button.tk { background: none; border: 0; padding: 0 1px; cursor: pointer; border-radius: 4px; }
.ex-sent sup { font-family: var(--f-body); font-size: 11px; font-weight: 700; color: var(--accent); margin-left: 1px; }
.tk-prep { text-decoration: underline dotted var(--accent) 2px; text-underline-offset: 5px; }
.tk-noun { text-decoration: underline dotted var(--muted) 1.5px; text-underline-offset: 5px; }
.tk.gap { display: inline-flex; align-items: baseline; }
.gap-line { display: inline-block; min-width: 54px; border-bottom: 2px solid var(--accent); height: 1em; }
.tk.gap:not(.ok) { background: color-mix(in srgb, var(--accent) 8%, transparent) !important; padding: 0 6px !important; }
.tk.gap.ok { font-weight: 700; }
.tk.gap.ok.k-nom { color: var(--nom); } .tk.gap.ok.k-akk { color: var(--akk); } .tk.gap.ok.k-dat { color: var(--dat); } .tk.gap.ok.k-gen { color: var(--gen); }
.ex-sent button.tk.on { outline: 2px solid var(--accent); outline-offset: 2px; }
.ex-sent .say, .ex-sent button[class*="say"] { vertical-align: middle; margin-left: 6px; }
.ex-tables { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); }
.ex-num { font: inherit; font-weight: 600; color: var(--accent); background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 3px 10px; cursor: pointer; }
.ex-num.on, .ex-num:hover { border-color: var(--accent); }
.ex-pop { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--bg); display: flex; flex-direction: column; gap: 10px; }
.ex-pop h4 { margin: 0; font-family: var(--f-display); font-size: 18px; font-weight: 600; }
.ex-pop h4.k-nom { color: var(--nom); } .ex-pop h4.k-akk { color: var(--akk); } .ex-pop h4.k-dat { color: var(--dat); } .ex-pop h4.k-gen { color: var(--gen); }
.ex-pop p { margin: 0; }
.ex-small { font-size: 13.5px; color: var(--muted); }
.ex-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.ex-opt { font-family: var(--f-display); font-size: 17px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 6px 14px; cursor: pointer; }
.ex-opt:hover { border-color: var(--accent); }
.ex-guide .ex-opt { font-family: var(--f-body); font-size: 14px; }
.ex-fb { font-size: 14px; }
.ex-fb.good { color: var(--easy); } .ex-fb.bad { color: var(--again); }
.ex-fb.k-nom { color: var(--nom); } .ex-fb.k-akk { color: var(--akk); } .ex-fb.k-dat { color: var(--dat); } .ex-fb.k-gen { color: var(--gen); }
.ex-links { display: flex; flex-wrap: wrap; gap: 6px 16px; }
button.link { font: inherit; font-size: 13.5px; background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.ex-guide { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; border-top: 1px dashed var(--line); padding-top: 10px; }
.ex-guide li { display: flex; flex-direction: column; gap: 6px; }
.art-m { color: var(--der); } .art-f { color: var(--die); } .art-n { color: var(--das); }
table.ex-t { max-width: 420px; }
table.ex-t td { text-align: center; }
table.ex-t tr.row-on th, table.ex-t tr.row-on td { background: color-mix(in srgb, var(--cc, var(--accent)) 12%, transparent); }
table.ex-t tr.row-on.k-nom { --cc: var(--nom); } table.ex-t tr.row-on.k-akk { --cc: var(--akk); } table.ex-t tr.row-on.k-dat { --cc: var(--dat); } table.ex-t tr.row-on.k-gen { --cc: var(--gen); }
table.ex-t tr.row-on th { color: var(--cc); }
table.ex-t td.cell-on { outline: 2px solid var(--cc); outline-offset: -2px; font-weight: 700; color: var(--cc); }
.ex-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ex-prog { font-size: 13.5px; font-weight: 600; color: var(--muted); }
.btn.small { padding: 6px 12px; font-size: 13.5px; }
.ex-result { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.ex-score { margin: 0; font-weight: 600; color: var(--easy); }
.ex-result h3 { margin: 0; }
.ex-done { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.ex-done-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.ex-done h3 { margin: 0; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.ex-done ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ex-done li button { width: 100%; text-align: left; font: inherit; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.ex-done li button:hover { border-color: var(--accent); }
.ex-d-s { font-family: var(--f-display); font-size: 15.5px; min-width: 0; }
.ex-d-m { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
@media (max-width: 480px) { .ex-sent { font-size: 19px; line-height: 2.2; } .ex-pop { padding: 12px; } .ex-done li button { flex-direction: column; gap: 2px; } }
.tk.gap sup { align-self: flex-start; margin-top: -2px; }
button.link { text-align: left; }
.gen-note { font-size: 12px; color: var(--muted); line-height: 1.35; }
.ex-pop .g-chips span.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); font-weight: 700; }
.ex-pop .g-chips span { font-size: 14px; padding: 3px 8px; }
.ex-vcase { font-size: 14px; } .ex-vcase.k-akk { color: var(--akk); } .ex-vcase.k-dat { color: var(--dat); } .ex-vcase.k-gen { color: var(--gen); }
.ex-vhint { color: var(--accent); }
.ex-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.ex-meta span { font-size: 12px; font-weight: 600; color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, transparent); border-radius: 99px; padding: 3px 10px; }

/* progress bar A1 → C2 (bottom of the Phrases tab) */
.lvp { display: flex; flex-direction: column; gap: 12px; }
.lvp-bar { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.lvp-seg { height: 14px; border-radius: 4px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; }
.lvp-seg:first-child { border-radius: 99px 4px 4px 99px; } .lvp-seg:last-child { border-radius: 4px 99px 99px 4px; }
.lvp-seg i { display: block; height: 100%; background: var(--accent); transition: width .4s; }
.lvp-seg.done i { background: var(--easy); }
.lvp-ticks { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; text-align: center; font-weight: 700; font-size: 14px; }
.lvp-ticks small { display: block; font-weight: 500; font-size: 11.5px; color: var(--muted); }
.lvp-plan { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.lvp-lv { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.lvp-lv.done { border-color: var(--easy); }
.lvp-lv h3 { margin: 0; font-size: 16px; } .lvp-lv h3 small { font-size: 12px; color: var(--muted); font-weight: 500; }
.lvp-lv p { margin: 0; color: var(--muted); line-height: 1.4; } .lvp-lv p b { display: block; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink); }
.lvp-lv .btn { align-self: flex-start; margin-top: auto; }
@media (max-width: 480px) { .lvp-plan { grid-template-columns: 1fr 1fr; } .lvp-ticks { font-size: 12.5px; } }
.gen-controls { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) { .gen-controls { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) { .gen-controls { grid-template-columns: 1fr; } }

/* "?" next to a menu of the generator → explanation in Grammaire */
.gen-lab { display: flex; align-items: center; gap: 6px; }
.gq { width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--accent); background: none; color: var(--accent); font-size: 12px; font-weight: 700; line-height: 1; padding: 0; cursor: pointer; display: inline-grid; place-items: center; }
.gq:hover { background: var(--accent); color: var(--accent-ink); }
.g-forms { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.g-form { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.g-form > b { font-family: var(--f-display); font-size: 17px; }
.g-form > p:not(.ex) { margin: 0; font-size: 14px; color: var(--muted); }
