/* PDF Word Counter — page-specific styles.
   Upload zone (.uz*) comes from base.css untouched. */

/* ── PDF info panel ──────────────────────────────────────────────────── */
.pwc-info-panel {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    gap: .25rem 1.5rem;
    background: #fafafe;
    border: 1px solid var(--border, #e8ecf0);
    border-radius: 1rem;
    padding: 1.125rem 1.25rem;
    margin-bottom: 1.75rem;
}
.pwc-info-row { display: flex; justify-content: space-between; gap: .75rem; padding: .375rem 0; border-bottom: 1px solid #eef1f5; font-size: .8125rem; }
.pwc-info-row:nth-last-child(-n+1) { border-bottom: none; }
.pwc-info-label { color: #94a3b8; font-weight: 600; }
.pwc-info-value { color: #0f172a; font-weight: 600; text-align: right; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Section headings ─────────────────────────────────────────────────── */
.pwc-section {  margin: 2.5rem 0 1.25rem; }
.pwc-section-title { font-size: 1.0625rem; font-weight: 800; color: #0f172a; margin: 0 0 .25rem; display: flex; align-items: center; gap: .5rem; }
.pwc-section-sub { font-size: .8125rem; color: #94a3b8; margin: 0 0 1.125rem; }

/* ── Stat cards ───────────────────────────────────────────────────────── */
.pwc-stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .75rem; }
.pwc-stat-card {
    background: #fff;
    border: 1.5px solid var(--border, #e8ecf0);
    border-radius: 1rem;
    padding: 1rem 1.125rem;
    transition: border-color .2s, transform .2s, box-shadow .2s;
}
.pwc-stat-card:hover { border-color: #c7d2fe; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(99, 102, 241, .08); }
.pwc-stat-value { font-size: 1.375rem; font-weight: 800; color: #0f172a; line-height: 1.2; }
.pwc-stat-label { font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #94a3b8; margin-top: .3rem; }
.pwc-stat-sub { font-size: .6875rem; color: #6366f1; font-weight: 600; margin-top: .2rem; }
.pwc-stat-card select.pwc-select { margin-top: .5rem; width: 100%; }

/* ── Controls: select / toggle / search input ────────────────────────── */
.pwc-select {
    height: 2rem;
    padding: 0 1.75rem 0 .75rem;
    border: 1.5px solid var(--border, #e8ecf0);
    border-radius: .5rem;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right .5rem center;
    font-size: .8125rem;
    font-weight: 600;
    color: #0f172a;
    font-family: inherit;
    cursor: pointer;
    appearance: none;
}
.pwc-select:focus { outline: none; border-color: var(--indigo, #6366f1); box-shadow: 0 0 0 3px rgba(99, 102, 241, .12); }

.pwc-toggle-row { display: flex; align-items: center; gap: .5rem; font-size: .8125rem; font-weight: 600; color: #475569; margin-bottom: 1rem; }
.pwc-toggle-row input[type="checkbox"] { width: 1rem; height: 1rem; accent-color: var(--indigo, #6366f1); cursor: pointer; }
.pwc-toggle-row label { cursor: pointer; }

.pwc-search-input {
    width: 100%;
    height: 2.375rem;
    padding: 0 1rem;
    border: 1.5px solid var(--border, #e8ecf0);
    border-radius: 9999px;
    font-size: .8438rem;
    font-family: inherit;
    color: #0f172a;
}
.pwc-search-input:focus { outline: none; border-color: var(--indigo, #6366f1); box-shadow: 0 0 0 3px rgba(99, 102, 241, .12); }
.pwc-search-row { display: flex; gap: .625rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.pwc-search-row .pwc-search-input { flex: 1; min-width: 12rem; }

.pwc-btn-outline {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem 1.125rem;
    border-radius: 9999px;
    border: 1.5px solid var(--border, #e8ecf0);
    background: #fff;
    font-size: .8125rem;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    font-family: inherit;
    transition: all .2s;
    white-space: nowrap;
}
.pwc-btn-outline:hover { border-color: #c7d2fe; background: #fafafe; color: var(--indigo, #6366f1); }
.pwc-btn-outline:disabled { opacity: .4; cursor: not-allowed; }

.pwc-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .625rem 1.375rem;
    border-radius: 9999px;
    border: none;
    background: var(--grad-primary, linear-gradient(135deg, #6366f1, #7c3aed));
    color: #fff;
    font-size: .8125rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 4px 12px rgba(99, 102, 241, .3);
    transition: transform .15s, box-shadow .15s;
}
.pwc-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(99, 102, 241, .38); }

/* ── Tables ───────────────────────────────────────────────────────────── */
.pwc-table-wrap { overflow-x: auto; border: 1px solid var(--border, #e8ecf0); border-radius: 1rem; }
.pwc-table { width: 100%; border-collapse: collapse; font-size: .8125rem; }
.pwc-table thead th {
    text-align: left;
    padding: .75rem 1rem;
    background: #fafafe;
    color: #64748b;
    font-weight: 700;
    font-size: .6875rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid var(--border, #e8ecf0);
    white-space: nowrap;
}
.pwc-table tbody td { padding: .625rem 1rem; border-bottom: 1px solid #f1f5f9; color: #334155; }
.pwc-table tbody tr:last-child td { border-bottom: none; }
.pwc-table tbody tr:hover { background: #fafafe; }
.pwc-table td:nth-child(5) { color: #94a3b8; font-size: .78rem; max-width: 24rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pwc-freq-bar { height: .5rem; border-radius: 9999px; background: var(--grad-primary, linear-gradient(135deg, #6366f1, #7c3aed)); min-width: 4px; }

.pwc-empty-msg { padding: 1.5rem; text-align: center; color: #94a3b8; font-size: .8438rem; }

/* ── Pagination ───────────────────────────────────────────────────────── */
.pwc-pagination { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .875rem; flex-wrap: wrap; }
.pwc-pagination-info { font-size: .78rem; color: #94a3b8; font-weight: 600; }

/* ── Text preview ─────────────────────────────────────────────────────── */
.pwc-preview-box {
    background: #fafafe;
    border: 1px solid var(--border, #e8ecf0);
    border-radius: 1rem;
    padding: 1.125rem 1.25rem;
    font-size: .8125rem;
    line-height: 1.75;
    color: #334155;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 26rem;
    overflow-y: auto;
}
.pwc-mark { background: #fef08a; color: #713f12; border-radius: .2rem; padding: 0 .1rem; }
.pwc-muted { color: #94a3b8; }
.pwc-preview-controls { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-top: .75rem; flex-wrap: wrap; }
.pwc-preview-match-count { font-size: .78rem; color: #6366f1; font-weight: 700; }

/* ── Keyword search results ───────────────────────────────────────────── */
.pwc-kw-summary { font-size: .875rem; color: #334155; margin: 0 0 .875rem; }
.pwc-kw-empty { font-size: .8438rem; color: #94a3b8; padding: 1rem 0; }
.pwc-kw-pages { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.125rem; }
.pwc-kw-page-chip { font-size: .75rem; font-weight: 700; padding: .25rem .625rem; border-radius: 9999px; background: #eef2ff; color: #4338ca; }
.pwc-kw-page-chip b { font-weight: 800; }
.pwc-kw-snippets { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .625rem; }
.pwc-kw-snippet { background: #fafafe; border: 1px solid var(--border, #e8ecf0); border-radius: .75rem; padding: .75rem .875rem; font-size: .8125rem; line-height: 1.6; color: #475569; }
.pwc-kw-snippet-page { display: inline-block; font-size: .6875rem; font-weight: 800; color: #6366f1; margin-right: .5rem; text-transform: uppercase; letter-spacing: .03em; }

/* ── Export row ───────────────────────────────────────────────────────── */
.pwc-export-row { display: flex; gap: .75rem; flex-wrap: wrap; }

/* ── Processing dashboard ─────────────────────────────────────────────── */
.pwc-progress-track { width: 100%; max-width: 26rem; height: .5rem; border-radius: 9999px; background: #eef2ff; margin: 1rem auto 0; overflow: hidden; }
.pwc-progress-fill { height: 100%; width: 0%; background: var(--grad-primary, linear-gradient(135deg, #6366f1, #7c3aed)); border-radius: 9999px; transition: width .3s ease; }

.pwc-dashboard {
    max-width: 26rem;
    margin: 1.25rem auto 0;
    background: #fafafe;
    border: 1px solid var(--border, #e8ecf0);
    border-radius: 1rem;
    padding: 1rem 1.25rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .875rem 1.25rem;
}
.pwc-dash-stat { text-align: left; }
.pwc-dash-stat-label { display: block; font-size: .625rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #94a3b8; margin-bottom: .2rem; }
.pwc-dash-stat-value { display: block; font-size: .9375rem; font-weight: 700; color: #0f172a; }

/* ── Toasts ───────────────────────────────────────────────────────────── */
#toastHost { position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: .5rem; align-items: center; pointer-events: none; }
.pwc-toast { background: #0f172a; color: #fff; font-size: .8125rem; font-weight: 600; padding: .75rem 1.25rem; border-radius: .75rem; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); opacity: 0; transform: translateY(.5rem); transition: opacity .25s, transform .25s; }
.pwc-toast.show { opacity: 1; transform: translateY(0); }
.pwc-toast-error { background: #dc2626; }

@media (max-width: 640px) {
    .pwc-info-panel { grid-template-columns: 1fr 1fr; }
    .pwc-dashboard { grid-template-columns: 1fr 1fr; }
    .pwc-table td:nth-child(5) { max-width: 8rem; }
}
