/* Three native objects only. Original source/model/controller styles stay owned
 * by their existing modules. Text inherits reader scaling; no stimulus is scaled. */
:is(#p004-01, #hma-p041-03, #p075-distinguishing-predictions) {
  container-type: inline-size;
}
:is(#p004-01, #p075-distinguishing-predictions) .learning-ui-v4 {
  margin: 16px 0;
}
:is(#p004-01, #p075-distinguishing-predictions) .lu4-product {
  overflow: visible;
  background: #f6f6f2;
}
:is(#p004-01, #p075-distinguishing-predictions) .lu4-productbar {
  background: #fff;
  border-radius: 16px 16px 0 0;
}
:is(#p004-01, #p075-distinguishing-predictions) .lu4-facts {
  margin: 0;
  padding-block: 12px;
  background: #fff;
}
:is(#p004-01, #p075-distinguishing-predictions) .lu4-facts > div {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  padding: 0;
}
:is(#p004-01, #p075-distinguishing-predictions) .lu4-facts dd {
  flex: 1 1 260px;
}
:is(#p004-01, #p075-distinguishing-predictions) .lu4-workspace {
  padding: 20px 24px;
}

/* Scheduler: an editor and the actual five meeting records, sharing one store. */
#p004-01 .lu4-stage {
  grid-template-columns: minmax(260px, .75fr) minmax(0, 1.25fr);
  align-items: start;
  gap: 24px;
}
#p004-01 .dv7-calendar-editor {
  display: grid;
  gap: 16px;
  min-width: 0;
}
#p004-01 .p004-v4-setup {
  display: grid;
  justify-items: start;
  gap: 8px;
  margin: 0;
  padding: 0 0 16px;
  border-bottom: 1px solid #deded9;
}
#p004-01 .p004-v4-calendar {
  grid-column: auto;
  min-width: 0;
}
#p004-01 .p004-v4-counts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 16px;
  padding: 0;
  background: transparent;
}
#p004-01 .p004-v4-counts > span {
  display: grid;
  gap: 4px;
  padding: 12px 16px;
  border: 1px solid #deded9;
  border-radius: 10px;
  background: #fff;
}
#p004-01 .p004-v4-counts strong {
  margin: 0;
  font-size: 1.7em;
  font-weight: 600;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
#p004-01 .p004-v4-calendar > table {
  background: #fff;
}
#p004-01 .p004-v4-calendar > table caption {
  padding-bottom: 8px;
}
#p004-01 .p004-v4-calendar > table :is(th, td) {
  padding: 12px 8px;
}
#p004-01 .p004-v4-calendar > table th:first-child {
  width: 27%;
  padding-left: 12px;
}
#p004-01 .p004-v4-calendar time {
  display: inline-block;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}
#p004-01 [data-p004-date][data-selected="true"],
#p004-01 [data-p004-date="2026-10-02"]:not([data-selected]) {
  background: #f7f5c9;
}
#p004-01 .p004-v4-review {
  margin: 16px 0 10px;
}
#p004-01 .p004-v4-primary {
  align-items: stretch;
}
#p004-01 .p004-v4-primary .lu4-action {
  padding-inline: 16px;
}
#p004-01 .p004-v4-calendar > .lu4-feedback {
  padding: 12px 0;
  background: transparent;
}
#p004-01 .p004-v4-record {
  margin: 8px 0 16px;
  padding: 12px 16px;
  border: 1px solid #deded9;
  border-radius: 8px;
  background: #fff;
}
#p004-01 .p004-v4-conditions {
  margin-top: 0;
}
#p004-01 .p004-v4-offline {
  background: #fff;
  padding: 16px;
  border: 1px solid #deded9;
  border-radius: 8px;
}

/* Study method: three actual stages connected by readable interval labels.
 * Stage lengths here are layout space, not a fitted curve or time scale. */
#hma-p041-03 .hma-spacing-method > .hma-object-title {
  font-size: 1.15em;
  margin: 0 0 16px;
}
#hma-p041-03 .hma-spacing-procedure {
  grid-template-columns: minmax(0, 1fr) max-content minmax(0, 1.4fr) max-content minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
  margin: 0 0 20px;
  padding: 16px;
  border-radius: 12px;
  background: #f6f6f2;
}
#hma-p041-03 .hma-spacing-procedure > li:not(:has(span)) {
  padding: 12px;
  border: 1px solid #deded9;
  border-radius: 8px;
  background: #fff;
}
#hma-p041-03 .hma-spacing-procedure :is(.hma-study-gap, .hma-retention-gap) {
  writing-mode: horizontal-tb;
  align-self: center;
  justify-content: center;
  margin: 0;
  padding: 8px 0;
  border: 0;
  border-bottom: 2px solid #3454ff;
  font-size: 1em;
  white-space: nowrap;
}
#hma-p041-03 .hma-condition-lattice {
  margin-top: 0;
}
#hma-p041-03 .hma-condition-lattice > .hma-object-title {
  margin-bottom: 8px;
}
#hma-p041-03 .hma-condition-lattice table {
  table-layout: fixed;
}
#hma-p041-03 .hma-condition-lattice tbody td {
  background: #f6f6f2;
}
#hma-p041-03 .hma-qualitative-finding {
  margin-top: 16px;
  padding: 16px 0 0;
}
#hma-p041-03 .hma-qualitative-finding p span {
  margin-block: 8px;
}

/* Each declared rule keeps its real prediction row in the same candidate. */
#p075-distinguishing-predictions .lu4-description {
  margin-block: 12px;
}
#p075-distinguishing-predictions .lu4-stage {
  gap: 16px;
}
#p075-distinguishing-predictions .lu4-stage > .lu4-actions {
  margin-top: 0;
}
#p075-distinguishing-predictions .dv7-rule-board {
  margin: 0;
}
#p075-distinguishing-predictions .dv7-rules-caption {
  margin: 0 0 12px;
  font: inherit;
  color: #66676b;
}
#p075-distinguishing-predictions .dv7-rule-candidates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
#p075-distinguishing-predictions .dv7-rule-candidate {
  display: grid;
  grid-template-rows: 1fr auto;
  min-width: 0;
  padding: 16px;
  border: 1px solid #deded9;
  border-radius: 12px;
  background: #fff;
}
#p075-distinguishing-predictions .dv7-rule-candidate .p075-rules {
  margin: 0 0 12px;
  padding: 0;
}
#p075-distinguishing-predictions .dv7-rule-candidate .p075-rules > div {
  grid-template-columns: 2em minmax(0, 1fr);
  align-items: center;
  padding: 0;
  border: 0;
}
#p075-distinguishing-predictions .dv7-rule-candidate .p075-rules dt {
  font-size: 1.5em;
  line-height: 1.3;
}
#p075-distinguishing-predictions .dv7-rule-candidate .p075-predictions {
  margin: 0;
  table-layout: fixed;
}
#p075-distinguishing-predictions .dv7-rule-candidate .p075-predictions thead {
  font-size: 1em;
}
#p075-distinguishing-predictions .dv7-rule-candidate .p075-predictions :is(th, td) {
  width: auto;
  padding: 8px 0;
}
#p075-distinguishing-predictions .dv7-rule-candidate .p075-predictions :is(th, td):last-child {
  text-align: right;
}
#p075-distinguishing-predictions .dv7-rule-candidate [data-p075-answer] {
  font-size: 1.4em;
  line-height: 1.4;
  font-weight: 500;
}
#p075-distinguishing-predictions .p075-workbench[data-p075-result-ready="true"] .dv7-rule-candidate {
  border-color: #b7b8b2;
}
#p075-distinguishing-predictions .p075-answer-note {
  margin-top: 12px;
}
#p075-distinguishing-predictions .p075-history {
  padding-top: 12px;
}

/* Container-based reflow protects a narrow desktop reader column as well. */
@container (max-width: 740px) {
  #p004-01 .lu4-stage {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  #hma-p041-03 .hma-spacing-procedure {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  #hma-p041-03 .hma-spacing-procedure :is(.hma-study-gap, .hma-retention-gap) {
    justify-content: flex-start;
    border-bottom: 0;
    border-left: 2px solid #3454ff;
    padding: 4px 12px;
    margin-left: 12px;
  }
  #hma-p041-03 .hma-spacing-procedure .hma-retention-gap {
    border-left-color: #797a74;
  }
  #p075-distinguishing-predictions .dv7-rule-candidates {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  :is(#p004-01, #p075-distinguishing-predictions) .lu4-workspace {
    padding: 16px;
  }
  #p004-01 .lu4-stage {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  #p004-01 .p004-v4-calendar > table :is(th, td) {
    padding: 10px 6px;
  }
  #p004-01 .p004-v4-calendar > table th:first-child {
    width: auto;
  }
  #hma-p041-03 .hma-spacing-procedure {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 12px;
  }
  #hma-p041-03 .hma-spacing-procedure :is(.hma-study-gap, .hma-retention-gap) {
    justify-content: flex-start;
    border-bottom: 0;
    border-left: 2px solid #3454ff;
    padding: 4px 12px;
    margin-left: 12px;
  }
  #hma-p041-03 .hma-spacing-procedure .hma-retention-gap {
    border-left-color: #797a74;
  }
  #hma-p041-03 .hma-condition-lattice table,
  #hma-p041-03 .hma-condition-lattice :is(thead, tbody) {
    display: block;
    width: 100%;
  }
  #hma-p041-03 .hma-condition-lattice caption {
    display: block;
  }
  #hma-p041-03 .hma-condition-lattice tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #hma-p041-03 .hma-condition-lattice :is(th, td) {
    display: block;
    width: auto;
    padding: 12px;
    word-break: keep-all;
    overflow-wrap: anywhere;
  }
  #hma-p041-03 .hma-condition-lattice th:first-child {
    grid-column: 1 / -1;
    width: auto;
  }
  #p075-distinguishing-predictions .dv7-rule-candidates {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
}

@media (max-width: 480px) {
  #p004-01 .p004-v4-calendar > table :is(th, td) {
    padding: 0;
  }
  #p004-01 .p004-v4-calendar > table tr {
    padding: 12px;
  }
  #p004-01 .p004-v4-calendar > table th:first-child {
    padding-left: 0;
  }
  #p004-01 .p004-v4-counts > span {
    padding: 12px;
  }
}

@media (max-width: 360px) {
  #p075-distinguishing-predictions .lu4-workspace {
    padding-inline: 12px;
  }
  #p075-distinguishing-predictions .lu4-stage {
    gap: 16px 8px;
  }
}

@media print {
  #p004-01 .lu4-stage {
    display: block;
  }
  #hma-p041-03 .hma-spacing-procedure,
  #p075-distinguishing-predictions .dv7-rule-candidates {
    break-inside: avoid;
  }
}
