/* Scoped styles for the independent keyword research component only. */
.nkt-root { --nkt-blue: #2563eb; color: var(--fg, #111827); background: var(--panel, #fff); border: 1px solid var(--line, #d6dbe3); border-radius: 12px; padding: 20px; min-width: 0; margin-top: 18px; }
.nkt-root *, .nkt-root *::before, .nkt-root *::after { box-sizing: border-box; }
.nkt-root [hidden] { display: none !important; }
.nkt-root h3, .nkt-root h4, .nkt-root p { margin: 0; }
.nkt-root h3 { font-size: 19px; line-height: 1.5; }
.nkt-root h4 { font-size: 15px; line-height: 1.5; }
.nkt-root p { display: block !important; color: var(--muted, #64748b); font-size: 12px; line-height: 1.65; white-space: normal; overflow-wrap: anywhere; }
.nkt-root .nkt-heading, .nkt-root .nkt-panel-title, .nkt-root .nkt-modal-heading, .nkt-root .nkt-chart-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.nkt-root .nkt-heading { margin-bottom: 16px; }
.nkt-root .nkt-heading p { margin-top: 4px; }
.nkt-root .nkt-badge { flex: 0 0 auto; font-size: 11px; color: var(--nkt-blue); background: color-mix(in srgb, var(--nkt-blue) 9%, var(--panel)); border-radius: 20px; padding: 5px 10px; }
.nkt-root button, .nkt-root input, .nkt-root select, .nkt-root textarea { font: inherit; font-size: 12px; color: var(--fg, #111827); }
.nkt-root input, .nkt-root select, .nkt-root textarea { min-width: 0; width: 100%; margin: 0; border: 1px solid var(--line, #d6dbe3); border-radius: 6px; background: var(--panel, #fff); padding: 8px 10px; min-height: 36px; box-shadow: none; }
.nkt-root input[type="checkbox"] { width: 15px; min-height: 15px; height: 15px; padding: 0; accent-color: var(--nkt-blue); }
.nkt-root textarea { resize: vertical; line-height: 1.6; }
.nkt-root button { width: auto; min-width: 0; min-height: 34px; padding: 6px 12px; border: 1px solid var(--line, #d6dbe3); border-radius: 6px; background: var(--panel, #fff); box-shadow: none; font-weight: 500; cursor: pointer; white-space: normal; }
.nkt-root button:hover:not(:disabled) { border-color: var(--nkt-blue); color: var(--nkt-blue); }
.nkt-root button:disabled { opacity: .5; cursor: not-allowed; }
.nkt-root button.nkt-primary { background: #2563eb; color: #fff; border-color: #2563eb; font-weight: 600; }
.nkt-root button.nkt-primary:hover:not(:disabled) { background: #1d4ed8; color: #fff; }
.nkt-root :is(button,input,select,textarea,[tabindex]):focus-visible { outline: 2px solid var(--nkt-blue); outline-offset: 2px; }
.nkt-root label { display: flex; flex-direction: column; align-items: stretch; gap: 6px; min-width: 0; font-size: 12px; font-weight: 600; color: var(--fg); }
.nkt-root .nkt-check-label { display: flex; align-items: center; gap: 6px; }
.nkt-root .nkt-search-form { display: grid; grid-template-columns: minmax(180px, .75fr) minmax(280px, 2fr) auto; gap: 12px; padding: 16px; align-items: end; background: var(--panel-soft, #f7f9fc); border: 1px solid var(--line); border-radius: 8px; }
.nkt-root .nkt-search-form > button { height: 39px; }
.nkt-root .nkt-keyword-field textarea { min-height: 68px; }
.nkt-root .nkt-optional-fields { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; padding-top: 6px; }
.nkt-root .nkt-feedback { display: block !important; margin: 10px 0; padding: 8px 10px; border: 1px solid transparent; border-radius: 6px; font-size: 12px; line-height: 1.6; color: var(--muted); min-height: 34px; white-space: normal; overflow-wrap: anywhere; }
.nkt-root .nkt-feedback[data-kind="error"] { border-color: color-mix(in srgb,#dc2626 35%,var(--line)); color: var(--danger,#dc2626); background: color-mix(in srgb,#dc2626 7%,var(--panel)); }
.nkt-root .nkt-feedback[data-kind="success"] { color: var(--success,#0f766e); background: color-mix(in srgb,#059669 6%,var(--panel)); }
.nkt-root .nkt-workspace { display: grid; grid-template-columns: minmax(0,1fr) 290px; gap: 18px; align-items: start; }
.nkt-root .nkt-results, .nkt-root .nkt-selection { min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.nkt-root .nkt-panel-title { margin-bottom: 12px; }
.nkt-root .nkt-panel-title > span { color: var(--muted); font-size: 12px; }
.nkt-root .nkt-result-tools { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; margin-bottom: 12px; }
.nkt-root .nkt-result-tools label { flex: 1 1 150px; max-width: 280px; }
.nkt-root .nkt-table-wrap { width: 100%; min-width: 0; max-height: 500px; overflow: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.nkt-root table { border-collapse: collapse; width: 100%; margin: 0; font-size: 12px; color: var(--fg); }
.nkt-root .nkt-result-table { min-width: 930px; }
.nkt-root th, .nkt-root td { text-align: right; vertical-align: middle; border-bottom: 1px solid var(--line); padding: 9px 8px; white-space: nowrap; font-size: 12px; }
.nkt-root th { position: sticky; top: 0; z-index: 1; background: var(--panel-soft); color: var(--fg); font-size: 11px; font-weight: 600; }
.nkt-root th button { border: 0; padding: 2px 0; min-height: 26px; font-size: inherit; font-weight: 600; white-space: nowrap; background: transparent; }
.nkt-root th:first-child, .nkt-root td.nkt-keyword-cell { text-align: left; white-space: normal; overflow-wrap: anywhere; min-width: 110px; max-width: 210px; }
.nkt-root td:last-child, .nkt-root th:last-child { text-align: center; }
.nkt-root td button { padding: 4px 7px; min-height: 28px; font-size: 11px; }
.nkt-root tbody tr:nth-child(even) td { background: var(--panel-soft); }
.nkt-root .nkt-empty { color: var(--muted); text-align: center !important; padding: 38px 16px; white-space: normal; line-height: 1.7; }
.nkt-root .nkt-pagination { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-top: 12px; font-size: 12px; color: var(--muted); }
.nkt-root .nkt-pagination > div { display: flex; gap: 5px; align-items: center; }
.nkt-root .nkt-pagination select { min-width: 72px; padding: 6px 26px 6px 8px; }
.nkt-root .nkt-selection-label textarea { min-height: 180px; }
.nkt-root textarea[aria-invalid="true"] { border-color: #dc2626; }
.nkt-root .nkt-selected-list { list-style: none; padding: 0; margin: 8px 0 12px; max-height: 180px; overflow: auto; }
.nkt-root .nkt-selected-list li { display: flex; gap: 8px; justify-content: space-between; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.nkt-root .nkt-selected-list li > span { overflow-wrap: anywhere; min-width: 0; }
.nkt-root .nkt-selected-list button { flex: 0 0 auto; min-height: 26px; padding: 3px 6px; font-size: 11px; }
.nkt-root .nkt-selection-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.nkt-root .nkt-overlay { display: flex; align-items: center; justify-content: center; position: fixed; z-index: 101000; inset: 0; background: rgba(0,0,0,.55); padding: 16px; }
.nkt-root .nkt-dialog { display: flex; flex-direction: column; gap: 16px; width: min(1500px,100%); max-height: calc(100dvh - 32px); overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 22px; box-shadow: 0 18px 65px rgba(0,0,0,.3); }
.nkt-root .nkt-dialog > * { flex-shrink: 0; min-width: 0; }
.nkt-root .nkt-modal-heading { align-items: start; }
.nkt-root .nkt-modal-heading button { flex: 0 0 auto; }
.nkt-root .nkt-estimate-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.nkt-root .nkt-estimate-form label { width: 170px; }
.nkt-root .nkt-bid-step-controls { display: flex; gap: 6px; flex-wrap: wrap; }
.nkt-root .nkt-chart-range { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.nkt-root .nkt-chart-range > span { color: var(--muted); font-size: 12px; text-align: center; }
.nkt-root .nkt-chart-range button { font-size: 12px; }
.nkt-root .nkt-dialog .nkt-feedback { margin: 0; }
.nkt-root .nkt-metrics { display: flex; flex-wrap: wrap; gap: 6px; }
.nkt-root .nkt-metrics button { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; }
.nkt-root .nkt-metrics button span, .nkt-root .nkt-chart-tip > span { display: inline-block; flex: 0 0 auto; height: 8px; width: 8px; border-radius: 50%; background: var(--nkt-series); }
.nkt-root .nkt-metrics button[aria-pressed="true"] { border-color: var(--nkt-series); font-weight: 700; background: color-mix(in srgb,var(--nkt-series) 10%,var(--panel)); }
.nkt-root .nkt-chart-frame { position: relative; }
.nkt-root .nkt-chart { min-height: 180px; border: 1px solid var(--line); border-radius: 8px; overflow: auto; }
.nkt-root .nkt-chart svg { display: block; width: 100%; min-width: 540px; max-height: 330px; }
.nkt-root .nkt-chart svg text { fill: var(--muted); font: 11px sans-serif; }
.nkt-root .nkt-gridline { stroke: var(--line); stroke-width: 1; }
.nkt-root .nkt-chart circle { cursor: pointer; }
.nkt-root .nkt-chart circle[aria-pressed="true"] { stroke: var(--fg); stroke-width: 2; }
.nkt-root .nkt-chart circle:focus-visible { outline: none; stroke: var(--fg); stroke-width: 3; }
.nkt-root .nkt-selected-bid-line { stroke: var(--muted); stroke-width: 1; opacity: .6; pointer-events: none; }
.nkt-root .nkt-bid-gridline { stroke-dasharray: 2 4; opacity: .65; }
.nkt-root .nkt-crosshair { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 4 4; pointer-events: none; }
.nkt-root .nkt-chart-tip { position: absolute; z-index: 5; display: flex; flex-direction: column; align-items: stretch; gap: 7px; min-height: 28px; width: 235px; max-width: calc(100% - 16px); font-size: 12px; color: var(--fg); padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 4px 16px rgba(0,0,0,.2); pointer-events: none; transition: none !important; animation: none !important; }
.nkt-root .nkt-chart-tip strong { font-size: 12px; }
.nkt-root .nkt-chart-tip small { color: var(--muted); font-size: 11px; line-height: 1.5; }
.nkt-root .nkt-tip-row { display: flex; align-items: center; gap: 7px; }
.nkt-root .nkt-tip-row > span:first-child { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; }
.nkt-root .nkt-tip-row b { margin-left: auto; font-weight: 600; }
.nkt-root .nkt-estimate-table-wrap { max-height: 320px; }
.nkt-root .nkt-estimate-table-wrap table { min-width: 600px; }
.nkt-root .nkt-estimate-status { white-space: nowrap; color: var(--muted); font-size: 12px; }
.nkt-root .nkt-disclaimer { margin-top: 0; }
.nkt-root .nkt-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media(max-width:1100px) { .nkt-root .nkt-workspace { grid-template-columns: minmax(0,1fr) 250px; } .nkt-root .nkt-chart-head { align-items: start; flex-direction: column; gap: 10px; } }
@media(max-width:800px) { .nkt-root { padding: 12px; } .nkt-root .nkt-workspace { grid-template-columns: minmax(0,1fr); } .nkt-root .nkt-search-form { grid-template-columns: minmax(0,1fr); padding: 12px; } .nkt-root .nkt-optional-fields { grid-template-columns: repeat(2,minmax(0,1fr)); } .nkt-root .nkt-dialog { padding: 14px; } .nkt-root .nkt-modal-heading { gap: 8px; } .nkt-root .nkt-overlay { padding: 8px; } .nkt-root .nkt-dialog { max-height: calc(100dvh - 16px); } .nkt-root .nkt-estimate-form label { flex: 1 1 120px; width: auto; } .nkt-root .nkt-heading { align-items: start; } .nkt-root .nkt-badge { display: none; } }
