:root {
    --portal-primary: #4f46e5;
    --portal-primary-dark: #3730a3;
    --portal-ink: #172033;
    --portal-muted: #64748b;
    --portal-surface: #f6f8fc;
    --portal-border: #e7eaf2;
}

body { color: var(--portal-ink); background: #fff; font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
a { text-underline-offset: .18em; }
.navbar { --bs-navbar-color: #485266; backdrop-filter: blur(14px); }
.brand-mark { width: 2.15rem; height: 2.15rem; display: inline-grid; place-items: center; color: #fff; border-radius: .72rem; background: linear-gradient(135deg, var(--portal-primary), #2563eb); box-shadow: 0 8px 18px rgba(79, 70, 229, .2); }
.hero { position: relative; overflow: hidden; background: radial-gradient(circle at 85% 20%, rgba(129, 140, 248, .23), transparent 28rem), linear-gradient(180deg, #f7f7ff 0%, #fff 100%); border-bottom: 1px solid var(--portal-border); }
.hero::after { content: ""; position: absolute; width: 18rem; height: 18rem; border-radius: 50%; right: -9rem; bottom: -10rem; background: rgba(79, 70, 229, .08); }
.hero-kicker { color: var(--portal-primary); letter-spacing: .08em; font-size: .78rem; font-weight: 800; text-transform: uppercase; }
.hero h1 { max-width: 790px; letter-spacing: -.045em; }
.hero-copy { color: var(--portal-muted); max-width: 650px; font-size: 1.12rem; }
.search-shell { max-width: 760px; padding: .45rem; background: #fff; border: 1px solid var(--portal-border); border-radius: 1rem; box-shadow: 0 18px 45px rgba(30, 41, 59, .09); }
.search-shell .form-control { border: 0; box-shadow: none; min-height: 3rem; }
.btn-primary { --bs-btn-bg: var(--portal-primary); --bs-btn-border-color: var(--portal-primary); --bs-btn-hover-bg: var(--portal-primary-dark); --bs-btn-hover-border-color: var(--portal-primary-dark); }
.text-primary { color: var(--portal-primary) !important; }
.section-muted { background: var(--portal-surface); }
.category-card, .tool-card { position: relative; height: 100%; border: 1px solid var(--portal-border); border-radius: 1rem; background: #fff; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.category-card:hover, .tool-card:hover { transform: translateY(-3px); border-color: #c7d2fe; box-shadow: 0 16px 34px rgba(30, 41, 59, .08); }
.category-icon, .tool-icon { display: inline-grid; place-items: center; width: 3rem; height: 3rem; border-radius: .85rem; background: #eef2ff; color: var(--portal-primary); font-size: 1.25rem; }
.category-card a, .tool-card a { color: inherit; text-decoration: none; }
.tool-card p, .category-card p { color: var(--portal-muted); }
.section-heading { letter-spacing: -.025em; }
.empty-state { max-width: 640px; padding: 3rem 1.5rem; text-align: center; border: 1px dashed #cbd5e1; border-radius: 1rem; background: #fff; }
.breadcrumb { --bs-breadcrumb-divider-color: #94a3b8; font-size: .92rem; }
.content-card { border: 1px solid var(--portal-border); border-radius: 1rem; box-shadow: 0 12px 28px rgba(30, 41, 59, .05); }

.document-drop-zone { border-style: dashed !important; cursor: pointer; background: #f8fafc; transition: border-color .2s, background-color .2s; }
.document-drop-zone:hover, .document-drop-zone.is-dragging { border-color: var(--bs-primary) !important; background: #eef6ff; }
.document-page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 1rem; }
.document-page-card { position: relative; border: 2px solid #e2e8f0; border-radius: .75rem; background: #fff; padding: .5rem; text-align: center; cursor: pointer; overflow: hidden; }
.document-page-card.is-selected { border-color: var(--bs-primary); box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .12); }
.document-page-card canvas { display: block; max-width: 100%; height: auto; margin: 0 auto .5rem; transition: transform .2s; }
.document-page-card .page-actions { display: flex; justify-content: center; gap: .25rem; }
.document-preview-image { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #f8fafc; }

/* Document Tools 1.2: a focused upload-first workspace. */
.document-tool-page { max-width: 1180px; }
.document-tool-page > nav { display: none; }
.document-tool-header { max-width: 960px; margin-inline: auto; text-align: center; }
.document-tool-header .tool-icon { display: none; }
.document-tool-header h1 { margin-bottom: .65rem; color: #252735; font-size: clamp(2.15rem, 5vw, 3.75rem); letter-spacing: -.045em; }
.document-tool-header .lead { max-width: 880px; margin: 0 auto; font-size: clamp(1rem, 2vw, 1.35rem); }
.document-tool-header-actions { justify-content: center; margin-top: 1rem; }
.document-tool-header-actions .btn { border: 0; color: var(--portal-muted); }
.document-tool-page > .content-card { max-width: 1040px; margin-inline: auto; padding: clamp(1.25rem, 3vw, 2.5rem) !important; border: 0; box-shadow: none; }
.document-tool-page .tool-workspace { max-width: 900px; }
.document-upload-field > .form-label { display: block; margin-bottom: .75rem; text-align: center; color: var(--portal-muted); font-size: .86rem; font-weight: 650; text-transform: uppercase; letter-spacing: .055em; }
.document-upload-stage { max-width: 610px; margin-inline: auto; text-align: center; }
.document-upload-picker { display: block; cursor: pointer; }
.document-upload-button { display: flex; min-height: 7.25rem; align-items: center; justify-content: center; gap: .85rem; padding: 1.35rem 2rem; border: 2px solid var(--portal-primary); border-radius: 1.15rem; background: linear-gradient(135deg, var(--portal-primary), #2563eb); color: #fff; box-shadow: 0 14px 26px rgba(79, 70, 229, .22); font-size: clamp(1.25rem, 3vw, 1.75rem); font-weight: 750; transition: transform .18s ease, box-shadow .18s ease, filter .18s ease; }
.document-upload-button .bi { font-size: 1.6rem; }
.document-upload-picker:hover .document-upload-button, .document-upload-stage.is-dragging .document-upload-button { transform: translateY(-2px); filter: brightness(1.04); box-shadow: 0 18px 34px rgba(79, 70, 229, .3); }
.document-upload-picker:focus-within .document-upload-button { outline: .22rem solid rgba(79, 70, 229, .2); outline-offset: .2rem; }
.document-upload-hint { display: block; padding-top: .85rem; color: #475569; font-size: 1rem; font-weight: 500; }
.document-upload-selection { margin: .85rem auto 0; padding: .6rem .9rem; border: 1px solid #c7d2fe; border-radius: .75rem; background: #eef2ff; color: var(--portal-primary-dark); font-size: .9rem; overflow-wrap: anywhere; }
.document-upload-field > .form-text { max-width: 610px; margin: .65rem auto 0; text-align: center; }
.document-simple-workspace:not(.has-document-file) .tool-form > .row > :not(.document-upload-field):not(:has([data-example])) { display: none; }
.document-simple-workspace:not(.has-document-file) .document-form-actions > :not([data-example]) { display: none; }
.document-simple-workspace:not(.has-document-file) .document-form-actions { justify-content: center; border-top: 0; }
.document-simple-workspace.has-document-file .tool-form > .row > :not(.document-upload-field) { animation: document-reveal .22s ease-out both; }
.document-simple-workspace .document-form-actions { margin-top: .35rem; padding-top: 1rem; border-top: 1px solid var(--portal-border); }
.document-simple-workspace .document-form-actions .btn-primary { min-width: 11rem; }
.document-form-actions > button[type="submit"] { order: 1; }
.document-form-actions > [data-document-sticky-result] { order: 2; }
.document-form-actions > button[type="reset"] { order: 3; }
.document-sticky-result { flex: 1 0 100%; display: grid; gap: .65rem; padding-top: .9rem; border-top: 1px solid #dbe2ef; }
.document-sticky-status { display: flex; align-items: center; gap: .45rem; color: #15803d; }
.document-sticky-status .bi { font-size: 1.05rem; }
.document-sticky-result p { display: -webkit-box; margin: 0; overflow: hidden; color: var(--portal-muted); font-size: .82rem; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.document-sticky-download { display: inline-flex; min-height: 3.25rem; align-items: center; justify-content: center; gap: .55rem; font-size: 1.02rem; font-weight: 750; box-shadow: 0 9px 20px rgba(21, 128, 61, .18); }
.document-result-link-mirrored { display: none !important; }
.document-settings-heading h2 { margin: 0 0 .45rem; font-size: 1.65rem; font-weight: 750; letter-spacing: -.025em; }
.document-settings-heading p { margin: 0; color: var(--portal-muted); font-size: .92rem; }
.document-preview-field { min-width: 0; }
.document-preview-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.document-preview-toolbar > div { display: flex; align-items: center; gap: .55rem; }
.document-preview-toolbar > div span { display: inline-grid; min-width: 1.6rem; height: 1.6rem; place-items: center; border-radius: 99rem; background: var(--portal-primary); color: #fff; font-size: .78rem; font-weight: 750; }
.document-preview-toolbar .btn { display: inline-flex; align-items: center; gap: .35rem; }
.document-preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 1rem; align-items: start; }
.document-preview-card { position: relative; min-width: 0; overflow: hidden; border: 1px solid #e2e8f0; border-radius: 1rem; background: #fff; box-shadow: 0 8px 22px rgba(30, 41, 59, .07); transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.document-preview-card[draggable="true"] { cursor: grab; }
.document-preview-card[draggable="true"]:active { cursor: grabbing; }
.document-preview-card:hover { border-color: #a5b4fc; box-shadow: 0 13px 28px rgba(30, 41, 59, .11); transform: translateY(-2px); }
.document-preview-order { position: absolute; z-index: 2; top: .65rem; left: .65rem; display: inline-grid; min-width: 1.7rem; height: 1.7rem; place-items: center; border: 2px solid #fff; border-radius: 99rem; background: var(--portal-primary); color: #fff; box-shadow: 0 3px 10px rgba(30, 41, 59, .2); font-size: .76rem; font-weight: 800; }
.document-preview-frame { display: grid; min-height: 205px; place-items: center; padding: 1rem; border-bottom: 1px solid #eef2f7; background: #f7f8fc; color: var(--portal-muted); }
.document-preview-frame canvas, .document-preview-frame img { display: block; max-width: 100%; max-height: 180px; width: auto; height: auto; object-fit: contain; filter: drop-shadow(0 4px 7px rgba(15, 23, 42, .12)); }
.document-preview-frame.is-fallback { align-content: center; gap: .5rem; text-align: center; font-size: .8rem; }
.document-preview-frame.is-fallback .bi { color: #94a3b8; font-size: 3rem; }
.document-preview-body { display: grid; gap: .35rem; padding: .8rem; }
.document-preview-body > strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.document-preview-body > span { color: var(--portal-muted); font-size: .78rem; }
.document-preview-actions { display: flex; gap: .35rem; margin-top: .3rem; }
.document-preview-actions .btn:last-child { margin-left: auto; }
.document-simple-workspace.has-document-file .document-upload-field { display: none; }
.document-simple-workspace.has-document-file .tool-form .table-responsive:has([data-file-list]) { display: none; }
.document-simple-workspace.has-document-file .document-page-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.document-tool-page:has(.has-document-file) { max-width: 1540px; }
.document-tool-page:has(.has-document-file) .document-tool-header { margin-bottom: 1.25rem !important; }
.document-tool-page:has(.has-document-file) .document-tool-header h1 { font-size: clamp(1.85rem, 3vw, 2.65rem); }
.document-tool-page:has(.has-document-file) .document-tool-header .lead { font-size: 1rem; }
.document-tool-page:has(.has-document-file) > .content-card { max-width: 1460px; border: 1px solid var(--portal-border); background: #f6f7fb !important; box-shadow: 0 12px 30px rgba(30, 41, 59, .06); }
.document-tool-page:has(.has-document-file) .tool-workspace { max-width: none; }
.document-tool-page .tool-help-disclosure, .document-tool-page .tool-description-disclosure { max-width: 900px; margin-inline: auto; }
.document-tool-page .alert-info { max-width: 900px; margin-inline: auto; border: 0; border-radius: .8rem; background: #f1f5f9; color: #475569; font-size: .9rem; }
@keyframes document-reveal { from { opacity: 0; transform: translateY(.35rem); } to { opacity: 1; transform: translateY(0); } }

@media (min-width: 992px) {
    .document-simple-workspace.has-document-file .tool-form > .row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); gap: 1rem 2rem; align-items: start; }
    .document-simple-workspace.has-document-file .tool-form > .row > * { width: auto; max-width: none; grid-column: 2; }
    .document-simple-workspace.has-document-file .tool-form > .row > .document-preview-field { grid-column: 1; grid-row: 1 / span 40; min-height: 540px; padding: 1.25rem; border-radius: 1rem; background: #eef0f6; }
    .document-simple-workspace.has-document-file .tool-form > .row > .document-settings-heading { grid-column: 2; grid-row: 1; padding-bottom: .9rem; border-bottom: 1px solid var(--portal-border); }
    .document-simple-workspace.has-document-file .document-form-actions { position: sticky; z-index: 5; bottom: 1rem; padding: 1rem; border: 1px solid #dbe2ef; border-radius: .85rem; background: rgba(255, 255, 255, .96); box-shadow: 0 10px 24px rgba(30, 41, 59, .1); backdrop-filter: blur(10px); }
    .document-simple-workspace.has-document-file .document-form-actions .btn-primary { flex: 1 1 100%; min-height: 3.25rem; font-size: 1.05rem; font-weight: 700; }
}

@media (max-width: 575.98px) {
    .document-page-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
    .document-tool-page { padding-top: 1.5rem !important; }
    .document-tool-header h1 { font-size: 2.25rem; }
    .document-tool-header .lead { font-size: 1rem; }
    .document-tool-header-actions { margin-top: .6rem; }
    .document-upload-button { min-height: 6.25rem; padding: 1rem; border-radius: 1rem; }
    .document-simple-workspace .document-form-actions .btn { width: 100%; }
    .document-preview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
    .document-preview-frame { min-height: 155px; padding: .7rem; }
    .document-preview-frame canvas, .document-preview-frame img { max-height: 135px; }
    .document-preview-toolbar { align-items: flex-start; }
}

@media (max-width: 991.98px) {
    .document-simple-workspace.has-document-file .document-preview-field { order: -2; padding: 1rem; border-radius: 1rem; background: #eef0f6; }
    .document-simple-workspace.has-document-file .document-settings-heading { order: -1; margin-top: .5rem; }
    .document-simple-workspace.has-document-file .document-form-actions { position: sticky; z-index: 10; bottom: .5rem; padding: .75rem; border: 1px solid #dbe2ef; border-radius: .8rem; background: rgba(255, 255, 255, .96); box-shadow: 0 8px 22px rgba(30, 41, 59, .13); }
}
.site-footer { background: #f8fafc; border-top: 1px solid var(--portal-border); }
.footer-links li + li { margin-top: .55rem; }
.footer-links a { color: var(--portal-muted); text-decoration: none; }
.footer-links a:hover { color: var(--portal-primary); }
.nav-tool-link { max-width: 8.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
@media (min-width: 1400px) { .nav-tool-link { max-width: 11rem; } }
@media (max-width: 1199.98px) { .nav-tool-link { max-width: none; } }
.tracking-wide { letter-spacing: .08em; }
.ad-slot { margin: 2rem 0; padding: 1rem; text-align: center; }
.admin-shell { min-height: 100vh; background: var(--portal-surface); }
.tool-workspace { max-width: 980px; margin-inline: auto; }
.tool-editor { min-height: 13rem; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; line-height: 1.55; }
.tool-result { padding: 1rem; border: 1px solid #c7d2fe; border-radius: .9rem; background: #f8faff; }
.tool-result.spin-wheel-fullscreen { width: 100%; height: 100%; overflow: auto; border: 0; border-radius: 0; background: #f8faff; padding: 1rem; }
.tool-result.spin-wheel-fullscreen [data-legacy-output] canvas { width: auto; max-width: 100%; max-height: calc(100vh - 13rem); }
.tool-result.spin-wheel-fullscreen [data-legacy-output] { display: flex; min-height: calc(100vh - 5rem); flex-direction: column; justify-content: center; }
.result-table th { width: 38%; color: var(--portal-muted); font-weight: 600; }
.result-table td { overflow-wrap: anywhere; }
.result-stat { height: 100%; padding: 1rem; border: 1px solid var(--portal-border); border-radius: .8rem; background: #fff; }
.result-stat span { display: block; margin-bottom: .35rem; color: var(--portal-muted); font-size: .85rem; }
.result-stat strong { display: block; overflow-wrap: anywhere; color: var(--portal-primary-dark); font-size: 1.25rem; }
.tool-note { padding: .85rem 1rem; border-left: .25rem solid #818cf8; border-radius: .25rem .7rem .7rem .25rem; background: #f5f7ff; color: #475569; }
.tool-help-disclosure, .tool-description-disclosure { overflow: hidden; border: 1px solid var(--portal-border); border-radius: .8rem; background: #fff; color: #475569; }
.tool-help-disclosure summary, .tool-description-disclosure summary { position: relative; padding: .8rem 3rem .8rem 1rem; color: var(--portal-ink); font-weight: 650; cursor: pointer; list-style: none; user-select: none; }
.tool-help-disclosure summary::-webkit-details-marker, .tool-description-disclosure summary::-webkit-details-marker { display: none; }
.tool-help-disclosure summary::after, .tool-description-disclosure summary::after { content: "+"; position: absolute; top: 50%; right: 1rem; color: var(--portal-muted); font-size: 1.3rem; font-weight: 400; line-height: 1; transform: translateY(-50%); transition: transform .18s ease; }
.tool-help-disclosure[open] summary::after, .tool-description-disclosure[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.tool-help-disclosure[open] summary, .tool-description-disclosure[open] summary { border-bottom: 1px solid var(--portal-border); background: #f8fafc; }
.tool-disclosure-body { padding: 1rem; }
.tool-disclosure-body > :last-child { margin-bottom: 0; }
.random-number-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(5rem, 1fr)); gap: .6rem; }
.random-number-grid > * { padding: .75rem; border: 1px solid var(--portal-border); border-radius: .65rem; background: #fff; text-align: center; font-weight: 700; }
.group-card { height: 100%; padding: 1rem; border: 1px solid var(--portal-border); border-radius: .8rem; background: #fff; }
.group-card li + li { margin-top: .35rem; }

.color-tool-workspace .tool-form { background: #f8fbff; border: 1px solid #dbeafe; border-radius: 1rem; padding: clamp(1rem, 3vw, 1.5rem); }
.color-preview { align-items: center; border: 1px solid rgba(15, 23, 42, .12); border-radius: 1rem; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); display: flex; justify-content: center; min-height: 230px; padding: 1.25rem; transition: background-color .2s ease, color .2s ease; }
.color-preview span { background: rgba(255, 255, 255, .78); border-radius: .5rem; color: #111827; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; padding: .4rem .65rem; }
.color-history-swatch { border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px #94a3b8; height: 2.25rem; width: 2.25rem; }
.color-history-swatch:focus-visible { box-shadow: 0 0 0 .25rem rgba(37, 99, 235, .3); outline: 2px solid #1d4ed8; }
.color-drop-zone { border: 2px dashed #93c5fd; border-radius: 1rem; background: #eff6ff; padding: 1rem; transition: border-color .2s ease, background .2s ease; }
.color-drop-zone.is-dragging { border-color: #2563eb; background: #dbeafe; }
.color-result-card { border: 0; border-radius: .75rem; display: flex; flex-direction: column; gap: .2rem; justify-content: end; min-height: 150px; padding: .75rem; text-align: left; text-shadow: 0 1px 2px rgba(0,0,0,.18); width: 100%; }
.color-result-card span { font-size: .76rem; overflow-wrap: anywhere; }
.color-result-card:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }
.image-processing-drop-zone { background: #eff6ff; border: 2px dashed #93c5fd; border-radius: 1rem; padding: 1rem; transition: background-color .2s ease, border-color .2s ease; }
.image-processing-drop-zone.is-dragging { background: #dbeafe; border-color: #2563eb; }
.image-processing-canvas-card { background: #f8fafc; border: 1px solid rgba(15, 23, 42, .12); border-radius: 1rem; height: 100%; padding: 1rem; }
.image-processing-canvas-scroll { align-items: center; background-image: linear-gradient(45deg,#e2e8f0 25%,transparent 25%),linear-gradient(-45deg,#e2e8f0 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#e2e8f0 75%),linear-gradient(-45deg,transparent 75%,#e2e8f0 75%); background-position: 0 0,0 8px,8px -8px,-8px 0; background-size: 16px 16px; border-radius: .75rem; display: flex; justify-content: center; max-height: 560px; min-height: 220px; overflow: auto; }
.image-processing-canvas-scroll canvas { display: block; height: auto; image-rendering: auto; max-width: 100%; }
.image-processing-canvas-scroll canvas:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }
.image-analysis-side-result { align-self: stretch; background: #f8fafc; border: 1px solid rgba(15, 23, 42, .12); border-radius: 1rem; padding: .85rem; }
.image-analysis-side-result > .d-flex { margin-bottom: .65rem !important; }
.image-analysis-side-result [data-result-title] { font-size: 1rem; }
.image-analysis-side-result [data-result-actions] { gap: .3rem !important; }
.image-analysis-side-result [data-result-actions] .btn { font-size: .72rem; padding: .25rem .45rem; }
.pixel-inspector-result .result-stat { border-radius: .6rem; padding: .5rem .65rem; }
.pixel-inspector-result .result-stat span { font-size: .7rem; line-height: 1.2; margin-bottom: .15rem; }
.pixel-inspector-result .result-stat strong { font-size: .88rem; line-height: 1.25; }
.image-matrix-wrapper { max-height: 620px; }
.image-matrix-table td { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .76rem; min-width: 72px; }
.pixel-matrix-result .image-matrix-wrapper { max-height: 500px; }
.pixel-matrix-result .image-matrix-table { margin-bottom: 0; }
.pixel-matrix-result .image-matrix-table td { font-size: .62rem; min-width: 52px; padding: .25rem; }
.image-statistics-summary { font-size: .72rem; line-height: 1.35; margin-bottom: .6rem; }
.image-statistics-table-wrapper { max-height: 500px; }
.image-statistics-table { font-size: .68rem; margin-bottom: 0; white-space: nowrap; }
.image-statistics-table > :not(caption) > * > * { padding: .32rem .38rem; }
.image-statistics-table th:first-child, .image-statistics-table td:first-child { background: #f8fafc; left: 0; position: sticky; z-index: 1; }
@media (max-width: 575.98px) { .image-processing-canvas-scroll { min-height: 160px; } .image-matrix-table td { font-size: .68rem; min-width: 60px; } .image-analysis-side-result { padding: .75rem; } }
[data-image-stage] canvas { max-height: 560px; transform-origin: center; }
.electrical-unit { max-width: 110px; }
.electrical-resistor-visual { overflow-x: auto; }
.electrical-resistor-body { align-items: stretch; background: linear-gradient(#d6b57b,#f2d49b,#d6b57b); border: 2px solid #8b6b3f; border-radius: 2rem; display: flex; gap: clamp(.6rem,4vw,2.2rem); height: 92px; justify-content: center; margin: 0 auto; min-width: 320px; padding: 0 2.5rem; width: min(100%,620px); }
.electrical-resistor-band { border-left: 1px solid rgba(0,0,0,.25); border-right: 1px solid rgba(0,0,0,.25); display: block; min-width: 18px; }
.electrical-resistor-row .form-label { margin: 0; }

@media (max-width: 575.98px) {
    .hero { text-align: center; }
    .hero h1 { font-size: 2.2rem; }
    .search-shell { border-radius: .9rem; }
    .search-shell .btn { width: 100%; }
}

@media print {
    body * { visibility: hidden !important; }
    .tool-result, .tool-result * { visibility: visible !important; }
    .tool-result { position: absolute; inset: 0 auto auto 0; width: 100%; border: 0; background: #fff; }
    .tool-result button { display: none !important; }
}
