/* Components specific to Automata Well Log Intelligence.
   Built on the same tokens, radii, type scale and status colours as design.css (copied unchanged from the Well Intervention demo). */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link:focus { left: 10px; z-index: 60; }

/* two-thirds / one-third split whenever a card carries .span2 */
.grid.two:has(> .card.span2) { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid.two > .card.span2 { grid-column: auto; }
@media (max-width: 1100px) { .grid.two:has(> .card.span2) { grid-template-columns: 1fr; } }
.grid.four.qc-kpis .card { padding: 18px 20px; }
.grid.four.qc-kpis .metric { font-size: 28px; }

/* legend swatches */
.legend i.sw { width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; border: 1px solid #00000014; }
.qc-legend { margin-top: 10px; gap: 8px 16px; }

/* log display */
.logview-wrap { position: relative; overflow-x: auto; padding: 10px; }
.chart.logview { min-width: 640px; }
.chart text { font-family: inherit; }
.logtip { position: absolute; z-index: 5; pointer-events: none; background: #10233c; color: #fff; font-size: 11.5px; line-height: 1.5; padding: 9px 11px; border-radius: 10px; box-shadow: 0 8px 22px #10233c40; width: 220px; }
.logtip b { font-size: 12.5px; }
.logtip .tip-flags { color: #ffda9d; font-weight: 650; }

/* replay controls */
.rt-controls { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; margin-bottom: 10px; }
.rt-controls .button svg { width: 15px; height: 15px; margin-right: 6px; }
.rt-speed, .rt-check { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: #35495f; }
.rt-speed select { border: 1px solid #a4b5c9; border-radius: 8px; padding: 7px 9px; font-size: 12px; background: #fff; color: var(--ink); }
.rt-check input { width: 15px; height: 15px; }
.rt-scrub { width: 100%; accent-color: var(--teal); margin: 4px 0 0; }
.rt-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-bottom: 12px; }
.grid.rt-grid:has(> .card.span2) { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.rt-side { position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 104px); overflow: auto; }
@media (max-width: 1100px) { .grid.rt-grid:has(> .card.span2) { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.rt-side { position: static; max-height: none; } }
.rt-readings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.rt-read { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #f5f8fb; display: grid; gap: 1px; }
.rt-read small { font-size: 10.5px; color: var(--muted); font-weight: 650; }
.rt-read b { font-size: 16px; letter-spacing: -.02em; }
.rt-read b i { font-style: normal; font-size: 10.5px; font-weight: 550; color: var(--muted); }
.rt-read em { font-style: normal; font-size: 10.5px; color: #185d43; font-weight: 650; }
.rt-read.lv-warn { background: #fff0d7; border-color: #c4882a; } .rt-read.lv-warn em { color: #754507; }
.rt-read.lv-bad { background: #fce9e7; border-color: #c96864; } .rt-read.lv-bad em { color: #952b30; }
.rt-read.lv-info { background: #e8eff8; border-color: #6188ad; } .rt-read.lv-info em { color: #244f76; }
.rt-read.lv-na { background: #f0f4f8; } .rt-read.lv-na em { color: var(--muted); }
.alert-feed { display: grid; gap: 10px; max-height: 420px; overflow: auto; padding-right: 4px; }
.alert-card { border: 1px solid var(--line); border-left: 4px solid #6188ad; border-radius: 11px; padding: 13px 14px; background: #fff; }
.alert-card.sev-high { border-left-color: #a12d32; background: #fffafa; }
.alert-card.sev-medium { border-left-color: #c4882a; }
.alert-card.is-done { opacity: 1; background: #f5f8fb; }
.alert-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.alert-top b { font-size: 13px; }
.alert-depth { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--muted); }
.alert-card p { margin: 8px 0 0; font-size: 12px; line-height: 1.55; }
.alert-action { color: #29435f; }

/* meters, ring, quality */
.qmeter { margin-bottom: 13px; }
.qmeter-top { display: flex; justify-content: space-between; font-size: 12px; color: #35495f; font-weight: 600; margin-bottom: 5px; }
.qmeter-top b { color: var(--ink); }
.qmeter-track { height: 7px; border-radius: 6px; background: #e1eaf0; overflow: hidden; }
.qmeter-track span { display: block; height: 100%; border-radius: 6px; }
.qmeter small { display: block; margin-top: 4px; font-size: 11px; }
.well-table td .qmeter { margin: 0; } .well-table td .qmeter-top { margin-bottom: 4px; }
.qa-hero { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 26px; align-items: center; margin: 4px 0 18px; }
.qa-dims { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 28px; }
.qa-facts { padding-top: 14px; border-top: 1px solid var(--line); gap: 14px; }
.qa-facts strong { font-size: 13px; }
.ring { display: block; }
@media (max-width: 720px) { .qa-hero { grid-template-columns: 1fr; justify-items: center; } .qa-dims { grid-template-columns: 1fr; width: 100%; } .rt-readings { grid-template-columns: 1fr 1fr; } }
.filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.filters .form-field { min-width: 170px; }
.form-field select, .form-field input[type=range] { width: 100%; }
.form-field input[type=range] { padding: 0; accent-color: var(--teal); }
.thr-read { font-size: 12px; font-weight: 700; color: var(--teal); }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; gap: 12px; flex-wrap: wrap; }
.well-table tr.row-active td { background: #e7f3f0; }
.well-table small, td small { display: block; }
.table-wrap table small { margin-top: 2px; }

/* overview attention list */
.attn-list { display: grid; gap: 8px; margin-top: 8px; }
.attn-item { display: flex; gap: 10px; align-items: flex-start; text-align: left; border: 1px solid var(--line); background: #f5f8fb; border-radius: 10px; padding: 10px 12px; color: var(--ink); }
.attn-item:hover { background: #e7f3f0; border-color: var(--teal); }
.attn-item strong { display: block; font-size: 12.5px; }
.attn-item small { color: var(--muted); font-size: 11.5px; }

/* z-score bars, heat */
.zbars { display: grid; gap: 8px; margin: 8px 0 4px; }
.zrow { display: grid; grid-template-columns: 150px minmax(0, 1fr) 46px; gap: 10px; align-items: center; font-size: 12px; }
.ztrack { position: relative; height: 10px; background: #e6ebf2; border-radius: 6px; }
.ztrack .zmid { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: #8696ab; }
.ztrack b { position: absolute; top: 0; height: 100%; border-radius: 5px; }
.ztrack b.pos { background: #245ba3; } .ztrack b.neg { background: #b67618; }
.zrow em { font-style: normal; font-weight: 700; text-align: right; }
table.heat { min-width: 0; } table.heat .heatcell { text-align: center; font-weight: 700; }
.driver-list { margin-top: 10px; }

/* coverage + tool diagnostics */
.covstrip { position: relative; height: 12px; border-radius: 6px; background: #e1eaf0; overflow: hidden; }
.covstrip span { position: absolute; top: 0; bottom: 0; border-radius: 2px; }
.cov-scale { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); margin-top: 4px; }
.tool-card.is-selected { border-color: var(--teal); box-shadow: 0 0 0 3px #006b6918; }
.tool-score { text-align: center; border-radius: 12px; padding: 7px 13px; min-width: 70px; }
.tool-score b { display: block; font-size: 22px; letter-spacing: -.03em; line-height: 1.1; }
.tool-score small { font-size: 10.5px; font-weight: 700; text-transform: capitalize; }
.tool-advice { margin-top: 14px; }
.tool-advice .bullets { font-size: 12px; margin-top: 4px; }
table.matrix { min-width: 0; } table.matrix th, table.matrix td { text-align: center; } table.matrix th:first-child, table.matrix td:first-child { text-align: left; }
table.matrix .col-active { background: #eef5f8; }
.mx-cell { border: 0; border-radius: 8px; min-width: 52px; padding: 7px 10px; font-weight: 750; font-size: 13px; }
.mx-cell:hover { outline: 2px solid var(--teal); }
.mx-na { color: #8696ab; }

/* job log */
.summary-block { padding: 12px 0; border-bottom: 1px solid #e4edf2; } .summary-block:last-of-type { border-bottom: 0; }
.summary-block p { margin: 4px 0 0; line-height: 1.65; }
.timeline-row .time { width: 57px; white-space: nowrap; }

/* assistant */
.chat-card { display: flex; flex-direction: column; }
.chat-log { height: 520px; overflow: auto; display: grid; align-content: start; gap: 14px; padding: 6px 4px 12px; border-top: 1px solid var(--line); padding-top: 16px; }
.msg { display: flex; gap: 10px; align-items: flex-start; }
.msg.user { justify-content: flex-end; }
.bubble { max-width: 92%; border-radius: 14px; padding: 12px 15px; font-size: 13px; line-height: 1.6; }
.msg.user .bubble { background: var(--teal); color: #fff; border-bottom-right-radius: 4px; }
.msg.bot .bubble { background: #f0f4f8; border: 1px solid var(--line); border-top-left-radius: 4px; }
.bubble p { margin: 0 0 8px; } .bubble p:last-child { margin-bottom: 0; }
.bubble .bullets { margin: 6px 0 4px; line-height: 1.6; }
.bot-avatar { flex: 0 0 30px; width: 30px; height: 30px; border-radius: 10px; background: #10233c; color: #fff; display: grid; place-items: center; }
.bot-avatar svg { width: 17px; height: 17px; }
.src-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 10px; padding-top: 9px; border-top: 1px dashed #bdcbdc; }
.src-chip { font-size: 10.5px; font-weight: 650; background: #e2eaf3; color: #29435f; border: 1px solid #bdcbdc; border-radius: 20px; padding: 3px 9px; }
.chat-form { display: flex; gap: 10px; margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; min-width: 0; padding: 11px 13px; border-radius: 10px; border: 1px solid #a4b5c9; font-size: 13px; }
.chat-form .button svg { width: 15px; height: 15px; }
.suggest-list { display: grid; gap: 8px; }
.suggest { text-align: left; border: 1px solid var(--line); background: #f5f8fb; border-radius: 10px; padding: 9px 12px; font-size: 12px; color: var(--ink); font-weight: 550; }
.suggest:hover { background: #e7f3f0; border-color: var(--teal); }
.evidence .tip-flags { font-weight: 700; }

/* method + tour */
.method-steps .click-card { display: block; padding: 15px; }
.method-steps small { display: block; line-height: 1.5; }
.method-steps .usedin { margin-top: 9px; color: var(--teal); font-weight: 650; }
.tour-card { position: fixed; right: 20px; bottom: 20px; width: min(380px, calc(100vw - 32px)); z-index: 38; background: #fff; border: 1px solid #94b8b0; border-left: 4px solid var(--teal); border-radius: 14px; padding: 18px; box-shadow: 0 16px 40px #10233c33; }
.tour-card h3 { margin: 4px 0 6px; font-size: 16px; }
.tour-card .guide-progress { margin: 12px 0 14px; }
.card.dark .signal-stats { padding: 0; }
.drawer { width: min(620px, 100vw); }
.drawer h3 { margin: 16px 0 6px; }
.drawer .chart-wrap { padding: 4px; }
.drawer .chart.logview { min-width: 700px; }
.environment-label { max-width: 230px; }
.page-actions { align-items: center; }
@media (max-width: 660px) { .tour-card { right: 12px; left: 12px; bottom: 12px; width: auto; } .zrow { grid-template-columns: 110px minmax(0, 1fr) 40px; } .chat-log { height: 420px; } }
@media print { .tour-card, .page-actions { display: none !important; } }

.button { white-space: nowrap; }
.card-title .button-row .button { white-space: nowrap; }

.button svg { width: 15px; height: 15px; flex: none; margin-right: 6px; }
.table-compact, .well-table { min-width: 0; }
.grid.align-start { align-items: start; }
.drawer { width: min(780px, 100vw); }
.drawer .chart.logview { min-width: 600px; }
.tool-card .table-wrap td, .tool-card .table-wrap th { padding: 9px 10px; }
.card-title { flex-wrap: wrap; }
@media (max-width: 1100px) { .grid.rt-grid:has(> .card.span2) { grid-template-columns: 1fr; } }
