/*
 * Sweep results rail for One Map.
 *
 * Inherits the console's tokens rather than introducing any: ink surfaces, one
 * orange accent, Inter Tight for prose and JetBrains Mono for anything a
 * surveyor would read off a record (survey numbers, extents, the axis).
 *
 * Sits in the same 396px slot as the insight panel, on the same rails, so the
 * two never fight for the right hand side.
 */

.om-find {
    position: fixed;
    top: 64px;
    right: 12px;
    bottom: 12px;
    width: 396px;
    z-index: 40;
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    overflow: hidden;
    background: rgba(19, 23, 30, 0.92);
    border: 1px solid var(--om-line, rgba(42, 51, 62, 0.9));
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    color: #eef1f6;
}

.om-find[hidden] { display: none; }

/* ---- title bar ---- */

.om-find-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 14px 10px 16px;
    border-bottom: 1px solid var(--om-line, rgba(42, 51, 62, 0.9));
}

.om-find-eyebrow {
    flex: 1;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10px;
    letter-spacing: 0.16em;
    color: #aab3c2;
}

.om-find-x {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 10px;
    background: rgba(42, 51, 62, 0.5);
    color: #aab3c2;
    cursor: pointer;
    transition: background .18s cubic-bezier(.32, .72, .25, 1), color .18s;
}
.om-find-x:hover { background: rgba(255, 103, 37, 0.16); color: #ff8e52; }
.om-find-x .mi { font-size: 18px; }

/* ---- head ---- */

.om-find-head { padding: 14px 16px 10px; }

.om-find-count { display: flex; align-items: baseline; gap: 8px; }
.om-find-count b {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 28px;
    font-weight: 600;
    color: #ff8e52;
    line-height: 1;
}
.om-find-count span { font-size: 12.5px; color: #aab3c2; }

.om-find-sum { margin: 8px 0 0; font-size: 12.5px; line-height: 1.5; color: #c6cdd8; }

/* A capped sweep says so. A truncated list that reads as complete is worse
   than one that admits where it stops. */
.om-find-cap {
    margin: 8px 0 0;
    padding: 7px 9px;
    border-radius: 9px;
    font-size: 11.5px;
    line-height: 1.45;
    color: #f9eb57;
    background: rgba(249, 235, 87, 0.08);
    border: 1px solid rgba(249, 235, 87, 0.22);
}

/* ---- the distribution strip: the signature ---- */

.om-fs { padding: 4px 16px 12px; }

.om-fs-cap {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 7px;
}
.om-fs-cap b {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 9.5px;
    letter-spacing: 0.15em;
    color: #8d97a6;
    font-weight: 500;
}
.om-fs-cap em { font-style: normal; font-size: 10.5px; color: #7f8a99; }

.om-fs-track {
    position: relative;
    height: 34px;
    border-radius: 8px;
    background: linear-gradient(90deg, rgba(42, 51, 62, 0.35), rgba(255, 103, 37, 0.10));
    border: 1px solid var(--om-line, rgba(42, 51, 62, 0.9));
}

/* One tick per parcel, placed by area. Deliberately 2px wide with a generous
   invisible hit area, so a dense tail is still readable and still clickable. */
.om-fs-tick {
    position: absolute;
    top: 5px;
    bottom: 5px;
    width: 2px;
    margin-left: -1px;
    border-radius: 2px;
    background: rgba(255, 142, 82, 0.55);
    cursor: pointer;
    transition: background .16s, transform .16s cubic-bezier(.34, 1.4, .4, 1);
}
.om-fs-tick::after {
    content: '';
    position: absolute;
    inset: -6px -4px;
}
.om-fs-tick:hover {
    background: #ff6725;
    transform: scaleX(2.4);
}

.om-fs-axis {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10px;
    color: #7f8a99;
}

/* ---- the list ---- */

.om-find-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 4px 8px 8px;
    scrollbar-width: thin;
}

.om-find-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    margin-bottom: 2px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: background .16s cubic-bezier(.32, .72, .25, 1), border-color .16s;
}

.om-find-row:hover,
.om-find-row.is-hot {
    background: rgba(255, 103, 37, 0.10);
    border-color: rgba(255, 103, 37, 0.28);
}
.om-find-row.is-picked {
    background: rgba(255, 103, 37, 0.17);
    border-color: rgba(255, 103, 37, 0.5);
}
.om-find-row:focus-visible {
    outline: 2px solid #ff8e52;
    outline-offset: 1px;
}

.om-find-rank {
    flex: 0 0 22px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10.5px;
    color: #828d9c;
    text-align: right;
}

.om-find-tx { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; }
.om-find-tx b {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 13px;
    font-weight: 600;
    color: #eef1f6;
}
.om-find-tx i {
    flex: 1 0 100%;
    font-style: normal;
    font-size: 11px;
    color: #8d97a6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.om-find-flag {
    font-style: normal;
    font-size: 9px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 2px 5px;
    border-radius: 5px;
}
.om-find-flag.govt { background: rgba(249, 235, 87, 0.14); color: #f9eb57; }
.om-find-flag.road { background: rgba(122, 162, 247, 0.14); color: #7aa2f7; }

.om-find-ac {
    flex: 0 0 auto;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 12.5px;
    color: #ff8e52;
}

/* ---- foot ---- */

.om-find-foot {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-top: 1px solid var(--om-line, rgba(42, 51, 62, 0.9));
    background: rgba(13, 16, 21, 0.6);
}

.om-find-page { flex: 1; font-size: 11.5px; color: #8d97a6; }

/* The next page names its own price. A charge that appears after the click is
   a charge the user did not agree to. */
.om-find-more {
    border: 1px solid rgba(255, 103, 37, 0.4);
    border-radius: 10px;
    padding: 7px 12px;
    background: rgba(255, 103, 37, 0.12);
    color: #ffb492;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .18s cubic-bezier(.32, .72, .25, 1);
}
.om-find-more:hover:not(:disabled) { background: rgba(255, 103, 37, 0.22); }
.om-find-more:disabled { opacity: .55; cursor: default; }

/* ---- the receipt left in the chat ---- */

.sv-acq-onmap {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 12.5px;
    line-height: 1.5;
    color: #c6cdd8;
    background: rgba(255, 103, 37, 0.08);
    border: 1px solid rgba(255, 103, 37, 0.22);
}
.sv-acq-onmap b { color: #ff8e52; }
.sv-acq-onmap .mi { font-size: 17px; color: #ff8e52; flex: 0 0 auto; }

/* ---- reveal ---- */

@keyframes omFindIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}
.om-find-in { animation: omFindIn .34s cubic-bezier(.32, .72, .25, 1) backwards; }

/* The insight panel steps aside while results are up: both want the same slot,
   and a sweep is the thing the user just asked for. */
body.om-has-find #omPanel { display: none; }

/* ---- mobile: the rail becomes a sheet ---- */

@media (max-width: 860px) {
    .om-find {
        top: auto;
        left: 8px;
        right: 8px;
        bottom: 0;
        width: auto;
        max-height: 72vh;
        border-radius: 20px 20px 0 0;
        padding-bottom: env(safe-area-inset-bottom, 0);
    }
    .om-find-list { max-height: 44vh; }
    .om-find-count b { font-size: 24px; }
    /* Touch targets stay at the 44px floor even though the rows are dense. */
    .om-find-row { padding: 12px 10px; }
    .om-fs-track { height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
    .om-find-in { animation: none; }
    .om-fs-tick:hover { transform: none; }
    .om-find-row, .om-find-x, .om-find-more, .om-fs-tick { transition: none; }
}
