.extraction-source,
.extraction-result,
.extraction-detail {
    margin-top: 16px;
    border: 1px solid #d7dee8;
    border-radius: 6px;
    background: #fff;
}

.extraction-source {
    padding: 13px;
    background: #f6f8fb;
}

.extraction-source__heading,
.extraction-result__heading,
.extraction-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.extraction-source__heading span,
.extraction-result__heading span,
.extraction-section-heading > div > span {
    color: #e8177f;
    font-size: 8px;
    font-weight: 700;
}

.extraction-source h3,
.extraction-result h3,
.extraction-detail h3 {
    margin: 2px 0 0;
    color: #17243a;
    font-size: 13px;
}

.extraction-source__badge,
.extraction-section-heading > span {
    padding: 4px 7px;
    color: #496b94;
    border-radius: 4px;
    background: #eaf2fb;
    font-size: 7px;
    font-weight: 700;
    text-transform: uppercase;
}

.extraction-inputs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.extraction-inputs label,
.extraction-table-picker {
    display: grid;
    gap: 4px;
}

.extraction-source .form-select,
.extraction-table-picker .form-select {
    min-width: 0;
    color: #24354d;
    border-color: #cfd9e6;
    border-radius: 5px;
    font-size: 9px;
}

.extraction-source > p {
    min-height: 28px;
    margin: 8px 0 0;
    color: #718096;
    font-size: 8px;
    line-height: 1.45;
}

.extraction-source .btn-demo-action,
.extraction-detail .btn-demo-action {
    margin-top: 10px;
}

.extraction-source .btn-demo-action.is-busy {
    cursor: progress;
}

.extraction-result {
    overflow: hidden;
    border-color: #a9d7ca;
    background: #f5fcf9;
}

.extraction-result__heading {
    padding: 13px 13px 10px;
}

.extraction-result__heading output {
    color: #218265;
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
}

.extraction-confidence {
    height: 5px;
    margin: 0 13px 12px;
    overflow: hidden;
    border-radius: 3px;
    background: #dcebe6;
}

.extraction-confidence span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: #2d9a78;
    transition: width 240ms ease;
}

.extraction-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid #d8ebe5;
    background: #fff;
}

.extraction-metrics span {
    display: grid;
    gap: 2px;
    padding: 10px 5px;
    text-align: center;
}

.extraction-metrics span + span {
    border-left: 1px solid #e4e9f0;
}

.extraction-metrics strong {
    color: #263850;
    font-size: 10px;
}

.extraction-metrics small {
    color: #7b889c;
    font-size: 6px;
}

.extraction-detail {
    padding: 13px;
}

.extraction-table-picker {
    margin-top: 11px;
}

.extraction-columns {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.extraction-column {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e6ebf1;
}

.extraction-column:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.extraction-column > div {
    display: grid;
    grid-template-columns: minmax(0, auto) 16px minmax(0, 1fr);
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.extraction-column > div span,
.extraction-column > div strong {
    min-width: 0;
    overflow: hidden;
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.extraction-column > div span {
    color: #6f7e91;
}

.extraction-column > div strong {
    color: #263850;
}

.extraction-column.is-key > div strong {
    color: #c21875;
}

.extraction-column > div i {
    position: relative;
    height: 1px;
    background: #bdc7d4;
}

.extraction-column > div i::after {
    position: absolute;
    top: -2px;
    right: 0;
    width: 5px;
    height: 5px;
    border-top: 1px solid #8796a8;
    border-right: 1px solid #8796a8;
    content: "";
    transform: rotate(45deg);
}

.extraction-type {
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 6px;
    font-weight: 700;
    text-transform: uppercase;
}

.extraction-type--identifier { color: #b30d66; background: #fde8f4; }
.extraction-type--amount { color: #167257; background: #e2f5ed; }
.extraction-type--percentage { color: #376b9f; background: #e7f1fb; }
.extraction-type--date { color: #7a5b14; background: #f7f0d9; }
.extraction-type--rating { color: #64519a; background: #eeeafd; }
.extraction-type--text,
.extraction-type--unknown { color: #596779; background: #edf0f4; }

.extraction-json {
    max-height: 310px;
    margin: 12px 0 0;
    padding: 11px;
    overflow: auto;
    color: #d8e4f2;
    border-radius: 5px;
    background: #202a38;
    font: 7px/1.55 Consolas, "Courier New", monospace;
    white-space: pre;
}

@media (max-width: 720px) {
    .extraction-inputs { grid-template-columns: 1fr; }
    .extraction-result__heading output { font-size: 18px; }
}
