.study-profile {
  --profile-page: light-dark(#f5f5f5, #191919);
  --profile-surface: light-dark(#ffffff, #242424);
  --profile-ink: light-dark(#202020, #f2f2f2);
  --profile-muted: light-dark(#565656, #bcbcbc);
  --profile-line: light-dark(#d8d8d8, #535353);
  --profile-focus: light-dark(#484848, #cccccc);
  --profile-button: light-dark(#242424, #dedede);
  --profile-button-text: light-dark(#ffffff, #222222);
  width: min(100%, 32rem);
  box-sizing: border-box;
  margin-block: 0 1.25rem;
  color: var(--profile-ink);
  border: 1px solid var(--profile-line);
  border-radius: .65rem;
  background: var(--profile-surface);
}

.study-profile [hidden] { display: none !important; }

.study-profile summary {
  cursor: pointer;
  padding: .65rem .85rem;
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.study-profile-current, .study-profile-edit {
  margin-inline-start: .35rem;
  color: var(--profile-muted);
  font-size: .9rem;
  font-weight: 500;
}
.study-profile-edit { text-decoration: underline; text-underline-offset: .16em; }

.study-profile-form { display: grid; gap: .5rem; margin: 0 .85rem .8rem; }

.study-profile-form label { font-weight: 700; }

.study-profile-form input {
  box-sizing: border-box;
  width: 100%;
  min-height: 2.75rem;
  padding: .6rem .75rem;
  font: inherit;
  color: var(--profile-ink);
  border: 1px solid var(--profile-line);
  border-radius: .5rem;
  background: var(--profile-page);
}

.study-profile-form input::placeholder { color: var(--profile-muted); opacity: 1; }

.study-profile-actions { display: flex; flex-wrap: wrap; gap: .45rem; }

.study-profile-actions button {
  min-height: 2.75rem;
  font: inherit;
  font-weight: 670;
  padding: .55rem .8rem;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: .5rem;
  color: var(--profile-button-text);
  background: var(--profile-button);
}

.study-profile-actions .study-profile-switch {
  color: var(--profile-ink);
  border-color: var(--profile-line);
  background: transparent;
}

.study-profile-actions button:hover:not(:disabled) { border-color: var(--profile-focus); }
.study-profile-actions button:disabled { cursor: wait; opacity: .65; }
.study-profile :focus-visible { outline: 2px solid var(--profile-focus); outline-offset: .16rem; }

.study-profile p {
  margin: 0;
  color: var(--profile-muted);
  font-size: .9rem;
}

.study-profile > .study-profile-status { margin: 0 .85rem .7rem; }
.study-profile-status:empty { display: none; }
