:root{--ground:#f1ecde;--surface:#e6dcc4;--ink:#1a1a18;--muted:#736d5a;--hairline:#c8bea4;--accent:#1b4b5a;--accent-ink:#f1ecde;--wrong:#a04a2a;--correct:#1b4b5a;--correct-bg:color-mix(in oklch, var(--accent) 12%, var(--ground));--wrong-bg:color-mix(in oklch, var(--wrong) 14%, var(--ground));--font-serif:"Source Serif 4", "Iowan Old Style", Palatino, "Palatino Linotype", "Songti TC", "Noto Serif CJK TC", serif;--font-sans:"Source Sans 3", "Avenir Next", "PingFang HK", "Segoe UI", sans-serif;--space-1:4px;--space-2:8px;--space-3:16px;--space-4:24px;--space-5:32px;--space-6:48px;--radius:0px;--shadow-sheet:0 24px 48px #1a1a1829;--ease:cubic-bezier(.22, 1, .36, 1);--dur-press:.12s;--dur-move:.28s;--tap:48px;--safe-top:env(safe-area-inset-top,0px);--safe-bottom:env(safe-area-inset-bottom,0px);--safe-left:env(safe-area-inset-left,0px);--safe-right:env(safe-area-inset-right,0px);--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}*,:before,:after{box-sizing:border-box}html,body{background:var(--ground);height:100%;color:var(--ink);font-family:var(--font-sans);-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent;margin:0;font-size:17px;line-height:1.45}body{height:100dvh;padding:var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);justify-content:center;display:flex;overflow:hidden}button{font:inherit;color:inherit}button:focus{outline:none}button:focus-visible{outline:2px solid var(--accent);outline-offset:3px}#app{width:100%;max-width:430px;height:100%;min-height:0;display:flex}.app{width:100%;height:100%;min-height:0;padding:var(--space-3) var(--space-4) var(--space-3);background:var(--ground);flex-direction:column;display:flex}.mast{padding:var(--space-4) 0 var(--space-3);flex-shrink:0}.mast-compact{padding-top:var(--space-2);padding-bottom:var(--space-2)}.kicker{font-family:var(--font-sans);letter-spacing:.14em;text-transform:uppercase;color:var(--accent);margin:0;font-size:.75rem;font-weight:600}.mast h1,.empty-state h1{margin:var(--space-2) 0 0;font-family:var(--font-serif);letter-spacing:-.035em;text-wrap:balance;font-size:clamp(3.15rem,15vw,4.15rem);font-weight:560;line-height:.9}.mast h1 em{font-style:italic;font-weight:520}.mast-compact h1{margin-top:var(--space-3);letter-spacing:-.03em;font-size:clamp(2.15rem,10vw,2.75rem);line-height:.95}.sub{margin:var(--space-3) 0 0;color:var(--muted);text-wrap:pretty;font-size:.95rem}.mast-compact .sub{font-family:var(--font-serif);color:var(--ink);margin-top:0;font-size:1.35rem}.session{padding:var(--space-1) 0 var(--space-3);flex-shrink:0}.session .sub{margin:var(--space-2) 0 0;font-family:var(--font-serif);color:var(--ink);letter-spacing:-.02em;font-size:1.05rem}.toolbar{justify-content:space-between;align-items:center;gap:var(--space-2);min-height:var(--tap);display:flex}.progress{color:var(--muted);font-variant-numeric:tabular-nums;letter-spacing:.04em;font-size:.875rem;font-weight:600}.progress strong{color:var(--ink);font-weight:600}.progress-track{margin-top:var(--space-2);background:var(--hairline);height:2px}.progress-fill{background:var(--accent);width:0%;height:100%;transition:width var(--dur-move) var(--ease)}.btn{min-height:var(--tap);min-width:var(--tap);padding:0 var(--space-3);border:1px solid var(--ink);border-radius:var(--radius);color:var(--ink);letter-spacing:.01em;cursor:pointer;-webkit-user-select:none;user-select:none;touch-action:manipulation;transition:background var(--dur-press) var(--ease), color var(--dur-press) var(--ease), border-color var(--dur-press) var(--ease);background:0 0;justify-content:center;align-items:center;font-size:.95rem;font-weight:600;display:inline-flex}.btn:active:not(:disabled){background:var(--surface)}.btn:disabled{opacity:.38;cursor:not-allowed}.btn-ghost{min-width:0;padding:0 var(--space-2) 0 0;color:var(--accent);background:0 0;border:0;justify-content:flex-start;font-size:.875rem;font-weight:600}.btn-ghost:active:not(:disabled){color:var(--ink);background:0 0}.btn-primary{background:var(--accent);border-color:var(--accent);color:var(--accent-ink);width:100%}.btn-primary:active:not(:disabled){background:var(--ink);border-color:var(--ink)}.btn-sm{min-width:44px;min-height:44px}.screen{flex-direction:column;flex:1;width:100%;min-height:0;display:none}.screen.active{display:flex}.screen[data-screen=docs].active,.screen[data-screen=modes].active,.screen[data-screen=empty].active{overflow-y:auto}.menu-stack{padding-top:var(--space-2);flex-direction:column;flex:1;justify-content:flex-start;display:flex}.menu-btn{justify-content:space-between;align-items:center;gap:var(--space-3);width:100%;min-height:76px;padding:var(--space-3) 0;border:0;border-bottom:1px solid var(--hairline);border-radius:var(--radius);color:var(--ink);text-align:left;cursor:pointer;touch-action:manipulation;-webkit-user-select:none;user-select:none;transition:background var(--dur-press) var(--ease);background:0 0;flex-direction:row;display:flex}.menu-stack .menu-btn:first-child{border-top:1px solid var(--hairline)}.menu-btn:active{background:var(--surface)}.menu-label{font-family:var(--font-serif);letter-spacing:-.03em;text-wrap:balance;font-size:clamp(1.55rem,6.4vw,1.85rem);font-weight:560;line-height:1.05}.menu-btn .hint{font-family:var(--font-sans);letter-spacing:0;color:var(--muted);text-align:right;text-wrap:pretty;flex:0 46%;margin:0;font-size:.75rem;font-weight:500;line-height:1.35}.back-row{flex-shrink:0}.empty-state{justify-content:flex-start;gap:var(--space-3);padding:var(--space-6) 0 var(--space-4);flex-direction:column;flex:1;display:flex}.empty-state h1{font-size:clamp(2.4rem,11vw,3.1rem)}.empty-state p{max-width:28ch;color:var(--muted);text-wrap:pretty;margin:0;font-size:1.05rem;line-height:1.5}.card-stage{touch-action:pan-y;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;min-height:0;padding-bottom:var(--space-2);flex-direction:column;flex:1;display:flex;position:relative;overflow:clip auto}.card{gap:var(--space-4);border-radius:var(--radius);padding:var(--space-2) 0 var(--space-3);transition:transform var(--dur-move) var(--ease), opacity var(--dur-move) var(--ease);will-change:transform;background:0 0;border:0;flex-direction:column;display:flex;overflow:visible}.card.swipe-left{opacity:0;transform:translate(-108%)}.card.swipe-right{opacity:0;transform:translate(108%)}.meta{gap:var(--space-2) var(--space-3);flex-wrap:wrap;align-items:baseline;display:flex;position:relative}.badge{background:0 0;border-radius:0;padding:0;font-weight:600;display:inline-block}.badge.clause{font-family:var(--font-serif);letter-spacing:-.02em;text-transform:none;color:var(--accent);font-size:1.05rem;font-style:italic;font-weight:560}.badge.source{clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.badges{display:contents}.badge.element{font-family:var(--font-sans);letter-spacing:.04em;text-transform:uppercase;color:var(--muted);font-size:.75rem;font-weight:500}.badge.element-secondary{font-family:var(--font-sans);letter-spacing:.02em;color:var(--accent);border-bottom:1px solid var(--hairline);padding-bottom:1px;font-size:.75rem;font-weight:600}.pipe-badges{gap:var(--space-2) var(--space-3);flex-wrap:wrap;min-height:0;display:flex}.pipe-badges:empty{display:none}.question{font-family:var(--font-serif);letter-spacing:-.025em;text-wrap:pretty;margin:0;font-size:1.5rem;font-weight:560;line-height:1.28}.choices{gap:var(--space-2);flex-direction:column;display:flex}.choice{width:100%;min-height:var(--tap);text-align:left;border:1px solid var(--hairline);border-radius:var(--radius);color:var(--ink);font-family:var(--font-serif);cursor:pointer;touch-action:manipulation;transition:background var(--dur-press) var(--ease), border-color var(--dur-press) var(--ease);background:0 0;align-items:flex-start;gap:12px;padding:12px 12px 12px 10px;font-size:1.02rem;font-weight:460;line-height:1.35;display:flex}.choice:active:not(:disabled){background:var(--surface);border-color:var(--ink)}.choice:disabled{cursor:default}.choice .letter{border:1px solid var(--hairline);border-radius:var(--radius);width:28px;height:28px;font-family:var(--font-sans);color:var(--muted);background:0 0;flex-shrink:0;justify-content:center;align-items:center;font-size:.75rem;font-weight:600;display:flex}.choice .choice-text{text-wrap:pretty;word-break:break-word;flex:1;padding-top:3px}.choice.correct{border-color:var(--correct);background:var(--correct-bg)}.choice.correct .letter{background:var(--correct);border-color:var(--correct);color:var(--accent-ink)}.choice.wrong{border-color:var(--wrong);background:var(--wrong-bg)}.choice.wrong .letter{background:var(--wrong);border-color:var(--wrong);color:var(--accent-ink)}.choice.dim{color:var(--muted);background:0 0;border-color:#0000}.choice.dim .letter{opacity:.7}.feedback{gap:var(--space-3);flex-direction:column;display:none}.feedback.show{display:flex}.feedback-ok{font-family:var(--font-serif);letter-spacing:-.02em;color:var(--accent);font-size:1.35rem;font-style:italic;font-weight:560}.notes-panel{background:var(--surface);border-radius:var(--radius);padding:var(--space-4) var(--space-3);overflow:visible}.notes-panel h3{margin:0 0 var(--space-2);font-family:var(--font-sans);letter-spacing:.12em;text-transform:uppercase;color:var(--accent);font-size:.75rem;font-weight:600}.notes-panel .correct-line{font-family:var(--font-serif);letter-spacing:-.02em;color:var(--accent);margin-bottom:var(--space-3);text-wrap:pretty;font-size:1.15rem;font-style:italic;font-weight:560;line-height:1.35}.notes-panel pre{white-space:pre-wrap;word-break:break-word;font-family:var(--font-serif);color:var(--ink);text-wrap:pretty;-webkit-user-select:text;user-select:text;margin:0;font-size:1rem;font-weight:460;line-height:1.65}.nav{gap:var(--space-2);margin-top:var(--space-2);padding-top:var(--space-2);border-top:1px solid var(--hairline);flex-shrink:0;display:flex}.nav .btn{flex:1}.nav .btn.is-emphasis{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}.end-screen{justify-content:flex-start;gap:var(--space-3);padding:var(--space-6) 0 var(--space-4);flex-direction:column;flex:1;display:none}.end-screen.show{display:flex}.end-screen h2{font-family:var(--font-serif);letter-spacing:-.035em;margin:0;font-size:clamp(2.6rem,12vw,3.4rem);font-weight:560;line-height:.95}.end-screen .score-num{font-family:var(--font-serif);letter-spacing:-.04em;color:var(--accent);font-variant-numeric:tabular-nums;font-size:clamp(4.5rem,22vw,6rem);font-style:italic;font-weight:520;line-height:.85}.end-screen .score-label{color:var(--muted);margin:0;font-size:.95rem}.end-screen .btn{margin-top:var(--space-3)}.hidden{display:none!important}.swipe-hint{margin:var(--space-2) 0 0;text-align:center;letter-spacing:.02em;color:var(--muted);flex-shrink:0;font-size:.75rem}@media (hover:hover){.menu-btn:hover{background:color-mix(in oklch, var(--surface) 65%, transparent)}.choice:hover:not(:disabled){border-color:var(--ink)}.btn:hover:not(:disabled){background:var(--surface)}.btn-primary:hover:not(:disabled),.nav .btn.is-emphasis:hover:not(:disabled){background:var(--ink);border-color:var(--ink);color:var(--accent-ink)}.btn-ghost:hover:not(:disabled){color:var(--ink);background:0 0}}@media (width>=520px){body{background:var(--surface)}.app{box-shadow:var(--shadow-sheet)}}@media (prefers-reduced-motion:reduce){.card,.progress-fill,.btn,.choice,.menu-btn{transition:none}}.review-root,.review{flex-direction:column;flex:1;min-height:0;display:flex}.review-scroll{overscroll-behavior:contain;-webkit-overflow-scrolling:touch;min-height:0;padding-bottom:var(--space-3);flex:1;overflow:hidden auto}.auth-bar{justify-content:space-between;align-items:center;gap:var(--space-2);min-height:44px;margin-bottom:var(--space-2);flex-shrink:0;display:flex}.auth-bar p{color:var(--muted);margin:0;font-size:.8125rem}.auth-actions{align-items:center;gap:var(--space-2);flex-shrink:0;display:flex}.review-notice{margin:0 0 var(--space-2);flex-shrink:0;font-size:.9rem;line-height:1.4}.review-notice.is-ok{color:var(--accent)}.review-notice.is-err{color:var(--wrong)}.chip-row{gap:var(--space-2);padding:var(--space-1) 0 var(--space-2);scrollbar-width:none;flex-shrink:0;display:flex;overflow-x:auto}.chip-row::-webkit-scrollbar{display:none}.chip{border:1px solid var(--hairline);border-radius:var(--radius);min-height:44px;color:var(--ink);cursor:pointer;touch-action:manipulation;background:0 0;flex:none;align-items:center;gap:6px;padding:0 12px;font-size:.875rem;font-weight:600;display:inline-flex}.chip.is-on{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}.chip-count{font-variant-numeric:tabular-nums;opacity:.75;font-weight:500}.search-field{margin-bottom:var(--space-1);display:block}.search-field input,.field input,.field textarea,.clause-id-input{width:100%;font:inherit;color:var(--ink);border:0;border-bottom:1px solid var(--hairline);border-radius:var(--radius);background:0 0;padding:10px 0;font-size:16px}.search-field input:focus,.field input:focus,.field textarea:focus,.clause-id-input:focus{border-bottom-color:var(--accent);outline:none}.field textarea{resize:vertical;border:1px solid var(--hairline);background:var(--surface);min-height:96px;padding:10px;line-height:1.5}.review-count{margin:var(--space-2) 0;color:var(--muted);letter-spacing:.08em;font-variant-numeric:tabular-nums;font-size:.75rem}.row-btn{width:100%;min-height:76px;padding:var(--space-3) 0;border:0;border-bottom:1px solid var(--hairline);border-radius:var(--radius);color:var(--ink);text-align:left;cursor:pointer;touch-action:manipulation;background:0 0;flex-direction:column;align-items:stretch;gap:4px;display:flex}.row-btn:first-of-type{border-top:1px solid var(--hairline)}.row-btn:active{background:var(--surface)}.row-main{justify-content:space-between;gap:var(--space-3);align-items:baseline;display:flex}.row-clause{font-family:var(--font-serif);letter-spacing:-.03em;color:var(--accent);font-size:1.35rem;font-style:italic;font-weight:560}.row-status,.row-meta,.row-preview{color:var(--muted);font-size:.8125rem}.row-preview{-webkit-line-clamp:2;-webkit-box-orient:vertical;line-height:1.4;display:-webkit-box;overflow:hidden}.review-empty{padding:var(--space-5) 0}.review-empty h2{margin:0 0 var(--space-2);font-family:var(--font-serif);letter-spacing:-.03em;font-size:clamp(1.8rem,8vw,2.4rem);font-weight:560;line-height:1.05}.review-empty p{margin:0 0 var(--space-3);color:var(--muted);max-width:28ch}.clause{padding-bottom:var(--space-3)}.identity{margin:var(--space-2) 0 0;color:var(--muted);word-break:break-word;font-size:.75rem;line-height:1.4}.status-line{margin:0 0 var(--space-3);font-family:var(--font-serif);font-size:1.15rem}.field{margin-bottom:var(--space-3);flex-direction:column;gap:4px;display:flex}.field-name{letter-spacing:.08em;color:var(--muted);font-size:.75rem;font-weight:600}.field-key,.field-lock{letter-spacing:0;color:var(--muted);font-weight:500}.field-lock{color:var(--accent)}.clause-id-input{font-family:var(--font-serif);letter-spacing:-.03em;padding-top:0;font-size:2rem;font-weight:560}.clause-text{white-space:pre-wrap;word-break:break-word;font-family:var(--font-serif);background:var(--surface);padding:var(--space-3);-webkit-user-select:text;user-select:text;margin:0;font-size:1rem;line-height:1.65}.review-dock{gap:var(--space-2);padding-top:var(--space-2);border-top:1px solid var(--hairline);background:var(--ground);flex-direction:column;flex-shrink:0;display:flex}.dock-hint{color:var(--muted);margin:0;font-size:.75rem}.review-pager{gap:var(--space-2);display:flex}.review-pager .btn{flex:1}.setup-banner{background:var(--surface);padding:0 var(--space-3) var(--space-2);margin:var(--space-2) 0 var(--space-3)}.setup-banner summary{cursor:pointer;align-items:center;min-height:48px;margin:0 -4px;padding:0 4px;font-weight:600;display:flex}.setup-banner p,.setup-banner li{margin:0 0 var(--space-2);font-size:.9rem;line-height:1.45}.setup-banner ul{margin:0 0 var(--space-2);padding-left:1.1rem}.setup-banner code{word-break:break-all;font-size:.78rem}.visually-hidden{clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}@media (hover:hover){.chip:hover,.row-btn:hover{background:color-mix(in oklch, var(--surface) 65%, transparent)}.chip.is-on:hover{background:var(--ink);border-color:var(--ink);color:var(--accent-ink)}}
