/* Reference tools use their own fixed action bar instead of the five-tab navigation. */
.tools-shell{--tool-red:#cd0000;--tool-orange:#ff8a00;--tool-line:#eee;--tool-width:440px;background:#fff;min-height:100dvh;padding-bottom:0;border-radius:0!important;margin-top:0!important;margin-bottom:0!important;color:#333;font-size:14px}
.tools-shell #main{padding:0 0 calc(112px + env(safe-area-inset-bottom));min-height:100dvh;scroll-margin-bottom:120px}
.tools-shell .bottom-nav{display:none}.tools-shell button,.tools-shell a{touch-action:manipulation}.tools-shell .sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
.tool-head{height:44px;display:flex;align-items:center;justify-content:space-between;background:linear-gradient(100deg,#ffa000,#ff4b00);color:white;padding:0 12px;gap:8px}
.tool-head h1{font-size:17px;font-weight:500;line-height:44px;margin:0;flex:1;text-align:center;white-space:nowrap}.tool-head>button{background:none;border:0;color:white;width:44px;height:44px;padding:0}.tool-head .icon{width:23px;height:23px}
.tool-capsule{display:flex;align-items:center;border-radius:20px;background:white;color:#222;width:70px;height:29px;flex-shrink:0;box-shadow:0 1px 4px #00000013}.tool-capsule a,.tool-capsule button{width:35px;min-height:29px;display:grid;place-items:center;border:0;background:none;padding:0;position:relative}.tool-capsule a:after{content:'';position:absolute;right:0;height:12px;width:1px;background:#e9e9e9}.tool-capsule .icon{width:15px;height:15px}
.tool-promo{height:34px;display:flex;align-items:center;gap:5px;background:#fde8e8;padding:0 12px;font-size:13px;overflow:hidden}.tool-promo .icon{width:19px;color:#46bbd5}.tool-promo span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tool-promo b{background:#ff8600;color:white;padding:1px 6px;border-radius:10px;font-size:10px;flex-shrink:0;font-weight:500}
.tool-tabs{display:flex;background:#fff;height:59px;border-bottom:1px solid var(--tool-line)}.tool-tabs button{position:relative;flex:1;color:#555;border:0;background:white;font-size:14px;font-weight:600;min-height:44px}.tool-tabs .active{color:#e54c00}.tool-tabs .active:after{content:'';width:20px;height:2px;background:#ff6900;position:absolute;left:calc(50% - 10px);bottom:20px}
.tool-table{table-layout:fixed;width:100%;font-size:13px}.tool-table th{background:#fff;color:#888;font-weight:600;height:42px;padding:0;text-align:center;border:1px solid #eee}.tool-table .check{width:52px}.tool-table td{padding:0;border:1px solid #eee;color:#666}.tool-table .check label{display:flex;align-items:center;justify-content:center;min-height:44px;cursor:pointer}.tool-table input[type=checkbox]{appearance:none;width:18px;height:18px;border:1px solid #6356df;border-radius:3px;padding:0;display:grid;place-items:center;accent-color:#6152df;outline-offset:3px;flex-shrink:0}.tool-table input:checked{background:#6152df}.tool-table input:checked:after{content:'✓';color:white;font-size:14px;line-height:16px}.tool-table .tolerance input{border-color:#ec646b}.tool-table .tolerance input:checked{background:#e94552}
.tool-table .operation{width:58px;text-align:center}.tool-table .operation button{padding:0;width:27px;height:40px;border:0;background:white;color:#999}.tool-table .operation .icon{width:17px;height:17px}.tool-table .condition button{background:white;border:0;padding:8px 7px;width:100%;text-align:left;line-height:1.5;color:#444;word-break:break-word}.tool-table .condition strong{display:block;font-size:12px;font-weight:400;color:#666}.tool-table .condition em{font-style:normal;color:#cf312a}.tool-table .condition span{display:block;font-size:12px;max-height:54px;overflow:hidden}.tool-table .condition small{color:#999;font-size:11px}.tool-table .tool-table-empty{text-align:center;height:51px;color:#999;font-size:14px}.tool-hints{font-size:13px;color:#929292;padding:12px 10px;line-height:1.8}.tool-hints i{color:#f45c61;font-style:normal}.tool-hints .tool-network-error{color:#a33123}
.tool-fixed{position:fixed;bottom:0;width:min(100%,var(--tool-width));z-index:30;background:#fff;padding-bottom:env(safe-area-inset-bottom);box-shadow:0 -1px 2px #00000003}.tool-tolerance{height:48px;background:#fff7e5;display:flex;align-items:center;justify-content:center;gap:5px;font-size:14px}.tool-tolerance>button{border:2px solid #aaa;background:none;color:#999;width:19px;height:19px;padding:0;border-radius:50%;font-weight:700;line-height:14px}.tool-stepper{display:flex;align-items:center;gap:2px}.tool-stepper button{height:27px;width:26px;padding:0;border:0;background:var(--tool-red);color:white;font-size:18px;line-height:27px}.tool-stepper input{background:var(--tool-red);color:white;border:0;border-radius:0;width:40px;height:27px;padding:0;text-align:center;font-size:14px;appearance:textfield;-moz-appearance:textfield}.tool-stepper input::-webkit-inner-spin-button{appearance:none}
.tool-actions{height:52px;display:grid;grid-template-columns:1fr .85fr 1.35fr 1.2fr .85fr;border-top:1px solid #f1d080}.tool-actions>*{border:0;border-right:1px solid #e7c478;display:flex;align-items:center;justify-content:center;gap:3px;background:#fadfa0;color:#df4e27;font-size:14px;border-radius:0;padding:0;white-space:nowrap}.tool-actions .selected{background:#fafafa;color:#333;font-size:13px}.tool-actions .selected b{color:#e14c20}.tool-actions .settings{background:linear-gradient(95deg,#ffa300,#ff7b00);color:white}.tool-actions .filter{background:var(--tool-red);color:#fbe2a7;font-weight:600}
.tool-dialog{border:0;padding:0;border-radius:10px;width:min(90vw,360px);max-height:82dvh;box-shadow:0 8px 50px #2225;color:#333;background:white;overflow:auto}.tool-dialog.wide{width:min(94vw,490px)}.tool-dialog::backdrop{background:#0008}.tool-dialog[open]{display:block}.tool-dialog>header{display:flex;align-items:center;justify-content:space-between;gap:10px;background:linear-gradient(100deg,#ffa000,#ff4b00);color:white;padding:0 10px 0 15px;min-height:44px;position:sticky;top:0;z-index:1}.tool-dialog h2{font-size:16px;line-height:1.4;font-weight:500}.tool-dialog .icon-button{color:white}.tool-dialog-body{padding:16px;font-size:14px;line-height:1.8}.tool-dialog-body p+p{margin-top:12px}.tool-help{max-height:65dvh;overflow:auto}.tool-menu{display:grid;padding:8px 16px}.tool-menu>*{padding:10px;border:0;border-bottom:1px solid #eee;background:white;text-align:left;min-height:44px}.tool-modal-actions{display:flex;gap:12px;justify-content:flex-end;margin-top:18px}.tool-modal-actions button,.tool-modal-actions a,.tool-dialog-body>button{border:1px solid #ddd;background:#fafafa;border-radius:6px;min-height:44px;padding:8px 14px}.tool-modal-actions .red{background:var(--tool-red);color:white;border:0}.tool-copy{width:100%;height:240px;margin-top:12px;resize:none}.tool-result-summary{text-align:center;background:#fff5df;color:#e44600;padding:9px}.tool-result-summary b{font-size:19px}.tool-results{max-height:38dvh;overflow:auto;display:grid;grid-template-columns:repeat(8,minmax(0,1fr));font-variant-numeric:tabular-nums;padding:12px;gap:5px 4px;color:#333;text-align:center;font-size:15px;line-height:1.7;overscroll-behavior:contain}.tool-results>p{grid-column:1/-1;line-height:1.8;padding:20px 0}.tool-result-actions{display:grid;grid-template-columns:repeat(4,1fr);gap:7px;padding:10px 12px;border-top:1px solid #eee}.tool-result-actions button{padding:0;border:1px solid #edcb83;background:#fff5de;color:#a34213;border-radius:4px;height:40px;font-size:13px}.tool-result-bottom{display:flex;gap:12px;padding:0 12px 14px}.tool-result-bottom button{flex:1;border:0;border-radius:5px;min-height:44px;background:linear-gradient(95deg,#ffa000,#ff5100);color:white}.tool-result-bottom .red{background:var(--tool-red)}#tool-modal-shade{position:fixed;inset:0;background:#0008;z-index:1000}.tool-dialog:not(:modal){position:fixed;top:8dvh;z-index:1001}
.tool-condition-title{background:#fff0d9;padding:10px 15px;display:flex;align-items:center;justify-content:space-between;color:#de5200}.tool-condition-title strong{font-size:16px;font-weight:500}.tool-condition-title button{width:24px;height:24px;border:1px solid #e87417;background:white;border-radius:50%;color:#d85c00;font-weight:600}.tool-field{border:0;border-bottom:1px solid #eee;padding:12px 15px;margin:0;min-width:0}.tool-field legend{float:left;width:100%;font-size:14px;margin-bottom:9px;padding:0;color:#555}.tool-field legend+*{clear:both}.tool-field textarea,.tool-field>input{width:100%;border-radius:3px;font-size:16px}.tool-chips{display:grid;grid-template-columns:repeat(10,minmax(0,1fr));gap:5px}.tool-chips label,.tool-radio label{position:relative;cursor:pointer}.tool-chips input,.tool-radio input{position:absolute;opacity:0;inset:0;width:100%;height:100%;margin:0;padding:0}.tool-chips span{display:grid;place-items:center;border:1px solid #ddd;border-radius:3px;min-height:33px;font-size:15px;color:#555;background:#fafafa}.tool-chips input:checked+span,.tool-radio input:checked+span{background:#eb180b;border-color:#eb180b;color:white}.tool-chips input:focus-visible+span,.tool-radio input:focus-visible+span{outline:3px solid #377fe2;outline-offset:2px}.tool-radio{display:flex;flex-wrap:wrap;gap:8px}.tool-radio span{display:block;min-width:54px;padding:6px 12px;border:1px solid #ddd;background:#fafafa;border-radius:4px;text-align:center;min-height:35px}.tool-form-hint{font-size:12px;color:#888;margin:8px 15px}.tool-form-toolbar{display:flex;gap:20px;justify-content:center;padding:18px}.tool-form-toolbar button{border:1px solid #ddd;background:#f8f8f8;border-radius:5px;min-width:98px;min-height:40px;font-size:17px}.tool-form-toolbar .orange{background:linear-gradient(100deg,#ffa000,#ff4b00);color:white;border:0}.tool-category-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;padding:13px 10px;border-top:8px solid #f6f6f6}.tool-category-grid button{background:#fffaf1;border:1px solid #ecc891;border-radius:4px;color:#a64817;min-height:39px;padding:3px;font-size:14px}.tool-category-grid .active{background:#e5150b;color:white;border-color:#e5150b}.tool-form-bottom{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;color:#999;font-size:12px}.tool-form-bottom a{display:flex;align-items:center;gap:5px;min-height:44px;color:#d65000;font-size:15px}#tool-form-error{padding:10px 15px;background:#fff0f0;color:#b40000;font-size:14px}
.tool-result-context{padding:8px 12px;color:#8a6a48;font-size:12px;background:#fffdf5}.tool-result-context summary{cursor:pointer;min-height:25px;line-height:25px}.tool-result-context p{padding:5px 0;border-top:1px solid #eee;word-break:break-word}.tool-result-context[open]{max-height:20dvh;overflow:auto}
.tool-review-list{padding:10px}.tool-review-list article{border:1px solid #eee;border-radius:5px;margin-bottom:10px;padding:11px 12px;line-height:1.7;font-size:13px}.tool-review-meta{display:flex;justify-content:space-between;gap:8px;font-size:14px}.tool-review-meta b{color:#ce4900;font-weight:500}.tool-review-list p{color:#888}.tool-review-list .tool-review-outcome{color:#cd3030}.tool-review-list article>div:last-child{display:flex;justify-content:space-between;margin-top:7px;gap:8px}.tool-review-list button{background:#fff5de;border:1px solid #ebcf9c;border-radius:4px;min-height:35px;padding:5px 9px;color:#b44b21;font-size:13px}.tool-review-empty{text-align:center;color:#999;padding:60px 15px 45px;line-height:2}.tool-review-empty h2{font-size:17px;color:#555;font-weight:500}.tool-review-empty button,.tool-review-empty a{display:inline-block;border:0;border-radius:4px;background:linear-gradient(100deg,#ffa000,#ff4b00);color:white;padding:8px 18px;margin-top:15px}.tool-review-note{text-align:center;color:#aaa;font-size:12px;padding:15px}.tool-clear-review{display:block;border:1px solid #e4ca9a;color:#b9481a;background:#fff8e8;padding:9px;border-radius:5px;margin:12px auto}.tool-review-back{display:block;text-align:center;color:#e44f12;min-height:44px}.tool-review-conditions p{padding-bottom:10px;border-bottom:1px solid #eee}.tool-loading{padding:45px 10px;text-align:center;color:#999}
@media(max-width:360px){.tool-table .check{width:40px}.tool-table .operation{width:55px}.tool-actions>*{font-size:12px}.tool-chips{gap:4px}.tool-chips span{min-height:29px;font-size:14px}.tool-category-grid{gap:5px}.tool-category-grid button{font-size:13px}.tool-results{grid-template-columns:repeat(6,minmax(0,1fr))}}
