/* Metrics tab. Replaces the list + thread panes while open; the header stays. */
#metrics{display:none;grid-column:1/3;overflow-y:auto;padding:20px 24px 40px}
body.metrics #list,body.metrics #thread{display:none!important}
body.metrics #metrics{display:block}
/* The header stats describe the inbox selection; Metrics has its own numbers. */
body.metrics #hstats .stat{display:none}
/* On Metrics the way back is the link above the title, not a header pill. */
body.metrics #mbtn{display:none}
/* Sits with the header stats it expands on, so it reads as part of them. */
#hstats{align-items:center}
#mbtn{padding:3px 12px;font-size:12px;font-weight:600;border-radius:99px;color:var(--fg)}
#mbtn[aria-pressed="true"]{border-color:var(--in);box-shadow:inset 0 0 0 1px var(--in)}

.m-wrap{max-width:1080px;margin:0 auto}
.m-back{display:inline-flex;align-items:center;gap:6px;margin:0 0 10px;padding:4px 0;
  color:var(--dim);font-size:13px;font-weight:500;text-decoration:none}
.m-back:hover,.m-back:focus-visible{color:var(--fg)}
.m-head{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:6px}
.m-head h2{margin:0;font-size:18px;font-weight:600}
.m-head select{margin-left:auto;min-width:220px;max-width:100%}
.m-sub{color:var(--dim);font-size:12px;margin:0 0 18px}
.m-sec{margin:22px 0 8px;font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:var(--dim)}
.m-tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:10px}
.m-tile{background:var(--panel);border:1px solid var(--edge);border-radius:10px;padding:12px 14px;min-width:0}
.m-tile.hero{border-color:#2f3a4c}
.m-tile .k{font-size:12px;color:var(--dim)}
.m-tile .v{font-size:24px;font-weight:600;font-variant-numeric:tabular-nums;margin-top:2px;line-height:1.2}
.m-tile.hero .v{font-size:30px}
.m-tile .h{font-size:11px;color:var(--dim);margin-top:4px}

/* status: reserved colours, always with an icon and a word */
.m-status{display:inline-flex;align-items:center;gap:5px;font-size:11px;font-weight:600;
  padding:1px 8px;border-radius:99px;border:1px solid currentColor;margin-top:6px}
.m-status.good{color:#4ade80}.m-status.warning{color:#fbbf24}.m-status.critical{color:#f87171}

/* response-rate comparison: one series, one hue, value labelled on each bar */
.m-bars{background:var(--panel);border:1px solid var(--edge);border-radius:10px;padding:12px 14px}
.m-bar{display:grid;grid-template-columns:minmax(90px,200px) 1fr 96px;gap:10px;align-items:center;
  padding:5px 0;cursor:pointer;border-radius:6px}
.m-bar:hover .m-name{color:var(--fg)}
.m-bar .m-name{font-size:12px;color:var(--dim);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.m-bar .m-track{height:10px;position:relative}
.m-bar .m-fill{position:absolute;left:0;top:0;bottom:0;background:#1f6feb;border-radius:0 4px 4px 0;min-width:2px}
.m-bar .m-val{font-size:12px;font-variant-numeric:tabular-nums;text-align:right}

.m-table{width:100%;border-collapse:collapse;font-size:13px;font-variant-numeric:tabular-nums}
.m-tblwrap{overflow-x:auto;border:1px solid var(--edge);border-radius:10px}
.m-table th{font-weight:500;font-size:11px;color:var(--dim);text-align:right;padding:9px 12px;
  border-bottom:1px solid var(--edge);white-space:nowrap;background:var(--panel)}
.m-table td{text-align:right;padding:9px 12px;border-bottom:1px solid var(--edge);white-space:nowrap}
.m-table th:first-child,.m-table td:first-child{text-align:left}
.m-table td:first-child{max-width:260px;overflow:hidden;text-overflow:ellipsis;font-weight:600}
.m-table tbody tr{cursor:pointer}
.m-table tbody tr:hover{background:var(--panel)}
.m-table tbody tr:last-child td{border-bottom:0}
.m-cname{display:inline-flex;align-items:center;gap:6px;max-width:100%}
.m-ctext{overflow:hidden;text-overflow:ellipsis}
.m-rename{flex:none;display:inline-grid;place-items:center;width:28px;height:28px;padding:0;
  background:transparent;border:1px solid transparent;border-radius:6px;color:var(--dim)}
.m-rename:hover,.m-rename:focus-visible{color:var(--fg);border-color:var(--edge)}
.m-table td:first-child:has(.m-rform){max-width:none;min-width:320px}
.m-rform{display:flex;gap:6px;align-items:center;flex-wrap:wrap;white-space:normal}
.m-rform input{min-width:180px;padding:5px 8px}
.m-rform button{padding:5px 10px}
.m-rerr{color:var(--warn);font-size:12px;font-weight:400;flex-basis:100%}

.m-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:18px}
.m-actions.top{margin:0 0 4px}
.m-title{display:flex;align-items:center;gap:6px;min-width:0}
.m-title .m-ctext{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.m-title .m-rform input{font-size:15px;font-weight:600}
.m-pc{color:var(--dim);margin-left:4px}
.m-note{color:var(--dim);font-size:12px;margin-top:22px;line-height:1.6}
.m-note b{color:var(--fg);font-weight:600}

@media(max-width:760px){
  #metrics{grid-column:1;padding:14px 12px 40px}
  #mbtn{min-height:32px;padding:4px 14px;font-size:13px}
  .m-head select{margin-left:0;flex:1 1 100%;min-width:0}
  .m-tiles{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .m-tile .v{font-size:20px}.m-tile.hero .v{font-size:24px}
  .m-bar{grid-template-columns:minmax(70px,110px) 1fr 84px}
  .m-actions button{flex:1;min-height:44px}
  .m-rename{width:40px;height:40px}
  .m-back{min-height:40px}
  .m-rform input{min-width:0;flex:1 1 100%}
  .m-table td:first-child:has(.m-rform){min-width:240px}
  .m-rform button{min-height:40px}
}
