/* WireAndWidgets additions on top of hub.css. Palette sampled from the logo. */
:root {
  --ink: #313A41; --blue: #3F4953; --blue-dark: #2A3138; --blue-tint: #E8ECEF;
  --sky: #CE7440; --bolt: #CE7440; --bg: #F1F2F3; --muted: #4F5A64;
  --orange: #CE7440; --orange-text: #A8531F; --steel: #617284;
}
a { color: var(--orange-text); } a:hover { color: #7F3C13; }
::selection { background: #F6D9C5; }
.grp-calc { --grp: #A8531F; --grp-tint: #F8E9DE; }
.grp-ref  { --grp: #3F4953; --grp-tint: #E6E9EC; }
.grp-text { --grp: #4F6175; --grp-tint: #E7ECF1; }
.brand { display: block; padding: 1rem 1.1rem .85rem; }
.brand-mark { display: block; width: 4.6rem; height: auto; }
.brand .brand-name { margin-top: .5rem; font: 700 1.3rem/1 var(--font-display); letter-spacing: .03em; color: var(--steel); }
.brand-name b { color: var(--ink); font-weight: 700; } .brand-name i { font-style: normal; }
.hero { margin: 0 0 1rem; } .hero img { display: block; width: min(100%, 38rem); height: auto; }

.topbar .fb-link { margin-left: auto; white-space: nowrap; }
.topbar #install-btn { margin-left: .5rem; }
.site-foot { padding: 1rem 1.5rem 2rem; font-size: .85rem; color: var(--muted); max-width: 60rem; }
.intro-lead { font-size: 1.15rem; max-width: 42rem; margin-bottom: 1.5rem; }
.prose { max-width: 40rem; }
.prose h2 { font: 600 1.35rem/1.2 var(--font-display); margin: 1.5rem 0 .4rem; }
@media print { .site-foot, .sidebar, .topbar { display: none; } }
.tool-tile { flex: 1; }
.intro { margin-bottom: 1.5rem; }
.intro-lead { margin-bottom: 0; }
.tool-tile { grid-template-columns: minmax(0, 1fr); }
.backup-bar { display: flex; gap: .4rem; margin-left: auto; }
.backup-bar + #install-btn { margin-left: .4rem; }
.grp-labels { --grp: #2F6F73; --grp-tint: #E1F0F0; }
@media (max-width: 640px) { .backup-bar .btn { padding-inline: .6rem; font-size: .85rem; } }
/* Retint the label and sticker tools' blue accents to the site palette */
body .bg-blue-600, body .bg-blue-500 { background-color: var(--blue); }
body .bg-blue-700, body .hover\:bg-blue-700:hover { background-color: var(--blue-dark); }
body .bg-blue-50, body .bg-blue-100 { background-color: var(--blue-tint); }
body .text-blue-600, body .text-blue-700, body .text-blue-800 { color: var(--blue); }
body .border-blue-600, body .border-blue-500, body .border-blue-400 { border-color: var(--blue); }
.grp-planning { --grp: #8A6A1F; --grp-tint: #F5EEDB; }
.grp-drawings { --grp: #3E5C9A; --grp-tint: #E6ECF7; }
.parts-tools { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .6rem 0; } .parts-tools input#parts-q { flex: 1; min-width: 12rem; }
/* BOM header: name and job on the first row, the tool buttons on their own row beneath */
.bom-head { grid-template-columns: auto minmax(0, 1fr); } .bom-head .bom-tools { grid-column: 1 / -1; justify-content: flex-start; }
.bom-name { flex: 1 1 14rem; } .bom-job { flex: 0 1 14rem; }

/* Terms: agreement gate, estimate notice, and the terms page */
.terms-gate { max-width: 34rem; width: calc(100% - 2rem); padding: 0; border: 1px solid var(--line-strong); border-radius: var(--r-panel); box-shadow: 0 12px 40px rgba(0,0,0,.35); }
.terms-gate::backdrop { background: rgba(35, 42, 48, .72); }
.terms-gate-body { padding: 1.4rem 1.5rem .5rem; } .terms-gate-body h2 { font: 700 1.5rem/1.2 var(--font-display); margin: 0 0 .6rem; } .terms-gate-body p { margin: 0 0 .9rem; }
.terms-gate-check { display: flex; gap: .7rem; align-items: flex-start; padding: .8rem .9rem; margin: 0 0 .8rem; background: var(--blue-tint); border-radius: var(--r-control); cursor: pointer; }
.terms-gate-check input { flex: none; width: 1.3rem; height: 1.3rem; margin-top: .15rem; } .terms-gate-small { font-size: .88rem; color: var(--muted); }
.terms-gate-foot { display: flex; justify-content: flex-end; gap: .6rem; padding: .9rem 1.5rem 1.3rem; }
.estimate-note { margin: 0 0 1rem; padding: .6rem .9rem; font-size: .92rem; background: #FFF6E5; border-left: 4px solid var(--orange); border-radius: 2px; } .estimate-note strong { color: #7F3C13; }
.terms { max-width: 46rem; } .terms h2 { font-size: 1.15rem; margin-top: 1.6rem; } .terms-summary { padding: .8rem 1rem; background: #FFF6E5; border-left: 4px solid var(--orange); }
.terms-caps { font-size: .9rem; line-height: 1.5; letter-spacing: .005em; }

/* ---- Accessibility: text/background contrast (WCAG AA 4.5:1) ---- */
.content .text-gray-400 { color: #62666b; }
.content .text-gray-300 { color: #62666b; }
.content .bg-gray-700 .text-gray-400, .content .bg-gray-800 .text-gray-400, .content .bg-gray-900 .text-gray-400,
.content .bg-gray-700 .text-gray-300, .content .bg-gray-800 .text-gray-300 { color: #d4d8db; }
.content .text-red-300 { color: #b91c1c; }
.content .text-blue-400 { color: #1d6fb0; }
.content .bg-gray-700 .text-blue-400, .content .bg-gray-800 .text-blue-400, .content .bg-gray-900 .text-blue-400 { color: #8ec9f7; }
.content .bg-blue-500 { background-color: #0369a1; }
.content .bg-green-600 { background-color: #15803d; }
.content .text-gray-500 { color: #565a5f; }
#tab-printer, #tab-receipt { color: #565a5f; }
#tab-printer.text-white, #tab-receipt.text-white, #tab-printer[aria-selected="true"], #tab-receipt[aria-selected="true"] { color: #fff; }
.readout.is-off { opacity: 1; }
.readout.is-off .readout-label, .readout.is-off .readout-note { color: #d4d8db; }
.readout-value.is-pending { color: #c9cdd1; }
.sr-only-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

html #lbl-root .text-gray-400, html #lbl-root .text-gray-300 { color: #62666b; }
html #lbl-root .text-gray-500 { color: #565a5f; }
html #lbl-root .bg-gray-700 .text-gray-400, html #lbl-root .bg-gray-800 .text-gray-400, html #lbl-root .bg-gray-900 .text-gray-400 { color: #d4d8db; }
html #lbl-root .text-red-300 { color: #b91c1c; }
html #lbl-root .text-blue-400 { color: #1d6fb0; }
html #lbl-root .bg-gray-700 .text-blue-400, html #lbl-root .bg-gray-800 .text-blue-400, html #lbl-root .bg-gray-900 .text-blue-400 { color: #8ec9f7; }
html #lbl-root .bg-blue-500 { background-color: #0369a1; }
html #lbl-root .bg-green-600 { background-color: #15803d; }

html #stk-root .text-gray-400, html #stk-root .text-gray-300 { color: #62666b; }
html #stk-root .text-gray-500 { color: #565a5f; }
html #stk-root .bg-gray-700 .text-gray-400, html #stk-root .bg-gray-800 .text-gray-400, html #stk-root .bg-gray-900 .text-gray-400 { color: #d4d8db; }
html #stk-root .text-red-300 { color: #b91c1c; }
html #stk-root .text-blue-400 { color: #1d6fb0; }
html #stk-root .bg-gray-700 .text-blue-400, html #stk-root .bg-gray-800 .text-blue-400, html #stk-root .bg-gray-900 .text-blue-400 { color: #8ec9f7; }
html #stk-root .bg-blue-500 { background-color: #0369a1; }
html #stk-root .bg-green-600 { background-color: #15803d; }
html #stk-root .bg-red-50.opacity-50 { opacity: 1; }
html #stk-root .bg-red-50 .text-red-300 { color: #991b1b; }

.tool-note { margin: 0 0 1rem; padding: .7rem .9rem; max-width: 52rem; background: #E1F0F0; border-left: 4px solid #2F6F73; border-radius: 4px; color: #1f3b3d; }

.grp-files { --grp: #5B5F97; --grp-tint: #E9EAF5; }

/* per-tool explanation under each tool (search-friendly text, readable by everyone) */
.tool-about { max-width: 52rem; margin: 2.5rem 0 1rem; padding-top: 1.5rem; border-top: 1px solid var(--line, #cfd6dc); line-height: 1.55; }
.tool-about h2 { font-size: 1.25rem; margin: 0 0 .5rem; } .tool-about h3 { font-size: 1.02rem; margin: 1.2rem 0 .3rem; }
.tool-about ol { padding-left: 1.3rem; } .tool-about li { margin: .25rem 0; }
.ta-faq dt { font-weight: 600; margin-top: .8rem; } .ta-faq dd { margin: .2rem 0 0; }
.ta-fine { font-size: .85rem; color: #4d5863; } .ta-related { padding-left: 1.2rem; }

/* motor circuit builder: notes under "How this was worked out" and the wide drive picker */
.method-notes { display: grid; gap: .5rem; margin-top: .8rem; max-width: 52rem; }
.method-note { margin: 0; padding: .55rem .8rem; background: #F2F4F6; border-left: 4px solid #8794A0; border-radius: 3px; font-size: .92rem; }
.field-wide { grid-column: 1 / -1; }

/* phones: the page title plate gets its own full-width row, so long names don't squeeze between the buttons */
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; row-gap: .6rem; }
  .topbar .nav-toggle { order: 1; }
  .topbar .fb-link { order: 2; margin-left: auto; }
  .topbar #install-btn { order: 2; }
  .topbar-title { order: 3; flex: 1 0 100%; }
}
