.platform-page {
  display: grid;
  gap: 30px;
}

.platform-section .section-heading {
  gap: 12px 20px;
  align-items: flex-start;
}

.platform-assistant {
  max-inline-size: 720px;
}

.platform-assistant .section-heading {
  flex-wrap: wrap;
  gap: 10px 20px;
  overflow-wrap: anywhere;
}

.platform-assistant form a {
  text-decoration: underline;
  text-underline-offset: .15em;
}

.platform-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 16px;
  padding: 14px var(--panel-gutter);
}

.dialog-body .platform-filter { padding: 0 0 10px; }
.platform-filter .input-search { min-width: 0; }
.platform-filter p { padding-bottom: 10px; }
.platform-section .platform-filter { background: var(--surface-muted); }

.platform-included {
  color: var(--green);
  font-weight: 720;
}

.platform-excluded {
  color: var(--muted);
}

.platform-owner {
  margin-inline: 0;
  padding: 8px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.platform-owner legend {
  padding: 0 8px 0 0;
  font-weight: 700;
}

.platform-options,
.platform-module-list {
  padding: 0;
  margin: 0;
  border: 0;
}

.platform-module-list {
  list-style: none;
}

.platform-check {
  display: grid;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding-block: 10px;
  border-bottom: 1px solid var(--line);
  grid-template-columns: auto minmax(0, 1fr);
  cursor: pointer;
}

.platform-check input {
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0;
  accent-color: var(--accent);
}

.platform-check .cell-meta {
  font-weight: normal;
}

.platform-module-title,
.platform-checklist-main {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.platform-reset-button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: var(--button-radius);
  color: var(--subtle);
  background: transparent;
}

.platform-reset-button:hover {
  color: var(--muted);
}

.platform-reset-button svg { width: 14px; height: 14px; }

.platform-module-state {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 3px 8px;
  border-radius: var(--radius);
  background: var(--red-light);
  color: var(--red);
  font-size: .85rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}

.platform-module-state[data-enabled="true"] {
  background: var(--sage);
  color: var(--ink);
}

.platform-checklist-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 12px;
  min-height: 52px;
  padding-block: 4px;
  border-bottom: 1px solid var(--line);
}

.platform-checklist-row:last-child { border-bottom: 0; }

.platform-checklist-choice {
  min-width: 0;
  min-height: 44px;
  padding-block: 6px;
  border: 0;
}

.platform-checklist-choice input {
  width: 20px;
  height: 20px;
}

.platform-checklist-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 4px 10px;
}

#dialog[data-kind="platform-modules"] {
  --dialog-width: 1200px;
  scroll-padding-block: 84px 100px;
}

@media screen and (min-width: 761px) {
  #dialog[data-kind="platform-modules"] .dialog-actions {
    position: sticky;
    bottom: 0;
    z-index: 1;
    margin-inline: calc(-1 * var(--dialog-gutter));
    margin-block-end: calc(-1 * var(--dialog-body-padding));
    padding: 12px var(--dialog-gutter) var(--dialog-body-padding);
    border-top: 1px solid var(--line);
    background: var(--surface);
  }
}

@media screen and (max-width: 760px) {
  .platform-reset-button { width: 44px; height: 44px; }
}

@media screen and (max-width: 600px) {
  .platform-checklist-row {
    grid-template-columns: minmax(0, 1fr);
    padding-bottom: 10px;
  }

  .platform-checklist-status {
    justify-content: flex-start;
    padding-inline-start: 32px;
  }

  .platform-reset-button { order: 1; }
}

.platform-groups {
  display: grid;
  gap: 12px;
  padding: 0 16px 16px;
}

.platform-module-group {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: clip;
}

.platform-module-group > summary {
  padding: 12px 14px;
  font-weight: 720;
  cursor: pointer;
  background: var(--sage-tint);
}

.platform-module-group > summary > span {
  margin-inline-start: 10px;
  font-weight: 500;
}

.platform-module-group[open] > summary {
  border-bottom: 1px solid var(--line);
}

.platform-module-group > .platform-options,
.platform-module-group > .platform-module-list,
.platform-module-group > .module-settings-list {
  padding-inline: 14px;
}
