/* Energy page, using the Dashboard's active palette and panel rhythm. */
.robot-energy-page {
  --energy-gap: clamp(14px, 2vw, 22px);
  --energy-pad: clamp(14px, 2.3vw, 24px);
  --energy-accent: var(--accent, #ffdb1a);
  display: grid;
  gap: var(--energy-gap);
  min-width: 0;
}
.robot-energy-page > .panel {
  min-width: 0;
  padding: var(--energy-pad);
  margin: 0;
}
.robot-energy-page h2 {
  font-size: 1.2rem;
  line-height: 1.35;
  margin: 0;
}
.robot-energy-page p { line-height: 1.55; }
.robot-energy-heading h1 {
  margin: 0 0 4px;
  font-size: clamp(1.48rem, 3vw, 2.15rem);
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.robot-energy-heading p { margin: 0; color: var(--muted); }
.robot-energy-files > p { margin: 5px 0 0; }
.robot-energy-practices {
  display: grid;
  align-items: start;
  gap: var(--energy-gap);
  margin-top: 14px;
}
.robot-energy-practices:has(> form:not([hidden])) {
  grid-template-columns: minmax(0, 1.5fr) minmax(250px, 1fr);
}
.robot-energy-library, .robot-energy-files form, .robot-energy-analysis-heading > div { min-width: 0; }
.robot-energy-files p, .robot-energy-file-meta, .robot-energy-analysis [data-energy-selected] { overflow-wrap: anywhere; }
.robot-energy-files form {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: var(--soft, #232329);
}
.robot-energy-files form h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}
.robot-energy-files label {
  display: block;
  margin-bottom: 4px;
  font-size: .86rem;
  font-weight: 650;
}
.robot-energy-files #energy-name, .robot-energy-files #energy-csv {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.robot-energy-files #energy-name-help, .robot-energy-files #energy-limit { margin: 4px 0; font-size: .83rem; }
.robot-energy-files #energy-name-help { margin-bottom: 12px; }
.robot-energy-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.robot-energy-upload-actions { justify-content: space-between; margin-top: 8px; }
.robot-energy-rows {
  display: grid;
  list-style: none;
  gap: 7px;
  margin: 0;
  padding: 0;
}
.robot-energy-practices:not(:has(> form:not([hidden]))) .robot-energy-rows {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}
.robot-energy-rows li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft, #232329);
}
.robot-energy-file-select {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: inherit;
  background: transparent;
  cursor: pointer;
  text-align: start;
  white-space: normal;
}
.robot-energy-file-select:hover { border-color: var(--line); }
.robot-energy-file-select[aria-pressed=true] {
  border-color: var(--energy-accent);
  background: color-mix(in srgb, var(--energy-accent) 7%, transparent);
}
.robot-energy-file-select:focus-visible, .robot-energy-analyzer:focus-visible {
  outline: 2px solid var(--energy-accent);
  outline-offset: 3px;
}
.robot-energy-file-select:disabled { cursor: wait; opacity: .65; }
.robot-energy-file-dot { color: var(--energy-accent); flex: none; line-height: 1.3; }
.robot-energy-file-meta { min-width: 0; line-height: 1.4; }
.robot-energy-file-meta strong, .robot-energy-file-meta small, .robot-energy-file-action { display: block; }
.robot-energy-file-meta strong { font-size: .93rem; }
.robot-energy-file-meta small { margin-top: 3px; font-size: .78rem; }
.robot-energy-file-action { margin-top: 3px; color: var(--energy-accent); font-size: .8rem; }
.robot-energy-pager { margin-top: 12px; }
.robot-energy-library > p { margin: 0 0 8px; }
.robot-energy-files [data-energy-status]:empty { display: none; }
.robot-energy-files [data-energy-retry] { margin-bottom: 8px; }
.robot-energy-analysis, .robot-energy-analyzer { min-width: 0; }
.robot-energy-analysis-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 10px;
}
.robot-energy-analysis [data-energy-selected] { margin: 2px 0 0; }
.robot-energy-analysis [data-energy-analyzer-retry] { margin-bottom: 10px; }
.robot-energy-analyzer { border-radius: 12px; color-scheme: dark; }
.robot-energy-analyzer[aria-busy=true]:empty { min-height: 84px; background: var(--surface, #1b1b1f); }
.robot-energy-intro { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--energy-gap); }
.robot-energy-intro ol { padding-inline-start: 24px; }
.robot-energy-intro li + li { margin-top: 6px; }
.robot-energy-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.robot-energy-links .button { max-width: 100%; text-align: center; white-space: normal; }
@media (max-width: 820px) {
  .robot-energy-practices:has(> form:not([hidden])), .robot-energy-intro { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 500px) {
  .robot-energy-rows li { grid-template-columns: minmax(0, 1fr); }
  .robot-energy-rows .robot-energy-controls { padding-inline: 8px; }
  .robot-energy-rows .button { min-height: 40px; }
  .robot-energy-links { display: grid; grid-template-columns: minmax(0,1fr); }
}
