/* Country and buyer keyword tools follow the shared workbench surfaces and motion. */
#marketWordsPanel{min-width:0}
#mwForm{display:flex;align-items:flex-end;gap:16px;flex-wrap:wrap;padding:24px;margin-bottom:18px}
#mwForm>label,#mwCategoryField>label,.mw-country-field>label,.mw-period-field>span{display:block;font-size:12px;color:#62738a;margin-bottom:8px}
#mwForm>label{display:grid;gap:8px;margin:0}#mwCategoryField{flex:1;min-width:250px}#mwForm[data-tool=country] #mwCategoryField{flex-basis:45%}
.mw-country-field{flex:1;min-width:220px}.mw-select-picker{position:relative}#mwCountryTrigger{width:100%;text-align:left;min-height:46px}
#mwCountryPopover{position:absolute;left:0;right:0;top:calc(100% + 10px);min-width:280px;max-width:calc(100vw - 64px);z-index:20;border:1px solid var(--wb-line);border-radius:10px;background:white;box-shadow:0 14px 36px #26394f24;overflow:hidden}
.mw-country-search{display:flex;gap:8px;padding:12px;border-bottom:1px solid #e5ebf3}.mw-country-search input{width:100%;min-width:0}.mw-country-search button{font-size:12px;padding:6px}
#mwCountryOptions{max-height:300px;overflow:auto;padding:6px 0}#mwCountryOptions button{display:flex;justify-content:space-between;align-items:center;width:100%;border:0;border-radius:0;text-align:left;padding:10px 16px;font-size:13px}#mwCountryOptions small{color:#8c99aa}#mwCountryOptions button[aria-pressed=true]{color:#2463d4;background:#edf3fd}#mwCountryOptions p{padding:20px}
.mw-segments{display:flex;padding:4px;background:#f1f5fb;border:1px solid #dce6f3;border-radius:8px;gap:3px}.mw-segments button{border:0;background:transparent;color:#67788d;min-height:36px;padding:6px 14px;font-size:13px;white-space:nowrap}.mw-segments button[aria-pressed=true]{background:white;color:#2463d4;box-shadow:0 2px 5px #33415513;font-weight:600}
.mw-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.mw-actions button{min-height:44px}#mwForm .mw-note{flex-basis:100%;padding:0;margin:0}
.mw-note{font-size:12px;color:#7b899d;line-height:1.8;overflow-wrap:anywhere;padding:14px 20px}#mwWarning{padding:0 20px 12px}
#marketWordsPanel .cache-bar label{min-width:0}#mwCache{max-width:min(650px,100%);text-overflow:ellipsis}
.mw-run-state{border:1px solid #dfe8f5;background:#f4f8ff;border-radius:8px;padding:12px 16px;margin-bottom:16px;font-size:12px;color:#536d8d}.mw-run-state>div{display:flex;align-items:center;gap:12px;flex-wrap:wrap}#mwProgress{margin-left:auto}#mwStatus{display:inline-flex;align-items:center;gap:9px}.mw-run-state[data-state=busy] #mwStatus::before{content:"";width:13px;height:13px;border:2px solid #9db9eb;border-right-color:#2463d4;border-radius:50%;animation:wb-spin .8s linear infinite;flex:none}.mw-run-state[data-state=done]{color:#277357;background:#f2faf6;border-color:#d4eadf}.mw-run-state[data-state=error]{color:#985826;background:#fff9f2;border-color:#f1dcc1}
#mwProgressBar{width:100%;height:4px;margin-top:10px;accent-color:#2463d4}#mwNotice{font-size:12px;color:#277357;margin:12px 0}#mwNotice[data-error=true]{color:#b42318}#mwIssue{padding:16px;border:1px solid #efd8bb;border-radius:8px;background:#fff8ef;margin:16px 0;color:#985826}#mwIssue strong{font-size:14px}#mwIssue p{font-size:13px;color:inherit;line-height:1.7;margin-top:6px}
.mw-stats{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px;margin-bottom:18px}#marketWordsPanel[data-tool=country] .mw-stats{grid-template-columns:repeat(3,minmax(0,1fr))}.mw-stats>div{background:white;border:1px solid #dfe6ef;border-top:3px solid #3b82f6;border-radius:8px;padding:16px;min-width:0}.mw-stats>[data-accent="1"]{border-top-color:#10b981}.mw-stats>[data-accent="2"]{border-top-color:#f59e0b}.mw-stats>[data-accent="3"]{border-top-color:#8b5cf6}.mw-stats span,.mw-stats small{display:block;font-size:12px;color:#64748b}.mw-stats strong{display:block;font-size:26px;color:#243449;margin:5px 0;font-variant-numeric:tabular-nums}
.mw-result-card{border:1px solid #dfe6ef;border-radius:10px;background:white;overflow:hidden}.mw-result-heading{display:flex;align-items:center;flex-wrap:wrap;gap:12px;padding:20px}.mw-result-heading h2{font-size:15px;margin:0}#mwResultScope{font-size:12px;color:#65768d;overflow-wrap:anywhere}#mwCompletion{margin-left:auto;font-size:12px;color:#277357}.mw-result-card .toolbar{border:0;border-radius:0;padding:0 20px 16px}.mw-result-card .search input{width:100%}.mw-result-card>.mw-note{margin:0}
.mw-country-results{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;padding:0 16px 16px}.mw-country-results article{min-width:0;border:1px solid #e3eaf3;border-radius:8px;overflow:hidden}.mw-country-results h3{font-size:14px;margin:0;padding:16px;background:#f7f9fc;display:flex;align-items:center;gap:10px}.mw-country-results h3 small{margin-left:auto;color:#8190a3;font-weight:400}.mw-country-results .table-wrap{max-height:570px;border:0}.mw-country-results table{min-width:420px;table-layout:auto}.mw-country-results th,.mw-country-results td{font-size:12px;padding:12px 9px;width:auto;text-align:right;white-space:nowrap}.mw-country-results th:nth-child(2),.mw-country-results td:nth-child(2){text-align:left;min-width:130px;max-width:190px;white-space:normal;overflow-wrap:anywhere}.mw-country-results th:first-child,.mw-country-results td:first-child{text-align:center}.mw-country-results th:last-child{width:auto}.mw-bar{display:block;height:3px;width:100%;background:#f0f5fb;margin-top:6px;overflow:hidden;border-radius:3px}.mw-bar i{display:block;height:100%;background:#accbf6;border-radius:3px}
.mw-word{padding:0;min-height:26px;border:0;background:transparent;color:#2463d4;text-align:left;font-weight:600;white-space:normal;overflow-wrap:anywhere}.mw-word:hover{box-shadow:none!important;text-decoration:underline}.mw-up{color:#11875d}.mw-down{color:#bc3e36}
.mw-buyer-filters{display:flex;align-items:center;flex-wrap:wrap;gap:12px;padding:12px 20px;border-block:1px solid #e5ebf3;background:#f7f9fc;font-size:12px;color:#6c7e95}.mw-buyer-filters label{display:flex;align-items:center;gap:8px}.mw-buyer-filters select{font-size:12px}.mw-buyer-filters>span{margin-left:auto}
#mwBuyerResults .table-wrap{border-inline:0;max-height:660px}#mwBuyerResults table{min-width:950px;table-layout:auto}#mwBuyerResults th,#mwBuyerResults td{font-size:12px;padding:12px 14px;width:auto;text-align:right;white-space:nowrap}#mwBuyerResults th:first-child,#mwBuyerResults td:first-child{width:55px;text-align:center}#mwBuyerResults th:nth-child(2),#mwBuyerResults td:nth-child(2){min-width:220px;max-width:300px;white-space:normal;text-align:left}#mwBuyerResults th button{font:inherit;min-height:24px;padding:0;background:transparent;border:0;white-space:nowrap;color:inherit}.mw-group-row th{position:static!important;text-align:left!important;color:#426ca6;background:#f4f8ff;font-weight:600}.mw-group-row small{margin-left:10px;color:#7b899d;font-weight:400}.mw-flag{display:inline-block;position:relative;border-radius:4px;padding:3px 6px;font-size:11px;color:#8795a9;background:#f1f4f8;margin-left:4px}.mw-flag.is-yes{color:#2463d4;background:#eaf2ff}
#mwConfirm{width:min(460px,calc(100vw - 32px));padding:24px;border:1px solid #dfe6ef;border-radius:10px;color:#233348}#mwConfirm p{margin:14px 0;line-height:1.8}#mwConfirm::backdrop{background:#20242b66}
body:has(#marketWordsPanel:not([hidden])) #message:not(.error){display:none}
@media(max-width:1760px){.mw-country-results{grid-template-columns:1fr}.mw-country-results table{min-width:550px}.mw-country-results .table-wrap{max-height:380px}.mw-stats{gap:10px}}
@media(max-width:900px){.mw-stats{grid-template-columns:repeat(3,minmax(0,1fr))}#mwForm[data-tool=country] #mwCategoryField{flex-basis:100%}}
@media(max-width:720px){#mwForm{padding:18px;gap:14px}#mwCategoryField,.mw-country-field{min-width:0;flex-basis:100%}#mwCountryPopover{min-width:0;max-width:100%;position:relative;top:0;margin-top:10px}.mw-stats,#marketWordsPanel[data-tool=country] .mw-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.mw-stats>div{padding:14px}.mw-result-heading{padding:16px}#mwCompletion{margin-left:0}.mw-result-card .toolbar{padding:0 16px 14px}.mw-country-results{padding:0 12px 12px}#mwProgress{margin-left:0}.mw-buyer-filters>span{margin-left:0}#mwCountrySearch{font-size:16px}}
@media(prefers-reduced-motion:reduce){.mw-run-state[data-state=busy] #mwStatus::before{animation:none}}

/* Shared category picker presentation. */
#marketWordsPanel .kt-category-field>label,#mwRankingPeriodLabel{display:block;color:#566b84;font-size:13px;margin-bottom:8px}
#mwCategoryPicker{position:relative;min-width:0}
#mwCategoryTrigger{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:46px;text-align:left;background:var(--wb-surface);border:1px solid var(--wb-line);color:var(--wb-text);font-weight:600}
#mwCategoryValue{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#mwCategoryTrigger svg{width:17px;height:17px;flex-shrink:0;stroke:#7a8eaa;stroke-width:1.7;fill:none;transition:transform var(--wb-motion-fast) ease}
#mwCategoryTrigger[aria-expanded=true]{border-color:var(--wb-blue);box-shadow:0 0 0 3px var(--wb-active)}
#mwCategoryTrigger[aria-expanded=true] svg{transform:rotate(180deg)}
#mwCategoryPopover{position:absolute;top:calc(100% + 10px);left:0;width:min(920px,calc(100vw - 350px));max-width:calc(100vw - 64px);border:1px solid var(--wb-line);border-radius:10px;background:var(--wb-surface);box-shadow:0 14px 36px #26394f24;overflow:hidden;z-index:20}
#marketWordsPanel .kt-category-search{display:flex;align-items:center;gap:12px;border-bottom:1px solid var(--wb-line);padding:10px 14px}
#mwCategorySearch{width:100%;min-width:0;border:1px solid var(--wb-line);border-radius:6px;padding:9px 12px;background:var(--wb-canvas);color:var(--wb-text)}
#mwCategoryClose{min-height:44px;border:0;font-size:12px;background:transparent;flex-shrink:0}
#marketWordsPanel .kt-category-columns{display:grid;grid-template-columns:1.15fr 1fr 1.2fr}
#marketWordsPanel .kt-category-column{min-width:0;max-height:350px;min-height:240px;overflow-y:auto;overscroll-behavior:contain;padding:7px 0}
#marketWordsPanel .kt-category-column+.kt-category-column{border-left:1px solid var(--wb-line)}
#marketWordsPanel .kt-category-column button,#marketWordsPanel .kt-category-root,#marketWordsPanel .kt-category-matches button{display:flex;align-items:center;gap:10px;width:100%;min-height:46px;padding:12px 16px;border:0;border-radius:0;background:transparent;color:var(--wb-text);text-align:left;font-size:13px}
#marketWordsPanel .kt-category-column button span{min-width:0;overflow-wrap:anywhere}
#marketWordsPanel .kt-category-column button b{margin-left:auto;color:#8193aa;font-size:20px;font-weight:400}
#marketWordsPanel .kt-category-column button i{width:16px;height:16px;border:1px solid #bdcbdf;border-radius:50%;flex-shrink:0}
#marketWordsPanel .kt-category-column button[aria-pressed=true],#marketWordsPanel .kt-category-root,#marketWordsPanel .kt-category-matches button[aria-pressed=true]{background:var(--wb-active);color:var(--wb-blue);font-weight:600}
#marketWordsPanel .kt-category-column button[aria-pressed=true] i{border:5px solid var(--wb-blue);background:var(--wb-surface)}
#marketWordsPanel .kt-category-column button:hover,#marketWordsPanel .kt-category-matches button:hover{background:var(--wb-hover);box-shadow:none}
#marketWordsPanel .kt-category-column button:focus-visible,#marketWordsPanel .kt-category-matches button:focus-visible{outline-offset:-3px}
#marketWordsPanel .kt-category-matches{max-height:350px;overflow:auto;min-height:100px}
#marketWordsPanel .kt-category-matches p{padding:20px}
#mwCategoryStatus{margin-top:8px;font-size:12px;color:#a25721;line-height:1.6}
@media(max-width:1100px){#mwCategoryPopover{width:min(780px,calc(100vw - 285px))}}
@media(max-width:720px){#mwCategoryPopover{width:100%;max-width:100%;position:relative;top:0;margin-top:10px}#marketWordsPanel .kt-category-columns{grid-template-columns:minmax(0,1fr) minmax(0,1.1fr)}#mwCategoryRoot{grid-column:1/-1;min-height:0;max-height:none;padding:0;border-bottom:1px solid var(--wb-line)}#marketWordsPanel .kt-category-column{max-height:280px;min-height:0}#marketWordsPanel .kt-category-column button{padding:12px 10px;font-size:12px;gap:7px}#mwCategoryGroups{border-left:0!important}#mwCategorySearch{font-size:16px}#mwCategoryClose{padding:8px}}
