.rvp-progress-page,
.rvp-progress-page * {
  box-sizing: border-box;
}

.rvp-progress-page {
  container: rvp-progress / size;
  position: relative;
  width: 94%;
  height: 94%;
  max-width: 94%;
  max-height: 94%;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 24%) minmax(0, 1fr);
  gap: 2%;
  overflow: hidden;
  color: #172033;
  font-family: inherit;
}

.rvp-progress-card {
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(23, 32, 51, 0.12);
  border-radius: clamp(10px, 1.7cqh, 19px);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 0.7cqh 2.1cqh rgba(23, 32, 51, 0.13);
  overflow: hidden;
}

/* Horní souhrn. Je vždy celý viditelný a nic se v něm neroluje. */
.rvp-progress-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.05fr) minmax(155px, 0.72fr);
  gap: 1.5%;
  align-items: stretch;
  padding: 1.35%;
}

.rvp-progress-summary__overall {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4%;
  align-items: center;
}

.rvp-progress-ring {
  --progress: 0;
  width: clamp(66px, 15cqh, 112px);
  aspect-ratio: 1;
  flex: 0 0 auto;
  padding: 7%;
  border-radius: 50%;
  background:
    conic-gradient(
      #2f80ed 0deg,
      #2f80ed calc(var(--progress) * 3.6deg),
      rgba(47, 128, 237, 0.15) calc(var(--progress) * 3.6deg),
      rgba(47, 128, 237, 0.15) 360deg
    );
  box-shadow: inset 0 0 0 0.28cqh rgba(255, 255, 255, 0.68);
}

.rvp-progress-ring__content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0.35cqh 1.2cqh rgba(23, 32, 51, 0.13);
}

.rvp-progress-ring__value {
  font-size: clamp(18px, 4.1cqh, 40px);
  font-weight: 700;
  line-height: 0.95;
  white-space: nowrap;
}

.rvp-progress-ring__label {
  margin-top: 0.35em;
  font-size: clamp(9px, 1.45cqh, 14px);
  line-height: 1;
  white-space: nowrap;
}

.rvp-progress-summary__identity {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.rvp-progress-user {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(14px, 2.7cqh, 24px);
  font-weight: 650;
  line-height: 1.1;
}

.rvp-progress-summary__module-label {
  margin-top: 0.25em;
  color: #2f80ed;
  font-size: clamp(10px, 1.65cqh, 16px);
  font-weight: 600;
}

.rvp-progress-equivalent {
  margin-top: 0.45em;
  color: #58667c;
  font-size: clamp(9px, 1.35cqh, 13px);
  line-height: 1.25;
}

.rvp-progress-summary-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.5%;
  align-items: stretch;
}

.rvp-progress-summary-item {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4% 2%;
  border-radius: clamp(8px, 1.25cqh, 14px);
  text-align: center;
}

.rvp-progress-summary-item--completed {
  background: rgba(47, 158, 102, 0.12);
}

.rvp-progress-summary-item--partial {
  background: rgba(243, 167, 18, 0.14);
}

.rvp-progress-summary-item--not-started {
  background: rgba(104, 116, 138, 0.11);
}

.rvp-progress-summary-item strong,
.rvp-progress-summary-item span {
  display: block;
}

.rvp-progress-summary-item strong {
  font-size: clamp(18px, 4cqh, 38px);
  line-height: 1;
}

.rvp-progress-summary-item span {
  margin-top: 0.38em;
  font-size: clamp(9px, 1.35cqh, 13px);
  line-height: 1.12;
}

.rvp-progress-summary__actions {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6%;
}

.rvp-progress-button {
  width: 100%;
  min-height: clamp(32px, 5.4cqh, 48px);
  border: 0;
  border-radius: clamp(8px, 1.1cqh, 13px);
  padding: 0.45em 0.75em;
  font: inherit;
  font-size: clamp(10px, 1.55cqh, 15px);
  font-weight: 650;
  line-height: 1.1;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.rvp-progress-button:hover {
  transform: translateY(-0.12cqh);
  box-shadow: 0 0.45cqh 1.1cqh rgba(23, 32, 51, 0.18);
}

.rvp-progress-button:focus-visible,
.rvp-progress-filter:focus-visible,
.rvp-progress-group-button:focus-visible,
.rvp-progress-modal__close:focus-visible {
  outline: 3px solid rgba(47, 128, 237, 0.42);
  outline-offset: 2px;
}

.rvp-progress-button--primary {
  color: #fff;
  background: #2f80ed;
}

.rvp-progress-button--secondary {
  color: #172033;
  background: rgba(47, 128, 237, 0.14);
}

.rvp-progress-summary__hint {
  color: #68748a;
  font-size: clamp(8px, 1.2cqh, 12px);
  line-height: 1.15;
  text-align: center;
}

/* Spodní pracovní plocha. Rolují se pouze seznamy uvnitř panelů. */
.rvp-progress-workspace {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(215px, 29%) minmax(0, 1fr);
  gap: 2%;
  overflow: hidden;
}

.rvp-progress-groups-panel,
.rvp-progress-targets-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.rvp-progress-panel-header {
  flex: 0 0 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3.2% 4%;
  border-bottom: 1px solid rgba(23, 32, 51, 0.1);
  background: rgba(255, 255, 255, 0.76);
}

.rvp-progress-panel-header h2,
.rvp-progress-targets-header h2,
.rvp-progress-modal__header h2 {
  margin: 0;
  font-size: clamp(14px, 2.5cqh, 23px);
  line-height: 1.05;
}

.rvp-progress-panel-header p,
.rvp-progress-targets-header p,
.rvp-progress-modal__header p {
  margin: 0.25em 0 0;
  color: #68748a;
  font-size: clamp(9px, 1.35cqh, 13px);
  line-height: 1.15;
}

.rvp-progress-group-list {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: clamp(5px, 0.8cqh, 9px);
  padding: 3%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.rvp-progress-group-button {
  width: 100%;
  min-height: clamp(46px, 8.4cqh, 68px);
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.45em;
  border: 1px solid rgba(23, 32, 51, 0.11);
  border-radius: clamp(8px, 1.1cqh, 13px);
  padding: 3.2% 4%;
  color: #172033;
  background: rgba(245, 247, 251, 0.94);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, transform 0.12s ease;
}

.rvp-progress-group-button:hover:not(:disabled) {
  border-color: rgba(47, 128, 237, 0.55);
  transform: translateX(0.25cqw);
}

.rvp-progress-group-button.is-active {
  border-color: #2f80ed;
  background: rgba(47, 128, 237, 0.13);
  box-shadow: inset 0.35cqw 0 0 #2f80ed;
}

.rvp-progress-group-button.is-filtered-out,
.rvp-progress-group-button:disabled {
  opacity: 0.38;
  cursor: default;
}

.rvp-progress-group-button__top {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto;
  gap: 0.55em;
  align-items: baseline;
}

.rvp-progress-group-button__top strong {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: clamp(11px, 1.75cqh, 16px);
}

.rvp-progress-group-button__top > span:not(.rvp-progress-group-button__value) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #68748a;
  font-size: clamp(9px, 1.3cqh, 12px);
}

.rvp-progress-group-button__value {
  font-size: clamp(10px, 1.55cqh, 14px);
  font-weight: 700;
  white-space: nowrap;
}

.rvp-progress-group-button__bar,
.rvp-progress-active-group-bar,
.rvp-progress-target__bar {
  display: block;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(23, 32, 51, 0.1);
}

.rvp-progress-group-button__bar {
  height: clamp(5px, 0.8cqh, 8px);
}

.rvp-progress-group-button__bar > span,
.rvp-progress-active-group-bar > span,
.rvp-progress-target__bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #2f80ed;
}

.rvp-progress-targets-header {
  flex: 0 0 auto;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 2%;
  align-items: center;
  padding: 1.7% 2.1%;
  border-bottom: 1px solid rgba(23, 32, 51, 0.1);
  background: rgba(255, 255, 255, 0.78);
}

.rvp-progress-targets-header__group {
  min-width: 0;
}

.rvp-progress-targets-header__title-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1em;
  align-items: center;
}

.rvp-progress-targets-header__title-row > div {
  min-width: 0;
}

.rvp-progress-targets-header__title-row h2,
.rvp-progress-targets-header__title-row p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rvp-progress-targets-header__title-row > strong {
  font-size: clamp(12px, 2cqh, 18px);
  white-space: nowrap;
}

.rvp-progress-active-group-bar {
  height: clamp(6px, 0.9cqh, 9px);
  margin-top: 0.6em;
}

.rvp-progress-filters {
  min-width: 0;
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: clamp(4px, 0.5cqw, 8px);
}

.rvp-progress-filter {
  min-width: 0;
  min-height: clamp(28px, 4.5cqh, 40px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  border: 1px solid rgba(23, 32, 51, 0.15);
  border-radius: 999px;
  padding: 0.38em 0.68em;
  color: #33415c;
  background: rgba(255, 255, 255, 0.8);
  font: inherit;
  font-size: clamp(9px, 1.35cqh, 13px);
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.rvp-progress-filter strong {
  min-width: 1.5em;
  padding: 0.18em 0.4em;
  border-radius: 999px;
  background: rgba(23, 32, 51, 0.08);
  font-size: 0.9em;
}

.rvp-progress-filter:hover {
  border-color: rgba(47, 128, 237, 0.55);
}

.rvp-progress-filter.is-active {
  color: #fff;
  border-color: #2f80ed;
  background: #2f80ed;
}

.rvp-progress-filter.is-active strong {
  background: rgba(255, 255, 255, 0.22);
}

.rvp-progress-warning {
  flex: 0 0 auto;
  margin: 1% 1.6% 0;
  padding: 0.8% 1.1%;
  border-radius: clamp(7px, 0.95cqh, 11px);
  color: #7b2430;
  background: rgba(220, 53, 69, 0.1);
  font-size: clamp(9px, 1.3cqh, 12px);
  line-height: 1.25;
}

.rvp-progress-target-list {
  min-height: 0;
  flex: 1 1 auto;
  padding: 1.2% 1.5% 1.5%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.rvp-progress-target {
  width: 100%;
  min-height: clamp(54px, 8.8cqh, 76px);
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(180px, 0.9fr);
  gap: 2%;
  align-items: center;
  margin-bottom: clamp(5px, 0.75cqh, 9px);
  padding: 1.05% 1.35%;
  border-radius: clamp(8px, 1cqh, 12px);
  background: rgba(245, 247, 251, 0.96);
}

.rvp-progress-target[data-target-state="completed"] {
  background: rgba(47, 158, 102, 0.09);
}

.rvp-progress-target[data-target-state="partial"] {
  background: rgba(243, 167, 18, 0.11);
}

.rvp-progress-target[hidden],
.rvp-progress-empty-filter[hidden],
.rvp-progress-modal[hidden] {
  display: none !important;
}

.rvp-progress-target__identity {
  min-width: 0;
}

.rvp-progress-target__heading {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 0.7em;
}

.rvp-progress-target__code {
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: clamp(10px, 1.6cqh, 15px);
  font-weight: 700;
  line-height: 1.12;
}

.rvp-progress-target__type {
  flex: 0 0 auto;
  color: #68748a;
  font-size: clamp(8px, 1.15cqh, 11px);
  white-space: nowrap;
}

.rvp-progress-target__contributors {
  min-width: 0;
  margin-top: 0.32em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: #68748a;
  font-size: clamp(9px, 1.3cqh, 12px);
  line-height: 1.2;
}

.rvp-progress-target__status {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(70px, 1fr) minmax(58px, auto);
  gap: 0.8em;
  align-items: center;
}

.rvp-progress-target__bar {
  height: clamp(7px, 1.1cqh, 11px);
}

.rvp-progress-target[data-target-state="not-started"] .rvp-progress-target__bar > span {
  background: #a8b1c2;
}

.rvp-progress-target[data-target-state="partial"] .rvp-progress-target__bar > span {
  background: #f3a712;
}

.rvp-progress-target[data-target-state="completed"] .rvp-progress-target__bar > span {
  background: #2f9e66;
}

.rvp-progress-target__value {
  min-width: 5.2em;
  text-align: right;
  font-size: clamp(10px, 1.55cqh, 14px);
  font-weight: 700;
  white-space: nowrap;
}

.rvp-progress-empty-filter {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #68748a;
  font-size: clamp(12px, 1.8cqh, 17px);
  text-align: center;
}

/* Přehled započítaných aktivit se otevírá jako vrstva uvnitř aplikace. */
.rvp-progress-modal {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
}

.rvp-progress-modal__backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(23, 32, 51, 0.48);
  cursor: pointer;
}

.rvp-progress-modal__panel {
  position: relative;
  z-index: 1;
  width: min(64%, 760px);
  max-height: 78%;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(23, 32, 51, 0.13);
  border-radius: clamp(12px, 2cqh, 22px);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 1.5cqh 4cqh rgba(23, 32, 51, 0.3);
  overflow: hidden;
}

.rvp-progress-modal__header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  padding: 2.6% 3.2%;
  border-bottom: 1px solid rgba(23, 32, 51, 0.1);
}

.rvp-progress-modal__close {
  width: clamp(34px, 5.4cqh, 48px);
  aspect-ratio: 1;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #172033;
  background: rgba(23, 32, 51, 0.08);
  font: inherit;
  font-size: clamp(22px, 3.6cqh, 34px);
  line-height: 1;
  cursor: pointer;
}

.rvp-progress-modal__content {
  min-height: 0;
  padding: 2.5% 3.2% 3.2%;
  overflow-y: auto;
}

.rvp-progress-activities {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(6px, 1cqh, 11px);
  list-style: none;
}

.rvp-progress-activities li {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7em;
  padding: 0.7em 0.85em;
  border-radius: clamp(7px, 0.9cqh, 11px);
  background: rgba(47, 128, 237, 0.08);
  font-size: clamp(10px, 1.45cqh, 14px);
}

.rvp-progress-activities li strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rvp-progress-activities li span {
  flex: 0 0 auto;
  color: #68748a;
  font-size: 0.88em;
  white-space: nowrap;
}

.rvp-progress-note {
  margin: 0.9em 0 0;
  color: #5e6b80;
  font-size: clamp(9px, 1.35cqh, 13px);
  line-height: 1.3;
}

.rvp-progress-error,
.rvp-progress-loading {
  grid-row: 1 / -1;
  width: min(72%, 680px);
  min-height: 38%;
  align-self: center;
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1em;
  padding: 3%;
  border-radius: clamp(12px, 2cqh, 22px);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0.7cqh 2.1cqh rgba(23, 32, 51, 0.13);
  text-align: center;
}

.rvp-progress-error h2,
.rvp-progress-error p {
  margin: 0;
}

.rvp-progress-error .rvp-progress-button {
  width: auto;
  min-width: 10em;
}

.rvp-progress-loading__spinner {
  width: clamp(30px, 5cqh, 46px);
  height: clamp(30px, 5cqh, 46px);
  border: clamp(3px, 0.45cqh, 5px) solid rgba(47, 128, 237, 0.18);
  border-top-color: #2f80ed;
  border-radius: 50%;
  animation: rvp-progress-spin 0.8s linear infinite;
}

@keyframes rvp-progress-spin {
  to { transform: rotate(360deg); }
}

/* Scrollbary zůstávají uvnitř panelů a jsou dobře uchopitelné i dotykem. */
.rvp-progress-group-list,
.rvp-progress-target-list,
.rvp-progress-modal__content {
  scrollbar-width: auto;
  scrollbar-color: rgba(47, 128, 237, 0.55) rgba(23, 32, 51, 0.06);
}

.rvp-progress-group-list::-webkit-scrollbar,
.rvp-progress-target-list::-webkit-scrollbar,
.rvp-progress-modal__content::-webkit-scrollbar {
  width: clamp(8px, 1cqw, 12px);
}

.rvp-progress-group-list::-webkit-scrollbar-track,
.rvp-progress-target-list::-webkit-scrollbar-track,
.rvp-progress-modal__content::-webkit-scrollbar-track {
  background: rgba(23, 32, 51, 0.05);
  border-radius: 999px;
}

.rvp-progress-group-list::-webkit-scrollbar-thumb,
.rvp-progress-target-list::-webkit-scrollbar-thumb,
.rvp-progress-modal__content::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(47, 128, 237, 0.55);
  background-clip: padding-box;
}

/* Menší 16:9 plocha: skrývají se jen doplňující věty, ovládání zůstává viditelné. */
@container rvp-progress (max-height: 520px) {
  .rvp-progress-page {
    grid-template-rows: minmax(0, 22%) minmax(0, 1fr);
  }

  .rvp-progress-equivalent,
  .rvp-progress-summary__hint {
    display: none;
  }

  .rvp-progress-summary {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr) minmax(145px, 0.68fr);
    padding: 1.05%;
  }

  .rvp-progress-ring {
    width: clamp(60px, 14cqh, 82px);
  }

  .rvp-progress-target {
    min-height: 50px;
  }
}

@container rvp-progress (max-width: 900px) {
  .rvp-progress-summary {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr) minmax(138px, 0.72fr);
  }

  .rvp-progress-summary__module-label,
  .rvp-progress-equivalent {
    display: none;
  }

  .rvp-progress-workspace {
    grid-template-columns: minmax(195px, 31%) minmax(0, 1fr);
  }

  .rvp-progress-targets-header {
    grid-template-columns: minmax(170px, 0.9fr) minmax(0, 1.1fr);
  }

  .rvp-progress-filter {
    padding-inline: 0.5em;
  }

  .rvp-progress-target {
    grid-template-columns: minmax(0, 1.35fr) minmax(145px, 0.8fr);
  }
}

@container rvp-progress (max-width: 720px) {
  .rvp-progress-summary-grid {
    gap: 1.5%;
  }

  .rvp-progress-summary-item span,
  .rvp-progress-summary__hint {
    display: none;
  }

  .rvp-progress-workspace {
    grid-template-columns: minmax(170px, 32%) minmax(0, 1fr);
  }

  .rvp-progress-targets-header {
    grid-template-columns: 1fr;
    gap: 0.55em;
  }

  .rvp-progress-filters {
    justify-content: flex-start;
  }

  .rvp-progress-filter span {
    max-width: 7.5em;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .rvp-progress-target {
    grid-template-columns: 1fr;
    gap: 0.45em;
  }

  .rvp-progress-target__status {
    grid-template-columns: minmax(70px, 1fr) auto;
  }

  .rvp-progress-modal__panel {
    width: 84%;
  }
}