/* v1.34.259: Company Check AI - name search matches, Advanced details, official documents. */

.thbp-cc-ai-after { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }

/* Name search */
.thbp-cc-ai-matches { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.thbp-cc-ai-match { display: grid; grid-template-columns: 1fr auto auto 16px; align-items: center; gap: 6px 14px; padding: 12px 14px; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; color: #111827 !important; text-decoration: none !important; transition: border-color .15s, box-shadow .15s, transform .15s; }
.thbp-cc-ai-match:hover, .thbp-cc-ai-match:focus-visible { border-color: #1f3b82; box-shadow: 0 4px 14px rgba(31, 59, 130, .10); transform: translateY(-1px); outline: none; }
.thbp-cc-ai-match-name { display: flex; flex-direction: column; min-width: 0; }
.thbp-cc-ai-match-name strong { font-size: 15px; font-weight: 700; color: #111827; overflow-wrap: anywhere; }
.thbp-cc-ai-match-name small { font-size: 12px; color: #6b7280; overflow-wrap: anywhere; }
.thbp-cc-ai-match-meta { font-size: 12px; color: #4b5563; white-space: nowrap; font-variant-numeric: tabular-nums; }
.thbp-cc-ai-match-go { font-size: 20px; color: #1f3b82; line-height: 1; }
.thbp-cc-ai-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.thbp-cc-ai-pill.is-active { background: #e8f7ec; color: #116329; }
.thbp-cc-ai-pill.is-closed { background: #f1f5f9; color: #64748b; }
.thbp-cc-ai-note { margin: 0; font-size: 12px; color: #6b7280; line-height: 1.5; }

.thbp-cc-ai-skeleton { display: flex; flex-direction: column; gap: 8px; }
.thbp-cc-ai-skeleton span { display: block; height: 52px; border-radius: 10px; background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%); background-size: 200% 100%; animation: thbpCcAiShimmer 1.3s ease-in-out infinite; }
.thbp-cc-ai-skeleton span:nth-child(2) { opacity: .8; }
.thbp-cc-ai-skeleton span:nth-child(3) { opacity: .6; }
@keyframes thbpCcAiShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Advanced details */
.thbp-cc-ai-badge { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 6px; background: #eef2ff; color: #1f3b82; font-size: 11px; font-weight: 700; vertical-align: middle; letter-spacing: .04em; }
.thbp-cc-ai-btn { display: inline-flex; align-items: center; justify-content: center; }
.thbp-cc-ai-hint { margin: 8px 0 0; font-size: 12px; color: #6b7280; }
.thbp-cc-ai-msg { margin: 0 0 10px; font-size: 14px; color: #374151; line-height: 1.6; }
.thbp-cc-ai-progress { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: 10px; background: #f8fafc; border: 1px solid #eef2f7; font-size: 14px; color: #1f3b82; font-weight: 600; }
.thbp-cc-ai-progress-time { margin-left: auto; color: #6b7280; font-weight: 400; font-variant-numeric: tabular-nums; }
.thbp-cc-ai-spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #c7d2fe; border-top-color: #1f3b82; animation: thbpCcAiSpin .8s linear infinite; flex: 0 0 18px; }
@keyframes thbpCcAiSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .thbp-cc-ai-spinner, .thbp-cc-ai-skeleton span { animation: none; } }

.thbp-cc-ai-disclaimer { margin: 0 0 12px; padding: 10px 12px; border-radius: 8px; background: #fffbeb; border: 1px solid #fde68a; color: #78350f; font-size: 12px; line-height: 1.55; }
.thbp-cc-ai-refresh { margin-left: 6px; padding: 0; border: 0; background: none; color: #1f3b82; font-size: 12px; font-weight: 700; cursor: pointer; text-decoration: underline; }
.thbp-cc-ai-rows { margin: 0; display: flex; flex-direction: column; }
.thbp-cc-ai-rows > div { display: grid; grid-template-columns: 170px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid #eef2f7; }
.thbp-cc-ai-rows > div:first-child { border-top: 0; padding-top: 0; }
.thbp-cc-ai-rows dt { margin: 0; font-size: 13px; font-weight: 700; color: #4b5563; }
.thbp-cc-ai-rows dd { margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: #111827; line-height: 1.55; min-width: 0; overflow-wrap: anywhere; }
.thbp-cc-ai-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.thbp-cc-ai-list li { line-height: 1.5; }
.thbp-cc-ai-list small, .thbp-cc-ai-rows dd small { color: #6b7280; font-size: 12px; }
.thbp-cc-ai-date { display: inline-block; min-width: 92px; color: #4b5563; font-size: 13px; font-variant-numeric: tabular-nums; }
.thbp-cc-ai-change { margin-left: 4px; font-style: italic; }
.thbp-cc-ai-sub { font-size: 13px; color: #4b5563; }
a.thbp-cc-ai-sub { color: #1f3b82; font-weight: 600; text-decoration: none; }
.thbp-cc-ai-src { margin-left: 4px; padding: 0 6px; border-radius: 5px; background: #eef2ff; color: #1f3b82 !important; font-size: 11px; font-weight: 600; text-decoration: none !important; white-space: nowrap; vertical-align: 1px; }
.thbp-cc-ai-src:hover { background: #dbe4ff; }
.thbp-cc-ai-check { align-self: flex-start; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.thbp-cc-ai-check.is-ok { background: #e8f7ec; color: #116329; }
.thbp-cc-ai-check.is-warn { background: #fff4e5; color: #9a4b00; }
.is-profit { color: #116329; }
.is-loss { color: #b42318; }
.thbp-cc-ai-sources { margin-top: 12px; padding-top: 10px; border-top: 1px solid #eef2f7; font-size: 13px; }
.thbp-cc-ai-sources summary { cursor: pointer; color: #1f3b82; font-weight: 600; }
.thbp-cc-ai-sources ul { margin: 8px 0 0; padding-left: 18px; }
.thbp-cc-ai-sources li { margin: 3px 0; overflow-wrap: anywhere; }

/* Official documents */
.thbp-cc-ai-orders { padding: 18px; border-radius: 14px; border: 1px solid #e2e8f0; background: #f8fafc; }
.thbp-cc-ai-orders h3 { margin: 0 0 4px; font-size: 16px; color: #111827; font-weight: 700; }
.thbp-cc-ai-orders > p { margin: 0 0 12px; font-size: 13px; color: #4b5563; line-height: 1.55; }
.thbp-cc-ai-order-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.thbp-cc-ai-order { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border-radius: 10px; border: 1px solid #dbe3ef; background: #fff; color: #111827 !important; text-decoration: none !important; transition: border-color .15s, box-shadow .15s; }
.thbp-cc-ai-order:hover { border-color: #1f3b82; box-shadow: 0 4px 14px rgba(31, 59, 130, .10); }
.thbp-cc-ai-order span { font-size: 13px; font-weight: 600; }
.thbp-cc-ai-order strong { font-size: 14px; color: #1f3b82; font-weight: 700; }

@media (max-width: 768px) {
    .thbp-cc-ai-match { grid-template-columns: 1fr auto; }
    .thbp-cc-ai-match-meta { grid-column: 1 / 2; white-space: normal; }
    .thbp-cc-ai-match .thbp-cc-ai-pill { grid-column: 2 / 3; grid-row: 1 / 2; justify-self: end; }
    .thbp-cc-ai-match-go { display: none; }
    .thbp-cc-ai-rows > div { grid-template-columns: 1fr; gap: 4px; }
    .thbp-cc-ai-order-list { grid-template-columns: 1fr; }
    .thbp-cc-ai-btn { width: 100%; }
}

/* v1.34.263: search box hint and calm notices */
.thbp-company-check-examples { margin: 8px 0 0; font-size: 12.5px; color: #6b7280; line-height: 1.5; }
.thbp-company-check-result-card.is-notice { border-color: #dbe3ef; background: #f8fafc; }
.thbp-cc-ai-names .thbp-company-check-result-head p:last-child { margin-bottom: 0; }

/* v1.34.264: Advanced details dropdown */
details.thbp-cc-ai-adv { padding: 0; overflow: hidden; }
.thbp-cc-ai-adv-summary { display: flex; align-items: center; gap: 14px; padding: 16px 18px; cursor: pointer; list-style: none; user-select: none; transition: background .15s; }
.thbp-cc-ai-adv-summary::-webkit-details-marker { display: none; }
.thbp-cc-ai-adv-summary::marker { content: ''; }
.thbp-cc-ai-adv-summary:hover { background: #f8fafc; }
.thbp-cc-ai-adv-summary:focus-visible { outline: 2px solid #1f3b82; outline-offset: -2px; border-radius: 14px; }
.thbp-cc-ai-adv-icon { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 10px; background: #eef2ff; color: #1f3b82; display: inline-flex; align-items: center; justify-content: center; }
.thbp-cc-ai-adv-titles { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.thbp-cc-ai-adv-title { font-size: 16px; font-weight: 700; color: #111827; line-height: 1.35; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.thbp-cc-ai-adv-sub { font-size: 13px; color: #6b7280; line-height: 1.5; }
.thbp-cc-ai-tag { display: inline-flex; align-items: center; padding: 1px 8px; border: 1px solid #cbd5e1; border-radius: 999px; font-size: 11px; font-weight: 600; color: #475569; letter-spacing: .02em; line-height: 1.6; background: #fff; }
.thbp-cc-ai-adv-state { flex: 0 0 auto; font-size: 12px; font-weight: 600; color: #64748b; background: #f1f5f9; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.thbp-cc-ai-adv-state.is-ready { background: #e8f7ec; color: #116329; }
.thbp-cc-ai-adv-state.is-locked { background: #eef2ff; color: #1f3b82; }
.thbp-cc-ai-chevron { flex: 0 0 auto; color: #64748b; display: inline-flex; transition: transform .2s ease; }
details.thbp-cc-ai-adv[open] .thbp-cc-ai-chevron { transform: rotate(180deg); }
details.thbp-cc-ai-adv[open] .thbp-cc-ai-adv-summary { border-bottom: 1px solid #eef2f7; }
details.thbp-cc-ai-adv .thbp-cc-ai-body { padding: 16px 18px 18px; }
@media (prefers-reduced-motion: reduce) { .thbp-cc-ai-chevron { transition: none; } }

/* v1.34.264: Business Documents call-to-action */
.thbp-cc-docs-cta { display: flex; align-items: center; gap: 16px; padding: 18px 20px; }
.thbp-cc-docs-icon { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 12px; background: #eef2ff; color: #1f3b82; display: inline-flex; align-items: center; justify-content: center; }
.thbp-cc-docs-text { flex: 1 1 auto; min-width: 0; }
.thbp-cc-docs-text h2 { margin: 0 0 4px; font-size: 16px; line-height: 1.35; font-weight: 700; color: #111827; }
.thbp-cc-docs-text p { margin: 0; font-size: 13px; line-height: 1.55; color: #4b5563; }
.thbp-cc-docs-btn { box-sizing: border-box; flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 18px; border: 1px solid #1f3b82; border-radius: 8px; background: #fff; color: #1f3b82 !important; font-size: 14px; font-weight: 700; text-decoration: none !important; white-space: nowrap; transition: background .15s, color .15s; }
.thbp-cc-docs-btn:hover, .thbp-cc-docs-btn:focus-visible { background: #1f3b82; color: #fff !important; }
.thbp-cc-docs-btn svg { transition: transform .15s; }
.thbp-cc-docs-btn:hover svg { transform: translateX(2px); }

@media (max-width: 640px) {
    .thbp-cc-ai-adv-summary { flex-wrap: wrap; gap: 10px 12px; padding: 14px; }
    .thbp-cc-ai-adv-icon { flex-basis: 36px; width: 36px; height: 36px; }
    .thbp-cc-ai-adv-titles { flex-basis: calc(100% - 90px); }
    .thbp-cc-ai-adv-state { order: 5; margin-left: 48px; }
    .thbp-cc-docs-cta { flex-wrap: wrap; align-items: flex-start; padding: 16px; }
    .thbp-cc-docs-text { flex-basis: calc(100% - 60px); }
    .thbp-cc-docs-btn { width: 100%; justify-content: center; }
}

/* v1.34.265: not-yet-confirmed matches, official filings, official source line, AI mark */
.thbp-cc-ai-pill.is-pending { background: #fff4e5; color: #9a4b00; }
.thbp-cc-ai-unconfirmed-note { margin: 0 0 12px; padding: 9px 12px; border-radius: 8px; background: #fffbeb; border: 1px solid #fde68a; color: #78350f; font-size: 12.5px; line-height: 1.55; }
.thbp-cc-official-source { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: #116329; }
.thbp-cc-official-source svg { flex: 0 0 auto; }
.thbp-cc-dwh { margin-bottom: 18px; padding: 14px 16px; border: 1px solid #d9eedf; border-radius: 12px; background: #f6fbf7; }
.thbp-cc-dwh-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 12px; }
.thbp-cc-dwh-badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; background: #e8f7ec; color: #116329; font-size: 12px; font-weight: 700; }
.thbp-cc-dwh-head small { font-size: 12px; color: #4b5563; }
.thbp-cc-dwh .thbp-cc-ai-rows > div { border-top-color: #e3f1e7; }
.thbp-cc-dwh-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.thbp-cc-dwh-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; min-width: 420px; }
.thbp-cc-dwh-table th { text-align: right; font-weight: 600; color: #4b5563; padding: 4px 8px 6px; border-bottom: 1px solid #dbe7df; white-space: nowrap; }
.thbp-cc-dwh-table td { text-align: right; padding: 6px 8px; border-bottom: 1px solid #eef5f0; white-space: nowrap; color: #111827; }
.thbp-cc-dwh-table th:first-child, .thbp-cc-dwh-table td:first-child { text-align: left; padding-left: 0; }
.thbp-cc-dwh-pending { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; padding: 12px 14px; border-radius: 10px; background: #f6fbf7; border: 1px solid #d9eedf; color: #116329; font-size: 13px; font-weight: 600; }
.thbp-cc-dwh-pending .thbp-cc-ai-spinner { border-color: #c9e9d2; border-top-color: #116329; }
.thbp-cc-ai-spark { display: inline-flex; color: #c9a84c; margin-right: 1px; }
details.thbp-cc-ai-adv .thbp-cc-dwh-slot:not(:empty) { padding: 16px 18px 0; }
details.thbp-cc-ai-adv .thbp-cc-dwh-slot .thbp-cc-dwh { margin-bottom: 0; }
.thbp-cc-ai-tag { gap: 4px; }
.thbp-cc-dwh-table td.is-profit { color: #116329; }
.thbp-cc-dwh-table td.is-loss { color: #b42318; }
@media (max-width: 640px) {
    .thbp-cc-dwh-table { min-width: 0; }
    .thbp-cc-dwh-table th:nth-child(n+4), .thbp-cc-dwh-table td:nth-child(n+4) { display: none; }
}
.thbp-cc-dwh-wait-row { display: flex; align-items: flex-start; gap: 14px; }
.thbp-cc-dwh-wait-row .thbp-cc-ai-spinner { margin-top: 4px; }
.thbp-cc-dwh-wait-row h2 { margin: 0 0 6px; font-size: 17px; line-height: 1.35; color: #111827; font-weight: 700; }
.thbp-cc-dwh-wait-row p { margin: 0 0 6px; font-size: 14px; color: #374151; line-height: 1.6; }
.thbp-cc-dwh-wait-time { color: #6b7280; font-size: 12px; font-variant-numeric: tabular-nums; }
.thbp-cc-ai-pill.is-checking { background: #eef2ff; color: #1f3b82; }
.thbp-cc-dwh-wait-name { margin: 0 0 4px !important; font-size: 15px !important; color: #111827 !important; }

/* v1.34.270: own company database */
.thbp-cc-ai-more { margin: 4px 0 6px; font-size: 13px; color: #4b5563; }
.thbp-cc-ai-more-btn { margin-left: 4px; padding: 0; border: 0; background: none; color: #1f3b82; font-weight: 700; font-size: 13px; text-decoration: underline; cursor: pointer; }
.thbp-cc-ai-more-btn:hover { color: #162f6b; }

/* v1.34.271: dated saved records and background refresh status. */
.thbp-cc-official-source { max-width:100%; align-items:flex-start; overflow-wrap:anywhere; line-height:1.5; }
[data-thbp-cc-db-refresh-state] { display:block; margin-top:6px; }

/* v1.34.277: search by number when a name is not found */
.thbp-cc-num { margin-top: 14px; padding-top: 14px; border-top: 1px solid #e2e8f0; }
.thbp-cc-num-label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 600; color: #111827; }
.thbp-cc-num-row { display: flex; gap: 10px; }
.thbp-cc-num-row input { flex: 1; min-width: 0; min-height: 44px; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 16px; box-sizing: border-box; background: #fff; color: #111827; }
.thbp-cc-num-row .thbp-company-check-button { min-height: 44px; }
.thbp-cc-num-hint { margin: 8px 0 0; font-size: 12.5px; color: #6b7280; line-height: 1.55; }
.thbp-cc-num-hint a { color: #1f3b82; font-weight: 600; }
@media (max-width: 640px) { .thbp-cc-num-row { flex-direction: column; } .thbp-cc-num-row .thbp-company-check-button { width: 100%; } }

/* v1.34.280: official filings loading line - title, hint and timer */
.thbp-cc-dwh-pending-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.thbp-cc-dwh-pending-hint { font-weight: 400; color: #4b6b55; font-size: 12px; line-height: 1.4; }
.thbp-cc-dwh-pending-time { font-weight: 500; color: #4b6b55; font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* v1.34.281: label on AI-written English company names */
.thbp-cc-ai-en-tag { display: inline-block; align-self: flex-start; margin-top: 3px; font-style: normal; font-size: 11px; line-height: 1.5; color: #6b7280; background: #f3f4f6; border-radius: 999px; padding: 0 8px; }
.thbp-company-check-result-item .thbp-cc-ai-en-tag { display: table; margin-top: 4px; }

/* v1.34.283: English translation status, keeping the Thai result readable. */
.thbp-cc-translation-pending { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; color: #6b7280; font-size: 12px; font-weight: 400; line-height: 1.5; }
.thbp-cc-translation-pending .thbp-cc-ai-spinner { width: 12px; height: 12px; flex-basis: 12px; }
