.tr-page { --tr-accent:#6453c7; --tr-blue:#126f91; --tr-line:#dce1ec; }
.tr-page .web-menu-toggle { min-height:44px; }
.tr-main { padding-block:24px 60px; }
.tr-breadcrumb { display:flex; align-items:center; flex-wrap:wrap; gap:9px; color:#5b667b; font-size:.78rem; line-height:1.7; }
.tr-breadcrumb a { color:#51449e; }
.tr-intro { max-width:850px; padding-block:48px 20px; }
.tr-intro h1 { margin-top:12px; font-size:clamp(2rem,4.7vw,3.7rem); line-height:1.16; letter-spacing:-.045em; }
.tr-intro h1 span { display:block; color:var(--tr-accent); }
.tr-intro .web-lead { margin-top:22px; }
.tr-page .web-actions { margin-top:24px; }
.tr-note { margin-top:16px; color:#56647b; font-size:.87rem; line-height:1.75; }
.tr-section { display:grid; gap:18px; padding-top:52px; scroll-margin-top:110px; }
.tr-section > h2 { font-size:clamp(1.5rem,3vw,2.2rem); letter-spacing:-.03em; line-height:1.25; }
.tr-section > p { max-width:900px; line-height:1.8; }
.tr-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.tr-grid article, .tr-rules article, .tr-workshop { min-width:0; padding:24px; border:1px solid var(--tr-line); border-radius:18px; background:#fff; }
.tr-grid h3 { margin-bottom:12px; font-size:1.12rem; line-height:1.4; }
.tr-grid p, .tr-grid li { color:#465570; font-size:.95rem; line-height:1.8; }
.tr-grid ol { padding-left:22px; }
.tr-grid li + li { margin-top:7px; }
.tr-examples { grid-template-columns:repeat(3,minmax(0,1fr)); }
.tr-examples h3 { color:var(--tr-accent); }
.tr-examples p { margin-top:14px; }
.tr-callout { padding:18px 22px; border:1px solid #d8d1ef; border-left:4px solid var(--tr-accent); border-radius:12px; background:#f0edfb; color:#352e62; line-height:1.8; }
.tr-workshop { display:grid; gap:20px; }
.tr-workshop[hidden], .tr-page [hidden] { display:none!important; }
.tr-form { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto; gap:14px; align-items:end; }
.tr-form > div { display:grid; gap:8px; min-width:0; }
.tr-page label { display:block; color:#26334d; font-size:.88rem; font-weight:800; }
.tr-page input, .tr-page select { width:100%; min-width:0; min-height:48px; margin:0; padding:11px 13px; border:1px solid #8b98b0; border-radius:10px; background:#fff; color:#20304c; font-family:inherit; font-size:1rem; font-weight:700; line-height:1.4; }
.tr-button { min-height:48px; margin:0; padding:12px 17px; border:1px solid #9fa9bf; border-radius:10px; background:#f6f7fb; color:#293653; font-family:inherit; font-size:.88rem; font-weight:800; line-height:1.4; cursor:pointer; touch-action:manipulation; }
.tr-button:hover { background:#ece9f8; }
.tr-primary { background:var(--tr-accent); border-color:var(--tr-accent); color:#fff; }
.tr-primary:hover { background:#51409f; }
.tr-button:disabled { opacity:.5; cursor:default; }
.tr-page :is(a,button,input,select):focus-visible { outline:3px solid #126f91; outline-offset:3px; }
.tr-error { min-height:1.4em; color:#9d2844; font-weight:700; line-height:1.6; }
.tr-digits { display:flex; flex-wrap:wrap; justify-content:center; gap:9px; padding-block:8px; }
.tr-digit { display:grid; place-content:center; gap:3px; min-width:48px; min-height:65px; padding:7px 10px; border:2px solid #d5dce8; border-radius:11px; background:#f8f9fc; color:#273651; font:800 1.6rem/1.2 ui-monospace,monospace; text-align:center; }
.tr-digit small { font:700 .65rem/1.2 system-ui,sans-serif; }
.tr-digit.is-padding { color:#69778d; border-style:dashed; }
.tr-digit.is-current, .tr-current { border-color:var(--tr-accent); color:#51409f; background:#ede9fb; }
.tr-digit.is-neighbor, .tr-neighbor { border-color:var(--tr-blue); color:#105e7b; background:#e4f3f7; }
.tr-legend { display:flex; flex-wrap:wrap; justify-content:center; gap:8px; font-size:.77rem; }
.tr-key { display:inline-flex; align-items:center; min-height:30px; padding:4px 9px; border:1px solid currentColor; border-radius:7px; }
.tr-carry { color:#835e13; background:#fff3d6; }
.tr-step { display:grid; gap:12px; padding:20px; border:1px solid #d8d1ef; border-radius:12px; background:#f7f5fd; line-height:1.8; }
.tr-step h4 { color:#51409f; font-size:1rem; }
.tr-step .tr-calculation { font:800 clamp(1rem,3.6vw,1.45rem)/1.7 ui-monospace,monospace; overflow-wrap:anywhere; }
.tr-step .tr-step-facts { display:flex; flex-wrap:wrap; gap:8px; }
.tr-step-facts span { padding:6px 10px; border:1px solid var(--tr-line); border-radius:8px; background:#fff; font-size:.85rem; }
.tr-result { padding:13px 16px; border-radius:10px; background:#e7f5ef; color:#1d5a45; font:800 1.1rem/1.6 ui-monospace,monospace; overflow-wrap:anywhere; }
.tr-controls { display:flex; align-items:center; justify-content:center; flex-wrap:wrap; gap:10px; }
.tr-controls span { padding:7px 2px; color:#516079; font-size:.86rem; }
.tr-rule-nav { display:flex; flex-wrap:wrap; gap:8px; }
.tr-rule-nav a { display:inline-flex; align-items:center; justify-content:center; min-width:56px; min-height:44px; padding:8px 13px; border:1px solid #aaa2cc; border-radius:9px; background:#fff; color:#51409f; font-weight:800; text-decoration:none; }
.tr-rules { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.tr-rules article { scroll-margin-top:110px; }
.tr-rules h3 { font-size:1.4rem; margin-block:7px 15px; }
.tr-rule-number { color:#6453a4; font-size:.73rem; font-weight:800; letter-spacing:.05em; }
.tr-rules p { font-size:.94rem; line-height:1.85; }
.tr-rules p + p { margin-top:13px; }
.tr-why { color:#52617a; }
.tr-example { padding:12px; border-radius:9px; background:#f5f6fa; }
.tr-quiz-answer { display:flex; align-items:end; flex-wrap:wrap; gap:10px; margin-top:17px; }
.tr-quiz-answer label { flex-basis:100%; }
.tr-quiz-answer input { flex:1 1 150px; width:auto; }
.tr-quiz-answer button { flex:1 1 180px; }
.tr-feedback { min-height:52px; margin-block:14px; padding:13px 15px; border-left:3px solid #8f9db7; border-radius:9px; background:#f1f4f9; color:#35445f; line-height:1.75; }
.tr-feedback.is-error { border-color:#ad3450; background:#fff0f3; color:#872940; }
.tr-feedback.is-success { border-color:#238767; background:#e9f7f1; color:#1f614d; }
.tr-correction { display:grid; gap:10px; margin-block:14px; padding:16px; border:1px solid var(--tr-line); border-radius:10px; background:#f8f9fc; color:#465570; font-size:.88rem; }
.tr-correction ol { padding-left:22px; }
.tr-correction li + li { margin-top:7px; }
.tr-quiz-score { font-size:1.1rem; font-weight:800; color:#51409f; line-height:1.8; }
.tr-step { padding:0; border:0; background:transparent; gap:14px; }
.tr-guide-block { display:grid; gap:12px; min-width:0; padding:18px; border:1px solid var(--tr-line); border-radius:13px; background:#f8f9fc; }
.tr-guide-block h4 { margin:0; color:#51409f; font-size:1rem; line-height:1.5; }
.tr-guide-block p { margin:0; }
.tr-guide-note { color:#52617a; font-size:.84rem; }
.tr-guide-carry { justify-self:start; padding:7px 11px; border:1px solid #dec68e; border-radius:8px; font-size:.88rem; font-weight:750; }
.tr-guide-details { min-width:0; padding:5px 0 0; border-top:1px solid var(--tr-line); }
.tr-guide-details summary { display:list-item; min-height:44px; padding:10px 2px; color:#51409f; cursor:pointer; font-size:.88rem; font-weight:750; }
.tr-guide-details summary:focus-visible { outline:3px solid var(--tr-blue); outline-offset:3px; border-radius:5px; }
.tr-guide-details > p { margin-block:12px; color:#465570; font-size:.9rem; }
.tr-guide-details .tr-step-facts span { color:#465570; }
.tr-digits { display:grid; grid-template-columns:repeat(var(--tr-digit-columns,3),minmax(0,1fr)); gap:8px; width:100%; max-width:38rem; padding:0; margin-inline:auto; }
.tr-digit { min-width:0; min-height:78px; width:100%; padding:8px 4px; font-size:clamp(1.25rem,4vw,1.8rem); }
.tr-digit small { min-width:0; font-size:.65rem; line-height:1.4; overflow-wrap:anywhere; }
.tr-digits.is-long .tr-digit small { display:none; }
.tr-focus-description { color:#465570; font-size:.83rem; font-weight:700; }
.tr-digit.is-padding { background:#f4f6fa; color:#607087; }
.tr-digit.is-padding.is-current { background:#ede9fb; color:#51409f; }
.tr-digit.is-padding.is-neighbor { background:#e4f3f7; color:#105e7b; }
.tr-guide-write .tr-result { display:grid; gap:10px; margin:0; min-width:0; background:#edf6f2; }
.tr-result-label { color:#36566a; font:750 .82rem/1.5 system-ui,sans-serif; }
.tr-result-slots { display:grid; grid-template-columns:repeat(var(--tr-result-columns,3),minmax(0,1fr)); gap:6px; width:min(100%,calc(var(--tr-result-columns,3) * 3.2rem + (var(--tr-result-columns,3) - 1) * .375rem)); margin-inline-start:auto; }
.tr-result-slot { display:grid; place-items:center; min-width:0; min-height:50px; border:1px solid #bbcbd3; border-radius:8px; background:#fff; color:#253c50; font:800 clamp(1.2rem,4vw,1.65rem)/1 ui-monospace,monospace; }
.tr-result-slot.is-empty { color:#718198; border-style:dashed; background:#f8faf9; }
.tr-result-slot.is-new { border:2px solid #28765e; background:#d9efe5; color:#18543e; }
.tr-result-direction { color:#526b73; font:500 .78rem/1.6 system-ui,sans-serif; }
.tr-result-equality { font:800 clamp(.9rem,3.6vw,1.15rem)/1.6 ui-monospace,monospace; overflow-wrap:anywhere; }
.tr-finish { padding-bottom:12px; }
.tr-sources { font-size:.86rem; color:#56647b; }
.tr-sources h2 { font-size:1.2rem; }
@media(min-width:1000px) { .tr-step { grid-template-columns:repeat(3,minmax(0,1fr)); }.tr-guide-block { align-content:start; }.tr-guide-details { grid-column:1/-1; } }
@media(max-width:850px) { .tr-examples { grid-template-columns:1fr; }.tr-form { grid-template-columns:1fr 1fr; }.tr-form > button { grid-column:1/-1; }.tr-main { padding-top:16px; } }
@media(max-width:580px) { .tr-intro { padding-top:32px; }.tr-section { padding-top:36px; }.tr-grid,.tr-rules,.tr-form { grid-template-columns:minmax(0,1fr); }.tr-form > button { grid-column:auto; }.tr-grid article,.tr-rules article,.tr-workshop { padding:18px; }.tr-digit { min-width:0; min-height:70px; padding:5px 2px; font-size:1.25rem; }.tr-digit small { font-size:.58rem; }.tr-digits { gap:4px; }.tr-step { padding:0; }.tr-guide-block { padding:14px 11px; }.tr-guide-write .tr-result { padding:12px 10px; }.tr-result-slots { gap:4px; }.tr-result-slot { min-height:44px; }.tr-controls > .tr-button { flex:1 1 140px; }.tr-controls > span { flex-basis:100%; text-align:center; }.tr-breadcrumb { font-size:.7rem; } }
@media(prefers-reduced-motion:reduce) { .tr-page * { animation:none!important; transition:none!important; scroll-behavior:auto!important; } }
@media(forced-colors:active) { .tr-digit.is-current { outline:3px solid Highlight; }.tr-digit.is-neighbor { outline:2px dashed Highlight; } }
@media print { .tr-intro { padding-top:10px; }.tr-section { padding-top:22px; }.tr-rules,.tr-grid { display:block; }.tr-rules article,.tr-grid article { break-inside:avoid; margin-block:12px; }.tr-workshop,.tr-rule-nav { display:none; }.tr-main { padding-bottom:0; } }
