.gd-pro-wrapper,
.gd-pro-wrapper * { box-sizing: border-box; }

.gd-pro-wrapper {
    --gd-bg: #f5f7fb;
    --gd-card: #ffffff;
    --gd-text: #172033;
    --gd-muted: #68738a;
    --gd-line: #dfe5ef;
    --gd-line-strong: #cbd4e3;
    --gd-primary: #2847d8;
    --gd-primary-soft: #eef2ff;
    --gd-success: #117a55;
    --gd-success-soft: #ecfdf5;
    --gd-warning: #9a5b09;
    --gd-warning-soft: #fff8e6;
    --gd-danger: #b42318;
    --gd-danger-soft: #fff0ee;
    --gd-radius: 16px;
    --gd-shadow: 0 10px 30px rgba(24, 39, 75, .07);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--gd-text);
    background: var(--gd-bg);
    border: 1px solid #e7ebf2;
    border-radius: 22px;
    min-height: 720px;
    overflow: hidden;
}

.gd-pro-wrapper button,
.gd-pro-wrapper input { font: inherit; }
.gd-pro-wrapper button { cursor: pointer; }
.gd-pro-wrapper [hidden] { display: none !important; }

.gd-shell { max-width: 1500px; margin: 0 auto; }

.gd-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 28px 30px 22px;
    background: #fff;
    border-bottom: 1px solid var(--gd-line);
}
.gd-header h1 { margin: 3px 0 5px; font-size: clamp(25px, 3vw, 36px); line-height: 1.1; letter-spacing: -.035em; }
.gd-header p { margin: 0; max-width: 720px; color: var(--gd-muted); font-size: 14px; }
.gd-eyebrow,
.gd-kicker { font-size: 11px; line-height: 1.2; font-weight: 800; letter-spacing: .11em; color: var(--gd-primary); }
.gd-header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

.gd-btn {
    min-height: 40px;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 9px 14px;
    font-weight: 750;
    font-size: 13px;
    transition: transform .12s ease, border-color .12s ease, background .12s ease, opacity .12s ease;
}
.gd-btn:hover:not(:disabled) { transform: translateY(-1px); }
.gd-btn:disabled { opacity: .45; cursor: not-allowed; }
.gd-btn-primary { background: var(--gd-primary); color: #fff; }
.gd-btn-secondary { background: #fff; color: #31405d; border-color: var(--gd-line-strong); }
.gd-btn-danger { background: #fff; color: var(--gd-danger); border-color: #efc5c1; }
.gd-btn-block { width: 100%; }

.gd-tabs {
    display: flex;
    overflow-x: auto;
    gap: 4px;
    padding: 10px 22px 0;
    background: #fff;
    border-bottom: 1px solid var(--gd-line);
    scrollbar-width: thin;
}
.gd-tab {
    white-space: nowrap;
    border: 0;
    border-bottom: 3px solid transparent;
    background: transparent;
    padding: 12px 14px 11px;
    color: #65718a;
    font-weight: 750;
    font-size: 13px;
}
.gd-tab span { display: inline-flex; min-width: 20px; justify-content: center; margin-left: 4px; background: #edf0f6; color: #5b667d; border-radius: 999px; padding: 1px 6px; font-size: 10px; }
.gd-tab.is-active { color: var(--gd-primary); border-bottom-color: var(--gd-primary); }
.gd-tab.is-active span { background: var(--gd-primary-soft); color: var(--gd-primary); }

.gd-main { padding: 26px; }
.gd-panel { display: none; }
.gd-panel.is-active { display: block; }

.gd-grid { display: grid; gap: 20px; }
.gd-grid-upload { grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); align-items: start; }
.gd-card { background: var(--gd-card); border: 1px solid var(--gd-line); border-radius: var(--gd-radius); box-shadow: var(--gd-shadow); padding: 21px; }
.gd-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; margin-bottom: 15px; }
.gd-card-head h2,
.gd-section-heading h2 { margin: 3px 0 0; font-size: 19px; letter-spacing: -.02em; }
.gd-help { margin: -5px 0 15px; color: var(--gd-muted); font-size: 12.5px; line-height: 1.55; }
.gd-chip { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 9px; background: #f0f3f8; color: #56647d; font-size: 11px; font-weight: 750; white-space: nowrap; }

.gd-drop-zone {
    min-height: 210px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    border: 2px dashed #bdc8dc;
    border-radius: 14px;
    background: #fafbfe;
    color: #34415a;
    padding: 26px;
    outline: none;
    transition: border-color .15s ease, background .15s ease;
}
.gd-drop-zone:hover,
.gd-drop-zone:focus,
.gd-drop-zone.is-dragover { border-color: var(--gd-primary); background: var(--gd-primary-soft); }
.gd-drop-zone strong { font-size: 15px; }
.gd-drop-zone span { color: var(--gd-muted); font-size: 12px; max-width: 430px; }
.gd-drop-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 13px; background: #e6ebff; color: var(--gd-primary); font-weight: 900; font-size: 13px; }

.gd-options { display: grid; gap: 8px; margin: 16px 0; }
.gd-check { display: flex; align-items: center; gap: 9px; color: #4a5770; font-size: 12.5px; }
.gd-check input { accent-color: var(--gd-primary); }

.gd-progress { margin-top: 16px; }
.gd-progress-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--gd-muted); font-size: 11px; margin-bottom: 6px; }
.gd-progress-track { height: 8px; border-radius: 999px; overflow: hidden; background: #e9edf5; }
.gd-progress-track span { display: block; width: 0; height: 100%; background: var(--gd-primary); transition: width .2s ease; }

.gd-inline-actions { display: flex; gap: 8px; }
.gd-link-btn { border: 0; background: transparent; color: var(--gd-primary); font-weight: 750; font-size: 12px; padding: 4px 3px; }

.gd-doc-list { display: grid; gap: 9px; max-height: 540px; overflow: auto; padding-right: 2px; }
.gd-doc-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 11px;
    align-items: center;
    padding: 11px 12px;
    border: 1px solid var(--gd-line);
    border-radius: 12px;
    background: #fff;
    transition: border-color .15s ease, background .15s ease;
}
.gd-doc-item.is-selectable { cursor: pointer; }
.gd-doc-item.is-selectable:hover { border-color: #aebbe8; background: #fbfcff; }
.gd-doc-item.is-active { border-color: var(--gd-primary); box-shadow: 0 0 0 2px rgba(40,71,216,.09); background: #fbfcff; }
.gd-doc-check { accent-color: var(--gd-primary); }
.gd-doc-main { min-width: 0; }
.gd-doc-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 780; font-size: 13px; color: #253149; }
.gd-doc-meta { display: flex; flex-wrap: wrap; gap: 5px 10px; margin-top: 4px; color: var(--gd-muted); font-size: 10.5px; }
.gd-status { display: inline-flex; align-items: center; gap: 4px; font-weight: 750; }
.gd-status.done { color: var(--gd-success); }
.gd-status.error { color: var(--gd-danger); }
.gd-status.processing { color: var(--gd-primary); }
.gd-status.pending { color: var(--gd-warning); }
.gd-remove-btn { border: 0; background: transparent; color: #8b95a7; width: 30px; height: 30px; border-radius: 8px; font-size: 18px; line-height: 1; }
.gd-remove-btn:hover { color: var(--gd-danger); background: var(--gd-danger-soft); }

.gd-empty { color: #8490a5; font-size: 13px; text-align: center; padding: 22px 14px; border: 1px dashed var(--gd-line-strong); border-radius: 12px; background: rgba(255,255,255,.55); }
.gd-empty-large { min-height: 180px; display: grid; place-items: center; }

.gd-document-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 22px;
    padding: 16px 18px;
    border-radius: 14px;
    border: 1px solid #d9e0ed;
    background: #fff;
}
.gd-document-banner strong { display: block; font-size: 15px; }
.gd-document-banner span { color: var(--gd-muted); font-size: 11px; }
.gd-type-badge { flex: 0 0 auto; border-radius: 999px; padding: 6px 10px; background: var(--gd-primary-soft); color: var(--gd-primary) !important; font-weight: 800; }

.gd-section-heading { display: flex; justify-content: space-between; align-items: end; gap: 15px; margin-bottom: 14px; }
.gd-section-heading-spaced { margin-top: 30px; }
.gd-coverage { color: var(--gd-muted); font-size: 11px; font-weight: 700; }

.gd-facts-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.gd-fact {
    min-height: 125px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 14px;
    background: #fff;
    border: 1px solid var(--gd-line);
    border-radius: 13px;
}
.gd-fact-label { color: #77839a; font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .07em; }
.gd-fact-value { color: #253149; font-size: 13px; line-height: 1.45; font-weight: 680; overflow-wrap: anywhere; }
.gd-fact-value.is-missing { color: #929bad; font-weight: 550; }
.gd-source-btn { margin-top: auto; align-self: flex-start; border: 0; background: transparent; padding: 2px 0; color: var(--gd-primary); font-size: 10.5px; font-weight: 800; }

.gd-theme-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.gd-theme {
    background: #fff;
    border: 1px solid var(--gd-line);
    border-radius: 13px;
    padding: 15px;
}
.gd-theme-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 8px; }
.gd-theme-head strong { font-size: 13px; }
.gd-page-tag { border-radius: 999px; padding: 3px 7px; background: #f1f4f9; color: #65718a; font-size: 9.5px; font-weight: 800; }
.gd-theme p { margin: 0; color: #45526a; font-size: 12.5px; line-height: 1.6; }
.gd-theme-actions { margin-top: 9px; }
.gd-theme-empty { color: #8e98aa; }

.gd-notice { margin-top: 18px; padding: 13px 15px; border: 1px solid #d8dfeb; border-radius: 12px; background: #f8f9fc; color: #5b677e; font-size: 11.5px; line-height: 1.55; }
.gd-notice strong { color: #39465e; }

.gd-mini-search { width: min(300px, 100%); border: 1px solid var(--gd-line-strong); background: #fff; border-radius: 10px; padding: 9px 11px; color: var(--gd-text); outline: none; }
.gd-mini-search:focus { border-color: var(--gd-primary); box-shadow: 0 0 0 3px rgba(40,71,216,.08); }
.gd-sections-list { display: grid; gap: 10px; }
.gd-section-item { background: #fff; border: 1px solid var(--gd-line); border-radius: 13px; overflow: hidden; }
.gd-section-item summary { list-style: none; cursor: pointer; padding: 14px 16px; }
.gd-section-item summary::-webkit-details-marker { display: none; }
.gd-section-summary-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 11px; align-items: start; }
.gd-section-num { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: #f0f3f9; color: #5d6980; font-size: 10px; font-weight: 850; }
.gd-section-title { font-size: 13px; font-weight: 800; color: #2d3951; }
.gd-section-extract { margin-top: 4px; color: #68738a; font-size: 11.5px; line-height: 1.5; }
.gd-section-body { border-top: 1px solid var(--gd-line); padding: 14px 16px 16px 55px; }
.gd-section-body pre { margin: 0; white-space: pre-wrap; word-break: break-word; font: inherit; color: #4a566d; font-size: 11.5px; line-height: 1.55; max-height: 360px; overflow: auto; }
.gd-topic-tag { display: inline-flex; margin-right: 6px; border-radius: 999px; padding: 3px 7px; background: var(--gd-primary-soft); color: var(--gd-primary); font-size: 9px; font-weight: 850; text-transform: uppercase; }

.gd-search-card { max-width: 1120px; margin: 0 auto; }
.gd-search-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; }
.gd-search-row input { min-width: 0; border: 1px solid var(--gd-line-strong); border-radius: 10px; padding: 10px 12px; outline: none; }
.gd-search-row input:focus { border-color: var(--gd-primary); box-shadow: 0 0 0 3px rgba(40,71,216,.08); }
.gd-results { display: grid; gap: 9px; margin-top: 17px; }
.gd-result { border: 1px solid var(--gd-line); border-radius: 12px; padding: 13px 14px; background: #fff; }
.gd-result-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.gd-result-head strong { font-size: 12.5px; }
.gd-result-meta { color: var(--gd-muted); font-size: 10px; white-space: nowrap; }
.gd-result p { margin: 0; color: #536078; font-size: 12px; line-height: 1.55; }
.gd-result mark { background: #fff0a6; color: inherit; border-radius: 3px; padding: 0 1px; }

.gd-stats-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 11px; margin-bottom: 20px; }
.gd-stat { background: #fff; border: 1px solid var(--gd-line); border-radius: 13px; padding: 16px; }
.gd-stat strong { display: block; font-size: clamp(20px, 2.5vw, 30px); letter-spacing: -.04em; }
.gd-stat span { display: block; margin-top: 4px; color: var(--gd-muted); font-size: 10.5px; }
.gd-word-card { box-shadow: none; }
.gd-word-cloud { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; min-height: 100px; }
.gd-word { border: 0; background: #f2f5fa; color: #4f5c73; border-radius: 999px; padding: 5px 9px; line-height: 1; }
.gd-word:hover { background: var(--gd-primary-soft); color: var(--gd-primary); }

.gd-toast { position: fixed; z-index: 999999; right: 22px; bottom: 22px; max-width: min(420px, calc(100vw - 44px)); padding: 11px 14px; border-radius: 11px; color: #fff; background: #253149; box-shadow: 0 12px 35px rgba(20,28,45,.24); font-size: 12px; font-weight: 700; opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .18s ease, transform .18s ease; }
.gd-toast.is-visible { opacity: 1; transform: translateY(0); }
.gd-toast.success { background: var(--gd-success); }
.gd-toast.error { background: var(--gd-danger); }
.gd-toast.warning { background: var(--gd-warning); }

@media (max-width: 1020px) {
    .gd-grid-upload { grid-template-columns: 1fr; }
    .gd-facts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gd-stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
    .gd-pro-wrapper { border-radius: 0; border-left: 0; border-right: 0; }
    .gd-header { padding: 20px 16px; flex-direction: column; }
    .gd-header-actions { width: 100%; justify-content: stretch; }
    .gd-header-actions .gd-btn { flex: 1 1 auto; }
    .gd-tabs { padding-left: 8px; padding-right: 8px; }
    .gd-main { padding: 16px 12px 22px; }
    .gd-card { padding: 16px; }
    .gd-facts-grid,
    .gd-theme-grid,
    .gd-stats-grid { grid-template-columns: 1fr; }
    .gd-section-heading { align-items: stretch; flex-direction: column; }
    .gd-mini-search { width: 100%; }
    .gd-search-row { grid-template-columns: 1fr 1fr; }
    .gd-search-row input { grid-column: 1 / -1; }
    .gd-document-banner { align-items: flex-start; flex-direction: column; }
    .gd-section-body { padding-left: 16px; }
    .gd-section-summary-row { grid-template-columns: auto minmax(0,1fr); }
    .gd-section-summary-row .gd-page-tag { grid-column: 2; justify-self: start; }
}

/* 2.1 · perfiles documentales */
.gd-fact-wide { grid-column: 1 / -1; min-height: auto; }
.gd-fact-wide .gd-fact-value { max-width: 1100px; line-height: 1.62; }
.gd-section-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 10px; }
.gd-auto-summary { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: #f7f9fc; color: #4d5970; font-size: 11.5px; line-height: 1.55; }
.gd-auto-summary strong { color: #33405a; }
.gd-section-item[open] { border-color: #c7d1ee; box-shadow: 0 5px 18px rgba(24, 39, 75, .05); }
.gd-level-2 { margin-left: 22px; }
.gd-level-3 { margin-left: 44px; }
.gd-level-4 { margin-left: 66px; }
.gd-level-2 .gd-section-num,
.gd-level-3 .gd-section-num,
.gd-level-4 .gd-section-num { background: #f6f7fa; }

@media (max-width: 720px) {
    .gd-level-2 { margin-left: 8px; }
    .gd-level-3 { margin-left: 16px; }
    .gd-level-4 { margin-left: 24px; }
}
