/* Shared workshop proportions with fraction bars and algebra tiles. */
html.modern-site .relative-workshop-main{max-width:1700px;padding:12px 24px 115px}html.modern-site body #relative-counters{padding:0;border-radius:22px;background:#fff;max-width:none;box-shadow:0 7px 30px #1d463309;border:1px solid #dce6df;overflow:visible;font-family:ui-sans-serif,system-ui}
#relative-counters .rc-workshop-toolbar{display:flex;align-items:center;gap:10px;padding:15px 18px;border-bottom:1px solid #e2e9e4;flex-wrap:wrap;background:#fff;border-radius:22px 22px 0 0;position:relative;z-index:8}#relative-counters .rc-workshop-toolbar .rc-tabs{margin:0;flex:1 1 430px;max-width:750px}#relative-counters .rc-workshop-toolbar .rc-tabs>:is(button,a){font-size:13px!important;padding:11px 15px!important;min-height:44px!important}#relative-counters .rc-command-strip{display:flex;gap:7px;flex-wrap:wrap;margin:0;align-items:center}#relative-counters .rc-command-strip button{font-size:12px;padding:10px 12px;border-radius:11px;border-color:#e0e8e3;color:#648170;min-height:42px;background:#f8fbf9}#relative-counters .rc-command-strip button[aria-pressed=true]{background:#e4f1e8;color:#398064;border-color:#cde4d6}#relative-counters .rc-command-strip .rc-main{background:#397d61;color:#fff;border-color:#397d61}#relative-counters .rc-reset-button{font-size:12px;padding:10px 13px;min-height:42px;border-radius:11px;color:#9d7270;background:#fff8f7;border-color:#eadcda;margin-left:auto}
#relative-counters .rc-option-menu{position:relative;margin:0;z-index:10}#relative-counters .rc-option-menu>summary{list-style:none;padding:12px 14px;border:1px solid #dce7df;border-radius:11px;font-size:12px;font-weight:600;color:#638271;background:#fff;cursor:pointer;min-height:42px}#relative-counters .rc-option-menu>summary::-webkit-details-marker{display:none}#relative-counters .rc-options-content{position:absolute;right:0;top:calc(100% + 9px);width:285px;max-width:calc(100vw - 35px);background:white;border:1px solid #dce7df;border-radius:17px;box-shadow:0 12px 40px #254b3720;padding:18px;display:flex;flex-direction:column;gap:17px}#relative-counters .rc-display-option{display:flex;flex-direction:row;align-items:center;gap:10px;margin:0;font-size:13px;color:#567562}#relative-counters .rc-display-option input{width:18px!important;min-height:18px!important;height:18px!important;accent-color:#3b8061;padding:0}#relative-counters .rc-advanced-tools{display:flex;flex-wrap:wrap;gap:8px;border-top:1px solid #e5ece7;padding-top:15px}#relative-counters .rc-advanced-tools button{font-size:12px;padding:9px 11px;background:#f3f8f4;border-radius:11px}
#relative-counters .rc-layout{grid-template-columns:170px minmax(0,1fr);gap:0;align-items:stretch;margin:0}#relative-counters .rc-piece-drawer{padding:25px 15px;background:#f7faf8;border-right:1px solid #e3ebe5;display:flex;flex-direction:column;align-items:stretch;gap:16px;border-radius:0 0 0 20px}#relative-counters .rc-reserve-label{text-transform:uppercase;letter-spacing:1.5px;font-size:10px;font-weight:700;color:#8ca090;margin-bottom:8px}#relative-counters .rc-piece-card{display:flex;align-items:center;gap:11px;padding:11px 9px;background:white;border:1px solid #e6ece7;border-radius:15px}#relative-counters .rc-piece-card>span{font-size:12px;font-weight:600;color:#647b6b}#relative-counters .rc-piece-card>.rc-token{width:46px;height:46px;min-height:46px;font-size:21px}#relative-counters .rc-token{box-shadow:inset 0 1px 0 #ffffff30,0 4px 8px #25443310;background:#6563cc;color:white;border-radius:50%;border:0}#relative-counters .rc-token.negative{background:#d46880}#relative-counters .rc-pair-tool{padding:10px 8px;background:#f1f6f2;border-radius:14px;text-align:center;border:1px solid #e2eae4}#relative-counters .rc-pair{background:transparent;border:0;min-height:48px}#relative-counters .rc-pair>span{background:#6563cc}#relative-counters .rc-pair>span+span{background:#d46880}#relative-counters .rc-pair-caption{font-size:10px;color:#8ca08f}
#relative-counters .rc-layout>div{min-width:0;padding:14px 18px 16px;background:#fff;border-radius:0 0 20px 0}#relative-counters .rc-board{border:1px solid #e1e8e2;border-radius:18px;min-height:clamp(390px,60vh,650px);padding:22px;background-color:#fcfefd;background-image:radial-gradient(#dbe6df 1px,transparent 1px);background-size:22px 22px;box-shadow:inset 0 1px 5px #28463403}#relative-counters .rc-equation{color:#4b755b;font-size:27px;min-height:12px;margin-bottom:18px}#relative-counters .rc-equation:empty{display:none}#relative-counters .rc-stage{min-height:270px;justify-content:center}#relative-counters .rc-lines{overflow-x:auto}#relative-counters .rc-lines .rc-tray{padding:14px 8px;gap:11px}#relative-counters .rc-empty{font-size:13px;color:#a1b0a4;text-align:center}#relative-counters .rc-hint{min-height:0;font-size:12px;color:#8a9c8d;margin:12px 0 0;padding:0 5px}#relative-counters .rc-board-footer{padding:12px 22px;border-top:1px solid #e4ebe5;font-size:10px;color:#94a493;border-radius:0 0 22px 22px;background:#fbfdfb}#relative-counters .rc-calculation-entry{padding:17px 20px;border-bottom:1px solid #e3eae5;background:#f8fbf9}#relative-counters .rc-calculation-entry .rc-inputs{margin:0;gap:12px}#relative-counters .rc-calculation-entry label{font-size:12px;color:#7a9280;flex:1 1 180px}#relative-counters .rc-calculation-entry input{width:100%;font-size:21px;min-height:48px;border-radius:12px;background:white;border-color:#d6e4da;text-align:left;padding:10px 14px}#relative-counters .rc-calculation-entry button{font-size:13px;border-radius:12px;min-height:48px;padding:12px 18px;background:#397d61}#relative-counters .rc-error{padding:0 20px;color:#b16d65;font-size:13px}#relative-counters .rc-error:empty{display:none}#relative-counters .rc-pieces-toggle,#relative-counters .rc-drawer-close,#relative-counters .rc-pieces-shade{display:none}
body.projection #relative-counters .rc-layout{grid-template-columns:140px minmax(0,1fr)}body.projection #relative-counters .rc-piece-drawer{flex-direction:column;align-items:stretch}body.projection #relative-counters .rc-board{min-height:65vh}body.projection #relative-counters .rc-workshop-toolbar{padding:10px 14px}
@media(max-width:700px){html.modern-site .relative-workshop-main{padding:10px 12px 105px}#relative-counters .rc-workshop-toolbar{padding:11px;gap:7px}#relative-counters .rc-workshop-toolbar .rc-tabs{flex:1 1 100%;max-width:none;order:-2}#relative-counters .rc-workshop-toolbar .rc-tabs>:is(button,a){font-size:11px!important;padding:10px 9px!important;min-height:43px!important}#relative-counters .rc-command-strip{gap:5px;flex:1 1 190px}#relative-counters .rc-command-strip button{padding:9px 10px;font-size:11px;min-height:41px}#relative-counters .rc-reset-button{font-size:11px;padding:9px 11px;margin-left:0}#relative-counters .rc-option-menu>summary{padding:10px 12px;font-size:11px}#relative-counters .rc-layout,body.projection #relative-counters .rc-layout{position:relative;grid-template-columns:1fr}#relative-counters .rc-layout>div{padding:10px;border-radius:0 0 18px 18px}#relative-counters .rc-board{padding:15px 10px;min-height:440px;background-size:21px 21px}#relative-counters .rc-stage{min-height:270px}#relative-counters .rc-token{width:42px;height:42px;min-height:42px;font-size:20px}#relative-counters .rc-lines .rc-tray{padding:13px 5px;gap:9px}#relative-counters .rc-piece-drawer{display:none;position:absolute;left:8px;top:8px;bottom:8px;width:170px;border:1px solid #dae5dc;border-radius:17px;padding:18px 14px;z-index:6;box-shadow:7px 0 25px #264c3920;overflow:auto;background:#fafdfb}#relative-counters.rc-pieces-open .rc-piece-drawer{display:flex}#relative-counters .rc-pieces-toggle{display:inline-block;background:#e8f3ec;color:#5d856a;border-color:#d3e6d9;font-size:12px;padding:10px 13px;border-radius:11px;min-height:41px}#relative-counters .rc-drawer-close{display:block;position:absolute;right:6px;top:5px;background:transparent;border:0;font-size:22px;color:#789480;min-height:30px;padding:2px 7px}#relative-counters .rc-pieces-shade:not([hidden]){display:block;position:absolute;inset:0;width:100%;height:100%;border:0;background:#254a3a12;border-radius:18px;z-index:5}#relative-counters .rc-board-footer{padding:12px 15px;line-height:1.6;font-size:10px}#relative-counters .rc-calculation-entry{padding:14px}#relative-counters .rc-options-content{right:-4px;width:250px}#relative-counters .rc-hint{font-size:11px}}
@media(max-width:700px){#relative-counters .rc-option-menu{position:static}#relative-counters .rc-options-content{right:10px;top:calc(100% + 7px);width:min(270px,calc(100vw - 55px))}}
/* Balanced workshop sizing: two compact modes, restrained controls, wrapping tokens. */
html.modern-site .relative-workshop-main{max-width:1400px;padding:8px 20px 100px}
#relative-counters .rc-workshop-toolbar{display:flex;flex-direction:column;align-items:stretch;padding:12px 14px;gap:10px}
#relative-counters .rc-topline{display:flex;align-items:center;gap:8px;min-width:0}
#relative-counters .rc-workshop-toolbar .rc-tabs{flex:1 1 auto;max-width:440px;min-width:0;margin-right:auto;padding:4px!important;border-radius:14px!important;gap:4px!important}
#relative-counters .rc-workshop-toolbar .rc-tabs>button{min-height:41px!important;padding:9px 12px!important;border-radius:10px!important;font-size:13px!important;flex:1!important}
#relative-counters .rc-mode-picker{display:none}
#relative-counters .rc-command-strip{gap:6px;min-width:0;flex:initial}
#relative-counters .rc-command-strip button{font-size:12px;min-height:40px;padding:9px 12px;max-width:100%}
#relative-counters .rc-option-menu>summary,#relative-counters .rc-reset-button{min-height:41px;padding:10px 12px;font-size:12px;white-space:nowrap;margin:0}
#relative-counters .rc-other-tool{display:block;color:#51766c;font-size:12px;text-decoration:none;background:#f0f6f3;border-radius:10px;padding:11px;line-height:1.4}
#relative-counters .rc-layout{grid-template-columns:140px minmax(0,1fr)}
#relative-counters .rc-piece-drawer{padding:20px 11px;gap:11px}
#relative-counters .rc-piece-card{gap:9px;padding:9px 7px;border-radius:12px}
#relative-counters .rc-piece-card>span{font-size:11px}
#relative-counters .rc-piece-card>.rc-token{width:40px;height:40px;min-height:40px;font-size:19px}
#relative-counters .rc-reserve-label{font-size:10px;margin-bottom:2px}
#relative-counters .rc-pair-tool{padding:8px 5px}
#relative-counters .rc-pair{min-height:42px;padding:6px 3px}
#relative-counters .rc-pair>span{width:29px;height:29px;font-size:14px}
#relative-counters .rc-layout>div{padding:12px}
#relative-counters .rc-board{min-height:clamp(310px,48svh,490px);padding:18px}
#relative-counters .rc-equation{font-size:24px;margin-bottom:13px;line-height:1.4}
#relative-counters .rc-stage{min-height:190px;justify-content:flex-start;gap:5px}
#relative-counters .rc-lines{overflow:visible;width:100%;min-width:0;padding:0;flex:none}
#relative-counters .rc-lines .rc-tray{display:flex;flex-wrap:wrap!important;min-width:0!important;width:100%;gap:10px;padding:8px 3px;min-height:48px;margin:7px 0}
#relative-counters .rc-tray>.rc-token:not(.rc-bundle),#relative-counters .rc-pending .rc-token{width:42px;height:42px;min-height:42px;font-size:20px}
#relative-counters .rc-empty{font-size:12px;line-height:1.5;margin-top:6px}
#relative-counters .rc-hint{font-size:12px;line-height:1.6;margin-top:10px}
#relative-counters .rc-pending{gap:7px;padding:6px 0}
#relative-counters .rc-pending-pair{gap:6px;padding:6px;border-radius:10px}
#relative-counters .rc-board-footer{padding:10px 15px;font-size:11px}
#relative-counters .rc-calculation-entry{padding:12px 15px}
#relative-counters .rc-calculation-entry input{font-size:19px;min-height:44px}
#relative-counters .rc-calculation-entry button{min-height:44px;font-size:12px}
body.projection #relative-counters .rc-board{min-height:52svh}
body.projection #relative-counters .rc-tray>.rc-token:not(.rc-bundle){width:48px;height:48px;min-height:48px;font-size:23px}
@media(max-width:700px){
 html.modern-site .relative-workshop-main{padding:6px 10px 100px}
 #relative-counters .rc-workshop-toolbar{padding:10px;gap:9px}
 #relative-counters .rc-topline{gap:6px}
 #relative-counters .rc-workshop-toolbar .rc-tabs{display:none!important}
 #relative-counters .rc-mode-picker{display:block;flex:1;min-width:0;width:0;max-width:none;font-size:13px;min-height:42px;padding:9px 8px;border-radius:11px;background:#f2f6f3;color:#426c5c;border-color:#dce7df}
 #relative-counters .rc-option-menu>summary,#relative-counters .rc-reset-button{min-height:42px;font-size:12px;padding:10px}
 #relative-counters .rc-command-strip{gap:5px;flex:none;width:100%}
 #relative-counters .rc-command-strip button{min-height:42px;padding:9px 10px;font-size:12px;flex:none}
 #relative-counters .rc-layout,body.projection #relative-counters .rc-layout{grid-template-columns:minmax(0,1fr)}
 #relative-counters .rc-layout>div{padding:8px}
 #relative-counters .rc-board{min-height:clamp(260px,40svh,390px);padding:14px 10px;border-radius:14px;background-size:20px 20px}
 #relative-counters .rc-stage{min-height:150px;gap:3px}
 #relative-counters .rc-equation{font-size:22px;min-height:0;margin-bottom:10px}
 #relative-counters .rc-lines .rc-tray{gap:8px;padding:6px 2px;min-height:44px}
 #relative-counters .rc-tray>.rc-token:not(.rc-bundle),#relative-counters .rc-pending .rc-token{width:38px;height:38px;min-height:38px;font-size:18px;position:relative}
 #relative-counters .rc-tray>.rc-token:after{content:'';position:absolute;inset:-3px;border-radius:50%;pointer-events:auto}
 #relative-counters .rc-pending-pair{padding:5px;gap:5px}
 #relative-counters .rc-piece-drawer{width:145px;padding:16px 10px;gap:10px;bottom:auto;min-height:240px;max-height:calc(100% - 16px)}
 #relative-counters .rc-piece-card>span{font-size:11px}
 #relative-counters .rc-hint{font-size:12px;line-height:1.5;padding:0 3px}
 #relative-counters .rc-board-footer{font-size:10px;padding:10px 12px}
 #relative-counters .rc-calculation-entry{padding:11px}
 #relative-counters .rc-calculation-entry .rc-inputs{gap:8px;align-items:flex-end}
 #relative-counters .rc-calculation-entry label{flex:1 1 145px}
 #relative-counters .rc-calculation-entry input{font-size:18px;min-height:44px;padding:9px 11px}
 #relative-counters .rc-calculation-entry button{padding:11px;font-size:12px}
 #relative-counters .rc-options-content{top:60px;right:8px;width:min(270px,calc(100vw - 48px))}
 body.projection #relative-counters .rc-board{min-height:45svh}
}
@media(max-width:370px){#relative-counters .rc-command-strip button{font-size:11px;padding:9px}#relative-counters .rc-calculation-entry button{width:100%}}
/* The drawer is a vertical palette at every width, including iPhone portrait. */
#relative-counters .rc-reserve.rc-piece-drawer{flex-direction:column!important;align-items:stretch!important;justify-content:flex-start!important;gap:10px;overflow-x:hidden}
#relative-counters .rc-piece-drawer>.rc-piece-card,#relative-counters .rc-piece-drawer>.rc-pair-tool{width:100%;max-width:100%;min-width:0;flex:0 0 auto}
#relative-counters .rc-piece-drawer .rc-reserve-label{display:block!important;margin:0 28px 8px 0;color:#6a8576;font-size:11px}
#relative-counters .rc-piece-drawer>.rc-drawer-close{width:30px!important;height:30px!important;min-height:30px!important;padding:0!important;font-size:22px!important;line-height:1!important}
#relative-counters .rc-piece-drawer .rc-piece-card{justify-content:flex-start;overflow:visible}
@media(max-width:700px){#relative-counters .rc-reserve.rc-piece-drawer{padding:18px 10px 12px;min-height:250px;max-height:calc(100% - 16px);border-radius:15px}#relative-counters .rc-piece-drawer .rc-pair{width:100%;justify-content:center}}
/* A persistent palette above the canvas replaces the side drawer. */
#relative-counters.rc-horizontal-palette .rc-top-palette.rc-reserve{position:static!important;inset:auto!important;display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:flex-start!important;gap:12px!important;width:auto!important;min-width:0!important;max-width:none!important;height:auto!important;min-height:0!important;max-height:none!important;padding:12px 16px!important;margin:0!important;background:#f7faf8!important;border:0!important;border-bottom:1px solid #e2eae4!important;border-radius:0!important;box-shadow:none!important;overflow:visible!important;flex-wrap:wrap!important}
#relative-counters.rc-horizontal-palette .rc-top-palette>.rc-reserve-label{display:block!important;font-size:11px;color:#7c9585;margin:0 4px 0 0!important}
#relative-counters.rc-horizontal-palette .rc-top-palette>.rc-piece-card{display:flex;flex-direction:row;align-items:center;gap:9px;padding:7px 12px;border:1px solid #dfe8e1;border-radius:12px;background:white;flex:0 1 auto;min-width:0}
#relative-counters.rc-horizontal-palette .rc-top-palette .rc-token{width:40px;height:40px;min-height:40px;font-size:19px}
#relative-counters.rc-horizontal-palette .rc-top-palette>.rc-pair-tool{display:flex;flex-direction:row;align-items:center;gap:8px;padding:7px 10px;background:white;border:1px solid #dfe8e1;border-radius:12px;flex:0 1 auto}
#relative-counters.rc-horizontal-palette .rc-top-palette .rc-pair{width:auto;min-height:40px;padding:0;gap:3px}
#relative-counters.rc-horizontal-palette .rc-top-palette .rc-pair>span{width:30px;height:30px;font-size:15px}
#relative-counters.rc-horizontal-palette .rc-top-palette .rc-pair-caption{font-size:11px;white-space:nowrap;color:#6e8878}
#relative-counters.rc-horizontal-palette .rc-layout,body.projection #relative-counters.rc-horizontal-palette .rc-layout{display:block!important;grid-template-columns:none!important}
#relative-counters.rc-horizontal-palette .rc-layout>div{border-radius:0 0 18px 18px}
@media(max-width:700px){
 #relative-counters.rc-horizontal-palette .rc-top-palette.rc-reserve{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:7px!important;padding:10px!important;align-items:stretch!important}
 #relative-counters.rc-horizontal-palette .rc-top-palette>.rc-reserve-label{display:none!important}
 #relative-counters.rc-horizontal-palette .rc-top-palette>.rc-piece-card,#relative-counters.rc-horizontal-palette .rc-top-palette>.rc-pair-tool{width:auto!important;max-width:none!important;min-width:0!important;flex-direction:column!important;justify-content:center;gap:5px;padding:8px 3px!important;border-radius:12px}
 #relative-counters.rc-horizontal-palette .rc-top-palette .rc-piece-card>span{font-size:11px}
 #relative-counters.rc-horizontal-palette .rc-top-palette .rc-token{width:38px;height:38px;min-height:38px;font-size:18px}
 #relative-counters.rc-horizontal-palette .rc-top-palette .rc-pair{min-height:38px;width:100%;justify-content:center;gap:2px}
 #relative-counters.rc-horizontal-palette .rc-top-palette .rc-pair>span{width:27px;height:27px;font-size:13px}
 #relative-counters.rc-horizontal-palette .rc-top-palette .rc-pair-caption{font-size:10px;line-height:1.2}
}
