svg.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.md-app{
  /* Layout: a close-up mat. Green felt is the stage, ivory cards are the only bright
     objects, brass marks stack numbers, and every answer pad sits in the thumb zone. */
  color-scheme: dark;
  --felt: #0F2D28;
  --felt-deep: #0A211D;
  --felt-raised: #163A33;
  --felt-hi: #1F4A41;
  --line: rgba(238, 228, 204, 0.12);
  --line-strong: rgba(238, 228, 204, 0.28);
  --ivory: #F6F0E2;
  --ivory-hi: #FCF8EE;
  --ivory-shade: #D8CDB2;
  --ink: #1C1B21;
  --pip-red: #C3263B;
  --red-lite: #F38D98;
  --brass: #DDB872;
  --brass-dim: rgba(221, 184, 114, 0.14);
  --text: #EFE8D6;
  --muted: #9DB2A8;
  --good: #7DD8A0;
  --bad: #FF8F84;
  --bad-line: rgba(255, 143, 132, 0.45);
  --lv0: rgba(238, 228, 204, 0.36);
  --lv1: #E8A44A;
  --lv2: #6CB8DD;
  --lv3: #7DD8A0;
  --back-red: #7A1E2C;
  --scrim: rgba(3, 12, 10, 0.64);
  --shadow: rgba(0, 0, 0, 0.55);
  --glow: rgba(255, 255, 255, 0.05);
  --on-accent: var(--felt-deep);      /* text and icons on brass, green, red and level fills */
  --card-edge: rgba(0, 0, 0, 0.07);   /* hairline around ivory cards, so they hold their shape on light themes */
  --toast: var(--ivory);
  --toast-ink: var(--ink);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", ui-serif, Georgia, "Noto Serif", "Droid Serif", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", "Droid Sans Mono", Menlo, Consolas, monospace;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --back: repeating-linear-gradient(45deg, rgba(221, 184, 114, 0.42) 0 1.2px, transparent 1.2px 6px), repeating-linear-gradient(-45deg, rgba(221, 184, 114, 0.42) 0 1.2px, transparent 1.2px 6px), var(--back-red);
}.md-app /* ── Themes. Felt (above) is the default; each theme overrides only what changes. The swatch colors in SKINS (script) mirror --felt, .md-app --brass and --ivory here, .md-app and the tests check they stay in step. ── */ :root[data-skin="midnight"]{   /* blue tournament felt, blue-backed cards */
  --felt: #102037; --felt-deep: #0A1628; --felt-raised: #172B48; --felt-hi: #213B60;
  --line: rgba(220, 230, 246, 0.12); --line-strong: rgba(220, 230, 246, 0.28);
  --text: #E8EDF5; --muted: #9DB0C8;
  --brass: #E2BF7A; --brass-dim: rgba(226, 191, 122, 0.14);
  --back-red: #1F3C78;
}.md-app[data-skin="bordeaux"]{   /* wine velvet, gold, blue-backed cards */
  --felt: #2E1219; --felt-deep: #220C12; --felt-raised: #3E1922; --felt-hi: #52222D;
  --line: rgba(246, 226, 218, 0.12); --line-strong: rgba(246, 226, 218, 0.28);
  --text: #F4E7E0; --muted: #C9A9A6;
  --brass: #E5C07A; --brass-dim: rgba(229, 192, 122, 0.14);
  --red-lite: #FF9DA6;
  --back-red: #213E70;
}.md-app[data-skin="noir"]{   /* near-black, easy on the eyes at night */
  --felt: #111113; --felt-deep: #060607; --felt-raised: #1B1B1F; --felt-hi: #29292F;
  --line: rgba(236, 236, 240, 0.12); --line-strong: rgba(236, 236, 240, 0.26);
  --text: #EDEBE6; --muted: #A9A7A2;
  --glow: rgba(255, 255, 255, 0.03);
}.md-app[data-skin="daylight"]{   /* warm paper for bright rooms: accents darken so light text can sit on them */
  color-scheme: light;
  --felt: #F1EADC; --felt-deep: #E7DDC9; --felt-raised: #F8F3E9; --felt-hi: #FFFFFF;
  --line: rgba(70, 52, 22, 0.14); --line-strong: rgba(70, 52, 22, 0.3);
  --ivory: #FFFFFF; --ivory-hi: #FFFFFF; --ivory-shade: #CDBF9F;
  --text: #2A251E; --muted: #625949;
  --brass: #7A4F10; --brass-dim: rgba(122, 79, 16, 0.12);
  --red-lite: #B0223A;
  --good: #23683F; --bad: #B0223A; --bad-line: rgba(176, 34, 58, 0.45);
  --lv0: rgba(70, 52, 22, 0.4); --lv1: #A65A0B; --lv2: #2C6A96; --lv3: #2A7448;
  --scrim: rgba(40, 30, 14, 0.42); --shadow: rgba(70, 50, 20, 0.32); --glow: rgba(255, 255, 255, 0.55);
  --on-accent: #FFFFFF; --card-edge: rgba(70, 52, 22, 0.2);
  --toast: #2A251E; --toast-ink: #F8F3E9;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}.md-app{ height: 100%; box-sizing: border-box; background: var(--felt-deep); overscroll-behavior: none; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }.md-app *, .md-app *::before, .md-app *::after{ box-sizing: inherit; }.md-app [hidden]{ display: none !important; }.md-app{
  height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none;
  background-color: var(--felt);
  background-image: radial-gradient(140% 60% at 50% 0%, var(--glow), transparent 65%), var(--grain);
  color: var(--text); font: 15px/1.45 var(--sans);
  -webkit-tap-highlight-color: transparent;
}.md-app button, .md-app select{ font: inherit; color: inherit; }.md-app button{ background: none; border: 0; padding: 0; margin: 0; cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; text-align: inherit; }.md-app button:disabled{ cursor: default; }.md-app [role="button"]{ cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; }.md-app button, .md-app [role="button"]{ -webkit-touch-callout: none; }.md-app .sr-only{ position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }.md-app :focus-visible{ outline: 2px solid var(--brass); outline-offset: 2px; }.md-app p, .md-app h1, .md-app h2, .md-app h3, .md-app ul, .md-app dl, .md-app dd{ margin: 0; }.md-app .sprite{ position: absolute; width: 0; height: 0; overflow: hidden; }.md-app .suit{ width: 1em; height: 1em; fill: currentColor; display: inline-block; flex: none; }.md-app .ico{ width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }.md-app .mono{ font-family: var(--mono); }.md-app /* ── App shell ── */ #app{ height: 100%; display: flex; flex-direction: column; }.md-app .bar{ flex: none; background: var(--felt-deep); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }.md-app .bar-in{ max-width: 640px; margin: 0 auto; }.md-app .top{ border-bottom: 1px solid var(--line); }.md-app .top .bar-in{ display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 50px; padding-block: 6px; }.md-app /* The brand doubles as the stack switcher: tap the stack's name to change stacks */ .brand-h{ min-width: 0; font: inherit; }.md-app .brand{ display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%; min-height: 44px; padding: 2px 4px 2px 0; border-radius: 12px; }.md-app .brand:active{ background: var(--felt); }.md-app .brand-mark{ width: 30px; height: 30px; flex: none; color: var(--brass); }.md-app .brand-txt{ display: flex; flex-direction: column; min-width: 0; }.md-app .brand-name{ display: flex; align-items: center; gap: 5px; min-width: 0; font: 600 17px/1.1 var(--serif); letter-spacing: 0.01em; color: var(--text); white-space: nowrap; }.md-app .brand-name #stackName{ overflow: hidden; text-overflow: ellipsis; }.md-app .brand-name .ico{ width: 15px; height: 15px; color: var(--brass); stroke-width: 2.4; }.md-app .brand-sub{ margin-top: 2px; overflow: hidden; text-overflow: ellipsis; font-size: 10px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }.md-app .mpill{ display: flex; align-items: center; gap: 7px; min-height: 40px; padding: 4px 11px 4px 5px; border-radius: 999px; border: 1px solid var(--line); background: var(--felt); font: 600 13px/1 var(--mono); color: var(--text); flex: none; }.md-app .mpill small{ color: var(--muted); font-weight: 500; }.md-app .ring{ width: 26px; height: 26px; transform: rotate(-90deg); }.md-app .ring circle{ fill: none; stroke-width: 4; }.md-app .ring-bg{ stroke: var(--line-strong); }.md-app .ring-fg{ stroke: var(--lv3); stroke-linecap: round; stroke-dasharray: 94.25; stroke-dashoffset: 94.25; transition: stroke-dashoffset 0.5s; }.md-app main{ flex: 1; min-height: 0; position: relative; }.md-app .view{ position: absolute; inset: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; }.md-app .wrap{ max-width: 640px; min-height: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 14px 28px; }.md-app .tabs{ border-top: 1px solid var(--line); }.md-app .tabs-in{ display: grid; grid-template-columns: repeat(5, 1fr); }.md-app .tabs button{ position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 54px; padding: 6px 0 5px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 0.03em; }.md-app .tabs svg{ width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }.md-app .tabs button[aria-selected="true"]{ color: var(--brass); }.md-app .tabs button[aria-selected="true"]::before{ content: ""; position: absolute; top: -1px; left: 32%; right: 32%; height: 2px; border-radius: 2px; background: var(--brass); }.md-app /* ── Type ── */ h2{ font: 600 23px/1.15 var(--serif); color: var(--text); text-wrap: balance; }.md-app h3{ font: 600 17px/1.2 var(--serif); color: var(--text); }.md-app .eyebrow{ margin-bottom: 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }.md-app .numeral{ margin: 0; font-family: var(--serif); font-weight: 600; font-variant-numeric: lining-nums tabular-nums; line-height: 0.9; color: var(--brass); letter-spacing: -0.02em; }.md-app .lead{ font-size: 14px; color: var(--muted); }.md-app .fine{ font-size: 12.5px; line-height: 1.45; color: var(--muted); }.md-app .label{ font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }.md-app .note{ display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; font-size: 13px; color: var(--muted); }.md-app .cl{ font-family: var(--serif); font-weight: 700; white-space: nowrap; }.md-app .cl.r{ color: var(--red-lite); }.md-app .cl.b{ color: var(--text); }.md-app .suit.is{ width: 0.8em; height: 0.8em; vertical-align: -0.06em; margin-left: 0.04em; }.md-app .head-row{ display: flex; align-items: flex-end; justify-content: space-between; gap: 10px 12px; flex-wrap: wrap; }.md-app .tool-row{ display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }.md-app .field{ display: flex; flex-direction: column; gap: 8px; }.md-app /* ── Controls ── */ .seg{ display: inline-flex; gap: 2px; max-width: 100%; padding: 3px; border-radius: 999px; background: var(--felt-deep); border: 1px solid var(--line); }.md-app .seg button{ flex: 1 1 auto; min-height: 40px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; text-align: center; }.md-app .seg button[aria-pressed="true"]{ background: var(--felt-hi); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }.md-app .seg.full{ display: flex; width: 100%; }.md-app .seg.full button{ flex: 1 1 0; min-width: 0; padding: 0 6px; }.md-app .seg.sm button{ min-height: 38px; font-size: 12.5px; }.md-app .chips{ display: flex; flex-wrap: wrap; gap: 6px; }.md-app .chip{ display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line); color: var(--text); font-size: 13px; font-weight: 600; }.md-app .chip[aria-pressed="true"]{ border-color: var(--brass); background: var(--brass-dim); color: var(--brass); }.md-app .chip .suit{ width: 16px; height: 16px; }.md-app .chip.r .suit{ color: var(--red-lite); }.md-app .chip.icon-chip{ width: 42px; padding: 0; }.md-app .btn{ display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 12px; background: var(--felt-raised); border: 1px solid var(--line); color: var(--text); font-size: 15px; font-weight: 600; text-align: center; }.md-app .btn:active:not(:disabled){ transform: translateY(1px); }.md-app .btn:disabled{ opacity: 0.45; }.md-app .btn.primary{ background: var(--brass); border-color: transparent; color: var(--on-accent); }.md-app .btn.ghost{ background: transparent; }.md-app .btn.big{ width: 100%; min-height: 52px; font-size: 16px; }.md-app .btn.sm{ min-height: 40px; padding: 0 14px; font-size: 13px; }.md-app .btn.outline{ background: transparent; border-color: var(--brass); color: var(--brass); }.md-app .btn.icon{ width: 46px; padding: 0; }.md-app .btn.icon .ico{ width: 22px; height: 22px; }.md-app .btn.grow{ flex: 1; }.md-app .btn.got{ background: var(--good); border-color: transparent; color: var(--on-accent); }.md-app .btn.miss{ background: transparent; border-color: var(--bad-line); color: var(--bad); }.md-app .btn.danger{ align-self: flex-start; margin-top: 4px; background: transparent; border-color: var(--bad-line); color: var(--bad); }.md-app .btn.danger.armed{ background: var(--bad); border-color: transparent; color: var(--on-accent); }.md-app .link{ display: inline-flex; align-items: center; min-height: 40px; padding: 4px; color: var(--brass); font-size: 13px; font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }.md-app /* ── Mastery marks ── */ .lv{ display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }.md-app .lv0{ box-shadow: inset 0 0 0 1.5px var(--lv0); }.md-app .lv1{ background: var(--lv1); }.md-app .lv2{ background: var(--lv2); }.md-app .lv3{ background: var(--lv3); }.md-app .dots{ display: inline-flex; flex-wrap: wrap; gap: 3px; }.md-app .dots .lv{ width: 6px; height: 6px; }.md-app /* ── Playing card, .md-app full size ── */ .pc{ --cw: 140px; position: relative; display: block; width: var(--cw); max-width: 100%; aspect-ratio: 5 / 7; flex: none; border-radius: calc(var(--cw) * 0.075); background: linear-gradient(170deg, var(--ivory-hi), var(--ivory)); color: var(--ink); box-shadow: inset 0 0 0 1px var(--card-edge), 0 12px 26px -12px var(--shadow); -webkit-user-select: none; user-select: none; }.md-app .pc.red{ color: var(--pip-red); }.md-app .pc .ix{ position: absolute; top: calc(var(--cw) * 0.045); left: calc(var(--cw) * 0.035); width: calc(var(--cw) * 0.18); display: flex; flex-direction: column; align-items: center; gap: calc(var(--cw) * 0.012); }.md-app .pc .ix b{ font: 700 calc(var(--cw) * 0.165)/0.9 var(--serif); letter-spacing: -0.07em; }.md-app .pc .ix .suit{ width: calc(var(--cw) * 0.115); height: calc(var(--cw) * 0.115); }.md-app .pc .ix.br{ top: auto; left: auto; bottom: calc(var(--cw) * 0.045); right: calc(var(--cw) * 0.035); transform: rotate(180deg); }.md-app .pc .field{ position: absolute; inset: 10% 20%; }.md-app .pc .pip{ position: absolute; width: calc(var(--cw) * 0.17); height: calc(var(--cw) * 0.17); transform: translate(-50%, -50%); }.md-app .pc .pip.f{ transform: translate(-50%, -50%) rotate(180deg); }.md-app .pc .pip .suit{ display: block; width: 100%; height: 100%; }.md-app .pc .pip.ace{ width: calc(var(--cw) * 0.42); height: calc(var(--cw) * 0.42); }.md-app .pc .court{ position: absolute; inset: 1% -2%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4%; border: 1.5px solid currentColor; border-radius: calc(var(--cw) * 0.03); background: repeating-linear-gradient(135deg, transparent 0 5px, rgba(0, 0, 0, 0.035) 5px 6px); }.md-app .pc .court b{ font: 600 calc(var(--cw) * 0.38)/1 var(--serif); }.md-app .pc .court .suit{ width: calc(var(--cw) * 0.2); height: calc(var(--cw) * 0.2); }.md-app .pc.back{ background: var(--back); box-shadow: inset 0 0 0 calc(var(--cw) * 0.05) var(--ivory), inset 0 0 0 calc(var(--cw) * 0.058) rgba(0, 0, 0, 0.12), 0 12px 26px -12px var(--shadow); }.md-app .flip{ perspective: 1000px; border-radius: 10px; }.md-app .flip-inner{ display: grid; transform-style: preserve-3d; transition: transform 0.42s cubic-bezier(0.3, 0.7, 0.2, 1); }.md-app .flip-face{ grid-area: 1 / 1; backface-visibility: hidden; -webkit-backface-visibility: hidden; }.md-app .flip-face.rear{ transform: rotateY(180deg); }.md-app .flip.is-flipped .flip-inner{ transform: rotateY(180deg); }.md-app /* ── Mini card ── */ .mini{ position: relative; display: block; width: 36px; height: 50px; flex: none; border-radius: 5px; background: var(--ivory); color: var(--ink); box-shadow: inset 0 0 0 1px var(--card-edge), 0 2px 6px -2px var(--shadow); }.md-app .mini.red{ color: var(--pip-red); }.md-app .mini-face{ position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }.md-app .mini-face b{ font: 700 17px/1 var(--serif); letter-spacing: -0.07em; }.md-app .mini-face .suit{ width: 14px; height: 14px; }.md-app .mini-back{ position: absolute; inset: 0; display: none; border-radius: inherit; background: var(--back); box-shadow: inset 0 0 0 2px var(--ivory); }.md-app .covered .mini-face{ visibility: hidden; }.md-app .covered .mini-back{ display: block; }.md-app .covered.peek .mini-face{ visibility: visible; animation: pop 0.2s ease-out; }.md-app .covered.peek .mini-back{ display: none; }.md-app .mini.big{ width: 48px; height: 66px; }.md-app .mini.big .mini-face b{ font-size: 22px; }.md-app .mini.big .mini-face .suit{ width: 18px; height: 18px; }.md-app .mini.ghost{ background: transparent; box-shadow: inset 0 0 0 1px var(--line); }.md-app .dim{ opacity: 0.22; }.md-app /* ── Stack: quads ── */ .quad-head{ position: sticky; top: 0; z-index: 3; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 9px 0 8px; background: var(--felt); box-shadow: 0 10px 12px -12px var(--shadow); }.md-app .gh{ display: flex; align-items: center; justify-content: center; gap: 5px; font: 600 11px/1 var(--mono); color: var(--muted); white-space: nowrap; }.md-app .gh .suit{ width: 15px; height: 15px; color: var(--text); }.md-app .gh.r .suit{ color: var(--red-lite); }.md-app .quad-grid{ display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }.md-app .cell{ position: relative; display: flex; align-items: center; justify-content: space-between; gap: 4px; min-height: 64px; padding: 6px 6px 6px 8px; border-radius: 10px; background: var(--felt-raised); border: 1px solid var(--line); transition: opacity 0.2s; }.md-app .cell-num{ align-self: flex-start; margin-top: 2px; font: 600 20px/1 var(--serif); font-variant-numeric: lining-nums tabular-nums; color: var(--brass); }.md-app .cell .lv{ position: absolute; left: 9px; bottom: 9px; width: 7px; height: 7px; }.md-app /* ── Stack: sets as ribbon spreads ── */ .spread-list{ display: flex; flex-direction: column; gap: 18px; }.md-app .spread-head{ display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }.md-app .spread-head b{ font: 600 15px/1 var(--serif); }.md-app .spread-head .rg{ font: 600 12px/1 var(--mono); color: var(--muted); }.md-app .spread-head .link{ margin-left: auto; }.md-app .spread{ --scw: 54px; position: relative; height: 96px; }.md-app .sc{ position: absolute; top: 0; left: calc((100% - var(--scw)) * var(--i) / (var(--n) - 1)); width: var(--scw); height: 96px; display: block; transition: opacity 0.2s; }.md-app .sc-num{ display: block; height: 18px; padding-left: 2px; font: 600 11px/18px var(--mono); color: var(--brass); }.md-app .sc-card{ position: relative; display: block; width: var(--scw); height: 76px; border-radius: 6px; background: var(--ivory); color: var(--ink); box-shadow: inset 0 0 0 1px var(--card-edge), -3px 0 6px -2px var(--shadow), 0 4px 10px -6px var(--shadow); }.md-app .sc-card.red{ color: var(--pip-red); }.md-app .sc-face{ position: absolute; inset: 0; }.md-app .sc-ix{ position: absolute; top: 4px; left: 3px; width: 18px; display: flex; flex-direction: column; align-items: center; gap: 2px; }.md-app .sc-ix b{ font: 700 15px/1 var(--serif); letter-spacing: -0.08em; }.md-app .sc-ix .suit{ width: 11px; height: 11px; }.md-app .sc-pip{ position: absolute; right: 7px; bottom: 9px; width: 22px; height: 22px; }.md-app .sc-back{ position: absolute; inset: 0; display: none; border-radius: inherit; background: var(--back); box-shadow: inset 0 0 0 2px var(--ivory); }.md-app .sc.covered .sc-face{ visibility: hidden; }.md-app .sc.covered .sc-back{ display: block; }.md-app .sc.covered.peek .sc-face{ visibility: visible; animation: pop 0.2s ease-out; }.md-app .sc.covered.peek .sc-back{ display: none; }.md-app .patterns{ border: 1px solid var(--line); border-radius: 16px; background: var(--felt-deep); }.md-app .patterns summary{ display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 50px; padding: 12px 16px; list-style: none; cursor: pointer; font: 600 16px/1.2 var(--serif); }.md-app .patterns summary::-webkit-details-marker{ display: none; }.md-app .patterns summary::after{ content: "+"; font: 400 24px/1 var(--sans); color: var(--brass); }.md-app .patterns[open] summary::after{ content: "\2212"; }.md-app .patterns ul{ display: grid; gap: 10px; padding: 0 16px 16px 34px; font-size: 14px; line-height: 1.5; }.md-app .patterns li::marker{ color: var(--brass); }.md-app /* Memorized stacks: all four cards of each value, .md-app in stack order */ .vmap{ display: flex; flex-direction: column; gap: 5px; padding: 0 16px 16px; }.md-app .vmap .fine{ margin-bottom: 4px; }.md-app .vrow{ display: grid; grid-template-columns: 24px repeat(4, minmax(0, 1fr)); align-items: center; gap: 5px; }.md-app .vr{ font: 700 15px/1 var(--serif); color: var(--text); text-align: center; }.md-app .vc{ display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 38px; border-radius: 9px; background: var(--felt-raised); border: 1px solid var(--line); font: 600 13px/1 var(--mono); color: var(--brass); }.md-app .vc .suit{ width: 13px; height: 13px; }.md-app .vc.r .suit{ color: var(--red-lite); }.md-app .vc.b .suit{ color: var(--text); }.md-app .land-switch{ display: none; }.md-app .nw{ white-space: nowrap; }.md-app /* ── Learn ── */ .set-picker{ display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }.md-app .set-chip{ display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 6px; min-height: 50px; padding: 8px 6px 7px; border-radius: 12px; border: 1px solid var(--line); background: var(--felt-raised); text-align: center; }.md-app .set-chip .rg{ font: 600 15px/1 var(--serif); font-variant-numeric: lining-nums tabular-nums; color: var(--text); white-space: nowrap; }.md-app .sbar{ display: flex; height: 4px; border-radius: 4px; overflow: hidden; background: var(--line); }.md-app .sbar i{ display: block; height: 100%; }.md-app .lvf1{ background: var(--lv1); }.md-app .lvf2{ background: var(--lv2); }.md-app .lvf3{ background: var(--lv3); }.md-app .lvf0{ background: var(--line-strong); }.md-app .set-chip[aria-selected="true"]{ border-color: var(--brass); background: var(--felt-hi); box-shadow: inset 0 0 0 1px var(--brass); }.md-app .set-chip[aria-selected="true"] .rg{ color: var(--brass); }.md-app .learn-body{ display: flex; flex-direction: column; gap: 12px; flex: 1; }.md-app .opts{ display: flex; flex-wrap: wrap; gap: 8px; }.md-app .study{ display: flex; flex-direction: column; gap: 12px; }.md-app .study-row{ display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 4px 0; touch-action: pan-y; }.md-app .study-num{ display: flex; flex-direction: column; align-items: flex-start; }.md-app .study-num .numeral{ font-size: clamp(64px, 21vw, 100px); }.md-app .study-num.is-hidden .numeral{ color: var(--muted); }.md-app .study-num.is-hidden{ padding: 8px 12px; border-radius: 14px; border: 1.5px dashed var(--line-strong); }.md-app .study-num .of{ margin-top: 10px; font-size: 13px; color: var(--muted); }.md-app .study .pc{ --cw: clamp(124px, 38vw, 170px); }.md-app .why{ font-size: 14px; line-height: 1.5; color: var(--text); }.md-app .why.muted{ color: var(--muted); }.md-app .study-ctl{ display: flex; gap: 8px; }.md-app .strip{ display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }.md-app .strip.n12{ grid-template-columns: repeat(6, minmax(0, 1fr)); }.md-app .scell{ position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0 7px; border-radius: 10px; border: 1px solid var(--line); background: var(--felt-raised); }.md-app .scell .n{ font: 600 12px/1 var(--mono); color: var(--brass); }.md-app .scell .mini{ width: 30px; height: 42px; }.md-app .scell .mini-face b{ font-size: 15px; }.md-app .scell .mini-face .suit{ width: 12px; height: 12px; }.md-app .scell .lv{ position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; }.md-app .scell.on{ border-color: var(--brass); background: var(--felt-hi); box-shadow: inset 0 0 0 1px var(--brass); }.md-app .flash{ display: flex; flex-direction: column; gap: 10px; }.md-app .fl-meta{ display: flex; justify-content: space-between; gap: 10px; font: 600 12.5px/1 var(--mono); color: var(--muted); }.md-app .fl-meta .ok{ color: var(--good); }.md-app .fl-meta .bad{ color: var(--bad); }.md-app .fl-card{ display: block; perspective: 1100px; border-radius: 18px; outline-offset: 4px; }.md-app .fl-inner{ display: grid; transform-style: preserve-3d; transition: transform 0.45s cubic-bezier(0.3, 0.7, 0.2, 1); }.md-app .fl-card.is-flipped .fl-inner{ transform: rotateY(180deg); }.md-app .fl-face{ grid-area: 1 / 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 268px; padding: 18px; border-radius: 18px; background: var(--felt-deep); border: 1px solid var(--line-strong); backface-visibility: hidden; -webkit-backface-visibility: hidden; }.md-app .fl-back{ transform: rotateY(180deg); background: var(--felt-raised); }.md-app .fl-face .numeral{ font-size: 96px; }.md-app .fl-face .pc{ --cw: 122px; }.md-app .fl-q{ font-size: 14px; color: var(--muted); }.md-app .fl-a{ font: 600 16px/1.25 var(--serif); color: var(--text); text-align: center; }.md-app .fl-grade{ display: grid; grid-template-columns: 1fr 1fr; gap: 8px; min-height: 52px; }.md-app .fl-grade .btn{ min-height: 52px; }.md-app .fl-tip{ grid-column: 1 / -1; align-self: center; font-size: 13px; color: var(--muted); text-align: center; }.md-app .lq-intro{ display: flex; flex-direction: column; gap: 16px; }.md-app /* ── Quiz ── */ .qz{ --qcw: clamp(86px, 27vw, 112px); display: flex; flex-direction: column; gap: 10px; flex: 1; }.md-app .qz-top{ display: flex; align-items: center; gap: 10px; font: 600 13px/1 var(--mono); color: var(--muted); }.md-app .qz-x{ display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: none; border-radius: 50%; border: 1px solid var(--line); color: var(--text); }.md-app .qz-bar{ flex: 1; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }.md-app .qz-bar i{ display: block; height: 100%; background: var(--brass); transition: width 0.3s; }.md-app .qz-score{ display: inline-flex; align-items: center; gap: 3px; color: var(--good); }.md-app .qz-tag{ flex: none; padding: 5px 8px; border-radius: 8px; background: var(--felt-raised); font: 600 12px/1 var(--serif); color: var(--brass); }.md-app .wrap.focus > .set-picker, .md-app .wrap.focus > .seg{ display: none; }.md-app .qz-prompt{ flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 12px; min-height: 196px; padding: 14px; border-radius: 18px; background: var(--felt-deep); border: 1px solid var(--line); transition: border-color 0.2s; }.md-app .qz-prompt.is-ok{ border-color: var(--good); }.md-app .qz-prompt.is-bad{ border-color: var(--bad); }.md-app .qz-ask{ font-size: 14px; color: var(--muted); text-align: center; }.md-app .qz-eq{ display: flex; align-items: center; justify-content: center; gap: 14px; }.md-app .qz-arrow{ font-size: 22px; color: var(--muted); }.md-app .qz-subj{ display: flex; justify-content: center; min-width: 0; }.md-app .qz-subj .numeral{ font-size: clamp(64px, 21vw, 96px); }.md-app .qz .pc{ --cw: var(--qcw); }.md-app .ans{ display: flex; align-items: center; justify-content: center; }.md-app .ans-card{ width: var(--qcw); aspect-ratio: 5 / 7; border-radius: 9px; border: 1.5px dashed var(--line-strong); color: var(--text); }.md-app .ans-card .ghost{ display: inline-flex; align-items: center; gap: 2px; font: 700 34px/1 var(--serif); letter-spacing: -0.05em; }.md-app .ans-card .ghost .suit{ width: 28px; height: 28px; }.md-app .ans-card.r .ghost{ color: var(--red-lite); }.md-app .ans .q, .md-app .ans .ghost i{ font-style: normal; color: var(--muted); opacity: 0.6; }.md-app .ans-pos{ min-width: 96px; height: calc(var(--qcw) * 1.4); border-bottom: 2px dashed var(--line-strong); }.md-app .ans-pos .numeral{ font-size: clamp(56px, 17vw, 80px); color: var(--text); }.md-app .ans.done .pc{ animation: pop 0.22s ease-out; }.md-app .ans.done.ok .pc{ box-shadow: 0 0 0 3px var(--good), 0 12px 26px -12px var(--shadow); }.md-app .ans.done.bad .pc{ box-shadow: 0 0 0 3px var(--brass), 0 12px 26px -12px var(--shadow); }.md-app .ans-pos.done{ border-bottom-style: solid; }.md-app .ans-pos.done.ok{ border-color: var(--good); }.md-app .ans-pos.done.ok .numeral{ color: var(--good); }.md-app .ans-pos.done.bad{ border-color: var(--brass); }.md-app .ans-pos.done.bad .numeral{ color: var(--brass); }.md-app .qz-hint{ font-size: 13.5px; line-height: 1.45; color: var(--text); text-align: center; }.md-app .qz-hint b{ margin-right: 4px; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--brass); }.md-app .qz-dock{ display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; }.md-app .qz-tools{ display: flex; gap: 8px; }.md-app .qz-tools .btn{ flex: 1; min-height: 38px; font-size: 13px; }.md-app .pad{ display: flex; flex-direction: column; gap: 6px; }.md-app .pad-row{ display: flex; justify-content: center; gap: 6px; }.md-app .key{ flex: 0 0 calc((100% - 36px) / 7); min-width: 0; height: 46px; border-radius: 10px; background: var(--felt-raised); border: 1px solid var(--line); color: var(--text); font: 600 19px/1 var(--serif); font-variant-numeric: lining-nums; text-align: center; }.md-app .key:active:not(:disabled){ background: var(--felt-hi); }.md-app .key[aria-pressed="true"]{ background: var(--brass); border-color: transparent; color: var(--on-accent); }.md-app .suit-row{ display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }.md-app .skey{ display: flex; align-items: center; justify-content: center; height: 52px; border-radius: 12px; background: var(--ivory); color: var(--ink); box-shadow: inset 0 0 0 1px var(--card-edge), 0 2px 0 var(--ivory-shade); }.md-app .skey.r{ color: var(--pip-red); }.md-app .skey .suit{ width: 26px; height: 26px; }.md-app .skey[aria-pressed="true"]{ box-shadow: 0 0 0 3px var(--brass); }.md-app .skey:active{ transform: translateY(1px); }.md-app .numpad{ display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }.md-app .numpad .key{ flex: none; width: auto; height: 48px; font-size: 22px; }.md-app .numpad .key.fn{ display: flex; align-items: center; justify-content: center; color: var(--muted); }.md-app .numpad .key.fn .ico{ width: 24px; height: 24px; }.md-app .numpad .key.go{ background: var(--brass); border-color: transparent; color: var(--on-accent); }.md-app .numpad .key.go:disabled{ opacity: 0.35; }.md-app .choices{ display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }.md-app .choice{ display: flex; align-items: center; justify-content: center; min-height: 66px; border-radius: 14px; background: var(--felt-raised); border: 1px solid var(--line); }.md-app .choice .numeral{ font-size: 34px; color: var(--text); }.md-app .wide{ display: inline-flex; align-items: center; gap: 4px; padding: 7px 14px; border-radius: 8px; background: var(--ivory); color: var(--ink); box-shadow: inset 0 0 0 1px var(--card-edge); font: 700 25px/1 var(--serif); letter-spacing: -0.05em; }.md-app .wide.red{ color: var(--pip-red); }.md-app .wide .suit{ width: 21px; height: 21px; }.md-app .fb{ position: relative; overflow: hidden; display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--felt-raised); border: 1px solid var(--line); }.md-app .fb-mark{ display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex: none; border-radius: 50%; color: var(--on-accent); }.md-app .fb-mark .ico{ width: 18px; height: 18px; stroke-width: 2.6; }.md-app .fb.ok .fb-mark{ background: var(--good); }.md-app .fb.bad .fb-mark{ background: var(--bad); }.md-app .fb-title{ font-size: 15px; font-weight: 700; }.md-app .fb-why{ margin-top: 3px; font-size: 13.5px; line-height: 1.45; color: var(--muted); }.md-app .fb.auto::after{ content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 3px; background: var(--good); transform-origin: left; animation: drain 0.7s linear forwards; }.md-app .results{ display: flex; flex-direction: column; gap: 14px; padding-top: 4px; }.md-app .score{ display: flex; align-items: baseline; gap: 10px; }.md-app .score .numeral{ font-size: 76px; }.md-app .score .of{ font: 600 22px/1 var(--serif); color: var(--muted); }.md-app .score-sub{ margin-top: -4px; font-size: 14px; color: var(--muted); }.md-app .missed-grid{ display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 6px; }.md-app .res-actions{ display: flex; flex-direction: column; gap: 8px; }.md-app .res-actions .btn{ width: 100%; min-height: 50px; }.md-app /* ── Order ── */ .order{ display: flex; flex-direction: column; gap: 12px; }.md-app .or-stats{ display: flex; align-items: center; justify-content: space-between; gap: 10px; font: 600 13px/1 var(--mono); color: var(--muted); }.md-app .or-stats .numeral{ margin-left: 4px; font-size: 28px; vertical-align: -4px; }.md-app .or-slots, .md-app .or-pool{ display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }.md-app .or-slots.n12, .md-app .or-pool.n12{ grid-template-columns: repeat(6, minmax(0, 1fr)); }.md-app .or-slot{ display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0; border-radius: 10px; border: 1px dashed var(--line-strong); }.md-app .or-slot .n{ font: 600 11px/1 var(--mono); color: var(--muted); }.md-app .or-slot .mini{ width: 30px; height: 42px; }.md-app .or-slot .mini-face b{ font-size: 15px; }.md-app .or-slot .mini-face .suit{ width: 12px; height: 12px; }.md-app .or-slot.cur{ border-style: solid; border-color: var(--brass); }.md-app .or-slot.cur .n{ color: var(--brass); }.md-app .or-slot.filled{ border-style: solid; border-color: var(--line); background: var(--felt-raised); }.md-app .or-slot.filled .mini{ animation: pop 0.2s ease-out; }.md-app .or-tile{ display: flex; justify-content: center; padding: 4px 0; border-radius: 10px; transition: opacity 0.2s, transform 0.2s; }.md-app .or-tile.used{ opacity: 0; transform: scale(0.8); pointer-events: none; }.md-app .or-tile.hintme .mini{ box-shadow: 0 0 0 3px var(--brass); }.md-app .or-pool.n12 .mini.big{ width: 44px; height: 61px; }.md-app .or-foot{ display: flex; align-items: center; justify-content: space-between; gap: 10px; }.md-app .shake{ animation: shake 0.35s; }.md-app /* ── Quiz setup ── */ .range-row{ display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }.md-app .range-row label{ font-size: 13px; color: var(--muted); }.md-app .range-row select{ min-width: 74px; min-height: 42px; padding: 0 10px; border-radius: 10px; background: var(--felt-raised); border: 1px solid var(--line-strong); color: var(--text); font: 600 15px/1 var(--mono); }.md-app .recent{ display: flex; flex-direction: column; padding: 0; list-style: none; }.md-app .recent li{ display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px; }.md-app .recent li:first-child{ border-top: 0; }.md-app .recent small{ display: block; font-size: 11.5px; color: var(--muted); }.md-app .recent b{ font: 600 15px/1 var(--mono); color: var(--brass); white-space: nowrap; }.md-app /* ── Progress ── */ .panel{ display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: 16px; background: var(--felt-deep); border: 1px solid var(--line); }.md-app .panel-head{ display: flex; align-items: baseline; justify-content: space-between; gap: 6px 10px; flex-wrap: wrap; }.md-app .lvbar{ display: flex; gap: 2px; height: 12px; border-radius: 6px; overflow: hidden; }.md-app .lvbar i{ display: block; min-width: 4px; }.md-app .legend{ display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }.md-app .legend li{ display: inline-flex; align-items: center; gap: 6px; }.md-app .legend b{ color: var(--text); font-family: var(--mono); }.md-app .heat{ display: flex; flex-direction: column; gap: 10px; }.md-app .hrow{ display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 4px; align-items: stretch; width: 100%; max-width: 100%; min-width: 0; }.md-app .hs{ display: flex; justify-content: flex-start; align-items: center; grid-column: 1 / -1; min-height: 20px; padding: 2px 0 0; }.md-app .hs .suit{ width: 16px; height: 16px; }.md-app .hs.r{ color: var(--red-lite); }.md-app .hs.b{ color: var(--text); }.md-app .hc{ display: flex; align-items: center; justify-content: center; height: 32px; border-radius: 5px; background: var(--felt-hi); color: var(--muted); font: 700 11px/1 var(--serif); letter-spacing: -0.05em; }.md-app .hc.lvb1{ background: var(--lv1); color: var(--on-accent); }.md-app .hc.lvb2{ background: var(--lv2); color: var(--on-accent); }.md-app .hc.lvb3{ background: var(--lv3); color: var(--on-accent); }.md-app .setrows{ display: flex; flex-direction: column; }.md-app .setrow{ display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 50px; padding: 9px 0; border-top: 1px solid var(--line); }.md-app .setrow:first-child{ border-top: 0; }.md-app .sr-name b{ display: block; font: 600 15px/1.1 var(--serif); color: var(--text); }.md-app .sr-name small{ font-size: 11px; color: var(--muted); }.md-app .sr-mid{ display: flex; flex-direction: column; gap: 5px; min-width: 0; }.md-app .sr-mid small{ font-size: 11px; color: var(--muted); }.md-app .sr-dots{ display: flex; flex-wrap: nowrap; gap: 3px; }.md-app .sr-dots .lv{ width: 7px; height: 7px; }.md-app .sr-meta{ font: 600 14px/1 var(--mono); color: var(--text); text-align: right; }.md-app .stat-grid{ display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }.md-app .stat-grid div{ padding: 10px 12px; border-radius: 12px; background: var(--felt-raised); }.md-app .stat-grid dt{ font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }.md-app .stat-grid dd{ margin-top: 5px; font: 600 24px/1 var(--serif); font-variant-numeric: lining-nums tabular-nums; color: var(--text); }.md-app .setting{ display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 4px 0; }.md-app .setting .st{ font-weight: 600; }.md-app .switch{ position: relative; width: 52px; height: 32px; flex: none; border-radius: 999px; background: var(--felt-hi); border: 1px solid var(--line-strong); transition: background 0.2s, border-color 0.2s; }.md-app .switch::after{ content: ""; position: absolute; inset: -9px -6px; }.md-app .switch i{ position: absolute; top: 4px; left: 4px; width: 22px; height: 22px; border-radius: 50%; background: var(--muted); transition: transform 0.2s, background 0.2s; }.md-app .switch[aria-checked="true"]{ background: var(--brass-dim); border-color: var(--brass); }.md-app .switch[aria-checked="true"] i{ transform: translateX(20px); background: var(--brass); }.md-app /* Theme picker: each swatch is a little table with a card and the accent color */ .skins{ display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }.md-app .skin{ display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 78px; padding: 7px 2px 6px; border-radius: 12px; border: 1px solid transparent; font-size: 11.5px; font-weight: 600; color: var(--muted); text-align: center; }.md-app .skin[aria-pressed="true"]{ border-color: var(--brass); background: var(--brass-dim); color: var(--text); }.md-app .sw{ position: relative; display: block; width: 44px; height: 44px; border-radius: 12px; background: var(--sw-bg); box-shadow: inset 0 0 0 1px var(--line-strong); overflow: hidden; }.md-app .sw::before{ content: ""; position: absolute; left: 10px; top: 8px; width: 17px; height: 24px; border-radius: 3px; background: var(--sw-card); box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(0, 0, 0, 0.12); transform: rotate(-9deg); }.md-app .sw::after{ content: ""; position: absolute; right: 7px; bottom: 7px; width: 11px; height: 11px; border-radius: 50%; background: var(--sw-acc); }.md-app /* ── Detail sheet & toast ── */ .sheet-wrap{ position: fixed; inset: 0; z-index: 40; }.md-app .scrim{ position: absolute; inset: 0; background: var(--scrim); opacity: 0; transition: opacity 0.2s; }.md-app .sheet{ position: absolute; left: 0; right: 0; bottom: 0; max-width: 640px; max-height: 92%; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; overscroll-behavior: contain; padding-top: 8px; padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); border: 1px solid var(--line-strong); border-bottom: 0; border-radius: 20px 20px 0 0; background: var(--felt-raised); transform: translateY(104%); transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1); outline: none; }.md-app .sheet-wrap.open .scrim{ opacity: 1; }.md-app .sheet-wrap.open .sheet{ transform: none; }.md-app .grab-zone{ flex: none; display: flex; justify-content: center; margin: -8px 0 -8px; padding: 12px 0 12px; touch-action: none; cursor: grab; }.md-app .grab{ width: 40px; height: 4px; border-radius: 4px; background: var(--line-strong); }.md-app .sheet-top{ display: flex; align-items: center; gap: 18px; touch-action: pan-x; }.md-app .sheet-top .pc{ --cw: 118px; }.md-app .sheet-id{ min-width: 0; }.md-app .sheet-id .numeral{ font-size: 66px; }.md-app .sheet-name{ margin-top: 8px; font: 600 16px/1.2 var(--serif); }.md-app .lvl-chip{ display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 12px; font-weight: 600; }.md-app .facts{ display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }.md-app .facts div{ padding: 9px 11px; border-radius: 12px; background: var(--felt-deep); }.md-app .facts dt{ font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }.md-app .facts dd{ margin-top: 3px; }.md-app .facts button{ display: flex; align-items: center; gap: 7px; width: 100%; min-height: 40px; padding: 2px 0; font-size: 15px; font-weight: 600; color: var(--text); }.md-app .facts .pn{ font-family: var(--mono); color: var(--brass); }.md-app .facts .trio{ grid-column: 1 / -1; }.md-app .facts .trio dd{ display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }.md-app /* Stack picker (shares the bottom sheet) */ .stack-list{ display: flex; flex-direction: column; gap: 8px; }.md-app .stack-opt{ display: flex; flex-direction: column; gap: 7px; width: 100%; padding: 12px 14px 13px; border-radius: 14px; border: 1px solid var(--line); background: var(--felt-deep); text-align: left; }.md-app .stack-opt:active{ transform: translateY(1px); }.md-app .stack-opt[aria-pressed="true"]{ border-color: var(--brass); background: var(--felt-hi); box-shadow: inset 0 0 0 1px var(--brass); }.md-app .so-top{ display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }.md-app .so-name{ font: 600 17px/1.2 var(--serif); color: var(--text); }.md-app .stack-opt[aria-pressed="true"] .so-name{ color: var(--brass); }.md-app .so-count{ font: 600 14px/1 var(--mono); color: var(--text); white-space: nowrap; }.md-app .so-count small{ font-weight: 500; color: var(--muted); }.md-app .so-sub{ font-size: 13px; line-height: 1.4; color: var(--muted); }.md-app .record{ font-size: 13px; color: var(--muted); }.md-app .sheet-nav{ display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 8px; }.md-app .toast{ position: fixed; left: 50%; bottom: calc(78px + env(safe-area-inset-bottom, 0px)); z-index: 50; width: max-content; max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 999px; background: var(--toast); color: var(--toast-ink); font-size: 14px; font-weight: 600; box-shadow: 0 10px 30px var(--shadow); opacity: 0; transform: translate(-50%, 16px); transition: opacity 0.2s, transform 0.2s; pointer-events: none; }.md-app .toast.show{ opacity: 1; transform: translate(-50%, 0); }.md-app /* ── Guidance: next up, .md-app daily review, .md-app milestones ── */ .nextup{ display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--felt-raised); border: 1px solid var(--line-strong); }.md-app .nextup .eyebrow{ margin-bottom: 2px; color: var(--brass); }.md-app .nextup p:not(.eyebrow){ font-size: 14px; }.md-app .nextup b{ font-family: var(--serif); }.md-app .nextup .btn{ flex: none; }.md-app .panel.review{ border-color: var(--brass); background: linear-gradient(180deg, var(--brass-dim), transparent 75%), var(--felt-deep); }.md-app .sub-h{ margin-top: 4px; }.md-app .milestone{ display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--good); background: var(--felt-raised); font-size: 14px; color: var(--good); }.md-app .milestone .ico{ width: 20px; height: 20px; }.md-app .milestone span{ color: var(--text); }.md-app @keyframes pop{ from { transform: scale(0.86); opacity: 0.3; } to { transform: none; opacity: 1; } }.md-app @keyframes shake{ 0%, 100% { transform: none; } 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }.md-app @keyframes drain{ from { transform: scaleX(0); } to { transform: scaleX(1); } }.md-app @media (max-height: 720px){
  .qz { --qcw: 82px; }
  .qz-subj .numeral { font-size: 64px; }
  .ans-pos .numeral { font-size: 56px; }
  .qz-prompt { min-height: 160px; padding: 10px; gap: 8px; }
  .key { height: 42px; }
  .skey { height: 46px; }
  .numpad .key { height: 44px; }
  .fl-face { min-height: 220px; }
  .fl-face .pc { --cw: 100px; }
  .fl-face .numeral { font-size: 80px; }
  .wrap { gap: 12px; padding-block: 12px 22px; }
}.md-app @media (max-height: 640px){
  .qz-prompt { min-height: 136px; }
  .key { height: 40px; }
  .skey { height: 44px; }
  .numpad .key { height: 42px; }
  .qz-tools .btn { min-height: 36px; }
}.md-app /* Phones held sideways: drop the brand bar, .md-app slim the tabs, .md-app put question and pad side by side */ @media (orientation: landscape) and (max-height: 500px){
  .top { display: none; }
  .land-switch { display: inline-flex; }
  .tabs button { flex-direction: row; gap: 8px; min-height: 44px; padding: 4px 0; font-size: 12px; }
  .tabs svg { width: 20px; height: 20px; }
  .wrap { gap: 10px; padding-block: 10px 16px; }
  .qz { --qcw: 72px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 8px 14px; }
  .qz-top { grid-column: 1 / -1; }
  .qz-prompt { min-height: 0; padding: 10px; gap: 6px; }
  .qz-subj .numeral { font-size: 56px; }
  .ans-pos .numeral { font-size: 48px; }
  .qz-hint { font-size: 12.5px; }
  .qz-dock { justify-content: center; }
  .qz-tools .btn { min-height: 36px; }
  .key, .numpad .key { height: 38px; }
  .skey { height: 40px; }
  .choice { min-height: 52px; }
  .fb { padding: 10px 12px; }
  .fb-why { font-size: 12.5px; }
  .flash { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: center; gap: 10px 14px; }
  .fl-meta { grid-column: 1 / -1; }
  .fl-face { min-height: 186px; padding: 12px; }
  .fl-face .pc { --cw: 86px; }
  .fl-face .numeral { font-size: 64px; }
  .fl-grade { grid-template-columns: 1fr; }
  .study .pc { --cw: 112px; }
  .score .numeral { font-size: 56px; }
  .or-slots, .or-pool { grid-template-columns: repeat(10, minmax(0, 1fr)); }
  .or-slots.n12, .or-pool.n12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .or-slot { padding: 4px 0; }
  .or-slot .mini { width: 26px; height: 36px; }
  .or-pool .mini.big, .or-pool.n12 .mini.big { width: 40px; height: 56px; }
  .or-pool .mini.big .mini-face b { font-size: 19px; }
}.md-app @media (prefers-reduced-motion: reduce){
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

.md-app .mark-fill{fill:var(--felt-deep)}

/* Site frame: keep the felt mat inside a viewport-tall shell; do not lock html/body. */
.md-app {
  --serif: Fraunces, "Iowan Old Style", Palatino, "Book Antiqua", ui-serif, Georgia, serif;
  --sans: Outfit, system-ui, -apple-system, "Segoe UI", sans-serif;
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 32rem;
  height: calc(100svh - 4.6rem);
  max-height: none;
  overflow: hidden;
  color: var(--text);
  font: 15px/1.45 var(--sans);
  background-color: var(--felt);
  background-image: radial-gradient(140% 60% at 50% 0%, var(--glow), transparent 65%), var(--grain);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
.md-app, .md-app * { box-sizing: border-box; }
.md-app #main { flex: 1; min-height: 0; position: relative; }
.md-app .mpill, .md-app .seg button, .md-app .seg.sm button, .md-app .chip,
.md-app .chip.icon-chip, .md-app .btn.sm, .md-app .link, .md-app .vc,
.md-app .qz-tools .btn, .md-app .qz-x, .md-app .facts button,
.md-app .range-row select {
  min-height: 44px;
  min-width: 44px;
}
.md-app .chip.icon-chip { width: 44px; padding: 0; }
.md-app .qz-x { width: 44px; height: 44px; }
.md-app .set-picker { overflow: hidden; }
.md-app .set-chip .rg { overflow: hidden; text-overflow: ellipsis; }
.md-app .chips { max-width: 100%; }
.md-app .btn:hover { background-image: none; }
.md-app .btn-ghost { background-image: none; }
.md-app .pip[data-x="12"]{left:12%}
.md-app .pip[data-x="22"]{left:22%}
.md-app .pip[data-x="25"]{left:25%}
.md-app .pip[data-x="31"]{left:31%}
.md-app .pip[data-x="37"]{left:37%}
.md-app .pip[data-x="50"]{left:50%}
.md-app .pip[data-x="63"]{left:63%}
.md-app .pip[data-x="69"]{left:69%}
.md-app .pip[data-x="75"]{left:75%}
.md-app .pip[data-x="78"]{left:78%}
.md-app .pip[data-x="88"]{left:88%}
.md-app .pip[data-y="12"]{top:12%}
.md-app .pip[data-y="25"]{top:25%}
.md-app .pip[data-y="31"]{top:31%}
.md-app .pip[data-y="37"]{top:37%}
.md-app .pip[data-y="50"]{top:50%}
.md-app .pip[data-y="63"]{top:63%}
.md-app .pip[data-y="69"]{top:69%}
.md-app .pip[data-y="75"]{top:75%}
.md-app .pip[data-y="88"]{top:88%}
.md-app .spread[data-n="1"]{--n:1}
.md-app .spread[data-n="2"]{--n:2}
.md-app .spread[data-n="3"]{--n:3}
.md-app .spread[data-n="4"]{--n:4}
.md-app .spread[data-n="5"]{--n:5}
.md-app .spread[data-n="6"]{--n:6}
.md-app .spread[data-n="7"]{--n:7}
.md-app .spread[data-n="8"]{--n:8}
.md-app .spread[data-n="9"]{--n:9}
.md-app .spread[data-n="10"]{--n:10}
.md-app .spread[data-n="11"]{--n:11}
.md-app .spread[data-n="12"]{--n:12}
.md-app .spread[data-n="13"]{--n:13}
.md-app .sc[data-i="0"]{--i:0}
.md-app .sc[data-i="1"]{--i:1}
.md-app .sc[data-i="2"]{--i:2}
.md-app .sc[data-i="3"]{--i:3}
.md-app .sc[data-i="4"]{--i:4}
.md-app .sc[data-i="5"]{--i:5}
.md-app .sc[data-i="6"]{--i:6}
.md-app .sc[data-i="7"]{--i:7}
.md-app .sc[data-i="8"]{--i:8}
.md-app .sc[data-i="9"]{--i:9}
.md-app .sc[data-i="10"]{--i:10}
.md-app .sc[data-i="11"]{--i:11}
.md-app .sc[data-i="12"]{--i:12}
.md-app .sw[data-skin-sw="felt"]{--sw-bg:#0F2D28;--sw-acc:#DDB872;--sw-card:#F6F0E2}
.md-app .sw[data-skin-sw="midnight"]{--sw-bg:#102037;--sw-acc:#E2BF7A;--sw-card:#F6F0E2}
.md-app .sw[data-skin-sw="bordeaux"]{--sw-bg:#2E1219;--sw-acc:#E5C07A;--sw-card:#F6F0E2}
.md-app .sw[data-skin-sw="noir"]{--sw-bg:#111113;--sw-acc:#DDB872;--sw-card:#F6F0E2}
.md-app .sw[data-skin-sw="daylight"]{--sw-bg:#F1EADC;--sw-acc:#7A4F10;--sw-card:#FFFFFF}
.md-app i[data-pct="0"]{width:0%}
.md-app i[data-pct="1"]{width:1%}
.md-app i[data-pct="2"]{width:2%}
.md-app i[data-pct="3"]{width:3%}
.md-app i[data-pct="4"]{width:4%}
.md-app i[data-pct="5"]{width:5%}
.md-app i[data-pct="6"]{width:6%}
.md-app i[data-pct="7"]{width:7%}
.md-app i[data-pct="8"]{width:8%}
.md-app i[data-pct="9"]{width:9%}
.md-app i[data-pct="10"]{width:10%}
.md-app i[data-pct="11"]{width:11%}
.md-app i[data-pct="12"]{width:12%}
.md-app i[data-pct="13"]{width:13%}
.md-app i[data-pct="14"]{width:14%}
.md-app i[data-pct="15"]{width:15%}
.md-app i[data-pct="16"]{width:16%}
.md-app i[data-pct="17"]{width:17%}
.md-app i[data-pct="18"]{width:18%}
.md-app i[data-pct="19"]{width:19%}
.md-app i[data-pct="20"]{width:20%}
.md-app i[data-pct="21"]{width:21%}
.md-app i[data-pct="22"]{width:22%}
.md-app i[data-pct="23"]{width:23%}
.md-app i[data-pct="24"]{width:24%}
.md-app i[data-pct="25"]{width:25%}
.md-app i[data-pct="26"]{width:26%}
.md-app i[data-pct="27"]{width:27%}
.md-app i[data-pct="28"]{width:28%}
.md-app i[data-pct="29"]{width:29%}
.md-app i[data-pct="30"]{width:30%}
.md-app i[data-pct="31"]{width:31%}
.md-app i[data-pct="32"]{width:32%}
.md-app i[data-pct="33"]{width:33%}
.md-app i[data-pct="34"]{width:34%}
.md-app i[data-pct="35"]{width:35%}
.md-app i[data-pct="36"]{width:36%}
.md-app i[data-pct="37"]{width:37%}
.md-app i[data-pct="38"]{width:38%}
.md-app i[data-pct="39"]{width:39%}
.md-app i[data-pct="40"]{width:40%}
.md-app i[data-pct="41"]{width:41%}
.md-app i[data-pct="42"]{width:42%}
.md-app i[data-pct="43"]{width:43%}
.md-app i[data-pct="44"]{width:44%}
.md-app i[data-pct="45"]{width:45%}
.md-app i[data-pct="46"]{width:46%}
.md-app i[data-pct="47"]{width:47%}
.md-app i[data-pct="48"]{width:48%}
.md-app i[data-pct="49"]{width:49%}
.md-app i[data-pct="50"]{width:50%}
.md-app i[data-pct="51"]{width:51%}
.md-app i[data-pct="52"]{width:52%}
.md-app i[data-pct="53"]{width:53%}
.md-app i[data-pct="54"]{width:54%}
.md-app i[data-pct="55"]{width:55%}
.md-app i[data-pct="56"]{width:56%}
.md-app i[data-pct="57"]{width:57%}
.md-app i[data-pct="58"]{width:58%}
.md-app i[data-pct="59"]{width:59%}
.md-app i[data-pct="60"]{width:60%}
.md-app i[data-pct="61"]{width:61%}
.md-app i[data-pct="62"]{width:62%}
.md-app i[data-pct="63"]{width:63%}
.md-app i[data-pct="64"]{width:64%}
.md-app i[data-pct="65"]{width:65%}
.md-app i[data-pct="66"]{width:66%}
.md-app i[data-pct="67"]{width:67%}
.md-app i[data-pct="68"]{width:68%}
.md-app i[data-pct="69"]{width:69%}
.md-app i[data-pct="70"]{width:70%}
.md-app i[data-pct="71"]{width:71%}
.md-app i[data-pct="72"]{width:72%}
.md-app i[data-pct="73"]{width:73%}
.md-app i[data-pct="74"]{width:74%}
.md-app i[data-pct="75"]{width:75%}
.md-app i[data-pct="76"]{width:76%}
.md-app i[data-pct="77"]{width:77%}
.md-app i[data-pct="78"]{width:78%}
.md-app i[data-pct="79"]{width:79%}
.md-app i[data-pct="80"]{width:80%}
.md-app i[data-pct="81"]{width:81%}
.md-app i[data-pct="82"]{width:82%}
.md-app i[data-pct="83"]{width:83%}
.md-app i[data-pct="84"]{width:84%}
.md-app i[data-pct="85"]{width:85%}
.md-app i[data-pct="86"]{width:86%}
.md-app i[data-pct="87"]{width:87%}
.md-app i[data-pct="88"]{width:88%}
.md-app i[data-pct="89"]{width:89%}
.md-app i[data-pct="90"]{width:90%}
.md-app i[data-pct="91"]{width:91%}
.md-app i[data-pct="92"]{width:92%}
.md-app i[data-pct="93"]{width:93%}
.md-app i[data-pct="94"]{width:94%}
.md-app i[data-pct="95"]{width:95%}
.md-app i[data-pct="96"]{width:96%}
.md-app i[data-pct="97"]{width:97%}
.md-app i[data-pct="98"]{width:98%}
.md-app i[data-pct="99"]{width:99%}
.md-app i[data-pct="100"]{width:100%}
.md-app .lvbar i[data-flex="0"]{flex:0}
.md-app .lvbar i[data-flex="1"]{flex:1}
.md-app .lvbar i[data-flex="2"]{flex:2}
.md-app .lvbar i[data-flex="3"]{flex:3}
.md-app .lvbar i[data-flex="4"]{flex:4}
.md-app .lvbar i[data-flex="5"]{flex:5}
.md-app .lvbar i[data-flex="6"]{flex:6}
.md-app .lvbar i[data-flex="7"]{flex:7}
.md-app .lvbar i[data-flex="8"]{flex:8}
.md-app .lvbar i[data-flex="9"]{flex:9}
.md-app .lvbar i[data-flex="10"]{flex:10}
.md-app .lvbar i[data-flex="11"]{flex:11}
.md-app .lvbar i[data-flex="12"]{flex:12}
.md-app .lvbar i[data-flex="13"]{flex:13}
.md-app .lvbar i[data-flex="14"]{flex:14}
.md-app .lvbar i[data-flex="15"]{flex:15}
.md-app .lvbar i[data-flex="16"]{flex:16}
.md-app .lvbar i[data-flex="17"]{flex:17}
.md-app .lvbar i[data-flex="18"]{flex:18}
.md-app .lvbar i[data-flex="19"]{flex:19}
.md-app .lvbar i[data-flex="20"]{flex:20}
.md-app .lvbar i[data-flex="21"]{flex:21}
.md-app .lvbar i[data-flex="22"]{flex:22}
.md-app .lvbar i[data-flex="23"]{flex:23}
.md-app .lvbar i[data-flex="24"]{flex:24}
.md-app .lvbar i[data-flex="25"]{flex:25}
.md-app .lvbar i[data-flex="26"]{flex:26}
.md-app .lvbar i[data-flex="27"]{flex:27}
.md-app .lvbar i[data-flex="28"]{flex:28}
.md-app .lvbar i[data-flex="29"]{flex:29}
.md-app .lvbar i[data-flex="30"]{flex:30}
.md-app .lvbar i[data-flex="31"]{flex:31}
.md-app .lvbar i[data-flex="32"]{flex:32}
.md-app .lvbar i[data-flex="33"]{flex:33}
.md-app .lvbar i[data-flex="34"]{flex:34}
.md-app .lvbar i[data-flex="35"]{flex:35}
.md-app .lvbar i[data-flex="36"]{flex:36}
.md-app .lvbar i[data-flex="37"]{flex:37}
.md-app .lvbar i[data-flex="38"]{flex:38}
.md-app .lvbar i[data-flex="39"]{flex:39}
.md-app .lvbar i[data-flex="40"]{flex:40}
.md-app .lvbar i[data-flex="41"]{flex:41}
.md-app .lvbar i[data-flex="42"]{flex:42}
.md-app .lvbar i[data-flex="43"]{flex:43}
.md-app .lvbar i[data-flex="44"]{flex:44}
.md-app .lvbar i[data-flex="45"]{flex:45}
.md-app .lvbar i[data-flex="46"]{flex:46}
.md-app .lvbar i[data-flex="47"]{flex:47}
.md-app .lvbar i[data-flex="48"]{flex:48}
.md-app .lvbar i[data-flex="49"]{flex:49}
.md-app .lvbar i[data-flex="50"]{flex:50}
.md-app .lvbar i[data-flex="51"]{flex:51}
.md-app .lvbar i[data-flex="52"]{flex:52}

/* KWD-21 QA: 44px chrome, contain inner rows, no switch bleed */
.md-app .switch {
  width: 64px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  box-sizing: border-box;
}
.md-app .switch::after { inset: 0; }
.md-app .switch i {
  top: 6px;
  left: 6px;
  width: 32px;
  height: 32px;
}
.md-app .switch[aria-checked="true"] i { transform: translateX(20px); }
.md-app .setting {
  min-height: 44px;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}
.md-app .field {
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}
.md-app .pc .field { overflow: hidden; }
.md-app .seg { max-width: 100%; min-width: 0; }
.md-app .seg button, .md-app .seg.full button { min-width: 0; }
.md-app .heat, .md-app .hrow, .md-app .panel {
  max-width: 100%;
  min-width: 0;
}
.md-app .wrap {
  max-width: 640px;
  min-width: 0;
  margin-left: auto;
  margin-right: auto;
}
.md-app .hc {
  width: 100%;
  height: 44px;
  min-height: 44px;
  min-width: 44px;
  box-sizing: border-box;
}
.md-app .mpill { min-height: 44px; }

/* Cap the stack map at 7 columns once 7×44px cells fit, so a suit wraps 7+6 instead of 12+1. */
@media (min-width: 412px) {
  .md-app .hrow { grid-template-columns: repeat(7, minmax(44px, 1fr)); }
}
