/* « Apprendre à écrire » (onglet Grammaire : arabe, russe, japonais, chinois) — js/features/writing.js */
.g-write .wr-sets { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 10px; }
.g-write .wr-set { border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 99px; padding: 6px 14px; font: inherit; font-size: 14px; cursor: pointer; }
.g-write .wr-set.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.g-write .wr-set-one { margin: 4px 0 8px; font-weight: 600; }
.g-write .wr-picker { display: flex; flex-wrap: wrap; gap: 5px; max-height: 148px; overflow-y: auto; padding: 2px; margin-bottom: 12px; align-content: flex-start; }
.g-write .wr-ch { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 20px; line-height: 1; cursor: pointer; position: relative; padding: 0; }
.g-write .wr-ch.on { border: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.g-write .wr-ch.done::after { content: "✓"; position: absolute; right: 2px; top: 0; font-size: 9px; color: var(--gm-ok, #2f7d45); font-weight: 700; }
.g-write .wr-count { flex: 0 0 100%; color: var(--muted); font-size: 12px; margin-top: 2px; }
.g-write .wr-card { border: 1px solid var(--line); border-radius: 16px; padding: 14px; background: var(--surface); display: flex; flex-direction: column; gap: 12px; align-items: center; }
.g-write .wr-head { display: flex; align-items: center; gap: 12px; width: 100%; flex-wrap: wrap; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; }
.g-write .wr-big { font-size: 34px; line-height: 1.1; font-weight: 600; }
.g-write .wr-r { flex: 1; display: flex; flex-direction: column; color: var(--muted); font-size: 14px; }
.g-write .wr-n { font-size: 12px; }
.g-write .wr-forms { flex: 0 0 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding-top: 6px; border-top: 1px dashed var(--line); }
.g-write .wr-forms small { flex: 0 0 100%; color: var(--muted); }
.g-write .wr-forms span { display: inline-flex; flex-direction: column; align-items: center; min-width: 52px; }
.g-write .wr-forms b { font-family: "Noto Naskh Arabic", "Geeza Pro", serif; font-size: 26px; font-weight: 400; line-height: 1.3; }
.g-write .wr-forms i { font-style: normal; font-size: 11px; color: var(--muted); }
.g-write .wr-modes { display: flex; justify-content: space-around; width: 100%; gap: 6px; }
.g-write .wr-mode { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; padding: 0; }
.g-write .wr-ico { width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink); }
.g-write .wr-mode.on { color: var(--ink); font-weight: 600; }
.g-write .wr-mode.on .wr-ico { border: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent); }
.g-write .wr-pad { --wr-size: 300px; position: relative; width: min(300px, 100%); aspect-ratio: 1; max-width: 100%; }
.g-write .wr-grid { position: absolute; inset: 0; width: 100%; height: 100%; }
.g-write .wr-grid rect { fill: var(--bg); stroke: color-mix(in srgb, var(--accent) 45%, var(--line)); stroke-width: .8; }
.g-write .wr-grid path { stroke: color-mix(in srgb, var(--accent) 30%, var(--line)); stroke-width: .5; stroke-dasharray: 2 2; fill: none; }
.g-write .wr-grid path.d { stroke-width: .35; opacity: .6; }
.g-write .wr-draw { position: absolute; inset: 0; display: grid; place-items: center; }
.g-write .wr-draw canvas { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: 100%; max-height: 100%; }
.g-write .wr-draw canvas.wr-ink { touch-action: none; cursor: crosshair; }
.g-write .wr-draw svg { touch-action: none; }
.g-write .wr-msg { margin: 0; width: 100%; padding: 9px 12px; border-radius: 10px; background: var(--bg); font-size: 14px; text-align: left; }
.g-write .wr-msg.ok { background: color-mix(in srgb, var(--gm-ok, #2f7d45) 14%, var(--surface)); color: var(--gm-ok, #2f7d45); font-weight: 600; }
.g-write .wr-msg.meh { background: color-mix(in srgb, #e8a33d 16%, var(--surface)); }
.g-write .wr-msg.bad { background: color-mix(in srgb, #c2410c 12%, var(--surface)); }
.g-write .wr-act { display: flex; gap: 8px; width: 100%; flex-wrap: wrap; }
.g-write .wr-act .btn { flex: 1; min-height: 44px; }
