/* Dialogs use a paper scorecard surface and the same green ink as the table. */
.gx-dialog {
  --gx-paper:#faf8ed;
  --gx-ink:#1a382e;
  --gx-line:#d8d9c9;
  color:var(--gx-ink);
  background:var(--gx-paper);
  width:min(496px,calc(100vw - 24px));
  max-height:calc(100dvh - 26px);
  margin:auto;
  padding:0;
  border:1px solid #c3bd9b;
  border-radius:18px;
  box-shadow:0 24px 96px #061c15a6;
  overflow:auto;
  overscroll-behavior:contain;
  font: 16px/1.45 "DM Sans", "Segoe UI", sans-serif;
  text-align:left;
}
.gx-dialog *, .gx-dialog { box-sizing:border-box; }
.gx-dialog::backdrop { background:rgb(6 22 17 / .66); backdrop-filter:blur(4px); }
.gx-dialog button, .gx-dialog select { font:inherit; cursor:pointer; }
.gx-dialog .gx-head { display:flex; align-items:center; gap:12px; padding:19px 22px; border-bottom:1px solid var(--gx-line); }
.gx-dialog .gx-mark { display:grid; place-items:center; width:34px; height:34px; border:1px solid #b5bda8; border-radius:50%; font:22px/1 Georgia,serif; color:#355d45; }
.gx-head h2 { flex:1; margin:0; color:var(--gx-ink); font:500 clamp(25px,5vw,33px)/1.07 Georgia, serif; letter-spacing:-1px; text-transform:none; }
.gx-head h2:focus { outline:none; }
.gx-x { width:44px; height:44px; display:grid; place-items:center; padding:0; color:var(--gx-ink); background:transparent; border:0; font-size:28px!important; }
.gx-content { padding:20px 24px 22px; }
.gx-dialog footer { display:flex; justify-content:flex-end; align-items:center; gap:8px; margin-top:22px; padding:0; background:none; border:0; }
.gx-dialog .gx-btn { display:inline-flex; align-items:center; justify-content:center; padding:10px 17px; min-height:44px; border-radius:9px; border:1px solid #b5bca9; background:transparent; color:var(--gx-ink); font-size:14px; font-weight:650; line-height:1.2; }
.gx-dialog .gx-main { background:#254f3a; color:#fffdf1; border-color:#254f3a; }
.gx-dialog .gx-btn:hover { box-shadow: inset 0 0 0 999px #78815320; }
.gx-dialog :is(button,select,input):focus-visible { outline:3px solid #be8527; outline-offset:2px; }
.gx-dialog .gx-switch-row { display:flex; justify-content:space-between; gap:12px; align-items:center; min-height:57px; padding:6px 0; border-bottom:1px solid var(--gx-line); font-weight:550; cursor:pointer; }
.gx-dialog .gx-reset { font-size:14px; font-weight:400; }
.gx-dialog .gx-switch { flex:none; appearance:none; width:44px; height:26px; margin:0; border:1px solid #63725d; border-radius:100px; cursor:pointer; background:radial-gradient(circle 8px at 12px center, #fffdf1 98%,transparent 100%),#81907d; }
.gx-dialog .gx-switch:checked { background:radial-gradient(circle 8px at calc(100% - 12px) center, #fffdf1 98%,transparent 100%), #27553c; }
.gx-prose { font:16px/1.6 Georgia,serif; }
.gx-prose p { margin:.75em 0; color:var(--gx-ink); }
.gx-prose p:first-child { font-size:21px; line-height:1.35; margin-top:0; }
.gx-dialog fieldset { padding:0; border:0; margin:0 0 18px; }
.gx-dialog legend,.gx-select > span { display:block; margin-bottom:8px; color:#546650; font-size:12px; letter-spacing:1.3px; text-transform:uppercase; font-weight:700; }
.gx-rule { display:flex; align-items:flex-start; gap:10px; padding:12px; border:1px solid var(--gx-line); border-radius:9px; margin:6px 0; cursor:pointer; }
.gx-rule:has(:checked) { background:#e9eddf; border-color:#637c58; }
.gx-rule input { width:17px; height:17px; margin:4px 0 0; accent-color:#28553c; flex:none; }
.gx-rule b { font-weight:700; }
.gx-rule small { color:#596a56; margin-left:4px; font-size:12px; }
.gx-rule-desc { display:block; margin-top:2px; font-size:14px; color:#4b5d4c; }
.gx-select-grid { display:grid; grid-template-columns:1fr 1.35fr; gap:10px; }
.gx-select select { width:100%; padding:8px; min-height:44px; color:var(--gx-ink); background:#fffdf5; border:1px solid #bec6b6; border-radius:8px; font-size:14px; }
.gx-steps { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; font-weight:650; }
.gx-steps span { display:flex; gap:4px; }
.gx-steps i { height:4px; width:16px; border-radius:2px; background:#d3d8c9; }
.gx-steps i.active { background:#577051; }
.gx-practice {
  --card-w:clamp(28px,8.2vw,48px);
  --card-h:calc(var(--card-w) * 1.42);
  background:radial-gradient(ellipse at top,#31624a,#1c412f);
  border:1px solid #173e2c;
  padding:18px 10px 12px;
  border-radius:12px;
  color:#fffdf0;
}
.gx-columns { display:grid; grid-template-columns:repeat(7,var(--card-w)); justify-content:space-evenly; }
.gx-column { border:1px solid #ffffff29; border-radius:5px; height:var(--card-h); width:var(--card-w); position:relative; }
.gx-practice .gx-card, .gx-back {
  width:var(--card-w); height:var(--card-h); min-width:0; min-height:0; padding:0; overflow:hidden; color:#202521; background-color:#fffdf5; border:1px solid #aaa891; border-radius:5px; position:relative;
}
.gx-practice .gx-card.red { color:#aa3135; }
.gx-column .gx-card { position:absolute; left:-1px; top:calc(var(--level) * 16px - 1px); }
.gx-practice .gx-card * { pointer-events:none; }
.gx-stacks { display:flex; justify-content:center; gap:20px; margin-top:32px; align-items:flex-start; }
.gx-stacks > div { display:flex; flex-direction:column; gap:4px; align-items:center; }
.gx-stacks small { color:#eeeede; font-size:12px; }
.gx-practice .gx-back { display:grid; place-items:center; background:repeating-linear-gradient(45deg,#2e6161 0 2px,#224b4a 2px 5px); color:#e3d5ae; border:3px solid #e5dbc0; }
.gx-back span { border:1px solid #ddcfa9; border-radius:50%; padding:0 .22em; font-family:Georgia,serif; }
.gx-practice .gx-glow { outline:3px solid #ffc233; outline-offset:1px; z-index:1; animation:gx-pulse 1s ease-in-out infinite alternate; }
.gx-practice .gx-pointer { overflow:visible; }
.gx-pointer:after { content:'▼'; position:absolute; top:-24px; left:50%; transform:translateX(-50%); color:white; text-shadow:0 1px 2px black; font:22px/1 sans-serif; }
.gx-practice .gx-end-example { position:relative; }
.gx-end-example strong { position:absolute; color:#a72e2d; font:bold 40px/1 Georgia; top:25%; }
.gx-instruction { margin:16px 0 0; font-size:16px; min-height:47px; color:var(--gx-ink); }
.gx-dialog .gx-tut-footer [data-gx="skip"] { margin-right:auto; background:none; border-color:transparent; padding-left:0; color:#435b47; }
.gx-celebrate { animation:gx-win .6s ease-in-out 2; }
@keyframes gx-pulse { to { box-shadow:0 0 14px 1px #ffc233ad; } }
@keyframes gx-win { 50% { transform:translateY(-5px) rotate(-3deg); } }
.reduce-motion .gx-dialog * { animation:none!important; transition:none!important; }
@media(max-width:420px) { .gx-content { padding:15px; } .gx-dialog .gx-head { padding:12px 15px; } .gx-select-grid { grid-template-columns:1fr; } .gx-dialog .gx-btn { padding:9px 11px; } }
@media(prefers-reduced-motion:reduce) { .gx-dialog * { animation:none!important; } }
