.hs-search-widget {
    background: #ffffff;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    font-family: system-ui, -apple-system, sans-serif;
}

.hs-search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.hs-search-header h4 {
    margin: 0;
    font-size: 1.1em;
    color: #24292e;
}

.hs-icon {
    margin-right: 6px;
}

.hs-status {
    font-size: 0.85em;
    padding: 2px 8px;
    border-radius: 12px;
}

.hs-status-ready {
    background: #e6f7e6;
    color: #1a7a1a;
}

.hs-status-warn {
    background: #fff4d6;
    color: #8a6d00;
}

.hs-search-input {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.hs-search-textbox {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #d1d5da;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s ease;
}

.hs-search-textbox:focus {
    border-color: #0366d6;
    box-shadow: 0 0 0 3px rgba(3, 102, 214, 0.15);
}

.hs-search-btn {
    background: #0366d6;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
    min-width: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.hs-search-btn:hover:not(:disabled) {
    background: #0256c4;
}

.hs-search-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

.hs-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: hs-spin 0.6s linear infinite;
    flex-shrink: 0;
}

@keyframes hs-spin {
    to { transform: rotate(360deg); }
}

.hs-empty {
    background: #f6f8fa;
    padding: 20px;
    border-radius: 6px;
    text-align: center;
    color: #586069;
}

.hs-empty-hint {
    font-size: 0.85em;
    margin-top: 8px;
    color: #6a737d;
}

.hs-results-header {
    font-size: 0.9em;
    color: #586069;
    margin-bottom: 8px;
    padding: 0 4px;
}

.hs-results {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hs-result {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    background: #f6f8fa;
    border: 1px solid #e1e4e8;
    border-left-width: 4px;
    border-radius: 6px;
    padding: 12px 16px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hs-result:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.hs-confidence-high   { border-left-color: #28a745; }
.hs-confidence-medium { border-left-color: #0366d6; }
.hs-confidence-low    { border-left-color: #f0ad4e; }

.hs-result-main {
    flex: 1;
    padding-right: 16px;
}

.hs-result-code {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.hs-rank {
    font-size: 0.8em;
    background: #d1d5da;
    color: #24292e;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.hs-code-value {
    font-family: 'Courier New', monospace;
    font-size: 1.15em;
    font-weight: 700;
    color: #24292e;
}

.hs-result-desc {
    color: #24292e;
    font-size: 0.95em;
    margin-bottom: 6px;
}

.hs-result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.8em;
    color: #586069;
}

.hs-chapter,
.hs-country {
    background: #ffffff;
    padding: 1px 6px;
    border-radius: 3px;
    border: 1px solid #e1e4e8;
}

.hs-keywords {
    font-style: italic;
}

.hs-result-action {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
    min-width: 130px;
}

.hs-confidence {
    text-align: right;
}

.hs-confidence-bar {
    width: 110px;
    height: 6px;
    background: #d1d5da;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}

.hs-confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745 0%, #0366d6 60%, #f0ad4e 100%);
    transition: width 0.3s ease;
}

.hs-confidence-text {
    font-size: 0.8em;
    font-weight: 600;
    color: #24292e;
}

.hs-use-btn {
    background: #28a745;
    color: #ffffff;
    border: none;
    padding: 6px 18px;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.hs-use-btn:hover {
    background: #22863a;
}

.hs-error {
    background: #ffeef0;
    color: #b31d28;
    padding: 12px 16px;
    border-radius: 6px;
    margin-top: 12px;
    font-size: 0.9em;
}

/* ─── Drill-down conversational UI ──────────────────────── */

.hs-drilldown {
    margin-top: 18px;
    padding: 18px 20px;
    background: #fffaf2;
    border: 1px solid #f6e6c4;
    border-left: 4px solid #f0ad4e;
    border-radius: 6px;
}

.hs-drilldown-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 0.95em;
}

.hs-drilldown-icon { font-size: 1.15em; }

.hs-drilldown-source {
    margin-left: auto;
    font-size: 0.75em;
    background: #ffffff;
    color: #586069;
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid #e1e4e8;
}

.hs-drilldown-crumb {
    font-size: 0.85em;
    color: #6a737d;
    margin-bottom: 8px;
}

.hs-drilldown-question {
    font-size: 1.05em;
    font-weight: 600;
    color: #24292e;
    margin: 8px 0 14px 0;
}

.hs-drilldown-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.hs-drilldown-option {
    background: #ffffff;
    border: 1px solid #d1d5da;
    color: #24292e;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 0.95em;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
}

.hs-drilldown-option:hover:not(:disabled) {
    border-color: #0366d6;
    background: #f1f8ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(3, 102, 214, 0.12);
}

.hs-drilldown-option:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.hs-drilldown-footer {
    margin-top: 14px;
    display: flex;
    justify-content: flex-end;
}

.hs-drilldown-restart {
    background: transparent;
    border: none;
    color: #586069;
    font-size: 0.85em;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 3px;
    transition: all 0.15s ease;
}

.hs-drilldown-restart:hover {
    color: #0366d6;
    background: rgba(3, 102, 214, 0.08);
}

/* Final result block */
.hs-drilldown-result {
    background: #e6f7e6;
    border-color: #b8e6b8;
    border-left-color: #28a745;
    display: flex;
    gap: 14px;
    align-items: stretch;
}

.hs-drilldown-result-icon {
    font-size: 1.8em;
    align-self: center;
}

.hs-drilldown-result-main { flex: 1; }

.hs-drilldown-result-label {
    font-size: 0.85em;
    color: #1a7a1a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 4px;
}

.hs-drilldown-result-code {
    font-family: 'Courier New', monospace;
    font-size: 1.5em;
    font-weight: 700;
    color: #24292e;
    margin-bottom: 4px;
}

.hs-drilldown-result-desc {
    color: #24292e;
    font-size: 0.95em;
    margin-bottom: 8px;
}

.hs-drilldown-result-trail {
    font-size: 0.8em;
    color: #6a737d;
    font-style: italic;
}

.hs-drilldown-result-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
}

/* ─── 10-digit tariff item display (HS-8) ───────────────────── */

.hs-tariff-desc {
    font-size: 0.85em;
    color: #586069;
    margin-top: 4px;
    font-style: italic;
}

.hs-drilldown-tariff-desc {
    font-size: 0.9em;
    color: #1a7a1a;
    margin-top: 8px;
    padding: 6px 10px;
    background: #e8f5e9;
    border-radius: 4px;
    border-left: 3px solid #28a745;
}
