.admin-history { max-width:1200px; margin-inline:auto; }
.admin-history [hidden], #adminHistoryButton[hidden] { display:none !important; }
.admin-history .workspace-heading h1 { font-size:clamp(28px,3vw,40px); }
.admin-privacy { padding:18px 20px; border:1px solid #c5dfd7; border-radius:16px; background:#eef8f4; color:#365b53; font-size:14px; line-height:1.7; }
.history-filters { display:flex; flex-wrap:wrap; align-items:end; gap:14px; margin:24px 0; }
.history-filters label { display:grid; gap:8px; flex:1 1 150px; min-width:0; color:#254840; font-size:14px; font-weight:650; }
.history-filters input,.history-filters select { width:100%; min-width:0; min-height:46px; padding:10px; border:1px solid #cddfd9; border-radius:10px; background:#fff; color:#24463e; font:inherit; }
.history-filters button { min-height:46px; }
.history-metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin-bottom:24px; }
.history-metrics div { padding:18px; border:1px solid #d6e6df; border-radius:16px; background:#fff; }
.history-metrics strong { display:block; font-size:28px; color:#007d69; }
.history-metrics span { font-size:14px; color:#56736c; }
.history-metrics strong { margin:9px 0; font-variant-numeric:tabular-nums; font-size:34px; letter-spacing:-1px; }
.history-metrics small { display:block; font-size:12px; color:#617c74; line-height:1.5; }
.history-metrics .history-metric-feature { background:linear-gradient(135deg,#063e38,#087e69); border-color:#087e69; }
.history-metric-feature strong { color:#fff; }
.history-metric-feature span,.history-metric-feature small { color:#c8eee1; }
.history-range { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin-top:24px; }
.history-range>span { font-weight:650; color:#24463e; margin-right:4px; }
.history-range button { padding:9px 15px; border:1px solid #cddfd9; border-radius:999px; color:#385d54; background:#fff; font:inherit; font-size:14px; cursor:pointer; min-height:40px; }
.history-range button[aria-pressed=true] { color:#fff; background:#087e69; border-color:#087e69; }
.history-range small { color:#617c74; margin-left:auto; }
.history-stats-period { color:#617c74; font-size:12px; line-height:1.7; margin-bottom:16px; }
.history-charts { display:grid; grid-template-columns:minmax(0,1.65fr) minmax(0,1fr); gap:20px; margin-bottom:32px; }
.history-chart { min-width:0; border:1px solid #d6e6df; border-radius:20px; padding:24px; background:#fff; box-shadow:0 5px 22px #103d3505; }
.history-chart h2 { font-size:19px; color:#173e37; margin:0 0 8px; }
.history-chart-caption { font-size:13px; color:#617c74; line-height:1.65; margin:0 0 18px; }
.history-chart svg { display:block; width:100%; height:auto; overflow:visible; margin-top:16px; }
.history-chart-legend { display:flex; gap:20px; font-size:13px; font-weight:650; }
.series-search { color:#007d69; }.series-ai { color:#4868ac; }
.history-grid-line { stroke:#e8f0ec; stroke-width:1; }
.history-axis { fill:#627d74; font-size:12px; font-family:inherit; }
.history-line-search,.history-line-ai { fill:none; stroke-width:2.5; stroke-linejoin:round; }
.history-line-search { stroke:#007d69; }.history-line-ai { stroke:#4868ac; stroke-dasharray:6 3; }
.history-area-search { fill:#007d690d; }.history-area-ai { fill:#4868ac0a; }
.history-point-search { fill:#007d69; }.history-point-ai { fill:#4868ac; }
.history-chart-empty { color:#617c74; padding:35px 0; }
.history-data-table { font-size:13px; color:#385d54; margin-top:16px; }
.history-data-table summary { cursor:pointer; padding:8px 0; }
.history-data-table table { width:100%; border-collapse:collapse; margin-top:12px; font-variant-numeric:tabular-nums; }
.history-data-table caption { text-align:left; margin-bottom:10px; color:#617c74; }
.history-data-table th,.history-data-table td { padding:9px 4px; text-align:right; border-bottom:1px solid #e8f0ec; }
.history-data-table th:first-child,.history-data-table td:first-child { text-align:left; }
.history-outcome { margin:18px 0; }
.history-outcome-label { display:flex; justify-content:space-between; gap:12px; color:#385d54; font-size:13px; line-height:1.5; }
.history-outcome-label strong { font-variant-numeric:tabular-nums; }
.history-outcome-track { height:7px; border-radius:9px; background:#eef4f1; overflow:hidden; margin:8px 0 5px; }
.history-outcome-bar { display:block; height:100%; border-radius:9px; background:#007d69; }
.history-outcome-bar.ai { background:#4868ac; }.history-outcome-bar.insufficient { background:#b98226; }.history-outcome-bar.failed { background:#b85950; }
.history-outcome small { font-size:11px; color:#617c74; }
.history-latency { grid-column:1/-1; }
.history-latency-values { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:22px; }
.history-latency-values div { min-width:0; padding-left:18px; border-left:3px solid #bddfd1; }
.history-latency-values span,.history-latency-values small { display:block; font-size:13px; color:#617c74; line-height:1.6; }
.history-latency-values strong { display:block; font-size:29px; color:#007d69; margin:6px 0; font-variant-numeric:tabular-nums; }
.history-latency-values small { font-size:12px; }
.history-list-heading { font-size:22px; margin:30px 0 18px; color:#173e37; }
@media(max-width:900px) { .history-charts { grid-template-columns:minmax(0,1fr); }.history-latency { grid-column:auto; } }
.history-items { display:grid; gap:12px; margin-bottom:20px; }
.history-item { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:12px; text-align:left; padding:22px; border:1px solid #d6e6df; border-radius:18px; background:#fff; color:#163e38; cursor:pointer; font:inherit; }
.history-item:hover { border-color:#00a487; background:#f7fcfa; }
.history-item:focus-visible,.admin-history button:focus-visible { outline:3px solid #c9912c; outline-offset:3px; }
.history-item strong { display:block; overflow-wrap:anywhere; font-size:17px; line-height:1.5; }
.history-item small { display:block; margin-top:8px; font-size:13px; line-height:1.7; color:#58776e; }
.history-badge { align-self:start; padding:8px 10px; border-radius:9px; background:#e3f5ef; color:#087762; font-size:13px; font-weight:750; }
.history-badge.warning { background:#fff2d9; color:#83591e; }
.history-status { color:#516f67; font-size:15px; line-height:1.6; }
.history-detail { padding:26px; border:1px solid #d6e6df; border-radius:22px; background:#fff; overflow-wrap:anywhere; }
.history-detail h2 { margin:24px 0 12px; font-size:clamp(23px,2.4vw,32px); line-height:1.4; }
.history-detail h3 { margin:26px 0 12px; font-size:19px; }
.history-detail p,.history-detail li { font-size:16px; line-height:1.8; white-space:pre-wrap; }
.history-detail .history-detail-meta { color:#617c74; font-size:14px; }
.history-source { padding:18px; margin:12px 0; background:#f1f8f5; border-radius:14px; }
.history-source strong { font-size:15px; }
.history-source p { font-size:14px; margin-bottom:6px; }
.history-source small { font-size:12px; color:#557168; }
.consult-history-notice { margin-top:14px; color:#b7d8cd; font-size:12px; line-height:1.6; }
.history-incorporate{margin-top:28px;padding-top:24px;border-top:1px solid #d6e6df}
.history-incorporate [hidden]{display:none!important}
.history-review-form{display:grid;gap:18px;margin-top:16px}
.history-review-form>label{display:grid;gap:8px;font-size:15px;font-weight:650;color:#24463e}
.history-review-form input:not([type=checkbox]),.history-review-form textarea,.history-review-form select{box-sizing:border-box;width:100%;min-width:0;max-width:100%;padding:12px;border:1px solid #cddfd9;border-radius:10px;background:#fff;color:#24463e;font-family:inherit;font-size:15px;font-weight:400;line-height:1.6}
.history-review-form textarea{min-height:260px;resize:vertical}
.history-review-form .history-review-consent{display:flex;align-items:flex-start;gap:10px;font-weight:500;line-height:1.6}
.history-review-consent input{flex-shrink:0;width:20px;height:20px;margin-top:3px}
.history-review-actions{display:flex;gap:12px;flex-wrap:wrap}
@media(max-width:600px) {
  .history-chart { padding:18px; }
  .history-latency-values { grid-template-columns:minmax(0,1fr); gap:18px; }
  .history-range small { flex-basis:100%; margin-left:0; }
  .history-metrics strong { font-size:28px; }
  .history-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .history-item { grid-template-columns:minmax(0,1fr); padding:18px; }
  .history-badge { justify-self:start; }
  .history-detail { padding:18px; }
  .history-filters button { width:100%; }
  .history-filters label { flex-basis:calc(50% - 14px); }
}

.history-row { display:grid; grid-template-columns:auto minmax(0,1fr); gap:10px; align-items:start; }
.history-select { display:flex; align-items:center; justify-content:center; width:44px; min-height:44px; margin-top:12px; cursor:pointer; }
.history-select input,.history-select-all input { width:20px; height:20px; accent-color:#087762; cursor:pointer; }
.history-select input:disabled { cursor:not-allowed; opacity:.4; }
.history-bulk { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; }
.history-select-all { display:flex; align-items:center; gap:10px; padding-left:12px; color:#254840; font-size:14px; font-weight:650; cursor:pointer; }
.history-danger { color:#9b2c1f; border-color:#e7c3bd; }
.history-danger:hover:not(:disabled) { background:#fdf1ef; border-color:#c9776b; }
.history-danger:disabled { opacity:.5; cursor:not-allowed; }
.history-cleanup { margin:0 0 24px; padding:16px 20px; border:1px solid #ecd6d2; border-radius:16px; background:#fffaf9; }
.history-cleanup summary { cursor:pointer; color:#7c2d22; font-weight:750; }
.history-cleanup form { display:flex; flex-wrap:wrap; align-items:end; gap:14px; margin-top:16px; }
.history-cleanup label { display:grid; gap:8px; flex:1 1 180px; min-width:0; color:#254840; font-size:14px; font-weight:650; }
.history-cleanup select { width:100%; min-height:46px; padding:10px; border:1px solid #cddfd9; border-radius:10px; background:#fff; color:#24463e; font:inherit; }
.history-cleanup button { min-height:46px; }
.history-cleanup-note { margin:12px 0 0; color:#6c5a56; font-size:13px; }
@media (max-width:640px) {
  .history-select { width:36px; }
  .history-cleanup button,.history-bulk button { width:100%; }
}
