
/* Disk analysis: one window on the sheet tier. A row opens in place, so the head stays put and
   only the body scrolls. */

body.diskw-advisor-open {
  overflow: hidden;
}

.diskw-advisor-modal {
  position: fixed;
  z-index: 2000;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.66);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.diskw-advisor-dialog {
  display: flex;
  flex-direction: column;
  width: min(760px, 100%);
  max-height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-modal);
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  color: var(--text);
}

.diskw-advisor-dialog:focus {
  outline: none;
}

.diskw-modal-head {
  display: flex;
  flex: none;
  align-items: center;
  gap: 12px;
  padding: 18px 20px 14px 24px;
  border-bottom: 1px solid var(--line);
}

.diskw-modal-bit {
  flex: none;
  width: 44px;
  height: 44px;
}

.diskw-modal-bit:empty {
  display: none;
}

.diskw-modal-bit svg {
  display: block;
  width: 100%;
  height: 100%;
}

.diskw-modal-heading {
  flex: 1 1 auto;
  min-width: 0;
}

.diskw-modal-heading h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
}

.diskw-modal-heading p {
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--muted-text);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diskw-modal-close {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--control-bg);
  color: var(--text);
  cursor: pointer;
  font-size: 22px;
  place-items: center;
}

.diskw-modal-head .diskw-modal-close {
  width: 44px;
  height: 44px;
  border-color: transparent;
  background: none;
  color: var(--muted-text);
  font-size: 28px;
}

.diskw-modal-head .diskw-modal-close:hover {
  background: color-mix(in srgb, var(--text), transparent 90%);
  color: var(--text);
}

.diskw-advisor-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 26px;
  min-height: 0;
  padding: 18px 24px 22px;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-width: thin;
}

.diskw-advisor-body > * {
  flex: none;
}

.diskw-modal-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px 18px;
}

.diskw-modal-stat {
  min-width: 0;
}

.diskw-modal-stat > span,
.diskw-modal-stat > strong,
.diskw-modal-stat > small {
  display: block;
}

.diskw-modal-stat > span {
  color: var(--muted-text);
  font-size: 13px;
}

.diskw-modal-stat > strong {
  margin-top: 2px;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
}

.diskw-modal-stat > small {
  margin-top: 2px;
  color: var(--muted-text);
  font-size: 12.5px;
  line-height: 1.35;
}

.diskw-modal-section h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}

.diskw-modal-section-intro {
  margin: 3px 0 0;
  color: var(--muted-text);
  font-size: 14px;
  line-height: 1.45;
}

.diskw-modal-cats {
  display: flex;
  flex-direction: column;
  margin: 8px -10px 0;
}

.diskw-modal-cat-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 20px;
  gap: 1px 12px;
  align-items: center;
  padding: 10px;
  border-radius: var(--radius-control);
}

summary.diskw-modal-cat-head {
  cursor: pointer;
  list-style: none;
}

summary.diskw-modal-cat-head::-webkit-details-marker {
  display: none;
}

summary.diskw-modal-cat-head:hover {
  background: color-mix(in srgb, var(--text), transparent 93%);
}

.diskw-modal-cat-name {
  grid-area: 1 / 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 700;
}

.diskw-modal-cat-size {
  grid-area: 1 / 2;
  font-size: 15px;
  font-weight: 800;
  text-align: right;
}

.diskw-modal-cat-risk {
  grid-area: 2 / 1;
  min-width: 0;
  color: var(--muted-text);
  font-size: 13px;
}

.diskw-modal-cat-count {
  grid-area: 2 / 2;
  color: var(--muted-text);
  font-size: 12.5px;
  text-align: right;
}

.diskw-modal-cat-bar {
  grid-area: 3 / 1 / 4 / 3;
  height: 6px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 3px;
  background: color-mix(in srgb, var(--text), transparent 90%);
}

.diskw-modal-cat-bar > span {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
  background: var(--accent);
}

.diskw-risk-safe .diskw-modal-cat-bar > span {
  background: var(--color-success);
}

.diskw-risk-review .diskw-modal-cat-bar > span {
  background: var(--color-warn);
}

.diskw-risk-permanent .diskw-modal-cat-bar > span {
  background: var(--color-danger);
}

.diskw-modal-caret {
  grid-area: 1 / 3 / 4 / 4;
  justify-self: center;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--muted-text);
  border-bottom: 2px solid var(--muted-text);
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.16s ease;
}

details[open] > summary > .diskw-modal-caret {
  transform: translateY(2px) rotate(-135deg);
}

.diskw-modal-cat-body {
  display: grid;
  gap: 10px;
  padding: 4px 10px 16px;
}

.diskw-modal-fact strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
}
