/* File viewer and repository browser (preview). Uses the colors of pipeline.css. */

.pv-frame { margin: 0.5rem 0.75rem; }

.pv-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.75rem;
    padding: 0.35rem 0.5rem;
    margin: 0 0 0.5rem;
    border: 1px solid var(--wvges-navy);
    border-radius: 4px;
    background: var(--panel-bg);
}
.pv-name { margin: 0; font-size: 0.95rem; word-break: break-all; }
.pv-size { color: #3d3d3d; }
.pv-actions { display: flex; gap: 0.75rem; margin-left: auto; }
.pv-actions a { font-weight: bold; color: var(--wvges-navy); }

/* File type badges */
.pv-badge {
    display: inline-block;
    min-width: 2.6rem;
    padding: 0.05rem 0.3rem;
    border-radius: 3px;
    font-size: 0.68rem;
    font-weight: bold;
    text-align: center;
    color: #fff;
    background: #595959;
}
.pv-k-pdf { background: #a4262c; }
.pv-k-picture { background: #2d6a2e; }
.pv-k-tiff { background: #6b3fa0; }
.pv-k-spreadsheet { background: #1e6b3a; }
.pv-k-word { background: #1f4e99; }
.pv-k-las { background: #8a4b00; }
.pv-k-zip, .pv-k-text { background: #3d4a5a; }

iframe.pv-pdf {
    display: block;
    width: 100%;
    height: calc(100vh - 7rem);
    min-height: 30rem;
    border: 1px solid #8c8c8c;
    background: #fff;
}
.pv-hint { font-size: 0.75rem; color: #3d3d3d; margin: 0.25rem 0; }
.pv-problem { padding: 0.5rem 0.75rem; border: 2px solid var(--accent-red); background: #fff; }
.pv-note { color: #595959; font-style: italic; }

.pv-picture { overflow: auto; max-height: calc(100vh - 6rem); border: 1px solid #8c8c8c; background: #f2f2f2; }
.pv-picture img { display: block; max-width: 100%; height: auto; cursor: zoom-in; margin: 0 auto; }
.pv-picture.pv-full img { max-width: none; cursor: zoom-out; }

.pv-tiff-tools { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; margin-bottom: 0.4rem; }
.pv-tiff-tools a { color: var(--wvges-navy); }
.pv-tiles { max-width: 100%; border: 1px solid #8c8c8c; background: #fff; }
.pv-tiles img { display: block; width: 100%; height: auto; }
.pv-page { font-size: 0.9rem; margin: 0.75rem 0 0.25rem; }

.pv-tabs { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0 0 0.4rem; }
.pv-tabs a {
    padding: 0.1rem 0.6rem;
    border: 1px solid var(--wvges-navy);
    border-radius: 3px 3px 0 0;
    color: var(--wvges-navy);
    text-decoration: none;
    background: #fff;
}
.pv-tabs a[aria-current="true"] { background: var(--wvges-navy); color: #fff; }
.pv-sheet h3 { font-size: 0.9rem; margin: 0.4rem 0 0.1rem; }
.pv-scroll { overflow: auto; max-width: 100%; max-height: calc(100vh - 9rem); border: 1px solid #c8c8c8; }
.pv-table { border-collapse: collapse; font-size: var(--table-size); border: 0; }
.pv-table th, .pv-table td { padding: 0.1rem 0.4rem; border: 1px solid #d6d6d6; white-space: nowrap; vertical-align: top; }
.pv-table thead th { position: sticky; top: 0; background: #e8eef5; z-index: 1; }
.pv-grid tbody th { background: #f4f4f4; color: #3d3d3d; font-weight: normal; text-align: right; }
.pv-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.pv-unit { font-weight: normal; color: #3d3d3d; }

.pv-word { max-width: 50rem; padding: 0.5rem 1rem; border: 1px solid #c8c8c8; background: #fff; line-height: 1.5; }
.pv-word p { margin: 0 0 0.5rem; }
.pv-word p.empty { margin: 0; }
.pv-word table { margin: 0.5rem 0; }
.pv-word td { white-space: normal; }

.pv-text { max-height: calc(100vh - 8rem); overflow: auto; padding: 0.5rem; border: 1px solid #c8c8c8; background: #fafafa; font-size: 0.75rem; }

.pv-download { padding: 1rem; border: 1px dashed #8c8c8c; background: #fff; }
.pv-button {
    display: inline-block;
    padding: 0.2rem 0.8rem;
    border-radius: 3px;
    background: var(--wvges-navy);
    color: #fff;
    font-weight: bold;
    text-decoration: none;
}

/* LAS plot */
.pv-las h3, .pv-las-header h3 { font-size: 0.9rem; margin: 0.6rem 0 0.2rem; }
.pv-las-header { display: flex; flex-wrap: wrap; gap: 0 1.5rem; }
.pv-las-header section { min-width: 0; }
.pv-las-plot { border: 1px solid #c8c8c8; background: #fff; }
.pv-las-controls { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; align-items: center; padding: 0.35rem 0.5rem; border-bottom: 1px solid #c8c8c8; background: #f6f0e4; }
.pv-las-controls label { white-space: nowrap; }
.pv-las-canvas { overflow: auto; max-height: calc(100vh - 8rem); }
.pv-las-canvas canvas { display: block; }
/* LAS: "Raw text | Log plot" switch, section links and the raw text */
.pv-las-switch { margin-bottom: 0.3rem; }
.pv-las-switch a { font-weight: bold; }
.pv-las-tools { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 1.25rem; margin: 0 0 0.2rem; }
.pv-las-tools > a { font-weight: bold; color: var(--wvges-navy); }
.pv-las-jump { display: flex; flex-wrap: wrap; gap: 0.15rem 0.6rem; }
.pv-las-jump span { font-weight: bold; color: var(--wvges-navy); }
.pv-las-jump a { color: var(--wvges-navy); font-family: Consolas, "Courier New", monospace; }
pre.pv-las-text { white-space: pre; max-height: calc(100vh - 9rem); margin: 0.2rem 0 0; line-height: 1.35; tab-size: 8; }
.pv-las-anchor { scroll-margin-top: 0.25rem; }

/* Records search (preview): list on the left, viewer on the right */
.pr-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(24rem, 52%); gap: 0.75rem; align-items: start; }
.pr-pane { position: sticky; top: 0.5rem; }
.pr-pane-bar { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; align-items: center; margin-bottom: 0.3rem; }
.pr-pane-bar button { font: inherit; font-weight: bold; color: var(--wvges-navy); background: #fff; border: 1px solid var(--wvges-navy); border-radius: 3px; padding: 0 0.6rem; cursor: pointer; }
.pr-pane-bar button:disabled { color: #8c8c8c; border-color: #c8c8c8; cursor: default; }
.pr-pane iframe { display: block; width: 100%; height: calc(100vh - 3rem); min-height: 30rem; border: 1px solid var(--wvges-navy); border-radius: 4px; background: #fff; }
.pr-results tr.pr-selected { background: #fff3c4 !important; outline: 2px solid var(--wvges-sand); }
.pr-results td a.pr-open { font-weight: bold; }
.pr-placeholder { padding: 1rem; color: #3d3d3d; }
.pr-preview-note { margin: 0 0 0.5rem; padding: 0.35rem 0.6rem; border-left: 4px solid var(--wvges-sky); background: #eef7fa; max-width: 60rem; }
@media (max-width: 70rem) {
    .pr-layout { grid-template-columns: minmax(0, 1fr); }
    .pr-pane { position: static; }
    .pr-pane iframe { height: 80vh; }
}

/* Repository browser */
.pf-repos { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 0.6rem; max-width: 80rem; padding: 0; list-style: none; }
.pf-repos li { padding: 0.5rem 0.75rem; border: 1px solid var(--wvges-navy); border-radius: 4px; background: var(--panel-bg); }
.pf-repos a { font-weight: bold; font-size: 0.95rem; color: var(--wvges-navy); }
.pf-repos p { margin: 0.25rem 0 0; }
.pf-group { font-size: 0.7rem; text-transform: uppercase; color: #3d3d3d; letter-spacing: 0.04em; }
.pf-path { display: flex; flex-wrap: wrap; gap: 0.2rem; list-style: none; padding: 0; margin: 0 0 0.4rem; font-size: 0.95rem; }
.pf-path li + li::before { content: "/"; padding: 0 0.3rem; color: #595959; }
.pf-path a { color: var(--wvges-navy); font-weight: bold; }
.pf-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 1rem; margin: 0.4rem 0; padding: 0.35rem 0.5rem; border: 1px solid var(--wvges-navy); border-radius: 4px; background: var(--panel-bg); max-width: 80rem; }
.pf-tools label { font-weight: bold; color: var(--wvges-navy); }
.pf-tools input, .pf-tools select { font: inherit; border: 1px solid var(--wvges-navy); border-radius: 3px; padding: 0 0.3rem; min-height: 1.4rem; background: #fff; }
.pf-folders { display: flex; flex-wrap: wrap; gap: 0.3rem; padding: 0; list-style: none; margin: 0.4rem 0 0.75rem; max-width: 80rem; }
.pf-folders a { display: inline-block; padding: 0.15rem 0.6rem; border: 1px solid #b9c7d8; border-radius: 3px; background: #f4f8fc; color: var(--wvges-navy); text-decoration: none; }
.pf-folders a:hover, .pf-folders a:focus-visible { background: #e2ecf6; text-decoration: underline; }
.pf-folders a::before { content: "\1F4C1"; padding-right: 0.3rem; }
.pf-gallery { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0; list-style: none; }
.pf-gallery a { display: block; text-align: center; font-size: 0.7rem; max-width: 160px; word-break: break-all; }
.pf-gallery img { display: block; width: 150px; height: auto; border: 1px solid #8c8c8c; background: #f2f2f2; }
.pf-count { font-weight: bold; }
.pp-grid .pv-badge { line-height: 1.25; padding: 0 0.3rem; }

.pr-search { width: auto; max-width: 80rem; }
.pr-fields {
    display: grid;
    grid-template-columns: max-content minmax(0, auto) max-content minmax(0, auto);
    gap: 0.25rem 0.6rem;
    align-items: center;
}
.pr-fields > label { font-weight: bold; color: var(--wvges-navy); text-align: right; }
.pr-fields select, .pr-fields input { justify-self: start; }
.pr-fields .pp-batch-fields label { font-weight: bold; color: var(--wvges-navy); }
.pr-search .actions { padding-left: 0; margin-top: 0.4rem; }
@media (max-width: 50rem) {
    .pr-fields { grid-template-columns: max-content minmax(0, 1fr); }
}
.pf-views { margin: 0.25rem 0; }
.pf-views a, .pf-views strong { margin-left: 0.5rem; }
.pf-wells { display: grid; grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr)); gap: 0.5rem; max-width: 90rem; }
.pf-well { padding: 0.3rem 0.5rem; border: 1px solid #c8c8c8; border-radius: 4px; background: #fff; }
.pf-well h2 { display: flex; flex-wrap: wrap; gap: 0 0.75rem; align-items: baseline; margin: 0 0 0.2rem; font-size: 0.85rem; }
.pf-well h2 a { font-size: 0.75rem; font-weight: normal; color: var(--wvges-navy); }
.pf-well ul { margin: 0; padding: 0; list-style: none; }
.pf-well li { display: flex; gap: 0.4rem; align-items: baseline; padding: 0.05rem 0; }
.pf-well .pv-size { margin-left: auto; font-size: 0.75rem; }

/* EFileViewer: selection and download toolbar */
.ev-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.4rem 1.5rem;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--wvges-navy);
    border-radius: 4px;
    background: var(--panel-bg);
}
.ev-group { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.75rem; }
.ev-toolbar button[type="submit"] {
    font: inherit;
    font-weight: bold;
    color: #fff;
    background: var(--wvges-navy);
    border: 1px solid var(--wvges-navy);
    border-radius: 3px;
    padding: 0.05rem 0.7rem;
    cursor: pointer;
}
.ev-toolbar .pp-button { margin: 0; padding: 0.05rem 0.7rem; }
.ev-toolbar .ev-excel { background: #1e6b3a; }
.ev-off { color: #595959; font-style: italic; }
.ev-check-all { font-weight: bold; color: var(--wvges-navy); white-space: nowrap; }
.ev-limits { margin: 0.2rem 0 0.3rem; }
.pr-results input.ev-pick { display: block; width: 0.95rem; height: 0.95rem; margin: 0; accent-color: var(--wvges-navy); }

/* EFileViewer uses the original page's layout: the search panel and file list on the left, the viewer on the right.
   The left column is as wide as the list needs; the viewer gets the rest of the window. */
.pp-records.ev2-records { grid-template-columns: minmax(0, max-content) minmax(24rem, 1fr); }
.ev2-records .pr-pane iframe { height: calc(100vh - 3rem); min-height: 30rem; }
.ev2-records .table-scroll { overflow-x: auto; }
/* The download toolbar and its limits line wrap to the width of the panel or list, whichever is wider. */
.ev2-records .ev-toolbar,
.ev2-records .ev-limits { width: 0; min-width: 100%; box-sizing: border-box; }

/* The search panel ends at the "Search Batch Date" drop-down: text that could widen it (the introduction, hints,
   error messages) wraps inside instead (width 0, then the panel's full width). Rows sit close together. */
.pp-search.ev2-search { width: fit-content; padding: calc(6px + 0.25rem) 0.6rem 0.35rem; }
.ev2-search .pp-intro,
.ev2-search .errors,
.ev2-search .pp-batch .hint { width: 0; min-width: 100%; box-sizing: border-box; }
.ev2-search .pp-intro { margin: 0 0 0.2rem; }
.ev2-search .w-api { width: 12ch; }
.ev2-search .pp-intro + .pp-intro { margin-bottom: 0.3rem; }
.ev2-search .pp-row { margin: 0; row-gap: 0; }
.ev2-search .pp-row + .pp-row { margin-top: 2px; }
.ev2-search select,
.ev2-search input[type="text"] { min-height: 1.2rem; line-height: 1.15; padding-top: 0; padding-bottom: 0; }
.ev2-search .pp-batch { margin: 0.15rem 0; padding-top: 0.1rem; padding-bottom: 0.15rem; }
.ev2-search .pp-batch legend { padding-top: 0; }
.ev2-search .pp-batch-fields { row-gap: 0.1rem; }
.ev2-search .pp-batch-range { margin: 0.05rem 0 0; }
.ev2-search .pp-batch .hint { margin: 0; line-height: 1.25; }
.ev2-search .actions { margin-top: 0.25rem; }

@media (max-width: 70rem) {
    .pp-records.ev2-records { grid-template-columns: minmax(0, 1fr); }
    .ev2-records .pr-pane iframe { height: 80vh; }
}
