* {
     box-sizing: border-box;
     margin: 0;
     padding: 0
}

body {
     font-family: system-ui, sans-serif;
     background: #f4f5f7;
     color: #1a1a1a;
     padding: 2rem 1rem
}

.wrap {
     max-width: 820px;
     margin: 0 auto
}

h1 {
     font-size: 1.4rem;
     font-weight: 600;
     margin-bottom: 1.5rem
}

.card {
     background: #fff;
     border: 1px solid #e0e0e0;
     border-radius: 10px;
     padding: 1.5rem;
     margin-bottom: 1.25rem
}

.card h2 {
     font-size: .75rem;
     font-weight: 600;
     text-transform: uppercase;
     letter-spacing: .07em;
     color: #888;
     margin-bottom: 1rem
}

.row {
     display: flex;
     gap: .75rem;
     flex-wrap: wrap;
     align-items: flex-end
}

.field {
     display: flex;
     flex-direction: column;
     gap: .3rem;
     flex: 1;
     min-width: 180px
}

label {
     font-size: .8rem;
     color: #555
}

input,
select {
     padding: .5rem .75rem;
     border: 1px solid #ccc;
     border-radius: 6px;
     font-size: .9rem;
     background: #fff;
     color: #1a1a1a;
     outline: none;
     width: 100%
}

input:focus,
select:focus {
     border-color: #4a7dff;
     box-shadow: 0 0 0 3px rgba(74, 125, 255, .12)
}

.btn {
     padding: .55rem 1.1rem;
     border: 1px solid #ccc;
     border-radius: 6px;
     font-size: .9rem;
     cursor: pointer;
     background: #fff;
     color: #1a1a1a;
     white-space: nowrap
}

.btn:hover {
     background: #f0f0f0
}

.btn:active {
     transform: scale(.98)
}

.btn-export {
     background: #16a34a;
     color: #fff;
     border-color: #16a34a;
     font-weight: 600
}

.btn-export:hover {
     background: #138a3e
}

.btn-export:disabled {
     background: #9ca3af;
     border-color: #9ca3af;
     cursor: not-allowed;
     transform: none
}

.alert-err {
     background: #fef2f2;
     border: 1px solid #fca5a5;
     color: #b91c1c;
     padding: .75rem 1rem;
     border-radius: 6px;
     margin-bottom: 1rem;
     font-size: .875rem
}

.search-box {
     width: 100%;
     padding: .5rem .75rem;
     border: 1px solid #ccc;
     border-radius: 6px;
     font-size: .9rem;
     margin-bottom: .5rem
}

.cat-list {
     max-height: 300px;
     overflow-y: auto;
     border: 1px solid #e0e0e0;
     border-radius: 6px
}

.cat-item {
     padding: .45rem 1rem;
     cursor: pointer;
     font-size: .85rem;
     border-bottom: 1px solid #f0f0f0;
     display: flex;
     justify-content: space-between;
     align-items: center;
     gap: .5rem;
     transition: background .1s
}

.cat-item:last-child {
     border-bottom: none
}

.cat-item:hover {
     background: #f0f4ff
}

.cat-item.selected {
     background: #eef3ff;
     font-weight: 500
}

.cat-id {
     font-size: .72rem;
     color: #aaa;
     font-family: monospace;
     flex-shrink: 0
}

.info {
     font-size: .8rem;
     color: #666;
     margin-top: .5rem
}
/* === Additions for deep taxonomy tree === */
.cat-list { max-height: 480px; }
.cat-item { padding-top: .35rem; padding-bottom: .35rem; font-size: .82rem; align-items: center; }
.cat-item > span:first-child { display: flex; align-items: baseline; gap: .35rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cat-item > span:first-child > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.btn-export[disabled] { background: #9ca3af; border-color: #9ca3af; cursor: not-allowed; }
