.fs-dimensions { margin-top: clamp(18px, 3vw, 34px); }
.fs-dim-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 10px 18px;
    margin-block: 16px;
}
.fs-dim-controls[hidden] { display: none; }
.fs-dim-controls label { display: grid; gap: 4px; font-size: .9rem; font-weight: 600; }
.fs-dim-controls select, .fs-dim-controls input[type="number"] {
    width: 100%;
    min-height: 40px;
    padding: 6px 9px;
    border: 1px solid var(--border, #b4c6d5);
    border-radius: 6px;
    background: #fff;
    color: inherit;
    font: inherit;
}
.fs-dim-controls input[type="number"] { width: 150px; }
.fs-dim-controls .fs-dim-toggle { display: flex; align-items: center; min-height: 40px; }
.fs-dim-figure {
    margin: 12px 0;
    padding: 10px;
    border: 1px solid var(--border, #b4c6d5);
    border-radius: 8px;
    background: var(--panel, #f3f7fa);
    color: var(--ink, #1f3348);
}
.fs-dim-figure svg { display: block; width: min(100%, 740px); height: auto; margin: auto; }
.fs-dim-figure figcaption { color: var(--muted, #445e73); text-align: center; font-size: .85rem; }
.fs-dim-annotations { color: #275578; font: 600 15px system-ui, sans-serif; }
.fs-dim-scroll { max-width: 100%; overflow-x: auto; margin-block: 14px; }
.fs-dim-table { width: 100%; min-width: 490px; border-collapse: collapse; font-size: .92rem; }
.fs-dim-table caption { margin-bottom: 6px; text-align: left; font-weight: 600; }
.fs-dim-table th, .fs-dim-table td { padding: 8px 10px; border: 1px solid var(--border, #b4c6d5); text-align: center; }
.fs-dim-table th { background: var(--panel, #f3f7fa); }
.fs-dim-table th:first-child { text-align: left; }
.fs-dim-table tbody th { font-weight: 400; }
.fs-dim-table .is-dim-selected { background: #dcecf8; color: #143b5a; }
@media (max-width: 500px) {
    .fs-dim-controls .fs-dim-toggle { flex-basis: 100%; }
    .fs-dim-figure { padding: 5px; }
}

.fs-dim-wide { min-width: 1080px; }
.fs-dim-wide th, .fs-dim-wide td { white-space: nowrap; }
.fs-dim-wide th:first-child { position: sticky; left: 0; z-index: 1; width: 160px; min-width: 140px; white-space: normal; }
.fs-dim-wide thead a { display: inline-block; color: #155987; text-decoration: underline; }
.fs-5782-standards th:first-child { text-align: center; }
.fs-5782-standards th, .fs-5782-standards td { white-space: nowrap; }
.fs-5782-standards td { color: #155987; font-weight: 600; }
.fs-drawing-only .fs-dim-table { min-width: 0; }
.fs-drawing-only .fs-dim-table [data-dim-column]:not(.is-dim-selected) { display: none; }

.fs-yjt-drawing { background: #fff; }
.fs-yjt-drawing svg { width: min(100%, 900px); }
.fs-yjt-drawing p { text-align: center; margin-top: 6px; }
.fs-yjt-values { fill: #155987; stroke: #fff; stroke-width: 3; paint-order: stroke; font-size: 16px; }

.fs-yjt-embed { overflow-x: auto; max-width: 1142px; margin: 12px auto; border: 1px solid var(--border); }
.fs-yjt-embed iframe { display: block; width: 1140px; height: min(76vh, 760px); min-height: 580px; border: 0; }
.fs-yjt-backup { margin-top: 20px; }
.fs-yjt-backup > summary { cursor: pointer; font-weight: 600; }

.fs-5782-selection { margin-block: 14px; }
.fs-5782-selection > h2 { font-size: 1.12rem; margin-bottom: 8px; }
.fs-5782-selection .fs-dim-controls { margin-block: 8px; }
.fs-5782-selection input[data-dim-length] {
    width: 150px;
    min-height: 40px;
    padding: 6px 9px;
    border: 1px solid var(--border, #b4c6d5);
    border-radius: 6px;
    background: #fff;
    color: inherit;
    font: inherit;
}
.fs-dim-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.fs-dim-actions [hidden] { display: none; }
.fs-dim-note { font-size: .85rem; color: var(--muted, #445e73); }
.fs-dim-art { overflow-x: auto; }
@media (max-width: 600px) {
    .fs-dim-art svg { min-width: 500px; }
}


.fs-inline-drawing-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; gap: 16px; }
.fs-inline-drawing-grid .fs-dim-scroll { margin: 0; }
.fs-inline-drawing-grid .fs-series-table { width: 100%; }
.fs-inline-dimensions .fs-dim-controls button[hidden] { display: none; }
@media (max-width: 850px) {
    .fs-inline-drawing-grid { grid-template-columns: minmax(0, 1fr); }
}
.technical > .fs-dimensions { margin-top: 0; }
.fs-series-table { min-width: 0; }
.fs-thread-length { padding: 8px 12px; margin: 8px 0; border-radius: 6px; background: var(--panel, #eef4f8); font-size: .92rem; font-weight: 600; }

.fs-dim-controls label, .fs-dim-controls select, .fs-dim-controls input[type="number"],
.fs-dim-table, .tech-panel .fs-dim-table, .fs-thread-length {
    font-size: 1rem;
    line-height: 1.55;
}
.fs-dim-note, .fs-dim-figure figcaption { font-size: .9375rem; }
.fs-5782-selection > h2 { font-size: 1.25rem; }

/* Keep original drawings open; enquiry controls are independent of the backup. */
.fs-drawing-tools { margin: 0; }
.fs-enquiry-panel { margin-top: 24px; scroll-margin-top: 24px; }
.fs-enquiry-panel > .button { margin-top: 12px; }
.fs-yjt-views > *, .fs-enquiry-panel .fs-dim-controls > * { min-width: 0; }
.fs-yjt-embed { max-width: 100%; overscroll-behavior-x: contain; }
.fs-drawing-scroll-hint { display: none; }
.fs-yjt-backup > summary, .fs-dim-toggle { min-height: 44px; padding-block: 10px; }
.fs-yjt-backup .fs-dim-toggle { display: flex; gap: 8px; align-items: center; }
.fs-enquiry-panel :is(h2,p,a), .fs-yjt-original h2 { overflow-wrap: anywhere; }
@media (max-width: 600px) {
    .fs-drawing-scroll-hint { display: block; font-size: 1rem; font-weight: 600; }
    .fs-enquiry-panel .button, .fs-drawing-tools .button { width: 100%; white-space: normal; text-align: center; }
    .fs-enquiry-panel .fs-dim-actions { display: grid; grid-template-columns: minmax(0,1fr); }
    .fs-enquiry-panel input[data-dim-length] { width: 100%; font-size: 16px; min-height: 44px; }
}

@media (max-width: 600px) {
    .fs-yjt-views .fs-dim-controls { display: grid; grid-template-columns: minmax(0,1fr); }
    .fs-yjt-views .fs-dim-controls label { width: 100%; min-width: 0; }
    .fs-yjt-views .fs-dim-controls :is(select,input:not([type=checkbox])) { width: 100%; min-height: 44px; font-size: 16px; }
}
/* Rebar coupler drawing: size, drawing and dimensions are in one panel. */
.fs-coupler-drawing-grid .fs-dim-controls { display: block; }
.fs-coupler-drawing-grid .fs-dim-controls select { display: block; width: 100%; margin-top: 8px; }
.fs-coupler-drawing-grid .fs-dim-actions .button { white-space: normal; text-align: center; }
.fs-coupler-drawing-grid .fs-5782-selection { margin: 0; }
.fs-coupler-drawing-grid .fs-dim-figure img { width: min(100%, 280px); }
@media (min-width: 1000px) {
    .fs-inline-drawing-grid.fs-coupler-drawing-grid {
        grid-template-columns: minmax(155px, .65fr) minmax(0, 1.6fr) minmax(285px, 1.45fr);
    }
}
@media (max-width: 999px) {
    .fs-inline-drawing-grid.fs-coupler-drawing-grid { grid-template-columns: minmax(0, 1fr); }
}
/* Drawing and selected dimensions for the full-thread hex bolt. */
.fs-fastener-drawing {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(16rem, 23rem);
    align-items: start;
    gap: 1rem 1.5rem;
}
.fs-fastener-specs .fs-dim-controls { grid-template-columns: 1fr; }
.fs-fastener-specs output { display: block; font-weight: 600; }
.fs-fastener-values .fs-dim-table { min-width: 0; }
.fs-fastener-values [data-dim-column]:not(.is-dim-selected) { display: none; }
@media (max-width: 800px) {
    .fs-fastener-drawing { grid-template-columns: minmax(0, 1fr); }
}
.fs-fastencloud-original { grid-row: span 2; margin: 0; }
.fs-fastencloud-original img { width: 100%; height: auto; }
@media (max-width: 800px) {
    .fs-fastencloud-original { grid-row: auto; }
}