:root { color-scheme: light; font: 16px/1.5 system-ui, sans-serif; color: #330000; background: #f3f6f8; }
* { box-sizing: border-box; }
body { margin: 0; }
header { background: #cc0000; color: white; padding: 28px max(22px, calc((100vw - 1280px)/2)); }
h1 { margin: 0 0 5px; font-size: 1.8rem; }
header p { margin: 0; color: #d9eaf2; }
main { max-width: 1320px; margin: 25px auto; padding: 0 20px 40px; }
.card { background: white; border: 1px solid #dce5e9; border-radius: 13px; padding: 20px; }
.intro { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-bottom: 22px; }
.intro p { margin: 3px 0; }
.intro-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.stock-filter { display: flex; align-items: center; gap: 22px; margin-bottom: 22px; }
.stock-filter-control { display: flex; flex-direction: column; gap: 6px; flex: 0 0 230px; }
.stock-filter-control label { font-weight: 700; }
.stock-filter-control input { width: 100%; border: 1px solid #97b2c0; border-radius: 8px; padding: 10px; color: #330000; background: white; font: inherit; }
.stock-filter-control input:focus-visible { outline: 2px solid #cc0000; outline-offset: 2px; }
.stock-filter p { margin: 3px 0; }
.muted { color: #7d4949; }
.button, button { cursor: pointer; border: 1px solid #97b2c0; border-radius: 8px; padding: 9px 13px; background: white; color: #330000; font: inherit; }
.button { display: inline-block; text-decoration: none; font-weight: 700; white-space: nowrap; }
.primary { background: #cc0000; border-color: #cc0000; color: white; }
button:hover, .button:hover { background: #e5c6c6; }
.primary:hover { background: #a60000; }
.layout { display: grid; grid-template-columns: minmax(250px, 320px) minmax(0, 1fr); gap: 20px; align-items: start; }
.catalog-content { min-width: 0; }
.xml-help { margin-top: 14px; }
.xml-help h2 { margin: 0 0 14px; padding: 8px 16px; border-radius: 8px; background: #cc0000; color: white; font-size: 1.15rem; line-height: 1.4; }
.xml-help-link { display: inline-block; margin-left: 2px; border-radius: 12px; line-height: 0; }
.xml-help-icon { display: block; width: 94px; height: 112px; }
.xml-help-link:hover { opacity: .9; }
.xml-help-link:focus-visible { outline: 3px solid #a60000; outline-offset: 5px; }
h2 { margin: 0 0 12px; font-size: 1.25rem; }
.tree { max-height: 69vh; overflow: auto; }
.tree ul { list-style: none; padding-left: 19px; margin: 0; border-left: 1px solid #e2e9ed; }
.tree > ul { border: 0; padding-left: 0; }
.tree li { margin: 3px 0; }
.tree summary { cursor: pointer; padding: 5px 3px; }
.tree summary:hover, .tree summary.active { background: #e9f4f8; border-radius: 5px; }
.tree small { color: #6c7e88; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.toolbar input[type=search] { flex: 1 1 210px; min-width: 0; border: 1px solid #a4b8c2; border-radius: 8px; padding: 10px; font: inherit; }
.table-wrap { overflow: auto; max-height: 61vh; border: 1px solid #e2e9ed; border-radius: 8px; }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid #e8edf0; padding: 9px; text-align: left; vertical-align: top; }
th { position: sticky; top: 0; background: #f5f8fa; z-index: 1; }
td:first-child { width: 42px; }
td:nth-child(3), td:nth-child(4) { white-space: nowrap; }
.hidden-label { color: #9b4b24; font-size: .8rem; white-space: nowrap; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.actions form { display: flex; gap: 10px; flex-wrap: wrap; margin: 0; }
@media (max-width: 800px) { .layout { grid-template-columns: 1fr; } .tree { max-height: 35vh; } .intro { display: block; } .intro .button { margin-top: 12px; } }
@media (max-width: 800px) { .actions form { flex-direction: column; align-items: flex-start; gap: 14px; } }
@media (max-width: 800px) { .stock-filter { flex-direction: column; align-items: stretch; gap: 10px; } .stock-filter-control { flex-basis: auto; } }

.visibility-filter { margin-bottom: 22px; }
.visibility-filter label { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.visibility-filter input { flex: 0 0 auto; width: 18px; height: 18px; margin: 3px 0 0; accent-color: #cc0000; }
.visibility-filter input:focus-visible { outline: 2px solid #cc0000; outline-offset: 3px; }
