.pe-heading { align-items: start; }
.pe-mode {
  flex: 0 0 auto;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--slate);
  font-size: .875rem;
  font-weight: 700;
}

.pe-settings, .pe-draft {
  min-width: 0;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 13px;
}
.pe-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.pe-settings fieldset {
  min-width: 0;
  margin: 0;
  padding: 18px 22px 22px;
  border: 0;
}
.pe-settings legend {
  float: left;
  width: 100%;
  padding: 0;
  margin: 0 0 12px;
  font-size: 1.125rem;
  font-weight: 780;
}
.pe-settings legend + * { clear: both; }
.pe-settings .pe-profile { border-right: 1px solid var(--line); }
.pe-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 12px; }
.pe-field-wide { grid-column: 1 / -1; }
.pe-profile-note { color: var(--slate); font-size: .8125rem; }
.pe-priorities { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 12px; }
.pe-field {
  display: grid;
  align-content: start;
  min-width: 0;
  gap: 4px;
  font-size: .875rem;
  font-weight: 700;
}
.pe-field input, .pe-field select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  font-size: 1rem;
  font-weight: 500;
}
.pe-field input {
  padding: 7px 11px;
  border: 1px solid #aebaca;
  border-radius: 8px;
  background: var(--white);
}
.pe-field select { text-overflow: ellipsis; }
.pe-field input:user-invalid { border-color: var(--accent-deep); }
.pe-target {
  padding: 14px 22px 16px;
  border-top: 1px solid var(--line);
}
.pe-target .pe-field { max-width: 22rem; }
.pe-setting-actions, .pe-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
}
.pe-setting-actions p { color: var(--slate); font-size: .875rem; }

.pe-button, .pe-day {
  min-height: 44px;
  padding: 7px 12px;
  border: 1px solid #aebaca;
  border-radius: 7px;
  background: var(--white);
  text-align: center;
  font-weight: 730;
}
.pe-button:disabled { opacity: .48; cursor: default; }
.pe-button:enabled:hover, .pe-day:hover { border-color: var(--night); }
.pe-button.pe-generate, .pe-day[aria-pressed=true] {
  background: var(--night);
  border-color: var(--night);
  color: var(--white);
}
.pe-button.pe-generate:hover { background: #26344a; }
.pe-button.pe-save {
  min-width: 128px;
  background: var(--accent);
  border-color: #a4523c;
  color: var(--ink);
}
.pe-button.pe-save:hover { background: #ffad92; }
.pe-button.pe-reset, .pe-button.pe-remove { color: var(--accent-deep); }

.pe-draft { margin-top: 16px; }
.pe-guidance {
  margin: 0 22px 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  font-size: .9375rem;
}
.pe-guidance h4 { margin: 0 0 4px; }
.pe-guidance p { margin: 4px 0; }
.pe-guidance details { margin-top: 5px; }
.pe-guidance summary {
  display: list-item;
  align-content: center;
  min-height: 44px;
  font-weight: 700;
  cursor: pointer;
}
.pe-guidance ul { margin: 4px 0 6px; padding-inline-start: 20px; }
.pe-guidance li + li { margin-top: 4px; }
.pe-guidance a { color: var(--accent-deep); text-decoration: underline; }
.pe-draft-heading, .pe-day-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 14px;
}
.pe-draft-heading {
  margin: 0 22px;
  padding: 17px 0 12px;
}
.pe-draft-count, .pe-day-header span {
  flex: 0 0 auto;
  color: var(--slate);
  font-size: .875rem;
}
.pe-days {
  display: flex;
  gap: 8px;
  padding: 0 22px 13px;
}
.pe-day {
  flex: 1 1 0;
  min-width: 0;
  padding-inline: 4px;
  text-align: center;
}
.pe-day strong, .pe-day small { display: block; }
.pe-day small { font-size: .8125rem; color: var(--slate); font-weight: 600; }
.pe-day[aria-pressed=true] small { color: #dbe3ed; }
.pe-day-content { padding: 0 22px 15px; }
.pe-day-header { padding: 8px 0; }
.pe-day-header h4, .pe-empty { margin: 0; }
.pe-empty { padding-block: 8px; color: var(--slate); }
.pe-moves { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.pe-move { min-width: 0; border-bottom: 1px solid var(--line); }
.pe-move-summary {
  display: flex;
  width: 100%;
  min-height: 53px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  text-align: left;
}
.pe-move-summary:hover, .pe-move-summary[aria-expanded=true] { background: var(--paper); }
.pe-move-summary strong, .pe-dose { display: block; }
.pe-dose { color: var(--slate); font-size: .875rem; overflow-wrap: anywhere; }
.pe-adjust { color: var(--accent-deep); font-size: .875rem; font-weight: 760; white-space: nowrap; }
.pe-move-editor, .pe-add {
  display: grid;
  gap: 10px;
  padding: 11px 8px;
}
.pe-chooser, .pe-dose-fields {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(84px, .65fr) minmax(0, 1.75fr);
}
.pe-dose-fields { grid-template-columns: minmax(56px, .55fr) minmax(0, 1.65fr) minmax(0, 1fr); }
.pe-move-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pe-move-tools .pe-remove { margin-inline-start: auto; }
.pe-add { padding-bottom: 0; }
.pe-add-limit { color: var(--slate); font-size: .875rem; }
.pe-add-button { justify-self: start; }
.pe-feedback, .pe-error {
  margin: 0 22px 12px;
  padding: 8px 11px;
  border-radius: 6px;
  background: #e9f4ee;
  color: #234c35;
  font-size: .9375rem;
  font-weight: 650;
}
.pe-error { background: #fff0eb; color: #8c3421; }
.pe-feedback:empty, .pe-error:empty { display: none; }

@media (max-width: 620px) {
  .pe-heading { flex-direction: column; gap: 8px; }
  .pe-settings-grid { grid-template-columns: minmax(0, 1fr); }
  .pe-settings fieldset { padding: 14px 14px 16px; }
  .pe-settings .pe-profile { border-right: 0; }
  .pe-settings .pe-preferences { border-top: 1px solid var(--line); }
  .pe-target, .pe-setting-actions, .pe-footer { padding-inline: 14px; }
  .pe-draft-heading, .pe-guidance, .pe-feedback, .pe-error { margin-inline: 14px; }
  .pe-days, .pe-day-content { padding-inline: 14px; }
  .pe-move-editor, .pe-add { padding-inline: 2px; }
}

@media (max-width: 360px) {
  .pe-dose-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
  .pe-dose-fields .pe-field:last-child { grid-column: 1 / -1; }
  .pe-day { font-size: .875rem; }
}
