.routine-summary-dialog {
  width:min(1120px,calc(100% - 24px)); max-height:calc(100dvh - 24px); padding:0;
  border:2px solid #9cc6e8; border-radius:22px; color:#10244a; background:#e9f6ff;
  box-shadow:0 18px 56px #061c4866;
}
.routine-summary-dialog::backdrop { background:#071a3b9e; backdrop-filter:blur(4px); }
.routine-summary-dialog [hidden] { display:none!important; }
.routine-summary-header {
  display:flex; justify-content:space-between; align-items:center; gap:14px;
  padding:clamp(14px,2.5vw,24px) clamp(15px,3vw,32px); color:white; background:#091f47;
}
.routine-summary-header h2 { margin:0; font-size:clamp(1.35rem,3.6vw,2.2rem); }
.routine-summary-header p { margin:.35rem 0 0; color:#c9e9ff; }
.routine-summary-header .btn { flex:none; }
.routine-summary-body { display:grid; gap:12px; padding:clamp(12px,3vw,28px); }
.routine-summary-filters, .routine-summary-section {
  min-width:0; padding:clamp(12px,2vw,20px); border:1px solid #b8d9f2; border-radius:14px; background:#fff;
}
.routine-summary-filters { display:grid; grid-template-columns:minmax(0,1.35fr) repeat(2,minmax(0,1fr)); gap:.75rem; }
.routine-summary-filters label, .routine-summary-stage-row label { display:grid; gap:.35rem; min-width:0; font-weight:750; }
.routine-summary-filters input, .routine-summary-filters select, .routine-summary-stage-row select {
  box-sizing:border-box; min-width:0; width:100%; min-height:44px; padding:.5rem .6rem;
  border:1px solid #92b5d4; border-radius:8px; background:#fff; color:#142d56; font:inherit; font-weight:500;
}
.routine-summary-stage-row { display:flex; align-items:end; }
.routine-summary-stage-row label { width:min(100%,220px); }
.routine-summary-report { display:grid; gap:12px; }
.routine-summary-metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.7rem; }
.routine-summary-metrics div { padding:.75rem; border:1px solid #c8ddef; border-radius:11px; }
.routine-summary-metrics strong { display:block; font-size:clamp(1.1rem,2.8vw,1.8rem); }
.routine-summary-metrics span, .routine-summary-hint, .routine-summary-page { color:#385577; font-size:.89rem; }
.routine-summary-section h3 { margin:0 0 .65rem; font-size:clamp(1.13rem,2.6vw,1.45rem); }
.routine-summary-section p { margin:.65rem 0 0; }
.routine-summary-chart-head, .routine-summary-paging { display:flex; justify-content:space-between; align-items:center; gap:.6rem; flex-wrap:wrap; }
.routine-summary-paging { justify-content:flex-end; margin-bottom:.55rem; }
.routine-summary-paging button { min-width:44px; min-height:44px; padding:.4rem .7rem; font-size:1.1rem; }
.routine-summary-lessons, .routine-summary-breakdown { padding:0; margin:0; list-style:none; }
.routine-summary-lessons { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:.4rem; }
.routine-summary-lesson {
  display:grid; justify-items:center; align-content:start; min-width:0; gap:.28rem;
  border-left:1px solid #cfdfeb; padding:.3rem .2rem; text-align:center;
}
.routine-summary-lesson:first-child { border-left:0; }
.routine-summary-lesson strong { font-size:1.2rem; }
.routine-summary-lesson small { color:#385577; }
.routine-summary-tiles { display:flex; justify-content:center; flex-wrap:wrap; min-height:23px; gap:3px; }
.routine-summary-tiles span { display:inline-block; width:clamp(10px,1.75vw,23px); aspect-ratio:1; border-radius:4px; background:#c8d9e8; }
.routine-summary-tiles .routine-summary-earned { background:#eda71d; }
.routine-summary-routine {
  display:grid; grid-template-columns:minmax(0,1.1fr) minmax(0,1fr) auto; align-items:center; gap:.8rem;
  padding:.65rem 0; border-bottom:1px solid #d8e5ef;
}
.routine-summary-routine > span { overflow-wrap:anywhere; font-weight:700; }
.routine-summary-routine progress { width:100%; height:14px; border:0; border-radius:10px; overflow:hidden; background:#dbe7f2; accent-color:#eda71d; }
.routine-summary-routine progress::-webkit-progress-bar { background:#dbe7f2; border-radius:10px; }
.routine-summary-routine progress::-webkit-progress-value { background:#eda71d; border-radius:10px; }
.routine-summary-routine progress::-moz-progress-bar { background:#eda71d; border-radius:10px; }
.routine-summary-notice { margin:0; }
.routine-summary-dialog :focus-visible, .routine-summary-trigger:focus-visible { outline:3px solid #1666ae; outline-offset:3px; }
@media(max-width:660px) {
  .routine-summary-filters { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .routine-summary-filters label:first-child { grid-column:1/-1; }
  .routine-summary-lessons { grid-template-columns:repeat(4,minmax(0,1fr)); }
  .routine-summary-lesson:nth-child(5) { border-left:0; }
  .routine-summary-routine { grid-template-columns:minmax(0,1fr) auto; gap:.35rem .7rem; }
  .routine-summary-routine progress { grid-column:1/-1; grid-row:2; }
}
