.detail { display: block; width: 100%; max-width: 920px; margin: 0 auto; padding: 48px 28px 88px; }
.detail a { color: var(--deep-blue); text-underline-offset: 4px; }
.record-type { margin: 0 0 12px; color: var(--muted); }
.detail h1 { overflow-wrap: anywhere; color: var(--deep-blue); }
.detail h2 { font-size: 23px; font-weight: 600; margin: 0 0 18px; }
.detail p { line-height: 1.7; }
.data-section p { color: var(--muted); }
@media (max-width: 600px) {
    .detail { padding: 28px 20px 60px; }
}

.data-section { margin-top: 40px; }
.knot-diagram { display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; width: min(100%, 448px); aspect-ratio: 1; margin: 28px auto; padding: 24px; background: #fff; border: 1px solid var(--border); border-radius: 0; }
.knot-diagram img { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; }
.knot-diagram p { color: var(--muted); }
.braid-diagram { margin: 24px 0; padding: 20px; overflow-x: auto; background: #fff; border: 1px solid var(--border); color: var(--deep-blue); }
.braid-diagram svg { display: block; max-width: none; margin: 0 auto; }
.knot-data { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 16px; line-height: 1.7; }
.knot-data th, .knot-data td { padding: 14px 0; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.knot-data th { width: 150px; padding-right: 24px; font-weight: 400; color: var(--muted); }
.data-table-scroll { overflow-x: auto; }
.catalogue-scroll { margin: 20px 0; border: 1px solid var(--border); background: #fff; }
.catalogue-table { border-collapse: collapse; width: max-content; min-width: 100%; }
.catalogue-table th, .catalogue-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); text-align: left; white-space: nowrap; }
.catalogue-table th { background: #f2efe8; }
.table-pagination, .table-pagination form { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.table-pagination { margin: 20px 0; }
.table-pagination input { width: 7em; padding: 5px 8px; border: 1px solid var(--border); border-radius: 4px; background: #fff; }
.table-pagination button { padding: 5px 10px; border: 1px solid var(--border); border-radius: 4px; background: #fff; }
.knot-record-data { min-width: 540px; }
.knot-data.knot-record-data th { width: 240px; white-space: nowrap; }
.pd-value { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pd-value input { flex: 1; width: 0; min-width: 0; height: 36px; padding: 5px 9px; border: 1px solid var(--border); border-radius: 4px; background: #fff; text-overflow: ellipsis; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.pd-value input:focus { outline: 2px solid var(--deep-blue); outline-offset: 2px; }
.copy-link { flex-shrink: 0; border: 0; padding: 8px 0; background: none; color: var(--deep-blue); text-decoration: underline; text-underline-offset: 3px; }
.copy-status { display: block; font-size: 14px; }
.copy-check { display: inline-block; width: 1em; margin-left: 4px; visibility: hidden; }
.copy-link.copied .copy-check { visibility: visible; }
.query-record { margin-top: 24px; padding: 20px 24px; border: 1px solid var(--border); border-radius: 10px; background: #f2efe8; }
.query-record h2 { font-size: 15px; margin: 0 0 7px; font-weight: 600; }
.exact-query { white-space: pre-wrap; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 15px; }
.query-record p { margin: 0; font-size: 13px; color: var(--muted); }
.normalizer-result { margin-top: 24px; }
.normalizer-result .result-label { margin: 0 0 10px; }
.tool-result-output { padding: 20px 24px; background: #f2efe8; border: 0; border-radius: 0; overflow-x: auto; }
.tool-result-output > :first-child { margin-top: 0; }
.tool-result-output > :last-child { margin-bottom: 0; }
#normalizer-output { min-height: 1.7em; }
.tools-table { width: 100%; margin-top: 36px; border-collapse: collapse; }
.tools-table th, .tools-table td { text-align: left; vertical-align: top; padding: 16px 20px 16px 0; border-bottom: 1px solid var(--border); line-height: 1.7; }
.normalizer-form { margin: 28px 0; }
.normalizer-form label { display: block; margin-bottom: 10px; }
.normalizer-form .search-box { gap: 8px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.normalizer-form .search-box:focus-within { box-shadow: none; }
.normalizer-form .search-box input { height: 40px; padding: 0 11px; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.normalizer-form .search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #ff6c0c20; }
.normalizer-form .search-submit { height: 40px; min-height: 40px; padding: 0 12px; border-radius: 6px; }
.normalizer-form .examples { justify-content: flex-start; }
.tool-section { margin-top: 36px; }
.tool-panel { padding: 28px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.tool-panel .normalizer-form { margin-bottom: 0; }
@media (max-width: 600px) {
    .tool-panel { padding: 20px 16px; }
    .tool-result-output { padding: 16px; }
}
.tool-breadcrumb { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.6rem; font-family: "Manrope", system-ui, sans-serif; font-size: clamp(1.4rem, 3vw, 1.8rem); font-weight: 700; line-height: 1.1; }
.tool-breadcrumb h1 { margin: 0; font: inherit; letter-spacing: normal; }
.tool-breadcrumb > span { color: var(--muted); }
.tool-heading-rule { margin: 20px 0 0; border: 0; border-top: 1px solid var(--border); }
.reference-code { max-width: 100%; max-height: 40rem; overflow: auto; background: white; border: 1px solid var(--border); border-radius: 6px; padding: 20px; font: 14px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.normalized-expression { overflow-wrap: anywhere; }
@media (max-width: 600px) { .knot-data th { width: 115px; padding-right: 16px; } }

.calculation-help { font-size: .9rem; line-height: 1.6; }
.calculation-error { color: #9a3b32; border-left: 3px solid currentColor; padding-left: 1rem; }
.calculation-error p { margin: 0; }
.calculation-form code, .tools-table td { overflow-wrap: anywhere; }

.search-invariants th { width: 220px; }
.search-invariants code { white-space: pre-wrap; overflow-wrap: anywhere; }
.identification-list { overflow-wrap: anywhere; }
.search-invariants small { font-size: 12px; }

/* Logical column types: hover or focus for a hint; follow for the definition. */
.type-info { position: relative; display: inline-flex; vertical-align: middle; align-items: center; margin-left: .2rem; color: var(--muted, #59676d); text-decoration: none; }
.type-info:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 50%; }
.type-tooltip { display: none; position: absolute; top: calc(100% + .3rem); left: 0; z-index: 10; padding: .4rem .6rem; border: 1px solid var(--border); border-radius: 4px; background: #fff; color: #17343f; font-size: .85rem; font-weight: normal; box-shadow: 0 2px 6px #0002; white-space: nowrap; }
.type-info:hover .type-tooltip, .type-info:focus .type-tooltip { display: block; }
.row-type-definition { overflow-x: auto; padding: 1rem; background: #f2efe8; border-radius: 6px; }

.table-width-region { width: 100%; margin-left: 0; transition: width 280ms ease-in-out, margin-left 280ms ease-in-out; }
.table-width-region.is-expanded { width: var(--table-expanded-width); margin-left: calc((100% - var(--table-expanded-width)) / 2); }
.table-pagination .table-expand { margin-left: auto; display: inline-flex; align-items: center; justify-content: center; min-width: 36px; min-height: 34px; color: var(--deep-blue); cursor: pointer; }
.table-expand[hidden] { display: none; }
.table-expand:hover { background: #f2efe8; }
.table-expand:focus-visible { outline: 2px solid var(--deep-blue); outline-offset: 3px; }
.table-expand .collapse-icon, .table-expand[aria-expanded="true"] .expand-icon { display: none; }
.table-expand[aria-expanded="true"] .collapse-icon { display: block; }
@media (prefers-reduced-motion: reduce) {
    .table-width-region { transition: none; }
}
