/* Leak Audit prototype styles (extends ../assets/css/site.css) */
.proto-bar { background: color-mix(in srgb, var(--primary) 9%, var(--bg)); border-bottom: 1px solid color-mix(in srgb, var(--primary) 30%, var(--line)); font-size: .84rem; color: var(--text-2); }
.proto-bar .wrap { display: flex; gap: 10px; align-items: center; padding-top: 9px; padding-bottom: 9px; }
.app { padding: 26px 0 40px; }
.app-grid > * { min-width: 0; }
.app-grid { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 28px; align-items: start; }
.app-side { position: sticky; top: 84px; }
.app-tabs { display: flex; flex-direction: column; gap: 3px; }
.app-tabs button { display: flex; align-items: center; gap: 10px; text-align: left; font: 600 .92rem/1 var(--body); color: var(--text-2); background: transparent; border: 1px solid transparent; border-radius: 10px; padding: 11px 12px; cursor: pointer; }
.app-tabs button svg { width: 18px; height: 18px; flex: none; }
.app-tabs button:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.app-tabs button[aria-selected="true"] { background: var(--surface); border-color: var(--line); color: var(--text); box-shadow: inset 3px 0 0 var(--primary); }
.app-tabs button:disabled { opacity: .4; cursor: not-allowed; }
.app-tabs .count { margin-left: auto; font: 600 .72rem/1 var(--mono); background: var(--primary-btn); color: var(--on-primary); padding: 4px 6px; border-radius: 6px; }
.app-tabs .count:empty { display: none; }
.side-card { margin-top: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: .82rem; }
.side-card b { font-family: var(--mono); }
@media (max-width: 900px) {
  .app-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .app-side { position: sticky; top: 64px; z-index: 20; background: var(--bg); margin: 0 -16px; padding: 8px 16px; border-bottom: 1px solid var(--line); }
  .app-tabs { flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .app-tabs::-webkit-scrollbar { display: none; }
  .app-tabs button { flex: none; padding: 9px 11px; }
  .app-tabs button[aria-selected="true"] { box-shadow: inset 0 -2px 0 var(--primary); }
  .side-card { display: none; }
}
.view-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 14px; margin-bottom: 20px; }
.view-head h1 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); margin-bottom: .3em; }
.view-head p { margin: 0; max-width: 70ch; }
.view-head .eyebrow { margin-bottom: 8px; }
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 38px 20px; border: 2px dashed var(--line-2); border-radius: 18px; background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; color: var(--text-2); }
.drop svg { width: 64px; height: 48px; color: var(--muted); }
.drop:hover, .drop.over { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, var(--surface)); }
.file-list { display: grid; gap: 12px; }
.file-card { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.file-top { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 14px; }
.file-top .name { font-weight: 600; word-break: break-all; flex: 1 1 220px; min-width: 0; }
.file-top select { width: auto; min-width: 220px; padding: 7px 10px; font-size: .86rem; }
.file-top .x { margin-left: auto; }
.file-map { border-top: 1px solid var(--line); padding: 12px 14px; display: none; }
.file-card.open .file-map { display: block; }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 10px; }
.map-grid label { font-size: .76rem; color: var(--muted); display: block; margin-bottom: 4px; }
.map-grid select { padding: 7px 9px; font-size: .84rem; }
.map-grid .req label::after { content: " *"; color: var(--primary-ink); }
.preview { margin-top: 12px; font-size: .78rem; }
.preview td, .preview th { padding: 6px 8px; white-space: nowrap; }
.run-bar { position: sticky; bottom: 12px; margin-top: 18px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; padding: 14px 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line-2); box-shadow: 0 12px 30px -12px rgba(0,0,0,.5); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; min-width: 0; }
.kpi .l { font-size: .76rem; color: var(--muted); }
.kpi .v { font: 700 1.5rem/1.15 var(--head); letter-spacing: -.01em; margin: 4px 0 2px; overflow-wrap: anywhere; }
.kpi .s { font-size: .74rem; color: var(--muted); }
.kpi.o .v { color: var(--primary-ink); }
.kpi.g .v { color: var(--accent-ink); }
.kpis-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr)); }
.kpis-4 .kpi { background: var(--surface-2); }
.rule-bars { display: grid; gap: 9px; }
.rb { display: grid; grid-template-columns: 150px 1fr 70px; gap: 10px; align-items: center; font-size: .82rem; }
.rb .track { height: 12px; background: var(--surface-2); border-radius: 6px; position: relative; overflow: hidden; }
.rb .track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; }
.rb .track i.id { background: color-mix(in srgb, var(--primary) 35%, transparent); }
.rb .track i.el { background: var(--primary); }
.rb .n { text-align: right; font-family: var(--mono); }
@media (max-width: 480px) { .rb { grid-template-columns: 100px 1fr 60px; } }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filters input[type=search] { flex: 1 1 200px; width: auto; }
.filters select { width: auto; flex: 0 1 200px; }
.check.inline { margin: 0; padding: 9px 12px; }
.leak-table td { font-size: .84rem; }
.leak-table .song b { display: block; }
.leak-table .song span { font: 500 .74rem var(--mono); color: var(--muted); }
.leak-table tr.detail td { background: var(--bg); }
.leak-table tr.detail p { margin: 0 0 8px; color: var(--text-2); max-width: 90ch; }
.leak-table .exp { background: none; border: 1px solid var(--line-2); color: var(--text-2); border-radius: 7px; padding: 5px 9px; cursor: pointer; font: 600 .76rem var(--body); white-space: nowrap; }
.leak-table .exp:hover { color: var(--text); border-color: var(--text-2); }
.gated { filter: blur(4px); user-select: none; pointer-events: none; }
.conf { font: 600 .68rem/1 var(--mono); text-transform: uppercase; letter-spacing: .05em; padding: 4px 6px; border-radius: 5px; border: 1px solid var(--line-2); display: inline-block; }
.conf.high { color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.conf.medium { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, transparent); }
.conf.low { color: var(--muted); }
.elig-yes { color: var(--accent-ink); font-weight: 600; }
.elig-no { color: var(--muted); }
.offer-grid { grid-template-columns: minmax(0, 1fr); }
.offer-inputs .inputs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 4px 22px; }
.paths { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.path { border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; min-width: 0; }
.path.best { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.path h4 { font: 700 1.05rem/1.2 var(--head); margin: 8px 0 2px; }
.path .big { font: 800 1.7rem/1.1 var(--head); letter-spacing: -.02em; margin: 8px 0 4px; overflow-wrap: anywhere; }
.path dl { margin: 10px 0 0; font-size: .82rem; }
.path .note { font-size: .74rem; color: var(--muted); margin-top: auto; padding-top: 10px; }
.report-frame { background: #fff; color: #15171A; border-radius: 14px; border: 1px solid var(--line); padding: clamp(18px, 4vw, 44px); overflow-x: auto; }
.settings-group h3 { font-size: 1rem; }
.saved-item { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin-bottom: 10px; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(30px); opacity: 0; background: var(--surface-3); color: var(--text); border: 1px solid var(--line-2); border-radius: 10px; padding: 11px 16px; font-size: .9rem; transition: all .25s; z-index: 200; pointer-events: none; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.loading { display: inline-block; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media print {
  .proto-bar, .app-side, .view-head .flex, .view-head .seg, .toast { display: none !important; }
  .app-grid { display: block; }
  .view:not(#view-report) { display: none !important; }
  #view-report { display: block !important; }
  .report-frame { border: 0; padding: 0; }
}
.app section.view { padding: 0; }
.leak-table .m-elig { display: none; font: 600 .68rem/1.3 var(--mono); text-transform: uppercase; color: var(--muted); margin-top: 3px; }
@media (max-width: 600px) {
  .leak-table th:nth-child(3), .leak-table td:nth-child(3), .leak-table th:nth-child(4), .leak-table td:nth-child(4),
  .leak-table th:nth-child(5), .leak-table td:nth-child(5), .leak-table th:nth-child(8), .leak-table td:nth-child(8),
  .leak-table th:nth-child(9), .leak-table td:nth-child(9) { display: none; }
  .proto-bar { font-size: .78rem; }
  .leak-table th:nth-child(7), .leak-table td:nth-child(7) { display: none; }
  .leak-table th, .leak-table td { padding: 10px 6px; }
  .leak-table th { letter-spacing: 0; }
  .leak-table .exp { padding: 4px 7px; }
  .leak-table .m-elig { display: block; }
}
#typeTable th, #typeTable td { padding: 10px 8px; }
#typeTable th { letter-spacing: 0; }
